Skip to content

Commit 801ae64

Browse files
committed
Snapshot of upstream SQLite 3.28.0
1 parent 49234e8 commit 801ae64

175 files changed

Lines changed: 48425 additions & 3395 deletions

File tree

Some content is hidden

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

LICENSE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
The author disclaims copyright to this source code. In place of
2+
a legal notice, here is a blessing:
3+
4+
* May you do good and not evil.
5+
* May you find forgiveness for yourself and forgive others.
6+
* May you share freely, never taking more than you give.

Makefile.in

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@ TESTSRC = \
422422
$(TOP)/src/test_tclsh.c \
423423
$(TOP)/src/test_tclvar.c \
424424
$(TOP)/src/test_thread.c \
425+
$(TOP)/src/test_vdbecov.c \
425426
$(TOP)/src/test_vfs.c \
426427
$(TOP)/src/test_windirent.c \
427428
$(TOP)/src/test_window.c \
@@ -1050,12 +1051,9 @@ opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/tool/mkopcodeh.tcl
10501051
#
10511052
parse.h: parse.c
10521053

1053-
parse.c: $(TOP)/src/parse.y lemon$(BEXE) $(TOP)/tool/addopcodes.tcl
1054+
parse.c: $(TOP)/src/parse.y lemon$(BEXE)
10541055
cp $(TOP)/src/parse.y .
1055-
rm -f parse.h
10561056
./lemon$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) parse.y
1057-
mv parse.h parse.h.temp
1058-
$(TCLSH_CMD) $(TOP)/tool/addopcodes.tcl parse.h.temp >parse.h
10591057

10601058
sqlite3.h: $(TOP)/src/sqlite.h.in $(TOP)/manifest mksourceid$(BEXE) $(TOP)/VERSION
10611059
$(TCLSH_CMD) $(TOP)/tool/mksqlite3h.tcl $(TOP) >sqlite3.h
@@ -1149,10 +1147,10 @@ fts3_write.lo: $(TOP)/ext/fts3/fts3_write.c $(HDR) $(EXTHDR)
11491147
rtree.lo: $(TOP)/ext/rtree/rtree.c $(HDR) $(EXTHDR)
11501148
$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/rtree/rtree.c
11511149

1152-
sqlite3session.lo: $(TOP)/ext/userauth/userauth.c $(HDR) $(EXTHDR)
1150+
userauth.lo: $(TOP)/ext/userauth/userauth.c $(HDR) $(EXTHDR)
11531151
$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/userauth/userauth.c
11541152

1155-
userauth.lo: $(TOP)/ext/session/sqlite3session.c $(HDR) $(EXTHDR)
1153+
sqlite3session.lo: $(TOP)/ext/session/sqlite3session.c $(HDR) $(EXTHDR)
11561154
$(LTCOMPILE) -DSQLITE_CORE -c $(TOP)/ext/session/sqlite3session.c
11571155

11581156
json1.lo: $(TOP)/ext/misc/json1.c
@@ -1374,8 +1372,9 @@ loadfts$(EXE): $(TOP)/tool/loadfts.c libsqlite3.la
13741372
# releasetest.tcl script.
13751373
#
13761374
VALIDIDS=' sqlite3(changeset|changegroup|session)?_'
1377-
checksymbols: sqlite3.lo
1378-
nm -g --defined-only sqlite3.lo | egrep -v $(VALIDIDS); test $$? -ne 0
1375+
checksymbols: sqlite3.o
1376+
nm -g --defined-only sqlite3.o
1377+
nm -g --defined-only sqlite3.o | egrep -v $(VALIDIDS); test $$? -ne 0
13791378
echo '0 errors out of 1 tests'
13801379

13811380
# Build the amalgamation-autoconf package. The amalamgation-tarball target builds
@@ -1424,7 +1423,7 @@ install: sqlite3$(TEXE) lib_install sqlite3.h sqlite3.pc ${HAVE_TCL:1=tcl_instal
14241423
$(INSTALL) -m 0644 sqlite3.pc $(DESTDIR)$(pkgconfigdir)
14251424

14261425
pkgIndex.tcl:
1427-
echo 'package ifneeded sqlite3 $(RELEASE) [list load $(TCLLIBDIR)/libtclsqlite3$(SHLIB_SUFFIX) sqlite3]' > $@
1426+
echo 'package ifneeded sqlite3 $(RELEASE) [list load [file join $$dir libtclsqlite3[info sharedlibextension]] sqlite3]' > $@
14281427
tcl_install: lib_install libtclsqlite3.la pkgIndex.tcl
14291428
$(INSTALL) -d $(DESTDIR)$(TCLLIBDIR)
14301429
$(LTINSTALL) libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)

Makefile.msc

Lines changed: 47 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,13 @@ SQLITETCLH = sqlite_tcl.h
320320
SQLITETCLDECLSH = sqlite_tclDecls.h
321321
!ENDIF
322322

323+
# This is the name to use for the dynamic link library (DLL) containing the
324+
# Tcl bindings for SQLite.
325+
#
326+
!IFNDEF SQLITE3TCLDLL
327+
SQLITE3TCLDLL = tclsqlite3.dll
328+
!ENDIF
329+
323330
# These are the additional targets that the targets that integrate with the
324331
# Tcl library should depend on when compiling, etc.
325332
#
@@ -495,9 +502,9 @@ UCRTLIBPATH = $(UCRTLIBPATH:\\=\)
495502
# will run on the platform that is doing the build.
496503
#
497504
!IF $(USE_FULLWARN)!=0
498-
BCC = $(NCC) -nologo -W4 $(CCOPTS) $(BCCOPTS)
505+
BCC = $(NCC) -nologo -W4 -Fd$*.pdb $(CCOPTS) $(BCCOPTS)
499506
!ELSE
500-
BCC = $(NCC) -nologo -W3 $(CCOPTS) $(BCCOPTS)
507+
BCC = $(NCC) -nologo -W3 -Fd$*.pdb $(CCOPTS) $(BCCOPTS)
501508
!ENDIF
502509

503510
# Check if assembly code listings should be generated for the source
@@ -853,6 +860,14 @@ RCC = $(RCC) -DSQLITE_WIN32_MALLOC_VALIDATE=1
853860
# prior to running nmake in order to match the actual installed location and
854861
# version on this machine.
855862
#
863+
!IFNDEF TCLVERSION
864+
TCLVERSION = 86
865+
!ENDIF
866+
867+
!IFNDEF TCLSUFFIX
868+
TCLSUFFIX =
869+
!ENDIF
870+
856871
!IFNDEF TCLDIR
857872
TCLDIR = $(TOP)\compat\tcl
858873
!ENDIF
@@ -866,11 +881,11 @@ TCLLIBDIR = $(TCLDIR)\lib
866881
!ENDIF
867882

868883
!IFNDEF LIBTCL
869-
LIBTCL = tcl86.lib
884+
LIBTCL = tcl$(TCLVERSION)$(TCLSUFFIX).lib
870885
!ENDIF
871886

872887
!IFNDEF LIBTCLSTUB
873-
LIBTCLSTUB = tclstub86.lib
888+
LIBTCLSTUB = tclstub$(TCLVERSION)$(TCLSUFFIX).lib
874889
!ENDIF
875890

876891
!IFNDEF LIBTCLPATH
@@ -1063,7 +1078,7 @@ RCC = $(RCC) -I$(ICUINCDIR)
10631078
# Command line prefixes for compiling code, compiling resources,
10641079
# linking, etc.
10651080
#
1066-
LTCOMPILE = $(TCC) -Fo$@
1081+
LTCOMPILE = $(TCC) -Fo$@ -Fd$*.pdb
10671082
LTRCOMPILE = $(RCC) -r
10681083
LTLIB = lib.exe
10691084
LTLINK = $(TCC) -Fe$@
@@ -1081,6 +1096,11 @@ LTLIBS = $(LTLIBS) rpcrt4.lib
10811096
!IFDEF PLATFORM
10821097
LTLINKOPTS = /NOLOGO /MACHINE:$(PLATFORM)
10831098
LTLIBOPTS = /NOLOGO /MACHINE:$(PLATFORM)
1099+
!ELSEIF "$(VISUALSTUDIOVERSION)"=="12.0" || \
1100+
"$(VISUALSTUDIOVERSION)"=="14.0" || \
1101+
"$(VISUALSTUDIOVERSION)"=="15.0"
1102+
LTLINKOPTS = /NOLOGO /MACHINE:x86
1103+
LTLIBOPTS = /NOLOGO /MACHINE:x86
10841104
!ELSE
10851105
LTLINKOPTS = /NOLOGO
10861106
LTLIBOPTS = /NOLOGO
@@ -1497,6 +1517,7 @@ TESTSRC = \
14971517
$(TOP)\src\test_tclsh.c \
14981518
$(TOP)\src\test_tclvar.c \
14991519
$(TOP)\src\test_thread.c \
1520+
$(TOP)\src\test_vdbecov.c \
15001521
$(TOP)\src\test_vfs.c \
15011522
$(TOP)\src\test_windirent.c \
15021523
$(TOP)\src\test_window.c \
@@ -1665,7 +1686,7 @@ TESTOPTS = --verbose=file --output=test-out.txt
16651686
# Extra targets for the "all" target that require Tcl.
16661687
#
16671688
!IF $(NO_TCL)==0
1668-
ALL_TCL_TARGETS = libtclsqlite3.lib
1689+
ALL_TCL_TARGETS = $(SQLITE3TCLDLL)
16691690
!ELSE
16701691
ALL_TCL_TARGETS =
16711692
!ENDIF
@@ -1697,7 +1718,22 @@ libsqlite3.lib: $(LIBOBJ)
16971718
$(LTLIB) $(LTLIBOPTS) /OUT:$@ $(LIBOBJ) $(TLIBS)
16981719

16991720
libtclsqlite3.lib: tclsqlite.lo libsqlite3.lib
1700-
$(LTLIB) $(LTLIBOPTS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS)
1721+
$(LTLIB) $(LTLIBOPTS) $(TCLLIBPATHS) $(LTLIBPATHS) /OUT:$@ tclsqlite.lo libsqlite3.lib $(LIBTCLSTUB) $(TLIBS)
1722+
1723+
tclsqlite3.def: tclsqlite.lo
1724+
echo EXPORTS > tclsqlite3.def
1725+
dumpbin /all tclsqlite.lo \
1726+
| $(TCLSH_CMD) $(TOP)\tool\replace.tcl include "^\s+/EXPORT:_?((?:Sqlite3|Tclsqlite3)_[^@]*)(?:@\d+)?$$" \1 \
1727+
| sort >> tclsqlite3.def
1728+
1729+
pkgIndex.tcl: $(TOP)\VERSION
1730+
for /F %%V in ('type "$(TOP)\VERSION"') do ( \
1731+
echo package ifneeded sqlite3 @version@ [list load [file join $$dir $(SQLITE3TCLDLL)] sqlite3] \
1732+
| $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact @version@ %%V > pkgIndex.tcl \
1733+
)
1734+
1735+
$(SQLITE3TCLDLL): libtclsqlite3.lib $(LIBRESOBJS) tclsqlite3.def pkgIndex.tcl
1736+
$(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /DEF:tclsqlite3.def /OUT:$@ libtclsqlite3.lib $(LIBRESOBJS) $(LTLIBS) $(TLIBS)
17011737
# <</mark>>
17021738

17031739
$(SQLITE3DLL): $(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)
@@ -1837,7 +1873,7 @@ opcodes.lo: opcodes.c
18371873
#
18381874
!IF $(USE_RC)!=0
18391875
# <<block1>>
1840-
$(LIBRESOBJS): $(TOP)\src\sqlite3.rc $(SQLITE3H)
1876+
$(LIBRESOBJS): $(TOP)\src\sqlite3.rc $(SQLITE3H) $(TOP)\VERSION
18411877
echo #ifndef SQLITE_RESOURCE_VERSION > sqlite3rc.h
18421878
for /F %%V in ('type "$(TOP)\VERSION"') do ( \
18431879
echo #define SQLITE_RESOURCE_VERSION %%V \
@@ -2103,12 +2139,10 @@ opcodes.h: parse.h $(TOP)\src\vdbe.c $(TOP)\tool\mkopcodeh.tcl
21032139
#
21042140
parse.h: parse.c
21052141

2106-
parse.c: $(TOP)\src\parse.y lemon.exe $(TOP)\tool\addopcodes.tcl
2142+
parse.c: $(TOP)\src\parse.y lemon.exe
21072143
del /Q parse.y parse.h parse.h.temp 2>NUL
21082144
copy $(TOP)\src\parse.y .
21092145
.\lemon.exe $(REQ_FEATURE_FLAGS) $(OPT_FEATURE_FLAGS) $(EXT_FEATURE_FLAGS) $(OPTS) parse.y
2110-
move parse.h parse.h.temp
2111-
$(TCLSH_CMD) $(TOP)\tool\addopcodes.tcl parse.h.temp > parse.h
21122146

21132147
$(SQLITE3H): $(TOP)\src\sqlite.h.in $(TOP)\manifest mksourceid.exe $(TOP)\VERSION
21142148
$(TCLSH_CMD) $(TOP)\tool\mksqlite3h.tcl $(TOP:\=/) > $(SQLITE3H) $(MKSQLITE3H_ARGS)
@@ -2514,6 +2548,7 @@ clean:
25142548
del /Q *.bsc *.def *.cod *.da *.bb *.bbg *.vc gmon.out 2>NUL
25152549
del /Q $(SQLITE3EXE) $(SQLITE3DLL) Replace.exe 2>NUL
25162550
# <<mark>>
2551+
del /Q $(SQLITE3TCLDLL) pkgIndex.tcl 2>NUL
25172552
del /Q opcodes.c opcodes.h 2>NUL
25182553
del /Q lemon.* lempar.c parse.* 2>NUL
25192554
del /Q mksourceid.* mkkeywordhash.* keywordhash.h 2>NUL
@@ -2524,6 +2559,7 @@ clean:
25242559
del /Q .target_source 2>NUL
25252560
del /Q tclsqlite3.exe $(SQLITETCLH) $(SQLITETCLDECLSH) 2>NUL
25262561
del /Q lsm.dll lsmtest.exe 2>NUL
2562+
del /Q atrc.exe changesetfuzz.exe dbtotxt.exe index_usage.exe 2>NUL
25272563
del /Q testloadext.dll 2>NUL
25282564
del /Q testfixture.exe test.db 2>NUL
25292565
del /Q LogEst.exe fts3view.exe rollback-test.exe showdb.exe dbdump.exe 2>NUL

README.md

Lines changed: 54 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,28 @@ This repository contains the complete source code for the
55
are also included. However, many other test scripts
66
and most of the documentation are managed separately.
77

8-
SQLite [does not use Git](https://sqlite.org/whynotgit.html).
9-
If you are reading this on GitHub, then you are looking at an
10-
unofficial mirror. See <https://sqlite.org/src> for the official
11-
repository.
12-
13-
## Obtaining The Code
8+
## Version Control
149

1510
SQLite sources are managed using the
1611
[Fossil](https://www.fossil-scm.org/), a distributed version control system
17-
that was specifically designed to support SQLite development.
12+
that was specifically designed and written to support SQLite development.
13+
The [Fossil repository](https://sqlite.org/src/timeline) contains the urtext.
14+
15+
If you are reading this on GitHub or some other Git repository or service,
16+
then you are looking at a mirror. The names of check-ins and
17+
other artifacts in a Git mirror are different from the official
18+
names for those objects. The offical names for check-ins are
19+
found in a footer on the check-in comment for authorized mirrors.
20+
The official check-in name can also be seen in the `manifest.uuid` file
21+
in the root of the tree. Always use the official name, not the
22+
Git-name, when communicating about an SQLite check-in.
23+
24+
If you pulled your SQLite source code from a secondary source and want to
25+
verify its integrity, there are hints on how to do that in the
26+
[Verifying Code Authenticity](#vauth) section below.
27+
28+
## Obtaining The Code
29+
1830
If you do not want to use Fossil, you can download tarballs or ZIP
1931
archives or [SQLite archives](https://sqlite.org/cli.html#sqlar) as follows:
2032

@@ -29,7 +41,7 @@ archives or [SQLite archives](https://sqlite.org/cli.html#sqlar) as follows:
2941
[SQLite-archive](https://www.sqlite.org/src/sqlar/sqlite.sqlar?r=release).
3042

3143
* For other check-ins, substitute an appropriate branch name or
32-
tag or hash prefix for "release" in the URLs of the previous
44+
tag or hash prefix in place of "release" in the URLs of the previous
3345
bullet. Or browse the [timeline](https://www.sqlite.org/src/timeline)
3446
to locate the check-in desired, click on its information page link,
3547
then click on the "Tarball" or "ZIP Archive" links on the information
@@ -163,11 +175,8 @@ the src/parse.y file. The conversion of "parse.y" into "parse.c" is done
163175
by the [lemon](./doc/lemon.html) LALR(1) parser generator. The source code
164176
for lemon is at tool/lemon.c. Lemon uses the tool/lempar.c file as a
165177
template for generating its parser.
166-
167178
Lemon also generates the **parse.h** header file, at the same time it
168-
generates parse.c. But the parse.h header file is
169-
modified further (to add additional symbols) using the ./addopcodes.tcl
170-
Tcl script.
179+
generates parse.c.
171180

172181
The **opcodes.h** header file contains macros that define the numbers
173182
corresponding to opcodes in the "VDBE" virtual machine. The opcodes.h
@@ -294,10 +303,42 @@ Key files:
294303
There are many other source files. Each has a succinct header comment that
295304
describes its purpose and role within the larger system.
296305

306+
<a name="vauth"></a>
307+
## Verifying Code Authenticity
308+
309+
If you obtained an SQLite source tree from a secondary source, such as a
310+
GitHub mirror, and you want to verify that it has not been altered, there
311+
are a couple of ways to do that.
312+
313+
If you have a release version of SQLite, and you are using the
314+
`sqlite3.c` amalgamation, then SHA3-256 hashes for the amalgamation are
315+
available in the [change log](https://www.sqlite.org/changes.html) on
316+
the official website. After building the `sqlite3.c` file, you can check
317+
that it is authentic by comparing the hash. This does not ensure that the
318+
test scripts are unaltered, but it does validate the deliverable part of
319+
the code and the verification process only involves computing and
320+
comparing a single hash.
321+
322+
For versions other than an official release, or if you are building the
323+
`sqlite3.c` amalgamation using non-standard build options, the verification
324+
process is a little more involved. The `manifest` file at the root directory
325+
of the source tree
326+
contains either a SHA3-256 hash (for newer files) or a SHA1 hash (for
327+
older files) for every source file in the repository. You can write a script
328+
to extracts hashes from `manifest` and verifies the hashes against the
329+
corresponding files in the source tree. The SHA3-256 hash of the `manifest`
330+
file itself is the official name of the version of the source tree that you
331+
have. The `manifest.uuid` file should contain the SHA3-256 hash of the
332+
`manifest` file. If all of the above hash comparisons are correct, then
333+
you can be confident that your source tree is authentic and unadulterated.
334+
335+
The format of the `manifest` file should be mostly self-explanatory, but
336+
if you want details, they are available
337+
[here](https://fossil-scm.org/fossil/doc/trunk/www/fileformat.wiki#manifest).
297338

298339
## Contacts
299340

300-
The main SQLite webpage is [http://www.sqlite.org/](http://www.sqlite.org/)
341+
The main SQLite website is [http://www.sqlite.org/](http://www.sqlite.org/)
301342
with geographically distributed backups at
302343
[http://www2.sqlite.org/](http://www2.sqlite.org) and
303344
[http://www3.sqlite.org/](http://www3.sqlite.org).

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.27.2
1+
3.28.0

autoconf/Makefile.msc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -433,9 +433,9 @@ UCRTLIBPATH = $(UCRTLIBPATH:\\=\)
433433
# will run on the platform that is doing the build.
434434
#
435435
!IF $(USE_FULLWARN)!=0
436-
BCC = $(NCC) -nologo -W4 $(CCOPTS) $(BCCOPTS)
436+
BCC = $(NCC) -nologo -W4 -Fd$*.pdb $(CCOPTS) $(BCCOPTS)
437437
!ELSE
438-
BCC = $(NCC) -nologo -W3 $(CCOPTS) $(BCCOPTS)
438+
BCC = $(NCC) -nologo -W3 -Fd$*.pdb $(CCOPTS) $(BCCOPTS)
439439
!ENDIF
440440

441441
# Check if assembly code listings should be generated for the source
@@ -808,7 +808,7 @@ BCC = $(BCC) -Zi
808808
# Command line prefixes for compiling code, compiling resources,
809809
# linking, etc.
810810
#
811-
LTCOMPILE = $(TCC) -Fo$@
811+
LTCOMPILE = $(TCC) -Fo$@ -Fd$*.pdb
812812
LTRCOMPILE = $(RCC) -r
813813
LTLIB = lib.exe
814814
LTLINK = $(TCC) -Fe$@
@@ -826,6 +826,11 @@ LTLIBS = $(LTLIBS) rpcrt4.lib
826826
!IFDEF PLATFORM
827827
LTLINKOPTS = /NOLOGO /MACHINE:$(PLATFORM)
828828
LTLIBOPTS = /NOLOGO /MACHINE:$(PLATFORM)
829+
!ELSEIF "$(VISUALSTUDIOVERSION)"=="12.0" || \
830+
"$(VISUALSTUDIOVERSION)"=="14.0" || \
831+
"$(VISUALSTUDIOVERSION)"=="15.0"
832+
LTLINKOPTS = /NOLOGO /MACHINE:x86
833+
LTLIBOPTS = /NOLOGO /MACHINE:x86
829834
!ELSE
830835
LTLINKOPTS = /NOLOGO
831836
LTLIBOPTS = /NOLOGO

0 commit comments

Comments
 (0)