Skip to content

Commit d0b7a5c

Browse files
Update SQLite to 3.20.0
1 parent 7c5ee86 commit d0b7a5c

File tree

319 files changed

+48103
-2261
lines changed

Some content is hidden

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

319 files changed

+48103
-2261
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ If you need a specific version of SQLite, or specific SQLite compilation options
88

99

1010

11-
**Jul 18, 2017: Update SQLite to 3.19.3** ([changelog](CHANGELOG.md)).
11+
**Aug 2, 2017: Update SQLite to 3.20.0** ([changelog](CHANGELOG.md)).
1212

1313
**Requirements**: iOS 8.0+ / OSX 10.9+, Xcode 7.3+
1414

15-
**SQLite Included:** **[3.19.3](https://www.sqlite.org/releaselog/3_19_3.html)**
15+
**SQLite Included:** **[3.20.0](https://www.sqlite.org/releaselog/3_20_0.html)**
1616

1717

1818

@@ -65,7 +65,7 @@ There is no need to modify any other files.
6565

6666
#### Compiling a Specific Version of SQLite:
6767

68-
SQLiteLib currently ships with the source for SQLite 3.19.3.
68+
SQLiteLib currently ships with the source for SQLite 3.20.0.
6969

7070
If you'd like to compile a newer (or older) version, the process is simple:
7171

sqlite/Makefile.in

+11-3
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ LIBOBJS0 = alter.lo analyze.lo attach.lo auth.lo \
181181
notify.lo opcodes.lo os.lo os_unix.lo os_win.lo \
182182
pager.lo parse.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \
183183
random.lo resolve.lo rowset.lo rtree.lo \
184-
sqlite3session.lo select.lo sqlite3rbu.lo status.lo \
184+
sqlite3session.lo select.lo sqlite3rbu.lo status.lo stmt.lo \
185185
table.lo threads.lo tokenize.lo treeview.lo trigger.lo \
186186
update.lo util.lo vacuum.lo \
187187
vdbe.lo vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo vdbesort.lo \
@@ -350,7 +350,8 @@ SRC += \
350350
$(TOP)/ext/rbu/sqlite3rbu.h \
351351
$(TOP)/ext/rbu/sqlite3rbu.c
352352
SRC += \
353-
$(TOP)/ext/misc/json1.c
353+
$(TOP)/ext/misc/json1.c \
354+
$(TOP)/ext/misc/stmt.c
354355

355356
# Generated source code files
356357
#
@@ -434,6 +435,7 @@ TESTSRC += \
434435
$(TOP)/ext/misc/series.c \
435436
$(TOP)/ext/misc/spellfix.c \
436437
$(TOP)/ext/misc/totype.c \
438+
$(TOP)/ext/misc/unionvtab.c \
437439
$(TOP)/ext/misc/wholenumber.c
438440

439441
# Source code to the library files needed by the test fixture
@@ -483,7 +485,8 @@ TESTSRC2 = \
483485
$(TOP)/ext/fts3/fts3_tokenizer.c \
484486
$(TOP)/ext/fts3/fts3_write.c \
485487
$(TOP)/ext/async/sqlite3async.c \
486-
$(TOP)/ext/session/sqlite3session.c
488+
$(TOP)/ext/session/sqlite3session.c \
489+
$(TOP)/ext/misc/stmt.c
487490

488491
# Header files used by all library source files.
489492
#
@@ -564,6 +567,7 @@ SHELL_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4
564567
# SHELL_OPT += -DSQLITE_ENABLE_FTS5
565568
SHELL_OPT += -DSQLITE_ENABLE_EXPLAIN_COMMENTS
566569
SHELL_OPT += -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
570+
SHELL_OPT += -DSQLITE_ENABLE_STMTVTAB
567571
FUZZERSHELL_OPT = -DSQLITE_ENABLE_JSON1
568572
FUZZCHECK_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5 -DSQLITE_OSS_FUZZ
569573
FUZZCHECK_OPT += -DSQLITE_MAX_MEMORY=50000000
@@ -1034,6 +1038,9 @@ sqlite3session.lo: $(TOP)/ext/session/sqlite3session.c $(HDR) $(EXTHDR)
10341038
json1.lo: $(TOP)/ext/misc/json1.c
10351039
$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/misc/json1.c
10361040

1041+
stmt.lo: $(TOP)/ext/misc/stmt.c
1042+
$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/misc/stmt.c
1043+
10371044
# FTS5 things
10381045
#
10391046
FTS5_SRC = \
@@ -1083,6 +1090,7 @@ TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE
10831090
TESTFIXTURE_FLAGS += -DBUILD_sqlite
10841091
TESTFIXTURE_FLAGS += -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
10851092
TESTFIXTURE_FLAGS += -DSQLITE_DEFAULT_PAGE_SIZE=1024
1093+
TESTFIXTURE_FLAGS += -DSQLITE_ENABLE_STMTVTAB
10861094

10871095
TESTFIXTURE_SRC0 = $(TESTSRC2) libsqlite3.la
10881096
TESTFIXTURE_SRC1 = sqlite3.c

sqlite/Makefile.msc

+9-2
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,8 @@ SRC07 = \
12941294
$(TOP)\ext\rtree\rtree.c \
12951295
$(TOP)\ext\session\sqlite3session.c \
12961296
$(TOP)\ext\rbu\sqlite3rbu.c \
1297-
$(TOP)\ext\misc\json1.c
1297+
$(TOP)\ext\misc\json1.c \
1298+
$(TOP)\ext\misc\stmt.c
12981299

12991300
# Extension header files, part 1.
13001301
#
@@ -1417,6 +1418,7 @@ TESTEXT = \
14171418
$(TOP)\ext\misc\series.c \
14181419
$(TOP)\ext\misc\spellfix.c \
14191420
$(TOP)\ext\misc\totype.c \
1421+
$(TOP)\ext\misc\unionvtab.c \
14201422
$(TOP)\ext\misc\wholenumber.c
14211423

14221424
# Source code to the library files needed by the test fixture
@@ -1505,7 +1507,7 @@ FUZZDATA = \
15051507
# when the shell is not being dynamically linked.
15061508
#
15071509
!IF $(DYNAMIC_SHELL)==0 && $(FOR_WIN10)==0
1508-
SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS
1510+
SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_STMTVTAB
15091511
!ENDIF
15101512

15111513
# <<mark>>
@@ -2089,6 +2091,7 @@ TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERVER=1 -DSQLITE_PRIVATE=""
20892091
TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_CORE $(NO_WARN)
20902092
TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERIES_CONSTRAINT_VERIFY=1
20912093
TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_DEFAULT_PAGE_SIZE=1024
2094+
TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_ENABLE_STMTVTAB
20922095
TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) $(TEST_CCONV_OPTS)
20932096

20942097
TESTFIXTURE_SRC0 = $(TESTEXT) $(TESTSRC2)
@@ -2242,6 +2245,9 @@ rbu.exe: $(TOP)\ext\rbu\rbu.c $(TOP)\ext\rbu\sqlite3rbu.c $(SQLITE3C) $(SQLITE3H
22422245
$(LTLINK) $(NO_WARN) -DSQLITE_ENABLE_RBU \
22432246
$(TOP)\ext\rbu\rbu.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
22442247

2248+
LSMDIR=$(TOP)\ext\lsm1
2249+
!INCLUDE $(LSMDIR)\Makefile.msc
2250+
22452251
moreclean: clean
22462252
del /Q $(SQLITE3C) $(SQLITE3H) 2>NUL
22472253
# <</mark>>
@@ -2261,6 +2267,7 @@ clean:
22612267
-rmdir /Q/S tsrc 2>NUL
22622268
del /Q .target_source 2>NUL
22632269
del /Q tclsqlite3.exe $(SQLITETCLH) $(SQLITETCLDECLSH) 2>NUL
2270+
del /Q lsm.dll lsmtest.exe 2>NUL
22642271
del /Q testloadext.dll 2>NUL
22652272
del /Q testfixture.exe test.db 2>NUL
22662273
del /Q LogEst.exe fts3view.exe rollback-test.exe showdb.exe dbdump.exe 2>NUL

sqlite/README.md

+34-22
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ archives as follows:
3434
If you do want to use Fossil to check out the source tree,
3535
first install Fossil version 2.0 or later.
3636
(Source tarballs and precompiled binaries available
37-
[here](https://www.fossil-scm.org/fossil/uv/download.html).)
37+
[here](https://www.fossil-scm.org/fossil/uv/download.html). Fossil is
38+
a stand-alone program. To install, simply download or build the single
39+
executable file and put that file someplace on your $PATH.)
3840
Then run commands like this:
3941

4042
mkdir ~/sqlite
@@ -106,19 +108,22 @@ The makefiles also require AWK.
106108

107109
## Source Code Tour
108110

109-
Most of the core source files are in the **src/** subdirectory. But
110-
src/ also contains files used to build the "testfixture" test harness;
111-
those file all begin with "test". And src/ contains the "shell.c" file
112-
which is the main program for the "sqlite3.exe" command-line shell and
113-
the "tclsqlite.c" file which implements the bindings to SQLite from the
114-
Tcl programming language. (Historical note: SQLite began as a Tcl
111+
Most of the core source files are in the **src/** subdirectory. The
112+
**src/** folder also contains files used to build the "testfixture" test
113+
harness. The names of the source files used by "testfixture" all begin
114+
with "test".
115+
The **src/** also contains the "shell.c" file
116+
which is the main program for the "sqlite3.exe"
117+
[command-line shell](https://sqlite.org/cli.html) and
118+
the "tclsqlite.c" file which implements the
119+
[TCL bindings](https://sqlite.org/tclsqlite.html) for SQLite.
120+
(Historical note: SQLite began as a Tcl
115121
extension and only later escaped to the wild as an independent library.)
116122

117123
Test scripts and programs are found in the **test/** subdirectory.
118-
There are other test suites for SQLite (see
119-
[How SQLite Is Tested](http://www.sqlite.org/testing.html))
120-
but those other test suites are
121-
in separate source repositories.
124+
Addtional test code is found in other source repositories.
125+
See [How SQLite Is Tested](http://www.sqlite.org/testing.html) for
126+
additional information.
122127

123128
The **ext/** subdirectory contains code for extensions. The
124129
Full-text search engine is in **ext/fts3**. The R-Tree engine is in
@@ -142,7 +147,7 @@ manually-edited files and automatically-generated files.
142147
The SQLite interface is defined by the **sqlite3.h** header file, which is
143148
generated from src/sqlite.h.in, ./manifest.uuid, and ./VERSION. The
144149
[Tcl script](http://www.tcl.tk) at tool/mksqlite3h.tcl does the conversion.
145-
The manifest.uuid file contains the SHA1 hash of the particular check-in
150+
The manifest.uuid file contains the SHA3 hash of the particular check-in
146151
and is used to generate the SQLITE\_SOURCE\_ID macro. The VERSION file
147152
contains the current SQLite version number. The sqlite3.h header is really
148153
just a copy of src/sqlite.h.in with the source-id and version number inserted
@@ -153,9 +158,8 @@ used to generate that documentation are in a separate source repository.
153158
The SQL language parser is **parse.c** which is generate from a grammar in
154159
the src/parse.y file. The conversion of "parse.y" into "parse.c" is done
155160
by the [lemon](./doc/lemon.html) LALR(1) parser generator. The source code
156-
for lemon is at tool/lemon.c. Lemon uses a
157-
template for generating its parser. A generic template is in tool/lempar.c,
158-
but SQLite uses a slightly modified template found in src/lempar.c.
161+
for lemon is at tool/lemon.c. Lemon uses the tool/lempar.c file as a
162+
template for generating its parser.
159163

160164
Lemon also generates the **parse.h** header file, at the same time it
161165
generates parse.c. But the parse.h header file is
@@ -175,6 +179,13 @@ that maps SQL language keywords (ex: "CREATE", "SELECT", "INDEX", etc.) into
175179
the numeric codes used by the parse.c parser. The keywordhash.h file is
176180
generated by a C-language program at tool mkkeywordhash.c.
177181

182+
The **pragma.h** header file contains various definitions used to parse
183+
and implement the PRAGMA statements. The header is generated by a
184+
script **tool/mkpragmatab.tcl**. If you want to add a new PRAGMA, edit
185+
the **tool/mkpragmatab.tcl** file to insert the information needed by the
186+
parser for your new PRAGMA, then run the script to regenerate the
187+
**pragma.h** header file.
188+
178189
### The Amalgamation
179190

180191
All of the individual C source code and header files (both manually-edited
@@ -192,7 +203,7 @@ subdirectory (using the equivalent of "make target_source") then the
192203
tool/mksqlite3c.tcl script is run to copy them all together in just the
193204
right order while resolving internal "#include" references.
194205

195-
The amalgamation source file is more than 100K lines long. Some symbolic
206+
The amalgamation source file is more than 200K lines long. Some symbolic
196207
debuggers (most notably MSVC) are unable to deal with files longer than 64K
197208
lines. To work around this, a separate Tcl script, tool/split-sqlite3c.tcl,
198209
can be run on the amalgamation to break it up into a single small C file
@@ -209,14 +220,15 @@ See the [architectural description](http://www.sqlite.org/arch.html)
209220
for details. Other documents that are useful in
210221
(helping to understand how SQLite works include the
211222
[file format](http://www.sqlite.org/fileformat2.html) description,
212-
the [virtual machine](http://www.sqlite.org/vdbe.html) that runs
223+
the [virtual machine](http://www.sqlite.org/opcode.html) that runs
213224
prepared statements, the description of
214225
[how transactions work](http://www.sqlite.org/atomiccommit.html), and
215226
the [overview of the query planner](http://www.sqlite.org/optoverview.html).
216227

217-
Unfortunately, years of effort have gone into optimizating SQLite, both
228+
Years of effort have gone into optimizating SQLite, both
218229
for small size and high performance. And optimizations tend to result in
219-
complex code. So there is a lot of complexity in the SQLite implementation.
230+
complex code. So there is a lot of complexity in the current SQLite
231+
implementation. It will not be the easiest library in the world to hack.
220232

221233
Key files:
222234

@@ -227,7 +239,7 @@ Key files:
227239
* **sqliteInt.h** - this header file defines many of the data objects
228240
used internally by SQLite.
229241

230-
* **parse.y** - This file describes the LALR(1) grammer that SQLite uses
242+
* **parse.y** - This file describes the LALR(1) grammar that SQLite uses
231243
to parse SQL statements, and the actions that are taken at each step
232244
in the parsing process.
233245

@@ -260,13 +272,13 @@ Key files:
260272
is not part of the core SQLite library. But as most of the tests in this
261273
repository are written in Tcl, the Tcl language bindings are important.
262274

263-
There are many other source files. Each has a suscinct header comment that
275+
There are many other source files. Each has a succinct header comment that
264276
describes its purpose and role within the larger system.
265277

266278

267279
## Contacts
268280

269281
The main SQLite webpage is [http://www.sqlite.org/](http://www.sqlite.org/)
270-
with geographically distributed backup servers at
282+
with geographically distributed backups at
271283
[http://www2.sqlite.org/](http://www2.sqlite.org) and
272284
[http://www3.sqlite.org/](http://www3.sqlite.org).

sqlite/VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.19.3
1+
3.20.0

sqlite/autoconf/Makefile.am

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ sqlite3_LDADD = @EXTRA_SHELL_OBJ@ @READLINE_LIBS@
1212
sqlite3_DEPENDENCIES = @EXTRA_SHELL_OBJ@
1313
sqlite3_CFLAGS = $(AM_CFLAGS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS
1414

15-
include_HEADERS = sqlite3.h sqlite3ext.h msvc.h
15+
include_HEADERS = sqlite3.h sqlite3ext.h
1616

1717
EXTRA_DIST = sqlite3.1 tea Makefile.msc sqlite3.rc README.txt Replace.cs
1818
pkgconfigdir = ${libdir}/pkgconfig

sqlite/autoconf/Makefile.msc

+1-1
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ LIBRESOBJS =
927927
# when the shell is not being dynamically linked.
928928
#
929929
!IF $(DYNAMIC_SHELL)==0 && $(FOR_WIN10)==0
930-
SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS
930+
SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS -DSQLITE_ENABLE_STMTVTAB
931931
!ENDIF
932932

933933

sqlite/configure

+9-9
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.19.3.
3+
# Generated by GNU Autoconf 2.69 for sqlite 3.20.0.
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.19.3'
730-
PACKAGE_STRING='sqlite 3.19.3'
729+
PACKAGE_VERSION='3.20.0'
730+
PACKAGE_STRING='sqlite 3.20.0'
731731
PACKAGE_BUGREPORT=''
732732
PACKAGE_URL=''
733733

@@ -1463,7 +1463,7 @@ if test "$ac_init_help" = "long"; then
14631463
# Omit some internal or obsolete options to make the list less imposing.
14641464
# This message is too long to be a string in the A/UX 3.1 sh.
14651465
cat <<_ACEOF
1466-
\`configure' configures sqlite 3.19.3 to adapt to many kinds of systems.
1466+
\`configure' configures sqlite 3.20.0 to adapt to many kinds of systems.
14671467
14681468
Usage: $0 [OPTION]... [VAR=VALUE]...
14691469
@@ -1528,7 +1528,7 @@ fi
15281528

15291529
if test -n "$ac_init_help"; then
15301530
case $ac_init_help in
1531-
short | recursive ) echo "Configuration of sqlite 3.19.3:";;
1531+
short | recursive ) echo "Configuration of sqlite 3.20.0:";;
15321532
esac
15331533
cat <<\_ACEOF
15341534
@@ -1652,7 +1652,7 @@ fi
16521652
test -n "$ac_init_help" && exit $ac_status
16531653
if $ac_init_version; then
16541654
cat <<\_ACEOF
1655-
sqlite configure 3.19.3
1655+
sqlite configure 3.20.0
16561656
generated by GNU Autoconf 2.69
16571657
16581658
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2071,7 +2071,7 @@ cat >config.log <<_ACEOF
20712071
This file contains any messages produced by compilers while
20722072
running configure, to aid debugging if configure makes a mistake.
20732073
2074-
It was created by sqlite $as_me 3.19.3, which was
2074+
It was created by sqlite $as_me 3.20.0, which was
20752075
generated by GNU Autoconf 2.69. Invocation command line was
20762076
20772077
$ $0 $@
@@ -12151,7 +12151,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
1215112151
# report actual input values of CONFIG_FILES etc. instead of their
1215212152
# values after options handling.
1215312153
ac_log="
12154-
This file was extended by sqlite $as_me 3.19.3, which was
12154+
This file was extended by sqlite $as_me 3.20.0, which was
1215512155
generated by GNU Autoconf 2.69. Invocation command line was
1215612156
1215712157
CONFIG_FILES = $CONFIG_FILES
@@ -12217,7 +12217,7 @@ _ACEOF
1221712217
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
1221812218
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
1221912219
ac_cs_version="\\
12220-
sqlite config.status 3.19.3
12220+
sqlite config.status 3.20.0
1222112221
configured by $0, generated by GNU Autoconf 2.69,
1222212222
with options \\"\$ac_cs_config\\"
1222312223

sqlite/doc/lemon.html

+20
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,26 @@ <h1 align=center>The Lemon Parser Generator</h1>
2323
<p>This document is an introduction to the Lemon
2424
parser generator.</p>
2525

26+
<h2>Security Note</h2>
27+
28+
<p>The language parser code created by Lemon is very robust and
29+
is well-suited for use in internet-facing applications that need to
30+
safely process maliciously crafted inputs.
31+
32+
<p>The "lemon.exe" command-line tool itself works great when given a valid
33+
input grammar file and almost always gives helpful
34+
error messages for malformed inputs. However, it is possible for
35+
a malicious user to craft a grammar file that will cause
36+
lemon.exe to crash.
37+
We do not see this as a problem, as lemon.exe is not intended to be used
38+
with hostile inputs.
39+
To summarize:</p>
40+
41+
<ul>
42+
<li>Parser code generated by lemon &rarr; Robust and secure
43+
<li>The "lemon.exe" command line tool itself &rarr; Not so much
44+
</ul>
45+
2646
<h2>Theory of Operation</h2>
2747

2848
<p>The main goal of Lemon is to translate a context free grammar (CFG)

0 commit comments

Comments
 (0)