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

Inconsistent behavior upon adding foreign key to RocksDB table

    XMLWordPrintable

Details

    Description

      install soname 'ha_rocksdb';
      create table t (a int) engine=RocksDB;
      --error ER_NOT_SUPPORTED_YET
      alter table t add foreign key(a) references x(x);
      alter table t drop foreign key xx, add foreign key(a) references x(x);
      

      The first ALTER fails with "not supported":

      10.4 632b1deb

      MariaDB [test]> alter table t add foreign key(a) references x(x);
      ERROR 1235 (42000): This version of MariaDB doesn't yet support 'FOREIGN KEY for the RocksDB storage engine'
      

      But the second one does not:

      MariaDB [test]> alter table t drop foreign key xx, add foreign key(a) references x(x);
      Query OK, 0 rows affected (0.342 sec)              
      Records: 0  Duplicates: 0  Warnings: 0
      

      It is not a no-op either, it adds a key to the table:

      MariaDB [test]> show create table t \G
      *************************** 1. row ***************************
             Table: t
      Create Table: CREATE TABLE `t` (
        `a` int(11) DEFAULT NULL,
        KEY `a` (`a`)
      ) ENGINE=ROCKSDB DEFAULT CHARSET=latin1
      1 row in set (0.004 sec)
      

      Attachments

        Issue Links

          Activity

            People

              psergei Sergei Petrunia
              elenst Elena Stepanova
              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.