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

DECLARE CURSOR: "Memory not freed: 280 bytes lost" on syntax error

    XMLWordPrintable

Details

    Description

      This test script:

      DELIMITER $$;
      --error ER_PARSE_ERROR
      BEGIN NOT ATOMIC
        DECLARE cur CURSOR (a INT) FOR SELECT a+1;
        OPEN cur(sp_followed_by_syntax_error();
        CLOSE cur;
      END;
      $$
      DELIMITER ;$$
      

      makes MTR complain about a memory leak:

      Warning: 280 bytes lost at 0x7fe82800aba0, allocated by T@0 at mysys/array.c:72, mysys/hash.c:99, sql/sp.cc:2331, sql/sp.cc:2646, sql/item_create.cc:2631, sql/item_create.cc:2477, sql/sql_yacc.yy:10752, sql/sql_parse.cc:10456
      Warning: 280 bytes lost at 0x7fe82800aba0, allocated by T@0 at mysys/array.c:72, mysys/hash.c:99, sql/sp.cc:2331, sql/sp.cc:2646, sql/item_create.cc:2631, sql/item_create.cc:2477, sql/sql_yacc.yy:10752, sql/sql_parse.cc:10456

      This is a similar problem to MDEV-30680, but the parse error happens in a different syntax context.

      The problem happens in the 10.5 tree with MDEV-30680 already pushed.

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

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