/ Check-in [de2e3717]
Login

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

Overview
Comment:Add the highly-experimental "PRAGMA noop_update=TRUE" command.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | pragma-noop-update
Files: files | file ages | folders
SHA3-256: de2e371757d2031cefc4bbae29d746a768c126a6c8443bb0f9ddebee7e69240b
User & Date: drh 2017-09-12 18:49:47
Context
2017-09-12
20:09
Add the highly-experimental "PRAGMA noop_update=TRUE" command. check-in: afe45271 user: drh tags: begin-concurrent-pnu
18:49
Add the highly-experimental "PRAGMA noop_update=TRUE" command. Leaf check-in: de2e3717 user: drh tags: pragma-noop-update
15:05
Fix an error in [b22cdd67] that can cause a negative infinity to be (rarely) reported as a positive infinity. check-in: 9780b23c user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pragma.h.

   436    436    {/* zName:     */ "module_list",
   437    437     /* ePragTyp:  */ PragTyp_MODULE_LIST,
   438    438     /* ePragFlg:  */ PragFlg_Result0,
   439    439     /* ColNames:  */ 31, 1,
   440    440     /* iArg:      */ 0 },
   441    441   #endif
   442    442   #endif
          443  +#endif
          444  +#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
          445  +#if defined(SQLITE_DEBUG)
          446  + {/* zName:     */ "noop_update",
          447  +  /* ePragTyp:  */ PragTyp_FLAG,
          448  +  /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
          449  +  /* ColNames:  */ 0, 0,
          450  +  /* iArg:      */ SQLITE_NoopUpdate },
          451  +#endif
   443    452   #endif
   444    453    {/* zName:     */ "optimize",
   445    454     /* ePragTyp:  */ PragTyp_OPTIMIZE,
   446    455     /* ePragFlg:  */ PragFlg_Result1|PragFlg_NeedSchema,
   447    456     /* ColNames:  */ 0, 0,
   448    457     /* iArg:      */ 0 },
   449    458   #if !defined(SQLITE_OMIT_PAGER_PRAGMAS)
................................................................................
   642    651    {/* zName:     */ "writable_schema",
   643    652     /* ePragTyp:  */ PragTyp_FLAG,
   644    653     /* ePragFlg:  */ PragFlg_Result0|PragFlg_NoColumns1,
   645    654     /* ColNames:  */ 0, 0,
   646    655     /* iArg:      */ SQLITE_WriteSchema },
   647    656   #endif
   648    657   };
   649         -/* Number of pragmas: 60 on by default, 77 total. */
          658  +/* Number of pragmas: 60 on by default, 78 total. */

Changes to src/sqliteInt.h.

  1487   1487   #define SQLITE_DeferFKs       0x00080000  /* Defer all FK constraints */
  1488   1488   #define SQLITE_QueryOnly      0x00100000  /* Disable database changes */
  1489   1489   #define SQLITE_CellSizeCk     0x00200000  /* Check btree cell sizes on load */
  1490   1490   #define SQLITE_Fts3Tokenizer  0x00400000  /* Enable fts3_tokenizer(2) */
  1491   1491   #define SQLITE_EnableQPSG     0x00800000  /* Query Planner Stability Guarantee */
  1492   1492   /* Flags used only if debugging */
  1493   1493   #ifdef SQLITE_DEBUG
         1494  +#define SQLITE_NoopUpdate     0x04000000  /* UPDATE operations are no-ops */
  1494   1495   #define SQLITE_SqlTrace       0x08000000  /* Debug print SQL as it executes */
  1495   1496   #define SQLITE_VdbeListing    0x10000000  /* Debug listings of VDBE programs */
  1496   1497   #define SQLITE_VdbeTrace      0x20000000  /* True to trace VDBE execution */
  1497   1498   #define SQLITE_VdbeAddopTrace 0x40000000  /* Trace sqlite3VdbeAddOp() calls */
  1498   1499   #define SQLITE_VdbeEQP        0x80000000  /* Debug EXPLAIN QUERY PLAN */
  1499   1500   #endif
  1500   1501   

Changes to src/update.c.

   219    219     ** of the UPDATE statement.  Also find the column index
   220    220     ** for each column to be updated in the pChanges array.  For each
   221    221     ** column to be updated, make sure we have authorization to change
   222    222     ** that column.
   223    223     */
   224    224     chngRowid = chngPk = 0;
   225    225     for(i=0; i<pChanges->nExpr; i++){
          226  +#if defined(SQLITE_DEBUG) && !defined(SQLITE_OMIT_FLAG_PRAGMAS)
          227  +    if( db->flags & SQLITE_NoopUpdate ){
          228  +      Token x;
          229  +      sqlite3ExprDelete(db, pChanges->a[i].pExpr);
          230  +      x.z = pChanges->a[i].zName;
          231  +      x.n = sqlite3Strlen30(x.z);
          232  +      pChanges->a[i].pExpr =
          233  +         sqlite3PExpr(pParse, TK_UPLUS, sqlite3ExprAlloc(db, TK_ID, &x, 0), 0);
          234  +      if( db->mallocFailed ) goto update_cleanup;
          235  +    }
          236  +#endif
   226    237       if( sqlite3ResolveExprNames(&sNC, pChanges->a[i].pExpr) ){
   227    238         goto update_cleanup;
   228    239       }
   229    240       for(j=0; j<pTab->nCol; j++){
   230    241         if( sqlite3StrICmp(pTab->aCol[j].zName, pChanges->a[i].zName)==0 ){
   231    242           if( j==pTab->iPKey ){
   232    243             chngRowid = 1;

Changes to tool/mkpragmatab.tcl.

   105    105     ARG:  SQLITE_SqlTrace|SQLITE_VdbeListing|SQLITE_VdbeTrace
   106    106     IF:   !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   107    107     IF:   defined(SQLITE_DEBUG)
   108    108   
   109    109     NAME: vdbe_eqp
   110    110     TYPE: FLAG
   111    111     ARG:  SQLITE_VdbeEQP
          112  +  IF:   !defined(SQLITE_OMIT_FLAG_PRAGMAS)
          113  +  IF:   defined(SQLITE_DEBUG)
          114  +
          115  +  NAME: noop_update
          116  +  TYPE: FLAG
          117  +  ARG:  SQLITE_NoopUpdate
   112    118     IF:   !defined(SQLITE_OMIT_FLAG_PRAGMAS)
   113    119     IF:   defined(SQLITE_DEBUG)
   114    120   
   115    121     NAME: ignore_check_constraints
   116    122     TYPE: FLAG
   117    123     ARG:  SQLITE_IgnoreChecks
   118    124     IF:   !defined(SQLITE_OMIT_FLAG_PRAGMAS)