/ Check-in [8dca748b]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Provide the SQLITE_MAX_SCHEMA_RETRY compile-time parameter for adjusting the number of reparse attempts after a schema change.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 8dca748b23fa6f9abf47a186dcd1766f4dcf3ab7
User & Date: drh 2011-06-23 01:42:53
Context
2011-06-23
16:18
Do not do affinity transformations on inserts into an index for the manifestation of a view or subquery. Fix for ticket [91e2e8ba6ff2e2]. check-in: 0b3174e0 user: drh tags: trunk
02:30
Pull the latest changes from trunk into the apple-osx branch. check-in: b5acda04 user: drh tags: apple-osx
02:11
Pull the latest trunk changes into the sessions branch. check-in: 5d95b429 user: drh tags: sessions
01:42
Provide the SQLITE_MAX_SCHEMA_RETRY compile-time parameter for adjusting the number of reparse attempts after a schema change. check-in: 8dca748b user: drh tags: trunk
01:07
Remove unused variables from test_vfs.c check-in: 07884cc2 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vdbeapi.c.

   455    455       ** caller. Set the error code in the database handle to the same value.
   456    456       */ 
   457    457       rc = db->errCode = p->rc;
   458    458     }
   459    459     return (rc&db->errMask);
   460    460   }
   461    461   
          462  +/*
          463  +** The maximum number of times that a statement will try to reparse
          464  +** itself before giving up and returning SQLITE_SCHEMA.
          465  +*/
          466  +#ifndef SQLITE_MAX_SCHEMA_RETRY
          467  +# define SQLITE_MAX_SCHEMA_RETRY 5
          468  +#endif
          469  +
   462    470   /*
   463    471   ** This is the top-level implementation of sqlite3_step().  Call
   464    472   ** sqlite3Step() to do most of the work.  If a schema error occurs,
   465    473   ** call sqlite3Reprepare() and try again.
   466    474   */
   467    475   int sqlite3_step(sqlite3_stmt *pStmt){
   468    476     int rc = SQLITE_OK;      /* Result from sqlite3Step() */
................................................................................
   473    481   
   474    482     if( vdbeSafetyNotNull(v) ){
   475    483       return SQLITE_MISUSE_BKPT;
   476    484     }
   477    485     db = v->db;
   478    486     sqlite3_mutex_enter(db->mutex);
   479    487     while( (rc = sqlite3Step(v))==SQLITE_SCHEMA
   480         -         && cnt++ < 5
          488  +         && cnt++ < SQLITE_MAX_SCHEMA_RETRY
   481    489            && (rc2 = rc = sqlite3Reprepare(v))==SQLITE_OK ){
   482    490       sqlite3_reset(pStmt);
   483    491       v->expired = 0;
   484    492     }
   485    493     if( rc2!=SQLITE_OK && ALWAYS(v->isPrepareV2) && ALWAYS(db->pErr) ){
   486    494       /* This case occurs after failing to recompile an sql statement. 
   487    495       ** The error message from the SQL compiler has already been loaded