mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-27 20:41:58 +03:00
Add the experimental dbdata extension.
FossilOrigin-Name: a3ab58832935e1399ecc7e4d8daefa3a6afa6b301792ce7176bc5d7c173510fb
This commit is contained in:
54
test/dbdata.test
Normal file
54
test/dbdata.test
Normal file
@ -0,0 +1,54 @@
|
||||
# 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
|
Reference in New Issue
Block a user