1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Fix foreign key CASCADE for cases where the parent key is an INTEGER PRIMARY

KEY and the parent table contains other columns named "rowid", "_rowid_",
and "oid".

FossilOrigin-Name: ed3cbaab6ad49b0cb5b17e44def26c866919387a
This commit is contained in:
drh
2015-04-10 12:04:57 +00:00
parent 75395ccd17
commit e918aaba98
4 changed files with 13 additions and 12 deletions

View File

@ -746,10 +746,10 @@ do_test fkey2-10.2.2 {
drop_all_tables
do_test fkey2-11.1.1 {
execsql {
CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
CREATE TABLE t1(a INTEGER PRIMARY KEY, b, rowid, _rowid_, oid);
CREATE TABLE t2(c, d, FOREIGN KEY(c) REFERENCES t1(a) ON UPDATE CASCADE);
INSERT INTO t1 VALUES(10, 100);
INSERT INTO t1 VALUES(10, 100, 'abc', 'def', 'ghi');
INSERT INTO t2 VALUES(10, 100);
UPDATE t1 SET a = 15;
SELECT * FROM t2;