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

Unified Diff: third_party/sqlite/src/test/stat.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/sqllimits1.test ('k') | third_party/sqlite/src/test/subquery.test » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/sqlite/src/test/stat.test
diff --git a/third_party/sqlite/src/test/stat.test b/third_party/sqlite/src/test/stat.test
index e1aeaa9e1ac80fc8d293f45b8f017b54f5ffed9d..f0447e450935dcc45cfcda374db51a70824ff5b2 100644
--- a/third_party/sqlite/src/test/stat.test
+++ b/third_party/sqlite/src/test/stat.test
@@ -15,7 +15,7 @@
set testdir [file dirname $argv0]
source $testdir/tester.tcl
-ifcapable !vtab {
+ifcapable !vtab||!compound {
finish_test
return
}
@@ -36,7 +36,8 @@ ifcapable wal {
do_execsql_test stat-0.1 {
PRAGMA journal_mode = WAL;
PRAGMA journal_mode = delete;
- SELECT * FROM stat;
+ SELECT name, path, pageno, pagetype, ncell, payload, unused, mx_payload
+ FROM stat;
} {wal delete sqlite_master / 1 leaf 0 0 916 0}
}
@@ -50,17 +51,20 @@ do_test stat-1.0 {
} {}
do_test stat-1.1 {
execsql {
- SELECT * FROM stat WHERE name = 't1';
+ SELECT name, path, pageno, pagetype, ncell, payload, unused, mx_payload
+ FROM stat WHERE name = 't1';
}
} {t1 / 2 leaf 2 10 998 5}
do_test stat-1.2 {
execsql {
- SELECT * FROM stat WHERE name = 'i1';
+ SELECT name, path, pageno, pagetype, ncell, payload, unused, mx_payload
+ FROM stat WHERE name = 'i1';
}
} {i1 / 3 leaf 2 10 1000 5}
do_test stat-1.3 {
execsql {
- SELECT * FROM stat WHERE name = 'sqlite_master';
+ SELECT name, path, pageno, pagetype, ncell, payload, unused, mx_payload
+ FROM stat WHERE name = 'sqlite_master';
}
} {sqlite_master / 1 leaf 2 77 831 40}
do_test stat-1.4 {
@@ -72,12 +76,18 @@ do_test stat-1.4 {
do_execsql_test stat-2.1 {
CREATE TABLE t3(a PRIMARY KEY, b);
INSERT INTO t3(rowid, a, b) VALUES(2, a_string(111), a_string(222));
- INSERT INTO t3 SELECT a_string(110+rowid), a_string(221+rowid) FROM t3;
- INSERT INTO t3 SELECT a_string(110+rowid), a_string(221+rowid) FROM t3;
- INSERT INTO t3 SELECT a_string(110+rowid), a_string(221+rowid) FROM t3;
- INSERT INTO t3 SELECT a_string(110+rowid), a_string(221+rowid) FROM t3;
- INSERT INTO t3 SELECT a_string(110+rowid), a_string(221+rowid) FROM t3;
- SELECT * FROM stat WHERE name != 'sqlite_master';
+ INSERT INTO t3 SELECT a_string(110+rowid), a_string(221+rowid) FROM t3
+ ORDER BY rowid;
+ INSERT INTO t3 SELECT a_string(110+rowid), a_string(221+rowid) FROM t3
+ ORDER BY rowid;
+ INSERT INTO t3 SELECT a_string(110+rowid), a_string(221+rowid) FROM t3
+ ORDER BY rowid;
+ INSERT INTO t3 SELECT a_string(110+rowid), a_string(221+rowid) FROM t3
+ ORDER BY rowid;
+ INSERT INTO t3 SELECT a_string(110+rowid), a_string(221+rowid) FROM t3
+ ORDER BY rowid;
+ SELECT name, path, pageno, pagetype, ncell, payload, unused, mx_payload
+ FROM stat WHERE name != 'sqlite_master';
} [list \
sqlite_autoindex_t3_1 / 3 internal 3 368 623 125 \
sqlite_autoindex_t3_1 /000/ 8 leaf 8 946 46 123 \
@@ -102,54 +112,66 @@ do_execsql_test stat-2.1 {
t3 /00e/ 22 leaf 2 730 276 366 \
t3 /00f/ 23 leaf 2 738 268 370 \
]
-do_execsql_test stat-2.2 { DROP TABLE t3 } {}
+
+# With every index entry overflowing, make sure no pages are missed
+# (other than the locking page which is 64 in this test build.)
+#
+do_execsql_test stat-2.2 {
+ UPDATE t3 SET a=a||hex(randomblob(700));
+ VACUUM;
+ SELECT pageno FROM stat EXCEPT SELECT pageno-1 FROM stat;
+} {64 136}
+
+do_execsql_test stat-2.3 { DROP TABLE t3; VACUUM; } {}
do_execsql_test stat-3.1 {
CREATE TABLE t4(x);
CREATE INDEX i4 ON t4(x);
INSERT INTO t4(rowid, x) VALUES(2, a_string(7777));
- SELECT * FROM stat WHERE name != 'sqlite_master';
+ SELECT name, path, pageno, pagetype, ncell, payload, unused, mx_payload
+ FROM stat WHERE name != 'sqlite_master';
} [list \
i4 / 3 leaf 1 103 905 7782 \
- i4 /000+000000 9 overflow 0 1020 0 0 \
- i4 /000+000001 10 overflow 0 1020 0 0 \
- i4 /000+000002 11 overflow 0 1020 0 0 \
- i4 /000+000003 12 overflow 0 1020 0 0 \
- i4 /000+000004 13 overflow 0 1020 0 0 \
- i4 /000+000005 14 overflow 0 1020 0 0 \
- i4 /000+000006 15 overflow 0 1020 0 0 \
- i4 /000+000007 16 overflow 0 539 481 0 \
+ i4 /000+000000 4 overflow 0 1020 0 0 \
+ i4 /000+000001 5 overflow 0 1020 0 0 \
+ i4 /000+000002 6 overflow 0 1020 0 0 \
+ i4 /000+000003 7 overflow 0 1020 0 0 \
+ i4 /000+000004 8 overflow 0 1020 0 0 \
+ i4 /000+000005 9 overflow 0 1020 0 0 \
+ i4 /000+000006 10 overflow 0 1020 0 0 \
+ i4 /000+000007 11 overflow 0 539 481 0 \
t4 / 2 leaf 1 640 367 7780 \
- t4 /000+000000 22 overflow 0 1020 0 0 \
- t4 /000+000001 23 overflow 0 1020 0 0 \
- t4 /000+000002 21 overflow 0 1020 0 0 \
- t4 /000+000003 20 overflow 0 1020 0 0 \
- t4 /000+000004 19 overflow 0 1020 0 0 \
- t4 /000+000005 18 overflow 0 1020 0 0 \
- t4 /000+000006 17 overflow 0 1020 0 0 \
+ t4 /000+000000 12 overflow 0 1020 0 0 \
+ t4 /000+000001 13 overflow 0 1020 0 0 \
+ t4 /000+000002 14 overflow 0 1020 0 0 \
+ t4 /000+000003 15 overflow 0 1020 0 0 \
+ t4 /000+000004 16 overflow 0 1020 0 0 \
+ t4 /000+000005 17 overflow 0 1020 0 0 \
+ t4 /000+000006 18 overflow 0 1020 0 0 \
]
do_execsql_test stat-4.1 {
CREATE TABLE t5(x);
CREATE INDEX i5 ON t5(x);
- SELECT * FROM stat WHERE name = 't5' OR name = 'i5';
+ SELECT name, path, pageno, pagetype, ncell, payload, unused, mx_payload
+ FROM stat WHERE name = 't5' OR name = 'i5';
} [list \
- i5 / 5 leaf 0 0 1016 0 \
- t5 / 4 leaf 0 0 1016 0 \
+ i5 / 20 leaf 0 0 1016 0 \
+ t5 / 19 leaf 0 0 1016 0 \
]
db close
-file delete -force test.db
+forcedelete test.db
sqlite3 db test.db
register_dbstat_vtab db
-breakpoint
do_execsql_test stat-5.1 {
PRAGMA auto_vacuum = OFF;
CREATE VIRTUAL TABLE temp.stat USING dbstat;
CREATE TABLE t1(x);
INSERT INTO t1 VALUES(zeroblob(1513));
INSERT INTO t1 VALUES(zeroblob(1514));
- SELECT * FROM stat WHERE name = 't1';
+ SELECT name, path, pageno, pagetype, ncell, payload, unused, mx_payload
+ FROM stat WHERE name = 't1';
} [list \
t1 / 2 leaf 2 993 5 1517 \
t1 /000+000000 3 overflow 0 1020 0 0 \
« no previous file with comments | « third_party/sqlite/src/test/sqllimits1.test ('k') | third_party/sqlite/src/test/subquery.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698