From 8a6888c19ed601ee6654529b833e5658fa03ceed Mon Sep 17 00:00:00 2001 From: stephan Date: Sun, 13 Aug 2023 10:22:15 +0000 Subject: [PATCH 01/32] Remove SQLITE_DEBUG from JNI build. FossilOrigin-Name: 82f004cf7408c503c5787b46c7b13ceb0a20a3ad1d4f69d56127772c40e214a1 --- ext/jni/GNUmakefile | 4 ++-- ext/jni/jar-dist.make | 6 +----- manifest | 15 +++++++-------- manifest.uuid | 2 +- 4 files changed, 11 insertions(+), 16 deletions(-) diff --git a/ext/jni/GNUmakefile b/ext/jni/GNUmakefile index 36ef42d31a..1be4c04439 100644 --- a/ext/jni/GNUmakefile +++ b/ext/jni/GNUmakefile @@ -166,8 +166,8 @@ SQLITE_OPT = \ -DSQLITE_THREADSAFE=0 \ -DSQLITE_TEMP_STORE=2 \ -DSQLITE_USE_URI=1 \ - -DSQLITE_C=$(sqlite3.c) \ - -DSQLITE_DEBUG + -DSQLITE_C=$(sqlite3.c) +# -DSQLITE_DEBUG # -DSQLITE_DEBUG is just to work around a -Wall warning # for a var which gets set in all builds but only read # via assert(). diff --git a/ext/jni/jar-dist.make b/ext/jni/jar-dist.make index 9f9d13002a..23a26e4a87 100644 --- a/ext/jni/jar-dist.make +++ b/ext/jni/jar-dist.make @@ -34,11 +34,7 @@ SQLITE_OPT = \ -DSQLITE_THREADSAFE=0 \ -DSQLITE_TEMP_STORE=2 \ -DSQLITE_USE_URI=1 \ - -DSQLITE_ENABLE_FTS5 \ - -DSQLITE_DEBUG -# -DSQLITE_DEBUG is just to work around a -Wall warning -# for a var which gets set in all builds but only read -# via assert(). + -DSQLITE_ENABLE_FTS5 sqlite3-jni.dll = libsqlite3-jni.so $(sqlite3-jni.dll): diff --git a/manifest b/manifest index f112606117..4c91071bd1 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Merge\sthe\sJava\sNative\sInterface\s(JNI)\sbinding\sinto\strunk. -D 2023-08-12T21:39:18.053 +C Remove\sSQLITE_DEBUG\sfrom\sJNI\sbuild. +D 2023-08-13T10:22:15.435 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -231,9 +231,9 @@ F ext/fts5/tool/showfts5.tcl d54da0e067306663e2d5d523965ca487698e722c F ext/icu/README.txt 7ab7ced8ae78e3a645b57e78570ff589d4c672b71370f5aa9e1cd7024f400fc9 F ext/icu/icu.c c074519b46baa484bb5396c7e01e051034da8884bad1a1cb7f09bbe6be3f0282 F ext/icu/sqliteicu.h fa373836ed5a1ee7478bdf8a1650689294e41d0c89c1daab26e9ae78a32075a8 -F ext/jni/GNUmakefile 435485ff2005c4bcdea808f5efe6d4ee66a00430c2499dcc4927b20378486bea +F ext/jni/GNUmakefile 3deba6bc0bf37c1ee5f15d1ff3c3512ae2f3cf44a2b8ae7b4af92690514b0cb4 F ext/jni/README.md 7a614a2fa6c561205f7a53fd8626cf93a7b5711ff454fc1814517f796df398eb -F ext/jni/jar-dist.make f90a553203a57934bf275bed86479485135a52f48ac5c1cfe6499ae07b0b35a4 +F ext/jni/jar-dist.make 93da95f8fe01ef22fccacc27f2e805938058e91e8c72c0532558d3a812a42e74 F ext/jni/src/c/sqlite3-jni.c bea6b8691a5fa3a8626a771757bb261208d3c5fc6598266d3b0ee23d88e35632 F ext/jni/src/c/sqlite3-jni.h c5f941b057a24ee62942e6e1bf5a7fd527e5004d20d9638e84a9382813c3cf2a F ext/jni/src/org/sqlite/jni/Authorizer.java 1308988f7f40579ea0e4deeaec3c6be971630566bd021c31367fe3f5140db892 @@ -2091,9 +2091,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 0a6930a7ff8f8c6ca244d1d654532f3d2a02d77ef67c6cae0c53092743d59ea6 1ba7754045a009d9c94b23ac76b9bb8d9c9cb24d42dcdf1203ee75ac85765d3e -R 71919983f1228c04d42d3555e47fba1b -T +closed 1ba7754045a009d9c94b23ac76b9bb8d9c9cb24d42dcdf1203ee75ac85765d3e Closed\sby\sintegrate-merge. +P 48b13edcec6935bf125b265b41a3e6f7b2407afff89d5b4daa2939e3c5679ca0 +R 5372bd20398f3ed53311b425db8b10c9 U stephan -Z 06dd3519c67c3e383d12eeb6b6fbb0d1 +Z eea4a90fcf3367f65681fd6689ad28cb # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 1c747eb83a..0b9a2ddb71 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -48b13edcec6935bf125b265b41a3e6f7b2407afff89d5b4daa2939e3c5679ca0 \ No newline at end of file +82f004cf7408c503c5787b46c7b13ceb0a20a3ad1d4f69d56127772c40e214a1 \ No newline at end of file From 07ef60350d578176253deab4f1a2e4a36ad567e3 Mon Sep 17 00:00:00 2001 From: drh <> Date: Mon, 14 Aug 2023 12:05:38 +0000 Subject: [PATCH 02/32] Enable SEH be default in Windows builds. FossilOrigin-Name: faae792fd5db7afeb7e4345d96f14c8986ea9a3cd4764ddee71314bfca36ac71 --- Makefile.msc | 2 +- autoconf/Makefile.msc | 2 +- manifest | 16 ++++++++-------- manifest.uuid | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Makefile.msc b/Makefile.msc index ab70e80b9c..95f0eee0d4 100644 --- a/Makefile.msc +++ b/Makefile.msc @@ -56,7 +56,7 @@ USE_STDCALL = 0 # in the core library. # !IFNDEF USE_SEH -USE_SEH = 0 +USE_SEH = 1 !ENDIF # Set this non-0 to have the shell executable link against the core dynamic diff --git a/autoconf/Makefile.msc b/autoconf/Makefile.msc index 24154dd5d8..261ac61bd5 100644 --- a/autoconf/Makefile.msc +++ b/autoconf/Makefile.msc @@ -56,7 +56,7 @@ USE_STDCALL = 0 # in the core library. # !IFNDEF USE_SEH -USE_SEH = 0 +USE_SEH = 1 !ENDIF # Set this non-0 to have the shell executable link against the core dynamic diff --git a/manifest b/manifest index 4c91071bd1..328d43a114 100644 --- a/manifest +++ b/manifest @@ -1,11 +1,11 @@ -C Remove\sSQLITE_DEBUG\sfrom\sJNI\sbuild. -D 2023-08-13T10:22:15.435 +C Enable\sSEH\sbe\sdefault\sin\sWindows\sbuilds. +D 2023-08-14T12:05:38.248 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 F Makefile.in 6f391d54fa01f8a49b024fef5cce1ab8234c281164641cf9a52694b432bdec1b F Makefile.linux-gcc f3842a0b1efbfbb74ac0ef60e56b301836d05b4d867d014f714fa750048f1ab6 -F Makefile.msc dd4c8fcc274e7933756cc581f7d3b4de080e8e8eef7770edde079f4aa9c6c206 +F Makefile.msc e0e2630b327b31232f4f1c748cae8af358f897e88cae7479218369d1d510f94d F README.md c1c4218efcc4071a6e26db2b517fdbc1035696a29b370edd655faddbef02b224 F VERSION c6366dc72582d3144ce87b013cc35fe48d62f6d07d5be0c9716ea33c862144aa F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50 @@ -15,7 +15,7 @@ F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903 F autoconf/Makefile.am a8d1d24affe52ebf8d7ddcf91aa973fa0316618ab95bb68c87cabf8faf527dc8 F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac -F autoconf/Makefile.msc 00f11ce1f7904416fe841c33e7d789defe8c39e1df6b97e93ed2af3b1bbaf9d7 +F autoconf/Makefile.msc 012cdd820963653a7db147a185ebe9085756b6ab15ac964e8cc1dae4c29485cd F autoconf/README.first 6c4f34fe115ff55d4e8dbfa3cecf04a0188292f7 F autoconf/README.txt 42cfd21d0b19dc7d5d85fb5c405c5f3c6a4c923021c39128f6ba685355d8fd56 F autoconf/configure.ac ec7fa914c5e74ff212fe879f9bb6918e1234497e05facfb641f30c4d5893b277 @@ -2091,8 +2091,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 48b13edcec6935bf125b265b41a3e6f7b2407afff89d5b4daa2939e3c5679ca0 -R 5372bd20398f3ed53311b425db8b10c9 -U stephan -Z eea4a90fcf3367f65681fd6689ad28cb +P 82f004cf7408c503c5787b46c7b13ceb0a20a3ad1d4f69d56127772c40e214a1 +R 4caf4b69e462e06348611937e8ca173a +U drh +Z f515be5ab4373e18d8c0262759649706 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 0b9a2ddb71..9ff81014e6 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -82f004cf7408c503c5787b46c7b13ceb0a20a3ad1d4f69d56127772c40e214a1 \ No newline at end of file +faae792fd5db7afeb7e4345d96f14c8986ea9a3cd4764ddee71314bfca36ac71 \ No newline at end of file From 592ae2823cfaa0a1b56b782aa45201c5618171c2 Mon Sep 17 00:00:00 2001 From: drh <> Date: Mon, 14 Aug 2023 12:20:44 +0000 Subject: [PATCH 03/32] Fix harmless compiler warnings reported by MSVC. FossilOrigin-Name: 391e21bb6e0b2f4632972b6617a3a18192f88deb29eee5bc060846468e624b21 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/update.c | 6 +++--- src/vdbeapi.c | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/manifest b/manifest index 328d43a114..01b41d272b 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Enable\sSEH\sbe\sdefault\sin\sWindows\sbuilds. -D 2023-08-14T12:05:38.248 +C Fix\sharmless\scompiler\swarnings\sreported\sby\sMSVC. +D 2023-08-14T12:20:44.209 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -748,7 +748,7 @@ F src/threads.c 4ae07fa022a3dc7c5beb373cf744a85d3c5c6c3c F src/tokenize.c 23d9f4539880b40226254ad9072f4ecf12eb1902e62aea47aac29928afafcfd5 F src/treeview.c 1d52fbc4e97161e65858d36e3424ea6e3fc045dd8a679c82b4b9593dc30de3bd F src/trigger.c ad6ab9452715fa9a8075442e15196022275b414b9141b566af8cdb7a1605f2b0 -F src/update.c 0bb9171afaa4d0b100ad946873bccda7aef90ffe083ef5c63668fce08c4df9da +F src/update.c 6904814dd62a7a93bbb86d9f1419c7f134a9119582645854ab02b36b676d9f92 F src/upsert.c 5303dc6c518fa7d4b280ec65170f465c7a70b7ac2b22491598f6d0b4875b3145 F src/utf.c ee39565f0843775cc2c81135751ddd93eceb91a673ea2c57f61c76f288b041a0 F src/util.c a40062117e705eb3339201842717a022092816b92479eead6397cde28af32ff9 @@ -756,7 +756,7 @@ F src/vacuum.c 604fcdaebe76f3497c855afcbf91b8fa5046b32de3045bab89cc008d68e40104 F src/vdbe.c 346d848a0bf8128e3e3722c5406f4bde6c32d7093b93402c6f8e0718d19305c3 F src/vdbe.h 41485521f68e9437fdb7ec4a90f9d86ab294e9bb8281e33b235915e29122cfc0 F src/vdbeInt.h 949669dfd8a41550d27dcb905b494f2ccde9a2e6c1b0b04daa1227e2e74c2b2c -F src/vdbeapi.c f37822f215740ede2a8fcae99bc13f2cc3a72dd0e1d22b81b9298c5ca67dbc38 +F src/vdbeapi.c 37341acd781fda162e8cf4d9fc2eaea2febad3b365877a9d7233b8c6d0960d85 F src/vdbeaux.c e3aa5c46827cd95e0fc4d0f302fa3e901ab5f07258fdbb42709eeef40f63018d F src/vdbeblob.c 2516697b3ee8154eb8915f29466fb5d4f1ae39ee8b755ea909cefaf57ec5e2ce F src/vdbemem.c 317b9f48708139db6239ade40c7980b4bc8233168383690d588dad6d8437f722 @@ -2091,8 +2091,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 82f004cf7408c503c5787b46c7b13ceb0a20a3ad1d4f69d56127772c40e214a1 -R 4caf4b69e462e06348611937e8ca173a +P faae792fd5db7afeb7e4345d96f14c8986ea9a3cd4764ddee71314bfca36ac71 +R fe9366bd97de6b1440602f35f2ed9fc3 U drh -Z f515be5ab4373e18d8c0262759649706 +Z cc27d150f7bbd6ca9f01328a7c41ab26 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 9ff81014e6..9f74628c6c 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -faae792fd5db7afeb7e4345d96f14c8986ea9a3cd4764ddee71314bfca36ac71 \ No newline at end of file +391e21bb6e0b2f4632972b6617a3a18192f88deb29eee5bc060846468e624b21 \ No newline at end of file diff --git a/src/update.c b/src/update.c index 3b3c2f838b..cd7d73f3f7 100644 --- a/src/update.c +++ b/src/update.c @@ -1259,9 +1259,9 @@ static void updateVirtualTable( sqlite3ExprDup(db, pChanges->a[aXRef[i]].pExpr, 0) ); }else{ - Expr *pRow = exprRowColumn(pParse, i); - if( pRow ) pRow->op2 = OPFLAG_NOCHNG; - pList = sqlite3ExprListAppend(pParse, pList, pRow); + Expr *pRowExpr = exprRowColumn(pParse, i); + if( pRowExpr ) pRowExpr->op2 = OPFLAG_NOCHNG; + pList = sqlite3ExprListAppend(pParse, pList, pRowExpr); } } diff --git a/src/vdbeapi.c b/src/vdbeapi.c index cc58e7a877..79b5de9f0e 100644 --- a/src/vdbeapi.c +++ b/src/vdbeapi.c @@ -1864,7 +1864,7 @@ int sqlite3_stmt_explain(sqlite3_stmt *pStmt, int eMode){ Vdbe *v = (Vdbe*)pStmt; int rc; sqlite3_mutex_enter(v->db->mutex); - if( v->explain==eMode ){ + if( ((int)v->explain)==eMode ){ rc = SQLITE_OK; }else if( eMode<0 || eMode>2 ){ rc = SQLITE_ERROR; From 1f72b53461534a5038f8caedeaf475024b29c2d2 Mon Sep 17 00:00:00 2001 From: drh <> Date: Mon, 14 Aug 2023 13:33:19 +0000 Subject: [PATCH 04/32] Change the name of the ".binary" command in the CLI to ".crnl". The sense of the setting is inverted. The original ".binary" still works for backwards compatibility but is now undocumented. ".crnl" is also undocumented on machines where it is a no-op (all machines other than Windows). [forum:/forumpost/8bd0b0fbdbc12477|forum thread 8bd0b0fbdbc12477] FossilOrigin-Name: 544de2da09cd7b9bbb6cb4c52bb22325ace3391fca00c6a43847bfc158032b66 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/shell.c.in | 23 ++++++++++++++++++++++- 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 01b41d272b..d123a018ac 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sharmless\scompiler\swarnings\sreported\sby\sMSVC. -D 2023-08-14T12:20:44.209 +C Change\sthe\sname\sof\sthe\s".binary"\scommand\sin\sthe\sCLI\sto\s".crnl".\s\sThe\ssense\sof\nthe\ssetting\sis\sinverted.\s\sThe\soriginal\s".binary"\sstill\sworks\sfor\sbackwards\ncompatibility\sbut\sis\snow\sundocumented.\s\s".crnl"\sis\salso\sundocumented\son\smachines\nwhere\sit\sis\sa\sno-op\s(all\smachines\sother\sthan\sWindows).\n[forum:/forumpost/8bd0b0fbdbc12477|forum\sthread\s8bd0b0fbdbc12477] +D 2023-08-14T13:33:19.213 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -684,7 +684,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c F src/resolve.c 37953a5f36c60bea413c3c04efcd433b6177009f508ef2ace0494728912fe2e9 F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97 F src/select.c 5f545a2c8702d4d3430bbb188cfec47d6c122d899061ef00cbe56af14591c574 -F src/shell.c.in 694aaf751f00610381533d4a31c83d142cfc83ef91ef65e2aa6912ace7c39b40 +F src/shell.c.in 0c3dd37ab2787a63f1e1c1b7160647c5d3276d9ac941890b2735a773a7495d27 F src/sqlite.h.in 73a366c1c45d5ac9888cfe81c458826a44498531d106cfb4f328193ab5f6f17d F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h da473ce2b3d0ae407a6300c4a164589b9a6bfdbec9462688a8593ff16f3bb6e4 @@ -2091,8 +2091,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 faae792fd5db7afeb7e4345d96f14c8986ea9a3cd4764ddee71314bfca36ac71 -R fe9366bd97de6b1440602f35f2ed9fc3 +P 391e21bb6e0b2f4632972b6617a3a18192f88deb29eee5bc060846468e624b21 +R 676721f5b95d5972349e28e60fde58e8 U drh -Z cc27d150f7bbd6ca9f01328a7c41ab26 +Z 343246f1d1f398cedd6a7b7f3f3868a2 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 9f74628c6c..e65d56dc16 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -391e21bb6e0b2f4632972b6617a3a18192f88deb29eee5bc060846468e624b21 \ No newline at end of file +544de2da09cd7b9bbb6cb4c52bb22325ace3391fca00c6a43847bfc158032b66 \ No newline at end of file diff --git a/src/shell.c.in b/src/shell.c.in index 1e65d0e9fd..55a13bc116 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -4799,7 +4799,6 @@ static const char *(azHelp[]) = { " --async Write to FILE without journal and fsync()", #endif ".bail on|off Stop after hitting an error. Default OFF", - ".binary on|off Turn binary output on or off. Default OFF", #ifndef SQLITE_SHELL_FIDDLE ".cd DIRECTORY Change the working directory to DIRECTORY", #endif @@ -4809,6 +4808,9 @@ static const char *(azHelp[]) = { ".clone NEWDB Clone data into NEWDB from the existing database", #endif ".connection [close] [#] Open or close an auxiliary database connection", +#if defined(_WIN32) || defined(WIN32) + ".crnl on|off Turn translate \\n to \\r\\n. Default ON", +#endif ".databases List names and files of attached databases", ".dbconfig ?op? ?val? List or change sqlite3_db_config() options", #if SQLITE_SHELL_HAVE_RECOVER @@ -8164,6 +8166,7 @@ static int do_meta_command(char *zLine, ShellState *p){ } }else + /* Undocumented. Legacy only. See "crnl" below */ if( c=='b' && n>=3 && cli_strncmp(azArg[0], "binary", n)==0 ){ if( nArg==2 ){ if( booleanValue(azArg[1]) ){ @@ -8172,6 +8175,8 @@ static int do_meta_command(char *zLine, ShellState *p){ setTextMode(p->out, 1); } }else{ + raw_printf(stderr, "The \".binary\" command is deprecated." + " Use \".crnl\" instead.\n"); raw_printf(stderr, "Usage: .binary on|off\n"); rc = 1; } @@ -8299,6 +8304,22 @@ static int do_meta_command(char *zLine, ShellState *p){ } }else + if( c=='c' && n==4 && cli_strncmp(azArg[0], "crnl", n)==0 ){ + if( nArg==2 ){ + if( booleanValue(azArg[1]) ){ + setTextMode(p->out, 1); + }else{ + setBinaryMode(p->out, 1); + } + }else{ +#if !defined(_WIN32) && !defined(WIN32) + raw_printf(stderr, "The \".crnl\" is a no-op on non-Windows machines.\n"); +#endif + raw_printf(stderr, "Usage: .crnl on|off\n"); + rc = 1; + } + }else + if( c=='d' && n>1 && cli_strncmp(azArg[0], "databases", n)==0 ){ char **azName = 0; int nName = 0; From 9541fbc2835ca9f2a9153913996055a94d0ea6c1 Mon Sep 17 00:00:00 2001 From: dan Date: Mon, 14 Aug 2023 18:21:56 +0000 Subject: [PATCH 05/32] Fix a problem in sqlite3_snapshot_recover() introduced by the [8a6b0c24937e855b] merge. FossilOrigin-Name: c2577eb0a4a627c65d675f1446514843486092be9cb271b682793a0107e496cd --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/wal.c | 3 ++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index d123a018ac..84a900c7c7 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Change\sthe\sname\sof\sthe\s".binary"\scommand\sin\sthe\sCLI\sto\s".crnl".\s\sThe\ssense\sof\nthe\ssetting\sis\sinverted.\s\sThe\soriginal\s".binary"\sstill\sworks\sfor\sbackwards\ncompatibility\sbut\sis\snow\sundocumented.\s\s".crnl"\sis\salso\sundocumented\son\smachines\nwhere\sit\sis\sa\sno-op\s(all\smachines\sother\sthan\sWindows).\n[forum:/forumpost/8bd0b0fbdbc12477|forum\sthread\s8bd0b0fbdbc12477] -D 2023-08-14T13:33:19.213 +C Fix\sa\sproblem\sin\ssqlite3_snapshot_recover()\sintroduced\sby\sthe\s[8a6b0c24937e855b]\smerge. +D 2023-08-14T18:21:56.123 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -765,7 +765,7 @@ F src/vdbetrace.c fe0bc29ebd4e02c8bc5c1945f1d2e6be5927ec12c06d89b03ef2a4def34bf8 F src/vdbevtab.c 57fa8f56478e5b5cb558cb425e7878515e0a105c54f96f1d1bbf4b9433529254 F src/vtab.c 1ecf8c3745d29275688d583e12822fa984d421e0286b5ef50c137bc3bf6d7a64 F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9 -F src/wal.c 02e10f033a6972bc7d50122b400318003199c504cda48f61ad404564505f4e89 +F src/wal.c 3b068bc1db5d42d72b940c377b6fdb0e6d41bc106c5e99bfc40bbbe973e5f3e2 F src/wal.h 04a9e53121d5076f2a173b0f2facb39d33047093fee71bd3bbe6b1f6f1f5fd4b F src/walker.c 7c7ea0115345851c3da4e04e2e239a29983b61fb5b038b94eede6aba462640e2 F src/where.c b8917792f1e0dbfa28fb29e6cd3d560060d69667be0ba4c491cbc772363264f5 @@ -2091,8 +2091,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 391e21bb6e0b2f4632972b6617a3a18192f88deb29eee5bc060846468e624b21 -R 676721f5b95d5972349e28e60fde58e8 -U drh -Z 343246f1d1f398cedd6a7b7f3f3868a2 +P 544de2da09cd7b9bbb6cb4c52bb22325ace3391fca00c6a43847bfc158032b66 +R a0b73071de83a84cf4d127819242513e +U dan +Z e2505e5a9210a6df91bb91a015427010 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index e65d56dc16..f0f0ce3b08 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -544de2da09cd7b9bbb6cb4c52bb22325ace3391fca00c6a43847bfc158032b66 \ No newline at end of file +c2577eb0a4a627c65d675f1446514843486092be9cb271b682793a0107e496cd \ No newline at end of file diff --git a/src/wal.c b/src/wal.c index c9d8eaebe5..4ee5d80f79 100644 --- a/src/wal.c +++ b/src/wal.c @@ -3163,7 +3163,8 @@ static int walSnapshotRecover( rc = walHashGet(pWal, walFramePage(i), &sLoc); if( rc!=SQLITE_OK ) break; - pgno = sLoc.aPgno[i-sLoc.iZero]; + assert( i - sLoc.iZero - 1 >=0 ); + pgno = sLoc.aPgno[i-sLoc.iZero-1]; iDbOff = (i64)(pgno-1) * szPage; if( iDbOff+szPage<=szDb ){ From db9a708ee729c1b369cebf9e30ebcfdd8d661505 Mon Sep 17 00:00:00 2001 From: drh <> Date: Mon, 14 Aug 2023 19:10:48 +0000 Subject: [PATCH 06/32] Fix the autoconf makefile for the CLI such that it disables double-quoted strings by default, as all other builds of the CLI do. [forum:/forumpost/9794b6aaa5|forum post 9794b6aaa5]. FossilOrigin-Name: 85fd4f0ef41a883448f16d55b7f8bd5c7b1d9c89a3d7d9bcae9c2744ed843099 --- autoconf/Makefile.am | 2 +- manifest | 14 +++++++------- manifest.uuid | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/autoconf/Makefile.am b/autoconf/Makefile.am index 694419b27d..1eaa560ff8 100644 --- a/autoconf/Makefile.am +++ b/autoconf/Makefile.am @@ -9,7 +9,7 @@ sqlite3_SOURCES = shell.c sqlite3.h EXTRA_sqlite3_SOURCES = sqlite3.c sqlite3_LDADD = @EXTRA_SHELL_OBJ@ @READLINE_LIBS@ sqlite3_DEPENDENCIES = @EXTRA_SHELL_OBJ@ -sqlite3_CFLAGS = $(AM_CFLAGS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_DBSTAT_VTAB $(SHELL_CFLAGS) +sqlite3_CFLAGS = $(AM_CFLAGS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_DQS=0 -DSQLITE_ENABLE_DBPAGE_VTAB -DSQLITE_ENABLE_STMTVTAB -DSQLITE_ENABLE_DBSTAT_VTAB $(SHELL_CFLAGS) include_HEADERS = sqlite3.h sqlite3ext.h diff --git a/manifest b/manifest index 84a900c7c7..578a742d95 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sa\sproblem\sin\ssqlite3_snapshot_recover()\sintroduced\sby\sthe\s[8a6b0c24937e855b]\smerge. -D 2023-08-14T18:21:56.123 +C Fix\sthe\sautoconf\smakefile\sfor\sthe\sCLI\ssuch\sthat\sit\sdisables\sdouble-quoted\nstrings\sby\sdefault,\sas\sall\sother\sbuilds\sof\sthe\sCLI\sdo.\n[forum:/forumpost/9794b6aaa5|forum\spost\s9794b6aaa5]. +D 2023-08-14T19:10:48.076 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -13,7 +13,7 @@ F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2 F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90 F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903 -F autoconf/Makefile.am a8d1d24affe52ebf8d7ddcf91aa973fa0316618ab95bb68c87cabf8faf527dc8 +F autoconf/Makefile.am adedc1324b6a87fdd1265ddd336d2fb7d4f36a0e77b86ea553ae7cc4ea239347 F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac F autoconf/Makefile.msc 012cdd820963653a7db147a185ebe9085756b6ab15ac964e8cc1dae4c29485cd F autoconf/README.first 6c4f34fe115ff55d4e8dbfa3cecf04a0188292f7 @@ -2091,8 +2091,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 544de2da09cd7b9bbb6cb4c52bb22325ace3391fca00c6a43847bfc158032b66 -R a0b73071de83a84cf4d127819242513e -U dan -Z e2505e5a9210a6df91bb91a015427010 +P c2577eb0a4a627c65d675f1446514843486092be9cb271b682793a0107e496cd +R 487f4829bdb09137b6b15dcfdad5cf32 +U drh +Z 63a74f78c58164771feacd560d95600e # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index f0f0ce3b08..fda70f1d93 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c2577eb0a4a627c65d675f1446514843486092be9cb271b682793a0107e496cd \ No newline at end of file +85fd4f0ef41a883448f16d55b7f8bd5c7b1d9c89a3d7d9bcae9c2744ed843099 \ No newline at end of file From f0c1ea9e86e3be256687d5ab40027e9561b42805 Mon Sep 17 00:00:00 2001 From: dan Date: Tue, 15 Aug 2023 10:57:08 +0000 Subject: [PATCH 07/32] Fix an off-by-one error causing a buffer overread in test2.c. FossilOrigin-Name: e1edf95ecc8f6840fd62abe83121fddeab7413c316b2e20b60fd3b2c8fdd4dca --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/test2.c | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index 578a742d95..63aa7e31d2 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sthe\sautoconf\smakefile\sfor\sthe\sCLI\ssuch\sthat\sit\sdisables\sdouble-quoted\nstrings\sby\sdefault,\sas\sall\sother\sbuilds\sof\sthe\sCLI\sdo.\n[forum:/forumpost/9794b6aaa5|forum\spost\s9794b6aaa5]. -D 2023-08-14T19:10:48.076 +C Fix\san\soff-by-one\serror\scausing\sa\sbuffer\soverread\sin\stest2.c. +D 2023-08-15T10:57:08.675 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -694,7 +694,7 @@ F src/status.c 160c445d7d28c984a0eae38c144f6419311ed3eace59b44ac6dafc20db4af749 F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1 F src/tclsqlite.c ecbc3c99c0d0c3ed122a913f143026c26d38d57f33e06bb71185dd5c1efe37cd F src/test1.c ebba2473874a23add4a10881b90bd445cfa7f59f90749434938aec14239c6486 -F src/test2.c 827446e259a3b7ab949da1542953edda7b5117982576d3e6f1c24a0dd20a5cef +F src/test2.c 54520d0565ef2b9bf0f8f1dcac43dc4d06baf4ffe13d10905f8d8c3ad3e4b9ab F src/test3.c e5178558c41ff53236ae0271e9acb3d6885a94981d2eb939536ee6474598840e F src/test4.c 4533b76419e7feb41b40582554663ed3cd77aaa54e135cf76b3205098cd6e664 F src/test5.c 328aae2c010c57a9829d255dc099d6899311672d @@ -2091,8 +2091,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 c2577eb0a4a627c65d675f1446514843486092be9cb271b682793a0107e496cd -R 487f4829bdb09137b6b15dcfdad5cf32 -U drh -Z 63a74f78c58164771feacd560d95600e +P 85fd4f0ef41a883448f16d55b7f8bd5c7b1d9c89a3d7d9bcae9c2744ed843099 +R 1b9d4cea79e74e7141aa61fb11c90d9e +U dan +Z 954bb096ffde5f026b4a133ace1967c1 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index fda70f1d93..4e0a30acc6 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -85fd4f0ef41a883448f16d55b7f8bd5c7b1d9c89a3d7d9bcae9c2744ed843099 \ No newline at end of file +e1edf95ecc8f6840fd62abe83121fddeab7413c316b2e20b60fd3b2c8fdd4dca \ No newline at end of file diff --git a/src/test2.c b/src/test2.c index d5db3867b8..c75fa2ebab 100644 --- a/src/test2.c +++ b/src/test2.c @@ -608,7 +608,7 @@ static int faultSimCallback(int x){ zInt[i] = (x%10) + '0'; } if( isNeg ) zInt[i--] = '-'; - memcpy(faultSimScript+faultSimScriptSize, zInt+i+1, sizeof(zInt)-i); + memcpy(faultSimScript+faultSimScriptSize, zInt+i+1, sizeof(zInt)-i-1); } rc = Tcl_Eval(faultSimInterp, faultSimScript); if( rc ){ From 00eee079113d9e4f840250c78748789bf366eb05 Mon Sep 17 00:00:00 2001 From: drh <> Date: Tue, 15 Aug 2023 11:58:22 +0000 Subject: [PATCH 08/32] Fix the PRAGMA case_sensitive_like command so that the LIKE function continues to be innocuous after the PRAGMA. [forum:/forumpost/925dc9f67804c540|Forum post 925dc9f67804c540]. FossilOrigin-Name: 84c268c34cba7207a90dad2a8e972ce90c85304e91f4933c76963822ad1ae48b --- manifest | 16 ++++++++-------- manifest.uuid | 2 +- src/func.c | 13 +++++++++---- test/like.test | 20 ++++++++++++++++++++ 4 files changed, 38 insertions(+), 13 deletions(-) diff --git a/manifest b/manifest index 63aa7e31d2..4fe7361729 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\san\soff-by-one\serror\scausing\sa\sbuffer\soverread\sin\stest2.c. -D 2023-08-15T10:57:08.675 +C Fix\sthe\sPRAGMA\scase_sensitive_like\scommand\sso\sthat\sthe\sLIKE\sfunction\scontinues\nto\sbe\sinnocuous\safter\sthe\sPRAGMA.\n[forum:/forumpost/925dc9f67804c540|Forum\spost\s925dc9f67804c540]. +D 2023-08-15T11:58:22.349 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -636,7 +636,7 @@ F src/delete.c cb766727c78e715f9fb7ec8a7d03658ed2a3016343ca687acfcec9083cdca500 F src/expr.c 1affe0cc049683ef0ef3545d9b6901508556b0ef7e2892a344c3df6d7288d79d F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007 F src/fkey.c a7fcbf7e66d14dbb73cf49f31489ebf66d0e6006c62b95246924a3bae9f37b36 -F src/func.c cc1da67fd643a43cfe691784158ec656d8ec6d13bb17e67018b01b38b3e4f5ab +F src/func.c dd1ecd1be6aaa67c9fa723f841e05e1536314c6aaa0509e25289b310f64dbb9c F src/global.c 29f56a330ed9d1b5cd9b79ac0ca36f97ac3afc730ff8bfa987b0db9e559d684d F src/hash.c 9ee4269fb1d6632a6fecfb9479c93a1f29271bddbbaf215dd60420bcb80c7220 F src/hash.h 3340ab6e1d13e725571d7cee6d3e3135f0779a7d8e76a9ce0a85971fa3953c51 @@ -1284,7 +1284,7 @@ F test/kvtest.c 6e0228409ea7ca0497dad503fbd109badb5e59545d131014b6aaac68b56f484a F test/lastinsert.test 42e948fd6442f07d60acbd15d33fb86473e0ef63 F test/laststmtchanges.test ae613f53819206b3222771828d024154d51db200 F test/lemon-test01.y 58b764610fd934e189ffbb0bbfa33d171b9cb06019b55bdc04d090d6767e11d7 -F test/like.test 5fe0bc37f307aef0a453ce2de4632bdfc0759448f0421c39f6d53caefe905fac +F test/like.test 242ee7f5d08a031144c0daf63bbd7e7710c847ccf387a83347e0b61b3aa69526 F test/like2.test d3be15fefee3e02fc88942a9b98f26c5339bbdef7783c90023c092c4955fe3d3 F test/like3.test a76e5938fadbe6d32807284c796bafd869974a961057bc5fc5a28e06de98745c F test/limit.test 350f5d03c29e7dff9a2cde016f84f8d368d40bcd02fa2b2a52fa10c4bf3cbfaf @@ -2091,8 +2091,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 85fd4f0ef41a883448f16d55b7f8bd5c7b1d9c89a3d7d9bcae9c2744ed843099 -R 1b9d4cea79e74e7141aa61fb11c90d9e -U dan -Z 954bb096ffde5f026b4a133ace1967c1 +P e1edf95ecc8f6840fd62abe83121fddeab7413c316b2e20b60fd3b2c8fdd4dca +R fdf43050aa2ff71098fa1da54047ef69 +U drh +Z c477dc1d859af6b1c36a11efde7a7bc8 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 4e0a30acc6..6a346141c6 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e1edf95ecc8f6840fd62abe83121fddeab7413c316b2e20b60fd3b2c8fdd4dca \ No newline at end of file +84c268c34cba7207a90dad2a8e972ce90c85304e91f4933c76963822ad1ae48b \ No newline at end of file diff --git a/src/func.c b/src/func.c index ef06a79fb9..ca0075edc3 100644 --- a/src/func.c +++ b/src/func.c @@ -2154,8 +2154,10 @@ void sqlite3RegisterPerConnectionBuiltinFunctions(sqlite3 *db){ ** sensitive. */ void sqlite3RegisterLikeFunctions(sqlite3 *db, int caseSensitive){ + FuncDef *pDef; struct compareInfo *pInfo; int flags; + int nArg; if( caseSensitive ){ pInfo = (struct compareInfo*)&likeInfoAlt; flags = SQLITE_FUNC_LIKE | SQLITE_FUNC_CASE; @@ -2163,10 +2165,13 @@ void sqlite3RegisterLikeFunctions(sqlite3 *db, int caseSensitive){ pInfo = (struct compareInfo*)&likeInfoNorm; flags = SQLITE_FUNC_LIKE; } - sqlite3CreateFunc(db, "like", 2, SQLITE_UTF8, pInfo, likeFunc, 0, 0, 0, 0, 0); - sqlite3CreateFunc(db, "like", 3, SQLITE_UTF8, pInfo, likeFunc, 0, 0, 0, 0, 0); - sqlite3FindFunction(db, "like", 2, SQLITE_UTF8, 0)->funcFlags |= flags; - sqlite3FindFunction(db, "like", 3, SQLITE_UTF8, 0)->funcFlags |= flags; + for(nArg=2; nArg<=3; nArg++){ + sqlite3CreateFunc(db, "like", nArg, SQLITE_UTF8, pInfo, likeFunc, + 0, 0, 0, 0, 0); + pDef = sqlite3FindFunction(db, "like", nArg, SQLITE_UTF8, 0); + pDef->funcFlags |= flags; + pDef->funcFlags &= ~SQLITE_FUNC_UNSAFE; + } } /* diff --git a/test/like.test b/test/like.test index e8662dc6c3..d314e96a19 100644 --- a/test/like.test +++ b/test/like.test @@ -1140,4 +1140,24 @@ do_execsql_test 17.1 { } {1} +# 2023-08-15 https://sqlite.org/forum/forumpost/925dc9f67804c540 +# +reset_db +sqlite3_db_config db DEFENSIVE 1 +db eval {PRAGMA trusted_schema=OFF} +do_execsql_test 18.0 { + CREATE TABLE t1(x INT, y TEXT); + INSERT INTO t1 VALUES(1,'abc'),(2,'ABC'),(3,'Abc'); + CREATE VIEW t2 AS SELECT * FROM t1 WHERE y LIKE 'a%'; + SELECT * FROM t2; +} {1 abc 2 ABC 3 Abc} +do_execsql_test 18.1 { + PRAGMA case_sensitive_like=OFF; + SELECT * FROM t2; +} {1 abc 2 ABC 3 Abc} +do_execsql_test 18.2 { + PRAGMA case_sensitive_like=ON; + SELECT * FROM t2; +} {1 abc} + finish_test From b93760e1e7775044be6de87af4ce92979c84e1d0 Mon Sep 17 00:00:00 2001 From: drh <> Date: Tue, 15 Aug 2023 12:27:27 +0000 Subject: [PATCH 09/32] Use a dodgy substitute if the INFINITY macro is not available. See [forum:/forumpost/8e66e19bb9|forumpost 8e66e19bb9]. FossilOrigin-Name: 4ae72c896761df5cd37c98ca3eeee7d4c6af3e4ccf74edd88ff902ef38f0765b --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/util.c | 4 ++++ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/manifest b/manifest index 4fe7361729..6657a139af 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sthe\sPRAGMA\scase_sensitive_like\scommand\sso\sthat\sthe\sLIKE\sfunction\scontinues\nto\sbe\sinnocuous\safter\sthe\sPRAGMA.\n[forum:/forumpost/925dc9f67804c540|Forum\spost\s925dc9f67804c540]. -D 2023-08-15T11:58:22.349 +C Use\sa\sdodgy\ssubstitute\sif\sthe\sINFINITY\smacro\sis\snot\savailable.\sSee\n[forum:/forumpost/8e66e19bb9|forumpost\s8e66e19bb9]. +D 2023-08-15T12:27:27.478 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -751,7 +751,7 @@ F src/trigger.c ad6ab9452715fa9a8075442e15196022275b414b9141b566af8cdb7a1605f2b0 F src/update.c 6904814dd62a7a93bbb86d9f1419c7f134a9119582645854ab02b36b676d9f92 F src/upsert.c 5303dc6c518fa7d4b280ec65170f465c7a70b7ac2b22491598f6d0b4875b3145 F src/utf.c ee39565f0843775cc2c81135751ddd93eceb91a673ea2c57f61c76f288b041a0 -F src/util.c a40062117e705eb3339201842717a022092816b92479eead6397cde28af32ff9 +F src/util.c 24f4458bb7a57b0e1b2858484fd62ea83fe63dcb0bce21a96bf9fe31fd402038 F src/vacuum.c 604fcdaebe76f3497c855afcbf91b8fa5046b32de3045bab89cc008d68e40104 F src/vdbe.c 346d848a0bf8128e3e3722c5406f4bde6c32d7093b93402c6f8e0718d19305c3 F src/vdbe.h 41485521f68e9437fdb7ec4a90f9d86ab294e9bb8281e33b235915e29122cfc0 @@ -2091,8 +2091,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 e1edf95ecc8f6840fd62abe83121fddeab7413c316b2e20b60fd3b2c8fdd4dca -R fdf43050aa2ff71098fa1da54047ef69 +P 84c268c34cba7207a90dad2a8e972ce90c85304e91f4933c76963822ad1ae48b +R 68b1065fea49c28c4ec46e875054e009 U drh -Z c477dc1d859af6b1c36a11efde7a7bc8 +Z 1d8e3732f722b552a83197dee226a295 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 6a346141c6..0356419027 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -84c268c34cba7207a90dad2a8e972ce90c85304e91f4933c76963822ad1ae48b \ No newline at end of file +4ae72c896761df5cd37c98ca3eeee7d4c6af3e4ccf74edd88ff902ef38f0765b \ No newline at end of file diff --git a/src/util.c b/src/util.c index e417034754..cb29736fbd 100644 --- a/src/util.c +++ b/src/util.c @@ -610,7 +610,11 @@ do_atof_calc: } assert( r>=0.0 ); if( r>+1.7976931348623157081452742373e+308L ){ +#ifdef INFINITY *pResult = +INFINITY; +#else + *pResult = 1.0e308*10.0; +#endif }else{ *pResult = (double)r; } From 8c5611a169dd3b0b26418f9e3a0ab9d84c7886a3 Mon Sep 17 00:00:00 2001 From: dan Date: Tue, 15 Aug 2023 14:53:49 +0000 Subject: [PATCH 10/32] Fix problems in fts5 test code. FossilOrigin-Name: c16ed3b1cc7b4c21bfa96062bf9028ae071c89e63df3b444b59f1753594e4e94 --- ext/fts5/fts5_expr.c | 2 ++ ext/fts5/fts5_index.c | 9 ++++++--- ext/fts5/test/fts5eb.test | 3 +++ manifest | 18 +++++++++--------- manifest.uuid | 2 +- 5 files changed, 21 insertions(+), 13 deletions(-) diff --git a/ext/fts5/fts5_expr.c b/ext/fts5/fts5_expr.c index 0e07b9246c..f5101ba065 100644 --- a/ext/fts5/fts5_expr.c +++ b/ext/fts5/fts5_expr.c @@ -2583,6 +2583,8 @@ static char *fts5ExprPrintTcl( if( zRet==0 ) return 0; } + }else if( pExpr->eType==0 ){ + zRet = sqlite3_mprintf("{}"); }else{ char const *zOp = 0; int i; diff --git a/ext/fts5/fts5_index.c b/ext/fts5/fts5_index.c index 9d80e79e56..dd9be16e82 100644 --- a/ext/fts5/fts5_index.c +++ b/ext/fts5/fts5_index.c @@ -7815,7 +7815,7 @@ static void fts5DecodeFunction( fts5DecodeRowidList(&rc, &s, &a[4], iTermOff-4); iOff = iTermOff; - while( iOffszLeaf ){ + rc = FTS5_CORRUPT; + }else{ + fts5DecodeRowidList(&rc, &s, &a[iOff], iTermOff-iOff); + } iOff = iTermOff; if( iOff Date: Tue, 15 Aug 2023 18:08:14 +0000 Subject: [PATCH 11/32] Improve the portability of the src-verify.c tool on Windows. FossilOrigin-Name: 4068d94acd042a0a9887fba8ba38fa94c6f41a6d3c7a61d5514a57f613b3d278 --- manifest | 14 +++++++------- manifest.uuid | 2 +- tool/src-verify.c | 8 ++++++-- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index fde4e02d92..2ce90b9773 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sproblems\sin\sfts5\stest\scode. -D 2023-08-15T14:53:49.203 +C Improve\sthe\sportability\sof\sthe\ssrc-verify.c\stool\son\sWindows. +D 2023-08-15T18:08:14.939 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -2057,7 +2057,7 @@ F tool/sqldiff.c 2a693b4e7c1818c23f871f82f0c3fe67d80b67e3f087893089d33da29c1e387 F tool/sqlite3_analyzer.c.in f88615bf33098945e0a42f17733f472083d150b58bdaaa5555a7129d0a51621c F tool/sqltclsh.c.in 1bcc2e9da58fadf17b0bf6a50e68c1159e602ce057210b655d50bad5aaaef898 F tool/sqltclsh.tcl 862f4cf1418df5e1315b5db3b5ebe88969e2a784525af5fbf9596592f14ed848 -F tool/src-verify.c f0cef434a8d8629c4928a02a644fb85e33c8b875a7f2352ba68cc50965a7d213 +F tool/src-verify.c 41c586dee84d0b190ad13e0282ed83d4a65ec9fefde9adf4943efdf6558eea7f F tool/srcck1.c 371de5363b70154012955544f86fdee8f6e5326f F tool/stack_usage.tcl f8e71b92cdb099a147dad572375595eae55eca43 F tool/stripccomments.c 20b8aabc4694d0d4af5566e42da1f1a03aff057689370326e9269a9ddcffdc37 @@ -2091,8 +2091,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 4ae72c896761df5cd37c98ca3eeee7d4c6af3e4ccf74edd88ff902ef38f0765b -R 713f3f55f713e24450b787462590b16f -U dan -Z ea5031f21bcb29fb317be09e8f8e82e0 +P c16ed3b1cc7b4c21bfa96062bf9028ae071c89e63df3b444b59f1753594e4e94 +R d26903aebf24528fd54e9e78adb5fdcf +U drh +Z 80466188e3cddbc3741a3a3520958836 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 198539fd3f..38ed7e4a70 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c16ed3b1cc7b4c21bfa96062bf9028ae071c89e63df3b444b59f1753594e4e94 \ No newline at end of file +4068d94acd042a0a9887fba8ba38fa94c6f41a6d3c7a61d5514a57f613b3d278 \ No newline at end of file diff --git a/tool/src-verify.c b/tool/src-verify.c index b73a89272a..7629046564 100644 --- a/tool/src-verify.c +++ b/tool/src-verify.c @@ -47,8 +47,12 @@ # include #else # include -# define R_OK 04 -# define access(f,m) _access((f),(m)) +# ifndef R_OK +# define R_OK 04 +# endif +# ifndef access +# define access(f,m) _access((f),(m)) +# endif #endif typedef unsigned long long int u64; From f05630fb1c46ade3b4d4c1d9487bc66160f31280 Mon Sep 17 00:00:00 2001 From: dan Date: Tue, 15 Aug 2023 18:52:25 +0000 Subject: [PATCH 12/32] Update testrunner.tcl to make it easier to add things like mdevtest. FossilOrigin-Name: a531b71c4fd64fff6008876af825107ebc403f80dcb95273a05936ff6587b7aa --- manifest | 16 +- manifest.uuid | 2 +- test/testrunner.tcl | 23 ++- test/testrunner_data.tcl | 424 ++++++++++++++++++++++++++++++++++++++- 4 files changed, 444 insertions(+), 21 deletions(-) diff --git a/manifest b/manifest index 2ce90b9773..85235e48a2 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Improve\sthe\sportability\sof\sthe\ssrc-verify.c\stool\son\sWindows. -D 2023-08-15T18:08:14.939 +C Update\stestrunner.tcl\sto\smake\sit\seasier\sto\sadd\sthings\slike\smdevtest. +D 2023-08-15T18:52:25.251 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -1602,8 +1602,8 @@ F test/temptable2.test 76821347810ecc88203e6ef0dd6897b6036ac788e9dd3e6b04fd4d163 F test/temptable3.test d11a0974e52b347e45ee54ef1923c91ed91e4637 F test/temptrigger.test 38f0ca479b1822d3117069e014daabcaacefffcc F test/tester.tcl 68454ef88508c196d19e8694daa27bff7107a91857799eaa12f417188ae53ede -F test/testrunner.tcl 0cf11ad8611e483f47e73d4893df855790c98fa610bc932316d194ea9fc4bb8a -F test/testrunner_data.tcl 8169c68654ac8906833b8a6aadca973358a441ebf88270dd05c153e5f96f76b8 +F test/testrunner.tcl d18b0480901b0d8db4016128935a52aba8618fb36ae99a6736461921d4a52eac +F test/testrunner_data.tcl 0f167aa9e9a640f2f19e5d99bc99016c236526a6a8eb36432e445df1983a8548 F test/thread001.test a0985c117eab62c0c65526e9fa5d1360dd1cac5b03bde223902763274ce21899 F test/thread002.test c24c83408e35ba5a952a3638b7ac03ccdf1ce4409289c54a050ac4c5f1de7502 F test/thread003.test ee4c9efc3b86a6a2767516a37bd64251272560a7 @@ -2091,8 +2091,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 c16ed3b1cc7b4c21bfa96062bf9028ae071c89e63df3b444b59f1753594e4e94 -R d26903aebf24528fd54e9e78adb5fdcf -U drh -Z 80466188e3cddbc3741a3a3520958836 +P 4068d94acd042a0a9887fba8ba38fa94c6f41a6d3c7a61d5514a57f613b3d278 +R 23489635657665eb395fd2e8c81d6041 +U dan +Z fd0574782fe3c58a69b5058f39838490 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 38ed7e4a70..12e3f429c1 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -4068d94acd042a0a9887fba8ba38fa94c6f41a6d3c7a61d5514a57f613b3d278 \ No newline at end of file +a531b71c4fd64fff6008876af825107ebc403f80dcb95273a05936ff6587b7aa \ No newline at end of file diff --git a/test/testrunner.tcl b/test/testrunner.tcl index e927a4f051..822f032767 100644 --- a/test/testrunner.tcl +++ b/test/testrunner.tcl @@ -278,6 +278,22 @@ if {([llength $argv]==2 || [llength $argv]==1) } #-------------------------------------------------------------------------- +#-------------------------------------------------------------------------- +# Check if this is the "script" command: +# +if {[string compare -nocase script [lindex $argv 0]]==0} { + if {[llength $argv]!=2 && !([llength $argv]==3&&[lindex $argv 1]=="-msvc")} { + usage + } + + set bMsvc [expr ([llength $argv]==3)] + set config [lindex $argv [expr [llength $argv]-1]] + + puts [trd_buildscript $config [file dirname $testdir] $bMsvc] + exit +} + + #-------------------------------------------------------------------------- # Check if this is the "status" command: # @@ -768,12 +784,7 @@ proc launch_another_job {iJob} { if {$b=="Zipvfs"} { set script [zipvfs_testrunner_script] } else { - set cmd [info nameofexec] - lappend cmd [file join $testdir releasetest_data.tcl] - lappend cmd trscript - if {$TRG(platform)=="win"} { lappend cmd -msvc } - lappend cmd $b $srcdir - set script [exec {*}$cmd] + set script [trd_buildscript $b $srcdir [expr {$TRG(platform)=="win"}]] } set fd [open [file join $builddir $TRG(make)] w] diff --git a/test/testrunner_data.tcl b/test/testrunner_data.tcl index f74ee146ca..040deecacf 100644 --- a/test/testrunner_data.tcl +++ b/test/testrunner_data.tcl @@ -5,6 +5,7 @@ namespace eval trd { variable tcltest variable extra variable all_configs + variable build # Tcl tests to run for various builds. @@ -75,6 +76,241 @@ namespace eval trd { inmemory_journal pcache0 pcache10 pcache50 pcache90 pcache100 prepare mmap } + + #----------------------------------------------------------------------- + # Start of build() definitions. + # + set build(Default) { + -O2 + --disable-amalgamation --disable-shared + --enable-session + -DSQLITE_ENABLE_RBU + } + + # These two are used by [testrunner.tcl mdevtest]. + # + set build(All-Debug) { + --enable-debug --enable-all + } + set build(All-O0) { + -O0 --enable-all + } + + set build(Sanitize) { + CC=clang -fsanitize=address,undefined + -DSQLITE_ENABLE_STAT4 + -DCONFIG_SLOWDOWN_FACTOR=5.0 + --enable-debug + --enable-all + } + set build(Stdcall) { + -DUSE_STDCALL=1 + -O2 + } + + # The "Have-Not" configuration sets all possible -UHAVE_feature options + # in order to verify that the code works even on platforms that lack + # these support services. + set build(Have-Not) { + -DHAVE_FDATASYNC=0 + -DHAVE_GMTIME_R=0 + -DHAVE_ISNAN=0 + -DHAVE_LOCALTIME_R=0 + -DHAVE_LOCALTIME_S=0 + -DHAVE_MALLOC_USABLE_SIZE=0 + -DHAVE_STRCHRNUL=0 + -DHAVE_USLEEP=0 + -DHAVE_UTIME=0 + } + set build(Unlock-Notify) { + -O2 + -DSQLITE_ENABLE_UNLOCK_NOTIFY + -DSQLITE_THREADSAFE + -DSQLITE_TCL_DEFAULT_FULLMUTEX=1 + } + set build(User-Auth) { + -O2 + -DSQLITE_USER_AUTHENTICATION=1 + } + set build(Secure-Delete) { + -O2 + -DSQLITE_SECURE_DELETE=1 + -DSQLITE_SOUNDEX=1 + } + set build(Update-Delete-Limit) { + -O2 + -DSQLITE_DEFAULT_FILE_FORMAT=4 + -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT=1 + -DSQLITE_ENABLE_STMT_SCANSTATUS + -DSQLITE_LIKE_DOESNT_MATCH_BLOBS + -DSQLITE_ENABLE_CURSOR_HINTS + } + set build(Check-Symbols) { + -DSQLITE_MEMDEBUG=1 + -DSQLITE_ENABLE_FTS3_PARENTHESIS=1 + -DSQLITE_ENABLE_FTS3=1 + -DSQLITE_ENABLE_RTREE=1 + -DSQLITE_ENABLE_MEMSYS5=1 + -DSQLITE_ENABLE_MEMSYS3=1 + -DSQLITE_ENABLE_COLUMN_METADATA=1 + -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT=1 + -DSQLITE_SECURE_DELETE=1 + -DSQLITE_SOUNDEX=1 + -DSQLITE_ENABLE_ATOMIC_WRITE=1 + -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1 + -DSQLITE_ENABLE_OVERSIZE_CELL_CHECK=1 + -DSQLITE_ENABLE_STAT4 + -DSQLITE_ENABLE_STMT_SCANSTATUS + --enable-fts5 --enable-session + } + set build(Debug-One) { + --disable-shared + -O2 -funsigned-char + -DSQLITE_DEBUG=1 + -DSQLITE_MEMDEBUG=1 + -DSQLITE_MUTEX_NOOP=1 + -DSQLITE_TCL_DEFAULT_FULLMUTEX=1 + -DSQLITE_ENABLE_FTS3=1 + -DSQLITE_ENABLE_RTREE=1 + -DSQLITE_ENABLE_MEMSYS5=1 + -DSQLITE_ENABLE_COLUMN_METADATA=1 + -DSQLITE_ENABLE_STAT4 + -DSQLITE_ENABLE_HIDDEN_COLUMNS + -DSQLITE_MAX_ATTACHED=125 + -DSQLITE_MUTATION_TEST + --enable-fts5 + } + set build(Debug-Two) { + -DSQLITE_DEFAULT_MEMSTATUS=0 + -DSQLITE_MAX_EXPR_DEPTH=0 + --enable-debug + } + set build(Fast-One) { + -O6 + -DSQLITE_ENABLE_FTS4=1 + -DSQLITE_ENABLE_RTREE=1 + -DSQLITE_ENABLE_STAT4 + -DSQLITE_ENABLE_RBU + -DSQLITE_MAX_ATTACHED=125 + -DSQLITE_MAX_MMAP_SIZE=12884901888 + -DSQLITE_ENABLE_SORTER_MMAP=1 + -DLONGDOUBLE_TYPE=double + --enable-session + } + set build(Device-One) { + -O2 + -DSQLITE_DEBUG=1 + -DSQLITE_DEFAULT_AUTOVACUUM=1 + -DSQLITE_DEFAULT_CACHE_SIZE=64 + -DSQLITE_DEFAULT_PAGE_SIZE=1024 + -DSQLITE_DEFAULT_TEMP_CACHE_SIZE=32 + -DSQLITE_DISABLE_LFS=1 + -DSQLITE_ENABLE_ATOMIC_WRITE=1 + -DSQLITE_ENABLE_IOTRACE=1 + -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1 + -DSQLITE_MAX_PAGE_SIZE=4096 + -DSQLITE_OMIT_LOAD_EXTENSION=1 + -DSQLITE_OMIT_PROGRESS_CALLBACK=1 + -DSQLITE_OMIT_VIRTUALTABLE=1 + -DSQLITE_ENABLE_HIDDEN_COLUMNS + -DSQLITE_TEMP_STORE=3 + } + set build(Device-Two) { + -DSQLITE_4_BYTE_ALIGNED_MALLOC=1 + -DSQLITE_DEFAULT_AUTOVACUUM=1 + -DSQLITE_DEFAULT_CACHE_SIZE=1000 + -DSQLITE_DEFAULT_LOCKING_MODE=0 + -DSQLITE_DEFAULT_PAGE_SIZE=1024 + -DSQLITE_DEFAULT_TEMP_CACHE_SIZE=1000 + -DSQLITE_DISABLE_LFS=1 + -DSQLITE_ENABLE_FTS3=1 + -DSQLITE_ENABLE_MEMORY_MANAGEMENT=1 + -DSQLITE_ENABLE_RTREE=1 + -DSQLITE_MAX_COMPOUND_SELECT=50 + -DSQLITE_MAX_PAGE_SIZE=32768 + -DSQLITE_OMIT_TRACE=1 + -DSQLITE_TEMP_STORE=3 + -DSQLITE_THREADSAFE=2 + --enable-fts5 --enable-session + } + set build(Locking-Style) { + -O2 + -DSQLITE_ENABLE_LOCKING_STYLE=1 + } + set build(Apple) { + -Os + -DHAVE_GMTIME_R=1 + -DHAVE_ISNAN=1 + -DHAVE_LOCALTIME_R=1 + -DHAVE_PREAD=1 + -DHAVE_PWRITE=1 + -DHAVE_UTIME=1 + -DSQLITE_DEFAULT_CACHE_SIZE=1000 + -DSQLITE_DEFAULT_CKPTFULLFSYNC=1 + -DSQLITE_DEFAULT_MEMSTATUS=1 + -DSQLITE_DEFAULT_PAGE_SIZE=1024 + -DSQLITE_DISABLE_PAGECACHE_OVERFLOW_STATS=1 + -DSQLITE_ENABLE_API_ARMOR=1 + -DSQLITE_ENABLE_AUTO_PROFILE=1 + -DSQLITE_ENABLE_FLOCKTIMEOUT=1 + -DSQLITE_ENABLE_FTS3=1 + -DSQLITE_ENABLE_FTS3_PARENTHESIS=1 + -DSQLITE_ENABLE_FTS3_TOKENIZER=1 + -DSQLITE_ENABLE_PERSIST_WAL=1 + -DSQLITE_ENABLE_PURGEABLE_PCACHE=1 + -DSQLITE_ENABLE_RTREE=1 + -DSQLITE_ENABLE_SNAPSHOT=1 + -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT=1 + -DSQLITE_MAX_LENGTH=2147483645 + -DSQLITE_MAX_VARIABLE_NUMBER=500000 + -DSQLITE_NO_SYNC=1 + -DSQLITE_OMIT_AUTORESET=1 + -DSQLITE_OMIT_LOAD_EXTENSION=1 + -DSQLITE_PREFER_PROXY_LOCKING=1 + -DSQLITE_SERIES_CONSTRAINT_VERIFY=1 + -DSQLITE_THREADSAFE=2 + -DSQLITE_USE_URI=1 + -DSQLITE_WRITE_WALFRAME_PREBUFFERED=1 + -DUSE_GUARDED_FD=1 + -DUSE_PREAD=1 + --enable-fts5 + } + set build(Extra-Robustness) { + -DSQLITE_ENABLE_OVERSIZE_CELL_CHECK=1 + -DSQLITE_MAX_ATTACHED=62 + } + set build(Devkit) { + -DSQLITE_DEFAULT_FILE_FORMAT=4 + -DSQLITE_MAX_ATTACHED=30 + -DSQLITE_ENABLE_COLUMN_METADATA + -DSQLITE_ENABLE_FTS4 + -DSQLITE_ENABLE_FTS5 + -DSQLITE_ENABLE_FTS4_PARENTHESIS + -DSQLITE_DISABLE_FTS4_DEFERRED + -DSQLITE_ENABLE_RTREE + --enable-fts5 + } + set build(No-lookaside) { + -DSQLITE_TEST_REALLOC_STRESS=1 + -DSQLITE_OMIT_LOOKASIDE=1 + } + set build(Valgrind) { + -DSQLITE_ENABLE_STAT4 + -DSQLITE_ENABLE_FTS4 + -DSQLITE_ENABLE_RTREE + -DSQLITE_ENABLE_HIDDEN_COLUMNS + -DLONGDOUBLE_TYPE=double + -DCONFIG_SLOWDOWN_FACTOR=8.0 + } + + set build(Windows-Memdebug) { + MEMDEBUG=1 + DEBUG=3 + } + set build(Windows-Win32Heap) { + WIN32HEAP=1 + DEBUG=4 + } } @@ -84,6 +320,7 @@ proc trd_import {} { variable ::trd::tcltest variable ::trd::extra variable ::trd::all_configs + variable ::trd::build } } @@ -106,13 +343,13 @@ proc trd_builds {platform} { set ret } -proc trd_configs {platform build} { +proc trd_configs {platform bld} { trd_import set clist [list] - if {[info exists tcltest($platform.$build)]} { - set clist $tcltest($platform.$build) + if {[info exists tcltest($platform.$bld)]} { + set clist $tcltest($platform.$bld) if {$clist=="all"} { set clist $all_configs } elseif {$clist=="all_plus_autovacuum_crash"} { @@ -123,12 +360,12 @@ proc trd_configs {platform build} { set clist } -proc trd_extras {platform build} { +proc trd_extras {platform bld} { trd_import set elist [list] - if {[info exists extra($platform.$build)]} { - set elist $extra($platform.$build) + if {[info exists extra($platform.$bld)]} { + set elist $extra($platform.$bld) } set elist @@ -139,5 +376,180 @@ proc trd_all_configs {} { set all_configs } +proc trimscript {text} { + set text [string map {"\n " "\n"} [string trim $text]] +} + +proc make_sh_script {srcdir opts cflags makeOpts configOpts} { + + set tcldir [::tcl::pkgconfig get libdir,install] + set myopts "" + if {[info exists ::env(OPTS)]} { + append myopts "# From environment variable:\n" + append myopts "OPTS=$::env(OPTS)\n" + } + foreach o [lsort $opts] { + append myopts "OPTS=\"\$OPTS $o\"\n" + } + + return [trimscript [subst -nocommands { + set -e + if [ "\$#" -ne 1 ] ; then + echo "Usage: \$0 " + exit -1 + fi + + SRCDIR="$srcdir" + TCLDIR="$tcldir" + + if [ ! -f Makefile ] ; then + \$SRCDIR/configure --with-tcl=\$TCL $configOpts + fi + + $myopts + CFLAGS="$cflags" + + make \$1 "CFLAGS=\$CFLAGS" "OPTS=\$OPTS" $makeOpts + }]] +} + +# Generate the text of a *.bat script. +# +proc make_bat_file {srcdir opts cflags makeOpts} { + set srcdir [file nativename [file normalize $srcdir]] + + return [trimscript [subst -nocommands { + set TARGET=%1 + set TMP=%CD% + nmake /f $srcdir\\Makefile.msc TOP="$srcdir" %TARGET% "CFLAGS=$cflags" "OPTS=$opts" $makeOpts + }]] +} + + +# Generate the text of a shell script. +# +proc make_script {cfg srcdir bMsvc} { + set opts [list] ;# OPTS value + set cflags [expr {$bMsvc ? "-Zi" : "-g"}] ;# CFLAGS value + set makeOpts [list] ;# Extra args for [make] + set configOpts [list] ;# Extra args for [configure] + + # Define either SQLITE_OS_WIN or SQLITE_OS_UNIX, as appropriate. + if {$::tcl_platform(platform)=="windows"} { + lappend opts -DSQLITE_OS_WIN=1 + } else { + lappend opts -DSQLITE_OS_UNIX=1 + } + + # Unless the configuration specifies -DHAVE_USLEEP=0, set -DHAVE_USLEEP=1. + # + if {[lsearch $cfg "-DHAVE_USLEEP=0"]<0} { + lappend cfg -DHAVE_USLEEP=1 + } + + # Loop through the parameters of the nominated configuration, updating + # $opts, $cflags, $makeOpts and $configOpts along the way. Rules are as + # follows: + # + # 1. If the parameter begins with "-D", add it to $opts. + # + # 2. If the parameter begins with "--" add it to $configOpts. Unless + # this command is preparing a script for MSVC - then add an + # equivalent to $makeOpts or $opts. + # + # 3. If the parameter begins with "-" add it to $cflags. If in MSVC + # mode and the parameter is an -O option, instead add + # an OPTIMIZATIONS= switch to $makeOpts. + # + # 4. If none of the above apply, add the parameter to $makeOpts + # + foreach param $cfg { + + if {[string range $param 0 1]=="-D"} { + lappend opts $param + continue + } + + if {[string range $param 0 1]=="--"} { + if {$bMsvc==0} { + lappend configOpts $param + } else { + + switch -- $param { + --disable-amalgamation { + lappend makeOpts USE_AMALGAMATION=0 + } + --disable-shared { + lappend makeOpts USE_CRT_DLL=0 DYNAMIC_SHELL=0 + } + --enable-fts5 { + lappend opts -DSQLITE_ENABLE_FTS5 + } + --enable-shared { + lappend makeOpts USE_CRT_DLL=1 DYNAMIC_SHELL=1 + } + --enable-session { + lappend opts -DSQLITE_ENABLE_PREUPDATE_HOOK + lappend opts -DSQLITE_ENABLE_SESSION + } + --enable-all { + } + --enable-debug { + # lappend makeOpts OPTIMIZATIONS=0 + lappend opts -DSQLITE_DEBUG + } + default { + error "Cannot translate $param for MSVC" + } + + } + } + + continue + } + + if {[string range $param 0 0]=="-"} { + if {$bMsvc && [regexp -- {^-O(\d+)$} $param -> level]} { + lappend makeOpts OPTIMIZATIONS=$level + } else { + lappend cflags $param + } + continue + } + + lappend makeOpts $param + } + + if {$bMsvc==0} { + set zRet [make_sh_script $srcdir $opts $cflags $makeOpts $configOpts] + } else { + set zRet [make_bat_file $srcdir $opts $cflags $makeOpts] + } +} + +# Usage: +# +# trd_buildscript CONFIG SRCDIR MSVC +# +# This command returns the full text of a script (either a shell script or +# an ms-dos bat file) that may be used to build SQLite source code according +# to a nominated configuration. +# +# Parameter CONFIG must be a configuration defined above in the ::trd::build +# array. SRCDIR is the root directory of an SQLite source tree (the parent +# directory of that containing this script). MSVC is a boolean - true to +# use the MSVC compiler, false otherwise. +# +proc trd_buildscript {config srcdir bMsvc} { + trd_import + + # Ensure that the named configuration exists. + if {![info exists build($config)]} { + error "No such build config: $config" + } + + # Generate and return the script. + return [make_script $build($config) $srcdir $bMsvc] +} From c131675401669c01b8e96d4bebe859d123592528 Mon Sep 17 00:00:00 2001 From: stephan Date: Tue, 15 Aug 2023 20:57:42 +0000 Subject: [PATCH 13/32] Cherrypick [653ed92dc391] (went to wrong branch). Doc change only, no code changes. FossilOrigin-Name: 79a14457f0067814e7c33de709e2f9e19ab880d3eebbcb6f9fcce52a4720ecac --- ext/jni/README.md | 5 +++-- manifest | 15 ++++++++------- manifest.uuid | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/ext/jni/README.md b/ext/jni/README.md index 80486d4a07..cb51a21cd3 100644 --- a/ext/jni/README.md +++ b/ext/jni/README.md @@ -44,8 +44,9 @@ Non-goals: Significant TODOs ======================================================================== -- Lots of APIs left to bind. Most "day-to-day" functionality is already - in place and is believed to work well. +- The initial beta release with version 3.43 has severe threading + limitations. Namely, two threads cannot call into the JNI-bound API + at once. This limitation will be remove in a subsequent release. Building diff --git a/manifest b/manifest index 85235e48a2..01586e3ea2 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Update\stestrunner.tcl\sto\smake\sit\seasier\sto\sadd\sthings\slike\smdevtest. -D 2023-08-15T18:52:25.251 +C Cherrypick\s[653ed92dc391]\s(went\sto\swrong\sbranch).\sDoc\schange\sonly,\sno\scode\schanges. +D 2023-08-15T20:57:42.480 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -232,7 +232,7 @@ F ext/icu/README.txt 7ab7ced8ae78e3a645b57e78570ff589d4c672b71370f5aa9e1cd7024f4 F ext/icu/icu.c c074519b46baa484bb5396c7e01e051034da8884bad1a1cb7f09bbe6be3f0282 F ext/icu/sqliteicu.h fa373836ed5a1ee7478bdf8a1650689294e41d0c89c1daab26e9ae78a32075a8 F ext/jni/GNUmakefile 3deba6bc0bf37c1ee5f15d1ff3c3512ae2f3cf44a2b8ae7b4af92690514b0cb4 -F ext/jni/README.md 7a614a2fa6c561205f7a53fd8626cf93a7b5711ff454fc1814517f796df398eb +F ext/jni/README.md 5c60e4580aa5c94ff74d7bef1fb6231e578f7764e831a07b5981b6ab62b35560 F ext/jni/jar-dist.make 93da95f8fe01ef22fccacc27f2e805938058e91e8c72c0532558d3a812a42e74 F ext/jni/src/c/sqlite3-jni.c bea6b8691a5fa3a8626a771757bb261208d3c5fc6598266d3b0ee23d88e35632 F ext/jni/src/c/sqlite3-jni.h c5f941b057a24ee62942e6e1bf5a7fd527e5004d20d9638e84a9382813c3cf2a @@ -2091,8 +2091,9 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 4068d94acd042a0a9887fba8ba38fa94c6f41a6d3c7a61d5514a57f613b3d278 -R 23489635657665eb395fd2e8c81d6041 -U dan -Z fd0574782fe3c58a69b5058f39838490 +P a531b71c4fd64fff6008876af825107ebc403f80dcb95273a05936ff6587b7aa +Q +653ed92dc39185cdedfab3ea518bc7ec2d2826120e5fa4cbdee3343301396184 +R 3f45750813fa6f5b999de781b7cd6f3a +U stephan +Z fa9f1268494622eeb67bdcd7e0dd3601 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 12e3f429c1..c75804ee9e 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a531b71c4fd64fff6008876af825107ebc403f80dcb95273a05936ff6587b7aa \ No newline at end of file +79a14457f0067814e7c33de709e2f9e19ab880d3eebbcb6f9fcce52a4720ecac \ No newline at end of file From ff9ff548018bbe276dbd7bf5418af8bdfd659a24 Mon Sep 17 00:00:00 2001 From: stephan Date: Tue, 15 Aug 2023 21:44:22 +0000 Subject: [PATCH 14/32] Cherrypick [00ac653562a6] to remove stray JNI debug output. No functional changes. FossilOrigin-Name: e12d70f38c0ed5c0abf9a1e30ce4db59a4426e1e8cb1f8f07834fc1bedfcc65a --- ext/jni/src/c/sqlite3-jni.h | 2 +- ext/jni/src/org/sqlite/jni/Tester1.java | 1 - manifest | 16 ++++++++-------- manifest.uuid | 2 +- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/ext/jni/src/c/sqlite3-jni.h b/ext/jni/src/c/sqlite3-jni.h index bf2d5527b0..bcb55c4f1c 100644 --- a/ext/jni/src/c/sqlite3-jni.h +++ b/ext/jni/src/c/sqlite3-jni.h @@ -1120,7 +1120,7 @@ JNIEXPORT jstring JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1db_1filename * Method: sqlite3_db_config * Signature: (Lorg/sqlite/jni/sqlite3;IILorg/sqlite/jni/OutputPointer/Int32;)I */ -JNIEXPORT jint JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1db_1config__Lorg_sqlite_jni_sqlite3_2IILorg_sqlite_jni_OutputPointer_00024Int32_2 +JNIEXPORT jint JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1db_1config__Lorg_sqlite_jni_sqlite3_2IILorg_sqlite_jni_OutputPointer_Int32_2 (JNIEnv *, jclass, jobject, jint, jint, jobject); /* diff --git a/ext/jni/src/org/sqlite/jni/Tester1.java b/ext/jni/src/org/sqlite/jni/Tester1.java index ffe0b83846..dca49faf66 100644 --- a/ext/jni/src/org/sqlite/jni/Tester1.java +++ b/ext/jni/src/org/sqlite/jni/Tester1.java @@ -512,7 +512,6 @@ public class Tester1 { rc = sqlite3_db_status(db, SQLITE_DBSTATUS_SCHEMA_USED, cur32, high32, false); affirm( 0 == rc ); affirm( cur32.value > 0 ); - outln(cur32.value," ",high32.value); affirm( high32.value == 0 /* always 0 for SCHEMA_USED */ ); sqlite3_close_v2(db); diff --git a/manifest b/manifest index 01586e3ea2..2b56ecf13a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Cherrypick\s[653ed92dc391]\s(went\sto\swrong\sbranch).\sDoc\schange\sonly,\sno\scode\schanges. -D 2023-08-15T20:57:42.480 +C Cherrypick\s[00ac653562a6]\sto\sremove\sstray\sJNI\sdebug\soutput.\sNo\sfunctional\schanges. +D 2023-08-15T21:44:22.230 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -235,7 +235,7 @@ F ext/jni/GNUmakefile 3deba6bc0bf37c1ee5f15d1ff3c3512ae2f3cf44a2b8ae7b4af9269051 F ext/jni/README.md 5c60e4580aa5c94ff74d7bef1fb6231e578f7764e831a07b5981b6ab62b35560 F ext/jni/jar-dist.make 93da95f8fe01ef22fccacc27f2e805938058e91e8c72c0532558d3a812a42e74 F ext/jni/src/c/sqlite3-jni.c bea6b8691a5fa3a8626a771757bb261208d3c5fc6598266d3b0ee23d88e35632 -F ext/jni/src/c/sqlite3-jni.h c5f941b057a24ee62942e6e1bf5a7fd527e5004d20d9638e84a9382813c3cf2a +F ext/jni/src/c/sqlite3-jni.h 28565de9efc971195c684095ba0d184b90401290698c987f7ea3f54e47ff4f2f F ext/jni/src/org/sqlite/jni/Authorizer.java 1308988f7f40579ea0e4deeaec3c6be971630566bd021c31367fe3f5140db892 F ext/jni/src/org/sqlite/jni/AutoExtension.java 18e83f6f463e306df60b2dceb65247d32af1f78af4bbbae9155411a8c6cdb093 F ext/jni/src/org/sqlite/jni/BusyHandler.java 1b1d3e5c86cd796a0580c81b6af6550ad943baa25e47ada0dcca3aff3ebe978c @@ -255,7 +255,7 @@ F ext/jni/src/org/sqlite/jni/ResultCode.java ba701f20213a5f259e94cfbfdd36eb7ac7c F ext/jni/src/org/sqlite/jni/RollbackHook.java b04c8abcc6ade44a8a57129e33765793f69df0ba909e49ba18d73f4268d92564 F ext/jni/src/org/sqlite/jni/SQLFunction.java 09ce81c1c637e31c3a830d4c859cce95d65f5e02ff45f8bd1985b3479381bc46 F ext/jni/src/org/sqlite/jni/SQLite3Jni.java 4b6fd22e04e63eb65d8e4e38fda39ecf15ce244d034607517627ce2e766e7e65 -F ext/jni/src/org/sqlite/jni/Tester1.java 07c14a90427529ceba54b5e8344ca03602f5789dc53c4163ce22f92d8c577a11 +F ext/jni/src/org/sqlite/jni/Tester1.java 4253dc7bcff64500a9388f1a17d3d39dbe4eb9d7db9fc035ce6e2380d45ad5fc F ext/jni/src/org/sqlite/jni/TesterFts5.java 59e22dd24af033ea8827d36225a2f3297908fb6af8818ead8850c6c6847557b1 F ext/jni/src/org/sqlite/jni/Tracer.java a5cece9f947b0af27669b8baec300b6dd7ff859c3e6a6e4a1bd8b50f9714775d F ext/jni/src/org/sqlite/jni/UpdateHook.java e58645a1727f8a9bbe72dc072ec5b40d9f9362cb0aa24acfe93f49ff56a9016d @@ -2091,9 +2091,9 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P a531b71c4fd64fff6008876af825107ebc403f80dcb95273a05936ff6587b7aa -Q +653ed92dc39185cdedfab3ea518bc7ec2d2826120e5fa4cbdee3343301396184 -R 3f45750813fa6f5b999de781b7cd6f3a +P 79a14457f0067814e7c33de709e2f9e19ab880d3eebbcb6f9fcce52a4720ecac +Q +00ac653562a66aad3112ea322d08be68e05e6bf7413c814dd3f81bf850fcf43b +R 3e4a6f489cbcdf58ed939bf866eeb9e5 U stephan -Z fa9f1268494622eeb67bdcd7e0dd3601 +Z 04ce3bad95ccde5b13a4d0f2b4327f37 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index c75804ee9e..56df8475df 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -79a14457f0067814e7c33de709e2f9e19ab880d3eebbcb6f9fcce52a4720ecac \ No newline at end of file +e12d70f38c0ed5c0abf9a1e30ce4db59a4426e1e8cb1f8f07834fc1bedfcc65a \ No newline at end of file From fe1835526768be512f616c3f8b039e879ab33691 Mon Sep 17 00:00:00 2001 From: dan Date: Wed, 16 Aug 2023 13:55:38 +0000 Subject: [PATCH 15/32] Fix test script problem preventing veryquick.test from running. FossilOrigin-Name: e73886574042108eb31641d0820c273c10b83fbf08ac6cb52d3e4c27830e2c23 --- manifest | 15 +++++++-------- manifest.uuid | 2 +- test/permutations.test | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index 2b56ecf13a..156b4edd50 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Cherrypick\s[00ac653562a6]\sto\sremove\sstray\sJNI\sdebug\soutput.\sNo\sfunctional\schanges. -D 2023-08-15T21:44:22.230 +C Fix\stest\sscript\sproblem\spreventing\sveryquick.test\sfrom\srunning. +D 2023-08-16T13:55:38.215 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -1410,7 +1410,7 @@ F test/pcache.test c8acbedd3b6fd0f9a7ca887a83b11d24a007972b F test/pcache2.test af7f3deb1a819f77a6d0d81534e97d1cf62cd442 F test/pendingrace.test cbdf0f74bc939fb43cebad64dda7a0b5a3941a10b7e9cc2b596ff3e423a18156 F test/percentile.test 4243af26b8f3f4555abe166f723715a1f74c77ff -F test/permutations.test 4268ad170a788ec1c0e3179786ffdaac6d8a022d4f849587a3378945a48fdde1 +F test/permutations.test f7caf8dd5c7b1da74842a48df116f7f193399c656d4ffc805cd0d9658568c675 F test/pg_common.tcl 3b27542224db1e713ae387459b5d117c836a5f6e328846922993b6d2b7640d9f F test/pragma.test 57a36226218c03cfb381019fe43234b2cefbd8a1f12825514f906a17ccf7991e F test/pragma2.test e5d5c176360c321344249354c0c16aec46214c9f @@ -2091,9 +2091,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 79a14457f0067814e7c33de709e2f9e19ab880d3eebbcb6f9fcce52a4720ecac -Q +00ac653562a66aad3112ea322d08be68e05e6bf7413c814dd3f81bf850fcf43b -R 3e4a6f489cbcdf58ed939bf866eeb9e5 -U stephan -Z 04ce3bad95ccde5b13a4d0f2b4327f37 +P e12d70f38c0ed5c0abf9a1e30ce4db59a4426e1e8cb1f8f07834fc1bedfcc65a +R aad1c865033f092e6c13ef7485e12ba1 +U dan +Z 3ef211021d49ef1d76dc9c52896d0217 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 56df8475df..e8c90ba565 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e12d70f38c0ed5c0abf9a1e30ce4db59a4426e1e8cb1f8f07834fc1bedfcc65a \ No newline at end of file +e73886574042108eb31641d0820c273c10b83fbf08ac6cb52d3e4c27830e2c23 \ No newline at end of file diff --git a/test/permutations.test b/test/permutations.test index 9bd8c94452..25aa7de018 100644 --- a/test/permutations.test +++ b/test/permutations.test @@ -10,7 +10,7 @@ #*********************************************************************** # -if {[info vars ::testdir]==""} { +if {[info vars ::trd::tcltest]==""} { set testdir [file dirname $argv0] source $testdir/tester.tcl db close From af8980bdce3e84f5b0584b2da9b235538c8af588 Mon Sep 17 00:00:00 2001 From: dan Date: Wed, 16 Aug 2023 14:18:53 +0000 Subject: [PATCH 16/32] Update testrunner.tcl to use environment variable %NUMBER_OF_PROCESSES% when running under tclsh on windows. Also modify the internal database schema used by testrunner.tcl to be compatible with old versions of SQLite. FossilOrigin-Name: 6542ed3b9e028c44aca504eadca843ee9b2ba08f5f650523238dd1253f7e221b --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/testrunner.tcl | 43 ++++++++++++++++++++++++++++--------------- 3 files changed, 35 insertions(+), 22 deletions(-) diff --git a/manifest b/manifest index 156b4edd50..3aa481e0f3 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\stest\sscript\sproblem\spreventing\sveryquick.test\sfrom\srunning. -D 2023-08-16T13:55:38.215 +C Update\stestrunner.tcl\sto\suse\senvironment\svariable\s%NUMBER_OF_PROCESSES%\swhen\srunning\sunder\stclsh\son\swindows.\sAlso\smodify\sthe\sinternal\sdatabase\sschema\sused\sby\stestrunner.tcl\sto\sbe\scompatible\swith\sold\sversions\sof\sSQLite. +D 2023-08-16T14:18:53.625 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -1602,7 +1602,7 @@ F test/temptable2.test 76821347810ecc88203e6ef0dd6897b6036ac788e9dd3e6b04fd4d163 F test/temptable3.test d11a0974e52b347e45ee54ef1923c91ed91e4637 F test/temptrigger.test 38f0ca479b1822d3117069e014daabcaacefffcc F test/tester.tcl 68454ef88508c196d19e8694daa27bff7107a91857799eaa12f417188ae53ede -F test/testrunner.tcl d18b0480901b0d8db4016128935a52aba8618fb36ae99a6736461921d4a52eac +F test/testrunner.tcl 56a744d4e6e516b2091c2ca6b7b27b9600e9ded136a2c860c350515511ebe20a F test/testrunner_data.tcl 0f167aa9e9a640f2f19e5d99bc99016c236526a6a8eb36432e445df1983a8548 F test/thread001.test a0985c117eab62c0c65526e9fa5d1360dd1cac5b03bde223902763274ce21899 F test/thread002.test c24c83408e35ba5a952a3638b7ac03ccdf1ce4409289c54a050ac4c5f1de7502 @@ -2091,8 +2091,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 e12d70f38c0ed5c0abf9a1e30ce4db59a4426e1e8cb1f8f07834fc1bedfcc65a -R aad1c865033f092e6c13ef7485e12ba1 +P e73886574042108eb31641d0820c273c10b83fbf08ac6cb52d3e4c27830e2c23 +R 02f8906445af4d496aeb7df86dbf9411 U dan -Z 3ef211021d49ef1d76dc9c52896d0217 +Z 5346440cb243f66c6add836cfbeafff3 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index e8c90ba565..4bc8402667 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e73886574042108eb31641d0820c273c10b83fbf08ac6cb52d3e4c27830e2c23 \ No newline at end of file +6542ed3b9e028c44aca504eadca843ee9b2ba08f5f650523238dd1253f7e221b \ No newline at end of file diff --git a/test/testrunner.tcl b/test/testrunner.tcl index 822f032767..3b94182a9e 100644 --- a/test/testrunner.tcl +++ b/test/testrunner.tcl @@ -110,16 +110,20 @@ proc guess_number_of_cores {} { if {[catch {number_of_cores} ret]} { set ret 4 - if {$::tcl_platform(os)=="Darwin"} { - set cmd "sysctl -n hw.logicalcpu" + if {$::tcl_platform(platform)=="windows"} { + catch { set ret $::env(NUMBER_OF_PROCESSORS) } } else { - set cmd "nproc" - } - catch { - set fd [open "|$cmd" r] - set ret [gets $fd] - close $fd - set ret [expr $ret] + if {$::tcl_platform(os)=="Darwin"} { + set cmd "sysctl -n hw.logicalcpu" + } else { + set cmd "nproc" + } + catch { + set fd [open "|$cmd" r] + set ret [gets $fd] + close $fd + set ret [expr $ret] + } } } return $ret @@ -188,10 +192,8 @@ set TRG(schema) { state TEXT CHECK( state IN ('', 'ready', 'running', 'done', 'failed') ), time INTEGER, -- Time in ms output TEXT, -- full output of test script - priority AS (((config='make')*3) + (config='build') + (slow*2)), - jobtype AS ( - CASE WHEN config IN ('build', 'make') THEN config ELSE 'script' END - ), + priority INTEGER, + jobtype TEXT CHECK( jobtype IN ('script', 'build', 'make') ), PRIMARY KEY(build, config, filename) ); @@ -697,9 +699,20 @@ proc make_new_testset {} { set state "" } + set priority [expr {$slow*2}] + if {$c=="make"} { incr priority 3 } + if {$c=="build"} { incr priority 1 } + + if {$c=="make" || $c=="build"} { + set jobtype $c + } else { + set jobtype "script" + } + trdb eval { - INSERT INTO script(build, config, filename, slow, state) - VALUES ($b, $c, $s, $slow, $state) + INSERT INTO script + (build, config, filename, slow, state, priority, jobtype) + VALUES ($b, $c, $s, $slow, $state, $priority, $jobtype) } } } From 7309b50fbccc437e41f4fca205522f491c152024 Mon Sep 17 00:00:00 2001 From: drh <> Date: Wed, 16 Aug 2023 15:10:07 +0000 Subject: [PATCH 17/32] Mix the current process ID into the randomness used for generating temporary filenames on Windows. FossilOrigin-Name: 775a36ee093df4b5f7529a43eeaee9d5a9a943ad5ed8ae03bc74e459e87ba438 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/os_win.c | 4 ++++ 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 3aa481e0f3..8cdb1c94c0 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Update\stestrunner.tcl\sto\suse\senvironment\svariable\s%NUMBER_OF_PROCESSES%\swhen\srunning\sunder\stclsh\son\swindows.\sAlso\smodify\sthe\sinternal\sdatabase\sschema\sused\sby\stestrunner.tcl\sto\sbe\scompatible\swith\sold\sversions\sof\sSQLite. -D 2023-08-16T14:18:53.625 +C Mix\sthe\scurrent\sprocess\sID\sinto\sthe\srandomness\sused\sfor\sgenerating\ntemporary\sfilenames\son\sWindows. +D 2023-08-16T15:10:07.618 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -668,7 +668,7 @@ F src/os_common.h 6c0eb8dd40ef3e12fe585a13e709710267a258e2c8dd1c40b1948a1d14582e F src/os_kv.c 4d39e1f1c180b11162c6dc4aa8ad34053873a639bac6baae23272fc03349986a F src/os_setup.h 6011ad7af5db4e05155f385eb3a9b4470688de6f65d6166b8956e58a3d872107 F src/os_unix.c 2e8b12107f75d1bd16412f312b4c5d5103191807a37836d3b81beb26436ad81b -F src/os_win.c 7038223a1cda0a47e2ab4db47f63bf1833fe53ba0542f0f283a062ea13894103 +F src/os_win.c 4a50a154aeebc66a1f8fb79c1ff6dd5fe3d005556533361e0d460d41cb6a45a8 F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a F src/pager.c 993445a19b611d473ca007542ab3149840661a4c7e9f2d9e1ec008b7cc2abe78 F src/pager.h 6e326bd05970a24dd28d41d3980b6964fbaa37b4da54a2c0d4e0c5bdb06ff187 @@ -2091,8 +2091,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 e73886574042108eb31641d0820c273c10b83fbf08ac6cb52d3e4c27830e2c23 -R 02f8906445af4d496aeb7df86dbf9411 -U dan -Z 5346440cb243f66c6add836cfbeafff3 +P 6542ed3b9e028c44aca504eadca843ee9b2ba08f5f650523238dd1253f7e221b +R ece0937be0d2051513e3d32d8c3b91f1 +U drh +Z 06c172de925aa6209d8f7ab3fd13d9d5 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 4bc8402667..e25aaca2da 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -6542ed3b9e028c44aca504eadca843ee9b2ba08f5f650523238dd1253f7e221b \ No newline at end of file +775a36ee093df4b5f7529a43eeaee9d5a9a943ad5ed8ae03bc74e459e87ba438 \ No newline at end of file diff --git a/src/os_win.c b/src/os_win.c index 73a2f946d8..dc16c08b51 100644 --- a/src/os_win.c +++ b/src/os_win.c @@ -4747,6 +4747,7 @@ static int winGetTempname(sqlite3_vfs *pVfs, char **pzBuf){ "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "0123456789"; size_t i, j; + DWORD pid; int nPre = sqlite3Strlen30(SQLITE_TEMP_FILE_PREFIX); int nMax, nBuf, nDir, nLen; char *zBuf; @@ -4959,7 +4960,10 @@ static int winGetTempname(sqlite3_vfs *pVfs, char **pzBuf){ j = sqlite3Strlen30(zBuf); sqlite3_randomness(15, &zBuf[j]); + pid = osGetCurrentProcessId(); for(i=0; i<15; i++, j++){ + zBuf[j] += pid & 0xff; + pid >>= 8; zBuf[j] = (char)zChars[ ((unsigned char)zBuf[j])%(sizeof(zChars)-1) ]; } zBuf[j] = 0; From 0d83c71b342bf6a68e5504b0cc0300b067c2aabb Mon Sep 17 00:00:00 2001 From: drh <> Date: Wed, 16 Aug 2023 15:27:49 +0000 Subject: [PATCH 18/32] Make sqlite3_stmt_explain() accessible to loadable extensions. FossilOrigin-Name: a237a31ff4a7cd3dc744af1e1ebb9466e42eebafa31c1b5c0027cbaee9babc9b --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/loadext.c | 4 +++- src/sqlite3ext.h | 4 ++++ 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index 8cdb1c94c0..a7bfcea548 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Mix\sthe\scurrent\sprocess\sID\sinto\sthe\srandomness\sused\sfor\sgenerating\ntemporary\sfilenames\son\sWindows. -D 2023-08-16T15:10:07.618 +C Make\ssqlite3_stmt_explain()\saccessible\sto\sloadable\sextensions. +D 2023-08-16T15:27:49.292 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -645,7 +645,7 @@ F src/in-operator.md 10cd8f4bcd225a32518407c2fb2484089112fd71 F src/insert.c 3f0a94082d978bbdd33c38fefea15346c6c6bffb70bc645a71dc0f1f87dd3276 F src/json.c ae840f87b418f039f5d336b488933d09396bd31e6b31e855b93055ccaee4e255 F src/legacy.c d7874bc885906868cd51e6c2156698f2754f02d9eee1bae2d687323c3ca8e5aa -F src/loadext.c 176d6b2cb18a6ad73b133db17f6fc351c4d9a2d510deebdb76c22bde9cfd1465 +F src/loadext.c 98cfba10989b3da6f1807ad42444017742db7f100a54f1032af7a8b1295912c0 F src/main.c fde8f13c876a658b4e8b74b77d875ca887915c174ea6a2f3122d80966f93d865 F src/malloc.c 47b82c5daad557d9b963e3873e99c22570fb470719082c6658bf64e3012f7d23 F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645 @@ -687,7 +687,7 @@ F src/select.c 5f545a2c8702d4d3430bbb188cfec47d6c122d899061ef00cbe56af14591c574 F src/shell.c.in 0c3dd37ab2787a63f1e1c1b7160647c5d3276d9ac941890b2735a773a7495d27 F src/sqlite.h.in 73a366c1c45d5ac9888cfe81c458826a44498531d106cfb4f328193ab5f6f17d F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 -F src/sqlite3ext.h da473ce2b3d0ae407a6300c4a164589b9a6bfdbec9462688a8593ff16f3bb6e4 +F src/sqlite3ext.h 2f30b2671f4c03cd27a43f039e11251391066c97d11385f5f963bb40b03038ac F src/sqliteInt.h 025ed58a41968ef80d64cdc194caa8dd207b0256b147253d762fdac7a62408f9 F src/sqliteLimit.h 33b1c9baba578d34efe7dfdb43193b366111cdf41476b1e82699e14c11ee1fb6 F src/status.c 160c445d7d28c984a0eae38c144f6419311ed3eace59b44ac6dafc20db4af749 @@ -2091,8 +2091,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 6542ed3b9e028c44aca504eadca843ee9b2ba08f5f650523238dd1253f7e221b -R ece0937be0d2051513e3d32d8c3b91f1 +P 775a36ee093df4b5f7529a43eeaee9d5a9a943ad5ed8ae03bc74e459e87ba438 +R 42ceb918e8eb774c2019ae2eb0fd4576 U drh -Z 06c172de925aa6209d8f7ab3fd13d9d5 +Z bc0426191acbad1bab7ee4cb90f3a1c9 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index e25aaca2da..2109d9d29d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -775a36ee093df4b5f7529a43eeaee9d5a9a943ad5ed8ae03bc74e459e87ba438 \ No newline at end of file +a237a31ff4a7cd3dc744af1e1ebb9466e42eebafa31c1b5c0027cbaee9babc9b \ No newline at end of file diff --git a/src/loadext.c b/src/loadext.c index 4fc1352e03..e792fa5a98 100644 --- a/src/loadext.c +++ b/src/loadext.c @@ -512,7 +512,9 @@ static const sqlite3_api_routines sqlite3Apis = { /* Version 3.40.0 and later */ sqlite3_value_encoding, /* Version 3.41.0 and later */ - sqlite3_is_interrupted + sqlite3_is_interrupted, + /* Version 3.43.0 and later */ + sqlite3_stmt_explain }; /* True if x is the directory separator character diff --git a/src/sqlite3ext.h b/src/sqlite3ext.h index 19e030028a..7116380992 100644 --- a/src/sqlite3ext.h +++ b/src/sqlite3ext.h @@ -361,6 +361,8 @@ struct sqlite3_api_routines { int (*value_encoding)(sqlite3_value*); /* Version 3.41.0 and later */ int (*is_interrupted)(sqlite3*); + /* Version 3.43.0 and later */ + int (*stmt_explain)(sqlite3_stmt*,int); }; /* @@ -689,6 +691,8 @@ typedef int (*sqlite3_loadext_entry)( #define sqlite3_value_encoding sqlite3_api->value_encoding /* Version 3.41.0 and later */ #define sqlite3_is_interrupted sqlite3_api->is_interrupted +/* Version 3.43.0 and later */ +#define sqlite3_stmt_explain sqlite3_api->stmt_explain #endif /* !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) */ #if !defined(SQLITE_CORE) && !defined(SQLITE_OMIT_LOAD_EXTENSION) From 7335f75daf283467d65a1040c76567095a4e210c Mon Sep 17 00:00:00 2001 From: drh <> Date: Wed, 16 Aug 2023 17:12:26 +0000 Subject: [PATCH 19/32] Improved instructions on how to build SQLite on Windows 11 and similar. FossilOrigin-Name: 0f6b2b33736ee07f17f3a4e5f077bb4d0e2481c8f81251b8ce6b78510f372237 --- README.md | 43 +++++++++++++-------------- doc/compile-for-windows.md | 59 ++++++++++++++++++++++++++++++++++++++ manifest | 13 +++++---- manifest.uuid | 2 +- 4 files changed, 89 insertions(+), 28 deletions(-) create mode 100644 doc/compile-for-windows.md diff --git a/README.md b/README.md index 10262653e7..9c221fff29 100644 --- a/README.md +++ b/README.md @@ -104,9 +104,9 @@ For example: mkdir bld ;# Build will occur in a sibling directory cd bld ;# Change to the build directory ../sqlite/configure ;# Run the configure script - make ;# Run the makefile. + make ;# Builds the "sqlite3" command-line tool make sqlite3.c ;# Build the "amalgamation" source file - make test ;# Run some tests (requires Tcl) + make devtest ;# Run some tests (requires Tcl) See the makefile for additional targets. @@ -119,29 +119,30 @@ show what changes are needed. ## Using MSVC for Windows systems On Windows, all applicable build products can be compiled with MSVC. -First open the command prompt window associated with the desired compiler -version (e.g. "Developer Command Prompt for VS2013"). Next, use NMAKE -with the provided "Makefile.msc" to build one of the supported targets. +You will also need a working installation of TCL. +See the [compile-for-windows.md](doc/compile-for-windows.md) document for +additional information about how to install MSVC and TCL and configure your +build environment. -For example, from the parent directory of the source subtree named "sqlite": +If you want to run tests, you need to let SQLite know the location of your +TCL library, using a command like this: - mkdir bld - cd bld - nmake /f ..\sqlite\Makefile.msc TOP=..\sqlite - nmake /f ..\sqlite\Makefile.msc sqlite3.c TOP=..\sqlite - nmake /f ..\sqlite\Makefile.msc sqlite3.dll TOP=..\sqlite - nmake /f ..\sqlite\Makefile.msc sqlite3.exe TOP=..\sqlite - nmake /f ..\sqlite\Makefile.msc test TOP=..\sqlite + set TCLDIR=c:\Tcl -There are several build options that can be set via the NMAKE command -line. For example, to build for WinRT, simply add "FOR_WINRT=1" argument -to the "sqlite3.dll" command line above. When debugging into the SQLite -code, adding the "DEBUG=1" argument to one of the above command lines is -recommended. +SQLite uses "tclsh.exe" as part of the build process, and so that utility +program will need to be somewhere on your %PATH%. The finished SQLite library +does not contain any TCL code, but it does use TCL to help with the build process +and to run tests. -SQLite does not require [Tcl](http://www.tcl.tk/) to run, but a Tcl installation -is required by the makefiles (including those for MSVC). SQLite contains -a lot of generated code and Tcl is used to do much of that code generation. +Build using Makefile.msc. Example: + + nmake /f Makefile.msc + nmake /f Makefile.msc sqlite3.c + nmake /f Makefile.msc devtest + nmake /f Makefile.msc releasetest + +There are many other makefile targets. See comments in Makefile.msc for +details. ## Source Code Tour diff --git a/doc/compile-for-windows.md b/doc/compile-for-windows.md new file mode 100644 index 0000000000..04240a7ddc --- /dev/null +++ b/doc/compile-for-windows.md @@ -0,0 +1,59 @@ +# Notes On Compiling SQLite On Windows 11 + +Here are step-by-step instructions on how to build SQLite from +canonical source on a new Windows 11 PC, as of 2023-08-16: + + 1. Install Microsoft Visual Studio. The free "community edition" + will work fine. Do a standard install for C++ development. + SQLite only needs the + "cl" compiler and the "nmake" build tool. + + 2. Under the "Start" menu, find "All Apps" then go to "Visual Studio 20XX" + and find "x64 Native Tools Command Prompt for VS 20XX". Pin that + application to your task bar, as you will use it a lot. Bring up + an instance of this command prompt and do all of the subsequent steps + in that "x64 Native Tools" command prompt. (Or use "x86" if you want + a 32-bit build.) The subsequent steps will not work in a vanilla + DOS prompt. Nor will they work in PowerShell. + + 3. Install TCL development libraries. This note assumes that you wil + install the TCL development libraries in the "`c:\Tcl`" directory. + Make adjustments + if you want TCL installed somewhere else. SQLite needs both the + "tclsh.exe" command-line tool as part of the build process, and + the "tcl86.lib" library in order to run tests. You will need + TCL version 8.6 or later. +
    +
  1. Get the TCL source archive, perhaps from + . +
  2. Untar or unzip the source archive. CD into the "win/" subfolder + of the source tree. +
  3. Run: `nmake /f makefile.vc release` +
  4. Run: `nmake /f makefile.vc INSTALLDIR=c:\Tcl install` +
  5. CD to c:\\Tcl\\lib. In that subfolder make a copy of the + "`tcl86t.lib`" file to the alternative name "`tcl86.lib`" + (omitting the second 't'). Leave the copy in the same directory + as the original. +
  6. CD to c:\\Tcl\\bin. Make a copy of the "`tclsh86t.exe`" + file, renaming it to "`tclsh.exe`". Put the copy somewhere + on your %PATH% so that the SQLite makefile will be able to + run "tclsh" commands. +
+ + 4. Download the SQLite source tree and unpack it. CD into the + toplevel directory of the source tree. + + 5. Set the TCLDIR environment variable to point to your TCL installation. + Like this: +
    +
  • `set TCLDIR=c:\Tcl` +
+ + 6. Run the "`Makefile.msc`" makefile with an appropriate target. + Examples: +
    +
  • `nmake /f makefile.msc` +
  • `nmake /f makefile.msc sqlite3.c` +
  • `nmake /f makefile.msc devtest` +
  • `nmake /f makefile.msc releasetest` +
diff --git a/manifest b/manifest index a7bfcea548..b22ba0c7b5 100644 --- a/manifest +++ b/manifest @@ -1,12 +1,12 @@ -C Make\ssqlite3_stmt_explain()\saccessible\sto\sloadable\sextensions. -D 2023-08-16T15:27:49.292 +C Improved\sinstructions\son\show\sto\sbuild\sSQLite\son\sWindows\s11\sand\ssimilar. +D 2023-08-16T17:12:26.504 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 F Makefile.in 6f391d54fa01f8a49b024fef5cce1ab8234c281164641cf9a52694b432bdec1b F Makefile.linux-gcc f3842a0b1efbfbb74ac0ef60e56b301836d05b4d867d014f714fa750048f1ab6 F Makefile.msc e0e2630b327b31232f4f1c748cae8af358f897e88cae7479218369d1d510f94d -F README.md c1c4218efcc4071a6e26db2b517fdbc1035696a29b370edd655faddbef02b224 +F README.md 093d7054271141a0a8518558e3d49087cb71f84d33b50ee10053946ed85dcac8 F VERSION c6366dc72582d3144ce87b013cc35fe48d62f6d07d5be0c9716ea33c862144aa F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50 F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2 @@ -37,6 +37,7 @@ F configure 9dc3300339f4d6b3c3b108de60cc6ae6b3c547e25c7e6df280b4775db4de3a1b x F configure.ac 4654d32ac0a0d0b48f1e1e79bdc3d777b723cf2f63c33eb1d7c4ed8b435938e8 F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad F doc/F2FS.txt c1d4a0ae9711cfe0e1d8b019d154f1c29e0d3abfe820787ba1e9ed7691160fcd +F doc/compile-for-windows.md a978d0939c4df3bc2903be88918bdb157d6acbd8ddd5e1b6e57fbadd250f92b3 F doc/json-enhancements.md e356fc834781f1f1aa22ee300027a270b2c960122468499bf347bb123ce1ea4f F doc/lemon.html d2862dbef72496e87f7996f37e814b146848190a742c12161d13fd15346051b0 F doc/pager-invariants.txt 27fed9a70ddad2088750c4a2b493b63853da2710 @@ -2091,8 +2092,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 775a36ee093df4b5f7529a43eeaee9d5a9a943ad5ed8ae03bc74e459e87ba438 -R 42ceb918e8eb774c2019ae2eb0fd4576 +P a237a31ff4a7cd3dc744af1e1ebb9466e42eebafa31c1b5c0027cbaee9babc9b +R e19435c7f021382e55e405e67b892334 U drh -Z bc0426191acbad1bab7ee4cb90f3a1c9 +Z 76dc25a75d894710960a3989dfe3a1ae # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 2109d9d29d..c6f9a45bb4 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a237a31ff4a7cd3dc744af1e1ebb9466e42eebafa31c1b5c0027cbaee9babc9b \ No newline at end of file +0f6b2b33736ee07f17f3a4e5f077bb4d0e2481c8f81251b8ce6b78510f372237 \ No newline at end of file From 936f7deee40e7422058203de682f9f75af0359a6 Mon Sep 17 00:00:00 2001 From: drh <> Date: Wed, 16 Aug 2023 17:23:42 +0000 Subject: [PATCH 20/32] Refinements to instructions on compiling for Windows. FossilOrigin-Name: d543c36c35f71c5f0a7ebf6f496feca40d16566d0c5b2c2ba205ff43437ffcd1 --- doc/compile-for-windows.md | 9 ++++++--- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/doc/compile-for-windows.md b/doc/compile-for-windows.md index 04240a7ddc..b4f8e04c5c 100644 --- a/doc/compile-for-windows.md +++ b/doc/compile-for-windows.md @@ -35,9 +35,12 @@ canonical source on a new Windows 11 PC, as of 2023-08-16: (omitting the second 't'). Leave the copy in the same directory as the original.
  • CD to c:\\Tcl\\bin. Make a copy of the "`tclsh86t.exe`" - file, renaming it to "`tclsh.exe`". Put the copy somewhere - on your %PATH% so that the SQLite makefile will be able to - run "tclsh" commands. + file into "`tclsh.exe`" (without the "86t") in the same directory. +
  • Add c:\\Tcl\\bin to your %PATH%. To do this, go to Settings + and search for "path". Select "edit environment variables for + your account" and modify your default PATH accordingly. + You will need to close and reopen your command prompts after + making this change. 4. Download the SQLite source tree and unpack it. CD into the diff --git a/manifest b/manifest index b22ba0c7b5..49c9bc8c34 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Improved\sinstructions\son\show\sto\sbuild\sSQLite\son\sWindows\s11\sand\ssimilar. -D 2023-08-16T17:12:26.504 +C Refinements\sto\sinstructions\son\scompiling\sfor\sWindows. +D 2023-08-16T17:23:42.222 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -37,7 +37,7 @@ F configure 9dc3300339f4d6b3c3b108de60cc6ae6b3c547e25c7e6df280b4775db4de3a1b x F configure.ac 4654d32ac0a0d0b48f1e1e79bdc3d777b723cf2f63c33eb1d7c4ed8b435938e8 F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad F doc/F2FS.txt c1d4a0ae9711cfe0e1d8b019d154f1c29e0d3abfe820787ba1e9ed7691160fcd -F doc/compile-for-windows.md a978d0939c4df3bc2903be88918bdb157d6acbd8ddd5e1b6e57fbadd250f92b3 +F doc/compile-for-windows.md a342ac53d5d38fc220cc643c4e0a8c0966bd6caa569f3d927cf10844f5f0aaca F doc/json-enhancements.md e356fc834781f1f1aa22ee300027a270b2c960122468499bf347bb123ce1ea4f F doc/lemon.html d2862dbef72496e87f7996f37e814b146848190a742c12161d13fd15346051b0 F doc/pager-invariants.txt 27fed9a70ddad2088750c4a2b493b63853da2710 @@ -2092,8 +2092,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 a237a31ff4a7cd3dc744af1e1ebb9466e42eebafa31c1b5c0027cbaee9babc9b -R e19435c7f021382e55e405e67b892334 +P 0f6b2b33736ee07f17f3a4e5f077bb4d0e2481c8f81251b8ce6b78510f372237 +R 6b56e789e5267410fdb3971aefa50798 U drh -Z 76dc25a75d894710960a3989dfe3a1ae +Z 6657d0ca5d125a89c7fdb5a9a6cb9ceb # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index c6f9a45bb4..e30cdd08fc 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -0f6b2b33736ee07f17f3a4e5f077bb4d0e2481c8f81251b8ce6b78510f372237 \ No newline at end of file +d543c36c35f71c5f0a7ebf6f496feca40d16566d0c5b2c2ba205ff43437ffcd1 \ No newline at end of file From 36a9f5c24cbdca85485eb899fd53df124d3ab895 Mon Sep 17 00:00:00 2001 From: drh <> Date: Thu, 17 Aug 2023 14:19:44 +0000 Subject: [PATCH 21/32] Fix a possible UAF in SEH if an exception occurs at an inopportune moment during WAL processing. FossilOrigin-Name: 91b91037e348fa10cf6a9d8a0ffbfdebb4a40e0e336b65b112ed1c828e75cda7 --- manifest | 12 ++++++------ manifest.uuid | 2 +- src/wal.c | 25 ++++++++++++++++++++++++- 3 files changed, 31 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 49c9bc8c34..07d4d8935e 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Refinements\sto\sinstructions\son\scompiling\sfor\sWindows. -D 2023-08-16T17:23:42.222 +C Fix\sa\spossible\sUAF\sin\sSEH\sif\san\sexception\soccurs\sat\san\sinopportune\smoment\nduring\sWAL\sprocessing. +D 2023-08-17T14:19:44.072 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -766,7 +766,7 @@ F src/vdbetrace.c fe0bc29ebd4e02c8bc5c1945f1d2e6be5927ec12c06d89b03ef2a4def34bf8 F src/vdbevtab.c 57fa8f56478e5b5cb558cb425e7878515e0a105c54f96f1d1bbf4b9433529254 F src/vtab.c 1ecf8c3745d29275688d583e12822fa984d421e0286b5ef50c137bc3bf6d7a64 F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9 -F src/wal.c 3b068bc1db5d42d72b940c377b6fdb0e6d41bc106c5e99bfc40bbbe973e5f3e2 +F src/wal.c 01e051a1e713d9eabdb25df38602837cec8f4c2cae448ce2cf6accc87af903e9 F src/wal.h 04a9e53121d5076f2a173b0f2facb39d33047093fee71bd3bbe6b1f6f1f5fd4b F src/walker.c 7c7ea0115345851c3da4e04e2e239a29983b61fb5b038b94eede6aba462640e2 F src/where.c b8917792f1e0dbfa28fb29e6cd3d560060d69667be0ba4c491cbc772363264f5 @@ -2092,8 +2092,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 0f6b2b33736ee07f17f3a4e5f077bb4d0e2481c8f81251b8ce6b78510f372237 -R 6b56e789e5267410fdb3971aefa50798 +P d543c36c35f71c5f0a7ebf6f496feca40d16566d0c5b2c2ba205ff43437ffcd1 +R f8ce2e24212ad2fa8332322fc5005324 U drh -Z 6657d0ca5d125a89c7fdb5a9a6cb9ceb +Z 3120c029fcad27eadc95da2816eed4db # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index e30cdd08fc..ab0264d1a6 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d543c36c35f71c5f0a7ebf6f496feca40d16566d0c5b2c2ba205ff43437ffcd1 \ No newline at end of file +91b91037e348fa10cf6a9d8a0ffbfdebb4a40e0e336b65b112ed1c828e75cda7 \ No newline at end of file diff --git a/src/wal.c b/src/wal.c index 4ee5d80f79..d63c13ffc4 100644 --- a/src/wal.c +++ b/src/wal.c @@ -531,6 +531,8 @@ struct Wal { #ifdef SQLITE_USE_SEH u32 lockMask; /* Mask of locks held */ void *pFree; /* Pointer to sqlite3_free() if exception thrown */ + u32 *pWiValue; /* Value to write into apWiData[iWiPg] */ + int iWiPg; /* Write pWiValue into apWiData[iWiPg] */ int iSysErrno; /* System error code following exception */ #endif #ifdef SQLITE_DEBUG @@ -702,11 +704,24 @@ static void sehInjectFault(Wal *pWal){ #define SEH_FREE_ON_ERROR(X,Y) \ assert( (X==0 || Y==0) && pWal->pFree==X ); pWal->pFree = Y +/* +** There are two ways to use this macro. To arrange for pWal->apWiData[iPg] +** to be set to pValue if an exception is thrown: +** +** SEH_SET_ON_ERROR(iPg, pValue); +** +** and to cancel the same: +** +** SEH_SET_ON_ERROR(0, 0); +*/ +#define SEH_SET_ON_ERROR(X,Y) pWal->iWiPg = X; pWal->pWiValue = Y + #else # define SEH_TRY VVA_ONLY(pWal->nSehTry++); # define SEH_EXCEPT(X) VVA_ONLY(pWal->nSehTry--); assert( pWal->nSehTry==0 ); # define SEH_INJECT_FAULT assert( pWal->nSehTry>0 ); # define SEH_FREE_ON_ERROR(X,Y) +# define SEH_SET_ON_ERROR(X,Y) #endif /* ifdef SQLITE_USE_SEH */ @@ -1467,6 +1482,7 @@ static int walIndexRecover(Wal *pWal){ rc = walIndexPage(pWal, iPg, (volatile u32**)&aShare); assert( aShare!=0 || rc!=SQLITE_OK ); if( aShare==0 ) break; + SEH_SET_ON_ERROR(iPg, aShare); pWal->apWiData[iPg] = aPrivate; for(iFrame=iFirst; iFrame<=iLast; iFrame++){ @@ -1494,6 +1510,7 @@ static int walIndexRecover(Wal *pWal){ } } pWal->apWiData[iPg] = aShare; + SEH_SET_ON_ERROR(0,0); nHdr = (iPg==0 ? WALINDEX_HDR_SIZE : 0); nHdr32 = nHdr / sizeof(u32); #ifndef SQLITE_SAFER_WALINDEX_RECOVERY @@ -2387,7 +2404,9 @@ static void walLimitSize(Wal *pWal, i64 nMax){ ** ** 2) Frees the pointer at Wal.pFree, if any, using sqlite3_free(). ** -** 3) Returns SQLITE_IOERR. +** 3) Set pWal->apWiData[pWal->iWiPg] to pWal->pWiValue if not NULL +** +** 4) Returns SQLITE_IOERR. */ static int walHandleException(Wal *pWal){ if( pWal->exclusiveMode==0 ){ @@ -2406,6 +2425,10 @@ static int walHandleException(Wal *pWal){ } sqlite3_free(pWal->pFree); pWal->pFree = 0; + if( pWal->pWiValue ){ + pWal->apWiData[pWal->iWiPg] = pWal->pWiValue; + pWal->pWiValue = 0; + } return SQLITE_IOERR_IN_PAGE; } From 81ef0f8e89555f6471d2cc18a0317e93c4828880 Mon Sep 17 00:00:00 2001 From: drh <> Date: Thu, 17 Aug 2023 15:11:59 +0000 Subject: [PATCH 22/32] Enable address sanitizer in Makefile.msc by adding the ASAN=1 argument on the nmake command line. FossilOrigin-Name: 3eaadaff85111103c9441a9d6cd31291b95db9f3a6ec7003e0ff4ce5db7490da --- Makefile.msc | 13 +++++++++++++ manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/Makefile.msc b/Makefile.msc index 95f0eee0d4..3179e301ce 100644 --- a/Makefile.msc +++ b/Makefile.msc @@ -225,6 +225,12 @@ WIN32HEAP = 0 OSTRACE = 0 !ENDIF +# enable address sanitizer using ASAN=1 on the command-line. +# +!IFNDEF ASAN +ASAN = 0 +!ENDIF + # Set this to one of the following values to enable various debugging # features. Each level includes the debugging options from the previous # levels. Currently, the recognized values for DEBUG are: @@ -891,6 +897,13 @@ RCC = $(RCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1 !ENDIF !ENDIF + +# Address sanitizer if ASAN=1 +# +!IF $(ASAN)>0 +TCC = $(TCC) /fsanitize=address +!ENDIF + # <> # The locations of the Tcl header and library files. Also, the library that # non-stubs enabled programs using Tcl must link against. These variables diff --git a/manifest b/manifest index 07d4d8935e..6a7a13e447 100644 --- a/manifest +++ b/manifest @@ -1,11 +1,11 @@ -C Fix\sa\spossible\sUAF\sin\sSEH\sif\san\sexception\soccurs\sat\san\sinopportune\smoment\nduring\sWAL\sprocessing. -D 2023-08-17T14:19:44.072 +C Enable\saddress\ssanitizer\sin\sMakefile.msc\sby\sadding\sthe\sASAN=1\sargument\son\nthe\snmake\scommand\sline. +D 2023-08-17T15:11:59.824 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 F Makefile.in 6f391d54fa01f8a49b024fef5cce1ab8234c281164641cf9a52694b432bdec1b F Makefile.linux-gcc f3842a0b1efbfbb74ac0ef60e56b301836d05b4d867d014f714fa750048f1ab6 -F Makefile.msc e0e2630b327b31232f4f1c748cae8af358f897e88cae7479218369d1d510f94d +F Makefile.msc 26c2d196391a285c279adb10fd6001774d9b243af94b700b681e4a49cd476684 F README.md 093d7054271141a0a8518558e3d49087cb71f84d33b50ee10053946ed85dcac8 F VERSION c6366dc72582d3144ce87b013cc35fe48d62f6d07d5be0c9716ea33c862144aa F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50 @@ -2092,8 +2092,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 d543c36c35f71c5f0a7ebf6f496feca40d16566d0c5b2c2ba205ff43437ffcd1 -R f8ce2e24212ad2fa8332322fc5005324 +P 91b91037e348fa10cf6a9d8a0ffbfdebb4a40e0e336b65b112ed1c828e75cda7 +R 4400ba90f4d067c0e7509c168d501950 U drh -Z 3120c029fcad27eadc95da2816eed4db +Z bada3b91f6d8a3e8bcac6a8e2760f073 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index ab0264d1a6..8d96bc99ac 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -91b91037e348fa10cf6a9d8a0ffbfdebb4a40e0e336b65b112ed1c828e75cda7 \ No newline at end of file +3eaadaff85111103c9441a9d6cd31291b95db9f3a6ec7003e0ff4ce5db7490da \ No newline at end of file From 58c44132d11b71f0e5e8285ae9bb3c08a24e52c1 Mon Sep 17 00:00:00 2001 From: dan Date: Thu, 17 Aug 2023 15:14:43 +0000 Subject: [PATCH 23/32] Have all test names in json101.test start with "json101". FossilOrigin-Name: af56d7b6b9c50f2541a51fcb7d94b89aafba4f343a9103b21a15aad3f283c63e --- manifest | 14 +- manifest.uuid | 2 +- test/json101.test | 394 +++++++++++++++++++++++----------------------- 3 files changed, 205 insertions(+), 205 deletions(-) diff --git a/manifest b/manifest index 6a7a13e447..8bbbd17875 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Enable\saddress\ssanitizer\sin\sMakefile.msc\sby\sadding\sthe\sASAN=1\sargument\son\nthe\snmake\scommand\sline. -D 2023-08-17T15:11:59.824 +C Have\sall\stest\snames\sin\sjson101.test\sstart\swith\s"json101". +D 2023-08-17T15:14:43.433 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -1273,7 +1273,7 @@ F test/json/README.md 63e3e589e1df8fd3cc1588ba1faaff659214003f8b77a15af5c6452b35 F test/json/json-generator.tcl dc0dd0f393800c98658fc4c47eaa6af29d4e17527380cd28656fb261bddc8a3f F test/json/json-q1.txt 65f9d1cdcc4cffa9823fb73ed936aae5658700cd001fde448f68bfb91c807307 F test/json/json-speed-check.sh 8b7babf530faa58bd59d6d362cec8e9036a68c5457ff46f3b1f1511d21af6737 x -F test/json101.test 243b0a2650218ac5eafde6ce2a92a0e9d02bf24f62aec68693b69d9a693f120a +F test/json101.test dc9d5a2a5b1fd1b54dbd71c538b17933cc98d84b4c1f821ead754933663dca55 F test/json102.test 24f6f204f9cde45b971016691d0b92a9b4c58040d699e36d6b12cb165f9083ff F test/json103.test 53df87f83a4e5fa0c0a56eb29ff6c94055c6eb919f33316d62161a8880112dbe F test/json104.test 1b844a70cddcfa2e4cd81a5db0657b2e61e7f00868310f24f56a9ba0114348c1 @@ -2092,8 +2092,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 91b91037e348fa10cf6a9d8a0ffbfdebb4a40e0e336b65b112ed1c828e75cda7 -R 4400ba90f4d067c0e7509c168d501950 -U drh -Z bada3b91f6d8a3e8bcac6a8e2760f073 +P 3eaadaff85111103c9441a9d6cd31291b95db9f3a6ec7003e0ff4ce5db7490da +R 048665a7accd06e0bff1d365377ae82b +U dan +Z e718fd03ed4d1cee7bc3d4e08526fc0a # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 8d96bc99ac..076583930a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3eaadaff85111103c9441a9d6cd31291b95db9f3a6ec7003e0ff4ce5db7490da \ No newline at end of file +af56d7b6b9c50f2541a51fcb7d94b89aafba4f343a9103b21a15aad3f283c63e \ No newline at end of file diff --git a/test/json101.test b/test/json101.test index 8bb133ec73..4da1d132cc 100644 --- a/test/json101.test +++ b/test/json101.test @@ -122,14 +122,14 @@ do_execsql_test json101-4.8 { # json_extract(JSON,'$') will return objects and arrays without change. # -do_execsql_test json-4.10 { +do_execsql_test json101-4.10 { SELECT count(*) FROM j1 WHERE json_type(x) IN ('object','array'); SELECT x FROM j1 WHERE json_extract(x,'$')<>x AND json_type(x) IN ('object','array'); } {4} -do_execsql_test json-5.1 { +do_execsql_test json101-5.1 { CREATE TABLE j2(id INTEGER PRIMARY KEY, json, src); INSERT INTO j2(id,json,src) VALUES(1,'{ @@ -257,7 +257,7 @@ do_execsql_test json-5.1 { SELECT count(*) FROM j2; } {3} -do_execsql_test json-5.2 { +do_execsql_test json101-5.2 { SELECT id, json_valid(json), json_type(json), '|' FROM j2 ORDER BY id; } {1 1 object | 2 1 object | 3 1 array |} @@ -268,13 +268,13 @@ ifcapable !vtab { # fullkey is always the same as path+key (with appropriate formatting) # -do_execsql_test json-5.3 { +do_execsql_test json101-5.3 { SELECT j2.rowid, jx.rowid, fullkey, path, key FROM j2, json_tree(j2.json) AS jx WHERE fullkey!=(path || CASE WHEN typeof(key)=='integer' THEN '['||key||']' ELSE '.'||key END); } {} -do_execsql_test json-5.4 { +do_execsql_test json101-5.4 { SELECT j2.rowid, jx.rowid, fullkey, path, key FROM j2, json_each(j2.json) AS jx WHERE fullkey!=(path || CASE WHEN typeof(key)=='integer' THEN '['||key||']' @@ -285,58 +285,58 @@ do_execsql_test json-5.4 { # Verify that the json_each.json and json_tree.json output is always the # same as input. # -do_execsql_test json-5.5 { +do_execsql_test json101-5.5 { SELECT j2.rowid, jx.rowid, fullkey, path, key FROM j2, json_each(j2.json) AS jx WHERE jx.json<>j2.json; } {} -do_execsql_test json-5.6 { +do_execsql_test json101-5.6 { SELECT j2.rowid, jx.rowid, fullkey, path, key FROM j2, json_tree(j2.json) AS jx WHERE jx.json<>j2.json; } {} -do_execsql_test json-5.7 { +do_execsql_test json101-5.7 { SELECT j2.rowid, jx.rowid, fullkey, path, key FROM j2, json_each(j2.json) AS jx WHERE jx.value<>jx.atom AND type NOT IN ('array','object'); } {} -do_execsql_test json-5.8 { +do_execsql_test json101-5.8 { SELECT j2.rowid, jx.rowid, fullkey, path, key FROM j2, json_tree(j2.json) AS jx WHERE jx.value<>jx.atom AND type NOT IN ('array','object'); } {} -do_execsql_test json-6.1 { +do_execsql_test json101-6.1 { SELECT json_valid('{"a":55,"b":72,}'); } {0} -do_execsql_test json-6.2 { +do_execsql_test json101-6.2 { SELECT json_error_position('{"a":55,"b":72,}'); } {0} -do_execsql_test json-6.3 { +do_execsql_test json101-6.3 { SELECT json_valid(json('{"a":55,"b":72,}')); } {1} -do_execsql_test json-6.4 { +do_execsql_test json101-6.4 { SELECT json_valid('{"a":55,"b":72 , }'); } {0} -do_execsql_test json-6.5 { +do_execsql_test json101-6.5 { SELECT json_error_position('{"a":55,"b":72 , }'); } {0} -do_execsql_test json-6.6 { +do_execsql_test json101-6.6 { SELECT json_error_position('{"a":55,"b":72,,}'); } {16} -do_execsql_test json-6.7 { +do_execsql_test json101-6.7 { SELECT json_valid('{"a":55,"b":72}'); } {1} -do_execsql_test json-6.8 { +do_execsql_test json101-6.8 { SELECT json_error_position('["a",55,"b",72,]'); } {0} -do_execsql_test json-6.9 { +do_execsql_test json101-6.9 { SELECT json_error_position('["a",55,"b",72 , ]'); } {0} -do_execsql_test json-6.10 { +do_execsql_test json101-6.10 { SELECT json_error_position('["a",55,"b",72,,]'); } {16} -do_execsql_test json-6.11 { +do_execsql_test json101-6.11 { SELECT json_valid('["a",55,"b",72]'); } {1} @@ -352,7 +352,7 @@ foreach {tn isvalid ws} { 7.6 1 char(0x20,0x09,0x0a,0x0d,0x20) 7.7 0 char(0x20,0x09,0x0a,0x0c,0x0d,0x20) } { - do_execsql_test json-$tn.1 \ + do_execsql_test json101-$tn.1 \ "SELECT json_valid(printf('%s{%s\"x\"%s:%s9%s}%s', $::ws,$::ws,$::ws,$::ws,$::ws,$::ws));" \ $isvalid @@ -361,23 +361,23 @@ foreach {tn isvalid ws} { # Ticket https://www.sqlite.org/src/info/ad2559db380abf8e # Control characters must be escaped in JSON strings. # -do_execsql_test json-8.1 { +do_execsql_test json101-8.1 { DROP TABLE IF EXISTS t8; CREATE TABLE t8(a,b); INSERT INTO t8(a) VALUES('abc' || char(1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35) || 'xyz'); UPDATE t8 SET b=json_array(a); SELECT b FROM t8; } {{["abc\u0001\u0002\u0003\u0004\u0005\u0006\u0007\b\t\n\u000b\f\r\u000e\u000f\u0010\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d\u001e\u001f !\"#xyz"]}} -do_execsql_test json-8.2 { +do_execsql_test json101-8.2 { SELECT a=json_extract(b,'$[0]') FROM t8; } {1} # 2017-04-12. Regression reported on the mailing list by Rolf Ade # -do_execsql_test json-8.3 { +do_execsql_test json101-8.3 { SELECT json_valid(char(0x22,0xe4,0x22)); } {1} -do_execsql_test json-8.4 { +do_execsql_test json101-8.4 { SELECT unicode(json_extract(char(0x22,228,0x22),'$')); } {228} @@ -385,331 +385,331 @@ do_execsql_test json-8.4 { # String values are quoted and interior quotes are escaped. NULL values # are rendered as the unquoted string "null". # -do_execsql_test json-9.1 { +do_execsql_test json101-9.1 { SELECT json_quote('abc"xyz'); } {{"abc\"xyz"}} -do_execsql_test json-9.2 { +do_execsql_test json101-9.2 { SELECT json_quote(3.14159); } {3.14159} -do_execsql_test json-9.3 { +do_execsql_test json101-9.3 { SELECT json_quote(12345); } {12345} -do_execsql_test json-9.4 { +do_execsql_test json101-9.4 { SELECT json_quote(null); } {"null"} -do_catchsql_test json-9.5 { +do_catchsql_test json101-9.5 { SELECT json_quote(x'30313233'); } {1 {JSON cannot hold BLOB values}} -do_catchsql_test json-9.6 { +do_catchsql_test json101-9.6 { SELECT json_quote(123,456) } {1 {wrong number of arguments to function json_quote()}} -do_catchsql_test json-9.7 { +do_catchsql_test json101-9.7 { SELECT json_quote() } {1 {wrong number of arguments to function json_quote()}} # Make sure only valid backslash-escapes are accepted. # -do_execsql_test json-10.1 { +do_execsql_test json101-10.1 { SELECT json_valid('" \ "'); } {0} -do_execsql_test json-10.2 { +do_execsql_test json101-10.2 { SELECT json_valid('" \! "'); } {0} -do_execsql_test json-10.3 { +do_execsql_test json101-10.3 { SELECT json_valid('" \" "'); } {1} -do_execsql_test json-10.4 { +do_execsql_test json101-10.4 { SELECT json_valid('" \# "'); } {0} -do_execsql_test json-10.5 { +do_execsql_test json101-10.5 { SELECT json_valid('" \$ "'); } {0} -do_execsql_test json-10.6 { +do_execsql_test json101-10.6 { SELECT json_valid('" \% "'); } {0} -do_execsql_test json-10.7 { +do_execsql_test json101-10.7 { SELECT json_valid('" \& "'); } {0} -do_execsql_test json-10.8 { +do_execsql_test json101-10.8 { SELECT json_valid('" \'' "'); } {0} -do_execsql_test json-10.9 { +do_execsql_test json101-10.9 { SELECT json_valid('" \( "'); } {0} -do_execsql_test json-10.10 { +do_execsql_test json101-10.10 { SELECT json_valid('" \) "'); } {0} -do_execsql_test json-10.11 { +do_execsql_test json101-10.11 { SELECT json_valid('" \* "'); } {0} -do_execsql_test json-10.12 { +do_execsql_test json101-10.12 { SELECT json_valid('" \+ "'); } {0} -do_execsql_test json-10.13 { +do_execsql_test json101-10.13 { SELECT json_valid('" \, "'); } {0} -do_execsql_test json-10.14 { +do_execsql_test json101-10.14 { SELECT json_valid('" \- "'); } {0} -do_execsql_test json-10.15 { +do_execsql_test json101-10.15 { SELECT json_valid('" \. "'); } {0} -do_execsql_test json-10.16 { +do_execsql_test json101-10.16 { SELECT json_valid('" \/ "'); } {1} -do_execsql_test json-10.17 { +do_execsql_test json101-10.17 { SELECT json_valid('" \0 "'); } {0} -do_execsql_test json-10.18 { +do_execsql_test json101-10.18 { SELECT json_valid('" \1 "'); } {0} -do_execsql_test json-10.19 { +do_execsql_test json101-10.19 { SELECT json_valid('" \2 "'); } {0} -do_execsql_test json-10.20 { +do_execsql_test json101-10.20 { SELECT json_valid('" \3 "'); } {0} -do_execsql_test json-10.21 { +do_execsql_test json101-10.21 { SELECT json_valid('" \4 "'); } {0} -do_execsql_test json-10.22 { +do_execsql_test json101-10.22 { SELECT json_valid('" \5 "'); } {0} -do_execsql_test json-10.23 { +do_execsql_test json101-10.23 { SELECT json_valid('" \6 "'); } {0} -do_execsql_test json-10.24 { +do_execsql_test json101-10.24 { SELECT json_valid('" \7 "'); } {0} -do_execsql_test json-10.25 { +do_execsql_test json101-10.25 { SELECT json_valid('" \8 "'); } {0} -do_execsql_test json-10.26 { +do_execsql_test json101-10.26 { SELECT json_valid('" \9 "'); } {0} -do_execsql_test json-10.27 { +do_execsql_test json101-10.27 { SELECT json_valid('" \: "'); } {0} -do_execsql_test json-10.28 { +do_execsql_test json101-10.28 { SELECT json_valid('" \; "'); } {0} -do_execsql_test json-10.29 { +do_execsql_test json101-10.29 { SELECT json_valid('" \< "'); } {0} -do_execsql_test json-10.30 { +do_execsql_test json101-10.30 { SELECT json_valid('" \= "'); } {0} -do_execsql_test json-10.31 { +do_execsql_test json101-10.31 { SELECT json_valid('" \> "'); } {0} -do_execsql_test json-10.32 { +do_execsql_test json101-10.32 { SELECT json_valid('" \? "'); } {0} -do_execsql_test json-10.33 { +do_execsql_test json101-10.33 { SELECT json_valid('" \@ "'); } {0} -do_execsql_test json-10.34 { +do_execsql_test json101-10.34 { SELECT json_valid('" \A "'); } {0} -do_execsql_test json-10.35 { +do_execsql_test json101-10.35 { SELECT json_valid('" \B "'); } {0} -do_execsql_test json-10.36 { +do_execsql_test json101-10.36 { SELECT json_valid('" \C "'); } {0} -do_execsql_test json-10.37 { +do_execsql_test json101-10.37 { SELECT json_valid('" \D "'); } {0} -do_execsql_test json-10.38 { +do_execsql_test json101-10.38 { SELECT json_valid('" \E "'); } {0} -do_execsql_test json-10.39 { +do_execsql_test json101-10.39 { SELECT json_valid('" \F "'); } {0} -do_execsql_test json-10.40 { +do_execsql_test json101-10.40 { SELECT json_valid('" \G "'); } {0} -do_execsql_test json-10.41 { +do_execsql_test json101-10.41 { SELECT json_valid('" \H "'); } {0} -do_execsql_test json-10.42 { +do_execsql_test json101-10.42 { SELECT json_valid('" \I "'); } {0} -do_execsql_test json-10.43 { +do_execsql_test json101-10.43 { SELECT json_valid('" \J "'); } {0} -do_execsql_test json-10.44 { +do_execsql_test json101-10.44 { SELECT json_valid('" \K "'); } {0} -do_execsql_test json-10.45 { +do_execsql_test json101-10.45 { SELECT json_valid('" \L "'); } {0} -do_execsql_test json-10.46 { +do_execsql_test json101-10.46 { SELECT json_valid('" \M "'); } {0} -do_execsql_test json-10.47 { +do_execsql_test json101-10.47 { SELECT json_valid('" \N "'); } {0} -do_execsql_test json-10.48 { +do_execsql_test json101-10.48 { SELECT json_valid('" \O "'); } {0} -do_execsql_test json-10.49 { +do_execsql_test json101-10.49 { SELECT json_valid('" \P "'); } {0} -do_execsql_test json-10.50 { +do_execsql_test json101-10.50 { SELECT json_valid('" \Q "'); } {0} -do_execsql_test json-10.51 { +do_execsql_test json101-10.51 { SELECT json_valid('" \R "'); } {0} -do_execsql_test json-10.52 { +do_execsql_test json101-10.52 { SELECT json_valid('" \S "'); } {0} -do_execsql_test json-10.53 { +do_execsql_test json101-10.53 { SELECT json_valid('" \T "'); } {0} -do_execsql_test json-10.54 { +do_execsql_test json101-10.54 { SELECT json_valid('" \U "'); } {0} -do_execsql_test json-10.55 { +do_execsql_test json101-10.55 { SELECT json_valid('" \V "'); } {0} -do_execsql_test json-10.56 { +do_execsql_test json101-10.56 { SELECT json_valid('" \W "'); } {0} -do_execsql_test json-10.57 { +do_execsql_test json101-10.57 { SELECT json_valid('" \X "'); } {0} -do_execsql_test json-10.58 { +do_execsql_test json101-10.58 { SELECT json_valid('" \Y "'); } {0} -do_execsql_test json-10.59 { +do_execsql_test json101-10.59 { SELECT json_valid('" \Z "'); } {0} -do_execsql_test json-10.60 { +do_execsql_test json101-10.60 { SELECT json_valid('" \[ "'); } {0} -do_execsql_test json-10.61 { +do_execsql_test json101-10.61 { SELECT json_valid('" \\ "'); } {1} -do_execsql_test json-10.62 { +do_execsql_test json101-10.62 { SELECT json_valid('" \] "'); } {0} -do_execsql_test json-10.63 { +do_execsql_test json101-10.63 { SELECT json_valid('" \^ "'); } {0} -do_execsql_test json-10.64 { +do_execsql_test json101-10.64 { SELECT json_valid('" \_ "'); } {0} -do_execsql_test json-10.65 { +do_execsql_test json101-10.65 { SELECT json_valid('" \` "'); } {0} -do_execsql_test json-10.66 { +do_execsql_test json101-10.66 { SELECT json_valid('" \a "'); } {0} -do_execsql_test json-10.67 { +do_execsql_test json101-10.67 { SELECT json_valid('" \b "'); } {1} -do_execsql_test json-10.68 { +do_execsql_test json101-10.68 { SELECT json_valid('" \c "'); } {0} -do_execsql_test json-10.69 { +do_execsql_test json101-10.69 { SELECT json_valid('" \d "'); } {0} -do_execsql_test json-10.70 { +do_execsql_test json101-10.70 { SELECT json_valid('" \e "'); } {0} -do_execsql_test json-10.71 { +do_execsql_test json101-10.71 { SELECT json_valid('" \f "'); } {1} -do_execsql_test json-10.72 { +do_execsql_test json101-10.72 { SELECT json_valid('" \g "'); } {0} -do_execsql_test json-10.73 { +do_execsql_test json101-10.73 { SELECT json_valid('" \h "'); } {0} -do_execsql_test json-10.74 { +do_execsql_test json101-10.74 { SELECT json_valid('" \i "'); } {0} -do_execsql_test json-10.75 { +do_execsql_test json101-10.75 { SELECT json_valid('" \j "'); } {0} -do_execsql_test json-10.76 { +do_execsql_test json101-10.76 { SELECT json_valid('" \k "'); } {0} -do_execsql_test json-10.77 { +do_execsql_test json101-10.77 { SELECT json_valid('" \l "'); } {0} -do_execsql_test json-10.78 { +do_execsql_test json101-10.78 { SELECT json_valid('" \m "'); } {0} -do_execsql_test json-10.79 { +do_execsql_test json101-10.79 { SELECT json_valid('" \n "'); } {1} -do_execsql_test json-10.80 { +do_execsql_test json101-10.80 { SELECT json_valid('" \o "'); } {0} -do_execsql_test json-10.81 { +do_execsql_test json101-10.81 { SELECT json_valid('" \p "'); } {0} -do_execsql_test json-10.82 { +do_execsql_test json101-10.82 { SELECT json_valid('" \q "'); } {0} -do_execsql_test json-10.83 { +do_execsql_test json101-10.83 { SELECT json_valid('" \r "'); } {1} -do_execsql_test json-10.84 { +do_execsql_test json101-10.84 { SELECT json_valid('" \s "'); } {0} -do_execsql_test json-10.85 { +do_execsql_test json101-10.85 { SELECT json_valid('" \t "'); } {1} -do_execsql_test json-10.86.0 { +do_execsql_test json101-10.86.0 { SELECT json_valid('" \u "'); } {0} -do_execsql_test json-10.86.1 { +do_execsql_test json101-10.86.1 { SELECT json_valid('" \ua "'); } {0} -do_execsql_test json-10.86.2 { +do_execsql_test json101-10.86.2 { SELECT json_valid('" \uab "'); } {0} -do_execsql_test json-10.86.3 { +do_execsql_test json101-10.86.3 { SELECT json_valid('" \uabc "'); } {0} -do_execsql_test json-10.86.4 { +do_execsql_test json101-10.86.4 { SELECT json_valid('" \uabcd "'); } {1} -do_execsql_test json-10.86.5 { +do_execsql_test json101-10.86.5 { SELECT json_valid('" \uFEDC "'); } {1} -do_execsql_test json-10.86.6 { +do_execsql_test json101-10.86.6 { SELECT json_valid('" \u1234 "'); } {1} -do_execsql_test json-10.87 { +do_execsql_test json101-10.87 { SELECT json_valid('" \v "'); } {0} -do_execsql_test json-10.88 { +do_execsql_test json101-10.88 { SELECT json_valid('" \w "'); } {0} -do_execsql_test json-10.89 { +do_execsql_test json101-10.89 { SELECT json_valid('" \x "'); } {0} -do_execsql_test json-10.90 { +do_execsql_test json101-10.90 { SELECT json_valid('" \y "'); } {0} -do_execsql_test json-10.91 { +do_execsql_test json101-10.91 { SELECT json_valid('" \z "'); } {0} -do_execsql_test json-10.92 { +do_execsql_test json101-10.92 { SELECT json_valid('" \{ "'); } {0} -do_execsql_test json-10.93 { +do_execsql_test json101-10.93 { SELECT json_valid('" \| "'); } {0} -do_execsql_test json-10.94 { +do_execsql_test json101-10.94 { SELECT json_valid('" \} "'); } {0} -do_execsql_test json-10.95 { +do_execsql_test json101-10.95 { SELECT json_valid('" \~ "'); } {0} @@ -719,20 +719,20 @@ do_execsql_test json-10.95 { # # The following tests confirm that deeply nested JSON is considered invalid. # -do_execsql_test json-11.0 { +do_execsql_test json101-11.0 { /* Shallow enough to be parsed */ SELECT json_valid(printf('%.1000c0%.1000c','[',']')); } {1} -do_execsql_test json-11.1 { +do_execsql_test json101-11.1 { /* Too deep by one */ SELECT json_valid(printf('%.1001c0%.1001c','[',']')); } {0} -do_execsql_test json-11.2 { +do_execsql_test json101-11.2 { /* Shallow enough to be parsed { */ SELECT json_valid(replace(printf('%.1000c0%.1000c','[','}'),'[','{"a":')); /* } */ } {1} -do_execsql_test json-11.3 { +do_execsql_test json101-11.3 { /* Too deep by one { */ SELECT json_valid(replace(printf('%.1001c0%.1001c','[','}'),'[','{"a":')); /* } */ @@ -742,7 +742,7 @@ do_execsql_test json-11.3 { # a json structure even though the element name constains a "." # character, by quoting the element name in the path. # -do_execsql_test json-12.100 { +do_execsql_test json101-12.100 { CREATE TABLE t12(x); INSERT INTO t12(x) VALUES( '{"settings": @@ -766,11 +766,11 @@ do_execsql_test json-12.100 { } }'); } {} -do_execsql_test json-12.110 { +do_execsql_test json101-12.110 { SELECT json_remove(x, '$.settings.layer2."dis.legomenon".forceDisplay') FROM t12; } {{{"settings":{"layer2":{"hapax.legomenon":{"forceDisplay":true,"transliterate":true,"add.footnote":true,"summary.report":true},"dis.legomenon":{"transliterate":false,"add.footnote":false,"summary.report":true},"tris.legomenon":{"forceDisplay":true,"transliterate":false,"add.footnote":false,"summary.report":false}}}}}} -do_execsql_test json-12.120 { +do_execsql_test json101-12.120 { SELECT json_extract(x, '$.settings.layer2."tris.legomenon"."summary.report"') FROM t12; } {0} @@ -779,7 +779,7 @@ do_execsql_test json-12.120 { # ticket https://www.sqlite.org/src/tktview/80177f0c226ff54f6ddd41 # Make sure the query planner knows about the arguments to table-valued functions. # -do_execsql_test json-13.100 { +do_execsql_test json101-13.100 { DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t2; CREATE TABLE t1(id, json); @@ -794,7 +794,7 @@ do_execsql_test json-13.100 { WHERE EXISTS(SELECT 1 FROM json_each(t1.json,'$.items') AS Z WHERE Z.value==t2.id); } {1 {{"items":[3,5]}} 3 {{"value":3}} 1 {{"items":[3,5]}} 5 {{"value":5}}} -do_execsql_test json-13.110 { +do_execsql_test json101-13.110 { SELECT * FROM t2 CROSS JOIN t1 WHERE EXISTS(SELECT 1 FROM json_each(t1.json,'$.items') AS Z WHERE Z.value==t2.id); @@ -804,28 +804,28 @@ do_execsql_test json-13.110 { # Incorrect fullkey output from json_each() # when the input JSON is not an array or object. # -do_execsql_test json-14.100 { +do_execsql_test json101-14.100 { SELECT fullkey FROM json_each('123'); } {$} -do_execsql_test json-14.110 { +do_execsql_test json101-14.110 { SELECT fullkey FROM json_each('123.56'); } {$} -do_execsql_test json-14.120 { +do_execsql_test json101-14.120 { SELECT fullkey FROM json_each('"hello"'); } {$} -do_execsql_test json-14.130 { +do_execsql_test json101-14.130 { SELECT fullkey FROM json_each('null'); } {$} -do_execsql_test json-14.140 { +do_execsql_test json101-14.140 { SELECT fullkey FROM json_tree('123'); } {$} -do_execsql_test json-14.150 { +do_execsql_test json101-14.150 { SELECT fullkey FROM json_tree('123.56'); } {$} -do_execsql_test json-14.160 { +do_execsql_test json101-14.160 { SELECT fullkey FROM json_tree('"hello"'); } {$} -do_execsql_test json-14.170 { +do_execsql_test json101-14.170 { SELECT fullkey FROM json_tree('null'); } {$} @@ -835,16 +835,16 @@ do_execsql_test json-14.170 { # # Bug reported via private email. See TH3 for more information. # -do_execsql_test json-15.100 { +do_execsql_test json101-15.100 { SELECT * FROM JSON_EACH('{"a":1, "b":2}'); } {a 1 integer 1 2 {} {$.a} {$} b 2 integer 2 4 {} {$.b} {$}} -do_execsql_test json-15.110 { +do_execsql_test json101-15.110 { SELECT xyz.* FROM JSON_EACH('{"a":1, "b":2}') AS xyz; } {a 1 integer 1 2 {} {$.a} {$} b 2 integer 2 4 {} {$.b} {$}} -do_execsql_test json-15.120 { +do_execsql_test json101-15.120 { SELECT * FROM (JSON_EACH('{"a":1, "b":2}')); } {a 1 integer 1 2 {} {$.a} {$} b 2 integer 2 4 {} {$.b} {$}} -do_execsql_test json-15.130 { +do_execsql_test json101-15.130 { SELECT xyz.* FROM (JSON_EACH('{"a":1, "b":2}')) AS xyz; } {a 1 integer 1 2 {} {$.a} {$} b 2 integer 2 4 {} {$.b} {$}} @@ -852,18 +852,18 @@ do_execsql_test json-15.130 { # Mailing list bug report on the handling of surrogate pairs # in JSON. # -do_execsql_test json-16.10 { +do_execsql_test json101-16.10 { SELECT length(json_extract('"abc\uD834\uDD1Exyz"','$')); } {7} -do_execsql_test json-16.20 { +do_execsql_test json101-16.20 { SELECT length(json_extract('"\uD834\uDD1E"','$')); } {1} -do_execsql_test json-16.30 { +do_execsql_test json101-16.30 { SELECT unicode(json_extract('"\uD834\uDD1E"','$')); } {119070} # 2022-01-30 dbsqlfuzz 4678cf825d27f87c9b8343720121e12cf944b71a -do_execsql_test json-17.1 { +do_execsql_test json101-17.1 { DROP TABLE IF EXISTS t1; DROP TABLE IF EXISTS t2; CREATE TABLE t1(a,b,c); @@ -872,19 +872,19 @@ do_execsql_test json-17.1 { } {} # 2022-04-04 forum post https://sqlite.org/forum/forumpost/c082aeab43 -do_execsql_test json-18.1 { +do_execsql_test json101-18.1 { SELECT json_valid('{"":5}'); } {1} -do_execsql_test json-18.2 { +do_execsql_test json101-18.2 { SELECT json_extract('{"":5}', '$.""'); } {5} -do_execsql_test json-18.3 { +do_execsql_test json101-18.3 { SELECT json_extract('[3,{"a":4,"":[5,{"hi":6},7]},8]', '$[1].""[1].hi'); } {6} -do_execsql_test json-18.4 { +do_execsql_test json101-18.4 { SELECT json_extract('[3,{"a":4,"":[5,{"hi":6},7]},8]', '$[1].""[1]."hi"'); } {6} -do_catchsql_test json-18.5 { +do_catchsql_test json101-18.5 { SELECT json_extract('{"":8}', '$.'); } {1 {JSON path error near ''}} @@ -893,28 +893,28 @@ do_catchsql_test json-18.5 { # a problem with transaction control. But the json() function makes # the problem more easily accessible, so it is tested here. # -do_execsql_test json-19.1 { +do_execsql_test json101-19.1 { DROP TABLE IF EXISTS t1; CREATE TABLE t1(x); } {} -do_catchsql_test json-19.2 { +do_catchsql_test json101-19.2 { BEGIN; INSERT INTO t1 VALUES(0), (json('not-valid-json')); } {1 {malformed JSON}} -do_execsql_test json-19.3 { +do_execsql_test json101-19.3 { COMMIT; SELECT * FROM t1; } {} # 2023-03-17 positive and negative infinities # -do_execsql_test json-20.1 { +do_execsql_test json101-20.1 { SELECT json_object('a',2e370,'b',-3e380); } {{{"a":9.0e+999,"b":-9.0e+999}}} -do_execsql_test json-20.2 { +do_execsql_test json101-20.2 { SELECT json_object('a',2e370,'b',-3e380)->>'a'; } Inf -do_execsql_test json-20.3 { +do_execsql_test json101-20.3 { SELECT json_object('a',2e370,'b',-3e380)->>'b'; } {-Inf} @@ -924,91 +924,91 @@ do_execsql_test json-20.3 { # db null NULL if {[db exists {SELECT * FROM pragma_compile_options WHERE compile_options LIKE '%legacy_json_valid%'}]} { - do_execsql_test json-21.1-legacy { + do_execsql_test json101-21.1-legacy { SELECT json_valid(NULL); } 0 } else { - do_execsql_test json-21.1-correct { + do_execsql_test json101-21.1-correct { SELECT json_valid(NULL); } NULL } -do_execsql_test json-21.2 { +do_execsql_test json101-21.2 { SELECT json_error_position(NULL); } NULL -do_execsql_test json-21.3 { +do_execsql_test json101-21.3 { SELECT json(NULL); } NULL -do_execsql_test json-21.4 { +do_execsql_test json101-21.4 { SELECT json_array(NULL); } {[null]} -do_execsql_test json-21.5 { +do_execsql_test json101-21.5 { SELECT json_extract(NULL); } NULL -do_execsql_test json-21.6 { +do_execsql_test json101-21.6 { SELECT json_insert(NULL,'$',123); } NULL -do_execsql_test json-21.7 { +do_execsql_test json101-21.7 { SELECT NULL->0; } NULL -do_execsql_test json-21.8 { +do_execsql_test json101-21.8 { SELECT NULL->>0; } NULL -do_execsql_test json-21.9 { +do_execsql_test json101-21.9 { SELECT '{a:5}'->NULL; } NULL -do_execsql_test json-21.10 { +do_execsql_test json101-21.10 { SELECT '{a:5}'->>NULL; } NULL -do_catchsql_test json-21.11 { +do_catchsql_test json101-21.11 { SELECT json_object(NULL,5); } {1 {json_object() labels must be TEXT}} -do_execsql_test json-21.12 { +do_execsql_test json101-21.12 { SELECT json_patch(NULL,'{a:5}'); } NULL -do_execsql_test json-21.13 { +do_execsql_test json101-21.13 { SELECT json_patch('{a:5}',NULL); } NULL -do_execsql_test json-21.14 { +do_execsql_test json101-21.14 { SELECT json_patch(NULL,NULL); } NULL -do_execsql_test json-21.15 { +do_execsql_test json101-21.15 { SELECT json_remove(NULL,'$'); } NULL -do_execsql_test json-21.16 { +do_execsql_test json101-21.16 { SELECT json_remove('{a:5,b:7}',NULL); } NULL -do_execsql_test json-21.17 { +do_execsql_test json101-21.17 { SELECT json_replace(NULL,'$.a',123); } NULL -do_execsql_test json-21.18 { +do_execsql_test json101-21.18 { SELECT json_replace('{a:5,b:7}',NULL,NULL); } {{{"a":5,"b":7}}} -do_execsql_test json-21.19 { +do_execsql_test json101-21.19 { SELECT json_set(NULL,'$.a',123); } NULL -do_execsql_test json-21.20 { +do_execsql_test json101-21.20 { SELECT json_set('{a:5,b:7}',NULL,NULL); } {{{"a":5,"b":7}}} -do_execsql_test json-21.21 { +do_execsql_test json101-21.21 { SELECT json_type(NULL); } NULL -do_execsql_test json-21.22 { +do_execsql_test json101-21.22 { SELECT json_type('{a:5,b:7}',NULL); } NULL -do_execsql_test json-21.23 { +do_execsql_test json101-21.23 { SELECT json_quote(NULL); } null -do_execsql_test json-21.24 { +do_execsql_test json101-21.24 { SELECT count(*) FROM json_each(NULL); } 0 -do_execsql_test json-21.25 { +do_execsql_test json101-21.25 { SELECT count(*) FROM json_tree(NULL); } 0 -do_execsql_test json-21.26 { +do_execsql_test json101-21.26 { WITH c(x) AS (VALUES(1),(2.0),(NULL),('three')) SELECT json_group_array(x) FROM c; } {[1,2.0,null,"three"]} -do_execsql_test json-21.27 { +do_execsql_test json101-21.27 { WITH c(x,y) AS (VALUES('a',1),('b',2.0),('c',NULL),(NULL,'three'),('e','four')) SELECT json_group_object(x,y) FROM c; } {{{"a":1,"b":2.0,"c":null,:"three","e":"four"}}} From 699803e1146787d17a691278a35e597ce7b8fb8d Mon Sep 17 00:00:00 2001 From: dan Date: Thu, 17 Aug 2023 16:06:17 +0000 Subject: [PATCH 24/32] Add "Windows-Sanitize" configuration to "testrunner.tcl release" tests on windows. FossilOrigin-Name: e68b46dc6aff48c81a2a5e7662d0f694615b64aa50bcfee9a0b8b25fa4e5f33d --- manifest | 12 ++++++------ manifest.uuid | 2 +- test/testrunner_data.tcl | 8 +++++++- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/manifest b/manifest index 8bbbd17875..cc8905fb44 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Have\sall\stest\snames\sin\sjson101.test\sstart\swith\s"json101". -D 2023-08-17T15:14:43.433 +C Add\s"Windows-Sanitize"\sconfiguration\sto\s"testrunner.tcl\srelease"\stests\son\swindows. +D 2023-08-17T16:06:17.814 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -1604,7 +1604,7 @@ F test/temptable3.test d11a0974e52b347e45ee54ef1923c91ed91e4637 F test/temptrigger.test 38f0ca479b1822d3117069e014daabcaacefffcc F test/tester.tcl 68454ef88508c196d19e8694daa27bff7107a91857799eaa12f417188ae53ede F test/testrunner.tcl 56a744d4e6e516b2091c2ca6b7b27b9600e9ded136a2c860c350515511ebe20a -F test/testrunner_data.tcl 0f167aa9e9a640f2f19e5d99bc99016c236526a6a8eb36432e445df1983a8548 +F test/testrunner_data.tcl 8afa4eeec7f7421db3d3af64cdd5544015e887c4289cf871a730cca5a7a8d934 F test/thread001.test a0985c117eab62c0c65526e9fa5d1360dd1cac5b03bde223902763274ce21899 F test/thread002.test c24c83408e35ba5a952a3638b7ac03ccdf1ce4409289c54a050ac4c5f1de7502 F test/thread003.test ee4c9efc3b86a6a2767516a37bd64251272560a7 @@ -2092,8 +2092,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 3eaadaff85111103c9441a9d6cd31291b95db9f3a6ec7003e0ff4ce5db7490da -R 048665a7accd06e0bff1d365377ae82b +P af56d7b6b9c50f2541a51fcb7d94b89aafba4f343a9103b21a15aad3f283c63e +R d90e68742664d72e56df500f0aaeb929 U dan -Z e718fd03ed4d1cee7bc3d4e08526fc0a +Z fef403ae8dc9c09fddbddb3b0dc476a8 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 076583930a..c0ab5c10c3 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -af56d7b6b9c50f2541a51fcb7d94b89aafba4f343a9103b21a15aad3f283c63e \ No newline at end of file +e68b46dc6aff48c81a2a5e7662d0f694615b64aa50bcfee9a0b8b25fa4e5f33d \ No newline at end of file diff --git a/test/testrunner_data.tcl b/test/testrunner_data.tcl index 040deecacf..c75b7c9d66 100644 --- a/test/testrunner_data.tcl +++ b/test/testrunner_data.tcl @@ -36,6 +36,7 @@ namespace eval trd { set tcltest(win.Have-Not) veryquick set tcltest(win.Windows-Memdebug) veryquick set tcltest(win.Windows-Win32Heap) veryquick + set tcltest(win.Windows-Sanitize) veryquick set tcltest(win.Default) full # Extra [make xyz] tests that should be run for various builds. @@ -64,6 +65,7 @@ namespace eval trd { set extra(win.Stdcall) {fuzztest sourcetest} set extra(win.Windows-Memdebug) {fuzztest sourcetest} set extra(win.Windows-Win32Heap) {fuzztest sourcetest} + set extra(win.Windows-Sanitize) fuzztest set extra(win.Have-Not) {fuzztest sourcetest} # The following mirrors the set of test suites invoked by "all.test". @@ -311,6 +313,10 @@ namespace eval trd { WIN32HEAP=1 DEBUG=4 } + set build(Windows-Sanitize) { + ASAN=1 + } + } @@ -421,7 +427,7 @@ proc make_bat_file {srcdir opts cflags makeOpts} { return [trimscript [subst -nocommands { set TARGET=%1 set TMP=%CD% - nmake /f $srcdir\\Makefile.msc TOP="$srcdir" %TARGET% "CFLAGS=$cflags" "OPTS=$opts" $makeOpts + nmake /f $srcdir\\Makefile.msc TOP="$srcdir" %TARGET% "CCOPTS=$cflags" "OPTS=$opts" $makeOpts }]] } From fab6882fd637350ea7789d893ce3e0b147c87136 Mon Sep 17 00:00:00 2001 From: dan Date: Thu, 17 Aug 2023 16:49:06 +0000 Subject: [PATCH 25/32] Add extra test to fts5synonym2.test. FossilOrigin-Name: 39ea11be3b35c5ecde9bc0fe66af673b8f440dc523422887d05a29feef036b01 --- ext/fts5/test/fts5synonym2.test | 3 +++ manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ext/fts5/test/fts5synonym2.test b/ext/fts5/test/fts5synonym2.test index 8bbfb07566..2c2705e34f 100644 --- a/ext/fts5/test/fts5synonym2.test +++ b/ext/fts5/test/fts5synonym2.test @@ -122,6 +122,9 @@ foreach {tn expr} { 4.1 "NEAR(one two, 2)" 4.2 "NEAR(one two three, 2)" 4.3 "NEAR(eight nine, 1) OR NEAR(six seven, 1)" + + 5.1 "one + two" + 5.2 "1 + two" } { if {[fts5_expr_ok $expr ss]==0} { do_test 1.$tok.$tn.OMITTED { list } [list] diff --git a/manifest b/manifest index cc8905fb44..616077cf1c 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\s"Windows-Sanitize"\sconfiguration\sto\s"testrunner.tcl\srelease"\stests\son\swindows. -D 2023-08-17T16:06:17.814 +C Add\sextra\stest\sto\sfts5synonym2.test. +D 2023-08-17T16:49:06.059 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -208,7 +208,7 @@ F ext/fts5/test/fts5simple.test a298670508c1458b88ce6030440f26a30673931884eb5f40 F ext/fts5/test/fts5simple2.test 258a1b0c590409bfa5271e872c79572b319d2a56554d0585f68f146a0da603f0 F ext/fts5/test/fts5simple3.test d5c74a9d3ca71bd5dd5cacb7c55b86ea12cdddfc8b1910e3de2995206898380f F ext/fts5/test/fts5synonym.test 1651815b8008de170e8e600dcacc17521d765482ea8f074ae82cfa870d8bb7fb -F ext/fts5/test/fts5synonym2.test b54cce5c34ec08ed616f646635538ae82e34a0e28f947ec60b6fadbc4b3fb17a +F ext/fts5/test/fts5synonym2.test 8f891fc49cc1e8daed727051e77e1f42849c784a6a54bef82564761b2cb3e016 F ext/fts5/test/fts5tok1.test 1f7817499f5971450d8c4a652114b3d833393c8134e32422d0af27884ffe9cef F ext/fts5/test/fts5tok2.test dcacb32d4a2a3f0dd3215d4a3987f78ae4be21a2 F ext/fts5/test/fts5tokenizer.test ac3c9112b263a639fb0508ae73a3ee886bf4866d2153771a8e8a20c721305a43 @@ -2092,8 +2092,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 af56d7b6b9c50f2541a51fcb7d94b89aafba4f343a9103b21a15aad3f283c63e -R d90e68742664d72e56df500f0aaeb929 +P e68b46dc6aff48c81a2a5e7662d0f694615b64aa50bcfee9a0b8b25fa4e5f33d +R 26e2590c5d1b954c8cedf1e3d265e54c U dan -Z fef403ae8dc9c09fddbddb3b0dc476a8 +Z 404f8e6bb7390152a8536e11ff091661 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index c0ab5c10c3..72b0492243 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e68b46dc6aff48c81a2a5e7662d0f694615b64aa50bcfee9a0b8b25fa4e5f33d \ No newline at end of file +39ea11be3b35c5ecde9bc0fe66af673b8f440dc523422887d05a29feef036b01 \ No newline at end of file From e15b35d5a61ef7fd58d6d050a9c91ea7004d6e38 Mon Sep 17 00:00:00 2001 From: dan Date: Thu, 17 Aug 2023 16:59:35 +0000 Subject: [PATCH 26/32] Fix an error in documentation comments in fts5.h. FossilOrigin-Name: 24d96bd65d8ccdd50a6f4fe217d196728a2f8658d128f9352c287f64e034104a --- ext/fts5/fts5.h | 4 ++-- manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ext/fts5/fts5.h b/ext/fts5/fts5.h index 2309460f02..323d73a28f 100644 --- a/ext/fts5/fts5.h +++ b/ext/fts5/fts5.h @@ -492,8 +492,8 @@ struct Fts5ExtensionApi { ** as separate queries of the FTS index are required for each synonym. ** ** When using methods (2) or (3), it is important that the tokenizer only -** provide synonyms when tokenizing document text (method (2)) or query -** text (method (3)), not both. Doing so will not cause any errors, but is +** provide synonyms when tokenizing document text (method (3)) or query +** text (method (2)), not both. Doing so will not cause any errors, but is ** inefficient. */ typedef struct Fts5Tokenizer Fts5Tokenizer; diff --git a/manifest b/manifest index 616077cf1c..a71ea83ccc 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Add\sextra\stest\sto\sfts5synonym2.test. -D 2023-08-17T16:49:06.059 +C Fix\san\serror\sin\sdocumentation\scomments\sin\sfts5.h. +D 2023-08-17T16:59:35.149 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -86,7 +86,7 @@ F ext/fts3/unicode/UnicodeData.txt cd07314edb62d49fde34debdaf92fa2aa69011e7 F ext/fts3/unicode/mkunicode.tcl d5aebf022fa4577ee8cdf27468f0d847879993959101f6dbd6348ef0cfc324a7 F ext/fts3/unicode/parseunicode.tcl a981bd6466d12dd17967515801c3ff23f74a281be1a03cf1e6f52a6959fc77eb F ext/fts5/extract_api_docs.tcl a36e54ec777172ddd3f9a88daf593b00848368e0 -F ext/fts5/fts5.h 9bebc9fb8b75b0777e741c758540e07c3c80ce75204198979028fe6cc4c59486 +F ext/fts5/fts5.h 05501612cc655504c5dce8ba765ab621d50fc478490089beaa0d75e00b23e520 F ext/fts5/fts5Int.h 78a63cc0795186cde5384816a9403a68c65774b35d952e05b81a1b4b158e07c8 F ext/fts5/fts5_aux.c 572d5ec92ba7301df2fea3258576332f2f4d2dfd66d8263afd157d9deceac480 F ext/fts5/fts5_buffer.c 3001fbabb585d6de52947b44b455235072b741038391f830d6b729225eeaf6a5 @@ -2092,8 +2092,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 e68b46dc6aff48c81a2a5e7662d0f694615b64aa50bcfee9a0b8b25fa4e5f33d -R 26e2590c5d1b954c8cedf1e3d265e54c +P 39ea11be3b35c5ecde9bc0fe66af673b8f440dc523422887d05a29feef036b01 +R abab5dc6334bf1a1bead623b5134e5ba U dan -Z 404f8e6bb7390152a8536e11ff091661 +Z 9416e12f401c5487e4229907a7abf2dc # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 72b0492243..2f944fee9d 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -39ea11be3b35c5ecde9bc0fe66af673b8f440dc523422887d05a29feef036b01 \ No newline at end of file +24d96bd65d8ccdd50a6f4fe217d196728a2f8658d128f9352c287f64e034104a \ No newline at end of file From 2e0ce58d2cfa6d866f40bdd4bb5330ca4c4225c2 Mon Sep 17 00:00:00 2001 From: drh <> Date: Thu, 17 Aug 2023 17:48:20 +0000 Subject: [PATCH 27/32] Do not allow bound parameters in the ON CONFLICT clause of an UPSERT. dbsqlfuzz 9983e2c77634a8ccf33b5c91fa9982599de5f9e9 FossilOrigin-Name: 3c06709335eb4b98e3a684e3ebbae69eeb6a21b452bce29159c82bb632d6a042 --- manifest | 16 ++++++++-------- manifest.uuid | 2 +- src/upsert.c | 2 +- test/upsert1.test | 13 +++++++++++++ 4 files changed, 23 insertions(+), 10 deletions(-) diff --git a/manifest b/manifest index a71ea83ccc..48f6ee7dba 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\san\serror\sin\sdocumentation\scomments\sin\sfts5.h. -D 2023-08-17T16:59:35.149 +C Do\snot\sallow\sbound\sparameters\sin\sthe\sON\sCONFLICT\sclause\sof\san\sUPSERT.\ndbsqlfuzz\s9983e2c77634a8ccf33b5c91fa9982599de5f9e9 +D 2023-08-17T17:48:20.472 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -750,7 +750,7 @@ F src/tokenize.c 23d9f4539880b40226254ad9072f4ecf12eb1902e62aea47aac29928afafcfd F src/treeview.c 1d52fbc4e97161e65858d36e3424ea6e3fc045dd8a679c82b4b9593dc30de3bd F src/trigger.c ad6ab9452715fa9a8075442e15196022275b414b9141b566af8cdb7a1605f2b0 F src/update.c 6904814dd62a7a93bbb86d9f1419c7f134a9119582645854ab02b36b676d9f92 -F src/upsert.c 5303dc6c518fa7d4b280ec65170f465c7a70b7ac2b22491598f6d0b4875b3145 +F src/upsert.c fa125a8d3410ce9a97b02cb50f7ae68a2476c405c76aa692d3acf6b8586e9242 F src/utf.c ee39565f0843775cc2c81135751ddd93eceb91a673ea2c57f61c76f288b041a0 F src/util.c 24f4458bb7a57b0e1b2858484fd62ea83fe63dcb0bce21a96bf9fe31fd402038 F src/vacuum.c 604fcdaebe76f3497c855afcbf91b8fa5046b32de3045bab89cc008d68e40104 @@ -1819,7 +1819,7 @@ F test/upfrom2.test 66f3ebf721b3cebd922faee5c386bf244f816d416b57c000753ff51af623 F test/upfrom3.test 6130f24ebf97f5ea865e5d2a14a2d543fe5428a62e87cc60f62d875e45c1f5f0 F test/upfrom4.test 78f742a6577c91a7a55c64edb8811004e7c6aa99b8d57b2320f70a918c357807 F test/upfromfault.test 3a10075a0043f0c4fad6614b2c371f88a8ba5a4acab68b907438413865d6a8d6 -F test/upsert1.test b0ae2f58680c5205b4bc1cdeed3c3d444057c506f6c44494fa3eac60731d68a2 +F test/upsert1.test a512e2f884d3a36159fce2e45108c236f78ae38e35bda55f4050db580ceb25d3 F test/upsert2.test 720e94d09f7362a282bc69b3c6b83d51daeaaf0440eb4920a08b86518b8c7496 F test/upsert3.test 88d7d590a1948a9cb6eac1b54b0642f67a9f35a1fc0f19b200e97d5d39e3179c F test/upsert4.test 25d2a1da92f149331ae0c51ca6e3eee78189577585eab92de149900d62994fa5 @@ -2092,8 +2092,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 39ea11be3b35c5ecde9bc0fe66af673b8f440dc523422887d05a29feef036b01 -R abab5dc6334bf1a1bead623b5134e5ba -U dan -Z 9416e12f401c5487e4229907a7abf2dc +P 24d96bd65d8ccdd50a6f4fe217d196728a2f8658d128f9352c287f64e034104a +R 72669b014bf41c72224f93b52bdb3a8f +U drh +Z 40e3bdaa3753eb1f16c29d787d46c397 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 2f944fee9d..27c598553b 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -24d96bd65d8ccdd50a6f4fe217d196728a2f8658d128f9352c287f64e034104a \ No newline at end of file +3c06709335eb4b98e3a684e3ebbae69eeb6a21b452bce29159c82bb632d6a042 \ No newline at end of file diff --git a/src/upsert.c b/src/upsert.c index 85994020cf..be0d0550df 100644 --- a/src/upsert.c +++ b/src/upsert.c @@ -178,7 +178,7 @@ int sqlite3UpsertAnalyzeTarget( pExpr = &sCol[0]; } for(jj=0; jja[jj].pExpr,pExpr,iCursor)<2 ){ + if( sqlite3ExprCompare(0,pTarget->a[jj].pExpr,pExpr,iCursor)<2 ){ break; /* Column ii of the index matches column jj of target */ } } diff --git a/test/upsert1.test b/test/upsert1.test index a321d6171d..7818311330 100644 --- a/test/upsert1.test +++ b/test/upsert1.test @@ -255,4 +255,17 @@ do_execsql_test upsert1-1100 { SELECT * FROM t1; } {1 22} +# 2023-08-17 dbsqlfuzz 9983e2c77634a8ccf33b5c91fa9982599de5f9e9 +# Bound parameters in the ON CONFLICT clause of an UPSERT. +# +reset_db +do_execsql_test upsert1-1200 { + CREATE TABLE t1(a INT, b INT); + CREATE UNIQUE INDEX t1x ON t1(b+3); +} +sqlite3_db_config db ENABLE_QPSG 1 +do_catchsql_test upsert1-1210 { + INSERT INTO t1(a,b) VALUES(1,2) ON CONFLICT(b+?1) DO NOTHING; +} {1 {ON CONFLICT clause does not match any PRIMARY KEY or UNIQUE constraint}} + finish_test From 2cffc5be2aeccfae4506693874a3eb127a850bfc Mon Sep 17 00:00:00 2001 From: drh <> Date: Fri, 18 Aug 2023 11:36:33 +0000 Subject: [PATCH 28/32] Enhance the notes on compiling for Windows11 to explain how to do 32-bit builds on a 64-bit system. FossilOrigin-Name: dd749e4042bdffb20fe71dd2dba91eab5edc32e4b2773c2fadba43cb54027a17 --- doc/compile-for-windows.md | 23 +++++++++++++++++++++++ manifest | 12 ++++++------ manifest.uuid | 2 +- 3 files changed, 30 insertions(+), 7 deletions(-) diff --git a/doc/compile-for-windows.md b/doc/compile-for-windows.md index b4f8e04c5c..84b0abe49e 100644 --- a/doc/compile-for-windows.md +++ b/doc/compile-for-windows.md @@ -60,3 +60,26 @@ canonical source on a new Windows 11 PC, as of 2023-08-16:
  • `nmake /f makefile.msc devtest`
  • `nmake /f makefile.msc releasetest` + +## 32-bit Builds + +Doing a 32-bit build is just like doing a 64-bit build with the +following minor changes: + + 1. Use the "x86 Native Tools Command Prompt" instead of + "x64 Native Tools Command Prompt". "**x86**" instead of "**x64**". + + 2. Use a different installation directory for TCL. + The recommended directory is `c:\tcl32`. Thus you end up + with two TCL builds: +
      +
    • `c:\tcl` ← 64-bit (the default) +
    • `c:\tcl32` ← 32-bit +
    + + 3. Ensure that c:\\tcl32\\bin comes before c:\\tcl\\bin on + your PATH environment variable. You can achieve this using + a command like: +
      +
    • `set PATH=c:\tcl32\bin;%PATH%` +
    diff --git a/manifest b/manifest index 48f6ee7dba..c0af19f4ad 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Do\snot\sallow\sbound\sparameters\sin\sthe\sON\sCONFLICT\sclause\sof\san\sUPSERT.\ndbsqlfuzz\s9983e2c77634a8ccf33b5c91fa9982599de5f9e9 -D 2023-08-17T17:48:20.472 +C Enhance\sthe\snotes\son\scompiling\sfor\sWindows11\sto\sexplain\show\sto\sdo\n32-bit\sbuilds\son\sa\s64-bit\ssystem. +D 2023-08-18T11:36:33.593 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -37,7 +37,7 @@ F configure 9dc3300339f4d6b3c3b108de60cc6ae6b3c547e25c7e6df280b4775db4de3a1b x F configure.ac 4654d32ac0a0d0b48f1e1e79bdc3d777b723cf2f63c33eb1d7c4ed8b435938e8 F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad F doc/F2FS.txt c1d4a0ae9711cfe0e1d8b019d154f1c29e0d3abfe820787ba1e9ed7691160fcd -F doc/compile-for-windows.md a342ac53d5d38fc220cc643c4e0a8c0966bd6caa569f3d927cf10844f5f0aaca +F doc/compile-for-windows.md e9d49959f44114a35dbec66f6aa5c3688ea9cb1b3f969a8537cd80b86d8969f7 F doc/json-enhancements.md e356fc834781f1f1aa22ee300027a270b2c960122468499bf347bb123ce1ea4f F doc/lemon.html d2862dbef72496e87f7996f37e814b146848190a742c12161d13fd15346051b0 F doc/pager-invariants.txt 27fed9a70ddad2088750c4a2b493b63853da2710 @@ -2092,8 +2092,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 24d96bd65d8ccdd50a6f4fe217d196728a2f8658d128f9352c287f64e034104a -R 72669b014bf41c72224f93b52bdb3a8f +P 3c06709335eb4b98e3a684e3ebbae69eeb6a21b452bce29159c82bb632d6a042 +R 5286e789edef31734778a59dd4048b53 U drh -Z 40e3bdaa3753eb1f16c29d787d46c397 +Z a68f0d67c5ca7757b723ad9a4597974a # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 27c598553b..2934ce1fcb 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -3c06709335eb4b98e3a684e3ebbae69eeb6a21b452bce29159c82bb632d6a042 \ No newline at end of file +dd749e4042bdffb20fe71dd2dba91eab5edc32e4b2773c2fadba43cb54027a17 \ No newline at end of file From f0eabde9a4ef6d3e43834044eba2b4d71b679fb6 Mon Sep 17 00:00:00 2001 From: drh <> Date: Fri, 18 Aug 2023 12:15:44 +0000 Subject: [PATCH 29/32] Enhance the CLI and the fuzzcheck utility programs to report whether they are compiled as 32-bit or 64-bit for things like the --version option. FossilOrigin-Name: ec7eeb055bfb0e5a4467d8a45fa53d84bb8ae80ca0474b687e2783e971648008 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/shell.c.in | 10 ++++++---- test/fuzzcheck.c | 9 ++++++--- 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/manifest b/manifest index c0af19f4ad..9f61c54ba4 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Enhance\sthe\snotes\son\scompiling\sfor\sWindows11\sto\sexplain\show\sto\sdo\n32-bit\sbuilds\son\sa\s64-bit\ssystem. -D 2023-08-18T11:36:33.593 +C Enhance\sthe\sCLI\sand\sthe\sfuzzcheck\sutility\sprograms\sto\sreport\swhether\sthey\nare\scompiled\sas\s32-bit\sor\s64-bit\sfor\sthings\slike\sthe\s--version\soption. +D 2023-08-18T12:15:44.137 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -685,7 +685,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c F src/resolve.c 37953a5f36c60bea413c3c04efcd433b6177009f508ef2ace0494728912fe2e9 F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97 F src/select.c 5f545a2c8702d4d3430bbb188cfec47d6c122d899061ef00cbe56af14591c574 -F src/shell.c.in 0c3dd37ab2787a63f1e1c1b7160647c5d3276d9ac941890b2735a773a7495d27 +F src/shell.c.in 40340c504bfda5708322cbab64b518510a06483abb6dda2f3baa7956a89241a4 F src/sqlite.h.in 73a366c1c45d5ac9888cfe81c458826a44498531d106cfb4f328193ab5f6f17d F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h 2f30b2671f4c03cd27a43f039e11251391066c97d11385f5f963bb40b03038ac @@ -1171,7 +1171,7 @@ F test/fuzz3.test 9c813e6613b837cb7a277b0383cd66bfa07042b4cf0317157c35852f30043c F test/fuzz4.test c229bcdb45518a89e1d208a21343e061503460ac69fae1539320a89f572eb634 F test/fuzz_common.tcl b7197de6ed1ee8250a4f82d67876f4561b42ee8cbbfc6160dcb66331bad3f830 F test/fuzz_malloc.test f348276e732e814802e39f042b1f6da6362a610af73a528d8f76898fde6b22f2 -F test/fuzzcheck.c 29a2f0237553375498f891c9487a2ef3267b47deecc5d5b4335fa37f904cb8d3 +F test/fuzzcheck.c ac8ff17018b30d6898c94d156a72223b3988921d3e999ed0579acb8e4ff83fac F test/fuzzdata1.db 3e86d9cf5aea68ddb8e27c02d7dfdaa226347426c7eb814918e4d95475bf8517 F test/fuzzdata2.db 128b3feeb78918d075c9b14b48610145a0dd4c8d6f1ca7c2870c7e425f5bf31f F test/fuzzdata3.db c6586d3e3cef0fbc18108f9bb649aa77bfc38aba @@ -2092,8 +2092,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 3c06709335eb4b98e3a684e3ebbae69eeb6a21b452bce29159c82bb632d6a042 -R 5286e789edef31734778a59dd4048b53 +P dd749e4042bdffb20fe71dd2dba91eab5edc32e4b2773c2fadba43cb54027a17 +R 721b61b17fa61306dfc38ad9b671418e U drh -Z a68f0d67c5ca7757b723ad9a4597974a +Z e031c1b6c081b3583919552c5f2bf81a # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 2934ce1fcb..cd9f301590 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -dd749e4042bdffb20fe71dd2dba91eab5edc32e4b2773c2fadba43cb54027a17 \ No newline at end of file +ec7eeb055bfb0e5a4467d8a45fa53d84bb8ae80ca0474b687e2783e971648008 \ No newline at end of file diff --git a/src/shell.c.in b/src/shell.c.in index 55a13bc116..20cd5cd2bb 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -11304,6 +11304,7 @@ static int do_meta_command(char *zLine, ShellState *p){ #endif /* SQLITE_USER_AUTHENTICATION */ if( c=='v' && cli_strncmp(azArg[0], "version", n)==0 ){ + char *zPtrSz = sizeof(void*)==8 ? "64-bit" : "32-bit"; utf8_printf(p->out, "SQLite %s %s\n" /*extra-version-info*/, sqlite3_libversion(), sqlite3_sourceid()); #if SQLITE_HAVE_ZLIB @@ -11314,11 +11315,11 @@ static int do_meta_command(char *zLine, ShellState *p){ #if defined(__clang__) && defined(__clang_major__) utf8_printf(p->out, "clang-" CTIMEOPT_VAL(__clang_major__) "." CTIMEOPT_VAL(__clang_minor__) "." - CTIMEOPT_VAL(__clang_patchlevel__) "\n"); + CTIMEOPT_VAL(__clang_patchlevel__) " (%s)\n", zPtrSz); #elif defined(_MSC_VER) - utf8_printf(p->out, "msvc-" CTIMEOPT_VAL(_MSC_VER) "\n"); + utf8_printf(p->out, "msvc-" CTIMEOPT_VAL(_MSC_VER) " (%s)\n", zPtrSz); #elif defined(__GNUC__) && defined(__VERSION__) - utf8_printf(p->out, "gcc-" __VERSION__ "\n"); + utf8_printf(p->out, "gcc-" __VERSION__ " (%s)\n", zPtrSz); #endif }else @@ -12492,7 +12493,8 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){ }else if( cli_strcmp(z,"-bail")==0 ){ /* No-op. The bail_on_error flag should already be set. */ }else if( cli_strcmp(z,"-version")==0 ){ - printf("%s %s\n", sqlite3_libversion(), sqlite3_sourceid()); + printf("%s %s (%d-bit)\n", sqlite3_libversion(), sqlite3_sourceid(), + 8*(int)sizeof(char*)); return 0; }else if( cli_strcmp(z,"-interactive")==0 ){ stdin_is_interactive = 1; diff --git a/test/fuzzcheck.c b/test/fuzzcheck.c index 76ce5af0ec..735beaba6e 100644 --- a/test/fuzzcheck.c +++ b/test/fuzzcheck.c @@ -2031,7 +2031,9 @@ int main(int argc, char **argv){ if( strcmp(z,"version")==0 ){ int ii; const char *zz; - printf("SQLite %s %s\n", sqlite3_libversion(), sqlite3_sourceid()); + printf("SQLite %s %s (%d-bit)\n", + sqlite3_libversion(), sqlite3_sourceid(), + 8*(int)sizeof(char*)); for(ii=0; (zz = sqlite3_compileoption_get(ii))!=0; ii++){ printf("%s\n", zz); } @@ -2536,9 +2538,10 @@ int main(int argc, char **argv){ printf("fuzzcheck: %u query invariants checked\n", g.nInvariant); } printf("fuzzcheck: 0 errors out of %d tests in %d.%03d seconds\n" - "SQLite %s %s\n", + "SQLite %s %s (%d-bit)\n", nTest, (int)(iElapse/1000), (int)(iElapse%1000), - sqlite3_libversion(), sqlite3_sourceid()); + sqlite3_libversion(), sqlite3_sourceid(), + 8*(int)sizeof(char*)); } free(azSrcDb); free(pHeap); From d5a9d522fb8846d9919fdacfacecd29e89be29d1 Mon Sep 17 00:00:00 2001 From: dan Date: Fri, 18 Aug 2023 15:17:52 +0000 Subject: [PATCH 30/32] Avoid running test case sort2.2.3 under address-sanitizer. It runs out of memory on some 32-bit platforms. FossilOrigin-Name: 925be7539947078547ee129b3d328ab0c59b19c6e2e5a391840f2d58f6d59acd --- manifest | 14 +++++++------- manifest.uuid | 2 +- test/sort2.test | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index 9f61c54ba4..8fc7505052 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Enhance\sthe\sCLI\sand\sthe\sfuzzcheck\sutility\sprograms\sto\sreport\swhether\sthey\nare\scompiled\sas\s32-bit\sor\s64-bit\sfor\sthings\slike\sthe\s--version\soption. -D 2023-08-18T12:15:44.137 +C Avoid\srunning\stest\scase\ssort2.2.3\sunder\saddress-sanitizer.\sIt\sruns\sout\sof\smemory\son\ssome\s32-bit\splatforms. +D 2023-08-18T15:17:52.057 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -1544,7 +1544,7 @@ F test/snapshot_up.test a0a29c4cf33475fcef07c3f8e64af795e24ab91b4cc68295863402a3 F test/soak.test 18944cf21b94a7fe0df02016a6ee1e9632bc4e8d095a0cb49d95e15d5cca2d5c F test/softheap1.test 843cd84db9891b2d01b9ab64cef3e9020f98d087 F test/sort.test f86751134159abb5e5fd4381a0d7038c91013638cd1e3fa1d7850901f6df6196 -F test/sort2.test cc23b7c19d684657559e8a55b02f7fcee03851d0 +F test/sort2.test 2f8c66402a03adebe77ce7aafca129fbf32df27d6c9b8f7a9f1b958e39f56da8 F test/sort3.test 1480ed7c4c157682542224e05e3b75faf4a149e5 F test/sort4.test cca6f4b0b5255882645bbbe346a6a9f4a5c7b6a18513a6a7bf4ac1c4761ddc19 F test/sort5.test 6b43ae0e2169b5ceed441844492e55ba7f1ae0790528395ddf7888ab3094525d @@ -2092,8 +2092,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 dd749e4042bdffb20fe71dd2dba91eab5edc32e4b2773c2fadba43cb54027a17 -R 721b61b17fa61306dfc38ad9b671418e -U drh -Z e031c1b6c081b3583919552c5f2bf81a +P ec7eeb055bfb0e5a4467d8a45fa53d84bb8ae80ca0474b687e2783e971648008 +R e11042589c02a36ddb6f96689ee2795e +U dan +Z 5746d777226734857d3cbbf5f4b6983b # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index cd9f301590..8c88c88e25 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -ec7eeb055bfb0e5a4467d8a45fa53d84bb8ae80ca0474b687e2783e971648008 \ No newline at end of file +925be7539947078547ee129b3d328ab0c59b19c6e2e5a391840f2d58f6d59acd \ No newline at end of file diff --git a/test/sort2.test b/test/sort2.test index f686654d53..9fe4b4ccf3 100644 --- a/test/sort2.test +++ b/test/sort2.test @@ -69,7 +69,7 @@ foreach {tn script} { # Because it uses so much data, this test can take 12-13 seconds even on # a modern workstation. So it is omitted from "veryquick" and other # permutations.test tests. - if {[isquick]==0} { + if {[isquick]==0 && [clang_sanitize_address]==0} { do_execsql_test $tn.3 { PRAGMA cache_size = 5; WITH r(x,y) AS ( From 4d8eb16f075e1c18f0277b9702e9507bb1657b56 Mon Sep 17 00:00:00 2001 From: drh <> Date: Fri, 18 Aug 2023 15:39:38 +0000 Subject: [PATCH 31/32] Rename the decimal_sci() function to decimal_exp(). [forum:/forumpost/fa027bb0ab|Forum post fa027bb0ab]. FossilOrigin-Name: c48f1be8cc505a7e2902c79e26c1d9a121ff5c55785ac812d2e09232b2414695 --- ext/misc/decimal.c | 6 +++--- manifest | 18 +++++++++--------- manifest.uuid | 2 +- src/util.c | 2 +- test/decimal.test | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ext/misc/decimal.c b/ext/misc/decimal.c index 06286f23fd..9365ae68b9 100644 --- a/ext/misc/decimal.c +++ b/ext/misc/decimal.c @@ -642,7 +642,7 @@ static Decimal *decimalFromDouble(double r){ /* ** SQL Function: decimal(X) -** OR: decimal_sci(X) +** OR: decimal_exp(X) ** ** Convert input X into decimal and then back into text. ** @@ -650,7 +650,7 @@ static Decimal *decimalFromDouble(double r){ ** point value is done. Or if X is an 8-byte blob, it is interpreted ** as a float and similarly expanded. ** -** The decimal_sci(X) function returns the result in scientific notation. +** The decimal_exp(X) function returns the result in exponential notation. ** decimal(X) returns a complete decimal, without the e+NNN at the end. */ static void decimalFunc( @@ -853,7 +853,7 @@ int sqlite3_decimal_init( void (*xFunc)(sqlite3_context*,int,sqlite3_value**); } aFunc[] = { { "decimal", 1, 0, decimalFunc }, - { "decimal_sci", 1, 1, decimalFunc }, + { "decimal_exp", 1, 1, decimalFunc }, { "decimal_cmp", 2, 0, decimalCmpFunc }, { "decimal_add", 2, 0, decimalAddFunc }, { "decimal_sub", 2, 0, decimalSubFunc }, diff --git a/manifest b/manifest index 8fc7505052..fb6be2f158 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Avoid\srunning\stest\scase\ssort2.2.3\sunder\saddress-sanitizer.\sIt\sruns\sout\sof\smemory\son\ssome\s32-bit\splatforms. -D 2023-08-18T15:17:52.057 +C Rename\sthe\sdecimal_sci()\sfunction\sto\sdecimal_exp().\n[forum:/forumpost/fa027bb0ab|Forum\spost\sfa027bb0ab]. +D 2023-08-18T15:39:38.045 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -334,7 +334,7 @@ F ext/misc/completion.c 6dafd7f4348eecc7be9e920d4b419d1fb2af75d938cd9c59a20cfe8b F ext/misc/compress.c 3354c77a7c8e86e07d849916000cdac451ed96500bfb5bd83b20eb61eee012c9 F ext/misc/csv.c ca8d6dafc5469639de81937cb66ae2e6b358542aba94c4f791910d355a8e7f73 F ext/misc/dbdump.c b8592f6f2da292c62991a13864a60d6c573c47a9cc58362131b9e6a64f823e01 -F ext/misc/decimal.c a61343b36672760e1d6d5b20a42cb52264db55bcd11d0a44e2e06e8ce23227e3 +F ext/misc/decimal.c 172cf81a8634e6a0f0bedaf71a8372fee63348cf5a3c4e1b78bb233c35889fdc F ext/misc/eval.c 04bc9aada78c888394204b4ed996ab834b99726fb59603b0ee3ed6e049755dc1 F ext/misc/explain.c 0086fab288d4352ea638cf40ac382aad3b0dc5e845a1ea829a694c015fd970fe F ext/misc/fileio.c 4e7f7cd30de8df4820c552f14af3c9ca451c5ffe1f2e7bef34d598a12ebfb720 @@ -752,7 +752,7 @@ F src/trigger.c ad6ab9452715fa9a8075442e15196022275b414b9141b566af8cdb7a1605f2b0 F src/update.c 6904814dd62a7a93bbb86d9f1419c7f134a9119582645854ab02b36b676d9f92 F src/upsert.c fa125a8d3410ce9a97b02cb50f7ae68a2476c405c76aa692d3acf6b8586e9242 F src/utf.c ee39565f0843775cc2c81135751ddd93eceb91a673ea2c57f61c76f288b041a0 -F src/util.c 24f4458bb7a57b0e1b2858484fd62ea83fe63dcb0bce21a96bf9fe31fd402038 +F src/util.c 278b81c3b33db1b5a5f3859adf8905c165b910080043061d44d3c5a25b4b406d F src/vacuum.c 604fcdaebe76f3497c855afcbf91b8fa5046b32de3045bab89cc008d68e40104 F src/vdbe.c 346d848a0bf8128e3e3722c5406f4bde6c32d7093b93402c6f8e0718d19305c3 F src/vdbe.h 41485521f68e9437fdb7ec4a90f9d86ab294e9bb8281e33b235915e29122cfc0 @@ -986,7 +986,7 @@ F test/dbpage.test fce29035c7566fd7835ec0f19422cb4b9c6944ce0e1b936ff8452443f92e8 F test/dbpagefault.test d9111a62f3601d3efc6841ace3940181937342d245f92a1cca6cba8206d4f58a F test/dbstatus.test 4a4221a883025ffd39696b3d1b3910b928fb097d77e671351acb35f3aed42759 F test/dbstatus2.test f5fe0afed3fa45e57cfa70d1147606c20d2ba23feac78e9a172f2fe8ab5b78ef -F test/decimal.test 18e7b4cb12e8d5c60d768b686ba52af3e1ca3ced4f870231f0476666fd9fab7e +F test/decimal.test ef731887b43ee32ef86e1c8fddb61a40789f988332c029c601dcf2c319277e9e F test/default.test 9687cfb16717e4b8238c191697c98be88c0b16e568dd5368cd9284154097ef50 F test/delete.test 2686e1c98d552ef37d79ad55b17b93fe96fad9737786917ce3839767f734c48f F test/delete2.test 3a03f2cca1f9a67ec469915cb8babd6485db43fa @@ -2092,8 +2092,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 ec7eeb055bfb0e5a4467d8a45fa53d84bb8ae80ca0474b687e2783e971648008 -R e11042589c02a36ddb6f96689ee2795e -U dan -Z 5746d777226734857d3cbbf5f4b6983b +P 925be7539947078547ee129b3d328ab0c59b19c6e2e5a391840f2d58f6d59acd +R fad532678661570c360a86287eb5b36b +U drh +Z 9f227d0d147a4f8369a99aac9693c824 # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 8c88c88e25..fc9435ecf9 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -925be7539947078547ee129b3d328ab0c59b19c6e2e5a391840f2d58f6d59acd \ No newline at end of file +c48f1be8cc505a7e2902c79e26c1d9a121ff5c55785ac812d2e09232b2414695 \ No newline at end of file diff --git a/src/util.c b/src/util.c index cb29736fbd..97deb64cfd 100644 --- a/src/util.c +++ b/src/util.c @@ -1020,7 +1020,7 @@ void sqlite3FpDecode(FpDecode *p, double r, int iRound, int mxRound){ ** The error terms on constants like 1.0e+100 computed using the ** decimal extension, for example as follows: ** - ** SELECT decimal_sci(decimal_sub('1.0e+100',decimal(1.0e+100))); + ** SELECT decimal_exp(decimal_sub('1.0e+100',decimal(1.0e+100))); */ double rr[2]; rr[0] = r; diff --git a/test/decimal.test b/test/decimal.test index 6ce5d642dd..cf4e06ad92 100644 --- a/test/decimal.test +++ b/test/decimal.test @@ -49,7 +49,7 @@ do_execsql_test 1080 { SELECT decimal('+123e+4'); } {1230000} do_execsql_test 1081 { - SELECT decimal_sci('+123e+4'); + SELECT decimal_exp('+123e+4'); } {+1.23e+06} From 78ad745ab9f36fa394c4701933d462b8453fe4a5 Mon Sep 17 00:00:00 2001 From: stephan Date: Sat, 19 Aug 2023 08:12:10 +0000 Subject: [PATCH 32/32] shell.c.in help text typo fix. No functional changes. FossilOrigin-Name: c319033276c3565d0f1f2cae1c91791940d322fe79696bc26d74fddeb2664373 --- manifest | 14 +++++++------- manifest.uuid | 2 +- src/shell.c.in | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/manifest b/manifest index fb6be2f158..fd7b8258af 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Rename\sthe\sdecimal_sci()\sfunction\sto\sdecimal_exp().\n[forum:/forumpost/fa027bb0ab|Forum\spost\sfa027bb0ab]. -D 2023-08-18T15:39:38.045 +C shell.c.in\shelp\stext\stypo\sfix.\sNo\sfunctional\schanges. +D 2023-08-19T08:12:10.152 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -685,7 +685,7 @@ F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c F src/resolve.c 37953a5f36c60bea413c3c04efcd433b6177009f508ef2ace0494728912fe2e9 F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97 F src/select.c 5f545a2c8702d4d3430bbb188cfec47d6c122d899061ef00cbe56af14591c574 -F src/shell.c.in 40340c504bfda5708322cbab64b518510a06483abb6dda2f3baa7956a89241a4 +F src/shell.c.in 2f9be25294b68b07e7e81f0adcec4475aba6011b64f160e414efe226910c4d7b F src/sqlite.h.in 73a366c1c45d5ac9888cfe81c458826a44498531d106cfb4f328193ab5f6f17d F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8 F src/sqlite3ext.h 2f30b2671f4c03cd27a43f039e11251391066c97d11385f5f963bb40b03038ac @@ -2092,8 +2092,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 925be7539947078547ee129b3d328ab0c59b19c6e2e5a391840f2d58f6d59acd -R fad532678661570c360a86287eb5b36b -U drh -Z 9f227d0d147a4f8369a99aac9693c824 +P c48f1be8cc505a7e2902c79e26c1d9a121ff5c55785ac812d2e09232b2414695 +R b8bc869b8d758cc2a2e67811c6189c81 +U stephan +Z 43d19bb1ac563f29cc01181a73eccbfe # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index fc9435ecf9..c2202fbeeb 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -c48f1be8cc505a7e2902c79e26c1d9a121ff5c55785ac812d2e09232b2414695 \ No newline at end of file +c319033276c3565d0f1f2cae1c91791940d322fe79696bc26d74fddeb2664373 \ No newline at end of file diff --git a/src/shell.c.in b/src/shell.c.in index 20cd5cd2bb..07d92d0142 100644 --- a/src/shell.c.in +++ b/src/shell.c.in @@ -4809,7 +4809,7 @@ static const char *(azHelp[]) = { #endif ".connection [close] [#] Open or close an auxiliary database connection", #if defined(_WIN32) || defined(WIN32) - ".crnl on|off Turn translate \\n to \\r\\n. Default ON", + ".crnl on|off Translate \\n to \\r\\n. Default ON", #endif ".databases List names and files of attached databases", ".dbconfig ?op? ?val? List or change sqlite3_db_config() options",