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

Delete with table name on system versioned table with cascading delete fails

    XMLWordPrintable

Details

    Description

      Version 10.3.27 on Debian tested, have not tested other platforms.

      Create two tables, both with system versioning. Table one has some random records in it. Table two has a foreign key reference to table one with a cascading delete. Create some records.

      Running a delete query of the format "DELETE table1 FROM table1" does not cascade the deletion to table2 while the query "DELETE FROM table1" does cascade as expected.

      --source include/have_innodb.inc
       
      create table t1 (
      	id tinyint unsigned not null auto_increment,
      	value char(1),
      	primary key ( id )
      ) engine=innodb with system versioning;
      create table t2 (
      	parent tinyint unsigned not null,
      	foreign key ( parent ) references t1 ( id ) on update cascade on delete cascade
      ) engine=innodb with system versioning;
       
      insert into t1 (value) values ('a'), ('b');
      insert into t2 values (1), (2);
       
      delete from t1 where id = 1;
      delete t1 from t1 where id = 2;
      select * from t1;
       
      drop tables t2, t1;
      

      Attachments

        Activity

          People

            midenok Aleksey Midenkov
            rstark@orbitform.com Ryan Stark
            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.