/ Changes On Branch noop-update-reprepare
Login

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

Changes In Branch noop-update-reprepare Excluding Merge-Ins

This is equivalent to a diff from dc0fc2aa7c to c25da6de1d

2018-12-03
19:29
Cherrypick a couple of fixes from begin-concurrent-pnu into this branch. The differences between the two branches are now that this one does not have "PRAGMA noop_update" or the mutex-free PRNG. (check-in: a56506b938 user: dan tags: begin-concurrent)
2018-02-20
21:00
Add extra code to log details when corruption is detected in the pointer-map structure maintained by the b-tree layer in begin-concurrent transactions. (check-in: 5702337160 user: dan tags: begin-concurrent-pnu)
2018-01-23
01:56
Enhance the PRAGMA noop_update statement so that the behavior persists across reprepare operations. (Leaf check-in: c25da6de1d user: drh tags: noop-update-reprepare)
2018-01-04
18:36
Fix problem causing free-list corruption when merging free-lists for two concurrent transactions that have both used page X as an in-memory free-list trunk page, where X lies past the end of the initial database images. (check-in: dc0fc2aa7c user: dan tags: begin-concurrent-pnu)
2018-01-02
19:57
Fix a spurious SQLITE_CORRUPT error that could occur within a COMMIT of a concurrent transaction. (check-in: 50c8952c92 user: dan tags: begin-concurrent-pnu)

Changes to src/prepare.c.

   675    675   #endif
   676    676     *ppStmt = 0;
   677    677     if( !sqlite3SafetyCheckOk(db)||zSql==0 ){
   678    678       return SQLITE_MISUSE_BKPT;
   679    679     }
   680    680     sqlite3_mutex_enter(db->mutex);
   681    681     sqlite3BtreeEnterAll(db);
          682  +#if defined(SQLITE_ENABLE_NOOP_UPDATE) && !defined(SQLITE_OMIT_FLAG_PRAGMAS)
          683  +  if( db->flags & SQLITE_NoopUpdate ) prepFlags |= SQLITE_PREPARE_NOOP_UPDATE;
          684  +#endif
   682    685     rc = sqlite3Prepare(db, zSql, nBytes, prepFlags, pOld, ppStmt, pzTail);
   683    686     if( rc==SQLITE_SCHEMA ){
   684    687       sqlite3ResetOneSchema(db, -1);
   685    688       sqlite3_finalize(*ppStmt);
   686    689       rc = sqlite3Prepare(db, zSql, nBytes, prepFlags, pOld, ppStmt, pzTail);
   687    690     }
   688    691     sqlite3BtreeLeaveAll(db);

Changes to src/sqlite.h.in.

  3549   3549   ** [sqlite3_finalize()] relatively soon. The current implementation acts
  3550   3550   ** on this hint by avoiding the use of [lookaside memory] so as not to
  3551   3551   ** deplete the limited store of lookaside memory. Future versions of
  3552   3552   ** SQLite may act on this hint differently.
  3553   3553   ** </dl>
  3554   3554   */
  3555   3555   #define SQLITE_PREPARE_PERSISTENT              0x01
         3556  +#define SQLITE_PREPARE_NOOP_UPDATE             0x02
  3556   3557   
  3557   3558   /*
  3558   3559   ** CAPI3REF: Compiling An SQL Statement
  3559   3560   ** KEYWORDS: {SQL statement compiler}
  3560   3561   ** METHOD: sqlite3
  3561   3562   ** CONSTRUCTOR: sqlite3_stmt
  3562   3563   **

Changes to src/update.c.

   233    233     ** for each column to be updated in the pChanges array.  For each
   234    234     ** column to be updated, make sure we have authorization to change
   235    235     ** that column.
   236    236     */
   237    237     chngRowid = chngPk = 0;
   238    238     for(i=0; i<pChanges->nExpr; i++){
   239    239   #if defined(SQLITE_ENABLE_NOOP_UPDATE) && !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   240         -    if( db->flags & SQLITE_NoopUpdate ){
          240  +    if( 0!=sqlite3GetVdbe(pParse)
          241  +     && 0!=(sqlite3VdbePrepareFlags(pParse->pVdbe) & SQLITE_PREPARE_NOOP_UPDATE)
          242  +    ){
   241    243         Token x;
   242    244         sqlite3ExprDelete(db, pChanges->a[i].pExpr);
   243    245         x.z = pChanges->a[i].zName;
   244    246         x.n = sqlite3Strlen30(x.z);
   245    247         pChanges->a[i].pExpr =
   246    248            sqlite3PExpr(pParse, TK_UPLUS, sqlite3ExprAlloc(db, TK_ID, &x, 0), 0);
   247    249         if( db->mallocFailed ) goto update_cleanup;