Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | robustness fixes for preventing a finalized statement from being reused |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | apple-osx |
Files: | files | file ages | folders |
SHA1: |
a7a0c8d644873764cb799f9d6aacede4 |
User & Date: | adam 2010-01-19 23:50:21.000 |
Context
2010-01-20
| ||
01:26 | Update the Apple OS-X branch to include all of the latest changes in trunk. (check-in: 96499b1dd6 user: drh tags: apple-osx) | |
2010-01-19
| ||
23:50 | robustness fixes for preventing a finalized statement from being reused (check-in: a7a0c8d644 user: adam tags: apple-osx) | |
2010-01-06
| ||
13:12 | Update the OS-X branch to include all trunk changes through version 3.6.22. (check-in: 541e2b488e user: drh tags: apple-osx) | |
Changes
Changes to src/legacy.c.
︙ | ︙ | |||
40 41 42 43 44 45 46 47 48 49 50 51 52 53 | int rc = SQLITE_OK; /* Return code */ 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( zSql==0 ) zSql = ""; #ifdef SQLITE_ENABLE_SQLRR SRRecExec(db, zSql); #endif sqlite3_mutex_enter(db->mutex); sqlite3Error(db, SQLITE_OK, 0); while( (rc==SQLITE_OK || (rc==SQLITE_SCHEMA && (++nRetry)<2)) && zSql[0] ){ | > > > > | 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | int rc = SQLITE_OK; /* Return code */ 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; } if( zSql==0 ) zSql = ""; #ifdef SQLITE_ENABLE_SQLRR SRRecExec(db, zSql); #endif sqlite3_mutex_enter(db->mutex); sqlite3Error(db, SQLITE_OK, 0); while( (rc==SQLITE_OK || (rc==SQLITE_SCHEMA && (++nRetry)<2)) && zSql[0] ){ |
︙ | ︙ |
Changes to src/vdbeapi.c.
︙ | ︙ | |||
49 50 51 52 53 54 55 56 57 58 59 60 61 62 | rc = SQLITE_OK; }else{ Vdbe *v = (Vdbe*)pStmt; #ifdef SQLITE_ENABLE_SQLRR SRRecFinalize(pStmt); #endif sqlite3 *db = v->db; #if SQLITE_THREADSAFE sqlite3_mutex *mutex = v->db->mutex; #endif sqlite3_mutex_enter(mutex); rc = sqlite3VdbeFinalize(v); rc = sqlite3ApiExit(db, rc); sqlite3_mutex_leave(mutex); | > > > | 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | rc = SQLITE_OK; }else{ Vdbe *v = (Vdbe*)pStmt; #ifdef SQLITE_ENABLE_SQLRR SRRecFinalize(pStmt); #endif sqlite3 *db = v->db; if( db==0 ){ return SQLITE_MISUSE; } #if SQLITE_THREADSAFE sqlite3_mutex *mutex = v->db->mutex; #endif sqlite3_mutex_enter(mutex); rc = sqlite3VdbeFinalize(v); rc = sqlite3ApiExit(db, rc); sqlite3_mutex_leave(mutex); |
︙ | ︙ | |||
410 411 412 413 414 415 416 | /* ** 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. */ int sqlite3_step(sqlite3_stmt *pStmt){ int rc = SQLITE_MISUSE; | < < | | > > | 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 | /* ** 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. */ int sqlite3_step(sqlite3_stmt *pStmt){ int rc = SQLITE_MISUSE; Vdbe *v = (Vdbe*)pStmt; sqlite3 *db; if( v && ((db = v->db) != NULL)){ int cnt = 0; #ifdef SQLITE_ENABLE_SQLRR SRRecStep(pStmt); #endif sqlite3_mutex_enter(db->mutex); while( (rc = sqlite3Step(v))==SQLITE_SCHEMA && cnt++ < 5 |
︙ | ︙ |
Changes to src/vdbeaux.c.
︙ | ︙ | |||
62 63 64 65 66 67 68 | } /* ** Return the SQL associated with a prepared statement */ const char *sqlite3_sql(sqlite3_stmt *pStmt){ Vdbe *p = (Vdbe *)pStmt; | | | 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | } /* ** Return the SQL associated with a prepared statement */ const char *sqlite3_sql(sqlite3_stmt *pStmt){ Vdbe *p = (Vdbe *)pStmt; return ((p && p->isPrepareV2) ? p->zSql : 0); } /* ** Swap all content between two VDBE structures. */ void sqlite3VdbeSwap(Vdbe *pA, Vdbe *pB){ Vdbe tmp, *pTmp; |
︙ | ︙ | |||
2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 | releaseMemArray(p->aColName, p->nResColumn*COLNAME_N); vdbeFreeOpArray(db, p->aOp, p->nOp); sqlite3DbFree(db, p->aLabel); sqlite3DbFree(db, p->aColName); sqlite3DbFree(db, p->zSql); p->magic = VDBE_MAGIC_DEAD; sqlite3DbFree(db, p->pFree); sqlite3DbFree(db, p); } /* ** Make sure the cursor p is ready to read or write the row to which it ** was last positioned. Return an error code if an OOM fault or I/O error ** prevents us from positioning the cursor to its correct position. | > | 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 | releaseMemArray(p->aColName, p->nResColumn*COLNAME_N); vdbeFreeOpArray(db, p->aOp, p->nOp); sqlite3DbFree(db, p->aLabel); sqlite3DbFree(db, p->aColName); sqlite3DbFree(db, p->zSql); p->magic = VDBE_MAGIC_DEAD; sqlite3DbFree(db, p->pFree); p->db = NULL; sqlite3DbFree(db, p); } /* ** Make sure the cursor p is ready to read or write the row to which it ** was last positioned. Return an error code if an OOM fault or I/O error ** prevents us from positioning the cursor to its correct position. |
︙ | ︙ |