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

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

Issue 949043002: Add //third_party/sqlite to dirs_to_snapshot, remove net_sql.patch (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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/amatch1.test ('k') | third_party/sqlite/src/test/analyze2.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/analyze.test
diff --git a/third_party/sqlite/src/test/analyze.test b/third_party/sqlite/src/test/analyze.test
index 766cd50d1fce0da503b19ec4ced0e1a854e4bb8a..c44508426396de42b8b877156a7687e5aa497d3d 100644
--- a/third_party/sqlite/src/test/analyze.test
+++ b/third_party/sqlite/src/test/analyze.test
@@ -287,6 +287,65 @@ do_test analyze-4.3 {
}
} {}
+# Verify that DROP TABLE and DROP INDEX remove entries from the
+# sqlite_stat1, sqlite_stat3 and sqlite_stat4 tables.
+#
+do_test analyze-5.0 {
+ execsql {
+ DELETE FROM t3;
+ DELETE FROM t4;
+ INSERT INTO t3 VALUES(1,2,3,4);
+ INSERT INTO t3 VALUES(5,6,7,8);
+ INSERT INTO t3 SELECT a+8, b+8, c+8, d+8 FROM t3;
+ INSERT INTO t3 SELECT a+16, b+16, c+16, d+16 FROM t3;
+ INSERT INTO t3 SELECT a+32, b+32, c+32, d+32 FROM t3;
+ INSERT INTO t3 SELECT a+64, b+64, c+64, d+64 FROM t3;
+ INSERT INTO t4 SELECT a, b, c FROM t3;
+ ANALYZE;
+ SELECT DISTINCT idx FROM sqlite_stat1 ORDER BY 1;
+ SELECT DISTINCT tbl FROM sqlite_stat1 ORDER BY 1;
+ }
+} {t3i1 t3i2 t3i3 t4i1 t4i2 t3 t4}
+ifcapable stat4||stat3 {
+ ifcapable stat4 {set stat sqlite_stat4} else {set stat sqlite_stat3}
+ do_test analyze-5.1 {
+ execsql "
+ SELECT DISTINCT idx FROM $stat ORDER BY 1;
+ SELECT DISTINCT tbl FROM $stat ORDER BY 1;
+ "
+ } {t3i1 t3i2 t3i3 t4i1 t4i2 t3 t4}
+}
+do_test analyze-5.2 {
+ execsql {
+ DROP INDEX t3i2;
+ SELECT DISTINCT idx FROM sqlite_stat1 ORDER BY 1;
+ SELECT DISTINCT tbl FROM sqlite_stat1 ORDER BY 1;
+ }
+} {t3i1 t3i3 t4i1 t4i2 t3 t4}
+ifcapable stat4||stat3 {
+ do_test analyze-5.3 {
+ execsql "
+ SELECT DISTINCT idx FROM $stat ORDER BY 1;
+ SELECT DISTINCT tbl FROM $stat ORDER BY 1;
+ "
+ } {t3i1 t3i3 t4i1 t4i2 t3 t4}
+}
+do_test analyze-5.4 {
+ execsql {
+ DROP TABLE t3;
+ SELECT DISTINCT idx FROM sqlite_stat1 ORDER BY 1;
+ SELECT DISTINCT tbl FROM sqlite_stat1 ORDER BY 1;
+ }
+} {t4i1 t4i2 t4}
+ifcapable stat4||stat3 {
+ do_test analyze-5.5 {
+ execsql "
+ SELECT DISTINCT idx FROM $stat ORDER BY 1;
+ SELECT DISTINCT tbl FROM $stat ORDER BY 1;
+ "
+ } {t4i1 t4i2 t4}
+}
+
# This test corrupts the database file so it must be the last test
# in the series.
#
@@ -302,5 +361,4 @@ do_test analyze-99.1 {
}
} {1 {malformed database schema (sqlite_stat1) - near "nonsense": syntax error}}
-
finish_test
« no previous file with comments | « third_party/sqlite/src/test/amatch1.test ('k') | third_party/sqlite/src/test/analyze2.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698