3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give.
10 #***********************************************************************
11 # This file implements regression tests for SQLite library. The
12 # focus of this file is testing the sqlite_dbpage virtual table.
15 set testdir [file dirname $argv0]
16 source $testdir/tester.tcl
19 ifcapable !vtab||!compound {
23 if { [catch { db enable_load_extension 1 }]
24 || [catch { db eval { SELECT load_extension('../dbdata') } }]
31 CREATE TABLE T1(a, b);
32 INSERT INTO t1(rowid, a ,b) VALUES(5, 'v', 'five');
33 INSERT INTO t1(rowid, a, b) VALUES(10, 'x', 'ten');
37 SELECT pgno, cell, field, quote(value) FROM sqlite_dbdata WHERE pgno=2;
49 SELECT pgno, cell, field, quote(value) FROM sqlite_dbdata;
56 1 0 4 {'CREATE TABLE T1(a, b)'}
65 set big [string repeat big 2000]
67 INSERT INTO t1 VALUES(NULL, $big);
68 SELECT value FROM sqlite_dbdata WHERE pgno=2 AND cell=2 AND field=1;
73 INSERT INTO t1 VALUES(NULL, randomblob(5050));
77 SELECT quote(value) FROM sqlite_dbdata WHERE pgno=2 AND cell=0 AND field=1;
79 } [db one {SELECT quote(b) FROM t1}]
81 #-------------------------------------------------------------------------
83 db enable_load_extension 1
84 db eval { SELECT load_extension('../dbdata') }
88 CREATE INDEX i1 ON t1(a);
90 SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<10
92 INSERT INTO t1 SELECT randomblob(900) FROM s;
96 SELECT * FROM sqlite_dbptr WHERE pgno=2;
98 2 25 2 6 2 7 2 9 2 11 2 13 2 15 2 17 2 19 2 21
101 do_execsql_test 2.2 {
102 SELECT * FROM sqlite_dbptr WHERE pgno=3;
107 do_execsql_test 2.3 {
108 SELECT * FROM sqlite_dbptr
110 2 25 2 6 2 7 2 9 2 11 2 13 2 15 2 17 2 19 2 21