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

Prepared insert statement doesn't insert rows

    XMLWordPrintable

Details

    • Bug
    • Status: Stalled (View Workflow)
    • Critical
    • Resolution: Unresolved
    • 10.5
    • 10.5
    • None

    Description

      10.5 ha introduced a bug in derived_view.test (10.4 is correct)

      From the result file:

      #
      # LP BUG#968720 crash due to converting to materialized and
      # natural join made only once
      #
      SET @save968720_optimizer_switch=@@optimizer_switch;
      SET optimizer_switch = 'derived_merge=on';
      CREATE TABLE t1 (a int, INDEX(a));
      INSERT INTO t1 VALUES (1);
      CREATE TABLE t2 (a int, INDEX(a));
      INSERT INTO t2 VALUES (1), (2);
      INSERT INTO t1 SELECT a FROM (SELECT a FROM test.t1) AS s1 NATURAL JOIN
      t2 AS s2;
      SELECT * FROM t1;
      a
      1
      1
      DELETE FROM t1;
      INSERT INTO t1 VALUES (1);
      PREPARE stmt FROM "
      INSERT INTO t1 SELECT a FROM (SELECT a FROM test.t1) AS s1 NATURAL JOIN
      t2 AS s2;
      ";
      EXECUTE stmt;
      SELECT * FROM t1;
      a
      1
      1
      EXECUTE stmt;
      SELECT * FROM t1;
      a
      1
      1
      drop table t1,t2;
      

      The last SELECT query should return 4 '1' rows. Somehow the last insert statement didn't insert any rows.

      I marked this as Critical as this is a regression

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            monty Michael Widenius
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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