Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-36481

Abnormal server termination on second execution of stored routine that runs a cursor after table metadata in the query was changed

    XMLWordPrintable

Details

    • Can result in hang or crash
    • Q3/2026 Server Maintenance

    Description

      The following test case breaks the server.
      The test is borrowed from comments to the task MDEV-36114

      CREATE TABLE t (a INT);
       
      --delimiter $
      CREATE PROCEDURE p() 
      BEGIN 
      	DECLARE cur CURSOR FOR SELECT * FROM t;
      	BEGIN 
      		DECLARE rec ROW(a INT,b INT) DEFAULT ROW(0,0);
      		DECLARE rec2 ROW TYPE OF cur DEFAULT rec;
      	END;
      END
      $
       
      --delimiter ;
      --ERROR ER_OPERAND_COLUMNS
      CALL p();
      CREATE OR REPLACE TABLE t (a INT);
      CALL p();
      
      

      Attachments

        Issue Links

          Activity

            People

              sanja Oleksandr Byelkin
              shulga Dmitry Shulga
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 9d 29m
                  9d 29m
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 3d 7h 5m Time Not Required
                  3d 7h 5m

                  Git Integration

                    Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.