All the page_size pragma to change the page size on a new :memory: database,
but not a vacuumed :memory: database. Ticket #3335 (CVS 5617) FossilOrigin-Name: 226a9056783247679fcf442e10807a1f2707f463
This commit is contained in:
+14
-3
@@ -11,7 +11,7 @@
|
||||
# This file implements regression tests for SQLite library.
|
||||
# This file implements tests for the page_size PRAGMA.
|
||||
#
|
||||
# $Id: pagesize.test,v 1.12 2007/04/06 21:42:22 drh Exp $
|
||||
# $Id: pagesize.test,v 1.13 2008/08/26 21:07:27 drh Exp $
|
||||
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
@@ -79,12 +79,23 @@ foreach PGSZ {512 2048 4096 8192} {
|
||||
if {[info exists SQLITE_MAX_PAGE_SIZE]
|
||||
&& $SQLITE_MAX_PAGE_SIZE<$PGSZ} continue
|
||||
ifcapable memorydb {
|
||||
do_test pagesize-2.$PGSZ.0 {
|
||||
do_test pagesize-2.$PGSZ.0.1 {
|
||||
db close
|
||||
sqlite3 db :memory:
|
||||
execsql "PRAGMA page_size=$PGSZ;"
|
||||
execsql {PRAGMA page_size}
|
||||
} 1024
|
||||
} $PGSZ
|
||||
do_test pagesize-2.$PGSZ.0.2 {
|
||||
execsql {CREATE TABLE t1(x UNIQUE, y UNIQUE, z UNIQUE)}
|
||||
execsql {PRAGMA page_size}
|
||||
} $PGSZ
|
||||
do_test pagesize-2.$PGSZ.0.3 {
|
||||
execsql {
|
||||
INSERT INTO t1 VALUES(1,2,3);
|
||||
INSERT INTO t1 VALUES(2,3,4);
|
||||
SELECT * FROM t1;
|
||||
}
|
||||
} {1 2 3 2 3 4}
|
||||
}
|
||||
do_test pagesize-2.$PGSZ.1 {
|
||||
db close
|
||||
|
||||
+17
-1
@@ -12,7 +12,7 @@
|
||||
# focus of this file is changing the database page size using a
|
||||
# VACUUM statement.
|
||||
#
|
||||
# $Id: vacuum3.test,v 1.8 2008/08/23 16:17:56 danielk1977 Exp $
|
||||
# $Id: vacuum3.test,v 1.9 2008/08/26 21:07:27 drh Exp $
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@@ -235,7 +235,23 @@ do_test vacuum3-4.6 {
|
||||
execsql { SELECT * FROM abc } db2
|
||||
} {1 2 3 4 5 6}
|
||||
|
||||
# Unable to change the page-size of an in-memory using vacuum.
|
||||
db2 close
|
||||
sqlite3 db2 :memory:
|
||||
do_test vacuum3-5.1 {
|
||||
db2 eval {
|
||||
CREATE TABLE t1(x);
|
||||
INSERT INTO t1 VALUES(1234);
|
||||
PRAGMA page_size=4096;
|
||||
VACUUM;
|
||||
SELECT * FROM t1;
|
||||
}
|
||||
} {1234}
|
||||
do_test vacuum3-5.2 {
|
||||
db2 eval {
|
||||
PRAGMA page_size
|
||||
}
|
||||
} {1024}
|
||||
|
||||
set create_database_sql {
|
||||
BEGIN;
|
||||
|
||||
Reference in New Issue
Block a user