git: 5e8b3d783d2c - main - databases/sqlite3: Update to 3.40.0

From: Fernando Apesteguía <fernape_at_FreeBSD.org>
Date: Mon, 28 Nov 2022 16:58:50 UTC
The branch main has been updated by fernape:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5e8b3d783d2cce36c7e4f38aad7b34b4ee3d9c68

commit 5e8b3d783d2cce36c7e4f38aad7b34b4ee3d9c68
Author:     Pavel Volkov <pavelivolkov@gmail.com>
AuthorDate: 2022-11-28 06:45:01 +0000
Commit:     Fernando Apesteguía <fernape@FreeBSD.org>
CommitDate: 2022-11-28 16:54:42 +0000

    databases/sqlite3: Update to 3.40.0
    
    ChangeLog: https://www.sqlite.org/releaselog/3_40_0.html
    
     * Add support for compiling SQLite to WASM and running it in web browsers.
     * Add the recovery extension that might be able to recover some content from a
       corrupt database file.
     * Query planner enhancements:
     * A new typedef named sqlite3_filename is added and used to represent the name
       of a database file.
     * Add the sqlite3_value_encoding() interface.
     * Security enhancement: SQLITE_DBCONFIG_DEFENSIVE is augmented to prohibit
       changing the schema_version.
     * Enhancements to the PRAGMA integrity_check statement:
     * Enhance the VACUUM INTO statement so that it honors the PRAGMA synchronous
       setting.
     * Enhance the sqlite3_strglob() and sqlite3_strlike() APIs
     * Provide the new SQLITE_MAX_ALLOCATION_SIZE compile-time option for limiting
       the size of memory allocations.
     * Change the algorithm used by SQLite's built-in pseudo-random number
       generator (PRNG) from RC4 to Chacha20.
     * Allow two or more indexes to have the same name as long as they are all in
       separate schemas.
     * Miscellaneous performance optimizations result in about 1% fewer CPU cycles
       used on typical workloads.
    
    PR:             268012
    Reported by:    pavelivolkov@gmail.com (maintainer)
---
 databases/sqlite3/Makefile                         |  3 +-
 databases/sqlite3/distinfo                         |  6 ++--
 databases/sqlite3/files/patch-Makefile.in          |  8 ++---
 databases/sqlite3/files/patch-test_e__uri.test     | 13 +++++++++
 databases/sqlite3/files/patch-test_fts3expr4.test  | 11 +++++++
 databases/sqlite3/files/patch-test_scanstatus.test | 34 ++++++++++++++++++++++
 databases/sqlite3/files/patch-test_stat.test       | 11 +++++++
 databases/sqlite3/files/patch-test_uri.test        | 15 ++++++++++
 8 files changed, 92 insertions(+), 9 deletions(-)

diff --git a/databases/sqlite3/Makefile b/databases/sqlite3/Makefile
index efa293154039..62275743c0ed 100644
--- a/databases/sqlite3/Makefile
+++ b/databases/sqlite3/Makefile
@@ -1,6 +1,5 @@
 PORTNAME=	sqlite3
-DISTVERSION=	3.39.3
-PORTREVISION=	1
+DISTVERSION=	3.40.0
 PORTEPOCH=	1
 CATEGORIES=	databases
 MASTER_SITES=	https://www.sqlite.org/${_YEAR}/ https://www2.sqlite.org/${_YEAR}/ https://www3.sqlite.org/${_YEAR}/
diff --git a/databases/sqlite3/distinfo b/databases/sqlite3/distinfo
index a62b86184071..c06070e07d02 100644
--- a/databases/sqlite3/distinfo
+++ b/databases/sqlite3/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1663328999
-SHA256 (sqlite-src-3390300.zip) = 18c12f2e1da112421173c85c4f8aed43261272c1b0474aa0759288fd30fab9fc
-SIZE (sqlite-src-3390300.zip) = 13404886
+TIMESTAMP = 1669461304
+SHA256 (sqlite-src-3400000.zip) = 48550828142051293e179ffc6a8520f6fbfd82e1cdca78b93792f766cc89b8e2
+SIZE (sqlite-src-3400000.zip) = 13723231
diff --git a/databases/sqlite3/files/patch-Makefile.in b/databases/sqlite3/files/patch-Makefile.in
index 47e20de23c2f..70aa8e8a281e 100644
--- a/databases/sqlite3/files/patch-Makefile.in
+++ b/databases/sqlite3/files/patch-Makefile.in
@@ -1,11 +1,11 @@
---- Makefile.in.orig	2021-04-11 09:08:25 UTC
+--- Makefile.in.orig	2022-11-26 11:17:35 UTC
 +++ Makefile.in
-@@ -1274,7 +1274,7 @@ valgrindfuzz:	fuzzcheck$(TEXT) $(FUZZDATA) sessionfuzz
+@@ -1299,7 +1299,7 @@ tcltest:	./testfixture$(TEXE)
  # The veryquick.test TCL tests.
  #
  tcltest:	./testfixture$(TEXE)
 -	./testfixture$(TEXE) $(TOP)/test/veryquick.test $(TESTOPTS)
 +	mkdir $(TOP)/testdir && touch $(TOP)/test-out.txt && chown nobody $(TOP)/testdir $(TOP)/test-out.txt && su -m nobody -c "./testfixture$(TEXE) $(TOP)/test/veryquick.test $(TESTOPTS)"
  
- # Minimal testing that runs in less than 3 minutes
- #
+ # Runs all the same tests cases as the "tcltest" target but uses
+ # the testrunner.tcl script to run them in multiple cores
diff --git a/databases/sqlite3/files/patch-test_e__uri.test b/databases/sqlite3/files/patch-test_e__uri.test
new file mode 100644
index 000000000000..6c09429555bc
--- /dev/null
+++ b/databases/sqlite3/files/patch-test_e__uri.test
@@ -0,0 +1,13 @@
+--- test/e_uri.test.orig	2022-11-27 09:06:46 UTC
++++ test/e_uri.test
+@@ -139,8 +139,8 @@ if {$tcl_platform(platform) == "unix"} {
+   foreach {tn uri error} "
+     1  {file://localhost[test_pwd /]test.db}   {not an error}
+     2  {file://[test_pwd /]test.db}            {not an error}
+-    3  {file://x[test_pwd /]test.db}           {invalid uri authority: x}
+-    4  {file://invalid[test_pwd /]test.db}     {invalid uri authority: invalid}
++    3  {file://x[test_pwd /]test.db}           {unable to open database file}
++    4  {file://invalid[test_pwd /]test.db}     {unable to open database file}
+   " {
+     do_test 2.$tn {
+       set DB [sqlite3_open_v2 $uri $flags ""]
diff --git a/databases/sqlite3/files/patch-test_fts3expr4.test b/databases/sqlite3/files/patch-test_fts3expr4.test
new file mode 100644
index 000000000000..ef73fba60d2f
--- /dev/null
+++ b/databases/sqlite3/files/patch-test_fts3expr4.test
@@ -0,0 +1,11 @@
+--- test/fts3expr4.test.orig	2022-11-27 11:47:17 UTC
++++ test/fts3expr4.test
+@@ -50,7 +50,7 @@ do_icu_expr_test 1.7 {a:word} {PHRASE 0 0 word}
+ # is passed to the tokenizer.
+ #
+ do_icu_expr_test 1.7 {a:word} {PHRASE 0 0 word}
+-do_icu_expr_test 1.8 {d:word} {PHRASE 3 0 d:word}
++do_icu_expr_test 1.8 {d:word} {AND {AND {PHRASE 3 0 d} {PHRASE 3 0 :}} {PHRASE 3 0 word}}
+ 
+ set sqlite_fts3_enable_parentheses 0
+ 
diff --git a/databases/sqlite3/files/patch-test_scanstatus.test b/databases/sqlite3/files/patch-test_scanstatus.test
new file mode 100644
index 000000000000..3d72a0b188a7
--- /dev/null
+++ b/databases/sqlite3/files/patch-test_scanstatus.test
@@ -0,0 +1,34 @@
+--- test/scanstatus.test.orig	2022-11-27 11:40:24 UTC
++++ test/scanstatus.test
+@@ -312,8 +312,8 @@ do_scanstatus_test 5.1.2 { 
+   SELECT count(*) FROM t1 WHERE a IN (SELECT b FROM t1 AS ii)
+ } {2}
+ do_scanstatus_test 5.1.2 { 
+-  nLoop 1 nVisit 10 nEst 10.0 zName t1bc 
+-  zExplain {SCAN ii USING COVERING INDEX t1bc}
++  nLoop 1 nVisit 10 nEst 10.0 zName t1
++  zExplain {SCAN ii}
+   nLoop 1 nVisit 2 nEst 8.0 zName sqlite_autoindex_t1_1
+   zExplain {SEARCH t1 USING COVERING INDEX sqlite_autoindex_t1_1 (a=?)}
+ }
+@@ -341,16 +341,16 @@ do_eqp_test 5.4.1 {
+   SELECT count(*) FROM t1, t2 WHERE y = c;
+ } {
+   QUERY PLAN
+-  |--SCAN t1 USING COVERING INDEX t1bc
++  |--SCAN t1
+   `--SEARCH t2 USING COVERING INDEX t2xy (ANY(x) AND y=?)
+ }
+ do_execsql_test 5.4.2 {
+   SELECT count(*) FROM t1, t2 WHERE y = c;
+ } {200}
+ do_scanstatus_test 5.4.3 { 
+-  nLoop 1 nVisit 10 nEst 10.0 zName t1bc 
+-  zExplain {SCAN t1 USING COVERING INDEX t1bc}
+-  nLoop 10 nVisit 200 nEst 56.0 zName t2xy 
++  nLoop 1 nVisit 10 nEst 10.0 zName t1
++  zExplain {SCAN t1}
++  nLoop 10 nVisit 200 nEst 56.0 zName t2xy
+   zExplain {SEARCH t2 USING COVERING INDEX t2xy (ANY(x) AND y=?)}
+ }
+ 
diff --git a/databases/sqlite3/files/patch-test_stat.test b/databases/sqlite3/files/patch-test_stat.test
new file mode 100644
index 000000000000..772ea91a95c2
--- /dev/null
+++ b/databases/sqlite3/files/patch-test_stat.test
@@ -0,0 +1,11 @@
+--- test/stat.test.orig	2022-11-27 11:50:01 UTC
++++ test/stat.test
+@@ -140,7 +140,7 @@ do_execsql_test stat-2.1agg {
+   SELECT * FROM dbstat WHERE aggregate=TRUE ORDER BY name;
+ } [list \
+   sqlite_autoindex_t3_1 {}  5 {} 32  3898 1065 132 {}  5120 \
+-  sqlite_schema         {}  1 {}  2    84  824  49 {}  1024 \
++  sqlite_schema         {}  1 {}  2    83  825  49 {}  1024 \
+   t3                    {} 17 {} 47 11188 5815 370 {} 17408 \
+ ]
+ 
diff --git a/databases/sqlite3/files/patch-test_uri.test b/databases/sqlite3/files/patch-test_uri.test
new file mode 100644
index 000000000000..e424ca6175ae
--- /dev/null
+++ b/databases/sqlite3/files/patch-test_uri.test
@@ -0,0 +1,15 @@
+--- test/uri.test.orig	2022-11-27 09:14:11 UTC
++++ test/uri.test
+@@ -301,9 +301,9 @@ foreach {tn uri res} {
+   1     "file://localhost/PWD/test.db"   {not an error}
+   2     "file:///PWD/test.db"            {not an error}
+   3     "file:/PWD/test.db"              {not an error}
+-  4     "file://l%6Fcalhost/PWD/test.db" {invalid uri authority: l%6Fcalhost}
+-  5     "file://lbcalhost/PWD/test.db"   {invalid uri authority: lbcalhost}
+-  6     "file://x/PWD/test.db"           {invalid uri authority: x}
++  4     "file://l%6Fcalhost/PWD/test.db" {unable to open database file}
++  5     "file://lbcalhost/PWD/test.db"   {unable to open database file}
++  6     "file://x/PWD/test.db"           {unable to open database file}
+ } {
+ 
+   if {$tcl_platform(platform)=="windows"} {