xref: /sqlite-3.40.0/test/shared3.test (revision 74e4352a)
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
14set testdir [file dirname $argv0]
15source $testdir/tester.tcl
16db close
17
18ifcapable !shared_cache {
19  finish_test
20  return
21}
22set ::enable_shared_cache [sqlite3_enable_shared_cache 1]
23
24# Ticket #1824
25#
26do_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}}
38do_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
43db1 close
44db2 close
45
46sqlite3_enable_shared_cache $::enable_shared_cache
47finish_test
48