Merge the changes for the 3.11.0 release candidate from trunk.
FossilOrigin-Name: 4d7a802e73ef0352f840bc8d74c560afb7666ff7
This commit is contained in:
commit
d8b7d6e44c
16
Makefile.in
16
Makefile.in
@ -555,7 +555,8 @@ TESTOPTS = --verbose=file --output=test-out.txt
|
||||
|
||||
# Extra compiler options for various shell tools
|
||||
#
|
||||
SHELL_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5
|
||||
SHELL_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_FTS4
|
||||
SHELL_OPT += -DSQLITE_ENABLE_EXPLAIN_COMMENTS
|
||||
FUZZERSHELL_OPT = -DSQLITE_ENABLE_JSON1
|
||||
FUZZCHECK_OPT = -DSQLITE_ENABLE_JSON1 -DSQLITE_ENABLE_MEMSYS5
|
||||
|
||||
@ -581,9 +582,9 @@ libtclsqlite3.la: tclsqlite.lo libsqlite3.la
|
||||
-version-info "8:6:8" \
|
||||
-avoid-version
|
||||
|
||||
sqlite3$(TEXE): $(TOP)/src/shell.c libsqlite3.la sqlite3.h
|
||||
sqlite3$(TEXE): $(TOP)/src/shell.c sqlite3.c
|
||||
$(LTLINK) $(READLINE_FLAGS) $(SHELL_OPT) -o $@ \
|
||||
$(TOP)/src/shell.c libsqlite3.la \
|
||||
$(TOP)/src/shell.c sqlite3.c \
|
||||
$(LIBREADLINE) $(TLIBS) -rpath "$(libdir)"
|
||||
|
||||
sqldiff$(TEXE): $(TOP)/tool/sqldiff.c sqlite3.c sqlite3.h
|
||||
@ -1168,10 +1169,15 @@ checksymbols: sqlite3.lo
|
||||
nm -g --defined-only sqlite3.o | egrep -v ' sqlite3(changeset|session)?_' ; test $$? -ne 0
|
||||
echo '0 errors out of 1 tests'
|
||||
|
||||
# Build the amalgamation-autoconf package.
|
||||
# Build the amalgamation-autoconf package. The amalamgation-tarball target builds
|
||||
# a tarball named for the version number. Ex: sqlite-autoconf-3110000.tar.gz.
|
||||
# The snapshot-tarball target builds a tarball named by the SHA1 hash
|
||||
#
|
||||
amalgamation-tarball: sqlite3.c
|
||||
TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh
|
||||
TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh --normal
|
||||
|
||||
snapshot-tarball: sqlite3.c
|
||||
TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh --snapshot
|
||||
|
||||
# The next two rules are used to support the "threadtest" target. Building
|
||||
# threadtest runs a few thread-safety tests that are implemented in C. This
|
||||
|
223
Makefile.msc
223
Makefile.msc
@ -126,12 +126,12 @@ USE_RC = 1
|
||||
FOR_WINRT = 0
|
||||
!ENDIF
|
||||
|
||||
# Set this non-0 to compile binaries suitable for the UAP environment.
|
||||
# Set this non-0 to compile binaries suitable for the UWP environment.
|
||||
# This setting does not apply to any binaries that require Tcl to operate
|
||||
# properly (i.e. the text fixture, etc).
|
||||
#
|
||||
!IFNDEF FOR_UAP
|
||||
FOR_UAP = 0
|
||||
!IFNDEF FOR_UWP
|
||||
FOR_UWP = 0
|
||||
!ENDIF
|
||||
|
||||
# Set this non-0 to compile binaries suitable for the Windows 10 platform.
|
||||
@ -414,8 +414,8 @@ TCC = $(CC) -nologo -W4 -DINCLUDE_MSVC_H=1 $(CCOPTS) $(TCCOPTS)
|
||||
TCC = $(CC) -nologo -W3 $(CCOPTS) $(TCCOPTS)
|
||||
!ENDIF
|
||||
|
||||
TCC = $(TCC) -DSQLITE_OS_WIN=1 -I$(TOP) -I$(TOP)\src -fp:precise
|
||||
RCC = $(RC) -DSQLITE_OS_WIN=1 -I$(TOP) -I$(TOP)\src $(RCOPTS) $(RCCOPTS)
|
||||
TCC = $(TCC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -I$(TOP)\src -fp:precise
|
||||
RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -I$(TOP)\src $(RCOPTS) $(RCCOPTS)
|
||||
|
||||
# Adjust the names of the primary targets for use with Windows 10.
|
||||
#
|
||||
@ -551,8 +551,8 @@ RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
|
||||
# C compiler options for the Windows 10 platform (needs MSVC 2015).
|
||||
#
|
||||
!IF $(FOR_WIN10)!=0
|
||||
TCC = $(TCC) /guard:cf -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
|
||||
BCC = $(BCC) /guard:cf -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
|
||||
TCC = $(TCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
|
||||
BCC = $(BCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
|
||||
!ENDIF
|
||||
|
||||
# Also, we need to dynamically link to the correct MSVC runtime
|
||||
@ -917,10 +917,10 @@ LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelH
|
||||
LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib
|
||||
!ENDIF
|
||||
|
||||
# When compiling for UAP or the Windows 10 platform, some extra linker
|
||||
# When compiling for UWP or the Windows 10 platform, some extra linker
|
||||
# options are also required.
|
||||
#
|
||||
!IF $(FOR_UAP)!=0 || $(FOR_WIN10)!=0
|
||||
!IF $(FOR_UWP)!=0 || $(FOR_WIN10)!=0
|
||||
LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE /NODEFAULTLIB:kernel32.lib
|
||||
LTLINKOPTS = $(LTLINKOPTS) mincore.lib
|
||||
!IFDEF PSDKLIBPATH
|
||||
@ -929,7 +929,7 @@ LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(PSDKLIBPATH)"
|
||||
!ENDIF
|
||||
|
||||
!IF $(FOR_WIN10)!=0
|
||||
LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(UCRTLIBPATH)"
|
||||
LTLINKOPTS = $(LTLINKOPTS) /guard:cf "/LIBPATH:$(UCRTLIBPATH)"
|
||||
!IF $(DEBUG)>1
|
||||
LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrtd.lib /DEFAULTLIB:ucrtd.lib
|
||||
!ELSE
|
||||
@ -1016,9 +1016,9 @@ LIBRESOBJS =
|
||||
!ENDIF
|
||||
|
||||
# <<mark>>
|
||||
# All of the source code files.
|
||||
# Core source code files, part 1.
|
||||
#
|
||||
SRC1 = \
|
||||
SRC00 = \
|
||||
$(TOP)\src\alter.c \
|
||||
$(TOP)\src\analyze.c \
|
||||
$(TOP)\src\attach.c \
|
||||
@ -1027,8 +1027,6 @@ SRC1 = \
|
||||
$(TOP)\src\bitvec.c \
|
||||
$(TOP)\src\btmutex.c \
|
||||
$(TOP)\src\btree.c \
|
||||
$(TOP)\src\btree.h \
|
||||
$(TOP)\src\btreeInt.h \
|
||||
$(TOP)\src\build.c \
|
||||
$(TOP)\src\callback.c \
|
||||
$(TOP)\src\complete.c \
|
||||
@ -1042,8 +1040,6 @@ SRC1 = \
|
||||
$(TOP)\src\func.c \
|
||||
$(TOP)\src\global.c \
|
||||
$(TOP)\src\hash.c \
|
||||
$(TOP)\src\hash.h \
|
||||
$(TOP)\src\hwtime.h \
|
||||
$(TOP)\src\insert.c \
|
||||
$(TOP)\src\journal.c \
|
||||
$(TOP)\src\legacy.c \
|
||||
@ -1056,29 +1052,22 @@ SRC1 = \
|
||||
$(TOP)\src\mem3.c \
|
||||
$(TOP)\src\mem5.c \
|
||||
$(TOP)\src\memjournal.c \
|
||||
$(TOP)\src\msvc.h \
|
||||
$(TOP)\src\mutex.c \
|
||||
$(TOP)\src\mutex.h \
|
||||
$(TOP)\src\mutex_noop.c \
|
||||
$(TOP)\src\mutex_unix.c \
|
||||
$(TOP)\src\mutex_w32.c \
|
||||
$(TOP)\src\notify.c \
|
||||
$(TOP)\src\os.c \
|
||||
$(TOP)\src\os.h \
|
||||
$(TOP)\src\os_common.h \
|
||||
$(TOP)\src\os_setup.h \
|
||||
$(TOP)\src\os_unix.c \
|
||||
$(TOP)\src\os_win.c \
|
||||
$(TOP)\src\os_win.h
|
||||
SRC2 = \
|
||||
$(TOP)\src\os_win.c
|
||||
|
||||
# Core source code files, part 2.
|
||||
#
|
||||
SRC01 = \
|
||||
$(TOP)\src\pager.c \
|
||||
$(TOP)\src\pager.h \
|
||||
$(TOP)\src\parse.y \
|
||||
$(TOP)\src\pcache.c \
|
||||
$(TOP)\src\pcache.h \
|
||||
$(TOP)\src\pcache1.c \
|
||||
$(TOP)\src\pragma.c \
|
||||
$(TOP)\src\pragma.h \
|
||||
$(TOP)\src\prepare.c \
|
||||
$(TOP)\src\printf.c \
|
||||
$(TOP)\src\random.c \
|
||||
@ -1086,11 +1075,6 @@ SRC2 = \
|
||||
$(TOP)\src\rowset.c \
|
||||
$(TOP)\src\select.c \
|
||||
$(TOP)\src\status.c \
|
||||
$(TOP)\src\shell.c \
|
||||
$(TOP)\src\sqlite.h.in \
|
||||
$(TOP)\src\sqlite3ext.h \
|
||||
$(TOP)\src\sqliteInt.h \
|
||||
$(TOP)\src\sqliteLimit.h \
|
||||
$(TOP)\src\table.c \
|
||||
$(TOP)\src\threads.c \
|
||||
$(TOP)\src\tclsqlite.c \
|
||||
@ -1102,64 +1086,90 @@ SRC2 = \
|
||||
$(TOP)\src\util.c \
|
||||
$(TOP)\src\vacuum.c \
|
||||
$(TOP)\src\vdbe.c \
|
||||
$(TOP)\src\vdbe.h \
|
||||
$(TOP)\src\vdbeapi.c \
|
||||
$(TOP)\src\vdbeaux.c \
|
||||
$(TOP)\src\vdbeblob.c \
|
||||
$(TOP)\src\vdbemem.c \
|
||||
$(TOP)\src\vdbesort.c \
|
||||
$(TOP)\src\vdbetrace.c \
|
||||
$(TOP)\src\vdbeInt.h \
|
||||
$(TOP)\src\vtab.c \
|
||||
$(TOP)\src\vxworks.h \
|
||||
$(TOP)\src\wal.c \
|
||||
$(TOP)\src\wal.h \
|
||||
$(TOP)\src\walker.c \
|
||||
$(TOP)\src\where.c \
|
||||
$(TOP)\src\wherecode.c \
|
||||
$(TOP)\src\whereexpr.c \
|
||||
$(TOP)\src\whereexpr.c
|
||||
|
||||
# Shell source code files.
|
||||
#
|
||||
SRC02 = \
|
||||
$(TOP)\src\shell.c
|
||||
|
||||
# Core miscellaneous files.
|
||||
#
|
||||
SRC03 = \
|
||||
$(TOP)\src\parse.y
|
||||
|
||||
# Core header files, part 1.
|
||||
#
|
||||
SRC04 = \
|
||||
$(TOP)\src\btree.h \
|
||||
$(TOP)\src\btreeInt.h \
|
||||
$(TOP)\src\hash.h \
|
||||
$(TOP)\src\hwtime.h \
|
||||
$(TOP)\src\msvc.h \
|
||||
$(TOP)\src\mutex.h \
|
||||
$(TOP)\src\os.h \
|
||||
$(TOP)\src\os_common.h \
|
||||
$(TOP)\src\os_setup.h \
|
||||
$(TOP)\src\os_win.h
|
||||
|
||||
# Core header files, part 2.
|
||||
#
|
||||
SRC05 = \
|
||||
$(TOP)\src\pager.h \
|
||||
$(TOP)\src\pcache.h \
|
||||
$(TOP)\src\pragma.h \
|
||||
$(TOP)\src\sqlite.h.in \
|
||||
$(TOP)\src\sqlite3ext.h \
|
||||
$(TOP)\src\sqliteInt.h \
|
||||
$(TOP)\src\sqliteLimit.h \
|
||||
$(TOP)\src\vdbe.h \
|
||||
$(TOP)\src\vdbeInt.h \
|
||||
$(TOP)\src\vxworks.h \
|
||||
$(TOP)\src\wal.h \
|
||||
$(TOP)\src\whereInt.h
|
||||
|
||||
# Source code for extensions
|
||||
# Extension source code files, part 1.
|
||||
#
|
||||
SRC3 = \
|
||||
SRC06 = \
|
||||
$(TOP)\ext\fts1\fts1.c \
|
||||
$(TOP)\ext\fts1\fts1.h \
|
||||
$(TOP)\ext\fts1\fts1_hash.c \
|
||||
$(TOP)\ext\fts1\fts1_hash.h \
|
||||
$(TOP)\ext\fts1\fts1_porter.c \
|
||||
$(TOP)\ext\fts1\fts1_tokenizer.h \
|
||||
$(TOP)\ext\fts1\fts1_tokenizer1.c \
|
||||
$(TOP)\ext\fts2\fts2.c \
|
||||
$(TOP)\ext\fts2\fts2.h \
|
||||
$(TOP)\ext\fts2\fts2_hash.c \
|
||||
$(TOP)\ext\fts2\fts2_hash.h \
|
||||
$(TOP)\ext\fts2\fts2_icu.c \
|
||||
$(TOP)\ext\fts2\fts2_porter.c \
|
||||
$(TOP)\ext\fts2\fts2_tokenizer.h \
|
||||
$(TOP)\ext\fts2\fts2_tokenizer.c \
|
||||
$(TOP)\ext\fts2\fts2_tokenizer1.c
|
||||
SRC4 = \
|
||||
|
||||
# Extension source code files, part 2.
|
||||
#
|
||||
SRC07 = \
|
||||
$(TOP)\ext\fts3\fts3.c \
|
||||
$(TOP)\ext\fts3\fts3.h \
|
||||
$(TOP)\ext\fts3\fts3Int.h \
|
||||
$(TOP)\ext\fts3\fts3_aux.c \
|
||||
$(TOP)\ext\fts3\fts3_expr.c \
|
||||
$(TOP)\ext\fts3\fts3_hash.c \
|
||||
$(TOP)\ext\fts3\fts3_hash.h \
|
||||
$(TOP)\ext\fts3\fts3_icu.c \
|
||||
$(TOP)\ext\fts3\fts3_porter.c \
|
||||
$(TOP)\ext\fts3\fts3_snippet.c \
|
||||
$(TOP)\ext\fts3\fts3_tokenizer.h \
|
||||
$(TOP)\ext\fts3\fts3_tokenizer.c \
|
||||
$(TOP)\ext\fts3\fts3_tokenizer1.c \
|
||||
$(TOP)\ext\fts3\fts3_tokenize_vtab.c \
|
||||
$(TOP)\ext\fts3\fts3_unicode.c \
|
||||
$(TOP)\ext\fts3\fts3_unicode2.c \
|
||||
$(TOP)\ext\fts3\fts3_write.c \
|
||||
$(TOP)\ext\icu\sqliteicu.h \
|
||||
$(TOP)\ext\icu\icu.c \
|
||||
$(TOP)\ext\rtree\rtree.h \
|
||||
$(TOP)\ext\rtree\rtree.c \
|
||||
$(TOP)\ext\session\sqlite3session.h \
|
||||
$(TOP)\ext\session\sqlite3session.c \
|
||||
@ -1167,20 +1177,44 @@ SRC4 = \
|
||||
$(TOP)\ext\rbu\sqlite3rbu.c \
|
||||
$(TOP)\ext\misc\json1.c
|
||||
|
||||
# Extension header files, part 1.
|
||||
#
|
||||
SRC08 = \
|
||||
$(TOP)\ext\fts1\fts1.h \
|
||||
$(TOP)\ext\fts1\fts1_hash.h \
|
||||
$(TOP)\ext\fts1\fts1_tokenizer.h \
|
||||
$(TOP)\ext\fts2\fts2.h \
|
||||
$(TOP)\ext\fts2\fts2_hash.h \
|
||||
$(TOP)\ext\fts2\fts2_tokenizer.h
|
||||
|
||||
# Extension header files, part 2.
|
||||
#
|
||||
SRC09 = \
|
||||
$(TOP)\ext\fts3\fts3.h \
|
||||
$(TOP)\ext\fts3\fts3Int.h \
|
||||
$(TOP)\ext\fts3\fts3_hash.h \
|
||||
$(TOP)\ext\fts3\fts3_tokenizer.h \
|
||||
$(TOP)\ext\icu\sqliteicu.h \
|
||||
$(TOP)\ext\rtree\rtree.h \
|
||||
$(TOP)\ext\rbu\sqlite3rbu.h
|
||||
|
||||
# Generated source code files
|
||||
#
|
||||
SRC5 = \
|
||||
keywordhash.h \
|
||||
SRC10 = \
|
||||
opcodes.c \
|
||||
parse.c
|
||||
|
||||
# Generated header files
|
||||
#
|
||||
SRC11 = \
|
||||
keywordhash.h \
|
||||
opcodes.h \
|
||||
parse.c \
|
||||
parse.h \
|
||||
$(SQLITE3H)
|
||||
|
||||
# All source code files.
|
||||
#
|
||||
SRC = $(SRC1) $(SRC2) $(SRC3) $(SRC4) $(SRC5)
|
||||
SRC = $(SRC00) $(SRC01) $(SRC02) $(SRC03) $(SRC04) $(SRC05) $(SRC06) $(SRC07) $(SRC08) $(SRC09) $(SRC10) $(SRC11)
|
||||
|
||||
# Source code to the test files.
|
||||
#
|
||||
@ -1230,7 +1264,7 @@ TESTSRC = \
|
||||
$(TOP)\ext\session\test_session.c \
|
||||
$(TOP)\ext\rbu\test_rbu.c
|
||||
|
||||
# Statically linked extensions
|
||||
# Statically linked extensions.
|
||||
#
|
||||
TESTEXT = \
|
||||
$(TOP)\ext\misc\amatch.c \
|
||||
@ -1250,57 +1284,15 @@ TESTEXT = \
|
||||
$(TOP)\ext\misc\totype.c \
|
||||
$(TOP)\ext\misc\wholenumber.c
|
||||
|
||||
|
||||
# Source code to the library files needed by the test fixture
|
||||
# (non-amalgamation)
|
||||
#
|
||||
TESTSRC2 = \
|
||||
$(TOP)\src\attach.c \
|
||||
$(TOP)\src\backup.c \
|
||||
$(TOP)\src\bitvec.c \
|
||||
$(TOP)\src\btree.c \
|
||||
$(TOP)\src\build.c \
|
||||
$(TOP)\src\ctime.c \
|
||||
$(TOP)\src\date.c \
|
||||
$(TOP)\src\dbstat.c \
|
||||
$(TOP)\src\expr.c \
|
||||
$(TOP)\src\func.c \
|
||||
$(TOP)\src\insert.c \
|
||||
$(TOP)\src\wal.c \
|
||||
$(TOP)\src\main.c \
|
||||
$(TOP)\src\mem5.c \
|
||||
$(TOP)\src\os.c \
|
||||
$(TOP)\src\os_unix.c \
|
||||
$(TOP)\src\os_win.c \
|
||||
$(TOP)\src\pager.c \
|
||||
$(TOP)\src\pragma.c \
|
||||
$(TOP)\src\prepare.c \
|
||||
$(TOP)\src\printf.c \
|
||||
$(TOP)\src\random.c \
|
||||
$(TOP)\src\pcache.c \
|
||||
$(TOP)\src\pcache1.c \
|
||||
$(TOP)\src\select.c \
|
||||
$(TOP)\src\tokenize.c \
|
||||
$(TOP)\src\utf.c \
|
||||
$(TOP)\src\util.c \
|
||||
$(TOP)\src\vdbeapi.c \
|
||||
$(TOP)\src\vdbeaux.c \
|
||||
$(TOP)\src\vdbe.c \
|
||||
$(TOP)\src\vdbemem.c \
|
||||
$(TOP)\src\vdbesort.c \
|
||||
$(TOP)\src\vdbetrace.c \
|
||||
$(TOP)\src\where.c \
|
||||
$(TOP)\src\wherecode.c \
|
||||
$(TOP)\src\whereexpr.c \
|
||||
parse.c \
|
||||
$(TOP)\ext\fts3\fts3.c \
|
||||
$(TOP)\ext\fts3\fts3_aux.c \
|
||||
$(TOP)\ext\fts3\fts3_expr.c \
|
||||
$(TOP)\ext\fts3\fts3_tokenizer.c \
|
||||
$(TOP)\ext\fts3\fts3_tokenize_vtab.c \
|
||||
$(TOP)\ext\fts3\fts3_unicode.c \
|
||||
$(TOP)\ext\fts3\fts3_unicode2.c \
|
||||
$(TOP)\ext\fts3\fts3_write.c \
|
||||
$(SRC00) \
|
||||
$(SRC01) \
|
||||
$(SRC06) \
|
||||
$(SRC07) \
|
||||
$(SRC10) \
|
||||
$(TOP)\ext\async\sqlite3async.c \
|
||||
$(TOP)\ext\session\sqlite3session.c
|
||||
|
||||
@ -1383,7 +1375,7 @@ FUZZDATA = \
|
||||
# when the shell is not being dynamically linked.
|
||||
#
|
||||
!IF $(DYNAMIC_SHELL)==0 && $(FOR_WIN10)==0
|
||||
SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5
|
||||
SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS
|
||||
!ENDIF
|
||||
|
||||
# <<mark>>
|
||||
@ -1484,11 +1476,18 @@ mptest: mptester.exe
|
||||
.target_source: $(SRC) $(TOP)\tool\vdbe-compress.tcl fts5.c
|
||||
-rmdir /Q/S tsrc 2>NUL
|
||||
-mkdir tsrc
|
||||
for %i in ($(SRC1)) do copy /Y %i tsrc
|
||||
for %i in ($(SRC2)) do copy /Y %i tsrc
|
||||
for %i in ($(SRC3)) do copy /Y %i tsrc
|
||||
for %i in ($(SRC4)) do copy /Y %i tsrc
|
||||
for %i in ($(SRC5)) do copy /Y %i tsrc
|
||||
for %i in ($(SRC00)) do copy /Y %i tsrc
|
||||
for %i in ($(SRC01)) do copy /Y %i tsrc
|
||||
for %i in ($(SRC02)) do copy /Y %i tsrc
|
||||
for %i in ($(SRC03)) do copy /Y %i tsrc
|
||||
for %i in ($(SRC04)) do copy /Y %i tsrc
|
||||
for %i in ($(SRC05)) do copy /Y %i tsrc
|
||||
for %i in ($(SRC06)) do copy /Y %i tsrc
|
||||
for %i in ($(SRC07)) do copy /Y %i tsrc
|
||||
for %i in ($(SRC08)) do copy /Y %i tsrc
|
||||
for %i in ($(SRC09)) do copy /Y %i tsrc
|
||||
for %i in ($(SRC10)) do copy /Y %i tsrc
|
||||
for %i in ($(SRC11)) do copy /Y %i tsrc
|
||||
copy /Y fts5.c tsrc
|
||||
copy /Y fts5.h tsrc
|
||||
del /Q tsrc\sqlite.h.in tsrc\parse.y 2>NUL
|
||||
@ -1937,7 +1936,7 @@ TESTFIXTURE_FLAGS = -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1
|
||||
TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_SERVER=1 -DSQLITE_PRIVATE=""
|
||||
TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS) -DSQLITE_CORE $(NO_WARN)
|
||||
|
||||
TESTFIXTURE_SRC0 = $(TESTEXT) $(TESTSRC2) $(SHELL_CORE_DEP)
|
||||
TESTFIXTURE_SRC0 = $(TESTEXT) $(TESTSRC2)
|
||||
TESTFIXTURE_SRC1 = $(TESTEXT) $(TESTSRC3) $(SQLITE3C)
|
||||
!IF $(USE_AMALGAMATION)==0
|
||||
TESTFIXTURE_SRC = $(TESTSRC) $(TOP)\src\tclsqlite.c $(TESTFIXTURE_SRC0)
|
||||
|
@ -6,11 +6,10 @@ libsqlite3_la_SOURCES = sqlite3.c
|
||||
libsqlite3_la_LDFLAGS = -no-undefined -version-info 8:6:8
|
||||
|
||||
bin_PROGRAMS = sqlite3
|
||||
sqlite3_SOURCES = shell.c sqlite3.h
|
||||
EXTRA_sqlite3_SOURCES = sqlite3.c
|
||||
sqlite3_LDADD = @EXTRA_SHELL_OBJ@ @READLINE_LIBS@
|
||||
sqlite3_SOURCES = shell.c sqlite3.c sqlite3.h
|
||||
sqlite3_LDADD = @READLINE_LIBS@
|
||||
sqlite3_DEPENDENCIES = @EXTRA_SHELL_OBJ@
|
||||
sqlite3_CFLAGS = $(AM_CFLAGS)
|
||||
sqlite3_CFLAGS = $(AM_CFLAGS) -DSQLITE_ENABLE_EXPLAIN_COMMENTS
|
||||
|
||||
include_HEADERS = sqlite3.h sqlite3ext.h
|
||||
|
||||
|
@ -119,12 +119,12 @@ USE_RC = 1
|
||||
FOR_WINRT = 0
|
||||
!ENDIF
|
||||
|
||||
# Set this non-0 to compile binaries suitable for the UAP environment.
|
||||
# Set this non-0 to compile binaries suitable for the UWP environment.
|
||||
# This setting does not apply to any binaries that require Tcl to operate
|
||||
# properly (i.e. the text fixture, etc).
|
||||
#
|
||||
!IFNDEF FOR_UAP
|
||||
FOR_UAP = 0
|
||||
!IFNDEF FOR_UWP
|
||||
FOR_UWP = 0
|
||||
!ENDIF
|
||||
|
||||
# Set this non-0 to compile binaries suitable for the Windows 10 platform.
|
||||
@ -399,8 +399,8 @@ TCC = $(CC) -nologo -W4 -DINCLUDE_MSVC_H=1 $(CCOPTS) $(TCCOPTS)
|
||||
TCC = $(CC) -nologo -W3 $(CCOPTS) $(TCCOPTS)
|
||||
!ENDIF
|
||||
|
||||
TCC = $(TCC) -DSQLITE_OS_WIN=1 -I$(TOP) -fp:precise
|
||||
RCC = $(RC) -DSQLITE_OS_WIN=1 -I$(TOP) $(RCOPTS) $(RCCOPTS)
|
||||
TCC = $(TCC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -fp:precise
|
||||
RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) $(RCOPTS) $(RCCOPTS)
|
||||
|
||||
# Adjust the names of the primary targets for use with Windows 10.
|
||||
#
|
||||
@ -536,8 +536,8 @@ RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
|
||||
# C compiler options for the Windows 10 platform (needs MSVC 2015).
|
||||
#
|
||||
!IF $(FOR_WIN10)!=0
|
||||
TCC = $(TCC) /guard:cf -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
|
||||
BCC = $(BCC) /guard:cf -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
|
||||
TCC = $(TCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
|
||||
BCC = $(BCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
|
||||
!ENDIF
|
||||
|
||||
# Also, we need to dynamically link to the correct MSVC runtime
|
||||
@ -802,10 +802,10 @@ LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelH
|
||||
LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib
|
||||
!ENDIF
|
||||
|
||||
# When compiling for UAP or the Windows 10 platform, some extra linker
|
||||
# When compiling for UWP or the Windows 10 platform, some extra linker
|
||||
# options are also required.
|
||||
#
|
||||
!IF $(FOR_UAP)!=0 || $(FOR_WIN10)!=0
|
||||
!IF $(FOR_UWP)!=0 || $(FOR_WIN10)!=0
|
||||
LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE /NODEFAULTLIB:kernel32.lib
|
||||
LTLINKOPTS = $(LTLINKOPTS) mincore.lib
|
||||
!IFDEF PSDKLIBPATH
|
||||
@ -814,7 +814,7 @@ LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(PSDKLIBPATH)"
|
||||
!ENDIF
|
||||
|
||||
!IF $(FOR_WIN10)!=0
|
||||
LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(UCRTLIBPATH)"
|
||||
LTLINKOPTS = $(LTLINKOPTS) /guard:cf "/LIBPATH:$(UCRTLIBPATH)"
|
||||
!IF $(DEBUG)>1
|
||||
LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrtd.lib /DEFAULTLIB:ucrtd.lib
|
||||
!ELSE
|
||||
@ -856,7 +856,7 @@ LIBRESOBJS =
|
||||
# when the shell is not being dynamically linked.
|
||||
#
|
||||
!IF $(DYNAMIC_SHELL)==0 && $(FOR_WIN10)==0
|
||||
SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_FTS5
|
||||
SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS) -DSQLITE_SHELL_JSON1 -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_EXPLAIN_COMMENTS
|
||||
!ENDIF
|
||||
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
This package contains:
|
||||
|
||||
* the SQLite library amalgamation (single file) source code distribution,
|
||||
* the shell.c file used to build the sqlite3 shell too, and
|
||||
* the sqlite3.h and sqlite3ext.h header files required to link programs
|
||||
and sqlite extensions against the installed libary.
|
||||
* the SQLite library amalgamation source code file: sqlite3.c
|
||||
* the sqlite3.h and sqlite3ext.h header files that define the C-language
|
||||
interface to the sqlite3.c library file
|
||||
* the shell.c file used to build the sqlite3 command-line shell program
|
||||
* autoconf/automake installation infrastucture for building on POSIX
|
||||
compliant systems.
|
||||
compliant systems
|
||||
* a Makefile.msc and sqlite3.rc for building with Microsoft Visual C++ on
|
||||
Windows.
|
||||
Windows
|
||||
|
||||
SUMMARY OF HOW TO BUILD
|
||||
=======================
|
||||
@ -39,7 +39,7 @@ to produce a smaller installation footprint.
|
||||
Other SQLite compilation parameters can also be set using CFLAGS. For
|
||||
example:
|
||||
|
||||
$ CFLAGS="-Os -DSQLITE_OMIT_TRIGGERS" ./configure
|
||||
$ CFLAGS="-Os -DSQLITE_THREADSAFE=0" ./configure
|
||||
|
||||
|
||||
BUILDING WITH MICROSOFT VISUAL C++
|
||||
@ -75,10 +75,10 @@ NMAKE command line as well:
|
||||
|
||||
"NSDKLIBPATH=%WindowsSdkDir%\..\8.1\lib\winv6.3\um\x86"
|
||||
|
||||
Building for UAP 10.0
|
||||
Building for UWP 10.0
|
||||
---------------------
|
||||
|
||||
FOR_WINRT=1 FOR_UAP=1
|
||||
FOR_WINRT=1 FOR_UWP=1
|
||||
|
||||
Using Microsoft Visual C++ 2015 (or later) is required. When using the
|
||||
above, something like the following macros will need to be added to the
|
||||
|
@ -18,6 +18,12 @@
|
||||
# define NDEBUG 1
|
||||
#endif
|
||||
|
||||
/* FTS3/FTS4 require virtual tables */
|
||||
#ifdef SQLITE_OMIT_VIRTUALTABLE
|
||||
# undef SQLITE_ENABLE_FTS3
|
||||
# undef SQLITE_ENABLE_FTS4
|
||||
#endif
|
||||
|
||||
/*
|
||||
** FTS4 is really an extension for FTS3. It is enabled using the
|
||||
** SQLITE_ENABLE_FTS3 macro. But to avoid confusion we also all
|
||||
|
@ -226,9 +226,9 @@ proc print_isalnum {zFunc lRange} {
|
||||
an_print_range_array $lRange
|
||||
an_print_ascii_bitmap $lRange
|
||||
puts {
|
||||
if( c<128 ){
|
||||
if( (unsigned int)c<128 ){
|
||||
return ( (aAscii[c >> 5] & (1 << (c & 0x001F)))==0 );
|
||||
}else if( c<(1<<22) ){
|
||||
}else if( (unsigned int)c<(1<<22) ){
|
||||
unsigned int key = (((unsigned int)c)<<10) | 0x000003FF;
|
||||
int iRes = 0;
|
||||
int iHi = sizeof(aEntry)/sizeof(aEntry[0]) - 1;
|
||||
|
@ -26,6 +26,7 @@ SQLITE_EXTENSION_INIT1
|
||||
typedef unsigned char u8;
|
||||
typedef unsigned int u32;
|
||||
typedef unsigned short u16;
|
||||
typedef short i16;
|
||||
typedef sqlite3_int64 i64;
|
||||
typedef sqlite3_uint64 u64;
|
||||
|
||||
@ -80,6 +81,16 @@ extern int sqlite3_fts5_may_be_corrupt;
|
||||
# define assert_nc(x) assert(x)
|
||||
#endif
|
||||
|
||||
/* Mark a function parameter as unused, to suppress nuisance compiler
|
||||
** warnings. */
|
||||
#ifndef UNUSED_PARAM
|
||||
# define UNUSED_PARAM(X) (void)(X)
|
||||
#endif
|
||||
|
||||
#ifndef UNUSED_PARAM2
|
||||
# define UNUSED_PARAM2(X, Y) (void)(X), (void)(Y)
|
||||
#endif
|
||||
|
||||
typedef struct Fts5Global Fts5Global;
|
||||
typedef struct Fts5Colset Fts5Colset;
|
||||
|
||||
@ -345,16 +356,6 @@ struct Fts5IndexIter {
|
||||
int sqlite3Fts5IndexOpen(Fts5Config *pConfig, int bCreate, Fts5Index**, char**);
|
||||
int sqlite3Fts5IndexClose(Fts5Index *p);
|
||||
|
||||
/*
|
||||
** for(
|
||||
** sqlite3Fts5IndexQuery(p, "token", 5, 0, 0, &pIter);
|
||||
** 0==sqlite3Fts5IterEof(pIter);
|
||||
** sqlite3Fts5IterNext(pIter)
|
||||
** ){
|
||||
** i64 iRowid = sqlite3Fts5IterRowid(pIter);
|
||||
** }
|
||||
*/
|
||||
|
||||
/*
|
||||
** Return a simple checksum value based on the arguments.
|
||||
*/
|
||||
@ -396,7 +397,6 @@ int sqlite3Fts5IndexQuery(
|
||||
*/
|
||||
int sqlite3Fts5IterNext(Fts5IndexIter*);
|
||||
int sqlite3Fts5IterNextFrom(Fts5IndexIter*, i64 iMatch);
|
||||
i64 sqlite3Fts5IterRowid(Fts5IndexIter*);
|
||||
|
||||
/*
|
||||
** Close an iterator opened by sqlite3Fts5IndexQuery().
|
||||
@ -681,7 +681,7 @@ int sqlite3Fts5ExprPopulatePoslists(
|
||||
void sqlite3Fts5ExprCheckPoslists(Fts5Expr*, i64);
|
||||
void sqlite3Fts5ExprClearEof(Fts5Expr*);
|
||||
|
||||
int sqlite3Fts5ExprClonePhrase(Fts5Config*, Fts5Expr*, int, Fts5Expr**);
|
||||
int sqlite3Fts5ExprClonePhrase(Fts5Expr*, int, Fts5Expr**);
|
||||
|
||||
int sqlite3Fts5ExprPhraseCollist(Fts5Expr *, int, const u8 **, int *);
|
||||
|
||||
|
@ -158,6 +158,8 @@ static int fts5HighlightCb(
|
||||
int rc = SQLITE_OK;
|
||||
int iPos;
|
||||
|
||||
UNUSED_PARAM2(pToken, nToken);
|
||||
|
||||
if( tflags & FTS5_TOKEN_COLOCATED ) return SQLITE_OK;
|
||||
iPos = p->iPos++;
|
||||
|
||||
@ -391,6 +393,7 @@ static int fts5CountCb(
|
||||
void *pUserData /* Pointer to sqlite3_int64 variable */
|
||||
){
|
||||
sqlite3_int64 *pn = (sqlite3_int64*)pUserData;
|
||||
UNUSED_PARAM2(pApi, pFts);
|
||||
(*pn)++;
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
@ -236,7 +236,7 @@ int sqlite3Fts5PoslistWriterAppend(
|
||||
Fts5PoslistWriter *pWriter,
|
||||
i64 iPos
|
||||
){
|
||||
int rc;
|
||||
int rc = 0; /* Initialized only to suppress erroneous warning from Clang */
|
||||
if( fts5BufferGrow(&rc, pBuf, 5+5+5) ) return rc;
|
||||
sqlite3Fts5PoslistSafeAppend(pBuf, &pWriter->iPrev, iPos);
|
||||
return SQLITE_OK;
|
||||
@ -390,6 +390,3 @@ void sqlite3Fts5TermsetFree(Fts5Termset *p){
|
||||
sqlite3_free(p);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -206,7 +206,7 @@ static int fts5ConfigSetEnum(
|
||||
const char *zEnum,
|
||||
int *peVal
|
||||
){
|
||||
int nEnum = strlen(zEnum);
|
||||
int nEnum = (int)strlen(zEnum);
|
||||
int i;
|
||||
int iVal = -1;
|
||||
|
||||
@ -943,4 +943,3 @@ int sqlite3Fts5ConfigLoad(Fts5Config *pConfig, int iCookie){
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
@ -320,8 +320,6 @@ static i64 fts5ExprSynonymRowid(Fts5ExprTerm *pTerm, int bDesc, int *pbEof){
|
||||
*/
|
||||
static int fts5ExprSynonymList(
|
||||
Fts5ExprTerm *pTerm,
|
||||
int bCollist,
|
||||
Fts5Colset *pColset,
|
||||
i64 iRowid,
|
||||
Fts5Buffer *pBuf, /* Use this buffer for space if required */
|
||||
u8 **pa, int *pn
|
||||
@ -405,7 +403,6 @@ static int fts5ExprSynonymList(
|
||||
*/
|
||||
static int fts5ExprPhraseIsMatch(
|
||||
Fts5ExprNode *pNode, /* Node pPhrase belongs to */
|
||||
Fts5Colset *pColset, /* Restrict matches to these columns */
|
||||
Fts5ExprPhrase *pPhrase, /* Phrase object to initialize */
|
||||
int *pbMatch /* OUT: Set to true if really a match */
|
||||
){
|
||||
@ -434,9 +431,7 @@ static int fts5ExprPhraseIsMatch(
|
||||
u8 *a = 0;
|
||||
if( pTerm->pSynonym ){
|
||||
Fts5Buffer buf = {0, 0, 0};
|
||||
rc = fts5ExprSynonymList(
|
||||
pTerm, 0, pColset, pNode->iRowid, &buf, &a, &n
|
||||
);
|
||||
rc = fts5ExprSynonymList(pTerm, pNode->iRowid, &buf, &a, &n);
|
||||
if( rc ){
|
||||
sqlite3_free(a);
|
||||
goto ismatch_out;
|
||||
@ -727,7 +722,7 @@ static int fts5ExprNearTest(
|
||||
Fts5ExprPhrase *pPhrase = pNear->apPhrase[i];
|
||||
if( pPhrase->nTerm>1 || pPhrase->aTerm[0].pSynonym || pNear->pColset ){
|
||||
int bMatch = 0;
|
||||
rc = fts5ExprPhraseIsMatch(pNode, pNear->pColset, pPhrase, &bMatch);
|
||||
rc = fts5ExprPhraseIsMatch(pNode, pPhrase, &bMatch);
|
||||
if( bMatch==0 ) break;
|
||||
}else{
|
||||
Fts5IndexIter *pIter = pPhrase->aTerm[0].pIter;
|
||||
@ -1476,6 +1471,8 @@ static int fts5ParseTokenize(
|
||||
TokenCtx *pCtx = (TokenCtx*)pContext;
|
||||
Fts5ExprPhrase *pPhrase = pCtx->pPhrase;
|
||||
|
||||
UNUSED_PARAM2(iUnused1, iUnused2);
|
||||
|
||||
/* If an error has already occurred, this is a no-op */
|
||||
if( pCtx->rc!=SQLITE_OK ) return pCtx->rc;
|
||||
|
||||
@ -1611,7 +1608,6 @@ Fts5ExprPhrase *sqlite3Fts5ParseTerm(
|
||||
** expression passed as the second argument.
|
||||
*/
|
||||
int sqlite3Fts5ExprClonePhrase(
|
||||
Fts5Config *pConfig,
|
||||
Fts5Expr *pExpr,
|
||||
int iPhrase,
|
||||
Fts5Expr **ppNew
|
||||
@ -1619,14 +1615,10 @@ int sqlite3Fts5ExprClonePhrase(
|
||||
int rc = SQLITE_OK; /* Return code */
|
||||
Fts5ExprPhrase *pOrig; /* The phrase extracted from pExpr */
|
||||
int i; /* Used to iterate through phrase terms */
|
||||
|
||||
Fts5Expr *pNew = 0; /* Expression to return via *ppNew */
|
||||
|
||||
TokenCtx sCtx = {0,0}; /* Context object for fts5ParseTokenize */
|
||||
|
||||
|
||||
pOrig = pExpr->apExprPhrase[iPhrase];
|
||||
|
||||
pNew = (Fts5Expr*)sqlite3Fts5MallocZero(&rc, sizeof(Fts5Expr));
|
||||
if( rc==SQLITE_OK ){
|
||||
pNew->apExprPhrase = (Fts5ExprPhrase**)sqlite3Fts5MallocZero(&rc,
|
||||
@ -2399,13 +2391,15 @@ static int fts5ExprPopulatePoslistsCb(
|
||||
int tflags, /* Mask of FTS5_TOKEN_* flags */
|
||||
const char *pToken, /* Pointer to buffer containing token */
|
||||
int nToken, /* Size of token in bytes */
|
||||
int iStart, /* Byte offset of token within input text */
|
||||
int iEnd /* Byte offset of end of token within input text */
|
||||
int iUnused1, /* Byte offset of token within input text */
|
||||
int iUnused2 /* Byte offset of end of token within input text */
|
||||
){
|
||||
Fts5ExprCtx *p = (Fts5ExprCtx*)pCtx;
|
||||
Fts5Expr *pExpr = p->pExpr;
|
||||
int i;
|
||||
|
||||
UNUSED_PARAM2(iUnused1, iUnused2);
|
||||
|
||||
if( (tflags & FTS5_TOKEN_COLOCATED)==0 ) p->iOff++;
|
||||
for(i=0; i<pExpr->nPhrase; i++){
|
||||
Fts5ExprTerm *pTerm;
|
||||
@ -2550,7 +2544,7 @@ int sqlite3Fts5ExprPhraseCollist(
|
||||
if( pTerm->pSynonym ){
|
||||
Fts5Buffer *pBuf = (Fts5Buffer*)&pTerm->pSynonym[1];
|
||||
rc = fts5ExprSynonymList(
|
||||
pTerm, 1, 0, pNode->iRowid, pBuf, (u8**)ppCollist, pnCollist
|
||||
pTerm, pNode->iRowid, pBuf, (u8**)ppCollist, pnCollist
|
||||
);
|
||||
}else{
|
||||
*ppCollist = pPhrase->aTerm[0].pIter->pData;
|
||||
|
@ -62,10 +62,10 @@ struct Fts5HashEntry {
|
||||
int nAlloc; /* Total size of allocation */
|
||||
int iSzPoslist; /* Offset of space for 4-byte poslist size */
|
||||
int nData; /* Total bytes of data (incl. structure) */
|
||||
int nKey; /* Length of zKey[] in bytes */
|
||||
u8 bDel; /* Set delete-flag @ iSzPoslist */
|
||||
u8 bContent; /* Set content-flag (detail=none mode) */
|
||||
|
||||
int iCol; /* Column of last value written */
|
||||
i16 iCol; /* Column of last value written */
|
||||
int iPos; /* Position of last value written */
|
||||
i64 iRowid; /* Rowid of last value written */
|
||||
char zKey[8]; /* Nul-terminated entry key */
|
||||
@ -245,8 +245,8 @@ int sqlite3Fts5HashWrite(
|
||||
iHash = fts5HashKey2(pHash->nSlot, (u8)bByte, (const u8*)pToken, nToken);
|
||||
for(p=pHash->aSlot[iHash]; p; p=p->pHashNext){
|
||||
if( p->zKey[0]==bByte
|
||||
&& p->nKey==nToken
|
||||
&& memcmp(&p->zKey[1], pToken, nToken)==0
|
||||
&& p->zKey[nToken+1]==0
|
||||
){
|
||||
break;
|
||||
}
|
||||
@ -273,6 +273,7 @@ int sqlite3Fts5HashWrite(
|
||||
p->zKey[0] = bByte;
|
||||
memcpy(&p->zKey[1], pToken, nToken);
|
||||
assert( iHash==fts5HashKey(pHash->nSlot, (u8*)p->zKey, nToken+1) );
|
||||
p->nKey = nToken;
|
||||
p->zKey[nToken+1] = '\0';
|
||||
p->nData = nToken+1 + 1 + FTS5_HASHENTRYSIZE;
|
||||
p->pHashNext = pHash->aSlot[iHash];
|
||||
|
@ -607,17 +607,6 @@ static int fts5BufferCompare(Fts5Buffer *pLeft, Fts5Buffer *pRight){
|
||||
return (res==0 ? (pLeft->n - pRight->n) : res);
|
||||
}
|
||||
|
||||
#ifdef SQLITE_DEBUG
|
||||
static int fts5BlobCompare(
|
||||
const u8 *pLeft, int nLeft,
|
||||
const u8 *pRight, int nRight
|
||||
){
|
||||
int nCmp = MIN(nLeft, nRight);
|
||||
int res = memcmp(pLeft, pRight, nCmp);
|
||||
return (res==0 ? (nLeft - nRight) : res);
|
||||
}
|
||||
#endif
|
||||
|
||||
static int fts5LeafFirstTermOff(Fts5Data *pLeaf){
|
||||
int ret;
|
||||
fts5GetVarint32(&pLeaf->p[pLeaf->szLeaf], ret);
|
||||
@ -879,25 +868,34 @@ static int fts5StructureDecode(
|
||||
int nTotal;
|
||||
int iSeg;
|
||||
|
||||
i += fts5GetVarint32(&pData[i], pLvl->nMerge);
|
||||
i += fts5GetVarint32(&pData[i], nTotal);
|
||||
assert( nTotal>=pLvl->nMerge );
|
||||
pLvl->aSeg = (Fts5StructureSegment*)sqlite3Fts5MallocZero(&rc,
|
||||
nTotal * sizeof(Fts5StructureSegment)
|
||||
);
|
||||
if( i>=nData ){
|
||||
rc = FTS5_CORRUPT;
|
||||
}else{
|
||||
i += fts5GetVarint32(&pData[i], pLvl->nMerge);
|
||||
i += fts5GetVarint32(&pData[i], nTotal);
|
||||
assert( nTotal>=pLvl->nMerge );
|
||||
pLvl->aSeg = (Fts5StructureSegment*)sqlite3Fts5MallocZero(&rc,
|
||||
nTotal * sizeof(Fts5StructureSegment)
|
||||
);
|
||||
}
|
||||
|
||||
if( rc==SQLITE_OK ){
|
||||
pLvl->nSeg = nTotal;
|
||||
for(iSeg=0; iSeg<nTotal; iSeg++){
|
||||
if( i>=nData ){
|
||||
rc = FTS5_CORRUPT;
|
||||
break;
|
||||
}
|
||||
i += fts5GetVarint32(&pData[i], pLvl->aSeg[iSeg].iSegid);
|
||||
i += fts5GetVarint32(&pData[i], pLvl->aSeg[iSeg].pgnoFirst);
|
||||
i += fts5GetVarint32(&pData[i], pLvl->aSeg[iSeg].pgnoLast);
|
||||
}
|
||||
}else{
|
||||
fts5StructureRelease(pRet);
|
||||
pRet = 0;
|
||||
}
|
||||
}
|
||||
if( rc!=SQLITE_OK ){
|
||||
fts5StructureRelease(pRet);
|
||||
pRet = 0;
|
||||
}
|
||||
}
|
||||
|
||||
*ppOut = pRet;
|
||||
@ -1564,6 +1562,10 @@ static void fts5SegIterLoadTerm(Fts5Index *p, Fts5SegIter *pIter, int nKeep){
|
||||
int nNew; /* Bytes of new data */
|
||||
|
||||
iOff += fts5GetVarint32(&a[iOff], nNew);
|
||||
if( iOff+nNew>pIter->pLeaf->nn ){
|
||||
p->rc = FTS5_CORRUPT;
|
||||
return;
|
||||
}
|
||||
pIter->term.n = nKeep;
|
||||
fts5BufferAppendBlob(&p->rc, &pIter->term, nNew, &a[iOff]);
|
||||
iOff += nNew;
|
||||
@ -1770,10 +1772,12 @@ static int fts5MultiIterIsEmpty(Fts5Index *p, Fts5Iter *pIter){
|
||||
static void fts5SegIterNext_Reverse(
|
||||
Fts5Index *p, /* FTS5 backend object */
|
||||
Fts5SegIter *pIter, /* Iterator to advance */
|
||||
int *pbNewTerm /* OUT: Set for new term */
|
||||
int *pbUnused /* Unused */
|
||||
){
|
||||
assert( pIter->flags & FTS5_SEGITER_REVERSE );
|
||||
assert( pIter->pNextLeaf==0 );
|
||||
UNUSED_PARAM(pbUnused);
|
||||
|
||||
if( pIter->iRowidOffset>0 ){
|
||||
u8 *a = pIter->pLeaf->p;
|
||||
int iOff;
|
||||
@ -2250,7 +2254,6 @@ static void fts5LeafSeek(
|
||||
*/
|
||||
static void fts5SegIterSeekInit(
|
||||
Fts5Index *p, /* FTS5 backend */
|
||||
Fts5Buffer *pBuf, /* Buffer to use for loading pages */
|
||||
const u8 *pTerm, int nTerm, /* Term to seek to */
|
||||
int flags, /* Mask of FTS5INDEX_XXX flags */
|
||||
Fts5StructureSegment *pSeg, /* Description of segment */
|
||||
@ -2637,7 +2640,7 @@ static void fts5SegIterNextFrom(
|
||||
/*
|
||||
** Free the iterator object passed as the second argument.
|
||||
*/
|
||||
static void fts5MultiIterFree(Fts5Index *p, Fts5Iter *pIter){
|
||||
static void fts5MultiIterFree(Fts5Iter *pIter){
|
||||
if( pIter ){
|
||||
int i;
|
||||
for(i=0; i<pIter->nSeg; i++){
|
||||
@ -2678,7 +2681,6 @@ static void fts5MultiIterAdvanced(
|
||||
** that it deals with more complicated cases as well.
|
||||
*/
|
||||
static int fts5MultiIterAdvanceRowid(
|
||||
Fts5Index *p, /* FTS5 backend to iterate within */
|
||||
Fts5Iter *pIter, /* Iterator to update aFirst[] array for */
|
||||
int iChanged, /* Index of sub-iterator just advanced */
|
||||
Fts5SegIter **ppFirst
|
||||
@ -2753,7 +2755,7 @@ static void fts5MultiIterNext(
|
||||
}
|
||||
|
||||
if( pSeg->pLeaf==0 || bNewTerm
|
||||
|| fts5MultiIterAdvanceRowid(p, pIter, iFirst, &pSeg)
|
||||
|| fts5MultiIterAdvanceRowid(pIter, iFirst, &pSeg)
|
||||
){
|
||||
fts5MultiIterAdvanced(p, pIter, iFirst, 1);
|
||||
fts5MultiIterSetEof(pIter);
|
||||
@ -2786,7 +2788,7 @@ static void fts5MultiIterNext2(
|
||||
assert( p->rc==SQLITE_OK );
|
||||
pSeg->xNext(p, pSeg, &bNewTerm);
|
||||
if( pSeg->pLeaf==0 || bNewTerm
|
||||
|| fts5MultiIterAdvanceRowid(p, pIter, iFirst, &pSeg)
|
||||
|| fts5MultiIterAdvanceRowid(pIter, iFirst, &pSeg)
|
||||
){
|
||||
fts5MultiIterAdvanced(p, pIter, iFirst, 1);
|
||||
fts5MultiIterSetEof(pIter);
|
||||
@ -2800,7 +2802,8 @@ static void fts5MultiIterNext2(
|
||||
}
|
||||
}
|
||||
|
||||
static void fts5IterSetOutputs_Noop(Fts5Iter *pIter, Fts5SegIter *pSeg){
|
||||
static void fts5IterSetOutputs_Noop(Fts5Iter *pUnused1, Fts5SegIter *pUnused2){
|
||||
UNUSED_PARAM2(pUnused1, pUnused2);
|
||||
}
|
||||
|
||||
static Fts5Iter *fts5MultiIterAlloc(
|
||||
@ -2826,10 +2829,11 @@ static Fts5Iter *fts5MultiIterAlloc(
|
||||
}
|
||||
|
||||
static void fts5PoslistCallback(
|
||||
Fts5Index *p,
|
||||
Fts5Index *pUnused,
|
||||
void *pContext,
|
||||
const u8 *pChunk, int nChunk
|
||||
){
|
||||
UNUSED_PARAM(pUnused);
|
||||
assert_nc( nChunk>=0 );
|
||||
if( nChunk>0 ){
|
||||
fts5BufferSafeAppendBlob((Fts5Buffer*)pContext, pChunk, nChunk);
|
||||
@ -2863,11 +2867,12 @@ static int fts5IndexColsetTest(Fts5Colset *pColset, int iCol){
|
||||
}
|
||||
|
||||
static void fts5PoslistOffsetsCallback(
|
||||
Fts5Index *p,
|
||||
Fts5Index *pUnused,
|
||||
void *pContext,
|
||||
const u8 *pChunk, int nChunk
|
||||
){
|
||||
PoslistOffsetsCtx *pCtx = (PoslistOffsetsCtx*)pContext;
|
||||
UNUSED_PARAM(pUnused);
|
||||
assert_nc( nChunk>=0 );
|
||||
if( nChunk>0 ){
|
||||
int i = 0;
|
||||
@ -2885,11 +2890,12 @@ static void fts5PoslistOffsetsCallback(
|
||||
}
|
||||
|
||||
static void fts5PoslistFilterCallback(
|
||||
Fts5Index *p,
|
||||
Fts5Index *pUnused,
|
||||
void *pContext,
|
||||
const u8 *pChunk, int nChunk
|
||||
){
|
||||
PoslistCallbackCtx *pCtx = (PoslistCallbackCtx*)pContext;
|
||||
UNUSED_PARAM(pUnused);
|
||||
assert_nc( nChunk>=0 );
|
||||
if( nChunk>0 ){
|
||||
/* Search through to find the first varint with value 1. This is the
|
||||
@ -3253,7 +3259,6 @@ static void fts5MultiIterNew(
|
||||
int nSeg = 0; /* Number of segment-iters in use */
|
||||
int iIter = 0; /* */
|
||||
int iSeg; /* Used to iterate through segments */
|
||||
Fts5Buffer buf = {0,0,0}; /* Buffer used by fts5SegIterSeekInit() */
|
||||
Fts5StructureLevel *pLvl;
|
||||
Fts5Iter *pNew;
|
||||
|
||||
@ -3296,7 +3301,7 @@ static void fts5MultiIterNew(
|
||||
if( pTerm==0 ){
|
||||
fts5SegIterInit(p, pSeg, pIter);
|
||||
}else{
|
||||
fts5SegIterSeekInit(p, &buf, pTerm, nTerm, flags, pSeg, pIter);
|
||||
fts5SegIterSeekInit(p, pTerm, nTerm, flags, pSeg, pIter);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3333,11 +3338,9 @@ static void fts5MultiIterNew(
|
||||
}
|
||||
|
||||
}else{
|
||||
fts5MultiIterFree(p, pNew);
|
||||
fts5MultiIterFree(pNew);
|
||||
*ppOut = 0;
|
||||
}
|
||||
fts5BufferFree(&buf);
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
@ -3475,15 +3478,14 @@ static void fts5IndexDiscardData(Fts5Index *p){
|
||||
}
|
||||
|
||||
/*
|
||||
** Return the size of the prefix, in bytes, that buffer (nNew/pNew) shares
|
||||
** with buffer (nOld/pOld).
|
||||
** Return the size of the prefix, in bytes, that buffer
|
||||
** (pNew/<length-unknown>) shares with buffer (pOld/nOld).
|
||||
**
|
||||
** Buffer (pNew/<length-unknown>) is guaranteed to be greater
|
||||
** than buffer (pOld/nOld).
|
||||
*/
|
||||
static int fts5PrefixCompress(
|
||||
int nOld, const u8 *pOld,
|
||||
int nNew, const u8 *pNew
|
||||
){
|
||||
static int fts5PrefixCompress(int nOld, const u8 *pOld, const u8 *pNew){
|
||||
int i;
|
||||
assert( fts5BlobCompare(pOld, nOld, pNew, nNew)<0 );
|
||||
for(i=0; i<nOld; i++){
|
||||
if( pOld[i]!=pNew[i] ) break;
|
||||
}
|
||||
@ -3793,13 +3795,13 @@ static void fts5WriteAppendTerm(
|
||||
** inefficient, but still correct. */
|
||||
int n = nTerm;
|
||||
if( pPage->term.n ){
|
||||
n = 1 + fts5PrefixCompress(pPage->term.n, pPage->term.p, nTerm, pTerm);
|
||||
n = 1 + fts5PrefixCompress(pPage->term.n, pPage->term.p, pTerm);
|
||||
}
|
||||
fts5WriteBtreeTerm(p, pWriter, n, pTerm);
|
||||
pPage = &pWriter->writer;
|
||||
}
|
||||
}else{
|
||||
nPrefix = fts5PrefixCompress(pPage->term.n, pPage->term.p, nTerm, pTerm);
|
||||
nPrefix = fts5PrefixCompress(pPage->term.n, pPage->term.p, pTerm);
|
||||
fts5BufferAppendVarint(&p->rc, &pPage->buf, nPrefix);
|
||||
}
|
||||
|
||||
@ -4165,7 +4167,7 @@ static void fts5IndexMergeLevel(
|
||||
pLvl->nMerge = nInput;
|
||||
}
|
||||
|
||||
fts5MultiIterFree(p, pIter);
|
||||
fts5MultiIterFree(pIter);
|
||||
fts5BufferFree(&term);
|
||||
if( pnRem ) *pnRem -= writer.nLeafWritten;
|
||||
}
|
||||
@ -4541,9 +4543,10 @@ int sqlite3Fts5IndexMerge(Fts5Index *p, int nMerge){
|
||||
static void fts5AppendRowid(
|
||||
Fts5Index *p,
|
||||
i64 iDelta,
|
||||
Fts5Iter *pMulti,
|
||||
Fts5Iter *pUnused,
|
||||
Fts5Buffer *pBuf
|
||||
){
|
||||
UNUSED_PARAM(pUnused);
|
||||
fts5BufferAppendVarint(&p->rc, pBuf, iDelta);
|
||||
}
|
||||
|
||||
@ -4886,7 +4889,7 @@ static void fts5SetupPrefixIter(
|
||||
}
|
||||
fts5BufferFree(&aBuf[i]);
|
||||
}
|
||||
fts5MultiIterFree(p, p1);
|
||||
fts5MultiIterFree(p1);
|
||||
|
||||
pData = fts5IdxMalloc(p, sizeof(Fts5Data) + doclist.n);
|
||||
if( pData ){
|
||||
@ -5167,7 +5170,7 @@ int sqlite3Fts5IndexQuery(
|
||||
int bDesc = (flags & FTS5INDEX_QUERY_DESC)!=0;
|
||||
buf.p[0] = FTS5_MAIN_PREFIX;
|
||||
fts5SetupPrefixIter(p, bDesc, buf.p, nToken+1, pColset, &pRet);
|
||||
assert( pRet->pColset==0 );
|
||||
assert( p->rc!=SQLITE_OK || pRet->pColset==0 );
|
||||
fts5IterSetOutputCb(&p->rc, pRet);
|
||||
if( p->rc==SQLITE_OK ){
|
||||
Fts5SegIter *pSeg = &pRet->aSeg[pRet->aFirst[1].iFirst];
|
||||
@ -5250,7 +5253,7 @@ void sqlite3Fts5IterClose(Fts5IndexIter *pIndexIter){
|
||||
if( pIndexIter ){
|
||||
Fts5Iter *pIter = (Fts5Iter*)pIndexIter;
|
||||
Fts5Index *pIndex = pIter->pIndex;
|
||||
fts5MultiIterFree(pIter->pIndex, pIter);
|
||||
fts5MultiIterFree(pIter);
|
||||
fts5CloseReader(pIndex);
|
||||
}
|
||||
}
|
||||
@ -5809,7 +5812,7 @@ int sqlite3Fts5IndexIntegrityCheck(Fts5Index *p, u64 cksum){
|
||||
}
|
||||
fts5TestTerm(p, &term, 0, 0, cksum2, &cksum3);
|
||||
|
||||
fts5MultiIterFree(p, pIter);
|
||||
fts5MultiIterFree(pIter);
|
||||
if( p->rc==SQLITE_OK && cksum!=cksum2 ) p->rc = FTS5_CORRUPT;
|
||||
|
||||
fts5StructureRelease(pStruct);
|
||||
@ -6046,6 +6049,7 @@ static void fts5DecodeFunction(
|
||||
int eDetailNone = (sqlite3_user_data(pCtx)!=0);
|
||||
|
||||
assert( nArg==2 );
|
||||
UNUSED_PARAM(nArg);
|
||||
memset(&s, 0, sizeof(Fts5Buffer));
|
||||
iRowid = sqlite3_value_int64(apVal[0]);
|
||||
|
||||
|
@ -1096,7 +1096,7 @@ static i64 fts5GetRowidLimit(sqlite3_value *pVal, i64 iDefault){
|
||||
static int fts5FilterMethod(
|
||||
sqlite3_vtab_cursor *pCursor, /* The cursor used for this query */
|
||||
int idxNum, /* Strategy index */
|
||||
const char *idxStr, /* Unused */
|
||||
const char *zUnused, /* Unused */
|
||||
int nVal, /* Number of elements in apVal */
|
||||
sqlite3_value **apVal /* Arguments for the indexing scheme */
|
||||
){
|
||||
@ -1114,6 +1114,9 @@ static int fts5FilterMethod(
|
||||
sqlite3_value *pRowidGe = 0; /* rowid >= ? expression (or NULL) */
|
||||
char **pzErrmsg = pConfig->pzErrmsg;
|
||||
|
||||
UNUSED_PARAM(zUnused);
|
||||
UNUSED_PARAM(nVal);
|
||||
|
||||
if( pCsr->ePlan ){
|
||||
fts5FreeCursorComponents(pCsr);
|
||||
memset(&pCsr->ePlan, 0, sizeof(Fts5Cursor) - ((u8*)&pCsr->ePlan-(u8*)pCsr));
|
||||
@ -1398,8 +1401,7 @@ static int fts5SpecialInsert(
|
||||
|
||||
static int fts5SpecialDelete(
|
||||
Fts5Table *pTab,
|
||||
sqlite3_value **apVal,
|
||||
sqlite3_int64 *piRowid
|
||||
sqlite3_value **apVal
|
||||
){
|
||||
int rc = SQLITE_OK;
|
||||
int eType1 = sqlite3_value_type(apVal[1]);
|
||||
@ -1475,7 +1477,7 @@ static int fts5UpdateMethod(
|
||||
if( pConfig->eContent!=FTS5_CONTENT_NORMAL
|
||||
&& 0==sqlite3_stricmp("delete", z)
|
||||
){
|
||||
rc = fts5SpecialDelete(pTab, apVal, pRowid);
|
||||
rc = fts5SpecialDelete(pTab, apVal);
|
||||
}else{
|
||||
rc = fts5SpecialInsert(pTab, z, apVal[2 + pConfig->nCol + 1]);
|
||||
}
|
||||
@ -1576,6 +1578,7 @@ static int fts5SyncMethod(sqlite3_vtab *pVtab){
|
||||
** Implementation of xBegin() method.
|
||||
*/
|
||||
static int fts5BeginMethod(sqlite3_vtab *pVtab){
|
||||
UNUSED_PARAM(pVtab); /* Call below is a no-op for NDEBUG builds */
|
||||
fts5CheckTransactionState((Fts5Table*)pVtab, FTS5_BEGIN, 0);
|
||||
return SQLITE_OK;
|
||||
}
|
||||
@ -1586,6 +1589,7 @@ static int fts5BeginMethod(sqlite3_vtab *pVtab){
|
||||
** by fts5SyncMethod().
|
||||
*/
|
||||
static int fts5CommitMethod(sqlite3_vtab *pVtab){
|
||||
UNUSED_PARAM(pVtab); /* Call below is a no-op for NDEBUG builds */
|
||||
fts5CheckTransactionState((Fts5Table*)pVtab, FTS5_COMMIT, 0);
|
||||
return SQLITE_OK;
|
||||
}
|
||||
@ -1839,12 +1843,14 @@ static sqlite3_int64 fts5ApiRowid(Fts5Context *pCtx){
|
||||
static int fts5ColumnSizeCb(
|
||||
void *pContext, /* Pointer to int */
|
||||
int tflags,
|
||||
const char *pToken, /* Buffer containing token */
|
||||
int nToken, /* Size of token in bytes */
|
||||
int iStart, /* Start offset of token */
|
||||
int iEnd /* End offset of token */
|
||||
const char *pUnused, /* Buffer containing token */
|
||||
int nUnused, /* Size of token in bytes */
|
||||
int iUnused1, /* Start offset of token */
|
||||
int iUnused2 /* End offset of token */
|
||||
){
|
||||
int *pCnt = (int*)pContext;
|
||||
UNUSED_PARAM2(pUnused, nUnused);
|
||||
UNUSED_PARAM2(iUnused1, iUnused2);
|
||||
if( (tflags & FTS5_TOKEN_COLOCATED)==0 ){
|
||||
(*pCnt)++;
|
||||
}
|
||||
@ -1960,10 +1966,11 @@ static void *fts5ApiGetAuxdata(Fts5Context *pCtx, int bClear){
|
||||
}
|
||||
|
||||
static void fts5ApiPhraseNext(
|
||||
Fts5Context *pCtx,
|
||||
Fts5Context *pUnused,
|
||||
Fts5PhraseIter *pIter,
|
||||
int *piCol, int *piOff
|
||||
){
|
||||
UNUSED_PARAM(pUnused);
|
||||
if( pIter->a>=pIter->b ){
|
||||
*piCol = -1;
|
||||
*piOff = -1;
|
||||
@ -2115,12 +2122,11 @@ static int fts5ApiQueryPhrase(
|
||||
|
||||
rc = fts5OpenMethod(pCsr->base.pVtab, (sqlite3_vtab_cursor**)&pNew);
|
||||
if( rc==SQLITE_OK ){
|
||||
Fts5Config *pConf = pTab->pConfig;
|
||||
pNew->ePlan = FTS5_PLAN_MATCH;
|
||||
pNew->iFirstRowid = SMALLEST_INT64;
|
||||
pNew->iLastRowid = LARGEST_INT64;
|
||||
pNew->base.pVtab = (sqlite3_vtab*)pTab;
|
||||
rc = sqlite3Fts5ExprClonePhrase(pConf, pCsr->pExpr, iPhrase, &pNew->pExpr);
|
||||
rc = sqlite3Fts5ExprClonePhrase(pCsr->pExpr, iPhrase, &pNew->pExpr);
|
||||
}
|
||||
|
||||
if( rc==SQLITE_OK ){
|
||||
@ -2333,7 +2339,7 @@ static int fts5ColumnMethod(
|
||||
*/
|
||||
static int fts5FindFunctionMethod(
|
||||
sqlite3_vtab *pVtab, /* Virtual table handle */
|
||||
int nArg, /* Number of SQL function arguments */
|
||||
int nUnused, /* Number of SQL function arguments */
|
||||
const char *zName, /* Name of SQL function */
|
||||
void (**pxFunc)(sqlite3_context*,int,sqlite3_value**), /* OUT: Result */
|
||||
void **ppArg /* OUT: User data for *pxFunc */
|
||||
@ -2341,6 +2347,7 @@ static int fts5FindFunctionMethod(
|
||||
Fts5Table *pTab = (Fts5Table*)pVtab;
|
||||
Fts5Auxiliary *pAux;
|
||||
|
||||
UNUSED_PARAM(nUnused);
|
||||
pAux = fts5FindAuxiliary(pTab, zName);
|
||||
if( pAux ){
|
||||
*pxFunc = fts5ApiCallback;
|
||||
@ -2370,6 +2377,7 @@ static int fts5RenameMethod(
|
||||
*/
|
||||
static int fts5SavepointMethod(sqlite3_vtab *pVtab, int iSavepoint){
|
||||
Fts5Table *pTab = (Fts5Table*)pVtab;
|
||||
UNUSED_PARAM(iSavepoint); /* Call below is a no-op for NDEBUG builds */
|
||||
fts5CheckTransactionState(pTab, FTS5_SAVEPOINT, iSavepoint);
|
||||
fts5TripCursors(pTab);
|
||||
return sqlite3Fts5StorageSync(pTab->pStorage, 0);
|
||||
@ -2382,6 +2390,7 @@ static int fts5SavepointMethod(sqlite3_vtab *pVtab, int iSavepoint){
|
||||
*/
|
||||
static int fts5ReleaseMethod(sqlite3_vtab *pVtab, int iSavepoint){
|
||||
Fts5Table *pTab = (Fts5Table*)pVtab;
|
||||
UNUSED_PARAM(iSavepoint); /* Call below is a no-op for NDEBUG builds */
|
||||
fts5CheckTransactionState(pTab, FTS5_RELEASE, iSavepoint);
|
||||
fts5TripCursors(pTab);
|
||||
return sqlite3Fts5StorageSync(pTab->pStorage, 0);
|
||||
@ -2394,6 +2403,7 @@ static int fts5ReleaseMethod(sqlite3_vtab *pVtab, int iSavepoint){
|
||||
*/
|
||||
static int fts5RollbackToMethod(sqlite3_vtab *pVtab, int iSavepoint){
|
||||
Fts5Table *pTab = (Fts5Table*)pVtab;
|
||||
UNUSED_PARAM(iSavepoint); /* Call below is a no-op for NDEBUG builds */
|
||||
fts5CheckTransactionState(pTab, FTS5_ROLLBACKTO, iSavepoint);
|
||||
fts5TripCursors(pTab);
|
||||
return sqlite3Fts5StorageRollback(pTab->pStorage);
|
||||
@ -2573,10 +2583,11 @@ static void fts5ModuleDestroy(void *pCtx){
|
||||
static void fts5Fts5Func(
|
||||
sqlite3_context *pCtx, /* Function call context */
|
||||
int nArg, /* Number of args */
|
||||
sqlite3_value **apVal /* Function arguments */
|
||||
sqlite3_value **apUnused /* Function arguments */
|
||||
){
|
||||
Fts5Global *pGlobal = (Fts5Global*)sqlite3_user_data(pCtx);
|
||||
char buf[8];
|
||||
UNUSED_PARAM2(nArg, apUnused);
|
||||
assert( nArg==0 );
|
||||
assert( sizeof(buf)>=sizeof(pGlobal) );
|
||||
memcpy(buf, (void*)&pGlobal, sizeof(pGlobal));
|
||||
@ -2589,9 +2600,10 @@ static void fts5Fts5Func(
|
||||
static void fts5SourceIdFunc(
|
||||
sqlite3_context *pCtx, /* Function call context */
|
||||
int nArg, /* Number of args */
|
||||
sqlite3_value **apVal /* Function arguments */
|
||||
sqlite3_value **apUnused /* Function arguments */
|
||||
){
|
||||
assert( nArg==0 );
|
||||
UNUSED_PARAM2(nArg, apUnused);
|
||||
sqlite3_result_text(pCtx, "--FTS5-SOURCE-ID--", -1, SQLITE_TRANSIENT);
|
||||
}
|
||||
|
||||
|
@ -362,11 +362,12 @@ static int fts5StorageInsertCallback(
|
||||
int tflags,
|
||||
const char *pToken, /* Buffer containing token */
|
||||
int nToken, /* Size of token in bytes */
|
||||
int iStart, /* Start offset of token */
|
||||
int iEnd /* End offset of token */
|
||||
int iUnused1, /* Start offset of token */
|
||||
int iUnused2 /* End offset of token */
|
||||
){
|
||||
Fts5InsertCtx *pCtx = (Fts5InsertCtx*)pContext;
|
||||
Fts5Index *pIdx = pCtx->pStorage->pIndex;
|
||||
UNUSED_PARAM2(iUnused1, iUnused2);
|
||||
if( (tflags & FTS5_TOKEN_COLOCATED)==0 || pCtx->szCol==0 ){
|
||||
pCtx->szCol++;
|
||||
}
|
||||
@ -797,8 +798,8 @@ static int fts5StorageIntegrityCallback(
|
||||
int tflags,
|
||||
const char *pToken, /* Buffer containing token */
|
||||
int nToken, /* Size of token in bytes */
|
||||
int iStart, /* Start offset of token */
|
||||
int iEnd /* End offset of token */
|
||||
int iUnused1, /* Start offset of token */
|
||||
int iUnused2 /* End offset of token */
|
||||
){
|
||||
Fts5IntegrityCtx *pCtx = (Fts5IntegrityCtx*)pContext;
|
||||
Fts5Termset *pTermset = pCtx->pTermset;
|
||||
@ -808,6 +809,8 @@ static int fts5StorageIntegrityCallback(
|
||||
int iPos;
|
||||
int iCol;
|
||||
|
||||
UNUSED_PARAM2(iUnused1, iUnused2);
|
||||
|
||||
if( (tflags & FTS5_TOKEN_COLOCATED)==0 || pCtx->szCol==0 ){
|
||||
pCtx->szCol++;
|
||||
}
|
||||
|
@ -62,12 +62,13 @@ static void fts5AsciiDelete(Fts5Tokenizer *p){
|
||||
** Create an "ascii" tokenizer.
|
||||
*/
|
||||
static int fts5AsciiCreate(
|
||||
void *pCtx,
|
||||
void *pUnused,
|
||||
const char **azArg, int nArg,
|
||||
Fts5Tokenizer **ppOut
|
||||
){
|
||||
int rc = SQLITE_OK;
|
||||
AsciiTokenizer *p = 0;
|
||||
UNUSED_PARAM(pUnused);
|
||||
if( nArg%2 ){
|
||||
rc = SQLITE_ERROR;
|
||||
}else{
|
||||
@ -116,7 +117,7 @@ static void asciiFold(char *aOut, const char *aIn, int nByte){
|
||||
static int fts5AsciiTokenize(
|
||||
Fts5Tokenizer *pTokenizer,
|
||||
void *pCtx,
|
||||
int flags,
|
||||
int iUnused,
|
||||
const char *pText, int nText,
|
||||
int (*xToken)(void*, int, const char*, int nToken, int iStart, int iEnd)
|
||||
){
|
||||
@ -130,6 +131,8 @@ static int fts5AsciiTokenize(
|
||||
char *pFold = aFold;
|
||||
unsigned char *a = p->aTokenChar;
|
||||
|
||||
UNUSED_PARAM(iUnused);
|
||||
|
||||
while( is<nText && rc==SQLITE_OK ){
|
||||
int nByte;
|
||||
|
||||
@ -323,13 +326,15 @@ static void fts5UnicodeDelete(Fts5Tokenizer *pTok){
|
||||
** Create a "unicode61" tokenizer.
|
||||
*/
|
||||
static int fts5UnicodeCreate(
|
||||
void *pCtx,
|
||||
void *pUnused,
|
||||
const char **azArg, int nArg,
|
||||
Fts5Tokenizer **ppOut
|
||||
){
|
||||
int rc = SQLITE_OK; /* Return code */
|
||||
Unicode61Tokenizer *p = 0; /* New tokenizer object */
|
||||
|
||||
UNUSED_PARAM(pUnused);
|
||||
|
||||
if( nArg%2 ){
|
||||
rc = SQLITE_ERROR;
|
||||
}else{
|
||||
@ -386,7 +391,7 @@ static int fts5UnicodeIsAlnum(Unicode61Tokenizer *p, int iCode){
|
||||
static int fts5UnicodeTokenize(
|
||||
Fts5Tokenizer *pTokenizer,
|
||||
void *pCtx,
|
||||
int flags,
|
||||
int iUnused,
|
||||
const char *pText, int nText,
|
||||
int (*xToken)(void*, int, const char*, int nToken, int iStart, int iEnd)
|
||||
){
|
||||
@ -402,6 +407,8 @@ static int fts5UnicodeTokenize(
|
||||
int nFold = p->nFold;
|
||||
const char *pEnd = &aFold[nFold-6];
|
||||
|
||||
UNUSED_PARAM(iUnused);
|
||||
|
||||
/* Each iteration of this loop gobbles up a contiguous run of separators,
|
||||
** then the next token. */
|
||||
while( rc==SQLITE_OK ){
|
||||
|
@ -125,9 +125,9 @@ int sqlite3Fts5UnicodeIsalnum(int c){
|
||||
0xFFFFFFFF, 0xFC00FFFF, 0xF8000001, 0xF8000001,
|
||||
};
|
||||
|
||||
if( c<128 ){
|
||||
if( (unsigned int)c<128 ){
|
||||
return ( (aAscii[c >> 5] & (1 << (c & 0x001F)))==0 );
|
||||
}else if( c<(1<<22) ){
|
||||
}else if( (unsigned int)c<(1<<22) ){
|
||||
unsigned int key = (((unsigned int)c)<<10) | 0x000003FF;
|
||||
int iRes = 0;
|
||||
int iHi = sizeof(aEntry)/sizeof(aEntry[0]) - 1;
|
||||
|
@ -237,7 +237,7 @@ static int fts5VocabCreateMethod(
|
||||
** Implementation of the xBestIndex method.
|
||||
*/
|
||||
static int fts5VocabBestIndexMethod(
|
||||
sqlite3_vtab *pVTab,
|
||||
sqlite3_vtab *pUnused,
|
||||
sqlite3_index_info *pInfo
|
||||
){
|
||||
int i;
|
||||
@ -247,6 +247,8 @@ static int fts5VocabBestIndexMethod(
|
||||
int idxNum = 0;
|
||||
int nArg = 0;
|
||||
|
||||
UNUSED_PARAM(pUnused);
|
||||
|
||||
for(i=0; i<pInfo->nConstraint; i++){
|
||||
struct sqlite3_index_constraint *p = &pInfo->aConstraint[i];
|
||||
if( p->usable==0 ) continue;
|
||||
@ -488,8 +490,8 @@ static int fts5VocabNextMethod(sqlite3_vtab_cursor *pCursor){
|
||||
static int fts5VocabFilterMethod(
|
||||
sqlite3_vtab_cursor *pCursor, /* The cursor used for this query */
|
||||
int idxNum, /* Strategy index */
|
||||
const char *idxStr, /* Unused */
|
||||
int nVal, /* Number of elements in apVal */
|
||||
const char *zUnused, /* Unused */
|
||||
int nUnused, /* Number of elements in apVal */
|
||||
sqlite3_value **apVal /* Arguments for the indexing scheme */
|
||||
){
|
||||
Fts5VocabCursor *pCsr = (Fts5VocabCursor*)pCursor;
|
||||
@ -504,6 +506,8 @@ static int fts5VocabFilterMethod(
|
||||
sqlite3_value *pGe = 0;
|
||||
sqlite3_value *pLe = 0;
|
||||
|
||||
UNUSED_PARAM2(zUnused, nUnused);
|
||||
|
||||
fts5VocabResetCursor(pCsr);
|
||||
if( idxNum & FTS5_VOCAB_TERM_EQ ) pEq = apVal[iVal++];
|
||||
if( idxNum & FTS5_VOCAB_TERM_GE ) pGe = apVal[iVal++];
|
||||
|
@ -28,12 +28,14 @@
|
||||
// This code runs whenever there is a syntax error
|
||||
//
|
||||
%syntax_error {
|
||||
UNUSED_PARAM(yymajor); /* Silence a compiler warning */
|
||||
sqlite3Fts5ParseError(
|
||||
pParse, "fts5: syntax error near \"%.*s\"",TOKEN.n,TOKEN.p
|
||||
);
|
||||
}
|
||||
%stack_overflow {
|
||||
assert( 0 );
|
||||
UNUSED_PARAM(yypMinor); /* Silence a compiler warning */
|
||||
sqlite3Fts5ParseError(pParse, "fts5: parser stack overflow");
|
||||
}
|
||||
|
||||
// The name of the generated procedure that implements the parser
|
||||
|
@ -334,12 +334,9 @@ do_catchsql_test 6.3.5 {
|
||||
} {1 {database disk image is malformed}}
|
||||
|
||||
|
||||
}
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
reset_db
|
||||
reset_db
|
||||
proc rnddoc {n} {
|
||||
set map [list a b c d]
|
||||
set doc [list]
|
||||
@ -371,6 +368,41 @@ do_test 7.1 {
|
||||
}
|
||||
} {}
|
||||
|
||||
}
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# Corruption within the structure record.
|
||||
#
|
||||
reset_db
|
||||
do_execsql_test 8.1 {
|
||||
CREATE VIRTUAL TABLE t1 USING fts5(x, y);
|
||||
INSERT INTO t1 VALUES('one', 'two');
|
||||
}
|
||||
|
||||
do_test 9.1.1 {
|
||||
set blob "12345678" ;# cookie
|
||||
append blob "0105" ;# 1 level, total of 5 segments
|
||||
append blob "06" ;# write counter
|
||||
append blob "0002" ;# first level has 0 segments merging, 2 other.
|
||||
append blob "450108" ;# first segment
|
||||
execsql "REPLACE INTO t1_data VALUES(10, X'$blob')"
|
||||
} {}
|
||||
do_catchsql_test 9.1.2 {
|
||||
SELECT * FROM t1('one AND two');
|
||||
} {1 {database disk image is malformed}}
|
||||
|
||||
do_test 9.2.1 {
|
||||
set blob "12345678" ;# cookie
|
||||
append blob "0205" ;# 2 levels, total of 5 segments
|
||||
append blob "06" ;# write counter
|
||||
append blob "0001" ;# first level has 0 segments merging, 1 other.
|
||||
append blob "450108" ;# first segment
|
||||
execsql "REPLACE INTO t1_data VALUES(10, X'$blob')"
|
||||
} {}
|
||||
do_catchsql_test 9.2.2 {
|
||||
SELECT * FROM t1('one AND two');
|
||||
} {1 {database disk image is malformed}}
|
||||
|
||||
sqlite3_fts5_may_be_corrupt 0
|
||||
finish_test
|
||||
|
||||
|
@ -66,47 +66,66 @@ proc random_doc {vocab nWord} {
|
||||
|
||||
foreach_detail_mode $testprefix {
|
||||
|
||||
set vocab [build_vocab1]
|
||||
db func r random_doc
|
||||
|
||||
do_execsql_test 1.0 {
|
||||
CREATE VIRTUAL TABLE eee USING fts5(e, ee, detail=%DETAIL%);
|
||||
BEGIN;
|
||||
WITH ii(i) AS (SELECT 1 UNION ALL SELECT i+1 FROM ii WHERE i<100)
|
||||
INSERT INTO eee SELECT r($vocab, 5), r($vocab, 7) FROM ii;
|
||||
INSERT INTO eee(eee) VALUES('integrity-check');
|
||||
COMMIT;
|
||||
INSERT INTO eee(eee) VALUES('integrity-check');
|
||||
}
|
||||
|
||||
set hash [sqlite3_fts5_token_hash 1024 xyz]
|
||||
set vocab [build_vocab1 -prefix xyz -hash $hash]
|
||||
lappend vocab xyz
|
||||
|
||||
do_execsql_test 1.1 {
|
||||
CREATE VIRTUAL TABLE vocab USING fts5vocab(eee, 'row');
|
||||
BEGIN;
|
||||
}
|
||||
do_test 1.2 {
|
||||
for {set i 1} {$i <= 100} {incr i} {
|
||||
execsql { INSERT INTO eee VALUES( r($vocab, 5), r($vocab, 7) ) }
|
||||
}
|
||||
} {}
|
||||
set vocab [build_vocab1]
|
||||
db func r random_doc
|
||||
|
||||
do_test 1.3 {
|
||||
db eval { SELECT term, doc FROM vocab } {
|
||||
set nRow [db one {SELECT count(*) FROM eee WHERE eee MATCH $term}]
|
||||
if {$nRow != $doc} {
|
||||
error "term=$term fts5vocab=$doc cnt=$nRow"
|
||||
}
|
||||
do_execsql_test 1.0 {
|
||||
CREATE VIRTUAL TABLE eee USING fts5(e, ee, detail=%DETAIL%);
|
||||
BEGIN;
|
||||
WITH ii(i) AS (SELECT 1 UNION ALL SELECT i+1 FROM ii WHERE i<100)
|
||||
INSERT INTO eee SELECT r($vocab, 5), r($vocab, 7) FROM ii;
|
||||
INSERT INTO eee(eee) VALUES('integrity-check');
|
||||
COMMIT;
|
||||
INSERT INTO eee(eee) VALUES('integrity-check');
|
||||
}
|
||||
|
||||
set hash [sqlite3_fts5_token_hash 1024 xyz]
|
||||
set vocab [build_vocab1 -prefix xyz -hash $hash]
|
||||
lappend vocab xyz
|
||||
|
||||
do_execsql_test 1.1 {
|
||||
CREATE VIRTUAL TABLE vocab USING fts5vocab(eee, 'row');
|
||||
BEGIN;
|
||||
}
|
||||
do_test 1.2 {
|
||||
for {set i 1} {$i <= 100} {incr i} {
|
||||
execsql { INSERT INTO eee VALUES( r($vocab, 5), r($vocab, 7) ) }
|
||||
}
|
||||
} {}
|
||||
|
||||
do_test 1.3 {
|
||||
db eval { SELECT term, doc FROM vocab } {
|
||||
set nRow [db one {SELECT count(*) FROM eee WHERE eee MATCH $term}]
|
||||
if {$nRow != $doc} {
|
||||
error "term=$term fts5vocab=$doc cnt=$nRow"
|
||||
}
|
||||
}
|
||||
set {} {}
|
||||
} {}
|
||||
|
||||
do_execsql_test 1.4 {
|
||||
COMMIT;
|
||||
INSERT INTO eee(eee) VALUES('integrity-check');
|
||||
}
|
||||
set {} {}
|
||||
} {}
|
||||
|
||||
do_execsql_test 1.4 {
|
||||
COMMIT;
|
||||
INSERT INTO eee(eee) VALUES('integrity-check');
|
||||
}
|
||||
#-----------------------------------------------------------------------
|
||||
# Add a small and very large token with the same hash value to an
|
||||
# empty table. At one point this would provoke an asan error.
|
||||
#
|
||||
do_test 2.0 {
|
||||
set big [string repeat 12345 40]
|
||||
set hash [sqlite3_fts5_token_hash 1024 $big]
|
||||
while {1} {
|
||||
set small [random_token]
|
||||
if {[sqlite3_fts5_token_hash 1024 $small]==$hash} break
|
||||
}
|
||||
|
||||
execsql { CREATE VIRTUAL TABLE t2 USING fts5(x, detail=%DETAIL%) }
|
||||
breakpoint
|
||||
execsql {
|
||||
INSERT INTO t2 VALUES($small || ' ' || $big);
|
||||
}
|
||||
} {}
|
||||
|
||||
} ;# foreach_detail_mode
|
||||
|
||||
|
@ -399,5 +399,15 @@ do_execsql_test 18.1 {
|
||||
SELECT rowid FROM x4('""');
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
reset_db
|
||||
do_execsql_test 19.1 {
|
||||
CREATE VIRTUAL TABLE x1 USING fts5(a,b,c);
|
||||
}
|
||||
|
||||
do_catchsql_test 19.2 {
|
||||
SELECT * FROM x1 WHERE x1 MATCH 'c0 AND (c1 AND (c2 AND (c3 AND (c4 AND (c5 AND (c6 AND (c7 AND (c8 AND (c9 AND (c10 AND (c11 AND (c12 AND (c13 AND (c14 AND (c15 AND (c16 AND (c17 AND (c18 AND (c19 AND (c20 AND (c21 AND (c22 AND (c23 AND (c24 AND (c25 AND (c26 AND (c27 AND (c28 AND (c29 AND (c30 AND (c31 AND (c32 AND (c33 AND (c34 AND (c35 AND (c36 AND (c37 AND (c38 AND (c39 AND (c40 AND (c41 AND (c42 AND (c43 AND (c44 AND (c45 AND (c46 AND (c47 AND (c48 AND (c49 AND (c50 AND (c51 AND (c52 AND (c53 AND (c54 AND (c55 AND (c56 AND (c57 AND (c58 AND (c59 AND (c60 AND (c61 AND (c62 AND (c63 AND (c64 AND (c65 AND (c66 AND (c67 AND (c68 AND (c69 AND (c70 AND (c71 AND (c72 AND (c73 AND (c74 AND (c75 AND (c76 AND (c77 AND (c78 AND (c79 AND (c80 AND (c81 AND (c82 AND (c83 AND (c84 AND (c85 AND (c86 AND (c87 AND (c88 AND (c89 AND (c90 AND (c91 AND (c92 AND (c93 AND (c94 AND (c95 AND (c96 AND (c97 AND (c98 AND (c99 AND (c100 AND (c101 AND (c102 AND (c103 AND (c104 AND (c105 AND (c106 AND (c107 AND (c108 AND (c109 AND (c110 AND (c111 AND (c112 AND (c113 AND (c114 AND (c115 AND (c116 AND (c117 AND (c118 AND (c119 AND (c120 AND (c121 AND (c122 AND (c123 AND (c124 AND (c125 AND (c126 AND (c127 AND (c128 AND (c129 AND (c130 AND (c131 AND (c132 AND (c133 AND (c134 AND (c135 AND (c136 AND (c137 AND (c138 AND (c139 AND (c140 AND (c141 AND (c142 AND (c143 AND (c144 AND (c145 AND (c146 AND (c147 AND (c148 AND (c149 AND (c150 AND (c151 AND (c152 AND (c153 AND (c154 AND (c155 AND (c156 AND (c157 AND (c158 AND (c159 AND (c160 AND (c161 AND (c162 AND (c163 AND (c164 AND (c165 AND (c166 AND (c167 AND (c168 AND (c169 AND (c170 AND (c171 AND (c172 AND (c173 AND (c174 AND (c175 AND (c176 AND (c177 AND (c178 AND (c179 AND (c180 AND (c181 AND (c182 AND (c183 AND (c184 AND (c185 AND (c186 AND (c187 AND (c188 AND (c189 AND (c190 AND (c191 AND (c192 AND (c193 AND (c194 AND (c195 AND (c196 AND (c197 AND (c198 AND (c199 AND c200)))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))';
|
||||
} {1 {fts5: parser stack overflow}}
|
||||
|
||||
finish_test
|
||||
|
||||
|
@ -31,7 +31,11 @@ SQLITE_EXTENSION_INIT1
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
|
||||
#define UNUSED_PARAM(X) (void)(X)
|
||||
/* Mark a function parameter as unused, to suppress nuisance compiler
|
||||
** warnings. */
|
||||
#ifndef UNUSED_PARAM
|
||||
# define UNUSED_PARAM(X) (void)(X)
|
||||
#endif
|
||||
|
||||
#ifndef LARGEST_INT64
|
||||
# define LARGEST_INT64 (0xffffffff|(((sqlite3_int64)0x7fffffff)<<32))
|
||||
@ -1552,6 +1556,7 @@ static void jsonArrayStep(
|
||||
sqlite3_value **argv
|
||||
){
|
||||
JsonString *pStr;
|
||||
UNUSED_PARAM(argc);
|
||||
pStr = (JsonString*)sqlite3_aggregate_context(ctx, sizeof(*pStr));
|
||||
if( pStr ){
|
||||
if( pStr->zBuf==0 ){
|
||||
@ -1597,6 +1602,7 @@ static void jsonObjectStep(
|
||||
JsonString *pStr;
|
||||
const char *z;
|
||||
u32 n;
|
||||
UNUSED_PARAM(argc);
|
||||
pStr = (JsonString*)sqlite3_aggregate_context(ctx, sizeof(*pStr));
|
||||
if( pStr ){
|
||||
if( pStr->zBuf==0 ){
|
||||
|
14
main.mk
14
main.mk
@ -508,10 +508,9 @@ mptester$(EXE): sqlite3.c $(TOP)/mptest/mptest.c
|
||||
$(TCCX) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.c \
|
||||
$(TLIBS) $(THREADLIB)
|
||||
|
||||
MPTEST1=./mptester$(EXE) mptest.db $(TOP)/mptest/crash01.test --repeat 20
|
||||
MPTEST2=./mptester$(EXE) mptest.db $(TOP)/mptest/multiwrite01.test --repeat 20
|
||||
MPTEST1=./mptester$(EXE) mptest1.db $(TOP)/mptest/crash01.test --repeat 20
|
||||
MPTEST2=./mptester$(EXE) mptest2.db $(TOP)/mptest/multiwrite01.test --repeat 20
|
||||
mptest: mptester$(EXE)
|
||||
rm -f mptest.db
|
||||
$(MPTEST1) --journalmode DELETE
|
||||
$(MPTEST2) --journalmode WAL
|
||||
$(MPTEST1) --journalmode WAL
|
||||
@ -880,10 +879,15 @@ loadfts: $(TOP)/tool/loadfts.c libsqlite3.a
|
||||
checksymbols: sqlite3.o
|
||||
nm -g --defined-only sqlite3.o | grep -v " sqlite3_" ; test $$? -ne 0
|
||||
|
||||
# Build the amalgamation-autoconf package.
|
||||
# Build the amalgamation-autoconf package. The amalamgation-tarball target builds
|
||||
# a tarball named for the version number. Ex: sqlite-autoconf-3110000.tar.gz.
|
||||
# The snapshot-tarball target builds a tarball named by the SHA1 hash
|
||||
#
|
||||
amalgamation-tarball: sqlite3.c
|
||||
TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh
|
||||
TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh --normal
|
||||
|
||||
snapshot-tarball: sqlite3.c
|
||||
TOP=$(TOP) sh $(TOP)/tool/mkautoconfamal.sh --snapshot
|
||||
|
||||
|
||||
# Standard install and cleanup targets
|
||||
|
90
manifest
90
manifest
@ -1,8 +1,8 @@
|
||||
C Merge\senhancements\sand\sfixes\sfrom\strunk.
|
||||
D 2016-02-09T15:44:18.735
|
||||
F Makefile.in f3616d877a83bca632307d8acd1d2247a462c6dd
|
||||
C Merge\sthe\schanges\sfor\sthe\s3.11.0\srelease\scandidate\sfrom\strunk.
|
||||
D 2016-02-13T14:07:56.771
|
||||
F Makefile.in 5cbf3f753328d1bcd3a6117785b4874d99612f8f
|
||||
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
|
||||
F Makefile.msc 8bab27a620b140c06014463b5d0829b052073d02
|
||||
F Makefile.msc 45e596bd4ccecf2256f68a2e96466aa52cc4bc1f
|
||||
F README.md 8ecc12493ff9f820cdea6520a9016001cb2e59b7
|
||||
F VERSION 866588d1edf0ccb5b0d33896974338f97564f719
|
||||
F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50
|
||||
@ -10,10 +10,10 @@ F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2
|
||||
F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90
|
||||
F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2
|
||||
F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903
|
||||
F autoconf/Makefile.am 1c1657650775960804945dc392e14d9e43c5ed84
|
||||
F autoconf/Makefile.msc a35b2aab24d1603f3f0ae65cf01686c2578d319c
|
||||
F autoconf/Makefile.am 29e2a6e8d0c5e32723a48b4faf6b168854dde5f4
|
||||
F autoconf/Makefile.msc b865d2c72cf43cbf39913336415556af8ff2e819
|
||||
F autoconf/README.first 6c4f34fe115ff55d4e8dbfa3cecf04a0188292f7
|
||||
F autoconf/README.txt e9757a381e5ce2553dbaa6247bb8ad00eb8d87aa
|
||||
F autoconf/README.txt 7c31da66232f7590bb987cfcd4e2381744b25d24
|
||||
F autoconf/configure.ac 72a5e42beb090b32bca580285dc0ab3c4670adb8
|
||||
F autoconf/tea/Makefile.in b438a7020446c8a8156e8d97c8914a04833da6fd
|
||||
F autoconf/tea/README 3e9a3c060f29a44344ab50aec506f4db903fb873
|
||||
@ -72,7 +72,7 @@ F ext/fts3/README.tokenizers e0a8b81383ea60d0334d274fadf305ea14a8c314
|
||||
F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d
|
||||
F ext/fts3/fts3.c e028eb13432f108d2e22cded019fc980700e4e00
|
||||
F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe
|
||||
F ext/fts3/fts3Int.h c84125c666ee54cef6efce6ff64abb0d0e2f4535
|
||||
F ext/fts3/fts3Int.h 89d0bd4595a0de384dac78e94b803de12586e8dd
|
||||
F ext/fts3/fts3_aux.c 9edc3655fcb287f0467d0a4b886a01c6185fe9f1
|
||||
F ext/fts3/fts3_expr.c dfd571a24412779ac01f25c01d888c6ef7b2d0ef
|
||||
F ext/fts3/fts3_hash.c 29b986e43f4e9dd40110eafa377dc0d63c422c60
|
||||
@ -94,27 +94,27 @@ F ext/fts3/mkfts3amal.tcl 252ecb7fe6467854f2aa237bf2c390b74e71f100
|
||||
F ext/fts3/tool/fts3view.c 5d78b668f4e9598af9147f8999632599fb0d9dd5
|
||||
F ext/fts3/unicode/CaseFolding.txt 8c678ca52ecc95e16bc7afc2dbf6fc9ffa05db8c
|
||||
F ext/fts3/unicode/UnicodeData.txt cd07314edb62d49fde34debdaf92fa2aa69011e7
|
||||
F ext/fts3/unicode/mkunicode.tcl 95cf7ec186e48d4985e433ff8a1c89090a774252
|
||||
F ext/fts3/unicode/mkunicode.tcl 2debed3f582d77b3fdd0b8830880250021571fd8
|
||||
F ext/fts3/unicode/parseunicode.tcl da577d1384810fb4e2b209bf3313074353193e95
|
||||
F ext/fts5/extract_api_docs.tcl a36e54ec777172ddd3f9a88daf593b00848368e0
|
||||
F ext/fts5/fts5.h ff9c2782e8ed890b0de2f697a8d63971939e70c7
|
||||
F ext/fts5/fts5Int.h efb02807dbe5a2bfb0ea592a472d1171cb553d53
|
||||
F ext/fts5/fts5_aux.c b9bcce753ef5b451267b2232f0ca153ddeb3951d
|
||||
F ext/fts5/fts5_buffer.c 5142f73defd7d2ad7419f3a8e487681b38b72097
|
||||
F ext/fts5/fts5_config.c 0c384ebdd23fd055e2e50a93277b8d59da538238
|
||||
F ext/fts5/fts5_expr.c ff5c451a6d025909639ac0f0d0af0cc595b50feb
|
||||
F ext/fts5/fts5_hash.c 1b113977296cf4212c6ec667d5e3f2bd18036955
|
||||
F ext/fts5/fts5_index.c 28f72130400cb54d179a9a120b7232915e3e7a4e
|
||||
F ext/fts5/fts5_main.c 6e23df904049edb498538bd3e22e53ec1ab6f4f7
|
||||
F ext/fts5/fts5_storage.c 2a1f44deae090cd711f02cec0c2af8e660360d24
|
||||
F ext/fts5/fts5Int.h fa7c17e5c3ec9c8690387ff962f9dc6aee75e114
|
||||
F ext/fts5/fts5_aux.c daa57fb45216491814520bbb587e97bf81ced458
|
||||
F ext/fts5/fts5_buffer.c 4c1502d4c956cd092c89ce4480867f9d8bf325cd
|
||||
F ext/fts5/fts5_config.c 35c5173cae4eb17e82164a7f5aeef56a48903079
|
||||
F ext/fts5/fts5_expr.c 8e8e4635f655133eb39018072fc0f0942a2c4337
|
||||
F ext/fts5/fts5_hash.c f3a7217c86eb8f272871be5f6aa1b6798960a337
|
||||
F ext/fts5/fts5_index.c c6cd5190c7e5dd94151cb17acd939c82e5c7be2d
|
||||
F ext/fts5/fts5_main.c 0e01ead4e817483e378e7e38e6d902f50b68d29e
|
||||
F ext/fts5/fts5_storage.c f8343db90d8c95a4d4b52f6676e354b4649ffd6e
|
||||
F ext/fts5/fts5_tcl.c f8731e0508299bd43f1a2eff7dbeaac870768966
|
||||
F ext/fts5/fts5_test_mi.c 1ec66ffdf7632077fbd773b7a6df5153272ec070
|
||||
F ext/fts5/fts5_test_tok.c db08af63673c3a7d39f053b36fd6e065017706be
|
||||
F ext/fts5/fts5_tokenize.c 4d5c4f183c7d07d144bc219b92da1ea0e962fae3
|
||||
F ext/fts5/fts5_unicode2.c 78273fbd588d1d9bd0a7e4e0ccc9207348bae33c
|
||||
F ext/fts5/fts5_tokenize.c 2ce7b44183538ec46b7907726262ee43ffdd39a8
|
||||
F ext/fts5/fts5_unicode2.c b450b209b157d598f7b9df9f837afb75a14c24bf
|
||||
F ext/fts5/fts5_varint.c a5aceacda04dafcbae725413d7a16818ecd65738
|
||||
F ext/fts5/fts5_vocab.c 3ef401a8d6932db56368de32f446eb9fe73aa623
|
||||
F ext/fts5/fts5parse.y 1647eba089b9b3fc058b4dc989d9da87d15b9580
|
||||
F ext/fts5/fts5_vocab.c dba72ca393d71c2588548b51380387f6b44c77a8
|
||||
F ext/fts5/fts5parse.y 59432ea369f1aa65511bad465f55d31a22f9f223
|
||||
F ext/fts5/mkportersteps.tcl 5acf962d2e0074f701620bb5308155fa1e4a63ba
|
||||
F ext/fts5/test/fts5_common.tcl 61ff0d1a29d98a91c4553b20b3f410d858834ee9
|
||||
F ext/fts5/test/fts5aa.test 7e814df4a0e6c22a6fe2d84f210fdc0b5068a084
|
||||
@ -141,7 +141,7 @@ F ext/fts5/test/fts5conflict.test 26f4e46c4d31e16221794832a990dc4e30e18de5
|
||||
F ext/fts5/test/fts5content.test 9a952c95518a14182dc3b59e3c8fa71cda82a4e1
|
||||
F ext/fts5/test/fts5corrupt.test c2ad090192708150d50d961278df10ae7a4b8b62
|
||||
F ext/fts5/test/fts5corrupt2.test 26c0a39dd9ff73207e6229f83b50b21d37c7658c
|
||||
F ext/fts5/test/fts5corrupt3.test a2b537c120bdd43c79c42fe2438d7b8c81fe5599
|
||||
F ext/fts5/test/fts5corrupt3.test b9558d5b0ca44a8b6247fbb5d4a47592a8976892
|
||||
F ext/fts5/test/fts5detail.test ef5c690535a797413acaf5ad9b8ab5d49972df69
|
||||
F ext/fts5/test/fts5dlidx.test 13871a14641017ae42f6f1055a8067bafd44cb3d
|
||||
F ext/fts5/test/fts5doclist.test 8edb5b57e5f144030ed74ec00ef6fa4294fed79b
|
||||
@ -158,7 +158,7 @@ F ext/fts5/test/fts5fault8.test 430837fe6dd0511fd3aea52bd602ac02441bcb58
|
||||
F ext/fts5/test/fts5fault9.test e10e395428a9ea0596ebe752ff7123d16ab78e08
|
||||
F ext/fts5/test/fts5faultA.test fa5d59c0ff62b7125cd14eee38ded1c46e15a7ea
|
||||
F ext/fts5/test/fts5full.test 6f6143af0c6700501d9fd597189dfab1555bb741
|
||||
F ext/fts5/test/fts5hash.test 00668f6fa9b9bffbd7c1be29f408aa2bdade0451
|
||||
F ext/fts5/test/fts5hash.test 06f9309ccb4d5050a131594e9e47d0b21456837d
|
||||
F ext/fts5/test/fts5integrity.test f5e4f8d284385875068ad0f3e894ce43e9de835d
|
||||
F ext/fts5/test/fts5matchinfo.test 86569026d20f1ed748236587ce798de8a96615f1
|
||||
F ext/fts5/test/fts5merge.test 8f3cdba2ec9c5e7e568246e81b700ad37f764367
|
||||
@ -176,7 +176,7 @@ F ext/fts5/test/fts5rank.test 7e9e64eac7245637f6f2033aec4b292aaf611aab
|
||||
F ext/fts5/test/fts5rebuild.test 03935f617ace91ed23a6099c7c74d905227ff29b
|
||||
F ext/fts5/test/fts5restart.test c17728fdea26e7d0f617d22ad5b4b2862b994c17
|
||||
F ext/fts5/test/fts5rowid.test 16908a99d6efc9ba21081b4f2b86b3fc699839a6
|
||||
F ext/fts5/test/fts5simple.test 7fcacfa473a37355af2e60096650c87b5ba8f3ba
|
||||
F ext/fts5/test/fts5simple.test e6fe2fb10a2b9193648b32bbc2caecabdf8c333d
|
||||
F ext/fts5/test/fts5simple2.test 98377ae1ff7749a42c21fe1a139c1ed312522c46
|
||||
F ext/fts5/test/fts5simple3.test 8e71733b3d1b0e695011d02c68ebc5ca40b6124e
|
||||
F ext/fts5/test/fts5synonym.test 6475d189c2e20d60795808f83e36bf9318708d48
|
||||
@ -206,7 +206,7 @@ F ext/misc/eval.c f971962e92ebb8b0a4e6b62949463ee454d88fa2
|
||||
F ext/misc/fileio.c d4171c815d6543a9edef8308aab2951413cd8d0f
|
||||
F ext/misc/fuzzer.c 4c84635c71c26cfa7c2e5848cf49fe2d2cfcd767
|
||||
F ext/misc/ieee754.c f190d0cc5182529acb15babd177781be1ac1718c
|
||||
F ext/misc/json1.c a27cf1eca6583f9b6e18abab5c2a9a82c4540ca9
|
||||
F ext/misc/json1.c b9c88d5c3b6ecd8c731ffdd7f5b3d902857f8c96
|
||||
F ext/misc/nextchar.c 35c8b8baacb96d92abbb34a83a997b797075b342
|
||||
F ext/misc/percentile.c bcbee3c061b884eccb80e21651daaae8e1e43c63
|
||||
F ext/misc/regexp.c af92cdaa5058fcec1451e49becc7ba44dba023dc
|
||||
@ -292,19 +292,19 @@ F ext/userauth/userauth.c 5fa3bdb492f481bbc1709fc83c91ebd13460c69e
|
||||
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
|
||||
F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
|
||||
F magic.txt 8273bf49ba3b0c8559cb2774495390c31fd61c60
|
||||
F main.mk 21ff7c0fda5d0fade28e9ac2dff3e28097180528
|
||||
F main.mk 347535e93b4a3b65c2b73002fefc931308cd034b
|
||||
F mkso.sh fd21c06b063bb16a5d25deea1752c2da6ac3ed83
|
||||
F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271
|
||||
F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504
|
||||
F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421
|
||||
F mptest/crash02.subtest f4ef05adcd15d60e5d2bd654204f2c008b519df8
|
||||
F mptest/mptest.c 0d3f2eb8e373cb692ab362a6dddedd53e0978502
|
||||
F mptest/mptest.c aa41ace6dbc5050d76b02548d3521e6bbccae4f0
|
||||
F mptest/multiwrite01.test dab5c5f8f9534971efce679152c5146da265222d
|
||||
F spec.template 86a4a43b99ebb3e75e6b9a735d5fd293a24e90ca
|
||||
F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b
|
||||
F sqlite3.1 fc7ad8990fc8409983309bb80de8c811a7506786
|
||||
F sqlite3.pc.in 48fed132e7cb71ab676105d2a4dc77127d8c1f3a
|
||||
F src/alter.c d50b7dbb49a4affee951301afb76a008463e3625
|
||||
F src/alter.c 1fbb01c26c64528088f1df8015992fefda387889
|
||||
F src/analyze.c fbf0e80d83cc893734e872f932f249a056b86e11
|
||||
F src/attach.c c16c2648a577fa3def2adfa48c28901376389bc5
|
||||
F src/auth.c b56c78ebe40a2110fd361379f7e8162d23f92240
|
||||
@ -329,7 +329,7 @@ F src/global.c bd5a0af3f30b0c01be6db756c626cd3c33a3d260
|
||||
F src/hash.c 4263fbc955f26c2e8cdc0cf214bc42435aa4e4f5
|
||||
F src/hash.h c8f3c31722cf3277d03713909761e152a5b81094
|
||||
F src/hwtime.h d32741c8f4df852c7d959236615444e2b1063b08
|
||||
F src/insert.c 76e3c2ffc598b7815e6a88b09b32416e1b1819fb
|
||||
F src/insert.c d53917351d0542ce2be88888dca6b0b076e46aaa
|
||||
F src/journal.c b4124532212b6952f42eb2c12fa3c25701d8ba8d
|
||||
F src/legacy.c b1b0880fc474abfab89e737b0ecfde0bd7a60902
|
||||
F src/loadext.c 84996d7d70a605597d79c1f1d7b2012a5fd34f2b
|
||||
@ -348,9 +348,9 @@ F src/mutex_noop.c 9d4309c075ba9cc7249e19412d3d62f7f94839c4
|
||||
F src/mutex_unix.c 27bb6cc49485ee46711a6580ab7b3f1402211d23
|
||||
F src/mutex_w32.c 5e6fe1c298fb5a8a15aaed4161d5759311431c17
|
||||
F src/notify.c 9711a7575036f0d3040ba61bc6e217f13a9888e7
|
||||
F src/os.c 8fd25588eeba74068d41102d26810e216999b6c8
|
||||
F src/os.c 205fa2bad945a0dc7cad48f9f95ea3e8dc5408ff
|
||||
F src/os.h 3e57a24e2794a94d3cf2342c6d9a884888cd96bf
|
||||
F src/os_common.h abdb9a191a367793268fe553d25bab894e986a0e
|
||||
F src/os_common.h b2f4707a603e36811d9b1a13278bffd757857b85
|
||||
F src/os_setup.h c9d4553b5aaa6f73391448b265b89bed0b890faa
|
||||
F src/os_unix.c 821ed110197175165cf2f50b0930c7ff9a24504c
|
||||
F src/os_win.c ccf29ddded3e41e506b6bd98c1171aa0963b23f2
|
||||
@ -369,11 +369,11 @@ F src/random.c ba2679f80ec82c4190062d756f22d0c358180696
|
||||
F src/resolve.c 9f7ce3a3c087afb7597b7c916c99126ff3f12f0c
|
||||
F src/rowset.c 9fe4b3ad7cc00944386bb600233d8f523de07a6e
|
||||
F src/select.c ff80004a9a6ece891a8d9327a88e7b6e2588ee6d
|
||||
F src/shell.c 01e109c27300379b1c35b254cd294cde635f0179
|
||||
F src/sqlite.h.in 301c01f7c514cbb9ff5110889ea24e1a9715edac
|
||||
F src/shell.c 8cb62662c93e75189a152c4896336f44f05ced28
|
||||
F src/sqlite.h.in 9a3a1ee60bd2681034a3b730ef1208268d00fcc8
|
||||
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
|
||||
F src/sqlite3ext.h dfbe62ffd95b99afe2140d8c35b180d11924072d
|
||||
F src/sqliteInt.h f58219ec2bae2458f2ead1c6e187646a3c70594a
|
||||
F src/sqliteInt.h a6127f268ee02e6f792e5d5706707a8dd9bf8808
|
||||
F src/sqliteLimit.h 216557999cb45f2e3578ed53ebefe228d779cb46
|
||||
F src/status.c 70912d7be68e9e2dbc4010c93d344af61d4c59ba
|
||||
F src/table.c 51b46b2a62d1b3a959633d593b89bab5e2c9155e
|
||||
@ -429,7 +429,7 @@ F src/threads.c bbfb74450643cb5372a43ad4f6cffd7e9dfcecb0
|
||||
F src/tokenize.c 813934be70597edfbb685ae08fc4c8b549cf5a1e
|
||||
F src/treeview.c dc39ccf04e9331237388b9cb73289c9d87ea050b
|
||||
F src/trigger.c e14840ee0c3e549e758ec9bf3e4146e166002280
|
||||
F src/update.c 52552d2fe1bb66e7bdaedbd68e7dda1f5705bd44
|
||||
F src/update.c c0016d277a418360456ff6af29363effbd4272f7
|
||||
F src/utf.c 10cc2519e82e3369344d0969ad4b1a333dc86d18
|
||||
F src/util.c 49ce0a65306c1c51d61cb5bc214c71cb62452de6
|
||||
F src/vacuum.c 2ddd5cad2a7b9cef7f9e431b8c7771634c6b1701
|
||||
@ -447,7 +447,7 @@ F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
|
||||
F src/wal.c d21b99fd1458159d0b1ecdccc8ee6ada4fdc4c54
|
||||
F src/wal.h 2f7c831cf3b071fa548bf2d5cac640846a7ff19c
|
||||
F src/walker.c 0f142b5bd3ed2041fc52d773880748b212e63354
|
||||
F src/where.c d89fd5cff448ab5c5ca492dd9793b35ffe31ab35
|
||||
F src/where.c 984084584c10c41e46c89ac027a5cca991bc37e6
|
||||
F src/whereInt.h 78b6b4de94db84aecbdc07fe3e38f648eb391e9a
|
||||
F src/wherecode.c 791a784bbf8749d560fdb0b990b607bc4f44a38d
|
||||
F src/whereexpr.c de117970b29471177a6901d60ad83a194671dc03
|
||||
@ -459,7 +459,7 @@ F test/alias.test 4529fbc152f190268a15f9384a5651bbbabc9d87
|
||||
F test/all.test 6ff7b43c2b4b905c74dc4a813d201d0fa64c5783
|
||||
F test/alter.test 2facdddf08d0d48e75dc6cc312cd2b030f4835dd
|
||||
F test/alter2.test 7ea05c7d92ac99349a802ef7ada17294dd647060
|
||||
F test/alter3.test 49c9d9fba2b8fcdce2dedeca97bbf1f369cc548d
|
||||
F test/alter3.test b3568d11c38c4599c92f24242eda34144d78dc10
|
||||
F test/alter4.test c461150723ac957f3b2214aa0b11552cd72023ec
|
||||
F test/altermalloc.test e81ac9657ed25c6c5bb09bebfa5a047cd8e4acfc
|
||||
F test/amatch1.test b5ae7065f042b7f4c1c922933f4700add50cdb9f
|
||||
@ -542,7 +542,7 @@ F test/capi3d.test 485048dc5cd07bc68011e4917ad035ad6047ab82
|
||||
F test/capi3e.test 3d49c01ef2a1a55f41d73cba2b23b5059ec460fe
|
||||
F test/cast.test 4c275cbdc8202d6f9c54a3596701719868ac7dc3
|
||||
F test/cffault.test aadc1f61f8811cb600e3e069acbf8796f472a096
|
||||
F test/check.test 5831ddb6f2c687782eaf2e1a07b6e17f24c4f763
|
||||
F test/check.test 85a84bfc4be0e83f668747211c7cd45a6721d485
|
||||
F test/close.test 340bd24cc58b16c6bc01967402755027c37eb815
|
||||
F test/closure01.test b1703ba40639cfc9b295cf478d70739415eec6a4
|
||||
F test/coalesce.test cee0dccb9fbd2d494b77234bccf9dc6c6786eb91
|
||||
@ -1403,7 +1403,7 @@ F tool/lemon.c 799e73e19a33b8dd7767a7fa34618ed2a9c2397d
|
||||
F tool/lempar.c 3ec1463a034b37d87d782be5f6b8b10a3b1ecbe7
|
||||
F tool/loadfts.c c3c64e4d5e90e8ba41159232c2189dba4be7b862
|
||||
F tool/logest.c eef612f8adf4d0993dafed0416064cf50d5d33c6
|
||||
F tool/mkautoconfamal.sh a29b14d54302b33fd892958f6895582ea90e4a45
|
||||
F tool/mkautoconfamal.sh c78caa3214f25dc28ea157b5a82abb311f209906
|
||||
F tool/mkkeywordhash.c f7f3b342211ac6a14258b9726d5b97cf4f548f22
|
||||
F tool/mkmsvcmin.tcl d57e6efc9428605f5418d0b235721ddf7b5d9c0b
|
||||
F tool/mkopcodec.tcl d1b6362bd3aa80d5520d4d6f3765badf01f6c43c
|
||||
@ -1415,7 +1415,7 @@ F tool/mksqlite3c-noext.tcl 87240b09c20042999b41d5fabe091b7111287835
|
||||
F tool/mksqlite3c.tcl a52d7e8c0888f9384fbfa2c6ddd5f357409758b9
|
||||
F tool/mksqlite3h.tcl e7b106fc4f29fbc258e8ba9b88d9108332ea2ade
|
||||
F tool/mksqlite3internalh.tcl eb994013e833359137eb53a55acdad0b5ae1049b
|
||||
F tool/mkvsix.tcl bbe57cd9ae11c6cc70319241101ef8d2b8c3765b
|
||||
F tool/mkvsix.tcl fbeb0af7cffdf64e0fba6d65e2e5120dc14595f4
|
||||
F tool/offsets.c fe4262fdfa378e8f5499a42136d17bf3b98f6091
|
||||
F tool/omittest.tcl 34d7ac01fe4fd18e3637f64abe12c40eca0f6b97
|
||||
F tool/pagesig.c ff0ca355fd3c2398e933da5e22439bbff89b803b
|
||||
@ -1446,9 +1446,9 @@ F tool/varint.c 5d94cb5003db9dbbcbcc5df08d66f16071aee003
|
||||
F tool/vdbe-compress.tcl 5926c71f9c12d2ab73ef35c29376e756eb68361c
|
||||
F tool/vdbe_profile.tcl 246d0da094856d72d2c12efec03250d71639d19f
|
||||
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
|
||||
F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b
|
||||
F tool/warnings.sh ef6ebc6fd8d2dc35db3b622015c16a023d4fef4f
|
||||
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
||||
P a533608cb0de3cbc1e28a794aab99864b8c249f4 ca72be8618e5d466d6f35819ca8bbd2b84269959
|
||||
R d85e9a45ccd06fa00872d35eb5681210
|
||||
P f040a5bb62f3473fba6450c97c68f538d1df21ef a049fbbde5da2e43d41aa8c2b41f9eb21507ac76
|
||||
R 622532d44eb7d789368cb4bcd5c9c290
|
||||
U drh
|
||||
Z de0bc42fb2718aff4f759eb51f24bd2c
|
||||
Z 7f2e42b2e725136d738cebdbb2b0b796
|
||||
|
@ -1 +1 @@
|
||||
f040a5bb62f3473fba6450c97c68f538d1df21ef
|
||||
4d7a802e73ef0352f840bc8d74c560afb7666ff7
|
@ -41,6 +41,7 @@
|
||||
#else
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
@ -1244,6 +1245,19 @@ static void usage(const char *argv0){
|
||||
if( isDirSep(argv0[i]) ) zTail = argv0+i+1;
|
||||
}
|
||||
fprintf(stderr,"Usage: %s DATABASE ?OPTIONS? ?SCRIPT?\n", zTail);
|
||||
fprintf(stderr,
|
||||
"Options:\n"
|
||||
" --errlog FILENAME Write errors to FILENAME\n"
|
||||
" --journalmode MODE Use MODE as the journal_mode\n"
|
||||
" --log FILENAME Log messages to FILENAME\n"
|
||||
" --quiet Suppress unnecessary output\n"
|
||||
" --vfs NAME Use NAME as the VFS\n"
|
||||
" --repeat N Repeat the test N times\n"
|
||||
" --sqltrace Enable SQL tracing\n"
|
||||
" --sync Enable synchronous disk writes\n"
|
||||
" --timeout MILLISEC Busy timeout is MILLISEC\n"
|
||||
" --trace BOOLEAN Enable or disable tracing\n"
|
||||
);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@ -1275,6 +1289,8 @@ int SQLITE_CDECL main(int argc, char **argv){
|
||||
const char *zJMode;
|
||||
const char *zNRep;
|
||||
int nRep = 1, iRep;
|
||||
int iTmout = 0; /* Default: no timeout */
|
||||
const char *zTmout;
|
||||
|
||||
g.argv0 = argv[0];
|
||||
g.iTrace = 1;
|
||||
@ -1301,6 +1317,8 @@ int SQLITE_CDECL main(int argc, char **argv){
|
||||
zTrace = findOption(argv+2, &n, "trace", 1);
|
||||
if( zTrace ) g.iTrace = atoi(zTrace);
|
||||
if( findOption(argv+2, &n, "quiet", 0)!=0 ) g.iTrace = 0;
|
||||
zTmout = findOption(argv+2, &n, "timeout", 1);
|
||||
if( zTmout ) iTmout = atoi(zTmout);
|
||||
g.bSqlTrace = findOption(argv+2, &n, "sqltrace", 0)!=0;
|
||||
g.bSync = findOption(argv+2, &n, "sync", 0)!=0;
|
||||
if( g.zErrLog ){
|
||||
@ -1321,6 +1339,7 @@ int SQLITE_CDECL main(int argc, char **argv){
|
||||
sqlite3_snprintf(sizeof(g.zName), g.zName, "%05d.client%02d",
|
||||
GETPID(), iClient);
|
||||
}else{
|
||||
int nTry = 0;
|
||||
if( g.iTrace>0 ){
|
||||
printf("BEGIN: %s", argv[0]);
|
||||
for(i=1; i<argc; i++) printf(" %s", argv[i]);
|
||||
@ -1332,11 +1351,22 @@ int SQLITE_CDECL main(int argc, char **argv){
|
||||
fflush(stdout);
|
||||
}
|
||||
iClient = 0;
|
||||
unlink(g.zDbFile);
|
||||
do{
|
||||
if( (nTry%5)==4 ) printf("... %strying to unlink '%s'\n",
|
||||
nTry>5 ? "still " : "", g.zDbFile);
|
||||
rc = unlink(g.zDbFile);
|
||||
if( rc && errno==ENOENT ) rc = 0;
|
||||
}while( rc!=0 && (++nTry)<60 && sqlite3_sleep(1000)>0 );
|
||||
if( rc!=0 ){
|
||||
fatalError("unable to unlink '%s' after %d attempts\n",
|
||||
g.zDbFile, nTry);
|
||||
}
|
||||
openFlags |= SQLITE_OPEN_CREATE;
|
||||
}
|
||||
rc = sqlite3_open_v2(g.zDbFile, &g.db, openFlags, g.zVfs);
|
||||
if( rc ) fatalError("cannot open [%s]", g.zDbFile);
|
||||
if( iTmout>0 ) sqlite3_busy_timeout(g.db, iTmout);
|
||||
|
||||
if( zJMode ){
|
||||
#if defined(_WIN32)
|
||||
if( sqlite3_stricmp(zJMode,"persist")==0
|
||||
|
40
src/alter.c
40
src/alter.c
@ -588,33 +588,6 @@ exit_rename_table:
|
||||
db->flags = savedDbFlags;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Generate code to make sure the file format number is at least minFormat.
|
||||
** The generated code will increase the file format number if necessary.
|
||||
*/
|
||||
void sqlite3MinimumFileFormat(Parse *pParse, int iDb, int minFormat){
|
||||
Vdbe *v;
|
||||
v = sqlite3GetVdbe(pParse);
|
||||
/* The VDBE should have been allocated before this routine is called.
|
||||
** If that allocation failed, we would have quit before reaching this
|
||||
** point */
|
||||
if( ALWAYS(v) ){
|
||||
int r1 = sqlite3GetTempReg(pParse);
|
||||
int r2 = sqlite3GetTempReg(pParse);
|
||||
int addr1;
|
||||
sqlite3VdbeAddOp3(v, OP_ReadCookie, iDb, r1, BTREE_FILE_FORMAT);
|
||||
sqlite3VdbeUsesBtree(v, iDb);
|
||||
sqlite3VdbeAddOp2(v, OP_Integer, minFormat, r2);
|
||||
addr1 = sqlite3VdbeAddOp3(v, OP_Ge, r2, 0, r1);
|
||||
sqlite3VdbeChangeP5(v, SQLITE_NOTNULL); VdbeCoverage(v);
|
||||
sqlite3VdbeAddOp3(v, OP_SetCookie, iDb, BTREE_FILE_FORMAT, minFormat);
|
||||
sqlite3VdbeJumpHere(v, addr1);
|
||||
sqlite3ReleaseTempReg(pParse, r1);
|
||||
sqlite3ReleaseTempReg(pParse, r2);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** This function is called after an "ALTER TABLE ... ADD" statement
|
||||
** has been parsed. Argument pColDef contains the text of the new
|
||||
@ -633,9 +606,11 @@ void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){
|
||||
Column *pCol; /* The new column */
|
||||
Expr *pDflt; /* Default value for the new column */
|
||||
sqlite3 *db; /* The database connection; */
|
||||
Vdbe *v = pParse->pVdbe; /* The prepared statement under construction */
|
||||
|
||||
db = pParse->db;
|
||||
if( pParse->nErr || db->mallocFailed ) return;
|
||||
assert( v!=0 );
|
||||
pNew = pParse->pNewTable;
|
||||
assert( pNew );
|
||||
|
||||
@ -725,11 +700,16 @@ void sqlite3AlterFinishAddColumn(Parse *pParse, Token *pColDef){
|
||||
db->flags = savedDbFlags;
|
||||
}
|
||||
|
||||
/* If the default value of the new column is NULL, then set the file
|
||||
/* If the default value of the new column is NULL, then the file
|
||||
** format to 2. If the default value of the new column is not NULL,
|
||||
** the file format becomes 3.
|
||||
** the file format be 3. Back when this feature was first added
|
||||
** in 2006, we went to the trouble to upgrade the file format to the
|
||||
** minimum support values. But 10-years on, we can assume that all
|
||||
** extent versions of SQLite support file-format 4, so we always and
|
||||
** unconditionally upgrade to 4.
|
||||
*/
|
||||
sqlite3MinimumFileFormat(pParse, iDb, pDflt ? 3 : 2);
|
||||
sqlite3VdbeAddOp3(v, OP_SetCookie, iDb, BTREE_FILE_FORMAT,
|
||||
SQLITE_MAX_FILE_FORMAT);
|
||||
|
||||
/* Reload the schema of the modified table. */
|
||||
reloadTableSchema(pParse, pTab, pTab->zName);
|
||||
|
71
src/insert.c
71
src/insert.c
@ -995,7 +995,7 @@ void sqlite3Insert(
|
||||
{
|
||||
int isReplace; /* Set to true if constraints may cause a replace */
|
||||
sqlite3GenerateConstraintChecks(pParse, pTab, aRegIdx, iDataCur, iIdxCur,
|
||||
regIns, 0, ipkColumn>=0, onError, endOfLoop, &isReplace
|
||||
regIns, 0, ipkColumn>=0, onError, endOfLoop, &isReplace, 0
|
||||
);
|
||||
sqlite3FkCheck(pParse, pTab, 0, regIns, 0, 0);
|
||||
sqlite3CompleteInsertion(pParse, pTab, iDataCur, iIdxCur,
|
||||
@ -1077,6 +1077,59 @@ insert_cleanup:
|
||||
#undef tmask
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Meanings of bits in of pWalker->eCode for checkConstraintUnchanged()
|
||||
*/
|
||||
#define CKCNSTRNT_COLUMN 0x01 /* CHECK constraint uses a changing column */
|
||||
#define CKCNSTRNT_ROWID 0x02 /* CHECK constraint references the ROWID */
|
||||
|
||||
/* This is the Walker callback from checkConstraintUnchanged(). Set
|
||||
** bit 0x01 of pWalker->eCode if
|
||||
** pWalker->eCode to 0 if this expression node references any of the
|
||||
** columns that are being modifed by an UPDATE statement.
|
||||
*/
|
||||
static int checkConstraintExprNode(Walker *pWalker, Expr *pExpr){
|
||||
if( pExpr->op==TK_COLUMN ){
|
||||
assert( pExpr->iColumn>=0 || pExpr->iColumn==-1 );
|
||||
if( pExpr->iColumn>=0 ){
|
||||
if( pWalker->u.aiCol[pExpr->iColumn]>=0 ){
|
||||
pWalker->eCode |= CKCNSTRNT_COLUMN;
|
||||
}
|
||||
}else{
|
||||
pWalker->eCode |= CKCNSTRNT_ROWID;
|
||||
}
|
||||
}
|
||||
return WRC_Continue;
|
||||
}
|
||||
|
||||
/*
|
||||
** pExpr is a CHECK constraint on a row that is being UPDATE-ed. The
|
||||
** only columns that are modified by the UPDATE are those for which
|
||||
** aiChng[i]>=0, and also the ROWID is modified if chngRowid is true.
|
||||
**
|
||||
** Return true if CHECK constraint pExpr does not use any of the
|
||||
** changing columns (or the rowid if it is changing). In other words,
|
||||
** return true if this CHECK constraint can be skipped when validating
|
||||
** the new row in the UPDATE statement.
|
||||
*/
|
||||
static int checkConstraintUnchanged(Expr *pExpr, int *aiChng, int chngRowid){
|
||||
Walker w;
|
||||
memset(&w, 0, sizeof(w));
|
||||
w.eCode = 0;
|
||||
w.xExprCallback = checkConstraintExprNode;
|
||||
w.u.aiCol = aiChng;
|
||||
sqlite3WalkExpr(&w, pExpr);
|
||||
if( !chngRowid ){
|
||||
testcase( (w.eCode & CKCNSTRNT_ROWID)!=0 );
|
||||
w.eCode &= ~CKCNSTRNT_ROWID;
|
||||
}
|
||||
testcase( w.eCode==0 );
|
||||
testcase( w.eCode==CKCNSTRNT_COLUMN );
|
||||
testcase( w.eCode==CKCNSTRNT_ROWID );
|
||||
testcase( w.eCode==(CKCNSTRNT_ROWID|CKCNSTRNT_COLUMN) );
|
||||
return !w.eCode;
|
||||
}
|
||||
|
||||
/*
|
||||
** Generate code to do constraint checks prior to an INSERT or an UPDATE
|
||||
** on table pTab.
|
||||
@ -1171,7 +1224,8 @@ void sqlite3GenerateConstraintChecks(
|
||||
u8 pkChng, /* Non-zero if the rowid or PRIMARY KEY changed */
|
||||
u8 overrideError, /* Override onError to this if not OE_Default */
|
||||
int ignoreDest, /* Jump to this label on an OE_Ignore resolution */
|
||||
int *pbMayReplace /* OUT: Set to true if constraint may cause a replace */
|
||||
int *pbMayReplace, /* OUT: Set to true if constraint may cause a replace */
|
||||
int *aiChng /* column i is unchanged if aiChng[i]<0 */
|
||||
){
|
||||
Vdbe *v; /* VDBE under constrution */
|
||||
Index *pIdx; /* Pointer to one of the indices */
|
||||
@ -1217,10 +1271,14 @@ void sqlite3GenerateConstraintChecks(
|
||||
*/
|
||||
for(i=0; i<nCol; i++){
|
||||
if( i==pTab->iPKey ){
|
||||
continue; /* ROWID is never NULL */
|
||||
}
|
||||
if( aiChng && aiChng[i]<0 ){
|
||||
/* Don't bother checking for NOT NULL on columns that do not change */
|
||||
continue;
|
||||
}
|
||||
onError = pTab->aCol[i].notNull;
|
||||
if( onError==OE_None ) continue;
|
||||
if( onError==OE_None ) continue; /* This column is allowed to be NULL */
|
||||
if( overrideError!=OE_Default ){
|
||||
onError = overrideError;
|
||||
}else if( onError==OE_Default ){
|
||||
@ -1269,8 +1327,11 @@ void sqlite3GenerateConstraintChecks(
|
||||
pParse->ckBase = regNewData+1;
|
||||
onError = overrideError!=OE_Default ? overrideError : OE_Abort;
|
||||
for(i=0; i<pCheck->nExpr; i++){
|
||||
int allOk = sqlite3VdbeMakeLabel(v);
|
||||
sqlite3ExprIfTrue(pParse, pCheck->a[i].pExpr, allOk, SQLITE_JUMPIFNULL);
|
||||
int allOk;
|
||||
Expr *pExpr = pCheck->a[i].pExpr;
|
||||
if( aiChng && checkConstraintUnchanged(pExpr, aiChng, pkChng) ) continue;
|
||||
allOk = sqlite3VdbeMakeLabel(v);
|
||||
sqlite3ExprIfTrue(pParse, pExpr, allOk, SQLITE_JUMPIFNULL);
|
||||
if( onError==OE_Ignore ){
|
||||
sqlite3VdbeGoto(v, ignoreDest);
|
||||
}else{
|
||||
|
54
src/os.c
54
src/os.c
@ -17,6 +17,28 @@
|
||||
#include "sqliteInt.h"
|
||||
#undef _SQLITE_OS_C_
|
||||
|
||||
/*
|
||||
** If we compile with the SQLITE_TEST macro set, then the following block
|
||||
** of code will give us the ability to simulate a disk I/O error. This
|
||||
** is used for testing the I/O recovery logic.
|
||||
*/
|
||||
#if defined(SQLITE_TEST)
|
||||
int sqlite3_io_error_hit = 0; /* Total number of I/O Errors */
|
||||
int sqlite3_io_error_hardhit = 0; /* Number of non-benign errors */
|
||||
int sqlite3_io_error_pending = 0; /* Count down to first I/O error */
|
||||
int sqlite3_io_error_persist = 0; /* True if I/O errors persist */
|
||||
int sqlite3_io_error_benign = 0; /* True if errors are benign */
|
||||
int sqlite3_diskfull_pending = 0;
|
||||
int sqlite3_diskfull = 0;
|
||||
#endif /* defined(SQLITE_TEST) */
|
||||
|
||||
/*
|
||||
** When testing, also keep a count of the number of open files.
|
||||
*/
|
||||
#if defined(SQLITE_TEST)
|
||||
int sqlite3_open_file_count = 0;
|
||||
#endif /* defined(SQLITE_TEST) */
|
||||
|
||||
/*
|
||||
** The default SQLite sqlite3_vfs implementations do not allocate
|
||||
** memory (actually, os_unix.c allocates a small amount of memory
|
||||
@ -24,7 +46,7 @@
|
||||
** So we test the effects of a malloc() failing and the sqlite3OsXXX()
|
||||
** function returning SQLITE_IOERR_NOMEM using the DO_OS_MALLOC_TEST macro.
|
||||
**
|
||||
** The following functions are instrumented for malloc() failure
|
||||
** The following functions are instrumented for malloc() failure
|
||||
** testing:
|
||||
**
|
||||
** sqlite3OsRead()
|
||||
@ -110,8 +132,8 @@ int sqlite3OsFileControl(sqlite3_file *id, int op, void *pArg){
|
||||
#ifdef SQLITE_TEST
|
||||
if( op!=SQLITE_FCNTL_COMMIT_PHASETWO ){
|
||||
/* Faults are not injected into COMMIT_PHASETWO because, assuming SQLite
|
||||
** is using a regular VFS, it is called after the corresponding
|
||||
** transaction has been committed. Injecting a fault at this point
|
||||
** is using a regular VFS, it is called after the corresponding
|
||||
** transaction has been committed. Injecting a fault at this point
|
||||
** confuses the test scripts - the COMMIT comand returns SQLITE_NOMEM
|
||||
** but the transaction is committed anyway.
|
||||
**
|
||||
@ -180,10 +202,10 @@ int sqlite3OsUnfetch(sqlite3_file *id, i64 iOff, void *p){
|
||||
** VFS methods.
|
||||
*/
|
||||
int sqlite3OsOpen(
|
||||
sqlite3_vfs *pVfs,
|
||||
const char *zPath,
|
||||
sqlite3_file *pFile,
|
||||
int flags,
|
||||
sqlite3_vfs *pVfs,
|
||||
const char *zPath,
|
||||
sqlite3_file *pFile,
|
||||
int flags,
|
||||
int *pFlagsOut
|
||||
){
|
||||
int rc;
|
||||
@ -202,18 +224,18 @@ int sqlite3OsDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){
|
||||
return pVfs->xDelete(pVfs, zPath, dirSync);
|
||||
}
|
||||
int sqlite3OsAccess(
|
||||
sqlite3_vfs *pVfs,
|
||||
const char *zPath,
|
||||
int flags,
|
||||
sqlite3_vfs *pVfs,
|
||||
const char *zPath,
|
||||
int flags,
|
||||
int *pResOut
|
||||
){
|
||||
DO_OS_MALLOC_TEST(0);
|
||||
return pVfs->xAccess(pVfs, zPath, flags, pResOut);
|
||||
}
|
||||
int sqlite3OsFullPathname(
|
||||
sqlite3_vfs *pVfs,
|
||||
const char *zPath,
|
||||
int nPathOut,
|
||||
sqlite3_vfs *pVfs,
|
||||
const char *zPath,
|
||||
int nPathOut,
|
||||
char *zPathOut
|
||||
){
|
||||
DO_OS_MALLOC_TEST(0);
|
||||
@ -259,9 +281,9 @@ int sqlite3OsCurrentTimeInt64(sqlite3_vfs *pVfs, sqlite3_int64 *pTimeOut){
|
||||
}
|
||||
|
||||
int sqlite3OsOpenMalloc(
|
||||
sqlite3_vfs *pVfs,
|
||||
const char *zFile,
|
||||
sqlite3_file **ppFile,
|
||||
sqlite3_vfs *pVfs,
|
||||
const char *zFile,
|
||||
sqlite3_file **ppFile,
|
||||
int flags,
|
||||
int *pOutFlags
|
||||
){
|
||||
|
@ -35,8 +35,8 @@
|
||||
*/
|
||||
#ifdef SQLITE_PERFORMANCE_TRACE
|
||||
|
||||
/*
|
||||
** hwtime.h contains inline assembler code for implementing
|
||||
/*
|
||||
** hwtime.h contains inline assembler code for implementing
|
||||
** high-performance timing routines.
|
||||
*/
|
||||
#include "hwtime.h"
|
||||
@ -57,14 +57,14 @@ static sqlite_uint64 g_elapsed;
|
||||
** of code will give us the ability to simulate a disk I/O error. This
|
||||
** is used for testing the I/O recovery logic.
|
||||
*/
|
||||
#ifdef SQLITE_TEST
|
||||
int sqlite3_io_error_hit = 0; /* Total number of I/O Errors */
|
||||
int sqlite3_io_error_hardhit = 0; /* Number of non-benign errors */
|
||||
int sqlite3_io_error_pending = 0; /* Count down to first I/O error */
|
||||
int sqlite3_io_error_persist = 0; /* True if I/O errors persist */
|
||||
int sqlite3_io_error_benign = 0; /* True if errors are benign */
|
||||
int sqlite3_diskfull_pending = 0;
|
||||
int sqlite3_diskfull = 0;
|
||||
#if defined(SQLITE_TEST)
|
||||
extern int sqlite3_io_error_hit;
|
||||
extern int sqlite3_io_error_hardhit;
|
||||
extern int sqlite3_io_error_pending;
|
||||
extern int sqlite3_io_error_persist;
|
||||
extern int sqlite3_io_error_benign;
|
||||
extern int sqlite3_diskfull_pending;
|
||||
extern int sqlite3_diskfull;
|
||||
#define SimulateIOErrorBenign(X) sqlite3_io_error_benign=(X)
|
||||
#define SimulateIOError(CODE) \
|
||||
if( (sqlite3_io_error_persist && sqlite3_io_error_hit) \
|
||||
@ -90,16 +90,16 @@ static void local_ioerr(){
|
||||
#define SimulateIOErrorBenign(X)
|
||||
#define SimulateIOError(A)
|
||||
#define SimulateDiskfullError(A)
|
||||
#endif
|
||||
#endif /* defined(SQLITE_TEST) */
|
||||
|
||||
/*
|
||||
** When testing, keep a count of the number of open files.
|
||||
*/
|
||||
#ifdef SQLITE_TEST
|
||||
int sqlite3_open_file_count = 0;
|
||||
#if defined(SQLITE_TEST)
|
||||
extern int sqlite3_open_file_count;
|
||||
#define OpenCounter(X) sqlite3_open_file_count+=(X)
|
||||
#else
|
||||
#define OpenCounter(X)
|
||||
#endif
|
||||
#endif /* defined(SQLITE_TEST) */
|
||||
|
||||
#endif /* !defined(_OS_COMMON_H_) */
|
||||
|
148
src/shell.c
148
src/shell.c
@ -605,6 +605,7 @@ typedef struct ShellState ShellState;
|
||||
struct ShellState {
|
||||
sqlite3 *db; /* The database */
|
||||
int echoOn; /* True to echo input commands */
|
||||
int autoExplain; /* Automatically turn on .explain mode */
|
||||
int autoEQP; /* Run EXPLAIN QUERY PLAN prior to seach SQL stmt */
|
||||
int statsOn; /* True to display memory stats before each finalize */
|
||||
int scanstatsOn; /* True to display scan stats before each finalize */
|
||||
@ -616,6 +617,8 @@ struct ShellState {
|
||||
FILE *traceOut; /* Output for sqlite3_trace() */
|
||||
int nErr; /* Number of errors seen */
|
||||
int mode; /* An output mode setting */
|
||||
int cMode; /* temporary output mode for the current query */
|
||||
int normalMode; /* Output mode before ".explain on" */
|
||||
int writableSchema; /* True if PRAGMA writable_schema=ON */
|
||||
int showHeader; /* True to show column names in List or Column mode */
|
||||
unsigned shellFlgs; /* Various flags */
|
||||
@ -626,7 +629,6 @@ struct ShellState {
|
||||
int actualWidth[100]; /* Actual width of each column */
|
||||
char nullValue[20]; /* The text to print when a NULL comes back from
|
||||
** the database */
|
||||
SavedModeInfo normalMode;/* Holds the mode just before .explain ON */
|
||||
char outfile[FILENAME_MAX]; /* Filename for *out */
|
||||
const char *zDbFilename; /* name of the database file */
|
||||
char *zFreeOnClose; /* Filename to free when closing */
|
||||
@ -899,7 +901,7 @@ static int shell_callback(
|
||||
int i;
|
||||
ShellState *p = (ShellState*)pArg;
|
||||
|
||||
switch( p->mode ){
|
||||
switch( p->cMode ){
|
||||
case MODE_Line: {
|
||||
int w = 5;
|
||||
if( azArg==0 ) break;
|
||||
@ -916,11 +918,24 @@ static int shell_callback(
|
||||
}
|
||||
case MODE_Explain:
|
||||
case MODE_Column: {
|
||||
static const int aExplainWidths[] = {4, 13, 4, 4, 4, 13, 2, 13};
|
||||
const int *colWidth;
|
||||
int showHdr;
|
||||
char *rowSep;
|
||||
if( p->cMode==MODE_Column ){
|
||||
colWidth = p->colWidth;
|
||||
showHdr = p->showHeader;
|
||||
rowSep = p->rowSeparator;
|
||||
}else{
|
||||
colWidth = aExplainWidths;
|
||||
showHdr = 1;
|
||||
rowSep = SEP_Row;
|
||||
}
|
||||
if( p->cnt++==0 ){
|
||||
for(i=0; i<nArg; i++){
|
||||
int w, n;
|
||||
if( i<ArraySize(p->colWidth) ){
|
||||
w = p->colWidth[i];
|
||||
w = colWidth[i];
|
||||
}else{
|
||||
w = 0;
|
||||
}
|
||||
@ -933,17 +948,17 @@ static int shell_callback(
|
||||
if( i<ArraySize(p->actualWidth) ){
|
||||
p->actualWidth[i] = w;
|
||||
}
|
||||
if( p->showHeader ){
|
||||
if( showHdr ){
|
||||
if( w<0 ){
|
||||
utf8_printf(p->out,"%*.*s%s",-w,-w,azCol[i],
|
||||
i==nArg-1 ? p->rowSeparator : " ");
|
||||
i==nArg-1 ? rowSep : " ");
|
||||
}else{
|
||||
utf8_printf(p->out,"%-*.*s%s",w,w,azCol[i],
|
||||
i==nArg-1 ? p->rowSeparator : " ");
|
||||
i==nArg-1 ? rowSep : " ");
|
||||
}
|
||||
}
|
||||
}
|
||||
if( p->showHeader ){
|
||||
if( showHdr ){
|
||||
for(i=0; i<nArg; i++){
|
||||
int w;
|
||||
if( i<ArraySize(p->actualWidth) ){
|
||||
@ -955,7 +970,7 @@ static int shell_callback(
|
||||
utf8_printf(p->out,"%-*.*s%s",w,w,
|
||||
"----------------------------------------------------------"
|
||||
"----------------------------------------------------------",
|
||||
i==nArg-1 ? p->rowSeparator : " ");
|
||||
i==nArg-1 ? rowSep : " ");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -967,7 +982,7 @@ static int shell_callback(
|
||||
}else{
|
||||
w = 10;
|
||||
}
|
||||
if( p->mode==MODE_Explain && azArg[i] && strlen30(azArg[i])>w ){
|
||||
if( p->cMode==MODE_Explain && azArg[i] && strlen30(azArg[i])>w ){
|
||||
w = strlen30(azArg[i]);
|
||||
}
|
||||
if( i==1 && p->aiIndent && p->pStmt ){
|
||||
@ -979,11 +994,11 @@ static int shell_callback(
|
||||
if( w<0 ){
|
||||
utf8_printf(p->out,"%*.*s%s",-w,-w,
|
||||
azArg[i] ? azArg[i] : p->nullValue,
|
||||
i==nArg-1 ? p->rowSeparator : " ");
|
||||
i==nArg-1 ? rowSep : " ");
|
||||
}else{
|
||||
utf8_printf(p->out,"%-*.*s%s",w,w,
|
||||
azArg[i] ? azArg[i] : p->nullValue,
|
||||
i==nArg-1 ? p->rowSeparator : " ");
|
||||
i==nArg-1 ? rowSep : " ");
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -1003,7 +1018,7 @@ static int shell_callback(
|
||||
utf8_printf(p->out, "%s", z);
|
||||
if( i<nArg-1 ){
|
||||
utf8_printf(p->out, "%s", p->colSeparator);
|
||||
}else if( p->mode==MODE_Semi ){
|
||||
}else if( p->cMode==MODE_Semi ){
|
||||
utf8_printf(p->out, ";%s", p->rowSeparator);
|
||||
}else{
|
||||
utf8_printf(p->out, "%s", p->rowSeparator);
|
||||
@ -1508,10 +1523,17 @@ static void explain_data_prepare(ShellState *p, sqlite3_stmt *pSql){
|
||||
|
||||
/* Try to figure out if this is really an EXPLAIN statement. If this
|
||||
** cannot be verified, return early. */
|
||||
if( sqlite3_column_count(pSql)!=8 ){
|
||||
p->cMode = p->mode;
|
||||
return;
|
||||
}
|
||||
zSql = sqlite3_sql(pSql);
|
||||
if( zSql==0 ) return;
|
||||
for(z=zSql; *z==' ' || *z=='\t' || *z=='\n' || *z=='\f' || *z=='\r'; z++);
|
||||
if( sqlite3_strnicmp(z, "explain", 7) ) return;
|
||||
if( sqlite3_strnicmp(z, "explain", 7) ){
|
||||
p->cMode = p->mode;
|
||||
return;
|
||||
}
|
||||
|
||||
for(iOp=0; SQLITE_ROW==sqlite3_step(pSql); iOp++){
|
||||
int i;
|
||||
@ -1528,6 +1550,20 @@ static void explain_data_prepare(ShellState *p, sqlite3_stmt *pSql){
|
||||
|
||||
/* Grow the p->aiIndent array as required */
|
||||
if( iOp>=nAlloc ){
|
||||
if( iOp==0 ){
|
||||
/* Do further verfication that this is explain output. Abort if
|
||||
** it is not */
|
||||
static const char *explainCols[] = {
|
||||
"addr", "opcode", "p1", "p2", "p3", "p4", "p5", "comment" };
|
||||
int jj;
|
||||
for(jj=0; jj<ArraySize(explainCols); jj++){
|
||||
if( strcmp(sqlite3_column_name(pSql,jj),explainCols[jj])!=0 ){
|
||||
p->cMode = p->mode;
|
||||
sqlite3_reset(pSql);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
nAlloc += 100;
|
||||
p->aiIndent = (int*)sqlite3_realloc64(p->aiIndent, nAlloc*sizeof(int));
|
||||
abYield = (int*)sqlite3_realloc64(abYield, nAlloc*sizeof(int));
|
||||
@ -1631,10 +1667,20 @@ static int shell_exec(
|
||||
sqlite3_free(zEQP);
|
||||
}
|
||||
|
||||
/* If the shell is currently in ".explain" mode, gather the extra
|
||||
** data required to add indents to the output.*/
|
||||
if( pArg && pArg->mode==MODE_Explain ){
|
||||
explain_data_prepare(pArg, pStmt);
|
||||
if( pArg ){
|
||||
pArg->cMode = pArg->mode;
|
||||
if( pArg->autoExplain
|
||||
&& sqlite3_column_count(pStmt)==8
|
||||
&& sqlite3_strlike("%EXPLAIN%", sqlite3_sql(pStmt),0)==0
|
||||
){
|
||||
pArg->cMode = MODE_Explain;
|
||||
}
|
||||
|
||||
/* If the shell is currently in ".explain" mode, gather the extra
|
||||
** data required to add indents to the output.*/
|
||||
if( pArg->cMode==MODE_Explain ){
|
||||
explain_data_prepare(pArg, pStmt);
|
||||
}
|
||||
}
|
||||
|
||||
/* perform the first step. this will tell us if we
|
||||
@ -1664,7 +1710,7 @@ static int shell_exec(
|
||||
/* extract the data and data types */
|
||||
for(i=0; i<nCol; i++){
|
||||
aiTypes[i] = x = sqlite3_column_type(pStmt, i);
|
||||
if( x==SQLITE_BLOB && pArg && pArg->mode==MODE_Insert ){
|
||||
if( x==SQLITE_BLOB && pArg && pArg->cMode==MODE_Insert ){
|
||||
azVals[i] = "";
|
||||
}else{
|
||||
azVals[i] = (char*)sqlite3_column_text(pStmt, i);
|
||||
@ -1884,8 +1930,7 @@ static char zHelp[] =
|
||||
".echo on|off Turn command echo on or off\n"
|
||||
".eqp on|off Enable or disable automatic EXPLAIN QUERY PLAN\n"
|
||||
".exit Exit this program\n"
|
||||
".explain ?on|off? Turn output mode suitable for EXPLAIN on or off.\n"
|
||||
" With no args, it turns EXPLAIN on.\n"
|
||||
".explain ?on|off|auto? Turn EXPLAIN output mode on or off or to automatic\n"
|
||||
".fullschema Show schema and the content of sqlite_stat tables\n"
|
||||
".headers on|off Turn display of headers on or off\n"
|
||||
".help Show this message\n"
|
||||
@ -2944,7 +2989,7 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
open_db(p, 0);
|
||||
memcpy(&data, p, sizeof(data));
|
||||
data.showHeader = 1;
|
||||
data.mode = MODE_Column;
|
||||
data.cMode = data.mode = MODE_Column;
|
||||
data.colWidth[0] = 3;
|
||||
data.colWidth[1] = 15;
|
||||
data.colWidth[2] = 58;
|
||||
@ -3039,37 +3084,24 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
}else
|
||||
|
||||
if( c=='e' && strncmp(azArg[0], "explain", n)==0 ){
|
||||
int val = nArg>=2 ? booleanValue(azArg[1]) : 1;
|
||||
if(val == 1) {
|
||||
if(!p->normalMode.valid) {
|
||||
p->normalMode.valid = 1;
|
||||
p->normalMode.mode = p->mode;
|
||||
p->normalMode.showHeader = p->showHeader;
|
||||
memcpy(p->normalMode.colWidth,p->colWidth,sizeof(p->colWidth));
|
||||
int val = 1;
|
||||
if( nArg>=2 ){
|
||||
if( strcmp(azArg[1],"auto")==0 ){
|
||||
val = 99;
|
||||
}else{
|
||||
val = booleanValue(azArg[1]);
|
||||
}
|
||||
/* We could put this code under the !p->explainValid
|
||||
** condition so that it does not execute if we are already in
|
||||
** explain mode. However, always executing it allows us an easy
|
||||
** was to reset to explain mode in case the user previously
|
||||
** did an .explain followed by a .width, .mode or .header
|
||||
** command.
|
||||
*/
|
||||
}
|
||||
if( val==1 && p->mode!=MODE_Explain ){
|
||||
p->normalMode = p->mode;
|
||||
p->mode = MODE_Explain;
|
||||
p->showHeader = 1;
|
||||
memset(p->colWidth,0,sizeof(p->colWidth));
|
||||
p->colWidth[0] = 4; /* addr */
|
||||
p->colWidth[1] = 13; /* opcode */
|
||||
p->colWidth[2] = 4; /* P1 */
|
||||
p->colWidth[3] = 4; /* P2 */
|
||||
p->colWidth[4] = 4; /* P3 */
|
||||
p->colWidth[5] = 13; /* P4 */
|
||||
p->colWidth[6] = 2; /* P5 */
|
||||
p->colWidth[7] = 13; /* Comment */
|
||||
}else if (p->normalMode.valid) {
|
||||
p->normalMode.valid = 0;
|
||||
p->mode = p->normalMode.mode;
|
||||
p->showHeader = p->normalMode.showHeader;
|
||||
memcpy(p->colWidth,p->normalMode.colWidth,sizeof(p->colWidth));
|
||||
p->autoExplain = 0;
|
||||
}else if( val==0 ){
|
||||
if( p->mode==MODE_Explain ) p->mode = p->normalMode;
|
||||
p->autoExplain = 0;
|
||||
}else if( val==99 ){
|
||||
if( p->mode==MODE_Explain ) p->mode = p->normalMode;
|
||||
p->autoExplain = 1;
|
||||
}
|
||||
}else
|
||||
|
||||
@ -3085,7 +3117,7 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
open_db(p, 0);
|
||||
memcpy(&data, p, sizeof(data));
|
||||
data.showHeader = 0;
|
||||
data.mode = MODE_Semi;
|
||||
data.cMode = data.mode = MODE_Semi;
|
||||
rc = sqlite3_exec(p->db,
|
||||
"SELECT sql FROM"
|
||||
" (SELECT sql sql, type type, tbl_name tbl_name, name name, rowid x"
|
||||
@ -3110,7 +3142,7 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
raw_printf(p->out, "ANALYZE sqlite_master;\n");
|
||||
sqlite3_exec(p->db, "SELECT 'ANALYZE sqlite_master'",
|
||||
callback, &data, &zErrMsg);
|
||||
data.mode = MODE_Insert;
|
||||
data.cMode = data.mode = MODE_Insert;
|
||||
data.zDestTable = "sqlite_stat1";
|
||||
shell_exec(p->db, "SELECT * FROM sqlite_stat1",
|
||||
shell_callback, &data,&zErrMsg);
|
||||
@ -3342,7 +3374,7 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
open_db(p, 0);
|
||||
memcpy(&data, p, sizeof(data));
|
||||
data.showHeader = 0;
|
||||
data.mode = MODE_List;
|
||||
data.cMode = data.mode = MODE_List;
|
||||
if( nArg==1 ){
|
||||
rc = sqlite3_exec(p->db,
|
||||
"SELECT name FROM sqlite_master "
|
||||
@ -3528,6 +3560,7 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
"ascii column csv html insert line list tabs tcl\n");
|
||||
rc = 1;
|
||||
}
|
||||
p->cMode = p->mode;
|
||||
}else
|
||||
|
||||
if( c=='n' && strncmp(azArg[0], "nullvalue", n)==0 ){
|
||||
@ -3718,7 +3751,7 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
open_db(p, 0);
|
||||
memcpy(&data, p, sizeof(data));
|
||||
data.showHeader = 0;
|
||||
data.mode = MODE_Semi;
|
||||
data.cMode = data.mode = MODE_Semi;
|
||||
if( nArg==2 ){
|
||||
int i;
|
||||
for(i=0; azArg[1][i]; i++) azArg[1][i] = ToLower(azArg[1][i]);
|
||||
@ -4057,7 +4090,8 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
}
|
||||
utf8_printf(p->out, "%12.12s: %s\n","echo", p->echoOn ? "on" : "off");
|
||||
utf8_printf(p->out, "%12.12s: %s\n","eqp", p->autoEQP ? "on" : "off");
|
||||
utf8_printf(p->out,"%9.9s: %s\n","explain",p->normalMode.valid?"on":"off");
|
||||
utf8_printf(p->out, "%12.12s: %s\n","explain",
|
||||
p->mode==MODE_Explain ? "on" : p->autoExplain ? "auto" : "off");
|
||||
utf8_printf(p->out,"%12.12s: %s\n","headers", p->showHeader ? "on" : "off");
|
||||
utf8_printf(p->out, "%12.12s: %s\n","mode", modeDescr[p->mode]);
|
||||
utf8_printf(p->out, "%12.12s: ", "nullvalue");
|
||||
@ -4856,7 +4890,8 @@ static void usage(int showDetail){
|
||||
*/
|
||||
static void main_init(ShellState *data) {
|
||||
memset(data, 0, sizeof(*data));
|
||||
data->mode = MODE_List;
|
||||
data->normalMode = data->cMode = data->mode = MODE_List;
|
||||
data->autoExplain = 1;
|
||||
memcpy(data->colSeparator,SEP_Column, 2);
|
||||
memcpy(data->rowSeparator,SEP_Row, 2);
|
||||
data->showHeader = 0;
|
||||
@ -5189,6 +5224,7 @@ int SQLITE_CDECL main(int argc, char **argv){
|
||||
raw_printf(stderr,"Use -help for a list of options.\n");
|
||||
return 1;
|
||||
}
|
||||
data.cMode = data.mode;
|
||||
}
|
||||
|
||||
if( !readStdin ){
|
||||
|
@ -347,7 +347,7 @@ typedef int (*sqlite3_callback)(void*,int,char**, char**);
|
||||
** from [sqlite3_malloc()] and passed back through the 5th parameter.
|
||||
** To avoid memory leaks, the application should invoke [sqlite3_free()]
|
||||
** on error message strings returned through the 5th parameter of
|
||||
** of sqlite3_exec() after the error message string is no longer needed.
|
||||
** sqlite3_exec() after the error message string is no longer needed.
|
||||
** ^If the 5th parameter to sqlite3_exec() is not NULL and no errors
|
||||
** occur, then sqlite3_exec() sets the pointer in its 5th parameter to
|
||||
** NULL before returning.
|
||||
|
@ -3112,6 +3112,7 @@ struct Walker {
|
||||
SrcList *pSrcList; /* FROM clause */
|
||||
struct SrcCount *pSrcCount; /* Counting column references */
|
||||
struct CCurHint *pCCurHint; /* Used by codeCursorHint() */
|
||||
int *aiCol; /* array of column indexes */
|
||||
} u;
|
||||
};
|
||||
|
||||
@ -3181,6 +3182,13 @@ int sqlite3CantopenError(int);
|
||||
#define SQLITE_MISUSE_BKPT sqlite3MisuseError(__LINE__)
|
||||
#define SQLITE_CANTOPEN_BKPT sqlite3CantopenError(__LINE__)
|
||||
|
||||
/*
|
||||
** FTS3 and FTS4 both require virtual table support
|
||||
*/
|
||||
#if defined(SQLITE_OMIT_VIRTUALTABLE)
|
||||
# undef SQLITE_ENABLE_FTS3
|
||||
# undef SQLITE_ENABLE_FTS4
|
||||
#endif
|
||||
|
||||
/*
|
||||
** FTS4 is really an extension for FTS3. It is enabled using the
|
||||
@ -3557,7 +3565,7 @@ void sqlite3GenerateRowIndexDelete(Parse*, Table*, int, int, int*, int);
|
||||
int sqlite3GenerateIndexKey(Parse*, Index*, int, int, int, int*,Index*,int);
|
||||
void sqlite3ResolvePartIdxLabel(Parse*,int);
|
||||
void sqlite3GenerateConstraintChecks(Parse*,Table*,int*,int,int,int,int,
|
||||
u8,u8,int,int*);
|
||||
u8,u8,int,int*,int*);
|
||||
void sqlite3CompleteInsertion(Parse*,Table*,int,int,int,int*,int,int,int);
|
||||
int sqlite3OpenTableAndIndices(Parse*, Table*, int, u8, int, u8*, int*, int*);
|
||||
void sqlite3BeginWriteOperation(Parse*, int, int);
|
||||
@ -3776,7 +3784,6 @@ void sqlite3DeleteIndexSamples(sqlite3*,Index*);
|
||||
void sqlite3DefaultRowEst(Index*);
|
||||
void sqlite3RegisterLikeFunctions(sqlite3*, int);
|
||||
int sqlite3IsLikeFunction(sqlite3*,Expr*,int*,char*);
|
||||
void sqlite3MinimumFileFormat(Parse*, int, int);
|
||||
void sqlite3SchemaClear(void *);
|
||||
Schema *sqlite3SchemaGet(sqlite3 *, Btree *);
|
||||
int sqlite3SchemaToIndex(sqlite3 *db, Schema *);
|
||||
|
@ -572,7 +572,8 @@ void sqlite3Update(
|
||||
/* Do constraint checks. */
|
||||
assert( regOldRowid>0 );
|
||||
sqlite3GenerateConstraintChecks(pParse, pTab, aRegIdx, iDataCur, iIdxCur,
|
||||
regNewRowid, regOldRowid, chngKey, onError, labelContinue, &bReplace);
|
||||
regNewRowid, regOldRowid, chngKey, onError, labelContinue, &bReplace,
|
||||
aXRef);
|
||||
|
||||
/* Do FK constraint checks. */
|
||||
if( hasFK ){
|
||||
|
11
src/where.c
11
src/where.c
@ -3438,7 +3438,6 @@ static const char *wherePathName(WherePath *pPath, int nLoop, WhereLoop *pLast){
|
||||
** order.
|
||||
*/
|
||||
static LogEst whereSortingCost(
|
||||
WhereInfo *pWInfo,
|
||||
LogEst nRow,
|
||||
int nOrderBy,
|
||||
int nSorted
|
||||
@ -3460,14 +3459,6 @@ static LogEst whereSortingCost(
|
||||
assert( nOrderBy>0 && 66==sqlite3LogEst(100) );
|
||||
rScale = sqlite3LogEst((nOrderBy-nSorted)*100/nOrderBy) - 66;
|
||||
rSortCost = nRow + estLog(nRow) + rScale + 16;
|
||||
|
||||
/* TUNING: The cost of implementing DISTINCT using a B-TREE is
|
||||
** similar but with a larger constant of proportionality.
|
||||
** Multiply by an additional factor of 3.0. */
|
||||
if( pWInfo->wctrlFlags & WHERE_WANT_DISTINCT ){
|
||||
rSortCost += 16;
|
||||
}
|
||||
|
||||
return rSortCost;
|
||||
}
|
||||
|
||||
@ -3601,7 +3592,7 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
|
||||
if( isOrdered>=0 && isOrdered<nOrderBy ){
|
||||
if( aSortCost[isOrdered]==0 ){
|
||||
aSortCost[isOrdered] = whereSortingCost(
|
||||
pWInfo, nRowEst, nOrderBy, isOrdered
|
||||
nRowEst, nOrderBy, isOrdered
|
||||
);
|
||||
}
|
||||
rCost = sqlite3LogEstAdd(rUnsorted, aSortCost[isOrdered]);
|
||||
|
@ -184,7 +184,7 @@ do_test alter3-3.2 {
|
||||
if {!$has_codec} {
|
||||
do_test alter3-3.3 {
|
||||
get_file_format
|
||||
} {3}
|
||||
} {4}
|
||||
}
|
||||
ifcapable schema_version {
|
||||
do_test alter3-3.4 {
|
||||
@ -220,7 +220,7 @@ do_test alter3-4.2 {
|
||||
if {!$has_codec} {
|
||||
do_test alter3-4.3 {
|
||||
get_file_format
|
||||
} {3}
|
||||
} {4}
|
||||
}
|
||||
ifcapable schema_version {
|
||||
do_test alter3-4.4 {
|
||||
@ -270,7 +270,7 @@ ifcapable attach {
|
||||
if {!$has_codec} {
|
||||
do_test alter3-5.5 {
|
||||
list [get_file_format test2.db] [get_file_format]
|
||||
} {2 3}
|
||||
} {4 4}
|
||||
}
|
||||
do_test alter3-5.6 {
|
||||
execsql {
|
||||
@ -347,19 +347,19 @@ if {!$has_codec} {
|
||||
ALTER TABLE abc ADD d DEFAULT NULL;
|
||||
}
|
||||
get_file_format
|
||||
} {2}
|
||||
} {4}
|
||||
do_test alter3-7.3 {
|
||||
execsql {
|
||||
ALTER TABLE abc ADD e DEFAULT 10;
|
||||
}
|
||||
get_file_format
|
||||
} {3}
|
||||
} {4}
|
||||
do_test alter3-7.4 {
|
||||
execsql {
|
||||
ALTER TABLE abc ADD f DEFAULT NULL;
|
||||
}
|
||||
get_file_format
|
||||
} {3}
|
||||
} {4}
|
||||
do_test alter3-7.5 {
|
||||
execsql {
|
||||
VACUUM;
|
||||
|
@ -459,4 +459,24 @@ do_execsql_test 8.1 {
|
||||
CREATE TABLE t811(b, CHECK( xyzzy.t811.b BETWEEN 5 AND 10 ));
|
||||
} {}
|
||||
|
||||
# Make sure check constraints involving the ROWID are not ignored
|
||||
#
|
||||
do_execsql_test 9.1 {
|
||||
CREATE TABLE t1(
|
||||
a INTEGER PRIMARY KEY,
|
||||
b INTEGER NOT NULL CONSTRAINT 'b-check' CHECK( b>a ),
|
||||
c INTEGER NOT NULL CONSTRAINT 'c-check' CHECK( c>rowid*2 ),
|
||||
d INTEGER NOT NULL CONSTRAINT 'd-check' CHECK( d BETWEEN b AND c )
|
||||
);
|
||||
INSERT INTO t1(a,b,c,d) VALUES(1,2,4,3),(2,4,6,5),(3,10,30,20);
|
||||
} {}
|
||||
do_catchsql_test 9.2 {
|
||||
UPDATE t1 SET b=0 WHERE a=1;
|
||||
} {1 {CHECK constraint failed: b-check}}
|
||||
do_catchsql_test 9.3 {
|
||||
UPDATE t1 SET c=a*2 WHERE a=1;
|
||||
} {1 {CHECK constraint failed: c-check}}
|
||||
|
||||
|
||||
|
||||
finish_test
|
||||
|
@ -22,16 +22,27 @@ set -u
|
||||
|
||||
TMPSPACE=./mkpkg_tmp_dir
|
||||
VERSION=`cat $TOP/VERSION`
|
||||
HASH=`sed 's/^\(..........\).*/\1/' $TOP/manifest.uuid`
|
||||
DATETIME=`grep '^D' $TOP/manifest | sed -e 's/[^0-9]//g' -e 's/\(............\).*/\1/'`
|
||||
|
||||
# Set global variable $ARTIFACT to the "3xxyyzz" string incorporated
|
||||
# into artifact filenames. And $VERSION2 to the "3.x.y[.z]" form.
|
||||
xx=`echo $VERSION|sed 's/3\.\([0-9]*\)\..*/\1/'`
|
||||
yy=`echo $VERSION|sed 's/3\.[^.]*\.\([0-9]*\).*/\1/'`
|
||||
zz=0
|
||||
set +e
|
||||
zz=`echo $VERSION|sed 's/3\.[^.]*\.[^.]*\.\([0-9]*\).*/\1/'|grep -v '\.'`
|
||||
set -e
|
||||
ARTIFACT=`printf "3%.2d%.2d%.2d" $xx $yy $zz`
|
||||
# If this script is given an argument of --snapshot, then generate a
|
||||
# snapshot tarball named for the current checkout SHA1 hash, rather than
|
||||
# the version number.
|
||||
#
|
||||
if test "$#" -ge 1 -a x$1 != x--snapshot
|
||||
then
|
||||
# Set global variable $ARTIFACT to the "3xxyyzz" string incorporated
|
||||
# into artifact filenames. And $VERSION2 to the "3.x.y[.z]" form.
|
||||
xx=`echo $VERSION|sed 's/3\.\([0-9]*\)\..*/\1/'`
|
||||
yy=`echo $VERSION|sed 's/3\.[^.]*\.\([0-9]*\).*/\1/'`
|
||||
zz=0
|
||||
set +e
|
||||
zz=`echo $VERSION|sed 's/3\.[^.]*\.[^.]*\.\([0-9]*\).*/\1/'|grep -v '\.'`
|
||||
set -e
|
||||
TARBALLNAME=`printf "sqlite-autoconf-3%.2d%.2d%.2d" $xx $yy $zz`
|
||||
else
|
||||
TARBALLNAME=sqlite-snapshot-$DATETIME
|
||||
fi
|
||||
|
||||
rm -rf $TMPSPACE
|
||||
cp -R $TOP/autoconf $TMPSPACE
|
||||
@ -73,6 +84,8 @@ rm -rf autom4te.cache
|
||||
cd ../
|
||||
./configure && make dist
|
||||
tar -xzf sqlite-$VERSION.tar.gz
|
||||
mv sqlite-$VERSION sqlite-autoconf-$ARTIFACT
|
||||
tar -czf sqlite-autoconf-$ARTIFACT.tar.gz sqlite-autoconf-$ARTIFACT
|
||||
mv sqlite-autoconf-$ARTIFACT.tar.gz ..
|
||||
mv sqlite-$VERSION $TARBALLNAME
|
||||
tar -czf $TARBALLNAME.tar.gz $TARBALLNAME
|
||||
mv $TARBALLNAME.tar.gz ..
|
||||
cd ..
|
||||
ls -l $TARBALLNAME.tar.gz
|
||||
|
@ -389,7 +389,7 @@ set shortNames(WP80,2013) SQLite.WP80.2013
|
||||
set shortNames(WP81,2013) SQLite.WP81
|
||||
set shortNames(Win32,2012) SQLite.Win32
|
||||
set shortNames(Win32,2013) SQLite.Win32.2013
|
||||
set shortNames(UAP,2015) SQLite.UAP.2015
|
||||
set shortNames(UWP,2015) SQLite.UWP.2015
|
||||
|
||||
set displayNames(WinRT,2012) "SQLite for Windows Runtime"
|
||||
set displayNames(WinRT,2013) "SQLite for Windows Runtime"
|
||||
@ -399,7 +399,7 @@ set displayNames(WP80,2013) "SQLite for Windows Phone"
|
||||
set displayNames(WP81,2013) "SQLite for Windows Phone 8.1"
|
||||
set displayNames(Win32,2012) "SQLite for Windows"
|
||||
set displayNames(Win32,2013) "SQLite for Windows"
|
||||
set displayNames(UAP,2015) "SQLite for Universal App Platform"
|
||||
set displayNames(UWP,2015) "SQLite for Universal Windows Platform"
|
||||
|
||||
if {[string equal $packageFlavor WinRT]} then {
|
||||
set shortName $shortNames($packageFlavor,$vsVersion)
|
||||
@ -455,7 +455,7 @@ if {[string equal $packageFlavor WinRT]} then {
|
||||
set extraSdkPath "\\..\\$targetPlatformIdentifier"
|
||||
set extraFileListAttributes \
|
||||
[getExtraFileListXmlChunk $packageFlavor $vsVersion]
|
||||
} elseif {[string equal $packageFlavor UAP]} then {
|
||||
} elseif {[string equal $packageFlavor UWP]} then {
|
||||
if {$vsVersion ne "2015"} then {
|
||||
fail [appendArgs \
|
||||
"unsupported combination, package flavor " $packageFlavor \
|
||||
@ -463,7 +463,7 @@ if {[string equal $packageFlavor WinRT]} then {
|
||||
}
|
||||
set shortName $shortNames($packageFlavor,$vsVersion)
|
||||
set displayName $displayNames($packageFlavor,$vsVersion)
|
||||
set targetPlatformIdentifier UAP
|
||||
set targetPlatformIdentifier UWP
|
||||
set targetPlatformVersion v0.8.0.0
|
||||
set minVsVersion [getMinVsVersionXmlChunk $vsVersion]
|
||||
set maxPlatformVersion \
|
||||
@ -485,7 +485,7 @@ if {[string equal $packageFlavor WinRT]} then {
|
||||
} else {
|
||||
fail [appendArgs \
|
||||
"unsupported package flavor, must be one of: " \
|
||||
[list WinRT WinRT81 WP80 WP81 UAP Win32]]
|
||||
[list WinRT WinRT81 WP80 WP81 UWP Win32]]
|
||||
}
|
||||
|
||||
###############################################################################
|
||||
|
@ -5,9 +5,10 @@
|
||||
#
|
||||
rm -f sqlite3.c
|
||||
make sqlite3.c
|
||||
echo '********** No optimizations. Includes FTS4 and RTREE *********'
|
||||
echo '********** No optimizations. Includes FTS4/5, RTREE, JSON1 ***'
|
||||
gcc -c -Wshadow -Wall -Wextra -pedantic-errors -Wno-long-long -std=c89 \
|
||||
-ansi -DHAVE_STDINT_H -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_RTREE \
|
||||
-DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 \
|
||||
sqlite3.c
|
||||
echo '********** Android configuration ******************************'
|
||||
gcc -c \
|
||||
@ -35,7 +36,8 @@ echo '********** No optimizations. ENABLE_STAT4. THREADSAFE=0 *******'
|
||||
gcc -c -Wshadow -Wall -Wextra -pedantic-errors -Wno-long-long -std=c89 \
|
||||
-ansi -DSQLITE_ENABLE_STAT4 -DSQLITE_THREADSAFE=0 \
|
||||
sqlite3.c
|
||||
echo '********** Optimized -O3. Includes FTS4 and RTREE ************'
|
||||
echo '********** Optimized -O3. Includes FTS4/5, RTREE, JSON1 ******'
|
||||
gcc -O3 -c -Wshadow -Wall -Wextra -pedantic-errors -Wno-long-long -std=c89 \
|
||||
-ansi -DHAVE_STDINT_H -DSQLITE_ENABLE_FTS4 -DSQLITE_ENABLE_RTREE \
|
||||
-DSQLITE_ENABLE_FTS5 -DSQLITE_ENABLE_JSON1 \
|
||||
sqlite3.c
|
||||
|
Loading…
x
Reference in New Issue
Block a user