diff options
author | drh <drh@noemail.net> | 2011-06-23 01:42:53 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2011-06-23 01:42:53 +0000 |
commit | 24e713d9b32c8b45dee0516f49a34e93d2806d39 (patch) | |
tree | 5468810fc8cb33f7e36f07d88a14c7e8e3449001 /src/vdbeapi.c | |
parent | e3f031686db740cc776a8565f873ed09af8c6cd2 (diff) | |
download | sqlite-24e713d9b32c8b45dee0516f49a34e93d2806d39.tar.gz sqlite-24e713d9b32c8b45dee0516f49a34e93d2806d39.zip |
Provide the SQLITE_MAX_SCHEMA_RETRY compile-time parameter for adjusting the
number of reparse attempts after a schema change.
FossilOrigin-Name: 8dca748b23fa6f9abf47a186dcd1766f4dcf3ab7
Diffstat (limited to 'src/vdbeapi.c')
-rw-r--r-- | src/vdbeapi.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/vdbeapi.c b/src/vdbeapi.c index 5923a4c01..a87b5c9ac 100644 --- a/src/vdbeapi.c +++ b/src/vdbeapi.c @@ -460,6 +460,14 @@ end_of_step: } /* +** 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, ** call sqlite3Reprepare() and try again. @@ -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; |