我尝试在SingleStore MemSQL中创建一个具有引用表外键的表:
-- Create table
create rowstore reference table DEPT
(
deptno INT(2) not null,
dname VARCHAR(14),
loc VARCHAR(13),
constraint PK_DEPT primary key (DEPTNO)
);
create rowstore table EMP
(
empno INT(4) not null,
ename VARCHAR(10),
job VARCHAR(9),
mgr INT(4),
hiredate DATE,
sal decimal(7,2),
comm decimal(7,2),
deptno INT(2),
constraint PK_EMP primary key (EMPNO)
,constraint FK_DEPTNO foreign key (DEPTNO) references DEPT (DEPTNO)
);但这一做法失败了,原因是:
ERROR 1706 ER_MEMSQL_FEATURE_LOCKDOWN: Feature 'FOREIGN (non-SHARD) key to a sharded table' is not supported by SingleStore.消息说不可能有相反的结果(共享表的外键),但在这里,我尝试从切分表创建外键到引用表。即使不支持分布式事务,这也应该是可能的,因为它是一个单一的碎片验证。
发布于 2022-08-28 16:21:45
https://stackoverflow.com/questions/73519336
复制相似问题