/ 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
676
677
678
679
680
681



682
683
684
685
686
687
688
#endif
  *ppStmt = 0;
  if( !sqlite3SafetyCheckOk(db)||zSql==0 ){
    return SQLITE_MISUSE_BKPT;
  }
  sqlite3_mutex_enter(db->mutex);
  sqlite3BtreeEnterAll(db);



  rc = sqlite3Prepare(db, zSql, nBytes, prepFlags, pOld, ppStmt, pzTail);
  if( rc==SQLITE_SCHEMA ){
    sqlite3ResetOneSchema(db, -1);
    sqlite3_finalize(*ppStmt);
    rc = sqlite3Prepare(db, zSql, nBytes, prepFlags, pOld, ppStmt, pzTail);
  }
  sqlite3BtreeLeaveAll(db);







>
>
>







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

Changes to src/sqlite.h.in.

3549
3550
3551
3552
3553
3554
3555

3556
3557
3558
3559
3560
3561
3562
** [sqlite3_finalize()] relatively soon. The current implementation acts
** on this hint by avoiding the use of [lookaside memory] so as not to
** deplete the limited store of lookaside memory. Future versions of
** SQLite may act on this hint differently.
** </dl>
*/
#define SQLITE_PREPARE_PERSISTENT              0x01


/*
** CAPI3REF: Compiling An SQL Statement
** KEYWORDS: {SQL statement compiler}
** METHOD: sqlite3
** CONSTRUCTOR: sqlite3_stmt
**







>







3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
** [sqlite3_finalize()] relatively soon. The current implementation acts
** on this hint by avoiding the use of [lookaside memory] so as not to
** deplete the limited store of lookaside memory. Future versions of
** SQLite may act on this hint differently.
** </dl>
*/
#define SQLITE_PREPARE_PERSISTENT              0x01
#define SQLITE_PREPARE_NOOP_UPDATE             0x02

/*
** CAPI3REF: Compiling An SQL Statement
** KEYWORDS: {SQL statement compiler}
** METHOD: sqlite3
** CONSTRUCTOR: sqlite3_stmt
**

Changes to src/update.c.

233
234
235
236
237
238
239

240

241
242
243
244
245
246
247
  ** for each column to be updated in the pChanges array.  For each
  ** column to be updated, make sure we have authorization to change
  ** that column.
  */
  chngRowid = chngPk = 0;
  for(i=0; i<pChanges->nExpr; i++){
#if defined(SQLITE_ENABLE_NOOP_UPDATE) && !defined(SQLITE_OMIT_FLAG_PRAGMAS)

    if( db->flags & SQLITE_NoopUpdate ){

      Token x;
      sqlite3ExprDelete(db, pChanges->a[i].pExpr);
      x.z = pChanges->a[i].zName;
      x.n = sqlite3Strlen30(x.z);
      pChanges->a[i].pExpr =
         sqlite3PExpr(pParse, TK_UPLUS, sqlite3ExprAlloc(db, TK_ID, &x, 0), 0);
      if( db->mallocFailed ) goto update_cleanup;







>
|
>







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