1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Update tests to work with SQLITE_ALLOW_ROWID_IN_VIEW.

FossilOrigin-Name: 495b8c7b08b998ddfe2ad055703f058c768e7e94014952e5cd8a81c7c1515cb1
This commit is contained in:
dan
2024-03-19 15:27:15 +00:00
parent 967c303212
commit f891ef8d61
10 changed files with 140 additions and 51 deletions

View File

@ -212,17 +212,38 @@ do_execsql_test 10.2 {
END;
}
do_catchsql_test 10.3a {
INSERT INTO t1(a, b) VALUES(1234, 5678) RETURNING rowid;
} {1 {no such column: new.rowid}}
do_catchsql_test 10.3b {
UPDATE t1 SET a='z' WHERE b='y' RETURNING rowid;
} {1 {no such column: new.rowid}}
do_execsql_test 10.4 {
SELECT * FROM log;
} {}
ifcapable !allow_rowid_in_view {
do_catchsql_test 10.3a {
INSERT INTO t1(a, b) VALUES(1234, 5678) RETURNING rowid;
} {1 {no such column: new.rowid}}
do_catchsql_test 10.3b {
UPDATE t1 SET a='z' WHERE b='y' RETURNING rowid;
} {1 {no such column: new.rowid}}
do_execsql_test 10.4 {
SELECT * FROM log;
} {}
} else {
# Note: The values returned by the RETURNING clauses of the following
# two statements are the rowid columns of views. These values are not
# well defined, so the INSERT returns -1, and the UPDATE returns 1, 2
# and 3. These match the values used for new.rowid expressions, but
# not much else.
do_catchsql_test 10.3a {
INSERT INTO t1(a, b) VALUES(1234, 5678) RETURNING rowid;
} {0 -1}
do_catchsql_test 10.3b {
UPDATE t1 SET a='z' WHERE b='y' RETURNING rowid;
} {0 {1 2 3}}
do_execsql_test 10.4 {
SELECT * FROM log;
} {
insert -1 1234 5678 update 1 z y update 2 z y update 3 z y
}
}
# 2021-04-27 dbsqlfuzz 78b9400770ef8cc7d9427dfba26f4fcf46ea7dc2
# Returning clauses on TEMP tables with triggers.