Enable constant expression factoring even if no tables are read and no

transaction is started.

FossilOrigin-Name: a45b87713c0afca2be2ace9500513620a024c0a2
This commit is contained in:
drh 2014-02-08 04:24:37 +00:00
parent aceb31b120
commit e0e261a473
4 changed files with 15 additions and 12 deletions

View File

@ -1,5 +1,5 @@
C Change\sthe\sOP_Trace\sopcode\sto\sOP_Init\sand\sgive\sit\sthe\sability\sto\sjump\sto\sthe\ninitialization\scode\sat\sthe\sbottom\sof\sthe\sprogram,\sthus\savoiding\sthe\sneed\sfor\nan\sextra\sOP_Goto.
D 2014-02-08T01:40:27.230
C Enable\sconstant\sexpression\sfactoring\seven\sif\sno\stables\sare\sread\sand\sno\ntransaction\sis\sstarted.
D 2014-02-08T04:24:37.181
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 2ef13430cd359f7b361bb863504e227b25cc7f81
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@ -169,7 +169,7 @@ F src/btmutex.c 976f45a12e37293e32cae0281b15a21d48a8aaa7
F src/btree.c 7b2c3cd16deedff7f4904f2e871e7b77328b9872
F src/btree.h a61ddebc78c66795a2b93181321a116746302cc9
F src/btreeInt.h f038e818bfadf75afbd09819ed93c26a333d39e0
F src/build.c 1bc258476158bfe7707d21daa5221dd95c03d37c
F src/build.c 13b9d82181d95af7b00ec8a8e1304bac096432d4
F src/callback.c 174e3c8656bc29f91d710ab61550d16eea34be98
F src/complete.c dc1d136c0feee03c2f7550bafc0d29075e36deac
F src/ctime.c 77779efbe78dd678d84bfb4fc2e87b6b6ad8dccd
@ -219,7 +219,7 @@ F src/printf.c 85d07756e45d7496d19439dcae3e6e9e0090f269
F src/random.c d10c1f85b6709ca97278428fd5db5bbb9c74eece
F src/resolve.c 7eda9097b29fcf3d2b42fdc17d1de672134e09b6
F src/rowset.c 64655f1a627c9c212d9ab497899e7424a34222e0
F src/select.c 0b6011a51496c916914f6fba11c3a6a0042a0439
F src/select.c deb41db22f671b4f2a3e0e48a99b896e227aefdb
F src/shell.c 7dedf7367ee49050b0366bf8dbc8ec2bd15b42c7
F src/sqlite.h.in eed7f7d66a60daaa7b4a597dcd9bad87aad9611b
F src/sqlite3.rc 11094cc6a157a028b301a9f06b3d03089ea37c3e
@ -1152,7 +1152,7 @@ F tool/vdbe-compress.tcl 0cf56e9263a152b84da86e75a5c0cdcdb7a47891
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01
F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff
P 5a88b6a7aef3a0d5380e19eee2ee38439cc9b08b
R a9b46d5717be39fdc7732934fcbad0a2
P 192dea97316144f15f6dd0eabff08a0bf9ef203e
R e90c019788474c8101c0d70d2228b12b
U drh
Z 07d97eaa48af367d9c2a599f3698a466
Z 46adb7aa7b0c0d2f1d0d873b94d6c7bb

View File

@ -1 +1 @@
192dea97316144f15f6dd0eabff08a0bf9ef203e
a45b87713c0afca2be2ace9500513620a024c0a2

View File

@ -149,7 +149,7 @@ void sqlite3FinishCoding(Parse *pParse){
** transaction on each used database and to verify the schema cookie
** on each used database.
*/
if( db->mallocFailed==0 && pParse->cookieMask ){
if( db->mallocFailed==0 && (pParse->cookieMask || pParse->pConstExpr) ){
yDbMask mask;
int iDb, i;
assert( sqlite3VdbeGetOp(v, 0)->opcode==OP_Init );
@ -3846,9 +3846,6 @@ void sqlite3CodeVerifySchema(Parse *pParse, int iDb){
if( !OMIT_TEMPDB && iDb==1 ){
sqlite3OpenTempDatabase(pToplevel);
}
if( pToplevel==pParse && OptimizationEnabled(db,SQLITE_FactorOutConst) ){
pParse->okConstFactor = 1;
}
}
}

View File

@ -1616,6 +1616,12 @@ Vdbe *sqlite3GetVdbe(Parse *pParse){
if( v==0 ){
v = pParse->pVdbe = sqlite3VdbeCreate(pParse);
if( v ) sqlite3VdbeAddOp0(v, OP_Init);
if( pParse->pToplevel==0
&& OptimizationEnabled(pParse->db,SQLITE_FactorOutConst)
){
pParse->okConstFactor = 1;
}
}
return v;
}