Index: third_party/sqlite/src/test/colmeta.test |
diff --git a/third_party/sqlite/src/test/colmeta.test b/third_party/sqlite/src/test/colmeta.test |
index 3939f8228acb917ffb2e383fd3d9a7b9cf88366c..21b0e0f38a59ef6de9f3f8f3f184dbd17652c647 100644 |
--- a/third_party/sqlite/src/test/colmeta.test |
+++ b/third_party/sqlite/src/test/colmeta.test |
@@ -17,17 +17,14 @@ |
set testdir [file dirname $argv0] |
source $testdir/tester.tcl |
-ifcapable !columnmetadata { |
- finish_test |
- return |
-} |
- |
# Set up a schema in the main and temp test databases. |
do_test colmeta-0 { |
execsql { |
CREATE TABLE abc(a, b, c); |
CREATE TABLE abc2(a PRIMARY KEY COLLATE NOCASE, b VARCHAR(32), c); |
CREATE TABLE abc3(a NOT NULL, b INTEGER PRIMARY KEY, c); |
+ CREATE TABLE abc5(w,x,y,z,PRIMARY KEY(x,z)) WITHOUT ROWID; |
+ CREATE TABLE abc6(rowid TEXT COLLATE rtrim, oid REAL, _rowid_ BLOB); |
} |
ifcapable autoinc { |
execsql { |
@@ -57,19 +54,27 @@ set tests { |
13 {main abc rowid} {0 {INTEGER BINARY 0 1 0}} |
14 {main abc3 rowid} {0 {INTEGER BINARY 0 1 0}} |
16 {main abc d} {1 {no such table column: abc.d}} |
+ 20 {main abc5 w} {0 {{} BINARY 0 0 0}} |
+ 21 {main abc5 x} {0 {{} BINARY 1 1 0}} |
+ 22 {main abc5 y} {0 {{} BINARY 0 0 0}} |
+ 23 {main abc5 z} {0 {{} BINARY 1 1 0}} |
+ 24 {main abc5 rowid} {1 {no such table column: abc5.rowid}} |
+ 30 {main abc6 rowid} {0 {TEXT rtrim 0 0 0}} |
+ 31 {main abc6 oid} {0 {REAL BINARY 0 0 0}} |
+ 32 {main abc6 _rowid_} {0 {BLOB BINARY 0 0 0}} |
} |
-ifcapable view { |
+ifcapable autoinc { |
set tests [concat $tests { |
- 8 {{} abc4 b} {0 {INTEGER BINARY 0 1 1}} |
- 15 {main abc4 rowid} {0 {INTEGER BINARY 0 1 1}} |
+ 100 {{} abc4 b} {0 {INTEGER BINARY 0 1 1}} |
+ 101 {main abc4 rowid} {0 {INTEGER BINARY 0 1 1}} |
}] |
} |
ifcapable view { |
set tests [concat $tests { |
- 9 {{} v1 a} {1 {no such table column: v1.a}} |
- 10 {main v1 b} {1 {no such table column: v1.b}} |
- 11 {main v1 badname} {1 {no such table column: v1.badname}} |
- 12 {main v1 rowid} {1 {no such table column: v1.rowid}} |
+ 200 {{} v1 a} {1 {no such table column: v1.a}} |
+ 201 {main v1 b} {1 {no such table column: v1.b}} |
+ 202 {main v1 badname} {1 {no such table column: v1.badname}} |
+ 203 {main v1 rowid} {1 {no such table column: v1.rowid}} |
}] |
} |
@@ -91,4 +96,15 @@ foreach {tn params results} $tests { |
} $results |
} |
+# Calling sqlite3_table_column_metadata with a NULL column name merely |
+# checks for the existance of the table. |
+# |
+do_test colmeta-300 { |
+ catch {sqlite3_table_column_metadata $::DB main xyzzy} res |
+} {1} |
+do_test colmeta-301 { |
+ catch {sqlite3_table_column_metadata $::DB main abc} res |
+} {0} |
+ |
+ |
finish_test |