summaryrefslogtreecommitdiff
path: root/test/insert.test
diff options
context:
space:
mode:
Diffstat (limited to 'test/insert.test')
-rw-r--r--test/insert.test35
1 files changed, 34 insertions, 1 deletions
diff --git a/test/insert.test b/test/insert.test
index e00b9a8..cb675b9 100644
--- a/test/insert.test
+++ b/test/insert.test
@@ -398,11 +398,44 @@ ifcapable compound {
} {1 2 3 4 5 6 7 8 9}
do_test insert-10.2 {
catchsql {
- INSERT INTO t10 VALUES(11,12,13), (14,15);
+ INSERT INTO t10 VALUES(11,12,13), (14,15), (16,17,28);
}
} {1 {all VALUES must have the same number of terms}}
}
+# Need for the OP_SoftNull opcode
+#
+do_execsql_test insert-11.1 {
+ CREATE TABLE t11a AS SELECT '123456789' AS x;
+ CREATE TABLE t11b (a INTEGER PRIMARY KEY, b, c);
+ INSERT INTO t11b SELECT x, x, x FROM t11a;
+ SELECT quote(a), quote(b), quote(c) FROM t11b;
+} {123456789 '123456789' '123456789'}
+
+
+# More columns of input than there are columns in the table.
+# Ticket http://www.sqlite.org/src/info/e9654505cfda9361
+#
+do_execsql_test insert-12.1 {
+ CREATE TABLE t12a(a,b,c,d,e,f,g);
+ INSERT INTO t12a VALUES(101,102,103,104,105,106,107);
+ CREATE TABLE t12b(x);
+ INSERT INTO t12b(x,rowid,x,x,x,x,x) SELECT * FROM t12a;
+ SELECT rowid, x FROM t12b;
+} {102 101}
+do_execsql_test insert-12.2 {
+ CREATE TABLE tab1( value INTEGER);
+ INSERT INTO tab1 (value, _rowid_) values( 11, 1);
+ INSERT INTO tab1 (value, _rowid_) SELECT 22,999;
+ SELECT * FROM tab1;
+} {11 22}
+do_execsql_test insert-12.3 {
+ CREATE TABLE t12c(a, b DEFAULT 'xyzzy', c);
+ INSERT INTO t12c(a, rowid, c) SELECT 'one', 999, 'two';
+ SELECT * FROM t12c;
+} {one xyzzy two}
+
+
integrity_check insert-99.0
finish_test