Compare commits
134 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 262de1bebb | |||
| abfcdb6302 | |||
| 5a0c3456f7 | |||
| ae1e169b2b | |||
| 9a78d4724a | |||
| fb90add461 | |||
| 81c31ff918 | |||
| 1c2023dd1b | |||
| 0592ffed82 | |||
| d088df5464 | |||
| 5eea255877 | |||
| 10f1e4ccd9 | |||
| b423178ea9 | |||
| 993632c3e5 | |||
| 6eb7764796 | |||
| 161de89e7e | |||
| 73304602e4 | |||
| cdea0ebac4 | |||
| 46e4155e9f | |||
| 375552f224 | |||
| b03592c324 | |||
| e2a6feee5e | |||
| b24fc84271 | |||
| 9e36a09d14 | |||
| 76b77c63f7 | |||
| a40e6e9273 | |||
| e72a8a4031 | |||
| f0e3e5ae3c | |||
| f5fb820c0f | |||
| e2f294a1e5 | |||
| 32d255851e | |||
| b74c7880d6 | |||
| 72c5b9bf0e | |||
| 885fad890c | |||
| 4da761773e | |||
| 624cb96f54 | |||
| afb88c5296 | |||
| 78b6c17faa | |||
| a525d635a9 | |||
| 23caead6cb | |||
| b94228a119 | |||
| d11a3fd916 | |||
| 90675da34a | |||
| f9a02e166a | |||
| d8712c6c25 | |||
| c2e400af04 | |||
| dd719bebfa | |||
| fe15ed4342 | |||
| a9e4ebc513 | |||
| bcdb28b8f9 | |||
| 4f5eba199a | |||
| cab9574668 | |||
| 6031de92c6 | |||
| 88282af521 | |||
| f578ce102e | |||
| 9c5fb63d37 | |||
| 87cb97b0ec | |||
| 45b4dca606 | |||
| 1b59f37c06 | |||
| dcaae8fd4b | |||
| 4924847cb9 | |||
| 5899d9c08f | |||
| 39b9249562 | |||
| 863fcdc116 | |||
| 72fea11809 | |||
| a4ff06f056 | |||
| 629e1bfa6d | |||
| d5a780fddf | |||
| 589ce93e9e | |||
| 4859bc9a9f | |||
| 4dfc4dc2df | |||
| ea7ea76a59 | |||
| c85c102efe | |||
| 2623a19ab0 | |||
| b8d18f321c | |||
| 4723539637 | |||
| ed3cf6ef37 | |||
| 17408fbbd8 | |||
| b23cce9a16 | |||
| 0b453b3b33 | |||
| 64366ae114 | |||
| 7b179a3098 | |||
| f553588c76 | |||
| 50ec92f7ce | |||
| 94fe1ad1c6 | |||
| da1bf77cc2 | |||
| 8f97647477 | |||
| 48dd75df73 | |||
| 492925a8f0 | |||
| 97b0610602 | |||
| 50bb0aaa2c | |||
| 4b0a2e0106 | |||
| 48d11044ba | |||
| 7f5a10e4ba | |||
| ab85d9abd6 | |||
| dd2deecbbd | |||
| eaefd9ccc8 | |||
| 7998b889e8 | |||
| ddc764b274 | |||
| f7f78a624d | |||
| 56423385fb | |||
| 2813eb3c9e | |||
| ce527f2e97 | |||
| 29f976432a | |||
| fba24d3528 | |||
| 74672acd94 | |||
| 2c72c55dca | |||
| d564bdb050 | |||
| c857b9eb5d | |||
| 706fdeebb8 | |||
| c8c95f5149 | |||
| 51bbf0c7b8 | |||
| 1e2834dd45 | |||
| c51dccbd8b | |||
| 46a62afbab | |||
| 44b8c37017 | |||
| c5c3cbc026 | |||
| 3b3f230d95 | |||
| 92e71573ce | |||
| dceffee1ba | |||
| 512ad53f3a | |||
| f9d1141a3b | |||
| dcf757c2ea | |||
| 54e35b543d | |||
| 58b4a8f6e7 | |||
| 43eafb7b76 | |||
| 08f1ba0767 | |||
| 0992764c7a | |||
| bcd6d5d393 | |||
| d0720eee5e | |||
| 777c35dbe8 | |||
| 0218424e5a | |||
| 6e8b3d3caa | |||
| de30fb5fc2 |
+17
-38
@@ -701,7 +701,7 @@ dbhash$(TEXE): $(TOP)/tool/dbhash.c sqlite3.lo sqlite3.h
|
||||
$(LTLINK) -o $@ $(TOP)/tool/dbhash.c sqlite3.lo $(TLIBS)
|
||||
|
||||
RSYNC_SRC = \
|
||||
$(TOP)/tool/sqlite3-rsync.c \
|
||||
$(TOP)/tool/sqlite3_rsync.c \
|
||||
sqlite3.c
|
||||
|
||||
RSYNC_OPT = \
|
||||
@@ -711,7 +711,7 @@ RSYNC_OPT = \
|
||||
-DSQLITE_OMIT_LOAD_EXTENSION \
|
||||
-DSQLITE_OMIT_DEPRECATED
|
||||
|
||||
sqlite3-rsync$(TEXE): $(RSYNC_SRC)
|
||||
sqlite3_rsync$(TEXE): $(RSYNC_SRC)
|
||||
$(TCC) -o $@ $(RSYNC_OPT) $(RSYNC_SRC) $(TLIBS)
|
||||
|
||||
scrub$(TEXE): $(TOP)/ext/misc/scrub.c sqlite3.lo
|
||||
@@ -722,13 +722,13 @@ srcck1$(BEXE): $(TOP)/tool/srcck1.c
|
||||
$(BCC) -o srcck1$(BEXE) $(TOP)/tool/srcck1.c
|
||||
|
||||
sourcetest: srcck1$(BEXE) sqlite3.c
|
||||
./srcck1 sqlite3.c
|
||||
./srcck1$(BEXE) sqlite3.c
|
||||
|
||||
src-verify: $(TOP)/tool/src-verify.c
|
||||
src-verify$(BEXE): $(TOP)/tool/src-verify.c
|
||||
$(BCC) -o src-verify$(BEXE) $(TOP)/tool/src-verify.c
|
||||
|
||||
verify-source: ./src-verify
|
||||
./src-verify $(TOP)
|
||||
verify-source: ./src-verify$(BEXE)
|
||||
./src-verify$(BEXE) $(TOP)
|
||||
|
||||
fuzzershell$(TEXE): $(TOP)/tool/fuzzershell.c sqlite3.c sqlite3.h
|
||||
$(LTLINK) -o $@ $(FUZZERSHELL_OPT) \
|
||||
@@ -785,20 +785,6 @@ dbfuzz2$(TEXE): $(TOP)/test/dbfuzz2.c sqlite3.c sqlite3.h
|
||||
mkdir -p dbfuzz2-dir
|
||||
cp $(TOP)/test/dbfuzz2-seed* dbfuzz2-dir
|
||||
|
||||
dbfuzz2-asan: $(TOP)/test/dbfuzz2.c sqlite3.c sqlite3.h
|
||||
clang-6.0 $(OPT_FEATURE_FLAGS) $(OPTS) -I. -g -O0 \
|
||||
-fsanitize=fuzzer,undefined,address -o dbfuzz2-asan \
|
||||
$(DBFUZZ2_OPTS) $(TOP)/test/dbfuzz2.c sqlite3.c $(TLIBS)
|
||||
mkdir -p dbfuzz2-dir
|
||||
cp $(TOP)/test/dbfuzz2-seed* dbfuzz2-dir
|
||||
|
||||
dbfuzz2-msan: $(TOP)/test/dbfuzz2.c sqlite3.c sqlite3.h
|
||||
clang-6.0 $(OPT_FEATURE_FLAGS) $(OPTS) -I. -g -O0 \
|
||||
-fsanitize=fuzzer,undefined,memory -o dbfuzz2-msan \
|
||||
$(DBFUZZ2_OPTS) $(TOP)/test/dbfuzz2.c sqlite3.c $(TLIBS)
|
||||
mkdir -p dbfuzz2-dir
|
||||
cp $(TOP)/test/dbfuzz2-seed* dbfuzz2-dir
|
||||
|
||||
mptester$(TEXE): sqlite3.lo $(TOP)/mptest/mptest.c
|
||||
$(LTLINK) -o $@ -I. $(TOP)/mptest/mptest.c sqlite3.lo \
|
||||
$(TLIBS) -rpath "$(libdir)"
|
||||
@@ -846,7 +832,7 @@ has_tclconfig:
|
||||
cp fts5.c fts5.h tsrc
|
||||
touch .target_source
|
||||
|
||||
sqlite3.c: .target_source $(TOP)/tool/mksqlite3c.tcl src-verify has_tclsh84
|
||||
sqlite3.c: .target_source $(TOP)/tool/mksqlite3c.tcl src-verify$(BEXE) has_tclsh84
|
||||
$(TCLSH_CMD) $(TOP)/tool/mksqlite3c.tcl $(AMALGAMATION_LINE_MACROS) $(EXTRA_SRC)
|
||||
cp tsrc/sqlite3ext.h .
|
||||
cp $(TOP)/ext/session/sqlite3session.h .
|
||||
@@ -1558,8 +1544,10 @@ snapshot-tarball: sqlite3.c sqlite3rc.h
|
||||
|
||||
# Build a ZIP archive containing various command-line tools.
|
||||
#
|
||||
tool-zip: testfixture sqlite3 sqldiff sqlite3_analyzer $(TOP)/tool/mktoolzip.tcl
|
||||
./testfixture $(TOP)/tool/mktoolzip.tcl
|
||||
tool-zip: testfixture$(TEXE) sqlite3$(TEXE) sqldiff$(TEXE) \
|
||||
sqlite3_analyzer$(TEXE) sqlite3_rsync$(TEXE) $(TOP)/tool/mktoolzip.tcl
|
||||
strip sqlite3$(TEXE) sqldiff$(TEXE) sqlite3_analyzer$(TEXE) sqlite3_rsync$(TEXE)
|
||||
./testfixture$(TEXE) $(TOP)/tool/mktoolzip.tcl
|
||||
|
||||
# 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
|
||||
@@ -1587,10 +1575,10 @@ lib_install: libsqlite3.la
|
||||
$(INSTALL) -d $(DESTDIR)$(libdir)
|
||||
$(LTINSTALL) libsqlite3.la $(DESTDIR)$(libdir)
|
||||
|
||||
# Use $(tcl_install_$(HAVE_TCL)) to resolve to either tcl_install or
|
||||
# Use $(tcl_install_$(HAVE_TCL)) to resolve to either tclextension-install or
|
||||
# an empty value.
|
||||
tcl_install_0 =
|
||||
tcl_install_1 = tcl_install
|
||||
tcl_install_1 = tclextension-install
|
||||
|
||||
install: sqlite3$(TEXE) lib_install sqlite3.h sqlite3.pc $(tcl_install_$(HAVE_TCL))
|
||||
$(INSTALL) -d $(DESTDIR)$(bindir)
|
||||
@@ -1601,27 +1589,18 @@ install: sqlite3$(TEXE) lib_install sqlite3.h sqlite3.pc $(tcl_install_$(HAVE_TC
|
||||
$(INSTALL) -d $(DESTDIR)$(pkgconfigdir)
|
||||
$(INSTALL) -m 0644 sqlite3.pc $(DESTDIR)$(pkgconfigdir)
|
||||
|
||||
pkgIndex.tcl:
|
||||
echo 'package ifneeded sqlite3 $(RELEASE) [list load [file join $$dir libtclsqlite3[info sharedlibextension]] sqlite3]' > $@
|
||||
|
||||
tcl_install: lib_install libtclsqlite3.la pkgIndex.tcl
|
||||
$(INSTALL) -d $(DESTDIR)$(TCLLIBDIR)
|
||||
$(LTINSTALL) libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)
|
||||
rm -f $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.a
|
||||
$(INSTALL) -m 0644 pkgIndex.tcl $(DESTDIR)$(TCLLIBDIR)
|
||||
|
||||
# Build the SQLite TCL extension in a way that make it compatible
|
||||
# with whatever version of TCL is running as $TCLSH_CMD, possibly defined
|
||||
# by --with-tclsh=
|
||||
#
|
||||
tclextension: tclsqlite3.c
|
||||
$(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --build-only --cc $(CC) $(CFLAGS) $(OPT_FEATURE_FLAGS) $(OPTS)
|
||||
$(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --build-only --cc "$(CC)" $(CFLAGS) $(OPT_FEATURE_FLAGS) $(OPTS)
|
||||
|
||||
# Install the SQLite TCL extension in a way that is appropriate for $TCLSH_CMD
|
||||
# to find it.
|
||||
#
|
||||
tclextension-install: tclsqlite3.c
|
||||
$(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --cc $(CC) $(CFLAGS) $(OPT_FEATURE_FLAGS) $(OPTS)
|
||||
$(TCLSH_CMD) $(TOP)/tool/buildtclext.tcl --destdir "$(DESTDIR)" --cc "$(CC)" $(CFLAGS) $(OPT_FEATURE_FLAGS) $(OPTS)
|
||||
|
||||
# Install the SQLite TCL extension that is used by $TCLSH_CMD
|
||||
#
|
||||
@@ -1653,11 +1632,11 @@ tidy:
|
||||
rm -f showjournal$(TEXE) showstat4$(TEXE) showwal$(TEXE) speedtest1$(TEXE)
|
||||
rm -f wordcount$(TEXE) changeset$(TEXE) version-info$(TEXE)
|
||||
rm -f *.dll *.lib *.exp *.def *.pc *.vsix *.so *.dylib pkgIndex.tcl
|
||||
rm -f sqlite3_analyzer$(TEXE) sqlite3-rsync$(TEXE)
|
||||
rm -f sqlite3_analyzer$(TEXE) sqlite3_rsync$(TEXE)
|
||||
rm -f mptester$(TEXE) rbu$(TEXE) srcck1$(TEXE)
|
||||
rm -f fuzzershell$(TEXE) fuzzcheck$(TEXE) sqldiff$(TEXE) dbhash$(TEXE)
|
||||
rm -f threadtest5$(TEXE)
|
||||
rm -f src-verify has_tclsh*
|
||||
rm -f src-verify$(BEXE) has_tclsh* has_tclconfig
|
||||
|
||||
# Removes build products and test logs. Retains ./configure outputs.
|
||||
#
|
||||
|
||||
+61
-11
@@ -66,6 +66,14 @@ USE_STDCALL = 0
|
||||
USE_SEH = 1
|
||||
!ENDIF
|
||||
|
||||
# Use STATICALLY_LINK_TCL=1 to statically link against TCL
|
||||
#
|
||||
!IFNDEF STATICALLY_LINK_TCL
|
||||
STATICALLY_LINK_TCL = 0
|
||||
!ELSEIF $(STATICALLY_LINK_TCL)!=0
|
||||
CCOPTS = $(CCOPTS) -DSTATIC_BUILD
|
||||
!ENDIF
|
||||
|
||||
# Set this non-0 to have the shell executable link against the core dynamic
|
||||
# link library.
|
||||
#
|
||||
@@ -929,10 +937,9 @@ TCC = $(TCC) /fsanitize=address
|
||||
# prior to running nmake in order to match the actual installed location and
|
||||
# version on this machine.
|
||||
#
|
||||
!IFNDEF TCLVERSION
|
||||
TCLVERSION = 86
|
||||
!IF $(STATICALLY_LINK_TCL)!=0
|
||||
TCLSUFFIX = s
|
||||
!ENDIF
|
||||
|
||||
!IFNDEF TCLSUFFIX
|
||||
TCLSUFFIX =
|
||||
!ENDIF
|
||||
@@ -941,6 +948,19 @@ TCLSUFFIX =
|
||||
TCLDIR = C:\Tcl
|
||||
!ENDIF
|
||||
|
||||
!IFNDEF TCLVERSION
|
||||
!IF EXISTS("$(TCLDIR)\lib\tcl90$(TCLSUFFIX).lib")
|
||||
TCLVERSION = 90
|
||||
!ELSEIF EXISTS("$(TCLDIR)\lib\tcl86$(TCLSUFFIX).lib")
|
||||
TCLVERSION = 86
|
||||
!ELSEIF EXISTS("$(TCLDIR)\lib\tcl86t.lib")
|
||||
TCLSUFFIX = t
|
||||
TCLVERSION = 86
|
||||
!ELSE
|
||||
TCLVERSION = 90
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
!IFNDEF TCLINCDIR
|
||||
TCLINCDIR = $(TCLDIR)\include
|
||||
!ENDIF
|
||||
@@ -953,9 +973,21 @@ TCLLIBDIR = $(TCLDIR)\lib
|
||||
LIBTCL = tcl$(TCLVERSION)$(TCLSUFFIX).lib
|
||||
!ENDIF
|
||||
|
||||
!IFNDEF TCLLIBS
|
||||
!IF $(STATICALLY_LINK_TCL)!=0
|
||||
TCLLIBS = /NODEFAULTLIB:libucrt.lib netapi32.lib user32.lib ucrt.lib
|
||||
!ELSE
|
||||
TCLLIBS =
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
!IFNDEF LIBTCLSTUB
|
||||
!IF EXISTS("$(TCLLIBDIR)\tclstub$(TCLSUFFIX).lib")
|
||||
LIBTCLSTUB = tclstub$(TCLSUFFIX).lib
|
||||
!ELSE
|
||||
LIBTCLSTUB = tclstub$(TCLVERSION)$(TCLSUFFIX).lib
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
!IFNDEF LIBTCLPATH
|
||||
LIBTCLPATH = $(TCLDIR)\bin
|
||||
@@ -1013,10 +1045,18 @@ LIBICU = icuuc.lib icuin.lib
|
||||
# specific Tcl shell to use.
|
||||
#
|
||||
!IFNDEF TCLSH_CMD
|
||||
!IF $(USE_TCLSH_IN_PATH)!=0 || !EXIST("$(TCLDIR)\bin\tclsh.exe")
|
||||
TCLSH_CMD = tclsh
|
||||
!ELSE
|
||||
!IF EXISTS("$(TCLDIR)\bin\tclsh$(TCLVERSION).exe")
|
||||
TCLSH_CMD = $(TCLDIR)\bin\tclsh$(TCLVERSION).exe
|
||||
!ELSEIF EXISTS("$(TCLDIR)\bin\tclsh90.exe")
|
||||
TCLSH_CMD = $(TCLDIR)\bin\tclsh90.exe
|
||||
!ELSEIF EXISTS("$(TCLDIR)\bin\tclsh86.exe")
|
||||
TCLSH_CMD = $(TCLDIR)\bin\tclsh86.exe
|
||||
!ELSEIF EXISTS("$(TCLDIR)\bin\tclsh86t.exe")
|
||||
TCLSH_CMD = $(TCLDIR)\bin\tclsh86t.exe
|
||||
!ELSEIF EXISTS("$(TCLDIR)\bin\tclsh.exe")
|
||||
TCLSH_CMD = $(TCLDIR)\bin\tclsh.exe
|
||||
!ELSE
|
||||
TCLSH_CMD = tclsh
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
# <</mark>>
|
||||
@@ -1824,7 +1864,7 @@ tclsqlite3.def: tclsqlite.lo
|
||||
|
||||
pkgIndex.tcl: $(TOP)\VERSION
|
||||
for /F %%V in ('type "$(TOP)\VERSION"') do ( \
|
||||
echo package ifneeded sqlite3 @version@ [list load [file join $$dir $(SQLITE3TCLDLL)] sqlite3] \
|
||||
echo package ifneeded sqlite3 @version@ [list load [file join $$dir $(SQLITE3TCLDLL)] Sqlite3] \
|
||||
| $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact @version@ %%V > pkgIndex.tcl \
|
||||
)
|
||||
|
||||
@@ -1868,7 +1908,7 @@ dbhash.exe: $(TOP)\tool\dbhash.c $(SQLITE3C) $(SQLITE3H)
|
||||
$(LTLINK) $(NO_WARN) $(TOP)\tool\dbhash.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
|
||||
|
||||
RSYNC_SRC = \
|
||||
$(TOP)\tool\sqlite3-rsync.c \
|
||||
$(TOP)\tool\sqlite3_rsync.c \
|
||||
$(SQLITE3C)
|
||||
|
||||
RSYNC_OPT = \
|
||||
@@ -1877,7 +1917,7 @@ RSYNC_OPT = \
|
||||
-DSQLITE_OMIT_LOAD_EXTENSION \
|
||||
-DSQLITE_OMIT_DEPRECATED
|
||||
|
||||
sqlite3-rsync.exe: $(RSYNC_SRC) $(LIBRESOBJS)
|
||||
sqlite3_rsync.exe: $(RSYNC_SRC) $(LIBRESOBJS)
|
||||
$(LTLINK) $(RSYNC_OPT) $(NO_WARN) $(RSYNC_SRC) /link $(LDFLAGS) $(LTLINKOPTS) $(LIBRESOBJS)
|
||||
|
||||
scrub.exe: $(TOP)\ext\misc\scrub.c $(SQLITE3C) $(SQLITE3H)
|
||||
@@ -2537,7 +2577,7 @@ extensiontest: testfixture.exe testloadext.dll
|
||||
@set PATH=$(LIBTCLPATH);$(PATH)
|
||||
.\testfixture.exe $(TOP)\test\loadext.test $(TESTOPTS)
|
||||
|
||||
tool-zip: testfixture.exe sqlite3.exe sqldiff.exe sqlite3_analyzer.exe $(TOP)\tool\mktoolzip.tcl
|
||||
tool-zip: testfixture.exe sqlite3.exe sqldiff.exe sqlite3_analyzer.exe sqlite3_rsync.exe $(TOP)\tool\mktoolzip.tcl
|
||||
.\testfixture.exe $(TOP)\tool\mktoolzip.tcl
|
||||
|
||||
coretestprogs: testfixture.exe sqlite3.exe
|
||||
@@ -2746,6 +2786,16 @@ THREADTEST3_SRC = \
|
||||
threadtest3.exe: $(THREADTEST3_SRC) $(TOP)\src\test_multiplex.c $(SQLITE3C) $(SQLITE3H)
|
||||
$(LTLINK) $(NO_WARN) $(TOP)\test\threadtest3.c $(TOP)\src\test_multiplex.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
|
||||
|
||||
# Display key variables that control which version of TCL is to be used.
|
||||
#
|
||||
tcl-env:
|
||||
@echo TCLDIR = $(TCLDIR)
|
||||
@echo TCLVERSION = $(TCLVERSION)
|
||||
@echo TCLSUFFIX = $(TCLSUFFIX)
|
||||
@echo LIBTCL = $(LIBTCL)
|
||||
@echo LIBTCLSTUB = $(LIBTCLSTUB)
|
||||
@echo TCLSH_CMD = $(TCLSH_CMD)
|
||||
|
||||
LSMDIR=$(TOP)\ext\lsm1
|
||||
!INCLUDE $(LSMDIR)\Makefile.msc
|
||||
|
||||
@@ -2779,7 +2829,7 @@ clean:
|
||||
del /Q sqlite3.c sqlite3-*.c sqlite3.h 2>NUL
|
||||
del /Q sqlite3rc.h 2>NUL
|
||||
del /Q shell.c sqlite3ext.h sqlite3session.h 2>NUL
|
||||
del /Q sqlite3_analyzer.exe sqlite3_analyzer.c sqlite3-rsync.exe 2>NUL
|
||||
del /Q sqlite3_analyzer.exe sqlite3_analyzer.c sqlite3_rsync.exe 2>NUL
|
||||
del /Q sqlite-*-output.vsix 2>NUL
|
||||
del /Q fuzzershell.exe fuzzcheck.exe sqldiff.exe dbhash.exe 2>NUL
|
||||
del /Q sqltclsh.* 2>NUL
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
width="103.73447mm"
|
||||
height="46.723713mm"
|
||||
viewBox="0 0 103.73447 46.723713"
|
||||
version="1.1"
|
||||
id="svg470"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<defs
|
||||
id="defs467">
|
||||
<clipPath
|
||||
clipPathUnits="userSpaceOnUse"
|
||||
id="clipPath41">
|
||||
<path
|
||||
d="m 994.055,997.609 c 6.725,-11.629 35.115,-61.371 40.815,-77.398 6.42,-18.121 7.77,-23.313 7.77,-23.313 0,0 -15.57,80.114 -41.12,126.862 5.6,18.9 12.29,39.79 19.86,62.12 8.85,-15.53 28.96,-51.2 36.23,-68.1 0.27,3.19 0.54,6.38 0.82,9.54 -6.44,24.75 -16.22,57.15 -28.74,82.54 32.14,167.25 135.59,386.25 247.04,504.48 H 509.602 c -37.883,0 -68.711,-30.82 -68.711,-68.71 V 731.789 c 173.738,66.68 383.23,127.633 563.529,125.02 -6.693,25.812 -14.315,49.152 -22.318,62.679 -4.122,6.981 0.449,35.653 11.953,78.121 z"
|
||||
id="path39" />
|
||||
</clipPath>
|
||||
<linearGradient
|
||||
x1="0"
|
||||
y1="0"
|
||||
x2="1"
|
||||
y2="0"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(-4.02e-5,-918.907,-918.907,4.02e-5,858.809,1614.34)"
|
||||
spreadMethod="pad"
|
||||
id="linearGradient51">
|
||||
<stop
|
||||
style="stop-opacity:1;stop-color:#97d9f6"
|
||||
offset="0"
|
||||
id="stop43" />
|
||||
<stop
|
||||
style="stop-opacity:1;stop-color:#0f80cc"
|
||||
offset="0.66199914"
|
||||
id="stop45" />
|
||||
<stop
|
||||
style="stop-opacity:1;stop-color:#0f80cc"
|
||||
offset="0.920245"
|
||||
id="stop47" />
|
||||
<stop
|
||||
style="stop-opacity:1;stop-color:#0f80cc"
|
||||
offset="1"
|
||||
id="stop49" />
|
||||
</linearGradient>
|
||||
</defs>
|
||||
<g
|
||||
id="g337">
|
||||
<rect
|
||||
style="fill:#ffffff;stroke:#ffffff;stroke-width:0.239562;stroke-linecap:round;stroke-linejoin:round"
|
||||
id="rect366"
|
||||
width="103.4949"
|
||||
height="46.48415"
|
||||
x="0.119781"
|
||||
y="0.119781"
|
||||
ry="0" />
|
||||
<g
|
||||
id="g465"
|
||||
transform="translate(-56.57816,-61.353828)">
|
||||
<path
|
||||
d="m 79.198545,96.729705 c -0.02011,-0.25467 -0.0321,-0.420158 -0.0321,-0.420158 0,0 -0.77223,-5.206224 -1.691499,-6.759822 -0.145415,-0.246275 0.01584,-1.257759 0.421676,-2.755936 0.237243,0.410245 1.238779,2.165033 1.439862,2.73043 0.226484,0.639268 0.274109,0.822431 0.274109,0.822431 0,0 -0.549275,-2.826244 -1.450623,-4.47541 0.197556,-0.66675 0.433564,-1.403703 0.700617,-2.191456 0.341489,0.599017 1.158875,2.049286 1.338792,2.552348 0.03634,0.103364 0.06703,0.191205 0.09454,0.271639 0.0088,-0.04833 0.01764,-0.09666 0.02646,-0.144992 -0.206375,-0.875595 -0.611716,-2.399242 -1.166636,-3.524956 1.231195,-6.408209 5.430309,-14.973654 9.735256,-18.795296 H 60.806192 c -1.88214,0 -3.422086,1.540228 -3.422086,3.422298 v 30.970081 c 0,1.881964 1.539946,3.421944 3.422086,3.421944 h 18.49607 c -0.13335,-1.61438 -0.1778,-3.40046 -0.103717,-5.123145"
|
||||
style="fill:#0f80cc;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.0352778"
|
||||
id="path21" />
|
||||
<path
|
||||
d="m 99.934471,84.584659 h 0.474839 v 3.954957 h -0.503061 c -0.115005,-1.093188 -0.510469,-1.946593 -1.186392,-2.560426 -0.676627,-0.612775 -1.526822,-0.920045 -2.5527,-0.920045 -0.911578,0 -1.64465,0.230364 -2.200628,0.690387 -0.555977,0.459669 -0.833966,1.073467 -0.833966,1.840759 0,0.709401 0.230011,1.356536 0.690386,1.940948 0.459669,0.585258 1.457325,1.337134 2.991556,2.258907 1.782939,1.063978 2.981325,1.992912 3.594805,2.789414 0.61348,0.795549 0.92004,1.706421 0.92004,2.732229 0,1.322916 -0.46813,2.454275 -1.405815,3.393691 -0.939094,0.93983 -2.069042,1.40945 -3.389489,1.40945 -0.766233,0 -1.742369,-0.21096 -2.929467,-0.63334 -0.487891,-0.17237 -0.799394,-0.25781 -0.933097,-0.25781 -0.277989,0 -0.492831,0.21523 -0.646289,0.64699 h -0.503414 v -4.558981 h 0.503414 c 0.0092,1.256206 0.418747,2.262752 1.227314,3.020521 0.808567,0.75667 1.753306,1.13524 2.834217,1.13524 1.024819,0 1.844322,-0.27231 2.462389,-0.81979 0.617008,-0.54723 0.925689,-1.276066 0.925689,-2.188068 0,-0.681143 -0.254,-1.333394 -0.760942,-1.956823 -0.506589,-0.623958 -1.567392,-1.427621 -3.180292,-2.412259 -1.31445,-0.812765 -2.192161,-1.452422 -2.63278,-1.923027 -0.44062,-0.470182 -0.766234,-0.985591 -0.976842,-1.547284 -0.210608,-0.560564 -0.316089,-1.177537 -0.316089,-1.848485 0,-1.294659 0.424744,-2.345302 1.273175,-3.151399 0.848431,-0.805392 1.953331,-1.208264 3.314347,-1.208264 0.747889,0 1.563159,0.148519 2.445103,0.445558 0.411692,0.134409 0.699559,0.201436 0.862189,0.201436 0.135114,0 0.225778,-0.02858 0.27305,-0.08608 0.04868,-0.05786 0.1016,-0.186973 0.15875,-0.388409"
|
||||
style="fill:#003b57;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.0352778"
|
||||
id="path23" />
|
||||
<path
|
||||
d="m 119.14851,93.38576 c 0,-2.579547 -0.59019,-4.611476 -1.76953,-6.097835 -1.17969,-1.48583 -2.70369,-2.22878 -4.57412,-2.22878 -1.98437,0 -3.56799,0.746125 -4.75191,2.235977 -1.18463,1.491438 -1.77553,3.482834 -1.77553,5.975562 0,2.42577 0.58702,4.398857 1.76106,5.918271 1.17511,1.519415 2.70616,2.278595 4.59458,2.278595 1.96568,0 3.5426,-0.73562 4.7311,-2.207334 1.18851,-1.472177 1.78435,-3.430094 1.78435,-5.874456 z m 2.93265,12.9716 0.18662,0.46041 c -0.82409,0.37402 -1.7586,0.56085 -2.80353,0.56085 -0.86289,0 -1.66405,-0.11314 -2.40206,-0.33789 -0.73731,-0.22571 -1.43122,-0.57051 -2.07751,-1.03572 -0.647,-0.46496 -1.43616,-1.23941 -2.36608,-2.32198 -0.82515,-0.95928 -1.45768,-1.55445 -1.8983,-1.78404 -1.92723,-0.39232 -3.58246,-1.40973 -4.96852,-3.048067 -1.38536,-1.639323 -2.07822,-3.509716 -2.07822,-5.609167 0,-1.5627 0.39794,-3.033889 1.19345,-4.414556 0.79587,-1.380772 1.87466,-2.461718 3.23709,-3.242416 1.36031,-0.782108 2.87055,-1.172633 4.52896,-1.172633 2.56011,0 4.71699,0.851253 6.47206,2.55263 1.75366,1.7012 2.63067,3.79416 2.63067,6.276975 0,2.09102 -0.67522,3.951923 -2.02706,5.586695 -1.3522,1.635479 -3.08293,2.658779 -5.19148,3.070539 0.20179,0.16151 0.56233,0.5697 1.0795,1.22234 1.10031,1.36204 2.02071,2.28604 2.75837,2.76998 0.73871,0.48274 1.47214,0.72542 2.20133,0.72542 0.53728,0 1.04634,-0.0868 1.52471,-0.25937"
|
||||
style="fill:#003b57;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.0352778"
|
||||
id="path25" />
|
||||
<path
|
||||
d="m 134.47177,99.116318 -0.28116,2.694482 h -11.00385 l 0.0233,-0.53619 c 0.59654,-0.061 1.01458,-0.21413 1.25835,-0.45861 0.24342,-0.24624 0.36654,-0.81111 0.37571,-1.699682 l 0.0127,-11.904593 c -0.004,-0.621877 -0.0346,-1.050502 -0.0861,-1.284393 -0.13828,-0.653698 -0.75565,-0.980017 -1.85984,-0.980017 l -0.0236,-0.535164 h 5.74393 l 0.0219,0.535164 c -0.61242,0.04163 -1.03152,0.206728 -1.26612,0.496711 -0.23212,0.291042 -0.34713,0.880533 -0.34678,1.767699 l -0.0441,12.029053 c 0.002,0.204646 0.0191,0.391901 0.0572,0.565538 0.1845,0.877674 0.88053,1.315474 2.08774,1.315474 h 1.03681 c 1.34161,0 2.27259,-0.15088 2.79788,-0.45226 0.52388,-0.29919 0.8569,-0.818023 1.00048,-1.553212 h 0.49565"
|
||||
style="fill:#003b57;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.0352778"
|
||||
id="path27" />
|
||||
<path
|
||||
d="m 138.12055,87.618936 c 0.25965,0 0.49883,0.09095 0.71967,0.273685 0.21837,0.182034 0.36054,0.407071 0.41522,0.674829 0.0533,0.25975 0.009,0.48507 -0.133,0.676769 -0.14217,0.191523 -0.34114,0.28702 -0.60078,0.28702 -0.26846,0 -0.51858,-0.0955 -0.75001,-0.28702 -0.23283,-0.191699 -0.37535,-0.417019 -0.42827,-0.676769 -0.0547,-0.267758 -0.0106,-0.492795 0.14605,-0.674829 0.15311,-0.182738 0.36266,-0.273685 0.63112,-0.273685 z m 1.75754,4.127783 -0.0176,7.535404 c 0.003,0.526662 0.03,0.900957 0.0769,1.122117 0.0607,0.30688 0.19685,0.5147 0.40111,0.6248 0.20778,0.11081 0.67133,0.1662 1.39065,0.1662 l 0.0166,0.50299 h -5.17702 l 0.0123,-0.50299 c 0.70979,0 1.14582,-0.0656 1.31198,-0.1947 0.16475,-0.12887 0.24941,-0.56307 0.25859,-1.301433 l 0.0325,-5.335094 c -0.006,-0.291042 -0.0243,-0.518548 -0.0586,-0.683613 -0.1016,-0.493219 -0.42686,-0.740587 -0.97367,-0.740587 l -1.12324,0.143616 -0.005,-0.589527 3.26319,-0.747183 h 0.59161"
|
||||
style="fill:#003b57;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.0352778"
|
||||
id="path29" />
|
||||
<path
|
||||
d="m 148.56207,92.004952 0.0247,0.805074 h -2.70545 l -0.0194,6.728955 c 0,0.183409 0.0109,0.341065 0.0423,0.476109 0.11465,0.55605 0.41945,0.83467 0.90946,0.83467 0.79728,0 1.70709,-0.52239 2.73967,-1.567637 l 0.43427,0.366148 c -1.43016,1.587219 -2.79682,2.380119 -4.10033,2.380119 -0.901,0 -1.43828,-0.41229 -1.6129,-1.23677 -0.072,-0.34438 -0.10795,-1.025556 -0.11077,-2.041838 l 0.037,-5.939756 h -1.76954 l -0.0205,-0.502708 c 1.51836,-0.153105 2.50472,-1.106981 2.96087,-2.861769 h 0.51752 l -0.005,2.559403 h 2.67758"
|
||||
style="fill:#003b57;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.0352778"
|
||||
id="path31" />
|
||||
<path
|
||||
d="m 152.6931,96.836244 c 2.82998,-0.546417 4.09434,-1.527845 3.79906,-2.9464 -0.0603,-0.288819 -0.24483,-0.55245 -0.54716,-0.791527 -0.30656,-0.239925 -0.61418,-0.359975 -0.92921,-0.359975 -0.71932,0 -1.3081,0.424462 -1.76178,1.272505 -0.4572,0.848854 -0.6417,1.791017 -0.56091,2.825397 z m -0.0162,0.533436 c 0.024,0.248708 0.0575,0.48394 0.10442,0.704179 0.36089,1.725437 1.3328,2.588371 2.91395,2.588371 1.15005,0 2.67264,-0.694412 3.42829,-2.08471 l 0.38312,0.395217 c -0.47378,1.071703 -0.9899,1.848523 -1.54658,2.331513 -0.55527,0.48327 -1.87678,0.72414 -2.82434,0.72414 -1.01776,0 -1.86161,-0.28497 -2.53259,-0.85548 -0.67204,-0.57076 -1.11407,-1.378306 -1.33456,-2.423128 -0.37465,-1.783751 -0.0843,-3.405012 0.86854,-4.868334 0.95779,-1.460853 2.19145,-2.19329 3.70593,-2.19329 0.59584,0 1.66511,0.152118 2.07574,0.453637 0.40535,0.30166 0.66393,0.707072 0.77118,1.214614 0.18027,0.85411 -0.78352,1.660948 -1.74484,2.423689 -0.96203,0.762318 -2.38725,1.291767 -4.26826,1.589582"
|
||||
style="fill:#003b57;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.0352778"
|
||||
id="path33" />
|
||||
<g
|
||||
id="g37"
|
||||
clip-path="url(#clipPath41)"
|
||||
transform="matrix(0.03527778,0,0,-0.03527778,42.828565,121.98722)">
|
||||
<path
|
||||
d="m 994.055,997.609 c 6.725,-11.629 35.115,-61.371 40.815,-77.398 6.42,-18.121 7.77,-23.313 7.77,-23.313 0,0 -15.57,80.114 -41.12,126.862 5.6,18.9 12.29,39.79 19.86,62.12 8.85,-15.53 28.96,-51.2 36.23,-68.1 0.27,3.19 0.54,6.38 0.82,9.54 -6.44,24.75 -16.22,57.15 -28.74,82.54 32.14,167.25 135.59,386.25 247.04,504.48 H 509.602 c -37.883,0 -68.711,-30.82 -68.711,-68.71 V 731.789 c 173.738,66.68 383.23,127.633 563.529,125.02 -6.693,25.812 -14.315,49.152 -22.318,62.679 -4.122,6.981 0.449,35.653 11.953,78.121"
|
||||
style="fill:url(#linearGradient51);fill-opacity:1;fill-rule:nonzero;stroke:none"
|
||||
id="path53" />
|
||||
</g>
|
||||
<path
|
||||
d="m 95.439377,63.024997 c -1.923345,-1.715206 -4.252031,-1.026231 -6.550379,1.01353 -0.341136,0.303037 -0.681566,0.639234 -1.020233,0.998362 -3.931709,4.170892 -7.581195,11.896725 -8.715023,17.796934 0.441678,0.895703 0.786695,2.038703 1.013884,2.911828 0.05821,0.224014 0.110772,0.43427 0.152752,0.613128 0.09984,0.423298 0.153459,0.697794 0.153459,0.697794 0,0 -0.03528,-0.133385 -0.179917,-0.552802 -0.02752,-0.08043 -0.05821,-0.168275 -0.09454,-0.271639 -0.01552,-0.04269 -0.03704,-0.09454 -0.06068,-0.149931 -0.25647,-0.596194 -0.965906,-1.854553 -1.278114,-2.402417 -0.267053,0.787753 -0.503061,1.524706 -0.700617,2.191456 0.901348,1.649166 1.450623,4.47541 1.450623,4.47541 0,0 -0.04762,-0.183163 -0.274109,-0.822431 -0.201083,-0.565397 -1.202619,-2.320185 -1.439862,-2.73043 -0.405836,1.498177 -0.567091,2.509661 -0.421676,2.755936 0.282328,0.477202 0.551216,1.300586 0.78733,2.211176 0.5334,2.051367 0.904169,4.548646 0.904169,4.548646 0,0 0.01199,0.165488 0.0321,0.420158 -0.07408,1.722685 -0.02963,3.508765 0.103717,5.123145 0.176741,2.13706 0.509411,3.97288 0.93345,4.9554 l 0.287866,-0.15695 c -0.622652,-1.93573 -0.875594,-4.47255 -0.764822,-7.39814 0.16757,-4.471846 1.196623,-9.86469 3.098095,-15.485534 3.212395,-8.485012 7.669389,-15.292918 11.748559,-18.544118 -3.717925,3.357739 -8.749948,14.22647 -10.256309,18.251312 -1.686631,4.50709 -2.881842,8.736578 -3.602214,12.788831 1.242836,-3.798959 5.261328,-5.431932 5.261328,-5.431932 0,0 1.97097,-2.430745 4.274256,-5.903454 -1.379714,0.314678 -3.645253,0.853369 -4.404078,1.172281 -1.119364,0.469547 -1.420989,0.629708 -1.420989,0.629708 0,0 3.62585,-2.208036 6.736645,-3.207809 4.278136,-6.738056 8.939042,-16.310328 4.245328,-20.497448"
|
||||
style="fill:#003b57;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:0.0352778"
|
||||
id="path55" />
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 12 KiB |
@@ -66,6 +66,14 @@ USE_STDCALL = 0
|
||||
USE_SEH = 1
|
||||
!ENDIF
|
||||
|
||||
# Use STATICALLY_LINK_TCL=1 to statically link against TCL
|
||||
#
|
||||
!IFNDEF STATICALLY_LINK_TCL
|
||||
STATICALLY_LINK_TCL = 0
|
||||
!ELSEIF $(STATICALLY_LINK_TCL)!=0
|
||||
CCOPTS = $(CCOPTS) -DSTATIC_BUILD
|
||||
!ENDIF
|
||||
|
||||
# Set this non-0 to have the shell executable link against the core dynamic
|
||||
# link library.
|
||||
#
|
||||
|
||||
+31
-44
@@ -9,8 +9,37 @@ This package contains:
|
||||
* a Makefile.msc, sqlite3.rc, and Replace.cs for building with Microsoft
|
||||
Visual C++ on Windows
|
||||
|
||||
SUMMARY OF HOW TO BUILD
|
||||
=======================
|
||||
WHY USE THIS PACKAGE?
|
||||
=====================
|
||||
|
||||
The canonical make system for SQLite requires TCL as part of the build
|
||||
process. Various TCL scripts are used to generate parts of the code and
|
||||
TCL is used to run tests. But some people would prefer to build SQLite
|
||||
using only generic tools and without having to install TCL. The purpose
|
||||
of this package is to provide that capability.
|
||||
|
||||
This package contains a pre-build SQLite amalgamation file "sqlite3.c"
|
||||
(and its associated header file "sqlite3.h"). Because the amalgamation
|
||||
has been pre-built, no TCL is required.
|
||||
|
||||
REASONS TO USE THE CANONICAL BUILD SYSTEM RATHER THAN THIS PACKAGE
|
||||
==================================================================
|
||||
|
||||
* the cononical build system allows you to run tests to verify that
|
||||
the build worked
|
||||
* the canonical build system supports more compile-time options
|
||||
* the canonical build system works for any arbitrary check-in to
|
||||
the SQLite source tree
|
||||
|
||||
Step-by-step instructions on how to build using the canonical make
|
||||
system for SQLite can be found at:
|
||||
|
||||
https://sqlite.org/src/doc/trunk/doc/compile-for-unix.md
|
||||
https://sqlite.org/src/doc/trunk/doc/compile-for-windows.md
|
||||
|
||||
|
||||
SUMMARY OF HOW TO BUILD USING THIS PACKAGE
|
||||
==========================================
|
||||
|
||||
Unix: ./configure; make
|
||||
Windows: nmake /f Makefile.msc
|
||||
@@ -53,48 +82,6 @@ Using Microsoft Visual C++ 2005 (or later) is recommended. Several Windows
|
||||
platform variants may be built by adding additional macros to the NMAKE
|
||||
command line.
|
||||
|
||||
Building for WinRT 8.0
|
||||
----------------------
|
||||
|
||||
FOR_WINRT=1
|
||||
|
||||
Using Microsoft Visual C++ 2012 (or later) is required. When using the
|
||||
above, something like the following macro will need to be added to the
|
||||
NMAKE command line as well:
|
||||
|
||||
"NSDKLIBPATH=%WindowsSdkDir%\..\8.0\lib\win8\um\x86"
|
||||
|
||||
Building for WinRT 8.1
|
||||
----------------------
|
||||
|
||||
FOR_WINRT=1
|
||||
|
||||
Using Microsoft Visual C++ 2013 (or later) is required. When using the
|
||||
above, something like the following macro will need to be added to the
|
||||
NMAKE command line as well:
|
||||
|
||||
"NSDKLIBPATH=%WindowsSdkDir%\..\8.1\lib\winv6.3\um\x86"
|
||||
|
||||
Building for UWP 10.0
|
||||
---------------------
|
||||
|
||||
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
|
||||
NMAKE command line as well:
|
||||
|
||||
"NSDKLIBPATH=%WindowsSdkDir%\..\10\lib\10.0.10586.0\um\x86"
|
||||
"PSDKLIBPATH=%WindowsSdkDir%\..\10\lib\10.0.10586.0\um\x86"
|
||||
"NUCRTLIBPATH=%UniversalCRTSdkDir%\..\10\lib\10.0.10586.0\ucrt\x86"
|
||||
|
||||
Building for the Windows 10 SDK
|
||||
-------------------------------
|
||||
|
||||
FOR_WIN10=1
|
||||
|
||||
Using Microsoft Visual C++ 2015 (or later) is required. When using the
|
||||
above, no other macros should be needed on the NMAKE command line.
|
||||
|
||||
Other preprocessor defines
|
||||
--------------------------
|
||||
|
||||
@@ -99,7 +99,6 @@ INSTALL_LIBRARY = @INSTALL_LIBRARY@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
CC = @CC@
|
||||
CCLD = @CCLD@
|
||||
CFLAGS_DEFAULT = @CFLAGS_DEFAULT@
|
||||
CFLAGS_WARNING = @CFLAGS_WARNING@
|
||||
EXEEXT = @EXEEXT@
|
||||
@@ -311,19 +310,6 @@ VPATH = $(srcdir):$(srcdir)/generic:$(srcdir)/unix:$(srcdir)/win:$(srcdir)/macos
|
||||
.c.@OBJEXT@:
|
||||
$(COMPILE) -c `@CYGPATH@ $<` -o $@
|
||||
|
||||
tclsample.@OBJEXT@: sampleUuid.h
|
||||
|
||||
$(srcdir)/manifest.uuid:
|
||||
printf "git-" >$(srcdir)/manifest.uuid
|
||||
(cd $(srcdir); git rev-parse HEAD >>$(srcdir)/manifest.uuid || \
|
||||
(printf "svn-r" >$(srcdir)/manifest.uuid ; \
|
||||
svn info --show-item last-changed-revision >>$(srcdir)/manifest.uuid) || \
|
||||
printf "unknown" >$(srcdir)/manifest.uuid)
|
||||
|
||||
sampleUuid.h: $(srcdir)/manifest.uuid
|
||||
echo "#define SAMPLE_VERSION_UUID \\" >$@
|
||||
cat $(srcdir)/manifest.uuid >>$@
|
||||
echo "" >>$@
|
||||
|
||||
#========================================================================
|
||||
# Distribution creation
|
||||
@@ -451,6 +437,8 @@ install-bin-binaries: binaries
|
||||
fi; \
|
||||
done
|
||||
|
||||
.SUFFIXES: .c .$(OBJEXT)
|
||||
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
cd $(top_builddir) \
|
||||
&& CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
This is the SQLite extension for Tcl using the Tcl Extension
|
||||
Architecture (TEA). For additional information on SQLite see
|
||||
|
||||
http://www.sqlite.org/
|
||||
|
||||
|
||||
UNIX BUILD
|
||||
==========
|
||||
|
||||
Building under most UNIX systems is easy, just run the configure script
|
||||
and then run make. For more information about the build process, see
|
||||
the tcl/unix/README file in the Tcl src dist. The following minimal
|
||||
example will install the extension in the /opt/tcl directory.
|
||||
|
||||
$ cd sqlite-*-tea
|
||||
$ ./configure --prefix=/opt/tcl
|
||||
$ make
|
||||
$ make install
|
||||
|
||||
WINDOWS BUILD
|
||||
=============
|
||||
|
||||
The recommended method to build extensions under windows is to use the
|
||||
Msys + Mingw build process. This provides a Unix-style build while
|
||||
generating native Windows binaries. Using the Msys + Mingw build tools
|
||||
means that you can use the same configure script as per the Unix build
|
||||
to create a Makefile. See the tcl/win/README file for the URL of
|
||||
the Msys + Mingw download.
|
||||
|
||||
If you have VC++ then you may wish to use the files in the win
|
||||
subdirectory and build the extension using just VC++. These files have
|
||||
been designed to be as generic as possible but will require some
|
||||
additional maintenance by the project developer to synchronise with
|
||||
the TEA configure.in and Makefile.in files. Instructions for using the
|
||||
VC++ makefile are written in the first part of the Makefile.vc
|
||||
file.
|
||||
@@ -0,0 +1,78 @@
|
||||
This is the SQLite extension for Tcl using the Tcl Extension
|
||||
Architecture (TEA).
|
||||
|
||||
----------------------- A BETTER WAY ---------------------------
|
||||
|
||||
A better way to build the TCL extension for SQLite is to use the
|
||||
canonical source code tarball. For Unix:
|
||||
|
||||
./configure --with-tclsh=$(TCLSH)
|
||||
make tclextension-install
|
||||
|
||||
For Windows:
|
||||
|
||||
nmake /f Makefile.msc tclextension-install TCLSH_CMD=$(TCLSH)
|
||||
|
||||
In both of the above, replace $(TCLSH) with the full pathname of
|
||||
of the tclsh that you want the SQLite extension to work with. See
|
||||
step-by-step instructions at the links below for more information:
|
||||
|
||||
https://sqlite.org/src/doc/trunk/doc/compile-for-unix.md
|
||||
https://sqlite.org/src/doc/trunk/doc/compile-for-windows.md
|
||||
|
||||
The whole point of the amalgamation-autoconf tarball (in which this
|
||||
README.txt file is embedded) is to provide a means of compiling
|
||||
SQLite that does not require first installing TCL and/or "tclsh".
|
||||
The canonical Makefile in the SQLite source tree provides more
|
||||
capabilities (such as the the ability to run test cases to ensure
|
||||
that the build worked) and is better maintained. The only
|
||||
downside of the canonical Makfile is that it requires a TCL
|
||||
installation. But if you are wanting to build the TCL extension for
|
||||
SQLite, then presumably you already have a TCL installation. So why
|
||||
not just use the more-capable and better-maintained canoncal Makefile?
|
||||
|
||||
This TEA builder is derived from code found at
|
||||
|
||||
http://core.tcl-lang.org/tclconfig
|
||||
http://core.tcl-lang.org/sampleextension
|
||||
|
||||
The SQLite developers do not understand how it works. It seems to
|
||||
work for us. It might also work for you. But we cannot promise that.
|
||||
|
||||
If you want to use this TEA builder and it works for you, that's fine.
|
||||
But if you have trouble, the first thing you should do is go back
|
||||
to using the canonical Makefile in the SQLite source tree.
|
||||
|
||||
------------------------------------------------------------------
|
||||
|
||||
|
||||
UNIX BUILD
|
||||
==========
|
||||
|
||||
Building under most UNIX systems is easy, just run the configure script
|
||||
and then run make. For more information about the build process, see
|
||||
the tcl/unix/README file in the Tcl src dist. The following minimal
|
||||
example will install the extension in the /opt/tcl directory.
|
||||
|
||||
$ cd sqlite-*-tea
|
||||
$ ./configure --prefix=/opt/tcl
|
||||
$ make
|
||||
$ make install
|
||||
|
||||
WINDOWS BUILD
|
||||
=============
|
||||
|
||||
The recommended method to build extensions under windows is to use the
|
||||
Msys + Mingw build process. This provides a Unix-style build while
|
||||
generating native Windows binaries. Using the Msys + Mingw build tools
|
||||
means that you can use the same configure script as per the Unix build
|
||||
to create a Makefile. See the tcl/win/README file for the URL of
|
||||
the Msys + Mingw download.
|
||||
|
||||
If you have VC++ then you may wish to use the files in the win
|
||||
subdirectory and build the extension using just VC++. These files have
|
||||
been designed to be as generic as possible but will require some
|
||||
additional maintenance by the project developer to synchronise with
|
||||
the TEA configure.in and Makefile.in files. Instructions for using the
|
||||
VC++ makefile are written in the first part of the Makefile.vc
|
||||
file.
|
||||
@@ -19,7 +19,7 @@ dnl to configure the system for the local environment.
|
||||
# so that we create the export library with the dll.
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
AC_INIT([sqlite],[3.47.0])
|
||||
AC_INIT([sqlite],[3.47.2])
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Call TEA_INIT as the first TEA_ macro to set up initial vars.
|
||||
@@ -97,7 +97,7 @@ TEA_ADD_TCL_SOURCES([])
|
||||
# Patchs from rmax.
|
||||
#--------------------------------------------------------------------
|
||||
AC_ARG_WITH([system-sqlite],
|
||||
[AC_HELP_STRING([--with-system-sqlite],
|
||||
[AS_HELP_STRING([--with-system-sqlite],
|
||||
[use a system-supplied libsqlite3 instead of the bundled one])],
|
||||
[], [with_system_sqlite=no])
|
||||
if test x$with_system_sqlite != xno; then
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
#
|
||||
if {[package vsatisfies [package provide Tcl] 9.0-]} {
|
||||
package ifneeded sqlite3 @PACKAGE_VERSION@ \
|
||||
[list load [file join $dir @PKG_LIB_FILE9@] sqlite3]
|
||||
[list load [file join $dir @PKG_LIB_FILE9@] Sqlite3]
|
||||
} else {
|
||||
package ifneeded sqlite3 @PACKAGE_VERSION@ \
|
||||
[list load [file join $dir @PKG_LIB_FILE8@] sqlite3]
|
||||
[list load [file join $dir @PKG_LIB_FILE8@] Sqlite3]
|
||||
}
|
||||
|
||||
+221
-208
@@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
# install - install a program, script, or datafile
|
||||
|
||||
scriptversion=2011-04-20.01; # UTC
|
||||
scriptversion=2020-11-14.01; # UTC
|
||||
|
||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
||||
@@ -35,25 +35,21 @@ scriptversion=2011-04-20.01; # UTC
|
||||
# FSF changes to this file are in the public domain.
|
||||
#
|
||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
||||
# `make' implicit rules from creating a file called install from it
|
||||
# 'make' implicit rules from creating a file called install from it
|
||||
# when there is no Makefile.
|
||||
#
|
||||
# This script is compatible with the BSD install script, but was written
|
||||
# from scratch.
|
||||
|
||||
tab=' '
|
||||
nl='
|
||||
'
|
||||
IFS=" "" $nl"
|
||||
IFS=" $tab$nl"
|
||||
|
||||
# set DOITPROG to echo to test this script
|
||||
# Set DOITPROG to "echo" to test this script.
|
||||
|
||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
||||
doit=${DOITPROG-}
|
||||
if test -z "$doit"; then
|
||||
doit_exec=exec
|
||||
else
|
||||
doit_exec=$doit
|
||||
fi
|
||||
doit_exec=${doit:-exec}
|
||||
|
||||
# Put in absolute file names if you don't have them in your path;
|
||||
# or use environment vars.
|
||||
@@ -68,22 +64,16 @@ mvprog=${MVPROG-mv}
|
||||
rmprog=${RMPROG-rm}
|
||||
stripprog=${STRIPPROG-strip}
|
||||
|
||||
posix_glob='?'
|
||||
initialize_posix_glob='
|
||||
test "$posix_glob" != "?" || {
|
||||
if (set -f) 2>/dev/null; then
|
||||
posix_glob=
|
||||
else
|
||||
posix_glob=:
|
||||
fi
|
||||
}
|
||||
'
|
||||
|
||||
posix_mkdir=
|
||||
|
||||
# Desired mode of installed file.
|
||||
mode=0755
|
||||
|
||||
# Create dirs (including intermediate dirs) using mode 755.
|
||||
# This is like GNU 'install' as of coreutils 8.32 (2020).
|
||||
mkdir_umask=22
|
||||
|
||||
backupsuffix=
|
||||
chgrpcmd=
|
||||
chmodcmd=$chmodprog
|
||||
chowncmd=
|
||||
@@ -97,7 +87,7 @@ dir_arg=
|
||||
dst_arg=
|
||||
|
||||
copy_on_change=false
|
||||
no_target_directory=
|
||||
is_target_a_directory=possibly
|
||||
|
||||
usage="\
|
||||
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
||||
@@ -114,19 +104,28 @@ Options:
|
||||
--version display version info and exit.
|
||||
|
||||
-c (ignored)
|
||||
-C install only if different (preserve the last data modification time)
|
||||
-C install only if different (preserve data modification time)
|
||||
-d create directories instead of installing files.
|
||||
-g GROUP $chgrpprog installed files to GROUP.
|
||||
-m MODE $chmodprog installed files to MODE.
|
||||
-o USER $chownprog installed files to USER.
|
||||
-p pass -p to $cpprog.
|
||||
-s $stripprog installed files.
|
||||
-S $stripprog installed files.
|
||||
-S SUFFIX attempt to back up existing files, with suffix SUFFIX.
|
||||
-t DIRECTORY install into DIRECTORY.
|
||||
-T report an error if DSTFILE is a directory.
|
||||
|
||||
Environment variables override the default commands:
|
||||
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
|
||||
RMPROG STRIPPROG
|
||||
|
||||
By default, rm is invoked with -f; when overridden with RMPROG,
|
||||
it's up to you to specify -f if you want it.
|
||||
|
||||
If -S is not specified, no backups are attempted.
|
||||
|
||||
Email bug reports to bug-automake@gnu.org.
|
||||
Automake home page: https://www.gnu.org/software/automake/
|
||||
"
|
||||
|
||||
while test $# -ne 0; do
|
||||
@@ -138,45 +137,62 @@ while test $# -ne 0; do
|
||||
-d) dir_arg=true;;
|
||||
|
||||
-g) chgrpcmd="$chgrpprog $2"
|
||||
shift;;
|
||||
shift;;
|
||||
|
||||
--help) echo "$usage"; exit $?;;
|
||||
|
||||
-m) mode=$2
|
||||
case $mode in
|
||||
*' '* | *' '* | *'
|
||||
'* | *'*'* | *'?'* | *'['*)
|
||||
echo "$0: invalid mode: $mode" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
shift;;
|
||||
case $mode in
|
||||
*' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
|
||||
echo "$0: invalid mode: $mode" >&2
|
||||
exit 1;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-o) chowncmd="$chownprog $2"
|
||||
shift;;
|
||||
shift;;
|
||||
|
||||
-p) cpprog="$cpprog -p";;
|
||||
|
||||
-s) stripcmd=$stripprog;;
|
||||
|
||||
-S) stripcmd="$stripprog $2"
|
||||
shift;;
|
||||
-S) backupsuffix="$2"
|
||||
shift;;
|
||||
|
||||
-t) dst_arg=$2
|
||||
shift;;
|
||||
-t)
|
||||
is_target_a_directory=always
|
||||
dst_arg=$2
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $dst_arg in
|
||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||
esac
|
||||
shift;;
|
||||
|
||||
-T) no_target_directory=true;;
|
||||
-T) is_target_a_directory=never;;
|
||||
|
||||
--version) echo "$0 $scriptversion"; exit $?;;
|
||||
|
||||
--) shift
|
||||
break;;
|
||||
--) shift
|
||||
break;;
|
||||
|
||||
-*) echo "$0: invalid option: $1" >&2
|
||||
exit 1;;
|
||||
-*) echo "$0: invalid option: $1" >&2
|
||||
exit 1;;
|
||||
|
||||
*) break;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
|
||||
# We allow the use of options -d and -T together, by making -d
|
||||
# take the precedence; this is for compatibility with GNU install.
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
if test -n "$dst_arg"; then
|
||||
echo "$0: target directory not allowed when installing a directory." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
||||
# When -d is used, all remaining arguments are directories to create.
|
||||
# When -t is used, the destination is already specified.
|
||||
@@ -190,6 +206,10 @@ if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
||||
fi
|
||||
shift # arg
|
||||
dst_arg=$arg
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $dst_arg in
|
||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
@@ -198,11 +218,20 @@ if test $# -eq 0; then
|
||||
echo "$0: no input file specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
# It's OK to call `install-sh -d' without argument.
|
||||
# It's OK to call 'install-sh -d' without argument.
|
||||
# This can happen when creating conditional directories.
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if test -z "$dir_arg"; then
|
||||
if test $# -gt 1 || test "$is_target_a_directory" = always; then
|
||||
if test ! -d "$dst_arg"; then
|
||||
echo "$0: $dst_arg: Is not a directory." >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if test -z "$dir_arg"; then
|
||||
do_exit='(exit $ret); exit $ret'
|
||||
trap "ret=129; $do_exit" 1
|
||||
@@ -219,16 +248,16 @@ if test -z "$dir_arg"; then
|
||||
|
||||
*[0-7])
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw='% 200'
|
||||
u_plus_rw='% 200'
|
||||
fi
|
||||
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
||||
*)
|
||||
if test -z "$stripcmd"; then
|
||||
u_plus_rw=
|
||||
u_plus_rw=
|
||||
else
|
||||
u_plus_rw=,u+rw
|
||||
u_plus_rw=,u+rw
|
||||
fi
|
||||
cp_umask=$mode$u_plus_rw;;
|
||||
esac
|
||||
@@ -236,9 +265,9 @@ fi
|
||||
|
||||
for src
|
||||
do
|
||||
# Protect names starting with `-'.
|
||||
# Protect names problematic for 'test' and other utilities.
|
||||
case $src in
|
||||
-*) src=./$src;;
|
||||
-* | [=\(\)!]) src=./$src;;
|
||||
esac
|
||||
|
||||
if test -n "$dir_arg"; then
|
||||
@@ -246,6 +275,10 @@ do
|
||||
dstdir=$dst
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
# Don't chown directories that already exist.
|
||||
if test $dstdir_status = 0; then
|
||||
chowncmd=""
|
||||
fi
|
||||
else
|
||||
|
||||
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
||||
@@ -260,185 +293,150 @@ do
|
||||
echo "$0: no destination specified." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
dst=$dst_arg
|
||||
# Protect names starting with `-'.
|
||||
case $dst in
|
||||
-*) dst=./$dst;;
|
||||
esac
|
||||
|
||||
# If destination is a directory, append the input filename; won't work
|
||||
# if double slashes aren't ignored.
|
||||
# If destination is a directory, append the input filename.
|
||||
if test -d "$dst"; then
|
||||
if test -n "$no_target_directory"; then
|
||||
echo "$0: $dst_arg: Is a directory" >&2
|
||||
exit 1
|
||||
if test "$is_target_a_directory" = never; then
|
||||
echo "$0: $dst_arg: Is a directory" >&2
|
||||
exit 1
|
||||
fi
|
||||
dstdir=$dst
|
||||
dst=$dstdir/`basename "$src"`
|
||||
dstbase=`basename "$src"`
|
||||
case $dst in
|
||||
*/) dst=$dst$dstbase;;
|
||||
*) dst=$dst/$dstbase;;
|
||||
esac
|
||||
dstdir_status=0
|
||||
else
|
||||
# Prefer dirname, but fall back on a substitute if dirname fails.
|
||||
dstdir=`
|
||||
(dirname "$dst") 2>/dev/null ||
|
||||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
||||
X"$dst" : 'X\(//\)[^/]' \| \
|
||||
X"$dst" : 'X\(//\)$' \| \
|
||||
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
|
||||
echo X"$dst" |
|
||||
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)[^/].*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\/\)$/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
/^X\(\/\).*/{
|
||||
s//\1/
|
||||
q
|
||||
}
|
||||
s/.*/./; q'
|
||||
`
|
||||
|
||||
dstdir=`dirname "$dst"`
|
||||
test -d "$dstdir"
|
||||
dstdir_status=$?
|
||||
fi
|
||||
fi
|
||||
|
||||
case $dstdir in
|
||||
*/) dstdirslash=$dstdir;;
|
||||
*) dstdirslash=$dstdir/;;
|
||||
esac
|
||||
|
||||
obsolete_mkdir_used=false
|
||||
|
||||
if test $dstdir_status != 0; then
|
||||
case $posix_mkdir in
|
||||
'')
|
||||
# Create intermediate dirs using mode 755 as modified by the umask.
|
||||
# This is like FreeBSD 'install' as of 1997-10-28.
|
||||
umask=`umask`
|
||||
case $stripcmd.$umask in
|
||||
# Optimize common cases.
|
||||
*[2367][2367]) mkdir_umask=$umask;;
|
||||
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
|
||||
# With -d, create the new directory with the user-specified mode.
|
||||
# Otherwise, rely on $mkdir_umask.
|
||||
if test -n "$dir_arg"; then
|
||||
mkdir_mode=-m$mode
|
||||
else
|
||||
mkdir_mode=
|
||||
fi
|
||||
|
||||
*[0-7])
|
||||
mkdir_umask=`expr $umask + 22 \
|
||||
- $umask % 100 % 40 + $umask % 20 \
|
||||
- $umask % 10 % 4 + $umask % 2
|
||||
`;;
|
||||
*) mkdir_umask=$umask,go-w;;
|
||||
esac
|
||||
posix_mkdir=false
|
||||
# The $RANDOM variable is not portable (e.g., dash). Use it
|
||||
# here however when possible just to lower collision chance.
|
||||
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||
|
||||
# With -d, create the new directory with the user-specified mode.
|
||||
# Otherwise, rely on $mkdir_umask.
|
||||
if test -n "$dir_arg"; then
|
||||
mkdir_mode=-m$mode
|
||||
trap '
|
||||
ret=$?
|
||||
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
|
||||
exit $ret
|
||||
' 0
|
||||
|
||||
# Because "mkdir -p" follows existing symlinks and we likely work
|
||||
# directly in world-writeable /tmp, make sure that the '$tmpdir'
|
||||
# directory is successfully created first before we actually test
|
||||
# 'mkdir -p'.
|
||||
if (umask $mkdir_umask &&
|
||||
$mkdirprog $mkdir_mode "$tmpdir" &&
|
||||
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
|
||||
then
|
||||
if test -z "$dir_arg" || {
|
||||
# Check for POSIX incompatibilities with -m.
|
||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||
# other-writable bit of parent directory when it shouldn't.
|
||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||
test_tmpdir="$tmpdir/a"
|
||||
ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
|
||||
case $ls_ld_tmpdir in
|
||||
d????-?r-*) different_mode=700;;
|
||||
d????-?--*) different_mode=755;;
|
||||
*) false;;
|
||||
esac &&
|
||||
$mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
|
||||
ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
|
||||
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||
}
|
||||
}
|
||||
then posix_mkdir=:
|
||||
fi
|
||||
rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
|
||||
else
|
||||
mkdir_mode=
|
||||
# Remove any dirs left behind by ancient mkdir implementations.
|
||||
rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
|
||||
fi
|
||||
|
||||
posix_mkdir=false
|
||||
case $umask in
|
||||
*[123567][0-7][0-7])
|
||||
# POSIX mkdir -p sets u+wx bits regardless of umask, which
|
||||
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
|
||||
;;
|
||||
*)
|
||||
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
||||
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
|
||||
|
||||
if (umask $mkdir_umask &&
|
||||
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
|
||||
then
|
||||
if test -z "$dir_arg" || {
|
||||
# Check for POSIX incompatibilities with -m.
|
||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
||||
# other-writeable bit of parent directory when it shouldn't.
|
||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
||||
ls_ld_tmpdir=`ls -ld "$tmpdir"`
|
||||
case $ls_ld_tmpdir in
|
||||
d????-?r-*) different_mode=700;;
|
||||
d????-?--*) different_mode=755;;
|
||||
*) false;;
|
||||
esac &&
|
||||
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
|
||||
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
|
||||
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
||||
}
|
||||
}
|
||||
then posix_mkdir=:
|
||||
fi
|
||||
rmdir "$tmpdir/d" "$tmpdir"
|
||||
else
|
||||
# Remove any dirs left behind by ancient mkdir implementations.
|
||||
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
|
||||
fi
|
||||
trap '' 0;;
|
||||
esac;;
|
||||
trap '' 0;;
|
||||
esac
|
||||
|
||||
if
|
||||
$posix_mkdir && (
|
||||
umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
||||
umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
||||
)
|
||||
then :
|
||||
else
|
||||
|
||||
# The umask is ridiculous, or mkdir does not conform to POSIX,
|
||||
# mkdir does not conform to POSIX,
|
||||
# or it failed possibly due to a race condition. Create the
|
||||
# directory the slow way, step by step, checking for races as we go.
|
||||
|
||||
case $dstdir in
|
||||
/*) prefix='/';;
|
||||
-*) prefix='./';;
|
||||
*) prefix='';;
|
||||
/*) prefix='/';;
|
||||
[-=\(\)!]*) prefix='./';;
|
||||
*) prefix='';;
|
||||
esac
|
||||
|
||||
eval "$initialize_posix_glob"
|
||||
|
||||
oIFS=$IFS
|
||||
IFS=/
|
||||
$posix_glob set -f
|
||||
set -f
|
||||
set fnord $dstdir
|
||||
shift
|
||||
$posix_glob set +f
|
||||
set +f
|
||||
IFS=$oIFS
|
||||
|
||||
prefixes=
|
||||
|
||||
for d
|
||||
do
|
||||
test -z "$d" && continue
|
||||
test X"$d" = X && continue
|
||||
|
||||
prefix=$prefix$d
|
||||
if test -d "$prefix"; then
|
||||
prefixes=
|
||||
else
|
||||
if $posix_mkdir; then
|
||||
(umask=$mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
||||
# Don't fail if two instances are running concurrently.
|
||||
test -d "$prefix" || exit 1
|
||||
else
|
||||
case $prefix in
|
||||
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
||||
*) qprefix=$prefix;;
|
||||
esac
|
||||
prefixes="$prefixes '$qprefix'"
|
||||
fi
|
||||
fi
|
||||
prefix=$prefix/
|
||||
prefix=$prefix$d
|
||||
if test -d "$prefix"; then
|
||||
prefixes=
|
||||
else
|
||||
if $posix_mkdir; then
|
||||
(umask $mkdir_umask &&
|
||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
||||
# Don't fail if two instances are running concurrently.
|
||||
test -d "$prefix" || exit 1
|
||||
else
|
||||
case $prefix in
|
||||
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
||||
*) qprefix=$prefix;;
|
||||
esac
|
||||
prefixes="$prefixes '$qprefix'"
|
||||
fi
|
||||
fi
|
||||
prefix=$prefix/
|
||||
done
|
||||
|
||||
if test -n "$prefixes"; then
|
||||
# Don't fail if two instances are running concurrently.
|
||||
(umask $mkdir_umask &&
|
||||
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
||||
test -d "$dstdir" || exit 1
|
||||
obsolete_mkdir_used=true
|
||||
# Don't fail if two instances are running concurrently.
|
||||
(umask $mkdir_umask &&
|
||||
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
||||
test -d "$dstdir" || exit 1
|
||||
obsolete_mkdir_used=true
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
@@ -451,14 +449,25 @@ do
|
||||
else
|
||||
|
||||
# Make a couple of temp file names in the proper directory.
|
||||
dsttmp=$dstdir/_inst.$$_
|
||||
rmtmp=$dstdir/_rm.$$_
|
||||
dsttmp=${dstdirslash}_inst.$$_
|
||||
rmtmp=${dstdirslash}_rm.$$_
|
||||
|
||||
# Trap to clean up those temp files at exit.
|
||||
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
||||
|
||||
# Copy the file name to the temp name.
|
||||
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
|
||||
(umask $cp_umask &&
|
||||
{ test -z "$stripcmd" || {
|
||||
# Create $dsttmp read-write so that cp doesn't create it read-only,
|
||||
# which would cause strip to fail.
|
||||
if test -z "$doit"; then
|
||||
: >"$dsttmp" # No need to fork-exec 'touch'.
|
||||
else
|
||||
$doit touch "$dsttmp"
|
||||
fi
|
||||
}
|
||||
} &&
|
||||
$doit_exec $cpprog "$src" "$dsttmp") &&
|
||||
|
||||
# and set any options; do chmod last to preserve setuid bits.
|
||||
#
|
||||
@@ -473,20 +482,24 @@ do
|
||||
|
||||
# If -C, don't bother to copy if it wouldn't change the file.
|
||||
if $copy_on_change &&
|
||||
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
||||
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
||||
|
||||
eval "$initialize_posix_glob" &&
|
||||
$posix_glob set -f &&
|
||||
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
||||
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
||||
set -f &&
|
||||
set X $old && old=:$2:$4:$5:$6 &&
|
||||
set X $new && new=:$2:$4:$5:$6 &&
|
||||
$posix_glob set +f &&
|
||||
|
||||
set +f &&
|
||||
test "$old" = "$new" &&
|
||||
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
|
||||
then
|
||||
rm -f "$dsttmp"
|
||||
else
|
||||
# If $backupsuffix is set, and the file being installed
|
||||
# already exists, attempt a backup. Don't worry if it fails,
|
||||
# e.g., if mv doesn't support -f.
|
||||
if test -n "$backupsuffix" && test -f "$dst"; then
|
||||
$doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
|
||||
fi
|
||||
|
||||
# Rename the file to the real destination.
|
||||
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
|
||||
|
||||
@@ -494,24 +507,24 @@ do
|
||||
# to itself, or perhaps because mv is so ancient that it does not
|
||||
# support -f.
|
||||
{
|
||||
# Now remove or move aside any old file at destination location.
|
||||
# We try this two ways since rm can't unlink itself on some
|
||||
# systems and the destination file might be busy for other
|
||||
# reasons. In this case, the final cleanup might fail but the new
|
||||
# file should still install successfully.
|
||||
{
|
||||
test ! -f "$dst" ||
|
||||
$doit $rmcmd -f "$dst" 2>/dev/null ||
|
||||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
|
||||
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
|
||||
} ||
|
||||
{ echo "$0: cannot unlink or rename $dst" >&2
|
||||
(exit 1); exit 1
|
||||
}
|
||||
} &&
|
||||
# Now remove or move aside any old file at destination location.
|
||||
# We try this two ways since rm can't unlink itself on some
|
||||
# systems and the destination file might be busy for other
|
||||
# reasons. In this case, the final cleanup might fail but the new
|
||||
# file should still install successfully.
|
||||
{
|
||||
test ! -f "$dst" ||
|
||||
$doit $rmcmd "$dst" 2>/dev/null ||
|
||||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
|
||||
{ $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
|
||||
} ||
|
||||
{ echo "$0: cannot unlink or rename $dst" >&2
|
||||
(exit 1); exit 1
|
||||
}
|
||||
} &&
|
||||
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dst"
|
||||
# Now rename the file to the real destination.
|
||||
$doit $mvcmd "$dsttmp" "$dst"
|
||||
}
|
||||
fi || exit 1
|
||||
|
||||
@@ -520,9 +533,9 @@ do
|
||||
done
|
||||
|
||||
# Local variables:
|
||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
||||
# eval: (add-hook 'before-save-hook 'time-stamp)
|
||||
# time-stamp-start: "scriptversion="
|
||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
||||
# time-stamp-time-zone: "UTC"
|
||||
# time-stamp-time-zone: "UTC0"
|
||||
# time-stamp-end: "; # UTC"
|
||||
# End:
|
||||
|
||||
+222
-170
@@ -53,6 +53,10 @@ AC_DEFUN([TEA_PATH_TCLCONFIG], [
|
||||
AS_HELP_STRING([--with-tcl],
|
||||
[directory containing tcl configuration (tclConfig.sh)]),
|
||||
[with_tclconfig="${withval}"])
|
||||
AC_ARG_WITH(tcl8,
|
||||
AS_HELP_STRING([--with-tcl8],
|
||||
[Compile for Tcl8 in Tcl9 environment]),
|
||||
[with_tcl8="${withval}"])
|
||||
AC_MSG_CHECKING([for Tcl configuration])
|
||||
AC_CACHE_VAL(ac_cv_c_tclconfig,[
|
||||
|
||||
@@ -138,10 +142,16 @@ AC_DEFUN([TEA_PATH_TCLCONFIG], [
|
||||
`ls -d /usr/pkg/lib 2>/dev/null` \
|
||||
`ls -d /usr/lib 2>/dev/null` \
|
||||
`ls -d /usr/lib64 2>/dev/null` \
|
||||
`ls -d /usr/lib/tcl9.0 2>/dev/null` \
|
||||
`ls -d /usr/lib/tcl8.7 2>/dev/null` \
|
||||
`ls -d /usr/lib/tcl8.6 2>/dev/null` \
|
||||
`ls -d /usr/lib/tcl8.5 2>/dev/null` \
|
||||
`ls -d /usr/local/lib/tcl9.0 2>/dev/null` \
|
||||
`ls -d /usr/local/lib/tcl8.7 2>/dev/null` \
|
||||
`ls -d /usr/local/lib/tcl8.6 2>/dev/null` \
|
||||
`ls -d /usr/local/lib/tcl8.5 2>/dev/null` \
|
||||
`ls -d /usr/local/lib/tcl/tcl9.0 2>/dev/null` \
|
||||
`ls -d /usr/local/lib/tcl/tcl8.7 2>/dev/null` \
|
||||
`ls -d /usr/local/lib/tcl/tcl8.6 2>/dev/null` \
|
||||
`ls -d /usr/local/lib/tcl/tcl8.5 2>/dev/null` \
|
||||
; do
|
||||
@@ -282,12 +292,18 @@ AC_DEFUN([TEA_PATH_TKCONFIG], [
|
||||
`ls -d /usr/local/lib 2>/dev/null` \
|
||||
`ls -d /usr/contrib/lib 2>/dev/null` \
|
||||
`ls -d /usr/pkg/lib 2>/dev/null` \
|
||||
`ls -d /usr/lib/tk9.0 2>/dev/null` \
|
||||
`ls -d /usr/lib/tk8.7 2>/dev/null` \
|
||||
`ls -d /usr/lib/tk8.6 2>/dev/null` \
|
||||
`ls -d /usr/lib/tk8.5 2>/dev/null` \
|
||||
`ls -d /usr/lib 2>/dev/null` \
|
||||
`ls -d /usr/lib64 2>/dev/null` \
|
||||
`ls -d /usr/local/lib/tk9.0 2>/dev/null` \
|
||||
`ls -d /usr/local/lib/tk8.7 2>/dev/null` \
|
||||
`ls -d /usr/local/lib/tk8.6 2>/dev/null` \
|
||||
`ls -d /usr/local/lib/tk8.5 2>/dev/null` \
|
||||
`ls -d /usr/local/lib/tcl/tk9.0 2>/dev/null` \
|
||||
`ls -d /usr/local/lib/tcl/tk8.7 2>/dev/null` \
|
||||
`ls -d /usr/local/lib/tcl/tk8.6 2>/dev/null` \
|
||||
`ls -d /usr/local/lib/tcl/tk8.5 2>/dev/null` \
|
||||
; do
|
||||
@@ -366,10 +382,10 @@ AC_DEFUN([TEA_LOAD_TCLCONFIG], [
|
||||
AC_MSG_CHECKING([for existence of ${TCL_BIN_DIR}/tclConfig.sh])
|
||||
|
||||
if test -f "${TCL_BIN_DIR}/tclConfig.sh" ; then
|
||||
AC_MSG_RESULT([loading])
|
||||
AC_MSG_RESULT([loading])
|
||||
. "${TCL_BIN_DIR}/tclConfig.sh"
|
||||
else
|
||||
AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh])
|
||||
AC_MSG_RESULT([could not find ${TCL_BIN_DIR}/tclConfig.sh])
|
||||
fi
|
||||
|
||||
# If the TCL_BIN_DIR is the build directory (not the install directory),
|
||||
@@ -379,9 +395,9 @@ AC_DEFUN([TEA_LOAD_TCLCONFIG], [
|
||||
# instead of TCL_BUILD_LIB_SPEC since it will work with both an
|
||||
# installed and uninstalled version of Tcl.
|
||||
if test -f "${TCL_BIN_DIR}/Makefile" ; then
|
||||
TCL_LIB_SPEC="${TCL_BUILD_LIB_SPEC}"
|
||||
TCL_STUB_LIB_SPEC="${TCL_BUILD_STUB_LIB_SPEC}"
|
||||
TCL_STUB_LIB_PATH="${TCL_BUILD_STUB_LIB_PATH}"
|
||||
TCL_LIB_SPEC="${TCL_BUILD_LIB_SPEC}"
|
||||
TCL_STUB_LIB_SPEC="${TCL_BUILD_STUB_LIB_SPEC}"
|
||||
TCL_STUB_LIB_PATH="${TCL_BUILD_STUB_LIB_PATH}"
|
||||
elif test "`uname -s`" = "Darwin"; then
|
||||
# If Tcl was built as a framework, attempt to use the libraries
|
||||
# from the framework at the given location so that linking works
|
||||
@@ -474,10 +490,10 @@ AC_DEFUN([TEA_LOAD_TKCONFIG], [
|
||||
AC_MSG_CHECKING([for existence of ${TK_BIN_DIR}/tkConfig.sh])
|
||||
|
||||
if test -f "${TK_BIN_DIR}/tkConfig.sh" ; then
|
||||
AC_MSG_RESULT([loading])
|
||||
AC_MSG_RESULT([loading])
|
||||
. "${TK_BIN_DIR}/tkConfig.sh"
|
||||
else
|
||||
AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh])
|
||||
AC_MSG_RESULT([could not find ${TK_BIN_DIR}/tkConfig.sh])
|
||||
fi
|
||||
|
||||
# If the TK_BIN_DIR is the build directory (not the install directory),
|
||||
@@ -487,9 +503,9 @@ AC_DEFUN([TEA_LOAD_TKCONFIG], [
|
||||
# instead of TK_BUILD_LIB_SPEC since it will work with both an
|
||||
# installed and uninstalled version of Tcl.
|
||||
if test -f "${TK_BIN_DIR}/Makefile" ; then
|
||||
TK_LIB_SPEC="${TK_BUILD_LIB_SPEC}"
|
||||
TK_STUB_LIB_SPEC="${TK_BUILD_STUB_LIB_SPEC}"
|
||||
TK_STUB_LIB_PATH="${TK_BUILD_STUB_LIB_PATH}"
|
||||
TK_LIB_SPEC="${TK_BUILD_LIB_SPEC}"
|
||||
TK_STUB_LIB_SPEC="${TK_BUILD_STUB_LIB_SPEC}"
|
||||
TK_STUB_LIB_PATH="${TK_BUILD_STUB_LIB_PATH}"
|
||||
elif test "`uname -s`" = "Darwin"; then
|
||||
# If Tk was built as a framework, attempt to use the libraries
|
||||
# from the framework at the given location so that linking works
|
||||
@@ -567,37 +583,37 @@ AC_DEFUN([TEA_LOAD_TKCONFIG], [
|
||||
AC_DEFUN([TEA_PROG_TCLSH], [
|
||||
AC_MSG_CHECKING([for tclsh])
|
||||
if test -f "${TCL_BIN_DIR}/Makefile" ; then
|
||||
# tclConfig.sh is in Tcl build directory
|
||||
if test "${TEA_PLATFORM}" = "windows"; then
|
||||
if test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${EXEEXT}" ; then
|
||||
TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${EXEEXT}"
|
||||
elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}s${EXEEXT}" ; then
|
||||
TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}s${EXEEXT}"
|
||||
elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}t${EXEEXT}" ; then
|
||||
TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}t${EXEEXT}"
|
||||
elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}st${EXEEXT}" ; then
|
||||
TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}st${EXEEXT}"
|
||||
fi
|
||||
else
|
||||
TCLSH_PROG="${TCL_BIN_DIR}/tclsh"
|
||||
fi
|
||||
# tclConfig.sh is in Tcl build directory
|
||||
if test "${TEA_PLATFORM}" = "windows"; then
|
||||
if test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${EXEEXT}" ; then
|
||||
TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${EXEEXT}"
|
||||
elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}s${EXEEXT}" ; then
|
||||
TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}s${EXEEXT}"
|
||||
elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}t${EXEEXT}" ; then
|
||||
TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}t${EXEEXT}"
|
||||
elif test -f "${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}st${EXEEXT}" ; then
|
||||
TCLSH_PROG="${TCL_BIN_DIR}/tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}st${EXEEXT}"
|
||||
fi
|
||||
else
|
||||
TCLSH_PROG="${TCL_BIN_DIR}/tclsh"
|
||||
fi
|
||||
else
|
||||
# tclConfig.sh is in install location
|
||||
if test "${TEA_PLATFORM}" = "windows"; then
|
||||
TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${EXEEXT}"
|
||||
else
|
||||
TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}"
|
||||
fi
|
||||
list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \
|
||||
`ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \
|
||||
`ls -d ${TCL_PREFIX}/bin 2>/dev/null`"
|
||||
for i in $list ; do
|
||||
if test -f "$i/${TCLSH_PROG}" ; then
|
||||
REAL_TCL_BIN_DIR="`cd "$i"; pwd`/"
|
||||
break
|
||||
fi
|
||||
done
|
||||
TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}"
|
||||
# tclConfig.sh is in install location
|
||||
if test "${TEA_PLATFORM}" = "windows"; then
|
||||
TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}${EXEEXT}"
|
||||
else
|
||||
TCLSH_PROG="tclsh${TCL_MAJOR_VERSION}.${TCL_MINOR_VERSION}"
|
||||
fi
|
||||
list="`ls -d ${TCL_BIN_DIR}/../bin 2>/dev/null` \
|
||||
`ls -d ${TCL_BIN_DIR}/.. 2>/dev/null` \
|
||||
`ls -d ${TCL_PREFIX}/bin 2>/dev/null`"
|
||||
for i in $list ; do
|
||||
if test -f "$i/${TCLSH_PROG}" ; then
|
||||
REAL_TCL_BIN_DIR="`cd "$i"; pwd`/"
|
||||
break
|
||||
fi
|
||||
done
|
||||
TCLSH_PROG="${REAL_TCL_BIN_DIR}${TCLSH_PROG}"
|
||||
fi
|
||||
AC_MSG_RESULT([${TCLSH_PROG}])
|
||||
AC_SUBST(TCLSH_PROG)
|
||||
@@ -625,37 +641,37 @@ AC_DEFUN([TEA_PROG_TCLSH], [
|
||||
AC_DEFUN([TEA_PROG_WISH], [
|
||||
AC_MSG_CHECKING([for wish])
|
||||
if test -f "${TK_BIN_DIR}/Makefile" ; then
|
||||
# tkConfig.sh is in Tk build directory
|
||||
if test "${TEA_PLATFORM}" = "windows"; then
|
||||
if test -f "${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${EXEEXT}" ; then
|
||||
WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${EXEEXT}"
|
||||
elif test -f "${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}s${EXEEXT}" ; then
|
||||
WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}$s{EXEEXT}"
|
||||
elif test -f "${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}t${EXEEXT}" ; then
|
||||
WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}t${EXEEXT}"
|
||||
elif test -f "${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}st${EXEEXT}" ; then
|
||||
WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}st${EXEEXT}"
|
||||
fi
|
||||
else
|
||||
WISH_PROG="${TK_BIN_DIR}/wish"
|
||||
fi
|
||||
# tkConfig.sh is in Tk build directory
|
||||
if test "${TEA_PLATFORM}" = "windows"; then
|
||||
if test -f "${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${EXEEXT}" ; then
|
||||
WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${EXEEXT}"
|
||||
elif test -f "${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}s${EXEEXT}" ; then
|
||||
WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}$s{EXEEXT}"
|
||||
elif test -f "${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}t${EXEEXT}" ; then
|
||||
WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}t${EXEEXT}"
|
||||
elif test -f "${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}st${EXEEXT}" ; then
|
||||
WISH_PROG="${TK_BIN_DIR}/wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}st${EXEEXT}"
|
||||
fi
|
||||
else
|
||||
WISH_PROG="${TK_BIN_DIR}/wish"
|
||||
fi
|
||||
else
|
||||
# tkConfig.sh is in install location
|
||||
if test "${TEA_PLATFORM}" = "windows"; then
|
||||
WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${EXEEXT}"
|
||||
else
|
||||
WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}"
|
||||
fi
|
||||
list="`ls -d ${TK_BIN_DIR}/../bin 2>/dev/null` \
|
||||
`ls -d ${TK_BIN_DIR}/.. 2>/dev/null` \
|
||||
`ls -d ${TK_PREFIX}/bin 2>/dev/null`"
|
||||
for i in $list ; do
|
||||
if test -f "$i/${WISH_PROG}" ; then
|
||||
REAL_TK_BIN_DIR="`cd "$i"; pwd`/"
|
||||
break
|
||||
fi
|
||||
done
|
||||
WISH_PROG="${REAL_TK_BIN_DIR}${WISH_PROG}"
|
||||
# tkConfig.sh is in install location
|
||||
if test "${TEA_PLATFORM}" = "windows"; then
|
||||
WISH_PROG="wish${TK_MAJOR_VERSION}${TK_MINOR_VERSION}${EXEEXT}"
|
||||
else
|
||||
WISH_PROG="wish${TK_MAJOR_VERSION}.${TK_MINOR_VERSION}"
|
||||
fi
|
||||
list="`ls -d ${TK_BIN_DIR}/../bin 2>/dev/null` \
|
||||
`ls -d ${TK_BIN_DIR}/.. 2>/dev/null` \
|
||||
`ls -d ${TK_PREFIX}/bin 2>/dev/null`"
|
||||
for i in $list ; do
|
||||
if test -f "$i/${WISH_PROG}" ; then
|
||||
REAL_TK_BIN_DIR="`cd "$i"; pwd`/"
|
||||
break
|
||||
fi
|
||||
done
|
||||
WISH_PROG="${REAL_TK_BIN_DIR}${WISH_PROG}"
|
||||
fi
|
||||
AC_MSG_RESULT([${WISH_PROG}])
|
||||
AC_SUBST(WISH_PROG)
|
||||
@@ -717,22 +733,22 @@ AC_DEFUN([TEA_ENABLE_SHARED], [
|
||||
if test "$shared_ok" = "yes" ; then
|
||||
AC_MSG_RESULT([shared])
|
||||
SHARED_BUILD=1
|
||||
STUBS_BUILD=1
|
||||
STUBS_BUILD=1
|
||||
else
|
||||
AC_MSG_RESULT([static])
|
||||
SHARED_BUILD=0
|
||||
AC_DEFINE(STATIC_BUILD, 1, [This a static build])
|
||||
if test "$stubs_ok" = "yes" ; then
|
||||
STUBS_BUILD=1
|
||||
else
|
||||
STUBS_BUILD=0
|
||||
fi
|
||||
if test "$stubs_ok" = "yes" ; then
|
||||
STUBS_BUILD=1
|
||||
else
|
||||
STUBS_BUILD=0
|
||||
fi
|
||||
fi
|
||||
if test "${STUBS_BUILD}" = "1" ; then
|
||||
AC_DEFINE(USE_TCL_STUBS, 1, [Use Tcl stubs])
|
||||
AC_DEFINE(USE_TCLOO_STUBS, 1, [Use TclOO stubs])
|
||||
if test "${TEA_WINDOWINGSYSTEM}" != ""; then
|
||||
AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs])
|
||||
AC_DEFINE(USE_TK_STUBS, 1, [Use Tk stubs])
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -1177,21 +1193,21 @@ AC_DEFUN([TEA_CONFIG_CFLAGS], [
|
||||
fi
|
||||
|
||||
if test "$GCC" != "yes" ; then
|
||||
if test "${SHARED_BUILD}" = "0" ; then
|
||||
if test "${SHARED_BUILD}" = "0" ; then
|
||||
runtime=-MT
|
||||
else
|
||||
else
|
||||
runtime=-MD
|
||||
fi
|
||||
case "x`echo \${VisualStudioVersion}`" in
|
||||
x1[[4-9]]*)
|
||||
lflags="${lflags} -nodefaultlib:libucrt.lib"
|
||||
TEA_ADD_LIBS([ucrt.lib])
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
fi
|
||||
case "x`echo \${VisualStudioVersion}`" in
|
||||
x1[[4-9]]*)
|
||||
lflags="${lflags} -nodefaultlib:libucrt.lib"
|
||||
TEA_ADD_LIBS([ucrt.lib])
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
if test "$do64bit" != "no" ; then
|
||||
if test "$do64bit" != "no" ; then
|
||||
CC="cl.exe"
|
||||
RC="rc.exe"
|
||||
lflags="${lflags} -nologo -MACHINE:${MACHINE} "
|
||||
@@ -1490,14 +1506,14 @@ AC_DEFUN([TEA_CONFIG_CFLAGS], [
|
||||
# Check to enable 64-bit flags for compiler/linker
|
||||
|
||||
AS_IF([test "$do64bit" = yes], [
|
||||
AS_IF([test "$GCC" = yes], [
|
||||
AC_MSG_WARN([64bit mode not supported by gcc])
|
||||
], [
|
||||
do64bit_ok=yes
|
||||
SHLIB_LD="ld -64 -shared -rdata_shared"
|
||||
CFLAGS="$CFLAGS -64"
|
||||
LDFLAGS_ARCH="-64"
|
||||
])
|
||||
AS_IF([test "$GCC" = yes], [
|
||||
AC_MSG_WARN([64bit mode not supported by gcc])
|
||||
], [
|
||||
do64bit_ok=yes
|
||||
SHLIB_LD="ld -64 -shared -rdata_shared"
|
||||
CFLAGS="$CFLAGS -64"
|
||||
LDFLAGS_ARCH="-64"
|
||||
])
|
||||
])
|
||||
;;
|
||||
Linux*|GNU*|NetBSD-Debian|DragonFly-*|FreeBSD-*)
|
||||
@@ -1519,7 +1535,7 @@ AC_DEFUN([TEA_CONFIG_CFLAGS], [
|
||||
CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
|
||||
LDFLAGS="$LDFLAGS $PTHREAD_LIBS"])
|
||||
;;
|
||||
esac
|
||||
esac
|
||||
|
||||
AS_IF([test $doRpath = yes], [
|
||||
CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'])
|
||||
@@ -1724,9 +1740,9 @@ AC_DEFUN([TEA_CONFIG_CFLAGS], [
|
||||
# Digital OSF/1
|
||||
SHLIB_CFLAGS=""
|
||||
AS_IF([test "$SHARED_BUILD" = 1], [
|
||||
SHLIB_LD='ld -shared -expect_unresolved "*"'
|
||||
SHLIB_LD='ld -shared -expect_unresolved "*"'
|
||||
], [
|
||||
SHLIB_LD='ld -non_shared -expect_unresolved "*"'
|
||||
SHLIB_LD='ld -non_shared -expect_unresolved "*"'
|
||||
])
|
||||
SHLIB_SUFFIX=".so"
|
||||
AS_IF([test $doRpath = yes], [
|
||||
@@ -1896,7 +1912,7 @@ AC_DEFUN([TEA_CONFIG_CFLAGS], [
|
||||
LDFLAGS="$LDFLAGS -Wl,-Bexport"
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[int i;]])],
|
||||
[tcl_cv_ld_Bexport=yes],[tcl_cv_ld_Bexport=no])
|
||||
LDFLAGS=$hold_ldflags])
|
||||
LDFLAGS=$hold_ldflags])
|
||||
AS_IF([test $tcl_cv_ld_Bexport = yes], [
|
||||
LDFLAGS="$LDFLAGS -Wl,-Bexport"
|
||||
])
|
||||
@@ -2015,8 +2031,8 @@ dnl # preprocessing tests use only CPPFLAGS.
|
||||
SHORT s;
|
||||
LONG l;
|
||||
]])],
|
||||
[tcl_cv_winnt_ignore_void=yes],
|
||||
[tcl_cv_winnt_ignore_void=no])
|
||||
[tcl_cv_winnt_ignore_void=yes],
|
||||
[tcl_cv_winnt_ignore_void=no])
|
||||
)
|
||||
if test "$tcl_cv_winnt_ignore_void" = "yes" ; then
|
||||
AC_DEFINE(HAVE_WINNT_IGNORE_VOID, 1,
|
||||
@@ -2529,20 +2545,19 @@ AC_DEFUN([TEA_TCL_LINK_LIBS], [
|
||||
#
|
||||
# Might define the following vars:
|
||||
# _ISOC99_SOURCE
|
||||
# _LARGEFILE64_SOURCE
|
||||
# _LARGEFILE_SOURCE64
|
||||
# _FILE_OFFSET_BITS
|
||||
#
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
AC_DEFUN([TEA_TCL_EARLY_FLAG],[
|
||||
AC_CACHE_VAL([tcl_cv_flag_]translit($1,[A-Z],[a-z]),
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[$2]], [[$3]])],
|
||||
[tcl_cv_flag_]translit($1,[A-Z],[a-z])=no,[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[[#define ]$1[ 1
|
||||
[tcl_cv_flag_]translit($1,[A-Z],[a-z])=no,[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[[#define ]$1[ ]m4_default([$4],[1])[
|
||||
]$2]], [[$3]])],
|
||||
[tcl_cv_flag_]translit($1,[A-Z],[a-z])=yes,
|
||||
[tcl_cv_flag_]translit($1,[A-Z],[a-z])=no)]))
|
||||
if test ["x${tcl_cv_flag_]translit($1,[A-Z],[a-z])[}" = "xyes"] ; then
|
||||
AC_DEFINE($1, 1, [Add the ]$1[ flag when building])
|
||||
AC_DEFINE($1, m4_default([$4],[1]), [Add the ]$1[ flag when building])
|
||||
tcl_flags="$tcl_flags $1"
|
||||
fi
|
||||
])
|
||||
@@ -2552,10 +2567,10 @@ AC_DEFUN([TEA_TCL_EARLY_FLAGS],[
|
||||
tcl_flags=""
|
||||
TEA_TCL_EARLY_FLAG(_ISOC99_SOURCE,[#include <stdlib.h>],
|
||||
[char *p = (char *)strtoll; char *q = (char *)strtoull;])
|
||||
TEA_TCL_EARLY_FLAG(_LARGEFILE64_SOURCE,[#include <sys/stat.h>],
|
||||
[struct stat64 buf; int i = stat64("/", &buf);])
|
||||
TEA_TCL_EARLY_FLAG(_LARGEFILE_SOURCE64,[#include <sys/stat.h>],
|
||||
[char *p = (char *)open64;])
|
||||
if test "${TCL_MAJOR_VERSION}" -ne 8 ; then
|
||||
TEA_TCL_EARLY_FLAG(_FILE_OFFSET_BITS,[#include <sys/stat.h>],
|
||||
[switch (0) { case 0: case (sizeof(off_t)==sizeof(long long)): ; }],64)
|
||||
fi
|
||||
if test "x${tcl_flags}" = "x" ; then
|
||||
AC_MSG_RESULT([none])
|
||||
else
|
||||
@@ -2579,6 +2594,7 @@ AC_DEFUN([TEA_TCL_EARLY_FLAGS],[
|
||||
# HAVE_STRUCT_DIRENT64, HAVE_DIR64
|
||||
# HAVE_STRUCT_STAT64
|
||||
# HAVE_TYPE_OFF64_T
|
||||
# _TIME_BITS
|
||||
#
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
@@ -2592,9 +2608,9 @@ AC_DEFUN([TEA_TCL_64BIT_FLAGS], [
|
||||
# See if we could use long anyway Note that we substitute in the
|
||||
# type that is our current guess for a 64-bit type inside this check
|
||||
# program, so it should be modified only carefully...
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[switch (0) {
|
||||
case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ;
|
||||
}]])],[tcl_cv_type_64bit=${tcl_type_64bit}],[])])
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[switch (0) {
|
||||
case 1: case (sizeof(${tcl_type_64bit})==sizeof(long)): ;
|
||||
}]])],[tcl_cv_type_64bit=${tcl_type_64bit}],[])])
|
||||
if test "${tcl_cv_type_64bit}" = none ; then
|
||||
AC_DEFINE(TCL_WIDE_INT_IS_LONG, 1, [Do 'long' and 'long long' have the same size (64-bit)?])
|
||||
AC_MSG_RESULT([yes])
|
||||
@@ -2609,6 +2625,25 @@ AC_DEFUN([TEA_TCL_64BIT_FLAGS], [
|
||||
AC_MSG_RESULT([${tcl_cv_type_64bit}])
|
||||
|
||||
# Now check for auxiliary declarations
|
||||
if test "${TCL_MAJOR_VERSION}" -ne 8 ; then
|
||||
AC_CACHE_CHECK([for 64-bit time_t], tcl_cv_time_t_64,[
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>]],
|
||||
[[switch (0) {case 0: case (sizeof(time_t)==sizeof(long long)): ;}]])],
|
||||
[tcl_cv_time_t_64=yes],[tcl_cv_time_t_64=no])])
|
||||
if test "x${tcl_cv_time_t_64}" = "xno" ; then
|
||||
# Note that _TIME_BITS=64 requires _FILE_OFFSET_BITS=64
|
||||
# which SC_TCL_EARLY_FLAGS has defined if necessary.
|
||||
AC_CACHE_CHECK([if _TIME_BITS=64 enables 64-bit time_t], tcl_cv__time_bits,[
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _TIME_BITS 64
|
||||
#include <sys/types.h>]],
|
||||
[[switch (0) {case 0: case (sizeof(time_t)==sizeof(long long)): ;}]])],
|
||||
[tcl_cv__time_bits=yes],[tcl_cv__time_bits=no])])
|
||||
if test "x${tcl_cv__time_bits}" = "xyes" ; then
|
||||
AC_DEFINE(_TIME_BITS, 64, [_TIME_BITS=64 enables 64-bit time_t.])
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK([for struct dirent64], tcl_cv_struct_dirent64,[
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
|
||||
#include <dirent.h>]], [[struct dirent64 p;]])],
|
||||
@@ -2620,7 +2655,7 @@ AC_DEFUN([TEA_TCL_64BIT_FLAGS], [
|
||||
AC_CACHE_CHECK([for DIR64], tcl_cv_DIR64,[
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
|
||||
#include <dirent.h>]], [[struct dirent64 *p; DIR64 d = opendir64(".");
|
||||
p = readdir64(d); rewinddir64(d); closedir64(d);]])],
|
||||
p = readdir64(d); rewinddir64(d); closedir64(d);]])],
|
||||
[tcl_cv_DIR64=yes], [tcl_cv_DIR64=no])])
|
||||
if test "x${tcl_cv_DIR64}" = "xyes" ; then
|
||||
AC_DEFINE(HAVE_DIR64, 1, [Is 'DIR64' in <sys/types.h>?])
|
||||
@@ -2643,8 +2678,8 @@ AC_DEFUN([TEA_TCL_64BIT_FLAGS], [
|
||||
dnl Define HAVE_TYPE_OFF64_T only when the off64_t type and the
|
||||
dnl functions lseek64 and open64 are defined.
|
||||
if test "x${tcl_cv_type_off64_t}" = "xyes" && \
|
||||
test "x${ac_cv_func_lseek64}" = "xyes" && \
|
||||
test "x${ac_cv_func_open64}" = "xyes" ; then
|
||||
test "x${ac_cv_func_lseek64}" = "xyes" && \
|
||||
test "x${ac_cv_func_open64}" = "xyes" ; then
|
||||
AC_DEFINE(HAVE_TYPE_OFF64_T, 1, [Is off64_t in <sys/types.h>?])
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
@@ -2747,8 +2782,6 @@ The PACKAGE_NAME variable must be defined by your TEA configure.ac])
|
||||
AC_SUBST(PKG_LIB_FILE)
|
||||
AC_SUBST(PKG_LIB_FILE8)
|
||||
AC_SUBST(PKG_LIB_FILE9)
|
||||
# Substitute STUB_LIB_FILE in case package creates a stub library too.
|
||||
AC_SUBST(PKG_STUB_LIB_FILE)
|
||||
|
||||
# We AC_SUBST these here to ensure they are subst'ed,
|
||||
# in case the user doesn't call TEA_ADD_...
|
||||
@@ -3106,11 +3139,15 @@ AC_DEFUN([TEA_SETUP_COMPILER], [
|
||||
fi
|
||||
fi
|
||||
|
||||
if test "${TCL_MAJOR_VERSION}" -lt 9 -a "${TCL_MINOR_VERSION}" -lt 7; then
|
||||
AC_DEFINE(Tcl_Size, int, [Is 'Tcl_Size' in <tcl.h>?])
|
||||
fi
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Common compiler flag setup
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
AC_C_BIGENDIAN
|
||||
AC_C_BIGENDIAN(,,,[#])
|
||||
])
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
@@ -3174,10 +3211,11 @@ print("manifest needed")
|
||||
|
||||
PACKAGE_LIB_PREFIX8="${PACKAGE_LIB_PREFIX}"
|
||||
PACKAGE_LIB_PREFIX9="${PACKAGE_LIB_PREFIX}tcl9"
|
||||
if test "${TCL_MAJOR_VERSION}" -gt 8 ; then
|
||||
if test "${TCL_MAJOR_VERSION}" -gt 8 -a x"${with_tcl8}" = x; then
|
||||
PACKAGE_LIB_PREFIX="${PACKAGE_LIB_PREFIX9}"
|
||||
else
|
||||
PACKAGE_LIB_PREFIX="${PACKAGE_LIB_PREFIX8}"
|
||||
AC_DEFINE(TCL_MAJOR_VERSION, 8, [Compile for Tcl8?])
|
||||
fi
|
||||
if test "${TEA_PLATFORM}" = "windows" ; then
|
||||
if test "${SHARED_BUILD}" = "1" ; then
|
||||
@@ -3202,7 +3240,11 @@ print("manifest needed")
|
||||
eval eval "PKG_LIB_FILE=${PACKAGE_LIB_PREFIX}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
|
||||
fi
|
||||
# Some packages build their own stubs libraries
|
||||
eval eval "PKG_STUB_LIB_FILE=${PACKAGE_LIB_PREFIX}${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
|
||||
if test "${TCL_MAJOR_VERSION}" -gt 8 -a x"${with_tcl8}" = x; then
|
||||
eval eval "PKG_STUB_LIB_FILE=${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}stub.a"
|
||||
else
|
||||
eval eval "PKG_STUB_LIB_FILE=${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
|
||||
fi
|
||||
if test "$GCC" = "yes"; then
|
||||
PKG_STUB_LIB_FILE=lib${PKG_STUB_LIB_FILE}
|
||||
fi
|
||||
@@ -3221,12 +3263,16 @@ print("manifest needed")
|
||||
eval eval "PKG_LIB_FILE=lib${PACKAGE_LIB_PREFIX}${PACKAGE_NAME}${SHARED_LIB_SUFFIX}"
|
||||
RANLIB=:
|
||||
else
|
||||
eval eval "PKG_LIB_FILE=lib${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
|
||||
eval eval "PKG_LIB_FILE=lib${PACKAGE_LIB_PREFIX9}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
|
||||
eval eval "PKG_LIB_FILE8=lib${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
|
||||
eval eval "PKG_LIB_FILE9=lib${PACKAGE_LIB_PREFIX9}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
|
||||
eval eval "PKG_LIB_FILE=lib${PACKAGE_LIB_PREFIX}${PACKAGE_NAME}${UNSHARED_LIB_SUFFIX}"
|
||||
fi
|
||||
# Some packages build their own stubs libraries
|
||||
eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
|
||||
if test "${TCL_MAJOR_VERSION}" -gt 8 -a x"${with_tcl8}" = x; then
|
||||
eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}stub.a"
|
||||
else
|
||||
eval eval "PKG_STUB_LIB_FILE=lib${PACKAGE_LIB_PREFIX8}${PACKAGE_NAME}stub${UNSHARED_LIB_SUFFIX}"
|
||||
fi
|
||||
fi
|
||||
|
||||
# These are escaped so that only CFLAGS is picked up at configure time.
|
||||
@@ -3240,6 +3286,8 @@ print("manifest needed")
|
||||
AC_SUBST(MAKE_SHARED_LIB)
|
||||
AC_SUBST(MAKE_STATIC_LIB)
|
||||
AC_SUBST(MAKE_STUB_LIB)
|
||||
# Substitute STUB_LIB_FILE in case package creates a stub library too.
|
||||
AC_SUBST(PKG_STUB_LIB_FILE)
|
||||
AC_SUBST(RANLIB_STUB)
|
||||
AC_SUBST(VC_MANIFEST_EMBED_DLL)
|
||||
AC_SUBST(VC_MANIFEST_EMBED_EXE)
|
||||
@@ -3366,9 +3414,9 @@ AC_DEFUN([TEA_PRIVATE_TCL_HEADERS], [
|
||||
# any *_NATIVE vars be defined in the Makefile
|
||||
TCL_INCLUDES="-I${TCL_GENERIC_DIR_NATIVE} -I${TCL_PLATFORM_DIR_NATIVE}"
|
||||
if test "`uname -s`" = "Darwin"; then
|
||||
# If Tcl was built as a framework, attempt to use
|
||||
# the framework's Headers and PrivateHeaders directories
|
||||
case ${TCL_DEFS} in
|
||||
# If Tcl was built as a framework, attempt to use
|
||||
# the framework's Headers and PrivateHeaders directories
|
||||
case ${TCL_DEFS} in
|
||||
*TCL_FRAMEWORK*)
|
||||
if test -d "${TCL_BIN_DIR}/Headers" -a \
|
||||
-d "${TCL_BIN_DIR}/PrivateHeaders"; then
|
||||
@@ -3376,7 +3424,7 @@ AC_DEFUN([TEA_PRIVATE_TCL_HEADERS], [
|
||||
else
|
||||
TCL_INCLUDES="${TCL_INCLUDES} ${TCL_INCLUDE_SPEC} `echo "${TCL_INCLUDE_SPEC}" | sed -e 's/Headers/PrivateHeaders/'`"
|
||||
fi
|
||||
;;
|
||||
;;
|
||||
esac
|
||||
result="Using ${TCL_INCLUDES}"
|
||||
else
|
||||
@@ -3817,10 +3865,10 @@ AC_DEFUN([TEA_LOAD_CONFIG], [
|
||||
AC_MSG_CHECKING([for existence of ${$1_BIN_DIR}/$1Config.sh])
|
||||
|
||||
if test -f "${$1_BIN_DIR}/$1Config.sh" ; then
|
||||
AC_MSG_RESULT([loading])
|
||||
AC_MSG_RESULT([loading])
|
||||
. "${$1_BIN_DIR}/$1Config.sh"
|
||||
else
|
||||
AC_MSG_RESULT([file not found])
|
||||
AC_MSG_RESULT([file not found])
|
||||
fi
|
||||
|
||||
#
|
||||
@@ -3834,11 +3882,11 @@ AC_DEFUN([TEA_LOAD_CONFIG], [
|
||||
|
||||
if test -f "${$1_BIN_DIR}/Makefile" ; then
|
||||
AC_MSG_WARN([Found Makefile - using build library specs for $1])
|
||||
$1_LIB_SPEC=${$1_BUILD_LIB_SPEC}
|
||||
$1_STUB_LIB_SPEC=${$1_BUILD_STUB_LIB_SPEC}
|
||||
$1_STUB_LIB_PATH=${$1_BUILD_STUB_LIB_PATH}
|
||||
$1_INCLUDE_SPEC=${$1_BUILD_INCLUDE_SPEC}
|
||||
$1_LIBRARY_PATH=${$1_LIBRARY_PATH}
|
||||
$1_LIB_SPEC=${$1_BUILD_LIB_SPEC}
|
||||
$1_STUB_LIB_SPEC=${$1_BUILD_STUB_LIB_SPEC}
|
||||
$1_STUB_LIB_PATH=${$1_BUILD_STUB_LIB_PATH}
|
||||
$1_INCLUDE_SPEC=${$1_BUILD_INCLUDE_SPEC}
|
||||
$1_LIBRARY_PATH=${$1_LIBRARY_PATH}
|
||||
fi
|
||||
|
||||
AC_SUBST($1_VERSION)
|
||||
@@ -3919,6 +3967,10 @@ AC_DEFUN([TEA_EXPORT_CONFIG], [
|
||||
eval $1_LIB_FLAG="-l$1`echo ${PACKAGE_VERSION} | tr -d .`"
|
||||
eval $1_STUB_LIB_FLAG="-l$1stub`echo ${PACKAGE_VERSION} | tr -d .`"
|
||||
fi
|
||||
if test "${TCL_MAJOR_VERSION}" -gt 8 -a x"${with_tcl8}" = x; then
|
||||
eval $1_STUB_LIB_FLAG="-l$1stub"
|
||||
fi
|
||||
|
||||
$1_BUILD_LIB_SPEC="-L`$CYGPATH $(pwd)` ${$1_LIB_FLAG}"
|
||||
$1_LIB_SPEC="-L`$CYGPATH ${pkglibdir}` ${$1_LIB_FLAG}"
|
||||
$1_BUILD_STUB_LIB_SPEC="-L`$CYGPATH $(pwd)` [$]{$1_STUB_LIB_FLAG}"
|
||||
@@ -4008,52 +4060,52 @@ AC_DEFUN([TEA_ZIPFS_SUPPORT], [
|
||||
AC_CACHE_VAL(ac_cv_path_macher, [
|
||||
search_path=`echo ${PATH} | sed -e 's/:/ /g'`
|
||||
for dir in $search_path ; do
|
||||
for j in `ls -r $dir/macher 2> /dev/null` \
|
||||
`ls -r $dir/macher 2> /dev/null` ; do
|
||||
if test x"$ac_cv_path_macher" = x ; then
|
||||
if test -f "$j" ; then
|
||||
ac_cv_path_macher=$j
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
for j in `ls -r $dir/macher 2> /dev/null` \
|
||||
`ls -r $dir/macher 2> /dev/null` ; do
|
||||
if test x"$ac_cv_path_macher" = x ; then
|
||||
if test -f "$j" ; then
|
||||
ac_cv_path_macher=$j
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
])
|
||||
if test -f "$ac_cv_path_macher" ; then
|
||||
MACHER_PROG="$ac_cv_path_macher"
|
||||
AC_MSG_RESULT([$MACHER_PROG])
|
||||
AC_MSG_RESULT([Found macher in environment])
|
||||
MACHER_PROG="$ac_cv_path_macher"
|
||||
AC_MSG_RESULT([$MACHER_PROG])
|
||||
AC_MSG_RESULT([Found macher in environment])
|
||||
fi
|
||||
AC_MSG_CHECKING([for zip])
|
||||
AC_CACHE_VAL(ac_cv_path_zip, [
|
||||
search_path=`echo ${PATH} | sed -e 's/:/ /g'`
|
||||
for dir in $search_path ; do
|
||||
for j in `ls -r $dir/zip 2> /dev/null` \
|
||||
`ls -r $dir/zip 2> /dev/null` ; do
|
||||
if test x"$ac_cv_path_zip" = x ; then
|
||||
if test -f "$j" ; then
|
||||
ac_cv_path_zip=$j
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
for j in `ls -r $dir/zip 2> /dev/null` \
|
||||
`ls -r $dir/zip 2> /dev/null` ; do
|
||||
if test x"$ac_cv_path_zip" = x ; then
|
||||
if test -f "$j" ; then
|
||||
ac_cv_path_zip=$j
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
done
|
||||
])
|
||||
if test -f "$ac_cv_path_zip" ; then
|
||||
ZIP_PROG="$ac_cv_path_zip"
|
||||
AC_MSG_RESULT([$ZIP_PROG])
|
||||
ZIP_PROG_OPTIONS="-rq"
|
||||
ZIP_PROG_VFSSEARCH="*"
|
||||
AC_MSG_RESULT([Found INFO Zip in environment])
|
||||
# Use standard arguments for zip
|
||||
ZIP_PROG="$ac_cv_path_zip"
|
||||
AC_MSG_RESULT([$ZIP_PROG])
|
||||
ZIP_PROG_OPTIONS="-rq"
|
||||
ZIP_PROG_VFSSEARCH="*"
|
||||
AC_MSG_RESULT([Found INFO Zip in environment])
|
||||
# Use standard arguments for zip
|
||||
else
|
||||
# It is not an error if an installed version of Zip can't be located.
|
||||
# We can use the locally distributed minizip instead
|
||||
ZIP_PROG="./minizip${EXEEXT_FOR_BUILD}"
|
||||
ZIP_PROG_OPTIONS="-o -r"
|
||||
ZIP_PROG_VFSSEARCH="*"
|
||||
ZIP_INSTALL_OBJS="minizip${EXEEXT_FOR_BUILD}"
|
||||
AC_MSG_RESULT([No zip found on PATH. Building minizip])
|
||||
# It is not an error if an installed version of Zip can't be located.
|
||||
# We can use the locally distributed minizip instead
|
||||
ZIP_PROG="./minizip${EXEEXT_FOR_BUILD}"
|
||||
ZIP_PROG_OPTIONS="-o -r"
|
||||
ZIP_PROG_VFSSEARCH="*"
|
||||
ZIP_INSTALL_OBJS="minizip${EXEEXT_FOR_BUILD}"
|
||||
AC_MSG_RESULT([No zip found on PATH. Building minizip])
|
||||
fi
|
||||
AC_SUBST(MACHER_PROG)
|
||||
AC_SUBST(ZIP_PROG)
|
||||
|
||||
+45
-414
@@ -1,430 +1,61 @@
|
||||
# makefile.vc -- -*- Makefile -*-
|
||||
#------------------------------------------------------------- -*- makefile -*-
|
||||
#
|
||||
# Microsoft Visual C++ makefile for use with nmake.exe v1.62+ (VC++ 5.0+)
|
||||
# Sample makefile for building Tcl extensions.
|
||||
#
|
||||
# This makefile is based upon the Tcl 8.4 Makefile.vc and modified to
|
||||
# make it suitable as a general package makefile. Look for the word EDIT
|
||||
# which marks sections that may need modification. As a minumum you will
|
||||
# need to change the PROJECT, DOTVERSION and DLLOBJS variables to values
|
||||
# relevant to your package.
|
||||
# Basic build, test and install
|
||||
# nmake /s /nologo /f makefile.vc INSTALLDIR=c:\path\to\tcl
|
||||
# nmake /s /nologo /f makefile.vc INSTALLDIR=c:\path\to\tcl test
|
||||
# nmake /s /nologo /f makefile.vc INSTALLDIR=c:\path\to\tcl install
|
||||
#
|
||||
# For other build options (debug, static etc.)
|
||||
# See TIP 477 (https://core.tcl.tk/tips/doc/trunk/tip/477.md) for
|
||||
# detailed documentation.
|
||||
#
|
||||
# See the file "license.terms" for information on usage and redistribution
|
||||
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
||||
#
|
||||
# Copyright (c) 1995-1996 Sun Microsystems, Inc.
|
||||
# Copyright (c) 1998-2000 Ajuba Solutions.
|
||||
# Copyright (c) 2001 ActiveState Corporation.
|
||||
# Copyright (c) 2001-2002 David Gravereaux.
|
||||
# Copyright (c) 2003 Pat Thoyts
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
# RCS: @(#)$Id: makefile.vc,v 1.4 2004/07/26 08:22:05 patthoyts Exp $
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
!if !defined(MSDEVDIR) && !defined(MSVCDIR) && !defined(VCINSTALLDIR) && !defined(MSSDK) && !defined(WINDOWSSDKDIR)
|
||||
MSG = ^
|
||||
You will need to run vcvars32.bat from Developer Studio, first, to setup^
|
||||
the environment. Jump to this line to read the new instructions.
|
||||
!error $(MSG)
|
||||
!endif
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# HOW TO USE this makefile:
|
||||
#
|
||||
# 1) It is now necessary to have %MSVCDir% set in the environment. This is
|
||||
# used as a check to see if vcvars32.bat had been run prior to running
|
||||
# nmake or during the installation of Microsoft Visual C++, MSVCDir had
|
||||
# been set globally and the PATH adjusted. Either way is valid.
|
||||
#
|
||||
# You'll need to run vcvars32.bat contained in the MsDev's vc(98)/bin
|
||||
# directory to setup the proper environment, if needed, for your current
|
||||
# setup. This is a needed bootstrap requirement and allows the swapping of
|
||||
# different environments to be easier.
|
||||
#
|
||||
# 2) To use the Platform SDK (not expressly needed), run setenv.bat after
|
||||
# vcvars32.bat according to the instructions for it. This can also turn on
|
||||
# the 64-bit compiler, if your SDK has it.
|
||||
#
|
||||
# 3) Targets are:
|
||||
# all -- Builds everything.
|
||||
# <project> -- Builds the project (eg: nmake sample)
|
||||
# test -- Builds and runs the test suite.
|
||||
# install -- Installs the built binaries and libraries to $(INSTALLDIR)
|
||||
# in an appropriate subdirectory.
|
||||
# clean/realclean/distclean -- varying levels of cleaning.
|
||||
#
|
||||
# 4) Macros usable on the commandline:
|
||||
# INSTALLDIR=<path>
|
||||
# Sets where to install Tcl from the built binaries.
|
||||
# C:\Progra~1\Tcl is assumed when not specified.
|
||||
#
|
||||
# OPTS=static,msvcrt,staticpkg,threads,symbols,profile,loimpact,none
|
||||
# Sets special options for the core. The default is for none.
|
||||
# Any combination of the above may be used (comma separated).
|
||||
# 'none' will over-ride everything to nothing.
|
||||
#
|
||||
# static = Builds a static library of the core instead of a
|
||||
# dll. The shell will be static (and large), as well.
|
||||
# msvcrt = Effects the static option only to switch it from
|
||||
# using libcmt(d) as the C runtime [by default] to
|
||||
# msvcrt(d). This is useful for static embedding
|
||||
# support.
|
||||
# staticpkg = Effects the static option only to switch
|
||||
# tclshXX.exe to have the dde and reg extension linked
|
||||
# inside it.
|
||||
# threads = Turns on full multithreading support.
|
||||
# thrdalloc = Use the thread allocator (shared global free pool).
|
||||
# symbols = Adds symbols for step debugging.
|
||||
# profile = Adds profiling hooks. Map file is assumed.
|
||||
# loimpact = Adds a flag for how NT treats the heap to keep memory
|
||||
# in use, low. This is said to impact alloc performance.
|
||||
#
|
||||
# STATS=memdbg,compdbg,none
|
||||
# Sets optional memory and bytecode compiler debugging code added
|
||||
# to the core. The default is for none. Any combination of the
|
||||
# above may be used (comma separated). 'none' will over-ride
|
||||
# everything to nothing.
|
||||
#
|
||||
# memdbg = Enables the debugging memory allocator.
|
||||
# compdbg = Enables byte compilation logging.
|
||||
#
|
||||
# MACHINE=(IX86|IA64|ALPHA)
|
||||
# Set the machine type used for the compiler, linker, and
|
||||
# resource compiler. This hook is needed to tell the tools
|
||||
# when alternate platforms are requested. IX86 is the default
|
||||
# when not specified.
|
||||
#
|
||||
# TMP_DIR=<path>
|
||||
# OUT_DIR=<path>
|
||||
# Hooks to allow the intermediate and output directories to be
|
||||
# changed. $(OUT_DIR) is assumed to be
|
||||
# $(BINROOT)\(Release|Debug) based on if symbols are requested.
|
||||
# $(TMP_DIR) will de $(OUT_DIR)\<buildtype> by default.
|
||||
#
|
||||
# TESTPAT=<file>
|
||||
# Reads the tests requested to be run from this file.
|
||||
#
|
||||
# CFG_ENCODING=encoding
|
||||
# name of encoding for configuration information. Defaults
|
||||
# to cp1252
|
||||
#
|
||||
# 5) Examples:
|
||||
#
|
||||
# Basic syntax of calling nmake looks like this:
|
||||
# nmake [-nologo] -f makefile.vc [target|macrodef [target|macrodef] [...]]
|
||||
#
|
||||
# Standard (no frills)
|
||||
# c:\tcl_src\win\>c:\progra~1\micros~1\vc98\bin\vcvars32.bat
|
||||
# Setting environment for using Microsoft Visual C++ tools.
|
||||
# c:\tcl_src\win\>nmake -f makefile.vc all
|
||||
# c:\tcl_src\win\>nmake -f makefile.vc install INSTALLDIR=c:\progra~1\tcl
|
||||
#
|
||||
# Building for Win64
|
||||
# c:\tcl_src\win\>c:\progra~1\micros~1\vc98\bin\vcvars32.bat
|
||||
# Setting environment for using Microsoft Visual C++ tools.
|
||||
# c:\tcl_src\win\>c:\progra~1\platfo~1\setenv.bat /pre64 /RETAIL
|
||||
# Targeting Windows pre64 RETAIL
|
||||
# c:\tcl_src\win\>nmake -f makefile.vc MACHINE=IA64
|
||||
#
|
||||
#------------------------------------------------------------------------------
|
||||
#==============================================================================
|
||||
###############################################################################
|
||||
#------------------------------------------------------------------------------
|
||||
|
||||
!if !exist("makefile.vc")
|
||||
MSG = ^
|
||||
You must run this makefile only from the directory it is in.^
|
||||
Please `cd` to its location first.
|
||||
!error $(MSG)
|
||||
!endif
|
||||
# PROJECT is sqlite, not sqlite3 to match TEA AC_INIT definition.
|
||||
# This makes the generated DLL name also consistent between the two
|
||||
# except for the "t" suffix which is the convention for nmake builds.
|
||||
PROJECT = sqlite
|
||||
PRJ_PACKAGE_TCLNAME = sqlite3
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# Project specific information (EDIT)
|
||||
#
|
||||
# You should edit this with the name and version of your project. This
|
||||
# information is used to generate the name of the package library and
|
||||
# it's install location.
|
||||
#
|
||||
# For example, the sample extension is going to build sample04.dll and
|
||||
# would install it into $(INSTALLDIR)\lib\sample04
|
||||
#
|
||||
# You need to specify the object files that need to be linked into your
|
||||
# binary here.
|
||||
#
|
||||
#-------------------------------------------------------------------------
|
||||
!include "rules-ext.vc"
|
||||
|
||||
PROJECT = sqlite3
|
||||
!include "rules.vc"
|
||||
PRJ_OBJS = $(TMP_DIR)\tclsqlite3.obj
|
||||
|
||||
# nmakehelp -V <file> <tag> will search the file for tag, skips until a
|
||||
# number and returns all character until a character not in [0-9.ab]
|
||||
# is read.
|
||||
|
||||
!if [echo REM = This file is generated from Makefile.vc > versions.vc]
|
||||
!endif
|
||||
# get project version from row "AC_INIT([sqlite], [3.x.y])"
|
||||
!if [echo DOTVERSION = \>> versions.vc] \
|
||||
&& [nmakehlp -V ..\configure.ac AC_INIT >> versions.vc]
|
||||
!endif
|
||||
!include "versions.vc"
|
||||
|
||||
VERSION = $(DOTVERSION:.=)
|
||||
STUBPREFIX = $(PROJECT)stub
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# Target names and paths ( shouldn't need changing )
|
||||
#-------------------------------------------------------------------------
|
||||
|
||||
BINROOT = .
|
||||
ROOT = ..
|
||||
|
||||
PRJIMPLIB = $(OUT_DIR)\$(PROJECT)$(VERSION)$(SUFX).lib
|
||||
PRJLIBNAME = $(PROJECT).$(EXT)
|
||||
PRJLIB = $(OUT_DIR)\$(PRJLIBNAME)
|
||||
|
||||
PRJSTUBLIBNAME = $(STUBPREFIX)$(VERSION).lib
|
||||
PRJSTUBLIB = $(OUT_DIR)\$(PRJSTUBLIBNAME)
|
||||
|
||||
### Make sure we use backslash only.
|
||||
PRJ_INSTALL_DIR = $(_INSTALLDIR)\$(PROJECT)$(DOTVERSION)
|
||||
LIB_INSTALL_DIR = $(PRJ_INSTALL_DIR)
|
||||
BIN_INSTALL_DIR = $(PRJ_INSTALL_DIR)
|
||||
DOC_INSTALL_DIR = $(PRJ_INSTALL_DIR)
|
||||
SCRIPT_INSTALL_DIR = $(PRJ_INSTALL_DIR)
|
||||
INCLUDE_INSTALL_DIR = $(_TCLDIR)\include
|
||||
|
||||
### The following paths CANNOT have spaces in them.
|
||||
GENERICDIR = $(ROOT)\generic
|
||||
WINDIR = $(ROOT)\win
|
||||
LIBDIR = $(ROOT)\library
|
||||
DOCDIR = $(ROOT)\doc
|
||||
TOOLSDIR = $(ROOT)\tools
|
||||
COMPATDIR = $(ROOT)\compat
|
||||
|
||||
### Figure out where the primary source code file(s) is/are.
|
||||
!if exist("$(ROOT)\..\..\sqlite3.c") && exist("$(ROOT)\..\..\src\tclsqlite.c")
|
||||
SQL_INCLUDES = -I"$(ROOT)\..\.."
|
||||
SQLITE_SRCDIR = $(ROOT)\..\..
|
||||
TCLSQLITE_SRCDIR = $(ROOT)\..\..\src
|
||||
DLLOBJS = $(TMP_DIR)\sqlite3.obj $(TMP_DIR)\tclsqlite.obj
|
||||
!else
|
||||
TCLSQLITE_SRCDIR = $(ROOT)\generic
|
||||
DLLOBJS = $(TMP_DIR)\tclsqlite3.obj
|
||||
!endif
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# Compile flags
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
!if !$(DEBUG)
|
||||
!if $(OPTIMIZING)
|
||||
### This cranks the optimization level to maximize speed
|
||||
cdebug = -O2 -Op -Gs
|
||||
!else
|
||||
cdebug =
|
||||
!endif
|
||||
!else if "$(MACHINE)" == "IA64"
|
||||
### Warnings are too many, can't support warnings into errors.
|
||||
cdebug = -Z7 -Od -GZ
|
||||
!else
|
||||
cdebug = -Z7 -WX -Od -GZ
|
||||
!endif
|
||||
|
||||
### Declarations common to all compiler options
|
||||
cflags = -nologo -c -W3 -D_CRT_SECURE_NO_WARNINGS -YX -Fp$(TMP_DIR)^\
|
||||
|
||||
!if $(MSVCRT)
|
||||
!if $(DEBUG)
|
||||
crt = -MDd
|
||||
!else
|
||||
crt = -MD
|
||||
!endif
|
||||
!else
|
||||
!if $(DEBUG)
|
||||
crt = -MTd
|
||||
!else
|
||||
crt = -MT
|
||||
!endif
|
||||
!endif
|
||||
|
||||
INCLUDES = $(SQL_INCLUDES) $(TCL_INCLUDES) -I"$(WINDIR)" \
|
||||
-I"$(GENERICDIR)" -I"$(ROOT)\.."
|
||||
BASE_CLFAGS = $(cflags) $(cdebug) $(crt) $(INCLUDES) \
|
||||
# Preprocessor macros specific to sqlite3.
|
||||
PRJ_DEFINES = -I"$(ROOT)\.." -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE \
|
||||
-DSQLITE_ENABLE_DBPAGE_VTAB=1 -DSQLITE_ENABLE_DBSTAT_VTAB=1 \
|
||||
-DSQLITE_ENABLE_FTS3_PARENTHESIS=1 -DSQLITE_ENABLE_FTS4=1 \
|
||||
-DSQLITE_ENABLE_FTS5=1 -DSQLITE_ENABLE_COLUMN_METADATA=1 \
|
||||
-DSQLITE_ENABLE_JSON1=1 -DSQLITE_LIKE_DOESNT_MATCH_BLOBS=1 \
|
||||
-DSQLITE_3_SUFFIX_ONLY=1 -DSQLITE_ENABLE_RTREE=1 \
|
||||
-DSQLITE_ENABLE_FTS3=1 -DSQLITE_OMIT_DEPRECATED=1 \
|
||||
-DSQLITE_ENABLE_FTS4=1 \
|
||||
-DSQLITE_ENABLE_FTS5=1 \
|
||||
-DSQLITE_3_SUFFIX_ONLY=1 \
|
||||
-DSQLITE_ENABLE_RTREE=1 \
|
||||
-DSQLITE_ENABLE_GEOPOLY=1 \
|
||||
-DSQLITE_ENABLE_MATH_FUNCTIONS=1 \
|
||||
-DSQLITE_ENABLE_DESERIALIZE=1 \
|
||||
-DSQLITE_ENABLE_DBPAGE_VTAB=1 \
|
||||
-DSQLITE_ENABLE_BYTECODE_VTAB=1 \
|
||||
-DSQLITE_ENABLE_DBSTAT_VTAB=1
|
||||
-DSQLITE_UNTESTABLE=1 -DSQLITE_OMIT_LOOKASIDE=1 \
|
||||
-DSQLITE_SECURE_DELETE=1 -DSQLITE_SOUNDEX=1 -DSQLITE_ENABLE_GEOPOLY=1 \
|
||||
-DSQLITE_ENABLE_UPDATE_DELETE_LIMIT=1 \
|
||||
-DSQLITE_ENABLE_MATH_FUNCTIONS=1 -DDSQLITE_USE_ALLOCA=1 \
|
||||
-DSQLITE_ENABLE_STAT4=1 -DSQLITE_OMIT_DEPRECATED=1 \
|
||||
-DSQLITE_WIN32_GETVERSIONEX=0 -DSQLITE_WIN32_NO_ANSI=1
|
||||
PRJ_DEFINES = $(PRJ_DEFINES) -I$(TMP_DIR)
|
||||
|
||||
CON_CFLAGS = $(cflags) $(cdebug) $(crt) -DCONSOLE -DSQLITE_ENABLE_FTS3=1
|
||||
TCL_CFLAGS = -DBUILD_sqlite -DUSE_TCL_STUBS \
|
||||
-DPACKAGE_VERSION="\"$(DOTVERSION)\"" $(BASE_CLFAGS) \
|
||||
$(OPTDEFINES)
|
||||
# Standard targets to build, install, test etc.
|
||||
!include "$(_RULESDIR)\targets.vc"
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# Link flags
|
||||
#---------------------------------------------------------------------
|
||||
# The built-in pkgindex does no suffice for our extension as
|
||||
# the PROJECT name (sqlite) is not same as init function name (Sqlite3)
|
||||
pkgindex:
|
||||
@echo if {[package vsatisfies [package provide Tcl] 9.0-]} { > $(OUT_DIR)\pkgIndex.tcl
|
||||
@echo package ifneeded $(PRJ_PACKAGE_TCLNAME) $(DOTVERSION) \
|
||||
[list load [file join $$dir $(PRJLIBNAME9)] [string totitle $(PRJ_PACKAGE_TCLNAME)]] >> $(OUT_DIR)\pkgIndex.tcl
|
||||
@echo } else { >> $(OUT_DIR)\pkgIndex.tcl
|
||||
@echo package ifneeded $(PRJ_PACKAGE_TCLNAME) $(DOTVERSION) \
|
||||
[list load [file join $$dir $(PRJLIBNAME8)] [string totitle $(PRJ_PACKAGE_TCLNAME)]] >> $(OUT_DIR)\pkgIndex.tcl
|
||||
@echo } >> $(OUT_DIR)\pkgIndex.tcl
|
||||
|
||||
!if $(DEBUG)
|
||||
ldebug = -debug:full -debugtype:cv
|
||||
!else
|
||||
ldebug = -release -opt:ref -opt:icf,3
|
||||
!endif
|
||||
# Install the manpage though on Windows, doubt it does much good
|
||||
install: default-install-docs-n
|
||||
|
||||
### Declarations common to all linker options
|
||||
lflags = -nologo -machine:$(MACHINE) $(ldebug)
|
||||
|
||||
!if $(PROFILE)
|
||||
lflags = $(lflags) -profile
|
||||
!endif
|
||||
|
||||
!if $(ALIGN98_HACK) && !$(STATIC_BUILD)
|
||||
### Align sections for PE size savings.
|
||||
lflags = $(lflags) -opt:nowin98
|
||||
!else if !$(ALIGN98_HACK) && $(STATIC_BUILD)
|
||||
### Align sections for speed in loading by choosing the virtual page size.
|
||||
lflags = $(lflags) -align:4096
|
||||
!endif
|
||||
|
||||
!if $(LOIMPACT)
|
||||
lflags = $(lflags) -ws:aggressive
|
||||
!endif
|
||||
|
||||
dlllflags = $(lflags) -dll
|
||||
conlflags = $(lflags) -subsystem:console
|
||||
guilflags = $(lflags) -subsystem:windows
|
||||
baselibs = $(TCLSTUBLIB)
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# TclTest flags
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
!IF "$(TESTPAT)" != ""
|
||||
TESTFLAGS = $(TESTFLAGS) -file $(TESTPAT)
|
||||
!ENDIF
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# Project specific targets (EDIT)
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
all: setup $(PROJECT)
|
||||
$(PROJECT): setup $(PRJLIB)
|
||||
install: install-binaries install-libraries install-docs
|
||||
|
||||
# Tests need to ensure we load the right dll file we
|
||||
# have to handle the output differently on Win9x.
|
||||
#
|
||||
!if "$(OS)" == "Windows_NT" || "$(MSVCDIR)" == "IDE"
|
||||
test: setup $(PROJECT)
|
||||
set TCL_LIBRARY=$(ROOT)/library
|
||||
$(TCLSH) <<
|
||||
load $(PRJLIB:\=/)
|
||||
cd "$(ROOT)/tests"
|
||||
set argv "$(TESTFLAGS)"
|
||||
source all.tcl
|
||||
<<
|
||||
!else
|
||||
test: setup $(PROJECT)
|
||||
echo Please wait while the test results are collected
|
||||
set TCL_LIBRARY=$(ROOT)/library
|
||||
$(TCLSH) << >tests.log
|
||||
load $(PRJLIB:\=/)
|
||||
cd "$(ROOT)/tests"
|
||||
set argv "$(TESTFLAGS)"
|
||||
source all.tcl
|
||||
<<
|
||||
type tests.log | more
|
||||
!endif
|
||||
|
||||
setup:
|
||||
@if not exist $(OUT_DIR)\nul mkdir $(OUT_DIR)
|
||||
@if not exist $(TMP_DIR)\nul mkdir $(TMP_DIR)
|
||||
|
||||
$(PRJLIB): $(DLLOBJS)
|
||||
$(link32) $(dlllflags) -out:$@ $(baselibs) @<<
|
||||
$**
|
||||
<<
|
||||
-@del $*.exp
|
||||
|
||||
$(PRJSTUBLIB): $(PRJSTUBOBJS)
|
||||
$(lib32) -nologo -out:$@ $(PRJSTUBOBJS)
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# Implicit rules
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
$(TMP_DIR)\sqlite3.obj: $(SQLITE_SRCDIR)\sqlite3.c
|
||||
$(cc32) $(TCL_CFLAGS) -DBUILD_$(PROJECT) -Fo$(TMP_DIR)\ \
|
||||
-c $(SQLITE_SRCDIR)\sqlite3.c
|
||||
|
||||
$(TMP_DIR)\tclsqlite.obj: $(TCLSQLITE_SRCDIR)\tclsqlite.c
|
||||
$(cc32) $(TCL_CFLAGS) -DBUILD_$(PROJECT) -Fo$(TMP_DIR)\ \
|
||||
-c $(TCLSQLITE_SRCDIR)\tclsqlite.c
|
||||
|
||||
$(TMP_DIR)\tclsqlite3.obj: $(TCLSQLITE_SRCDIR)\tclsqlite3.c
|
||||
$(cc32) $(TCL_CFLAGS) -DBUILD_$(PROJECT) -Fo$(TMP_DIR)\ \
|
||||
-c $(TCLSQLITE_SRCDIR)\tclsqlite3.c
|
||||
|
||||
{$(WINDIR)}.rc{$(TMP_DIR)}.res:
|
||||
$(rc32) -fo $@ -r -i "$(GENERICDIR)" -D__WIN32__ \
|
||||
!if $(DEBUG)
|
||||
-d DEBUG \
|
||||
!endif
|
||||
!if $(TCL_THREADS)
|
||||
-d TCL_THREADS \
|
||||
!endif
|
||||
!if $(STATIC_BUILD)
|
||||
-d STATIC_BUILD \
|
||||
!endif
|
||||
$<
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES:.c .rc
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# Installation. (EDIT)
|
||||
#
|
||||
# You may need to modify this section to reflect the final distribution
|
||||
# of your files and possibly to generate documentation.
|
||||
#
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
install-binaries:
|
||||
@echo Installing binaries to '$(SCRIPT_INSTALL_DIR)'
|
||||
@if not exist "$(SCRIPT_INSTALL_DIR)" mkdir "$(SCRIPT_INSTALL_DIR)"
|
||||
@$(CPY) $(PRJLIB) "$(SCRIPT_INSTALL_DIR)" >NUL
|
||||
|
||||
install-libraries:
|
||||
@echo Installing libraries to '$(SCRIPT_INSTALL_DIR)'
|
||||
@if exist $(LIBDIR) $(CPY) $(LIBDIR)\*.tcl "$(SCRIPT_INSTALL_DIR)"
|
||||
@echo Installing package index in '$(SCRIPT_INSTALL_DIR)'
|
||||
@type << >"$(SCRIPT_INSTALL_DIR)\pkgIndex.tcl"
|
||||
package ifneeded $(PROJECT) $(DOTVERSION) \
|
||||
[list load [file join $$dir $(PRJLIBNAME)] sqlite3]
|
||||
<<
|
||||
|
||||
install-docs:
|
||||
@echo Installing documentation files to '$(DOC_INSTALL_DIR)'
|
||||
@if exist $(DOCDIR) $(CPY) $(DOCDIR)\*.n "$(DOC_INSTALL_DIR)"
|
||||
|
||||
#---------------------------------------------------------------------
|
||||
# Clean up
|
||||
#---------------------------------------------------------------------
|
||||
|
||||
clean:
|
||||
@if exist $(TMP_DIR)\nul $(RMDIR) $(TMP_DIR)
|
||||
@if exist $(WINDIR)\version.vc del $(WINDIR)\version.vc
|
||||
|
||||
realclean: clean
|
||||
@if exist $(OUT_DIR)\nul $(RMDIR) $(OUT_DIR)
|
||||
|
||||
distclean: realclean
|
||||
@if exist $(WINDIR)\nmakehlp.exe del $(WINDIR)\nmakehlp.exe
|
||||
@if exist $(WINDIR)\nmakehlp.obj del $(WINDIR)\nmakehlp.obj
|
||||
# Explicit dependency rules
|
||||
|
||||
@@ -0,0 +1,123 @@
|
||||
# This file should only be included in makefiles for Tcl extensions,
|
||||
# NOT in the makefile for Tcl itself.
|
||||
|
||||
!ifndef _RULES_EXT_VC
|
||||
|
||||
# We need to run from the directory the parent makefile is located in.
|
||||
# nmake does not tell us what makefile was used to invoke it so parent
|
||||
# makefile has to set the MAKEFILEVC macro or we just make a guess and
|
||||
# warn if we think that is not the case.
|
||||
!if "$(MAKEFILEVC)" == ""
|
||||
|
||||
!if exist("$(PROJECT).vc")
|
||||
MAKEFILEVC = $(PROJECT).vc
|
||||
!elseif exist("makefile.vc")
|
||||
MAKEFILEVC = makefile.vc
|
||||
!endif
|
||||
!endif # "$(MAKEFILEVC)" == ""
|
||||
|
||||
!if !exist("$(MAKEFILEVC)")
|
||||
MSG = ^
|
||||
You must run nmake from the directory containing the project makefile.^
|
||||
If you are doing that and getting this message, set the MAKEFILEVC^
|
||||
macro to the name of the project makefile.
|
||||
!message WARNING: $(MSG)
|
||||
!endif
|
||||
|
||||
!if "$(PROJECT)" == "tcl"
|
||||
!error The rules-ext.vc file is not intended for Tcl itself.
|
||||
!endif
|
||||
|
||||
# We extract version numbers using the nmakehlp program. For now use
|
||||
# the local copy of nmakehlp. Once we locate Tcl, we will use that
|
||||
# one if it is newer.
|
||||
!if "$(MACHINE)" == "IX86" || "$(MACHINE)" == "$(NATIVE_ARCH)"
|
||||
!if [$(CC) -nologo -DNDEBUG "nmakehlp.c" -link -subsystem:console > nul]
|
||||
!endif
|
||||
!else
|
||||
!if [copy x86_64-w64-mingw32-nmakehlp.exe nmakehlp.exe >NUL]
|
||||
!endif
|
||||
!endif
|
||||
|
||||
# First locate the Tcl directory that we are working with.
|
||||
!if "$(TCLDIR)" != ""
|
||||
|
||||
_RULESDIR = $(TCLDIR:/=\)
|
||||
|
||||
!else
|
||||
|
||||
# If an installation path is specified, that is also the Tcl directory.
|
||||
# Also Tk never builds against an installed Tcl, it needs Tcl sources
|
||||
!if defined(INSTALLDIR) && "$(PROJECT)" != "tk"
|
||||
_RULESDIR=$(INSTALLDIR:/=\)
|
||||
!else
|
||||
# Locate Tcl sources
|
||||
!if [echo _RULESDIR = \> nmakehlp.out] \
|
||||
|| [nmakehlp -L generic\tcl.h >> nmakehlp.out]
|
||||
_RULESDIR = ..\..\tcl
|
||||
!else
|
||||
!include nmakehlp.out
|
||||
!endif
|
||||
|
||||
!endif # defined(INSTALLDIR)....
|
||||
|
||||
!endif # ifndef TCLDIR
|
||||
|
||||
# Now look for the targets.vc file under the Tcl root. Note we check this
|
||||
# file and not rules.vc because the latter also exists on older systems.
|
||||
!if exist("$(_RULESDIR)\lib\nmake\targets.vc") # Building against installed Tcl
|
||||
_RULESDIR = $(_RULESDIR)\lib\nmake
|
||||
!elseif exist("$(_RULESDIR)\win\targets.vc") # Building against Tcl sources
|
||||
_RULESDIR = $(_RULESDIR)\win
|
||||
!else
|
||||
# If we have not located Tcl's targets file, most likely we are compiling
|
||||
# against an older version of Tcl and so must use our own support files.
|
||||
_RULESDIR = .
|
||||
!endif
|
||||
|
||||
!if "$(_RULESDIR)" != "."
|
||||
# Potentially using Tcl's support files. If this extension has its own
|
||||
# nmake support files, need to compare the versions and pick newer.
|
||||
|
||||
!if exist("rules.vc") # The extension has its own copy
|
||||
|
||||
!if [echo TCL_RULES_MAJOR = \> versions.vc] \
|
||||
&& [nmakehlp -V "$(_RULESDIR)\rules.vc" RULES_VERSION_MAJOR >> versions.vc]
|
||||
!endif
|
||||
!if [echo TCL_RULES_MINOR = \>> versions.vc] \
|
||||
&& [nmakehlp -V "$(_RULESDIR)\rules.vc" RULES_VERSION_MINOR >> versions.vc]
|
||||
!endif
|
||||
|
||||
!if [echo OUR_RULES_MAJOR = \>> versions.vc] \
|
||||
&& [nmakehlp -V "rules.vc" RULES_VERSION_MAJOR >> versions.vc]
|
||||
!endif
|
||||
!if [echo OUR_RULES_MINOR = \>> versions.vc] \
|
||||
&& [nmakehlp -V "rules.vc" RULES_VERSION_MINOR >> versions.vc]
|
||||
!endif
|
||||
!include versions.vc
|
||||
# We have a newer version of the support files, use them
|
||||
!if ($(TCL_RULES_MAJOR) != $(OUR_RULES_MAJOR)) || ($(TCL_RULES_MINOR) < $(OUR_RULES_MINOR))
|
||||
_RULESDIR = .
|
||||
!endif
|
||||
|
||||
!endif # if exist("rules.vc")
|
||||
|
||||
!endif # if $(_RULESDIR) != "."
|
||||
|
||||
# Let rules.vc know what copy of nmakehlp.c to use.
|
||||
NMAKEHLPC = $(_RULESDIR)\nmakehlp.c
|
||||
|
||||
# Get rid of our internal defines before calling rules.vc
|
||||
!undef TCL_RULES_MAJOR
|
||||
!undef TCL_RULES_MINOR
|
||||
!undef OUR_RULES_MAJOR
|
||||
!undef OUR_RULES_MINOR
|
||||
|
||||
!if exist("$(_RULESDIR)\rules.vc")
|
||||
!message *** Using $(_RULESDIR)\rules.vc
|
||||
!include "$(_RULESDIR)\rules.vc"
|
||||
!else
|
||||
!error *** Could not locate rules.vc in $(_RULESDIR)
|
||||
!endif
|
||||
|
||||
!endif # _RULES_EXT_VC
|
||||
+1609
-406
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,98 @@
|
||||
#------------------------------------------------------------- -*- makefile -*-
|
||||
# targets.vc --
|
||||
#
|
||||
# Part of the nmake based build system for Tcl and its extensions.
|
||||
# This file defines some standard targets for the convenience of extensions
|
||||
# and can be optionally included by the extension makefile.
|
||||
# See TIP 477 (https://core.tcl-lang.org/tips/doc/main/tip/477.md) for docs.
|
||||
|
||||
$(PROJECT): setup pkgindex $(PRJLIB)
|
||||
|
||||
!ifdef PRJ_STUBOBJS
|
||||
$(PROJECT): $(PRJSTUBLIB)
|
||||
$(PRJSTUBLIB): $(PRJ_STUBOBJS)
|
||||
$(LIBCMD) $**
|
||||
|
||||
$(PRJ_STUBOBJS):
|
||||
$(CCSTUBSCMD) %s
|
||||
!endif # PRJ_STUBOBJS
|
||||
|
||||
!ifdef PRJ_MANIFEST
|
||||
$(PROJECT): $(PRJLIB).manifest
|
||||
$(PRJLIB).manifest: $(PRJ_MANIFEST)
|
||||
@nmakehlp -s << $** >$@
|
||||
@MACHINE@ $(MACHINE:IX86=X86)
|
||||
<<
|
||||
!endif
|
||||
|
||||
!if "$(PROJECT)" != "tcl" && "$(PROJECT)" != "tk"
|
||||
$(PRJLIB): $(PRJ_OBJS) $(RESFILE)
|
||||
!if $(STATIC_BUILD)
|
||||
$(LIBCMD) $**
|
||||
!else
|
||||
$(DLLCMD) $**
|
||||
$(_VC_MANIFEST_EMBED_DLL)
|
||||
!endif
|
||||
-@del $*.exp
|
||||
!endif
|
||||
|
||||
!if "$(PRJ_HEADERS)" != "" && "$(PRJ_OBJS)" != ""
|
||||
$(PRJ_OBJS): $(PRJ_HEADERS)
|
||||
!endif
|
||||
|
||||
# If parent makefile has defined stub objects, add their installation
|
||||
# to the default install
|
||||
!if "$(PRJ_STUBOBJS)" != ""
|
||||
default-install: default-install-stubs
|
||||
!endif
|
||||
|
||||
# Unlike the other default targets, these cannot be in rules.vc because
|
||||
# the executed command depends on existence of macro PRJ_HEADERS_PUBLIC
|
||||
# that the parent makefile will not define until after including rules-ext.vc
|
||||
!if "$(PRJ_HEADERS_PUBLIC)" != ""
|
||||
default-install: default-install-headers
|
||||
default-install-headers:
|
||||
@echo Installing headers to '$(INCLUDE_INSTALL_DIR)'
|
||||
@for %f in ($(PRJ_HEADERS_PUBLIC)) do @$(COPY) %f "$(INCLUDE_INSTALL_DIR)"
|
||||
!endif
|
||||
|
||||
!if "$(DISABLE_STANDARD_TARGETS)" == ""
|
||||
DISABLE_STANDARD_TARGETS = 0
|
||||
!endif
|
||||
|
||||
!if "$(DISABLE_TARGET_setup)" == ""
|
||||
DISABLE_TARGET_setup = 0
|
||||
!endif
|
||||
!if "$(DISABLE_TARGET_install)" == ""
|
||||
DISABLE_TARGET_install = 0
|
||||
!endif
|
||||
!if "$(DISABLE_TARGET_clean)" == ""
|
||||
DISABLE_TARGET_clean = 0
|
||||
!endif
|
||||
!if "$(DISABLE_TARGET_test)" == ""
|
||||
DISABLE_TARGET_test = 0
|
||||
!endif
|
||||
!if "$(DISABLE_TARGET_shell)" == ""
|
||||
DISABLE_TARGET_shell = 0
|
||||
!endif
|
||||
|
||||
!if !$(DISABLE_STANDARD_TARGETS)
|
||||
!if !$(DISABLE_TARGET_setup)
|
||||
setup: default-setup
|
||||
!endif
|
||||
!if !$(DISABLE_TARGET_install)
|
||||
install: default-install
|
||||
!endif
|
||||
!if !$(DISABLE_TARGET_clean)
|
||||
clean: default-clean
|
||||
realclean: hose
|
||||
hose: default-hose
|
||||
distclean: realclean default-distclean
|
||||
!endif
|
||||
!if !$(DISABLE_TARGET_test)
|
||||
test: default-test
|
||||
!endif
|
||||
!if !$(DISABLE_TARGET_shell)
|
||||
shell: default-shell
|
||||
!endif
|
||||
!endif # DISABLE_STANDARD_TARGETS
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.69 for sqlite 3.47.0.
|
||||
# Generated by GNU Autoconf 2.69 for sqlite 3.47.2.
|
||||
#
|
||||
#
|
||||
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
|
||||
@@ -726,8 +726,8 @@ MAKEFLAGS=
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='sqlite'
|
||||
PACKAGE_TARNAME='sqlite'
|
||||
PACKAGE_VERSION='3.47.0'
|
||||
PACKAGE_STRING='sqlite 3.47.0'
|
||||
PACKAGE_VERSION='3.47.2'
|
||||
PACKAGE_STRING='sqlite 3.47.2'
|
||||
PACKAGE_BUGREPORT=''
|
||||
PACKAGE_URL=''
|
||||
|
||||
@@ -1467,7 +1467,7 @@ if test "$ac_init_help" = "long"; then
|
||||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
\`configure' configures sqlite 3.47.0 to adapt to many kinds of systems.
|
||||
\`configure' configures sqlite 3.47.2 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@@ -1532,7 +1532,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of sqlite 3.47.0:";;
|
||||
short | recursive ) echo "Configuration of sqlite 3.47.2:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@@ -1665,7 +1665,7 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
sqlite configure 3.47.0
|
||||
sqlite configure 3.47.2
|
||||
generated by GNU Autoconf 2.69
|
||||
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
@@ -2084,7 +2084,7 @@ cat >config.log <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by sqlite $as_me 3.47.0, which was
|
||||
It was created by sqlite $as_me 3.47.2, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
@@ -10334,8 +10334,8 @@ else
|
||||
fi
|
||||
|
||||
original_use_tcl=${use_tcl}
|
||||
if test x"${with_tclsh}" == x -a x"${with_tcl}" == x; then
|
||||
for ac_prog in tclsh8.6 tclsh tclsh9.0
|
||||
if test x"${with_tclsh}" = x -a x"${with_tcl}" = x; then
|
||||
for ac_prog in tclsh9.0 tclsh8.6 tclsh
|
||||
do
|
||||
# Extract the first word of "$ac_prog", so it can be a program name with args.
|
||||
set dummy $ac_prog; ac_word=$2
|
||||
@@ -10453,7 +10453,7 @@ $as_echo "unable to run tests because no tclConfig.sh file could be located" >&6
|
||||
HAVE_TCL=0
|
||||
fi
|
||||
|
||||
if test x"$TCLSH_CMD" == x; then
|
||||
if test x"$TCLSH_CMD" = x; then
|
||||
TCLSH_CMD=${TCL_EXEC_PREFIX}/bin/tclsh${TCL_VERSION}
|
||||
if test ! -x ${TCLSH_CMD}; then
|
||||
TCLSH_CMD_2=${TCL_EXEC_PREFIX}/bin/tclsh
|
||||
@@ -12396,7 +12396,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
||||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by sqlite $as_me 3.47.0, which was
|
||||
This file was extended by sqlite $as_me 3.47.2, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -12462,7 +12462,7 @@ _ACEOF
|
||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||
ac_cs_version="\\
|
||||
sqlite config.status 3.47.0
|
||||
sqlite config.status 3.47.2
|
||||
configured by $0, generated by GNU Autoconf 2.69,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
|
||||
+3
-3
@@ -124,8 +124,8 @@ AC_ARG_WITH(tcl, AS_HELP_STRING([--with-tcl=DIR],[directory containing (tclConfi
|
||||
AC_ARG_ENABLE(tcl, AS_HELP_STRING([--disable-tcl],[omit building accessory programs that require TCL-dev]),
|
||||
[use_tcl=$enableval],[use_tcl=yes])
|
||||
original_use_tcl=${use_tcl}
|
||||
if test x"${with_tclsh}" == x -a x"${with_tcl}" == x; then
|
||||
AC_CHECK_PROGS(TCLSH_CMD, [tclsh8.6 tclsh tclsh9.0],none)
|
||||
if test x"${with_tclsh}" = x -a x"${with_tcl}" = x; then
|
||||
AC_CHECK_PROGS(TCLSH_CMD, [tclsh9.0 tclsh8.6 tclsh],none)
|
||||
with_tclsh=${TCLSH_CMD}
|
||||
fi
|
||||
if test x"${with_tclsh}" != x -a x"${with_tclsh}" != xnone; then
|
||||
@@ -195,7 +195,7 @@ else
|
||||
HAVE_TCL=0
|
||||
fi
|
||||
AC_SUBST(HAVE_TCL)
|
||||
if test x"$TCLSH_CMD" == x; then
|
||||
if test x"$TCLSH_CMD" = x; then
|
||||
TCLSH_CMD=${TCL_EXEC_PREFIX}/bin/tclsh${TCL_VERSION}
|
||||
if test ! -x ${TCLSH_CMD}; then
|
||||
TCLSH_CMD_2=${TCL_EXEC_PREFIX}/bin/tclsh
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
# Notes On Compiling SQLite On All Kinds Of Unix
|
||||
|
||||
Here are step-by-step instructions on how to build SQLite from
|
||||
canonical source on any modern machine that isn't Windows. These
|
||||
notes are tested (on 2024-10-11) on Ubuntu and on MacOS, but they
|
||||
are general and should work on most any modern unix platform.
|
||||
|
||||
1. Install a C-compiler. GCC or Clang both work fine. If you are
|
||||
reading this document, you've probably already done that.
|
||||
|
||||
2. Install TCL9 development libraries. In this note, we'll do a
|
||||
private install in the $HOME/local directory, but you can make
|
||||
adjustments to install TCL9 wherever you like.
|
||||
<p>
|
||||
This document assumes you are working with <b>TCL version 9.0</b>.
|
||||
<ol type="a">
|
||||
<li>Get the TCL source archive, perhaps from
|
||||
<https://www.tcl.tk/software/tcltk/download.html>
|
||||
or <https://sqlite.org/tmp/tcl9.0.0.tar.gz>.
|
||||
<li>Untar the source archive. CD into the "unix/" subfolder
|
||||
of the source tree.
|
||||
<li>Run: `mkdir $HOME/local`
|
||||
<li>Run: `./configure --prefix=$HOME/local`
|
||||
<li>Run: `make install`
|
||||
</ol>
|
||||
|
||||
4. Download the SQLite source tree and unpack it. CD into the
|
||||
toplevel directory of the source tree.
|
||||
|
||||
5. Run: `./configure --enable-all --with-tclsh=$HOME/local/bin/tclsh9.0`
|
||||
|
||||
You do not need to use --with-tclsh if the tclsh you want to use is the
|
||||
first one on your PATH.
|
||||
|
||||
6. Run the "`Makefile`" makefile with an appropriate target.
|
||||
Examples:
|
||||
<ul>
|
||||
<li> `make sqlite3.c`
|
||||
<li> `make sqlite3`
|
||||
<li> `make sqldiff`
|
||||
<li> `make sqlite3_rsync`
|
||||
<li> `make tclextension-install`
|
||||
<li> `make devtest`
|
||||
<li> `make releasetest`
|
||||
<li> `make sqlite3_analyzer`
|
||||
</ul>
|
||||
|
||||
It is not required that you run the "tclextension-install" target prior to
|
||||
running tests. However, the tests will run more smoothly if you do.
|
||||
The version of SQLite used for the TCL extension does *not* need to
|
||||
correspond to the version of SQLite under test. So you can install the
|
||||
SQLite TCL extension once, and then use it to test many different versions
|
||||
of SQLite.
|
||||
|
||||
|
||||
7. For a debugging build of the CLI, where the ".treetrace" and ".wheretrace"
|
||||
commands work, add the the --enable-debug argument to configure.
|
||||
+26
-20
@@ -1,7 +1,7 @@
|
||||
# Notes On Compiling SQLite On Windows 11
|
||||
|
||||
Here are step-by-step instructions on how to build SQLite from
|
||||
canonical source on a new Windows 11 PC, as of 2023-11-01:
|
||||
canonical source on a new Windows 11 PC, as of 2024-10-09:
|
||||
|
||||
1. Install Microsoft Visual Studio. The free "community edition"
|
||||
will work fine. Do a standard install for C++ development.
|
||||
@@ -20,23 +20,23 @@ canonical source on a new Windows 11 PC, as of 2023-11-01:
|
||||
install the TCL development libraries in the "`c:\Tcl`" directory.
|
||||
Make adjustments
|
||||
if you want TCL installed somewhere else. SQLite needs both the
|
||||
"tclsh.exe" command-line tool as part of the build process, and
|
||||
the "tcl86.lib" library in order to run tests. You will need
|
||||
TCL version 8.6 or later.
|
||||
"tclsh90.exe" command-line tool as part of the build process, and
|
||||
the "tcl90.lib" and "tclstub.lib" libraries in order to run tests.
|
||||
This document assumes you are working with <b>TCL version 9.0</b>.
|
||||
See versions of this document from prior to 2024-10-10 for
|
||||
instructions on how to build using TCL version 8.6.
|
||||
<ol type="a">
|
||||
<li>Get the TCL source archive, perhaps from
|
||||
[https://www.tcl.tk/software/tcltk/download.html](https://www.tcl.tk/software/tcltk/download.html).
|
||||
<https://www.tcl.tk/software/tcltk/download.html>
|
||||
or <https://sqlite.org/tmp/tcl9.0.0.tar.gz>.
|
||||
<li>Untar or unzip the source archive. CD into the "win/" subfolder
|
||||
of the source tree.
|
||||
<li>Run: `nmake /f makefile.vc release`
|
||||
<li>Run: `nmake /f makefile.vc INSTALLDIR=c:\Tcl install`
|
||||
<li>CD to `c:\Tcl\lib`. In that subfolder make a copy of the
|
||||
"`tcl86t.lib`" file to the alternative name "`tcl86.lib`"
|
||||
(omitting the second 't'). Leave the copy in the same directory
|
||||
as the original.
|
||||
<li>CD to `c:\Tcl\bin`. Make a copy of the "`tclsh86t.exe`"
|
||||
file into "`tclsh.exe`" (without the "86t") in the same directory.
|
||||
<li>Add `c:\Tcl\bin` to your %PATH%. To do this, go to Settings
|
||||
<li><i>Optional:</i> CD to `c:\Tcl\bin` and make a copy of
|
||||
`tclsh90.exe` over into just `tclsh.exe`.
|
||||
<li><i>Optional:</i>
|
||||
Add `c:\Tcl\bin` to your %PATH%. To do this, go to Settings
|
||||
and search for "path". Select "edit environment variables for
|
||||
your account" and modify your default PATH accordingly.
|
||||
You will need to close and reopen your command prompts after
|
||||
@@ -52,6 +52,12 @@ canonical source on a new Windows 11 PC, as of 2023-11-01:
|
||||
<li> `set TCLDIR=c:\Tcl`
|
||||
</ul>
|
||||
|
||||
If you install TCL in the "`c:\Tcl`" directory (as recommended
|
||||
in step 3 above), then this step is optional because
|
||||
"`c:\Tcl`" is the default value for TCLDIR. You can also skip this
|
||||
step by specifying "`TCLDIR=c:\Tcl`" as an argument to the nmake
|
||||
commands in step 6 below.
|
||||
|
||||
6. Run the "`Makefile.msc`" makefile with an appropriate target.
|
||||
Examples:
|
||||
<ul>
|
||||
@@ -59,6 +65,7 @@ canonical source on a new Windows 11 PC, as of 2023-11-01:
|
||||
<li> `nmake /f makefile.msc sqlite3.c`
|
||||
<li> `nmake /f makefile.msc sqlite3.exe`
|
||||
<li> `nmake /f makefile.msc sqldiff.exe`
|
||||
<li> `nmake /f makefile.msc sqlite3_rsync.exe`
|
||||
<li> `nmake /f makefile.msc tclextension-install`
|
||||
<li> `nmake /f makefile.msc devtest`
|
||||
<li> `nmake /f makefile.msc releasetest`
|
||||
@@ -127,7 +134,7 @@ nmake /f Makefile.msc sqlite3_analyzer.exe
|
||||
~~~~
|
||||
|
||||
And you will end up with a working executable. However, that executable
|
||||
will depend on having the "tcl86.dll" library somewhere on your %PATH%.
|
||||
will depend on having the "tcl98.dll" library somewhere on your %PATH%.
|
||||
Use the following steps to build an executable that has the TCL library
|
||||
statically linked so that it does not depend on separate DLL:
|
||||
|
||||
@@ -137,27 +144,26 @@ statically linked so that it does not depend on separate DLL:
|
||||
2. Untar the TCL source tarball into a fresh directory. CD into
|
||||
the "win/" subfolder.
|
||||
|
||||
3. Run: `nmake /f makefile.vc OPTS=nothreads,static shell`
|
||||
|
||||
3. Run: `nmake /f makefile.vc OPTS=static shell`
|
||||
|
||||
4. CD into the "Release*" subfolder that is created (note the
|
||||
wildcard - the full name of the directory might vary). There
|
||||
you will find the "tcl86s.lib" file. Copy this file into the
|
||||
same directory that you put the "tcl86.lib" on your initial
|
||||
you will find the "tcl90s.lib" file. Copy this file into the
|
||||
same directory that you put the "tcl90.lib" on your initial
|
||||
installation. (In this document, that directory is
|
||||
"`C:\Tcl32\lib`" for 32-bit builds and
|
||||
"`C:\Tcl\lib`" for 64-bit builds.)
|
||||
|
||||
5. CD into your SQLite source code directory and build the desired
|
||||
utility program, but add the following extra arguments to the
|
||||
utility program, but add the following extra argument to the
|
||||
nmake command line:
|
||||
<blockquote><pre>
|
||||
CCOPTS="-DSTATIC_BUILD" LIBTCL="tcl86s.lib netapi32.lib user32.lib"
|
||||
STATICALLY_LINK_TCL=1
|
||||
</pre></blockquote>
|
||||
<p>So, for example, to build a statically linked version of
|
||||
sqlite3_analyzer.exe, you might type:
|
||||
<blockquote><pre>
|
||||
nmake /f Makefile.msc CCOPTS="-DSTATIC_BUILD" LIBTCL="tcl86s.lib netapi32.lib user32.lib" sqlite3_analyzer.exe
|
||||
nmake /f Makefile.msc STATICALLY_LINK_TCL=1 sqlite3_analyzer.exe
|
||||
</pre></blockquote>
|
||||
|
||||
6. After your executable is built, you can verify that it does not
|
||||
|
||||
@@ -402,6 +402,19 @@ do_setup_rec_test $tn.19.0 {
|
||||
SCAN t1 USING COVERING INDEX t1_idx_01a7214e
|
||||
}
|
||||
|
||||
ifcapable fts5 {
|
||||
do_setup_rec_test $tn.20.0 {
|
||||
CREATE VIRTUAL TABLE ft USING fts5(a);
|
||||
CREATE TABLE t1(x, y);
|
||||
} {
|
||||
SELECT * FROM ft, t1 WHERE a=x
|
||||
} {
|
||||
CREATE INDEX t1_idx_00000078 ON t1(x);
|
||||
SCAN ft VIRTUAL TABLE INDEX 0:
|
||||
SEARCH t1 USING INDEX t1_idx_00000078 (x=?)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
proc do_candidates_test {tn sql res} {
|
||||
@@ -507,4 +520,90 @@ do_candidates_test 6.1 {
|
||||
CREATE INDEX x1_idx_00000062 ON x1(b);
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
ifcapable fts5 {
|
||||
reset_db
|
||||
do_execsql_test 7.0 {
|
||||
CREATE VIRTUAL TABLE ft USING fts5(a);
|
||||
CREATE TABLE t1(x, y);
|
||||
}
|
||||
|
||||
do_candidates_test 7.1 {
|
||||
SELECT * FROM ft, t1 WHERE a=x
|
||||
} {
|
||||
CREATE INDEX t1_idx_00000078 ON t1(x);
|
||||
}
|
||||
|
||||
register_tcl_module db
|
||||
proc vtab_command {method args} {
|
||||
global G
|
||||
|
||||
switch -- $method {
|
||||
xConnect {
|
||||
return "CREATE TABLE t1(a, b, c);"
|
||||
}
|
||||
|
||||
xBestIndex {
|
||||
return [list]
|
||||
}
|
||||
|
||||
xFilter {
|
||||
return [list sql "SELECT rowid, * FROM t0"]
|
||||
}
|
||||
}
|
||||
|
||||
return {}
|
||||
}
|
||||
|
||||
do_execsql_test 7.2 {
|
||||
CREATE TABLE t0(a, b, c);
|
||||
INSERT INTO t0 VALUES(1, 2, 3), (11, 22, 33);
|
||||
CREATE VIRTUAL TABLE t2 USING tcl(vtab_command);
|
||||
}
|
||||
|
||||
do_execsql_test 7.3 {
|
||||
SELECT * FROM t2
|
||||
} {
|
||||
1 2 3
|
||||
11 22 33
|
||||
}
|
||||
|
||||
do_candidates_test 7.4 {
|
||||
SELECT * FROM ft, t1 WHERE a=x
|
||||
} {
|
||||
CREATE INDEX t1_idx_00000078 ON t1(x);
|
||||
}
|
||||
|
||||
do_test 7.5 {
|
||||
set expert [sqlite3_expert_new db]
|
||||
list [catch { $expert sql "SELECT * FROM ft, t2 WHERE b=1" } msg] $msg
|
||||
} {1 {no such table: t2}}
|
||||
$expert destroy
|
||||
|
||||
reset_db
|
||||
do_execsql_test 7.6 {
|
||||
BEGIN TRANSACTION;
|
||||
CREATE TABLE IF NOT EXISTS 'bfts_idx_data'(id INTEGER PRIMARY KEY, block BLOB);
|
||||
CREATE TABLE IF NOT EXISTS 'fts_idx_data'(id INTEGER PRIMARY KEY, block BLOB);
|
||||
INSERT INTO fts_idx_data VALUES(1,X'');
|
||||
INSERT INTO fts_idx_data VALUES(10,X'00000000ff000001000000');
|
||||
CREATE TABLE IF NOT EXISTS 'fts_idx_idx'(segid, term, pgno, PRIMARY KEY(segid, term)) WITHOUT ROWID;
|
||||
CREATE TABLE IF NOT EXISTS 'fts_idx_docsize'(id INTEGER PRIMARY KEY, sz BLOB, origin INTEGER);
|
||||
CREATE TABLE IF NOT EXISTS 'fts_idx_config'(k PRIMARY KEY, v) WITHOUT ROWID;
|
||||
INSERT INTO fts_idx_config VALUES('version',4);
|
||||
PRAGMA writable_schema=ON;
|
||||
INSERT INTO sqlite_schema(type,name,tbl_name,rootpage,sql)VALUES('table','fts_idx','fts_idx',0,'CREATE VIRTUAL TABLE fts_idx USING fts5(Title, Description, Channel, Tags, content='''', contentless_delete=1)');
|
||||
|
||||
CREATE TABLE f(x BLOB, y);
|
||||
COMMIT;
|
||||
PRAGMA writable_schema = RESET;
|
||||
}
|
||||
|
||||
do_candidates_test 7.4 {
|
||||
SELECT * FROM fts_idx, f WHERE x = fts_idx.Channel
|
||||
} {
|
||||
CREATE INDEX f_idx_00000078 ON f(x);
|
||||
}
|
||||
}
|
||||
|
||||
finish_test
|
||||
|
||||
+85
-10
@@ -1392,6 +1392,66 @@ static int idxProcessTriggers(sqlite3expert *p, char **pzErr){
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
** This function tests if the schema of the main database of database handle
|
||||
** db contains an object named zTab. Assuming no error occurs, output parameter
|
||||
** (*pbContains) is set to true if zTab exists, or false if it does not.
|
||||
**
|
||||
** Or, if an error occurs, an SQLite error code is returned. The final value
|
||||
** of (*pbContains) is undefined in this case.
|
||||
*/
|
||||
static int expertDbContainsObject(
|
||||
sqlite3 *db,
|
||||
const char *zTab,
|
||||
int *pbContains /* OUT: True if object exists */
|
||||
){
|
||||
const char *zSql = "SELECT 1 FROM sqlite_schema WHERE name = ?";
|
||||
sqlite3_stmt *pSql = 0;
|
||||
int rc = SQLITE_OK;
|
||||
int ret = 0;
|
||||
|
||||
rc = sqlite3_prepare_v2(db, zSql, -1, &pSql, 0);
|
||||
if( rc==SQLITE_OK ){
|
||||
sqlite3_bind_text(pSql, 1, zTab, -1, SQLITE_STATIC);
|
||||
if( SQLITE_ROW==sqlite3_step(pSql) ){
|
||||
ret = 1;
|
||||
}
|
||||
rc = sqlite3_finalize(pSql);
|
||||
}
|
||||
|
||||
*pbContains = ret;
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
** Execute SQL command zSql using database handle db. If no error occurs,
|
||||
** set (*pzErr) to NULL and return SQLITE_OK.
|
||||
**
|
||||
** If an error does occur, return an SQLite error code and set (*pzErr) to
|
||||
** point to a buffer containing an English language error message. Except,
|
||||
** if the error message begins with "no such module:", then ignore the
|
||||
** error and return as if the SQL statement had succeeded.
|
||||
**
|
||||
** This is used to copy as much of the database schema as possible while
|
||||
** ignoring any errors related to missing virtual table modules.
|
||||
*/
|
||||
static int expertSchemaSql(sqlite3 *db, const char *zSql, char **pzErr){
|
||||
int rc = SQLITE_OK;
|
||||
char *zErr = 0;
|
||||
|
||||
rc = sqlite3_exec(db, zSql, 0, 0, &zErr);
|
||||
if( rc!=SQLITE_OK && zErr ){
|
||||
int nErr = STRLEN(zErr);
|
||||
if( nErr>=15 && memcmp(zErr, "no such module:", 15)==0 ){
|
||||
sqlite3_free(zErr);
|
||||
rc = SQLITE_OK;
|
||||
zErr = 0;
|
||||
}
|
||||
}
|
||||
|
||||
*pzErr = zErr;
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int idxCreateVtabSchema(sqlite3expert *p, char **pzErrmsg){
|
||||
int rc = idxRegisterVtab(p);
|
||||
@@ -1403,26 +1463,35 @@ static int idxCreateVtabSchema(sqlite3expert *p, char **pzErrmsg){
|
||||
** 2) Create the equivalent virtual table in dbv.
|
||||
*/
|
||||
rc = idxPrepareStmt(p->db, &pSchema, pzErrmsg,
|
||||
"SELECT type, name, sql, 1 FROM sqlite_schema "
|
||||
"WHERE type IN ('table','view') AND name NOT LIKE 'sqlite_%%' "
|
||||
"SELECT type, name, sql, 1, "
|
||||
" substr(sql,1,14)=='create virtual' COLLATE nocase "
|
||||
"FROM sqlite_schema "
|
||||
"WHERE type IN ('table','view') AND "
|
||||
" substr(name,1,7)!='sqlite_' COLLATE nocase "
|
||||
" UNION ALL "
|
||||
"SELECT type, name, sql, 2 FROM sqlite_schema "
|
||||
"SELECT type, name, sql, 2, 0 FROM sqlite_schema "
|
||||
"WHERE type = 'trigger'"
|
||||
" AND tbl_name IN(SELECT name FROM sqlite_schema WHERE type = 'view') "
|
||||
"ORDER BY 4, 1"
|
||||
"ORDER BY 4, 5 DESC, 1"
|
||||
);
|
||||
while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pSchema) ){
|
||||
const char *zType = (const char*)sqlite3_column_text(pSchema, 0);
|
||||
const char *zName = (const char*)sqlite3_column_text(pSchema, 1);
|
||||
const char *zSql = (const char*)sqlite3_column_text(pSchema, 2);
|
||||
int bVirtual = sqlite3_column_int(pSchema, 4);
|
||||
int bExists = 0;
|
||||
|
||||
if( zType==0 || zName==0 ) continue;
|
||||
if( zType[0]=='v' || zType[1]=='r' ){
|
||||
if( zSql ) rc = sqlite3_exec(p->dbv, zSql, 0, 0, pzErrmsg);
|
||||
rc = expertDbContainsObject(p->dbv, zName, &bExists);
|
||||
if( rc || bExists ) continue;
|
||||
|
||||
if( zType[0]=='v' || zType[1]=='r' || bVirtual ){
|
||||
/* A view. Or a trigger on a view. */
|
||||
if( zSql ) rc = expertSchemaSql(p->dbv, zSql, pzErrmsg);
|
||||
}else{
|
||||
IdxTable *pTab;
|
||||
rc = idxGetTableInfo(p->db, zName, &pTab, pzErrmsg);
|
||||
if( rc==SQLITE_OK ){
|
||||
if( rc==SQLITE_OK && ALWAYS(pTab!=0) ){
|
||||
int i;
|
||||
char *zInner = 0;
|
||||
char *zOuter = 0;
|
||||
@@ -1957,12 +2026,18 @@ sqlite3expert *sqlite3_expert_new(sqlite3 *db, char **pzErrmsg){
|
||||
if( rc==SQLITE_OK ){
|
||||
sqlite3_stmt *pSql = 0;
|
||||
rc = idxPrintfPrepareStmt(pNew->db, &pSql, pzErrmsg,
|
||||
"SELECT sql FROM sqlite_schema WHERE name NOT LIKE 'sqlite_%%'"
|
||||
" AND sql NOT LIKE 'CREATE VIRTUAL %%' ORDER BY rowid"
|
||||
"SELECT sql, name, substr(sql,1,14)=='create virtual' COLLATE nocase"
|
||||
" FROM sqlite_schema WHERE substr(name,1,7)!='sqlite_' COLLATE nocase"
|
||||
" ORDER BY 3 DESC, rowid"
|
||||
);
|
||||
while( rc==SQLITE_OK && SQLITE_ROW==sqlite3_step(pSql) ){
|
||||
const char *zSql = (const char*)sqlite3_column_text(pSql, 0);
|
||||
if( zSql ) rc = sqlite3_exec(pNew->dbm, zSql, 0, 0, pzErrmsg);
|
||||
const char *zName = (const char*)sqlite3_column_text(pSql, 1);
|
||||
int bExists = 0;
|
||||
rc = expertDbContainsObject(pNew->dbm, zName, &bExists);
|
||||
if( rc==SQLITE_OK && zSql && bExists==0 ){
|
||||
rc = expertSchemaSql(pNew->dbm, zSql, pzErrmsg);
|
||||
}
|
||||
}
|
||||
idxFinalize(&rc, pSql);
|
||||
}
|
||||
|
||||
+6
-1
@@ -2344,10 +2344,15 @@ static int fts3PoslistPhraseMerge(
|
||||
if( *p1==POS_COLUMN ){
|
||||
p1++;
|
||||
p1 += fts3GetVarint32(p1, &iCol1);
|
||||
/* iCol1==0 indicates corruption. Column 0 does not have a POS_COLUMN
|
||||
** entry, so this is actually end-of-doclist. */
|
||||
if( iCol1==0 ) return 0;
|
||||
}
|
||||
if( *p2==POS_COLUMN ){
|
||||
p2++;
|
||||
p2 += fts3GetVarint32(p2, &iCol2);
|
||||
/* As above, iCol2==0 indicates corruption. */
|
||||
if( iCol2==0 ) return 0;
|
||||
}
|
||||
|
||||
while( 1 ){
|
||||
@@ -5518,7 +5523,7 @@ static int fts3EvalNearTest(Fts3Expr *pExpr, int *pRc){
|
||||
nTmp += p->pRight->pPhrase->doclist.nList;
|
||||
}
|
||||
nTmp += p->pPhrase->doclist.nList;
|
||||
aTmp = sqlite3_malloc64(nTmp*2);
|
||||
aTmp = sqlite3_malloc64(nTmp*2 + FTS3_VARINT_MAX);
|
||||
if( !aTmp ){
|
||||
*pRc = SQLITE_NOMEM;
|
||||
res = 0;
|
||||
|
||||
+16
-17
@@ -319,10 +319,11 @@ static int getNextString(
|
||||
Fts3PhraseToken *pToken;
|
||||
|
||||
p = fts3ReallocOrFree(p, nSpace + ii*sizeof(Fts3PhraseToken));
|
||||
if( !p ) goto no_mem;
|
||||
|
||||
zTemp = fts3ReallocOrFree(zTemp, nTemp + nByte);
|
||||
if( !zTemp ) goto no_mem;
|
||||
if( !zTemp || !p ){
|
||||
rc = SQLITE_NOMEM;
|
||||
goto getnextstring_out;
|
||||
}
|
||||
|
||||
assert( nToken==ii );
|
||||
pToken = &((Fts3Phrase *)(&p[1]))->aToken[ii];
|
||||
@@ -337,9 +338,6 @@ static int getNextString(
|
||||
nToken = ii+1;
|
||||
}
|
||||
}
|
||||
|
||||
pModule->xClose(pCursor);
|
||||
pCursor = 0;
|
||||
}
|
||||
|
||||
if( rc==SQLITE_DONE ){
|
||||
@@ -347,7 +345,10 @@ static int getNextString(
|
||||
char *zBuf = 0;
|
||||
|
||||
p = fts3ReallocOrFree(p, nSpace + nToken*sizeof(Fts3PhraseToken) + nTemp);
|
||||
if( !p ) goto no_mem;
|
||||
if( !p ){
|
||||
rc = SQLITE_NOMEM;
|
||||
goto getnextstring_out;
|
||||
}
|
||||
memset(p, 0, (char *)&(((Fts3Phrase *)&p[1])->aToken[0])-(char *)p);
|
||||
p->eType = FTSQUERY_PHRASE;
|
||||
p->pPhrase = (Fts3Phrase *)&p[1];
|
||||
@@ -355,11 +356,9 @@ static int getNextString(
|
||||
p->pPhrase->nToken = nToken;
|
||||
|
||||
zBuf = (char *)&p->pPhrase->aToken[nToken];
|
||||
assert( nTemp==0 || zTemp );
|
||||
if( zTemp ){
|
||||
memcpy(zBuf, zTemp, nTemp);
|
||||
sqlite3_free(zTemp);
|
||||
}else{
|
||||
assert( nTemp==0 );
|
||||
}
|
||||
|
||||
for(jj=0; jj<p->pPhrase->nToken; jj++){
|
||||
@@ -369,17 +368,17 @@ static int getNextString(
|
||||
rc = SQLITE_OK;
|
||||
}
|
||||
|
||||
*ppExpr = p;
|
||||
return rc;
|
||||
no_mem:
|
||||
|
||||
getnextstring_out:
|
||||
if( pCursor ){
|
||||
pModule->xClose(pCursor);
|
||||
}
|
||||
sqlite3_free(zTemp);
|
||||
sqlite3_free(p);
|
||||
*ppExpr = 0;
|
||||
return SQLITE_NOMEM;
|
||||
if( rc!=SQLITE_OK ){
|
||||
sqlite3_free(p);
|
||||
p = 0;
|
||||
}
|
||||
*ppExpr = p;
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -396,7 +396,6 @@ struct Fts5ExtensionApi {
|
||||
** Applications may also register custom tokenizer types. A tokenizer
|
||||
** is registered by providing fts5 with a populated instance of the
|
||||
** following structure. All structure methods must be defined, setting
|
||||
**
|
||||
** any member of the fts5_tokenizer struct to NULL leads to undefined
|
||||
** behaviour. The structure methods are expected to function as follows:
|
||||
**
|
||||
|
||||
+6
-4
@@ -224,6 +224,7 @@ struct Fts5Config {
|
||||
int *aPrefix; /* Sizes in bytes of nPrefix prefix indexes */
|
||||
int eContent; /* An FTS5_CONTENT value */
|
||||
int bContentlessDelete; /* "contentless_delete=" option (dflt==0) */
|
||||
int bContentlessUnindexed; /* "contentless_unindexed=" option (dflt=0) */
|
||||
char *zContent; /* content table */
|
||||
char *zContentRowid; /* "content_rowid=" option value */
|
||||
int bColumnsize; /* "columnsize=" option value (dflt==1) */
|
||||
@@ -262,9 +263,10 @@ struct Fts5Config {
|
||||
#define FTS5_CURRENT_VERSION 4
|
||||
#define FTS5_CURRENT_VERSION_SECUREDELETE 5
|
||||
|
||||
#define FTS5_CONTENT_NORMAL 0
|
||||
#define FTS5_CONTENT_NONE 1
|
||||
#define FTS5_CONTENT_EXTERNAL 2
|
||||
#define FTS5_CONTENT_NORMAL 0
|
||||
#define FTS5_CONTENT_NONE 1
|
||||
#define FTS5_CONTENT_EXTERNAL 2
|
||||
#define FTS5_CONTENT_UNINDEXED 3
|
||||
|
||||
#define FTS5_DETAIL_FULL 0
|
||||
#define FTS5_DETAIL_NONE 1
|
||||
@@ -724,7 +726,7 @@ int sqlite3Fts5DropAll(Fts5Config*);
|
||||
int sqlite3Fts5CreateTable(Fts5Config*, const char*, const char*, int, char **);
|
||||
|
||||
int sqlite3Fts5StorageDelete(Fts5Storage *p, i64, sqlite3_value**, int);
|
||||
int sqlite3Fts5StorageContentInsert(Fts5Storage *p, sqlite3_value**, i64*);
|
||||
int sqlite3Fts5StorageContentInsert(Fts5Storage *p, int, sqlite3_value**, i64*);
|
||||
int sqlite3Fts5StorageIndexInsert(Fts5Storage *p, sqlite3_value**, i64);
|
||||
|
||||
int sqlite3Fts5StorageIntegrity(Fts5Storage *p, int iArg);
|
||||
|
||||
+41
-5
@@ -241,6 +241,7 @@ static int fts5ConfigParseSpecial(
|
||||
){
|
||||
int rc = SQLITE_OK;
|
||||
int nCmd = (int)strlen(zCmd);
|
||||
|
||||
if( sqlite3_strnicmp("prefix", zCmd, nCmd)==0 ){
|
||||
const int nByte = sizeof(int) * FTS5_MAX_PREFIX_INDEXES;
|
||||
const char *p;
|
||||
@@ -360,6 +361,16 @@ static int fts5ConfigParseSpecial(
|
||||
return rc;
|
||||
}
|
||||
|
||||
if( sqlite3_strnicmp("contentless_unindexed", zCmd, nCmd)==0 ){
|
||||
if( (zArg[0]!='0' && zArg[0]!='1') || zArg[1]!='\0' ){
|
||||
*pzErr = sqlite3_mprintf("malformed contentless_delete=... directive");
|
||||
rc = SQLITE_ERROR;
|
||||
}else{
|
||||
pConfig->bContentlessUnindexed = (zArg[0]=='1');
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
if( sqlite3_strnicmp("content_rowid", zCmd, nCmd)==0 ){
|
||||
if( pConfig->zContentRowid ){
|
||||
*pzErr = sqlite3_mprintf("multiple content_rowid=... directives");
|
||||
@@ -477,7 +488,8 @@ static int fts5ConfigParseColumn(
|
||||
Fts5Config *p,
|
||||
char *zCol,
|
||||
char *zArg,
|
||||
char **pzErr
|
||||
char **pzErr,
|
||||
int *pbUnindexed
|
||||
){
|
||||
int rc = SQLITE_OK;
|
||||
if( 0==sqlite3_stricmp(zCol, FTS5_RANK_NAME)
|
||||
@@ -488,6 +500,7 @@ static int fts5ConfigParseColumn(
|
||||
}else if( zArg ){
|
||||
if( 0==sqlite3_stricmp(zArg, "unindexed") ){
|
||||
p->abUnindexed[p->nCol] = 1;
|
||||
*pbUnindexed = 1;
|
||||
}else{
|
||||
*pzErr = sqlite3_mprintf("unrecognized column option: %s", zArg);
|
||||
rc = SQLITE_ERROR;
|
||||
@@ -508,11 +521,17 @@ static int fts5ConfigMakeExprlist(Fts5Config *p){
|
||||
|
||||
sqlite3Fts5BufferAppendPrintf(&rc, &buf, "T.%Q", p->zContentRowid);
|
||||
if( p->eContent!=FTS5_CONTENT_NONE ){
|
||||
assert( p->eContent==FTS5_CONTENT_EXTERNAL
|
||||
|| p->eContent==FTS5_CONTENT_NORMAL
|
||||
|| p->eContent==FTS5_CONTENT_UNINDEXED
|
||||
);
|
||||
for(i=0; i<p->nCol; i++){
|
||||
if( p->eContent==FTS5_CONTENT_EXTERNAL ){
|
||||
sqlite3Fts5BufferAppendPrintf(&rc, &buf, ", T.%Q", p->azCol[i]);
|
||||
}else{
|
||||
}else if( p->eContent==FTS5_CONTENT_NORMAL || p->abUnindexed[i] ){
|
||||
sqlite3Fts5BufferAppendPrintf(&rc, &buf, ", T.c%d", i);
|
||||
}else{
|
||||
sqlite3Fts5BufferAppendPrintf(&rc, &buf, ", NULL");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -555,6 +574,7 @@ int sqlite3Fts5ConfigParse(
|
||||
Fts5Config *pRet; /* New object to return */
|
||||
int i;
|
||||
sqlite3_int64 nByte;
|
||||
int bUnindexed = 0; /* True if there are one or more UNINDEXED */
|
||||
|
||||
*ppOut = pRet = (Fts5Config*)sqlite3_malloc(sizeof(Fts5Config));
|
||||
if( pRet==0 ) return SQLITE_NOMEM;
|
||||
@@ -614,7 +634,7 @@ int sqlite3Fts5ConfigParse(
|
||||
pzErr
|
||||
);
|
||||
}else{
|
||||
rc = fts5ConfigParseColumn(pRet, zOne, zTwo, pzErr);
|
||||
rc = fts5ConfigParseColumn(pRet, zOne, zTwo, pzErr, &bUnindexed);
|
||||
zOne = 0;
|
||||
}
|
||||
}
|
||||
@@ -646,14 +666,30 @@ int sqlite3Fts5ConfigParse(
|
||||
rc = SQLITE_ERROR;
|
||||
}
|
||||
|
||||
/* We only allow contentless_unindexed=1 if the table is actually a
|
||||
** contentless one.
|
||||
*/
|
||||
if( rc==SQLITE_OK
|
||||
&& pRet->bContentlessUnindexed
|
||||
&& pRet->eContent!=FTS5_CONTENT_NONE
|
||||
){
|
||||
*pzErr = sqlite3_mprintf(
|
||||
"contentless_unindexed=1 requires a contentless table"
|
||||
);
|
||||
rc = SQLITE_ERROR;
|
||||
}
|
||||
|
||||
/* If no zContent option was specified, fill in the default values. */
|
||||
if( rc==SQLITE_OK && pRet->zContent==0 ){
|
||||
const char *zTail = 0;
|
||||
assert( pRet->eContent==FTS5_CONTENT_NORMAL
|
||||
|| pRet->eContent==FTS5_CONTENT_NONE
|
||||
assert( pRet->eContent==FTS5_CONTENT_NORMAL
|
||||
|| pRet->eContent==FTS5_CONTENT_NONE
|
||||
);
|
||||
if( pRet->eContent==FTS5_CONTENT_NORMAL ){
|
||||
zTail = "content";
|
||||
}else if( bUnindexed && pRet->bContentlessUnindexed ){
|
||||
pRet->eContent = FTS5_CONTENT_UNINDEXED;
|
||||
zTail = "content";
|
||||
}else if( pRet->bColumnsize ){
|
||||
zTail = "docsize";
|
||||
}
|
||||
|
||||
+118
-45
@@ -332,10 +332,16 @@ static void fts5CheckTransactionState(Fts5FullTable *p, int op, int iSavepoint){
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Return true if pTab is a contentless table.
|
||||
** Return true if pTab is a contentless table. If parameter bIncludeUnindexed
|
||||
** is true, this includes contentless tables that store UNINDEXED columns
|
||||
** only.
|
||||
*/
|
||||
static int fts5IsContentless(Fts5FullTable *pTab){
|
||||
return pTab->p.pConfig->eContent==FTS5_CONTENT_NONE;
|
||||
static int fts5IsContentless(Fts5FullTable *pTab, int bIncludeUnindexed){
|
||||
int eContent = pTab->p.pConfig->eContent;
|
||||
return (
|
||||
eContent==FTS5_CONTENT_NONE
|
||||
|| (bIncludeUnindexed && eContent==FTS5_CONTENT_UNINDEXED)
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1726,7 +1732,7 @@ static int fts5SpecialInsert(
|
||||
}
|
||||
bLoadConfig = 1;
|
||||
}else if( 0==sqlite3_stricmp("rebuild", zCmd) ){
|
||||
if( pConfig->eContent==FTS5_CONTENT_NONE ){
|
||||
if( fts5IsContentless(pTab, 1) ){
|
||||
fts5SetVtabError(pTab,
|
||||
"'rebuild' may not be used with a contentless fts5 table"
|
||||
);
|
||||
@@ -1795,7 +1801,7 @@ static void fts5StorageInsert(
|
||||
){
|
||||
int rc = *pRc;
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = sqlite3Fts5StorageContentInsert(pTab->pStorage, apVal, piRowid);
|
||||
rc = sqlite3Fts5StorageContentInsert(pTab->pStorage, 0, apVal, piRowid);
|
||||
}
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = sqlite3Fts5StorageIndexInsert(pTab->pStorage, apVal, *piRowid);
|
||||
@@ -1803,6 +1809,67 @@ static void fts5StorageInsert(
|
||||
*pRc = rc;
|
||||
}
|
||||
|
||||
/*
|
||||
**
|
||||
** This function is called when the user attempts an UPDATE on a contentless
|
||||
** table. Parameter bRowidModified is true if the UPDATE statement modifies
|
||||
** the rowid value. Parameter apVal[] contains the new values for each user
|
||||
** defined column of the fts5 table. pConfig is the configuration object of the
|
||||
** table being updated (guaranteed to be contentless). The contentless_delete=1
|
||||
** and contentless_unindexed=1 options may or may not be set.
|
||||
**
|
||||
** This function returns SQLITE_OK if the UPDATE can go ahead, or an SQLite
|
||||
** error code if it cannot. In this case an error message is also loaded into
|
||||
** pConfig. Output parameter (*pbContent) is set to true if the caller should
|
||||
** update the %_content table only - not the FTS index or any other shadow
|
||||
** table. This occurs when an UPDATE modifies only UNINDEXED columns of the
|
||||
** table.
|
||||
**
|
||||
** An UPDATE may proceed if:
|
||||
**
|
||||
** * The only columns modified are UNINDEXED columns, or
|
||||
**
|
||||
** * The contentless_delete=1 option was specified and all of the indexed
|
||||
** columns (not a subset) have been modified.
|
||||
*/
|
||||
static int fts5ContentlessUpdate(
|
||||
Fts5Config *pConfig,
|
||||
sqlite3_value **apVal,
|
||||
int bRowidModified,
|
||||
int *pbContent
|
||||
){
|
||||
int ii;
|
||||
int bSeenIndex = 0; /* Have seen modified indexed column */
|
||||
int bSeenIndexNC = 0; /* Have seen unmodified indexed column */
|
||||
int rc = SQLITE_OK;
|
||||
|
||||
for(ii=0; ii<pConfig->nCol; ii++){
|
||||
if( pConfig->abUnindexed[ii]==0 ){
|
||||
if( sqlite3_value_nochange(apVal[ii]) ){
|
||||
bSeenIndexNC++;
|
||||
}else{
|
||||
bSeenIndex++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( bSeenIndex==0 && bRowidModified==0 ){
|
||||
*pbContent = 1;
|
||||
}else{
|
||||
if( bSeenIndexNC || pConfig->bContentlessDelete==0 ){
|
||||
rc = SQLITE_ERROR;
|
||||
sqlite3Fts5ConfigErrmsg(pConfig,
|
||||
(pConfig->bContentlessDelete ?
|
||||
"%s a subset of columns on fts5 contentless-delete table: %s" :
|
||||
"%s contentless fts5 table: %s")
|
||||
, "cannot UPDATE", pConfig->zName
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
** This function is the implementation of the xUpdate callback used by
|
||||
** FTS3 virtual tables. It is invoked by SQLite each time a row is to be
|
||||
@@ -1889,25 +1956,20 @@ static int fts5UpdateMethod(
|
||||
assert( eType0==SQLITE_INTEGER || eType0==SQLITE_NULL );
|
||||
assert( nArg!=1 || eType0==SQLITE_INTEGER );
|
||||
|
||||
/* Filter out attempts to run UPDATE or DELETE on contentless tables.
|
||||
** This is not suported. Except - they are both supported if the CREATE
|
||||
** VIRTUAL TABLE statement contained "contentless_delete=1". */
|
||||
if( eType0==SQLITE_INTEGER
|
||||
&& pConfig->eContent==FTS5_CONTENT_NONE
|
||||
&& pConfig->bContentlessDelete==0
|
||||
){
|
||||
pTab->p.base.zErrMsg = sqlite3_mprintf(
|
||||
"cannot %s contentless fts5 table: %s",
|
||||
(nArg>1 ? "UPDATE" : "DELETE from"), pConfig->zName
|
||||
);
|
||||
rc = SQLITE_ERROR;
|
||||
}
|
||||
|
||||
/* DELETE */
|
||||
else if( nArg==1 ){
|
||||
i64 iDel = sqlite3_value_int64(apVal[0]); /* Rowid to delete */
|
||||
rc = sqlite3Fts5StorageDelete(pTab->pStorage, iDel, 0, 0);
|
||||
bUpdateOrDelete = 1;
|
||||
if( nArg==1 ){
|
||||
/* It is only possible to DELETE from a contentless table if the
|
||||
** contentless_delete=1 flag is set. */
|
||||
if( fts5IsContentless(pTab, 1) && pConfig->bContentlessDelete==0 ){
|
||||
fts5SetVtabError(pTab,
|
||||
"cannot DELETE from contentless fts5 table: %s", pConfig->zName
|
||||
);
|
||||
rc = SQLITE_ERROR;
|
||||
}else{
|
||||
i64 iDel = sqlite3_value_int64(apVal[0]); /* Rowid to delete */
|
||||
rc = sqlite3Fts5StorageDelete(pTab->pStorage, iDel, 0, 0);
|
||||
bUpdateOrDelete = 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* INSERT or UPDATE */
|
||||
@@ -1941,35 +2003,55 @@ static int fts5UpdateMethod(
|
||||
|
||||
/* UPDATE */
|
||||
else{
|
||||
Fts5Storage *pStorage = pTab->pStorage;
|
||||
i64 iOld = sqlite3_value_int64(apVal[0]); /* Old rowid */
|
||||
i64 iNew = sqlite3_value_int64(apVal[1]); /* New rowid */
|
||||
int bContent = 0; /* Content only update */
|
||||
|
||||
/* If this is a contentless table (including contentless_unindexed=1
|
||||
** tables), check if the UPDATE may proceed. */
|
||||
if( fts5IsContentless(pTab, 1) ){
|
||||
rc = fts5ContentlessUpdate(pConfig, &apVal[2], iOld!=iNew, &bContent);
|
||||
if( rc!=SQLITE_OK ) goto update_out;
|
||||
}
|
||||
|
||||
if( eType1!=SQLITE_INTEGER ){
|
||||
rc = SQLITE_MISMATCH;
|
||||
}else if( iOld!=iNew ){
|
||||
assert( bContent==0 );
|
||||
if( eConflict==SQLITE_REPLACE ){
|
||||
rc = sqlite3Fts5StorageDelete(pTab->pStorage, iOld, 0, 1);
|
||||
rc = sqlite3Fts5StorageDelete(pStorage, iOld, 0, 1);
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = sqlite3Fts5StorageDelete(pTab->pStorage, iNew, 0, 0);
|
||||
rc = sqlite3Fts5StorageDelete(pStorage, iNew, 0, 0);
|
||||
}
|
||||
fts5StorageInsert(&rc, pTab, apVal, pRowid);
|
||||
}else{
|
||||
rc = sqlite3Fts5StorageFindDeleteRow(pTab->pStorage, iOld);
|
||||
rc = sqlite3Fts5StorageFindDeleteRow(pStorage, iOld);
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = sqlite3Fts5StorageContentInsert(pTab->pStorage,apVal,pRowid);
|
||||
rc = sqlite3Fts5StorageContentInsert(pStorage, 0, apVal, pRowid);
|
||||
}
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = sqlite3Fts5StorageDelete(pTab->pStorage, iOld, 0, 1);
|
||||
rc = sqlite3Fts5StorageDelete(pStorage, iOld, 0, 0);
|
||||
}
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = sqlite3Fts5StorageIndexInsert(pTab->pStorage, apVal,*pRowid);
|
||||
rc = sqlite3Fts5StorageIndexInsert(pStorage, apVal, *pRowid);
|
||||
}
|
||||
}
|
||||
}else if( bContent ){
|
||||
/* This occurs when an UPDATE on a contentless table affects *only*
|
||||
** UNINDEXED columns. This is a no-op for contentless_unindexed=0
|
||||
** tables, or a write to the %_content table only for =1 tables. */
|
||||
assert( fts5IsContentless(pTab, 1) );
|
||||
rc = sqlite3Fts5StorageFindDeleteRow(pStorage, iOld);
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = sqlite3Fts5StorageContentInsert(pStorage, 1, apVal, pRowid);
|
||||
}
|
||||
}else{
|
||||
rc = sqlite3Fts5StorageDelete(pTab->pStorage, iOld, 0, 1);
|
||||
rc = sqlite3Fts5StorageDelete(pStorage, iOld, 0, 1);
|
||||
fts5StorageInsert(&rc, pTab, apVal, pRowid);
|
||||
}
|
||||
bUpdateOrDelete = 1;
|
||||
sqlite3Fts5StorageReleaseDeleteRow(pTab->pStorage);
|
||||
sqlite3Fts5StorageReleaseDeleteRow(pStorage);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2170,7 +2252,7 @@ static int fts5ApiColumnText(
|
||||
assert( pCsr->ePlan!=FTS5_PLAN_SPECIAL );
|
||||
if( iCol<0 || iCol>=pTab->pConfig->nCol ){
|
||||
rc = SQLITE_RANGE;
|
||||
}else if( fts5IsContentless((Fts5FullTable*)(pCsr->base.pVtab)) ){
|
||||
}else if( fts5IsContentless((Fts5FullTable*)(pCsr->base.pVtab), 0) ){
|
||||
*pz = 0;
|
||||
*pn = 0;
|
||||
}else{
|
||||
@@ -2203,7 +2285,7 @@ static int fts5CsrPoslist(
|
||||
if( iPhrase<0 || iPhrase>=sqlite3Fts5ExprPhraseCount(pCsr->pExpr) ){
|
||||
rc = SQLITE_RANGE;
|
||||
}else if( pConfig->eDetail!=FTS5_DETAIL_FULL
|
||||
&& pConfig->eContent==FTS5_CONTENT_NONE
|
||||
&& fts5IsContentless((Fts5FullTable*)pCsr->base.pVtab, 1)
|
||||
){
|
||||
*pa = 0;
|
||||
*pn = 0;
|
||||
@@ -2399,7 +2481,7 @@ static int fts5ApiColumnSize(Fts5Context *pCtx, int iCol, int *pnToken){
|
||||
if( pConfig->bColumnsize ){
|
||||
i64 iRowid = fts5CursorRowid(pCsr);
|
||||
rc = sqlite3Fts5StorageDocsize(pTab->pStorage, iRowid, pCsr->aColumnSize);
|
||||
}else if( pConfig->zContent==0 ){
|
||||
}else if( !pConfig->zContent || pConfig->eContent==FTS5_CONTENT_UNINDEXED ){
|
||||
int i;
|
||||
for(i=0; i<pConfig->nCol; i++){
|
||||
if( pConfig->abUnindexed[i]==0 ){
|
||||
@@ -2687,7 +2769,7 @@ static int fts5ApiColumnLocale(
|
||||
rc = SQLITE_RANGE;
|
||||
}else if(
|
||||
pConfig->abUnindexed[iCol]==0
|
||||
&& pConfig->eContent!=FTS5_CONTENT_NONE
|
||||
&& 0==fts5IsContentless((Fts5FullTable*)pCsr->base.pVtab, 1)
|
||||
&& pConfig->bLocale
|
||||
){
|
||||
rc = fts5SeekCursor(pCsr, 0);
|
||||
@@ -2962,16 +3044,7 @@ static int fts5ColumnMethod(
|
||||
}
|
||||
}
|
||||
}else{
|
||||
/* A column created by the user containing values. */
|
||||
int bNochange = sqlite3_vtab_nochange(pCtx);
|
||||
|
||||
if( fts5IsContentless(pTab) ){
|
||||
if( bNochange && pConfig->bContentlessDelete ){
|
||||
fts5ResultError(pCtx, "cannot UPDATE a subset of "
|
||||
"columns on fts5 contentless-delete table: %s", pConfig->zName
|
||||
);
|
||||
}
|
||||
}else if( bNochange==0 || pConfig->eContent!=FTS5_CONTENT_NORMAL ){
|
||||
if( !sqlite3_vtab_nochange(pCtx) && pConfig->eContent!=FTS5_CONTENT_NONE ){
|
||||
pConfig->pzErrmsg = &pTab->p.base.zErrMsg;
|
||||
rc = fts5SeekCursor(pCsr, 1);
|
||||
if( rc==SQLITE_OK ){
|
||||
|
||||
+89
-72
@@ -73,30 +73,6 @@ struct Fts5Storage {
|
||||
#define FTS5_STMT_REPLACE_CONFIG 10
|
||||
#define FTS5_STMT_SCAN 11
|
||||
|
||||
/*
|
||||
** Return a pointer to a buffer obtained from sqlite3_malloc() that contains
|
||||
** nBind comma-separated question marks. e.g. if nBind is passed 5, this
|
||||
** function returns "?,?,?,?,?".
|
||||
**
|
||||
** If *pRc is not SQLITE_OK when this function is called, it is a no-op and
|
||||
** NULL is returned immediately. Or, if the attempt to malloc a buffer
|
||||
** fails, then *pRc is set to SQLITE_NOMEM and NULL is returned. Otherwise,
|
||||
** if it is SQLITE_OK when this function is called and the malloc() succeeds,
|
||||
** *pRc is left unchanged.
|
||||
*/
|
||||
static char *fts5BindingsList(int *pRc, int nBind){
|
||||
char *zBind = sqlite3Fts5MallocZero(pRc, 1 + nBind*2);
|
||||
if( zBind ){
|
||||
int ii;
|
||||
for(ii=0; ii<nBind; ii++){
|
||||
zBind[ii*2] = '?';
|
||||
zBind[ii*2 + 1] = ',';
|
||||
}
|
||||
zBind[ii*2-1] = '\0';
|
||||
}
|
||||
return zBind;
|
||||
}
|
||||
|
||||
/*
|
||||
** Prepare the two insert statements - Fts5Storage.pInsertContent and
|
||||
** Fts5Storage.pInsertDocsize - if they have not already been prepared.
|
||||
@@ -165,23 +141,37 @@ static int fts5StorageGetStmt(
|
||||
);
|
||||
break;
|
||||
|
||||
case FTS5_STMT_INSERT_CONTENT: {
|
||||
int nCol = 0;
|
||||
char *zBind;
|
||||
case FTS5_STMT_INSERT_CONTENT:
|
||||
case FTS5_STMT_REPLACE_CONTENT: {
|
||||
char *zBind = 0;
|
||||
int i;
|
||||
|
||||
nCol = 1 + pC->nCol;
|
||||
if( pC->bLocale ){
|
||||
for(i=0; i<pC->nCol; i++){
|
||||
if( pC->abUnindexed[i]==0 ) nCol++;
|
||||
assert( pC->eContent==FTS5_CONTENT_NORMAL
|
||||
|| pC->eContent==FTS5_CONTENT_UNINDEXED
|
||||
);
|
||||
|
||||
/* Add bindings for the "c*" columns - those that store the actual
|
||||
** table content. If eContent==NORMAL, then there is one binding
|
||||
** for each column. Or, if eContent==UNINDEXED, then there are only
|
||||
** bindings for the UNINDEXED columns. */
|
||||
for(i=0; rc==SQLITE_OK && i<(pC->nCol+1); i++){
|
||||
if( !i || pC->eContent==FTS5_CONTENT_NORMAL || pC->abUnindexed[i-1] ){
|
||||
zBind = sqlite3Fts5Mprintf(&rc, "%z%s?%d", zBind, zBind?",":"",i+1);
|
||||
}
|
||||
}
|
||||
|
||||
zBind = fts5BindingsList(&rc, nCol);
|
||||
if( zBind ){
|
||||
zSql = sqlite3_mprintf(azStmt[eStmt], pC->zDb, pC->zName, zBind);
|
||||
sqlite3_free(zBind);
|
||||
/* Add bindings for any "l*" columns. Only non-UNINDEXED columns
|
||||
** require these. */
|
||||
if( pC->bLocale && pC->eContent==FTS5_CONTENT_NORMAL ){
|
||||
for(i=0; rc==SQLITE_OK && i<pC->nCol; i++){
|
||||
if( pC->abUnindexed[i]==0 ){
|
||||
zBind = sqlite3Fts5Mprintf(&rc, "%z,?%d", zBind, pC->nCol+i+2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
zSql = sqlite3Fts5Mprintf(&rc, azStmt[eStmt], pC->zDb, pC->zName,zBind);
|
||||
sqlite3_free(zBind);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -367,7 +357,9 @@ int sqlite3Fts5StorageOpen(
|
||||
p->pIndex = pIndex;
|
||||
|
||||
if( bCreate ){
|
||||
if( pConfig->eContent==FTS5_CONTENT_NORMAL ){
|
||||
if( pConfig->eContent==FTS5_CONTENT_NORMAL
|
||||
|| pConfig->eContent==FTS5_CONTENT_UNINDEXED
|
||||
){
|
||||
int nDefn = 32 + pConfig->nCol*10;
|
||||
char *zDefn = sqlite3_malloc64(32 + (sqlite3_int64)pConfig->nCol * 20);
|
||||
if( zDefn==0 ){
|
||||
@@ -378,8 +370,12 @@ int sqlite3Fts5StorageOpen(
|
||||
sqlite3_snprintf(nDefn, zDefn, "id INTEGER PRIMARY KEY");
|
||||
iOff = (int)strlen(zDefn);
|
||||
for(i=0; i<pConfig->nCol; i++){
|
||||
sqlite3_snprintf(nDefn-iOff, &zDefn[iOff], ", c%d", i);
|
||||
iOff += (int)strlen(&zDefn[iOff]);
|
||||
if( pConfig->eContent==FTS5_CONTENT_NORMAL
|
||||
|| pConfig->abUnindexed[i]
|
||||
){
|
||||
sqlite3_snprintf(nDefn-iOff, &zDefn[iOff], ", c%d", i);
|
||||
iOff += (int)strlen(&zDefn[iOff]);
|
||||
}
|
||||
}
|
||||
if( pConfig->bLocale ){
|
||||
for(i=0; i<pConfig->nCol; i++){
|
||||
@@ -617,7 +613,9 @@ static int fts5StorageContentlessDelete(Fts5Storage *p, i64 iDel){
|
||||
int rc = SQLITE_OK;
|
||||
|
||||
assert( p->pConfig->bContentlessDelete );
|
||||
assert( p->pConfig->eContent==FTS5_CONTENT_NONE );
|
||||
assert( p->pConfig->eContent==FTS5_CONTENT_NONE
|
||||
|| p->pConfig->eContent==FTS5_CONTENT_UNINDEXED
|
||||
);
|
||||
|
||||
/* Look up the origin of the document in the %_docsize table. Store
|
||||
** this in stack variable iOrigin. */
|
||||
@@ -741,6 +739,12 @@ int sqlite3Fts5StorageDelete(
|
||||
if( rc==SQLITE_OK ){
|
||||
if( p->pConfig->bContentlessDelete ){
|
||||
rc = fts5StorageContentlessDelete(p, iDel);
|
||||
if( rc==SQLITE_OK
|
||||
&& bSaveRow
|
||||
&& p->pConfig->eContent==FTS5_CONTENT_UNINDEXED
|
||||
){
|
||||
rc = sqlite3Fts5StorageFindDeleteRow(p, iDel);
|
||||
}
|
||||
}else{
|
||||
rc = fts5StorageDeleteFromIndex(p, iDel, apVal, bSaveRow);
|
||||
}
|
||||
@@ -757,7 +761,9 @@ int sqlite3Fts5StorageDelete(
|
||||
}
|
||||
|
||||
/* Delete the %_content record */
|
||||
if( pConfig->eContent==FTS5_CONTENT_NORMAL ){
|
||||
if( pConfig->eContent==FTS5_CONTENT_NORMAL
|
||||
|| pConfig->eContent==FTS5_CONTENT_UNINDEXED
|
||||
){
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = fts5StorageGetStmt(p, FTS5_STMT_DELETE_CONTENT, &pDel, 0);
|
||||
}
|
||||
@@ -789,8 +795,13 @@ int sqlite3Fts5StorageDeleteAll(Fts5Storage *p){
|
||||
);
|
||||
if( rc==SQLITE_OK && pConfig->bColumnsize ){
|
||||
rc = fts5ExecPrintf(pConfig->db, 0,
|
||||
"DELETE FROM %Q.'%q_docsize';",
|
||||
pConfig->zDb, pConfig->zName
|
||||
"DELETE FROM %Q.'%q_docsize';", pConfig->zDb, pConfig->zName
|
||||
);
|
||||
}
|
||||
|
||||
if( rc==SQLITE_OK && pConfig->eContent==FTS5_CONTENT_UNINDEXED ){
|
||||
rc = fts5ExecPrintf(pConfig->db, 0,
|
||||
"DELETE FROM %Q.'%q_content';", pConfig->zDb, pConfig->zName
|
||||
);
|
||||
}
|
||||
|
||||
@@ -926,6 +937,7 @@ static int fts5StorageNewRowid(Fts5Storage *p, i64 *piRowid){
|
||||
*/
|
||||
int sqlite3Fts5StorageContentInsert(
|
||||
Fts5Storage *p,
|
||||
int bReplace, /* True to use REPLACE instead of INSERT */
|
||||
sqlite3_value **apVal,
|
||||
i64 *piRowid
|
||||
){
|
||||
@@ -933,7 +945,9 @@ int sqlite3Fts5StorageContentInsert(
|
||||
int rc = SQLITE_OK;
|
||||
|
||||
/* Insert the new row into the %_content table. */
|
||||
if( pConfig->eContent!=FTS5_CONTENT_NORMAL ){
|
||||
if( pConfig->eContent!=FTS5_CONTENT_NORMAL
|
||||
&& pConfig->eContent!=FTS5_CONTENT_UNINDEXED
|
||||
){
|
||||
if( sqlite3_value_type(apVal[1])==SQLITE_INTEGER ){
|
||||
*piRowid = sqlite3_value_int64(apVal[1]);
|
||||
}else{
|
||||
@@ -942,8 +956,10 @@ int sqlite3Fts5StorageContentInsert(
|
||||
}else{
|
||||
sqlite3_stmt *pInsert = 0; /* Statement to write %_content table */
|
||||
int i; /* Counter variable */
|
||||
int nIndexed = 0; /* Number indexed columns seen */
|
||||
rc = fts5StorageGetStmt(p, FTS5_STMT_INSERT_CONTENT, &pInsert, 0);
|
||||
|
||||
assert( FTS5_STMT_INSERT_CONTENT+1==FTS5_STMT_REPLACE_CONTENT );
|
||||
assert( bReplace==0 || bReplace==1 );
|
||||
rc = fts5StorageGetStmt(p, FTS5_STMT_INSERT_CONTENT+bReplace, &pInsert, 0);
|
||||
if( pInsert ) sqlite3_clear_bindings(pInsert);
|
||||
|
||||
/* Bind the rowid value */
|
||||
@@ -953,38 +969,39 @@ int sqlite3Fts5StorageContentInsert(
|
||||
** user-defined column. As is column 1 of pSavedRow. */
|
||||
for(i=2; rc==SQLITE_OK && i<=pConfig->nCol+1; i++){
|
||||
int bUnindexed = pConfig->abUnindexed[i-2];
|
||||
sqlite3_value *pVal = apVal[i];
|
||||
if( pConfig->eContent==FTS5_CONTENT_NORMAL || bUnindexed ){
|
||||
sqlite3_value *pVal = apVal[i];
|
||||
|
||||
nIndexed += !bUnindexed;
|
||||
if( sqlite3_value_nochange(pVal) && p->pSavedRow ){
|
||||
/* This is an UPDATE statement, and column (i-2) was not modified.
|
||||
** Retrieve the value from Fts5Storage.pSavedRow instead. */
|
||||
pVal = sqlite3_column_value(p->pSavedRow, i-1);
|
||||
if( pConfig->bLocale && bUnindexed==0 ){
|
||||
sqlite3_bind_value(pInsert, pConfig->nCol + 1 + nIndexed,
|
||||
sqlite3_column_value(p->pSavedRow, pConfig->nCol + i - 1)
|
||||
);
|
||||
}
|
||||
}else if( sqlite3Fts5IsLocaleValue(pConfig, pVal) ){
|
||||
const char *pText = 0;
|
||||
const char *pLoc = 0;
|
||||
int nText = 0;
|
||||
int nLoc = 0;
|
||||
assert( pConfig->bLocale );
|
||||
|
||||
rc = sqlite3Fts5DecodeLocaleValue(pVal, &pText, &nText, &pLoc, &nLoc);
|
||||
if( rc==SQLITE_OK ){
|
||||
sqlite3_bind_text(pInsert, i, pText, nText, SQLITE_TRANSIENT);
|
||||
if( bUnindexed==0 ){
|
||||
int iLoc = pConfig->nCol + 1 + nIndexed;
|
||||
sqlite3_bind_text(pInsert, iLoc, pLoc, nLoc, SQLITE_TRANSIENT);
|
||||
if( sqlite3_value_nochange(pVal) && p->pSavedRow ){
|
||||
/* This is an UPDATE statement, and user-defined column (i-2) was not
|
||||
** modified. Retrieve the value from Fts5Storage.pSavedRow. */
|
||||
pVal = sqlite3_column_value(p->pSavedRow, i-1);
|
||||
if( pConfig->bLocale && bUnindexed==0 ){
|
||||
sqlite3_bind_value(pInsert, pConfig->nCol + i,
|
||||
sqlite3_column_value(p->pSavedRow, pConfig->nCol + i - 1)
|
||||
);
|
||||
}
|
||||
}else if( sqlite3Fts5IsLocaleValue(pConfig, pVal) ){
|
||||
const char *pText = 0;
|
||||
const char *pLoc = 0;
|
||||
int nText = 0;
|
||||
int nLoc = 0;
|
||||
assert( pConfig->bLocale );
|
||||
|
||||
rc = sqlite3Fts5DecodeLocaleValue(pVal, &pText, &nText, &pLoc, &nLoc);
|
||||
if( rc==SQLITE_OK ){
|
||||
sqlite3_bind_text(pInsert, i, pText, nText, SQLITE_TRANSIENT);
|
||||
if( bUnindexed==0 ){
|
||||
int iLoc = pConfig->nCol + i;
|
||||
sqlite3_bind_text(pInsert, iLoc, pLoc, nLoc, SQLITE_TRANSIENT);
|
||||
}
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
continue;
|
||||
rc = sqlite3_bind_value(pInsert, i, pVal);
|
||||
}
|
||||
|
||||
rc = sqlite3_bind_value(pInsert, i, pVal);
|
||||
}
|
||||
if( rc==SQLITE_OK ){
|
||||
sqlite3_step(pInsert);
|
||||
|
||||
@@ -198,7 +198,7 @@ static const unsigned char sqlite3Utf8Trans1[] = {
|
||||
c = *(zIn++); \
|
||||
if( c>=0xc0 ){ \
|
||||
c = sqlite3Utf8Trans1[c-0xc0]; \
|
||||
while( zIn!=zTerm && (*zIn & 0xc0)==0x80 ){ \
|
||||
while( zIn<zTerm && (*zIn & 0xc0)==0x80 ){ \
|
||||
c = (c<<6) + (0x3f & *(zIn++)); \
|
||||
} \
|
||||
if( c<0x80 \
|
||||
|
||||
@@ -113,5 +113,58 @@ do_execsql_test 3.4 {
|
||||
INSERT INTO tx(tx) VALUES('integrity-check');
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
reset_db
|
||||
do_execsql_test 4.0 {
|
||||
CREATE VIRTUAL TABLE ft1 USING fts5(a, b UNINDEXED,
|
||||
content='', contentless_unindexed=1
|
||||
);
|
||||
CREATE VIRTUAL TABLE ft2 USING fts5(a, b UNINDEXED,
|
||||
content='', contentless_unindexed=1, contentless_delete=1
|
||||
);
|
||||
|
||||
INSERT INTO ft1(rowid, a, b) VALUES(1, 'one', 'i');
|
||||
INSERT INTO ft1(rowid, a, b) VALUES(2, 'two', 'ii');
|
||||
INSERT INTO ft1(rowid, a, b) VALUES(3, 'three', 'iii');
|
||||
INSERT INTO ft2(rowid, a, b) VALUES(1, 'one', 'i');
|
||||
INSERT INTO ft2(rowid, a, b) VALUES(2, 'two', 'ii');
|
||||
INSERT INTO ft2(rowid, a, b) VALUES(3, 'three', 'iii');
|
||||
}
|
||||
|
||||
do_catchsql_test 4.1 {
|
||||
DELETE FROM ft1 WHERE rowid=2
|
||||
} {1 {cannot DELETE from contentless fts5 table: ft1}}
|
||||
do_catchsql_test 4.2 {
|
||||
DELETE FROM ft2 WHERE rowid=2
|
||||
} {0 {}}
|
||||
|
||||
do_catchsql_test 4.3 {
|
||||
INSERT INTO ft1(ft1, rowid, a) VALUES('delete', 2, 'two');
|
||||
} {0 {}}
|
||||
do_catchsql_test 4.2 {
|
||||
INSERT INTO ft2(ft2, rowid, a) VALUES('delete', 2, 'two');
|
||||
} {1 {'delete' may not be used with a contentless_delete=1 table}}
|
||||
|
||||
do_execsql_test 4.3 {
|
||||
SELECT rowid, * FROM ft1;
|
||||
} {
|
||||
1 {} i
|
||||
3 {} iii
|
||||
}
|
||||
do_execsql_test 4.4 {
|
||||
SELECT rowid, * FROM ft2;
|
||||
} {
|
||||
1 {} i
|
||||
3 {} iii
|
||||
}
|
||||
|
||||
do_execsql_test 4.5 {
|
||||
SELECT * FROM ft1_content
|
||||
} {1 i 3 iii}
|
||||
|
||||
do_execsql_test 4.6 {
|
||||
SELECT * FROM ft2_content
|
||||
} {1 i 3 iii}
|
||||
|
||||
finish_test
|
||||
|
||||
|
||||
@@ -0,0 +1,297 @@
|
||||
# 2024 Sep 13
|
||||
#
|
||||
# The author disclaims copyright to this source code. In place of
|
||||
# a legal notice, here is a blessing:
|
||||
#
|
||||
# May you do good and not evil.
|
||||
# May you find forgiveness for yourself and forgive others.
|
||||
# May you share freely, never taking more than you give.
|
||||
#
|
||||
#***********************************************************************
|
||||
#
|
||||
# The tests in this file focus on "unindexed" columns in contentless
|
||||
# tables.
|
||||
#
|
||||
|
||||
source [file join [file dirname [info script]] fts5_common.tcl]
|
||||
set testprefix fts5unindexed2
|
||||
|
||||
# If SQLITE_ENABLE_FTS5 is not defined, omit this file.
|
||||
ifcapable !fts5 {
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
do_execsql_test 1.1 {
|
||||
CREATE VIRTUAL TABLE t1 USING fts5(
|
||||
a, b UNINDEXED, content=, contentless_unindexed=1
|
||||
);
|
||||
} {}
|
||||
|
||||
do_execsql_test 1.2 {
|
||||
INSERT INTO t1 VALUES('abc def', 'ghi jkl');
|
||||
}
|
||||
|
||||
do_execsql_test 1.3 {
|
||||
SELECT rowid, a, b FROM t1
|
||||
} {1 {} {ghi jkl}}
|
||||
|
||||
do_execsql_test 1.4 {
|
||||
INSERT INTO t1(rowid, a, b) VALUES(11, 'hello world', 'one two three');
|
||||
}
|
||||
|
||||
do_execsql_test 1.5 {
|
||||
INSERT INTO t1(t1, rowid, a, b) VALUES('delete', 1, 'abc def', 'ghi jkl');
|
||||
}
|
||||
|
||||
do_execsql_test 1.6 {
|
||||
SELECT rowid, a, b FROM t1
|
||||
} {
|
||||
11 {} {one two three}
|
||||
}
|
||||
|
||||
do_execsql_test 1.7 {
|
||||
PRAGMA integrity_check
|
||||
} {ok}
|
||||
|
||||
do_execsql_test 1.8 {
|
||||
INSERT INTO t1(rowid, a, b) VALUES(12, 'abc def', 'ghi jkl');
|
||||
}
|
||||
|
||||
do_execsql_test 1.9 {
|
||||
SELECT rowid, a, b FROM t1('def')
|
||||
} {12 {} {ghi jkl}}
|
||||
|
||||
do_execsql_test 1.10 {
|
||||
SELECT rowid, a, b FROM t1('def OR hello') ORDER BY rank
|
||||
} {11 {} {one two three} 12 {} {ghi jkl}}
|
||||
|
||||
do_execsql_test 1.11 {
|
||||
SELECT rowid, a, b FROM t1 WHERE rowid=11
|
||||
} {11 {} {one two three}}
|
||||
|
||||
do_execsql_test 1.12 {
|
||||
SELECT rowid, a, b FROM t1
|
||||
} {11 {} {one two three} 12 {} {ghi jkl}}
|
||||
|
||||
|
||||
fts5_aux_test_functions db
|
||||
do_execsql_test 1.12.2 {
|
||||
SELECT rowid, fts5_test_columntext(t1) FROM t1('def OR hello')
|
||||
} {11 {{} {one two three}} 12 {{} {ghi jkl}}}
|
||||
|
||||
do_execsql_test 1.13 {
|
||||
INSERT INTO t1(t1) VALUES('delete-all');
|
||||
}
|
||||
|
||||
do_execsql_test 1.14 {
|
||||
SELECT rowid, a, b FROM t1
|
||||
}
|
||||
|
||||
do_execsql_test 1.15 {
|
||||
PRAGMA integrity_check
|
||||
} {ok}
|
||||
|
||||
do_execsql_test 2.0 {
|
||||
CREATE VIRTUAL TABLE t4 USING fts5(
|
||||
x, y UNINDEXED, z, columnsize=0, content='', contentless_unindexed=1
|
||||
);
|
||||
}
|
||||
|
||||
do_execsql_test 2.1 {
|
||||
INSERT INTO t4(rowid, x, y, z) VALUES(1, 'a a', 'b b b', 'c');
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
reset_db
|
||||
|
||||
do_execsql_test 3.0 {
|
||||
CREATE VIRTUAL TABLE x1 USING fts5(
|
||||
a UNINDEXED, b, c UNINDEXED, d, content=, contentless_delete=1,
|
||||
contentless_unindexed=1
|
||||
);
|
||||
}
|
||||
|
||||
do_execsql_test 3.1 {
|
||||
INSERT INTO x1(rowid, a, b, c, d) VALUES(131, 'aaa', 'bbb', 'ccc', 'ddd');
|
||||
}
|
||||
|
||||
do_execsql_test 3.2 {
|
||||
SELECT * FROM x1
|
||||
} {aaa {} ccc {}}
|
||||
|
||||
do_execsql_test 3.3 {
|
||||
INSERT INTO x1(rowid, a, b, c, d) VALUES(1000, 'AAA', 'BBB', 'CCC', 'DDD');
|
||||
}
|
||||
|
||||
do_execsql_test 3.4 {
|
||||
SELECT rowid, * FROM x1
|
||||
} {
|
||||
131 aaa {} ccc {}
|
||||
1000 AAA {} CCC {}
|
||||
}
|
||||
|
||||
do_execsql_test 3.5 {
|
||||
DELETE FROM x1 WHERE rowid=131;
|
||||
SELECT rowid, * FROM x1
|
||||
} {
|
||||
1000 AAA {} CCC {}
|
||||
}
|
||||
|
||||
do_execsql_test 3.6 {
|
||||
INSERT INTO x1(rowid, a, b, c, d) VALUES(112, 'aaa', 'bbb', 'ccc', 'ddd');
|
||||
SELECT rowid, * FROM x1
|
||||
} {
|
||||
112 aaa {} ccc {}
|
||||
1000 AAA {} CCC {}
|
||||
}
|
||||
|
||||
do_execsql_test 3.7 {
|
||||
UPDATE x1 SET b='hello', d='world', rowid=1120 WHERE rowid=112
|
||||
}
|
||||
|
||||
do_execsql_test 3.8 {
|
||||
SELECT rowid, * FROM x1
|
||||
} {
|
||||
1000 AAA {} CCC {}
|
||||
1120 aaa {} ccc {}
|
||||
}
|
||||
|
||||
do_execsql_test 3.9 {
|
||||
SELECT rowid, * FROM x1('hello');
|
||||
} {
|
||||
1120 aaa {} ccc {}
|
||||
}
|
||||
|
||||
do_execsql_test 3.9 {
|
||||
SELECT rowid, * FROM x1('bbb');
|
||||
} {
|
||||
1000 AAA {} CCC {}
|
||||
}
|
||||
|
||||
fts5_aux_test_functions db
|
||||
do_execsql_test 3.10 {
|
||||
SELECT rowid, fts5_test_columntext(x1) FROM x1('b*')
|
||||
} {1000 {AAA {} CCC {}}}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# Check that if contentless_unindexed=1 is not specified, the values
|
||||
# of UNINDEXED columns are not stored in the database.
|
||||
#
|
||||
# Also check that contentless_unindexed=1 is not allowed unless the table
|
||||
# is actually contentless.
|
||||
#
|
||||
reset_db
|
||||
do_execsql_test 4.0 {
|
||||
CREATE VIRTUAL TABLE ft USING fts5(a, b, c UNINDEXED, content='');
|
||||
INSERT INTO ft VALUES('one', 'two', 'three');
|
||||
SELECT rowid, * FROM ft;
|
||||
} {1 {} {} {}}
|
||||
|
||||
do_execsql_test 4.1 {
|
||||
SELECT name FROM sqlite_schema ORDER BY 1
|
||||
} {
|
||||
ft ft_config ft_data ft_docsize ft_idx
|
||||
}
|
||||
|
||||
do_catchsql_test 4.2 {
|
||||
CREATE VIRTUAL TABLE ft2 USING fts5(
|
||||
a, b, c UNINDEXED, contentless_unindexed=1
|
||||
);
|
||||
} {1 {contentless_unindexed=1 requires a contentless table}}
|
||||
|
||||
do_catchsql_test 4.3 {
|
||||
DELETE FROM ft WHERE rowid=1
|
||||
} {1 {cannot DELETE from contentless fts5 table: ft}}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# Check that the usual restrictions on contentless tables apply to
|
||||
# contentless_unindexed=1 tables.
|
||||
#
|
||||
reset_db
|
||||
do_execsql_test 5.0 {
|
||||
CREATE VIRTUAL TABLE ft USING fts5(
|
||||
a, b UNINDEXED, c, content='', contentless_unindexed=1
|
||||
);
|
||||
INSERT INTO ft VALUES('one', 'two', 'three');
|
||||
INSERT INTO ft VALUES('four', 'five', 'six');
|
||||
INSERT INTO ft VALUES('seven', 'eight', 'nine');
|
||||
SELECT rowid, * FROM ft;
|
||||
} {
|
||||
1 {} two {}
|
||||
2 {} five {}
|
||||
3 {} eight {}
|
||||
}
|
||||
|
||||
do_execsql_test 5.1 {
|
||||
PRAGMA integrity_check
|
||||
} {ok}
|
||||
|
||||
do_catchsql_test 5.2 {
|
||||
DELETE FROM ft WHERE rowid=2
|
||||
} {1 {cannot DELETE from contentless fts5 table: ft}}
|
||||
|
||||
do_execsql_test 5.3 {
|
||||
SELECT rowid, * FROM ft('six')
|
||||
} {
|
||||
2 {} five {}
|
||||
}
|
||||
|
||||
do_catchsql_test 5.4 {
|
||||
UPDATE ft SET a='x', b='y', c='z' WHERE rowid=3
|
||||
} {1 {cannot UPDATE contentless fts5 table: ft}}
|
||||
|
||||
fts5_aux_test_functions db
|
||||
|
||||
do_execsql_test 5.5 {
|
||||
SELECT fts5_test_columntext(ft) FROM ft WHERE rowid=3
|
||||
} {
|
||||
{{} eight {}}
|
||||
}
|
||||
do_execsql_test 5.6 {
|
||||
SELECT fts5_test_columntext(ft) FROM ft('three');
|
||||
} {
|
||||
{{} two {}}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# Check that it is possible to UPDATE a contentless_unindexed=1 table
|
||||
# if the only columns being modified are UNINDEXED.
|
||||
#
|
||||
# If the contentless_unindexed=1 table is also contentless_delete=1, then
|
||||
# it is also possible to update indexed columns - but only if *all* indexed
|
||||
# columns are updated.
|
||||
#
|
||||
reset_db
|
||||
do_execsql_test 6.0 {
|
||||
CREATE VIRTUAL TABLE ft1 USING fts5(a, b UNINDEXED, c UNINDEXED, d,
|
||||
contentless_unindexed=1, content=''
|
||||
);
|
||||
|
||||
INSERT INTO ft1(rowid, a, b, c, d) VALUES
|
||||
(100, 'x y', 'b1', 'c1', 'a b'),
|
||||
(200, 'c d', 'b2', 'c2', 'a b'),
|
||||
(300, 'e f', 'b3', 'c3', 'a b');
|
||||
}
|
||||
|
||||
do_execsql_test 6.1 {
|
||||
UPDATE ft1 SET b='b1.1', c='c1.1' WHERE rowid=100;
|
||||
}
|
||||
do_execsql_test 6.2 {
|
||||
UPDATE ft1 SET b='b2.1' WHERE rowid=200;
|
||||
}
|
||||
do_execsql_test 6.3 {
|
||||
UPDATE ft1 SET c='c3.1' WHERE rowid=300;
|
||||
}
|
||||
|
||||
do_execsql_test 6.4 {
|
||||
SELECT rowid, a, b, c, d FROM ft1
|
||||
} {
|
||||
100 {} b1.1 c1.1 {}
|
||||
200 {} b2.1 c2 {}
|
||||
300 {} b3 c3.1 {}
|
||||
}
|
||||
|
||||
finish_test
|
||||
|
||||
@@ -0,0 +1,177 @@
|
||||
# 2024 Sep 27
|
||||
#
|
||||
# The author disclaims copyright to this source code. In place of
|
||||
# a legal notice, here is a blessing:
|
||||
#
|
||||
# May you do good and not evil.
|
||||
# May you find forgiveness for yourself and forgive others.
|
||||
# May you share freely, never taking more than you give.
|
||||
#
|
||||
#*************************************************************************
|
||||
# This file implements regression tests for SQLite library. The
|
||||
# focus of this script is testing the FTS5 module.
|
||||
#
|
||||
|
||||
source [file join [file dirname [info script]] fts5_common.tcl]
|
||||
set testprefix fts5update2
|
||||
|
||||
# If SQLITE_ENABLE_FTS5 is not defined, omit this file.
|
||||
ifcapable !fts5 {
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# Test that the various types of UPDATE statement are handled correctly
|
||||
# by different table types.
|
||||
#
|
||||
foreach_detail_mode $testprefix {
|
||||
foreach {tn cu} {
|
||||
1 0
|
||||
2 1
|
||||
} {
|
||||
reset_db
|
||||
do_execsql_test 1.$tn.1 "
|
||||
CREATE VIRTUAL TABLE ft1 USING fts5(a, b UNINDEXED, c UNINDEXED, d,
|
||||
content='',
|
||||
contentless_unindexed=$cu,
|
||||
detail=%DETAIL%
|
||||
);
|
||||
CREATE VIRTUAL TABLE ft2 USING fts5(a, b UNINDEXED, c UNINDEXED, d,
|
||||
content='',
|
||||
contentless_unindexed=$cu, contentless_delete=1,
|
||||
detail=%DETAIL%
|
||||
);
|
||||
"
|
||||
|
||||
do_execsql_test 1.$tn.2 {
|
||||
INSERT INTO ft1(rowid, a, b, c, d) VALUES(1, 'a1', 'b1', 'c1', 'd1');
|
||||
INSERT INTO ft1(rowid, a, b, c, d) VALUES(2, 'a2', 'b2', 'c2', 'd2');
|
||||
INSERT INTO ft1(rowid, a, b, c, d) VALUES(3, 'a3', 'b3', 'c3', 'd3');
|
||||
|
||||
INSERT INTO ft2(rowid, a, b, c, d) VALUES(1, 'a1', 'b1', 'c1', 'd1');
|
||||
INSERT INTO ft2(rowid, a, b, c, d) VALUES(2, 'a2', 'b2', 'c2', 'd2');
|
||||
INSERT INTO ft2(rowid, a, b, c, d) VALUES(3, 'a3', 'b3', 'c3', 'd3');
|
||||
}
|
||||
|
||||
# It should be possible to update a subset of the UNINDEXED columns of
|
||||
# a contentless table. Regardless of whether or not contentless_unindexed=1
|
||||
# or contentless_delete=1 is set.
|
||||
do_execsql_test 1.$tn.3 {
|
||||
UPDATE ft1 SET b=b||'.1';
|
||||
UPDATE ft2 SET b=b||'.1';
|
||||
}
|
||||
do_execsql_test 1.$tn.4 {
|
||||
UPDATE ft1 SET b=b||'.2', c=c||'.2';
|
||||
UPDATE ft2 SET b=b||'.2', c=c||'.2';
|
||||
}
|
||||
|
||||
set res(0) {
|
||||
1 {} {} {} {}
|
||||
2 {} {} {} {}
|
||||
3 {} {} {} {}
|
||||
}
|
||||
set res(1) {
|
||||
1 {} b1.1.2 c1.2 {}
|
||||
2 {} b2.1.2 c2.2 {}
|
||||
3 {} b3.1.2 c3.2 {}
|
||||
}
|
||||
|
||||
do_execsql_test 1.$tn.5 {
|
||||
SELECT rowid, * FROM ft2
|
||||
} $res($cu)
|
||||
|
||||
do_execsql_test 1.6.1 { SELECT rowid FROM ft1('a2') } {2}
|
||||
do_execsql_test 1.6.2 { SELECT rowid FROM ft2('a2') } {2}
|
||||
|
||||
# It should be possible to update all indexed columns (but no other subset)
|
||||
# if the contentless_delete=1 option is set, as it is for "ft2".
|
||||
do_execsql_test 1.$tn.7 {
|
||||
UPDATE ft2 SET a='a22', d='d22' WHERE rowid=2;
|
||||
}
|
||||
do_execsql_test 1.$tn.8 { SELECT rowid FROM ft2('a22 AND d22') } {2}
|
||||
|
||||
do_execsql_test 1.$tn.9 {
|
||||
UPDATE ft2 SET a='a33', d='d33', b='b3' WHERE rowid=3;
|
||||
}
|
||||
|
||||
set res(1) {
|
||||
1 {} b1.1.2 c1.2 {}
|
||||
2 {} b2.1.2 c2.2 {}
|
||||
3 {} b3 c3.2 {}
|
||||
}
|
||||
do_execsql_test 1.$tn.10 {
|
||||
SELECT rowid, * FROM ft2
|
||||
} $res($cu)
|
||||
|
||||
do_catchsql_test 1.$tn.11 {
|
||||
UPDATE ft2 SET a='a11' WHERE rowid=1
|
||||
} {1 {cannot UPDATE a subset of columns on fts5 contentless-delete table: ft2}}
|
||||
do_catchsql_test 1.$tn.12 {
|
||||
UPDATE ft2 SET d='d11' WHERE rowid=1
|
||||
} {1 {cannot UPDATE a subset of columns on fts5 contentless-delete table: ft2}}
|
||||
|
||||
# It is not possible to update the values of indexed columns if
|
||||
# contentless_delete=1 is not set.
|
||||
do_catchsql_test 1.$tn.13 {
|
||||
UPDATE ft1 SET a='a11' WHERE rowid=1
|
||||
} {1 {cannot UPDATE contentless fts5 table: ft1}}
|
||||
do_catchsql_test 1.$tn.14 {
|
||||
UPDATE ft1 SET d='d11' WHERE rowid=1
|
||||
} {1 {cannot UPDATE contentless fts5 table: ft1}}
|
||||
|
||||
# It should be possible to update the rowid if contentless_delete=1 is
|
||||
# set and all indexed columns are updated.
|
||||
do_execsql_test 1.$tn.15 {
|
||||
UPDATE ft2 SET a='aXone', d='dXone', rowid=11 WHERE rowid=1
|
||||
}
|
||||
|
||||
set res(0) {
|
||||
2 {} {} {} {}
|
||||
3 {} {} {} {}
|
||||
11 {} {} {} {}
|
||||
}
|
||||
set res(1) {
|
||||
2 {} b2.1.2 c2.2 {}
|
||||
3 {} b3 c3.2 {}
|
||||
11 {} b1.1.2 c1.2 {}
|
||||
}
|
||||
do_execsql_test 1.$tn.16 {
|
||||
SELECT rowid, * FROM ft2
|
||||
} $res($cu)
|
||||
|
||||
# Should not be possible to update the rowid of a contentless_delete=1
|
||||
# table if no indexed columns are updated.
|
||||
do_catchsql_test 1.$tn.17 {
|
||||
UPDATE ft2 SET rowid=12 WHERE rowid=11
|
||||
} {1 {cannot UPDATE a subset of columns on fts5 contentless-delete table: ft2}}
|
||||
do_catchsql_test 1.$tn.18 {
|
||||
UPDATE ft1 SET rowid=12 WHERE rowid=1
|
||||
} {1 {cannot UPDATE contentless fts5 table: ft1}}
|
||||
|
||||
do_execsql_test 1.$tn.19 {
|
||||
UPDATE ft2 SET a='aXtwo', d='dXtwo', c='newval', rowid=12 WHERE rowid=2
|
||||
} {}
|
||||
|
||||
set res(0) {
|
||||
3 {} {} {} {}
|
||||
11 {} {} {} {}
|
||||
12 {} {} {} {}
|
||||
}
|
||||
set res(1) {
|
||||
3 {} b3 c3.2 {}
|
||||
11 {} b1.1.2 c1.2 {}
|
||||
12 {} b2.1.2 newval {}
|
||||
}
|
||||
do_execsql_test 1.$tn.20 {
|
||||
SELECT rowid, * FROM ft2
|
||||
} $res($cu)
|
||||
|
||||
do_execsql_test 1.$tn.21 {
|
||||
SELECT rowid, * FROM ft2('aXtwo AND dXtwo')
|
||||
} [lrange $res($cu) 10 end]
|
||||
|
||||
}} ;# end of [foreach_detail_mode] loop
|
||||
|
||||
finish_test
|
||||
@@ -23,7 +23,27 @@ set G(src) [string map [list %dir% $srcdir] {
|
||||
}]
|
||||
|
||||
set G(hdr) {
|
||||
|
||||
/*
|
||||
** This, the "fts5.c" source file, is a composite file that is itself
|
||||
** assembled from the following files:
|
||||
**
|
||||
** fts5.h
|
||||
** fts5Int.h
|
||||
** fts5parse.h <--- Generated from fts5parse.y by Lemon
|
||||
** fts5parse.c <--- Generated from fts5parse.y by Lemon
|
||||
** fts5_aux.c
|
||||
** fts5_buffer.c
|
||||
** fts5_config.c
|
||||
** fts5_expr.c
|
||||
** fts5_hash.c
|
||||
** fts5_index.c
|
||||
** fts5_main.c
|
||||
** fts5_storage.c
|
||||
** fts5_tokenize.c
|
||||
** fts5_unicode2.c
|
||||
** fts5_varint.c
|
||||
** fts5_vocab.c
|
||||
*/
|
||||
#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS5)
|
||||
|
||||
#if !defined(NDEBUG) && !defined(SQLITE_DEBUG)
|
||||
@@ -33,10 +53,16 @@ set G(hdr) {
|
||||
# undef NDEBUG
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STDINT_H
|
||||
#include <stdint.h>
|
||||
#endif
|
||||
#ifdef HAVE_INTTYPES_H
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
}
|
||||
|
||||
set G(footer) {
|
||||
|
||||
/* Here ends the fts5.c composite file. */
|
||||
#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS5) */
|
||||
}
|
||||
|
||||
|
||||
@@ -484,10 +484,10 @@ int sqlite3_percentile_init(
|
||||
){
|
||||
int rc = SQLITE_OK;
|
||||
unsigned int i;
|
||||
#if defined(SQLITE3_H) || defined(SQLITE_STATIC_PERCENTILE)
|
||||
(void)pApi; /* Unused parameter */
|
||||
#else
|
||||
#ifdef SQLITE3EXT_H
|
||||
SQLITE_EXTENSION_INIT2(pApi);
|
||||
#else
|
||||
(void)pApi; /* Unused parameter */
|
||||
#endif
|
||||
(void)pzErrMsg; /* Unused parameter */
|
||||
for(i=0; i<sizeof(aPercentFunc)/sizeof(aPercentFunc[0]); i++){
|
||||
|
||||
+48
-40
@@ -658,46 +658,54 @@ static int seriesBestIndex(
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if( pConstraint->iColumn==SERIES_COLUMN_VALUE ){
|
||||
switch( op ){
|
||||
case SQLITE_INDEX_CONSTRAINT_EQ:
|
||||
case SQLITE_INDEX_CONSTRAINT_IS: {
|
||||
idxNum |= 0x0080;
|
||||
idxNum &= ~0x3300;
|
||||
aIdx[5] = i;
|
||||
aIdx[6] = -1;
|
||||
bStartSeen = 1;
|
||||
break;
|
||||
}
|
||||
case SQLITE_INDEX_CONSTRAINT_GE: {
|
||||
if( idxNum & 0x0080 ) break;
|
||||
idxNum |= 0x0100;
|
||||
idxNum &= ~0x0200;
|
||||
aIdx[5] = i;
|
||||
bStartSeen = 1;
|
||||
break;
|
||||
}
|
||||
case SQLITE_INDEX_CONSTRAINT_GT: {
|
||||
if( idxNum & 0x0080 ) break;
|
||||
idxNum |= 0x0200;
|
||||
idxNum &= ~0x0100;
|
||||
aIdx[5] = i;
|
||||
bStartSeen = 1;
|
||||
break;
|
||||
}
|
||||
case SQLITE_INDEX_CONSTRAINT_LE: {
|
||||
if( idxNum & 0x0080 ) break;
|
||||
idxNum |= 0x1000;
|
||||
idxNum &= ~0x2000;
|
||||
aIdx[6] = i;
|
||||
break;
|
||||
}
|
||||
case SQLITE_INDEX_CONSTRAINT_LT: {
|
||||
if( idxNum & 0x0080 ) break;
|
||||
idxNum |= 0x2000;
|
||||
idxNum &= ~0x1000;
|
||||
aIdx[6] = i;
|
||||
break;
|
||||
if( pConstraint->iColumn<SERIES_COLUMN_START ){
|
||||
if( pConstraint->iColumn==SERIES_COLUMN_VALUE && pConstraint->usable ){
|
||||
switch( op ){
|
||||
case SQLITE_INDEX_CONSTRAINT_EQ:
|
||||
case SQLITE_INDEX_CONSTRAINT_IS: {
|
||||
idxNum |= 0x0080;
|
||||
idxNum &= ~0x3300;
|
||||
aIdx[5] = i;
|
||||
aIdx[6] = -1;
|
||||
#ifndef ZERO_ARGUMENT_GENERATE_SERIES
|
||||
bStartSeen = 1;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case SQLITE_INDEX_CONSTRAINT_GE: {
|
||||
if( idxNum & 0x0080 ) break;
|
||||
idxNum |= 0x0100;
|
||||
idxNum &= ~0x0200;
|
||||
aIdx[5] = i;
|
||||
#ifndef ZERO_ARGUMENT_GENERATE_SERIES
|
||||
bStartSeen = 1;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case SQLITE_INDEX_CONSTRAINT_GT: {
|
||||
if( idxNum & 0x0080 ) break;
|
||||
idxNum |= 0x0200;
|
||||
idxNum &= ~0x0100;
|
||||
aIdx[5] = i;
|
||||
#ifndef ZERO_ARGUMENT_GENERATE_SERIES
|
||||
bStartSeen = 1;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case SQLITE_INDEX_CONSTRAINT_LE: {
|
||||
if( idxNum & 0x0080 ) break;
|
||||
idxNum |= 0x1000;
|
||||
idxNum &= ~0x2000;
|
||||
aIdx[6] = i;
|
||||
break;
|
||||
}
|
||||
case SQLITE_INDEX_CONSTRAINT_LT: {
|
||||
if( idxNum & 0x0080 ) break;
|
||||
idxNum |= 0x2000;
|
||||
idxNum &= ~0x1000;
|
||||
aIdx[6] = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
continue;
|
||||
|
||||
+92
-28
@@ -31,27 +31,21 @@
|
||||
#include <fcntl.h>
|
||||
|
||||
/*
|
||||
** If the SQLITE_U8TEXT_ONLY option is defined, then only use
|
||||
** _O_U8TEXT, _O_WTEXT, and similar together with the UTF-16
|
||||
** interfaces to the Windows CRT. The use of ANSI-only routines
|
||||
** like fputs() and ANSI modes like _O_TEXT and _O_BINARY is
|
||||
** avoided.
|
||||
** If the SQLITE_U8TEXT_ONLY option is defined, then use O_U8TEXT
|
||||
** when appropriate on all output. (Sometimes use O_BINARY when
|
||||
** rendering ASCII text in cases where NL-to-CRLF expansion would
|
||||
** not be correct.)
|
||||
**
|
||||
** The downside of using SQLITE_U8TEXT_ONLY is that it becomes
|
||||
** impossible to output a bare newline character (0x0a) - that is,
|
||||
** a newline that is not preceded by a carriage return (0x0d).
|
||||
** And without that capability, sometimes the output will be slightly
|
||||
** incorrect, as extra 0x0d characters will have been inserted where
|
||||
** they do not belong.
|
||||
** If the SQLITE_U8TEXT_STDIO option is defined, then use O_U8TEXT
|
||||
** when appropriate when writing to stdout or stderr. Use O_BINARY
|
||||
** or O_TEXT (depending on things like the .mode and the .crlf setting
|
||||
** in the CLI, or other context clues in other applications) for all
|
||||
** other output channels.
|
||||
**
|
||||
** The SQLITE_U8TEXT_STDIO compile-time option is a compromise.
|
||||
** It always enables _O_WTEXT or similar for stdin, stdout, stderr,
|
||||
** but allows other streams to be _O_TEXT and/or O_BINARY. The
|
||||
** SQLITE_U8TEXT_STDIO option has the same downside as SQLITE_U8TEXT_ONLY
|
||||
** in that stray 0x0d characters might appear where they ought not, but
|
||||
** at least with this option those characters only appear on standard
|
||||
** I/O streams, and not on new streams that might be created by the
|
||||
** application using sqlite3_fopen() or sqlite3_popen().
|
||||
** The default behavior, if neither of the above is defined is to
|
||||
** use O_U8TEXT when writing to the Windows console (or anything
|
||||
** else for which _isatty() returns true) and to use O_BINARY or O_TEXT
|
||||
** for all other output channels.
|
||||
*/
|
||||
#if defined(SQLITE_U8TEXT_ONLY)
|
||||
# define UseWtextForOutput(fd) 1
|
||||
@@ -67,6 +61,31 @@
|
||||
# define IsConsole(fd) 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Global variables determine if simulated O_BINARY mode is to be
|
||||
** used for stdout or other, respectively. Simulated O_BINARY mode
|
||||
** means the mode is usually O_BINARY, but switches to O_U8TEXT for
|
||||
** unicode characters U+0080 or greater (any character that has a
|
||||
** multi-byte representation in UTF-8). This is the only way we
|
||||
** have found to render Unicode characters on a Windows console while
|
||||
** at the same time avoiding undesirable \n to \r\n translation.
|
||||
*/
|
||||
static int simBinaryStdout = 0;
|
||||
static int simBinaryOther = 0;
|
||||
|
||||
|
||||
/*
|
||||
** Determine if simulated binary mode should be used for output to fd
|
||||
*/
|
||||
static int UseBinaryWText(FILE *fd){
|
||||
if( fd==stdout || fd==stderr ){
|
||||
return simBinaryStdout;
|
||||
}else{
|
||||
return simBinaryOther;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Work-alike for the fopen() routine from the standard C library.
|
||||
*/
|
||||
@@ -88,6 +107,7 @@ FILE *sqlite3_fopen(const char *zFilename, const char *zMode){
|
||||
}
|
||||
free(b1);
|
||||
free(b2);
|
||||
simBinaryOther = 0;
|
||||
return fp;
|
||||
}
|
||||
|
||||
@@ -126,7 +146,7 @@ char *sqlite3_fgets(char *buf, int sz, FILE *in){
|
||||
** that into UTF-8. Otherwise, non-ASCII characters all get translated
|
||||
** into '?'.
|
||||
*/
|
||||
wchar_t *b1 = malloc( sz*sizeof(wchar_t) );
|
||||
wchar_t *b1 = sqlite3_malloc( sz*sizeof(wchar_t) );
|
||||
if( b1==0 ) return 0;
|
||||
_setmode(_fileno(in), IsConsole(in) ? _O_WTEXT : _O_U8TEXT);
|
||||
if( fgetws(b1, sz/4, in)==0 ){
|
||||
@@ -143,27 +163,67 @@ char *sqlite3_fgets(char *buf, int sz, FILE *in){
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** Send ASCII text as O_BINARY. But for Unicode characters U+0080 and
|
||||
** greater, switch to O_U8TEXT.
|
||||
*/
|
||||
static void piecemealOutput(wchar_t *b1, int sz, FILE *out){
|
||||
int i;
|
||||
wchar_t c;
|
||||
while( sz>0 ){
|
||||
for(i=0; i<sz && b1[i]>=0x80; i++){}
|
||||
if( i>0 ){
|
||||
c = b1[i];
|
||||
b1[i] = 0;
|
||||
fflush(out);
|
||||
_setmode(_fileno(out), _O_U8TEXT);
|
||||
fputws(b1, out);
|
||||
fflush(out);
|
||||
b1 += i;
|
||||
b1[0] = c;
|
||||
sz -= i;
|
||||
}else{
|
||||
fflush(out);
|
||||
_setmode(_fileno(out), _O_TEXT);
|
||||
_setmode(_fileno(out), _O_BINARY);
|
||||
fwrite(&b1[0], 1, 1, out);
|
||||
for(i=1; i<sz && b1[i]<0x80; i++){
|
||||
fwrite(&b1[i], 1, 1, out);
|
||||
}
|
||||
fflush(out);
|
||||
_setmode(_fileno(out), _O_U8TEXT);
|
||||
b1 += i;
|
||||
sz -= i;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** Work-alike for fputs() from the standard C library.
|
||||
*/
|
||||
int sqlite3_fputs(const char *z, FILE *out){
|
||||
if( UseWtextForOutput(out) ){
|
||||
if( !UseWtextForOutput(out) ){
|
||||
/* Writing to a file or other destination, just write bytes without
|
||||
** any translation. */
|
||||
return fputs(z, out);
|
||||
}else{
|
||||
/* When writing to the command-prompt in Windows, it is necessary
|
||||
** to use _O_WTEXT input mode and write UTF-16 characters.
|
||||
** to use O_U8TEXT to render Unicode U+0080 and greater. Go ahead
|
||||
** use O_U8TEXT for everything in text mode.
|
||||
*/
|
||||
int sz = (int)strlen(z);
|
||||
wchar_t *b1 = malloc( (sz+1)*sizeof(wchar_t) );
|
||||
wchar_t *b1 = sqlite3_malloc( (sz+1)*sizeof(wchar_t) );
|
||||
if( b1==0 ) return 0;
|
||||
sz = MultiByteToWideChar(CP_UTF8, 0, z, sz, b1, sz);
|
||||
b1[sz] = 0;
|
||||
_setmode(_fileno(out), _O_U8TEXT);
|
||||
fputws(b1, out);
|
||||
if( UseBinaryWText(out) ){
|
||||
piecemealOutput(b1, sz, out);
|
||||
}else{
|
||||
fputws(b1, out);
|
||||
}
|
||||
sqlite3_free(b1);
|
||||
return 0;
|
||||
}else{
|
||||
/* Writing to a file or other destination, just write bytes without
|
||||
** any translation. */
|
||||
return fputs(z, out);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,6 +265,10 @@ void sqlite3_fsetmode(FILE *fp, int mode){
|
||||
if( !UseWtextForOutput(fp) ){
|
||||
fflush(fp);
|
||||
_setmode(_fileno(fp), mode);
|
||||
}else if( fp==stdout || fp==stderr ){
|
||||
simBinaryStdout = (mode==_O_BINARY);
|
||||
}else{
|
||||
simBinaryOther = (mode==_O_BINARY);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -744,7 +744,7 @@ static const char *recoverUnusedString(
|
||||
}
|
||||
|
||||
/*
|
||||
** Implementation of scalar SQL function "escape_crnl". The argument passed to
|
||||
** Implementation of scalar SQL function "escape_crlf". The argument passed to
|
||||
** this function is the output of built-in function quote(). If the first
|
||||
** character of the input is "'", indicating that the value passed to quote()
|
||||
** was a text value, then this function searches the input for "\n" and "\r"
|
||||
@@ -755,7 +755,7 @@ static const char *recoverUnusedString(
|
||||
** Or, if the first character of the input is not "'", then a copy of the input
|
||||
** is returned.
|
||||
*/
|
||||
static void recoverEscapeCrnl(
|
||||
static void recoverEscapeCrlf(
|
||||
sqlite3_context *context,
|
||||
int argc,
|
||||
sqlite3_value **argv
|
||||
@@ -970,7 +970,7 @@ static int recoverOpenOutput(sqlite3_recover *p){
|
||||
{ "getpage", 1, recoverGetPage },
|
||||
{ "page_is_used", 1, recoverPageIsUsed },
|
||||
{ "read_i32", 2, recoverReadI32 },
|
||||
{ "escape_crnl", 1, recoverEscapeCrnl },
|
||||
{ "escape_crlf", 1, recoverEscapeCrlf },
|
||||
};
|
||||
|
||||
const int flags = SQLITE_OPEN_URI|SQLITE_OPEN_CREATE|SQLITE_OPEN_READWRITE;
|
||||
@@ -1323,7 +1323,7 @@ static sqlite3_stmt *recoverInsertStmt(
|
||||
|
||||
if( bSql ){
|
||||
zBind = recoverMPrintf(p,
|
||||
"%z%sescape_crnl(quote(?%d))", zBind, zSqlSep, pTab->aCol[ii].iBind
|
||||
"%z%sescape_crlf(quote(?%d))", zBind, zSqlSep, pTab->aCol[ii].iBind
|
||||
);
|
||||
zSqlSep = "||', '||";
|
||||
}else{
|
||||
|
||||
@@ -227,7 +227,7 @@ ifeq (1,$(barebones))
|
||||
else
|
||||
wasm-bare-bones := 0
|
||||
endif
|
||||
undefine barebones
|
||||
# undefine barebones # relatively new gmake feature, not ubiquitous
|
||||
|
||||
# Common options for building sqlite3-wasm.c and speedtest1.c.
|
||||
# Explicit ENABLEs...
|
||||
@@ -1106,7 +1106,7 @@ emcc-opt-extra :=
|
||||
# doubles the build time and seems to have negligible, if any, effect
|
||||
# on higher optimization levels.
|
||||
#
|
||||
# -flto does ont shrink the size of bare-bones builds by any measurable
|
||||
# -flto does not shrink the size of bare-bones builds by any measurable
|
||||
# amount.
|
||||
#endif
|
||||
o0: clean
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
** implementation of the SQLTester framework.
|
||||
**
|
||||
** This version is not well-documented because it's a direct port of
|
||||
** the Java immplementation, which is documented: in the main SQLite3
|
||||
** source tree, see ext/jni/src/org/sqlite/jni/tester/SQLite3Tester.java.
|
||||
** the Java implementation, which is documented: in the main SQLite3
|
||||
** source tree, see ext/jni/src/org/sqlite/jni/capi/SQLTester.java.
|
||||
*/
|
||||
|
||||
import sqlite3ApiInit from '/jswasm/sqlite3.mjs';
|
||||
@@ -28,7 +28,7 @@ const log = (...args)=>{
|
||||
/**
|
||||
Try to install vfsName as the new default VFS. Once this succeeds
|
||||
(returns true) then it becomes a no-op on future calls. Throws if
|
||||
vfs registration as the default VFS fails but has no side effects
|
||||
VFS registration as the default VFS fails but has no side effects
|
||||
if vfsName is not currently registered.
|
||||
*/
|
||||
const tryInstallVfs = function f(vfsName){
|
||||
@@ -48,11 +48,10 @@ tryInstallVfs.vfsName = undefined;
|
||||
|
||||
if( 0 && globalThis.WorkerGlobalScope ){
|
||||
// Try OPFS storage, if available...
|
||||
if( 0 && sqlite3.oo1.OpfsDb ){
|
||||
if( 1 && sqlite3.oo1.OpfsDb ){
|
||||
/* Really slow with these tests */
|
||||
tryInstallVfs("opfs");
|
||||
}
|
||||
if( sqlite3.installOpfsSAHPoolVfs ){
|
||||
}else if( sqlite3.installOpfsSAHPoolVfs ){
|
||||
await sqlite3.installOpfsSAHPoolVfs({
|
||||
clearOnInit: true,
|
||||
initialCapacity: 15,
|
||||
@@ -207,6 +206,9 @@ const Util = newObj({
|
||||
['string','string'])
|
||||
})/*Util*/;
|
||||
|
||||
/**
|
||||
Output logger utility.
|
||||
*/
|
||||
class Outer {
|
||||
#lnBuf = [];
|
||||
#verbosity = 0;
|
||||
@@ -352,7 +354,7 @@ class SQLTester {
|
||||
this.closeAllDbs();
|
||||
this.metrics.nTest = 0;
|
||||
this.#nullView = "nil";
|
||||
this.emitColNames = false;
|
||||
this.#emitColNames = false;
|
||||
this.#db.iCurrentDb = 0;
|
||||
//this.#db.initSql.push("SELECT 1;");
|
||||
}
|
||||
@@ -605,7 +607,7 @@ class SQLTester {
|
||||
}
|
||||
}
|
||||
}
|
||||
sb.append("\"");
|
||||
sb.push("\"");
|
||||
return sb.join('');
|
||||
}
|
||||
|
||||
@@ -694,11 +696,11 @@ class SQLTester {
|
||||
break;
|
||||
}
|
||||
}/* column loop */
|
||||
if( ResultRowMode.NEWLINE === rowMode ){
|
||||
spacing = 0;
|
||||
sb.push('\n');
|
||||
}
|
||||
}/* row loop */
|
||||
if( ResultRowMode.NEWLINE === rowMode ){
|
||||
spacing = 0;
|
||||
sb.push('\n');
|
||||
}
|
||||
}else{ // no output but possibly other side effects
|
||||
while( capi.SQLITE_ROW === (rc = capi.sqlite3_step(pStmt)) ) {}
|
||||
}
|
||||
@@ -706,7 +708,7 @@ class SQLTester {
|
||||
if( capi.SQLITE_ROW===rc || capi.SQLITE_DONE===rc) rc = 0;
|
||||
else if( rc!=0 ){
|
||||
if( sb ){
|
||||
self.#appendDbErr(db, sb, rc);
|
||||
self.#appendDbErr(pDb, sb, rc);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
** May you share freely, never taking more than you give.
|
||||
**
|
||||
*************************************************************************
|
||||
** This file contains a test application for SQLTester.js.
|
||||
** This file contains a test application for SQLTester.mjs. It loads
|
||||
** test scripts and runs them through the SQLTester class.
|
||||
*/
|
||||
import {default as ns} from './SQLTester.mjs';
|
||||
import {default as allTests} from './test-list.mjs';
|
||||
@@ -33,7 +34,7 @@ const affirm = function(expr, msg){
|
||||
}
|
||||
}
|
||||
|
||||
let ts = new ns.TestScript('/foo.test',`
|
||||
let ts = new ns.TestScript('SQLTester-sanity-check.test',`
|
||||
/*
|
||||
** This is a comment. There are many like it but this one is mine.
|
||||
**
|
||||
@@ -69,11 +70,13 @@ intentional error;
|
||||
SELECT json_array(1,2,3)
|
||||
--json [1,2,3]
|
||||
--testcase tableresult-1
|
||||
select 1, 'a';
|
||||
select 2, 'b';
|
||||
select 1, 'a' UNION
|
||||
select 2, 'b' UNION
|
||||
select 3, 'c' ORDER by 1
|
||||
--tableresult
|
||||
# [a-z]
|
||||
2 b
|
||||
3 c
|
||||
--end
|
||||
--testcase json-block-1
|
||||
select json_array(1,2,3);
|
||||
@@ -91,6 +94,7 @@ SELECT json_array(1,2,3)
|
||||
select 1 as 'a', 2 as 'b';
|
||||
--result 1 2
|
||||
--close
|
||||
--testcase the-end
|
||||
--print Until next time
|
||||
`);
|
||||
|
||||
@@ -110,14 +114,13 @@ const runTests = function(){
|
||||
ts.run(sqt);
|
||||
affirm( 'zilch' === sqt.nullValue() );
|
||||
sqt.addTestScript(ts);
|
||||
sqt.runTests();
|
||||
}else{
|
||||
for(const t of allTests){
|
||||
sqt.addTestScript( new ns.TestScript(t) );
|
||||
}
|
||||
allTests.length = 0;
|
||||
sqt.runTests();
|
||||
}
|
||||
sqt.runTests();
|
||||
}finally{
|
||||
//log( "Metrics:", sqt.metrics );
|
||||
sqt.reset();
|
||||
|
||||
@@ -119,8 +119,6 @@
|
||||
break;
|
||||
}
|
||||
};
|
||||
//runTests()
|
||||
/* Inexplicably, */
|
||||
})();
|
||||
</script>
|
||||
</body>
|
||||
|
||||
@@ -506,8 +506,7 @@ const installAsyncProxy = function(){
|
||||
dirHandle: hDir,
|
||||
fileHandle: hFile,
|
||||
sabView: state.sabFileBufView,
|
||||
readOnly: create
|
||||
? false : (state.sq3Codes.SQLITE_OPEN_READONLY & flags),
|
||||
readOnly: !create && !!(state.sq3Codes.SQLITE_OPEN_READONLY & flags),
|
||||
deleteOnClose: !!(state.sq3Codes.SQLITE_OPEN_DELETEONCLOSE & flags)
|
||||
});
|
||||
fh.releaseImplicitLocks =
|
||||
|
||||
@@ -57,7 +57,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
|
||||
'use strict';
|
||||
const toss = sqlite3.util.toss;
|
||||
const toss3 = sqlite3.util.toss3;
|
||||
const initPromises = Object.create(null);
|
||||
const initPromises = Object.create(null) /* cache of (name:result) of VFS init results */;
|
||||
const capi = sqlite3.capi;
|
||||
const util = sqlite3.util;
|
||||
const wasm = sqlite3.wasm;
|
||||
@@ -843,6 +843,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
|
||||
if(!this.#cVfs.pointer || !this.#dhOpaque) return false;
|
||||
capi.sqlite3_vfs_unregister(this.#cVfs.pointer);
|
||||
this.#cVfs.dispose();
|
||||
delete initPromises[this.vfsName];
|
||||
try{
|
||||
this.releaseAccessHandles();
|
||||
await this.#dhVfsRoot.removeEntry(OPAQUE_DIR_NAME, {recursive: true});
|
||||
|
||||
@@ -922,6 +922,8 @@ const installOpfsVfs = function callee(options){
|
||||
fh.filename = zName;
|
||||
fh.sab = new SharedArrayBuffer(state.fileBufferSize);
|
||||
fh.flags = flags;
|
||||
fh.readOnly = !(sqlite3.SQLITE_OPEN_CREATE & flags)
|
||||
&& !!(flags & capi.SQLITE_OPEN_READONLY);
|
||||
const rc = opRun('xOpen', pFile, zName, flags, opfsFlags);
|
||||
if(!rc){
|
||||
/* Recall that sqlite3_vfs::xClose() will be called, even on
|
||||
|
||||
@@ -1248,8 +1248,6 @@ globalThis.sqlite3InitModule = sqlite3InitModule;
|
||||
let st = this.db.prepare(
|
||||
new TextEncoder('utf-8').encode("select 3 as a")
|
||||
);
|
||||
//debug("statement =",st);
|
||||
T.assert( !this.progressHandlerCount );
|
||||
let rc;
|
||||
try {
|
||||
T.assert(wasm.isPtr(st.pointer))
|
||||
@@ -3355,6 +3353,55 @@ globalThis.sqlite3InitModule = sqlite3InitModule;
|
||||
db.close();
|
||||
}
|
||||
})
|
||||
.t({
|
||||
name: 'r/o connection recovery from write op error',
|
||||
predicate: ()=>hasOpfs() || "Requires OPFS to reproduce",
|
||||
//predicate: ()=>false,
|
||||
test: async function(sqlite3){
|
||||
/* https://sqlite.org/forum/forumpost/cf37d5ff1182c31081
|
||||
|
||||
The "opfs" VFS (but not SAHPool) was formerly misbehaving
|
||||
after a write attempt was made on a db opened with
|
||||
mode=ro. This test ensures that that behavior is fixed and
|
||||
compares that behavior with other VFSes. */
|
||||
const tryOne = function(vfsName,descr){
|
||||
const uri = 'file:///foo.db';
|
||||
let db = new sqlite3.oo1.DB(uri + (vfsName ? '?vfs='+vfsName : ''));
|
||||
db.exec([
|
||||
"drop table if exists t;",
|
||||
"create table t(a);",
|
||||
"insert into t(a) values('abc'),('def'),('ghi');"
|
||||
]);
|
||||
db.close();
|
||||
db = new sqlite3.oo1.DB(uri+'?mode=ro'+
|
||||
(vfsName ? '&vfs='+vfsName : ''));
|
||||
let err;
|
||||
try {
|
||||
db.exec('insert into t(a) values(1)');
|
||||
}catch(e){
|
||||
err = e;
|
||||
}
|
||||
T.assert(err && (err.message.indexOf('SQLITE_READONLY')===0));
|
||||
try{
|
||||
db.exec('select a from t');
|
||||
}finally{
|
||||
db.close();
|
||||
}
|
||||
};
|
||||
const poolConfig = JSON.parse(JSON.stringify(sahPoolConfig));
|
||||
poolConfig.name = 'opfs-sahpool-cf37d5ff11';
|
||||
let poolUtil;
|
||||
await sqlite3.installOpfsSAHPoolVfs(poolConfig).then(p=>poolUtil=p);
|
||||
T.assert(!!sqlite3.capi.sqlite3_vfs_find(poolConfig.name), "Expecting to find just-registered VFS");
|
||||
try{
|
||||
tryOne(false, "Emscripten filesystem");
|
||||
tryOne(poolConfig.name);
|
||||
tryOne('opfs');
|
||||
}finally{
|
||||
await poolUtil.removeVfs();
|
||||
}
|
||||
}
|
||||
})
|
||||
;/*end of Bug Reports group*/;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -569,7 +569,7 @@ dbhash$(EXE): $(TOP)/tool/dbhash.c sqlite3.c sqlite3.h
|
||||
$(TOP)/tool/dbhash.c sqlite3.c $(TLIBS) $(THREADLIB)
|
||||
|
||||
RSYNC_SRC = \
|
||||
$(TOP)/tool/sqlite3-rsync.c \
|
||||
$(TOP)/tool/sqlite3_rsync.c \
|
||||
sqlite3.c
|
||||
|
||||
RSYNC_OPT = \
|
||||
@@ -578,7 +578,7 @@ RSYNC_OPT = \
|
||||
-DSQLITE_OMIT_LOAD_EXTENSION \
|
||||
-DSQLITE_OMIT_DEPRECATED
|
||||
|
||||
sqlite3-rsync$(EXE): $(RSYNC_SRC)
|
||||
sqlite3_rsync$(EXE): $(RSYNC_SRC)
|
||||
$(TCC) -o $@ $(RSYNC_OPT) $(RSYNC_SRC) $(TLIBS)
|
||||
|
||||
scrub$(EXE): $(TOP)/ext/misc/scrub.c sqlite3.o
|
||||
@@ -1159,7 +1159,7 @@ clean:
|
||||
rm -f showjournal$(TEXE) showstat4$(TEXE) showwal$(TEXE) speedtest1$(TEXE)
|
||||
rm -f wordcount$(TEXE) changeset$(TEXE) version-info$(TEXE)
|
||||
rm -f *.dll *.lib *.exp *.def *.pc *.vsix
|
||||
rm -f sqlite3_analyzer$(TEXE) sqlite3-rsync$(TEXE)
|
||||
rm -f sqlite3_analyzer$(TEXE) sqlite3_rsync$(TEXE)
|
||||
rm -f mptester$(TEXE) rbu$(TEXE) srcck1$(TEXE)
|
||||
rm -f fuzzershell$(TEXE) fuzzcheck$(TEXE) sqldiff$(TEXE) dbhash$(TEXE)
|
||||
rm -f threadtest5$(TEXE)
|
||||
|
||||
@@ -1,45 +1,49 @@
|
||||
C Remove\sa\sfew\smore\straces\sof\slong\sdouble\sfrom\sthe\scode.
|
||||
D 2024-10-02T11:34:11.757
|
||||
C Version\s3.47.2
|
||||
D 2024-12-07T20:39:59.211
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
||||
F Makefile.in 6a826facc78c3c8ad38bf00ed588f6aa3665ccd7a9749b891d20582fc290c77e
|
||||
F Makefile.in bb7184a6906f4f15647031c414d4b7dbe935683c14976548a793071e7133bd84
|
||||
F Makefile.linux-gcc f3842a0b1efbfbb74ac0ef60e56b301836d05b4d867d014f714fa750048f1ab6
|
||||
F Makefile.msc 9c6d80d9d103fa42e931f4c464884a5e577fae8563acc7589bff4e43fbe8f864
|
||||
F Makefile.msc 58b69eda1faad5d475092b8aeffab9156ee4901a82db089b166607f2ec907ee4
|
||||
F README.md c3c0f19532ce28f6297a71870f3c7b424729f0e6d9ab889616d3587dd2332159
|
||||
F VERSION 0db40f92c04378404eb45bff93e9e42c148c7e54fd3da99469ed21e22411f5a6
|
||||
F VERSION f6819a04f84cfb674a2c35379885171be92205dd18603bd989455126717b9229
|
||||
F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50
|
||||
F art/icon-243x273.gif 9750b734f82fdb3dc43127753d5e6fbf3b62c9f4e136c2fbf573b2f57ea87af5
|
||||
F art/icon-80x90.gif 65509ce3e5f86a9cd64fe7fca2d23954199f31fe44c1e09e208c80fb83d87031
|
||||
F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2
|
||||
F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90
|
||||
F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2
|
||||
F art/sqlite370.svg 40b7e2fe8aac3add5d56dd86ab8d427a4eca5bcb3fe4f8946cb3794e1821d531
|
||||
F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903
|
||||
F autoconf/Makefile.am adedc1324b6a87fdd1265ddd336d2fb7d4f36a0e77b86ea553ae7cc4ea239347
|
||||
F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac
|
||||
F autoconf/Makefile.msc 2aced6442addab13ed115696eba28d9ed29caa3dd604a31392c2c7a5da301492
|
||||
F autoconf/Makefile.msc 0a1fdef1f2c618815cf7c82c817a7369c1e07b3cfed490803db16fb43326d506
|
||||
F autoconf/README.first 6c4f34fe115ff55d4e8dbfa3cecf04a0188292f7
|
||||
F autoconf/README.txt 42cfd21d0b19dc7d5d85fb5c405c5f3c6a4c923021c39128f6ba685355d8fd56
|
||||
F autoconf/README.txt 5e946ffb6fbdbb114c81e1bdc862df27fce8beab557d7b0421820b0fe8fc048f
|
||||
F autoconf/configure.ac ec7fa914c5e74ff212fe879f9bb6918e1234497e05facfb641f30c4d5893b277
|
||||
F autoconf/tea/Makefile.in 106a96f2f745d41a0f6193f1de98d7355830b65d45032c18cd7c90295ec24196
|
||||
F autoconf/tea/README 3e9a3c060f29a44344ab50aec506f4db903fb873
|
||||
F autoconf/tea/Makefile.in ba0556fee8da09c066bad85a4457904e46ee2c2eabaa309c0e83a78f2f151a8e
|
||||
F autoconf/tea/README.txt 61e62e519579e4a112791354d6d440f8b51ea6db3b0bab58d59f29df42d2dfe3
|
||||
F autoconf/tea/aclocal.m4 52c47aac44ce0ddb1f918b6993e8beb8eee88f43
|
||||
F autoconf/tea/configure.ac 0deb5d6c49c8119f75f436488219fc043127d72057af5dfba2c9ce096a5734bc
|
||||
F autoconf/tea/configure.ac 073330791b9e99d225dbe3fd65d97d3e1fe9487bf41000e8373f677809f652d5
|
||||
F autoconf/tea/doc/sqlite3.n e1fe45d4f5286ee3d0ccc877aca2a0def488e9bb
|
||||
F autoconf/tea/license.terms 13bd403c9610fd2b76ece0ab50c4c5eda933d523
|
||||
F autoconf/tea/pkgIndex.tcl.in b9eb6dd37f64e08e637d576b3c83259814b9cddd78bec4af2e5abfc6c5c750ce
|
||||
F autoconf/tea/tclconfig/install-sh bdd5e293591621ae60d9824d86a4b1c5f22c3d00
|
||||
F autoconf/tea/tclconfig/tcl.m4 c6e5f2fc7178f40d087403daa044ef3b86a8e30793f3b121bdcbdf152c6a776a
|
||||
F autoconf/tea/win/makefile.vc 2c478a9a962e48b2bf9062734e04d7c63c556e217095419173f9d7938d7d78f7
|
||||
F autoconf/tea/pkgIndex.tcl.in 55aec3c6d7e9a1de9b8d2fdc9c27fd055da3ac3a51b572195e2ae7300bcfd3a2
|
||||
F autoconf/tea/tclconfig/install-sh 2182b3705d92e25753411e2c28cf788c69e35a48fbb8aa332e342dfc6b95b80d
|
||||
F autoconf/tea/tclconfig/tcl.m4 284faa1d9cf66c1efb42817beb5c8a63626fb35bf903993d4f11fde75677cc1a
|
||||
F autoconf/tea/win/makefile.vc 55721106928894cb818164a8ce054da11d948948f5a92a54d262dd0a6a891d4d
|
||||
F autoconf/tea/win/nmakehlp.c b01f822eabbe1ed2b64e70882d97d48402b42d2689a1ea00342d1a1a7eaa19cb
|
||||
F autoconf/tea/win/rules.vc 7b3bb2ef32ade0f3f14d951231811678722725e3bca240dd9727ae0dfe10f6a5
|
||||
F autoconf/tea/win/rules-ext.vc fd5740d97aac8c41c97eaa0fbcc0c15a41b6f7075d5f9f593e147d7a284a247a
|
||||
F autoconf/tea/win/rules.vc 94a18c3e453535459b4a643983acca52fb8756e79055bd2ad4b0999d66484f4c
|
||||
F autoconf/tea/win/targets.vc 96a25a1fa6e9e9cfb348fd3760a5395b4ce8acafc8ed10f0412937ec200d5dbd
|
||||
F config.guess 883205ddf25b46f10c181818bf42c09da9888884af96f79e1719264345053bd6
|
||||
F config.sub c2d0260f17f3e4bc0b6808fccf1b291cb5e9126c14fc5890efc77b9fd0175559
|
||||
F configure 49523f0a070b583cea040d26eff53a65fb0893eca4663b1343a4d5a9a964da53 x
|
||||
F configure.ac a100ebf7a07f5dedd319ef547dd467d1676ed059b85a7877aa9c44ac309f7000
|
||||
F configure 3d57abc2124fd69998939bade07aac5e97bf1139592452b2685e0c940acf2ca6 x
|
||||
F configure.ac 45dbc4aaccc943ef51826e3226671b021158434d1b17cbc6819aff63e10171bf
|
||||
F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad
|
||||
F doc/F2FS.txt c1d4a0ae9711cfe0e1d8b019d154f1c29e0d3abfe820787ba1e9ed7691160fcd
|
||||
F doc/compile-for-windows.md 4d4bfafda42a7a33f166d23aed4db1bb4ea1e5751595a5cced2bad349fd14652
|
||||
F doc/compile-for-unix.md 343fe9334260d8695c36b465f55221f0187c8e7abaaa4d5afb4d564ed1d22dc1
|
||||
F doc/compile-for-windows.md 90f97b9e6bbf27470e825711064bca409d26355f8f31416631a1722bcddf0612
|
||||
F doc/json-enhancements.md e356fc834781f1f1aa22ee300027a270b2c960122468499bf347bb123ce1ea4f
|
||||
F doc/jsonb.md 5fab4b8613aa9153fbeb6259297bd4697988af8b3d23900deba588fa7841456b
|
||||
F doc/lemon.html 8b266ff711d2ec7f867c3dca37634963f48a630329908cc282beebfa8c708706
|
||||
@@ -57,19 +61,19 @@ F ext/consio/console_io.c d2b74afae8d301de2e8447b1045fcd33eb59df13bf581d906d99c7
|
||||
F ext/consio/console_io.h b5ebe34aa15b357621ebbea3d3f2e2b24750d4280b5802516409e23947fd9ee5
|
||||
F ext/expert/README.md b321c2762bb93c18ea102d5a5f7753a4b8bac646cb392b3b437f633caf2020c3
|
||||
F ext/expert/expert.c d548d603a4cc9e61f446cc179c120c6713511c413f82a4a32b1e1e69d3f086a4
|
||||
F ext/expert/expert1.test b10f9e20f64102a015c0fcf54cb7b7680266b397e91d93cdad45f57857cdfba6
|
||||
F ext/expert/sqlite3expert.c df417a6d91873a74d35daa9259171647c23c6601415e938e8a71702703f3d677
|
||||
F ext/expert/expert1.test 1d2da6606623b57bb47064e02140823ce1daecd4cacbf402c73ad3473d7f000c
|
||||
F ext/expert/sqlite3expert.c 494a6b7d4e0ead6dec6a50109dd78fcc054bb1a3fcc29c6f25e06a3685ed557e
|
||||
F ext/expert/sqlite3expert.h ca81efc2679a92373a13a3e76a6138d0310e32be53d6c3bfaedabd158ea8969b
|
||||
F ext/expert/test_expert.c b767b2039a0df707eb3147e86bcf68b252d8455d9a41774b1a836cd052ceca70
|
||||
F ext/fts3/README.content b9078d0843a094d86af0d48dffbff13c906702b4c3558012e67b9c7cc3bf59ee
|
||||
F ext/fts3/README.syntax a19711dc5458c20734b8e485e75fb1981ec2427a
|
||||
F ext/fts3/README.tokenizers b92bdeb8b46503f0dd301d364efc5ef59ef9fa8e2758b8e742f39fa93a2e422d
|
||||
F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d
|
||||
F ext/fts3/fts3.c c922380b62bd15bce953dae3350337acbd0fff07c10cdc805819409791eb480a
|
||||
F ext/fts3/fts3.c 27f09d3e00d0e5af8e28fe6cde07eca9426e9ae68e9a051063e270c8643b9181
|
||||
F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe
|
||||
F ext/fts3/fts3Int.h 968f7d7cae541a6926146e9fd3fb2b2ccbd3845b7890a8ed03de0c06ac776682
|
||||
F ext/fts3/fts3_aux.c 7eab82a9cf0830f6551ba3abfdbe73ed39e322a4d3940ee82fbf723674ecd9f3
|
||||
F ext/fts3/fts3_expr.c 903bfb9433109fffb10e910d7066c49cbf8eeae316adc93f0499c4da7dfc932a
|
||||
F ext/fts3/fts3_expr.c 365849a2a1185e19028a9db2d9f1ea63efe909a3a6aca7ec86fc26a13a60bd58
|
||||
F ext/fts3/fts3_hash.c 8b6e31bfb0844c27dc6092c2620bdb1fca17ed613072db057d96952c6bdb48b7
|
||||
F ext/fts3/fts3_hash.h 39cf6874dc239d6b4e30479b1975fe5b22a3caaf
|
||||
F ext/fts3/fts3_icu.c 305ce7fb6036484085b5556a9c8e62acdc7763f0f4cdf5fd538212a9f3720116
|
||||
@@ -92,20 +96,20 @@ F ext/fts3/unicode/UnicodeData.txt cd07314edb62d49fde34debdaf92fa2aa69011e7
|
||||
F ext/fts3/unicode/mkunicode.tcl 63db9624ccf70d4887836c320eda93ab552f21008f3be7ede551eac3ead62baa
|
||||
F ext/fts3/unicode/parseunicode.tcl a981bd6466d12dd17967515801c3ff23f74a281be1a03cf1e6f52a6959fc77eb
|
||||
F ext/fts5/extract_api_docs.tcl 009cf59c77afa86d137b0cca3e3b1a5efbe2264faa2df233f9a7aa8563926d15
|
||||
F ext/fts5/fts5.h efaaac0df3d3bc740383044c144b582f47921aafa21d7b10eb98f42c24c740b0
|
||||
F ext/fts5/fts5Int.h 93aba03ca417f403b07b2ab6f50aa0e0c1b8b031917a9026b81520e7047a168e
|
||||
F ext/fts5/fts5.h 6b4b92df890965567360db5f1ead24fd13a72cb23b95e4ed2ff58d1d89f7aa42
|
||||
F ext/fts5/fts5Int.h bf0d3efa144f36e00f9b5206626aec2f436f58186a0835092394f2202e9828e3
|
||||
F ext/fts5/fts5_aux.c 65a0468dd177d6093aa9ae1622e6d86b0136b8d267c62c0ad6493ad1e9a3d759
|
||||
F ext/fts5/fts5_buffer.c 0eec58bff585f1a44ea9147eae5da2447292080ea435957f7488c70673cb6f09
|
||||
F ext/fts5/fts5_config.c da21548ddbc1a457cb42545f527065221ede8ada6a734891b8c34317a7a9506b
|
||||
F ext/fts5/fts5_config.c a6633d88596758941c625b526075b85d3d9fd1089d8d9eab5db6e8a71fd347ad
|
||||
F ext/fts5/fts5_expr.c 9a56f53700d1860f0ee2f373c2b9074eaf2a7aa0637d0e27a6476de26a3fee33
|
||||
F ext/fts5/fts5_hash.c adda4272be401566a6e0ba1acbe70ee5cb97fce944bc2e04dc707152a0ec91b1
|
||||
F ext/fts5/fts5_index.c 368a968570ce12ba40223e284a588d9f93ee23a0133727f0df1fcd64086b1fb6
|
||||
F ext/fts5/fts5_main.c 4503498d3453e29a3cd89dacaba029011e89cb8c481a6241611d106e7a369bd4
|
||||
F ext/fts5/fts5_storage.c 3332497823c3d171cf56379f2bd8c971ce15a19aadacff961106462022c92470
|
||||
F ext/fts5/fts5_main.c 50eb059e51d730e8e0c77df4e568b018079e112a755c094488b0d5b1aa06afbb
|
||||
F ext/fts5/fts5_storage.c 337b05e4c66fc822d031e264d65bde807ec2fab08665ca2cc8aaf9c5fa06792c
|
||||
F ext/fts5/fts5_tcl.c 4db9258a7882c5eac0da4433042132aaf15b87dd1e1636c7a6ca203abd2c8bfe
|
||||
F ext/fts5/fts5_test_mi.c 08c11ec968148d4cb4119d96d819f8c1f329812c568bac3684f5464be177d3ee
|
||||
F ext/fts5/fts5_test_tok.c 3cb0a9b508b30d17ef025ccddd26ae3dc8ddffbe76c057616e59a9aa85d36f3b
|
||||
F ext/fts5/fts5_tokenize.c ae9c4fa93174ef06ffc138bd4280a1c37f7e13624d3d2706aad4b80573f23c41
|
||||
F ext/fts5/fts5_tokenize.c 033e2e43b8e852c0ef6cecc611266d61e2346e52ec7dcfb76a428fe56a07efa9
|
||||
F ext/fts5/fts5_unicode2.c 6f9b0fb79a8facaed76628ffd4eb9c16d7f2b84b52872784f617cf3422a9b043
|
||||
F ext/fts5/fts5_varint.c e64d2113f6e1bfee0032972cffc1207b77af63319746951bf1d09885d1dadf80
|
||||
F ext/fts5/fts5_vocab.c e4830b00809e5da53bc10f93adc59e321407b0f801c7f4167c0e47f5552267e0
|
||||
@@ -154,7 +158,7 @@ F ext/fts5/test/fts5corrupt5.test 11b47126f5772cc37b67e3e8b2ed05895c4d07c05338bc
|
||||
F ext/fts5/test/fts5corrupt6.test 2d72db743db7b5d9c9a6d0cfef24d799ed1aa5e8192b66c40e871a37ed9eed06
|
||||
F ext/fts5/test/fts5corrupt7.test 4e830875c33b9ea3c4cf1ba71e692b63893cbb4faae8c69b1071889dc26e211c
|
||||
F ext/fts5/test/fts5corrupt8.test b81d802e41631e98100f49a1aadeeffef860e30a62d6ed7d743c2797c477239e
|
||||
F ext/fts5/test/fts5delete.test 619295b20dbc1d840b403ee07c878f52378849c3c02e44f2ee143b3e978a0aa7
|
||||
F ext/fts5/test/fts5delete.test 2a5008f8b1174ef41d1974e606928c20e4f9da77d9f8347aed818994d89cced4
|
||||
F ext/fts5/test/fts5detail.test 54015e9c43ec4ba542cfb93268abdf280e0300f350efd08ee411284b03595cc4
|
||||
F ext/fts5/test/fts5determin.test 1b77879b2ae818b5b71c859e534ee334dac088b7cf3ff3bf76a2c82b1c788d11
|
||||
F ext/fts5/test/fts5dlidx.test a7c42b0a74dc7c8aa1a46d586e0aadda4b6cc42c24450f8d3774b21166e93159
|
||||
@@ -246,14 +250,16 @@ F ext/fts5/test/fts5unicode2.test 3bbd30152f9f760bf13886e5b1e5ec23ff62f56758ddda
|
||||
F ext/fts5/test/fts5unicode3.test f4891a3dac3b49c3d7c0fdb29566e9eb0ecff35263370c89f9661b1952b20818
|
||||
F ext/fts5/test/fts5unicode4.test 728c8f0caafb05567f524ad313d9f8b780fa45987b8a8df04eff87923c74b4d0
|
||||
F ext/fts5/test/fts5unindexed.test 168838d2c385e131120bbf5b516d2432a5fabc4caa2259c932e1d49ae209a4ae
|
||||
F ext/fts5/test/fts5unindexed2.test 516236eceaac05ace322290a0d3705b4c4ffe4760d8eb9d014d9d27d56dfcc02
|
||||
F ext/fts5/test/fts5update.test b8affd796e45c94a4d19ad5c26606ea06065a0f162a9562d9f005b5a80ccf0bc
|
||||
F ext/fts5/test/fts5update2.test c5baa76799ac605ebb8e5e21035db2014b396cef25c903eb96ba39b1d6f9f046
|
||||
F ext/fts5/test/fts5version.test c22d163c17e60a99f022cbc52de5a48bb7f84deaa00fe15e9bc4c3aa1996204e
|
||||
F ext/fts5/test/fts5vocab.test 2a2bdb60d0998fa3124d541b6d30b019504918dc43a6584645b63a24be72f992
|
||||
F ext/fts5/test/fts5vocab2.test bbba149c254375d00055930c1a501c9a51e80b0d20bf7b98f3e9fa3b03786373
|
||||
F ext/fts5/tool/fts5speed.tcl b0056f91a55b2d1a3684ec05729de92b042e2f85
|
||||
F ext/fts5/tool/fts5txt2db.tcl c0d43c8590656f8240e622b00957b3a0facc49482411a9fdc2870b45c0c82f9f
|
||||
F ext/fts5/tool/loadfts5.tcl 95b03429ee6b138645703c6ca192c3ac96eaf093
|
||||
F ext/fts5/tool/mkfts5c.tcl 3eba8e9bee4221ed165f3304b51b2a74a705f4ec5df3d044573a2be539534af8
|
||||
F ext/fts5/tool/mkfts5c.tcl 6649ed963a9135e36866f7cc9f8de5c8dcec85b5df089388274cee6381702cb7
|
||||
F ext/fts5/tool/showfts5.tcl d54da0e067306663e2d5d523965ca487698e722c
|
||||
F ext/icu/README.txt 7ab7ced8ae78e3a645b57e78570ff589d4c672b71370f5aa9e1cd7024f400fc9
|
||||
F ext/icu/icu.c 3add8197e0a86c1761771a39500ebae749438bcf1836160b407a56b4eaa8721c
|
||||
@@ -411,7 +417,7 @@ F ext/misc/nextchar.c 7877914c2a80c2f181dd04c3dbef550dfb54c93495dc03da2403b5dd58
|
||||
F ext/misc/noop.c f1a21cc9b7a4e667e5c8458d80ba680b8bd4315a003f256006046879f679c5a0
|
||||
F ext/misc/normalize.c bd84355c118e297522aba74de34a4fd286fc775524e0499b14473918d09ea61f
|
||||
F ext/misc/pcachetrace.c f4227ce03fb16aa8d6f321b72dd051097419d7a028a9853af048bee7645cb405
|
||||
F ext/misc/percentile.c 42eb041edab407e512aaa087f99ed9287fe0b3224f7a6d194456c00fc1454312
|
||||
F ext/misc/percentile.c 82531c62cd015b9cdca95ad6bb10c3a907ceb570d21ebd4fb7d634c809cfb089
|
||||
F ext/misc/prefixes.c 82645f79229877afab08c8b08ca1e7fa31921280906b90a61c294e4f540cd2a6
|
||||
F ext/misc/qpvtab.c fc189e127f68f791af90a487f4460ec91539a716daf45a0c357e963fd47cc06c
|
||||
F ext/misc/randomjson.c ef835fc64289e76ac4873b85fe12f9463a036168d7683cf2b773e36e6262c4ed
|
||||
@@ -419,13 +425,13 @@ F ext/misc/regexp.c 4bdd0045912f81c84908bd535ec5ad3b1c8540b4287c70ab840709636240
|
||||
F ext/misc/remember.c add730f0f7e7436cd15ea3fd6a90fd83c3f706ab44169f7f048438b7d6baa69c
|
||||
F ext/misc/rot13.c 51ac5f51e9d5fd811db58a9c23c628ad5f333c173f1fc53c8491a3603d38556c
|
||||
F ext/misc/scrub.c 2a44b0d44c69584c0580ad2553f6290a307a49df4668941d2812135bfb96a946
|
||||
F ext/misc/series.c a6089b5e8e3002bd1e5d9877cee6aead0b9a6426e406c09a399817db9e9ae823
|
||||
F ext/misc/series.c cbdda2e2eb8159a1331974d246984c6e2693c6ea93930e6165046c8dbb8db0e9
|
||||
F ext/misc/sha1.c cb5002148c2661b5946f34561701e9105e9d339b713ec8ac057fd888b196dcb9
|
||||
F ext/misc/shathree.c 1821d90a0040c9accdbe3e3527d378d30569475d758aa70f6848924c0b430e8c
|
||||
F ext/misc/showauth.c 732578f0fe4ce42d577e1c86dc89dd14a006ab52
|
||||
F ext/misc/spellfix.c bcc42ef3fd29429bc01a83e751332b8d4690e65d45008449bdffe7656371487f
|
||||
F ext/misc/sqlar.c a6175790482328171da47095f87608b48a476d4fac78d8a9ff18b03a2454f634
|
||||
F ext/misc/sqlite3_stdio.c f110e6f2dc97c67e89f941f82af7dbd221193fa44d1e3ef38a691454a2cbccda
|
||||
F ext/misc/sqlite3_stdio.c d3359cb499ddf2fcf50c630166821b329d35c1f8ddcf78b333c894845d9e3d6c
|
||||
F ext/misc/sqlite3_stdio.h f05eaf5e0258f0573910324a789a9586fc360a57678c57a6d63cfaa2245b6176
|
||||
F ext/misc/stmt.c b090086cd6bd6281c21271d38d576eeffe662f0e6b67536352ce32bbaa438321
|
||||
F ext/misc/stmtrand.c 59cffa5d8e158943ff1ce078956d8e208e8c04e67307e8f249dece2436dcb7fc
|
||||
@@ -506,7 +512,7 @@ F ext/recover/recoverpgsz.test 88766fcb810e52ee05335c456d4e5fb06d02b73d3ccb48c52
|
||||
F ext/recover/recoverrowid.test f948bf4024a5f41b0e21b8af80c60564c5b5d78c05a8d64fc00787715ff9f45f
|
||||
F ext/recover/recoverslowidx.test 5205a9742dd9490ee99950dabb622307355ef1662dea6a3a21030057bfd81411
|
||||
F ext/recover/recoversql.test e66d01f95302a223bcd3fd42b5ee58dc2b53d70afa90b0d00e41e4b8eab20486
|
||||
F ext/recover/sqlite3recover.c 2dcf6b56c5e0e2b43fc4c6115b689ab194c374ced7f7f8380ad9a24d8ef24ac9
|
||||
F ext/recover/sqlite3recover.c e822ecbb05a04a5c85d1309765fcd6cf392d100d02d2227cd7720c9d6921a17a
|
||||
F ext/recover/sqlite3recover.h 011c799f02deb70ab685916f6f538e6bb32c4e0025e79bfd0e24ff9c74820959
|
||||
F ext/recover/test_recover.c 072260d7452a3b81aba995b2b3269e7ec2aa7f06725544ba4c25b1b0a1dbc61a
|
||||
F ext/repair/README.md 92f5e8aae749a4dae14f02eea8e1bb42d4db2b6ce5e83dbcdd6b1446997e0c15
|
||||
@@ -603,13 +609,13 @@ F ext/userauth/sqlite3userauth.h 7f3ea8c4686db8e40b0a0e7a8e0b00fac13aa7a3
|
||||
F ext/userauth/user-auth.txt ca7e9ee82ca4e1c1744295f8184dd70edfae1992865d26c64303f539eb6c084c
|
||||
F ext/userauth/userauth.c 7f00cded7dcaa5d47f54539b290a43d2e59f4b1eb5f447545fa865f002fc80cb
|
||||
F ext/wasm/EXPORTED_FUNCTIONS.fiddle.in 27450c8b8c70875a260aca55435ec927068b34cef801a96205adb81bdcefc65c
|
||||
F ext/wasm/GNUmakefile bfd63f0462ac7e5b814a267e9101b8284d61731574ec673dae3178643cdb89ef
|
||||
F ext/wasm/GNUmakefile 128f8e9830dd8c50c14558649a6f13a2742e9d48223cc67485779baeebbc7391
|
||||
F ext/wasm/README-dist.txt 6382cb9548076fca472fb3330bbdba3a55c1ea0b180ff9253f084f07ff383576
|
||||
F ext/wasm/README.md a8a2962c3aebdf8d2104a9102e336c5554e78fc6072746e5daf9c61514e7d193
|
||||
F ext/wasm/SQLTester/GNUmakefile e0794f676d55819951bbfae45cc5e8d7818dc460492dc317ce7f0d2eca15caff
|
||||
F ext/wasm/SQLTester/SQLTester.mjs ce765c0ad7d57f93553d12ef4dca574deb00300134a26d472daacab49031e1fb
|
||||
F ext/wasm/SQLTester/SQLTester.run.mjs c72b7fe2072d05992f7a3d8c6a1d34e95712513ceabe40849784e24e41c84638
|
||||
F ext/wasm/SQLTester/index.html 3f8a016df0776be76605abf20e815ecaafbe055abac0e1fe5ea080e7846b760d
|
||||
F ext/wasm/SQLTester/SQLTester.mjs 66e1adc3d79467b68e3e40614fd42c1a577c7e219ec0985db966eded52a941e5
|
||||
F ext/wasm/SQLTester/SQLTester.run.mjs 57f2adb33f43f2784abbf8026c1bfd049d8013af1998e7dcb8b50c89ffc332e0
|
||||
F ext/wasm/SQLTester/index.html 64f3435084c7d6139b08d1f2a713828a73f68de2ae6a3112cbb5980d991ba06f
|
||||
F ext/wasm/SQLTester/touint8array.c 2d5ece04ec1393a6a60c4bf96385bda5e1a10ad49f3038b96460fc5e5aa7e536
|
||||
F ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-core 2bcbbfe3b95c043ed6037e2708a2ee078d212dd1612c364f93588d8dc97300fe
|
||||
F ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-extras fe40d6d758646e38f8b15f709044951e10884214f5453d35502100179c388c13
|
||||
@@ -627,10 +633,10 @@ F ext/wasm/api/sqlite3-api-oo1.c-pp.js f3a8e2004c6625d17946c11f2fb32008be78bc520
|
||||
F ext/wasm/api/sqlite3-api-prologue.js 6f1257e04885632ed9f44d43aba200b86e0bc16709ffdba29abbbeb1bc8e8b76
|
||||
F ext/wasm/api/sqlite3-api-worker1.c-pp.js 5cc22a3c0d52828cb32aad8691488719f47d27567e63e8bc8b832d74371c352d
|
||||
F ext/wasm/api/sqlite3-license-version-header.js 0c807a421f0187e778dc1078f10d2994b915123c1223fe752b60afdcd1263f89
|
||||
F ext/wasm/api/sqlite3-opfs-async-proxy.js e8f1df56e97a29004a95a2eddd26778f52c33b3e797d32d4b1b668a38e6493dd
|
||||
F ext/wasm/api/sqlite3-opfs-async-proxy.js 3774befd97cd1a5e2895c8225a894aad946848c6d9b4028acc988b5d123475af
|
||||
F ext/wasm/api/sqlite3-vfs-helper.c-pp.js 3f828cc66758acb40e9c5b4dcfd87fd478a14c8fb7f0630264e6c7fa0e57515d
|
||||
F ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js e529a99b7d5a088284821e2902b20d3404b561126969876997d5a73a656c9199
|
||||
F ext/wasm/api/sqlite3-vfs-opfs.c-pp.js e99e3d99f736937914527070f00ab13e9391d3f1cef884ab99a64cbcbee8d675
|
||||
F ext/wasm/api/sqlite3-vfs-opfs-sahpool.c-pp.js bb5e96cd0fd6e1e54538256433f1c60a4e3095063c4d1a79a8a022fc59be9571
|
||||
F ext/wasm/api/sqlite3-vfs-opfs.c-pp.js 9b86ca2d8276cf919fbc9ba2a10e9786033b64f92c2db844d951804dee6c4b4e
|
||||
F ext/wasm/api/sqlite3-vtab-helper.c-pp.js e809739d71e8b35dfe1b55d24d91f02d04239e6aef7ca1ea92a15a29e704f616
|
||||
F ext/wasm/api/sqlite3-wasm.c 83f5e9f998e9fa4261eb84e9f092210e3ffe03895119f5ded0429eb34ab9d2be
|
||||
F ext/wasm/api/sqlite3-worker1-promiser.c-pp.js 46f303ba8ddd1b2f0a391798837beddfa72e8c897038c8047eda49ce7d5ed46b
|
||||
@@ -679,7 +685,7 @@ F ext/wasm/test-opfs-vfs.html 1f2d672f3f3fce810dfd48a8d56914aba22e45c6834e262555
|
||||
F ext/wasm/test-opfs-vfs.js 1618670e466f424aa289859fe0ec8ded223e42e9e69b5c851f809baaaca1a00c
|
||||
F ext/wasm/tester1-worker.html ebc4b820a128963afce328ecf63ab200bd923309eb939f4110510ab449e9814c
|
||||
F ext/wasm/tester1.c-pp.html 1c1bc78b858af2019e663b1a31e76657b73dc24bede28ca92fbe917c3a972af2
|
||||
F ext/wasm/tester1.c-pp.js bb8c41a56ca0eabb945ca2e8f06324a7b63ad91630959d714b071bee88322019
|
||||
F ext/wasm/tester1.c-pp.js 228101c290003423f0bfb66a6ebbfc6904fa7b1b69466e700c135f74ee83d62a
|
||||
F ext/wasm/tests/opfs/concurrency/index.html 657578a6e9ce1e9b8be951549ed93a6a471f4520a99e5b545928668f4285fb5e
|
||||
F ext/wasm/tests/opfs/concurrency/test.js d08889a5bb6e61937d0b8cbb78c9efbefbf65ad09f510589c779b7cc6a803a88
|
||||
F ext/wasm/tests/opfs/concurrency/worker.js 0a8c1a3e6ebb38aabbee24f122693f1fb29d599948915c76906681bb7da1d3d2
|
||||
@@ -687,7 +693,7 @@ F ext/wasm/wasmfs.make bc8bb227f35d5bd3863a7bd2233437c37472a0d81585979f058f9b9b5
|
||||
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
|
||||
F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
|
||||
F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0
|
||||
F main.mk 0a55ebec3508ca1bdb593d86f3aa19d7fa42a2ddd3220703e6dc0a65f1338a43
|
||||
F main.mk c6501abe2d915ed1a2ec3d074e652c096177f93c50ac91f815c831e3417f9019
|
||||
F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271
|
||||
F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504
|
||||
F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421
|
||||
@@ -700,27 +706,27 @@ F sqlite3.1 acdff36db796e2d00225b911d3047d580cd136547298435426ce9d40347973cc
|
||||
F sqlite3.pc.in 48fed132e7cb71ab676105d2a4dc77127d8c1f3a
|
||||
F sqlite_cfg.h.in baf2e409c63d4e7a765e17769b6ff17c5a82bbd9cbf1e284fd2e4cefaff3fcf2
|
||||
F src/alter.c aa93e37e4a36a0525bbb2a2aeda20d2018f0aa995542c7dc658e031375e3f532
|
||||
F src/analyze.c 30bf40ec4208ead9e977bec017bccc8a9681820936e38ca5a4a7443100a6d5c5
|
||||
F src/analyze.c 9a8b67239d899ac12289db5db3f5bfe7f7a0ad1277f80f87ead1d048085876eb
|
||||
F src/attach.c 08235ab62ed5ccc93c22bf36e640d19effcd632319615851bccf724ec9341333
|
||||
F src/auth.c 4c1ea890e0069ad73bead5d17a5b12c34cfa4f1a24175c8147ea439b64be271c
|
||||
F src/backup.c 5c97e8023aab1ce14a42387eb3ae00ba5a0644569e3476f38661fa6f824c3523
|
||||
F src/bitvec.c 9eac5f42c11914d5ef00a75605bb205e934f435c579687f985f1f8b0995c8645
|
||||
F src/btmutex.c 79a43670447eacc651519a429f6ece9fd638563cf95b469d6891185ddae2b522
|
||||
F src/btree.c 8c5592c618741c5fc9733e7efe3927bfafad3e999d15b0a0f3f1d3f3e17b919e
|
||||
F src/btree.h 55066f513eb095db935169dab1dc2f7c7a747ef223c533f5d4ad4dfed346cbd0
|
||||
F src/btree.c 63ca6b647342e8cef643863cd0962a542f133e1069460725ba4461dcda92b03c
|
||||
F src/btree.h 18e5e7b2124c23426a283523e5f31a4bff029131b795bb82391f9d2f3136fc50
|
||||
F src/btreeInt.h 98aadb6dcb77b012cab2574d6a728fad56b337fc946839b9898c4b4c969e30b6
|
||||
F src/build.c 3a1840d9d171ce2d24f4c1f7acda7266ab796c664290c1acba65ff98ce2bd01e
|
||||
F src/callback.c db3a45e376deff6a16c0058163fe0ae2b73a2945f3f408ca32cf74960b28d490
|
||||
F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e
|
||||
F src/ctime.c b224d3db0f28c4a5f1407c50107a0a8133bd244ff3c7f6f8cedeb896a8cf1b64
|
||||
F src/date.c 89ce1ff20512a7fa5070ba6e7dd5c171148ca7d580955795bf97c79c2456144a
|
||||
F src/dbpage.c 12e49515d67d4a59625d71f9aa42499556cfdc2e4f1ea49086e674a7f47f46e5
|
||||
F src/dbpage.c db1be8adaf1f839ad733c08baeac5c22aa912f7b535865c0c061382602081360
|
||||
F src/dbstat.c 73362c0df0f40ad5523a6f5501224959d0976757b511299bf892313e79d14f5c
|
||||
F src/delete.c 03a77ba20e54f0f42ebd8eddf15411ed6bdb06a2c472ac4b6b336521bf7cea42
|
||||
F src/expr.c 6d5f2c38fe3ec06a7eac599dac822788b36064124e20112a844e9cd5156cb239
|
||||
F src/expr.c a9d9f5fdfbdd3b2c94d7af1b11f181464b8a641736cf32cb92fa3c5e7ecb30df
|
||||
F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007
|
||||
F src/fkey.c 928ed2517e8732113d2b9821aa37af639688d752f4ea9ac6e0e393d713eeb76f
|
||||
F src/func.c df400a1d3f4625997d4dd8a81951c303e066277c29b861d37e03cd152d7858dd
|
||||
F src/func.c 1d093b93b8f097665721e59a1c404d7db4dc591e1a777a7a1022dfbda21e108b
|
||||
F src/global.c a19e4b1ca1335f560e9560e590fc13081e21f670643367f99cb9e8f9dc7d615b
|
||||
F src/hash.c 9ee4269fb1d6632a6fecfb9479c93a1f29271bddbbaf215dd60420bcb80c7220
|
||||
F src/hash.h 3340ab6e1d13e725571d7cee6d3e3135f0779a7d8e76a9ce0a85971fa3953c51
|
||||
@@ -730,7 +736,7 @@ F src/insert.c f8d1a0f8ee258411009c6b7f2d93170e351bd19f5ad89d57e1180644297cbe70
|
||||
F src/json.c 68a98c020c22127f2d65f08855f7fc7460ff352a6ce0b543d8931dde83319c22
|
||||
F src/legacy.c d7874bc885906868cd51e6c2156698f2754f02d9eee1bae2d687323c3ca8e5aa
|
||||
F src/loadext.c 7432c944ff197046d67a1207790a1b13eec4548c85a9457eb0896bb3641dfb36
|
||||
F src/main.c e42b9134800a577060e4cd325ddf88c289a99ed57519553ad3465c1080a4d6d6
|
||||
F src/main.c d55d27db5a3b7bb12e1b723e350efd833586f22baa4b15ca2c0b4bde9a44ae29
|
||||
F src/malloc.c 410e570b30c26cc36e3372577df50f7a96ee3eed5b2b161c6b6b48773c650c5e
|
||||
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
|
||||
F src/mem1.c 3bb59158c38e05f6270e761a9f435bf19827a264c13d1631c58b84bdc96d73b2
|
||||
@@ -751,32 +757,32 @@ F src/os.h 1ff5ae51d339d0e30d8a9d814f4b8f8e448169304d83a7ed9db66a65732f3e63
|
||||
F src/os_common.h 6c0eb8dd40ef3e12fe585a13e709710267a258e2c8dd1c40b1948a1d14582e06
|
||||
F src/os_kv.c 4d39e1f1c180b11162c6dc4aa8ad34053873a639bac6baae23272fc03349986a
|
||||
F src/os_setup.h 6011ad7af5db4e05155f385eb3a9b4470688de6f65d6166b8956e58a3d872107
|
||||
F src/os_unix.c 779e83666ecd535f6725497ba6da069c1d15138ff6a4ee123edad1ae0cdfbe83
|
||||
F src/os_win.c 6ff43bac175bd9ed79e7c0f96840b139f2f51d01689a638fd05128becf94908a
|
||||
F src/os_unix.c 0ad4e0885294b3a0e135a18533590ec9ad91ffe82f6a08e55b40babd51772928
|
||||
F src/os_win.c 4e2f9f8845ff5cf21b15cb66cbfa0e34330bb536332d458d80597705ce6c866c
|
||||
F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a
|
||||
F src/pager.c b08600ebf0db90b6d1e9b8b6577c6fa3877cbe1a100bd0b2899e4c6e9adad4b3
|
||||
F src/pager.c d57287cd0864c88740d20618e5e595b144b85bfdaefccafd353d596f254a7b35
|
||||
F src/pager.h 4b1140d691860de0be1347474c51fee07d5420bd7f802d38cbab8ea4ab9f538a
|
||||
F src/parse.y a7a8d42eeff01d267444ddb476029b0b1726fb70ae3d77984140f17ad02e2d61
|
||||
F src/pcache.c 588cc3c5ccaaadde689ed35ce5c5c891a1f7b1f4d1f56f6cf0143b74d8ee6484
|
||||
F src/pcache.h 1497ce1b823cf00094bb0cf3bac37b345937e6f910890c626b16512316d3abf5
|
||||
F src/pcache1.c 49516ad7718a3626f28f710fa7448ef1fce3c07fd169acbb4817341950264319
|
||||
F src/pragma.c 52bfbf6dfd668b69b5eb9bd1186e3a67367c8453807150d6e75239229924f684
|
||||
F src/pragma.c cd613126f7cdd0c2ded4648c3c7b7b0239e678d7f3489e88c4b6d6858372fd07
|
||||
F src/pragma.h e690a356c18e98414d2e870ea791c1be1545a714ba623719deb63f7f226d8bb7
|
||||
F src/prepare.c 3ba0ad907b7773ed642f66cea8a2c9c8edc18841aa1050b6218dbb3479e86225
|
||||
F src/printf.c 6a87534ebfb9e5346011191b1f3a7ebc457f5938c7e4feeea478ecf53f6a41b2
|
||||
F src/printf.c 96f7f8baeedc7639da94e4e7a4a2c200e2537c4eec9e5e1c2ffc821f40eb3105
|
||||
F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c
|
||||
F src/resolve.c 9750a281f7ba073b4e6da2be1a6c4071f5d841a7746c5fb3f70d6d793b6675ea
|
||||
F src/resolve.c c8a5372b97b2a2e972a280676f06ddb5b74e885d3b1f5ce383f839907b57ef68
|
||||
F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
|
||||
F src/select.c 4b14337a2742f0c0beeba490e9a05507e9b4b12184b9cd12773501d08d48e3fe
|
||||
F src/shell.c.in 981efe98f98a983c1d0193d18528eb2d765207c0c82b67b610be60f17995a43e
|
||||
F src/sqlite.h.in 29bd29520f8dad4754f8d9a195edd5ec2598d2d3b1e9085a25d01697f70545c0
|
||||
F src/select.c 428f4aa8641eb02015e23f3377689bfbe57820a1fe9521104ecd84c7cf4773a4
|
||||
F src/shell.c.in b76590ad53010e3df2d311b1eb23d62029a6dca8a1b93e4dea7f38b9782ae694
|
||||
F src/sqlite.h.in 29fc900a58f394c7488d093fd7a8dcb14d3fa6399d5178cb20adcf88dbedfe39
|
||||
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
|
||||
F src/sqlite3ext.h 3f046c04ea3595d6bfda99b781926b17e672fd6d27da2ba6d8d8fc39981dcb54
|
||||
F src/sqliteInt.h 6ffd984ac04b5cfbe03f985a79d4664fe40be1198482add1c3de1137a8d9b86f
|
||||
F src/sqliteInt.h baae24292817e13e7fe748851c62efc381dcc4dac241b1182eac3d2f05eae52c
|
||||
F src/sqliteLimit.h 6878ab64bdeb8c24a1d762d45635e34b96da21132179023338c93f820eee6728
|
||||
F src/status.c cb11f8589a6912af2da3bb1ec509a94dd8ef27df4d4c1a97e0bcf2309ece972b
|
||||
F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1
|
||||
F src/tclsqlite.c c6888598f08dee3d9112a38ef42c8f5c89ca7f3190f4694744d0b84250f4bf8c
|
||||
F src/tclsqlite.c b30c05721ba0bc76120b2c942ab2453356ceeaed577381751cd1610f2ba6a088
|
||||
F src/tclsqlite.h c6af51f31a2b2172d674608763a4b98fdf5cd587e4025053e546fb8077757262
|
||||
F src/test1.c 8bf8b74145b768f42386787f93f6d6dad7bc400a4ee2d50e4ad5a06a20a97ef1
|
||||
F src/test2.c 7ebc518e6735939d8979273a6f7b1d9b5702babf059f6ad62499f7f60a9eb9a3
|
||||
@@ -834,10 +840,10 @@ F src/treeview.c 88aa39b754f5ef7214385c1bbbdd2f3dc20efafeed0cf590e8d1199b9c6e44a
|
||||
F src/trigger.c 0bb986a5b96047fd597c6aac28588853df56064e576e6b81ba777ef2ccaac461
|
||||
F src/update.c 0e01aa6a3edf9ec112b33eb714b9016a81241497b1fb7c3e74332f4f71756508
|
||||
F src/upsert.c 215328c3f91623c520ec8672c44323553f12caeb4f01b1090ebdca99fdf7b4f1
|
||||
F src/utf.c 7bc550af6f3ddd5f5dc82d092c41f728acb760c92e0b47f391963b01ae52569b
|
||||
F src/util.c 4d57ae861d0e234019be9596818228d7715e44e6efaccb612cf4498bedc2e023
|
||||
F src/utf.c 8b29d9a5956569ea2700f869669b8ef67a9662ee5e724ff77ab3c387e27094ba
|
||||
F src/util.c 9234bbddd2ba8ff22fc07331d34b01da6c4c4ce36ca34852e44dc746acdefa18
|
||||
F src/vacuum.c b763b6457bd058d2072ef9364832351fd8d11e8abf70cbb349657360f7d55c40
|
||||
F src/vdbe.c be5f58bc29f60252e041a618eae59e8d57d460ba136c5403cf0abf955560c457
|
||||
F src/vdbe.c 1f56a0ae24115c2e37213e77cf79aa3b8c8d0366755707385564f6b8dd83d0fb
|
||||
F src/vdbe.h c2549a215898a390de6669cfa32adba56f0d7e17ba5a7f7b14506d6fd5f0c36a
|
||||
F src/vdbeInt.h af7d7e8291edd0b19f2cd698e60e4d4031078f9a2f2328ac8f0b7efb134f8a1d
|
||||
F src/vdbeapi.c 53c7e26a2c0821a892b20eee2cde4656e31998212f3d515576c780dfaa45fd17
|
||||
@@ -849,13 +855,13 @@ F src/vdbetrace.c fe0bc29ebd4e02c8bc5c1945f1d2e6be5927ec12c06d89b03ef2a4def34bf8
|
||||
F src/vdbevtab.c fc46b9cbd759dc013f0b3724549cc0d71379183c667df3a5988f7e2f1bd485f3
|
||||
F src/vtab.c 316cd48e9320660db3047cd306cd056e4361180cebb4d0f10a39244e10c11422
|
||||
F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
|
||||
F src/wal.c ef68130ba330ee18c1cb22da36a881c82e3a3b109badbdc6a9b9acaf788a6688
|
||||
F src/wal.c 8b7e309a8012659ac9275ad8cdcc6acaf73fa04b1090e38a01335f230fd10681
|
||||
F src/wal.h ba252daaa94f889f4b2c17c027e823d9be47ce39da1d3799886bbd51f0490452
|
||||
F src/walker.c d5006d6b005e4ea7302ad390957a8d41ed83faa177e412f89bc5600a7462a014
|
||||
F src/where.c 461d41017d900d4248a268df96d2d30506c4dcc2257f4167c4f46072003ce2cf
|
||||
F src/where.c ed0e1e9ef15f01f5da54168ae2fdb5eb789a881fd20d7b4820e38454dedf9947
|
||||
F src/whereInt.h a5d079c346a658b7a6e9e47bb943d021e02fa1e6aed3b964ca112112a4892192
|
||||
F src/wherecode.c 5172d647798134e7c92536ddffe7e530c393d79b5dedd648b88faf2646c65baf
|
||||
F src/whereexpr.c 44f41ae554c7572e1de1485b3169b233ee04d464b2ee5881687ede3bf07cacfa
|
||||
F src/wherecode.c fa2b5bbb95b1589318f034a24e2a8b85e63cd2000b5b9b830a0874542a57e8ea
|
||||
F src/whereexpr.c 0f93a29cabd3a338d09a1f5c6770620a1ac51ec1157f3229502a7e7767c60b6f
|
||||
F src/window.c 499d48f315a09242dc68f2fac635ed27dcf6bbb0d9ab9084857898c64489e975
|
||||
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
|
||||
F test/affinity2.test ce1aafc86e110685b324e9a763eab4f2a73f737842ec3b687bd965867de90627
|
||||
@@ -906,7 +912,7 @@ F test/async2.test c0a9bd20816d7d6a2ceca7b8c03d3d69c28ffb8b
|
||||
F test/async3.test d73a062002376d7edc1fe3edff493edbec1fc2f7
|
||||
F test/async4.test 1787e3952128aa10238bf39945126de7ca23685a
|
||||
F test/async5.test 383ab533fdb9f7ad228cc99ee66e1acb34cc0dc0
|
||||
F test/atof1.test 7ec56debc04b32e8f9dc87239f4bbb07d84550fb83dd7475b0ead9e83beb35da
|
||||
F test/atof1.test bd21c4a0e718ab1470de07a2a79f2544d7903be34feebcc80de04beee4807b00
|
||||
F test/atomic.test 065a453dde33c77ff586d91ccaa6ed419829d492dbb1a5694b8a09f3f9d7d061
|
||||
F test/atomic2.test b6863b4aa552543874f80b42fb3063f1c8c2e3d8e56b6562f00a3cc347b5c1da
|
||||
F test/atrc.c c388fac43dbba05c804432a7135ae688b32e8f25818e9994ffba4b64cf60c27c
|
||||
@@ -1040,7 +1046,7 @@ F test/corruptJ.test 4d5ccc4bf959464229a836d60142831ef76a5aa4
|
||||
F test/corruptK.test ac13504593d89d69690d45479547616ed12644d42b5cb7eeb2e759a76fc23dcb
|
||||
F test/corruptL.test 652fc8ac0763a6fd3eb28b951d481924167b2d9936083bcc68253b2274a0c8fe
|
||||
F test/corruptM.test 7d574320e08c1b36caa3e47262061f186367d593a7e305d35f15289cc2c3e067
|
||||
F test/corruptN.test 7c099d153a554001b4fb829c799b01f2ea6276cbc32479131e0db0da4efd9cc4
|
||||
F test/corruptN.test 40bc47aee4af9aadff902be43f14d69dc17b3731448dad6c7cc722da913f1455
|
||||
F test/cost.test cc434a026b1e9d0d98137a147e24e5daf1b1ad09e9ff7da63b34c83ddd136d92
|
||||
F test/count.test cd4bd531066e8d77ef8fe1e3fc8253d042072e117ccab214b290cf83f1602249
|
||||
F test/countofview.test 4088e461a10ee33e69803c177a69aa1d7bba81a9ffc2df66d76465a22ca7fdfc
|
||||
@@ -1123,6 +1129,7 @@ F test/enc4.test c8f1ce3618508fd0909945beb8b8831feef2c020
|
||||
F test/eqp.test 82f221e8cd588434d7f3bba9a0f4c78cbe7a541615a41632e12f50608bfb4a99
|
||||
F test/eqp2.test 6e8996148de88f0e7670491e92e712a2920a369b4406f21a27c3c9b6a46b68dd
|
||||
F test/errmsg.test eae9f091eb39ce7e20305de45d8e5d115b68fa856fba4ea6757b6ca3705ff7f9
|
||||
F test/errofst1.test 6da78363739ba8991f498396ab331b5d64e7ab5c4172c12b5884683ef523ac53
|
||||
F test/eval.test 73969a2d43a511bf44080c44485a8c4d796b6a4f038d19e491867081155692c0
|
||||
F test/exclusive.test 7ff63be7503990921838d5c9f77f6e33e68e48ed1a9d48cd28745bf650bf0747
|
||||
F test/exclusive2.test cd70b1d9c6fffd336f9795b711dcc5d9ceba133ad3f7001da3fda63615bdc91e
|
||||
@@ -1187,6 +1194,7 @@ F test/fts3corrupt3.test 0d5b69a0998b4adf868cc301fc78f3d0707745f1d984ce044c205cd
|
||||
F test/fts3corrupt4.test a451033ae31db9c5979a7612dee80fb4f221db104a2eeeabd1c9adcc8e8fe95a
|
||||
F test/fts3corrupt5.test 0549f85ec4bd22e992f645f13c59b99d652f2f5e643dac75568bfd23a6db7ed5
|
||||
F test/fts3corrupt6.test f417c910254f32c0bc9ead7affa991a1d5aec35b3b32a183ffb05eea78289525
|
||||
F test/fts3corrupt7.test 1da31776e24bb91d3c028e663456b61280b121a74496ccf2fef3fe33790ad2b0
|
||||
F test/fts3cov.test 7eacdbefd756cfa4dc2241974e3db2834e9b372ca215880e00032222f32194cf
|
||||
F test/fts3d.test 2bd8c97bcb9975f2334147173b4872505b6a41359a4f9068960a36afe07a679f
|
||||
F test/fts3defer.test f4c20e4c7153d20a98ee49ee5f3faef624fefc9a067f8d8d629db380c4d9f1de
|
||||
@@ -1201,7 +1209,7 @@ F test/fts3expr3.test c4d4a7d6327418428c96e0a3a1137c251b8dfbf8
|
||||
F test/fts3expr4.test 6c7675bbdbffe6ffc95e9e861500b8ac3f739c4d004ffda812f138eeb1b45529
|
||||
F test/fts3expr5.test a5b9a053becbdb8e973fbf4d6d3abaabeb42d511d1848bd57931f3e0a1cf983e
|
||||
F test/fts3f.test 8c438d5e1cab526b0021988fb1dc70cf3597b006a33ffd6c955ee89929077fe3
|
||||
F test/fts3fault.test f4e1342acfe6d216a001490e8cd52afac1f9ffe4a11bbcdcb296129a45c5df45
|
||||
F test/fts3fault.test 9228f00cd69e2a5d2ed0f06c181981f4f90bd36da9f86b73f3a58b4b23451fd4
|
||||
F test/fts3fault2.test 7b2741e5095367238380b0fcdb837f36c24484c7a5f353659b387df63cf039ec
|
||||
F test/fts3fault3.test ccdd2292dd2d4e21e30fc5f4c8e064f79e516087eec5ff57ab6bc4f6a7714097
|
||||
F test/fts3first.test dbdedd20914c8d539aa3206c9b34a23775644641
|
||||
@@ -1297,7 +1305,7 @@ F test/in3.test 3cbf58c87f4052cee3a58b37b6389777505aa0c0
|
||||
F test/in4.test bb767ec1cfd1730256f0a83219f0acda36bc251b63f8b8bb7d8c7cff17875a4f
|
||||
F test/in5.test 4fd79c70dfa0681313e8cdca07f5ff0400bdc0e20f808a5c59eaef1e4b48082a
|
||||
F test/in6.test f5f40d6816a8bb7c784424b58a10ac38efb76ab29127a2c17399e0cbeeda0e4b
|
||||
F test/in7.test 9256cdb30dc487f2078bb4bb30f43f2c1ff4d277a9c7c9a14bd1c9510c9c8cae
|
||||
F test/in7.test 5050b648510d88bd27ff6b40991a45e1cc277c20e258162e81650e01069a56bb
|
||||
F test/incrblob.test c9b96afc292aeff43d6687bcb09b0280aa599822
|
||||
F test/incrblob2.test a494c9e848560039a23974b9119cfc2cf3ad3bd15cc2694ee6367ae537ef8f1f
|
||||
F test/incrblob3.test 67621a04b3084113bf38ce03797d70eca012d9d8f948193b8f655df577b0da6f
|
||||
@@ -1322,6 +1330,7 @@ F test/indexA.test 11d84f6995e6e5b9d8315953fb1b6d29772ee7c7803ee9112715e7e4dd3e4
|
||||
F test/indexedby.test f21eca4f7a6ffe14c8500a7ad6cd53166666c99e5ccd311842a28bc94a195fe0
|
||||
F test/indexexpr1.test 24fa85a12da384dd1d56f7b24e593c51a8a54b4c5e2e8bbb9e5fdf1099427faf
|
||||
F test/indexexpr2.test 1c382e81ef996d8ae8b834a74f2a9013dddf59214c32201d7c8a656d739f999a
|
||||
F test/indexexpr3.test 9d893bf440937ebcc1e59c7c9c1505c40c918346a3ddde76a69078f3c733c45d
|
||||
F test/indexfault.test 98d78a8ff1f5335628b62f886a1cb7c7dac1ef6d48fa39c51ec871c87dce9811
|
||||
F test/init.test 15c823093fdabbf7b531fe22cf037134d09587a7
|
||||
F test/insert.test 4e3f0de67aac3c5be1f4aaedbcea11638f1b5cdc9a3115be14d19aa9db7623c6
|
||||
@@ -1388,7 +1397,7 @@ F test/kvtest.c 6e0228409ea7ca0497dad503fbd109badb5e59545d131014b6aaac68b56f484a
|
||||
F test/lastinsert.test 42e948fd6442f07d60acbd15d33fb86473e0ef63
|
||||
F test/laststmtchanges.test ae613f53819206b3222771828d024154d51db200
|
||||
F test/lemon-test01.y 70110eff607ab137ccc851edb2bc7e14a6d4f246b5d2d25f82a60b69d87a9ff2
|
||||
F test/like.test 242ee7f5d08a031144c0daf63bbd7e7710c847ccf387a83347e0b61b3aa69526
|
||||
F test/like.test b3ea2ba3558199aa8f25a42ddeb54772e234fab50868c9f066047acdbda8fc58
|
||||
F test/like2.test d3be15fefee3e02fc88942a9b98f26c5339bbdef7783c90023c092c4955fe3d3
|
||||
F test/like3.test a76e5938fadbe6d32807284c796bafd869974a961057bc5fc5a28e06de98745c
|
||||
F test/limit.test 350f5d03c29e7dff9a2cde016f84f8d368d40bcd02fa2b2a52fa10c4bf3cbfaf
|
||||
@@ -1402,7 +1411,7 @@ F test/lock.test be4fe08118fb988fed741f429b7dd5d65e1c90db
|
||||
F test/lock2.test 5242d8ac4e2d59c403aebff606af449b455aceff
|
||||
F test/lock3.test f271375930711ae044080f4fe6d6eda930870d00
|
||||
F test/lock4.test 27143363eda1622f03c133efc8db808fc331afd973486cb571ea71cd717d37b8
|
||||
F test/lock5.test 24693e40a805f71d80836f720d1f2034684a39b64f1e1990989002c7968c11ee
|
||||
F test/lock5.test 583cae05992af0f66607286917f7d5f8aed3b6053c52df5994efb98f2a8fdbaf
|
||||
F test/lock6.test ad5b387a3a8096afd3c68a55b9535056431b0cf5
|
||||
F test/lock7.test 49f1eaff1cdc491cc5dee3669f3c671d9f172431
|
||||
F test/lock_common.tcl 2f3f7f2e9637f93ccf609df48ef5b27a50278b6b1cd752b445d52262e5841413
|
||||
@@ -1533,7 +1542,7 @@ F test/printf.test 685fec5a0c5af2490ab0632775a301554361d674211d690f5bee0a97b0533
|
||||
F test/printf2.test 3f55c1871a5a65507416076f6eb97e738d5210aeda7595a74ee895f2224cce60
|
||||
F test/progress.test ebab27f670bd0d4eb9d20d49cef96e68141d92fb
|
||||
F test/ptrchng.test ef1aa72d6cf35a2bbd0869a649b744e9d84977fc
|
||||
F test/pushdown.test 84b525767442b3695d671f9df59dd91cf0ed8fb24cbbcdc55959f0dadeee8b39
|
||||
F test/pushdown.test 46a626ef1c0ca79b85296ff2e078b9da20a50e9b804b38f441590c3987580ddd
|
||||
F test/queryonly.test 5f653159e0f552f0552d43259890c1089391dcca
|
||||
F test/quick.test 1681febc928d686362d50057c642f77a02c62e57
|
||||
F test/quickcheck.test a4b7e878cd97e46108291c409b0bf8214f29e18fddd68a42bc5c1375ad1fb80a
|
||||
@@ -1626,7 +1635,7 @@ F test/sharedA.test 64bdd21216dda2c6a3bd3475348ccdc108160f34682c97f2f51c19fc0e21
|
||||
F test/sharedB.test 1a84863d7a2204e0d42f2e1606577c5e92e4473fa37ea0f5bdf829e4bf8ee707
|
||||
F test/shared_err.test 32634e404a3317eeb94abc7a099c556a346fdb8fb3858dbe222a4cbb8926a939
|
||||
F test/sharedlock.test 5ede3c37439067c43b0198f580fd374ebf15d304
|
||||
F test/shell1.test b02d628494fa284cdb2b7b2fecdadea96913796afd623f340a79d68f055dcb7e
|
||||
F test/shell1.test 5d84e415adf7cc4edd5913c4f23c761104ff135b9c190fcf7b430a4cbca6cb65
|
||||
F test/shell2.test 01a01f76ed98088ce598794fbf5b359e148271541a8ddbf79d21cc353cc67a24
|
||||
F test/shell3.test db1953a8e59d08e9240b7cc5948878e184f7eb2623591587f8fd1f1a5bd536d8
|
||||
F test/shell4.test 522fdc628c55eff697b061504fb0a9e4e6dfc5d9087a633ab0f3dd11bcc4f807
|
||||
@@ -1647,7 +1656,7 @@ F test/skipscan5.test 0672103fd2c8f96bd114133f356192b35ece45c794fe3677e1d9e5e310
|
||||
F test/skipscan6.test bddbb35dd335e2d21b7791a61e3b2e1f3255dc307ce80aa6fe19cc298e6feb13
|
||||
F test/snapshot.test a504f2e7009f512ef66c719f0ea1c55a556bdaf1e1312c80a04d46fc1a3e9632
|
||||
F test/snapshot2.test 8d6ff5dd9cc503f6e12d408a30409c3f9c653507b24408d9cd7195931c89bc54
|
||||
F test/snapshot3.test 8744313270c55f6e18574283553d3c5c5fe4c5970585663613a0e75c151e599b
|
||||
F test/snapshot3.test 41350216abc6c7da37113ad462259c070786e5ad70bdc8709daaed148b1b3a2c
|
||||
F test/snapshot4.test d4e9347ef2fcabc491fc893506c7bbaf334da3be111d6eb4f3a97cc623b78322
|
||||
F test/snapshot_fault.test 129234ceb9b26a0e1000e8563a16e790f5c1412354e70749cbd78c3d5d07d60a
|
||||
F test/snapshot_up.test 77dc7853bfb2b4fa249f76e1714cfa1e596826165d9ef22c06ac3a0b7b778d9a
|
||||
@@ -1697,12 +1706,12 @@ F test/swarmvtab2.test c948cb2fdfc5b01d85e8f6d6504854202dc1a0782ab2a0ed61538f27c
|
||||
F test/swarmvtab3.test 41a3ab47cb7a834d4e5336425103b617410a67bb95d335ef536f887587ece073
|
||||
F test/swarmvtabfault.test 8a67a9f27c61073a47990829e92bc0c64420a807cb642b15a25f6c788210ed95
|
||||
F test/symlink.test 4368af0e213dd6e726a6240a16f2bb96a5a58f83f2d5d60652f27547b28cbf06
|
||||
F test/symlink2.test 9531f475a53d8781c4f81373f87faf2e2aff4f5fb2102ec6386e0c827916a670
|
||||
F test/symlink2.test bf932ff7fe95c9dbb39d2a990df9098b0ea943233c97e40098e0a8d6b559a96f
|
||||
F test/sync.test 89539f4973c010eda5638407e71ca7fddbcd8e0594f4c9980229f804d4333092
|
||||
F test/sync2.test 8f9f7d4f6d5be8ca8941a8dadcc4299e558cb6a1ff653a9469146c7a76ef2039
|
||||
F test/syscall.test a067468b43b8cb2305e9f9fe414e5f40c875bb5d2cba5f00b8154396e95fcf37
|
||||
F test/sysfault.test c9f2b0d8d677558f74de750c75e12a5454719d04
|
||||
F test/tabfunc01.test 6002a5f37b76355f173c75c2b3b03173b19d6a8b078c5baaa4c78bbcd0fa6323
|
||||
F test/tabfunc01.test 7be82bd50c7ede7f01b2dd17cd1b84f352c516078222d0b067d858f081e3f9a7
|
||||
F test/table.test 7862a00b58b5541511a26757ea9c5c7c3f8298766e98aa099deec703d9c0a8e0
|
||||
F test/tableapi.test ecbcc29c4ab62c1912c3717c48ea5c5e59f7d64e4a91034e6148bd2b82f177f4
|
||||
F test/tableopts.test dba698ba97251017b7c80d738c198d39ab747930
|
||||
@@ -1715,7 +1724,7 @@ F test/temptable2.test 76821347810ecc88203e6ef0dd6897b6036ac788e9dd3e6b04fd4d163
|
||||
F test/temptable3.test d11a0974e52b347e45ee54ef1923c91ed91e4637
|
||||
F test/temptrigger.test 38f0ca479b1822d3117069e014daabcaacefffcc
|
||||
F test/tester.tcl 7b44f1a9b9a2de8112695b908afc21dd9a68cd2d44e84b73f1b27b53492c0d59
|
||||
F test/testrunner.tcl 3dd75b45593d2afa2e3bca76121297a9f163bebb98474b13536f326829a71db1 x
|
||||
F test/testrunner.tcl 6215e11be403a16947bbb3b31cf4905b417155df242e4c5229f85bcda1c28f50 x
|
||||
F test/testrunner_data.tcl c7b3b911e44f7e8c01cc6bc7571e16115cdc2e4db46630bd2acd7a931a46380e
|
||||
F test/thread001.test a0985c117eab62c0c65526e9fa5d1360dd1cac5b03bde223902763274ce21899
|
||||
F test/thread002.test c24c83408e35ba5a952a3638b7ac03ccdf1ce4409289c54a050ac4c5f1de7502
|
||||
@@ -1725,7 +1734,7 @@ F test/thread005.test 50d10b5684399676174bd96c94ad4250b1a2c8b6
|
||||
F test/thread1.test df115faa10a4ba1d456e9d4d9ec165016903eae4
|
||||
F test/thread2.test f35d2106452b77523b3a2b7d1dcde2e5ee8f9e46
|
||||
F test/thread3.test a12656a56cdf67acb6a2ff7638826c6d6a645f79909d86df521045ad31cf547d
|
||||
F test/thread_common.tcl 334639cadcb9f912bf82aa73f49efd5282e6cadd
|
||||
F test/thread_common.tcl b3b19a769fe30ef5537cdfa60acd49b78f771301627720d1add2d3bac77d9039
|
||||
F test/threadtest1.c 6029d9c5567db28e6dc908a0c63099c3ba6c383b
|
||||
F test/threadtest2.c a70a8e94bef23339d34226eb9521015ef99f4df8
|
||||
F test/threadtest3.c 655bff6c0895ec03f014126aa65e808fac9aae8c5a7a7da58a510cbe8b43b781
|
||||
@@ -2103,11 +2112,11 @@ F tool/GetTclKit.bat d84033c6a93dfe735d247f48ba00292a1cc284dcf69963e5e672444e045
|
||||
F tool/Replace.cs 02c67258801c2fb5f63231e0ac0f220b4b36ba91
|
||||
F tool/build-all-msvc.bat c817b716e0edeecaf265a6775b63e5f45c34a6544f1d4114a222701ed5ac79ab x
|
||||
F tool/build-shell.sh 369c4b171cc877ad974fef691e4da782b4c1e99fe8f4361316c735f64d49280f
|
||||
F tool/buildtclext.tcl b64d250517b148e644d26fcbc097851867a0df52cd4bafe9bcd94b8421e1428a
|
||||
F tool/buildtclext.tcl b3d76545dac9cb44c3476910ff62475f60f29a773ebf96af4e97edef1a510c63
|
||||
F tool/cg_anno.tcl c1f875f5a4c9caca3d59937b16aff716f8b1883935f1b4c9ae23124705bc8099 x
|
||||
F tool/checkSpacing.c 810e51703529a204fc4e1eb060e9ab663e3c06d2
|
||||
F tool/cktclsh.sh 6075eef9c6b9ba4b38fef2ca2a66d25f2311bd3c610498d18a9b01f861629cca
|
||||
F tool/custom.txt 6cdf298f43e1db4bb91406d14777669b8fb1df790837823fa6754c4308decc27
|
||||
F tool/custom.txt 24ed55e71c5edae0067ba159bbf09240d58b160331f7716e95816cd3aa0ba5c4
|
||||
F tool/dbhash.c 5da0c61032d23d74f2ab84ffc5740f0e8abec94f2c45c0b4306be7eb3ae96df0
|
||||
F tool/dbtotxt.c ca48d34eaca6d6b6e4bd6a7be2b72caf34475869054240244c60fa7e69a518d6
|
||||
F tool/dbtotxt.md c9a57af8739957ef36d2cfad5c4b1443ff3688ed33e4901ee200c8b651f43f3c
|
||||
@@ -2146,7 +2155,7 @@ F tool/mksqlite3c-noext.tcl 4f7cfef5152b0c91920355cbfc1d608a4ad242cb819f1aea07f6
|
||||
F tool/mksqlite3c.tcl c6acfdf4e4ef93478ff3ce3cd593e17abb03f446036ce710c3156bcfa18665e0
|
||||
F tool/mksqlite3h.tcl d391cff7cad0a372ee1406faee9ccc7dad9cb80a0c95cae0f73d10dd26e06762
|
||||
F tool/mksqlite3internalh.tcl eb994013e833359137eb53a55acdad0b5ae1049b
|
||||
F tool/mktoolzip.tcl c7a9b685f5131d755e7d941cec50cee7f34178b9e34c9a89811eeb08617f8423
|
||||
F tool/mktoolzip.tcl 34b4e92be544f820e2cc26f143f7d5aec511e826ec394cc82969a5dcf7c7a27c
|
||||
F tool/mkvsix.tcl 67b40996a50f985a573278eea32fc5a5eb6110bdf14d33f1d8086e48c69e540a
|
||||
F tool/offsets.c 8ed2b344d33f06e71366a9b93ccedaa38c096cc1dbd4c3c26ad08c6115285845
|
||||
F tool/omittest-msvc.tcl d6b8f501ac1d7798c4126065030f89812379012cad98a1735d6d7221492abc08
|
||||
@@ -2174,11 +2183,11 @@ F tool/speedtest8inst1.c 7ce07da76b5e745783e703a834417d725b7d45fd
|
||||
F tool/spellsift.tcl 52b4b04dc4333c7ab024f09d9d66ed6b6f7c6eb00b38497a09f338fa55d40618 x
|
||||
F tool/split-sqlite3c.tcl 5aa60643afca558bc732b1444ae81a522326f91e1dc5665b369c54f09e20de60
|
||||
F tool/sqldiff.c 2a0987d183027c795ced13d6749061c1d2f38e24eddb428f56fa64c3a8f51e4b
|
||||
F tool/sqlite3-rsync.c 187b262035c1159b047dbfa1959c168b87b5a153b63465e8c8bd1b54fabf4460
|
||||
F tool/sqlite3_analyzer.c.in 348ba349bbdc93c9866439f9f935d7284866a2a4e6898bc906ae1204ade56918
|
||||
F tool/sqlite3_rsync.c 6c9cac5a9197f591985b271aeff803ec4fb4db36c8eab97e1331ff64aa1b8d94
|
||||
F tool/sqltclsh.c.in 1bcc2e9da58fadf17b0bf6a50e68c1159e602ce057210b655d50bad5aaaef898
|
||||
F tool/sqltclsh.tcl 862f4cf1418df5e1315b5db3b5ebe88969e2a784525af5fbf9596592f14ed848
|
||||
F tool/src-verify.c 41c586dee84d0b190ad13e0282ed83d4a65ec9fefde9adf4943efdf6558eea7f
|
||||
F tool/src-verify.c d00f93263aa2fa6ba0cba0106d95458e6effb94fdb5fc634f56834f90c05bbb4
|
||||
F tool/srcck1.c 371de5363b70154012955544f86fdee8f6e5326f
|
||||
F tool/srctree-check.tcl c15f860a3c97d5f7b4c14b60392d9466af29dd006c4ef18127f502641e2977a8
|
||||
F tool/stack_usage.tcl f8e71b92cdb099a147dad572375595eae55eca43
|
||||
@@ -2213,8 +2222,10 @@ F vsixtest/vsixtest.tcl 6195aba1f12a5e10efc2b8c0009532167be5e301abe5b31385638080
|
||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||
P f622b52024c8bec1d241b1dc480fbbd839fc1af50b6220f012812503de2c656e
|
||||
R 7cb8c5e39f3b0a66c9a6cd2a8aa3a2f9
|
||||
P 07bd06b13c42edb3a3efa8f26d48823c9ffa3d5ec8d06ee21a33b6c1d29b4726
|
||||
R 3df4e8abea3bba7571d6c59d3633b08c
|
||||
T +sym-release *
|
||||
T +sym-version-3.47.2 *
|
||||
U drh
|
||||
Z 479f0ce23bd7d658aebb57b7e11ea9e8
|
||||
Z 2b27d6949c6873483f90ec22ca9e3998
|
||||
# Remove this line to create a well-formed Fossil manifest.
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
11d6a89e4a25c3f884ff617036d239dc42522859400cd1f4674634f6c7adbb02
|
||||
2aabe05e2e8cae4847a802ee2daddc1d7413d8fc560254d93ee3e72c14685b6c
|
||||
|
||||
+2
-2
@@ -1800,8 +1800,8 @@ static int loadStatTbl(
|
||||
char *zIndex; /* Index name */
|
||||
Index *pIdx; /* Pointer to the index object */
|
||||
int nSample; /* Number of samples */
|
||||
int nByte; /* Bytes of space required */
|
||||
int i; /* Bytes of space required */
|
||||
i64 nByte; /* Bytes of space required */
|
||||
i64 i; /* Bytes of space required */
|
||||
tRowcnt *pSpace; /* Available allocated memory space */
|
||||
u8 *pPtr; /* Available memory as a u8 for easier manipulation */
|
||||
|
||||
|
||||
+19
@@ -4746,6 +4746,25 @@ int sqlite3BtreeCursorSize(void){
|
||||
return ROUND8(sizeof(BtCursor));
|
||||
}
|
||||
|
||||
#ifdef SQLITE_DEBUG
|
||||
/*
|
||||
** Return true if and only if the Btree object will be automatically
|
||||
** closed with the BtCursor closes. This is used within assert() statements
|
||||
** only.
|
||||
*/
|
||||
int sqlite3BtreeClosesWithCursor(
|
||||
Btree *pBtree, /* the btree object */
|
||||
BtCursor *pCur /* Corresponding cursor */
|
||||
){
|
||||
BtShared *pBt = pBtree->pBt;
|
||||
if( (pBt->openFlags & BTREE_SINGLE)==0 ) return 0;
|
||||
if( pBt->pCursor!=pCur ) return 0;
|
||||
if( pCur->pNext!=0 ) return 0;
|
||||
if( pCur->pBtree!=pBtree ) return 0;
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Initialize memory that will be converted into a BtCursor object.
|
||||
**
|
||||
|
||||
@@ -240,6 +240,9 @@ int sqlite3BtreeCursor(
|
||||
);
|
||||
BtCursor *sqlite3BtreeFakeValidCursor(void);
|
||||
int sqlite3BtreeCursorSize(void);
|
||||
#ifdef SQLITE_DEBUG
|
||||
int sqlite3BtreeClosesWithCursor(Btree*,BtCursor*);
|
||||
#endif
|
||||
void sqlite3BtreeCursorZero(BtCursor*);
|
||||
void sqlite3BtreeCursorHintFlags(BtCursor*, unsigned);
|
||||
#ifdef SQLITE_ENABLE_CURSOR_HINTS
|
||||
|
||||
+24
-30
@@ -57,8 +57,8 @@ struct DbpageCursor {
|
||||
struct DbpageTable {
|
||||
sqlite3_vtab base; /* Base class. Must be first */
|
||||
sqlite3 *db; /* The database */
|
||||
int nTrunc; /* Entries in aTrunc[] */
|
||||
Pgno *aTrunc; /* Truncation size for each database */
|
||||
int iDbTrunc; /* Database to truncate */
|
||||
Pgno pgnoTrunc; /* Size to truncate to */
|
||||
};
|
||||
|
||||
/* Columns */
|
||||
@@ -107,8 +107,6 @@ static int dbpageConnect(
|
||||
** Disconnect from or destroy a dbpagevfs virtual table.
|
||||
*/
|
||||
static int dbpageDisconnect(sqlite3_vtab *pVtab){
|
||||
DbpageTable *pTab = (DbpageTable *)pVtab;
|
||||
sqlite3_free(pTab->aTrunc);
|
||||
sqlite3_free(pVtab);
|
||||
return SQLITE_OK;
|
||||
}
|
||||
@@ -375,19 +373,12 @@ static int dbpageUpdate(
|
||||
if( sqlite3_value_type(argv[3])!=SQLITE_BLOB
|
||||
|| sqlite3_value_bytes(argv[3])!=szPage
|
||||
){
|
||||
if( sqlite3_value_type(argv[3])==SQLITE_NULL && isInsert ){
|
||||
if( iDb>=pTab->nTrunc ){
|
||||
testcase( pTab->aTrunc!=0 );
|
||||
pTab->aTrunc = sqlite3_realloc(pTab->aTrunc, (iDb+1)*sizeof(Pgno));
|
||||
if( pTab->aTrunc ){
|
||||
int j;
|
||||
for(j=pTab->nTrunc; j<iDb; j++) pTab->aTrunc[j] = 0;
|
||||
pTab->nTrunc = iDb+1;
|
||||
}else{
|
||||
return SQLITE_NOMEM;
|
||||
}
|
||||
}
|
||||
pTab->aTrunc[iDb] = pgno;
|
||||
if( sqlite3_value_type(argv[3])==SQLITE_NULL && isInsert && pgno>1 ){
|
||||
/* "INSERT INTO dbpage($PGNO,NULL)" causes page number $PGNO and
|
||||
** all subsequent pages to be deleted. */
|
||||
pTab->iDbTrunc = iDb;
|
||||
pgno--;
|
||||
pTab->pgnoTrunc = pgno;
|
||||
}else{
|
||||
zErr = "bad page value";
|
||||
goto update_fail;
|
||||
@@ -400,6 +391,7 @@ static int dbpageUpdate(
|
||||
if( (rc = sqlite3PagerWrite(pDbPage))==SQLITE_OK && pData ){
|
||||
unsigned char *aPage = sqlite3PagerGetData(pDbPage);
|
||||
memcpy(aPage, pData, szPage);
|
||||
pTab->pgnoTrunc = 0;
|
||||
}
|
||||
}
|
||||
sqlite3PagerUnref(pDbPage);
|
||||
@@ -423,29 +415,31 @@ static int dbpageBegin(sqlite3_vtab *pVtab){
|
||||
Btree *pBt = db->aDb[i].pBt;
|
||||
if( pBt ) (void)sqlite3BtreeBeginTrans(pBt, 1, 0);
|
||||
}
|
||||
if( pTab->nTrunc>0 ){
|
||||
memset(pTab->aTrunc, 0, sizeof(pTab->aTrunc[0])*pTab->nTrunc);
|
||||
}
|
||||
pTab->pgnoTrunc = 0;
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
/* Invoke sqlite3PagerTruncate() as necessary, just prior to COMMIT
|
||||
*/
|
||||
static int dbpageSync(sqlite3_vtab *pVtab){
|
||||
int iDb;
|
||||
DbpageTable *pTab = (DbpageTable *)pVtab;
|
||||
|
||||
for(iDb=0; iDb<pTab->nTrunc; iDb++){
|
||||
if( pTab->aTrunc[iDb]>0 ){
|
||||
Btree *pBt = pTab->db->aDb[iDb].pBt;
|
||||
Pager *pPager = sqlite3BtreePager(pBt);
|
||||
sqlite3PagerTruncateImage(pPager, pTab->aTrunc[iDb]);
|
||||
pTab->aTrunc[iDb] = 0;
|
||||
}
|
||||
if( pTab->pgnoTrunc>0 ){
|
||||
Btree *pBt = pTab->db->aDb[pTab->iDbTrunc].pBt;
|
||||
Pager *pPager = sqlite3BtreePager(pBt);
|
||||
sqlite3PagerTruncateImage(pPager, pTab->pgnoTrunc);
|
||||
}
|
||||
pTab->pgnoTrunc = 0;
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
/* Cancel any pending truncate.
|
||||
*/
|
||||
static int dbpageRollbackTo(sqlite3_vtab *pVtab, int notUsed1){
|
||||
DbpageTable *pTab = (DbpageTable *)pVtab;
|
||||
pTab->pgnoTrunc = 0;
|
||||
(void)notUsed1;
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** Invoke this routine to register the "dbpage" virtual table module
|
||||
@@ -474,7 +468,7 @@ int sqlite3DbpageRegister(sqlite3 *db){
|
||||
0, /* xRename */
|
||||
0, /* xSavepoint */
|
||||
0, /* xRelease */
|
||||
0, /* xRollbackTo */
|
||||
dbpageRollbackTo, /* xRollbackTo */
|
||||
0, /* xShadowName */
|
||||
0 /* xIntegrity */
|
||||
};
|
||||
|
||||
+64
@@ -4554,6 +4554,59 @@ static int exprCodeInlineFunction(
|
||||
return target;
|
||||
}
|
||||
|
||||
/*
|
||||
** Expression Node callback for sqlite3ExprCanReturnSubtype().
|
||||
**
|
||||
** Only a function call is able to return a subtype. So if the node
|
||||
** is not a function call, return WRC_Prune immediately.
|
||||
**
|
||||
** A function call is able to return a subtype if it has the
|
||||
** SQLITE_RESULT_SUBTYPE property.
|
||||
**
|
||||
** Assume that every function is able to pass-through a subtype from
|
||||
** one of its argument (using sqlite3_result_value()). Most functions
|
||||
** are not this way, but we don't have a mechanism to distinguish those
|
||||
** that are from those that are not, so assume they all work this way.
|
||||
** That means that if one of its arguments is another function and that
|
||||
** other function is able to return a subtype, then this function is
|
||||
** able to return a subtype.
|
||||
*/
|
||||
static int exprNodeCanReturnSubtype(Walker *pWalker, Expr *pExpr){
|
||||
int n;
|
||||
FuncDef *pDef;
|
||||
sqlite3 *db;
|
||||
if( pExpr->op!=TK_FUNCTION ){
|
||||
return WRC_Prune;
|
||||
}
|
||||
assert( ExprUseXList(pExpr) );
|
||||
db = pWalker->pParse->db;
|
||||
n = ALWAYS(pExpr->x.pList) ? pExpr->x.pList->nExpr : 0;
|
||||
pDef = sqlite3FindFunction(db, pExpr->u.zToken, n, ENC(db), 0);
|
||||
if( NEVER(pDef==0) || (pDef->funcFlags & SQLITE_RESULT_SUBTYPE)!=0 ){
|
||||
pWalker->eCode = 1;
|
||||
return WRC_Prune;
|
||||
}
|
||||
return WRC_Continue;
|
||||
}
|
||||
|
||||
/*
|
||||
** Return TRUE if expression pExpr is able to return a subtype.
|
||||
**
|
||||
** A TRUE return does not guarantee that a subtype will be returned.
|
||||
** It only indicates that a subtype return is possible. False positives
|
||||
** are acceptable as they only disable an optimization. False negatives,
|
||||
** on the other hand, can lead to incorrect answers.
|
||||
*/
|
||||
static int sqlite3ExprCanReturnSubtype(Parse *pParse, Expr *pExpr){
|
||||
Walker w;
|
||||
memset(&w, 0, sizeof(w));
|
||||
w.pParse = pParse;
|
||||
w.xExprCallback = exprNodeCanReturnSubtype;
|
||||
sqlite3WalkExpr(&w, pExpr);
|
||||
return w.eCode;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Check to see if pExpr is one of the indexed expressions on pParse->pIdxEpr.
|
||||
** If it is, then resolve the expression by reading from the index and
|
||||
@@ -4586,6 +4639,17 @@ static SQLITE_NOINLINE int sqlite3IndexedExprLookup(
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
/* Functions that might set a subtype should not be replaced by the
|
||||
** value taken from an expression index if they are themselves an
|
||||
** argument to another scalar function or aggregate.
|
||||
** https://sqlite.org/forum/forumpost/68d284c86b082c3e */
|
||||
if( ExprHasProperty(pExpr, EP_SubtArg)
|
||||
&& sqlite3ExprCanReturnSubtype(pParse, pExpr)
|
||||
){
|
||||
continue;
|
||||
}
|
||||
|
||||
v = pParse->pVdbe;
|
||||
assert( v!=0 );
|
||||
if( p->bMaybeNullRow ){
|
||||
|
||||
+87
-3
@@ -2535,7 +2535,13 @@ static void signFunc(
|
||||
** Implementation of fpdecode(x,y,z) function.
|
||||
**
|
||||
** x is a real number that is to be decoded. y is the precision.
|
||||
** z is the maximum real precision.
|
||||
** z is the maximum real precision. Return a string that shows the
|
||||
** results of the sqlite3FpDecode() function.
|
||||
**
|
||||
** Used for testing and debugging only, specifically testing and debugging
|
||||
** of the sqlite3FpDecode() function. This SQL function does not appear
|
||||
** in production builds. This function is not an API and is subject to
|
||||
** modification or removal in future versions of SQLite.
|
||||
*/
|
||||
static void fpdecodeFunc(
|
||||
sqlite3_context *context,
|
||||
@@ -2562,6 +2568,82 @@ static void fpdecodeFunc(
|
||||
}
|
||||
#endif /* SQLITE_DEBUG */
|
||||
|
||||
#ifdef SQLITE_DEBUG
|
||||
/*
|
||||
** Implementation of parseuri(uri,flags) function.
|
||||
**
|
||||
** Required Arguments:
|
||||
** "uri" The URI to parse.
|
||||
** "flags" Bitmask of flags, as if to sqlite3_open_v2().
|
||||
**
|
||||
** Additional arguments beyond the first two make calls to
|
||||
** sqlite3_uri_key() for integers and sqlite3_uri_parameter for
|
||||
** anything else.
|
||||
**
|
||||
** The result is a string showing the results of calling sqlite3ParseUri().
|
||||
**
|
||||
** Used for testing and debugging only, specifically testing and debugging
|
||||
** of the sqlite3ParseUri() function. This SQL function does not appear
|
||||
** in production builds. This function is not an API and is subject to
|
||||
** modification or removal in future versions of SQLite.
|
||||
*/
|
||||
static void parseuriFunc(
|
||||
sqlite3_context *ctx,
|
||||
int argc,
|
||||
sqlite3_value **argv
|
||||
){
|
||||
sqlite3_str *pResult;
|
||||
const char *zVfs;
|
||||
const char *zUri;
|
||||
unsigned int flgs;
|
||||
int rc;
|
||||
sqlite3_vfs *pVfs = 0;
|
||||
char *zFile = 0;
|
||||
char *zErr = 0;
|
||||
|
||||
if( argc<2 ) return;
|
||||
pVfs = sqlite3_vfs_find(0);
|
||||
assert( pVfs );
|
||||
zVfs = pVfs->zName;
|
||||
zUri = (const char*)sqlite3_value_text(argv[0]);
|
||||
if( zUri==0 ) return;
|
||||
flgs = (unsigned int)sqlite3_value_int(argv[1]);
|
||||
rc = sqlite3ParseUri(zVfs, zUri, &flgs, &pVfs, &zFile, &zErr);
|
||||
pResult = sqlite3_str_new(0);
|
||||
if( pResult ){
|
||||
int i;
|
||||
sqlite3_str_appendf(pResult, "rc=%d", rc);
|
||||
sqlite3_str_appendf(pResult, ", flags=0x%x", flgs);
|
||||
sqlite3_str_appendf(pResult, ", vfs=%Q", pVfs ? pVfs->zName: 0);
|
||||
sqlite3_str_appendf(pResult, ", err=%Q", zErr);
|
||||
sqlite3_str_appendf(pResult, ", file=%Q", zFile);
|
||||
if( zFile ){
|
||||
const char *z = zFile;
|
||||
z += sqlite3Strlen30(z)+1;
|
||||
while( z[0] ){
|
||||
sqlite3_str_appendf(pResult, ", %Q", z);
|
||||
z += sqlite3Strlen30(z)+1;
|
||||
}
|
||||
for(i=2; i<argc; i++){
|
||||
const char *zArg;
|
||||
if( sqlite3_value_type(argv[i])==SQLITE_INTEGER ){
|
||||
int k = sqlite3_value_int(argv[i]);
|
||||
sqlite3_str_appendf(pResult, ", '%d:%q'",k,sqlite3_uri_key(zFile, k));
|
||||
}else if( (zArg = (const char*)sqlite3_value_text(argv[i]))!=0 ){
|
||||
sqlite3_str_appendf(pResult, ", '%q:%q'",
|
||||
zArg, sqlite3_uri_parameter(zFile,zArg));
|
||||
}else{
|
||||
sqlite3_str_appendf(pResult, ", NULL");
|
||||
}
|
||||
}
|
||||
}
|
||||
sqlite3_result_text(ctx, sqlite3_str_finish(pResult), -1, sqlite3_free);
|
||||
}
|
||||
sqlite3_free_filename(zFile);
|
||||
sqlite3_free(zErr);
|
||||
}
|
||||
#endif /* SQLITE_DEBUG */
|
||||
|
||||
/*
|
||||
** All of the FuncDef structures in the aBuiltinFunc[] array above
|
||||
** to the global function hash table. This occurs at start-time (as
|
||||
@@ -2624,7 +2706,8 @@ void sqlite3RegisterBuiltinFunctions(void){
|
||||
WAGGREGATE(max, 1, 1, 1, minmaxStep, minMaxFinalize, minMaxValue, 0,
|
||||
SQLITE_FUNC_MINMAX|SQLITE_FUNC_ANYORDER ),
|
||||
FUNCTION2(typeof, 1, 0, 0, typeofFunc, SQLITE_FUNC_TYPEOF),
|
||||
FUNCTION2(subtype, 1, 0, 0, subtypeFunc, SQLITE_FUNC_TYPEOF),
|
||||
FUNCTION2(subtype, 1, 0, 0, subtypeFunc,
|
||||
SQLITE_FUNC_TYPEOF|SQLITE_SUBTYPE),
|
||||
FUNCTION2(length, 1, 0, 0, lengthFunc, SQLITE_FUNC_LENGTH),
|
||||
FUNCTION2(octet_length, 1, 0, 0, bytelengthFunc,SQLITE_FUNC_BYTELEN),
|
||||
FUNCTION(instr, 2, 0, 0, instrFunc ),
|
||||
@@ -2635,6 +2718,7 @@ void sqlite3RegisterBuiltinFunctions(void){
|
||||
FUNCTION(abs, 1, 0, 0, absFunc ),
|
||||
#ifdef SQLITE_DEBUG
|
||||
FUNCTION(fpdecode, 3, 0, 0, fpdecodeFunc ),
|
||||
FUNCTION(parseuri, -1, 0, 0, parseuriFunc ),
|
||||
#endif
|
||||
#ifndef SQLITE_OMIT_FLOATING_POINT
|
||||
FUNCTION(round, 1, 0, 0, roundFunc ),
|
||||
@@ -2729,7 +2813,7 @@ void sqlite3RegisterBuiltinFunctions(void){
|
||||
MFUNCTION(sqrt, 1, sqrt, math1Func ),
|
||||
MFUNCTION(radians, 1, degToRad, math1Func ),
|
||||
MFUNCTION(degrees, 1, radToDeg, math1Func ),
|
||||
FUNCTION(pi, 0, 0, 0, piFunc ),
|
||||
MFUNCTION(pi, 0, 0, piFunc ),
|
||||
#endif /* SQLITE_ENABLE_MATH_FUNCTIONS */
|
||||
FUNCTION(sign, 1, 0, 0, signFunc ),
|
||||
INLINE_FUNC(coalesce, -1, INLINEFUNC_coalesce, 0 ),
|
||||
|
||||
@@ -4912,7 +4912,11 @@ int sqlite3_snapshot_get(
|
||||
if( iDb==0 || iDb>1 ){
|
||||
Btree *pBt = db->aDb[iDb].pBt;
|
||||
if( SQLITE_TXN_WRITE!=sqlite3BtreeTxnState(pBt) ){
|
||||
Pager *pPager = sqlite3BtreePager(pBt);
|
||||
i64 dummy = 0;
|
||||
sqlite3PagerSnapshotOpen(pPager, (sqlite3_snapshot*)&dummy);
|
||||
rc = sqlite3BtreeBeginTrans(pBt, 0, 0);
|
||||
sqlite3PagerSnapshotOpen(pPager, 0);
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = sqlite3PagerSnapshotGet(sqlite3BtreePager(pBt), ppSnapshot);
|
||||
}
|
||||
|
||||
+21
-41
@@ -2464,54 +2464,33 @@ static int robust_flock(int fd, int op){
|
||||
** is set to SQLITE_OK unless an I/O error occurs during lock checking.
|
||||
*/
|
||||
static int flockCheckReservedLock(sqlite3_file *id, int *pResOut){
|
||||
int rc = SQLITE_OK;
|
||||
int reserved = 0;
|
||||
#ifdef SQLITE_DEBUG
|
||||
unixFile *pFile = (unixFile*)id;
|
||||
#else
|
||||
UNUSED_PARAMETER(id);
|
||||
#endif
|
||||
|
||||
SimulateIOError( return SQLITE_IOERR_CHECKRESERVEDLOCK; );
|
||||
|
||||
assert( pFile );
|
||||
assert( pFile->eFileLock<=SHARED_LOCK );
|
||||
|
||||
/* Check if a thread in this process holds such a lock */
|
||||
if( pFile->eFileLock>SHARED_LOCK ){
|
||||
reserved = 1;
|
||||
}
|
||||
/* The flock VFS only ever takes exclusive locks (see function flockLock).
|
||||
** Therefore, if this connection is holding any lock at all, no other
|
||||
** connection may be holding a RESERVED lock. So set *pResOut to 0
|
||||
** in this case.
|
||||
**
|
||||
** Or, this connection may be holding no lock. In that case, set *pResOut to
|
||||
** 0 as well. The caller will then attempt to take an EXCLUSIVE lock on the
|
||||
** db in order to roll the hot journal back. If there is another connection
|
||||
** holding a lock, that attempt will fail and an SQLITE_BUSY returned to
|
||||
** the user. With other VFS, we try to avoid this, in order to allow a reader
|
||||
** to proceed while a writer is preparing its transaction. But that won't
|
||||
** work with the flock VFS - as it always takes EXCLUSIVE locks - so it is
|
||||
** not a problem in this case. */
|
||||
*pResOut = 0;
|
||||
|
||||
/* Otherwise see if some other process holds it. */
|
||||
if( !reserved ){
|
||||
/* attempt to get the lock */
|
||||
int lrc = robust_flock(pFile->h, LOCK_EX | LOCK_NB);
|
||||
if( !lrc ){
|
||||
/* got the lock, unlock it */
|
||||
lrc = robust_flock(pFile->h, LOCK_UN);
|
||||
if ( lrc ) {
|
||||
int tErrno = errno;
|
||||
/* unlock failed with an error */
|
||||
lrc = SQLITE_IOERR_UNLOCK;
|
||||
storeLastErrno(pFile, tErrno);
|
||||
rc = lrc;
|
||||
}
|
||||
} else {
|
||||
int tErrno = errno;
|
||||
reserved = 1;
|
||||
/* someone else might have it reserved */
|
||||
lrc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_LOCK);
|
||||
if( IS_LOCK_ERROR(lrc) ){
|
||||
storeLastErrno(pFile, tErrno);
|
||||
rc = lrc;
|
||||
}
|
||||
}
|
||||
}
|
||||
OSTRACE(("TEST WR-LOCK %d %d %d (flock)\n", pFile->h, rc, reserved));
|
||||
|
||||
#ifdef SQLITE_IGNORE_FLOCK_LOCK_ERRORS
|
||||
if( (rc & 0xff) == SQLITE_IOERR ){
|
||||
rc = SQLITE_OK;
|
||||
reserved=1;
|
||||
}
|
||||
#endif /* SQLITE_IGNORE_FLOCK_LOCK_ERRORS */
|
||||
*pResOut = reserved;
|
||||
return rc;
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -4149,6 +4128,7 @@ static void setDeviceCharacteristics(unixFile *pFd){
|
||||
if( pFd->ctrlFlags & UNIXFILE_PSOW ){
|
||||
pFd->deviceCharacteristics |= SQLITE_IOCAP_POWERSAFE_OVERWRITE;
|
||||
}
|
||||
pFd->deviceCharacteristics |= SQLITE_IOCAP_SUBPAGE_READ;
|
||||
|
||||
pFd->sectorSize = SQLITE_DEFAULT_SECTOR_SIZE;
|
||||
}
|
||||
|
||||
+2
-2
@@ -3660,7 +3660,7 @@ static int winSectorSize(sqlite3_file *id){
|
||||
*/
|
||||
static int winDeviceCharacteristics(sqlite3_file *id){
|
||||
winFile *p = (winFile*)id;
|
||||
return SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN |
|
||||
return SQLITE_IOCAP_UNDELETABLE_WHEN_OPEN | SQLITE_IOCAP_SUBPAGE_READ |
|
||||
((p->ctrlFlags & WINFILE_PSOW)?SQLITE_IOCAP_POWERSAFE_OVERWRITE:0);
|
||||
}
|
||||
|
||||
@@ -5048,7 +5048,7 @@ static int winOpen(
|
||||
|
||||
int rc = SQLITE_OK; /* Function Return Code */
|
||||
#if !defined(NDEBUG) || SQLITE_OS_WINCE
|
||||
int eType = flags&0xFFFFFF00; /* Type of file to open */
|
||||
int eType = flags&0x0FFF00; /* Type of file to open */
|
||||
#endif
|
||||
|
||||
int isExclusive = (flags & SQLITE_OPEN_EXCLUSIVE);
|
||||
|
||||
+14
-6
@@ -808,18 +808,26 @@ static const unsigned char aJournalMagic[] = {
|
||||
** Return true if page pgno can be read directly from the database file
|
||||
** by the b-tree layer. This is the case if:
|
||||
**
|
||||
** * the database file is open,
|
||||
** * there are no dirty pages in the cache, and
|
||||
** * the desired page is not currently in the wal file.
|
||||
** (1) the database file is open
|
||||
** (2) the VFS for the database is able to do unaligned sub-page reads
|
||||
** (3) there are no dirty pages in the cache, and
|
||||
** (4) the desired page is not currently in the wal file.
|
||||
*/
|
||||
int sqlite3PagerDirectReadOk(Pager *pPager, Pgno pgno){
|
||||
if( pPager->fd->pMethods==0 ) return 0;
|
||||
if( sqlite3PCacheIsDirty(pPager->pPCache) ) return 0;
|
||||
assert( pPager!=0 );
|
||||
assert( pPager->fd!=0 );
|
||||
if( pPager->fd->pMethods==0 ) return 0; /* Case (1) */
|
||||
assert( pPager->fd->pMethods->xDeviceCharacteristics!=0 );
|
||||
if( (pPager->fd->pMethods->xDeviceCharacteristics(pPager->fd)
|
||||
& SQLITE_IOCAP_SUBPAGE_READ)==0 ){
|
||||
return 0; /* Case (2) */
|
||||
}
|
||||
if( sqlite3PCacheIsDirty(pPager->pPCache) ) return 0; /* Failed (3) */
|
||||
#ifndef SQLITE_OMIT_WAL
|
||||
if( pPager->pWal ){
|
||||
u32 iRead = 0;
|
||||
(void)sqlite3WalFindFrame(pPager->pWal, pgno, &iRead);
|
||||
return iRead==0;
|
||||
return iRead==0; /* Condition (4) */
|
||||
}
|
||||
#endif
|
||||
return 1;
|
||||
|
||||
@@ -1761,6 +1761,7 @@ void sqlite3Pragma(
|
||||
|
||||
/* Make sure sufficient number of registers have been allocated */
|
||||
sqlite3TouchRegister(pParse, 8+cnt);
|
||||
sqlite3VdbeAddOp3(v, OP_Null, 0, 8, 8+cnt);
|
||||
sqlite3ClearTempRegCache(pParse);
|
||||
|
||||
/* Do the b-tree integrity checks */
|
||||
|
||||
@@ -938,6 +938,7 @@ void sqlite3RecordErrorOffsetOfExpr(sqlite3 *db, const Expr *pExpr){
|
||||
pExpr = pExpr->pLeft;
|
||||
}
|
||||
if( pExpr==0 ) return;
|
||||
if( ExprHasProperty(pExpr, EP_FromDDL) ) return;
|
||||
db->errByteOffset = pExpr->w.iOfst;
|
||||
}
|
||||
|
||||
|
||||
@@ -1183,6 +1183,24 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* If the function may call sqlite3_value_subtype(), then set the
|
||||
** EP_SubtArg flag on all of its argument expressions. This prevents
|
||||
** where.c from replacing the expression with a value read from an
|
||||
** index on the same expression, which will not have the correct
|
||||
** subtype. Also set the flag if the function expression itself is
|
||||
** an EP_SubtArg expression. In this case subtypes are required as
|
||||
** the function may return a value with a subtype back to its
|
||||
** caller using sqlite3_result_value(). */
|
||||
if( (pDef->funcFlags & SQLITE_SUBTYPE)
|
||||
|| ExprHasProperty(pExpr, EP_SubtArg)
|
||||
){
|
||||
int ii;
|
||||
for(ii=0; ii<n; ii++){
|
||||
ExprSetProperty(pList->a[ii].pExpr, EP_SubtArg);
|
||||
}
|
||||
}
|
||||
|
||||
if( pDef->funcFlags & (SQLITE_FUNC_CONSTANT|SQLITE_FUNC_SLOCHNG) ){
|
||||
/* For the purposes of the EP_ConstFunc flag, date and time
|
||||
** functions and other functions that change slowly are considered
|
||||
|
||||
+20
-20
@@ -3911,32 +3911,32 @@ static Expr *substExpr(
|
||||
if( pSubst->isOuterJoin ){
|
||||
ExprSetProperty(pNew, EP_CanBeNull);
|
||||
}
|
||||
if( pNew->op==TK_TRUEFALSE ){
|
||||
pNew->u.iValue = sqlite3ExprTruthValue(pNew);
|
||||
pNew->op = TK_INTEGER;
|
||||
ExprSetProperty(pNew, EP_IntValue);
|
||||
}
|
||||
|
||||
/* Ensure that the expression now has an implicit collation sequence,
|
||||
** just as it did when it was a column of a view or sub-query. */
|
||||
{
|
||||
CollSeq *pNat = sqlite3ExprCollSeq(pSubst->pParse, pNew);
|
||||
CollSeq *pColl = sqlite3ExprCollSeq(pSubst->pParse,
|
||||
pSubst->pCList->a[iColumn].pExpr
|
||||
);
|
||||
if( pNat!=pColl || (pNew->op!=TK_COLUMN && pNew->op!=TK_COLLATE) ){
|
||||
pNew = sqlite3ExprAddCollateString(pSubst->pParse, pNew,
|
||||
(pColl ? pColl->zName : "BINARY")
|
||||
);
|
||||
}
|
||||
}
|
||||
ExprClearProperty(pNew, EP_Collate);
|
||||
if( ExprHasProperty(pExpr,EP_OuterON|EP_InnerON) ){
|
||||
sqlite3SetJoinExpr(pNew, pExpr->w.iJoin,
|
||||
pExpr->flags & (EP_OuterON|EP_InnerON));
|
||||
}
|
||||
sqlite3ExprDelete(db, pExpr);
|
||||
pExpr = pNew;
|
||||
if( pExpr->op==TK_TRUEFALSE ){
|
||||
pExpr->u.iValue = sqlite3ExprTruthValue(pExpr);
|
||||
pExpr->op = TK_INTEGER;
|
||||
ExprSetProperty(pExpr, EP_IntValue);
|
||||
}
|
||||
|
||||
/* Ensure that the expression now has an implicit collation sequence,
|
||||
** just as it did when it was a column of a view or sub-query. */
|
||||
{
|
||||
CollSeq *pNat = sqlite3ExprCollSeq(pSubst->pParse, pExpr);
|
||||
CollSeq *pColl = sqlite3ExprCollSeq(pSubst->pParse,
|
||||
pSubst->pCList->a[iColumn].pExpr
|
||||
);
|
||||
if( pNat!=pColl || (pExpr->op!=TK_COLUMN && pExpr->op!=TK_COLLATE) ){
|
||||
pExpr = sqlite3ExprAddCollateString(pSubst->pParse, pExpr,
|
||||
(pColl ? pColl->zName : "BINARY")
|
||||
);
|
||||
}
|
||||
}
|
||||
ExprClearProperty(pExpr, EP_Collate);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
|
||||
+60
-57
@@ -1448,6 +1448,7 @@ struct ShellState {
|
||||
u8 bSafeMode; /* True to prohibit unsafe operations */
|
||||
u8 bSafeModePersist; /* The long-term value of bSafeMode */
|
||||
u8 eRestoreState; /* See comments above doAutoDetectRestore() */
|
||||
u8 crlfMode; /* Do NL-to-CRLF translations when enabled (maybe) */
|
||||
ColModeOpts cmOpts; /* Option values affecting columnar mode output */
|
||||
unsigned statsOn; /* True to display memory stats before each finalize */
|
||||
unsigned mEqpLines; /* Mask of vertical lines in the EQP output graph */
|
||||
@@ -1628,13 +1629,7 @@ static const char *modeDescr[] = {
|
||||
#define SEP_Tab "\t"
|
||||
#define SEP_Space " "
|
||||
#define SEP_Comma ","
|
||||
#ifdef SQLITE_U8TEXT_ONLY
|
||||
/* With the SQLITE_U8TEXT_ONLY option, the output will always be in
|
||||
** text mode. The \r will be inserted automatically. */
|
||||
# define SEP_CrLf "\n"
|
||||
#else
|
||||
# define SEP_CrLf "\r\n"
|
||||
#endif
|
||||
#define SEP_CrLf "\r\n"
|
||||
#define SEP_Unit "\x1F"
|
||||
#define SEP_Record "\x1E"
|
||||
|
||||
@@ -1719,7 +1714,7 @@ static void editFunc(
|
||||
char *zCmd = 0;
|
||||
int bBin;
|
||||
int rc;
|
||||
int hasCRNL = 0;
|
||||
int hasCRLF = 0;
|
||||
FILE *f = 0;
|
||||
sqlite3_int64 sz;
|
||||
sqlite3_int64 x;
|
||||
@@ -1764,7 +1759,7 @@ static void editFunc(
|
||||
}else{
|
||||
const char *z = (const char*)sqlite3_value_text(argv[0]);
|
||||
/* Remember whether or not the value originally contained \r\n */
|
||||
if( z && strstr(z,"\r\n")!=0 ) hasCRNL = 1;
|
||||
if( z && strstr(z,"\r\n")!=0 ) hasCRLF = 1;
|
||||
x = fwrite(sqlite3_value_text(argv[0]), 1, (size_t)sz, f);
|
||||
}
|
||||
fclose(f);
|
||||
@@ -1809,7 +1804,7 @@ static void editFunc(
|
||||
sqlite3_result_blob64(context, p, sz, sqlite3_free);
|
||||
}else{
|
||||
sqlite3_int64 i, j;
|
||||
if( hasCRNL ){
|
||||
if( hasCRLF ){
|
||||
/* If the original contains \r\n then do no conversions back to \n */
|
||||
}else{
|
||||
/* If the file did not originally contain \r\n then convert any new
|
||||
@@ -1851,6 +1846,21 @@ static void outputModePop(ShellState *p){
|
||||
memcpy(p->rowSeparator, p->rowSepPrior, sizeof(p->rowSeparator));
|
||||
}
|
||||
|
||||
/*
|
||||
** Set output mode to text or binary for Windows.
|
||||
*/
|
||||
static void setCrlfMode(ShellState *p){
|
||||
#ifdef _WIN32
|
||||
if( p->crlfMode ){
|
||||
sqlite3_fsetmode(p->out, _O_TEXT);
|
||||
}else{
|
||||
sqlite3_fsetmode(p->out, _O_BINARY);
|
||||
}
|
||||
#else
|
||||
UNUSED_PARAMETER(p);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
** Output the given string as a hex-encoded blob (eg. X'1234' )
|
||||
*/
|
||||
@@ -1901,9 +1911,10 @@ static const char *unused_string(
|
||||
**
|
||||
** See also: output_quoted_escaped_string()
|
||||
*/
|
||||
static void output_quoted_string(FILE *out, const char *z){
|
||||
static void output_quoted_string(ShellState *p, const char *z){
|
||||
int i;
|
||||
char c;
|
||||
FILE *out = p->out;
|
||||
sqlite3_fsetmode(out, _O_BINARY);
|
||||
if( z==0 ) return;
|
||||
for(i=0; (c = z[i])!=0 && c!='\''; i++){}
|
||||
@@ -1929,7 +1940,7 @@ static void output_quoted_string(FILE *out, const char *z){
|
||||
}
|
||||
sqlite3_fputs("'", out);
|
||||
}
|
||||
sqlite3_fsetmode(out, _O_TEXT);
|
||||
setCrlfMode(p);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1941,9 +1952,10 @@ static void output_quoted_string(FILE *out, const char *z){
|
||||
** This is like output_quoted_string() but with the addition of the \r\n
|
||||
** escape mechanism.
|
||||
*/
|
||||
static void output_quoted_escaped_string(FILE *out, const char *z){
|
||||
static void output_quoted_escaped_string(ShellState *p, const char *z){
|
||||
int i;
|
||||
char c;
|
||||
FILE *out = p->out;
|
||||
sqlite3_fsetmode(out, _O_BINARY);
|
||||
for(i=0; (c = z[i])!=0 && c!='\'' && c!='\n' && c!='\r'; i++){}
|
||||
if( c==0 ){
|
||||
@@ -1996,7 +2008,7 @@ static void output_quoted_escaped_string(FILE *out, const char *z){
|
||||
sqlite3_fprintf(out, ",'%s',char(10))", zNL);
|
||||
}
|
||||
}
|
||||
sqlite3_fsetmode(stdout, _O_TEXT);
|
||||
setCrlfMode(p);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -2793,7 +2805,7 @@ static int shell_callback(
|
||||
}
|
||||
sqlite3_fputs(p->rowSeparator, p->out);
|
||||
}
|
||||
sqlite3_fsetmode(p->out, _O_TEXT);
|
||||
setCrlfMode(p);
|
||||
break;
|
||||
}
|
||||
case MODE_Insert: {
|
||||
@@ -2821,9 +2833,9 @@ static int shell_callback(
|
||||
sqlite3_fputs("NULL", p->out);
|
||||
}else if( aiType && aiType[i]==SQLITE_TEXT ){
|
||||
if( ShellHasFlag(p, SHFLG_Newlines) ){
|
||||
output_quoted_string(p->out, azArg[i]);
|
||||
output_quoted_string(p, azArg[i]);
|
||||
}else{
|
||||
output_quoted_escaped_string(p->out, azArg[i]);
|
||||
output_quoted_escaped_string(p, azArg[i]);
|
||||
}
|
||||
}else if( aiType && aiType[i]==SQLITE_INTEGER ){
|
||||
sqlite3_fputs(azArg[i], p->out);
|
||||
@@ -2852,9 +2864,9 @@ static int shell_callback(
|
||||
}else if( isNumber(azArg[i], 0) ){
|
||||
sqlite3_fputs(azArg[i], p->out);
|
||||
}else if( ShellHasFlag(p, SHFLG_Newlines) ){
|
||||
output_quoted_string(p->out, azArg[i]);
|
||||
output_quoted_string(p, azArg[i]);
|
||||
}else{
|
||||
output_quoted_escaped_string(p->out, azArg[i]);
|
||||
output_quoted_escaped_string(p, azArg[i]);
|
||||
}
|
||||
}
|
||||
sqlite3_fputs(");\n", p->out);
|
||||
@@ -2907,7 +2919,7 @@ static int shell_callback(
|
||||
if( p->cnt==0 && p->showHeader ){
|
||||
for(i=0; i<nArg; i++){
|
||||
if( i>0 ) sqlite3_fputs(p->colSeparator, p->out);
|
||||
output_quoted_string(p->out, azCol[i]);
|
||||
output_quoted_string(p, azCol[i]);
|
||||
}
|
||||
sqlite3_fputs(p->rowSeparator, p->out);
|
||||
}
|
||||
@@ -2917,7 +2929,7 @@ static int shell_callback(
|
||||
if( (azArg[i]==0) || (aiType && aiType[i]==SQLITE_NULL) ){
|
||||
sqlite3_fputs("NULL", p->out);
|
||||
}else if( aiType && aiType[i]==SQLITE_TEXT ){
|
||||
output_quoted_string(p->out, azArg[i]);
|
||||
output_quoted_string(p, azArg[i]);
|
||||
}else if( aiType && aiType[i]==SQLITE_INTEGER ){
|
||||
sqlite3_fputs(azArg[i], p->out);
|
||||
}else if( aiType && aiType[i]==SQLITE_FLOAT ){
|
||||
@@ -2932,7 +2944,7 @@ static int shell_callback(
|
||||
}else if( isNumber(azArg[i], 0) ){
|
||||
sqlite3_fputs(azArg[i], p->out);
|
||||
}else{
|
||||
output_quoted_string(p->out, azArg[i]);
|
||||
output_quoted_string(p, azArg[i]);
|
||||
}
|
||||
}
|
||||
sqlite3_fputs(p->rowSeparator, p->out);
|
||||
@@ -4751,7 +4763,7 @@ static int dump_callback(void *pArg, int nArg, char **azArg, char **azNotUsed){
|
||||
noSys = (p->shellFlgs & SHFLG_DumpNoSys)!=0;
|
||||
|
||||
if( cli_strcmp(zTable, "sqlite_sequence")==0 && !noSys ){
|
||||
if( !dataOnly ) sqlite3_fputs("DELETE FROM sqlite_sequence;\n", p->out);
|
||||
/* no-op */
|
||||
}else if( sqlite3_strglob("sqlite_stat?", zTable)==0 && !noSys ){
|
||||
if( !dataOnly ) sqlite3_fputs("ANALYZE sqlite_schema;\n", p->out);
|
||||
}else if( cli_strncmp(zTable, "sqlite_", 7)==0 ){
|
||||
@@ -4936,10 +4948,7 @@ static const char *(azHelp[]) = {
|
||||
".clone NEWDB Clone data into NEWDB from the existing database",
|
||||
#endif
|
||||
".connection [close] [#] Open or close an auxiliary database connection",
|
||||
#if defined(_WIN32) && !defined(SQLITE_U8TEXT_ONLY) \
|
||||
&& !defined(SQLITE_U8TEXT_STDIO)
|
||||
".crnl on|off Translate \\n to \\r\\n. Default ON",
|
||||
#endif /* _WIN32 && U8TEXT_ONLY && U8TEXT_STDIO */
|
||||
".crlf ?on|off? Whether or not to use \\r\\n line endings",
|
||||
".databases List names and files of attached databases",
|
||||
".dbconfig ?op? ?val? List or change sqlite3_db_config() options",
|
||||
#if SQLITE_SHELL_HAVE_RECOVER
|
||||
@@ -5938,7 +5947,7 @@ static void output_file_close(FILE *f){
|
||||
** recognized and do the right thing. NULL is returned if the output
|
||||
** filename is "off".
|
||||
*/
|
||||
static FILE *output_file_open(const char *zFile, int bTextMode){
|
||||
static FILE *output_file_open(const char *zFile){
|
||||
FILE *f;
|
||||
if( cli_strcmp(zFile,"stdout")==0 ){
|
||||
f = stdout;
|
||||
@@ -5947,7 +5956,7 @@ static FILE *output_file_open(const char *zFile, int bTextMode){
|
||||
}else if( cli_strcmp(zFile, "off")==0 ){
|
||||
f = 0;
|
||||
}else{
|
||||
f = sqlite3_fopen(zFile, bTextMode ? "w" : "wb");
|
||||
f = sqlite3_fopen(zFile, "w");
|
||||
if( f==0 ){
|
||||
sqlite3_fprintf(stderr,"Error: cannot open \"%s\"\n", zFile);
|
||||
}
|
||||
@@ -6420,6 +6429,7 @@ static void output_redir(ShellState *p, FILE *pfNew){
|
||||
sqlite3_fputs("Output already redirected.\n", stderr);
|
||||
}else{
|
||||
p->out = pfNew;
|
||||
setCrlfMode(p);
|
||||
if( p->mode==MODE_Www ){
|
||||
sqlite3_fputs(
|
||||
"<!DOCTYPE html>\n"
|
||||
@@ -6475,6 +6485,7 @@ static void output_reset(ShellState *p){
|
||||
}
|
||||
p->outfile[0] = 0;
|
||||
p->out = stdout;
|
||||
setCrlfMode(p);
|
||||
}
|
||||
#else
|
||||
# define output_redir(SS,pfO)
|
||||
@@ -8427,9 +8438,9 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
}
|
||||
}else
|
||||
|
||||
/* Undocumented. Legacy only. See "crnl" below */
|
||||
/* Undocumented. Legacy only. See "crlf" below */
|
||||
if( c=='b' && n>=3 && cli_strncmp(azArg[0], "binary", n)==0 ){
|
||||
eputz("The \".binary\" command is deprecated. Use \".crnl\" instead.\n");
|
||||
eputz("The \".binary\" command is deprecated.\n");
|
||||
rc = 1;
|
||||
}else
|
||||
|
||||
@@ -8555,22 +8566,18 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
}
|
||||
}else
|
||||
|
||||
if( c=='c' && n==4 && cli_strncmp(azArg[0], "crnl", n)==0 ){
|
||||
#if !defined(_WIN32) || defined(SQLITE_U8TEXT_ONLY) \
|
||||
|| defined(SQLITE_U8TEXT_STDIO)
|
||||
sqlite3_fputs("The \".crnl\" command is disable in this build.\n", p->out);
|
||||
#else
|
||||
if( c=='c' && n==4
|
||||
&& (cli_strncmp(azArg[0], "crlf", n)==0
|
||||
|| cli_strncmp(azArg[0], "crnl",n)==0)
|
||||
){
|
||||
if( nArg==2 ){
|
||||
if( booleanValue(azArg[1]) ){
|
||||
sqlite3_fsetmode(p->out, _O_TEXT);
|
||||
}else{
|
||||
sqlite3_fsetmode(p->out, _O_BINARY);
|
||||
}
|
||||
}else{
|
||||
eputz("Usage: .crnl on|off\n");
|
||||
rc = 1;
|
||||
}
|
||||
#ifdef _WIN32
|
||||
p->crlfMode = booleanValue(azArg[1]);
|
||||
#else
|
||||
p->crlfMode = 0;
|
||||
#endif
|
||||
}
|
||||
sqlite3_fprintf(stderr, "crlf is %s\n", p->crlfMode ? "ON" : "OFF");
|
||||
}else
|
||||
|
||||
if( c=='d' && n>1 && cli_strncmp(azArg[0], "databases", n)==0 ){
|
||||
@@ -9650,7 +9657,7 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
}
|
||||
output_file_close(p->pLog);
|
||||
if( cli_strcmp(zFile,"on")==0 ) zFile = "stdout";
|
||||
p->pLog = output_file_open(zFile, 0);
|
||||
p->pLog = output_file_open(zFile);
|
||||
}
|
||||
}else
|
||||
|
||||
@@ -9905,7 +9912,6 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
|| (c=='w' && n==3 && cli_strcmp(azArg[0],"www")==0)
|
||||
){
|
||||
char *zFile = 0;
|
||||
int bTxtMode = 0;
|
||||
int i;
|
||||
int eMode = 0;
|
||||
int bOnce = 0; /* 0: .output, 1: .once, 2: .excel/.www */
|
||||
@@ -9987,11 +9993,9 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
/* web-browser mode. */
|
||||
newTempFile(p, "html");
|
||||
if( !bPlain ) p->mode = MODE_Www;
|
||||
bTxtMode = 1;
|
||||
}else{
|
||||
/* text editor mode */
|
||||
newTempFile(p, "txt");
|
||||
bTxtMode = 1;
|
||||
}
|
||||
sqlite3_free(zFile);
|
||||
zFile = sqlite3_mprintf("%s", p->zTempFile);
|
||||
@@ -10015,7 +10019,7 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
}
|
||||
#endif
|
||||
}else{
|
||||
FILE *pfFile = output_file_open(zFile, bTxtMode);
|
||||
FILE *pfFile = output_file_open(zFile);
|
||||
if( pfFile==0 ){
|
||||
if( cli_strcmp(zFile,"off")!=0 ){
|
||||
sqlite3_fprintf(stderr,"Error: cannot write to \"%s\"\n", zFile);
|
||||
@@ -10023,13 +10027,13 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
rc = 1;
|
||||
} else {
|
||||
output_redir(p, pfFile);
|
||||
if( zBom ) sqlite3_fputs(zBom, pfFile);
|
||||
if( bPlain && eMode=='w' ){
|
||||
sqlite3_fputs(
|
||||
"<!DOCTYPE html>\n<BODY>\n<PLAINTEXT>\n",
|
||||
pfFile
|
||||
);
|
||||
}
|
||||
if( zBom ) sqlite3_fputs(zBom, pfFile);
|
||||
sqlite3_snprintf(sizeof(p->outfile), p->outfile, "%s", zFile);
|
||||
}
|
||||
}
|
||||
@@ -10226,7 +10230,6 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
#ifdef SQLITE_OMIT_POPEN
|
||||
eputz("Error: pipes are not supported in this OS\n");
|
||||
rc = 1;
|
||||
p->out = stdout;
|
||||
#else
|
||||
p->in = sqlite3_popen(azArg[1]+1, "r");
|
||||
if( p->in==0 ){
|
||||
@@ -11213,7 +11216,7 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
/* Begin redirecting output to the file "testcase-out.txt" */
|
||||
if( c=='t' && cli_strcmp(azArg[0],"testcase")==0 ){
|
||||
output_reset(p);
|
||||
p->out = output_file_open("testcase-out.txt", 0);
|
||||
p->out = output_file_open("testcase-out.txt");
|
||||
if( p->out==0 ){
|
||||
eputz("Error: cannot open 'testcase-out.txt'\n");
|
||||
}
|
||||
@@ -11717,7 +11720,7 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
}
|
||||
}else{
|
||||
output_file_close(p->traceOut);
|
||||
p->traceOut = output_file_open(z, 0);
|
||||
p->traceOut = output_file_open(z);
|
||||
}
|
||||
}
|
||||
if( p->traceOut==0 ){
|
||||
@@ -11940,7 +11943,6 @@ static QuickScanState quickscan(char *zLine, QuickScanState qss,
|
||||
char cWait = (char)qss; /* intentional narrowing loss */
|
||||
if( cWait==0 ){
|
||||
PlainScan:
|
||||
assert( cWait==0 );
|
||||
while( (cin = *zLine++)!=0 ){
|
||||
if( IsSpace(cin) )
|
||||
continue;
|
||||
@@ -11992,7 +11994,6 @@ static QuickScanState quickscan(char *zLine, QuickScanState qss,
|
||||
if( *zLine != '/' )
|
||||
continue;
|
||||
++zLine;
|
||||
cWait = 0;
|
||||
CONTINUE_PROMPT_AWAITC(pst, 0);
|
||||
qss = QSS_SETV(qss, 0);
|
||||
goto PlainScan;
|
||||
@@ -12004,7 +12005,6 @@ static QuickScanState quickscan(char *zLine, QuickScanState qss,
|
||||
}
|
||||
deliberate_fall_through;
|
||||
case ']':
|
||||
cWait = 0;
|
||||
CONTINUE_PROMPT_AWAITC(pst, 0);
|
||||
qss = QSS_SETV(qss, 0);
|
||||
goto PlainScan;
|
||||
@@ -12594,6 +12594,9 @@ static void main_init(ShellState *data) {
|
||||
memset(data, 0, sizeof(*data));
|
||||
data->normalMode = data->cMode = data->mode = MODE_List;
|
||||
data->autoExplain = 1;
|
||||
#ifdef _WIN32
|
||||
data->crlfMode = 1;
|
||||
#endif
|
||||
data->pAuxDb = &data->aAuxDb[0];
|
||||
memcpy(data->colSeparator,SEP_Column, 2);
|
||||
memcpy(data->rowSeparator,SEP_Row, 2);
|
||||
|
||||
+29
-2
@@ -652,6 +652,13 @@ int sqlite3_exec(
|
||||
** filesystem supports doing multiple write operations atomically when those
|
||||
** write operations are bracketed by [SQLITE_FCNTL_BEGIN_ATOMIC_WRITE] and
|
||||
** [SQLITE_FCNTL_COMMIT_ATOMIC_WRITE].
|
||||
**
|
||||
** The SQLITE_IOCAP_SUBPAGE_READ property means that it is ok to read
|
||||
** from the database file in amounts that are not a multiple of the
|
||||
** page size and that do not begin at a page boundary. Without this
|
||||
** property, SQLite is careful to only do full-page reads and write
|
||||
** on aligned pages, with the one exception that it will do a sub-page
|
||||
** read of the first page to access the database header.
|
||||
*/
|
||||
#define SQLITE_IOCAP_ATOMIC 0x00000001
|
||||
#define SQLITE_IOCAP_ATOMIC512 0x00000002
|
||||
@@ -668,6 +675,7 @@ int sqlite3_exec(
|
||||
#define SQLITE_IOCAP_POWERSAFE_OVERWRITE 0x00001000
|
||||
#define SQLITE_IOCAP_IMMUTABLE 0x00002000
|
||||
#define SQLITE_IOCAP_BATCH_ATOMIC 0x00004000
|
||||
#define SQLITE_IOCAP_SUBPAGE_READ 0x00008000
|
||||
|
||||
/*
|
||||
** CAPI3REF: File Locking Levels
|
||||
@@ -814,6 +822,7 @@ struct sqlite3_file {
|
||||
** <li> [SQLITE_IOCAP_POWERSAFE_OVERWRITE]
|
||||
** <li> [SQLITE_IOCAP_IMMUTABLE]
|
||||
** <li> [SQLITE_IOCAP_BATCH_ATOMIC]
|
||||
** <li> [SQLITE_IOCAP_SUBPAGE_READ]
|
||||
** </ul>
|
||||
**
|
||||
** The SQLITE_IOCAP_ATOMIC property means that all writes of
|
||||
@@ -4232,7 +4241,7 @@ int sqlite3_limit(sqlite3*, int id, int newVal);
|
||||
** is the number of bytes in the input string <i>including</i>
|
||||
** the nul-terminator.
|
||||
** Note that nByte measure the length of the input in bytes, not
|
||||
** characters, even for the UTF-16 inferfaces.
|
||||
** characters, even for the UTF-16 interfaces.
|
||||
**
|
||||
** ^If pzTail is not NULL then *pzTail is made to point to the first byte
|
||||
** past the end of the first SQL statement in zSql. These routines only
|
||||
@@ -5603,7 +5612,7 @@ int sqlite3_create_window_function(
|
||||
** This flag instructs SQLite to omit some corner-case optimizations that
|
||||
** might disrupt the operation of the [sqlite3_value_subtype()] function,
|
||||
** causing it to return zero rather than the correct subtype().
|
||||
** SQL functions that invokes [sqlite3_value_subtype()] should have this
|
||||
** All SQL functions that invoke [sqlite3_value_subtype()] should have this
|
||||
** property. If the SQLITE_SUBTYPE property is omitted, then the return
|
||||
** value from [sqlite3_value_subtype()] might sometimes be zero even though
|
||||
** a non-zero subtype was specified by the function argument expression.
|
||||
@@ -9344,6 +9353,16 @@ typedef struct sqlite3_backup sqlite3_backup;
|
||||
** APIs are not strictly speaking threadsafe. If they are invoked at the
|
||||
** same time as another thread is invoking sqlite3_backup_step() it is
|
||||
** possible that they return invalid values.
|
||||
**
|
||||
** <b>Alternatives To Using The Backup API</b>
|
||||
**
|
||||
** Other techniques for safely creating a consistent backup of an SQLite
|
||||
** database include:
|
||||
**
|
||||
** <ul>
|
||||
** <li> The [VACUUM INTO] command.
|
||||
** <li> The [sqlite3_rsync] utility program.
|
||||
** </ul>
|
||||
*/
|
||||
sqlite3_backup *sqlite3_backup_init(
|
||||
sqlite3 *pDest, /* Destination database handle */
|
||||
@@ -10543,6 +10562,14 @@ typedef struct sqlite3_snapshot {
|
||||
** If there is not already a read-transaction open on schema S when
|
||||
** this function is called, one is opened automatically.
|
||||
**
|
||||
** If a read-transaction is opened by this function, then it is guaranteed
|
||||
** that the returned snapshot object may not be invalidated by a database
|
||||
** writer or checkpointer until after the read-transaction is closed. This
|
||||
** is not guaranteed if a read-transaction is already open when this
|
||||
** function is called. In that case, any subsequent write or checkpoint
|
||||
** operation on the database may invalidate the returned snapshot handle,
|
||||
** even while the read-transaction remains open.
|
||||
**
|
||||
** The following must be true for this function to succeed. If any of
|
||||
** the following statements are false when sqlite3_snapshot_get() is
|
||||
** called, SQLITE_ERROR is returned. The final value of *P is undefined
|
||||
|
||||
+4
-12
@@ -638,6 +638,7 @@
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
#include <stddef.h>
|
||||
#include <ctype.h>
|
||||
|
||||
/*
|
||||
** Use a macro to replace memcpy() if compiled with SQLITE_INLINE_MEMCPY.
|
||||
@@ -3103,7 +3104,7 @@ struct Expr {
|
||||
#define EP_IsTrue 0x10000000 /* Always has boolean value of TRUE */
|
||||
#define EP_IsFalse 0x20000000 /* Always has boolean value of FALSE */
|
||||
#define EP_FromDDL 0x40000000 /* Originates from sqlite_schema */
|
||||
/* 0x80000000 // Available */
|
||||
#define EP_SubtArg 0x80000000 /* Is argument to SQLITE_SUBTYPE function */
|
||||
|
||||
/* The EP_Propagate mask is a set of properties that automatically propagate
|
||||
** upwards into parent nodes.
|
||||
@@ -3659,8 +3660,8 @@ struct Select {
|
||||
** row of result as the key in table pDest->iSDParm.
|
||||
** Apply the affinity pDest->affSdst before storing
|
||||
** results. if pDest->iSDParm2 is positive, then it is
|
||||
** a regsiter holding a Bloom filter for the IN operator
|
||||
** that should be populated in addition to the
|
||||
** a register holding a Bloom filter for the IN operator
|
||||
** that should be populated in addition to the
|
||||
** pDest->iSDParm table. This SRT is used to
|
||||
** implement "IN (SELECT ...)".
|
||||
**
|
||||
@@ -4632,15 +4633,6 @@ int sqlite3CantopenError(int);
|
||||
# define SQLITE_ENABLE_FTS3 1
|
||||
#endif
|
||||
|
||||
/*
|
||||
** The ctype.h header is needed for non-ASCII systems. It is also
|
||||
** needed by FTS3 when FTS3 is included in the amalgamation.
|
||||
*/
|
||||
#if !defined(SQLITE_ASCII) || \
|
||||
(defined(SQLITE_ENABLE_FTS3) && defined(SQLITE_AMALGAMATION))
|
||||
# include <ctype.h>
|
||||
#endif
|
||||
|
||||
/*
|
||||
** The following macros mimic the standard library functions toupper(),
|
||||
** isspace(), isalnum(), isdigit() and isxdigit(), respectively. The
|
||||
|
||||
+18
-1
@@ -3981,7 +3981,7 @@ static int SQLITE_TCLAPI DbMain(
|
||||
** The EXTERN macros are required by TCL in order to work on windows.
|
||||
*/
|
||||
EXTERN int Sqlite3_Init(Tcl_Interp *interp){
|
||||
int rc = Tcl_InitStubs(interp, "8.4", 0) ? TCL_OK : TCL_ERROR;
|
||||
int rc = Tcl_InitStubs(interp, "8.5-", 0) ? TCL_OK : TCL_ERROR;
|
||||
if( rc==TCL_OK ){
|
||||
Tcl_CreateObjCommand(interp, "sqlite3", (Tcl_ObjCmdProc*)DbMain, 0, 0);
|
||||
#ifndef SQLITE_3_SUFFIX_ONLY
|
||||
@@ -4037,6 +4037,23 @@ EXTERN int sqlite_Init(Tcl_Interp *interp){ return Sqlite3_Init(interp);}
|
||||
static const char *tclsh_main_loop(void){
|
||||
static const char zMainloop[] =
|
||||
"if {[llength $argv]>=1} {\n"
|
||||
#ifdef WIN32
|
||||
"set new [list]\n"
|
||||
"foreach arg $argv {\n"
|
||||
"if {[string match -* $arg] || [file exists $arg]} {\n"
|
||||
"lappend new $arg\n"
|
||||
"} else {\n"
|
||||
"set once 0\n"
|
||||
"foreach match [lsort [glob -nocomplain $arg]] {\n"
|
||||
"lappend new $match\n"
|
||||
"set once 1\n"
|
||||
"}\n"
|
||||
"if {!$once} {lappend new $arg}\n"
|
||||
"}\n"
|
||||
"}\n"
|
||||
"set argv $new\n"
|
||||
"unset new\n"
|
||||
#endif
|
||||
"set argv0 [lindex $argv 0]\n"
|
||||
"set argv [lrange $argv 1 end]\n"
|
||||
"source $argv0\n"
|
||||
|
||||
@@ -136,7 +136,7 @@ static const unsigned char sqlite3Utf8Trans1[] = {
|
||||
c = *(zIn++); \
|
||||
if( c>=0xc0 ){ \
|
||||
c = sqlite3Utf8Trans1[c-0xc0]; \
|
||||
while( zIn!=zTerm && (*zIn & 0xc0)==0x80 ){ \
|
||||
while( zIn<zTerm && (*zIn & 0xc0)==0x80 ){ \
|
||||
c = (c<<6) + (0x3f & *(zIn++)); \
|
||||
} \
|
||||
if( c<0x80 \
|
||||
|
||||
+12
-16
@@ -539,8 +539,8 @@ int sqlite3AtoF(const char *z, double *pResult, int length, u8 enc){
|
||||
int eValid = 1; /* True exponent is either not used or is well-formed */
|
||||
int nDigit = 0; /* Number of digits processed */
|
||||
int eType = 1; /* 1: pure integer, 2+: fractional -1 or less: bad UTF16 */
|
||||
u64 s2; /* round-tripped significand */
|
||||
double rr[2];
|
||||
u64 s2;
|
||||
|
||||
assert( enc==SQLITE_UTF8 || enc==SQLITE_UTF16LE || enc==SQLITE_UTF16BE );
|
||||
*pResult = 0.0; /* Default return value, in case of an error */
|
||||
@@ -643,7 +643,7 @@ do_atof_calc:
|
||||
e = (e*esign) + d;
|
||||
|
||||
/* Try to adjust the exponent to make it smaller */
|
||||
while( e>0 && s<(LARGEST_UINT64/10) ){
|
||||
while( e>0 && s<((LARGEST_UINT64-0x7ff)/10) ){
|
||||
s *= 10;
|
||||
e--;
|
||||
}
|
||||
@@ -653,11 +653,16 @@ do_atof_calc:
|
||||
}
|
||||
|
||||
rr[0] = (double)s;
|
||||
s2 = (u64)rr[0];
|
||||
#if defined(_MSC_VER) && _MSC_VER<1700
|
||||
if( s2==0x8000000000000000LL ){ s2 = 2*(u64)(0.5*rr[0]); }
|
||||
#endif
|
||||
rr[1] = s>=s2 ? (double)(s - s2) : -(double)(s2 - s);
|
||||
assert( sizeof(s2)==sizeof(rr[0]) );
|
||||
memcpy(&s2, &rr[0], sizeof(s2));
|
||||
if( s2<=0x43efffffffffffffLL ){
|
||||
s2 = (u64)rr[0];
|
||||
rr[1] = s>=s2 ? (double)(s - s2) : -(double)(s2 - s);
|
||||
}else{
|
||||
rr[1] = 0.0;
|
||||
}
|
||||
assert( rr[1]<=1.0e-10*rr[0] ); /* Equal only when rr[0]==0.0 */
|
||||
|
||||
if( e>0 ){
|
||||
while( e>=100 ){
|
||||
e -= 100;
|
||||
@@ -1846,12 +1851,3 @@ int sqlite3VListNameToNum(VList *pIn, const char *zName, int nName){
|
||||
}while( i<mx );
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
** High-resolution hardware timer used for debugging and testing only.
|
||||
*/
|
||||
#if defined(VDBE_PROFILE) \
|
||||
|| defined(SQLITE_PERFORMANCE_TRACE) \
|
||||
|| defined(SQLITE_ENABLE_STMT_SCANSTATUS)
|
||||
# include "hwtime.h"
|
||||
#endif
|
||||
|
||||
+13
-1
@@ -21,6 +21,15 @@
|
||||
#include "sqliteInt.h"
|
||||
#include "vdbeInt.h"
|
||||
|
||||
/*
|
||||
** High-resolution hardware timer used for debugging and testing only.
|
||||
*/
|
||||
#if defined(VDBE_PROFILE) \
|
||||
|| defined(SQLITE_PERFORMANCE_TRACE) \
|
||||
|| defined(SQLITE_ENABLE_STMT_SCANSTATUS)
|
||||
# include "hwtime.h"
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Invoke this macro on memory cells just prior to changing the
|
||||
** value of the cell. This macro verifies that shallow copies are
|
||||
@@ -4530,7 +4539,10 @@ case OP_OpenEphemeral: { /* ncycle */
|
||||
}
|
||||
pCx->isOrdered = (pOp->p5!=BTREE_UNORDERED);
|
||||
if( rc ){
|
||||
assert( !sqlite3BtreeClosesWithCursor(pCx->ub.pBtx, pCx->uc.pCursor) );
|
||||
sqlite3BtreeClose(pCx->ub.pBtx);
|
||||
}else{
|
||||
assert( sqlite3BtreeClosesWithCursor(pCx->ub.pBtx, pCx->uc.pCursor) );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9048,7 +9060,7 @@ case OP_ReleaseReg: {
|
||||
** As with all opcodes, the meanings of the parameters for OP_Explain
|
||||
** are subject to change from one release to the next. Applications
|
||||
** should not attempt to interpret or use any of the information
|
||||
** contined in the OP_Explain opcode. The information provided by this
|
||||
** contained in the OP_Explain opcode. The information provided by this
|
||||
** opcode is intended for testing and debugging use only.
|
||||
*/
|
||||
default: { /* This is really OP_Noop, OP_Explain */
|
||||
|
||||
@@ -541,6 +541,7 @@ struct Wal {
|
||||
#endif
|
||||
#ifdef SQLITE_ENABLE_SNAPSHOT
|
||||
WalIndexHdr *pSnapshot; /* Start transaction here if not NULL */
|
||||
int bGetSnapshot; /* Transaction opened for sqlite3_get_snapshot() */
|
||||
#endif
|
||||
#ifdef SQLITE_ENABLE_SETLK_TIMEOUT
|
||||
sqlite3 *db;
|
||||
@@ -2433,7 +2434,7 @@ static int walHandleException(Wal *pWal){
|
||||
|
||||
/*
|
||||
** Assert that the Wal.lockMask mask, which indicates the locks held
|
||||
** by the connenction, is consistent with the Wal.readLock, Wal.writeLock
|
||||
** by the connection, is consistent with the Wal.readLock, Wal.writeLock
|
||||
** and Wal.ckptLock variables. To be used as:
|
||||
**
|
||||
** assert( walAssertLockmask(pWal) );
|
||||
@@ -3097,7 +3098,7 @@ static int walTryBeginRead(Wal *pWal, int *pChanged, int useWal, int *pCnt){
|
||||
SEH_INJECT_FAULT;
|
||||
if( !useWal && AtomicLoad(&pInfo->nBackfill)==pWal->hdr.mxFrame
|
||||
#ifdef SQLITE_ENABLE_SNAPSHOT
|
||||
&& (pWal->pSnapshot==0 || pWal->hdr.mxFrame==0)
|
||||
&& ((pWal->bGetSnapshot==0 && pWal->pSnapshot==0) || pWal->hdr.mxFrame==0)
|
||||
#endif
|
||||
){
|
||||
/* The WAL has been completely backfilled (or it is empty).
|
||||
@@ -4497,7 +4498,20 @@ void sqlite3WalSnapshotOpen(
|
||||
Wal *pWal,
|
||||
sqlite3_snapshot *pSnapshot
|
||||
){
|
||||
pWal->pSnapshot = (WalIndexHdr*)pSnapshot;
|
||||
if( pSnapshot && ((WalIndexHdr*)pSnapshot)->iVersion==0 ){
|
||||
/* iVersion==0 means that this is a call to sqlite3_snapshot_get(). In
|
||||
** this case set the bGetSnapshot flag so that if the call to
|
||||
** sqlite3_snapshot_get() is about to read transaction on this wal
|
||||
** file, it does not take read-lock 0 if the wal file has been completely
|
||||
** checkpointed. Taking read-lock 0 would work, but then it would be
|
||||
** possible for a subsequent writer to destroy the snapshot even while
|
||||
** this connection is holding its read-transaction open. This is contrary
|
||||
** to user expectations, so we avoid it by not taking read-lock 0. */
|
||||
pWal->bGetSnapshot = 1;
|
||||
}else{
|
||||
pWal->pSnapshot = (WalIndexHdr*)pSnapshot;
|
||||
pWal->bGetSnapshot = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+1
-59
@@ -2583,7 +2583,7 @@ static void whereInfoFree(sqlite3 *db, WhereInfo *pWInfo){
|
||||
** and Y has additional constraints that might speed the search that X lacks
|
||||
** but the cost of running X is not more than the cost of running Y.
|
||||
**
|
||||
** In other words, return true if the cost relationwship between X and Y
|
||||
** In other words, return true if the cost relationship between X and Y
|
||||
** is inverted and needs to be adjusted.
|
||||
**
|
||||
** Case 1:
|
||||
@@ -6302,58 +6302,6 @@ static SQLITE_NOINLINE void whereCheckIfBloomFilterIsUseful(
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** Expression Node callback for sqlite3ExprCanReturnSubtype().
|
||||
**
|
||||
** Only a function call is able to return a subtype. So if the node
|
||||
** is not a function call, return WRC_Prune immediately.
|
||||
**
|
||||
** A function call is able to return a subtype if it has the
|
||||
** SQLITE_RESULT_SUBTYPE property.
|
||||
**
|
||||
** Assume that every function is able to pass-through a subtype from
|
||||
** one of its argument (using sqlite3_result_value()). Most functions
|
||||
** are not this way, but we don't have a mechanism to distinguish those
|
||||
** that are from those that are not, so assume they all work this way.
|
||||
** That means that if one of its arguments is another function and that
|
||||
** other function is able to return a subtype, then this function is
|
||||
** able to return a subtype.
|
||||
*/
|
||||
static int exprNodeCanReturnSubtype(Walker *pWalker, Expr *pExpr){
|
||||
int n;
|
||||
FuncDef *pDef;
|
||||
sqlite3 *db;
|
||||
if( pExpr->op!=TK_FUNCTION ){
|
||||
return WRC_Prune;
|
||||
}
|
||||
assert( ExprUseXList(pExpr) );
|
||||
db = pWalker->pParse->db;
|
||||
n = pExpr->x.pList ? pExpr->x.pList->nExpr : 0;
|
||||
pDef = sqlite3FindFunction(db, pExpr->u.zToken, n, ENC(db), 0);
|
||||
if( pDef==0 || (pDef->funcFlags & SQLITE_RESULT_SUBTYPE)!=0 ){
|
||||
pWalker->eCode = 1;
|
||||
return WRC_Prune;
|
||||
}
|
||||
return WRC_Continue;
|
||||
}
|
||||
|
||||
/*
|
||||
** Return TRUE if expression pExpr is able to return a subtype.
|
||||
**
|
||||
** A TRUE return does not guarantee that a subtype will be returned.
|
||||
** It only indicates that a subtype return is possible. False positives
|
||||
** are acceptable as they only disable an optimization. False negatives,
|
||||
** on the other hand, can lead to incorrect answers.
|
||||
*/
|
||||
static int sqlite3ExprCanReturnSubtype(Parse *pParse, Expr *pExpr){
|
||||
Walker w;
|
||||
memset(&w, 0, sizeof(w));
|
||||
w.pParse = pParse;
|
||||
w.xExprCallback = exprNodeCanReturnSubtype;
|
||||
sqlite3WalkExpr(&w, pExpr);
|
||||
return w.eCode;
|
||||
}
|
||||
|
||||
/*
|
||||
** The index pIdx is used by a query and contains one or more expressions.
|
||||
** In other words pIdx is an index on an expression. iIdxCur is the cursor
|
||||
@@ -6387,12 +6335,6 @@ static SQLITE_NOINLINE void whereAddIndexedExpr(
|
||||
continue;
|
||||
}
|
||||
if( sqlite3ExprIsConstant(0,pExpr) ) continue;
|
||||
if( pExpr->op==TK_FUNCTION && sqlite3ExprCanReturnSubtype(pParse,pExpr) ){
|
||||
/* Functions that might set a subtype should not be replaced by the
|
||||
** value taken from an expression index since the index omits the
|
||||
** subtype. https://sqlite.org/forum/forumpost/68d284c86b082c3e */
|
||||
continue;
|
||||
}
|
||||
p = sqlite3DbMallocRaw(pParse->db, sizeof(IndexedExpr));
|
||||
if( p==0 ) break;
|
||||
p->pIENext = pParse->pIdxEpr;
|
||||
|
||||
@@ -575,6 +575,7 @@ static Expr *removeUnindexableInClauseTerms(
|
||||
pNew->pLeft->x.pList = pLhs;
|
||||
}
|
||||
pSelect->pEList = pRhs;
|
||||
pSelect->selId = ++pParse->nSelect; /* Req'd for SubrtnSig validity */
|
||||
if( pLhs && pLhs->nExpr==1 ){
|
||||
/* Take care here not to generate a TK_VECTOR containing only a
|
||||
** single value. Since the parser never creates such a vector, some
|
||||
|
||||
+16
-11
@@ -219,20 +219,25 @@ static int isLikeOrGlob(
|
||||
z = (u8*)pRight->u.zToken;
|
||||
}
|
||||
if( z ){
|
||||
|
||||
/* Count the number of prefix characters prior to the first wildcard.
|
||||
** If the underlying database has a UTF16LE encoding, then only consider
|
||||
** ASCII characters. Note that the encoding of z[] is UTF8 - we are
|
||||
** dealing with only UTF8 here in this code, but the database engine
|
||||
** itself might be processing content using a different encoding. */
|
||||
/* Count the number of prefix bytes prior to the first wildcard.
|
||||
** or U+fffd character. If the underlying database has a UTF16LE
|
||||
** encoding, then only consider ASCII characters. Note that the
|
||||
** encoding of z[] is UTF8 - we are dealing with only UTF8 here in
|
||||
** this code, but the database engine itself might be processing
|
||||
** content using a different encoding. */
|
||||
cnt = 0;
|
||||
while( (c=z[cnt])!=0 && c!=wc[0] && c!=wc[1] && c!=wc[2] ){
|
||||
cnt++;
|
||||
if( c==wc[3] && z[cnt]!=0 ){
|
||||
if( c==wc[3] && z[cnt]>0 && z[cnt]<0x80 ){
|
||||
cnt++;
|
||||
}else if( c>=0x80 && ENC(db)==SQLITE_UTF16LE ){
|
||||
cnt--;
|
||||
break;
|
||||
}else if( c>=0x80 ){
|
||||
const u8 *z2 = z+cnt-1;
|
||||
if( sqlite3Utf8Read(&z2)==0xfffd || ENC(db)==SQLITE_UTF16LE ){
|
||||
cnt--;
|
||||
break;
|
||||
}else{
|
||||
cnt = (int)(z2-z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,7 +249,7 @@ static int isLikeOrGlob(
|
||||
** range search. The third is because the caller assumes that the pattern
|
||||
** consists of at least one character after all escapes have been
|
||||
** removed. */
|
||||
if( (cnt>1 || (cnt>0 && z[0]!=wc[3])) && 255!=(u8)z[cnt-1] ){
|
||||
if( (cnt>1 || (cnt>0 && z[0]!=wc[3])) && ALWAYS(255!=(u8)z[cnt-1]) ){
|
||||
Expr *pPrefix;
|
||||
|
||||
/* A "complete" match if the pattern ends with "*" or "%" */
|
||||
|
||||
@@ -82,5 +82,43 @@ do_execsql_test atof1-2.40 {
|
||||
SELECT randomblob(0) - 1;
|
||||
} {-1}
|
||||
|
||||
# 2024-12-07 https://sqlite.org/forum/forumpost/569a7209179a7f5e
|
||||
# Incorrect conversion of floating point or integer literals that
|
||||
# have significant digits that begin with 1844674407370955 followed
|
||||
# by more digits in the range 0592 throgh 1609.
|
||||
#
|
||||
do_execsql_test atof-3.1 {
|
||||
WITH RECURSIVE bigval(i,vtxt) AS (
|
||||
SELECT 0, '18446744073709550000'
|
||||
UNION ALL
|
||||
SELECT i+1, format('1844674407370955%04d',i+1) FROM bigval
|
||||
WHERE i+1<=9999
|
||||
)
|
||||
SELECT vtxt, CAST(vtxt AS REAL) FROM bigval
|
||||
WHERE CAST(vtxt AS REAL) NOT GLOB '1.8446744073709[56]*';
|
||||
} {}
|
||||
do_execsql_test atof-3.2 {
|
||||
WITH RECURSIVE bigval(i,vtxt) AS (
|
||||
SELECT 0, '18.446744073709550000'
|
||||
UNION ALL
|
||||
SELECT i+1, format('18.44674407370955%04d',i+1) FROM bigval
|
||||
WHERE i+1<=9999
|
||||
)
|
||||
SELECT vtxt, CAST(vtxt AS REAL) FROM bigval
|
||||
WHERE CAST(vtxt AS REAL) NOT GLOB '18.446744073709*';
|
||||
} {}
|
||||
do_execsql_test atof-3.3 {
|
||||
WITH RECURSIVE exp(n,v1,v2) AS (
|
||||
SELECT -200, '1.8446744073709550592e-200', '1.8446744073709551609e-200'
|
||||
UNION ALL
|
||||
SELECT n+1, ('1.8446744073709550592e'||n),('1.8446744073709551609e'||n)
|
||||
FROM exp WHERE n<200
|
||||
)
|
||||
SELECT n, v1, v2
|
||||
FROM exp
|
||||
WHERE format('%.10e',CAST(v1 AS REAL)) NOT GLOB '1.8446*'
|
||||
OR format('%.10e',CAST(v2 AS REAL)) NOT GLOB '1.8446*';
|
||||
} {}
|
||||
|
||||
|
||||
finish_test
|
||||
|
||||
@@ -276,4 +276,31 @@ do_catchsql_test 6.3 {
|
||||
UPDATE t1 SET x='hello world' WHERE rowid=1;
|
||||
} {1 {database disk image is malformed}}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
reset_db
|
||||
do_execsql_test 7.0 {
|
||||
BEGIN;
|
||||
CREATE TABLE p1(x PRIMARY KEY);
|
||||
CREATE TABLE c1(y);
|
||||
|
||||
PRAGMA schema_version = 0;
|
||||
PRAGMA writable_schema = RESET;
|
||||
|
||||
INSERT INTO c1 VALUES(1000);
|
||||
ROLLBACK;
|
||||
}
|
||||
|
||||
do_execsql_test 7.1 {
|
||||
PRAGMA table_info = p1;
|
||||
} {0 x {} 0 {} 1}
|
||||
|
||||
do_catchsql_test 7.2 {
|
||||
SELECT * FROM p1;
|
||||
} {1 {database disk image is malformed}}
|
||||
|
||||
do_catchsql_test 7.3 {
|
||||
PRAGMA integrity_check
|
||||
} {1 {database disk image is malformed}}
|
||||
|
||||
|
||||
finish_test
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
# 2024-11-20
|
||||
#
|
||||
# The author disclaims copyright to this source code. In place of
|
||||
# a legal notice, here is a blessing:
|
||||
#
|
||||
# May you do good and not evil.
|
||||
# May you find forgiveness for yourself and forgive others.
|
||||
# May you share freely, never taking more than you give.
|
||||
#
|
||||
#***********************************************************************
|
||||
#
|
||||
# Test cases for sqlite3_error_offset()
|
||||
#
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
|
||||
do_execsql_test errofst1-1.1 {
|
||||
CREATE TABLE t1 as select 1 as aa;
|
||||
CREATE VIEW t2 AS
|
||||
WITH t3 AS (SELECT 1 FROM t1 AS bb, t1 AS cc WHERE cc.aa <= sts.aa)
|
||||
SELECT 1 FROM t3 AS dd;
|
||||
}
|
||||
do_catchsql_test errofst1-1.2 {
|
||||
SELECT * FROM t2;
|
||||
} {1 {no such column: sts.aa}}
|
||||
do_test errofst1-1.3 {
|
||||
sqlite3_error_offset db
|
||||
} {-1}
|
||||
|
||||
finish_test
|
||||
@@ -0,0 +1,280 @@
|
||||
# 2024 November 7
|
||||
#
|
||||
# The author disclaims copyright to this source code. In place of
|
||||
# a legal notice, here is a blessing:
|
||||
#
|
||||
# May you do good and not evil.
|
||||
# May you find forgiveness for yourself and forgive others.
|
||||
# May you share freely, never taking more than you give.
|
||||
#
|
||||
#*************************************************************************
|
||||
# This file implements regression tests for SQLite library. The
|
||||
# focus of this script is testing the FTS3 module.
|
||||
#
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
source $testdir/fts3_common.tcl
|
||||
set testprefix fts3corrupt7
|
||||
|
||||
# If SQLITE_ENABLE_FTS3 is defined, omit this file.
|
||||
ifcapable !fts3 {
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
|
||||
sqlite3_fts3_may_be_corrupt 1
|
||||
database_may_be_corrupt
|
||||
extra_schema_checks 0
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
reset_db
|
||||
do_test 1.0 {
|
||||
sqlite3 db {}
|
||||
db deserialize [decode_hexdb {
|
||||
| size 28672 pagesize 4096 filename x.db
|
||||
| page 1 offset 0
|
||||
| 0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 SQLite format 3.
|
||||
| 16: 10 00 01 01 00 40 20 20 00 00 00 04 00 00 00 07 .....@ ........
|
||||
| 32: 00 00 00 02 00 00 00 01 00 00 00 04 00 00 00 04 ................
|
||||
| 48: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 ................
|
||||
| 80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 04 ................
|
||||
| 96: 00 2e 82 40 0d 0e b1 00 06 0d a4 00 0f 8d 0f 21 ...@...........!
|
||||
| 112: 0e b9 0d c8 0e 7e 0d a4 7d a4 00 00 00 00 00 00 .....~..........
|
||||
| 2512: 00 00 00 00 00 00 00 00 96 00 00 00 00 00 00 00 ................
|
||||
| 3488: 00 00 00 00 22 07 06 17 11 11 01 31 74 61 62 6c ...........1tabl
|
||||
| 3504: 65 74 32 74 32 07 43 52 45 41 54 45 20 54 41 42 et2t2.CREATE TAB
|
||||
| 3520: 4c 45 20 74 32 28 78 29 81 33 05 07 17 1f 1f 01 LE t2(x).3......
|
||||
| 3536: 82 35 74 61 62 6c 65 74 31 5f 73 65 67 64 69 72 .5tablet1_segdir
|
||||
| 3552: 74 31 5f 73 65 67 64 69 72 05 43 52 45 41 54 45 t1_segdir.CREATE
|
||||
| 3568: 20 54 41 42 4c 45 20 27 74 31 5f 73 65 67 64 69 TABLE 't1_segdi
|
||||
| 3584: 72 27 28 6c 65 76 65 6c 20 49 4e 54 45 47 45 52 r'(level INTEGER
|
||||
| 3600: 2c 69 64 78 20 49 4e 54 45 47 45 52 2c 73 74 61 ,idx INTEGER,sta
|
||||
| 3616: 72 74 5f 62 6c 6f 63 6b 20 49 4e 54 45 47 45 52 rt_block INTEGER
|
||||
| 3632: 2c 6c 65 61 76 65 73 5f 65 6e 64 5f 62 6c 6f 63 ,leaves_end_bloc
|
||||
| 3648: 6b 20 49 4e 54 45 47 45 52 2c 65 6e 64 5f 62 6c k INTEGER,end_bl
|
||||
| 3664: 6f 63 6b 20 49 4e 54 45 47 45 52 2c 72 6f 6f 74 ock INTEGER,root
|
||||
| 3680: 20 42 4c 4f 42 2c 50 52 49 4d 41 52 59 20 4b 45 BLOB,PRIMARY KE
|
||||
| 3696: 59 28 6c 65 76 65 6c 2c 20 69 64 78 29 29 31 06 Y(level, idx))1.
|
||||
| 3712: 06 17 45 1f 01 00 69 6e 64 65 78 73 71 6c 69 74 ..E...indexsqlit
|
||||
| 3728: 65 5f 61 75 74 6f 69 6e 64 65 78 5f 74 31 5f 73 e_autoindex_t1_s
|
||||
| 3744: 65 67 64 69 72 5f 31 74 31 5f 73 65 67 64 69 72 egdir_1t1_segdir
|
||||
| 3760: 06 0f c7 00 08 00 00 00 00 66 04 07 17 23 23 01 .........f...##.
|
||||
| 3776: 81 13 74 61 62 6c 65 74 31 5f 73 65 67 6d 65 6e ..tablet1_segmen
|
||||
| 3792: 74 73 74 31 5f 73 65 67 6d 65 6e 74 73 04 43 52 tst1_segments.CR
|
||||
| 3808: 45 41 54 45 20 54 41 42 4c 45 20 27 74 31 5f 73 EATE TABLE 't1_s
|
||||
| 3824: 65 67 6d 65 6e 74 73 27 28 62 6c 6f 63 6b 69 64 egments'(blockid
|
||||
| 3840: 20 49 4e 54 45 47 45 52 20 50 52 49 4d 41 52 59 INTEGER PRIMARY
|
||||
| 3856: 20 4b 45 59 2c 20 62 6c 6f 63 6b 20 42 4c 4f 42 KEY, block BLOB
|
||||
| 3872: 29 6a 03 07 17 21 21 01 81 1f 74 61 62 6c 65 74 )j...!!...tablet
|
||||
| 3888: 31 5f 63 6f 6e 74 65 6e 74 74 31 5f 63 6f 6e 74 1_contentt1_cont
|
||||
| 3904: 65 6e 74 03 43 52 45 41 54 45 20 54 41 42 4c 45 ent.CREATE TABLE
|
||||
| 3920: 20 27 74 31 5f 63 6f 6e 74 65 6e 74 27 28 64 6f 't1_content'(do
|
||||
| 3936: 63 69 64 20 49 4e 54 45 47 45 52 20 50 52 49 4d cid INTEGER PRIM
|
||||
| 3952: 41 52 59 20 4b 45 59 2c 20 27 63 30 61 27 2c 20 ARY KEY, 'c0a',
|
||||
| 3968: 27 63 31 62 27 2c 20 27 63 32 63 27 29 38 02 06 'c1b', 'c2c')8..
|
||||
| 3984: 17 11 11 08 5f 74 61 62 6c 65 74 31 74 31 43 52 ...._tablet1t1CR
|
||||
| 4000: 45 41 54 45 20 56 49 52 54 55 41 4c 20 54 41 42 EATE VIRTUAL TAB
|
||||
| 4016: 4c 45 20 74 31 20 55 53 49 4e 47 20 66 74 73 33 LE t1 USING fts3
|
||||
| 4032: 28 61 2c 62 2c 63 29 00 00 00 39 00 00 00 00 00 (a,b,c)...9.....
|
||||
| page 2 offset 4096
|
||||
| 0: 01 00 00 00 00 01 00 00 00 00 01 00 00 00 00 01 ................
|
||||
| 16: 00 00 00 00 02 00 00 00 00 05 00 00 00 03 02 00 ................
|
||||
| 32: 00 00 00 05 00 00 00 03 02 00 00 00 00 05 00 00 ................
|
||||
| 48: 00 03 02 00 00 00 00 05 00 00 00 03 02 00 00 00 ................
|
||||
| 64: 00 05 00 00 00 03 02 00 00 00 00 05 00 00 00 03 ................
|
||||
| 80: 02 00 00 00 00 05 00 00 00 03 02 00 00 00 00 05 ................
|
||||
| 96: 00 00 00 03 02 00 00 00 00 05 00 00 00 03 05 00 ................
|
||||
| 112: 00 00 03 03 00 00 00 23 02 00 00 00 00 03 00 00 .......#........
|
||||
| 128: 00 23 02 00 00 00 00 03 00 00 4d 5a 14 00 ae 7c .#........MZ...|
|
||||
| 1088: 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00 ................
|
||||
| 4080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 09 ................
|
||||
| page 3 offset 8192
|
||||
| 0: 0d 00 00 00 25 0b 48 00 0f d8 0f af 0f 86 0f 74 ....%.H........t
|
||||
| 16: 0f 61 0f 4e 0f 2f 0f 0f 0e ef 0e d7 0e be 0e a5 .a.N./..........
|
||||
| 32: 0e 8d 0e 74 0e 5b 0e 40 0e 24 0e 08 0d ef 0d d5 ...t.[.@.$......
|
||||
| 48: 0d bb 0d a0 0d 84 0d 68 0d 4f 0d 35 0d 1b 0c fb .......h.O.5....
|
||||
| 64: 0c da 0c b9 0c 99 0c 78 0c 57 0c 3e 0c 24 0c 0a .......x.W.>.$..
|
||||
| 80: 0b 48 00 00 00 00 00 00 00 00 00 00 00 00 00 00 .H..............
|
||||
| 2880: 00 00 00 00 00 00 00 00 81 3f 25 06 00 82 7f 00 .........?%.....
|
||||
| 2896: 00 43 4f 4d 50 49 4c 45 52 3d 67 63 63 2d 35 2e .COMPILER=gcc-5.
|
||||
| 2912: 34 2e 30 20 32 30 31 36 30 36 30 39 20 44 45 42 4.0 20160609 DEB
|
||||
| 2928: 55 47 20 45 4e 41 42 4c 45 20 44 42 53 54 41 54 UG ENABLE DBSTAT
|
||||
| 2944: 20 56 54 41 42 20 45 4e 41 42 4c 45 20 46 54 53 VTAB ENABLE FTS
|
||||
| 2960: 34 20 45 4e 41 42 4c 45 20 46 54 53 35 20 45 4e 4 ENABLE FTS5 EN
|
||||
| 2976: 41 42 4c 45 20 47 45 4f 50 4f 4c 59 20 45 4e 41 ABLE GEOPOLY ENA
|
||||
| 2992: 42 4c 45 20 4a 53 4f 4e 31 20 45 4e 41 42 4c 45 BLE JSON1 ENABLE
|
||||
| 3008: 20 4d 45 4d 53 59 53 35 20 45 4e 41 42 4c 45 20 MEMSYS5 ENABLE
|
||||
| 3024: 52 54 52 45 45 20 4d 41 58 20 4d 45 4d 4f 52 59 RTREE MAX MEMORY
|
||||
| 3040: 3d 35 30 30 30 30 30 30 30 20 4f 4d 49 54 20 4c =50000000 OMIT L
|
||||
| 3056: 4f 41 44 20 45 58 54 45 4e 53 49 4f 4e 20 54 48 OAD EXTENSION TH
|
||||
| 3072: 52 45 41 44 53 41 46 45 3d 30 18 24 05 00 25 0f READSAFE=0.$..%.
|
||||
| 3088: 19 54 48 52 45 41 44 53 41 46 45 3d 30 58 42 49 .THREADSAFE=0XBI
|
||||
| 3104: 4e 41 52 59 18 23 05 00 25 0f 19 54 48 52 45 41 NARY.#..%..THREA
|
||||
| 3120: 44 53 41 46 45 3d 30 58 4e 4f 43 41 53 45 17 22 DSAFE=0XNOCASE..
|
||||
| 3136: 05 00 25 0f 17 54 48 52 45 41 44 53 41 46 45 3d ..%..THREADSAFE=
|
||||
| 3152: 30 58 52 54 52 49 4d 1f 21 05 00 33 0f 19 4f 4d 0XRTRIM.!..3..OM
|
||||
| 3168: 49 54 20 4c 4f 41 44 20 45 58 54 45 4e 53 49 4f IT LOAD EXTENSIO
|
||||
| 3184: 4e 58 42 49 4e 41 52 59 1f 20 05 00 33 0f 19 4f NXBINARY. ..3..O
|
||||
| 3200: 4d 49 54 20 4c 4f 41 44 20 45 58 54 45 4e 53 49 MIT LOAD EXTENSI
|
||||
| 3216: 4f 4e 58 4e 4f 43 41 53 45 1e 1f 05 00 33 0f 17 ONXNOCASE....3..
|
||||
| 3232: 4f 4d 49 54 20 4c 4f 41 44 20 45 58 54 45 4e 53 OMIT LOAD EXTENS
|
||||
| 3248: 49 4f 4e 58 52 54 52 49 4d 1f 1e 05 00 33 00 00 IONXRTRIM....3..
|
||||
| 4016: 54 41 42 4c 45 20 74 31 28 61 20 49 4e 54 45 47 TABLE t1(a INTEG
|
||||
| 4032: 45 52 20 50 52 49 4d 41 52 59 20 4b 45 59 20 41 ER PRIMARY KEY A
|
||||
| 4048: 55 54 4f 49 4e 43 52 45 4d 45 4e 54 2c 0a 62 2c UTOINCREMENT,.b,
|
||||
| 4064: 63 2c 64 2c 65 2c 66 2c 67 2c 68 2c 6a 2c 6b 2c c,d,e,f,g,h,j,k,
|
||||
| 4080: 6c 2c 6d 2c 6e 2c 6f 2c 70 2c 71 2c 72 2c 73 29 l,m,n,o,p,q,r,s)
|
||||
| page 5 offset 16384
|
||||
| 0: 0d 00 00 00 02 0b a0 00 0c ad 0b a0 00 00 00 00 ................
|
||||
| 2976: 82 0a 02 08 08 09 08 08 17 84 06 30 20 32 35 33 ...........0 253
|
||||
| 2992: 00 01 30 04 25 06 1b 00 00 08 32 30 31 36 30 36 ..0.%.....201606
|
||||
| 3008: 30 39 03 25 07 00 00 01 34 03 25 05 00 00 01 35 09.%....4.%....5
|
||||
| 3024: 03 25 04 00 01 07 30 30 30 30 30 30 30 03 25 1a .%....0000000.%.
|
||||
| 3040: 00 00 08 63 6f 6d 70 69 6c 65 72 03 25 02 00 00 ...compiler.%...
|
||||
| 3056: 06 64 62 73 74 61 74 03 25 0a 00 01 04 65 62 75 .dbstat.%....ebu
|
||||
| 3072: 67 03 25 08 00 00 06 65 6e 61 62 6c 65 09 25 09 g.%....enable.%.
|
||||
| 3088: 05 04 04 04 04 04 00 01 08 78 74 65 6e 73 69 6f .........xtensio
|
||||
| 3104: 6e 03 25 1d 00 00 04 66 74 73 34 03 25 0d 00 03 n.%....fts4.%...
|
||||
| 3120: 01 35 03 25 0f 00 00 03 67 63 63 03 25 03 00 01 .5.%....gcc.%...
|
||||
| 3136: 06 65 6f 70 6f 6c 79 03 25 11 00 00 05 6a 73 6f .eopoly.%....jso
|
||||
| 3152: 6e 31 03 25 13 00 00 04 6c 6f 61 64 03 25 1c 00 n1.%....load.%..
|
||||
| 3168: 00 03 6d 61 78 03 25 18 00 01 05 65 6d 6f 72 79 ..max.%....emory
|
||||
| 3184: 03 25 19 00 03 04 73 79 73 35 03 25 15 00 00 04 .%....sys5.%....
|
||||
| 3200: 6f 6d 69 74 03 25 1b 00 00 05 72 74 72 65 65 03 omit.%....rtree.
|
||||
| 3216: 25 01 00 d0 0a 07 68 72 65 61 64 73 61 66 65 03 %.....hreadsafe.
|
||||
| 3232: 25 1e 00 00 04 76 74 61 62 03 25 0b 00 86 50 01 %....vtab.%...P.
|
||||
| 3248: 08 08 08 08 08 17 8d 12 30 20 38 33 35 00 01 30 ........0 835..0
|
||||
| 3264: 12 01 06 00 01 06 00 01 06 00 1f 03 00 01 03 00 ................
|
||||
| 3280: 01 03 00 00 08 32 30 31 36 30 36 30 39 09 01 07 .....20160609...
|
||||
| 3296: 00 01 07 00 01 07 00 00 01 34 09 01 05 00 01 05 .........4......
|
||||
| 3312: 00 01 05 00 00 01 35 09 01 04 00 01 04 00 01 04 ......5.........
|
||||
| 3328: 00 01 07 30 30 30 30 30 30 30 09 1c 04 00 01 04 ...0000000......
|
||||
| 3344: 00 01 04 00 00 06 62 69 6e 61 72 79 3c 03 01 02 ......binary<...
|
||||
| 3360: 02 00 03 01 02 02 00 03 01 02 02 00 03 01 02 02 ................
|
||||
| 3376: 00 03 01 02 02 00 03 01 02 02 00 03 01 02 02 00 ................
|
||||
| 3392: 03 01 02 02 00 03 01 02 02 00 03 01 02 02 00 03 ................
|
||||
| 3408: 01 02 02 00 03 01 02 02 00 00 08 63 6f 6d 70 69 ...........compi
|
||||
| 3424: 6c 65 72 09 01 02 00 01 02 00 01 02 00 00 06 64 ler............d
|
||||
| 3440: 62 73 74 61 74 09 07 03 00 01 03 00 01 03 00 01 bstat...........
|
||||
| 3456: 04 65 62 75 67 09 04 02 00 01 02 00 01 02 00 00 .ebug...........
|
||||
| 3472: 06 65 6e 61 62 6c 65 3f 07 02 00 01 02 00 01 02 .enable?........
|
||||
| 3488: 00 01 02 00 01 02 00 01 02 00 01 02 00 01 02 00 ................
|
||||
| 3504: 01 02 00 01 02 00 01 02 00 01 02 00 01 02 00 01 ................
|
||||
| 3520: 02 00 01 02 00 01 02 00 01 02 00 01 02 00 01 02 ................
|
||||
| 3536: 00 01 02 00 01 02 00 01 08 78 74 65 6e 73 69 6f .........xtensio
|
||||
| 3552: 6e 09 1f 04 00 01 04 00 01 04 00 00 04 66 74 73 n............fts
|
||||
| 3568: 34 09 0a 03 00 01 03 00 01 03 00 03 01 35 09 0d 4............5..
|
||||
| 3584: 03 00 01 03 00 01 03 00 00 03 67 63 63 09 01 03 ..........gcc...
|
||||
| 3600: 00 01 03 00 01 03 00 01 06 65 6f 70 6f 6c 79 09 .........eopoly.
|
||||
| 3616: 10 03 00 01 03 00 01 03 00 00 05 6a 73 6f 6e 31 ...........json1
|
||||
| 3632: 09 13 03 00 01 03 01 01 03 00 00 04 6c 6f 61 64 ............load
|
||||
| 3648: 09 1f 03 00 01 03 00 01 03 00 00 03 6d 61 78 09 ............max.
|
||||
| 3664: 1c 02 00 01 02 00 01 02 00 01 05 65 6d 6f 72 79 ...........emory
|
||||
| 3680: 09 1c 03 00 01 03 00 01 03 00 03 04 73 79 73 35 ............sys5
|
||||
| 3696: 09 16 03 00 01 03 00 01 03 00 00 06 6e 6f 63 61 ............noca
|
||||
| 3712: 73 65 3c 02 01 02 02 00 03 01 02 02 00 03 01 02 se<.............
|
||||
| 3744: 00 03 01 02 02 00 03 01 02 02 00 03 01 02 02 00 ................
|
||||
| 3760: 03 01 02 02 00 03 01 02 02 00 03 01 02 02 00 00 ................
|
||||
| 3776: 04 6f 6d 69 74 09 1f 02 00 01 02 00 01 02 00 00 .omit...........
|
||||
| 3792: 05 72 74 72 65 65 09 19 03 00 01 03 00 01 03 00 .rtree..........
|
||||
| 3808: 03 02 69 6d 3c 01 01 02 02 00 03 01 02 02 00 03 ..im<...........
|
||||
| 3824: 01 02 02 00 03 01 02 02 00 03 01 02 02 00 03 01 ................
|
||||
| 3840: 02 02 00 03 01 02 02 00 03 01 02 02 00 03 01 02 ................
|
||||
| 3856: 02 00 03 01 02 02 00 03 01 02 02 00 03 01 02 02 ................
|
||||
| 3872: 00 00 0a 74 68 72 65 61 64 73 61 66 65 09 22 02 ...threadsafe...
|
||||
| 3888: 00 01 02 00 01 02 00 00 04 76 74 61 62 09 07 04 .........vtab...
|
||||
| 3952: 01 01 02 00 01 01 01 02 00 01 01 01 02 00 01 01 ................
|
||||
| 3968: 01 02 00 01 01 01 02 00 01 01 01 02 00 01 01 01 ................
|
||||
| 3984: 02 00 01 01 01 02 00 01 01 01 02 00 01 01 01 02 ................
|
||||
| 4000: 00 01 01 01 02 00 01 01 01 02 00 01 01 01 02 00 ................
|
||||
| 4032: 01 01 02 00 01 01 01 02 00 01 01 01 02 00 01 01 ................
|
||||
| 4048: 01 02 00 01 01 01 02 00 01 01 01 02 00 01 01 01 ................
|
||||
| 4064: 02 00 01 01 01 02 00 01 01 01 02 00 01 01 01 02 ................
|
||||
| 4080: 00 01 01 01 02 00 01 01 01 02 00 01 01 01 02 00 ................
|
||||
| page 6 offset 20480
|
||||
| 0: 0a 00 00 00 02 0f f5 00 0f fb 0f f5 00 00 00 00 ................
|
||||
| 4080: 00 00 00 00 00 05 04 08 09 01 02 04 04 08 08 09 ................
|
||||
| end x.db
|
||||
}]} {}
|
||||
|
||||
do_catchsql_test 1.1 {
|
||||
SELECT offsets(t1) FROM t1 WHERE t1 MATCH 'rtree NEAR rtree NEAR "json1 enable"';
|
||||
} {0 {}}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
reset_db
|
||||
do_test 1.0 {
|
||||
sqlite3 db {}
|
||||
db deserialize [decode_hexdb {
|
||||
| size 24576 pagesize 4096 filename crash-10b0f1037e9c85.db
|
||||
| page 1 offset 0
|
||||
| 0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 SQLite format 3.
|
||||
| 16: 10 00 00 00 00 40 20 20 00 00 00 01 00 00 00 07 .....@ ........
|
||||
| 32: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 00 ................
|
||||
| 80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 ................
|
||||
| 96: 00 2e 82 40 0d 00 00 00 06 00 00 00 0f 8d 0f 21 ...@...........!
|
||||
| 112: 0e b9 0d c8 0e 7e 0d a4 00 00 00 00 00 00 00 00 .....~..........
|
||||
| 3488: 00 00 00 00 21 ff 06 17 10 10 01 30 74 61 62 6c ....!......0tabl
|
||||
| 3504: 65 74 32 74 32 00 43 52 45 41 54 45 20 54 41 42 et2t2.CREATE TAB
|
||||
| 3520: 4c 45 20 74 32 28 70 29 81 33 00 07 17 1f 1f 01 LE t2(p).3......
|
||||
| 3536: 82 35 74 61 62 6c 65 74 31 5f 73 65 67 64 69 72 .5tablet1_segdir
|
||||
| 3552: 74 31 5f 73 65 67 64 69 72 05 43 52 45 41 54 45 t1_segdir.CREATE
|
||||
| 3568: 20 54 41 42 4c 45 20 27 74 31 5f 73 65 67 64 69 TABLE 't1_segdi
|
||||
| 3584: 72 27 28 6c 65 76 65 6c 20 09 4e 50 45 47 45 50 r'(level .NPEGEP
|
||||
| 3600: 2c 69 64 78 20 09 4e 50 45 47 45 50 2c 73 74 61 ,idx .NPEGEP,sta
|
||||
| 3616: 72 74 5f 62 6c 6f 63 6b 20 09 4e 50 45 47 45 50 rt_block .NPEGEP
|
||||
| 3632: 2c 6c 65 61 76 65 73 5f 65 6e 64 5f 62 6c 6f 63 ,leaves_end_bloc
|
||||
| 3648: 6b 20 09 4e 50 45 47 45 50 2c 65 6e 64 5f 62 6c k .NPEGEP,end_bl
|
||||
| 3664: 6f 63 6b 20 09 4e 50 45 47 45 50 2c 72 6f 6f 74 ock .NPEGEP,root
|
||||
| 3680: 20 42 0c 4f 42 2c 50 52 49 4d 41 52 59 20 4b 45 B.OB,PRIMARY KE
|
||||
| 3696: 59 28 6c 65 76 65 6c 2c 20 69 64 78 29 29 31 00 Y(level, idx))1.
|
||||
| 3712: 06 17 45 1f 01 00 00 00 00 00 00 73 71 6c 69 74 ..E........sqlit
|
||||
| 3728: 65 5f 61 75 74 6f 69 6e 64 65 78 5f 74 31 5f 73 e_autoindex_t1_s
|
||||
| 3744: 65 67 64 69 72 5f 31 00 00 00 00 00 00 00 00 00 egdir_1.........
|
||||
| 3760: 06 00 00 00 00 00 00 00 00 66 00 07 17 23 23 01 .........f...##.
|
||||
| 3776: 81 13 74 61 62 6c 65 74 31 5f 73 65 67 6d 65 6e ..tablet1_segmen
|
||||
| 3792: 74 73 74 31 5f 73 65 67 6d 65 6e 74 73 00 43 52 tst1_segments.CR
|
||||
| 3808: 45 41 54 45 20 54 41 42 4c 45 20 27 74 31 5f 73 EATE TABLE 't1_s
|
||||
| 3824: 65 67 6d 65 6e 74 73 27 28 0c 6f 63 6b 09 64 0a egments'(.ock.d.
|
||||
| 3840: 20 09 4e 50 45 47 45 50 20 50 50 09 04 31 50 09 .NPEGEP PP..1P.
|
||||
| 3856: 20 0b 45 09 0c 20 62 0c 6f 63 6b 20 42 0c 4f 42 .E.. b.ock B.OB
|
||||
| 3872: 29 6a 00 07 17 20 20 01 81 1f 74 61 62 6c 65 74 )j... ...tablet
|
||||
| 3888: 31 5f 63 6f 6e 74 65 6e 74 74 31 5f 63 6f 6e 74 1_contentt1_cont
|
||||
| 3904: 65 6e 74 00 43 52 45 41 54 45 20 54 41 42 4c 45 ent.CREATE TABLE
|
||||
| 3920: 20 27 74 31 5f 63 6f 6e 74 65 6e 74 27 28 64 6f 't1_content'(do
|
||||
| 3936: 09 64 20 09 4e 50 45 47 45 50 20 50 50 09 0d 0c .d .NPEGEP PP...
|
||||
| 3952: 50 09 20 0b 45 09 0c 20 27 03 03 01 27 0c 20 0a P. .E.. '...'. .
|
||||
| 3968: 27 03 01 02 27 0c 20 27 03 02 03 27 29 38 00 06 '...'. '...')8..
|
||||
| 3984: 17 10 10 08 5f 74 61 62 6c 65 74 31 74 31 43 52 ...._tablet1t1CR
|
||||
| 4000: 45 41 54 45 20 56 49 52 54 55 41 4c 20 54 41 42 EATE VIRTUAL TAB
|
||||
| 4016: 4c 45 20 74 31 20 55 53 49 4e 47 20 66 74 73 33 LE t1 USING fts3
|
||||
| page 5 offset 16384
|
||||
| 0: 0d 00 00 00 02 00 00 00 00 00 0b a0 00 00 00 00 ................
|
||||
| 2976: 82 0a 02 08 00 00 00 00 17 84 06 00 00 00 00 00 ................
|
||||
| 2992: 00 01 00 04 00 00 00 00 00 08 00 00 00 00 00 00 ................
|
||||
| 3008: 00 00 03 00 00 00 00 01 00 03 00 00 00 00 01 00 ................
|
||||
| 3024: 03 00 00 00 00 07 00 00 00 00 00 00 00 03 00 00 ................
|
||||
| 3040: 00 00 08 00 00 00 00 00 00 00 00 03 00 00 00 00 ................
|
||||
| 3056: 06 00 00 00 00 00 00 03 00 00 00 00 04 00 00 00 ................
|
||||
| 3072: 00 03 00 00 00 00 06 65 6e 61 62 6c 65 09 25 09 .......enable.%.
|
||||
| 3088: 05 04 04 04 04 00 00 00 08 00 00 00 00 00 00 00 ................
|
||||
| 3104: 00 03 00 00 00 00 04 00 00 00 00 03 00 00 00 00 ................
|
||||
| 3120: 01 00 03 00 00 00 00 03 00 00 00 03 00 00 00 00 ................
|
||||
| 3136: 06 00 00 00 00 00 00 03 00 00 00 00 05 6a 73 6f .............jso
|
||||
| 3152: 6e 31 03 25 13 00 00 04 00 00 00 00 03 00 00 00 n1.%............
|
||||
| 3168: 00 03 00 00 00 03 00 00 00 00 05 00 00 00 00 00 ................
|
||||
| 3184: 03 00 00 00 00 04 00 00 00 00 03 00 00 00 00 04 ................
|
||||
| 3200: 00 00 00 00 03 00 00 00 00 05 72 74 72 65 65 03 ..........rtree.
|
||||
| 3216: 25 01 00 0d 0a 07 08 01 ff ff ff ff ff 01 00 00 %...............
|
||||
| page 6 offset 20480
|
||||
| 0: 0a 00 00 00 02 00 00 00 0f fb 0f f5 00 00 00 00 ................
|
||||
| 4080: 00 00 00 00 00 05 04 09 00 01 02 04 00 00 00 00 ................
|
||||
| end crash-10b0f1037e9c85.db
|
||||
}]} {}
|
||||
|
||||
do_catchsql_test 2.1 {
|
||||
SELECT 0 FROM t1 WHERE t1 MATCH 'rtree NEAR rtree"json1 enable"';
|
||||
} {1 {database disk image is malformed}}
|
||||
|
||||
finish_test
|
||||
@@ -216,6 +216,14 @@ do_faultsim_test 8.4 -prep {
|
||||
} -test {
|
||||
faultsim_test_result {0 3}
|
||||
}
|
||||
do_faultsim_test 8.5 -prep {
|
||||
faultsim_restore_and_reopen
|
||||
db func mit mit
|
||||
} -body {
|
||||
execsql { SELECT mit(matchinfo(t8, 'l')) FROM t8 WHERE t8 MATCH '"a b c"' }
|
||||
} -test {
|
||||
faultsim_test_result {0 3}
|
||||
}
|
||||
|
||||
do_test 9.0 {
|
||||
faultsim_delete_and_reopen
|
||||
|
||||
+26
-1
@@ -192,6 +192,31 @@ do_execsql_test 3.4 {
|
||||
1 2 3 4 5 6
|
||||
}
|
||||
|
||||
|
||||
# 2024-11-20 https://sqlite.org/forum/forumpost/0b9ded2f8428ac00
|
||||
#
|
||||
# Bug in SubrtnSig logic. If a SELECT statement is copied and the copy
|
||||
# is subsequently modified, we need to change the Select.selId on the
|
||||
# copy so that when the copy is used to generate code, the SubrtnSig
|
||||
# logic won't try to substitute the original SELECT in place of the
|
||||
# copy which is now different.
|
||||
#
|
||||
do_execsql_test 3.5 {
|
||||
DROP TABLE IF EXISTS t1;
|
||||
DROP TABLE IF EXISTS t2;
|
||||
CREATE TABLE t1 (a int UNIQUE);
|
||||
CREATE TABLE t2 (b int UNIQUE);
|
||||
INSERT INTO t1 VALUES (1);
|
||||
INSERT INTO t2 VALUES (1), (2);
|
||||
SELECT t1.a, t2.b FROM t1, t2 WHERE (t1.a, t2.b) = (1, 1);
|
||||
} {1 1}
|
||||
do_execsql_test 3.6 {
|
||||
SELECT t1.a, t2.b FROM t1, t2 WHERE (t1.a, t2.b) IN ((1, 1));
|
||||
} {1 1}
|
||||
do_execsql_test 3.7 {
|
||||
SELECT t1.a, t2.b FROM t1, t2 WHERE (t1.a, t2.b) = (1, 2);
|
||||
} {1 2}
|
||||
do_execsql_test 3.8 {
|
||||
SELECT t1.a, t2.b FROM t1, t2 WHERE (t1.a, t2.b) IN ((1, 2));
|
||||
} {1 2}
|
||||
|
||||
finish_test
|
||||
|
||||
@@ -0,0 +1,83 @@
|
||||
# 2024-10-05
|
||||
#
|
||||
# The author disclaims copyright to this source code. In place of
|
||||
# a legal notice, here is a blessing:
|
||||
#
|
||||
# May you do good and not evil.
|
||||
# May you find forgiveness for yourself and forgive others.
|
||||
# May you share freely, never taking more than you give.
|
||||
#
|
||||
#***********************************************************************
|
||||
# This file implements regression tests for SQLite library. The
|
||||
# focus of this file is testing indexes on expressions.
|
||||
#
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
set testprefix indexexpr3
|
||||
|
||||
|
||||
do_execsql_test 1.0 {
|
||||
CREATE TABLE t1(a, j);
|
||||
INSERT INTO t1 VALUES(1, '{x:"one"}');
|
||||
INSERT INTO t1 VALUES(2, '{x:"two"}');
|
||||
INSERT INTO t1 VALUES(3, '{x:"three"}');
|
||||
|
||||
CREATE INDEX i1 ON t1( json_extract(j, '$.x') );
|
||||
CREATE INDEX i2 ON t1( a, json_extract(j, '$.x') );
|
||||
}
|
||||
|
||||
proc do_hasfunction_test {tn sql res} {
|
||||
set nFunction 0
|
||||
db eval "EXPLAIN $sql" x {
|
||||
if {$x(opcode)=="Function"} {
|
||||
incr nFunction
|
||||
}
|
||||
}
|
||||
|
||||
do_execsql_test $tn "
|
||||
SELECT $nFunction;
|
||||
$sql
|
||||
" $res
|
||||
}
|
||||
|
||||
do_hasfunction_test 1.1 {
|
||||
SELECT json_extract(j, '$.x') FROM t1 ORDER BY 1;
|
||||
} {
|
||||
0 one three two
|
||||
}
|
||||
|
||||
do_hasfunction_test 1.2 {
|
||||
SELECT json_extract(j, '$.x') FROM t1 WHERE a=2
|
||||
} {
|
||||
0 two
|
||||
}
|
||||
|
||||
do_hasfunction_test 1.3 {
|
||||
SELECT coalesce(json_extract(j, '$.x'), 'five') FROM t1 WHERE a=2
|
||||
} {
|
||||
0 two
|
||||
}
|
||||
|
||||
do_hasfunction_test 1.4 {
|
||||
SELECT json_extract(j, '$.x') || '.two' FROM t1 WHERE a=2
|
||||
} {
|
||||
0 two.two
|
||||
}
|
||||
|
||||
do_hasfunction_test 1.5 {
|
||||
SELECT json_insert( '{}', '$.y', json_extract(j, '$.x') ) FROM t1 WHERE a=2
|
||||
} {
|
||||
2 {{"y":"two"}}
|
||||
}
|
||||
|
||||
do_hasfunction_test 1.6 {
|
||||
SELECT json_insert( '{}', '$.y', coalesce( json_extract(j, '$.x'), 'five' ) )
|
||||
FROM t1 WHERE a=2
|
||||
} {
|
||||
2 {{"y":"two"}}
|
||||
}
|
||||
|
||||
|
||||
finish_test
|
||||
|
||||
+3
-3
@@ -731,16 +731,16 @@ ifcapable like_opt&&!icu {
|
||||
}
|
||||
do_test like-9.5.1 {
|
||||
set res [sqlite3_exec_hex db {
|
||||
SELECT x FROM t2 WHERE x LIKE '%fe%25'
|
||||
SELECT 1 FROM t2 WHERE x LIKE '%fe%25'
|
||||
}]
|
||||
} {0 {}}
|
||||
} {0 {1 1}}
|
||||
ifcapable explain {
|
||||
do_test like-9.5.2 {
|
||||
set res [sqlite3_exec_hex db {
|
||||
EXPLAIN QUERY PLAN SELECT x FROM t2 WHERE x LIKE '%fe%25'
|
||||
}]
|
||||
regexp {INDEX i2} $res
|
||||
} {1}
|
||||
} {0}
|
||||
}
|
||||
|
||||
# Do an SQL statement. Append the search count to the end of the result.
|
||||
|
||||
@@ -146,6 +146,54 @@ do_test lock5-flock.8 {
|
||||
db2 close
|
||||
} {}
|
||||
|
||||
do_test lock5-flock.9 {
|
||||
sqlite3 db test.db -vfs unix-flock
|
||||
execsql {
|
||||
SELECT * FROM t1
|
||||
}
|
||||
} {1 2}
|
||||
|
||||
do_test lock5-flock.10 {
|
||||
sqlite3 db2 test.db -vfs unix-flock
|
||||
execsql {
|
||||
SELECT * FROM t1
|
||||
} db2
|
||||
} {1 2}
|
||||
|
||||
do_test lock5-flock.10 {
|
||||
execsql {
|
||||
PRAGMA cache_size = 1;
|
||||
BEGIN;
|
||||
WITH s(i) AS (
|
||||
SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<10000
|
||||
)
|
||||
INSERT INTO t1 SELECT i, i+1 FROM s;
|
||||
}
|
||||
|
||||
catchsql {
|
||||
SELECT * FROM t1
|
||||
} db2
|
||||
} {1 {database is locked}}
|
||||
|
||||
if {[permutation]!="inmemory_journal"} {
|
||||
do_test lock5-flock.11 {
|
||||
forcecopy test.db test.db2
|
||||
forcecopy test.db-journal test.db2-journal
|
||||
db2 close
|
||||
sqlite3 db2 test.db2 -vfs unix-flock
|
||||
catchsql {
|
||||
SELECT * FROM t1
|
||||
} db2
|
||||
} {0 {1 2}}
|
||||
|
||||
do_test lock5-flock.12 {
|
||||
file exists test.db2-journal
|
||||
} 0
|
||||
}
|
||||
|
||||
db close
|
||||
db2 close
|
||||
|
||||
}
|
||||
|
||||
#####################################################################
|
||||
|
||||
@@ -325,4 +325,35 @@ do_eqp_test 6.3 {
|
||||
`--REUSE LIST SUBQUERY xxxxxx
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
reset_db
|
||||
do_execsql_test 7.0 {
|
||||
CREATE TABLE t0_1(a INT , b INT, c INT);
|
||||
CREATE TABLE t0_2(a INT , b INT, c INT);
|
||||
|
||||
INSERT INTO t0_1 (a, b, c) VALUES (1, 0, 1);
|
||||
INSERT INTO t0_2 (a, b, c) VALUES (1, 0, 1);
|
||||
|
||||
CREATE TABLE empty1(x);
|
||||
CREATE TABLE empty2(y);
|
||||
}
|
||||
|
||||
do_execsql_test 7.1 {
|
||||
SELECT t0_2.c
|
||||
FROM (SELECT '0000' AS c0 FROM empty2 RIGHT JOIN t0_1 ON 1) AS v0
|
||||
LEFT JOIN empty1 ON v0.c0, t0_2
|
||||
RIGHT JOIN (
|
||||
SELECT 5678 AS col0 FROM (SELECT 0)
|
||||
) AS sub1 ON 1;
|
||||
} {1}
|
||||
|
||||
do_execsql_test 7.2 {
|
||||
SELECT t0_2.c
|
||||
FROM (SELECT '0000' AS c0 FROM empty2 RIGHT JOIN t0_1 ON 1) AS v0
|
||||
LEFT JOIN empty1 ON v0.c0, t0_2
|
||||
RIGHT JOIN (
|
||||
SELECT 5678 AS col0 FROM (SELECT 0)
|
||||
) AS sub1 ON 1 WHERE +t0_2.c;
|
||||
} {1}
|
||||
|
||||
finish_test
|
||||
|
||||
+4
-1
@@ -1063,7 +1063,10 @@ do_test shell1-5.0 {
|
||||
continue
|
||||
}
|
||||
# Tcl 8.7 maps 0x80 through 0x9f into valid UTF8. So skip those tests.
|
||||
if {$i>=0x80 && ($i<=0x9F || $tcl_version>=9.0)} continue
|
||||
if {$i>=0x80} {
|
||||
if {$i<=0x9F || $tcl_version>=9.0} continue
|
||||
if {$tcl_platform(platform)=="windows"} continue
|
||||
}
|
||||
if {$i>=0xE0 && $tcl_platform(os)=="OpenBSD"} continue
|
||||
if {$i>=0xE0 && $i<=0xEF && $tcl_platform(os)=="Linux"} continue
|
||||
set hex [format %02X $i]
|
||||
|
||||
@@ -96,4 +96,43 @@ do_test 1.8 {
|
||||
list [catch { sqlite3_snapshot_open_blob db3 main $snap } msg] $msg
|
||||
} {1 SQLITE_ERROR_SNAPSHOT}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
reset_db
|
||||
do_execsql_test 2.0 {
|
||||
PRAGMA journal_mode = wal;
|
||||
CREATE TABLE t1(a, b);
|
||||
INSERT INTO t1 VALUES(1, 2);
|
||||
INSERT INTO t1 VALUES(3, 4);
|
||||
} {wal}
|
||||
|
||||
sqlite3 db2 test.db
|
||||
sqlite3 db3 test.db
|
||||
do_execsql_test -db db2 2.0.1 {
|
||||
SELECT * FROM t1
|
||||
} {1 2 3 4}
|
||||
do_execsql_test -db db3 2.0.2 {
|
||||
SELECT * FROM t1
|
||||
} {1 2 3 4}
|
||||
|
||||
do_execsql_test -db db2 2.2 {
|
||||
PRAGMA wal_checkpoint;
|
||||
} {0 4 4}
|
||||
|
||||
do_test 2.1 {
|
||||
db eval { BEGIN }
|
||||
set snap [sqlite3_snapshot_get db main]
|
||||
set {} {}
|
||||
} {}
|
||||
|
||||
do_execsql_test -db db2 2.3 {
|
||||
INSERT INTO t1 VALUES(5, 6);
|
||||
} {}
|
||||
|
||||
do_test 2.2 {
|
||||
execsql { BEGIN } db3
|
||||
sqlite3_snapshot_open db3 main $snap
|
||||
} {}
|
||||
|
||||
sqlite3_snapshot_free $snap
|
||||
|
||||
finish_test
|
||||
|
||||
+3
-1
@@ -57,6 +57,7 @@ do_execsql_test 1.0 {
|
||||
INSERT INTO t1 VALUES(1,9999);
|
||||
}
|
||||
|
||||
forcedelete link.db
|
||||
do_test 2.0 {
|
||||
createWin32Symlink link.db test.db
|
||||
} {}
|
||||
@@ -87,12 +88,13 @@ do_test 3.4 {
|
||||
db3 close
|
||||
} {}
|
||||
|
||||
# The -nofollow option does not work on Windows
|
||||
do_test 3.5 {
|
||||
list [catch {
|
||||
sqlite3 db4 link.db -nofollow true
|
||||
execsql { SELECT x, y FROM t1; } db4
|
||||
} res] $res
|
||||
} {1 {unable to open database file}}
|
||||
} {0 {1 9999}}
|
||||
|
||||
catch {db4 close}
|
||||
|
||||
|
||||
@@ -348,6 +348,29 @@ do_execsql_test tabfunc01-920 {
|
||||
) LIMIT -1 OFFSET 0;
|
||||
} {1 2 3 4 5 6 7 8 9 10 101 102 103 104}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# Forum post https://sqlite.org/forum/forumpost/e7c3ae1215
|
||||
#
|
||||
foreach {tn where res} {
|
||||
1000 "where value = 2" 2
|
||||
1010 "where value in (2)" 2
|
||||
1020 "where value in (select 2)" 2
|
||||
1030 "where value = 2 OR value = 4" {2 4}
|
||||
1040 "where value in (2, 4)" {2 4}
|
||||
} {
|
||||
do_execsql_test $tn "
|
||||
SELECT value FROM generate_series(1, 5) $where
|
||||
" $res
|
||||
}
|
||||
|
||||
do_execsql_test 1100 {
|
||||
select 1 as c_0
|
||||
from
|
||||
generate_series(1, 1) as ref_3
|
||||
where (ref_3.value) in (select 1);
|
||||
} {1}
|
||||
|
||||
|
||||
|
||||
# Free up memory allocations
|
||||
intarray_addr
|
||||
|
||||
@@ -245,6 +245,15 @@ switch -nocase -glob -- $tcl_platform(os) {
|
||||
set TRG(run) run.sh
|
||||
set TRG(runcmd) "bash run.sh"
|
||||
}
|
||||
*openbsd* {
|
||||
set TRG(platform) linux
|
||||
set TRG(make) make.sh
|
||||
set TRG(makecmd) "sh make.sh"
|
||||
set TRG(testfixture) testfixture
|
||||
set TRG(shell) sqlite3
|
||||
set TRG(run) run.sh
|
||||
set TRG(runcmd) "sh run.sh"
|
||||
}
|
||||
*win* {
|
||||
set TRG(platform) win
|
||||
set TRG(make) make.bat
|
||||
|
||||
@@ -95,7 +95,7 @@ proc run_thread_tests {{print_warning 0}} {
|
||||
if {[info commands sqlthread] eq ""} {
|
||||
set zProblem "SQLite build is not threadsafe"
|
||||
}
|
||||
if {![info exists ::tcl_platform(threaded)]} {
|
||||
if {![tcl::pkgconfig get threaded]} {
|
||||
set zProblem "Linked against a non-threadsafe Tcl build"
|
||||
}
|
||||
if {[info exists zProblem]} {
|
||||
@@ -107,4 +107,3 @@ proc run_thread_tests {{print_warning 0}} {
|
||||
}
|
||||
|
||||
return 0
|
||||
|
||||
|
||||
+26
-2
@@ -15,6 +15,7 @@ Options:
|
||||
--info Show info on existing SQLite TCL extension installs
|
||||
--install-only Install an extension previously build
|
||||
--uninstall Uninstall the extension
|
||||
--destdir DIR Installation root (used by "make install DESTDIR=...")
|
||||
|
||||
Other options are retained and passed through into the compiler.}
|
||||
|
||||
@@ -25,6 +26,7 @@ set uninstall 0
|
||||
set infoonly 0
|
||||
set CC {}
|
||||
set OPTS {}
|
||||
set DESTDIR ""; # --destdir "$(DESTDIR)"
|
||||
for {set ii 0} {$ii<[llength $argv]} {incr ii} {
|
||||
set a0 [lindex $argv $ii]
|
||||
if {$a0=="--install-only"} {
|
||||
@@ -42,6 +44,9 @@ for {set ii 0} {$ii<[llength $argv]} {incr ii} {
|
||||
} elseif {$a0=="--cc" && $ii+1<[llength $argv]} {
|
||||
incr ii
|
||||
set CC [lindex $argv $ii]
|
||||
} elseif {$a0=="--destdir" && $ii+1<[llength $argv]} {
|
||||
incr ii
|
||||
set DESTDIR [lindex $argv $ii]
|
||||
} elseif {[string match -* $a0]} {
|
||||
append OPTS " $a0"
|
||||
} else {
|
||||
@@ -193,7 +198,26 @@ if {$install} {
|
||||
#
|
||||
set DEST {}
|
||||
foreach dir $auto_path {
|
||||
if {[file writable $dir]} {
|
||||
if {[string match //*:* $dir]} {
|
||||
# We can't install to //zipfs: paths
|
||||
continue
|
||||
} elseif {"" ne $DESTDIR && ![file writable $DESTDIR]} {
|
||||
# In the common case, ${DESTDIR}${dir} will not exist when we
|
||||
# get to this point of the installation, and the "is writable?"
|
||||
# check just below this will fail for that case.
|
||||
#
|
||||
# Assumption made for simplification's sake: if ${DESTDIR} is
|
||||
# not writable, no part of the remaining path will
|
||||
# be. ${DESTDIR} is typically used by OS package maintainers,
|
||||
# not normal installations, and it "shouldn't" ever happen that
|
||||
# the DESTDIR is read-only while the target ${DESTDIR}${prefix}
|
||||
# is not, as it's typical for such installations to create
|
||||
# ${prefix} on-demand under ${DESTDIR}.
|
||||
break
|
||||
}
|
||||
set dir ${DESTDIR}$dir
|
||||
if {[file writable $dir] || "" ne $DESTDIR} {
|
||||
# the dir will be created later ^^^^^^^^
|
||||
set DEST $dir
|
||||
break
|
||||
} elseif {[glob -nocomplain $dir/sqlite3*/pkgIndex.tcl]!=""} {
|
||||
@@ -211,7 +235,7 @@ if {$install} {
|
||||
puts "to work around this problem.\n"
|
||||
puts "These are the (unwritable) \$auto_path directories:\n"
|
||||
foreach dir $auto_path {
|
||||
puts " * $dir"
|
||||
puts " * ${DESTDIR}$dir"
|
||||
}
|
||||
exit 1
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ amalgamator
|
||||
amongst
|
||||
analyse
|
||||
antipenultimate
|
||||
antirez
|
||||
ap
|
||||
api
|
||||
appdef
|
||||
@@ -93,6 +94,7 @@ beginthreadex
|
||||
behavior
|
||||
behavioral
|
||||
behaviors
|
||||
behaviour
|
||||
benigncnt
|
||||
bg
|
||||
bigblob
|
||||
@@ -243,6 +245,7 @@ dependences
|
||||
dequote
|
||||
dequoted
|
||||
dequoting
|
||||
dereference
|
||||
dereferenced
|
||||
dereferences
|
||||
desc
|
||||
@@ -476,6 +479,7 @@ iff
|
||||
ifndef
|
||||
imm
|
||||
impl
|
||||
imposter
|
||||
incr
|
||||
incrblob
|
||||
incrementing
|
||||
@@ -563,6 +567,7 @@ lifecycle
|
||||
lindex
|
||||
lineno
|
||||
Linenoise
|
||||
linenoise
|
||||
linux
|
||||
lised
|
||||
lld
|
||||
@@ -650,6 +655,7 @@ msec
|
||||
msg
|
||||
msgs
|
||||
msize
|
||||
msteveb
|
||||
msvc
|
||||
mtime
|
||||
mult
|
||||
@@ -893,6 +899,7 @@ rowids
|
||||
Rowkey
|
||||
rownumber
|
||||
rowset
|
||||
rsync
|
||||
runtime
|
||||
rw
|
||||
rwc
|
||||
@@ -1192,6 +1199,7 @@ wheretrace
|
||||
whitespace
|
||||
Willmann
|
||||
withoutrowid
|
||||
workalike
|
||||
wr
|
||||
wrapup
|
||||
writeable
|
||||
|
||||
+5
-13
@@ -10,6 +10,7 @@
|
||||
# sqlite3 -- the SQLite CLI
|
||||
# sqldiff -- Program to diff two databases
|
||||
# sqlite3_analyzer -- Space analyzer
|
||||
# sqlite3_rsync -- Remote db sync
|
||||
#
|
||||
switch $tcl_platform(os) {
|
||||
{Windows NT} {
|
||||
@@ -54,16 +55,7 @@ close $in
|
||||
scan $vers %d.%d.%d v1 v2 v3
|
||||
set v2 [format 3%02d%02d00 $v2 $v3]
|
||||
set name sqlite-tools-$OS-$ARCH-$v2.zip
|
||||
|
||||
if {$OS=="win32"} {
|
||||
# The win32 tar.exe supports the -a ("auto-compress") option. This causes
|
||||
# tar to create an archive type based on the extension of the output file.
|
||||
# In this case, a zip file.
|
||||
puts "tar -a -cf $name sqlite3$EXE sqldiff$EXE sqlite3_analyzer$EXE"
|
||||
puts [exec tar -a -cf $name sqlite3$EXE sqldiff$EXE sqlite3_analyzer$EXE]
|
||||
puts "$name: [file size $name] bytes"
|
||||
} else {
|
||||
puts "zip $name sqlite3$EXE sqldiff$EXE sqlite3_analyzer$EXE"
|
||||
puts [exec zip $name sqlite3$EXE sqldiff$EXE sqlite3_analyzer$EXE]
|
||||
puts [exec ls -l $name]
|
||||
}
|
||||
set toollist "sqlite3$EXE sqldiff$EXE sqlite3_analyzer$EXE sqlite3_rsync$EXE"
|
||||
puts "zip $name {*}$toollist"
|
||||
exec zip $name {*}$toollist
|
||||
puts "$name: [file size $name] bytes"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include "sqlite3.h"
|
||||
|
||||
static const char zUsage[] =
|
||||
"sqlite3-rsync ORIGIN REPLICA ?OPTIONS?\n"
|
||||
"sqlite3_rsync ORIGIN REPLICA ?OPTIONS?\n"
|
||||
"\n"
|
||||
"One of ORIGIN or REPLICA is a pathname to a database on the local\n"
|
||||
"machine and the other is of the form \"USER@HOST:PATH\" describing\n"
|
||||
@@ -30,7 +30,7 @@ static const char zUsage[] =
|
||||
"\n"
|
||||
"OPTIONS:\n"
|
||||
"\n"
|
||||
" --exe PATH Name of the sqlite3-rsync program on the remote side\n"
|
||||
" --exe PATH Name of the sqlite3_rsync program on the remote side\n"
|
||||
" --help Show this help screen\n"
|
||||
" --ssh PATH Name of the SSH program used to reach the remote side\n"
|
||||
" -v Verbose. Multiple v's for increasing output\n"
|
||||
@@ -56,6 +56,7 @@ struct SQLiteRsync {
|
||||
u8 isRemote; /* On the remote side of a connection */
|
||||
u8 isReplica; /* True if running on the replica side */
|
||||
u8 iProtocol; /* Protocol version number */
|
||||
u8 wrongEncoding; /* ATTACH failed due to wrong encoding */
|
||||
sqlite3_uint64 nOut; /* Bytes transmitted */
|
||||
sqlite3_uint64 nIn; /* Bytes received */
|
||||
unsigned int nPage; /* Total number of pages in the database */
|
||||
@@ -92,6 +93,7 @@ struct SQLiteRsync {
|
||||
****************************************************************************/
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#include <io.h>
|
||||
#include <fcntl.h>
|
||||
/*
|
||||
** Print a fatal error and quit.
|
||||
@@ -239,9 +241,9 @@ static int popen2(
|
||||
hStdinRd, hStdoutWr, hStderr,&childPid);
|
||||
*pChildPid = childPid;
|
||||
fd = _open_osfhandle(PTR_TO_INT(hStdoutRd), 0);
|
||||
*ppIn = fdopen(fd, "r");
|
||||
*ppIn = fdopen(fd, "rb");
|
||||
fd = _open_osfhandle(PTR_TO_INT(hStdinWr), 0);
|
||||
*ppOut = _fdopen(fd, "w");
|
||||
*ppOut = _fdopen(fd, "wb");
|
||||
CloseHandle(hStdinRd);
|
||||
CloseHandle(hStdoutWr);
|
||||
return 0;
|
||||
@@ -1064,7 +1066,15 @@ static sqlite3_stmt *prepareStmt(
|
||||
return pStmt;
|
||||
}
|
||||
|
||||
/* Run a single SQL statement
|
||||
/* Run a single SQL statement. Report an error if something goes
|
||||
** wrong.
|
||||
**
|
||||
** As a special case, if the statement starts with "ATTACH" (but not
|
||||
** "Attach") and if the error message is about an incorrect encoding,
|
||||
** then do not report the error, but instead set the wrongEncoding flag.
|
||||
** This is a kludgy work-around to the problem of attaching a database
|
||||
** with a non-UTF8 encoding to the empty :memory: database that is
|
||||
** opened on the replica.
|
||||
*/
|
||||
static void runSql(SQLiteRsync *p, char *zSql, ...){
|
||||
sqlite3_stmt *pStmt;
|
||||
@@ -1077,8 +1087,15 @@ static void runSql(SQLiteRsync *p, char *zSql, ...){
|
||||
int rc = sqlite3_step(pStmt);
|
||||
if( rc==SQLITE_ROW ) rc = sqlite3_step(pStmt);
|
||||
if( rc!=SQLITE_OK && rc!=SQLITE_DONE ){
|
||||
reportError(p, "SQL statement [%s] failed: %s", zSql,
|
||||
sqlite3_errmsg(p->db));
|
||||
const char *zErr = sqlite3_errmsg(p->db);
|
||||
if( strncmp(zSql,"ATTACH ", 7)==0
|
||||
&& strstr(zErr,"must use the same text encoding")!=0
|
||||
){
|
||||
p->wrongEncoding = 1;
|
||||
}else{
|
||||
reportError(p, "SQL statement [%s] failed: %s", zSql,
|
||||
sqlite3_errmsg(p->db));
|
||||
}
|
||||
}
|
||||
sqlite3_finalize(pStmt);
|
||||
}
|
||||
@@ -1197,6 +1214,7 @@ static void originSide(SQLiteRsync *p){
|
||||
int c = 0;
|
||||
unsigned int nPage = 0;
|
||||
unsigned int iPage = 0;
|
||||
unsigned int lockBytePage = 0;
|
||||
unsigned int szPg = 0;
|
||||
sqlite3_stmt *pCkHash = 0;
|
||||
char buf[200];
|
||||
@@ -1235,6 +1253,7 @@ static void originSide(SQLiteRsync *p){
|
||||
p->nPage = nPage;
|
||||
p->szPage = szPg;
|
||||
p->iProtocol = PROTOCOL_VERSION;
|
||||
lockBytePage = (1<<30)/szPg + 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1290,6 +1309,7 @@ static void originSide(SQLiteRsync *p){
|
||||
" INSERT INTO badHash SELECT n FROM c",
|
||||
iPage+1, p->nPage);
|
||||
}
|
||||
runSql(p, "DELETE FROM badHash WHERE pgno=%d", lockBytePage);
|
||||
pStmt = prepareStmt(p,
|
||||
"SELECT pgno, data"
|
||||
" FROM badHash JOIN sqlite_dbpage('main') USING(pgno)");
|
||||
@@ -1404,6 +1424,16 @@ static void replicaSide(SQLiteRsync *p){
|
||||
break;
|
||||
}
|
||||
runSql(p, "ATTACH %Q AS 'replica'", p->zReplica);
|
||||
if( p->wrongEncoding ){
|
||||
p->wrongEncoding = 0;
|
||||
runSql(p, "PRAGMA encoding=utf16le");
|
||||
runSql(p, "ATTACH %Q AS 'replica'", p->zReplica);
|
||||
if( p->wrongEncoding ){
|
||||
p->wrongEncoding = 0;
|
||||
runSql(p, "PRAGMA encoding=utf16be");
|
||||
runSql(p, "Attach %Q AS 'replica'", p->zReplica);
|
||||
}
|
||||
}
|
||||
if( p->nErr ){
|
||||
closeDb(p);
|
||||
break;
|
||||
@@ -1456,15 +1486,18 @@ static void replicaSide(SQLiteRsync *p){
|
||||
}else if( p->nErr ){
|
||||
runSql(p, "ROLLBACK");
|
||||
}else{
|
||||
int rc;
|
||||
sqlite3_bind_int64(pIns, 1, nOPage);
|
||||
sqlite3_bind_null(pIns, 2);
|
||||
rc = sqlite3_step(pIns);
|
||||
if( rc!=SQLITE_DONE ){
|
||||
reportError(p, "SQL statement [%s] failed (pgno=%u, data=NULL): %s",
|
||||
sqlite3_sql(pIns), nOPage, sqlite3_errmsg(p->db));
|
||||
if( nOPage<0xffffffff ){
|
||||
int rc;
|
||||
sqlite3_bind_int64(pIns, 1, nOPage+1);
|
||||
sqlite3_bind_null(pIns, 2);
|
||||
rc = sqlite3_step(pIns);
|
||||
if( rc!=SQLITE_DONE ){
|
||||
reportError(p,
|
||||
"SQL statement [%s] failed (pgno=%u, data=NULL): %s",
|
||||
sqlite3_sql(pIns), nOPage, sqlite3_errmsg(p->db));
|
||||
}
|
||||
sqlite3_reset(pIns);
|
||||
}
|
||||
sqlite3_reset(pIns);
|
||||
p->nPage = nOPage;
|
||||
runSql(p, "COMMIT");
|
||||
}
|
||||
@@ -1580,13 +1613,13 @@ static char *hostSeparator(const char *zIn){
|
||||
**
|
||||
** Input formats:
|
||||
**
|
||||
** (1) sqlite3-rsync FILENAME1 USER@HOST:FILENAME2
|
||||
** (1) sqlite3_rsync FILENAME1 USER@HOST:FILENAME2
|
||||
**
|
||||
** (2) sqlite3-rsync USER@HOST:FILENAME1 FILENAME2
|
||||
** (2) sqlite3_rsync USER@HOST:FILENAME1 FILENAME2
|
||||
**
|
||||
** (3) sqlite3-rsync --origin FILENAME1
|
||||
** (3) sqlite3_rsync --origin FILENAME1
|
||||
**
|
||||
** (4) sqlite3-rsync --replica FILENAME2
|
||||
** (4) sqlite3_rsync --replica FILENAME2
|
||||
**
|
||||
** The user types (1) or (2). SSH launches (3) or (4).
|
||||
**
|
||||
@@ -1610,7 +1643,7 @@ int main(int argc, char const * const *argv){
|
||||
FILE *pOut = 0;
|
||||
int childPid = 0;
|
||||
const char *zSsh = "ssh";
|
||||
const char *zExe = "sqlite3-rsync";
|
||||
const char *zExe = "sqlite3_rsync";
|
||||
char *zCmd = 0;
|
||||
sqlite3_int64 tmStart;
|
||||
sqlite3_int64 tmEnd;
|
||||
@@ -1724,6 +1757,10 @@ int main(int argc, char const * const *argv){
|
||||
ctx.pIn = stdin;
|
||||
ctx.pOut = stdout;
|
||||
ctx.isRemote = 1;
|
||||
#ifdef _WIN32
|
||||
_setmode(_fileno(ctx.pIn), _O_BINARY);
|
||||
_setmode(_fileno(ctx.pOut), _O_BINARY);
|
||||
#endif
|
||||
originSide(&ctx);
|
||||
return 0;
|
||||
}
|
||||
@@ -1731,6 +1768,10 @@ int main(int argc, char const * const *argv){
|
||||
ctx.pIn = stdin;
|
||||
ctx.pOut = stdout;
|
||||
ctx.isRemote = 1;
|
||||
#ifdef _WIN32
|
||||
_setmode(_fileno(ctx.pIn), _O_BINARY);
|
||||
_setmode(_fileno(ctx.pOut), _O_BINARY);
|
||||
#endif
|
||||
replicaSide(&ctx);
|
||||
return 0;
|
||||
}
|
||||
@@ -854,12 +854,16 @@ int main(int argc, char **argv){
|
||||
xErr = errorMsgNH;
|
||||
continue;
|
||||
}
|
||||
usage:
|
||||
fprintf(stderr, "Usage: %s DIRECTORY\n"
|
||||
" or: %s --sha1 FILE ...\n"
|
||||
" or: %s --sha3 FILE ...\n",
|
||||
argv[0], argv[0], argv[0]);
|
||||
return 1;
|
||||
}
|
||||
if( !zDir ){
|
||||
goto usage;
|
||||
}
|
||||
if( strlen(zDir)>1000 ){
|
||||
fprintf(stderr, "Directory argument too big: [%s]\n", zDir);
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user