-C Revert\s"PRAGMA\sindex_info"\sto\soutput\sonly\sthree\scolumns,\sfor\scomplete\ncompatibility\swith\sprior\sversions.\s\sThe\snew\s"PRAGMA\sindex_xinfo"\scan\sbe\nused\sto\sget\sthe\sextra\sinformation\sin\s4th,\s5th,\sand\s6th\scolumns.
-D 2015-03-05T14:29:02.994
+C New\stest\scases\sand\srequirements\smarks\sfor\sPRAGMA\sindex_info,\sindex_xinfo,\nand\sindex_list.
+D 2015-03-05T15:34:15.760
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 2f643d6968dfc0b82d2e546a0525a39079f9e928
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F test/index4.test ab92e736d5946840236cd61ac3191f91a7856bf6
F test/index5.test 25b0b451aceed4ac5f7d49f856f6de7257470b3e
F test/index6.test 3ae54e53c53f2adcacda269237d8e52bdb05a481
-F test/index7.test 917cf1e1c7439bb155abbeabec511b28945e157b
+F test/index7.test 3d54dce09344c4530ea39a458aa304da044c887a
F test/indexedby.test 5f527a78bae74c61b8046ae3037f9dfb0bf0c353
F test/indexfault.test 31d4ab9a7d2f6e9616933eb079722362a883eb1d
F test/init.test 15c823093fdabbf7b531fe22cf037134d09587a7
F test/pcache2.test a83efe2dec0d392f814bfc998def1d1833942025
F test/percentile.test 4243af26b8f3f4555abe166f723715a1f74c77ff
F test/permutations.test f9cc1dd987986c9d4949211c7a4ed55ec9aecba1
-F test/pragma.test 6929a762e8b09f2f29644bc2a330c2265eb44083
+F test/pragma.test ad99d05e411c7687302124be56f3b362204be041
F test/pragma2.test f624a496a95ee878e81e59961eade66d5c00c028
F test/pragma3.test 6f849ccffeee7e496d2f2b5e74152306c0b8757c
F test/printf.test ec9870c4dce8686a37818e0bf1aba6e6a1863552
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
-P e7991bc510f63f3594603a91f6f3b32e94d90e72
-R 0612eee82e15bf764eabd621fde6a161
+P fc543c2c5ced30a7dc3a05b0c1ad80fdc838df8e
+R db9f4f2755acee2cbbb8badacd04c339
U drh
-Z b1026128d0af596b6f509b65a6cc3523
+Z 2b5470d505e73b65c2166edb9eeee198
}
db eval {SELECT seqno, cid, name FROM out ORDER BY seqno}
} {0 0 a 1 1 b}
+
+# EVIDENCE-OF: R-23114-21695 The auxiliary index-columns are not shown
+# by the index_info pragma, but they are listed by the index_xinfo
+# pragma.
+#
+do_test pragma-6.5.1b {
+ capture_pragma db out {PRAGMA index_xinfo(t3i1)}
+ db eval {SELECT seqno, cid, name FROM out ORDER BY seqno}
+} {0 0 a 1 1 b 2 -1 {}}
+
+
+# EVIDENCE-OF: R-62725-03366 PRAGMA database.index_info(index-name);
+# This pragma returns one row for each key column in the named index.
+#
+# (The first column of output from PRAGMA index_info is...)
+# EVIDENCE-OF: R-34186-52914 The rank of the column within the index. (0
+# means left-most.)
+#
+# (The second column of output from PRAGMA index_info is...)
+# EVIDENCE-OF: R-65019-08383 The rank of the column within the table
+# being indexed.
+#
+# (The third column of output from PRAGMA index_info is...)
+# EVIDENCE-OF: R-09773-34266 The name of the column being indexed.
+#
+do_execsql_test pragma-6.5.1c {
+ CREATE INDEX t3i2 ON t3(b,a);
+ PRAGMA index_info='t3i2';
+ DROP INDEX t3i2;
+} {0 1 b 1 0 a}
+
do_test pragma-6.5.2 {
execsql {
pragma index_info(t3i1_bogus);
# Miscellaneous tests
#
ifcapable schema_pragmas {
+# EVIDENCE-OF: R-63500-32024 PRAGMA database.index_list(table-name);
+# This pragma returns one row for each index associated with the given
+# table.
do_test pragma-7.1.1 {
# Make sure a pragma knows to read the schema if it needs to
db close
CREATE TABLE t1(a INTEGER PRIMARY KEY,b,c,d);
CREATE INDEX i1 ON t1(b,c);
CREATE INDEX i2 ON t1(c,d);
+ CREATE INDEX i2x ON t1(d COLLATE nocase, c DESC);
CREATE TABLE t2(x INTEGER REFERENCES t1);
}
db2 eval {SELECT name FROM sqlite_master}
-} {t1 i1 i2 t2}
+} {t1 i1 i2 i2x t2}
do_test 23.2a {
db eval {
DROP INDEX i2;
capture_pragma db2 out {PRAGMA index_info(i2)}
db2 eval {SELECT cid, name, '|' FROM out ORDER BY seqno}
} {2 c | 3 d | 1 b |}
+
+# EVIDENCE-OF: R-44874-46325 PRAGMA database.index_xinfo(index-name);
+# This pragma returns information about every column in an index.
+#
+# EVIDENCE-OF: R-45970-35618 Unlike this index_info pragma, this pragma
+# returns information about every column in the index, not just the key
+# columns.
+#
do_test 23.2b {
-breakpoint;
capture_pragma db2 out {PRAGMA index_xinfo(i2)}
db2 eval {SELECT cid, name, "desc", coll, "key", '|' FROM out ORDER BY seqno}
} {2 c 0 BINARY 1 | 3 d 0 BINARY 1 | 1 b 0 BINARY 1 | -1 {} 0 BINARY 0 |}
+
+# (The first column of output from PRAGMA index_xinfo is...)
+# EVIDENCE-OF: R-00197-14279 The rank of the column within the index. (0
+# means left-most. Key columns come before auxiliary columns.)
+#
+# (The second column of output from PRAGMA index_xinfo is...)
+# EVIDENCE-OF: R-40889-06838 The rank of the column within the table
+# being indexed, or -1 if the index-column is the rowid of the table
+# being indexed.
+#
+# (The third column of output from PRAGMA index_xinfo is...)
+# EVIDENCE-OF: R-22751-28901 The name of the column being indexed, or
+# NULL if the index-column is the rowid of the table being indexed.
+#
+# (The fourth column of output from PRAGMA index_xinfo is...)
+# EVIDENCE-OF: R-11847-09179 1 if the index-column is sorted in reverse
+# (DESC) order by the index and 0 otherwise.
+#
+# (The fifth column of output from PRAGMA index_xinfo is...)
+# EVIDENCE-OF: R-15313-19540 The name for the collating sequence used to
+# compare values in the index-column.
+#
+# (The sixth column of output from PRAGMA index_xinfo is...)
+# EVIDENCE-OF: R-14310-64553 1 if the index-column is a key column and 0
+# if the index-column is an auxiliary column.
+#
+do_test 23.2c {
+ db2 eval {PRAGMA index_xinfo(i2)}
+} {0 2 c 0 BINARY 1 1 3 d 0 BINARY 1 2 1 b 0 BINARY 1 3 -1 {} 0 BINARY 0}
+do_test 23.2d {
+ db2 eval {PRAGMA index_xinfo(i2x)}
+} {0 3 d 0 nocase 1 1 2 c 1 BINARY 1 2 -1 {} 0 BINARY 0}
+
+# EVIDENCE-OF: R-63500-32024 PRAGMA database.index_list(table-name);
+# This pragma returns one row for each index associated with the given
+# table.
+#
+# (The first column of output from PRAGMA index_list is...)
+# EVIDENCE-OF: R-02753-24748 A sequence number assigned to each index
+# for internal tracking purposes.
+#
+# (The second column of output from PRAGMA index_list is...)
+# EVIDENCE-OF: R-35496-03635 The name of the index.
+#
+# (The third column of output from PRAGMA index_list is...)
+# EVIDENCE-OF: R-57301-64506 "1" if the index is UNIQUE and "0" if not.
+#
+# (The fourth column of output from PRAGMA index_list is...)
+# EVIDENCE-OF: R-36609-39554 "c" if the index was created by a CREATE
+# INDEX statement, "u" if the index was created by a UNIQUE constraint,
+# or "pk" if the index was created by a PRIMARY KEY constraint.
+#
do_test 23.3 {
db eval {
CREATE INDEX i3 ON t1(d,b,c);
}
capture_pragma db2 out {PRAGMA index_list(t1)}
- db2 eval {SELECT name, "unique", origin FROM out ORDER BY seq}
-} {i3 0 c i2 0 c i1 0 c}
+ db2 eval {SELECT seq, name, "unique", origin, '|' FROM out ORDER BY seq}
+} {0 i3 0 c | 1 i2 0 c | 2 i2x 0 c | 3 i1 0 c |}
do_test 23.4 {
db eval {
ALTER TABLE t1 ADD COLUMN e;