8000 Snapshot of upstream SQLite 3.39.2 · sqlcipher/sqlcipher@a6c0401 · GitHub
[go: up one dir, main page]

Skip to content

Commit a6c0401

Browse files
committed
Snapshot of upstream SQLite 3.39.2
1 parent 00dbcf0 commit a6c0401

File tree

174 files changed

+61291
-2201
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

174 files changed

+61291
-2201
lines changed

Makefile.in

Lines changed: 134 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,7 @@ TESTSRC2 = \
503503
$(TOP)/src/pcache1.c \
504504
$(TOP)/src/select.c \
505505
$(TOP)/src/tokenize.c \
506+
$(TOP)/src/treeview.c \
506507
$(TOP)/src/utf.c \
507508
$(TOP)/src/util.c \
508509
$(TOP)/src/vdbeapi.c \
@@ -630,7 +631,7 @@ FUZZCHECK_OPT += -DSQLITE_ENABLE_RTREE
630631
FUZZCHECK_OPT += -DSQLITE_ENABLE_GEOPOLY
631632
FUZZCHECK_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
632633
FUZZCHECK_OPT += -DSQLITE_ENABLE_BYTECODE_VTAB
633-
FUZZCHECK_SRC = $(TOP)/test/fuzzcheck.c $(TOP)/test/ossfuzz.c
634+
FUZZCHECK_SRC = $(TOP)/test/fuzzcheck.c $(TOP)/test/ossfuzz.c $(TOP)/test/fuzzinvariants.c
634635
DBFUZZ_OPT =
635636

636637
# This is the default Makefile target. The objects listed here
@@ -874,7 +875,7 @@ hash.lo: $(TOP)/src/hash.c $(HDR)
874875
insert.lo: $(TOP)/src/insert.c $(HDR)
875876
$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/insert.c
876877

877-
json.lo: $(TOP)/src/json.c
878+
json.lo: $(TOP)/src/json.c $(HDR)
878879
$(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/json.c
879880

880881
legacy.lo: $(TOP)/src/legacy.c $(HDR)
@@ -1512,3 +1513,134 @@ sqlite3.def: $(REAL_LIBOBJ)
15121513
sqlite3.dll: $(REAL_LIBOBJ) sqlite3.def
15131514
$(TCC) -shared -o $@ sqlite3.def \
15141515
-Wl,"--strip-all" $(REAL_LIBOBJ)
1516+
1517+
1518+
#
1519+
# fiddle/wasm section
1520+
#
1521+
fiddle_dir = ext/fiddle
1522+
fiddle_dir_abs = $(TOP)/$(fiddle_dir)
1523+
# ^^^ some emcc opts require absolute paths
1524+
fiddle_html = $(fiddle_dir)/fiddle.html
1525+
fiddle_module_js = $(fiddle_dir)/fiddle-module.js
1526+
sqlite3_wasm_js = $(fiddle_dir)/sqlite3.js
1527+
sqlite3_wasm = $(fiddle_dir)/sqlite3.wasm
1528+
#emcc_opt = -O0
1529+
#emcc_opt = -O1
1530+
#emcc_opt = -O2
1531+
#emcc_opt = -O3
1532+
emcc_opt = -Oz
1533+
emcc_flags = $(emcc_opt) -sALLOW_TABLE_GROWTH -sSTRICT_JS \
1534+
-sENVIRONMENT=web -sMODULARIZE \
1535+
-sEXPORTED_RUNTIME_METHODS=@$(fiddle_dir_abs)/EXPORTED_RUNTIME_METHODS \
1536+
-sDYNAMIC_EXECUTION=0 \
1537+
-I. $(SHELL_OPT)
1538+
$(fiddle_module_js): Makefile sqlite3.c shell.c \
1539+
$(fiddle_dir)/EXPORTED_RUNTIME_METHODS \
1540+
$(fiddle_dir)/EXPORTED_FUNCTIONS.fiddle
1541+
emcc -o $@ $(emcc_flags) \
1542+
-sEXPORT_NAME=initFiddleModule \
1543+
-sEXPORTED_FUNCTIONS=@$(fiddle_dir_abs)/EXPORTED_FUNCTIONS.fiddle \
1544+
sqlite3.c shell.c
1545+
gzip < $@ > $@.gz
1546+
gzip < $(fiddle_dir)/fiddle-module.wasm > $(fiddle_dir)/fiddle-module.wasm.gz
1547+
$(sqlite3_wasm_js): Makefile sqlite3.c \
1548+
$(fiddle_dir)/sqlite3-api.js \
1549+
$(fiddle_dir)/EXPORTED_RUNTIME_METHODS \
1550+
$(fiddle_dir)/EXPORTED_FUNCTIONS.sqlite3-api
1551+
emcc -o $@ $(emcc_flags) \
1552+
-sEXPORT_NAME=initSqlite3Module \
1553+
-sEXPORTED_FUNCTIONS=@$(fiddle_dir_abs)/EXPORTED_FUNCTIONS.sqlite3-api \
1554+
--post-js=$(fiddle_dir)/sqlite3-api.js \
1555+
--no-entry \
1556+
sqlite3.c
1557+
gzip < $@ > $@.gz
1558+
gzip < $(sqlite3_wasm) > $(sqlite3_wasm).gz
1559+
gzip < $(fiddle_dir)/sqlite3-api.js > $(fiddle_dir)/sqlite3-api.js.gz
1560+
$(fiddle_dir)/fiddle.js.gz: $(fiddle_dir)/fiddle.js
1561+
gzip < $< > $@
1562+
$(fiddle_dir)/sqlite3-api.js.gz: $(fiddle_dir)/sqlite3-api.js
1563+
gzip < $< > $@
1564+
1565+
fiddle_generated = $(fiddle_module_js) $(fiddle_module_js).gz \
1566+
$(fiddle_dir)/fiddle-module.wasm \
1567+
$(fiddle_dir)/fiddle-module.wasm.gz \
1568+
$(fiddle_dir)/fiddle.js.gz
1569+
sqlite3_wasm_generated = \
1570+
$(sqlite3_wasm) $(sqlite3_wasm).gz \
1571+
$(sqlite3_wasm_js) $(sqlite3_wasm_js).gz \
1572+
$(fiddle_dir)/sqlite3.js.gz \
1573+
$(fiddle_dir)/sqlite3-api.js.gz
1574+
1575+
clean-wasm:
1576+
rm -f $(fiddle_generated) $(sqlite3_wasm_generated)
1577+
clean: clean-wasm
1578+
fiddle: $(fiddle_module_js) $(fiddle_dir)/fiddle.js.gz
1579+
sqlite3-wasm: $(sqlite3_wasm_js)
1580+
wasm: fiddle sqlite3-wasm
1581+
########################################################################
1582+
# Explanation of the emcc build flags follows. Full docs for these can
1583+
# be found at:
1584+
#
1585+
# https://github.com/emscripten-core/emscripten/blob/main/src/settings.js
1586+
#
1587+
# -sENVIRONMENT=web: elides bootstrap code related to n 10000 on-web JS
1588+
# environments like node.js. Removing this makes the output a tiny
1589+
# tick larger but hypothetically makes it more portable to
1590+
# non-browser JS environments.
1591+
#
1592+
# -sMODULARIZE: changes how the generated code is structured to avoid
1593+
# declaring a global Module object and instead installing a function
1594+
# which loads and initialized the module. The function is named...
1595+
#
1596+
# -sEXPORT_NAME=jsFunctionName (see -sMODULARIZE)
1597+
#
1598+
# -sEXPORTED_RUNTIME_METHODS=@/absolute/path/to/file: a file
1599+
# containing a list of emscripten-supplied APIs, one per line, which
1600+
# must be exported into the generated JS. Must be an absolute path!
1601+
#
1602+
# -sEXPORTED_FUNCTIONS=@/absolute/path/to/file: a file containing a
1603+
# list of C functions, one per line, which must be exported via wasm
1604+
# so they're visible to JS. C symbols names in that file must all
1605+
# start with an underscore for reasons known only to the emcc
1606+
# developers. e.g., _sqlite3_open_v2 and _sqlite3_finalize. Must be
1607+
# an absolute path!
1608+
#
1609+
# -sSTRICT_JS ensures that the emitted JS code includes the 'use
1610+
# strict' option. Note that -sSTRICT is more broadly-scoped and
1611+
# results in build errors.
1612+
#
1613+
# -sALLOW_TABLE_GROWTH is required for (at a minimum) the UDF-binding
1614+
# feature.
1615+
#
1616+
# -sDYNAMIC_EXECUTION=0 disables eval() and the Function constructor.
1617+
# If the build runs without these, it's preferable to use this flag
1618+
# because certain execution environments disallow those constructs.
1619+
# This flag is not strictly necessary, however.
1620+
#
1621+
# -sWASM_BIGINT is UNTESTED but "should" allow the int64-using C APIs
1622+
# to work with JS/wasm, insofar as the JS environment supports the
1623+
# BigInt type. That support requires an extremely recent browser:
1624+
# Safari didn't get that support until late 2020.
1625+
#
1626+
# --no-entry: for compiling library code with no main(). If this is
1627+
# not supplied and the code has a main(), it is called as part of the
1628+
# module init process. Note that main() is #if'd out of shell.c
1629+
# (renamed) when building in wasm mode.
1630+
#
1631 10000 +
# --pre-js/--post-js=FILE relative or absolute paths to JS files to
1632+
# prepend/append to the emcc-generated bootstrapping JS. It's
1633+
# easier/faster to develop with separate JS files (reduces rebuilding
1634+
# requirements) but certain configurations, namely -sMODULARIZE, may
1635+
# require using at least a --pre-js file. They can be used
1636+
# individually and need not be paired.
1637+
#
1638+
# -O0..-O3 and -Oz: optimization levels affect not only C-style
1639+
# optimization but whether or not the resulting generated JS code
1640+
# gets minified. -O0 compiles _much_ more quickly than -O3 or -Oz,
1641+
# and doesn't minimize any JS code, so is recommended for
1642+
# development. -O3 or -Oz are recommended for deployment, but
1643+
# primarily because -Oz will shrink the wasm file notably. JS-side
1644+
# minification makes little difference in terms of overall
1645+
# distributable size.
1646+
########################################################################

Makefile.msc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1705,7 +1705,7 @@ FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_GEOPOLY
17051705
FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_DBSTAT_VTAB
17061706
FUZZCHECK_OPTS = $(FUZZCHECK_OPTS) -DSQLITE_ENABLE_BYTECODE_VTAB
17071707

1708-
FUZZCHECK_SRC = $(TOP)\test\fuzzcheck.c $(TOP)\test\ossfuzz.c
1708+
FUZZCHECK_SRC = $(TOP)\test\fuzzcheck.c $(TOP)\test\ossfuzz.c $(TOP)\test\fuzzinvariants.c
17091709
OSSSHELL_SRC = $(TOP)\test\ossshell.c $(TOP)\test\ossfuzz.c
17101710
DBFUZZ_COMPILE_OPTS = -DSQLITE_THREADSAFE=0 -DSQLITE_OMIT_LOAD_EXTENSION
17111711
KV_COMPILE_OPTS = -DSQLITE_THREADSAFE=0 -DSQLITE_DIRECT_OVERFLOW_READ

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<h1 align="center">SQLite Source Repository</h1>
22

3-
This repository contains the complete source code for the
4-
[SQLite database engine](https://sqlite.org/). Some test scripts
3+
This repository contains the complete source code for the
4+
[SQLite database engine](https://sqlite.org/). Some test scripts
55
are also included. However, many other test scripts
66
and most of the documentation are managed separately.
77

@@ -15,7 +15,7 @@ The [Fossil repository](https://sqlite.org/src/timeline) contains the urtext.
1515
If you are reading this on GitHub or some other Git repository or service,
1616
then you are looking at a mirror. The names of check-ins and
1717
other artifacts in a Git mirror are different from the official
18-
names for those objects. The offical names for check-ins are
18+
names for those objects. The official names for check-ins are
1919
found in a footer on the check-in comment for authorized mirrors.
2020
The official check-in name can also be seen in the `manifest.uuid` file
2121
in the root of the tree. Always use the official name, not the
@@ -30,7 +30,7 @@ verify its integrity, there are hints on how to do that in the
3030
If you do not want to use Fossil, you can download tarballs or ZIP
3131
archives or [SQLite archives](https://sqlite.org/cli.html#sqlar) as follows:
3232

33-
* Lastest trunk check-in as
33+
* Latest trunk check-in as
3434
[Tarball](https://www.sqlite.org/src/tarball/sqlite.tar.gz),
3535
[ZIP-archive](https://www.sqlite.org/src/zip/sqlite.zip), or
3636
[SQLite-archive](https://www.sqlite.org/src/sqlar/sqlite.sqlar).
@@ -47,11 +47,11 @@ archives or [SQLite archives](https://sqlite.org/cli.html#sqlar) as follows:
4747
then click on the "Tarball" or "ZIP Archive" links on the information
4848
page.
4949

50-
If you do want to use Fossil to check out the source tree,
50+
If you do want to use Fossil to check out the source tree,
5151
first install Fossil version 2.0 or later.
5252
(Source tarballs and precompiled binaries available
5353
[here](https://www.fossil-scm.org/fossil/uv/download.html). Fossil is
54-
a stand-alone program. To install, simply download or build the single
54+
a stand-alone program. To install, simply download or build the single
5555
executable file and put that file someplace on your $PATH.)
5656
Then run commands like this:
5757

@@ -61,7 +61,7 @@ Then run commands like this:
6161
fossil open ~/Fossils/sqlite.fossil
6262

6363
After setting up a repository using the steps above, you can always
64-
update to the lastest version using:
64+
update to the latest version using:
6565

6666
fossil update trunk ;# latest trunk check-in
6767
fossil update release ;# latest official release
@@ -136,7 +136,7 @@ the "tclsqlite.c" file which implements the
136136
extension and only later escaped to the wild as an independent library.)
137137

138138
Test scripts and programs are found in the **test/** subdirectory.
139-
Addtional test code is found in other source repositories.
139+
Additional test code is found in other source repositories.
140140
See [How SQLite Is Tested](http://www.sqlite.org/testing.html) for
141141
additional information.
142142

@@ -170,7 +170,7 @@ at just the right spots. Note that comment text in the sqlite3.h file is
170170
used to generate much of the SQLite API documentation. The Tcl scripts
171171
used to generate that documentation are in a separate source repository.
172172

173-
The SQL language parser is **parse.c** which is generate from a grammar in
173+
The SQL language parser is **parse.c** which is generated from a grammar in
174174
the src/parse.y file. The conversion of "parse.y" into "parse.c" is done
175175
by the [lemon](./doc/lemon.html) LALR(1) parser generator. The source code
176176
for lemon is at tool/lemon.c. Lemon uses the tool/lempar.c file as a
@@ -180,7 +180,7 @@ generates parse.c.
180180

181181
The **opcodes.h** header file contains macros that define the numbers
182182
corresponding to opcodes in the "VDBE" virtual machine. The opcodes.h
183-
file is generated by the scanning the src/vdbe.c source file. The
183+
file is generated by scanning the src/vdbe.c source file. The
184184
Tcl script at ./mkopcodeh.tcl does this scan and generates opcodes.h.
185185
A second Tcl script, ./mkopcodec.tcl, then scans opcodes.h to generate
186186
the **opcodes.c** source file, which contains a reverse mapping from
@@ -237,7 +237,7 @@ prepared statements, the description of
237237
[how transactions work](http://www.sqlite.org/atomiccommit.html), and
238238
the [overview of the query planner](http://www.sqlite.org/optoverview.html).
239239

240-
Years of effort have gone into optimizating SQLite, both
240+
Years of effort have gone into optimizing SQLite, both
241241
for small size and high performance. And optimizations tend to result in
242242
complex code. So there is a lot of complexity in the current SQLite
243243
implementation. It will not be the easiest library in the world to hack.
@@ -294,11 +294,11 @@ Key files:
294294
building the "testfixture.exe" program. The testfixture.exe program is
295295
an enhanced Tcl shell. The testfixture.exe program runs scripts in the
296296
test/ folder to validate the core SQLite code. The testfixture program
297-
(and some other test programs too) is build and run when you type
297+
(and some other test programs too) is built and run when you type
298298
"make test".
299299

300300
* **ext/misc/json1.c** - This file implements the various JSON functions
301-
that are build into SQLite.
301+
that are built into SQLite.
302302

303303
There are many other source files. Each has a succinct header comment that
304304
describes its purpose and role within the larger system.
@@ -307,7 +307,7 @@ describes its purpose and role within the larger system.
307307
## Verifying Code Authenticity
308308

309309
The `manifest` file at the root directory of the source tree
310-
contains either a SHA3-256 hash (for newer files) or a SHA1 hash (for
310+
contains either a SHA3-256 hash (for newer files) or a SHA1 hash (for
311311
older files) for every source file in the repository.
312312
The name of the version of the entire source tree is just the
313313
SHA3-256 hash of the `manifest` file itself, possibly with the

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.38.5
1+
3.39.2

configure

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.69 for sqlite 3.38.5.
3+
# Generated by GNU Autoconf 2.69 for sqlite 3.39.2.
44
#
55
#
66
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -726,8 +726,8 @@ MAKEFLAGS=
726726
# Identity of this package.
727727
PACKAGE_NAME='sqlite'
728728
PACKAGE_TARNAME='sqlite'
729-
PACKAGE_VERSION='3.38.5'
730-
PACKAGE_STRING='sqlite 3.38.5'
729+
PACKAGE_VERSION='3.39.2'
730+
PACKAGE_STRING='sqlite 3.39.2'
731731
PACKAGE_BUGREPORT=''
732732
PACKAGE_URL=''
733733

@@ -1468,7 +1468,7 @@ if test "$ac_init_help" = "long"; then
14681468
# Omit some internal or obsolete options to make the list less imposing.
14691469
# This message is too long to be a string in the A/UX 3.1 sh.
14701470
cat <<_ACEOF
1471-
\`configure' configures sqlite 3.38.5 to adapt to many kinds of systems.
1471+
\`configure' configures sqlite 3.39.2 to adapt to many kinds of systems.
14721472
14731473
Usage: $0 [OPTION]... [VAR=VALUE]...
14741474
@@ -1533,7 +1533,7 @@ fi
15331533

15341534
if test -n "$ac_init_help"; then
15351535
case $ac_init_help in
1536-
short | recursive ) echo "Configuration of sqlite 3.38.5:";;
1536+
short | recursive ) echo "Configuration of sqlite 3.39.2:";;
15371537
esac
15381538
cat <<\_ACEOF
15391539
@@ -1661,7 +1661,7 @@ fi
16611661
test -n "$ac_init_help" && exit $ac_status
16621662
if $ac_init_version; then
16631663
cat <<\_ACEOF
1664-
sqlite configure 3.38.5
1664+
sqlite configure 3.39.2
16651665
generated by GNU Autoconf 2.69
16661666
16671667
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2080,7 +2080,7 @@ cat >config.log <<_ACEOF
20802080
This file contains any messages produced by compilers while
20812081
running configure, to aid debugging if configure makes a mistake.
20822082
2083-
It was created by sqlite $as_me 3.38.5, which was
2083+
It was created by sqlite $as_me 3.39.2, which was
20842084
generated by GNU Autoconf 2.69. Invocation command line was
20852085
20862086
$ $0 $@
@@ -12390,7 +12390,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
1239012390
# report actual input values of CONFIG_FILES etc. instead of their
1239112391
# values after options handling.
1239212392
ac_log="
12393-
This file was extended by sqlite $as_me 3.38.5, which was
12393+
This file was extended by sqlite $as_me 3.39.2, which was
1239412394
generated by GNU Autoconf 2.69. Invocation command line was
1239512395
1239612396
CONFIG_FILES = $CONFIG_FILES
@@ -12456,7 +12456,7 @@ _ACEOF
1245612456
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1245712457
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1245812458
ac_cs_version 92AD ="\\
12459-
sqlite config.status 3.38.5
12459+
sqlite config.status 3.39.2
1246012460
configured by $0, generated by GNU Autoconf 2.69,
1246112461
with options \\"\$ac_cs_config\\"
1246212462

ext/fiddle/EXPORTED_FUNCTIONS.fiddle

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
_fiddle_exec
2+
_fiddle_interrupt
3+
_fiddle_experiment
4+
_fiddle_the_db
5+
_fiddle_db_arg
6+
_fiddle_db_filename
7+
_fiddle_reset_db

0 commit comments

Comments
 (0)
0