summaryrefslogtreecommitdiffstats
path: root/test/tkt-4ef7e3cfca.test
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 14:07:11 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-13 14:07:11 +0000
commit63847496f14c813a5d80efd5b7de0f1294ffe1e3 (patch)
tree01c7571c7c762ceee70638549a99834fdd7c411b /test/tkt-4ef7e3cfca.test
parentInitial commit. (diff)
downloadsqlite3-63847496f14c813a5d80efd5b7de0f1294ffe1e3.tar.xz
sqlite3-63847496f14c813a5d80efd5b7de0f1294ffe1e3.zip
Adding upstream version 3.45.1.upstream/3.45.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/tkt-4ef7e3cfca.test')
-rw-r--r--test/tkt-4ef7e3cfca.test68
1 files changed, 68 insertions, 0 deletions
diff --git a/test/tkt-4ef7e3cfca.test b/test/tkt-4ef7e3cfca.test
new file mode 100644
index 0000000..fc1efde
--- /dev/null
+++ b/test/tkt-4ef7e3cfca.test
@@ -0,0 +1,68 @@
+# 2014-03-04
+#
+# The author disclaims copyright to this source code. In place of
+# a legal notice, here is a blessing:
+#
+# May you do good and not evil.
+# May you find forgiveness for yourself and forgive others.
+# May you share freely, never taking more than you give.
+#
+#***********************************************************************
+#
+# This file implements tests to verify that ticket [4ef7e3cfca] has been
+# fixed.
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+set testprefix tkt-4ef7e3cfca
+
+do_catchsql_test 1.1 {
+ CREATE TABLE x(a);
+ CREATE TRIGGER t AFTER INSERT ON x BEGIN
+ SELECT * FROM x WHERE abc.a = 1;
+ END;
+ INSERT INTO x VALUES('assert');
+} {1 {no such column: abc.a}}
+
+reset_db
+do_execsql_test 2.1 {
+ CREATE TABLE w(a);
+ CREATE TABLE x(a);
+ CREATE TABLE y(a);
+ CREATE TABLE z(a);
+
+ INSERT INTO x(a) VALUES(5);
+ INSERT INTO y(a) VALUES(10);
+
+ CREATE TRIGGER t AFTER INSERT ON w BEGIN
+ INSERT INTO z
+ SELECT (SELECT x.a + y.a FROM y) FROM x;
+ END;
+ INSERT INTO w VALUES('incorrect');
+}
+do_execsql_test 2.2 {
+ SELECT * FROM z;
+} {15}
+
+reset_db
+do_execsql_test 3.1 {
+ CREATE TABLE w(a);
+ CREATE TABLE x(b);
+ CREATE TABLE y(a);
+ CREATE TABLE z(a);
+
+ INSERT INTO x(b) VALUES(5);
+ INSERT INTO y(a) VALUES(10);
+
+ CREATE TRIGGER t AFTER INSERT ON w BEGIN
+ INSERT INTO z
+ SELECT (SELECT x.b + y.a FROM y) FROM x;
+ END;
+ INSERT INTO w VALUES('assert');
+}
+do_execsql_test 3.2 {
+ SELECT * FROM z;
+} {15}
+
+finish_test