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

Memory leaks on running DELETE statement in PS mode with positional parameters

    XMLWordPrintable

Details

    Description

      Consider the following case:

      CREATE TABLE t1 (a INT, b VARCHAR(30)) CHARSET=utf8mb4;
      INSERT INTO t1 VALUES (1, 'one'), (0, NULL), (3, 'three'), (4, 'four');
      PREPARE stmt1 FROM 'DELETE FROM t1 WHERE b=?' ;
      SET @arg00=NULL;
      EXECUTE stmt1 USING @arg00; # <<=== First time the prepared statement 'stmt1' is executed
      SET @arg00='one';
      EXECUTE stmt1 USING @arg00; <<=== Second time the same prepared statement is executed results in memory leaks
      

      The essential prerequisite in the above use case is that the table t1 is created with CHARSET=utf8mb4. Without explicit clause 'CHARSET=utf8mb4' in CREATE TABLE statement, the aforementioned test case would complete with success up to 11.6 where the default characterset was changed from latin1 to utf8mb4 (commit 36eba98817339f53cc57f1d4884ace3efb38db8d)

      Attachments

        Issue Links

          Activity

            People

              shulga Dmitry Shulga
              shulga Dmitry Shulga
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0d
                  0d
                  Logged:
                  Time Spent - 4d 1h
                  4d 1h

                  Git Integration

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