[MDEV-22304] Inconsistent behavior upon adding foreign key to RocksDB table Created: 2020-04-19  Updated: 2023-04-27

Status: Open
Project: MariaDB Server
Component/s: Storage Engine - RocksDB
Affects Version/s: 10.2, 10.3, 10.4, 10.5
Fix Version/s: 10.4, 10.5

Type: Bug Priority: Major
Reporter: Elena Stepanova Assignee: Sergei Petrunia
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Relates
relates to MDEV-22305 Server crash or DDL mismatch in myroc... Open

 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)


Generated at Thu Feb 08 09:13:44 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.