drh | f012ea3 | 2006-05-24 12:43:26 +0000 | [diff] [blame^] | 1 | # 2005 January 19 |
| 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 | # |
| 12 | # $Id: shared3.test,v 1.1 2006/05/24 12:43:28 drh Exp $ |
| 13 | |
| 14 | set testdir [file dirname $argv0] |
| 15 | source $testdir/tester.tcl |
| 16 | db close |
| 17 | |
| 18 | ifcapable !shared_cache { |
| 19 | finish_test |
| 20 | return |
| 21 | } |
| 22 | set ::enable_shared_cache [sqlite3_enable_shared_cache 1] |
| 23 | |
| 24 | # Ticket #1824 |
| 25 | # |
| 26 | do_test shared3-1.1 { |
| 27 | file delete -force test.db test.db-journal |
| 28 | sqlite3 db1 test.db |
| 29 | db1 eval { |
| 30 | PRAGMA encoding=UTF16; |
| 31 | CREATE TABLE t1(x,y); |
| 32 | INSERT INTO t1 VALUES('abc','This is a test string'); |
| 33 | } |
| 34 | db1 close |
| 35 | sqlite3 db1 test.db |
| 36 | db1 eval {SELECT * FROM t1} |
| 37 | } {abc {This is a test string}} |
| 38 | do_test shared3-1.2 { |
| 39 | sqlite3 db2 test.db |
| 40 | db2 eval {SELECT y FROM t1 WHERE x='abc'} |
| 41 | } {{This is a test string}} |
| 42 | |
| 43 | db1 close |
| 44 | db2 close |
| 45 | |
| 46 | sqlite3_enable_shared_cache $::enable_shared_cache |
| 47 | finish_test |