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

Online log for virtual index doesn't compute virtual column value

    XMLWordPrintable

Details

    Description

      InnoDB concurrent DML doesn't compute virtual column value during index build DDL. It leads to insertion of NULL value.

      --source include/have_innodb.inc
      --source include/have_debug.inc
       
      create table t1(f1 int not null, f2 int not null,
                      f3 int as (f2) virtual, index(f1),
                      index(f2))engine=innodb;
      insert into t1(f1, f2) values(1, 2);
      set DEBUG_SYNC="innodb_inplace_alter_table_enter SIGNAL dml_start WAIT_FOR dml_finish";
      send alter table t1 add index(f3), algorithm=inplace;
      connect(con1,localhost,root,,,);
      set DEBUG_SYNC="now WAIT_FOR dml_start";
      BEGIN;
      INSERT INTO t1(f1, f2) VALUES(3, 4);
      UPDATE t1 SET f2= 5 WHERE f2= 4;
      COMMIT;
      set DEBUG_SYNC="now SIGNAL dml_finish";
      disconnect con1;
      connection default;
      reap;
       
      check table t1;
      drop table t1;
       
      select f3 from t1 use index(f3);
      drop table t1;
      set debug_sync=reset;
      

      10.7 e67d46e4a16a6550734dbff8d1a28c578ab3b23d

      check table t1;
      Table	Op	Msg_type	Msg_text
      test.t1	check	Warning	InnoDB: Index 'f3' contains 3 entries, should be 2.
      test.t1	check	error	Corrupt
      drop table t1;
      set debug_sync=reset;
      

      Server fails to send the value of virtual column for the secondary index tuple when index is being created.

      Attachments

        Activity

          People

            nikitamalyavin Nikita Malyavin
            thiru Thirunarayanan Balathandayuthapani
            Votes:
            0 Vote for this issue
            Watchers:
            1 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.