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

Can't find record in table on multi-table update with ORDER BY

Details

    • 10.3.6-1

    Description

      --source include/have_partition.inc
       
      CREATE TABLE t1 (i INT) ENGINE=MyISAM;
      INSERT IGNORE INTO t1 VALUES (1),(2);
       
      CREATE TABLE t2 (f INT) ENGINE=MyISAM 
      PARTITION BY RANGE(f) (
        PARTITION p1 VALUES LESS THAN (128),
        PARTITION p2 VALUES LESS THAN MAXVALUE
      );
      REPLACE INTO t2 VALUES (1),(2);
       
      UPDATE t1, t2 SET f = 126 ORDER BY f LIMIT 2;
       
      # Cleanup
      DROP TABLE t1, t2;
      

      MariaDB [test]> UPDATE t1, t2 SET f = 126 ORDER BY f LIMIT 2;
      ERROR 1032 (HY000): Can't find record in 't2'
      

      Attachments

        Issue Links

          Activity

            elenst Elena Stepanova added a comment - - edited

            Also, while the test case from the description is not applicable to previous versions (because of the ORDER BY in UPDATE), this one with views instead of a direct multi-update is, and it appears to show a regression:

            --source include/have_partition.inc
             
            CREATE TABLE t1 (i INT);
            INSERT IGNORE INTO t1 VALUES (1),(2);
             
            CREATE TABLE t2 (f INT) 
            PARTITION BY RANGE(f) (
              PARTITION p1 VALUES LESS THAN (128),
              PARTITION p2 VALUES LESS THAN MAXVALUE
            );
             
            CREATE VIEW v AS SELECT f FROM t1, t2;
            REPLACE INTO t2 VALUES (1),(2);
             
            UPDATE v SET f = 126 ORDER BY f LIMIT 2;
             
            # Cleanup
            DROP VIEW v;
            DROP TABLE t1, t2;
            

            It passes on 10.2, but causes the same ER_KEY_NOT_FOUND on 10.3.

            elenst Elena Stepanova added a comment - - edited Also, while the test case from the description is not applicable to previous versions (because of the ORDER BY in UPDATE ), this one with views instead of a direct multi-update is, and it appears to show a regression: --source include/have_partition.inc   CREATE TABLE t1 (i INT ); INSERT IGNORE INTO t1 VALUES (1),(2);   CREATE TABLE t2 (f INT ) PARTITION BY RANGE(f) ( PARTITION p1 VALUES LESS THAN (128), PARTITION p2 VALUES LESS THAN MAXVALUE );   CREATE VIEW v AS SELECT f FROM t1, t2; REPLACE INTO t2 VALUES (1),(2);   UPDATE v SET f = 126 ORDER BY f LIMIT 2;   # Cleanup DROP VIEW v; DROP TABLE t1, t2; It passes on 10.2, but causes the same ER_KEY_NOT_FOUND on 10.3.

            I assume the ball is on Serg's side until the failing example is fixed.

            psergei Sergei Petrunia added a comment - I assume the ball is on Serg's side until the failing example is fixed.

            People

              serg Sergei Golubchik
              elenst Elena Stepanova
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.