mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Ensure that the db->init.azInit array is initialized at all times.
dbsqlfuzz 0ad6d441f9bf3dfc32626a9900bc1700495b16f9 FossilOrigin-Name: c7560c1329965ab57cd71393c044b110561b83641d08677bc51044df9e377882
This commit is contained in:
Binary file not shown.
59
test/vtabK.test
Normal file
59
test/vtabK.test
Normal file
@@ -0,0 +1,59 @@
|
||||
# 2020-09-24
|
||||
#
|
||||
# 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 tests for a strange scenario discovered by
|
||||
# dbsqlfuzz (0ad6d441f9bf3dfc32626a9900bc1700495b16f9) in which a
|
||||
# virtual table is named "sqlite_stat1".
|
||||
#
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
set testprefix vtabK
|
||||
|
||||
ifcapable !vtab||!rtree||!fts5 {
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
|
||||
do_execsql_test 100 {
|
||||
CREATE TABLE t1(x);
|
||||
INSERT INTO t1 VALUES(123);
|
||||
PRAGMA writable_schema=ON;
|
||||
CREATE VIRTUAL TABLE sqlite_stat1 USING fts5(a);
|
||||
PRAGMA writable_schema=OFF;
|
||||
CREATE VIRTUAL TABLE t3 USING fts5(b);
|
||||
INSERT INTO t3 VALUES('this is a test');
|
||||
}
|
||||
do_catchsql_test 110 {
|
||||
CREATE VIRTUAL TABLE t2 USING rtree(id,x,y);
|
||||
} {1 {no such column: stat}}
|
||||
do_execsql_test 120 {
|
||||
SELECT * FROM t1;
|
||||
} {123}
|
||||
do_execsql_test 130 {
|
||||
INSERT INTO t3(b) VALUES('Four score and seven years ago');
|
||||
SELECT * FROM t3 WHERE t3 MATCH 'this';
|
||||
} {{this is a test}}
|
||||
do_execsql_test 140 {
|
||||
SELECT * FROM t3 WHERE t3 MATCH 'four seven';
|
||||
} {{Four score and seven years ago}}
|
||||
do_execsql_test 150 {
|
||||
INSERT INTO sqlite_stat1(a)
|
||||
VALUES('We hold these truths to be self-evident...');
|
||||
SELECT * FROM sqlite_stat1;
|
||||
} {{We hold these truths to be self-evident...}}
|
||||
do_catchsql_test 160 {
|
||||
ANALYZE;
|
||||
} {1 {database disk image is malformed}}
|
||||
do_execsql_test 170 {
|
||||
PRAGMA integrity_check;
|
||||
} {ok}
|
||||
|
||||
finish_test
|
Reference in New Issue
Block a user