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 #***********************************************************************
12 # Test cases for the SQLITE_ENABLE_8_3_NAMES feature that forces all
13 # filename extensions to be limited to 3 characters. Some embedded
14 # systems need this to work around microsoft FAT patents, but this
15 # feature should be disabled on most deployments.
18 set testdir [file dirname $argv0]
19 source $testdir/tester.tcl
20 ifcapable !8_3_names {
29 do_test 8_3_names-1.0 {
30 forcedelete test.db test.nal test.db-journal
35 INSERT INTO t1 VALUES(randomblob(20000));
38 INSERT INTO t1 VALUES(randomblob(15000));
40 file exists test.db-journal
42 do_test 8_3_names-1.1 {
45 do_test 8_3_names-1.2 {
48 SELECT length(x) FROM t1
53 do_test 8_3_names-2.0 {
54 forcedelete test.db test.nal test.db-journal
55 sqlite3 db file:./test.db?8_3_names=1
59 INSERT INTO t1 VALUES(randomblob(20000));
62 INSERT INTO t1 VALUES(randomblob(15000));
64 file exists test.db-journal
66 do_test 8_3_names-2.1 {
69 forcedelete test2.db test2.nal test2.db-journal
70 copy_file test.db test2.db
71 copy_file test.nal test2.nal
72 do_test 8_3_names-2.2 {
75 SELECT length(x) FROM t1
78 do_test 8_3_names-2.3 {
79 sqlite3 db2 file:./test2.db?8_3_names=1
81 PRAGMA integrity_check;
82 SELECT length(x) FROM t1;
87 do_test 8_3_names-3.0 {
88 forcedelete test.db test.nal test.db-journal
89 sqlite3 db file:./test.db?8_3_names=0
93 INSERT INTO t1 VALUES(randomblob(20000));
96 INSERT INTO t1 VALUES(randomblob(15000));
98 file exists test.db-journal
100 do_test 8_3_names-3.1 {
103 forcedelete test2.db test2.nal test2.db-journal
104 copy_file test.db test2.db
105 copy_file test.db-journal test2.db-journal
106 do_test 8_3_names-3.2 {
109 SELECT length(x) FROM t1
112 do_test 8_3_names-3.3 {
113 sqlite3 db2 file:./test2.db?8_3_names=0
115 PRAGMA integrity_check;
116 SELECT length(x) FROM t1;
120 ##########################################################################
124 forcedelete test.db test2.db
125 do_test 8_3_names-4.0 {
126 sqlite3 db file:./test.db?8_3_names=1
129 INSERT INTO t1 VALUES(1);
130 ATTACH 'file:./test2.db?8_3_names=1' AS db2;
131 CREATE TABLE db2.t2(y);
132 INSERT INTO t2 VALUES(2);
134 INSERT INTO t1 VALUES(3);
135 INSERT INTO t2 VALUES(4);
137 SELECT * FROM t1, t2 ORDER BY x, y
142 ##########################################################################
151 do_test 8_3_names-5.0 {
152 sqlite3 db file:./test.db?8_3_names=1
153 load_static_extension db wholenumber
155 PRAGMA journal_mode=WAL;
157 CREATE VIRTUAL TABLE nums USING wholenumber;
158 INSERT INTO t1 SELECT value FROM nums WHERE value BETWEEN 1 AND 1000;
162 sqlite3 db2 file:./test.db?8_3_names=1
163 load_static_extension db2 wholenumber
166 SELECT sum(x) FROM t1;
170 do_test 8_3_names-5.1 {
171 file exists test.db-wal
173 do_test 8_3_names-5.2 {
176 do_test 8_3_names-5.3 {
177 file exists test.db-shm
179 do_test 8_3_names-5.4 {
184 do_test 8_3_names-5.5 {
187 SELECT sum(x) FROM t1;
190 do_test 8_3_names-5.6 {
192 SELECT sum(x) FROM t1;