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

Failure at second executon of PS for query using stored function

    XMLWordPrintable

Details

    Description

      The following test case fails if the server is built with -DWITH_PROTECT_STATEMENT_MEMROOT:BOOL=ON

      CREATE TABLE t1 (a INT,b INT);
      INSERT INTO t1 VALUES (10,1),(20,2),(30,3),(40,4);
      CREATE VIEW v1 AS
      SELECT a,1 as b FROM t1 WHERE a>(SELECT AVG(a) FROM t1 t) AND b>(SELECT 1);
      DELIMITER |;
      CREATE FUNCTION f1() RETURNS INT
      BEGIN
        DECLARE a TYPE OF v1.a DEFAULT 10;
        RETURN a+1;
      END;
      |
      DELIMITER ;|
      PREPARE stmt FROM "SELECT f1();";
      EXECUTE stmt;
      EXECUTE stmt;
      DEALLOCATE PREPARE stmt;
      DROP FUNCTION f1;
      DROP VIEW v1;
      DROP TABLE t1;
      

      Attachments

        Issue Links

          Activity

            People

              shulga Dmitry Shulga
              igor Igor Babaev
              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.