From: drh Date: Mon, 5 May 2014 19:57:09 +0000 (+0000) Subject: Try to reduce the amount of memory used to hold the schema when X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3bb8bfdb820ee10e6fc936ec78a1462f45e7af09;p=thirdparty%2Fsqlite.git Try to reduce the amount of memory used to hold the schema when PRAGMA ignore_check_constraints is active. FossilOrigin-Name: 35a9f3f1787ed20b72a22cdf86cb8b8b0f4976cc --- diff --git a/manifest b/manifest index 2785d56cb3..5c2174fb5d 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Centralize\sand\sreform\suse\sof\sthe\sWin32\srelated\sinclude\sfiles. -D 2014-05-05T18:24:47.522 +C Try\sto\sreduce\sthe\samount\sof\smemory\sused\sto\shold\sthe\sschema\swhen\nPRAGMA\signore_check_constraints\sis\sactive. +D 2014-05-05T19:57:09.081 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in dd2b1aba364ff9b05de41086f74407f285c57670 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -168,7 +168,7 @@ F src/btmutex.c 976f45a12e37293e32cae0281b15a21d48a8aaa7 F src/btree.c 6c9b51abd404ce5b78b173b6f2248e8cb824758c F src/btree.h d79306df4ed9181b48916737fe8871a4392c4594 F src/btreeInt.h cf180d86b2e9e418f638d65baa425c4c69c0e0e3 -F src/build.c 02665ca158431a0926b10cbd7d8178a4c9fc4a22 +F src/build.c 7fec8e35d4786f307517010e15bb1de1bd9408b5 F src/callback.c 174e3c8656bc29f91d710ab61550d16eea34be98 F src/complete.c dc1d136c0feee03c2f7550bafc0d29075e36deac F src/ctime.c 0231df905e2c4abba4483ee18ffc05adc321df2a @@ -214,7 +214,7 @@ F src/parse.y 22d6a074e5f5a7258947a1dc55a9bf946b765dd0 F src/pcache.c d8eafac28290d4bb80332005435db44991d07fc2 F src/pcache.h a5e4f5d9f5d592051d91212c5949517971ae6222 F src/pcache1.c 102e6f5a2fbc646154463eb856d1fd716867b64c -F src/pragma.c 810ef31ccfaa233201dcf100637a9777cc24e897 +F src/pragma.c f89b68223ab587c2d9e425c519dc2654373783f8 F src/prepare.c 677521ab7132615a8a26107a1d1c3132f44ae337 F src/printf.c e5a0005f8b3de21f85da6a709d2fbee76775bf4b F src/random.c d10c1f85b6709ca97278428fd5db5bbb9c74eece @@ -225,7 +225,7 @@ F src/shell.c 2afe7a7154e97be0c74c5feacf09626bda8493be F src/sqlite.h.in bde98816e1ba0c9ffef50afe7b32f4e5a8f54fe0 F src/sqlite3.rc 11094cc6a157a028b301a9f06b3d03089ea37c3e F src/sqlite3ext.h 886f5a34de171002ad46fae8c36a7d8051c190fc -F src/sqliteInt.h b2947801eccefd7ba3e5f14e1353289351a83cf3 +F src/sqliteInt.h b1707e267c6a2a4a1cd09ce01d235f150f49e4aa F src/sqliteLimit.h 164b0e6749d31e0daa1a4589a169d31c0dec7b3d F src/status.c 7ac05a5c7017d0b9f0b4bcd701228b784f987158 F src/table.c 2cd62736f845d82200acfa1287e33feb3c15d62e @@ -1168,7 +1168,10 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01 F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff -P 4760504396bcf44528eb8de9ed7aa5d9659c54b6 a3cfd81339267c87db511cedf35ec209ee1f1a72 -R 938ab94058764b9d56f0ca54851e9d8f -U mistachkin -Z 010c73dcd5fc4fed61a248b3b687b42d +P 857f2baf9b722e4eb1ac0d50fe03e32d5176185b +R 69cfb806886499369b394e960a7bda2c +T *branch * reduce-schema-size +T *sym-reduce-schema-size * +T -sym-trunk * +U drh +Z 4e457bba1bbaad4242f130453c9a00dd diff --git a/manifest.uuid b/manifest.uuid index 691d0d795d..95e024fa9f 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -857f2baf9b722e4eb1ac0d50fe03e32d5176185b \ No newline at end of file +35a9f3f1787ed20b72a22cdf86cb8b8b0f4976cc \ No newline at end of file diff --git a/src/build.c b/src/build.c index a79abed3b6..bd43a3604d 100644 --- a/src/build.c +++ b/src/build.c @@ -1306,7 +1306,10 @@ void sqlite3AddCheckConstraint( ){ #ifndef SQLITE_OMIT_CHECK Table *pTab = pParse->pNewTable; - if( pTab && !IN_DECLARE_VTAB ){ + if( pTab + && !IN_DECLARE_VTAB + && (pParse->db->flags & SQLITE_IgnoreChecks)==0 + ){ pTab->pCheck = sqlite3ExprListAppend(pParse, pTab->pCheck, pCheckExpr); if( pParse->constraintName.n ){ sqlite3ExprListSetName(pParse, pTab->pCheck, &pParse->constraintName, 1); diff --git a/src/pragma.c b/src/pragma.c index 4c69ceb4fd..7bc593102f 100644 --- a/src/pragma.c +++ b/src/pragma.c @@ -1406,6 +1406,7 @@ void sqlite3Pragma( */ sqlite3VdbeAddOp2(v, OP_Expire, 0, 0); setAllPagerFlags(db); + if( mask==SQLITE_IgnoreChecks ) sqlite3ResetAllSchemasOfConnection(db); } break; } diff --git a/src/sqliteInt.h b/src/sqliteInt.h index 4bd65a690f..5f0382d40b 100644 --- a/src/sqliteInt.h +++ b/src/sqliteInt.h @@ -1882,13 +1882,13 @@ struct Expr { ** access them will result in a segfault or malfunction. *********************************************************************/ -#if SQLITE_MAX_EXPR_DEPTH>0 - int nHeight; /* Height of the tree headed by this node */ -#endif int iTable; /* TK_COLUMN: cursor number of table holding column ** TK_REGISTER: register number ** TK_TRIGGER: 1 -> new, 0 -> old ** EP_Unlikely: 1000 times likelihood */ +#if SQLITE_MAX_EXPR_DEPTH>0 + int nHeight; /* Height of the tree headed by this node */ +#endif ynVar iColumn; /* TK_COLUMN: column index. -1 for rowid. ** TK_VARIABLE: variable number (always >= 1). */ i16 iAgg; /* Which entry in pAggInfo->aCol[] or ->aFunc[] */