1
0
mirror of https://github.com/sqlite/sqlite.git synced 2026-01-06 08:01:16 +03:00

Preset the legacy_file_format pragma to the value of the primary

database so that a VACUUM will not unknowingly alter the setting.
Ticket #2804. (CVS 4574)

FossilOrigin-Name: f731fa6bb398d8af621af17dc0677dd0f715c4a7
This commit is contained in:
drh
2007-11-28 13:43:16 +00:00
parent ed05efbf7b
commit 4aa2bfe67d
5 changed files with 36 additions and 14 deletions

View File

@@ -13,7 +13,7 @@
# file format change that may be used in the future to implement
# "ALTER TABLE ... ADD COLUMN".
#
# $Id: alter2.test,v 1.11 2007/11/13 10:30:26 danielk1977 Exp $
# $Id: alter2.test,v 1.12 2007/11/28 13:43:17 drh Exp $
#
set testdir [file dirname $argv0]
@@ -275,10 +275,11 @@ set default_file_format [expr $SQLITE_DEFAULT_FILE_FORMAT==4 ? 4 : 1]
ifcapable vacuum {
do_test alter2-5.1 {
set_file_format 2
execsql {SELECT 1 FROM sqlite_master LIMIT 1;}
get_file_format
} {2}
do_test alter2-5.2 {
execsql {
execsql {
VACUUM;
}
} {}

View File

@@ -11,7 +11,7 @@
# This file implements regression tests for SQLite library. The
# focus of this script is descending indices.
#
# $Id: descidx1.test,v 1.8 2007/11/27 23:36:59 drh Exp $
# $Id: descidx1.test,v 1.9 2007/11/28 13:43:17 drh Exp $
#
set testdir [file dirname $argv0]
@@ -336,6 +336,11 @@ do_test descidx1-6.4 {
do_test descidx1-6.5 {
execsql {
CREATE TABLE t1(a,b,c);
CREATE INDEX i1 ON t1(a ASC, b DESC, c ASC);
INSERT INTO t1 VALUES(1,2,3);
INSERT INTO t1 VALUES(1,1,0);
INSERT INTO t1 VALUES(1,2,1);
INSERT INTO t1 VALUES(1,3,4);
}
get_file_format
} {4}
@@ -345,7 +350,15 @@ ifcapable vacuum {
execsql {VACUUM}
get_file_format
} {4}
}
do_test descidx1-6.7 {
execsql {
PRAGMA legacy_file_format=ON;
VACUUM;
}
get_file_format
} {4}
}
finish_test