mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Get the aggregate=TRUE feature working on the DBSTAT virtual table.
FossilOrigin-Name: 16fef3db063830884de46d53a289f637a7204fe84fcdee7ea81dbb8bca578952
This commit is contained in:
@@ -134,6 +134,14 @@ do_execsql_test stat-2.1 {
|
||||
t3 /00f/ 23 leaf 2 738 268 370 \
|
||||
]
|
||||
|
||||
do_execsql_test stat-2.1agg {
|
||||
SELECT * FROM dbstat WHERE aggregate=TRUE ORDER BY name;
|
||||
} [list \
|
||||
sqlite_autoindex_t3_1 {} 5 {} 32 3898 1065 132 {} 5120 \
|
||||
sqlite_master {} 1 {} 2 84 824 49 {} 1024 \
|
||||
t3 {} 17 {} 47 11188 5815 370 {} 17408 \
|
||||
]
|
||||
|
||||
# With every index entry overflowing, make sure no pages are missed
|
||||
# (other than the locking page which is 64 in this test build.)
|
||||
#
|
||||
@@ -171,6 +179,15 @@ do_execsql_test stat-3.1 {
|
||||
t4 /000+000006 18 overflow 0 1020 0 0 \
|
||||
]
|
||||
|
||||
do_execsql_test stat-3.2 {
|
||||
SELECT *, '|' FROM dbstat WHERE aggregate=TRUE ORDER BY name;
|
||||
} [list \
|
||||
i4 {} 9 {} 1 7782 1386 7782 {} 9216 | \
|
||||
sqlite_master {} 1 {} 2 74 834 40 {} 1024 | \
|
||||
t4 {} 8 {} 1 7780 367 7780 {} 8192 | \
|
||||
]
|
||||
|
||||
|
||||
do_execsql_test stat-4.1 {
|
||||
CREATE TABLE t5(x);
|
||||
CREATE INDEX i5 ON t5(x);
|
||||
@@ -201,6 +218,16 @@ do_execsql_test stat-5.1 {
|
||||
t1 /001+000000 4 overflow 0 1020 0 0 \
|
||||
]
|
||||
|
||||
do_execsql_test stat-5.20 {
|
||||
SELECT name, quote(path), pageno, quote(pagetype), ncell, payload,
|
||||
unused, mx_payload, '|' FROM dbstat('main',1);
|
||||
} {sqlite_master NULL 1 NULL 1 34 878 34 | tx NULL 1 NULL 0 0 1016 0 |}
|
||||
do_execsql_test stat-5.21 {
|
||||
SELECT name, quote(path), pageno, quote(pagetype), ncell, payload,
|
||||
unused, mx_payload, '|' FROM dbstat('aux1',1);
|
||||
} {sqlite_master NULL 1 NULL 1 34 878 34 | t1 NULL 3 NULL 2 3033 5 1517 |}
|
||||
|
||||
|
||||
do_catchsql_test stat-6.1 {
|
||||
CREATE VIRTUAL TABLE temp.s2 USING dbstat(mainx);
|
||||
} {1 {no such database: mainx}}
|
||||
|
Reference in New Issue
Block a user