mirror of
https://github.com/sqlite/sqlite.git
synced 2026-01-06 08:01:16 +03:00
Make the TEMP file tables use the page size set for the main database.
Ticket [b80eeab588c4]. Also copy over the changes from apple-osx check-in [7c3bede3f2]. FossilOrigin-Name: 5dcfb0c9e420d27e54a299b3991b98776651a507
This commit is contained in:
28
manifest
28
manifest
@@ -1,5 +1,8 @@
|
||||
C Fix\stwo\ssimilar\sproblems\sin\sfts3\sthat\smeant\sthat\san\sOOM\serror\scould\scause\sa\smemory\sleak.
|
||||
D 2010-01-22T15:48:18
|
||||
-----BEGIN PGP SIGNED MESSAGE-----
|
||||
Hash: SHA1
|
||||
|
||||
C Make\sthe\sTEMP\sfile\stables\suse\sthe\spage\ssize\sset\sfor\sthe\smain\sdatabase.\nTicket\s[b80eeab588c4].\s\s\nAlso\scopy\sover\sthe\schanges\sfrom\sapple-osx\scheck-in\s[7c3bede3f2].
|
||||
D 2010-01-26T01:25:27
|
||||
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
|
||||
F Makefile.in c5827ead754ab32b9585487177c93bb00b9497b3
|
||||
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
||||
@@ -111,7 +114,7 @@ F src/btmutex.c 96a12f50f7a17475155971a241d85ec5171573ff
|
||||
F src/btree.c efdef3953c49e28f8b8fa9cc0ac5754cc1a7489a
|
||||
F src/btree.h 7944a9dac59eb3e541aad45fd2747f1051e7c63d
|
||||
F src/btreeInt.h 54f4245decd0409ea52cf9aee422d3d761d7ac10
|
||||
F src/build.c 6ab7f8d8fa5b0ac6bfdce359e85f580b7a9b2e86
|
||||
F src/build.c f9002fe1d968812acd67ce6b777ea0325feaf977
|
||||
F src/callback.c 908f3e0172c3d4058f4ca0acd42c637c52e9669f
|
||||
F src/complete.c 4c8a742c4a4a6d9c835912648f5c8f032ea36c7b
|
||||
F src/date.c 485a4409a384310e6d93fd1104a9d0a8658becd9
|
||||
@@ -144,7 +147,7 @@ F src/mutex_os2.c 20477db50cf3817c2f1cd3eb61e5c177e50231db
|
||||
F src/mutex_unix.c 04a25238abce7e3d06b358dcf706e26624270809
|
||||
F src/mutex_w32.c 9ec75bcef0ca722821be7968c320fd725abfb984
|
||||
F src/notify.c f799bbda67ab6619b36b0a24153b49518874a203
|
||||
F src/os.c 4500ff276e277730776fe9b6c6c5930383ec4000
|
||||
F src/os.c 8bc63cf91e9802e2b807198e54e50227fa889306
|
||||
F src/os.h 534b082c3cb349ad05fa6fa0b06087e022af282c
|
||||
F src/os_common.h 240c88b163b02c21a9f21f87d49678a0aa21ff30
|
||||
F src/os_os2.c 75a8c7b9a00a2cf1a65f9fa4afbc27d46634bb2f
|
||||
@@ -518,7 +521,7 @@ F test/notnull.test cc7c78340328e6112a13c3e311a9ab3127114347
|
||||
F test/null.test a8b09b8ed87852742343b33441a9240022108993
|
||||
F test/openv2.test af02ed0a9cbc0d2a61b8f35171d4d117e588e4ec
|
||||
F test/pageropt.test 3ee6578891baaca967f0bd349e4abfa736229e1a
|
||||
F test/pagesize.test 0d9ff3fedfce6e5ffe8fa7aca9b6d3433a2e843b
|
||||
F test/pagesize.test 76aa9f23ecb0741a4ed9d2e16c5fa82671f28efb
|
||||
F test/pcache.test eebc4420b37cb07733ae9b6e99c9da7c40dd6d58
|
||||
F test/pcache2.test 0d85f2ab6963aee28c671d4c71bec038c00a1d16
|
||||
F test/permutations.test 1ce2874df8fec876d0b963c7a3ef61c4e9df8827
|
||||
@@ -785,7 +788,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
|
||||
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
||||
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
||||
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
|
||||
P a82e6b4585b9ddba581204976cd5ea8704339185
|
||||
R 1d0679ec078fa3ba616176fe55ef6412
|
||||
U dan
|
||||
Z 0057f18ebe7740aa86b9e7dd3d9cc373
|
||||
P 701ef64b3dbf45e52043e79e528002bd4b7a21e2
|
||||
R cb8cb67a829d9e95c52b1a4b63eff53d
|
||||
U drh
|
||||
Z 1976ade310e3b5bdf46e1315b02ad967
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
Version: GnuPG v1.4.6 (GNU/Linux)
|
||||
|
||||
iD8DBQFLXkSKoxKgR168RlERAgmwAJ9CIRstwSjmL+knTtYPhAE+dBOIuwCeKnSn
|
||||
sHGNe72f31mnCtT6hRPItX8=
|
||||
=lwNk
|
||||
-----END PGP SIGNATURE-----
|
||||
|
||||
@@ -1 +1 @@
|
||||
701ef64b3dbf45e52043e79e528002bd4b7a21e2
|
||||
5dcfb0c9e420d27e54a299b3991b98776651a507
|
||||
11
src/build.c
11
src/build.c
@@ -3402,6 +3402,7 @@ int sqlite3OpenTempDatabase(Parse *pParse){
|
||||
sqlite3 *db = pParse->db;
|
||||
if( db->aDb[1].pBt==0 && !pParse->explain ){
|
||||
int rc;
|
||||
Btree *pBt;
|
||||
static const int flags =
|
||||
SQLITE_OPEN_READWRITE |
|
||||
SQLITE_OPEN_CREATE |
|
||||
@@ -3409,17 +3410,19 @@ int sqlite3OpenTempDatabase(Parse *pParse){
|
||||
SQLITE_OPEN_DELETEONCLOSE |
|
||||
SQLITE_OPEN_TEMP_DB;
|
||||
|
||||
rc = sqlite3BtreeFactory(db, 0, 0, SQLITE_DEFAULT_CACHE_SIZE, flags,
|
||||
&db->aDb[1].pBt);
|
||||
rc = sqlite3BtreeFactory(db, 0, 0, SQLITE_DEFAULT_CACHE_SIZE, flags, &pBt);
|
||||
if( rc!=SQLITE_OK ){
|
||||
sqlite3ErrorMsg(pParse, "unable to open a temporary database "
|
||||
"file for storing temporary tables");
|
||||
pParse->rc = rc;
|
||||
return 1;
|
||||
}
|
||||
db->aDb[1].pBt = pBt;
|
||||
assert( db->aDb[1].pSchema );
|
||||
sqlite3PagerJournalMode(sqlite3BtreePager(db->aDb[1].pBt),
|
||||
db->dfltJournalMode);
|
||||
if( SQLITE_NOMEM==sqlite3BtreeSetPageSize(pBt, db->nextPagesize, -1, 0) ){
|
||||
db->mallocFailed = 1;
|
||||
}
|
||||
sqlite3PagerJournalMode(sqlite3BtreePager(pBt), db->dfltJournalMode);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
4
src/os.c
4
src/os.c
@@ -112,11 +112,11 @@ int sqlite3OsOpen(
|
||||
){
|
||||
int rc;
|
||||
DO_OS_MALLOC_TEST(0);
|
||||
/* 0x7f1f is a mask of SQLITE_OPEN_ flags that are valid to be passed
|
||||
/* 0x7f3f is a mask of SQLITE_OPEN_ flags that are valid to be passed
|
||||
** down into the VFS layer. Some SQLITE_OPEN_ flags (for example,
|
||||
** SQLITE_OPEN_FULLMUTEX or SQLITE_OPEN_SHAREDCACHE) are blocked before
|
||||
** reaching the VFS. */
|
||||
rc = pVfs->xOpen(pVfs, zPath, pFile, flags & 0x7f1f, pFlagsOut);
|
||||
rc = pVfs->xOpen(pVfs, zPath, pFile, flags & 0x7f3f, pFlagsOut);
|
||||
assert( rc==SQLITE_OK || pFile->pMethods==0 );
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -188,6 +188,32 @@ foreach PGSZ {512 2048 4096 8192} {
|
||||
ifcapable {vacuum} {execsql VACUUM}
|
||||
} {}
|
||||
integrity_check pagesize-2.$PGSZ.17
|
||||
|
||||
db close
|
||||
file delete -force test.db
|
||||
sqlite3 db test.db
|
||||
do_test pagesize-2.$PGSZ.30 {
|
||||
execsql "
|
||||
CREATE TABLE t1(x);
|
||||
PRAGMA temp.page_size=$PGSZ;
|
||||
CREATE TEMP TABLE t2(y);
|
||||
PRAGMA main.page_size;
|
||||
PRAGMA temp.page_size;
|
||||
"
|
||||
} [list 1024 $PGSZ]
|
||||
|
||||
db close
|
||||
file delete -force test.db
|
||||
sqlite3 db test.db
|
||||
do_test pagesize-2.$PGSZ.40 {
|
||||
execsql "
|
||||
PRAGMA page_size=$PGSZ;
|
||||
CREATE TABLE t1(x);
|
||||
CREATE TEMP TABLE t2(y);
|
||||
PRAGMA main.page_size;
|
||||
PRAGMA temp.page_size;
|
||||
"
|
||||
} [list $PGSZ $PGSZ]
|
||||
}
|
||||
|
||||
finish_test
|
||||
|
||||
Reference in New Issue
Block a user