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

Online ALTER reports the number of affected rows incorrectly

    XMLWordPrintable

Details

    Description

      --source include/have_debug_sync.inc
       
      create table t (a int);
      insert into t values (1),(2);
      --send set debug_sync= 'now wait_for go_dml'
       
      --connect (con1,localhost,root,,)
      set debug_sync='alter_table_online_progress signal go_dml wait_for go_alter';
      --send alter table t add b int, algorithm=copy, lock=none
       
      --connection default
      --reap
      insert into t values (3);
      set debug_sync= 'now signal go_alter';
       
      --connection con1
      --enable_info
      --reap
      --disable_info
      select * from t;
       
      # Cleanup
      drop table t;
      

      bb-11.2-oalter b0484157ecd33e153e181d9ca4c055b82046ffea

      connect  con1,localhost,root,,;
      set debug_sync='alter_table_online_progress signal go_dml wait_for go_alter';
      alter table t add b int, algorithm=copy, lock=none;
      connection default;
      insert into t values (3);
      set debug_sync= 'now signal go_alter';
      connection con1;
      affected rows: 2
      info: Records: 2  Duplicates: 0  Warnings: 0
      select * from t;
      a	b
      1	NULL
      2	NULL
      3	NULL
      

      So, ALTER reports 2 affected rows (the number before DML), while it obviously affects 3.

      Attachments

        Issue Links

          Activity

            People

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