Skip to content

Commit 2654480

Browse files
committed
Merge sqlite-release(3.51.3) into prerelease-integration
2 parents b3444ee + 2b30a9f commit 2654480

274 files changed

Lines changed: 11467 additions & 26559 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.

Makefile.msc

Lines changed: 127 additions & 76 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 50 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -154,9 +154,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
154154
<h1 align="center">SQLite Source Repository</h1>
155155

156156
This repository contains the complete source code for the
157-
[SQLite database engine](https://sqlite.org/) going back
158-
to 2000-05-29. The tree includes many tests and some
159-
documentation, though additional tests and most documentation
157+
[SQLite database engine](https://sqlite.org/), including
158+
many tests. Additional tests and most documentation
160159
are managed separately.
161160

162161
See the [on-line documentation](https://sqlite.org/) for more information
@@ -253,32 +252,31 @@ script found at the root of the source tree. Then run "make".
253252

254253
For example:
255254

256-
apt install gcc make tcl-dev ;# Install the necessary build tools
255+
apt install gcc make tcl-dev ;# Make sure you have all the necessary build tools
257256
tar xzf sqlite.tar.gz ;# Unpack the source tree into "sqlite"
258-
mkdir bld ;# Build happens in a sibling directory
257+
mkdir bld ;# Build will occur in a sibling directory
259258
cd bld ;# Change to the build directory
260259
../sqlite/configure ;# Run the configure script
261-
make sqlite3 ;# The "sqlite3" command-line tool
262-
make sqlite3.c ;# The "amalgamation" source file
263-
make sqldiff ;# The "sqldiff" command-line tool
264-
#### Targets below require tcl-dev ####
265-
make tclextension-install ;# Install the SQLite TCL extension
260+
make sqlite3 ;# Builds the "sqlite3" command-line tool
261+
make sqlite3.c ;# Build the "amalgamation" source file
262+
make sqldiff ;# Builds the "sqldiff" command-line tool
263+
# Makefile targets below this point require tcl-dev
264+
make tclextension-install ;# Build and install the SQLite TCL extension
266265
make devtest ;# Run development tests
267266
make releasetest ;# Run full release tests
268267
make sqlite3_analyzer ;# Builds the "sqlite3_analyzer" tool
269268

270269
See the makefile for additional targets. For debugging builds, the
271270
core developers typically run "configure" with options like this:
272271

273-
../sqlite/configure --all --debug CFLAGS='-O0 -g'
272+
../sqlite/configure --enable-all --enable-debug CFLAGS='-O0 -g'
274273

275274
For release builds, the core developers usually do:
276275

277-
../sqlite/configure --all
276+
../sqlite/configure --enable-all
278277

279-
Core deliverables (sqlite3.c, sqlite3) can be built without a TCL, but
280-
many makefile targets require a "tclsh" TCL interpreter version 8.6
281-
or later. The "tclextension-install" target and the test targets that follow
278+
Almost all makefile targets require a "tclsh" TCL interpreter version 8.6 or
279+
later. The "tclextension-install" target and the test targets that follow
282280
all require TCL development libraries too. ("apt install tcl-dev"). It is
283281
helpful, but is not required, to install the SQLite TCL extension (the
284282
"tclextension-install" target) prior to running tests. The "releasetest"
@@ -288,20 +286,20 @@ On "make" command-lines, one can add "OPTIONS=..." to specify additional
288286
compile-time options over and above those set by ./configure. For example,
289287
to compile with the SQLITE_OMIT_DEPRECATED compile-time option, one could say:
290288

291-
./configure --all
289+
./configure --enable-all
292290
make OPTIONS=-DSQLITE_OMIT_DEPRECATED sqlite3
293291

294-
The configure script uses [autosetup](https://msteveb.github.io/autosetup/).
295-
If the configure script does not work out for you, there is a generic
296-
makefile named "Makefile.linux-gcc" in the top directory of the source tree
297-
that you can copy and edit to suit your needs. Comments on the generic
298-
makefile show what changes are needed.
292+
The configure script uses autoconf 2.61 and libtool. If the configure
293+
script does not work out for you, there is a generic makefile named
294+
"Makefile.linux-gcc" in the top directory of the source tree that you
295+
can copy and edit to suit your needs. Comments on the generic makefile
296+
show what changes are needed.
299297

300298
## Compiling for Windows Using MSVC
301299

302300
On Windows, everything can be compiled with MSVC.
303-
You will also need a working installation of TCL if you want to run tests,
304-
though TCL is not required if you just want to build SQLite itself.
301+
You will also need a working installation of TCL if you want to run tests.
302+
TCL is not required if you just want to build SQLite itself.
305303
See the [compile-for-windows.md](doc/compile-for-windows.md) document for
306304
additional information about how to install MSVC and TCL and configure your
307305
build environment.
@@ -311,33 +309,32 @@ TCL library, using a command like this:
311309

312310
set TCLDIR=c:\Tcl
313311

314-
SQLite itself does not contain any TCL code, but it does use TCL to run
315-
tests. You may need to install TCL development libraries in order to
316-
successfully complete some makefile targets. It is helpful, but is not
317-
required, to install the SQLite TCL extension (the "tclextension-install"
318-
target) prior to running tests.
319-
320-
The source tree contains a "make.bat" file that allows the same "make"
321-
commands of Unix to work on Windows. In the following, you can substitute
322-
"nmake /f Makefile.msc" in place of "make", if you prefer to avoid this BAT
323-
file:
324-
325-
make sqlite3.exe
326-
make sqlite3.c
327-
make sqldiff.exe
328-
#### Targets below require TCL development libraries ####
329-
make tclextension-install
330-
make devtest
331-
make releasetest
332-
make sqlite3_analyzer.exe
312+
SQLite uses "tclsh.exe" as part of the build process, and so that
313+
program will need to be somewhere on your %PATH%. SQLite itself
314+
does not contain any TCL code, but it does use TCL to run tests.
315+
You may need to install TCL development
316+
libraries in order to successfully complete some makefile targets.
317+
It is helpful, but is not required, to install the SQLite TCL extension
318+
(the "tclextension-install" target) prior to running tests.
319+
320+
Build using Makefile.msc. Example:
321+
322+
nmake /f Makefile.msc sqlite3.exe
323+
nmake /f Makefile.msc sqlite3.c
324+
nmake /f Makefile.msc sqldiff.exe
325+
# Makefile targets below this point require TCL development libraries
326+
nmake /f Makefile.msc tclextension-install
327+
nmake /f Makefile.msc devtest
328+
nmake /f Makefile.msc releasetest
329+
nmake /f Makefile.msc sqlite3_analyzer.exe
333330

334331
There are many other makefile targets. See comments in Makefile.msc for
335332
details.
336333

337334
As with the unix Makefile, the OPTIONS=... argument can be passed on the nmake
338335
command-line to enable new compile-time options. For example:
339336

340-
make OPTIONS=-DSQLITE_OMIT_DEPRECATED sqlite3.exe
337+
nmake /f Makefile.msc OPTIONS=-DSQLITE_OMIT_DEPRECATED sqlite3.exe
341338

342339
## Source Tree Map
343340

@@ -350,7 +347,8 @@ command-line to enable new compile-time options. For example:
350347
* **test/** - This directory and its subdirectories contains code used
351348
for testing. Files that end in "`.test`" are TCL scripts that run
352349
tests using an augmented TCL interpreter named "testfixture". Use
353-
a command like "`make testfixture`" to build that
350+
a command like "`make testfixture`" (unix) or
351+
"`nmake /f Makefile.msc testfixture.exe`" (windows) to build that
354352
augmented TCL interpreter, then run individual tests using commands like
355353
"`testfixture test/main.test`". This test/ subdirectory also contains
356354
additional C code modules and scripts for other kinds of testing.
@@ -532,11 +530,10 @@ implementation. It will not be the easiest library in the world to hack.
532530
(and some other test programs too) is built and run when you type
533531
"make test".
534532

535-
* **VERSION**, **manifest**, **manifest.tags**, and **manifest.uuid** -
536-
These files define the current SQLite version number. The "VERSION" file
537-
is human generated, but the "manifest", "manifest.tags", and
538-
"manifest.uuid" files are automatically generated by the
539-
[Fossil version control system](https://fossil-scm.org/).
533+
* **VERSION**, **manifest**, and **manifest.uuid** - These files define
534+
the current SQLite version number. The "VERSION" file is human generated,
535+
but the "manifest" and "manifest.uuid" files are automatically generated
536+
by the [Fossil version control system](https://fossil-scm.org/).
540537

541538
There are many other source files. Each has a succinct header comment that
542539
describes its purpose and role within the larger system.
@@ -562,6 +559,10 @@ makefile:
562559

563560
> make verify-source
564561
562+
Or on windows:
563+
564+
> nmake /f Makefile.msc verify-source
565+
565566
Using the makefile to verify source integrity is good for detecting
566567
accidental changes to the source tree, but malicious changes could be
567568
hidden by also modifying the makefiles.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.52.0
1+
3.51.3

autoconf/Makefile.in

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,19 @@ sqlite_cfg.h: $(AS_AUTO_DEF)
117117
# CFLAGS for sqlite3$(T.exe)
118118
#
119119
SHELL_OPT ?= @OPT_SHELL@
120+
SHELL_OPT += -DSQLITE_DQS=0
121+
SHELL_OPT += -DSQLITE_ENABLE_FTS4
122+
#SHELL_OPT += -DSQLITE_ENABLE_FTS5
123+
SHELL_OPT += -DSQLITE_ENABLE_RTREE
124+
SHELL_OPT += -DSQLITE_ENABLE_EXPLAIN_COMMENTS
125+
SHELL_OPT += -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
126+
SHELL_OPT += -DSQLITE_ENABLE_STMTVTAB
127+
SHELL_OPT += -DSQLITE_ENABLE_DBPAGE_VTAB
128+
SHELL_OPT += -DSQLITE_ENABLE_DBSTAT_VTAB
129+
SHELL_OPT += -DSQLITE_ENABLE_BYTECODE_VTAB
130+
SHELL_OPT += -DSQLITE_ENABLE_OFFSET_SQL_FUNC
131+
SHELL_OPT += -DSQLITE_ENABLE_PERCENTILE
132+
SHELL_OPT += -DSQLITE_STRICT_SUBTYPE=1
120133

121134
#
122135
# Library-level feature flags
@@ -282,7 +295,7 @@ DIST_FILES := \
282295
README.txt VERSION \
283296
auto.def autosetup configure tea \
284297
sqlite3.h sqlite3.c shell.c sqlite3ext.h \
285-
Makefile.in Makefile.msc Makefile.fallback make.bat \
298+
Makefile.in Makefile.msc Makefile.fallback \
286299
sqlite3.rc sqlite3rc.h Replace.cs \
287300
sqlite3.pc.in sqlite3.1
288301

autoconf/Makefile.msc

Lines changed: 90 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@ NO_WARN = $(NO_WARN) -wd4210 -wd4232 -wd4244 -wd4305 -wd4306 -wd4702 -wd4706
101101
!ENDIF
102102
!ENDIF
103103

104+
# Set this non-0 to use the library paths and other options necessary for
105+
# Windows Phone 8.1.
106+
#
107+
!IFNDEF USE_WP81_OPTS
108+
USE_WP81_OPTS = 0
109+
!ENDIF
110+
104111
# Set this non-0 to split the SQLite amalgamation file into chunks to
105112
# be used for debugging with Visual Studio.
106113
#
@@ -149,6 +156,14 @@ USE_NATIVE_LIBPATHS = 0
149156
USE_RC = 1
150157
!ENDIF
151158

159+
# Set this non-0 to compile binaries suitable for the WinRT environment.
160+
# This setting does not apply to any binaries that require Tcl to operate
161+
# properly (i.e. the text fixture, etc).
162+
#
163+
!IFNDEF FOR_WINRT
164+
FOR_WINRT = 0
165+
!ENDIF
166+
152167
# Set this non-0 to compile binaries suitable for the UWP environment.
153168
# This setting does not apply to any binaries that require Tcl to operate
154169
# properly (i.e. the text fixture, etc).
@@ -548,14 +563,10 @@ RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) $(RCOPTS) $(RCCOPTS)
548563
!IF "$(PLATFORM)"=="x86"
549564
CORE_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
550565
SHELL_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
551-
552-
553566
!ELSE
554567
!IFNDEF PLATFORM
555568
CORE_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
556569
SHELL_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
557-
558-
559570
!ELSE
560571
CORE_CCONV_OPTS =
561572
SHELL_CCONV_OPTS =
@@ -656,6 +667,18 @@ SHELL_LINK_OPTS = $(SHELL_CORE_LIB)
656667
TCC = $(TCC) -FAcs
657668
!ENDIF
658669

670+
# When compiling the library for use in the WinRT environment,
671+
# the following compile-time options must be used as well to
672+
# disable use of Win32 APIs that are not available and to enable
673+
# use of Win32 APIs that are specific to Windows 8 and/or WinRT.
674+
#
675+
!IF $(FOR_WINRT)!=0
676+
TCC = $(TCC) -DSQLITE_OS_WINRT=1
677+
RCC = $(RCC) -DSQLITE_OS_WINRT=1
678+
TCC = $(TCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
679+
RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
680+
!ENDIF
681+
659682
# C compiler options for the Windows 10 platform (needs MSVC 2015).
660683
#
661684
!IF $(FOR_WIN10)!=0
@@ -668,7 +691,7 @@ BCC = $(BCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
668691
# USE_CRT_DLL option is set to force dynamically linking to the
669692
# MSVC runtime library.
670693
#
671-
!IF $(USE_CRT_DLL)!=0
694+
!IF $(FOR_WINRT)!=0 || $(USE_CRT_DLL)!=0
672695
!IF $(DEBUG)>1
673696
TCC = $(TCC) -MDd
674697
BCC = $(BCC) -MDd
@@ -691,6 +714,16 @@ ZLIBCFLAGS = -nologo -MT -W3 -O2 -Oy- -Zi
691714
!ENDIF
692715

693716

717+
# Define -DNDEBUG to compile without debugging (i.e., for production usage)
718+
# Omitting the define will cause extra debugging code to be inserted and
719+
# includes extra comments when "EXPLAIN stmt" is used.
720+
#
721+
!IF $(DEBUG)==0
722+
TCC = $(TCC) -DNDEBUG
723+
BCC = $(BCC) -DNDEBUG
724+
RCC = $(RCC) -DNDEBUG
725+
!ENDIF
726+
694727
!IF $(DEBUG)>0 || $(API_ARMOR)!=0 || $(FOR_WIN10)!=0
695728
TCC = $(TCC) -DSQLITE_ENABLE_API_ARMOR=1
696729
RCC = $(RCC) -DSQLITE_ENABLE_API_ARMOR=1
@@ -880,6 +913,56 @@ LTLINKOPTS = /NOLOGO
880913
LTLIBOPTS = /NOLOGO
881914
!ENDIF
882915

916+
# When compiling for use in the WinRT environment, the following
917+
# linker option must be used to mark the executable as runnable
918+
# only in the context of an application container.
919+
#
920+
!IF $(FOR_WINRT)!=0
921+
LTLINKOPTS = $(LTLINKOPTS) /APPCONTAINER
922+
!IF "$(VISUALSTUDIOVERSION)"=="12.0" || "$(VISUALSTUDIOVERSION)"=="14.0"
923+
!IFNDEF STORELIBPATH
924+
!IF "$(PLATFORM)"=="x86"
925+
STORELIBPATH = $(CRTLIBPATH)\store
926+
!ELSEIF "$(PLATFORM)"=="x64"
927+
STORELIBPATH = $(CRTLIBPATH)\store\amd64
928+
!ELSEIF "$(PLATFORM)"=="ARM"
929+
STORELIBPATH = $(CRTLIBPATH)\store\arm
930+
!ELSE
931+
STORELIBPATH = $(CRTLIBPATH)\store
932+
!ENDIF
933+
!ENDIF
934+
STORELIBPATH = $(STORELIBPATH:\\=\)
935+
LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(STORELIBPATH)"
936+
!ENDIF
937+
!ENDIF
938+
939+
# When compiling for Windows Phone 8.1, an extra library path is
940+
# required.
941+
#
942+
!IF $(USE_WP81_OPTS)!=0
943+
!IFNDEF WP81LIBPATH
944+
!IF "$(PLATFORM)"=="x86"
945+
WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
946+
!ELSEIF "$(PLATFORM)"=="ARM"
947+
WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\ARM
948+
!ELSE
949+
WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
950+
!ENDIF
951+
!ENDIF
952+
!ENDIF
953+
954+
# When compiling for Windows Phone 8.1, some extra linker options
955+
# are also required.
956+
#
957+
!IF $(USE_WP81_OPTS)!=0
958+
!IFDEF WP81LIBPATH
959+
LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)"
960+
!ENDIF
961+
LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE
962+
LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib
963+
LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib
964+
!ENDIF
965+
883966
# When compiling for UWP or the Windows 10 platform, some extra linker
884967
# options are also required.
885968
#
@@ -903,9 +986,9 @@ LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib
903986
# If either debugging or symbols are enabled, enable PDBs.
904987
#
905988
!IF $(DEBUG)>1 || $(SYMBOLS)!=0
906-
LDFLAGS = /NODEFAULTLIB:msvcrt /DEBUG $(LDOPTS)
989+
LDFLAGS = /DEBUG $(LDOPTS)
907990
!ELSE
908-
LDFLAGS = /NODEFAULTLIB:msvcrt $(LDOPTS)
991+
LDFLAGS = $(LDOPTS)
909992
!ENDIF
910993

911994

@@ -941,7 +1024,6 @@ SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_OFFSET_SQL_FUNC=1
9411024
SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_PERCENTILE=1
9421025
SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION=1
9431026
SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_STMT_SCANSTATUS=1
944-
SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_ENABLE_BYTECODE_VTAB=1
9451027
SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_STRICT_SUBTYPE=1
9461028
!ENDIF
9471029

@@ -990,8 +1072,6 @@ $(SQLITE3EXE): shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLIT
9901072
/link $(SQLITE3EXEPDB) $(LDFLAGS) $(LTLINKOPTS) $(SHELL_LINK_OPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
9911073

9921074

993-
tclsqlite-ex.c:
994-
9951075
# Rule to build the amalgamation
9961076
#
9971077
sqlite3.lo: $(SQLITE3C)

0 commit comments

Comments
 (0)