gitlab.com/CoiaPrant/sqlite3@v1.19.1/testdata/tcl/fts3drop.test (about) 1 # 2011 October 29 2 # 3 # The author disclaims copyright to this source code. In place of 4 # a legal notice, here is a blessing: 5 # 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. 9 # 10 #************************************************************************* 11 # This file implements regression tests for SQLite library. The 12 # focus of this script is testing the FTS3 module. More specifically, 13 # that DROP TABLE commands can co-exist with savepoints inside transactions. 14 # See ticket [48f299634a] for details. 15 # 16 17 18 set testdir [file dirname $argv0] 19 source $testdir/tester.tcl 20 set testprefix fts3drop 21 22 # If SQLITE_ENABLE_FTS3 is defined, omit this file. 23 ifcapable !fts3 { 24 finish_test 25 return 26 } 27 28 do_execsql_test 1.1 { 29 CREATE VIRTUAL TABLE f1 USING fts3; 30 INSERT INTO f1 VALUES('a b c'); 31 } 32 33 do_execsql_test 1.2 { 34 BEGIN; 35 INSERT INTO f1 VALUES('d e f'); 36 SAVEPOINT one; 37 INSERT INTO f1 VALUES('g h i'); 38 DROP TABLE f1; 39 ROLLBACK TO one; 40 COMMIT; 41 } 42 43 do_execsql_test 1.3 { 44 SELECT * FROM f1; 45 } {{a b c} {d e f}} 46 47 do_execsql_test 1.4 { 48 BEGIN; 49 INSERT INTO f1 VALUES('g h i'); 50 SAVEPOINT one; 51 INSERT INTO f1 VALUES('j k l'); 52 DROP TABLE f1; 53 RELEASE one; 54 ROLLBACK; 55 } 56 57 do_execsql_test 1.5 { 58 SELECT * FROM f1; 59 } {{a b c} {d e f}} 60 61 finish_test