/ Check-in [49181427]
Login

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

Overview
Comment:Add the SQLITE_BUG_COMPATIBLE_20160819 compile-time option to omit the error message when an unrecognized argument is provided to the VACUUM command.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 491814272dce7e937b4734fcbc2ad69e12377b56
User & Date: drh 2017-02-18 13:47:11
Context
2017-02-20
14:30
Small grammar simplification. check-in: 0d8a868a user: drh tags: trunk
13:11
Merge fixes from trunk. check-in: ff213f2e user: drh tags: auto-analyze
2017-02-18
20:05
Add an optimization to OP_Column to speed up sequential OP_Column instructions that read earlier fields from the same cursor. Attempt to reorder OP_Column opcodes so as to take advantage of this. Leaf check-in: c1adf959 user: dan tags: sort-column-opcodes
13:47
Add the SQLITE_BUG_COMPATIBLE_20160819 compile-time option to omit the error message when an unrecognized argument is provided to the VACUUM command. check-in: 49181427 user: drh tags: trunk
2017-02-17
23:52
Fix the #endif location for an #ifndef SQLITE_UNTESTABLE macro in the command-line shell. check-in: 8cc9d74c user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/vacuum.c.

    94     94   ** not work if other processes are attached to the original database.
    95     95   ** And a power loss in between deleting the original and renaming the
    96     96   ** transient would cause the database file to appear to be deleted
    97     97   ** following reboot.
    98     98   */
    99     99   void sqlite3Vacuum(Parse *pParse, Token *pNm){
   100    100     Vdbe *v = sqlite3GetVdbe(pParse);
   101         -  int iDb = pNm ? sqlite3TwoPartName(pParse, pNm, pNm, &pNm) : 0;
   102         -  if( v && (iDb>=2 || iDb==0) ){
          101  +  int iDb = 0;
          102  +  if( v==0 ) return;
          103  +  if( pNm ){
          104  +#ifndef SQLITE_BUG_COMPATIBLE_20160819
          105  +    /* Default behavior:  Report an error if the argument to VACUUM is
          106  +    ** not recognized */
          107  +    iDb = sqlite3TwoPartName(pParse, pNm, pNm, &pNm);
          108  +    if( iDb<0 ) return;
          109  +#else
          110  +    /* When SQLITE_BUG_COMPATIBLE_20160819 is defined, unrecognized arguments
          111  +    ** to VACUUM are silently ignored.  This is a back-out of a bug fix that
          112  +    ** occurred on 2016-08-19 (https://www.sqlite.org/src/info/083f9e6270).
          113  +    ** The buggy behavior is required for binary compatibility with some
          114  +    ** legacy applications. */
          115  +    iDb = sqlite3FindDb(pParse->db, pNm);
          116  +    if( iDb<0 ) iDb = 0;
          117  +#endif
          118  +  }
          119  +  if( iDb!=1 ){
   103    120       sqlite3VdbeAddOp1(v, OP_Vacuum, iDb);
   104    121       sqlite3VdbeUsesBtree(v, iDb);
   105    122     }
   106    123     return;
   107    124   }
   108    125   
   109    126   /*