From be4e3c88f5e0eca8385a27e05361a6860bfcfa9b Mon Sep 17 00:00:00 2001 From: drh <> Date: Wed, 16 Feb 2022 15:11:01 +0000 Subject: [PATCH 01/10] Make the sqlite3_error_offset() interface accessible from TCL using the new "erroroffset" method on the sqlite3 object. FossilOrigin-Name: 3454a1222bedefba527af98c0284ed0bfbd28dd941885d9a0ac9a44aea2fc8ec --- manifest | 14 ++++++------- manifest.uuid | 2 +- src/tclsqlite.c | 48 ++++++++++++++++++++++++++++----------------- test/tclsqlite.test | 9 +++++++-- 4 files changed, 45 insertions(+), 28 deletions(-) diff --git a/manifest b/manifest index 220535e5db..dd89b8d768 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Improved\srendering\sof\sfloating\spoint\snumbers\swithout\sa\sfractional\spart\sin\n".dump"\soutput\sfrom\sthe\sCLI.\n[forum:/forumpost/550d877659f37cb2|Forum\spost\s550d877659f37cb2]. -D 2022-02-15T13:23:09.386 +C Make\sthe\ssqlite3_error_offset()\sinterface\saccessible\sfrom\sTCL\susing\sthe\nnew\s"erroroffset"\smethod\son\sthe\ssqlite3\sobject. +D 2022-02-16T15:11:01.014 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -561,7 +561,7 @@ F src/sqliteInt.h f8814239fb1f95056555e2d7fa475750e64681cac4221fb03610d1fde0b79d F src/sqliteLimit.h d7323ffea5208c6af2734574bae933ca8ed2ab728083caa117c9738581a31657 F src/status.c 4b8bc2a6905163a38b739854a35b826c737333fab5b1f8e03fa7eb9a4799c4c1 F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1 -F src/tclsqlite.c 48f291e1a7e672a7204884d4c164a8ed3a522ff087c361ada2991f5d54e987f6 +F src/tclsqlite.c 1f6673991147bc2cecc08a40d22f9803b84c805b24b499fe727f392256f73474 F src/test1.c 87fda59eea3ac1eba1baef37c1967565cb1b8d6d264649f2e57f252ca5989914 F src/test2.c 3efb99ab7f1fc8d154933e02ae1378bac9637da5 F src/test3.c 61798bb0d38b915067a8c8e03f5a534b431181f802659a6616f9b4ff7d872644 @@ -1465,7 +1465,7 @@ F test/tabfunc01.test 241425ce3998687ab24adba09cb95e8012e17499b84a0ed47e128ab45e F test/table.test eb3463b7add9f16a5bb836badf118cf391b809d09fdccd1f79684600d07ec132 F test/tableapi.test ecbcc29c4ab62c1912c3717c48ea5c5e59f7d64e4a91034e6148bd2b82f177f4 F test/tableopts.test dba698ba97251017b7c80d738c198d39ab747930 -F test/tclsqlite.test 97cda6e4843e9f3e06c56f656d9b77ee0178fe1ee33fb09a6eeae8f125757ac1 +F test/tclsqlite.test ad0bbd92edabe64cc91d990a0748142fe5ab962d74ac71fa3bfa94d50d2f4c87 F test/tempdb.test 4cdaa23ddd8acb4d79cbb1b68ccdfd09b0537aaba909ca69a876157c2a2cbd08 F test/tempdb2.test 353864e96fd3ae2f70773d0ffbf8b1fe48589b02c2ec05013b540879410c3440 F test/tempfault.test 0c0d349c9a99bf5f374655742577f8712c647900 @@ -1944,8 +1944,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P d74ec88c2f9b9e056988add8322186750229e14a609d1a6969ba393a5b8c5174 -R d44a4dfcecd9d59ae3b06dca8b590f27 +P 9edaeed56f2282fd4da935454178c38ab49d259aed96d4e720aae09050a53006 +R 50c370b3d9d14ff830ffc7f797dcfa74 U drh -Z 28d22f7919d651ae0bfc81a1c20dfd1c +Z 91ac5b55b4df8ebe715787c15b76f001 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index cf24b67f55..1eaff22254 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9edaeed56f2282fd4da935454178c38ab49d259aed96d4e720aae09050a53006 \ No newline at end of file +3454a1222bedefba527af98c0284ed0bfbd28dd941885d9a0ac9a44aea2fc8ec \ No newline at end of file diff --git a/src/tclsqlite.c b/src/tclsqlite.c index d379f8d5ae..8c184809f1 100644 --- a/src/tclsqlite.c +++ b/src/tclsqlite.c @@ -1943,15 +1943,16 @@ static int SQLITE_TCLAPI DbObjCmd( "close", "collate", "collation_needed", "commit_hook", "complete", "config", "copy", "deserialize", "enable_load_extension", - "errorcode", "eval", "exists", - "function", "incrblob", "interrupt", - "last_insert_rowid", "nullvalue", "onecolumn", - "preupdate", "profile", "progress", - "rekey", "restore", "rollback_hook", - "serialize", "status", "timeout", - "total_changes", "trace", "trace_v2", - "transaction", "unlock_notify", "update_hook", - "version", "wal_hook", 0 + "errorcode", "erroroffset", "eval", + "exists", "function", "incrblob", + "interrupt", "last_insert_rowid", "nullvalue", + "onecolumn", "preupdate", "profile", + "progress", "rekey", "restore", + "rollback_hook", "serialize", "status", + "timeout", "total_changes", "trace", + "trace_v2", "transaction", "unlock_notify", + "update_hook", "version", "wal_hook", + 0 }; enum DB_enum { DB_AUTHORIZER, DB_BACKUP, DB_BIND_FALLBACK, @@ -1959,15 +1960,15 @@ static int SQLITE_TCLAPI DbObjCmd( DB_CLOSE, DB_COLLATE, DB_COLLATION_NEEDED, DB_COMMIT_HOOK, DB_COMPLETE, DB_CONFIG, DB_COPY, DB_DESERIALIZE, DB_ENABLE_LOAD_EXTENSION, - DB_ERRORCODE, DB_EVAL, DB_EXISTS, - DB_FUNCTION, DB_INCRBLOB, DB_INTERRUPT, - DB_LAST_INSERT_ROWID, DB_NULLVALUE, DB_ONECOLUMN, - DB_PREUPDATE, DB_PROFILE, DB_PROGRESS, - DB_REKEY, DB_RESTORE, DB_ROLLBACK_HOOK, - DB_SERIALIZE, DB_STATUS, DB_TIMEOUT, - DB_TOTAL_CHANGES, DB_TRACE, DB_TRACE_V2, - DB_TRANSACTION, DB_UNLOCK_NOTIFY, DB_UPDATE_HOOK, - DB_VERSION, DB_WAL_HOOK + DB_ERRORCODE, DB_ERROROFFSET, DB_EVAL, + DB_EXISTS, DB_FUNCTION, DB_INCRBLOB, + DB_INTERRUPT, DB_LAST_INSERT_ROWID, DB_NULLVALUE, + DB_ONECOLUMN, DB_PREUPDATE, DB_PROFILE, + DB_PROGRESS, DB_REKEY, DB_RESTORE, + DB_ROLLBACK_HOOK, DB_SERIALIZE, DB_STATUS, + DB_TIMEOUT, DB_TOTAL_CHANGES, DB_TRACE, + DB_TRACE_V2, DB_TRANSACTION, DB_UNLOCK_NOTIFY, + DB_UPDATE_HOOK, DB_VERSION, DB_WAL_HOOK, }; /* don't leave trailing commas on DB_enum, it confuses the AIX xlc compiler */ @@ -2730,6 +2731,17 @@ deserialize_error: break; } + /* + ** $db erroroffset + ** + ** Return the numeric error code that was returned by the most recent + ** call to sqlite3_exec(). + */ + case DB_ERROROFFSET: { + Tcl_SetObjResult(interp, Tcl_NewIntObj(sqlite3_error_offset(pDb->db))); + break; + } + /* ** $db exists $sql ** $db onecolumn $sql diff --git a/test/tclsqlite.test b/test/tclsqlite.test index c2fa522e64..0758abd822 100644 --- a/test/tclsqlite.test +++ b/test/tclsqlite.test @@ -42,7 +42,7 @@ do_test tcl-1.1.1 { do_test tcl-1.2 { set v [catch {db bogus} msg] lappend v $msg -} {1 {bad option "bogus": must be authorizer, backup, bind_fallback, busy, cache, changes, close, collate, collation_needed, commit_hook, complete, config, copy, deserialize, enable_load_extension, errorcode, eval, exists, function, incrblob, interrupt, last_insert_rowid, nullvalue, onecolumn, preupdate, profile, progress, rekey, restore, rollback_hook, serialize, status, timeout, total_changes, trace, trace_v2, transaction, unlock_notify, update_hook, version, or wal_hook}} +} {1 {bad option "bogus": must be authorizer, backup, bind_fallback, busy, cache, changes, close, collate, collation_needed, commit_hook, complete, config, copy, deserialize, enable_load_extension, errorcode, erroroffset, eval, exists, function, incrblob, interrupt, last_insert_rowid, nullvalue, onecolumn, preupdate, profile, progress, rekey, restore, rollback_hook, serialize, status, timeout, total_changes, trace, trace_v2, transaction, unlock_notify, update_hook, version, or wal_hook}} do_test tcl-1.2.1 { set v [catch {db cache bogus} msg] lappend v $msg @@ -883,5 +883,10 @@ do_test 20.2 { list $rc $msg } {0 {10 1 20 30 30 40}} -finish_test +sqlite3 db :memory: +do_test 21.1 { + catch {db eval {SELECT 1 2 3;}} msg + db erroroffset +} {9} +finish_test From 24ea5fb3e8fceb2607aced9f34ecc5e980f86f1b Mon Sep 17 00:00:00 2001 From: drh <> Date: Thu, 17 Feb 2022 14:29:39 +0000 Subject: [PATCH 02/10] Fix a testing error on Windows that was recently added to shell5.test. FossilOrigin-Name: 6cace54320997dcbbdd49017f20eecafa88ebcc4b264ee800954f25d9605023d --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/shell5.test | 1 + 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/manifest b/manifest index dd89b8d768..848f3f4e67 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Make\sthe\ssqlite3_error_offset()\sinterface\saccessible\sfrom\sTCL\susing\sthe\nnew\s"erroroffset"\smethod\son\sthe\ssqlite3\sobject. -D 2022-02-16T15:11:01.014 +C Fix\sa\stesting\serror\son\sWindows\sthat\swas\srecently\sadded\sto\sshell5.test. +D 2022-02-17T14:29:39.586 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -1392,7 +1392,7 @@ F test/shell1.test b224e0793c5f48aa3749e65d8c64b93a30731bd206f2e41e6c5f1bee1bdb1 F test/shell2.test 89e4b2db062d52baed75022227b462d085cff495809de1699652779d8e0257d6 F test/shell3.test a50628ab1d78d90889d9d3f32fb2c084ee15674771e96afe954aaa0accd1de3c F test/shell4.test 8f6c0fce4abed19a8a7f7262517149812a04caa905d01bdc8f5e92573504b759 -F test/shell5.test 3be444397eb1e91619ce289a6216a8df9ac690cc45d5e9595f60e750a944161f +F test/shell5.test 2b521446f55146c9aafccd0946bdb44ae288b0d25bd48f722e041974fdeeb04a F test/shell6.test 1ceb51b2678c472ba6cf1e5da96679ce8347889fe2c3bf93a0e0fa73f00b00d3 F test/shell7.test 115132f66d0463417f408562cc2cf534f6bbc6d83a6d50f0072a9eb171bae97f F test/shell8.test 388471d16e4de767333107e30653983f186232c0e863f4490bb230419e830aae @@ -1944,8 +1944,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 9edaeed56f2282fd4da935454178c38ab49d259aed96d4e720aae09050a53006 -R 50c370b3d9d14ff830ffc7f797dcfa74 +P 3454a1222bedefba527af98c0284ed0bfbd28dd941885d9a0ac9a44aea2fc8ec +R 0e4bf2f7117a92dae18da02a084f350a U drh -Z 91ac5b55b4df8ebe715787c15b76f001 +Z aaf6628a887fb8adb33b2fa446f7e8f2 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 1eaff22254..f2cf50afe1 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3454a1222bedefba527af98c0284ed0bfbd28dd941885d9a0ac9a44aea2fc8ec \ No newline at end of file +6cace54320997dcbbdd49017f20eecafa88ebcc4b264ee800954f25d9605023d \ No newline at end of file diff --git a/test/shell5.test b/test/shell5.test index 7599edbbe2..2237e685d5 100644 --- a/test/shell5.test +++ b/test/shell5.test @@ -479,6 +479,7 @@ CREATE TABLE t8(a, b, c); #---------------------------------------------------------------------------- # Tests for the shell automatic column rename. # +db close # Import columns containing duplicates do_test shell5-5.1 { From dedd51aed4427c869d6d9aa958d23d3ce24c0bd4 Mon Sep 17 00:00:00 2001 From: drh <> Date: Thu, 17 Feb 2022 14:33:13 +0000 Subject: [PATCH 03/10] Remove references to the now-defunct SQLITE_ENABLE_JSON1 compile-time option. FossilOrigin-Name: db950192c93db7f5eb4ffcce41d0ea374c58450405945cfb8ebe0c93070b7c48 --- Makefile.in | 6 +++--- Makefile.msc | 8 +++----- autoconf/Makefile.msc | 1 - autoconf/README.txt | 2 +- autoconf/configure.ac | 15 --------------- ext/repair/sqlite3_checker.c.in | 1 - main.mk | 5 ++--- manifest | 30 +++++++++++++++--------------- manifest.uuid | 2 +- src/test_config.c | 2 +- test/releasetest_data.tcl | 16 +++++----------- tool/warnings.sh | 4 ++-- 12 files changed, 33 insertions(+), 59 deletions(-) diff --git a/Makefile.in b/Makefile.in index b70e2d5167..e5d30d030b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -609,7 +609,7 @@ TESTOPTS = --verbose=file --output=test-out.txt # Extra compiler options for various shell tools # -SHELL_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4 +SHELL_OPT = -DSQLITE_ENABLE_FTS4 #SHELL_OPT += -DSQLITE_ENABLE_FTS5 SHELL_OPT += -DSQLITE_ENABLE_RTREE SHELL_OPT += -DSQLITE_ENABLE_EXPLAIN_COMMENTS @@ -619,8 +619,8 @@ SHELL_OPT += -DSQLITE_ENABLE_DBPAGE_VTAB SHELL_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB SHELL_OPT += -DSQLITE_ENABLE_BYTECODE_VTAB SHELL_OPT += -DSQLITE_ENABLE_OFFSET_SQL_FUNC -FUZZERSHELL_OPT = -DSQLITE_ENABLE_JSON1 -FUZZCHECK_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5 -DSQLITE_OSS_FUZZ +FUZZERSHELL_OPT = +FUZZCHECK_OPT = -DSQLITE_ENABLE_MEMSYS5 -DSQLITE_OSS_FUZZ FUZZCHECK_OPT += -DSQLITE_MAX_MEMORY=50000000 FUZZCHECK_OPT += -DSQLITE_PRINTF_PRECISION_LIMIT=1000 FUZZCHECK_OPT += -DSQLITE_ENABLE_FTS4 diff --git a/Makefile.msc b/Makefile.msc index a77d8b0447..d67b7f0b86 100644 --- a/Makefile.msc +++ b/Makefile.msc @@ -363,7 +363,6 @@ SQLITE_TCL_DEP = OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_GEOPOLY=1 -OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_JSON1=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_STMTVTAB=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBPAGE_VTAB=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBSTAT_VTAB=1 @@ -1696,9 +1695,9 @@ SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_OFFSET_SQL_FUNC=1 # <> # Extra compiler options for various test tools. # -MPTESTER_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS5 -FUZZERSHELL_COMPILE_OPTS = -DSQLITE_ENABLE_JSON1 -FUZZCHECK_OPTS = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5 -DSQLITE_OSS_FUZZ -DSQLITE_MAX_MEMORY=50000000 -DSQLITE_PRINTF_PRECISION_LIMIT=1000 +MPTESTER_COMPILE_OPTS = -DSQLITE_ENABLE_FTS5 +FUZZERSHELL_COMPILE_OPTS = +FUZZCHECK_OPTS = -DSQLITE_ENABLE_MEMSYS5 -DSQLITE_OSS_FUZZ -DSQLITE_MAX_MEMORY=50000000 -DSQLITE_PRINTF_PRECISION_LIMIT=1000 FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_FTS4 FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_FTS5 FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_RTREE @@ -2393,7 +2392,6 @@ TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_DEFAULT_PAGE_SIZE=1024 TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_ENABLE_STMTVTAB=1 TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_ENABLE_DBPAGE_VTAB=1 TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_ENABLE_BYTECODE_VTAB=1 -TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_ENABLE_JSON1=1 TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_CKSUMVFS_STATIC=1 TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) $(TEST_CCONV_OPTS) diff --git a/autoconf/Makefile.msc b/autoconf/Makefile.msc index 524aeb6f41..e36eb21ea0 100644 --- a/autoconf/Makefile.msc +++ b/autoconf/Makefile.msc @@ -285,7 +285,6 @@ SQLITE3EXEPDB = /pdb:sqlite3sh.pdb OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_FTS3=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_RTREE=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_GEOPOLY=1 -OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_JSON1=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_STMTVTAB=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBPAGE_VTAB=1 OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_DBSTAT_VTAB=1 diff --git a/autoconf/README.txt b/autoconf/README.txt index 6e62a4e138..ccf5e235ac 100644 --- a/autoconf/README.txt +++ b/autoconf/README.txt @@ -105,7 +105,7 @@ may be specified in this manner as some require the amalgamation to be built with them enabled (see http://www.sqlite.org/compile.html). For example, the following will work: - "OPTS=-DSQLITE_ENABLE_STAT4=1 -DSQLITE_ENABLE_JSON1=1" + "OPTS=-DSQLITE_ENABLE_STAT4=1 -DSQLITE_OMIT_JSON=1" However, the following will not compile unless the amalgamation was built with it enabled: diff --git a/autoconf/configure.ac b/autoconf/configure.ac index e050786bd7..0c7a32db1f 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -173,21 +173,6 @@ else fi #----------------------------------------------------------------------- -#----------------------------------------------------------------------- -# --enable-json1 -# -AC_ARG_ENABLE(json1, [AS_HELP_STRING( - [--enable-json1], [include json1 support [default=yes]])], - [],[enable_json1=yes]) -AC_MSG_CHECKING([JSON functions]) -if test x"$enable_json1" = "xyes"; then - BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_JSON1" - AC_MSG_RESULT([enabled]) -else - AC_MSG_RESULT([disabled]) -fi -#----------------------------------------------------------------------- - #----------------------------------------------------------------------- # --enable-rtree # diff --git a/ext/repair/sqlite3_checker.c.in b/ext/repair/sqlite3_checker.c.in index 76e9708787..96b15f2713 100644 --- a/ext/repair/sqlite3_checker.c.in +++ b/ext/repair/sqlite3_checker.c.in @@ -4,7 +4,6 @@ */ #define TCLSH_INIT_PROC sqlite3_checker_init_proc #define SQLITE_ENABLE_DBPAGE_VTAB 1 -#define SQLITE_ENABLE_JSON1 1 #undef SQLITE_THREADSAFE #define SQLITE_THREADSAFE 0 #undef SQLITE_ENABLE_COLUMN_METADATA diff --git a/main.mk b/main.mk index 514776f64b..be16034e55 100644 --- a/main.mk +++ b/main.mk @@ -529,7 +529,7 @@ TESTOPTS = --verbose=file --output=test-out.txt # Extra compiler options for various shell tools # -SHELL_OPT += -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5 +SHELL_OPT += -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5 SHELL_OPT += -DSQLITE_ENABLE_RTREE SHELL_OPT += -DSQLITE_ENABLE_EXPLAIN_COMMENTS SHELL_OPT += -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION @@ -538,8 +538,7 @@ SHELL_OPT += -DSQLITE_ENABLE_DBPAGE_VTAB SHELL_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB SHELL_OPT += -DSQLITE_ENABLE_BYTECODE_VTAB SHELL_OPT += -DSQLITE_ENABLE_OFFSET_SQL_FUNC -FUZZERSHELL_OPT = -DSQLITE_ENABLE_JSON1 -FUZZCHECK_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5 +FUZZCHECK_OPT = -DSQLITE_ENABLE_MEMSYS5 FUZZCHECK_OPT += -DSQLITE_MAX_MEMORY=50000000 FUZZCHECK_OPT += -DSQLITE_PRINTF_PRECISION_LIMIT=1000 FUZZCHECK_OPT += -DSQLITE_ENABLE_FTS4 diff --git a/manifest b/manifest index 848f3f4e67..9a5f00462c 100644 --- a/manifest +++ b/manifest @@ -1,11 +1,11 @@ -C Fix\sa\stesting\serror\son\sWindows\sthat\swas\srecently\sadded\sto\sshell5.test. -D 2022-02-17T14:29:39.586 +C Remove\sreferences\sto\sthe\snow-defunct\sSQLITE_ENABLE_JSON1\scompile-time\soption. +D 2022-02-17T14:33:13.716 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 -F Makefile.in 3271f3cffa0fb1e214816bbffbdb8a367f8d3b8415eda5346839cf427a138c70 +F Makefile.in b210ad2733317f1a4353085dfb9d385ceec30b0e6a61d20a5accabecac6b1949 F Makefile.linux-gcc f609543700659711fbd230eced1f01353117621dccae7b9fb70daa64236c5241 -F Makefile.msc eeb45109d245d1bc5d6ce78da818d62848307419f950b0de0a00ab0672b15081 +F Makefile.msc b28a8a7a977e7312f6859f560348e1eb110c21bd6cf9fab0d16537c0a514eef3 F README.md 2dd87a5c1d108b224921f3dd47dea567973f706e1f6959386282a626f459a70c F VERSION 392c2f83569705069415a5d98b1c138ec8fe8a56a663a0d94cea019e806537b2 F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50 @@ -15,10 +15,10 @@ F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903 F autoconf/Makefile.am a8d1d24affe52ebf8d7ddcf91aa973fa0316618ab95bb68c87cabf8faf527dc8 F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac -F autoconf/Makefile.msc 262dad10223b39a6853c4faefadb0f71931ca55c742fa285f8ee8d56b7543ddc +F autoconf/Makefile.msc 8401a514e4e70add3c6448348ae31322d5cb7db427b05a20828f943c3ddb2733 F autoconf/README.first 6c4f34fe115ff55d4e8dbfa3cecf04a0188292f7 -F autoconf/README.txt 4f04b0819303aabaa35fff5f7b257fb0c1ef95f1 -F autoconf/configure.ac a8ba2a9e61216f5093d44f3b7d2cb8fe1890d6b7dc330a02f802d8efaa1fdc79 +F autoconf/README.txt 42cfd21d0b19dc7d5d85fb5c405c5f3c6a4c923021c39128f6ba685355d8fd56 +F autoconf/configure.ac ec7fa914c5e74ff212fe879f9bb6918e1234497e05facfb641f30c4d5893b277 F autoconf/tea/Makefile.in b438a7020446c8a8156e8d97c8914a04833da6fd F autoconf/tea/README 3e9a3c060f29a44344ab50aec506f4db903fb873 F autoconf/tea/aclocal.m4 52c47aac44ce0ddb1f918b6993e8beb8eee88f43 @@ -388,7 +388,7 @@ F ext/rbu/test_rbu.c 03f6f177096a5f822d68d8e4069ad8907fe572c62ff2d19b141f5974282 F ext/repair/README.md 92f5e8aae749a4dae14f02eea8e1bb42d4db2b6ce5e83dbcdd6b1446997e0c15 F ext/repair/checkfreelist.c e21f06995ff4efdc1622dcceaea4dcba2caa83ca2f31a1607b98a8509168a996 F ext/repair/checkindex.c 4383e4469c21e5b9ae321d0d63cec53e981af9d7a6564be6374f0eeb93dfc890 -F ext/repair/sqlite3_checker.c.in 4a5a3af3f450fe503e5a2985e98516dc2a6b9ad247449e284c1cf140fc91720f +F ext/repair/sqlite3_checker.c.in 445118c5f7fea958b36fba1b2c464283e60ed4842039ddee3265f1698115ebf7 F ext/repair/sqlite3_checker.tcl a9a2caa9660567257c177a91124d8c0dccdfa341e25c51e6da7f1fd9e601eafa F ext/repair/test/README.md 34b2f542cf5be7bffe479242b33ee3492cea30711e447cc4a1a86cb5915f419e F ext/repair/test/checkfreelist01.test 3e8aa6aeb4007680c94a8d07b41c339aa635cc78249442da72ff3f8297398a69 @@ -473,7 +473,7 @@ F ext/userauth/userauth.c 7f00cded7dcaa5d47f54539b290a43d2e59f4b1eb5f447545fa865 F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8 F magic.txt 8273bf49ba3b0c8559cb2774495390c31fd61c60 -F main.mk 3de4bca45fee4b843aaf74df8ffc639aa8ae3c52af997bbbd6927add30154fda +F main.mk 80ac3d2f82eb21c6fb4423f9c7f8e207abb51be6676845a00e246cfb22f9c77c F mkso.sh fd21c06b063bb16a5d25deea1752c2da6ac3ed83 F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271 F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504 @@ -577,7 +577,7 @@ F src/test_backup.c bf5da90c9926df0a4b941f2d92825a01bbe090a0 F src/test_bestindex.c 8294d8223b7f18a3ddb7f9a0e30815dcca4e61681f78b538c870f7d934f88b81 F src/test_blob.c ae4a0620b478548afb67963095a7417cd06a4ec0a56adb453542203bfdcb31ce F src/test_btree.c 8b2dc8b8848cf3a4db93f11578f075e82252a274 -F src/test_config.c 284c29912736f68b0a583a920bf63fd8f9125dffb8a75cb0676e58502b2f7908 +F src/test_config.c 8264637b06a3c1f0727c88d1ea32dcf7986b9e7e358a970cae87cdac8a5b2708 F src/test_delete.c e2fe07646dff6300b48d49b2fee2fe192ed389e834dd635e3b3bac0ce0bf9f8f F src/test_demovfs.c 86142ba864d4297d54c5b2e972e74f3141ae4b30f05b3a95824184ed2d3d7f91 F src/test_devsym.c aff2255ea290d7718da08af30cdf18e470ff7325a5eff63e0057b1496ed66593 @@ -1313,7 +1313,7 @@ F test/recover.test ccb8c2623902a92ebb76770edd075cb4f75a4760bb7afde38026572c6e79 F test/regexp1.test 0c3ff80f66b0eff80e623eb5db7a3dad512095c573d78ac23009785f6d8f51ce F test/regexp2.test 55ed41da802b0e284ac7e2fe944be3948f93ff25abbca0361a609acfed1368b5 F test/reindex.test cd9d6021729910ece82267b4f5e1b5ac2911a7566c43b43c176a6a4732e2118d -F test/releasetest_data.tcl 7cea6c852ae6bb3a9ff1a2b910e4dd13c16a05f74443984dfd52159b0b01ea55 +F test/releasetest_data.tcl 11ba48a21ed1c808147b0e77c6e93d204577f4327ffe6d7c3b34cd3c01eac3a2 F test/resetdb.test 8062cf10a09d8c048f8de7711e94571c38b38168db0e5877ba7561789e5eeb2b F test/resolver01.test f4022acafda7f4d40eca94dbf16bc5fc4ac30ceb F test/returning1.test ee0b115162b17f59fe486767899596b1e8290bcd845db05d7d1d9e6c2dad1b8b @@ -1921,7 +1921,7 @@ F tool/varint.c 5d94cb5003db9dbbcbcc5df08d66f16071aee003 F tool/vdbe-compress.tcl 1dcb7632e57cf57105248029e6e162fddaf6c0fccb3bb9e6215603752c5a2d4a F tool/vdbe_profile.tcl 246d0da094856d72d2c12efec03250d71639d19f F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 -F tool/warnings.sh 09311479bdc290e20ec8e35a3d1b14b096bbd96222277cfd6274c3a99b3d012f +F tool/warnings.sh d58dc38367cc776550f90327e205d7946802d4004fb9f291fd8b81256bc1eedd F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f F vsixtest/App.xaml b76d3b48860e7454775c47ea38ffea9c4abe3e85 F vsixtest/App.xaml.cpp 41158ee43269820136fa3bba00c0bd91b26cc38b650ee392aec2a8d823e54318 @@ -1944,8 +1944,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 3454a1222bedefba527af98c0284ed0bfbd28dd941885d9a0ac9a44aea2fc8ec -R 0e4bf2f7117a92dae18da02a084f350a +P 6cace54320997dcbbdd49017f20eecafa88ebcc4b264ee800954f25d9605023d +R e53902f2dbf0ae77be8f56d67e9a648c U drh -Z aaf6628a887fb8adb33b2fa446f7e8f2 +Z 6e5356ac204fb51a4444299256d4bb22 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index f2cf50afe1..83064301ed 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -6cace54320997dcbbdd49017f20eecafa88ebcc4b264ee800954f25d9605023d \ No newline at end of file +db950192c93db7f5eb4ffcce41d0ea374c58450405945cfb8ebe0c93070b7c48 \ No newline at end of file diff --git a/src/test_config.c b/src/test_config.c index acf98e36d8..a362dbc567 100644 --- a/src/test_config.c +++ b/src/test_config.c @@ -239,7 +239,7 @@ static void set_options(Tcl_Interp *interp){ Tcl_SetVar2(interp, "sqlite_options", "geopoly", "0", TCL_GLOBAL_ONLY); #endif -#ifdef SQLITE_ENABLE_JSON1 +#ifndef SQLITE_OMIT_JSON Tcl_SetVar2(interp, "sqlite_options", "json1", "1", TCL_GLOBAL_ONLY); #else Tcl_SetVar2(interp, "sqlite_options", "json1", "0", TCL_GLOBAL_ONLY); diff --git a/test/releasetest_data.tcl b/test/releasetest_data.tcl index 45966fd233..314331aeef 100644 --- a/test/releasetest_data.tcl +++ b/test/releasetest_data.tcl @@ -99,7 +99,6 @@ array set ::Configs [strip_comments { -DSQLITE_ENABLE_STMT_SCANSTATUS -DSQLITE_LIKE_DOESNT_MATCH_BLOBS -DSQLITE_ENABLE_CURSOR_HINTS - --enable-json1 } "Check-Symbols" { -DSQLITE_MEMDEBUG=1 @@ -117,7 +116,7 @@ array set ::Configs [strip_comments { -DSQLITE_ENABLE_OVERSIZE_CELL_CHECK=1 -DSQLITE_ENABLE_STAT4 -DSQLITE_ENABLE_STMT_SCANSTATUS - --enable-json1 --enable-fts5 --enable-session + --enable-fts5 --enable-session } "Debug-One" { --disable-shared @@ -134,7 +133,7 @@ array set ::Configs [strip_comments { -DSQLITE_ENABLE_HIDDEN_COLUMNS -DSQLITE_MAX_ATTACHED=125 -DSQLITE_MUTATION_TEST - --enable-fts5 --enable-json1 + --enable-fts5 } "Debug-Two" { -DSQLITE_DEFAULT_MEMSTATUS=0 @@ -170,7 +169,6 @@ array set ::Configs [strip_comments { -DSQLITE_OMIT_VIRTUALTABLE=1 -DSQLITE_ENABLE_HIDDEN_COLUMNS -DSQLITE_TEMP_STORE=3 - --enable-json1 } "Device-Two" { -DSQLITE_4_BYTE_ALIGNED_MALLOC=1 @@ -188,7 +186,7 @@ array set ::Configs [strip_comments { -DSQLITE_OMIT_TRACE=1 -DSQLITE_TEMP_STORE=3 -DSQLITE_THREADSAFE=2 - --enable-json1 --enable-fts5 --enable-session + --enable-fts5 --enable-session } "Locking-Style" { -O2 @@ -232,7 +230,7 @@ array set ::Configs [strip_comments { -DSQLITE_WRITE_WALFRAME_PREBUFFERED=1 -DUSE_GUARDED_FD=1 -DUSE_PREAD=1 - --enable-json1 --enable-fts5 + --enable-fts5 } "Extra-Robustness" { -DSQLITE_ENABLE_OVERSIZE_CELL_CHECK=1 @@ -247,7 +245,7 @@ array set ::Configs [strip_comments { -DSQLITE_ENABLE_FTS4_PARENTHESIS -DSQLITE_DISABLE_FTS4_DEFERRED -DSQLITE_ENABLE_RTREE - --enable-json1 --enable-fts5 + --enable-fts5 } "No-lookaside" { -DSQLITE_TEST_REALLOC_STRESS=1 @@ -259,7 +257,6 @@ array set ::Configs [strip_comments { -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_HIDDEN_COLUMNS -DCONFIG_SLOWDOWN_FACTOR=8.0 - --enable-json1 } "Windows-Memdebug" { @@ -503,9 +500,6 @@ proc main_script {args} { --enable-fts5 { lappend opts -DSQLITE_ENABLE_FTS5 } - --enable-json1 { - lappend opts -DSQLITE_ENABLE_JSON1 - } --enable-shared { lappend makeOpts USE_CRT_DLL=1 DYNAMIC_SHELL=1 } diff --git a/tool/warnings.sh b/tool/warnings.sh index 0754a0f3f6..a839d235b6 100644 --- a/tool/warnings.sh +++ b/tool/warnings.sh @@ -20,7 +20,7 @@ echo '********** No optimizations. Includes FTS4/5, GEOPOLY, JSON1 ***' echo '********** ' Options: $WARNING_OPTS gcc -c $WARNING_OPTS -std=c89 \ -ansi -DHAVE_STDINT_H -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_GEOPOLY \ - -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 \ + -DSQLITE_ENABLE_FTS5 \ sqlite3.c if test x`uname` = 'xLinux'; then echo '********** Android configuration ******************************' @@ -56,5 +56,5 @@ echo '********** Optimized -O3. Includes FTS4/5, GEOPOLY, JSON1 ******' echo '********** ' Options: $WARNING_OPTS gcc -O3 -c $WARNING_OPTS -std=c89 \ -ansi -DHAVE_STDINT_H -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_GEOPOLY \ - -DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 \ + -DSQLITE_ENABLE_FTS5 \ sqlite3.c From b15a3940d1f7031abc41786f5cdf4e3cd9053629 Mon Sep 17 00:00:00 2001 From: drh <> Date: Thu, 17 Feb 2022 17:24:39 +0000 Subject: [PATCH 04/10] Enhance the documentation on sqlite3_stmt_readonly() to explain that EXPLAIN and EXPLAIN QUERY PLAN do not affect the return value. Add test cases to verify this. Add new test cases and requirements marks for complete requirements test coverage on this interface. FossilOrigin-Name: a6fbb7ba0583b3981e2d8b809006b902b3e97e516dbd3ab7d905c5ea73df2272 --- manifest | 14 ++++---- manifest.uuid | 2 +- src/sqlite.h.in | 4 +++ test/capi3d.test | 86 ++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 98 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 9a5f00462c..2820112fc2 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Remove\sreferences\sto\sthe\snow-defunct\sSQLITE_ENABLE_JSON1\scompile-time\soption. -D 2022-02-17T14:33:13.716 +C Enhance\sthe\sdocumentation\son\ssqlite3_stmt_readonly()\sto\sexplain\sthat\nEXPLAIN\sand\sEXPLAIN\sQUERY\sPLAN\sdo\snot\saffect\sthe\sreturn\svalue.\s\sAdd\stest\ncases\sto\sverify\sthis.\s\sAdd\snew\stest\scases\sand\srequirements\smarks\sfor\ncomplete\srequirements\stest\scoverage\son\sthis\sinterface. +D 2022-02-17T17:24:39.996 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -554,7 +554,7 @@ F src/resolve.c ea935b87d6fb36c78b70cdc7b28561dc8f33f2ef37048389549c7b5ef9b0ba5e F src/rowset.c ba9515a922af32abe1f7d39406b9d35730ed65efab9443dc5702693b60854c92 F src/select.c 3baa9dd8cf240654773c7974e2bcce398ac9dd24419c36684156963defe43b35 F src/shell.c.in b5b44c2ebfd3942e60dbcc47b94a74337a482a5f1c3766fbfb9f578a605ecf50 -F src/sqlite.h.in 7047c4b60fa550264d6363bb1d983540e7828fb19d2d1e5aa43b52ca13144807 +F src/sqlite.h.in e30cedf008d9c51511f4027a3739b727a588da553424748b48d2393f85dbde41 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h a95cb9ed106e3d39e2118e4dcc15a14faec3fa50d0093425083d340d9dfd96e6 F src/sqliteInt.h f8814239fb1f95056555e2d7fa475750e64681cac4221fb03610d1fde0b79d53 @@ -763,7 +763,7 @@ F test/capi2.test 4ee545824adc3eb33bf57ef89f77440b28188ec3da72e5425ff0fcdba32e8d F test/capi3.test 3910a73c38ac76d69778dd9eb481ab7cd6ed59117fc047b4f6056a5c72529de1 F test/capi3b.test efb2b9cfd127efa84433cd7a2d72ce0454ae0dc4 F test/capi3c.test 54e2dc0c8fd7c34ad1590d1be6864397da2438c95a9f5aee2f8fbc60c112e44b -F test/capi3d.test aba917805573a03deed961a21f07a5a84505ad0a616f7e3fc1508844a15bccc4 +F test/capi3d.test 8b778794af891b0dca3d900bd345fbc8ebd2aa2aae425a9dccdd10d5233dfbde F test/capi3e.test 3d49c01ef2a1a55f41d73cba2b23b5059ec460fe F test/carray01.test d55d57bf66b1af1c7ac55fae66ff4910884a8f5d21a90a18797ce386212a2634 F test/cast.test 336fa21989b5170ebcaf90c24266be22dd97b3e23d1fad5ecf6ad4efb04c4423 @@ -1944,8 +1944,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 6cace54320997dcbbdd49017f20eecafa88ebcc4b264ee800954f25d9605023d -R e53902f2dbf0ae77be8f56d67e9a648c +P db950192c93db7f5eb4ffcce41d0ea374c58450405945cfb8ebe0c93070b7c48 +R 523f364c921f1f1a1af91e70e24a8c4e U drh -Z 6e5356ac204fb51a4444299256d4bb22 +Z a1a8fedeb890f7339edc06cd1f9179a9 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 83064301ed..a69584d59c 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -db950192c93db7f5eb4ffcce41d0ea374c58450405945cfb8ebe0c93070b7c48 \ No newline at end of file +a6fbb7ba0583b3981e2d8b809006b902b3e97e516dbd3ab7d905c5ea73df2272 \ No newline at end of file diff --git a/src/sqlite.h.in b/src/sqlite.h.in index ca9d5e6f41..bc1db4609f 100644 --- a/src/sqlite.h.in +++ b/src/sqlite.h.in @@ -4284,6 +4284,10 @@ const char *sqlite3_normalized_sql(sqlite3_stmt *pStmt); ** be false. ^Similarly, a CREATE TABLE IF NOT EXISTS statement is a ** read-only no-op if the table already exists, but ** sqlite3_stmt_readonly() still returns false for such a statement. +** +** ^If prepared statement X is an [EXPLAIN] or [EXPLAIN QUERY PLAN] +** statement, then sqlite3_stmt_readonly(X) returns the same value as +** if the EXPLAIN or EXPLAIN QUERY PLAN prefix were omitted. */ int sqlite3_stmt_readonly(sqlite3_stmt *pStmt); diff --git a/test/capi3d.test b/test/capi3d.test index b56d7929b0..7cad2870cd 100644 --- a/test/capi3d.test +++ b/test/capi3d.test @@ -100,8 +100,32 @@ proc test_is_readonly {testname sql truth} { sqlite3_finalize $STMT set rc } $sql] $truth + + # EVIDENCE-OF: R-61212-30018 If prepared statement X is an EXPLAIN or + # EXPLAIN QUERY PLAN statement, then sqlite3_stmt_readonly(X) returns + # the same value as if the EXPLAIN or EXPLAIN QUERY PLAN prefix were + # omitted. + # + do_test $testname.explain [format { + set DB [sqlite3_connection_pointer db] + set STMT [sqlite3_prepare $DB {EXPLAIN %s} -1 TAIL] + set rc [sqlite3_stmt_readonly $STMT] + sqlite3_finalize $STMT + set rc + } $sql] $truth + do_test $testname.eqp [format { + set DB [sqlite3_connection_pointer db] + set STMT [sqlite3_prepare $DB {EXPLAIN QUERY PLAN %s} -1 TAIL] + set rc [sqlite3_stmt_readonly $STMT] + sqlite3_finalize $STMT + set rc + } $sql] $truth } +# EVIDENCE-OF: R-23332-64992 The sqlite3_stmt_readonly(X) interface +# returns true (non-zero) if and only if the prepared statement X makes +# no direct changes to the content of the database file. +# test_is_readonly capi3d-2.1 {SELECT * FROM sqlite_master} 1 test_is_readonly capi3d-2.2 {CREATE TABLE t1(x)} 0 db eval {CREATE TABLE t1(x)} @@ -120,6 +144,68 @@ do_test capi3-2.49 { } 1 +# EVIDENCE-OF: R-04929-09147 This routine returns false if there is any +# possibility that the statement might change the database file. +# +# EVIDENCE-OF: R-13288-53765 A false return does not guarantee that the +# statement will change the database file. +# +# EVIDENCE-OF: R-22182-18548 For example, an UPDATE statement might have +# a WHERE clause that makes it a no-op, but the sqlite3_stmt_readonly() +# result would still be false. +# +# EVIDENCE-OF: R-50998-48593 Similarly, a CREATE TABLE IF NOT EXISTS +# statement is a read-only no-op if the table already exists, but +# sqlite3_stmt_readonly() still returns false for such a statement. +# +db eval { + CREATE TABLE t2(a,b,c); + INSERT INTO t2 VALUES(1,2,3); +} +test_is_readonly capi3d-2.11 {UPDATE t2 SET a=a+1 WHERE false} 0 +test_is_readonly capi3d-2.12 {CREATE TABLE IF NOT EXISTS t2(x,y)} 0 + + +# EVIDENCE-OF: R-37014-01401 The ATTACH and DETACH statements also cause +# sqlite3_stmt_readonly() to return true since, while those statements +# change the configuration of a database connection, they do not make +# changes to the content of the database files on disk. +# +test_is_readonly capi3d-2.13 {ATTACH ':memory:' AS mem1} 1 +db eval {ATTACH ':memory:' AS mem1} +test_is_readonly capi3d-2.14 {DETACH mem1} 1 +db eval {DETACH mem1} + +# EVIDENCE-OF: R-07474-04783 Transaction control statements such as +# BEGIN, COMMIT, ROLLBACK, SAVEPOINT, and RELEASE cause +# sqlite3_stmt_readonly() to return true, since the statements +# themselves do not actually modify the database but rather they control +# the timing of when other statements modify the database. +# +test_is_readonly capi3d-2.15 {BEGIN} 1 +test_is_readonly capi3d-2.16 {COMMIT} 1 +test_is_readonly capi3d-2.17 {SAVEPOINT one} 1 +test_is_readonly capi3d-2.18 {RELEASE one} 1 + +# EVIDENCE-OF: R-36961-63052 The sqlite3_stmt_readonly() interface +# returns true for BEGIN since BEGIN merely sets internal flags, but the +# BEGIN IMMEDIATE and BEGIN EXCLUSIVE commands do touch the database and +# so sqlite3_stmt_readonly() returns false for those commands. +# +test_is_readonly capi3d-2.19 {BEGIN IMMEDIATE} 0 +test_is_readonly capi3d-2.20 {BEGIN EXCLUSIVE} 0 + +# EVIDENCE-OF: R-21769-42523 For example, if an application defines a +# function "eval()" that calls sqlite3_exec(), then the following SQL +# statement would change the database file through side-effects: SELECT +# eval('DELETE FROM t1') FROM t2; But because the SELECT statement does +# not change the database file directly, sqlite3_stmt_readonly() would +# still return true. +# +proc evalsql {sql} {db eval $sql} +db func eval evalsql +test_is_readonly capi3d-2.21 {SELECT eval('DELETE FROM t1') FROM t2} 1 + # Tests for the is-explain interface. # proc test_is_explain {testname sql truth} { From 1ff855b22e978c045438f1edb09db06fc289bd70 Mon Sep 17 00:00:00 2001 From: drh <> Date: Sat, 19 Feb 2022 15:57:28 +0000 Subject: [PATCH 05/10] Add a NEVER() to a branch that is unreachable for STAT4. FossilOrigin-Name: e4e97505af4016c48465009686bfeffe9627e225a5b2082a5bf4baeee40db5c9 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/vdbemem.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 2820112fc2..ea9b335ee2 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Enhance\sthe\sdocumentation\son\ssqlite3_stmt_readonly()\sto\sexplain\sthat\nEXPLAIN\sand\sEXPLAIN\sQUERY\sPLAN\sdo\snot\saffect\sthe\sreturn\svalue.\s\sAdd\stest\ncases\sto\sverify\sthis.\s\sAdd\snew\stest\scases\sand\srequirements\smarks\sfor\ncomplete\srequirements\stest\scoverage\son\sthis\sinterface. -D 2022-02-17T17:24:39.996 +C Add\sa\sNEVER()\sto\sa\sbranch\sthat\sis\sunreachable\sfor\sSTAT4. +D 2022-02-19T15:57:28.513 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -630,7 +630,7 @@ F src/vdbeInt.h b45599a2b59f1ce042512ab6786b0b82a8cf3002f6b0fa60b4834e2cd3ac61d8 F src/vdbeapi.c 8863ffb5a7bac42fe9a68aaa3526ee29fc18fb02a9b27188b756de41e33856e9 F src/vdbeaux.c 0d7659fe8cb38ce86092b9bc5131c99a834a04eb78745e54acb77d79d7af2fb5 F src/vdbeblob.c 5e61ce31aca17db8fb60395407457a8c1c7fb471dde405e0cd675974611dcfcd -F src/vdbemem.c eb6042667c02c3ef1f968235b4a170e31b23a4b6a57f65a8454eab4d36f14b7f +F src/vdbemem.c 7737f0b1c480a32b057849c804d2f21d5389649bb8be80f77ad75df700adc9a1 F src/vdbesort.c 43756031ca7430f7aec3ef904824a7883c4ede783e51f280d99b9b65c0796e35 F src/vdbetrace.c fe0bc29ebd4e02c8bc5c1945f1d2e6be5927ec12c06d89b03ef2a4def34bf823 F src/vdbevtab.c f99b275366c5fc5e2d99f734729880994ab9500bdafde7fae3b02d562b9d323c @@ -1944,8 +1944,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P db950192c93db7f5eb4ffcce41d0ea374c58450405945cfb8ebe0c93070b7c48 -R 523f364c921f1f1a1af91e70e24a8c4e +P a6fbb7ba0583b3981e2d8b809006b902b3e97e516dbd3ab7d905c5ea73df2272 +R 85d00e72da6e2d01b41c44403f0c974f U drh -Z a1a8fedeb890f7339edc06cd1f9179a9 +Z faf788eb0e7388b41064eae8cc7a901b # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index a69584d59c..92b0099046 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a6fbb7ba0583b3981e2d8b809006b902b3e97e516dbd3ab7d905c5ea73df2272 \ No newline at end of file +e4e97505af4016c48465009686bfeffe9627e225a5b2082a5bf4baeee40db5c9 \ No newline at end of file diff --git a/src/vdbemem.c b/src/vdbemem.c index 5d2d69268e..e840f6586c 100644 --- a/src/vdbemem.c +++ b/src/vdbemem.c @@ -1645,7 +1645,7 @@ static int valueFromExpr( no_mem: #ifdef SQLITE_ENABLE_STAT4 - if( pCtx==0 || pCtx->pParse->nErr==0 ) + if( pCtx==0 || NEVER(pCtx->pParse->nErr==0) ) #endif sqlite3OomFault(db); sqlite3DbFree(db, zVal); From a7919add6af5ec0ed0a2b315f56e451acb2705e4 Mon Sep 17 00:00:00 2001 From: larrybr Date: Sat, 19 Feb 2022 21:25:48 +0000 Subject: [PATCH 06/10] Improve .backup and .save help text FossilOrigin-Name: 741651fd4b1b776b4dea156cdc987f426f7c668ece203bda6654b2c7117c8933 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/shell.c.in | 3 ++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index ea9b335ee2..fd15186044 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sa\sNEVER()\sto\sa\sbranch\sthat\sis\sunreachable\sfor\sSTAT4. -D 2022-02-19T15:57:28.513 +C Improve\s.backup\sand\s.save\shelp\stext +D 2022-02-19T21:25:48.787 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -553,7 +553,7 @@ F src/random.c 097dc8b31b8fba5a9aca1697aeb9fd82078ec91be734c16bffda620ced7ab83c F src/resolve.c ea935b87d6fb36c78b70cdc7b28561dc8f33f2ef37048389549c7b5ef9b0ba5e F src/rowset.c ba9515a922af32abe1f7d39406b9d35730ed65efab9443dc5702693b60854c92 F src/select.c 3baa9dd8cf240654773c7974e2bcce398ac9dd24419c36684156963defe43b35 -F src/shell.c.in b5b44c2ebfd3942e60dbcc47b94a74337a482a5f1c3766fbfb9f578a605ecf50 +F src/shell.c.in 14cdfba32c73cb06169e50cd448632c28359f2bab2a0f803dc4a7f46dfc5b6fa F src/sqlite.h.in e30cedf008d9c51511f4027a3739b727a588da553424748b48d2393f85dbde41 F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h a95cb9ed106e3d39e2118e4dcc15a14faec3fa50d0093425083d340d9dfd96e6 @@ -1944,8 +1944,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P a6fbb7ba0583b3981e2d8b809006b902b3e97e516dbd3ab7d905c5ea73df2272 -R 85d00e72da6e2d01b41c44403f0c974f -U drh -Z faf788eb0e7388b41064eae8cc7a901b +P e4e97505af4016c48465009686bfeffe9627e225a5b2082a5bf4baeee40db5c9 +R c48545ce64b3f1da439983ecf515b9af +U larrybr +Z be1dba8d96f5599719b2fc2ec5a8b0a8 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 92b0099046..a52f1710c0 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e4e97505af4016c48465009686bfeffe9627e225a5b2082a5bf4baeee40db5c9 \ No newline at end of file +741651fd4b1b776b4dea156cdc987f426f7c668ece203bda6654b2c7117c8933 \ No newline at end of file diff --git a/src/shell.c.in b/src/shell.c.in index 3ff1f62c72..354c9a849b 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -4245,6 +4245,7 @@ static const char *(azHelp[]) = { ".auth ON|OFF Show authorizer callbacks", #endif ".backup ?DB? FILE Backup DB (default \"main\") to FILE", + " Options:", " --append Use the appendvfs", " --async Write to FILE without journal and fsync()", ".bail on|off Stop after hitting an error. Default OFF", @@ -4392,7 +4393,7 @@ static const char *(azHelp[]) = { " that are not also INTEGER PRIMARY KEYs", #endif ".restore ?DB? FILE Restore content of DB (default \"main\") from FILE", - ".save FILE Write in-memory database into FILE", + ".save ?OPTIONS? FILE Write database to FILE (an alias for .backup ...)", ".scanstats on|off Turn sqlite3_stmt_scanstatus() metrics on or off", ".schema ?PATTERN? Show the CREATE statements matching PATTERN", " Options:", From d01a1bd94a803dad387c4289f0f65997b62bb0df Mon Sep 17 00:00:00 2001 From: drh <> Date: Mon, 21 Feb 2022 00:23:49 +0000 Subject: [PATCH 07/10] Do not allow error messages from sqlite3NestedParse() to leak up into the main parse. FossilOrigin-Name: 9c4e21abdca664d6b7bcf0043fe9ec05ef8b2949ba6ee7208abaaec1ff4ed679 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/build.c | 2 ++ 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index fd15186044..9df562f653 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Improve\s.backup\sand\s.save\shelp\stext -D 2022-02-19T21:25:48.787 +C Do\snot\sallow\serror\smessages\sfrom\ssqlite3NestedParse()\sto\sleak\sup\sinto\sthe\nmain\sparse. +D 2022-02-21T00:23:49.892 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -495,7 +495,7 @@ F src/btmutex.c 8acc2f464ee76324bf13310df5692a262b801808984c1b79defb2503bbafadb6 F src/btree.c 117808943727d27e38c69de4e79237e52c89ee40f6f1a70de4e6e14b5e596cbc F src/btree.h 74d64b8f28cfa4a894d14d4ed64fa432cd697b98b61708d4351482ae15913e22 F src/btreeInt.h ee9348c4cb9077243b049edc93a82c1f32ca48baeabf2140d41362b9f9139ff7 -F src/build.c b59ff41525c10b429adc277d3bca6e433b09d055b0df8c1529385763cea8bb04 +F src/build.c 9891c2160886cf7e344d7e8f1f7177f9612916c7c67ffeacd64cb34a92d387a8 F src/callback.c 4c19af69835787bfe790ac560f3071a824eb629f34e41f97b52ce5235c77de1c F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e F src/ctime.c 2cce39df1a13e05b7633e6d21b651f21492471f991dd7b323a4ee4e7b7f0b7f1 @@ -1944,8 +1944,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P e4e97505af4016c48465009686bfeffe9627e225a5b2082a5bf4baeee40db5c9 -R c48545ce64b3f1da439983ecf515b9af -U larrybr -Z be1dba8d96f5599719b2fc2ec5a8b0a8 +P 741651fd4b1b776b4dea156cdc987f426f7c668ece203bda6654b2c7117c8933 +R e58f244b851f39804e3706c333ceac19 +U drh +Z 4d37dc9349c7c233094d1c870b4b22d9 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index a52f1710c0..e5c4243bc0 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -741651fd4b1b776b4dea156cdc987f426f7c668ece203bda6654b2c7117c8933 \ No newline at end of file +9c4e21abdca664d6b7bcf0043fe9ec05ef8b2949ba6ee7208abaaec1ff4ed679 \ No newline at end of file diff --git a/src/build.c b/src/build.c index 8b1a8009d6..58b0710660 100644 --- a/src/build.c +++ b/src/build.c @@ -333,6 +333,8 @@ void sqlite3NestedParse(Parse *pParse, const char *zFormat, ...){ memset(PARSE_TAIL(pParse), 0, PARSE_TAIL_SZ); db->mDbFlags |= DBFLAG_PreferBuiltin; sqlite3RunParser(pParse, zSql); + sqlite3DbFree(db, pParse->zErrMsg); + pParse->zErrMsg = 0; db->mDbFlags = savedDbFlags; sqlite3DbFree(db, zSql); memcpy(PARSE_TAIL(pParse), saveBuf, PARSE_TAIL_SZ); From 91260dcf831ef0fd5a0ccc435acad17993c7a0be Mon Sep 17 00:00:00 2001 From: drh <> Date: Mon, 21 Feb 2022 13:02:23 +0000 Subject: [PATCH 08/10] Add SQLITE_OMIT_JSON to the compile-time option test sequence. FossilOrigin-Name: f36325a6e21c4d3b6ab48ebfb2efabda089281344d1e61949d1c9290e88395b1 --- manifest | 12 ++++++------ manifest.uuid | 2 +- tool/omittest.tcl | 1 + 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/manifest b/manifest index 9df562f653..f3a61299b7 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Do\snot\sallow\serror\smessages\sfrom\ssqlite3NestedParse()\sto\sleak\sup\sinto\sthe\nmain\sparse. -D 2022-02-21T00:23:49.892 +C Add\sSQLITE_OMIT_JSON\sto\sthe\scompile-time\soption\stest\ssequence. +D 2022-02-21T13:02:23.169 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -1887,7 +1887,7 @@ F tool/mksqlite3h.tcl 1f5e4a1dbbbc43c83cc6e74fe32c6c620502240b66c7c0f33a51378e78 F tool/mksqlite3internalh.tcl eb994013e833359137eb53a55acdad0b5ae1049b F tool/mkvsix.tcl b9e0777a213c23156b6542842c238479e496ebf5 F tool/offsets.c 8ed2b344d33f06e71366a9b93ccedaa38c096cc1dbd4c3c26ad08c6115285845 -F tool/omittest.tcl 3d222272b1d840b4e3d67bff0cb743ce3f633faddadb3702b2056b726775db8f +F tool/omittest.tcl 3bc9609aceea871e1ca6ed6749df9ce79b89369d22b492f6ce6078f40647cc3f F tool/opcodesum.tcl 740ed206ba8c5040018988129abbf3089a0ccf4a F tool/pagesig.c ff0ca355fd3c2398e933da5e22439bbff89b803b F tool/replace.tcl 937c931ad560688e85bdd6258bdc754371bb1e2732e1fb28ef441e44c9228fce @@ -1944,8 +1944,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 741651fd4b1b776b4dea156cdc987f426f7c668ece203bda6654b2c7117c8933 -R e58f244b851f39804e3706c333ceac19 +P 9c4e21abdca664d6b7bcf0043fe9ec05ef8b2949ba6ee7208abaaec1ff4ed679 +R 605f35793af6c6c5c05c40e106a2aaf9 U drh -Z 4d37dc9349c7c233094d1c870b4b22d9 +Z 505632ad7d9e98bb700e59017aab91f9 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index e5c4243bc0..7a73970f66 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -9c4e21abdca664d6b7bcf0043fe9ec05ef8b2949ba6ee7208abaaec1ff4ed679 \ No newline at end of file +f36325a6e21c4d3b6ab48ebfb2efabda089281344d1e61949d1c9290e88395b1 \ No newline at end of file diff --git a/tool/omittest.tcl b/tool/omittest.tcl index 9f24d6d3d3..b54f2984d4 100644 --- a/tool/omittest.tcl +++ b/tool/omittest.tcl @@ -218,6 +218,7 @@ proc main {argv} { SQLITE_OMIT_INCRBLOB \ SQLITE_OMIT_INTEGRITY_CHECK \ SQLITE_OMIT_INTROSPECTION_PRAGMAS \ + SQLITE_OMIT_JSON \ SQLITE_OMIT_LIKE_OPTIMIZATION \ SQLITE_OMIT_LOAD_EXTENSION \ SQLITE_OMIT_LOCALTIME \ From a12500005f045fa716a4f9006b300bce284cf6e2 Mon Sep 17 00:00:00 2001 From: drh <> Date: Mon, 21 Feb 2022 13:44:51 +0000 Subject: [PATCH 09/10] Remove stray tab characters from auxiliary source code files. FossilOrigin-Name: e25e33582b69289a2c3a6bc403e3911de22a3b529db1a565efb9f1af01b9e382 --- ext/lsm1/lsm_vtab.c | 2 +- ext/misc/csv.c | 2 +- ext/misc/ieee754.c | 2 +- manifest | 18 ++++++++--------- manifest.uuid | 2 +- tool/sqldiff.c | 48 ++++++++++++++++++++++----------------------- 6 files changed, 37 insertions(+), 37 deletions(-) diff --git a/ext/lsm1/lsm_vtab.c b/ext/lsm1/lsm_vtab.c index f96a6bbd71..bb1460297d 100644 --- a/ext/lsm1/lsm_vtab.c +++ b/ext/lsm1/lsm_vtab.c @@ -26,7 +26,7 @@ ** ** The virtual table contains read-only hidden columns: ** -** lsm1_key A BLOB which is the raw LSM key. If the "keytype" +** lsm1_key A BLOB which is the raw LSM key. If the "keytype" ** is BLOB or TEXT then this column is exactly the ** same as the key. For the UINT keytype, this column ** will be a variable-length integer encoding of the key. diff --git a/ext/misc/csv.c b/ext/misc/csv.c index d08ddd6b3a..b51fbad30e 100644 --- a/ext/misc/csv.c +++ b/ext/misc/csv.c @@ -941,7 +941,7 @@ int sqlite3_csv_init( char **pzErrMsg, const sqlite3_api_routines *pApi ){ -#ifndef SQLITE_OMIT_VIRTUALTABLE +#ifndef SQLITE_OMIT_VIRTUALTABLE int rc; SQLITE_EXTENSION_INIT2(pApi); rc = sqlite3_create_module(db, "csv", &CsvModule, 0); diff --git a/ext/misc/ieee754.c b/ext/misc/ieee754.c index 66d946f3d5..ff5d2d333c 100644 --- a/ext/misc/ieee754.c +++ b/ext/misc/ieee754.c @@ -284,7 +284,7 @@ int sqlite3_ieee_init( SQLITE_EXTENSION_INIT2(pApi); (void)pzErrMsg; /* Unused parameter */ for(i=0; iinctl ){ - inctl = ctl; - fprintf(out, "%.*s'||X'%02x", i-j, &zArg[j], c); - j = i+1; - }else if( ctl ){ - fprintf(out, "%02x", c); - j = i+1; - }else{ - if( inctl ){ - inctl = 0; - fprintf(out, "'\n||'"); - } - if( c=='\'' ){ - fprintf(out, "%.*s'", i-j+1, &zArg[j]); - j = i+1; - } - } - } - fprintf(out, "%s'", &zArg[j]); + for(i=j=0; zArg[i]; i++){ + char c = zArg[i]; + int ctl = iscntrl(c); + if( ctl>inctl ){ + inctl = ctl; + fprintf(out, "%.*s'||X'%02x", i-j, &zArg[j], c); + j = i+1; + }else if( ctl ){ + fprintf(out, "%02x", c); + j = i+1; + }else{ + if( inctl ){ + inctl = 0; + fprintf(out, "'\n||'"); + } + if( c=='\'' ){ + fprintf(out, "%.*s'", i-j+1, &zArg[j]); + j = i+1; + } + } + } + fprintf(out, "%s'", &zArg[j]); } break; } From 16f56e841628b334f2ba3707fc4686804e622fbd Mon Sep 17 00:00:00 2001 From: drh <> Date: Mon, 21 Feb 2022 14:30:59 +0000 Subject: [PATCH 10/10] Fix compiler warnings for older compilers (ex: gcc 4.0.1 powerpc-apple-darwin). FossilOrigin-Name: 5c188243d769681c68938c8e432155c8ec838d9e32fe8d1b12286ebc9d0e87f1 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/date.c | 8 +++++--- src/vdbe.c | 2 +- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/manifest b/manifest index d564147994..9420efd1f3 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Remove\sstray\stab\scharacters\sfrom\sauxiliary\ssource\scode\sfiles. -D 2022-02-21T13:44:51.801 +C Fix\scompiler\swarnings\sfor\solder\scompilers\s(ex:\sgcc\s4.0.1\spowerpc-apple-darwin). +D 2022-02-21T14:30:59.112 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -499,7 +499,7 @@ F src/build.c 9891c2160886cf7e344d7e8f1f7177f9612916c7c67ffeacd64cb34a92d387a8 F src/callback.c 4c19af69835787bfe790ac560f3071a824eb629f34e41f97b52ce5235c77de1c F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e F src/ctime.c 2cce39df1a13e05b7633e6d21b651f21492471f991dd7b323a4ee4e7b7f0b7f1 -F src/date.c 1fcc64294b0e81cc9fa05cf8f773e862dd004f74d023544d43edeeacbcfde7e5 +F src/date.c 1abbd739ae1d3fc8e0aaff995f57332af10d0b332728e4d3f241c494515495f0 F src/dbpage.c 8a01e865bf8bc6d7b1844b4314443a6436c07c3efe1d488ed89e81719047833a F src/dbstat.c 861e08690fcb0f2ee1165eff0060ea8d4f3e2ea10f80dab7d32ad70443a6ff2d F src/delete.c b5f1716b4d723db48254ee0f896e362cd029e865e05414139ea7f539f3884e1d @@ -624,7 +624,7 @@ F src/upsert.c 8789047a8f0a601ea42fa0256d1ba3190c13746b6ba940fe2d25643a7e991937 F src/utf.c ee39565f0843775cc2c81135751ddd93eceb91a673ea2c57f61c76f288b041a0 F src/util.c 602fe229f32a96ceccae4f40824129669582096f7c355f53dbac156c9fecef23 F src/vacuum.c 6c38ddc52f0619865c91dae9c441d4d48bf3040d7dc1bc5b22da1e45547ed0b3 -F src/vdbe.c 13a4de20ee07bdfb3dc74ab49b7912208e309caf762a8d1678fb111e2223af35 +F src/vdbe.c e179d2d6551c6cc3dda7f6f233f9fe3d3c8da2f9bfc46eaabb4b54dc4337d3cf F src/vdbe.h 25dabb25c7e157b84e59260cfb5b466c3ac103ede9f36f4db371332c47601abe F src/vdbeInt.h b45599a2b59f1ce042512ab6786b0b82a8cf3002f6b0fa60b4834e2cd3ac61d8 F src/vdbeapi.c 8863ffb5a7bac42fe9a68aaa3526ee29fc18fb02a9b27188b756de41e33856e9 @@ -1944,8 +1944,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P f36325a6e21c4d3b6ab48ebfb2efabda089281344d1e61949d1c9290e88395b1 -R 9b73a3299298da08d030294b07937ddc +P e25e33582b69289a2c3a6bc403e3911de22a3b529db1a565efb9f1af01b9e382 +R 1bf4b4ff22c1879fe76eac8c2b94a531 U drh -Z c883394327385fdc334da2f7b46c6fac +Z 346e276610f450eefee83609bdbf0861 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 5ecd4a8dd0..a25da3e720 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e25e33582b69289a2c3a6bc403e3911de22a3b529db1a565efb9f1af01b9e382 \ No newline at end of file +5c188243d769681c68938c8e432155c8ec838d9e32fe8d1b12286ebc9d0e87f1 \ No newline at end of file diff --git a/src/date.c b/src/date.c index a510d62750..b96ebc05d2 100644 --- a/src/date.c +++ b/src/date.c @@ -574,8 +574,8 @@ static int toLocaltime( memset(&sLocal, 0, sizeof(sLocal)); computeJD(p); - if( p->iJD<21086676000*(i64)10000 /* 1970-01-01 */ - || p->iJD>21301414560*(i64)10000 /* 2038-01-18 */ + if( p->iJD<2108667600*(i64)100000 /* 1970-01-01 */ + || p->iJD>2130141456*(i64)100000 /* 2038-01-18 */ ){ /* EVIDENCE-OF: R-55269-29598 The localtime_r() C function normally only ** works for years between 1970 and 2037. For dates outside this range, @@ -681,7 +681,9 @@ static int parseModifier( if( !p->rawS || p->validJD ){ rc = 0; p->rawS = 0; - }else if( p->s>=-210866760000 && p->s<=253402300799 ){ + }else if( p->s>=-21086676*(i64)10000 /* -4713-11-24 12:00:00 */ + && p->s<=(25340230*(i64)10000)+799 /* 9999-12-31 23:59:59 */ + ){ r = p->s*1000.0 + 210866760000000.0; clearYMD_HMS_TZ(p); p->iJD = (sqlite3_int64)(r + 0.5); diff --git a/src/vdbe.c b/src/vdbe.c index 5410a79127..83cf382213 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -3243,7 +3243,7 @@ case OP_MakeRecord: { testcase( uu==127 ); testcase( uu==128 ); testcase( uu==32767 ); testcase( uu==32768 ); testcase( uu==8388607 ); testcase( uu==8388608 ); - testcase( uu==2147483647 ); testcase( uu==2147483648 ); + testcase( uu==2147483647 ); testcase( uu==2147483648LL ); testcase( uu==140737488355327LL ); testcase( uu==140737488355328LL ); if( uu<=127 ){ if( (i&1)==i && file_format>=4 ){