Convert the implementation of the ".dbstat" dot-command of the command-line
[sqlite.git] / test / fts3drop.test
blob8b76eafec01b2170e8817c8a5fb579ce0472f194
1 # 2011 October 29
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 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.
18 set testdir [file dirname $argv0]
19 source $testdir/tester.tcl
20 set testprefix fts3drop
22 # If SQLITE_ENABLE_FTS3 is defined, omit this file.
23 ifcapable !fts3 {
24   finish_test
25   return
28 do_execsql_test 1.1 {
29   CREATE VIRTUAL TABLE f1 USING fts3;
30   INSERT INTO f1 VALUES('a b c');
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;
43 do_execsql_test 1.3 {
44   SELECT * FROM f1;
45 } {{a b c} {d e f}}
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;
57 do_execsql_test 1.5 {
58   SELECT * FROM f1;
59 } {{a b c} {d e f}}
61 finish_test