1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-12-04 20:02:48 +03:00

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

@@ -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;
}
}
}