diff options
author | drh <drh@noemail.net> | 2013-04-06 18:06:51 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2013-04-06 18:06:51 +0000 |
commit | 60625313b04bd9dc09c8f770095b9b02b24a407c (patch) | |
tree | f2fa8c8013549d705c8304326470899004e239e3 /src/legacy.c | |
parent | abd6d84a11781229fb3f09a03c45516f1081a4dc (diff) | |
download | sqlite-60625313b04bd9dc09c8f770095b9b02b24a407c.tar.gz sqlite-60625313b04bd9dc09c8f770095b9b02b24a407c.zip |
Increase the default SQLITE_MAX_SCHEMA_RETRY to 50. Make sure that macro
covers every case where a prepared statement might need to be reprepared due
to a schema change. The sqlite3_exec() interface now uses
sqlite3_prepare_v2().
FossilOrigin-Name: c1d7304c80c4a6244c8a9f6fad1eebd0f339c724
Diffstat (limited to 'src/legacy.c')
-rw-r--r-- | src/legacy.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/legacy.c b/src/legacy.c index ebab2de37..94649ae70 100644 --- a/src/legacy.c +++ b/src/legacy.c @@ -38,7 +38,6 @@ int sqlite3_exec( const char *zLeftover; /* Tail of unprocessed SQL */ sqlite3_stmt *pStmt = 0; /* The current SQL statement */ char **azCols = 0; /* Names of result columns */ - int nRetry = 0; /* Number of retry attempts */ int callbackIsInit; /* True if callback data is initialized */ if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT; @@ -46,12 +45,12 @@ int sqlite3_exec( sqlite3_mutex_enter(db->mutex); sqlite3Error(db, SQLITE_OK, 0); - while( (rc==SQLITE_OK || (rc==SQLITE_SCHEMA && (++nRetry)<2)) && zSql[0] ){ + while( rc==SQLITE_OK && zSql[0] ){ int nCol; char **azVals = 0; pStmt = 0; - rc = sqlite3_prepare(db, zSql, -1, &pStmt, &zLeftover); + rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, &zLeftover); assert( rc==SQLITE_OK || pStmt==0 ); if( rc!=SQLITE_OK ){ continue; @@ -108,11 +107,8 @@ int sqlite3_exec( if( rc!=SQLITE_ROW ){ rc = sqlite3VdbeFinalize((Vdbe *)pStmt); pStmt = 0; - if( rc!=SQLITE_SCHEMA ){ - nRetry = 0; - zSql = zLeftover; - while( sqlite3Isspace(zSql[0]) ) zSql++; - } + zSql = zLeftover; + while( sqlite3Isspace(zSql[0]) ) zSql++; break; } } |