aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authordanielk1977 <danielk1977@noemail.net>2006-01-11 14:09:31 +0000
committerdanielk1977 <danielk1977@noemail.net>2006-01-11 14:09:31 +0000
commitb82e7edae9c6f8b0c9f2f6745442b5663a55b51a (patch)
treec388bb764973fcc40e8812c26ed450e7288a9c45 /test
parent003437a0a7563fddadb95d4103630da3a9d7f2ae (diff)
downloadsqlite-b82e7edae9c6f8b0c9f2f6745442b5663a55b51a.tar.gz
sqlite-b82e7edae9c6f8b0c9f2f6745442b5663a55b51a.zip
Fix bugs caused by assuming that shared-schemas are initialized. (CVS 2917)
FossilOrigin-Name: 3970eb875d1830d35b3a70a7583a8ab6b238cad6
Diffstat (limited to 'test')
-rw-r--r--test/enc2.test43
-rw-r--r--test/shared.test22
-rw-r--r--test/vacuum.test7
3 files changed, 49 insertions, 23 deletions
diff --git a/test/enc2.test b/test/enc2.test
index d6b16a094..a21fca5b2 100644
--- a/test/enc2.test
+++ b/test/enc2.test
@@ -13,7 +13,7 @@
# various suported unicode encodings (UTF-8, UTF-16, UTF-16le and
# UTF-16be).
#
-# $Id: enc2.test,v 1.25 2006/01/03 00:33:50 drh Exp $
+# $Id: enc2.test,v 1.26 2006/01/11 14:09:32 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -473,4 +473,45 @@ ifcapable {complete} {
} {0}
}
+# Test that the encoding of an empty database may still be set after the
+# (empty) schema has been initialized.
+file delete -force test.db
+do_test enc2-9.1 {
+ sqlite3 db test.db
+ execsql {
+ PRAGMA encoding = 'UTF-8';
+ PRAGMA encoding;
+ }
+} {UTF-8}
+do_test enc2-9.2 {
+ sqlite3 db test.db
+ execsql {
+ PRAGMA encoding = 'UTF-16le';
+ PRAGMA encoding;
+ }
+} {UTF-16le}
+do_test enc2-9.3 {
+ sqlite3 db test.db
+ execsql {
+ SELECT * FROM sqlite_master;
+ PRAGMA encoding = 'UTF-8';
+ PRAGMA encoding;
+ }
+} {UTF-8}
+do_test enc2-9.4 {
+ sqlite3 db test.db
+ execsql {
+ PRAGMA encoding = 'UTF-16le';
+ CREATE TABLE abc(a, b, c);
+ PRAGMA encoding;
+ }
+} {UTF-16le}
+do_test enc2-9.5 {
+ sqlite3 db test.db
+ execsql {
+ PRAGMA encoding = 'UTF-8';
+ PRAGMA encoding;
+ }
+} {UTF-16le}
+
finish_test
diff --git a/test/shared.test b/test/shared.test
index 8323d4b3d..af23aa23e 100644
--- a/test/shared.test
+++ b/test/shared.test
@@ -9,7 +9,7 @@
#
#***********************************************************************
#
-# $Id: shared.test,v 1.10 2006/01/11 01:08:34 drh Exp $
+# $Id: shared.test,v 1.11 2006/01/11 14:09:32 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -608,26 +608,6 @@ catch {db close}
catch {db2 close}
file delete -force test.db test2.db
-if 0 {
-
-do_test shared-9.1 {
- sqlite3 db test.db
-} {}
-do_test shared-9.2 {
- execsql {CREATE TABLE t1(a);}
-} {}
-
-file delete -force test.db
-sqlite3 db test.db; set DB [sqlite3_connection_pointer db]
-do_test shared-9.3 {
- execsql {
- CREATE TABLE t5(a);
- INSERT INTO t5 VALUES('one');
- } db
-} {}
-
-}
-
#---------------------------------------------------------------------------
# The following tests - shared-9.* - test interactions between TEMP triggers
# and shared-schemas.
diff --git a/test/vacuum.test b/test/vacuum.test
index 63eee972f..58f0045df 100644
--- a/test/vacuum.test
+++ b/test/vacuum.test
@@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this file is testing the VACUUM statement.
#
-# $Id: vacuum.test,v 1.36 2006/01/03 00:33:50 drh Exp $
+# $Id: vacuum.test,v 1.37 2006/01/11 14:09:32 danielk1977 Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -164,6 +164,11 @@ do_test vacuum-2.5 {
}
sqlite3 db3 test.db
execsql {
+ -- The "SELECT * FROM sqlite_master" statement ensures that this test
+ -- works when shared-cache is enabled. If shared-cache is enabled, then
+ -- db3 shares a cache with db2 (but not db - it was opened as
+ -- "./test.db").
+ SELECT * FROM sqlite_master;
SELECT * FROM t7 LIMIT 1
} db3
execsql {