Avoid incrementing the SQLITE_LOOKASIDE_MISS_SIZE stat before sqlite3_open()

returns. Fix test script problem in lookaside.test.

FossilOrigin-Name: e461cb281959d8517296e3e4e934eba8206770b1a592cd7655b6567268da1634
This commit is contained in:
dan 2018-09-18 17:50:34 +00:00
parent 253c6ee1bf
commit c4b1e5e758
4 changed files with 13 additions and 9 deletions

View File

@ -1,5 +1,5 @@
C Enhance\stester.tcl\sso\sthat\swhen\s"--malloctrace=1"\sis\sspecified,\sthe\stest\ngenerates\sself-contained\sTcl\sscripts\sthat\spresent\sGUIs\sinstead\sof\s*.sql\sfiles\nthat\srequire\sa\sseparate\sprogram\sto\sinterpret.
D 2018-09-18T17:00:06.795
C Avoid\sincrementing\sthe\sSQLITE_LOOKASIDE_MISS_SIZE\sstat\sbefore\ssqlite3_open()\nreturns.\sFix\stest\sscript\sproblem\sin\slookaside.test.
D 2018-09-18T17:50:34.415
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
F Makefile.in 01e95208a78b57d056131382c493c963518f36da4c42b12a97eb324401b3a334
@ -466,7 +466,7 @@ F src/in-operator.md 10cd8f4bcd225a32518407c2fb2484089112fd71
F src/insert.c 0a214201afec77880a31a59c33d86b473a160fc5cc31981eab2041ae03d8bf2f
F src/legacy.c 134ab3e3fae00a0f67a5187981d6935b24b337bcf0f4b3e5c9fa5763da95bf4e
F src/loadext.c 30b140d0e5031924c56f802760506c0a235ced0dff9f3d95119aa86df12856e2
F src/main.c 1f54ee71990bfbf4cdc2dc79bdc33e7c4f54eef6922447b4c910f9b5885a4478
F src/main.c 6275ece0699a957c4709a7ebe29476f132adbe459d18a6b497e234e4669abf91
F src/malloc.c 07295435093ce354c6d9063ac05a2eeae28bd251d2e63c48b3d67c12c76f7e18
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
F src/mem1.c c12a42539b1ba105e3707d0e628ad70e611040d8f5e38cf942cee30c867083de
@ -1065,7 +1065,7 @@ F test/lock5.test c6c5e0ebcb21c61a572870cc86c0cb9f14cede38
F test/lock6.test ad5b387a3a8096afd3c68a55b9535056431b0cf5
F test/lock7.test 49f1eaff1cdc491cc5dee3669f3c671d9f172431
F test/lock_common.tcl 7ffb45accf6ee91c736df9bafe0806a44358f035
F test/lookaside.test b17c99ae3aef96a8c9fa6f6be33cc75b93d657cb791d3827302b6835b71941f7
F test/lookaside.test 5a828e7256f1ee4da8e1bdaa03373a3ccdb0f1ff98dfa82e9b76cb41a45b1083
F test/main.test 6bbb3999fd461eb8fb335cbab97409a3d7f91bbb8da60635e8be3e4a04a77772
F test/make-where7.tcl 05c16b5d4f5d6512881dfec560cb793915932ef9
F test/malloc.test 18dd1c4188c81ca79cf123527c71b19ee0c31feb9947fdffb0dc6ceb1436816a
@ -1767,7 +1767,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
P 3e1a2f6614eacb65e1dffe64c6292c809fc5808be2d9d7d103cfc57d7b32fcd9
R e3886b1f8760e45d3fbfc8f6d69183e6
P de2e3cbd08c00d235106c040fa472ec267ef8f1ec13c34ed7d16deac8d50b6cc
R 87b8b2ee28b1a1a8366c364e4fdd6314
U dan
Z 0af372fccee1295faf720b1e25ced7fe
Z 971302d914167dfdeae1d53b5caa351e

View File

@ -1 +1 @@
de2e3cbd08c00d235106c040fa472ec267ef8f1ec13c34ed7d16deac8d50b6cc
e461cb281959d8517296e3e4e934eba8206770b1a592cd7655b6567268da1634

View File

@ -3021,6 +3021,7 @@ static int openDatabase(
db->nDb = 2;
db->magic = SQLITE_MAGIC_BUSY;
db->aDb = db->aDbStatic;
db->lookaside.bDisable = 1;
assert( sizeof(db->aLimit)==sizeof(aHardLimit) );
memcpy(db->aLimit, aHardLimit, sizeof(db->aLimit));

View File

@ -24,7 +24,7 @@ ifcapable !lookaside {
# The tests in this file configure the lookaside allocator after a
# connection is opened. This will not work if there is any "presql"
# configured (SQL run within the [sqlite3] wrapper in tester.tcl).
if {[info exists ::G(perm:presql)]} {
if {[info exists ::G(perm:dbconfig)] && $::G(perm:dbconfig)!=""} {
finish_test
return
}
@ -35,7 +35,9 @@ catch {db close}
sqlite3_shutdown
sqlite3_initialize
autoinstall_test_functions
sqlite3 db test.db
db cache size 4
# Make sure sqlite3_db_config() and sqlite3_db_status are working.
#
@ -99,6 +101,7 @@ do_test lookaside-2.2 {
expr {$x==0 && $y<$z && $z>10 && $z<100}
} {1}
do_test lookaside-2.3 {
db eval {SELECT 1}
sqlite3_db_config_lookaside db 0 50 50
} {5} ;# SQLITE_BUSY
do_test lookaside-2.4 {