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.
13 # This file implements tests to verify that ticket
14 # [f7b4edece25c994857dc139207f55a53c8319fae] has been fixed.
17 set testdir [file dirname $argv0]
18 source $testdir/tester.tcl
19 ifcapable !shared_cache { finish_test ; return }
21 # Open two database connections to the same database file in
22 # shared cache mode. Create update hooks that will fire on
26 set ::enable_shared_cache [sqlite3_enable_shared_cache 1]
29 unset -nocomplain HOOKS
31 proc update_hook {args} { lappend ::HOOKS $args }
32 db1 update_hook update_hook
33 db2 update_hook update_hook
35 # Create a prepared statement
37 do_test tkt-f7b4edec-1 {
38 execsql { CREATE TABLE t1(x, y); } db1
39 execsql { INSERT INTO t1 VALUES(1, 2) } db1
41 } {{INSERT main t1 1}}
43 # In the second database connection cause the schema to be reparsed
44 # without changing the schema cookie.
47 do_test tkt-f7b4edec-2 {
51 CREATE TABLE t1(x, y);
57 # Rerun the prepared statement that was created prior to the
58 # schema reparse. Verify that the update-hook gives the correct
62 do_test tkt-f7b4edec-3 {
63 execsql { INSERT INTO t1 VALUES(1, 2) } db1
65 } {{INSERT main t1 2}}
67 # Be sure to restore the original shared-cache mode setting before
72 sqlite3_enable_shared_cache $::enable_shared_cache