aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/sqlite/unix/sqlite-3.5.1/test/vtab_shared.test
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/sqlite/unix/sqlite-3.5.1/test/vtab_shared.test')
-rw-r--r--libraries/sqlite/unix/sqlite-3.5.1/test/vtab_shared.test62
1 files changed, 62 insertions, 0 deletions
diff --git a/libraries/sqlite/unix/sqlite-3.5.1/test/vtab_shared.test b/libraries/sqlite/unix/sqlite-3.5.1/test/vtab_shared.test
new file mode 100644
index 0000000..04ba1ec
--- /dev/null
+++ b/libraries/sqlite/unix/sqlite-3.5.1/test/vtab_shared.test
@@ -0,0 +1,62 @@
1# 2007 April 16
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 tests interactions between the virtual table and
12# shared-schema functionality.
13#
14# $Id: vtab_shared.test,v 1.1 2007/04/16 15:49:42 danielk1977 Exp $
15
16set testdir [file dirname $argv0]
17source $testdir/tester.tcl
18
19ifcapable !vtab||!shared_cache {
20 finish_test
21 return
22}
23
24db close
25sqlite3_enable_shared_cache 1
26sqlite3 db test.db
27
28do_test vtab_shared-1.0 {
29 register_echo_module [sqlite3_connection_pointer db]
30 catchsql {
31 CREATE TABLE t0(a, b, c);
32 CREATE VIRTUAL TABLE t1 USING echo(t0);
33 }
34} {1 {Cannot use virtual tables in shared-cache mode}}
35
36db close
37sqlite3_enable_shared_cache 0
38sqlite3 db test.db
39
40do_test vtab_shared-1.1 {
41 register_echo_module [sqlite3_connection_pointer db]
42 catchsql {
43 CREATE VIRTUAL TABLE t1 USING echo(t0);
44 }
45} {0 {}}
46
47db close
48sqlite3_enable_shared_cache 1
49sqlite3 db test.db
50
51do_test vtab_shared-1.2 {
52 register_echo_module [sqlite3_connection_pointer db]
53 catchsql {
54 SELECT * FROM t1;
55 }
56} [list 1 \
57 {malformed database schema - Cannot use virtual tables in shared-cache mode}]
58
59db close
60sqlite3_enable_shared_cache 0
61finish_test
62