1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Provide the SQLITE_MAX_SCHEMA_RETRY compile-time parameter for adjusting the

number of reparse attempts after a schema change.

FossilOrigin-Name: 8dca748b23fa6f9abf47a186dcd1766f4dcf3ab7
This commit is contained in:
drh
2011-06-23 01:42:53 +00:00
parent e3f031686d
commit 24e713d9b3
3 changed files with 16 additions and 8 deletions

View File

@@ -459,6 +459,14 @@ end_of_step:
return (rc&db->errMask);
}
/*
** The maximum number of times that a statement will try to reparse
** itself before giving up and returning SQLITE_SCHEMA.
*/
#ifndef SQLITE_MAX_SCHEMA_RETRY
# define SQLITE_MAX_SCHEMA_RETRY 5
#endif
/*
** This is the top-level implementation of sqlite3_step(). Call
** sqlite3Step() to do most of the work. If a schema error occurs,
@@ -477,7 +485,7 @@ int sqlite3_step(sqlite3_stmt *pStmt){
db = v->db;
sqlite3_mutex_enter(db->mutex);
while( (rc = sqlite3Step(v))==SQLITE_SCHEMA
&& cnt++ < 5
&& cnt++ < SQLITE_MAX_SCHEMA_RETRY
&& (rc2 = rc = sqlite3Reprepare(v))==SQLITE_OK ){
sqlite3_reset(pStmt);
v->expired = 0;