# 2019-04-11 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the sqlite_dbpage virtual table. # set testdir [file dirname $argv0] source $testdir/tester.tcl set testprefix dbdata ifcapable !vtab||!compound { finish_test return } db enable_load_extension 1 if { [catch { db eval { SELECT load_extension('../dbdata') } }] } { finish_test return } do_execsql_test 1.0 { CREATE TABLE T1(a, b); INSERT INTO t1(rowid, a ,b) VALUES(5, 'v', 'five'); INSERT INTO t1(rowid, a, b) VALUES(10, 'x', 'ten'); } do_execsql_test 1.1 { SELECT pgno, cell, field, quote(value) FROM sqlite_dbdata WHERE pgno=2; } { 2 0 -1 5 2 0 0 'v' 2 0 1 'five' 2 1 -1 10 2 1 0 'x' 2 1 1 'ten' } set big [string repeat big 2000] do_execsql_test 1.2 { INSERT INTO t1 VALUES(NULL, $big); SELECT value FROM sqlite_dbdata WHERE pgno=2 AND cell=2 AND field=1; } $big finish_test