Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Unified Diff: third_party/sqlite/src/test/index7.test

Issue 1610963002: Import SQLite 3.10.2. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/sqlite/src/test/index6.test ('k') | third_party/sqlite/src/test/indexedby.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « third_party/sqlite/src/test/index6.test ('k') | third_party/sqlite/src/test/indexedby.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698