Index: third_party/sqlite/src/test/index7.test |
diff --git a/third_party/sqlite/src/test/index7.test b/third_party/sqlite/src/test/index7.test |
index 0f341a3129f84c523fef6cf9f70e1e415d8d7a00..557fe21324d4a07db427c8b16755dbb010dc6448 100644 |
--- a/third_party/sqlite/src/test/index7.test |
+++ b/third_party/sqlite/src/test/index7.test |
@@ -21,6 +21,31 @@ ifcapable !vtab { |
return |
} |
+# Capture the output of a pragma in a TEMP table. |
+# |
+proc capture_pragma {db tabname sql} { |
+ $db eval "DROP TABLE IF EXISTS temp.$tabname" |
+ set once 1 |
+ $db eval $sql x { |
+ if {$once} { |
+ set once 0 |
+ set ins "INSERT INTO $tabname VALUES" |
+ set crtab "CREATE TEMP TABLE $tabname " |
+ set sep "(" |
+ foreach col $x(*) { |
+ append ins ${sep}\$x($col) |
+ append crtab ${sep}\"$col\" |
+ set sep , |
+ } |
+ append ins ) |
+ append crtab ) |
+ $db eval $crtab |
+ } |
+ $db eval $ins |
+ } |
+} |
+ |
+ |
load_static_extension db wholenumber; |
do_test index7-1.1 { |
# Able to parse and manage partial indices |
@@ -37,6 +62,15 @@ do_test index7-1.1 { |
} |
} {14 20 ok} |
+# (The "partial" column of the PRAGMA index_list output is...) |
+# EVIDENCE-OF: R-34457-09668 "1" if the index is a partial index and "0" |
+# if not. |
+# |
+do_test index7-1.1a { |
+ capture_pragma db out {PRAGMA index_list(t1)} |
+ db eval {SELECT "name", "partial", '|' FROM out ORDER BY "name"} |
+} {sqlite_autoindex_t1_1 0 | t1a 1 | t1b 1 |} |
+ |
# Make sure the count(*) optimization works correctly with |
# partial indices. Ticket [a5c8ed66cae16243be6] 2013-10-03. |
# |
@@ -277,5 +311,9 @@ do_eqp_test index7-6.4 { |
} { |
0 0 0 {SEARCH TABLE t4 USING INDEX i4 (c=?)} |
} |
+do_catchsql_test index7-6.5 { |
+ CREATE INDEX t5a ON t5(a) WHERE a=#1; |
+} {1 {near "#1": syntax error}} |
+ |
finish_test |