]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add the SQLITE_BUG_COMPATIBLE_20160819 compile-time option to omit the error
authordrh <drh@noemail.net>
Sat, 18 Feb 2017 13:47:11 +0000 (13:47 +0000)
committerdrh <drh@noemail.net>
Sat, 18 Feb 2017 13:47:11 +0000 (13:47 +0000)
message when an unrecognized argument is provided to the VACUUM command.

FossilOrigin-Name: 491814272dce7e937b4734fcbc2ad69e12377b56

manifest
manifest.uuid
src/vacuum.c

index f6dcc6d61d73989b7c5dbd46bcacfed9bdb3fccd..44763338e48963dc508b3c321d487ef4e5927a04 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sthe\s#endif\slocation\sfor\san\s#ifndef\sSQLITE_UNTESTABLE\smacro\sin\sthe\ncommand-line\sshell.
-D 2017-02-17T23:52:00.611
+C Add\sthe\sSQLITE_BUG_COMPATIBLE_20160819\scompile-time\soption\sto\somit\sthe\serror\nmessage\swhen\san\sunrecognized\sargument\sis\sprovided\sto\sthe\sVACUUM\scommand.
+D 2017-02-18T13:47:11.181
 F Makefile.in edb6bcdd37748d2b1c3422ff727c748df7ffe918
 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
 F Makefile.msc a89ea37ab5928026001569f056973b9059492fe2
@@ -460,7 +460,7 @@ F src/trigger.c c9f0810043b265724fdb1bdd466894f984dfc182
 F src/update.c 456d4a4656f8a03c2abc88a51b19172197400e58
 F src/utf.c 699001c79f28e48e9bcdf8a463da029ea660540c
 F src/util.c ca8440ede81e155d15cff7c101654f60b55a9ae6
-F src/vacuum.c 33c174b28886b2faf26e503b5a49a1c01a9b1c16
+F src/vacuum.c 1fe4555cd8c9b263afb85b5b4ee3a4a4181ad569
 F src/vdbe.c 16f378640570c24442fd7191b136b5d6380f5c7b
 F src/vdbe.h 59998ffd71d7caa8886bc78dafaf8caeccd4c13c
 F src/vdbeInt.h 4e4b15b2e1330e1636e4e01974eab2b0b985092f
@@ -1556,7 +1556,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
 F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
 F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P 218b2bbb0de07288889f6762d4461ea8acd78969
-R ac73be2e300a373fc7f110abc87089ba
+P 8cc9d74c176a78aeebfbb39198c21b5dd547ff52
+R 57839b570efd132c834489fe34d93e5e
 U drh
-Z 57022d1bdb1e12a8cd90064785570f14
+Z 38cfd439ab0cfeae01cbf1d291727475
index ce8096c87ea2e73d55c11809375ff7ca05d59311..557d9a7e8b87af705ae093d6dc7a7605d85ded0f 100644 (file)
@@ -1 +1 @@
-8cc9d74c176a78aeebfbb39198c21b5dd547ff52
\ No newline at end of file
+491814272dce7e937b4734fcbc2ad69e12377b56
\ No newline at end of file
index 25b1258510fc5435e172047d60b225043da826c1..9e471b8d9ca6d39b3cb6252898797c9f3b45111e 100644 (file)
@@ -98,8 +98,25 @@ static int execSqlF(sqlite3 *db, char **pzErrMsg, const char *zSql, ...){
 */
 void sqlite3Vacuum(Parse *pParse, Token *pNm){
   Vdbe *v = sqlite3GetVdbe(pParse);
-  int iDb = pNm ? sqlite3TwoPartName(pParse, pNm, pNm, &pNm) : 0;
-  if( v && (iDb>=2 || iDb==0) ){
+  int iDb = 0;
+  if( v==0 ) return;
+  if( pNm ){
+#ifndef SQLITE_BUG_COMPATIBLE_20160819
+    /* Default behavior:  Report an error if the argument to VACUUM is
+    ** not recognized */
+    iDb = sqlite3TwoPartName(pParse, pNm, pNm, &pNm);
+    if( iDb<0 ) return;
+#else
+    /* When SQLITE_BUG_COMPATIBLE_20160819 is defined, unrecognized arguments
+    ** to VACUUM are silently ignored.  This is a back-out of a bug fix that
+    ** occurred on 2016-08-19 (https://www.sqlite.org/src/info/083f9e6270).
+    ** The buggy behavior is required for binary compatibility with some
+    ** legacy applications. */
+    iDb = sqlite3FindDb(pParse->db, pNm);
+    if( iDb<0 ) iDb = 0;
+#endif
+  }
+  if( iDb!=1 ){
     sqlite3VdbeAddOp1(v, OP_Vacuum, iDb);
     sqlite3VdbeUsesBtree(v, iDb);
   }