Add a comment to prepare.c explaining why the lookaside buffer is disabled before sqlite3_exec() is called to parse a schema statement. No code changes. (CVS 6376)

FossilOrigin-Name: 8ca6a665650c9683a202f3ced17b14f7c85624bf
This commit is contained in:
danielk1977 2009-03-24 04:46:08 +00:00
parent 347a7cb35b
commit 4be6469146
3 changed files with 24 additions and 9 deletions

View File

@ -1,5 +1,5 @@
C Clarify\sthe\smeaning\sof\sa\scomment.\s\sNo\schanges\sto\scode.\s(CVS\s6375)
D 2009-03-23T21:37:04
C Add\sa\scomment\sto\sprepare.c\sexplaining\swhy\sthe\slookaside\sbuffer\sis\sdisabled\sbefore\ssqlite3_exec()\sis\scalled\sto\sparse\sa\sschema\sstatement.\sNo\scode\schanges.\s(CVS\s6376)
D 2009-03-24T04:46:08
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
F Makefile.in 583e87706abc3026960ed759aff6371faf84c211
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@ -150,7 +150,7 @@ F src/pcache.c fcf7738c83c4d3e9d45836b2334c8a368cc41274
F src/pcache.h 9b927ccc5a538e31b4c3bc7eec4f976db42a1324
F src/pcache1.c f587565f4ba0fd1772067eaa96814dce761b7a4c
F src/pragma.c 22ed04836aab8ce134c53be1ca896f3ad20fabdb
F src/prepare.c db64c97583b59d78a9eebd2bfc3e61d9f571ef12
F src/prepare.c 662b7d30574558822ca6f0621cbb7aef7e87cee3
F src/printf.c 9866a9a9c4a90f6d4147407f373df3fd5d5f9b6f
F src/random.c 676b9d7ac820fe81e6fb2394ac8c10cff7f38628
F src/resolve.c 094e44450371fb27869eb8bf679aacbe51fdc56d
@ -709,7 +709,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
P 8a9f3e66069146ad1b1bc2686567882dc87603a9
R 17883624947124ab6b43fc9ee555bc00
U drh
Z a1267e6bacfc9823586c154e140a6edf
P 7c2df04b52a40d5d1b744ad1097f7c12143d8c2c
R 703f5e83ff72a6ceec997ed32c6b6e4e
U danielk1977
Z 3f57c912d20fa971468a1ff4756c679d

View File

@ -1 +1 @@
7c2df04b52a40d5d1b744ad1097f7c12143d8c2c
8ca6a665650c9683a202f3ced17b14f7c85624bf

View File

@ -13,7 +13,7 @@
** interface, and routines that contribute to loading the database schema
** from disk.
**
** $Id: prepare.c,v 1.112 2009/03/23 17:11:27 danielk1977 Exp $
** $Id: prepare.c,v 1.113 2009/03/24 04:46:08 danielk1977 Exp $
*/
#include "sqliteInt.h"
@ -74,6 +74,21 @@ int sqlite3InitCallback(void *pInit, int argc, char **argv, char **NotUsed){
** But because db->init.busy is set to 1, no VDBE code is generated
** or executed. All the parser does is build the internal data
** structures that describe the table, index, or view.
**
** While the CREATE XXX statement is being processed, the lookaside
** buffer is disabled. One reason for this is that when running in
** shared cache mode, the objects allocated for the in-memory schema
** might be freed from within a call made on a different database
** connection to db (e.g. if the second connection executes a DROP
** TABLE statement). If the objects that make up the Table structure
** are allocated from within db's lookaside buffer, then db->mutex
** would have to be obtained before they could be freed. This would
** open the door to deadlock in a multi-threaded application.
**
** Another reason to disable the lookaside buffer is that lookaside
** gives the greatest performance boost when it is used to allocate
** and free small transient objects. The schema objects, which tend
** to have long lifetimes, are better allocated from the heap.
*/
char *zErr;
int rc;