summaryrefslogtreecommitdiffstats
path: root/test/returning1.test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-16 17:30:16 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-16 17:30:16 +0000
commitb74486be0ae6240834852c4a9d5f8ea3a1c92fff (patch)
treec5f6bc5aefed5712f27c84dbc55609f90fdd269b /test/returning1.test
parentReleasing progress-linux version 3.45.2-1~progress7.99u1. (diff)
downloadsqlite3-b74486be0ae6240834852c4a9d5f8ea3a1c92fff.tar.xz
sqlite3-b74486be0ae6240834852c4a9d5f8ea3a1c92fff.zip
Merging upstream version 3.45.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/returning1.test')
-rw-r--r--test/returning1.test43
1 files changed, 32 insertions, 11 deletions
diff --git a/test/returning1.test b/test/returning1.test
index 6c098dc..2403249 100644
--- a/test/returning1.test
+++ b/test/returning1.test
@@ -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.