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

Cascade foreign key updates do not apply in online alter

    XMLWordPrintable

Details

    Description

      --source include/have_debug_sync.inc
      --source include/have_innodb.inc
       
      create table t1 (a int primary key) engine=InnoDB;
      insert into t1 values (1),(2),(3);
      create table t2 (b int, foreign key (b) references t1 (a) on update cascade) engine=InnoDB;
      insert into t2 values (1),(2),(3);
      --send
        set debug_sync= 'now wait_for downgraded';
       
      --connect (con_alter,localhost,root,,test)
      set debug_sync= 'alter_table_online_downgraded signal downgraded wait_for goforit';
      --send
        alter table t2 add c int, algorithm=copy, lock=none;
       
      --connection default
      --reap
      update t1 set a = 22 where a = 2;
      set debug_sync= 'now signal goforit';
       
      --connection con_alter
      --reap
      select * from t2;
       
      # Cleanup
      drop table t2, t1;
      set debug_sync= reset;
      

      bb-10.10-MDEV-16329 49ad87590

      connection default;
      update t1 set a = 22 where a = 2;
      set debug_sync= 'now signal goforit';
      connection con_alter;
      select * from t2;
      b	c
      1	NULL
      2	NULL
      3	NULL
      

      Expected 22 instead of 2, via update cascade. 2 is now an orphan row.

      Attachments

        Issue Links

          Activity

            People

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