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

SELECT from table with vcol index reports warning

    XMLWordPrintable

Details

    Description

      With the following patch applied,

      diff --git a/sql/sql_insert.cc b/sql/sql_insert.cc
      --- a/sql/sql_insert.cc
      +++ b/sql/sql_insert.cc
      @@ -1132,6 +1132,8 @@
             error= write_record(thd, table, &info, result);
             if (unlikely(error))
               break;
      +
      +      DEBUG_SYNC(thd, "after_write_record");
             info.accepted_rows++;
           }
           its.rewind();
      

      the following test outputs warning in SELECT:

      # Run with --innodb-page-size=4K
       
      --source include/have_debug_sync.inc
      --source include/have_innodb.inc
      --source include/have_sequence.inc
      --connect (con2, localhost, root,,)
      --connection default
      set default_storage_engine= innodb;
       
      CREATE TABLE t1(fld1 INT NOT NULL PRIMARY KEY);
      CREATE TABLE t2(fld1 INT NOT NULL,
                      fld2 INT AS (100/fld1) VIRTUAL,
                      KEY(fld2),
                      FOREIGN KEY(fld1) REFERENCES t1(fld1)
                        ON UPDATE CASCADE);
      INSERT INTO t1 SELECT * from seq_1_to_1025; # Fill enough to make a new block
      INSERT INTO t2 VALUES(1, DEFAULT), (2, default);
      --connection con2
      set debug_sync = "after_write_record signal go wait_for finish";
      send INSERT INTO t1 VALUES(10000);
      --connection default
      #--error ER_DIVISION_BY_ZERO
      set debug_sync = "now wait_for go";
      UPDATE IGNORE t1 SET fld1= 0 WHERE fld1= 2;
      SELECT fld2 FROM t2;
       
      set debug_sync = "now signal finish";
      DROP TABLE t2, t1;
       
      set debug_sync= reset;
      --connection default
      

      This affects gcol.innodb_virtual_fk making it nondeterministically output ER_DIVISION_BY_ZERO warning

      Attachments

        Issue Links

          Activity

            People

              nikitamalyavin Nikita Malyavin
              nikitamalyavin Nikita Malyavin
              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.