Compare commits
209 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 | |||
| 010f9f8704 | |||
| dceffee1ba | |||
| 512ad53f3a | |||
| f9d1141a3b | |||
| e8b2c92240 | |||
| 7151010919 | |||
| 1f2faa647f | |||
| c9c1b65698 | |||
| dac22f6566 | |||
| ed94e0e677 | |||
| cacef23082 | |||
| d5838eaa42 | |||
| 54fd01c4ab | |||
| dcf757c2ea | |||
| 33669ef289 | |||
| 54e35b543d | |||
| 5ec9ed7fe9 | |||
| 6a8336987a | |||
| d4c735d491 | |||
| 51fb37db61 | |||
| fabae7a134 | |||
| 3c58039e9e | |||
| add19478c1 | |||
| 58b4a8f6e7 | |||
| 43eafb7b76 | |||
| 08f1ba0767 | |||
| c707b2eb6d | |||
| 0992764c7a | |||
| bcd6d5d393 | |||
| c94e4a7b2f | |||
| 74194f14ec | |||
| 2b041fb97a | |||
| 2c77d51dfe | |||
| d0720eee5e | |||
| 2fb055366d | |||
| b7ceffdadf | |||
| 66b3ed318b | |||
| 878db7b099 | |||
| 7119a6c16b | |||
| 95f35b64da | |||
| 62d96919f6 | |||
| 2a9254cf2c | |||
| 9e59c06fb1 | |||
| 777c35dbe8 | |||
| 853520ddbf | |||
| 38b4158aba | |||
| 8f1f9ef09f | |||
| 8cd30e3f5b | |||
| f4382b2415 | |||
| 613c2ee21f | |||
| 18e2ace468 | |||
| 697c3fb25b | |||
| 63558eae54 | |||
| 6ba175f0c8 | |||
| a55901a27c | |||
| 0be2dd9a1b | |||
| 29057f3d18 | |||
| 57b32ef924 | |||
| d2917d9f69 | |||
| 88c43ce1f6 | |||
| 3c90b86372 | |||
| 4e34558f1b | |||
| 118ac6a7ad | |||
| 7d24e6b080 | |||
| 405ae974ee | |||
| 415acd09d7 | |||
| 6ed21e8fd7 | |||
| 69cce89425 | |||
| 1d9db01065 | |||
| 253695caf3 | |||
| d69b4249ff | |||
| 5e419c1048 | |||
| 38f2c5f81c | |||
| 8a894cd804 | |||
| 7f0e0c7dbf | |||
| db467f5777 | |||
| f8305e4616 | |||
| 8513eb6ba8 | |||
| 0e8cbd5e78 | |||
| 704561f346 | |||
| ae2a4acf8d | |||
| 0218424e5a | |||
| 6e8b3d3caa | |||
| de30fb5fc2 | |||
| 8ade1d2f97 | |||
| 57a0af406e | |||
| d35a69a8da | |||
| e7840ce681 | |||
| 520d1a8486 | |||
| cc65612e35 |
+21
-42
@@ -694,14 +694,14 @@ sqlite3$(TEXE): shell.c sqlite3.c
|
||||
shell.c sqlite3.c \
|
||||
$(LIBREADLINE) $(TLIBS) -rpath "$(libdir)"
|
||||
|
||||
sqldiff$(TEXE): $(TOP)/tool/sqldiff.c sqlite3.lo sqlite3.h
|
||||
$(LTLINK) -o $@ $(TOP)/tool/sqldiff.c sqlite3.lo $(TLIBS)
|
||||
sqldiff$(TEXE): $(TOP)/tool/sqldiff.c $(TOP)/ext/misc/sqlite3_stdio.h sqlite3.lo sqlite3.h
|
||||
$(LTLINK) -I$(TOP)/ext/misc -o $@ $(TOP)/tool/sqldiff.c sqlite3.lo $(TLIBS)
|
||||
|
||||
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 .
|
||||
@@ -1187,8 +1173,6 @@ keywordhash.h: $(TOP)/tool/mkkeywordhash.c
|
||||
# Source and header files that shell.c depends on
|
||||
SHELL_DEP = \
|
||||
$(TOP)/src/shell.c.in \
|
||||
$(TOP)/ext/consio/console_io.c \
|
||||
$(TOP)/ext/consio/console_io.h \
|
||||
$(TOP)/ext/expert/sqlite3expert.c \
|
||||
$(TOP)/ext/expert/sqlite3expert.h \
|
||||
$(TOP)/ext/intck/sqlite3intck.c \
|
||||
@@ -1208,6 +1192,8 @@ SHELL_DEP = \
|
||||
$(TOP)/ext/misc/sha1.c \
|
||||
$(TOP)/ext/misc/shathree.c \
|
||||
$(TOP)/ext/misc/sqlar.c \
|
||||
$(TOP)/ext/misc/sqlite3_stdio.c \
|
||||
$(TOP)/ext/misc/sqlite3_stdio.h \
|
||||
$(TOP)/ext/misc/uint.c \
|
||||
$(TOP)/ext/misc/vfstrace.c \
|
||||
$(TOP)/ext/misc/zipfile.c \
|
||||
@@ -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.
|
||||
#
|
||||
|
||||
+70
-16
@@ -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 \
|
||||
)
|
||||
|
||||
@@ -1861,14 +1901,14 @@ $(SQLITE3EXE): shell.c $(SHELL_CORE_DEP) $(LIBRESOBJS) $(SHELL_CORE_SRC) $(SQLIT
|
||||
/link $(SQLITE3EXEPDB) $(LDFLAGS) $(LTLINKOPTS) $(SHELL_LINK_OPTS) $(LTLIBPATHS) $(LIBRESOBJS) $(LIBREADLINE) $(LTLIBS) $(TLIBS)
|
||||
|
||||
# <<mark>>
|
||||
sqldiff.exe: $(TOP)\tool\sqldiff.c $(TOP)\ext\consio\console_io.h $(TOP)\ext\consio\console_io.c $(SQLITE3C) $(SQLITE3H) $(LIBRESOBJS)
|
||||
$(LTLINK) $(NO_WARN) -I$(TOP)\ext\consio $(TOP)\tool\sqldiff.c $(TOP)\ext\consio\console_io.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS) $(LIBRESOBJS)
|
||||
sqldiff.exe: $(TOP)\tool\sqldiff.c $(TOP)\ext\misc\sqlite3_stdio.h $(TOP)\ext\misc\sqlite3_stdio.c $(SQLITE3C) $(SQLITE3H) $(LIBRESOBJS)
|
||||
$(LTLINK) $(NO_WARN) -I$(TOP)\ext\misc $(TOP)\tool\sqldiff.c $(TOP)\ext\misc\sqlite3_stdio.c $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS) $(LIBRESOBJS)
|
||||
|
||||
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)
|
||||
@@ -1907,6 +1947,10 @@ fuzzcheck.exe: $(FUZZCHECK_SRC) $(SQLITE3C) $(SQLITE3H)
|
||||
fuzzcheck-asan.exe: $(FUZZCHECK_SRC) $(SQLITE3C) $(SQLITE3H)
|
||||
$(LTLINK) $(NO_WARN) /fsanitize=address $(FUZZCHECK_OPTS) $(FUZZCHECK_SRC) $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
|
||||
|
||||
run-fuzzcheck: fuzzcheck.exe fuzzcheck-asan.exe
|
||||
fuzzcheck --spinner $(FUZZDB)
|
||||
fuzzcheck-asan --spinner $(FUZZDB)
|
||||
|
||||
ossshell.exe: $(OSSSHELL_SRC) $(SQLITE3C) $(SQLITE3H)
|
||||
$(LTLINK) $(NO_WARN) $(FUZZCHECK_OPTS) $(OSSSHELL_SRC) $(SQLITE3C) /link $(LDFLAGS) $(LTLINKOPTS)
|
||||
|
||||
@@ -2312,8 +2356,6 @@ keywordhash.h: $(TOP)\tool\mkkeywordhash.c mkkeywordhash.exe
|
||||
# Source and header files that shell.c depends on
|
||||
SHELL_DEP = \
|
||||
$(TOP)\src\shell.c.in \
|
||||
$(TOP)\ext\consio\console_io.c \
|
||||
$(TOP)\ext\consio\console_io.h \
|
||||
$(TOP)\ext\expert\sqlite3expert.c \
|
||||
$(TOP)\ext\expert\sqlite3expert.h \
|
||||
$(TOP)\ext\intck\sqlite3intck.c \
|
||||
@@ -2333,6 +2375,8 @@ SHELL_DEP = \
|
||||
$(TOP)\ext\misc\sha1.c \
|
||||
$(TOP)\ext\misc\shathree.c \
|
||||
$(TOP)\ext\misc\sqlar.c \
|
||||
$(TOP)\ext\misc\sqlite3_stdio.c \
|
||||
$(TOP)\ext\misc\sqlite3_stdio.h \
|
||||
$(TOP)\ext\misc\uint.c \
|
||||
$(TOP)\ext\misc\vfstrace.c \
|
||||
$(TOP)\ext\misc\zipfile.c \
|
||||
@@ -2533,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
|
||||
@@ -2620,7 +2664,7 @@ smoketest: $(TESTPROGS)
|
||||
shelltest: $(TESTPROGS)
|
||||
.\testfixture.exe $(TOP)\test\permutations.test shell
|
||||
|
||||
sqlite3_analyzer.c: $(SQLITE3C) $(SQLITE3H) $(TOP)\src\tclsqlite.c $(TOP)\tool\spaceanal.tcl $(TOP)\tool\mkccode.tcl $(TOP)\tool\sqlite3_analyzer.c.in $(TOP)\ext\consio\console_io.h $(TOP)\ext\consio\console_io.c $(SQLITE_TCL_DEP)
|
||||
sqlite3_analyzer.c: $(SQLITE3C) $(SQLITE3H) $(TOP)\src\tclsqlite.c $(TOP)\tool\spaceanal.tcl $(TOP)\tool\mkccode.tcl $(TOP)\tool\sqlite3_analyzer.c.in $(TOP)\ext\misc\sqlite3_stdio.h $(TOP)\ext\misc\sqlite3_stdio.c $(SQLITE_TCL_DEP)
|
||||
$(TCLSH_CMD) $(TOP)\tool\mkccode.tcl $(TOP)\tool\sqlite3_analyzer.c.in > $@
|
||||
|
||||
sqlite3_analyzer.exe: sqlite3_analyzer.c $(LIBRESOBJS)
|
||||
@@ -2742,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
|
||||
|
||||
@@ -2775,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} {
|
||||
@@ -428,6 +441,8 @@ do_execsql_test 5.0 {
|
||||
|
||||
WITH s(i) AS ( VALUES(1) UNION ALL SELECT i+1 FROM s WHERE i<100)
|
||||
INSERT INTO t2 SELECT (i-1)/20, (i-1)/5 FROM s;
|
||||
|
||||
CREATE INDEX i1 ON t1( lower(a) );
|
||||
}
|
||||
do_candidates_test 5.1 {
|
||||
SELECT * FROM t1,t2 WHERE (b=? OR a=?) AND (c=? OR d=?)
|
||||
@@ -457,6 +472,7 @@ do_execsql_test 5.3 {
|
||||
ANALYZE;
|
||||
SELECT * FROM sqlite_stat1 ORDER BY 1, 2;
|
||||
} {
|
||||
t1 i1 {100 50}
|
||||
t1 t1_idx_00000061 {100 50}
|
||||
t1 t1_idx_00000062 {100 20}
|
||||
t1 t1_idx_000123a7 {100 50 17}
|
||||
@@ -491,4 +507,103 @@ USE TEMP B-TREE FOR ORDER BY
|
||||
}}
|
||||
}
|
||||
|
||||
do_execsql_test 6.0 {
|
||||
CREATE TABLE x1(a, b, c, d);
|
||||
CREATE INDEX x1ab ON x1(a, lower(b));
|
||||
CREATE INDEX x1dcba ON x1(d, b+c, a);
|
||||
}
|
||||
|
||||
do_candidates_test 6.1 {
|
||||
SELECT * FROM x1 WHERE b=? ORDER BY a;
|
||||
} {
|
||||
CREATE INDEX x1_idx_0001267f ON x1(b, a);
|
||||
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
|
||||
|
||||
+91
-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;
|
||||
@@ -1623,6 +1692,12 @@ static int idxPopulateOneStat1(
|
||||
const char *zComma = zCols==0 ? "" : ", ";
|
||||
const char *zName = (const char*)sqlite3_column_text(pIndexXInfo, 0);
|
||||
const char *zColl = (const char*)sqlite3_column_text(pIndexXInfo, 1);
|
||||
if( zName==0 ){
|
||||
/* This index contains an expression. Ignore it. */
|
||||
sqlite3_free(zCols);
|
||||
sqlite3_free(zOrder);
|
||||
return sqlite3_reset(pIndexXInfo);
|
||||
}
|
||||
zCols = idxAppendText(&rc, zCols,
|
||||
"%sx.%Q IS sqlite_expert_rem(%d, x.%Q) COLLATE %s",
|
||||
zComma, zName, nCol, zName, zColl
|
||||
@@ -1951,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";
|
||||
}
|
||||
|
||||
@@ -4889,6 +4889,11 @@ static int fts5IndexFindDeleteMerge(Fts5Index *p, Fts5Structure *pStruct){
|
||||
nBest = nPercent;
|
||||
}
|
||||
}
|
||||
|
||||
/* If pLvl is already the input level to an ongoing merge, look no
|
||||
** further for a merge candidate. The caller should be allowed to
|
||||
** continue merging from pLvl first. */
|
||||
if( pLvl->nMerge ) break;
|
||||
}
|
||||
}
|
||||
return iRet;
|
||||
@@ -8813,7 +8818,7 @@ static int fts5structConnectMethod(
|
||||
|
||||
/*
|
||||
** We must have a single struct=? constraint that will be passed through
|
||||
** into the xFilter method. If there is no valid stmt=? constraint,
|
||||
** into the xFilter method. If there is no valid struct=? constraint,
|
||||
** then return an SQLITE_CONSTRAINT error.
|
||||
*/
|
||||
static int fts5structBestIndexMethod(
|
||||
|
||||
+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 \
|
||||
|
||||
@@ -35,8 +35,8 @@ do_execsql_test 1.01 {
|
||||
}
|
||||
|
||||
# explain_i "UPDATE t1 SET a='a' WHERE t1.rowid=1"
|
||||
breakpoint
|
||||
explain_i "UPDATE t1 SET a='a' FROM t2 WHERE t1.rowid=1 AND b IS NULL"
|
||||
#breakpoint
|
||||
#explain_i "UPDATE t1 SET a='a' FROM t2 WHERE t1.rowid=1 AND b IS NULL"
|
||||
|
||||
#breakpoint
|
||||
#explain_i "UPDATE t1 SET a='a' WHERE b IS NULL AND rowid=?"
|
||||
@@ -56,4 +56,56 @@ foreach {tn up err} {
|
||||
do_catchsql_test 1.$tn $up $res($err)
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
reset_db
|
||||
|
||||
proc random {n} { expr {abs(int(rand()*$n))} }
|
||||
proc select_one {list} {
|
||||
set n [llength $list]
|
||||
lindex $list [random $n]
|
||||
}
|
||||
proc vocab {} {
|
||||
list abc def ghi jkl mno pqr stu vwx yza
|
||||
}
|
||||
proc term {} {
|
||||
select_one [vocab]
|
||||
}
|
||||
proc document {} {
|
||||
set nTerm [expr [random 3] + 7]
|
||||
set doc ""
|
||||
for {set ii 0} {$ii < $nTerm} {incr ii} {
|
||||
lappend doc [term]
|
||||
}
|
||||
set doc
|
||||
}
|
||||
db func document document
|
||||
|
||||
do_execsql_test 2.0 {
|
||||
CREATE VIRTUAL TABLE ft USING fts5(a, contentless_delete=1, content='');
|
||||
INSERT INTO ft(ft, rank) VALUES('pgsz', 64);
|
||||
}
|
||||
|
||||
do_test 2.1 {
|
||||
for {set ii 1} {$ii < 12} {incr ii} {
|
||||
db transaction {
|
||||
for {set jj 0} {$jj < 10} {incr jj} {
|
||||
set doc [document]
|
||||
execsql { INSERT INTO ft VALUES($doc); }
|
||||
}
|
||||
}
|
||||
}
|
||||
} {}
|
||||
|
||||
do_test 2.2 {
|
||||
foreach r [db eval {SELECT rowid FROM ft}] {
|
||||
execsql { DELETE FROM ft WHERE rowid=$r }
|
||||
}
|
||||
} {}
|
||||
|
||||
set doc [document]
|
||||
do_execsql_test 2.3 {
|
||||
INSERT INTO ft VALUES($doc)
|
||||
}
|
||||
|
||||
|
||||
finish_test
|
||||
|
||||
@@ -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) */
|
||||
}
|
||||
|
||||
|
||||
+10
-3
@@ -40,7 +40,7 @@
|
||||
** modification-time of the target file is set to this value before
|
||||
** returning.
|
||||
**
|
||||
** If three or more arguments are passed to this function and an
|
||||
** If five or more arguments are passed to this function and an
|
||||
** error is encountered, an exception is raised.
|
||||
**
|
||||
** READFILE(FILE):
|
||||
@@ -110,6 +110,13 @@ SQLITE_EXTENSION_INIT1
|
||||
#include <time.h>
|
||||
#include <errno.h>
|
||||
|
||||
/* When used as part of the CLI, the sqlite3_stdio.h module will have
|
||||
** been included before this one. In that case use the sqlite3_stdio.h
|
||||
** #defines. If not, create our own for fopen().
|
||||
*/
|
||||
#ifndef _SQLITE3_STDIO_H_
|
||||
# define sqlite3_fopen fopen
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Structure of the fsdir() table-valued function
|
||||
@@ -142,7 +149,7 @@ static void readFileContents(sqlite3_context *ctx, const char *zName){
|
||||
sqlite3 *db;
|
||||
int mxBlob;
|
||||
|
||||
in = fopen(zName, "rb");
|
||||
in = sqlite3_fopen(zName, "rb");
|
||||
if( in==0 ){
|
||||
/* File does not exist or is unreadable. Leave the result set to NULL. */
|
||||
return;
|
||||
@@ -397,7 +404,7 @@ static int writeFile(
|
||||
sqlite3_int64 nWrite = 0;
|
||||
const char *z;
|
||||
int rc = 0;
|
||||
FILE *out = fopen(zFile, "wb");
|
||||
FILE *out = sqlite3_fopen(zFile, "wb");
|
||||
if( out==0 ) return 1;
|
||||
z = (const char*)sqlite3_value_blob(pData);
|
||||
if( z ){
|
||||
|
||||
@@ -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;
|
||||
|
||||
+4
-4
@@ -351,7 +351,7 @@ static int substituteCost(char cPrev, char cFrom, char cTo){
|
||||
** Negative values indicate an error:
|
||||
** -1 One of the inputs is NULL
|
||||
** -2 Non-ASCII characters on input
|
||||
** -3 Unable to allocate memory
|
||||
** -3 Unable to allocate memory
|
||||
**
|
||||
** If pnMatch is not NULL, then *pnMatch is set to the number of bytes
|
||||
** of zB that matched the pattern in zA. If zA does not end with a '*',
|
||||
@@ -360,8 +360,8 @@ static int substituteCost(char cPrev, char cFrom, char cTo){
|
||||
** of zB that was deemed to match zA.
|
||||
*/
|
||||
static int editdist1(const char *zA, const char *zB, int *pnMatch){
|
||||
int nA, nB; /* Number of characters in zA[] and zB[] */
|
||||
int xA, xB; /* Loop counters for zA[] and zB[] */
|
||||
unsigned int nA, nB; /* Number of characters in zA[] and zB[] */
|
||||
unsigned int xA, xB; /* Loop counters for zA[] and zB[] */
|
||||
char cA = 0, cB; /* Current character of zA and zB */
|
||||
char cAprev, cBprev; /* Previous character of zA and zB */
|
||||
char cAnext, cBnext; /* Next character in zA and zB */
|
||||
@@ -3021,7 +3021,7 @@ static sqlite3_module spellfix1Module = {
|
||||
*/
|
||||
static int spellfix1Register(sqlite3 *db){
|
||||
int rc = SQLITE_OK;
|
||||
int i;
|
||||
unsigned int i;
|
||||
rc = sqlite3_create_function(db, "spellfix1_translit", 1,
|
||||
SQLITE_UTF8|SQLITE_DETERMINISTIC, 0,
|
||||
transliterateSqlFunc, 0, 0);
|
||||
|
||||
@@ -0,0 +1,275 @@
|
||||
/*
|
||||
** 2024-09-24
|
||||
**
|
||||
** 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.
|
||||
**
|
||||
*************************************************************************
|
||||
**
|
||||
** Implementation of standard I/O interfaces for UTF-8 that are missing
|
||||
** on Windows.
|
||||
*/
|
||||
#ifdef _WIN32 /* This file is a no-op on all platforms except Windows */
|
||||
#ifndef _SQLITE3_STDIO_H_
|
||||
#include "sqlite3_stdio.h"
|
||||
#endif
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#include <assert.h>
|
||||
#include "sqlite3.h"
|
||||
#include <ctype.h>
|
||||
#include <stdarg.h>
|
||||
#include <io.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
/*
|
||||
** 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.)
|
||||
**
|
||||
** 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 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
|
||||
# define UseWtextForInput(fd) 1
|
||||
# define IsConsole(fd) _isatty(_fileno(fd))
|
||||
#elif defined(SQLITE_U8TEXT_STDIO)
|
||||
# define UseWtextForOutput(fd) ((fd)==stdout || (fd)==stderr)
|
||||
# define UseWtextForInput(fd) ((fd)==stdin)
|
||||
# define IsConsole(fd) _isatty(_fileno(fd))
|
||||
#else
|
||||
# define UseWtextForOutput(fd) _isatty(_fileno(fd))
|
||||
# define UseWtextForInput(fd) _isatty(_fileno(fd))
|
||||
# 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.
|
||||
*/
|
||||
FILE *sqlite3_fopen(const char *zFilename, const char *zMode){
|
||||
FILE *fp = 0;
|
||||
wchar_t *b1, *b2;
|
||||
int sz1, sz2;
|
||||
|
||||
sz1 = (int)strlen(zFilename);
|
||||
sz2 = (int)strlen(zMode);
|
||||
b1 = malloc( (sz1+1)*sizeof(b1[0]) );
|
||||
b2 = malloc( (sz2+1)*sizeof(b1[0]) );
|
||||
if( b1 && b2 ){
|
||||
sz1 = MultiByteToWideChar(CP_UTF8, 0, zFilename, sz1, b1, sz1);
|
||||
b1[sz1] = 0;
|
||||
sz2 = MultiByteToWideChar(CP_UTF8, 0, zMode, sz2, b2, sz2);
|
||||
b2[sz2] = 0;
|
||||
fp = _wfopen(b1, b2);
|
||||
}
|
||||
free(b1);
|
||||
free(b2);
|
||||
simBinaryOther = 0;
|
||||
return fp;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Work-alike for the popen() routine from the standard C library.
|
||||
*/
|
||||
FILE *sqlite3_popen(const char *zCommand, const char *zMode){
|
||||
FILE *fp = 0;
|
||||
wchar_t *b1, *b2;
|
||||
int sz1, sz2;
|
||||
|
||||
sz1 = (int)strlen(zCommand);
|
||||
sz2 = (int)strlen(zMode);
|
||||
b1 = malloc( (sz1+1)*sizeof(b1[0]) );
|
||||
b2 = malloc( (sz2+1)*sizeof(b1[0]) );
|
||||
if( b1 && b2 ){
|
||||
sz1 = MultiByteToWideChar(CP_UTF8, 0, zCommand, sz1, b1, sz1);
|
||||
b1[sz1] = 0;
|
||||
sz2 = MultiByteToWideChar(CP_UTF8, 0, zMode, sz2, b2, sz2);
|
||||
b2[sz2] = 0;
|
||||
fp = _wpopen(b1, b2);
|
||||
}
|
||||
free(b1);
|
||||
free(b2);
|
||||
return fp;
|
||||
}
|
||||
|
||||
/*
|
||||
** Work-alike for fgets() from the standard C library.
|
||||
*/
|
||||
char *sqlite3_fgets(char *buf, int sz, FILE *in){
|
||||
if( UseWtextForInput(in) ){
|
||||
/* When reading from the command-prompt in Windows, it is necessary
|
||||
** to use _O_WTEXT input mode to read UTF-16 characters, then translate
|
||||
** that into UTF-8. Otherwise, non-ASCII characters all get translated
|
||||
** into '?'.
|
||||
*/
|
||||
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 ){
|
||||
sqlite3_free(b1);
|
||||
return 0;
|
||||
}
|
||||
WideCharToMultiByte(CP_UTF8, 0, b1, -1, buf, sz, 0, 0);
|
||||
sqlite3_free(b1);
|
||||
return buf;
|
||||
}else{
|
||||
/* Reading from a file or other input source, just read bytes without
|
||||
** any translation. */
|
||||
return fgets(buf, sz, 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) ){
|
||||
/* 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_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 = 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);
|
||||
if( UseBinaryWText(out) ){
|
||||
piecemealOutput(b1, sz, out);
|
||||
}else{
|
||||
fputws(b1, out);
|
||||
}
|
||||
sqlite3_free(b1);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Work-alike for fprintf() from the standard C library.
|
||||
*/
|
||||
int sqlite3_fprintf(FILE *out, const char *zFormat, ...){
|
||||
int rc;
|
||||
if( UseWtextForOutput(out) ){
|
||||
/* When writing to the command-prompt in Windows, it is necessary
|
||||
** to use _O_WTEXT input mode and write UTF-16 characters.
|
||||
*/
|
||||
char *z;
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, zFormat);
|
||||
z = sqlite3_vmprintf(zFormat, ap);
|
||||
va_end(ap);
|
||||
sqlite3_fputs(z, out);
|
||||
rc = (int)strlen(z);
|
||||
sqlite3_free(z);
|
||||
}else{
|
||||
/* Writing to a file or other destination, just write bytes without
|
||||
** any translation. */
|
||||
va_list ap;
|
||||
va_start(ap, zFormat);
|
||||
rc = vfprintf(out, zFormat, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
** Set the mode for an output stream. mode argument is typically _O_BINARY or
|
||||
** _O_TEXT.
|
||||
*/
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* defined(_WIN32) */
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
** 2024-09-24
|
||||
**
|
||||
** 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 header file contains definitions of interfaces that provide
|
||||
** cross-platform I/O for UTF-8 content.
|
||||
**
|
||||
** On most platforms, the interfaces definitions in this file are
|
||||
** just #defines. For example sqlite3_fopen() is a macro that resolves
|
||||
** to the standard fopen() in the C-library.
|
||||
**
|
||||
** But Windows does not have a standard C-library, at least not one that
|
||||
** can handle UTF-8. So for windows build, the interfaces resolve to new
|
||||
** C-language routines contained in the separate sqlite3_stdio.c source file.
|
||||
**
|
||||
** So on all non-Windows platforms, simply #include this header file and
|
||||
** use the interfaces defined herein. Then to run your application on Windows,
|
||||
** also link in the accompanying sqlite3_stdio.c source file when compiling
|
||||
** to get compatible interfaces.
|
||||
*/
|
||||
#ifndef _SQLITE3_STDIO_H_
|
||||
#define _SQLITE3_STDIO_H_ 1
|
||||
#ifdef _WIN32
|
||||
/**** Definitions For Windows ****/
|
||||
#include <stdio.h>
|
||||
#include <windows.h>
|
||||
|
||||
FILE *sqlite3_fopen(const char *zFilename, const char *zMode);
|
||||
FILE *sqlite3_popen(const char *zCommand, const char *type);
|
||||
char *sqlite3_fgets(char *s, int size, FILE *stream);
|
||||
int sqlite3_fputs(const char *s, FILE *stream);
|
||||
int sqlite3_fprintf(FILE *stream, const char *format, ...);
|
||||
void sqlite3_fsetmode(FILE *stream, int mode);
|
||||
|
||||
|
||||
#else
|
||||
/**** Definitions For All Other Platforms ****/
|
||||
#include <stdio.h>
|
||||
#define sqlite3_fopen fopen
|
||||
#define sqlite3_popen popen
|
||||
#define sqlite3_fgets fgets
|
||||
#define sqlite3_fputs fputs
|
||||
#define sqlite3_fprintf fprintf
|
||||
#define sqlite3_fsetmode(F,X) /*no-op*/
|
||||
|
||||
#endif
|
||||
#endif /* _SQLITE3_STDIO_H_ */
|
||||
+1
-1
@@ -416,7 +416,7 @@ static const char *lockName(int eLock){
|
||||
const char *azLockNames[] = {
|
||||
"NONE", "SHARED", "RESERVED", "PENDING", "EXCLUSIVE"
|
||||
};
|
||||
if( eLock<0 || eLock>=sizeof(azLockNames)/sizeof(azLockNames[0]) ){
|
||||
if( eLock<0 || eLock>=(int)(sizeof(azLockNames)/sizeof(azLockNames[0])) ){
|
||||
return "???";
|
||||
}else{
|
||||
return azLockNames[eLock];
|
||||
|
||||
+10
-2
@@ -35,6 +35,14 @@ SQLITE_EXTENSION_INIT1
|
||||
|
||||
#include <zlib.h>
|
||||
|
||||
/* When used as part of the CLI, the sqlite3_stdio.h module will have
|
||||
** been included before this one. In that case use the sqlite3_stdio.h
|
||||
** #defines. If not, create our own for fopen().
|
||||
*/
|
||||
#ifndef _SQLITE3_STDIO_H_
|
||||
# define sqlite3_fopen fopen
|
||||
#endif
|
||||
|
||||
#ifndef SQLITE_OMIT_VIRTUALTABLE
|
||||
|
||||
#ifndef SQLITE_AMALGAMATION
|
||||
@@ -1291,7 +1299,7 @@ static int zipfileFilter(
|
||||
}
|
||||
|
||||
if( 0==pTab->pWriteFd && 0==bInMemory ){
|
||||
pCsr->pFile = zFile ? fopen(zFile, "rb") : 0;
|
||||
pCsr->pFile = zFile ? sqlite3_fopen(zFile, "rb") : 0;
|
||||
if( pCsr->pFile==0 ){
|
||||
zipfileCursorErr(pCsr, "cannot open file: %s", zFile);
|
||||
rc = SQLITE_ERROR;
|
||||
@@ -1481,7 +1489,7 @@ static int zipfileBegin(sqlite3_vtab *pVtab){
|
||||
** structure into memory. During the transaction any new file data is
|
||||
** appended to the archive file, but the central directory is accumulated
|
||||
** in main-memory until the transaction is committed. */
|
||||
pTab->pWriteFd = fopen(pTab->zFile, "ab+");
|
||||
pTab->pWriteFd = sqlite3_fopen(pTab->zFile, "ab+");
|
||||
if( pTab->pWriteFd==0 ){
|
||||
pTab->base.zErrMsg = sqlite3_mprintf(
|
||||
"zipfile: failed to open file %s for writing", pTab->zFile
|
||||
|
||||
@@ -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{
|
||||
|
||||
@@ -202,6 +202,7 @@ foreach {tn sql1 at sql2} {
|
||||
|
||||
sqlite3changegroup grp
|
||||
grp schema db main
|
||||
breakpoint
|
||||
grp add $C1
|
||||
grp add $C2
|
||||
set T1 [grp output]
|
||||
|
||||
@@ -82,6 +82,7 @@ do_execsql_test 1.5 {
|
||||
UPDATE p1 SET c=12345 WHERE a = 45;
|
||||
}
|
||||
|
||||
breakpoint
|
||||
sqlite3changeset_apply_v2 -noaction db $C conflict
|
||||
do_execsql_test 1.6 {
|
||||
SELECT * FROM c1
|
||||
|
||||
@@ -48,7 +48,8 @@ struct sqlite3_session {
|
||||
int bEnable; /* True if currently recording */
|
||||
int bIndirect; /* True if all changes are indirect */
|
||||
int bAutoAttach; /* True to auto-attach tables */
|
||||
int bImplicitPK; /* True to handle tables with implicit PK */ int rc; /* Non-zero if an error has occurred */
|
||||
int bImplicitPK; /* True to handle tables with implicit PK */
|
||||
int rc; /* Non-zero if an error has occurred */
|
||||
void *pFilterCtx; /* First argument to pass to xTableFilter */
|
||||
int (*xTableFilter)(void *pCtx, const char *zTab);
|
||||
i64 nMalloc; /* Number of bytes of data allocated */
|
||||
@@ -73,6 +74,10 @@ struct SessionBuffer {
|
||||
** input data. Input data may be supplied either as a single large buffer
|
||||
** (e.g. sqlite3changeset_start()) or using a stream function (e.g.
|
||||
** sqlite3changeset_start_strm()).
|
||||
**
|
||||
** bNoDiscard:
|
||||
** If true, then the only time data is discarded is as a result of explicit
|
||||
** sessionDiscardData() calls. Not within every sessionInputBuffer() call.
|
||||
*/
|
||||
struct SessionInput {
|
||||
int bNoDiscard; /* If true, do not discard in InputBuffer() */
|
||||
@@ -5126,15 +5131,21 @@ static int sessionChangesetApply(
|
||||
int nTab = 0; /* Result of sqlite3Strlen30(zTab) */
|
||||
SessionApplyCtx sApply; /* changeset_apply() context object */
|
||||
int bPatchset;
|
||||
u64 savedFlag = db->flags & SQLITE_FkNoAction;
|
||||
|
||||
assert( xConflict!=0 );
|
||||
|
||||
sqlite3_mutex_enter(sqlite3_db_mutex(db));
|
||||
if( flags & SQLITE_CHANGESETAPPLY_FKNOACTION ){
|
||||
db->flags |= ((u64)SQLITE_FkNoAction);
|
||||
db->aDb[0].pSchema->schema_cookie -= 32;
|
||||
}
|
||||
|
||||
pIter->in.bNoDiscard = 1;
|
||||
memset(&sApply, 0, sizeof(sApply));
|
||||
sApply.bRebase = (ppRebase && pnRebase);
|
||||
sApply.bInvertConstraints = !!(flags & SQLITE_CHANGESETAPPLY_INVERT);
|
||||
sApply.bIgnoreNoop = !!(flags & SQLITE_CHANGESETAPPLY_IGNORENOOP);
|
||||
sqlite3_mutex_enter(sqlite3_db_mutex(db));
|
||||
if( (flags & SQLITE_CHANGESETAPPLY_NOSAVEPOINT)==0 ){
|
||||
rc = sqlite3_exec(db, "SAVEPOINT changeset_apply", 0, 0, 0);
|
||||
}
|
||||
@@ -5296,6 +5307,12 @@ static int sessionChangesetApply(
|
||||
sqlite3_free((char*)sApply.azCol); /* cast works around VC++ bug */
|
||||
sqlite3_free((char*)sApply.constraints.aBuf);
|
||||
sqlite3_free((char*)sApply.rebase.aBuf);
|
||||
|
||||
if( (flags & SQLITE_CHANGESETAPPLY_FKNOACTION) && savedFlag==0 ){
|
||||
assert( db->flags & SQLITE_FkNoAction );
|
||||
db->flags &= ~((u64)SQLITE_FkNoAction);
|
||||
db->aDb[0].pSchema->schema_cookie -= 32;
|
||||
}
|
||||
sqlite3_mutex_leave(sqlite3_db_mutex(db));
|
||||
return rc;
|
||||
}
|
||||
@@ -5324,12 +5341,6 @@ int sqlite3changeset_apply_v2(
|
||||
sqlite3_changeset_iter *pIter; /* Iterator to skip through changeset */
|
||||
int bInv = !!(flags & SQLITE_CHANGESETAPPLY_INVERT);
|
||||
int rc = sessionChangesetStart(&pIter, 0, 0, nChangeset, pChangeset, bInv, 1);
|
||||
u64 savedFlag = db->flags & SQLITE_FkNoAction;
|
||||
|
||||
if( flags & SQLITE_CHANGESETAPPLY_FKNOACTION ){
|
||||
db->flags |= ((u64)SQLITE_FkNoAction);
|
||||
db->aDb[0].pSchema->schema_cookie -= 32;
|
||||
}
|
||||
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = sessionChangesetApply(
|
||||
@@ -5337,11 +5348,6 @@ int sqlite3changeset_apply_v2(
|
||||
);
|
||||
}
|
||||
|
||||
if( (flags & SQLITE_CHANGESETAPPLY_FKNOACTION) && savedFlag==0 ){
|
||||
assert( db->flags & SQLITE_FkNoAction );
|
||||
db->flags &= ~((u64)SQLITE_FkNoAction);
|
||||
db->aDb[0].pSchema->schema_cookie -= 32;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -5662,6 +5668,9 @@ static int sessionChangesetExtendRecord(
|
||||
sessionAppendBlob(pOut, aRec, nRec, &rc);
|
||||
if( rc==SQLITE_OK && pTab->pDfltStmt==0 ){
|
||||
rc = sessionPrepareDfltStmt(pGrp->db, pTab, &pTab->pDfltStmt);
|
||||
if( rc==SQLITE_OK && SQLITE_ROW!=sqlite3_step(pTab->pDfltStmt) ){
|
||||
rc = sqlite3_errcode(pGrp->db);
|
||||
}
|
||||
}
|
||||
for(ii=nCol; rc==SQLITE_OK && ii<pTab->nCol; ii++){
|
||||
int eType = sqlite3_column_type(pTab->pDfltStmt, ii);
|
||||
@@ -5678,6 +5687,7 @@ static int sessionChangesetExtendRecord(
|
||||
}
|
||||
if( SQLITE_OK==sessionBufferGrow(pOut, 8, &rc) ){
|
||||
sessionPutI64(&pOut->aBuf[pOut->nBuf], iVal);
|
||||
pOut->nBuf += 8;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -5817,6 +5827,8 @@ static int sessionOneChangeToHash(
|
||||
u8 *aRec = &pIter->in.aData[pIter->in.iCurrent + 2];
|
||||
int nRec = (pIter->in.iNext - pIter->in.iCurrent) - 2;
|
||||
|
||||
assert( nRec>0 );
|
||||
|
||||
/* Ensure that only changesets, or only patchsets, but not a mixture
|
||||
** of both, are being combined. It is an error to try to combine a
|
||||
** changeset and a patchset. */
|
||||
@@ -5894,6 +5906,7 @@ static int sessionChangesetToHash(
|
||||
int nRec;
|
||||
int rc = SQLITE_OK;
|
||||
|
||||
pIter->in.bNoDiscard = 1;
|
||||
while( SQLITE_ROW==(sessionChangesetNext(pIter, &aRec, &nRec, 0)) ){
|
||||
rc = sessionOneChangeToHash(pGrp, pIter, bRebase);
|
||||
if( rc!=SQLITE_OK ) break;
|
||||
|
||||
+272
-312
@@ -15,8 +15,9 @@
|
||||
# by the target name. Rebuild is necessary for all components to get
|
||||
# the desired optimization level.
|
||||
#
|
||||
# quick, q = do just a minimal build (sqlite3.js/wasm, tester1) for
|
||||
# faster development-mode turnaround.
|
||||
# quick, q = do just build the essentials for testing
|
||||
# (sqlite3.js/wasm, tester1) for faster development-mode
|
||||
# turnaround.
|
||||
#
|
||||
# dist = create end user deliverables. Add dist.build=oX to build
|
||||
# with a specific optimization level, where oX is one of the
|
||||
@@ -35,25 +36,21 @@
|
||||
# - wasm-strip for release builds: https://github.com/WebAssembly/wabt
|
||||
# - InfoZip for 'dist' zip file
|
||||
########################################################################
|
||||
#
|
||||
# Significant TODOs for this build include, but are not necessarily
|
||||
# limited to:
|
||||
#
|
||||
# 1) Consolidate the code generation for sqlite3*.*js into a script
|
||||
# which generates the makefile code, rather than using $(call) and
|
||||
# $(eval), or at least centralize the setup of the numerous vars
|
||||
# related to each build variant $(JS_BUILD_MODES). (Update: an
|
||||
# external script was attempted but generating properly-escaped
|
||||
# makefile code from within a shell script is even less legible
|
||||
# than the $(eval) indirection going on in this file.)
|
||||
#
|
||||
default: all
|
||||
#default: quick
|
||||
SHELL := $(shell which bash 2>/dev/null)
|
||||
SHELL := $(firstword $(wildcard /usr/local/bin/bash /usr/bin/bash /bin/bash))
|
||||
ifeq (,$(SHELL))
|
||||
$(error Cannot find the bash shell)
|
||||
endif
|
||||
MAKEFILE := $(lastword $(MAKEFILE_LIST))
|
||||
CLEAN_FILES :=
|
||||
DISTCLEAN_FILES := ./--dummy--
|
||||
release: oz
|
||||
DISTCLEAN_FILES :=
|
||||
MAKING_CLEAN := $(if $(filter %clean,$(MAKECMDGOALS)),1,0)
|
||||
.PHONY: clean distclean
|
||||
clean:
|
||||
-rm -f $(CLEAN_FILES)
|
||||
distclean: clean
|
||||
-rm -f $(DISTCLEAN_FILES)
|
||||
|
||||
########################################################################
|
||||
# JS_BUILD_NAMES exists for documentation purposes only. It enumerates
|
||||
@@ -86,46 +83,6 @@ JS_BUILD_NAMES := sqlite3 sqlite3-wasmfs
|
||||
#
|
||||
JS_BUILD_MODES := vanilla esm bunder-friendly node
|
||||
|
||||
########################################################################
|
||||
# Emscripten SDK home dir and related binaries...
|
||||
EMSDK_HOME ?= $(word 1,$(wildcard $(HOME)/emsdk $(HOME)/src/emsdk))
|
||||
emcc.bin ?= $(word 1,$(wildcard $(EMSDK_HOME)/upstream/emscripten/emcc) $(shell which emcc))
|
||||
ifeq (,$(emcc.bin))
|
||||
$(error Cannot find emcc.)
|
||||
endif
|
||||
emcc.version := $(shell "$(emcc.bin)" --version | sed -n 1p \
|
||||
| sed -e 's/^.* \([3-9][^ ]*\) .*$$/\1/;')
|
||||
ifeq (,$(emcc.version))
|
||||
$(warning Cannot determine emcc version. This might unduly impact build flags.)
|
||||
else
|
||||
$(info using emcc version [$(emcc.version)])
|
||||
endif
|
||||
|
||||
wasm-strip ?= $(shell which wasm-strip 2>/dev/null)
|
||||
ifeq (,$(filter clean,$(MAKECMDGOALS)))
|
||||
ifeq (,$(wasm-strip))
|
||||
$(info WARNING: *******************************************************************)
|
||||
$(info WARNING: builds using -O2/-O3/-Os/-Oz will minify WASM-exported names,)
|
||||
$(info WARNING: breaking _All The Things_. The workaround for that is to build)
|
||||
$(info WARNING: with -g3 (which explodes the file size) and then strip the debug)
|
||||
$(info WARNING: info after compilation, using wasm-strip, to shrink the wasm file.)
|
||||
$(info WARNING: wasm-strip was not found in the PATH so we cannot strip those.)
|
||||
$(info WARNING: If this build uses any optimization level higher than -O1 then)
|
||||
$(info WARNING: the ***resulting JS code WILL NOT BE USABLE***.)
|
||||
$(info WARNING: wasm-strip is part of the wabt package:)
|
||||
$(info WARNING: https://github.com/WebAssembly/wabt)
|
||||
$(info WARNING: on Ubuntu-like systems it can be installed with:)
|
||||
$(info WARNING: sudo apt install wabt)
|
||||
$(info WARNING: *******************************************************************)
|
||||
endif
|
||||
endif # 'make clean' check
|
||||
|
||||
ifeq (,$(wasm-strip))
|
||||
maybe-wasm-strip = echo "not wasm-stripping"
|
||||
else
|
||||
maybe-wasm-strip = $(wasm-strip)
|
||||
endif
|
||||
|
||||
########################################################################
|
||||
# dir.top = the top dir of the canonical build tree, where
|
||||
# sqlite3.[ch] live.
|
||||
@@ -141,41 +98,19 @@ dir.common := common
|
||||
dir.fiddle := fiddle
|
||||
dir.fiddle-debug := fiddle-debug
|
||||
dir.tool := $(dir.top)/tool
|
||||
CLEAN_FILES += *~ $(dir.jacc)/*~ $(dir.api)/*~ $(dir.common)/*~ $(dir.fiddle)/*~ \
|
||||
$(dir.fiddle-debug)/*
|
||||
|
||||
########################################################################
|
||||
# dir.dout = output dir for deliverables.
|
||||
#
|
||||
# MAINTENANCE REMINDER: the output .js and .wasm files of certain emcc
|
||||
# buildables must be in _this_ dir, rather than a subdir, or else
|
||||
# parts of the generated code get confused and cannot load
|
||||
# property. Specifically, when X.js loads X.wasm, whether or not X.js
|
||||
# uses the correct path for X.wasm depends on how it's loaded: an HTML
|
||||
# script tag will resolve it intuitively, whereas a Worker's call to
|
||||
# importScripts() will not. That's a fundamental incompatibility with
|
||||
# how URL resolution in JS happens between those two contexts. See:
|
||||
#
|
||||
# https://zzz.buzz/2017/03/14/relative-uris-in-web-development/
|
||||
#
|
||||
# We unfortunately have no way, from Worker-initiated code, to
|
||||
# automatically resolve the path from X.js to X.wasm.
|
||||
#
|
||||
# We have an "only slightly unsightly" solution for our main builds
|
||||
# but it does not work for the WASMFS builds, so those builds have to
|
||||
# be built to _this_ directory and can only run when the client app is
|
||||
# loaded from the same directory.
|
||||
# dir.dout = output dir for deliverables
|
||||
dir.dout := $(dir.wasm)/jswasm
|
||||
# dir.tmp = output dir for intermediary build files, as opposed to
|
||||
# end-user deliverables.
|
||||
dir.tmp := $(dir.wasm)/bld
|
||||
CLEAN_FILES += $(dir.tmp)/* $(dir.dout)/*
|
||||
ifeq (,$(wildcard $(dir.dout)))
|
||||
dir._tmp := $(shell mkdir -p $(dir.dout))
|
||||
endif
|
||||
ifeq (,$(wildcard $(dir.tmp)))
|
||||
dir._tmp := $(shell mkdir -p $(dir.tmp))
|
||||
endif
|
||||
dir.wasmfs := $(dir.dout)
|
||||
|
||||
MKDIR.bld := $(dir.tmp)
|
||||
$(MKDIR.bld):
|
||||
-mkdir -p $@ $(dir.dout)
|
||||
|
||||
CLEAN_FILES += *~ $(dir.jacc)/*~ $(dir.api)/*~ $(dir.common)/*~ $(dir.fiddle)/*~ \
|
||||
$(dir.fiddle-debug)/* $(dir.dout)/* $(dir.tmp)/*
|
||||
|
||||
########################################################################
|
||||
# Set up sqlite3.c and sqlite3.h...
|
||||
@@ -197,48 +132,14 @@ endif
|
||||
sqlite3.canonical.c := $(dir.top)/sqlite3.c
|
||||
sqlite3.c ?= $(firstword $(wildcard $(dir.top)/sqlite3-see.c) $(sqlite3.canonical.c))
|
||||
sqlite3.h := $(dir.top)/sqlite3.h
|
||||
ifeq (,$(shell grep sqlite3_activate_see $(sqlite3.c) 2>/dev/null))
|
||||
|
||||
ifneq (1,$(MAKING_CLEAN))
|
||||
ifeq (,$(shell grep sqlite3_activate_see $(sqlite3.c)))
|
||||
SQLITE_C_IS_SEE := 0
|
||||
else
|
||||
SQLITE_C_IS_SEE := 1
|
||||
$(info This is an SEE build.)
|
||||
$(info This is an SEE build)
|
||||
endif
|
||||
# Most SQLITE_OPT flags are set in sqlite3-wasm.c but we need them
|
||||
# made explicit here for building speedtest1.c.
|
||||
SQLITE_OPT = \
|
||||
-DSQLITE_ENABLE_FTS5 \
|
||||
-DSQLITE_ENABLE_RTREE \
|
||||
-DSQLITE_ENABLE_EXPLAIN_COMMENTS \
|
||||
-DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION \
|
||||
-DSQLITE_ENABLE_STMTVTAB \
|
||||
-DSQLITE_ENABLE_DBPAGE_VTAB \
|
||||
-DSQLITE_ENABLE_DBSTAT_VTAB \
|
||||
-DSQLITE_ENABLE_BYTECODE_VTAB \
|
||||
-DSQLITE_ENABLE_OFFSET_SQL_FUNC \
|
||||
-DSQLITE_OMIT_LOAD_EXTENSION \
|
||||
-DSQLITE_OMIT_DEPRECATED \
|
||||
-DSQLITE_OMIT_UTF16 \
|
||||
-DSQLITE_OMIT_SHARED_CACHE \
|
||||
-DSQLITE_THREADSAFE=0 \
|
||||
-DSQLITE_TEMP_STORE=2 \
|
||||
-DSQLITE_OS_KV_OPTIONAL=1 \
|
||||
'-DSQLITE_DEFAULT_UNIX_VFS="unix-none"' \
|
||||
-DSQLITE_USE_URI=1 \
|
||||
-DSQLITE_WASM_ENABLE_C_TESTS \
|
||||
-DSQLITE_C=$(sqlite3.c)
|
||||
#SQLITE_OPT += -DSQLITE_DEBUG
|
||||
# Enabling SQLITE_DEBUG will break sqlite3_wasm_vfs_create_file()
|
||||
# (and thus sqlite3_js_vfs_create_file()). Those functions are
|
||||
# deprecated and alternatives are in place, but this crash behavior
|
||||
# can be used to find errant uses of sqlite3_js_vfs_create_file()
|
||||
# in client code.
|
||||
|
||||
########################################################################
|
||||
# minimal=1 disables all "extraneous" stuff from sqlite3-wasm.c, the
|
||||
# goal being to create a WASM file with only the core APIs.
|
||||
minimal ?= 0
|
||||
ifeq (1,$(minimal))
|
||||
SQLITE_OPT += -DSQLITE_WASM_MINIMAL
|
||||
endif
|
||||
|
||||
########################################################################@
|
||||
@@ -250,21 +151,179 @@ $(sqlite3.h):
|
||||
$(MAKE) -C $(dir.top) sqlite3.c
|
||||
$(sqlite3.c): $(sqlite3.h)
|
||||
|
||||
.PHONY: clean distclean
|
||||
clean:
|
||||
-rm -f $(CLEAN_FILES)
|
||||
distclean: clean
|
||||
-rm -f $(DISTCLEAN_FILES)
|
||||
########################################################################
|
||||
# Special-case builds for which we require certain pre-conditions
|
||||
# which, if not met, may cause warnings or fatal errors in the build.
|
||||
# This also affects the default optimization level flags. Note that
|
||||
# the fiddle targets are in this list because they are used for
|
||||
# generating sqlite.org/fiddle.
|
||||
OPTIMIZED_TARGETS := dist snapshot fiddle fiddle.debug
|
||||
|
||||
ifeq (release,$(filter release,$(MAKECMDGOALS)))
|
||||
ifeq (,$(wasm-strip))
|
||||
$(error Cannot make release-quality binary because wasm-strip is not available. \
|
||||
See notes in the warning above)
|
||||
ifneq (1,$(MAKING_CLEAN))
|
||||
ifeq (,$(filter $(OPTIMIZED_TARGETS),$(MAKECMDGOALS)))
|
||||
$(info ==============================================================)
|
||||
$(info == Development build. Make one of (dist, snapshot) for a)
|
||||
$(info == smaller release build.)
|
||||
$(info ==============================================================)
|
||||
endif
|
||||
else
|
||||
$(info Development build. Use '$(MAKE) release' for a smaller release build.)
|
||||
endif
|
||||
|
||||
########################################################################
|
||||
# Find emcc (Emscripten compiler)...
|
||||
ifeq (1,$(MAKING_CLEAN))
|
||||
emcc.bin := echo
|
||||
emcc.version := unknown
|
||||
else
|
||||
emcc.bin := $(shell which emcc 2>/dev/null)
|
||||
ifeq (,$(emcc.bin))
|
||||
ifneq (,$(EMSDK_HOME))
|
||||
emcc.bin := $(wildcard $(EMSDK_HOME)/upstream/emscripten/emcc)
|
||||
endif
|
||||
ifeq (,$(emcc.bin))
|
||||
$(error Cannot find emcc in path.)
|
||||
endif
|
||||
endif
|
||||
emcc.version := $(shell $(emcc.bin) --version | sed -n 1p | sed -e 's/^.* \([3-9][^ ]*\) .*$$/\1/;')
|
||||
$(info using emcc version [$(emcc.version)])
|
||||
endif
|
||||
#########################################################################
|
||||
# Find wasm-strip, which we need for release builds (see below for
|
||||
# why) but not strictly for non-release builds.
|
||||
ifeq (1,$(MAKING_CLEAN))
|
||||
wasm-strip-bin := irrelevant
|
||||
else
|
||||
wasm-strip.bin ?= $(shell which wasm-strip 2>/dev/null)
|
||||
ifeq (,$(wasm-strip.bin))
|
||||
$(info WARNING: *******************************************************************)
|
||||
$(info WARNING: Builds using -O2/-O3/-Os/-Oz will minify WASM-exported names,)
|
||||
$(info WARNING: breaking _All The Things_. The workaround for that is to build)
|
||||
$(info WARNING: with -g3 (which explodes the file size) and then strip the debug)
|
||||
$(info WARNING: info after compilation, using wasm-strip, to shrink the wasm file.)
|
||||
$(info WARNING: wasm-strip was not found in the PATH so we cannot strip those.)
|
||||
$(info WARNING: If this build uses any optimization level higher than -O1 then)
|
||||
$(info WARNING: the ***resulting JS code WILL NOT BE USABLE***.)
|
||||
$(info WARNING: wasm-strip is part of the wabt package:)
|
||||
$(info WARNING: https://github.com/WebAssembly/wabt)
|
||||
$(info WARNING: on Ubuntu-like systems it can be installed with:)
|
||||
$(info WARNING: sudo apt install wabt)
|
||||
$(info WARNING: *******************************************************************)
|
||||
ifneq (,$(filter $(OPTIMIZED_TARGETS),$(MAKECMDGOALS)))
|
||||
$(error Cannot make release-quality binary because wasm-strip is not available.)
|
||||
endif
|
||||
wasm-strip.bin := echo "not wasm-stripping"
|
||||
endif
|
||||
endif
|
||||
maybe-wasm-strip := $(wasm-strip.bin)
|
||||
|
||||
########################################################################
|
||||
# barebones=1 disables all "extraneous" stuff from sqlite3-wasm.c, the
|
||||
# goal being to create a WASM file with only the core APIs.
|
||||
ifeq (1,$(barebones))
|
||||
wasm-bare-bones := 1
|
||||
$(info ==============================================================)
|
||||
$(info == This is a bare-bones build. It trades away features for)
|
||||
$(info == a smaller .wasm file.)
|
||||
$(info ==============================================================)
|
||||
else
|
||||
wasm-bare-bones := 0
|
||||
endif
|
||||
# undefine barebones # relatively new gmake feature, not ubiquitous
|
||||
|
||||
# Common options for building sqlite3-wasm.c and speedtest1.c.
|
||||
# Explicit ENABLEs...
|
||||
SQLITE_OPT.common := \
|
||||
-DSQLITE_THREADSAFE=0 \
|
||||
-DSQLITE_TEMP_STORE=2 \
|
||||
-DSQLITE_ENABLE_MATH_FUNCTIONS \
|
||||
-DSQLITE_OS_KV_OPTIONAL=1 \
|
||||
'-DSQLITE_DEFAULT_UNIX_VFS="unix-none"' \
|
||||
-DSQLITE_USE_URI=1 \
|
||||
-DSQLITE_C=$(sqlite3.c) \
|
||||
-DSQLITE_OMIT_DEPRECATED \
|
||||
-DSQLITE_OMIT_UTF16 \
|
||||
-DSQLITE_OMIT_LOAD_EXTENSION \
|
||||
-DSQLITE_OMIT_SHARED_CACHE
|
||||
# ^^^ These particular OMITs are hard-coded in sqlite3-wasm.c and
|
||||
# removing them from this list will serve only to break the speedtest1
|
||||
# builds.
|
||||
|
||||
# Currently always needed but TODO is paring tester1.c-pp.js down
|
||||
# to be able to run without this:
|
||||
SQLITE_OPT.common += -DSQLITE_WASM_ENABLE_C_TESTS
|
||||
|
||||
# Extra flags for full-featured builds...
|
||||
SQLITE_OPT.full-featured := \
|
||||
-DSQLITE_ENABLE_BYTECODE_VTAB \
|
||||
-DSQLITE_ENABLE_DBPAGE_VTAB \
|
||||
-DSQLITE_ENABLE_DBSTAT_VTAB \
|
||||
-DSQLITE_ENABLE_FTS5 \
|
||||
-DSQLITE_ENABLE_MATH_FUNCTIONS \
|
||||
-DSQLITE_ENABLE_OFFSET_SQL_FUNC \
|
||||
-DSQLITE_ENABLE_PREUPDATE_HOOK \
|
||||
-DSQLITE_ENABLE_RTREE \
|
||||
-DSQLITE_ENABLE_SESSION \
|
||||
-DSQLITE_ENABLE_STMTVTAB \
|
||||
-DSQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
|
||||
|
||||
ifeq (0,$(wasm-bare-bones))
|
||||
# The so-called canonical build is full-featured:
|
||||
SQLITE_OPT := \
|
||||
$(SQLITE_OPT.common) \
|
||||
$(SQLITE_OPT.full-featured)
|
||||
else
|
||||
# The so-called bare-bones build is exactly that:
|
||||
SQLITE_OPT := \
|
||||
$(SQLITE_OPT.common) \
|
||||
-DSQLITE_WASM_BARE_BONES
|
||||
# SQLITE_WASM_BARE_BONES tells sqlite3-wasm.c to explicitly omit
|
||||
# a bunch of stuff, in the interest of keeping the wasm file size
|
||||
# down. As of this writing it equates to:
|
||||
#
|
||||
# -USQLITE_ENABLE_DBPAGE_VTAB
|
||||
# -USQLITE_ENABLE_DBSTAT_VTAB
|
||||
# -USQLITE_ENABLE_EXPLAIN_COMMENTS
|
||||
# -USQLITE_ENABLE_FTS5
|
||||
# -USQLITE_ENABLE_OFFSET_SQL_FUNC
|
||||
# -USQLITE_ENABLE_PREUPDATE_HOOK
|
||||
# -USQLITE_ENABLE_RTREE
|
||||
# -USQLITE_ENABLE_SESSION
|
||||
# -USQLITE_ENABLE_STMTVTAB
|
||||
# -DSQLITE_OMIT_AUTHORIZATION
|
||||
# -DSQLITE_OMIT_GET_TABLE
|
||||
# -DSQLITE_OMIT_INCRBLOB
|
||||
# -DSQLITE_OMIT_INTROSPECTION_PRAGMAS
|
||||
# -DSQLITE_OMIT_JSON
|
||||
# -DSQLITE_OMIT_PROGRESS_CALLBACK
|
||||
# -DSQLITE_OMIT_WAL
|
||||
#
|
||||
# There are others we want here but which require explicit OMIT when
|
||||
# creating their amalgamation, and that step is TODO:
|
||||
#
|
||||
# -DSQLITE_OMIT_EXPLAIN
|
||||
# -DSQLITE_OMIT_TRIGGER
|
||||
# -DSQLITE_OMIT_VIRTUALTABLE
|
||||
# -DSQLITE_OMIT_WINDOWFUNC
|
||||
endif
|
||||
|
||||
#SQLITE_OPT += -DSQLITE_DEBUG
|
||||
# Enabling SQLITE_DEBUG will break sqlite3_wasm_vfs_create_file()
|
||||
# (and thus sqlite3_js_vfs_create_file()). Those functions are
|
||||
# deprecated and alternatives are in place, but this crash behavior
|
||||
# can be used to find errant uses of sqlite3_js_vfs_create_file()
|
||||
# in client code.
|
||||
|
||||
########################################################################
|
||||
# The following flags are hard-coded into sqlite3-wasm.c and cannot be
|
||||
# modified via the build process:
|
||||
#
|
||||
# SQLITE_ENABLE_API_ARMOR
|
||||
# SQLITE_OMIT_LOAD_EXTENSION
|
||||
# SQLITE_OMIT_DEPRECATED
|
||||
# SQLITE_OMIT_UTF16
|
||||
# SQLITE_OMIT_SHARED_CACHE
|
||||
########################################################################
|
||||
|
||||
|
||||
########################################################################
|
||||
# Adding custom C code via sqlite3_wasm_extra_init.c:
|
||||
#
|
||||
@@ -321,6 +380,18 @@ $(bin.stripccomments): $(bin.stripccomments).c $(MAKEFILE)
|
||||
$(CC) -o $@ $<
|
||||
DISTCLEAN_FILES += $(bin.stripccomments)
|
||||
|
||||
########################################################################
|
||||
# bin.mkwb is used for generating some of the makefile code for the
|
||||
# various wasm builds. It used to be generated in this makefile via a
|
||||
# difficult-to-read/maintain block of $(eval)'d code. Attempts were
|
||||
# made to generate it from tcl and bash (shell) but having to escape
|
||||
# the $ references in those languages made it just as illegible as the
|
||||
# native makefile code. Somewhat surprisingly, moving that code generation
|
||||
# to C makes it slightly less illegible than the previous 3 options.
|
||||
bin.mkwb := ./mkwasmbuilds
|
||||
$(bin.mkwb): $(bin.mkwb).c $(MAKEFILE)
|
||||
$(CC) -o $@ $<
|
||||
DISTCLEAN_FILES += $(bin.mkwb)
|
||||
|
||||
########################################################################
|
||||
# C-PP.FILTER: a $(call)able to transform $(1) to $(2) via:
|
||||
@@ -360,6 +431,7 @@ $(bin.c-pp): c-pp.c $(sqlite3.c) $(MAKEFILE)
|
||||
-DSQLITE_OMIT_LOAD_EXTENSION -DSQLITE_OMIT_DEPRECATED -DSQLITE_OMIT_UTF16 \
|
||||
-DSQLITE_OMIT_SHARED_CACHE -DSQLITE_OMIT_WAL -DSQLITE_THREADSAFE=0 \
|
||||
-DSQLITE_TEMP_STORE=3
|
||||
DISTCLEAN_FILES += $(bin.c-pp)
|
||||
C-PP.FILTER.global ?=
|
||||
ifeq (1,$(SQLITE_C_IS_SEE))
|
||||
C-PP.FILTER.global += -Denable-see
|
||||
@@ -371,7 +443,7 @@ define C-PP.FILTER
|
||||
# $3 = optional c-pp -D... flags
|
||||
$(2): $(1) $$(MAKEFILE) $$(bin.c-pp)
|
||||
$$(bin.c-pp) -f $(1) -o $$@ $(3) $(C-PP.FILTER.global)
|
||||
CLEAN_FILES += $(2)
|
||||
#CLEAN_FILES += $(2)
|
||||
endef
|
||||
# /end C-PP.FILTER
|
||||
########################################################################
|
||||
@@ -386,7 +458,17 @@ emcc.WASM_BIGINT ?= 1
|
||||
# emcc_opt = optimization-related flags. These are primarily used by
|
||||
# the various oX targets. build times for -O levels higher than 0 are
|
||||
# painful at dev-time.
|
||||
emcc_opt ?= -O0
|
||||
#
|
||||
# When running any of the $(OPTIMIZED_TARGETS) explicitly, e.g. for a
|
||||
# release distribution, use a higher optimization level. Experience
|
||||
# has shown -Oz to produce the smallest deliverables with only a
|
||||
# roughly 10% performance hit in the resulting WASM file compared to
|
||||
# -O2 (which consistently creates the fastest-running deliverables).
|
||||
ifeq (,$(filter $(OPTIMIZED_TARGETS),$(MAKECMDGOALS)))
|
||||
emcc_opt ?= -O0
|
||||
else
|
||||
emcc_opt ?= -Oz
|
||||
endif
|
||||
|
||||
# When passing emcc_opt from the CLI, += and re-assignment have no
|
||||
# effect, so emcc_opt+=-g3 doesn't work. So...
|
||||
@@ -421,24 +503,16 @@ emcc_opt_full := $(emcc_opt) -g3
|
||||
########################################################################
|
||||
# EXPORTED_FUNCTIONS.* = files for use with Emscripten's
|
||||
# -sEXPORTED_FUNCTION flag.
|
||||
EXPORTED_FUNCTIONS.api.core := $(abspath $(dir.api)/EXPORTED_FUNCTIONS.sqlite3-core)
|
||||
EXPORTED_FUNCTIONS.api.core := $(dir.api)/EXPORTED_FUNCTIONS.sqlite3-core
|
||||
EXPORTED_FUNCTIONS.api.in := $(EXPORTED_FUNCTIONS.api.core)
|
||||
ifeq (1,$(SQLITE_C_IS_SEE))
|
||||
EXPORTED_FUNCTIONS.api.in += $(abspath $(dir.api)/EXPORTED_FUNCTIONS.sqlite3-see)
|
||||
EXPORTED_FUNCTIONS.api.in += $(dir.api)/EXPORTED_FUNCTIONS.sqlite3-see
|
||||
endif
|
||||
ifeq (0,$(minimal))
|
||||
EXPORTED_FUNCTIONS.api.in += \
|
||||
$(abspath $(dir.api)/EXPORTED_FUNCTIONS.sqlite3-auth) \
|
||||
$(abspath $(dir.api)/EXPORTED_FUNCTIONS.sqlite3-preupdate) \
|
||||
$(abspath $(dir.api)/EXPORTED_FUNCTIONS.sqlite3-session) \
|
||||
$(abspath $(dir.api)/EXPORTED_FUNCTIONS.sqlite3-vtab)
|
||||
else
|
||||
$(info ========================================)
|
||||
$(info This is a minimal-mode build)
|
||||
$(info ========================================)
|
||||
ifeq (0,$(wasm-bare-bones))
|
||||
EXPORTED_FUNCTIONS.api.in += $(dir.api)/EXPORTED_FUNCTIONS.sqlite3-extras
|
||||
endif
|
||||
EXPORTED_FUNCTIONS.api := $(dir.tmp)/EXPORTED_FUNCTIONS.api
|
||||
$(EXPORTED_FUNCTIONS.api): $(EXPORTED_FUNCTIONS.api.in) $(sqlite3.c) $(MAKEFILE)
|
||||
$(EXPORTED_FUNCTIONS.api): $(MKDIR.bld) $(EXPORTED_FUNCTIONS.api.in) $(sqlite3.c) $(MAKEFILE)
|
||||
cat $(EXPORTED_FUNCTIONS.api.in) > $@
|
||||
|
||||
########################################################################
|
||||
@@ -470,8 +544,10 @@ sqlite3-api.jses += $(dir.api)/sqlite3-api-oo1.c-pp.js
|
||||
sqlite3-api.jses += $(dir.api)/sqlite3-api-worker1.c-pp.js
|
||||
# sqlite3-vfs-helper = helper APIs for VFSes:
|
||||
sqlite3-api.jses += $(dir.api)/sqlite3-vfs-helper.c-pp.js
|
||||
# sqlite3-vtab-helper = helper APIs for VTABLEs:
|
||||
sqlite3-api.jses += $(dir.api)/sqlite3-vtab-helper.c-pp.js
|
||||
ifeq (0,$(wasm-bare-bones))
|
||||
# sqlite3-vtab-helper = helper APIs for VTABLEs:
|
||||
sqlite3-api.jses += $(dir.api)/sqlite3-vtab-helper.c-pp.js
|
||||
endif
|
||||
# sqlite3-vfs-opfs = the first OPFS VFS:
|
||||
sqlite3-api.jses += $(dir.api)/sqlite3-vfs-opfs.c-pp.js
|
||||
# sqlite3-vfs-opfs-sahpool = the second OPFS VFS:
|
||||
@@ -520,7 +596,7 @@ $(SOAP.js.bld): $(SOAP.js)
|
||||
# preprocessed. It contains all of $(sqlite3-api.jses) but none of the
|
||||
# Emscripten-specific headers and footers.
|
||||
sqlite3-api.js.in := $(dir.tmp)/sqlite3-api.c-pp.js
|
||||
$(sqlite3-api.js.in): $(sqlite3-api.jses) $(MAKEFILE)
|
||||
$(sqlite3-api.js.in): $(MKDIR.bld) $(sqlite3-api.jses) $(MAKEFILE)
|
||||
@echo "Making $@..."
|
||||
@for i in $(sqlite3-api.jses); do \
|
||||
echo "/* BEGIN FILE: $$i */"; \
|
||||
@@ -687,7 +763,7 @@ emcc.jsflags += -sLLD_REPORT_UNDEFINED
|
||||
########################################################################
|
||||
# $(sqlite3-api-build-version.js) injects the build version info into
|
||||
# the bundle in JSON form.
|
||||
$(sqlite3-api-build-version.js): $(bin.version-info) $(MAKEFILE)
|
||||
$(sqlite3-api-build-version.js): $(MKDIR.bld) $(bin.version-info) $(MAKEFILE)
|
||||
@echo "Making $@..."
|
||||
@{ \
|
||||
echo 'globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){'; \
|
||||
@@ -703,7 +779,7 @@ $(sqlite3-api-build-version.js): $(bin.version-info) $(MAKEFILE)
|
||||
#
|
||||
# Maintenance reminder: there are awk binaries out there which do not
|
||||
# support -e SCRIPT.
|
||||
$(sqlite3-license-version.js): $(sqlite3.h) $(sqlite3-license-version-header.js) \
|
||||
$(sqlite3-license-version.js): $(MKDIR.bld) $(sqlite3.h) $(sqlite3-license-version-header.js) \
|
||||
$(MAKEFILE)
|
||||
@echo "Making $@..."; { \
|
||||
cat $(sqlite3-license-version-header.js); \
|
||||
@@ -731,7 +807,7 @@ post-jses.js := \
|
||||
$(dir.api)/post-js-header.js \
|
||||
$(sqlite3-api.js.in) \
|
||||
$(dir.api)/post-js-footer.js
|
||||
$(post-js.js.in): $(post-jses.js) $(MAKEFILE)
|
||||
$(post-js.js.in): $(MKDIR.bld) $(post-jses.js) $(MAKEFILE)
|
||||
@echo "Making $@..."
|
||||
@for i in $(post-jses.js); do \
|
||||
echo "/* BEGIN FILE: $$i */"; \
|
||||
@@ -740,55 +816,6 @@ $(post-js.js.in): $(post-jses.js) $(MAKEFILE)
|
||||
done > $@
|
||||
|
||||
|
||||
########################################################################
|
||||
# call-make-pre-post is a $(call)able which creates rules for
|
||||
# pre-js.$(1)-$(2).js. $1 = the base name of the JS file on whose
|
||||
# behalf this pre-js is for (one of: $(JS_BUILD_NAMES)). $2 is
|
||||
# the build mode: one of $(JS_BUILD_MODES). This sets up
|
||||
# --[extern-][pre/post]-js flags in $(pre-post-$(1)-$(2).flags) and
|
||||
# dependencies in $(pre-post-$(1)-$(2).deps). The resulting files get
|
||||
# filtered using $(C-PP.FILTER). Any flags necessary for such
|
||||
# filtering need to be set in $(c-pp.D.$(1)-$(2)) before $(call)ing
|
||||
# this.
|
||||
#
|
||||
# Maintenance note: a shell script was written to generate these rules
|
||||
# with the hope that it would make them more legible and maintainable,
|
||||
# but embedding makefile code in another language makes it even less
|
||||
# legible than having the level of $(eval) indirection which we have
|
||||
# here.
|
||||
define call-make-pre-post
|
||||
pre-post-$(1)-$(2).flags ?=
|
||||
pre-js.js.$(1)-$(2).intermediary := $$(dir.tmp)/pre-js.$(1)-$(2).intermediary.js
|
||||
pre-js.js.$(1)-$(2) := $$(dir.tmp)/pre-js.$(1)-$(2).js
|
||||
#$$(error $$(pre-js.js.$(1)-$(2).intermediary) $$(pre-js.js.$(1)-$(2)))
|
||||
$$(eval $$(call C-PP.FILTER,$$(pre-js.js.in),$$(pre-js.js.$(1)-$(2).intermediary),$$(c-pp.D.$(1)-$(2))))
|
||||
post-js.js.$(1)-$(2) := $$(dir.tmp)/post-js.$(1)-$(2).js
|
||||
$$(eval $$(call C-PP.FILTER,$$(post-js.js.in),$$(post-js.js.$(1)-$(2)),$$(c-pp.D.$(1)-$(2))))
|
||||
extern-post-js.js.$(1)-$(2) := $$(dir.tmp)/extern-post-js.$(1)-$(2).js
|
||||
$$(eval $$(call C-PP.FILTER,$$(extern-post-js.js.in),$$(extern-post-js.js.$(1)-$(2)),$$(c-pp.D.$(1)-$(2))))
|
||||
pre-post-common.flags.$(1)-$(2) := \
|
||||
$$(pre-post-common.flags) \
|
||||
--post-js=$$(post-js.js.$(1)-$(2)) \
|
||||
--extern-post-js=$$(extern-post-js.js.$(1)-$(2))
|
||||
pre-post-jses.$(1)-$(2).deps := $$(pre-post-jses.deps.common) \
|
||||
$$(post-js.js.$(1)-$(2)) $$(extern-post-js.js.$(1)-$(2))
|
||||
$$(pre-js.js.$(1)-$(2)): $$(pre-js.js.$(1)-$(2).intermediary) $$(MAKEFILE)
|
||||
cp $$(pre-js.js.$(1)-$(2).intermediary) $$@
|
||||
@if [ sqlite3-wasmfs = $(1) ]; then \
|
||||
echo "delete Module[xNameOfInstantiateWasm] /*for WASMFS build*/;"; \
|
||||
elif [ sqlite3 != $(1) ]; then \
|
||||
echo "Module[xNameOfInstantiateWasm].uri = '$(1).wasm';"; \
|
||||
fi >> $$@
|
||||
pre-post-$(1)-$(2).deps := \
|
||||
$$(pre-post-jses.$(1)-$(2).deps) \
|
||||
$$(dir.tmp)/pre-js.$(1)-$(2).js
|
||||
pre-post-$(1)-$(2).flags += \
|
||||
$$(pre-post-common.flags.$(1)-$(2)) \
|
||||
--pre-js=$$(dir.tmp)/pre-js.$(1)-$(2).js
|
||||
endef
|
||||
# /post-js and pre-js
|
||||
########################################################################
|
||||
|
||||
# Undocumented Emscripten feature: if the target file extension is
|
||||
# "mjs", it defaults to ES6 module builds:
|
||||
# https://github.com/emscripten-core/emscripten/issues/14383
|
||||
@@ -802,11 +829,13 @@ sqlite3-wasmfs.cfiles := $(sqlite3-wasm.cfiles)
|
||||
# difference, so we build all binaries against sqlite3-wasm.c instead
|
||||
# of building a shared copy of sqlite3-wasm.o to link against.
|
||||
########################################################################
|
||||
# SQLITE3.xJS.EXPORT-DEFAULT is part of SQLITE3-WASMFS.xJS.RECIPE and
|
||||
# SETUP_LIB_BUILD_MODE, factored into a separate piece to avoid code
|
||||
# duplication. $1 is 1 if the build mode needs this workaround (esm,
|
||||
# bundler-friendly, node) and 0 if not (vanilla). $2 must be empty for
|
||||
# all builds except sqlite3-wasmfs.mjs, in which case it must be 1.
|
||||
|
||||
########################################################################
|
||||
# SQLITE3.xJS.ESM-EXPORT-DEFAULT is used by mkwasmbuilds.c and the
|
||||
# wasmfs build. $1 is 1 if the build mode needs this workaround
|
||||
# (modes: esm, bundler-friendly, node) and 0 if not (vanilla). $2 must
|
||||
# be 0 for all builds except sqlite3-wasmfs.mjs, in which case it must
|
||||
# be 1.
|
||||
#
|
||||
# Reminder for ESM builds: even if we use -sEXPORT_ES6=0, emcc _still_
|
||||
# adds:
|
||||
@@ -825,11 +854,11 @@ sqlite3-wasmfs.cfiles := $(sqlite3-wasm.cfiles)
|
||||
# use awk instead of sed for this.
|
||||
define SQLITE3.xJS.ESM-EXPORT-DEFAULT
|
||||
if [ x1 = x$(1) ]; then \
|
||||
echo "Fragile workaround for emscripten/issues/18237. See SQLITE3.xJS.RECIPE."; \
|
||||
echo "Fragile workaround for emscripten/issues/18237. See SQLITE3.xJS.ESM-EXPORT-DEFAULT."; \
|
||||
{\
|
||||
awk '/^export default/ && !f{f=1; next} 1' $@ > $@.tmp && mv $@.tmp $@; \
|
||||
} || exit $$?; \
|
||||
if [ x != x$(2) ]; then \
|
||||
if [ x1 = x$(2) ]; then \
|
||||
if ! grep -q '^export default' $@; then \
|
||||
echo "Cannot find export default." 1>&2; \
|
||||
exit 1; \
|
||||
@@ -838,78 +867,6 @@ if [ x1 = x$(1) ]; then \
|
||||
fi
|
||||
endef
|
||||
|
||||
########################################################################
|
||||
# extern-post-js* and extern-pre-js* are files for use with
|
||||
# Emscripten's --extern-pre-js and --extern-post-js flags.
|
||||
extern-pre-js.js := $(dir.api)/extern-pre-js.js
|
||||
extern-post-js.js.in := $(dir.api)/extern-post-js.c-pp.js
|
||||
# Emscripten flags for --[extern-][pre|post]-js=... for the
|
||||
# various builds.
|
||||
pre-post-common.flags := \
|
||||
--extern-pre-js=$(sqlite3-license-version.js)
|
||||
# pre-post-jses.deps.* = a list of dependencies for the
|
||||
# --[extern-][pre/post]-js files.
|
||||
pre-post-jses.deps.common := $(extern-pre-js.js) $(sqlite3-license-version.js)
|
||||
|
||||
########################################################################
|
||||
# SETUP_LIB_BUILD_MODE is a $(call)'able which sets up numerous pieces
|
||||
# for one of the build modes.
|
||||
#
|
||||
# $1 = one of: $(JS_BUILD_NAMES)
|
||||
# $2 = build mode name: one of $(JS_BUILD_MODES)
|
||||
# $3 = 1 for ESM build mode, else 0
|
||||
# $4 = resulting sqlite-api JS/MJS file
|
||||
# $5 = resulting JS/MJS file
|
||||
# $6 = -D... flags for $(bin.c-pp)
|
||||
# $7 = optional extra flags for emcc
|
||||
#
|
||||
# Maintenance reminder: be careful not to introduce spaces around args
|
||||
# ($1, $2), otherwise string concatenation will malfunction.
|
||||
#
|
||||
# Before calling this, emcc.environment.$(2) must be set to a value
|
||||
# for emcc's -sENVIRONMENT flag.
|
||||
#
|
||||
# $(cflags.$(1)) and $(cflags.$(1).$(2)) may be defined to append
|
||||
# CFLAGS to a given build mode.
|
||||
#
|
||||
# $(emcc.flags.$(1)) and $(emcc.flags.$(1).$(2)) may be defined to
|
||||
# append emcc-specific flags to a given build mode.
|
||||
define SETUP_LIB_BUILD_MODE
|
||||
$(info Setting up build [$(1)-$(2)]: $(5))
|
||||
c-pp.D.$(1)-$(2) := $(6)
|
||||
$$(eval $$(call call-make-pre-post,$(1),$(2)))
|
||||
emcc.flags.$(1).$(2) ?=
|
||||
emcc.flags.$(1).$(2) += $(7)
|
||||
$$(eval $$(call C-PP.FILTER, $$(sqlite3-api.js.in), $(4), $(6)))
|
||||
$(5): $(4) $$(MAKEFILE) $$(sqlite3-wasm.cfiles) $$(EXPORTED_FUNCTIONS.api) $$(pre-post-$(1)-$(2).deps)
|
||||
@echo "Building $$@ ..."
|
||||
$$(emcc.bin) -o $$@ $$(emcc_opt_full) $$(emcc.flags) \
|
||||
$$(emcc.jsflags) \
|
||||
-sENVIRONMENT=$$(emcc.environment.$(2)) \
|
||||
$$(pre-post-$(1)-$(2).flags) \
|
||||
$$(emcc.flags.$(1)) $$(emcc.flags.$(1).$(2)) \
|
||||
$$(cflags.common) $$(SQLITE_OPT) \
|
||||
$$(cflags.$(1)) $$(cflags.$(1).$(2)) \
|
||||
$$(cflags.wasm_extra_init) $$(sqlite3-wasm.cfiles)
|
||||
@$$(call SQLITE3.xJS.ESM-EXPORT-DEFAULT,$(3))
|
||||
@dotwasm=$$(basename $$@).wasm; \
|
||||
chmod -x $$$$dotwasm; \
|
||||
$(maybe-wasm-strip) $$$$dotwasm; \
|
||||
case $(2) in \
|
||||
bundler-friendly|node) \
|
||||
echo "Patching $$@ for $(1).wasm..."; \
|
||||
rm -f $$$$dotwasm; \
|
||||
dotwasm=; \
|
||||
sed -i -e 's/$(1)-$(2).wasm/$(1).wasm/g' $$@ || exit $$$$?; \
|
||||
;; \
|
||||
esac; \
|
||||
ls -la $$$$dotwasm $$@
|
||||
all: $(5)
|
||||
#quick: $(5)
|
||||
CLEAN_FILES += $(4) $(5)
|
||||
endef
|
||||
# ^^^ /SETUP_LIB_BUILD_MODE
|
||||
########################################################################
|
||||
sqlite3-api.js := $(dir.dout)/sqlite3-api.js
|
||||
sqlite3.js := $(dir.dout)/sqlite3.js
|
||||
sqlite3-api.mjs := $(dir.dout)/sqlite3-api.mjs
|
||||
@@ -918,17 +875,18 @@ sqlite3-api-bundler-friendly.mjs := $(dir.dout)/sqlite3-api-bundler-friendly.mjs
|
||||
sqlite3-bundler-friendly.mjs := $(dir.dout)/sqlite3-bundler-friendly.mjs
|
||||
sqlite3-api-node.mjs := $(dir.dout)/sqlite3-api-node.mjs
|
||||
sqlite3-node.mjs := $(dir.dout)/sqlite3-node.mjs
|
||||
#$(info $(call SETUP_LIB_BUILD_MODE,sqlite3,vanilla,0, $(sqlite3-api.js), $(sqlite3.js)))
|
||||
$(eval $(call SETUP_LIB_BUILD_MODE,sqlite3,vanilla,0,\
|
||||
$(sqlite3-api.js), $(sqlite3.js)))
|
||||
$(eval $(call SETUP_LIB_BUILD_MODE,sqlite3,esm,1,\
|
||||
$(sqlite3-api.mjs), $(sqlite3.mjs), -Dtarget=es6-module))
|
||||
$(eval $(call SETUP_LIB_BUILD_MODE,sqlite3,bundler-friendly,1,\
|
||||
$(sqlite3-api-bundler-friendly.mjs),$(sqlite3-bundler-friendly.mjs),\
|
||||
$(c-pp.D.sqlite3-esm) -Dtarget=es6-bundler-friendly))
|
||||
$(eval $(call SETUP_LIB_BUILD_MODE,sqlite3,node,1,\
|
||||
$(sqlite3-api-node.mjs),$(sqlite3-node.mjs),\
|
||||
$(c-pp.D.sqlite3-bundler-friendly) -Dtarget=node))
|
||||
sqlite3-api-wasmfs.mjs := $(dir.tmp)/sqlite3-api-wasmfs.mjs
|
||||
sqlite3-wasmfs.mjs := $(dir.wasmfs)/sqlite3-wasmfs.mjs
|
||||
EXPORTED_FUNCTIONS.fiddle := $(dir.tmp)/EXPORTED_FUNCTIONS.fiddle
|
||||
ifneq (1,$(MAKING_CLEAN))
|
||||
.wasmbuilds.make: $(bin.mkwb)
|
||||
@rm -f $@
|
||||
$(bin.mkwb) > $@
|
||||
@chmod -w $@
|
||||
-include .wasmbuilds.make
|
||||
endif
|
||||
DISTCLEAN_FILES += .wasmbuilds.make
|
||||
|
||||
# The various -D... values used by *.c-pp.js include:
|
||||
#
|
||||
# -Dtarget=es6-module: for all ESM module builds
|
||||
@@ -962,7 +920,7 @@ $(sqlite3.wasm): $(sqlite3.js)
|
||||
$(sqlite3.mjs): $(sqlite3.js)
|
||||
$(sqlite3-bundler-friendly.mjs): $(sqlite3.mjs)
|
||||
$(sqlite3-node.mjs): $(sqlite3.mjs)
|
||||
CLEAN_FILES += $(sqlite3.wasm)
|
||||
#CLEAN_FILES += $(sqlite3.wasm)
|
||||
|
||||
########################################################################
|
||||
# We need separate copies of certain supplementary JS files for the
|
||||
@@ -1078,15 +1036,13 @@ speedtest1.exit-runtime1 := -sEXIT_RUNTIME=1
|
||||
# -sEXIT_RUNTIME=1 but we need EXIT_RUNTIME=0 for the worker-based app
|
||||
# which runs speedtest1 multiple times.
|
||||
|
||||
$(EXPORTED_FUNCTIONS.speedtest1): $(EXPORTED_FUNCTIONS.api.core)
|
||||
$(EXPORTED_FUNCTIONS.speedtest1): $(MKDIR.bld) $(EXPORTED_FUNCTIONS.api.core)
|
||||
@echo "Making $@ ..."
|
||||
@{ echo _wasm_main; cat $(EXPORTED_FUNCTIONS.api.core); } > $@
|
||||
speedtest1.js := $(dir.dout)/speedtest1.js
|
||||
speedtest1.wasm := $(dir.dout)/speedtest1.wasm
|
||||
emcc.flags.speedtest1-vanilla := $(cflags.common) -DSQLITE_SPEEDTEST1_WASM
|
||||
|
||||
speedtest1.cfiles := $(speedtest1.c) $(sqlite3-wasm.c)
|
||||
$(eval $(call call-make-pre-post,speedtest1,vanilla))
|
||||
$(speedtest1.js): $(MAKEFILE) $(speedtest1.cfiles) \
|
||||
$(pre-post-speedtest1-vanilla.deps) \
|
||||
$(EXPORTED_FUNCTIONS.speedtest1)
|
||||
@@ -1096,7 +1052,7 @@ $(speedtest1.js): $(MAKEFILE) $(speedtest1.cfiles) \
|
||||
$(emcc.speedtest1.common) \
|
||||
$(emcc.flags.speedtest1-vanilla) $(pre-post-speedtest1-vanilla.flags) \
|
||||
$(SQLITE_OPT) \
|
||||
-USQLITE_WASM_MINIMAL \
|
||||
-USQLITE_WASM_BARE_BONES \
|
||||
-USQLITE_C -DSQLITE_C=$(sqlite3.canonical.c) \
|
||||
$(speedtest1.exit-runtime0) \
|
||||
-o $@ $(speedtest1.cfiles) -lm
|
||||
@@ -1106,7 +1062,7 @@ $(speedtest1.js): $(MAKEFILE) $(speedtest1.cfiles) \
|
||||
|
||||
speedtest1: $(speedtest1.js)
|
||||
all: speedtest1
|
||||
CLEAN_FILES += $(speedtest1.js) $(speedtest1.wasm)
|
||||
#CLEAN_FILES += $(speedtest1.js) $(speedtest1.wasm)
|
||||
# end speedtest1.js
|
||||
########################################################################
|
||||
|
||||
@@ -1143,24 +1099,29 @@ quick: $(sqlite3.js)
|
||||
# painful.
|
||||
|
||||
.PHONY: o0 o1 o2 o3 os oz
|
||||
o-xtra :=
|
||||
#o-xtra ?= -flto
|
||||
emcc-opt-extra :=
|
||||
#ifeq (1,$(wasm-bare-bones))
|
||||
#emcc-opt-extra += -flto
|
||||
# ^^^^ -flto can have a considerably performance boost at -O0 but
|
||||
# doubles the build time and seems to have negligible, if any, effect
|
||||
# on higher optimization levels.
|
||||
#
|
||||
# -flto does not shrink the size of bare-bones builds by any measurable
|
||||
# amount.
|
||||
#endif
|
||||
o0: clean
|
||||
$(MAKE) -e "emcc_opt=-O0"
|
||||
o1: clean
|
||||
$(MAKE) -e "emcc_opt=-O1 $(o-xtra)"
|
||||
$(MAKE) -e "emcc_opt=-O1 $(emcc-opt-extra)"
|
||||
o2: clean
|
||||
$(MAKE) -j2 -e "emcc_opt=-O2 $(o-xtra)"
|
||||
$(MAKE) -j2 -e "emcc_opt=-O2 $(emcc-opt-extra)"
|
||||
o3: clean
|
||||
$(MAKE) -e "emcc_opt=-O3 $(o-xtra)"
|
||||
$(MAKE) -e "emcc_opt=-O3 $(emcc-opt-extra)"
|
||||
os: clean
|
||||
@echo "WARNING: -Os can result in a build with mysteriously missing pieces!"
|
||||
$(MAKE) -e "emcc_opt=-Os $(o-xtra)"
|
||||
$(MAKE) -e "emcc_opt=-Os $(emcc-opt-extra)"
|
||||
oz: clean
|
||||
$(MAKE) -j2 -e "emcc_opt=-Oz $(o-xtra)"
|
||||
$(MAKE) -j2 -e "emcc_opt=-Oz $(emcc-opt-extra)"
|
||||
|
||||
########################################################################
|
||||
# Sub-makes...
|
||||
@@ -1174,7 +1135,7 @@ wasmfs.enable ?= 1
|
||||
else
|
||||
# Unconditionally enable wasmfs for [dist]clean so that the wasmfs
|
||||
# sub-make can clean up.
|
||||
wasmfs.enable ?= $(if $(filter %clean,$(MAKECMDGOALS)),1,0)
|
||||
wasmfs.enable ?= $(MAKING_CLEAN)
|
||||
endif
|
||||
ifeq (1,$(wasmfs.enable))
|
||||
# wasmfs build disabled 2022-10-19 per /chat discussion.
|
||||
@@ -1253,4 +1214,3 @@ endif
|
||||
# Run local web server for the test/demo pages.
|
||||
httpd:
|
||||
althttpd -max-age 1 -enable-sab 1 -page index.html
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
_sqlite3_set_authorizer
|
||||
@@ -41,7 +41,6 @@ _sqlite3_create_collation
|
||||
_sqlite3_create_collation_v2
|
||||
_sqlite3_create_function
|
||||
_sqlite3_create_function_v2
|
||||
_sqlite3_create_window_function
|
||||
_sqlite3_data_count
|
||||
_sqlite3_db_filename
|
||||
_sqlite3_db_handle
|
||||
@@ -49,7 +48,6 @@ _sqlite3_db_name
|
||||
_sqlite3_db_readonly
|
||||
_sqlite3_db_status
|
||||
_sqlite3_deserialize
|
||||
_sqlite3_drop_modules
|
||||
_sqlite3_errcode
|
||||
_sqlite3_errmsg
|
||||
_sqlite3_error_offset
|
||||
@@ -81,7 +79,6 @@ _sqlite3_open_v2
|
||||
_sqlite3_overload_function
|
||||
_sqlite3_prepare_v2
|
||||
_sqlite3_prepare_v3
|
||||
_sqlite3_progress_handler
|
||||
_sqlite3_randomness
|
||||
_sqlite3_realloc
|
||||
_sqlite3_realloc64
|
||||
|
||||
+21
@@ -1,3 +1,12 @@
|
||||
_sqlite3_create_window_function
|
||||
_sqlite3_progress_handler
|
||||
_sqlite3_set_authorizer
|
||||
_sqlite3_preupdate_blobwrite
|
||||
_sqlite3_preupdate_count
|
||||
_sqlite3_preupdate_depth
|
||||
_sqlite3_preupdate_hook
|
||||
_sqlite3_preupdate_new
|
||||
_sqlite3_preupdate_old
|
||||
_sqlite3changegroup_add
|
||||
_sqlite3changegroup_add_strm
|
||||
_sqlite3changegroup_delete
|
||||
@@ -40,3 +49,15 @@ _sqlite3session_object_config
|
||||
_sqlite3session_patchset
|
||||
_sqlite3session_patchset_strm
|
||||
_sqlite3session_table_filter
|
||||
_sqlite3_create_module
|
||||
_sqlite3_create_module_v2
|
||||
_sqlite3_declare_vtab
|
||||
_sqlite3_drop_modules
|
||||
_sqlite3_vtab_collation
|
||||
_sqlite3_vtab_distinct
|
||||
_sqlite3_vtab_in
|
||||
_sqlite3_vtab_in_first
|
||||
_sqlite3_vtab_in_next
|
||||
_sqlite3_vtab_nochange
|
||||
_sqlite3_vtab_on_conflict
|
||||
_sqlite3_vtab_rhs_value
|
||||
@@ -1,6 +0,0 @@
|
||||
_sqlite3_preupdate_blobwrite
|
||||
_sqlite3_preupdate_count
|
||||
_sqlite3_preupdate_depth
|
||||
_sqlite3_preupdate_hook
|
||||
_sqlite3_preupdate_new
|
||||
_sqlite3_preupdate_old
|
||||
@@ -1,11 +0,0 @@
|
||||
_sqlite3_create_module
|
||||
_sqlite3_create_module_v2
|
||||
_sqlite3_declare_vtab
|
||||
_sqlite3_vtab_collation
|
||||
_sqlite3_vtab_distinct
|
||||
_sqlite3_vtab_in
|
||||
_sqlite3_vtab_in_first
|
||||
_sqlite3_vtab_in_next
|
||||
_sqlite3_vtab_nochange
|
||||
_sqlite3_vtab_on_conflict
|
||||
_sqlite3_vtab_rhs_value
|
||||
@@ -48,7 +48,7 @@ Module['locateFile'] = function(path, prefix) {
|
||||
}else{
|
||||
theFile = prefix + path;
|
||||
}
|
||||
sqlite3InitModuleState.debugModule(
|
||||
this.debugModule(
|
||||
"locateFile(",arguments[0], ',', arguments[1],")",
|
||||
'sqlite3InitModuleState.scriptDir =',this.scriptDir,
|
||||
'up.entries() =',Array.from(up.entries()),
|
||||
@@ -59,6 +59,7 @@ Module['locateFile'] = function(path, prefix) {
|
||||
}.bind(sqlite3InitModuleState);
|
||||
//#endif ifnot target=es6-bundler-friendly
|
||||
|
||||
//#if custom-Module.instantiateModule
|
||||
/**
|
||||
Bug warning: a custom Module.instantiateWasm() does not work
|
||||
in WASMFS builds:
|
||||
@@ -67,7 +68,15 @@ Module['locateFile'] = function(path, prefix) {
|
||||
|
||||
In such builds we must disable this.
|
||||
*/
|
||||
const xNameOfInstantiateWasm = false
|
||||
const xNameOfInstantiateWasm =
|
||||
//#if wasmfs
|
||||
false
|
||||
//#else
|
||||
true /* This works, but it does not have the testing coverage in the
|
||||
wild which Emscripten's default impl does, so we'll save
|
||||
this option until we really need a custom
|
||||
Module.instantiateWasm() */
|
||||
//#endif
|
||||
? 'instantiateWasm'
|
||||
: 'emscripten-bug-17951';
|
||||
Module[xNameOfInstantiateWasm] = function callee(imports,onSuccess){
|
||||
@@ -80,6 +89,7 @@ Module[xNameOfInstantiateWasm] = function callee(imports,onSuccess){
|
||||
sqlite3InitModuleState.debugModule(
|
||||
"instantiateWasm() uri =", uri
|
||||
);
|
||||
//console.warn("Custom instantiateModule",uri);
|
||||
const wfetch = ()=>fetch(uri, {credentials: 'same-origin'});
|
||||
const loadWasm = WebAssembly.instantiateStreaming
|
||||
? async ()=>{
|
||||
@@ -105,6 +115,7 @@ Module[xNameOfInstantiateWasm] = function callee(imports,onSuccess){
|
||||
scripts.
|
||||
*/
|
||||
Module[xNameOfInstantiateWasm].uri = 'sqlite3.wasm';
|
||||
//#endif custom-Module.instantiateModule
|
||||
/* END FILE: api/pre-js.js, noting that the build process may add a
|
||||
line after this one to change the above .uri to a build-specific
|
||||
one. */
|
||||
|
||||
@@ -136,20 +136,12 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
|
||||
["sqlite3_compileoption_used", "int", "string"],
|
||||
["sqlite3_complete", "int", "string:flexible"],
|
||||
["sqlite3_context_db_handle", "sqlite3*", "sqlite3_context*"],
|
||||
|
||||
/* sqlite3_create_collation() and sqlite3_create_collation_v2()
|
||||
use hand-written bindings to simplify passing of the callback
|
||||
function. */
|
||||
/* sqlite3_create_function(), sqlite3_create_function_v2(), and
|
||||
sqlite3_create_window_function() use hand-written bindings to
|
||||
simplify handling of their function-type arguments. */
|
||||
/* sqlite3_create_collation() and sqlite3_create_collation_v2()
|
||||
use hand-written bindings to simplify passing of the callback
|
||||
function.
|
||||
["sqlite3_create_collation", "int",
|
||||
"sqlite3*", "string", "int",//SQLITE_UTF8 is the only legal value
|
||||
"*", "*"],
|
||||
["sqlite3_create_collation_v2", "int",
|
||||
"sqlite3*", "string", "int",//SQLITE_UTF8 is the only legal value
|
||||
"*", "*", "*"],
|
||||
*/
|
||||
["sqlite3_data_count", "int", "sqlite3_stmt*"],
|
||||
["sqlite3_db_filename", "string", "sqlite3*", "string"],
|
||||
["sqlite3_db_handle", "sqlite3*", "sqlite3_stmt*"],
|
||||
@@ -211,14 +203,6 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
|
||||
for those, depending on how their SQL argument is provided. */
|
||||
/* sqlite3_randomness() uses a hand-written wrapper to extend
|
||||
the range of supported argument types. */
|
||||
["sqlite3_progress_handler", undefined, [
|
||||
"sqlite3*", "int", new wasm.xWrap.FuncPtrAdapter({
|
||||
name: 'xProgressHandler',
|
||||
signature: 'i(p)',
|
||||
bindScope: 'context',
|
||||
contextKey: (argv,argIndex)=>argv[0/* sqlite3* */]
|
||||
}), "*"
|
||||
]],
|
||||
["sqlite3_realloc", "*","*","int"],
|
||||
["sqlite3_reset", "int", "sqlite3_stmt*"],
|
||||
/* sqlite3_reset_auto_extension() has a hand-written binding. */
|
||||
@@ -303,6 +287,19 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
|
||||
["sqlite3_vfs_unregister", "int", "sqlite3_vfs*"]
|
||||
]/*wasm.bindingSignatures*/;
|
||||
|
||||
if( !!wasm.exports.sqlite3_progress_handler ){
|
||||
wasm.bindingSignatures.push(
|
||||
["sqlite3_progress_handler", undefined, [
|
||||
"sqlite3*", "int", new wasm.xWrap.FuncPtrAdapter({
|
||||
name: 'xProgressHandler',
|
||||
signature: 'i(p)',
|
||||
bindScope: 'context',
|
||||
contextKey: (argv,argIndex)=>argv[0/* sqlite3* */]
|
||||
}), "*"
|
||||
]]
|
||||
);
|
||||
}
|
||||
|
||||
if( !!wasm.exports.sqlite3_stmt_explain ){
|
||||
wasm.bindingSignatures.push(
|
||||
["sqlite3_stmt_explain", "int", "sqlite3_stmt*", "int"],
|
||||
@@ -336,7 +333,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
|
||||
}/* sqlite3_set_authorizer() */
|
||||
|
||||
if(false && wasm.compileOptionUsed('SQLITE_ENABLE_NORMALIZE')){
|
||||
/* ^^^ "the problem" is that this is an option feature and the
|
||||
/* ^^^ "the problem" is that this is an optional feature and the
|
||||
build-time function-export list does not currently take
|
||||
optional features into account. */
|
||||
wasm.bindingSignatures.push(["sqlite3_normalized_sql", "string", "sqlite3_stmt*"]);
|
||||
@@ -385,7 +382,6 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
|
||||
of this, the canonical builds of sqlite3.wasm/js guarantee that
|
||||
sqlite3.wasm.alloc() and friends use those allocators. Custom builds
|
||||
may not guarantee that, however. */,
|
||||
["sqlite3_drop_modules", "int", ["sqlite3*", "**"]],
|
||||
["sqlite3_last_insert_rowid", "i64", ["sqlite3*"]],
|
||||
["sqlite3_malloc64", "*","i64"],
|
||||
["sqlite3_msize", "i64", "*"],
|
||||
@@ -422,6 +418,7 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
|
||||
["sqlite3_create_module_v2", "int",
|
||||
["sqlite3*","string","sqlite3_module*","*","*"]],
|
||||
["sqlite3_declare_vtab", "int", ["sqlite3*", "string:flexible"]],
|
||||
["sqlite3_drop_modules", "int", ["sqlite3*", "**"]],
|
||||
["sqlite3_vtab_collation","string","sqlite3_index_info*","int"],
|
||||
["sqlite3_vtab_distinct","int", "sqlite3_index_info*"],
|
||||
["sqlite3_vtab_in","int", "sqlite3_index_info*", "int", "int"],
|
||||
@@ -950,7 +947,8 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
|
||||
|
||||
/** Code duplication reducer for functions which take an encoding
|
||||
argument and require SQLITE_UTF8. Sets the db error code to
|
||||
SQLITE_FORMAT and returns that code. */
|
||||
SQLITE_FORMAT, installs a descriptive error message,
|
||||
and returns SQLITE_FORMAT. */
|
||||
const __errEncoding = (pDb)=>{
|
||||
return util.sqlite3__wasm_db_error(
|
||||
pDb, capi.SQLITE_FORMAT, "SQLITE_UTF8 is the only supported encoding."
|
||||
@@ -1000,11 +998,13 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
|
||||
this._addUDF(pDb, name, arity, m.udf);
|
||||
};
|
||||
|
||||
__dbCleanupMap.addWindowFunc = function(pDb, name, arity){
|
||||
const m = __dbCleanupMap(pDb, 1);
|
||||
if(!m.wudf) m.wudf = new Map;
|
||||
this._addUDF(pDb, name, arity, m.wudf);
|
||||
};
|
||||
if( wasm.exports.sqlite3_create_window_function ){
|
||||
__dbCleanupMap.addWindowFunc = function(pDb, name, arity){
|
||||
const m = __dbCleanupMap(pDb, 1);
|
||||
if(!m.wudf) m.wudf = new Map;
|
||||
this._addUDF(pDb, name, arity, m.wudf);
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
Intended to be called _only_ from sqlite3_close_v2(),
|
||||
@@ -1273,17 +1273,20 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
|
||||
]
|
||||
);
|
||||
|
||||
const __sqlite3CreateWindowFunction = wasm.xWrap(
|
||||
"sqlite3_create_window_function", "int", [
|
||||
"sqlite3*", "string"/*funcName*/, "int"/*nArg*/,
|
||||
"int"/*eTextRep*/, "*"/*pApp*/,
|
||||
new wasm.xWrap.FuncPtrAdapter({name: 'xStep', ...__cfProxy.xInverseAndStep}),
|
||||
new wasm.xWrap.FuncPtrAdapter({name: 'xFinal', ...__cfProxy.xFinalAndValue}),
|
||||
new wasm.xWrap.FuncPtrAdapter({name: 'xValue', ...__cfProxy.xFinalAndValue}),
|
||||
new wasm.xWrap.FuncPtrAdapter({name: 'xInverse', ...__cfProxy.xInverseAndStep}),
|
||||
new wasm.xWrap.FuncPtrAdapter({name: 'xDestroy', ...__cfProxy.xDestroy})
|
||||
]
|
||||
);
|
||||
const __sqlite3CreateWindowFunction =
|
||||
wasm.exports.sqlite3_create_window_function
|
||||
? wasm.xWrap(
|
||||
"sqlite3_create_window_function", "int", [
|
||||
"sqlite3*", "string"/*funcName*/, "int"/*nArg*/,
|
||||
"int"/*eTextRep*/, "*"/*pApp*/,
|
||||
new wasm.xWrap.FuncPtrAdapter({name: 'xStep', ...__cfProxy.xInverseAndStep}),
|
||||
new wasm.xWrap.FuncPtrAdapter({name: 'xFinal', ...__cfProxy.xFinalAndValue}),
|
||||
new wasm.xWrap.FuncPtrAdapter({name: 'xValue', ...__cfProxy.xFinalAndValue}),
|
||||
new wasm.xWrap.FuncPtrAdapter({name: 'xInverse', ...__cfProxy.xInverseAndStep}),
|
||||
new wasm.xWrap.FuncPtrAdapter({name: 'xDestroy', ...__cfProxy.xDestroy})
|
||||
]
|
||||
)
|
||||
: undefined;
|
||||
|
||||
/* Documented in the api object's initializer. */
|
||||
capi.sqlite3_create_function_v2 = function f(
|
||||
@@ -1328,61 +1331,71 @@ globalThis.sqlite3ApiBootstrap.initializers.push(function(sqlite3){
|
||||
};
|
||||
|
||||
/* Documented in the api object's initializer. */
|
||||
capi.sqlite3_create_window_function = function f(
|
||||
pDb, funcName, nArg, eTextRep, pApp,
|
||||
xStep, //void (*xStep)(sqlite3_context*,int,sqlite3_value**)
|
||||
xFinal, //void (*xFinal)(sqlite3_context*)
|
||||
xValue, //void (*xValue)(sqlite3_context*)
|
||||
xInverse,//void (*xInverse)(sqlite3_context*,int,sqlite3_value**)
|
||||
xDestroy //void (*xDestroy)(void*)
|
||||
){
|
||||
if( f.length!==arguments.length ){
|
||||
return __dbArgcMismatch(pDb,"sqlite3_create_window_function",f.length);
|
||||
}else if( 0 === (eTextRep & 0xf) ){
|
||||
eTextRep |= capi.SQLITE_UTF8;
|
||||
}else if( capi.SQLITE_UTF8 !== (eTextRep & 0xf) ){
|
||||
return __errEncoding(pDb);
|
||||
}
|
||||
try{
|
||||
const rc = __sqlite3CreateWindowFunction(pDb, funcName, nArg, eTextRep,
|
||||
pApp, xStep, xFinal, xValue,
|
||||
xInverse, xDestroy);
|
||||
if(0===rc && (xStep instanceof Function
|
||||
|| xFinal instanceof Function
|
||||
|| xValue instanceof Function
|
||||
|| xInverse instanceof Function
|
||||
|| xDestroy instanceof Function)){
|
||||
__dbCleanupMap.addWindowFunc(pDb, funcName, nArg);
|
||||
if( __sqlite3CreateWindowFunction ){
|
||||
capi.sqlite3_create_window_function = function f(
|
||||
pDb, funcName, nArg, eTextRep, pApp,
|
||||
xStep, //void (*xStep)(sqlite3_context*,int,sqlite3_value**)
|
||||
xFinal, //void (*xFinal)(sqlite3_context*)
|
||||
xValue, //void (*xValue)(sqlite3_context*)
|
||||
xInverse,//void (*xInverse)(sqlite3_context*,int,sqlite3_value**)
|
||||
xDestroy //void (*xDestroy)(void*)
|
||||
){
|
||||
if( f.length!==arguments.length ){
|
||||
return __dbArgcMismatch(pDb,"sqlite3_create_window_function",f.length);
|
||||
}else if( 0 === (eTextRep & 0xf) ){
|
||||
eTextRep |= capi.SQLITE_UTF8;
|
||||
}else if( capi.SQLITE_UTF8 !== (eTextRep & 0xf) ){
|
||||
return __errEncoding(pDb);
|
||||
}
|
||||
return rc;
|
||||
}catch(e){
|
||||
console.error("sqlite3_create_window_function() setup threw:",e);
|
||||
return util.sqlite3__wasm_db_error(pDb, e, "Creation of UDF threw: "+e);
|
||||
}
|
||||
};
|
||||
try{
|
||||
const rc = __sqlite3CreateWindowFunction(pDb, funcName, nArg, eTextRep,
|
||||
pApp, xStep, xFinal, xValue,
|
||||
xInverse, xDestroy);
|
||||
if(0===rc && (xStep instanceof Function
|
||||
|| xFinal instanceof Function
|
||||
|| xValue instanceof Function
|
||||
|| xInverse instanceof Function
|
||||
|| xDestroy instanceof Function)){
|
||||
__dbCleanupMap.addWindowFunc(pDb, funcName, nArg);
|
||||
}
|
||||
return rc;
|
||||
}catch(e){
|
||||
console.error("sqlite3_create_window_function() setup threw:",e);
|
||||
return util.sqlite3__wasm_db_error(pDb, e, "Creation of UDF threw: "+e);
|
||||
}
|
||||
};
|
||||
}else{
|
||||
delete capi.sqlite3_create_window_function;
|
||||
}
|
||||
/**
|
||||
A _deprecated_ alias for capi.sqlite3_result_js() which
|
||||
predates the addition of that function in the public API.
|
||||
*/
|
||||
capi.sqlite3_create_function_v2.udfSetResult =
|
||||
capi.sqlite3_create_function.udfSetResult =
|
||||
capi.sqlite3_create_function.udfSetResult = capi.sqlite3_result_js;
|
||||
if(capi.sqlite3_create_window_function){
|
||||
capi.sqlite3_create_window_function.udfSetResult = capi.sqlite3_result_js;
|
||||
}
|
||||
|
||||
/**
|
||||
A _deprecated_ alias for capi.sqlite3_values_to_js() which
|
||||
predates the addition of that function in the public API.
|
||||
*/
|
||||
capi.sqlite3_create_function_v2.udfConvertArgs =
|
||||
capi.sqlite3_create_function.udfConvertArgs =
|
||||
capi.sqlite3_create_function.udfConvertArgs = capi.sqlite3_values_to_js;
|
||||
if(capi.sqlite3_create_window_function){
|
||||
capi.sqlite3_create_window_function.udfConvertArgs = capi.sqlite3_values_to_js;
|
||||
}
|
||||
|
||||
/**
|
||||
A _deprecated_ alias for capi.sqlite3_result_error_js() which
|
||||
predates the addition of that function in the public API.
|
||||
*/
|
||||
capi.sqlite3_create_function_v2.udfSetError =
|
||||
capi.sqlite3_create_function.udfSetError =
|
||||
capi.sqlite3_create_function.udfSetError = capi.sqlite3_result_error_js;
|
||||
if(capi.sqlite3_create_window_function){
|
||||
capi.sqlite3_create_window_function.udfSetError = capi.sqlite3_result_error_js;
|
||||
}
|
||||
|
||||
}/*sqlite3_create_function_v2() and sqlite3_create_window_function() proxies*/;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
+78
-100
@@ -14,16 +14,17 @@
|
||||
*/
|
||||
#define SQLITE_WASM
|
||||
#ifdef SQLITE_WASM_ENABLE_C_TESTS
|
||||
# undef SQLITE_WASM_ENABLE_C_TESTS
|
||||
# define SQLITE_WASM_ENABLE_C_TESTS 1
|
||||
/*
|
||||
** Code blocked off by SQLITE_WASM_TESTS is intended solely for use in
|
||||
** unit/regression testing. They may be safely omitted from
|
||||
** Code blocked off by SQLITE_WASM_ENABLE_C_TESTS is intended solely
|
||||
** for use in unit/regression testing. They may be safely omitted from
|
||||
** client-side builds. The main unit test script, tester1.js, will
|
||||
** skip related tests if it doesn't find the corresponding functions
|
||||
** in the WASM exports.
|
||||
*/
|
||||
# define SQLITE_WASM_TESTS 1
|
||||
#else
|
||||
# define SQLITE_WASM_TESTS 0
|
||||
# define SQLITE_WASM_ENABLE_C_TESTS 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -92,60 +93,18 @@
|
||||
#undef SQLITE_ENABLE_API_ARMOR
|
||||
#define SQLITE_ENABLE_API_ARMOR 1
|
||||
|
||||
#ifndef SQLITE_ENABLE_BYTECODE_VTAB
|
||||
# define SQLITE_ENABLE_BYTECODE_VTAB 1
|
||||
#endif
|
||||
#ifndef SQLITE_ENABLE_DBPAGE_VTAB
|
||||
# define SQLITE_ENABLE_DBPAGE_VTAB 1
|
||||
#endif
|
||||
#ifndef SQLITE_ENABLE_DBSTAT_VTAB
|
||||
# define SQLITE_ENABLE_DBSTAT_VTAB 1
|
||||
#endif
|
||||
#ifndef SQLITE_ENABLE_EXPLAIN_COMMENTS
|
||||
# define SQLITE_ENABLE_EXPLAIN_COMMENTS 1
|
||||
#endif
|
||||
#ifndef SQLITE_ENABLE_FTS5
|
||||
# define SQLITE_ENABLE_FTS5 1
|
||||
#endif
|
||||
#ifndef SQLITE_ENABLE_MATH_FUNCTIONS
|
||||
# define SQLITE_ENABLE_MATH_FUNCTIONS 1
|
||||
#endif
|
||||
#ifndef SQLITE_ENABLE_OFFSET_SQL_FUNC
|
||||
# define SQLITE_ENABLE_OFFSET_SQL_FUNC 1
|
||||
#endif
|
||||
#ifndef SQLITE_ENABLE_PREUPDATE_HOOK
|
||||
# define SQLITE_ENABLE_PREUPDATE_HOOK 1 /*required by session extension*/
|
||||
#endif
|
||||
#ifndef SQLITE_ENABLE_RTREE
|
||||
# define SQLITE_ENABLE_RTREE 1
|
||||
#endif
|
||||
#ifndef SQLITE_ENABLE_SESSION
|
||||
# define SQLITE_ENABLE_SESSION 1
|
||||
#endif
|
||||
#ifndef SQLITE_ENABLE_STMTVTAB
|
||||
# define SQLITE_ENABLE_STMTVTAB 1
|
||||
#endif
|
||||
#ifndef SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
|
||||
# define SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION
|
||||
#endif
|
||||
|
||||
/**********************************************************************/
|
||||
/* SQLITE_O... */
|
||||
#ifndef SQLITE_OMIT_DEPRECATED
|
||||
# define SQLITE_OMIT_DEPRECATED 1
|
||||
#endif
|
||||
#ifndef SQLITE_OMIT_LOAD_EXTENSION
|
||||
# define SQLITE_OMIT_LOAD_EXTENSION 1
|
||||
#endif
|
||||
#ifndef SQLITE_OMIT_SHARED_CACHE
|
||||
# define SQLITE_OMIT_SHARED_CACHE 1
|
||||
#endif
|
||||
#ifndef SQLITE_OMIT_UTF16
|
||||
# define SQLITE_OMIT_UTF16 1
|
||||
#endif
|
||||
#ifndef SQLITE_OS_KV_OPTIONAL
|
||||
# define SQLITE_OS_KV_OPTIONAL 1
|
||||
#endif
|
||||
#undef SQLITE_OMIT_DEPRECATED
|
||||
#define SQLITE_OMIT_DEPRECATED 1
|
||||
#undef SQLITE_OMIT_LOAD_EXTENSION
|
||||
#define SQLITE_OMIT_LOAD_EXTENSION 1
|
||||
#undef SQLITE_OMIT_SHARED_CACHE
|
||||
#define SQLITE_OMIT_SHARED_CACHE 1
|
||||
#undef SQLITE_OMIT_UTF16
|
||||
#define SQLITE_OMIT_UTF16 1
|
||||
#undef SQLITE_OS_KV_OPTIONAL
|
||||
#define SQLITE_OS_KV_OPTIONAL 1
|
||||
|
||||
/**********************************************************************/
|
||||
/* SQLITE_S... */
|
||||
@@ -173,45 +132,64 @@
|
||||
#endif
|
||||
|
||||
/*
|
||||
** If SQLITE_WASM_MINIMAL is defined, undefine most of the ENABLE
|
||||
** If SQLITE_WASM_BARE_BONES is defined, undefine most of the ENABLE
|
||||
** macros.
|
||||
*/
|
||||
#ifdef SQLITE_WASM_MINIMAL
|
||||
# undef SQLITE_ENABLE_DBPAGE_VTAB
|
||||
# undef SQLITE_ENABLE_DBSTAT_VTAB
|
||||
# undef SQLITE_ENABLE_EXPLAIN_COMMENTS
|
||||
# undef SQLITE_ENABLE_FTS5
|
||||
# undef SQLITE_ENABLE_OFFSET_SQL_FUNC
|
||||
# undef SQLITE_ENABLE_PREUPDATE_HOOK
|
||||
# undef SQLITE_ENABLE_RTREE
|
||||
# undef SQLITE_ENABLE_SESSION
|
||||
# undef SQLITE_ENABLE_STMTVTAB
|
||||
# undef SQLITE_OMIT_AUTHORIZATION
|
||||
#ifdef SQLITE_WASM_BARE_BONES
|
||||
# undef SQLITE_ENABLE_DBPAGE_VTAB
|
||||
# undef SQLITE_ENABLE_DBSTAT_VTAB
|
||||
# undef SQLITE_ENABLE_EXPLAIN_COMMENTS
|
||||
# undef SQLITE_ENABLE_FTS5
|
||||
# undef SQLITE_ENABLE_OFFSET_SQL_FUNC
|
||||
# undef SQLITE_ENABLE_PREUPDATE_HOOK
|
||||
# undef SQLITE_ENABLE_RTREE
|
||||
# undef SQLITE_ENABLE_SESSION
|
||||
# undef SQLITE_ENABLE_STMTVTAB
|
||||
# undef SQLITE_OMIT_AUTHORIZATION
|
||||
# define SQLITE_OMIT_AUTHORIZATION
|
||||
/*Reminder re. custom sqlite3.c:
|
||||
# undef SQLITE_OMIT_GET_TABLE
|
||||
# define SQLITE_OMIT_GET_TABLE
|
||||
# undef SQLITE_OMIT_INCRBLOB
|
||||
# define SQLITE_OMIT_INCRBLOB
|
||||
# undef SQLITE_OMIT_INTROSPECTION_PRAGMAS
|
||||
# define SQLITE_OMIT_INTROSPECTION_PRAGMAS
|
||||
# undef SQLITE_OMIT_JSON
|
||||
# define SQLITE_OMIT_JSON
|
||||
# undef SQLITE_OMIT_PROGRESS_CALLBACK
|
||||
# define SQLITE_OMIT_PROGRESS_CALLBACK
|
||||
# undef SQLITE_OMIT_WAL
|
||||
# define SQLITE_OMIT_WAL
|
||||
/*
|
||||
The following OMITs do not work with the standard amalgamation, so
|
||||
require a custom build:
|
||||
|
||||
fossil clean -x
|
||||
./configure
|
||||
OPTS='-DSQLITE_OMIT_VIRTUALTABLE -DSQLITE_OMIT_EXPLAIN -DSQLITE_OMIT_TRIGGER' make -e sqlite3
|
||||
*/
|
||||
/*Requires a custom sqlite3.c
|
||||
# undef SQLITE_OMIT_TRIGGER
|
||||
# define SQLITE_OMIT_TRIGGER
|
||||
*/
|
||||
/*TODO (requires build tweaks)
|
||||
# undef SQLITE_OMIT_WINDOWFUNC
|
||||
# define SQLITE_OMIT_WINDOWFUNC
|
||||
*/
|
||||
/*Requires a custom sqlite3.c
|
||||
OPTS='...' make -e sqlite3
|
||||
|
||||
where ... has a -D... for each of the following OMIT flags:
|
||||
|
||||
# undef SQLITE_OMIT_EXPLAIN
|
||||
# define SQLITE_OMIT_EXPLAIN
|
||||
*/
|
||||
/*Requires a custom sqlite3.c
|
||||
|
||||
# undef SQLITE_OMIT_TRIGGER
|
||||
# define SQLITE_OMIT_TRIGGER
|
||||
|
||||
# undef SQLITE_OMIT_VIRTUALTABLE
|
||||
# define SQLITE_OMIT_VIRTUALTABLE
|
||||
|
||||
# undef SQLITE_OMIT_WINDOWFUNC
|
||||
# define SQLITE_OMIT_WINDOWFUNC
|
||||
|
||||
As of this writing (2024-07-25), such a build fails in various ways
|
||||
for as-yet-unknown reasons.
|
||||
*/
|
||||
# undef SQLITE_OMIT_JSON
|
||||
# define SQLITE_OMIT_JSON
|
||||
#endif
|
||||
|
||||
#if !defined(SQLITE_OMIT_VIRTUALTABLE) && !defined(SQLITE_WASM_BARE_BONES)
|
||||
# define SQLITE_WASM_HAS_VTAB 1
|
||||
#else
|
||||
# define SQLITE_WASM_HAS_VTAB 0
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
@@ -264,10 +242,6 @@
|
||||
#undef INC__STRINGIFY
|
||||
#undef SQLITE_C
|
||||
|
||||
#if defined(__EMSCRIPTEN__)
|
||||
# include <emscripten/console.h>
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
/*
|
||||
** An EXPERIMENT in implementing a stack-based allocator analog to
|
||||
@@ -412,7 +386,7 @@ int sqlite3__wasm_db_error(sqlite3*db, int err_code, const char *zMsg){
|
||||
return err_code;
|
||||
}
|
||||
|
||||
#if SQLITE_WASM_TESTS
|
||||
#if SQLITE_WASM_ENABLE_C_TESTS
|
||||
struct WasmTestStruct {
|
||||
int v4;
|
||||
void * ppV;
|
||||
@@ -432,7 +406,7 @@ void sqlite3__wasm_test_struct(WasmTestStruct * s){
|
||||
}
|
||||
return;
|
||||
}
|
||||
#endif /* SQLITE_WASM_TESTS */
|
||||
#endif /* SQLITE_WASM_ENABLE_C_TESTS */
|
||||
|
||||
/*
|
||||
** This function is NOT part of the sqlite3 public API. It is strictly
|
||||
@@ -967,7 +941,7 @@ const char * sqlite3__wasm_enum_json(void){
|
||||
} _DefGroup;
|
||||
|
||||
DefGroup(vtab) {
|
||||
#if !defined(SQLITE_OMIT_VIRTUALTABLE) && !defined(SQLITE_WASM_MINIMAL)
|
||||
#if SQLITE_WASM_HAS_VTAB
|
||||
DefInt(SQLITE_INDEX_SCAN_UNIQUE);
|
||||
DefInt(SQLITE_INDEX_CONSTRAINT_EQ);
|
||||
DefInt(SQLITE_INDEX_CONSTRAINT_GT);
|
||||
@@ -995,7 +969,7 @@ const char * sqlite3__wasm_enum_json(void){
|
||||
DefInt(SQLITE_FAIL);
|
||||
//DefInt(SQLITE_ABORT); // Also an error code
|
||||
DefInt(SQLITE_REPLACE);
|
||||
#endif /*!SQLITE_OMIT_VIRTUALTABLE*/
|
||||
#endif /*SQLITE_WASM_HAS_VTAB*/
|
||||
} _DefGroup;
|
||||
|
||||
#undef DefGroup
|
||||
@@ -1110,6 +1084,7 @@ const char * sqlite3__wasm_enum_json(void){
|
||||
#undef CurrentStruct
|
||||
|
||||
|
||||
#if SQLITE_WASM_HAS_VTAB
|
||||
#define CurrentStruct sqlite3_vtab
|
||||
StructBinder {
|
||||
M(pModule, "p");
|
||||
@@ -1155,7 +1130,6 @@ const char * sqlite3__wasm_enum_json(void){
|
||||
} _StructBinder;
|
||||
#undef CurrentStruct
|
||||
|
||||
#if !defined(SQLITE_OMIT_VIRTUALTABLE) && !defined(SQLITE_WASM_MINIMAL)
|
||||
/**
|
||||
** Workaround: in order to map the various inner structs from
|
||||
** sqlite3_index_info, we have to uplift those into constructs we
|
||||
@@ -1232,9 +1206,9 @@ const char * sqlite3__wasm_enum_json(void){
|
||||
} _StructBinder;
|
||||
#undef CurrentStruct
|
||||
|
||||
#endif /*!SQLITE_OMIT_VIRTUALTABLE*/
|
||||
#endif /*SQLITE_WASM_HAS_VTAB*/
|
||||
|
||||
#if SQLITE_WASM_TESTS
|
||||
#if SQLITE_WASM_ENABLE_C_TESTS
|
||||
#define CurrentStruct WasmTestStruct
|
||||
StructBinder {
|
||||
M(v4, "i");
|
||||
@@ -1244,7 +1218,7 @@ const char * sqlite3__wasm_enum_json(void){
|
||||
M(xFunc, "v(p)");
|
||||
} _StructBinder;
|
||||
#undef CurrentStruct
|
||||
#endif
|
||||
#endif /*SQLITE_WASM_ENABLE_C_TESTS*/
|
||||
|
||||
} out( "]"/*structs*/);
|
||||
|
||||
@@ -1603,7 +1577,7 @@ sqlite3_kvvfs_methods * sqlite3__wasm_kvvfs_methods(void){
|
||||
return &sqlite3KvvfsMethods;
|
||||
}
|
||||
|
||||
#if !defined(SQLITE_OMIT_VIRTUALTABLE) && !defined(SQLITE_WASM_MINIMAL)
|
||||
#if SQLITE_WASM_HAS_VTAB
|
||||
/*
|
||||
** This function is NOT part of the sqlite3 public API. It is strictly
|
||||
** for use by the sqlite project's own JS/WASM bindings.
|
||||
@@ -1626,7 +1600,7 @@ int sqlite3__wasm_vtab_config(sqlite3 *pDb, int op, int arg){
|
||||
return SQLITE_MISUSE;
|
||||
}
|
||||
}
|
||||
#endif /*!SQLITE_OMIT_VIRTUALTABLE*/
|
||||
#endif /*SQLITE_WASM_HAS_VTAB*/
|
||||
|
||||
/*
|
||||
** This function is NOT part of the sqlite3 public API. It is strictly
|
||||
@@ -1750,6 +1724,7 @@ char * sqlite3__wasm_qfmt_token(char *z, int addQuotes){
|
||||
}
|
||||
|
||||
#if defined(__EMSCRIPTEN__) && defined(SQLITE_ENABLE_WASMFS)
|
||||
#include <emscripten/console.h>
|
||||
#include <emscripten/wasmfs.h>
|
||||
|
||||
/*
|
||||
@@ -1801,7 +1776,7 @@ int sqlite3__wasm_init_wasmfs(const char *zUnused){
|
||||
}
|
||||
#endif /* __EMSCRIPTEN__ && SQLITE_ENABLE_WASMFS */
|
||||
|
||||
#if SQLITE_WASM_TESTS
|
||||
#if SQLITE_WASM_ENABLE_C_TESTS
|
||||
|
||||
SQLITE_WASM_EXPORT
|
||||
int sqlite3__wasm_test_intptr(int * p){
|
||||
@@ -1967,6 +1942,9 @@ int sqlite3__wasm_SQLTester_strglob(const char *zGlob, const char *z){
|
||||
return !sqlite3__wasm_SQLTester_strnotglob(zGlob, z);
|
||||
}
|
||||
|
||||
#endif /* SQLITE_WASM_TESTS */
|
||||
#endif /* SQLITE_WASM_ENABLE_C_TESTS */
|
||||
|
||||
#undef SQLITE_WASM_EXPORT
|
||||
#undef SQLITE_WASM_HAS_VTAB
|
||||
#undef SQLITE_WASM_BARE_BONES
|
||||
#undef SQLITE_WASM_ENABLE_C_TESTS
|
||||
|
||||
+3
-2
@@ -1,7 +1,8 @@
|
||||
/*
|
||||
** 2022-11-12:
|
||||
**
|
||||
** In place of a legal notice, here is a blessing:
|
||||
** 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.
|
||||
@@ -1507,7 +1508,7 @@ int main(int argc, char const * const * argv){
|
||||
}
|
||||
ISFLAG("debug"){
|
||||
++g.doDebug;
|
||||
}else if(!zInfile){
|
||||
}else if(!zInfile && '-'!=argv[i][0]){
|
||||
goto do_infile;
|
||||
}else{
|
||||
fatal("Unhandled flag: %s", argv[i]);
|
||||
|
||||
+26
-53
@@ -7,21 +7,23 @@ MAKEFILE.fiddle := $(lastword $(MAKEFILE_LIST))
|
||||
|
||||
########################################################################
|
||||
# shell.c and its build flags...
|
||||
make-np-0 := make -C $(dir.top) -n -p
|
||||
make-np-1 := sed -e 's/(TOP)/(dir.top)/g'
|
||||
# Extract SHELL_OPT and SHELL_DEP from the top-most makefile and import
|
||||
# them as vars here...
|
||||
$(eval $(shell $(make-np-0) | grep -e '^SHELL_OPT ' | $(make-np-1)))
|
||||
$(eval $(shell $(make-np-0) | grep -e '^SHELL_DEP ' | $(make-np-1)))
|
||||
# ^^^ can't do that in 1 invocation b/c newlines get stripped
|
||||
ifeq (,$(SHELL_OPT))
|
||||
$(error Could not parse SHELL_OPT from $(dir.top)/Makefile.)
|
||||
endif
|
||||
ifeq (,$(SHELL_DEP))
|
||||
$(error Could not parse SHELL_DEP from $(dir.top)/Makefile.)
|
||||
endif
|
||||
$(dir.top)/shell.c: $(SHELL_DEP) $(dir.top)/tool/mkshellc.tcl $(sqlite3.c)
|
||||
ifneq (1,$(MAKING_CLEAN))
|
||||
make-np-0 := make -C $(dir.top) -n -p
|
||||
make-np-1 := sed -e 's/(TOP)/(dir.top)/g'
|
||||
# Extract SHELL_OPT and SHELL_DEP from the top-most makefile and import
|
||||
# them as vars here...
|
||||
$(eval $(shell $(make-np-0) | grep -e '^SHELL_OPT ' | $(make-np-1)))
|
||||
$(eval $(shell $(make-np-0) | grep -e '^SHELL_DEP ' | $(make-np-1)))
|
||||
# ^^^ can't do that in 1 invocation b/c newlines get stripped
|
||||
ifeq (,$(SHELL_OPT))
|
||||
$(error Could not parse SHELL_OPT from $(dir.top)/Makefile.)
|
||||
endif
|
||||
ifeq (,$(SHELL_DEP))
|
||||
$(error Could not parse SHELL_DEP from $(dir.top)/Makefile.)
|
||||
endif
|
||||
$(dir.top)/shell.c: $(SHELL_DEP) $(dir.tool)/mkshellc.tcl $(sqlite3.c)
|
||||
$(MAKE) -C $(dir.top) shell.c
|
||||
endif
|
||||
# /shell.c
|
||||
########################################################################
|
||||
|
||||
@@ -41,10 +43,11 @@ fiddle.emcc-flags = \
|
||||
$(emcc.exportedRuntimeMethods) \
|
||||
-sEXPORTED_FUNCTIONS=@$(abspath $(EXPORTED_FUNCTIONS.fiddle)) \
|
||||
-sEXPORTED_RUNTIME_METHODS=FS,wasmMemory \
|
||||
$(SQLITE_OPT) $(SHELL_OPT) \
|
||||
-USQLITE_WASM_MINIMAL \
|
||||
$(SQLITE_OPT.full-featured) \
|
||||
$(SQLITE_OPT.common) \
|
||||
$(SHELL_OPT) \
|
||||
-USQLITE_WASM_BARE_BONES \
|
||||
-DSQLITE_SHELL_FIDDLE
|
||||
# -D_POSIX_C_SOURCE is needed for strdup() with emcc
|
||||
|
||||
# Flags specifically for debug builds of fiddle. Performance suffers
|
||||
# greatly in debug builds.
|
||||
@@ -55,52 +58,22 @@ fiddle.emcc-flags.debug := $(fiddle.emcc-flags) \
|
||||
|
||||
fiddle.EXPORTED_FUNCTIONS.in := \
|
||||
EXPORTED_FUNCTIONS.fiddle.in \
|
||||
$(EXPORTED_FUNCTIONS.api)
|
||||
$(dir.api)/EXPORTED_FUNCTIONS.sqlite3-core \
|
||||
$(dir.api)/EXPORTED_FUNCTIONS.sqlite3-extras
|
||||
|
||||
$(EXPORTED_FUNCTIONS.fiddle): $(fiddle.EXPORTED_FUNCTIONS.in) $(MAKEFILE.fiddle)
|
||||
$(EXPORTED_FUNCTIONS.fiddle): $(MKDIR.bld) $(fiddle.EXPORTED_FUNCTIONS.in) \
|
||||
$(MAKEFILE.fiddle)
|
||||
sort -u $(fiddle.EXPORTED_FUNCTIONS.in) > $@
|
||||
|
||||
fiddle.cses := $(dir.top)/shell.c $(sqlite3-wasm.c)
|
||||
$(eval $(call call-make-pre-post,fiddle-module,vanilla))
|
||||
|
||||
########################################################################
|
||||
# emit rules for one of the two fiddle builds. $1 must be
|
||||
# either $(dir.fiddle) or $(dir.fiddle-debug). $2 must be empty
|
||||
# in the former case and .debug in the latter.
|
||||
define make-fiddle-rules
|
||||
fiddle-module.js$(2) := $(1)/fiddle-module.js
|
||||
fiddle-module.wasm$(2) := $$(subst .js,.wasm,$$(fiddle-module.js$(2)))
|
||||
$$(fiddle-module.js$(2)): $$(MAKEFILE) $$(MAKEFILE.fiddle) \
|
||||
$$(EXPORTED_FUNCTIONS.fiddle) \
|
||||
$$(fiddle.cses) $$(pre-post-fiddle-module-vanilla.deps) $$(SOAP.js)
|
||||
@test -d "$$(dir $$@)" || mkdir -p "$$(dir $$@)"
|
||||
$$(emcc.bin) -o $$@ $$(fiddle.emcc-flags$(2)) \
|
||||
$$(pre-post-fiddle-module-vanilla.flags) \
|
||||
$$(fiddle.cses)
|
||||
$$(maybe-wasm-strip) $$(fiddle-module.wasm$(2))
|
||||
@cp -p $$(SOAP.js) $$(dir $$@)
|
||||
@if [[ x.debug = x$(2) ]]; then \
|
||||
cp -p $$(dir.fiddle)/index.html \
|
||||
$$(dir.fiddle)/fiddle.js \
|
||||
$$(dir.fiddle)/fiddle-worker.js \
|
||||
$$(dir $$@)/.; \
|
||||
fi
|
||||
@for i in $(1)/*.*js $(1)/*.html $(1)/*.wasm; do \
|
||||
test -f $$$${i} || continue; \
|
||||
gzip < $$$${i} > $$$${i}.gz; \
|
||||
done
|
||||
fiddle$(2): $$(fiddle-module.js$(2)) $(1)/fiddle.js.gz
|
||||
endef
|
||||
|
||||
$(eval $(call make-fiddle-rules,$(dir.fiddle)))
|
||||
$(eval $(call make-fiddle-rules,$(dir.fiddle-debug),.debug))
|
||||
fiddle: $(fiddle-module.js) $(fiddle-module.js.debug)
|
||||
fiddle.debug: $(fiddle-module.js.debug)
|
||||
|
||||
clean: clean-fiddle
|
||||
clean-fiddle:
|
||||
rm -f $(fiddle-module.js) \
|
||||
$(fiddle-module.wasm) \
|
||||
rm -f $(dir.fiddle)/fiddle-module.js \
|
||||
$(dir.fiddle)/*.wasm \
|
||||
$(dir.fiddle)/sqlite3-opfs-*.js \
|
||||
$(dir.fiddle)/*.gz \
|
||||
EXPORTED_FUNCTIONS.fiddle
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
two lines and ensure that these files are on the web server. -->
|
||||
<!--script src="jqterm/jqterm-bundle.min.js"></script>
|
||||
<link rel="stylesheet" href="jqterm/jquery.terminal.min.css"/-->
|
||||
<link rel="stylesheet" href="emscripten.css"/>
|
||||
<style>
|
||||
/* The following styles are for app-level use. */
|
||||
:root {
|
||||
|
||||
+3
-3
@@ -125,10 +125,10 @@
|
||||
the WASMFS build is available on this server (it is not by
|
||||
default) and that this server emits the COOP/COEP headers.
|
||||
<ul>
|
||||
<li><a href='scratchpad-wasmfs.html'>scratchpad-wasmfs</a>:
|
||||
<!--li><a href='scratchpad-wasmfs.html'>scratchpad-wasmfs</a>:
|
||||
experimenting with WASMFS/OPFS-based persistence.
|
||||
</li>
|
||||
<li><a href='speedtest1-wasmfs.html?flags=--size,15'>speedtest1-wasmfs</a>:
|
||||
</li-->
|
||||
<li><a href='speedtest1-wasmfs.html?flags=--size,10'>speedtest1-wasmfs</a>:
|
||||
a variant of speedtest1 built solely for the wasmfs/opfs
|
||||
feature.
|
||||
</li>
|
||||
|
||||
@@ -0,0 +1,284 @@
|
||||
/*
|
||||
** 2024-09-23
|
||||
**
|
||||
** 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 app's single purpose is to emit parts of the Makefile code for
|
||||
** building sqlite3's WASM build. The main motivation is to generate
|
||||
** code which "can" be created via GNU Make's eval command but is
|
||||
** highly illegible when constructed that way. Attempts to write this
|
||||
** app in Bash and TCL have suffered from the problem that both
|
||||
** require escaping $ symbols, making the resulting script code as
|
||||
** illegible as the eval spaghetti we want to get away from. Writing
|
||||
** it in C is, somewhat surprisingly, _slightly_ less illegible than
|
||||
** writing it in bash, tcl, or native Make code.
|
||||
**
|
||||
** The emitted makefile code is not standalone - it depends on
|
||||
** variables and $(call)able functions from the main makefile.
|
||||
**
|
||||
*/
|
||||
|
||||
#undef NDEBUG
|
||||
#define DEBUG 1
|
||||
#include <assert.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#define pf printf
|
||||
#define ps puts
|
||||
/* Very common printf() args combo. */
|
||||
#define zNM zName, zMode
|
||||
|
||||
/*
|
||||
** Valid names for the zName arguments.
|
||||
*/
|
||||
#define JS_BUILD_NAMES sqlite3 sqlite3-wasmfs
|
||||
/*
|
||||
** Valid names for the zMode arguments of the "sqlite3" build. For the
|
||||
** "sqlite3-wasmfs" build, only "esm" (ES6 Module) is legal.
|
||||
*/
|
||||
#define JS_BUILD_MODES vanilla esm bundler-friendly node
|
||||
static const char * zBanner =
|
||||
"\n########################################################################\n";
|
||||
|
||||
/*
|
||||
** Emits common vars needed by the rest of the emitted code (but not
|
||||
** needed by makefile code outside of these generated pieces).
|
||||
*/
|
||||
static void mk_prologue(void){
|
||||
pf("%s", zBanner);
|
||||
ps("# extern-post-js* and extern-pre-js* are files for use with");
|
||||
ps("# Emscripten's --extern-pre-js and --extern-post-js flags.");
|
||||
ps("extern-pre-js.js := $(dir.api)/extern-pre-js.js");
|
||||
ps("extern-post-js.js.in := $(dir.api)/extern-post-js.c-pp.js");
|
||||
ps("# Emscripten flags for --[extern-][pre|post]-js=... for the");
|
||||
ps("# various builds.");
|
||||
ps("pre-post-common.flags := --extern-pre-js=$(sqlite3-license-version.js)");
|
||||
ps("# pre-post-jses.deps.* = a list of dependencies for the");
|
||||
ps("# --[extern-][pre/post]-js files.");
|
||||
ps("pre-post-jses.deps.common := $(extern-pre-js.js) $(sqlite3-license-version.js)");
|
||||
}
|
||||
|
||||
/*
|
||||
** Emits makefile code for setting up values for the --pre-js=FILE,
|
||||
** --post-js=FILE, and --extern-post-js=FILE emcc flags, as well as
|
||||
** populating those files.
|
||||
*/
|
||||
static void mk_pre_post(const char *zName /* build name */,
|
||||
const char *zMode /* build mode */,
|
||||
const char *zCmppD /* optional -D flags for c-pp for the
|
||||
** --pre/--post-js files. */){
|
||||
pf("%s# Begin --pre/--post flags for %s-%s\n", zBanner, zName, zMode);
|
||||
pf("c-pp.D.%s-%s := %s\n", zNM, zCmppD ? zCmppD : "");
|
||||
pf("pre-post-%s-%s.flags ?=\n", zNM);
|
||||
|
||||
/* --pre-js=... */
|
||||
pf("pre-js.js.%s-%s := $(dir.tmp)/pre-js.%s-%s.js\n",
|
||||
zNM, zNM);
|
||||
pf("$(pre-js.js.%s-%s): $(MAKEFILE)\n", zNM);
|
||||
#if 1
|
||||
pf("$(eval $(call C-PP.FILTER,$(pre-js.js.in),$(pre-js.js.%s-%s),"
|
||||
"$(c-pp.D.%s-%s)))\n", zNM, zNM);
|
||||
#else
|
||||
/* This part is needed if/when we re-enable the custom
|
||||
** Module.instantiateModule() impl in api/pre-js.c-pp.js. */
|
||||
pf("pre-js.js.%s-%s.intermediary := $(dir.tmp)/pre-js.%s-%s.intermediary.js\n",
|
||||
zNM, zNM);
|
||||
pf("$(eval $(call C-PP.FILTER,$(pre-js.js.in),$(pre-js.js.%s-%s.intermediary),"
|
||||
"$(c-pp.D.%s-%s) -Dcustom-Module.instantiateModule))\n", zNM, zNM);
|
||||
pf("$(pre-js.js.%s-%s): $(pre-js.js.%s-%s.intermediary)\n", zNM, zNM);
|
||||
pf("\tcp $(pre-js.js.%s-%s.intermediary) $@\n", zNM);
|
||||
|
||||
/* Amend $(pre-js.js.zName-zMode) for all targets except the plain
|
||||
** "sqlite3" build... */
|
||||
if( 0!=strcmp("sqlite3-wasmfs", zName)
|
||||
&& 0!=strcmp("sqlite3", zName) ){
|
||||
pf("\t@echo 'Module[xNameOfInstantiateWasm].uri = "
|
||||
"\"%s.wasm\";' >> $@\n", zName);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* --post-js=... */
|
||||
pf("post-js.js.%s-%s := $(dir.tmp)/post-js.%s-%s.js\n", zNM, zNM);
|
||||
pf("$(eval $(call C-PP.FILTER,$(post-js.js.in),"
|
||||
"$(post-js.js.%s-%s),$(c-pp.D.%s-%s)))\n", zNM, zNM);
|
||||
|
||||
/* --extern-post-js=... */
|
||||
pf("extern-post-js.js.%s-%s := $(dir.tmp)/extern-post-js.%s-%s.js\n", zNM, zNM);
|
||||
pf("$(eval $(call C-PP.FILTER,$(extern-post-js.js.in),$(extern-post-js.js.%s-%s),"
|
||||
"$(c-pp.D.%s-%s)))\n", zNM, zNM);
|
||||
|
||||
/* Combine flags for use with emcc... */
|
||||
pf("pre-post-common.flags.%s-%s := "
|
||||
"$(pre-post-common.flags) "
|
||||
"--post-js=$(post-js.js.%s-%s) "
|
||||
"--extern-post-js=$(extern-post-js.js.%s-%s)\n", zNM, zNM, zNM);
|
||||
|
||||
pf("pre-post-%s-%s.flags += $(pre-post-common.flags.%s-%s) "
|
||||
"--pre-js=$(pre-js.js.%s-%s)\n", zNM, zNM, zNM);
|
||||
|
||||
/* Set up deps... */
|
||||
pf("pre-post-jses.%s-%s.deps := $(pre-post-jses.deps.common) "
|
||||
"$(post-js.js.%s-%s) $(extern-post-js.js.%s-%s)\n",
|
||||
zNM, zNM, zNM);
|
||||
pf("pre-post-%s-%s.deps := $(pre-post-jses.%s-%s.deps) $(dir.tmp)/pre-js.%s-%s.js\n",
|
||||
zNM, zNM, zNM);
|
||||
pf("# End --pre/--post flags for %s-%s%s", zName, zMode, zBanner);
|
||||
}
|
||||
|
||||
/*
|
||||
** Emits rules for the fiddle builds.
|
||||
**
|
||||
*/
|
||||
static void mk_fiddle(){
|
||||
int i = 0;
|
||||
|
||||
mk_pre_post("fiddle-module","vanilla", 0);
|
||||
for( ; i < 2; ++i ){
|
||||
const char *zTail = i ? ".debug" : "";
|
||||
const char *zDir = i ? "$(dir.fiddle-debug)" : "$(dir.fiddle)";
|
||||
|
||||
pf("%s# Begin fiddle%s\n", zBanner, zTail);
|
||||
pf("fiddle-module.js%s := %s/fiddle-module.js\n", zTail, zDir);
|
||||
pf("fiddle-module.wasm%s := "
|
||||
"$(subst .js,.wasm,$(fiddle-module.js%s))\n", zTail, zTail);
|
||||
pf("$(fiddle-module.js%s):%s $(MAKEFILE) $(MAKEFILE.fiddle) "
|
||||
"$(EXPORTED_FUNCTIONS.fiddle) "
|
||||
"$(fiddle.cses) $(pre-post-fiddle-module-vanilla.deps) "
|
||||
"$(SOAP.js)\n",
|
||||
zTail, (i ? " $(fiddle-module.js)" : ""));
|
||||
if( 1==i ){/*fiddle.debug*/
|
||||
pf(" @test -d \"$(dir $@)\" || mkdir -p \"$(dir $@)\"\n");
|
||||
}
|
||||
pf(" $(emcc.bin) -o $@ $(fiddle.emcc-flags%s) "
|
||||
"$(pre-post-fiddle-module-vanilla.flags) $(fiddle.cses)\n",
|
||||
zTail);
|
||||
pf(" $(maybe-wasm-strip) $(fiddle-module.wasm%s)\n", zTail);
|
||||
pf(" @cp -p $(SOAP.js) $(dir $@)\n");
|
||||
if( 1==i ){/*fiddle.debug*/
|
||||
pf(" cp -p $(dir.fiddle)/index.html "
|
||||
"$(dir.fiddle)/fiddle.js "
|
||||
"$(dir.fiddle)/fiddle-worker.js "
|
||||
"$(dir $@)\n");
|
||||
}
|
||||
pf(" @for i in %s/*.*js %s/*.html %s/*.wasm; do \\\n"
|
||||
" test -f $${i} || continue; \\\n"
|
||||
" gzip < $${i} > $${i}.gz; \\\n"
|
||||
" done\n", zDir, zDir, zDir);
|
||||
if( 0==i ){
|
||||
ps("fiddle: $(fiddle-module.js)");
|
||||
}else{
|
||||
ps("fiddle-debug: $(fiddle-module-debug.js)");
|
||||
}
|
||||
pf("# End fiddle%s%s", zTail, zBanner);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** Emits makefile code for one build of the library, primarily defined
|
||||
** by the combination of zName and zMode, each of which must be values
|
||||
** from JS_BUILD_NAMES resp. JS_BUILD_MODES.
|
||||
*/
|
||||
static void mk_lib_mode(const char *zName /* build name */,
|
||||
const char *zMode /* build mode */,
|
||||
int bIsEsm /* true only for ESM build */,
|
||||
const char *zApiJsOut /* name of generated sqlite3-api.js/.mjs */,
|
||||
const char *zJsOut /* name of generated sqlite3.js/.mjs */,
|
||||
const char *zCmppD /* extra -D flags for c-pp */,
|
||||
const char *zEmcc /* extra flags for emcc */){
|
||||
assert( zName );
|
||||
assert( zMode );
|
||||
assert( zApiJsOut );
|
||||
assert( zJsOut );
|
||||
if( !zCmppD ) zCmppD = "";
|
||||
if( !zEmcc ) zEmcc = "";
|
||||
|
||||
pf("%s# Begin build [%s-%s]\n", zBanner, zNM);
|
||||
pf("ifneq (1,$(MAKING_CLEAN))\n");
|
||||
pf("$(info Setting up build [%s-%s]: %s)\n", zNM, zJsOut);
|
||||
mk_pre_post(zNM, zCmppD);
|
||||
pf("\nemcc.flags.%s.%s ?=\n", zNM);
|
||||
if( zEmcc[0] ){
|
||||
pf("emcc.flags.%s.%s += %s\n", zNM, zEmcc);
|
||||
}
|
||||
pf("$(eval $(call C-PP.FILTER, $(sqlite3-api.js.in), %s, %s))\n",
|
||||
zApiJsOut, zCmppD);
|
||||
|
||||
/* target zJsOut */
|
||||
pf("%s: %s $(MAKEFILE) $(sqlite3-wasm.cfiles) $(EXPORTED_FUNCTIONS.api) "
|
||||
"$(pre-post-%s-%s.deps)\n",
|
||||
zJsOut, zApiJsOut, zNM);
|
||||
pf("\t@echo \"Building $@ ...\"\n");
|
||||
pf("\t$(emcc.bin) -o $@ $(emcc_opt_full) $(emcc.flags) \\\n");
|
||||
pf("\t\t$(emcc.jsflags) -sENVIRONMENT=$(emcc.environment.%s) \\\n", zMode);
|
||||
pf("\t\t$(pre-post-%s-%s.flags) \\\n", zNM);
|
||||
pf("\t\t$(emcc.flags.%s) $(emcc.flags.%s.%s) \\\n", zName, zNM);
|
||||
pf("\t\t$(cflags.common) $(SQLITE_OPT) \\\n"
|
||||
"\t\t$(cflags.%s) $(cflags.%s.%s) \\\n"
|
||||
"\t\t$(cflags.wasm_extra_init) $(sqlite3-wasm.cfiles)\n", zName, zNM);
|
||||
if( bIsEsm ){
|
||||
/* TODO? Replace this CALL with the corresponding makefile code.
|
||||
** OTOH, we also use this $(call) in the speedtest1-wasmfs build,
|
||||
** which is not part of the rules emitted by this program. */
|
||||
pf("\t@$(call SQLITE3.xJS.ESM-EXPORT-DEFAULT,1,%d)\n",
|
||||
0==strcmp("sqlite3-wasmfs", zName) ? 1 : 0);
|
||||
}
|
||||
pf("\t@dotwasm=$(basename $@).wasm; \\\n"
|
||||
"\tchmod -x $$dotwasm; \\\n"
|
||||
"\t$(maybe-wasm-strip) $$dotwasm; \\\n");
|
||||
/*
|
||||
** The above $(emcc.bin) call will write zJsOut and will create a
|
||||
** like-named .wasm file. That .wasm file name gets hard-coded into
|
||||
** zJsOut so we need to, for some cases, patch zJsOut to use the
|
||||
** name sqlite3.wasm instead. Note that the resulting .wasm file is
|
||||
** identical for all builds for which zEmcc is empty.
|
||||
*/
|
||||
if( 0==strcmp("bundler-friendly", zMode)
|
||||
|| 0==strcmp("node", zMode) ) {
|
||||
pf("\techo 'Patching $@ for %s.wasm...' \\\n", zName);
|
||||
pf("\trm -f $$dotwasm; dotwasm=; \\\n"
|
||||
"\tsed -i -e 's/%s-%s.wasm/%s.wasm/g' $@ || exit $$?; \\\n",
|
||||
zNM, zName);
|
||||
}
|
||||
pf("\tls -la $$dotwasm $@\n");
|
||||
if( 0!=strcmp("sqlite3-wasmfs", zName) ){
|
||||
/* The sqlite3-wasmfs build is optional and needs to be invoked
|
||||
** conditionally using info we don't have here. */
|
||||
pf("all: %s\n", zJsOut);
|
||||
}
|
||||
ps("endif\n# ^^^ !$(MAKING_CLEAN)");
|
||||
pf("# End build [%s-%s]%s", zNM, zBanner);
|
||||
}
|
||||
|
||||
int main(void){
|
||||
int rc = 0;
|
||||
pf("# What follows was GENERATED by %s. Edit at your own risk.\n", __FILE__);
|
||||
mk_prologue();
|
||||
mk_lib_mode("sqlite3", "vanilla", 0,
|
||||
"$(sqlite3-api.js)", "$(sqlite3.js)", 0, 0);
|
||||
mk_lib_mode("sqlite3", "esm", 1,
|
||||
"$(sqlite3-api.mjs)", "$(sqlite3.mjs)",
|
||||
"-Dtarget=es6-module", 0);
|
||||
mk_lib_mode("sqlite3", "bundler-friendly", 1,
|
||||
"$(sqlite3-api-bundler-friendly.mjs)", "$(sqlite3-bundler-friendly.mjs)",
|
||||
"$(c-pp.D.sqlite3-esm) -Dtarget=es6-bundler-friendly", 0);
|
||||
mk_lib_mode("sqlite3" , "node", 1,
|
||||
"$(sqlite3-api-node.mjs)", "$(sqlite3-node.mjs)",
|
||||
"$(c-pp.D.sqlite3-bundler-friendly) -Dtarget=node", 0);
|
||||
mk_lib_mode("sqlite3-wasmfs", "esm" ,1,
|
||||
"$(sqlite3-api-wasmfs.mjs)", "$(sqlite3-wasmfs.mjs)",
|
||||
"$(c-pp.D.sqlite3-bundler-friendly) -Dwasmfs",
|
||||
"-sEXPORT_ES6 -sUSE_ES6_IMPORT_META");
|
||||
|
||||
mk_fiddle();
|
||||
mk_pre_post("speedtest1","vanilla", 0);
|
||||
mk_pre_post("speedtest1-wasmfs","esm", "$(c-pp.D.sqlite3-bundler-friendly) -Dwasmfs");
|
||||
return rc;
|
||||
}
|
||||
@@ -10,14 +10,14 @@ wMsg('log',"speedtest1-wasmfs starting...");
|
||||
*/
|
||||
const wasmfsDir = function f(wasmUtil,dirName="/opfs"){
|
||||
if(undefined !== f._) return f._;
|
||||
if( !self.FileSystemHandle
|
||||
|| !self.FileSystemDirectoryHandle
|
||||
|| !self.FileSystemFileHandle){
|
||||
if( !globalThis.FileSystemHandle
|
||||
|| !globalThis.FileSystemDirectoryHandle
|
||||
|| !globalThis.FileSystemFileHandle){
|
||||
return f._ = "";
|
||||
}
|
||||
try{
|
||||
if(0===wasmUtil.xCallWrapped(
|
||||
'sqlite3_wasm_init_wasmfs', 'i32', ['string'], dirName
|
||||
'sqlite3__wasm_init_wasmfs', 'i32', ['string'], dirName
|
||||
)){
|
||||
return f._ = dirName;
|
||||
}else{
|
||||
@@ -36,7 +36,7 @@ const logErr = (...args)=>wMsg('logErr',...args);
|
||||
const runTests = function(sqlite3){
|
||||
console.log("Module inited.",sqlite3);
|
||||
const wasm = sqlite3.wasm;
|
||||
const __unlink = wasm.xWrap("sqlite3_wasm_vfs_unlink", "int", ["*","string"]);
|
||||
const __unlink = wasm.xWrap("sqlite3__wasm_vfs_unlink", "int", ["*","string"]);
|
||||
const unlink = (fn)=>__unlink(0,fn);
|
||||
const pDir = wasmfsDir(wasm);
|
||||
if(pDir) log("Persistent storage:",pDir);
|
||||
@@ -46,7 +46,7 @@ const runTests = function(sqlite3){
|
||||
}
|
||||
const scope = wasm.scopedAllocPush();
|
||||
const dbFile = pDir+"/speedtest1.db";
|
||||
const urlParams = new URL(self.location.href).searchParams;
|
||||
const urlParams = new URL(globalThis.location.href).searchParams;
|
||||
const argv = ["speedtest1"];
|
||||
if(urlParams.has('flags')){
|
||||
argv.push(...(urlParams.get('flags').split(',')));
|
||||
|
||||
+302
-245
@@ -848,171 +848,176 @@ globalThis.sqlite3InitModule = sqlite3InitModule;
|
||||
}/*WhWasmUtil*/)
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
.t('sqlite3.StructBinder (jaccwabyt🐇)', function(sqlite3){
|
||||
const S = sqlite3, W = S.wasm;
|
||||
const MyStructDef = {
|
||||
sizeof: 16,
|
||||
members: {
|
||||
p4: {offset: 0, sizeof: 4, signature: "i"},
|
||||
pP: {offset: 4, sizeof: 4, signature: "P"},
|
||||
ro: {offset: 8, sizeof: 4, signature: "i", readOnly: true},
|
||||
cstr: {offset: 12, sizeof: 4, signature: "s"}
|
||||
}
|
||||
};
|
||||
if(W.bigIntEnabled){
|
||||
const m = MyStructDef;
|
||||
m.members.p8 = {offset: m.sizeof, sizeof: 8, signature: "j"};
|
||||
m.sizeof += m.members.p8.sizeof;
|
||||
}
|
||||
const StructType = S.StructBinder.StructType;
|
||||
const K = S.StructBinder('my_struct',MyStructDef);
|
||||
T.mustThrowMatching(()=>K(), /via 'new'/).
|
||||
mustThrowMatching(()=>new K('hi'), /^Invalid pointer/);
|
||||
const k1 = new K(), k2 = new K();
|
||||
try {
|
||||
T.assert(k1.constructor === K).
|
||||
assert(K.isA(k1)).
|
||||
assert(k1 instanceof K).
|
||||
assert(K.prototype.lookupMember('p4').key === '$p4').
|
||||
assert(K.prototype.lookupMember('$p4').name === 'p4').
|
||||
mustThrowMatching(()=>K.prototype.lookupMember('nope'), /not a mapped/).
|
||||
assert(undefined === K.prototype.lookupMember('nope',false)).
|
||||
assert(k1 instanceof StructType).
|
||||
assert(StructType.isA(k1)).
|
||||
mustThrowMatching(()=>k1.$ro = 1, /read-only/);
|
||||
Object.keys(MyStructDef.members).forEach(function(key){
|
||||
key = K.memberKey(key);
|
||||
T.assert(0 == k1[key],
|
||||
"Expecting allocation to zero the memory "+
|
||||
"for "+key+" but got: "+k1[key]+
|
||||
" from "+k1.memoryDump());
|
||||
});
|
||||
T.assert('number' === typeof k1.pointer).
|
||||
mustThrowMatching(()=>k1.pointer = 1, /pointer/);
|
||||
k1.$p4 = 1; k1.$pP = 2;
|
||||
T.assert(1 === k1.$p4).assert(2 === k1.$pP);
|
||||
if(MyStructDef.members.$p8){
|
||||
k1.$p8 = 1/*must not throw despite not being a BigInt*/;
|
||||
k1.$p8 = BigInt(Number.MAX_SAFE_INTEGER * 2);
|
||||
T.assert(BigInt(2 * Number.MAX_SAFE_INTEGER) === k1.$p8);
|
||||
}
|
||||
T.assert(!k1.ondispose);
|
||||
k1.setMemberCString('cstr', "A C-string.");
|
||||
T.assert(Array.isArray(k1.ondispose)).
|
||||
assert(k1.ondispose[0] === k1.$cstr).
|
||||
assert('number' === typeof k1.$cstr).
|
||||
assert('A C-string.' === k1.memberToJsString('cstr'));
|
||||
k1.$pP = k2;
|
||||
T.assert(k1.$pP === k2.pointer);
|
||||
k1.$pP = null/*null is special-cased to 0.*/;
|
||||
T.assert(0===k1.$pP);
|
||||
let ptr = k1.pointer;
|
||||
k1.dispose();
|
||||
T.assert(undefined === k1.pointer).
|
||||
mustThrowMatching(()=>{k1.$pP=1}, /disposed instance/);
|
||||
}finally{
|
||||
k1.dispose();
|
||||
k2.dispose();
|
||||
}
|
||||
|
||||
if(!W.bigIntEnabled){
|
||||
log("Skipping WasmTestStruct tests: BigInt not enabled.");
|
||||
return;
|
||||
}
|
||||
|
||||
const WTStructDesc =
|
||||
W.ctype.structs.filter((e)=>'WasmTestStruct'===e.name)[0];
|
||||
const autoResolvePtr = true /* EXPERIMENTAL */;
|
||||
if(autoResolvePtr){
|
||||
WTStructDesc.members.ppV.signature = 'P';
|
||||
}
|
||||
const WTStruct = S.StructBinder(WTStructDesc);
|
||||
//log(WTStruct.structName, WTStruct.structInfo);
|
||||
const wts = new WTStruct();
|
||||
//log("WTStruct.prototype keys:",Object.keys(WTStruct.prototype));
|
||||
try{
|
||||
T.assert(wts.constructor === WTStruct).
|
||||
assert(WTStruct.memberKeys().indexOf('$ppV')>=0).
|
||||
assert(wts.memberKeys().indexOf('$v8')>=0).
|
||||
assert(!K.isA(wts)).
|
||||
assert(WTStruct.isA(wts)).
|
||||
assert(wts instanceof WTStruct).
|
||||
assert(wts instanceof StructType).
|
||||
assert(StructType.isA(wts)).
|
||||
assert(wts.pointer>0).assert(0===wts.$v4).assert(0n===wts.$v8).
|
||||
assert(0===wts.$ppV).assert(0===wts.$xFunc);
|
||||
const testFunc =
|
||||
W.xGet('sqlite3__wasm_test_struct'/*name gets mangled in -O3 builds!*/);
|
||||
let counter = 0;
|
||||
//log("wts.pointer =",wts.pointer);
|
||||
const wtsFunc = function(arg){
|
||||
/*log("This from a JS function called from C, "+
|
||||
"which itself was called from JS. arg =",arg);*/
|
||||
++counter;
|
||||
if(3===counter){
|
||||
tossQuietly("Testing exception propagation.");
|
||||
.t({
|
||||
name: 'sqlite3.StructBinder (jaccwabyt🐇)',
|
||||
predicate: (sqlite3)=>!!sqlite3.wasm.exports.sqlite3__wasm_test_struct
|
||||
|| "Built without SQLITE_WASM_ENABLE_C_TESTS",
|
||||
test: function(sqlite3){
|
||||
const S = sqlite3, W = S.wasm;
|
||||
const MyStructDef = {
|
||||
sizeof: 16,
|
||||
members: {
|
||||
p4: {offset: 0, sizeof: 4, signature: "i"},
|
||||
pP: {offset: 4, sizeof: 4, signature: "P"},
|
||||
ro: {offset: 8, sizeof: 4, signature: "i", readOnly: true},
|
||||
cstr: {offset: 12, sizeof: 4, signature: "s"}
|
||||
}
|
||||
};
|
||||
if(W.bigIntEnabled){
|
||||
const m = MyStructDef;
|
||||
m.members.p8 = {offset: m.sizeof, sizeof: 8, signature: "j"};
|
||||
m.sizeof += m.members.p8.sizeof;
|
||||
}
|
||||
const StructType = S.StructBinder.StructType;
|
||||
const K = S.StructBinder('my_struct',MyStructDef);
|
||||
T.mustThrowMatching(()=>K(), /via 'new'/).
|
||||
mustThrowMatching(()=>new K('hi'), /^Invalid pointer/);
|
||||
const k1 = new K(), k2 = new K();
|
||||
try {
|
||||
T.assert(k1.constructor === K).
|
||||
assert(K.isA(k1)).
|
||||
assert(k1 instanceof K).
|
||||
assert(K.prototype.lookupMember('p4').key === '$p4').
|
||||
assert(K.prototype.lookupMember('$p4').name === 'p4').
|
||||
mustThrowMatching(()=>K.prototype.lookupMember('nope'), /not a mapped/).
|
||||
assert(undefined === K.prototype.lookupMember('nope',false)).
|
||||
assert(k1 instanceof StructType).
|
||||
assert(StructType.isA(k1)).
|
||||
mustThrowMatching(()=>k1.$ro = 1, /read-only/);
|
||||
Object.keys(MyStructDef.members).forEach(function(key){
|
||||
key = K.memberKey(key);
|
||||
T.assert(0 == k1[key],
|
||||
"Expecting allocation to zero the memory "+
|
||||
"for "+key+" but got: "+k1[key]+
|
||||
" from "+k1.memoryDump());
|
||||
});
|
||||
T.assert('number' === typeof k1.pointer).
|
||||
mustThrowMatching(()=>k1.pointer = 1, /pointer/);
|
||||
k1.$p4 = 1; k1.$pP = 2;
|
||||
T.assert(1 === k1.$p4).assert(2 === k1.$pP);
|
||||
if(MyStructDef.members.$p8){
|
||||
k1.$p8 = 1/*must not throw despite not being a BigInt*/;
|
||||
k1.$p8 = BigInt(Number.MAX_SAFE_INTEGER * 2);
|
||||
T.assert(BigInt(2 * Number.MAX_SAFE_INTEGER) === k1.$p8);
|
||||
}
|
||||
T.assert(!k1.ondispose);
|
||||
k1.setMemberCString('cstr', "A C-string.");
|
||||
T.assert(Array.isArray(k1.ondispose)).
|
||||
assert(k1.ondispose[0] === k1.$cstr).
|
||||
assert('number' === typeof k1.$cstr).
|
||||
assert('A C-string.' === k1.memberToJsString('cstr'));
|
||||
k1.$pP = k2;
|
||||
T.assert(k1.$pP === k2.pointer);
|
||||
k1.$pP = null/*null is special-cased to 0.*/;
|
||||
T.assert(0===k1.$pP);
|
||||
let ptr = k1.pointer;
|
||||
k1.dispose();
|
||||
T.assert(undefined === k1.pointer).
|
||||
mustThrowMatching(()=>{k1.$pP=1}, /disposed instance/);
|
||||
}finally{
|
||||
k1.dispose();
|
||||
k2.dispose();
|
||||
}
|
||||
wts.$v4 = 10; wts.$v8 = 20;
|
||||
wts.$xFunc = W.installFunction(wtsFunc, wts.memberSignature('xFunc'))
|
||||
T.assert(0===counter).assert(10 === wts.$v4).assert(20n === wts.$v8)
|
||||
.assert(0 === wts.$ppV).assert('number' === typeof wts.$xFunc)
|
||||
.assert(0 === wts.$cstr)
|
||||
.assert(wts.memberIsString('$cstr'))
|
||||
.assert(!wts.memberIsString('$v4'))
|
||||
.assert(null === wts.memberToJsString('$cstr'))
|
||||
.assert(W.functionEntry(wts.$xFunc) instanceof Function);
|
||||
/* It might seem silly to assert that the values match
|
||||
what we just set, but recall that all of those property
|
||||
reads and writes are, via property interceptors,
|
||||
actually marshaling their data to/from a raw memory
|
||||
buffer, so merely reading them back is actually part of
|
||||
testing the struct-wrapping API. */
|
||||
|
||||
testFunc(wts.pointer);
|
||||
//log("wts.pointer, wts.$ppV",wts.pointer, wts.$ppV);
|
||||
T.assert(1===counter).assert(20 === wts.$v4).assert(40n === wts.$v8)
|
||||
.assert(wts.$ppV === wts.pointer)
|
||||
.assert('string' === typeof wts.memberToJsString('cstr'))
|
||||
.assert(wts.memberToJsString('cstr') === wts.memberToJsString('$cstr'))
|
||||
.mustThrowMatching(()=>wts.memberToJsString('xFunc'),
|
||||
/Invalid member type signature for C-string/)
|
||||
;
|
||||
testFunc(wts.pointer);
|
||||
T.assert(2===counter).assert(40 === wts.$v4).assert(80n === wts.$v8)
|
||||
.assert(wts.$ppV === wts.pointer);
|
||||
/** The 3rd call to wtsFunc throw from JS, which is called
|
||||
from C, which is called from JS. Let's ensure that
|
||||
that exception propagates back here... */
|
||||
T.mustThrowMatching(()=>testFunc(wts.pointer),/^Testing/);
|
||||
W.uninstallFunction(wts.$xFunc);
|
||||
wts.$xFunc = 0;
|
||||
wts.$ppV = 0;
|
||||
T.assert(!wts.$ppV);
|
||||
//WTStruct.debugFlags(0x03);
|
||||
wts.$ppV = wts;
|
||||
T.assert(wts.pointer === wts.$ppV)
|
||||
wts.setMemberCString('cstr', "A C-string.");
|
||||
T.assert(Array.isArray(wts.ondispose)).
|
||||
assert(wts.ondispose[0] === wts.$cstr).
|
||||
assert('A C-string.' === wts.memberToJsString('cstr'));
|
||||
const ptr = wts.pointer;
|
||||
wts.dispose();
|
||||
T.assert(ptr).assert(undefined === wts.pointer);
|
||||
}finally{
|
||||
wts.dispose();
|
||||
}
|
||||
if(!W.bigIntEnabled){
|
||||
log("Skipping WasmTestStruct tests: BigInt not enabled.");
|
||||
return;
|
||||
}
|
||||
|
||||
if(1){ // ondispose of other struct instances
|
||||
const s1 = new WTStruct, s2 = new WTStruct, s3 = new WTStruct;
|
||||
T.assert(s1.lookupMember instanceof Function)
|
||||
.assert(s1.addOnDispose instanceof Function);
|
||||
s1.addOnDispose(s2,"testing variadic args");
|
||||
T.assert(2===s1.ondispose.length);
|
||||
s2.addOnDispose(s3);
|
||||
s1.dispose();
|
||||
T.assert(!s2.pointer,"Expecting s2 to be ondispose'd by s1.");
|
||||
T.assert(!s3.pointer,"Expecting s3 to be ondispose'd by s2.");
|
||||
const WTStructDesc =
|
||||
W.ctype.structs.filter((e)=>'WasmTestStruct'===e.name)[0];
|
||||
const autoResolvePtr = true /* EXPERIMENTAL */;
|
||||
if(autoResolvePtr){
|
||||
WTStructDesc.members.ppV.signature = 'P';
|
||||
}
|
||||
const WTStruct = S.StructBinder(WTStructDesc);
|
||||
//log(WTStruct.structName, WTStruct.structInfo);
|
||||
const wts = new WTStruct();
|
||||
//log("WTStruct.prototype keys:",Object.keys(WTStruct.prototype));
|
||||
try{
|
||||
T.assert(wts.constructor === WTStruct).
|
||||
assert(WTStruct.memberKeys().indexOf('$ppV')>=0).
|
||||
assert(wts.memberKeys().indexOf('$v8')>=0).
|
||||
assert(!K.isA(wts)).
|
||||
assert(WTStruct.isA(wts)).
|
||||
assert(wts instanceof WTStruct).
|
||||
assert(wts instanceof StructType).
|
||||
assert(StructType.isA(wts)).
|
||||
assert(wts.pointer>0).assert(0===wts.$v4).assert(0n===wts.$v8).
|
||||
assert(0===wts.$ppV).assert(0===wts.$xFunc);
|
||||
const testFunc =
|
||||
W.xGet('sqlite3__wasm_test_struct'/*name gets mangled in -O3 builds!*/);
|
||||
let counter = 0;
|
||||
//log("wts.pointer =",wts.pointer);
|
||||
const wtsFunc = function(arg){
|
||||
/*log("This from a JS function called from C, "+
|
||||
"which itself was called from JS. arg =",arg);*/
|
||||
++counter;
|
||||
if(3===counter){
|
||||
tossQuietly("Testing exception propagation.");
|
||||
}
|
||||
}
|
||||
wts.$v4 = 10; wts.$v8 = 20;
|
||||
wts.$xFunc = W.installFunction(wtsFunc, wts.memberSignature('xFunc'))
|
||||
T.assert(0===counter).assert(10 === wts.$v4).assert(20n === wts.$v8)
|
||||
.assert(0 === wts.$ppV).assert('number' === typeof wts.$xFunc)
|
||||
.assert(0 === wts.$cstr)
|
||||
.assert(wts.memberIsString('$cstr'))
|
||||
.assert(!wts.memberIsString('$v4'))
|
||||
.assert(null === wts.memberToJsString('$cstr'))
|
||||
.assert(W.functionEntry(wts.$xFunc) instanceof Function);
|
||||
/* It might seem silly to assert that the values match
|
||||
what we just set, but recall that all of those property
|
||||
reads and writes are, via property interceptors,
|
||||
actually marshaling their data to/from a raw memory
|
||||
buffer, so merely reading them back is actually part of
|
||||
testing the struct-wrapping API. */
|
||||
|
||||
testFunc(wts.pointer);
|
||||
//log("wts.pointer, wts.$ppV",wts.pointer, wts.$ppV);
|
||||
T.assert(1===counter).assert(20 === wts.$v4).assert(40n === wts.$v8)
|
||||
.assert(wts.$ppV === wts.pointer)
|
||||
.assert('string' === typeof wts.memberToJsString('cstr'))
|
||||
.assert(wts.memberToJsString('cstr') === wts.memberToJsString('$cstr'))
|
||||
.mustThrowMatching(()=>wts.memberToJsString('xFunc'),
|
||||
/Invalid member type signature for C-string/)
|
||||
;
|
||||
testFunc(wts.pointer);
|
||||
T.assert(2===counter).assert(40 === wts.$v4).assert(80n === wts.$v8)
|
||||
.assert(wts.$ppV === wts.pointer);
|
||||
/** The 3rd call to wtsFunc throw from JS, which is called
|
||||
from C, which is called from JS. Let's ensure that
|
||||
that exception propagates back here... */
|
||||
T.mustThrowMatching(()=>testFunc(wts.pointer),/^Testing/);
|
||||
W.uninstallFunction(wts.$xFunc);
|
||||
wts.$xFunc = 0;
|
||||
wts.$ppV = 0;
|
||||
T.assert(!wts.$ppV);
|
||||
//WTStruct.debugFlags(0x03);
|
||||
wts.$ppV = wts;
|
||||
T.assert(wts.pointer === wts.$ppV)
|
||||
wts.setMemberCString('cstr', "A C-string.");
|
||||
T.assert(Array.isArray(wts.ondispose)).
|
||||
assert(wts.ondispose[0] === wts.$cstr).
|
||||
assert('A C-string.' === wts.memberToJsString('cstr'));
|
||||
const ptr = wts.pointer;
|
||||
wts.dispose();
|
||||
T.assert(ptr).assert(undefined === wts.pointer);
|
||||
}finally{
|
||||
wts.dispose();
|
||||
}
|
||||
|
||||
if(1){ // ondispose of other struct instances
|
||||
const s1 = new WTStruct, s2 = new WTStruct, s3 = new WTStruct;
|
||||
T.assert(s1.lookupMember instanceof Function)
|
||||
.assert(s1.addOnDispose instanceof Function);
|
||||
s1.addOnDispose(s2,"testing variadic args");
|
||||
T.assert(2===s1.ondispose.length);
|
||||
s2.addOnDispose(s3);
|
||||
s1.dispose();
|
||||
T.assert(!s2.pointer,"Expecting s2 to be ondispose'd by s1.");
|
||||
T.assert(!s3.pointer,"Expecting s3 to be ondispose'd by s2.");
|
||||
}
|
||||
}
|
||||
}/*StructBinder*/)
|
||||
|
||||
@@ -1126,75 +1131,83 @@ globalThis.sqlite3InitModule = sqlite3InitModule;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
T.g('sqlite3.oo1')
|
||||
.t('Create db', function(sqlite3){
|
||||
const dbFile = '/tester1.db';
|
||||
sqlite3.util.sqlite3__wasm_vfs_unlink(0, dbFile);
|
||||
const db = this.db = new sqlite3.oo1.DB(dbFile, 0 ? 'ct' : 'c');
|
||||
db.onclose = {
|
||||
disposeAfter: [],
|
||||
disposeBefore: [
|
||||
(db)=>{
|
||||
//console.debug("db.onclose.before dropping modules");
|
||||
//sqlite3.capi.sqlite3_drop_modules(db.pointer, 0);
|
||||
}
|
||||
],
|
||||
before: function(db){
|
||||
while(this.disposeBefore.length){
|
||||
const v = this.disposeBefore.shift();
|
||||
console.debug("db.onclose.before cleaning up:",v);
|
||||
if(wasm.isPtr(v)) wasm.dealloc(v);
|
||||
else if(v instanceof sqlite3.StructBinder.StructType){
|
||||
v.dispose();
|
||||
}else if(v instanceof Function){
|
||||
try{ v(db) } catch(e){
|
||||
console.warn("beforeDispose() callback threw:",e);
|
||||
.t({
|
||||
name:'Create db',
|
||||
//predicate: (sqlite3)=>
|
||||
test: function(sqlite3){
|
||||
const dbFile = '/tester1.db';
|
||||
sqlite3.util.sqlite3__wasm_vfs_unlink(0, dbFile);
|
||||
const db = this.db = new sqlite3.oo1.DB(dbFile, 0 ? 'ct' : 'c');
|
||||
db.onclose = {
|
||||
disposeAfter: [],
|
||||
disposeBefore: [
|
||||
(db)=>{
|
||||
//console.debug("db.onclose.before dropping modules");
|
||||
//sqlite3.capi.sqlite3_drop_modules(db.pointer, 0);
|
||||
}
|
||||
],
|
||||
before: function(db){
|
||||
while(this.disposeBefore.length){
|
||||
const v = this.disposeBefore.shift();
|
||||
console.debug("db.onclose.before cleaning up:",v);
|
||||
if(wasm.isPtr(v)) wasm.dealloc(v);
|
||||
else if(v instanceof sqlite3.StructBinder.StructType){
|
||||
v.dispose();
|
||||
}else if(v instanceof Function){
|
||||
try{ v(db) } catch(e){
|
||||
console.warn("beforeDispose() callback threw:",e);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
after: function(){
|
||||
while(this.disposeAfter.length){
|
||||
const v = this.disposeAfter.shift();
|
||||
console.debug("db.onclose.after cleaning up:",v);
|
||||
if(wasm.isPtr(v)) wasm.dealloc(v);
|
||||
else if(v instanceof sqlite3.StructBinder.StructType){
|
||||
v.dispose();
|
||||
}else if(v instanceof Function){
|
||||
try{v()} catch(e){/*ignored*/}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
after: function(){
|
||||
while(this.disposeAfter.length){
|
||||
const v = this.disposeAfter.shift();
|
||||
console.debug("db.onclose.after cleaning up:",v);
|
||||
if(wasm.isPtr(v)) wasm.dealloc(v);
|
||||
else if(v instanceof sqlite3.StructBinder.StructType){
|
||||
v.dispose();
|
||||
}else if(v instanceof Function){
|
||||
try{v()} catch(e){/*ignored*/}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
T.assert(wasm.isPtr(db.pointer))
|
||||
.mustThrowMatching(()=>db.pointer=1, /read-only/)
|
||||
.assert(0===sqlite3.capi.sqlite3_extended_result_codes(db.pointer,1))
|
||||
.assert('main'===db.dbName(0))
|
||||
.assert('string' === typeof db.dbVfsName())
|
||||
.assert(db.pointer === wasm.xWrap.testConvertArg('sqlite3*',db));
|
||||
// Custom db error message handling via sqlite3_prepare_v2/v3()
|
||||
let rc = capi.sqlite3_prepare_v3(db.pointer, {/*invalid*/}, -1, 0, null, null);
|
||||
T.assert(capi.SQLITE_MISUSE === rc)
|
||||
.assert(0 === capi.sqlite3_errmsg(db.pointer).indexOf("Invalid SQL"))
|
||||
.assert(dbFile === db.dbFilename())
|
||||
.assert(!db.dbFilename('nope'));
|
||||
//Sanity check DB.checkRc()...
|
||||
let ex;
|
||||
try{db.checkRc(rc)}
|
||||
catch(e){ex = e}
|
||||
T.assert(ex instanceof sqlite3.SQLite3Error)
|
||||
.assert(capi.SQLITE_MISUSE===ex.resultCode)
|
||||
.assert(0===ex.message.indexOf("SQLITE_MISUSE: sqlite3 result code"))
|
||||
.assert(ex.message.indexOf("Invalid SQL")>0);
|
||||
T.assert(db === db.checkRc(0))
|
||||
.assert(db === sqlite3.oo1.DB.checkRc(db,0))
|
||||
.assert(null === sqlite3.oo1.DB.checkRc(null,0));
|
||||
this.progressHandlerCount = 0;
|
||||
if( wasm.compileOptionUsed('OMIT_PROGRESS_CALLBACK') ){
|
||||
T.assert( !capi.sqlite3_progress_handler );
|
||||
}else{
|
||||
T.assert( !!capi.sqlite3_progress_handler );
|
||||
capi.sqlite3_progress_handler(db, 5, (p)=>{
|
||||
++this.progressHandlerCount;
|
||||
return 0;
|
||||
}, 0);
|
||||
}
|
||||
};
|
||||
|
||||
T.assert(wasm.isPtr(db.pointer))
|
||||
.mustThrowMatching(()=>db.pointer=1, /read-only/)
|
||||
.assert(0===sqlite3.capi.sqlite3_extended_result_codes(db.pointer,1))
|
||||
.assert('main'===db.dbName(0))
|
||||
.assert('string' === typeof db.dbVfsName())
|
||||
.assert(db.pointer === wasm.xWrap.testConvertArg('sqlite3*',db));
|
||||
// Custom db error message handling via sqlite3_prepare_v2/v3()
|
||||
let rc = capi.sqlite3_prepare_v3(db.pointer, {/*invalid*/}, -1, 0, null, null);
|
||||
T.assert(capi.SQLITE_MISUSE === rc)
|
||||
.assert(0 === capi.sqlite3_errmsg(db.pointer).indexOf("Invalid SQL"))
|
||||
.assert(dbFile === db.dbFilename())
|
||||
.assert(!db.dbFilename('nope'));
|
||||
//Sanity check DB.checkRc()...
|
||||
let ex;
|
||||
try{db.checkRc(rc)}
|
||||
catch(e){ex = e}
|
||||
T.assert(ex instanceof sqlite3.SQLite3Error)
|
||||
.assert(capi.SQLITE_MISUSE===ex.resultCode)
|
||||
.assert(0===ex.message.indexOf("SQLITE_MISUSE: sqlite3 result code"))
|
||||
.assert(ex.message.indexOf("Invalid SQL")>0);
|
||||
T.assert(db === db.checkRc(0))
|
||||
.assert(db === sqlite3.oo1.DB.checkRc(db,0))
|
||||
.assert(null === sqlite3.oo1.DB.checkRc(null,0));
|
||||
|
||||
this.progressHandlerCount = 0;
|
||||
capi.sqlite3_progress_handler(db, 5, (p)=>{
|
||||
++this.progressHandlerCount;
|
||||
return 0;
|
||||
}, 0);
|
||||
}
|
||||
})
|
||||
////////////////////////////////////////////////////////////////////
|
||||
.t('sqlite3_db_config() and sqlite3_db_status()', function(sqlite3){
|
||||
@@ -1235,8 +1248,6 @@ globalThis.sqlite3InitModule = sqlite3InitModule;
|
||||
let st = this.db.prepare(
|
||||
new TextEncoder('utf-8').encode("select 3 as a")
|
||||
);
|
||||
//debug("statement =",st);
|
||||
this.progressHandlerCount = 0;
|
||||
let rc;
|
||||
try {
|
||||
T.assert(wasm.isPtr(st.pointer))
|
||||
@@ -1278,7 +1289,8 @@ globalThis.sqlite3InitModule = sqlite3InitModule;
|
||||
st, capi.SQLITE_STMTSTATUS_RUN, 0
|
||||
) > 0);
|
||||
|
||||
T.assert(this.progressHandlerCount > 0,
|
||||
T.assert(this.progressHandlerCount>0
|
||||
|| wasm.compileOptionUsed('OMIT_PROGRESS_CALLBACK'),
|
||||
"Expecting progress callback.").
|
||||
assert(0===capi.sqlite3_strglob("*.txt", "foo.txt")).
|
||||
assert(0!==capi.sqlite3_strglob("*.txt", "foo.xtx")).
|
||||
@@ -1363,7 +1375,8 @@ globalThis.sqlite3InitModule = sqlite3InitModule;
|
||||
.assert(2 === list.length)
|
||||
.assert('string'===typeof list[1])
|
||||
.assert(3===db.changes())
|
||||
.assert(this.progressHandlerCount > 0,
|
||||
.assert(this.progressHandlerCount > 0
|
||||
|| wasm.compileOptionUsed('OMIT_PROGRESS_CALLBACK'),
|
||||
"Expecting progress callback.")
|
||||
if(wasm.bigIntEnabled){
|
||||
T.assert(3n===db.changes(false,true));
|
||||
@@ -1904,7 +1917,9 @@ globalThis.sqlite3InitModule = sqlite3InitModule;
|
||||
////////////////////////////////////////////////////////////////////
|
||||
.t({
|
||||
name: 'Window UDFs',
|
||||
//predicate: ()=>false,
|
||||
predicate: (sqlite3)=>!!sqlite3.wasm.exports.sqlite3_create_window_function
|
||||
/*!sqlite3.wasm.compileOptionUsed('OMIT_WINDOWFUNC')*/
|
||||
|| "Missing window functions",
|
||||
test: function(){
|
||||
/* Example window function, table, and results taken from:
|
||||
https://sqlite.org/windowfunctions.html#udfwinfunc */
|
||||
@@ -2153,7 +2168,7 @@ globalThis.sqlite3InitModule = sqlite3InitModule;
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
.t({
|
||||
name: 'virtual table #1: eponymous w/ manual exception handling',
|
||||
predicate: ()=>!!capi.sqlite3_create_module || "Missing vtab support",
|
||||
predicate: (sqlite3)=>!!sqlite3.capi.sqlite3_vtab || "Missing vtab support",
|
||||
test: function(sqlite3){
|
||||
const VT = sqlite3.vtab;
|
||||
const tmplCols = Object.assign(Object.create(null),{
|
||||
@@ -2350,7 +2365,7 @@ globalThis.sqlite3InitModule = sqlite3InitModule;
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
.t({
|
||||
name: 'virtual table #2: non-eponymous w/ automated exception wrapping',
|
||||
predicate: ()=>!!capi.sqlite3_create_module || "Missing vtab support",
|
||||
predicate: (sqlite3)=>!!sqlite3.capi.sqlite3_vtab || "Missing vtab support",
|
||||
test: function(sqlite3){
|
||||
const VT = sqlite3.vtab;
|
||||
const tmplCols = Object.assign(Object.create(null),{
|
||||
@@ -3132,7 +3147,10 @@ globalThis.sqlite3InitModule = sqlite3InitModule;
|
||||
]);
|
||||
T.assert(2 === u1.getFileCount() /* one is the journal file */)
|
||||
.assert(3 === db.selectValue('select count(*) from t'))
|
||||
.assert('wal'===db.selectValue('pragma journal_mode'));
|
||||
.assert(
|
||||
'wal'===db.selectValue('pragma journal_mode')
|
||||
|| wasm.compileOptionUsed('OMIT_WAL')
|
||||
);
|
||||
db.close();
|
||||
T.assert(1 === u1.getFileCount());
|
||||
db = new u2.OpfsSAHPoolDb(dbName);
|
||||
@@ -3300,17 +3318,7 @@ globalThis.sqlite3InitModule = sqlite3InitModule;
|
||||
T.g('Bug Reports')
|
||||
.t({
|
||||
name: 'Delete via bound parameter in subquery',
|
||||
predicate: function(sqlite3){
|
||||
const d = new sqlite3.oo1.DB();
|
||||
try{
|
||||
d.exec("create virtual table f using fts5(x)");
|
||||
return true;
|
||||
}catch(e){
|
||||
return "FTS5 is not available";
|
||||
}finally{
|
||||
d.close();
|
||||
}
|
||||
},
|
||||
predicate: ()=>wasm.compileOptionUsed('ENABLE_FTS5') || "Missing FTS5",
|
||||
test: function(sqlite3){
|
||||
// Testing https://sqlite.org/forum/forumpost/40ce55bdf5
|
||||
// with the exception that that post uses "external content"
|
||||
@@ -3345,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*/;
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
+20
-24
@@ -6,19 +6,20 @@
|
||||
# GNUMakefile.
|
||||
########################################################################
|
||||
MAKEFILE.wasmfs := $(lastword $(MAKEFILE_LIST))
|
||||
$(warning The WASMFS build is currently incomplete.)
|
||||
# ensure that the following message starts on line 10 or higher for proper
|
||||
# $(warning) alignment!
|
||||
ifneq (1,$(MAKING_CLEAN))
|
||||
$(warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!)
|
||||
$(warning !! The WASMFS build is not well-supported. WASMFS is a proverbial)
|
||||
$(warning !! moving target, sometimes changing in incompatible ways between)
|
||||
$(warning !! Emscripten versions. This build is provided for adventurous folks)
|
||||
$(warning !! and is not a supported deliverable of the SQLite project.)
|
||||
$(warning !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!)
|
||||
endif
|
||||
|
||||
#dir.wasmfs := $(dir.wasm)
|
||||
dir.wasmfs := $(dir.dout)
|
||||
sqlite3-wasmfs.js := $(dir.wasmfs)/sqlite3-wasmfs.js
|
||||
sqlite3-wasmfs.mjs := $(dir.wasmfs)/sqlite3-wasmfs.mjs
|
||||
sqlite3-wasmfs.wasm := $(dir.wasmfs)/sqlite3-wasmfs.wasm
|
||||
|
||||
CLEAN_FILES += $(sqlite3-wasmfs.js) $(sqlite3-wasmfs.wasm) \
|
||||
$(subst .js,.worker.js,$(sqlite3-wasmfs.js)) \
|
||||
$(sqlite3-wasmfs.mjs) \
|
||||
$(subst .mjs,.worker.mjs,$(sqlite3-wasmfs.mjs))
|
||||
|
||||
########################################################################
|
||||
# emcc flags for .c/.o.
|
||||
cflags.sqlite3-wasmfs :=
|
||||
@@ -30,12 +31,15 @@ cflags.sqlite3-wasmfs += -DSQLITE_ENABLE_WASMFS
|
||||
# emcc flags specific to building the final .js/.wasm file...
|
||||
emcc.flags.sqlite3-wasmfs :=
|
||||
emcc.flags.sqlite3-wasmfs += \
|
||||
-sEXPORTED_RUNTIME_METHODS=wasmMemory,allocateUTF8OnStack,stringToUTF8OnStack
|
||||
-sEXPORTED_RUNTIME_METHODS=wasmMemory
|
||||
# wasmMemory ==> for -sIMPORTED_MEMORY
|
||||
# *OnStack ==> wasmfs internals (leaky abstraction)
|
||||
# Some version of emcc between 3.1.60-ish(?) and 3.1.62 deprecated the
|
||||
# use of (allocateUTF8OnStack,stringToUTF8OnStack). Earlier emcc
|
||||
# versions will fail to build without those in the
|
||||
# EXPORTED_RUNTIME_METHODS list.
|
||||
emcc.flags.sqlite3-wasmfs += -sUSE_CLOSURE_COMPILER=0
|
||||
emcc.flags.sqlite3-wasmfs += -Wno-limited-postlink-optimizations
|
||||
# ^^^^^ it likes to warn when we have "limited optimizations" via the -g3 flag.
|
||||
# ^^^^^ emcc likes to warn when we have "limited optimizations" via the -g3 flag.
|
||||
emcc.flags.sqlite3-wasmfs += -sMEMORY64=0
|
||||
emcc.flags.sqlite3-wasmfs += -sINITIAL_MEMORY=$(emcc.INITIAL_MEMORY.128)
|
||||
# ^^^^ 64MB is not enough for WASMFS/OPFS test runs using batch-runner.js
|
||||
@@ -51,12 +55,7 @@ emcc.flags.sqlite3-wasmfs += -sALLOW_MEMORY_GROWTH=0
|
||||
# And, indeed, it runs slowly if memory is permitted to grow.
|
||||
#emcc.flags.sqlite3-wasmfs.vanilla :=
|
||||
#emcc.flags.sqlite3-wasmfs.esm := -sEXPORT_ES6 -sUSE_ES6_IMPORT_META
|
||||
sqlite3-api.mjs.wasmfs := $(dir.tmp)/sqlite3-api-wasmfs.mjs
|
||||
$(eval $(call SETUP_LIB_BUILD_MODE,sqlite3-wasmfs,esm,1,\
|
||||
$(sqlite3-api.mjs.wasmfs), $(sqlite3-wasmfs.mjs),\
|
||||
$(c-pp.D.sqlite3-bundler-friendly) -Dwasmfs,\
|
||||
-sEXPORT_ES6 -sUSE_ES6_IMPORT_META\
|
||||
))
|
||||
all: $(sqlite3-wasmfs.mjs)
|
||||
$(sqlite3-wasmfs.js) $(sqlite3-wasmfs.mjs): $(MAKEFILE.wasmfs)
|
||||
########################################################################
|
||||
# Build quirk: we cannot build BOTH .js and .mjs with our current
|
||||
@@ -67,8 +66,8 @@ $(sqlite3-wasmfs.js) $(sqlite3-wasmfs.mjs): $(MAKEFILE.wasmfs)
|
||||
# build both modes they would need to have distinct base names or
|
||||
# output directories. "The problem" with giving them distinct base
|
||||
# names is that it means that the corresponding .wasm file is also
|
||||
# built/saved multiple times.
|
||||
#
|
||||
# built/saved multiple times. It is likely that anyone wanting to use
|
||||
# WASMFS will want an ES6 module, so that's what we build here.
|
||||
wasmfs.build.ext := mjs
|
||||
$(sqlite3-wasmfs.js) $(sqlite3-wasmfs.mjs): $(SOAP.js.bld)
|
||||
ifeq (js,$(wasmfs.build.ext))
|
||||
@@ -78,7 +77,6 @@ else
|
||||
$(sqlite3-wasmfs.wasm): $(sqlite3-wasmfs.mjs)
|
||||
wasmfs: $(sqlite3-wasmfs.mjs)
|
||||
endif
|
||||
#all: wasmfs
|
||||
|
||||
########################################################################
|
||||
# speedtest1 for wasmfs.
|
||||
@@ -103,13 +101,11 @@ $(speedtest1-wasmfs.mjs): $(speedtest1.cfiles) $(sqlite3-wasmfs.js) \
|
||||
$(emcc.flags.sqlite3-wasmfs) \
|
||||
$(emcc.flags.speedtest1-wasmfs) \
|
||||
-o $@ $(speedtest1.cfiles) -lm
|
||||
@$(call SQLITE3.xJS.ESM-EXPORT-DEFAULT,1)
|
||||
@$(call SQLITE3.xJS.ESM-EXPORT-DEFAULT,1,1)
|
||||
$(maybe-wasm-strip) $(speedtest1-wasmfs.wasm)
|
||||
chmod -x $(speedtest1-wasmfs.wasm)
|
||||
ls -la $@ $(speedtest1-wasmfs.wasm)
|
||||
|
||||
wasmfs: $(speedtest1-wasmfs.mjs)
|
||||
CLEAN_FILES += $(speedtest1-wasmfs.mjs) $(speedtest1-wasmfs.wasm) \
|
||||
$(subst .js,.worker.js,$(speedtest1-wasmfs.mjs))
|
||||
# end speedtest1.js
|
||||
########################################################################
|
||||
|
||||
@@ -560,8 +560,8 @@ sqlite3$(EXE): sqlite3.h libsqlite3.a shell.c
|
||||
$(TCCX) $(READLINE_FLAGS) -o sqlite3$(EXE) $(SHELL_OPT) \
|
||||
shell.c libsqlite3.a $(LIBREADLINE) $(TLIBS) $(THREADLIB)
|
||||
|
||||
sqldiff$(EXE): $(TOP)/tool/sqldiff.c sqlite3.c sqlite3.h
|
||||
$(TCCX) -o sqldiff$(EXE) -DSQLITE_THREADSAFE=0 \
|
||||
sqldiff$(EXE): $(TOP)/tool/sqldiff.c $(TOP)/ext/misc/sqlite3_stdio.h sqlite3.c sqlite3.h
|
||||
$(TCCX) -I$(TOP)/ext/misc -o sqldiff$(EXE) -DSQLITE_THREADSAFE=0 \
|
||||
$(TOP)/tool/sqldiff.c sqlite3.c $(TLIBS) $(THREADLIB)
|
||||
|
||||
dbhash$(EXE): $(TOP)/tool/dbhash.c sqlite3.c sqlite3.h
|
||||
@@ -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
|
||||
@@ -763,8 +763,6 @@ keywordhash.h: $(TOP)/tool/mkkeywordhash.c
|
||||
# Source and header files that shell.c depends on
|
||||
SHELL_DEP = \
|
||||
$(TOP)/src/shell.c.in \
|
||||
$(TOP)/ext/consio/console_io.c \
|
||||
$(TOP)/ext/consio/console_io.h \
|
||||
$(TOP)/ext/expert/sqlite3expert.c \
|
||||
$(TOP)/ext/expert/sqlite3expert.h \
|
||||
$(TOP)/ext/intck/sqlite3intck.c \
|
||||
@@ -784,6 +782,8 @@ SHELL_DEP = \
|
||||
$(TOP)/ext/misc/sha1.c \
|
||||
$(TOP)/ext/misc/shathree.c \
|
||||
$(TOP)/ext/misc/sqlar.c \
|
||||
$(TOP)/ext/misc/sqlite3_stdio.c \
|
||||
$(TOP)/ext/misc/sqlite3_stdio.h \
|
||||
$(TOP)/ext/misc/uint.c \
|
||||
$(TOP)/ext/misc/vfstrace.c \
|
||||
$(TOP)/ext/misc/zipfile.c \
|
||||
@@ -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 Fix\sthe\spreupdate\shook\sso\sthat\sit\sworks\swhen\sthe\s"old.*"\srow\shas\sa\scolumn\swith\sa\snon-NULL\sdefault\svalue\sthat\swas\sadded\sby\sALTER\sTABLE\sADD\sCOLUMN\safter\sthe\scurrent\srecord\swas\screated.
|
||||
D 2024-09-18T15:02:27.631
|
||||
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 fa448c4c0567623fd140efebecb570ab58d955d766a5ea0fd8a94e9b5697007c
|
||||
F Makefile.in bb7184a6906f4f15647031c414d4b7dbe935683c14976548a793071e7133bd84
|
||||
F Makefile.linux-gcc f3842a0b1efbfbb74ac0ef60e56b301836d05b4d867d014f714fa750048f1ab6
|
||||
F Makefile.msc bf58bbf9acb3d2b592adffb2f17130737fb26055f381da01258607c72dafd0b0
|
||||
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 661f873fd451127edf822ef0d520088faa319135f6a15bd10be6801ac284ac9b
|
||||
F ext/expert/sqlite3expert.c 8b09aeb2b95a9fca8b6628b522bf4d69aa746ff64c38eb1e99a9b5fad8cf03b9
|
||||
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 571483823193f09439356741669aa8c81da838ae6f5e1bfa7517f7ee2fb3addd
|
||||
F ext/fts5/fts5_main.c 4503498d3453e29a3cd89dacaba029011e89cb8c481a6241611d106e7a369bd4
|
||||
F ext/fts5/fts5_storage.c 3332497823c3d171cf56379f2bd8c971ce15a19aadacff961106462022c92470
|
||||
F ext/fts5/fts5_index.c 368a968570ce12ba40223e284a588d9f93ee23a0133727f0df1fcd64086b1fb6
|
||||
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
|
||||
@@ -145,7 +149,7 @@ F ext/fts5/test/fts5contentless.test 606f063b29ba0f46d4b79aa36cdd1ef4dab5de53eae
|
||||
F ext/fts5/test/fts5contentless2.test 70ffe6c611d8f278240da56734df8a77948f04e2739b358439e9bdcf56ced35f
|
||||
F ext/fts5/test/fts5contentless3.test 75eaae5ad6b284ee447788943974d323228f27cc35a1681da997135cff95bc6a
|
||||
F ext/fts5/test/fts5contentless4.test ec34dc69ef474ca9997dae6d91e072906e0e9a5a4b05ea89964c863833b6eff8
|
||||
F ext/fts5/test/fts5contentless5.test 40cdcb4fe751672450829c5a96bd32c25fc2f6076279dd2ce5c58ac9a390132a
|
||||
F ext/fts5/test/fts5contentless5.test 38cd0392c730dc7090c550321ce3c24ba4c392bc97308b51a4180e9959dca7b5
|
||||
F ext/fts5/test/fts5corrupt.test 6485f721b88ba355ca5d701e7ee87a4efa3ea578d8e6adb26f51ef956c8328bd
|
||||
F ext/fts5/test/fts5corrupt2.test 335911e3f68b9625d850325f9e29a128db3f4276a8c9d4e32134580da8f924c4
|
||||
F ext/fts5/test/fts5corrupt3.test 4fc3bf129f1616bea00884a23fd9d7b0e46d01791d2b57fe8d68ac36e8d3ff7c
|
||||
@@ -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
|
||||
@@ -399,7 +405,7 @@ F ext/misc/dbdump.c b8592f6f2da292c62991a13864a60d6c573c47a9cc58362131b9e6a64f82
|
||||
F ext/misc/decimal.c 172cf81a8634e6a0f0bedaf71a8372fee63348cf5a3c4e1b78bb233c35889fdc
|
||||
F ext/misc/eval.c 04bc9aada78c888394204b4ed996ab834b99726fb59603b0ee3ed6e049755dc1
|
||||
F ext/misc/explain.c 606100185fb90d6a1eade1ed0414d53503c86820d8956a06e3b0a56291894f2b
|
||||
F ext/misc/fileio.c 916638042f318701460485032e33981056747d0f92e6757aa9499f2363ea7047
|
||||
F ext/misc/fileio.c e6b34db4df4b55b96265086c0010264e257b6eab1644e665697a6da587659403
|
||||
F ext/misc/fossildelta.c 8c026e086e406e2b69947f1856fa3b848fff5379962276430d10085b8756b05a
|
||||
F ext/misc/fuzzer.c 8b28acf1a7e95d50e332bdd47e792ff27054ad99d3f9bc2e91273814d4b31a5a
|
||||
F ext/misc/ieee754.c 62a90978204d2c956d5036eb89e548e736ca5fac0e965912867ddd7bb833256d
|
||||
@@ -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,12 +425,14 @@ 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 c0aa7b80d6df45f7da59d912b38752bcac1af53a5766966160e6c5cdd397dbea
|
||||
F ext/misc/spellfix.c bcc42ef3fd29429bc01a83e751332b8d4690e65d45008449bdffe7656371487f
|
||||
F ext/misc/sqlar.c a6175790482328171da47095f87608b48a476d4fac78d8a9ff18b03a2454f634
|
||||
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
|
||||
F ext/misc/templatevtab.c 10f15b165b95423ddef593bc5dcb915ec4eb5e0f1066d585e5435a368b8bc22b
|
||||
@@ -435,11 +443,11 @@ F ext/misc/urifuncs.c f71360d14fa9e7626b563f1f781c6148109462741c5235ac63ae0f8917
|
||||
F ext/misc/uuid.c 5bb2264c1b64d163efa46509544fd7500cb8769cb7c16dd52052da8d961505cf
|
||||
F ext/misc/vfslog.c 3932ab932eeb2601dbc4447cb14d445aaa9fbe43b863ef5f014401c3420afd20
|
||||
F ext/misc/vfsstat.c a85df08654743922a19410d7b1e3111de41bb7cd07d20dd16eda4e2b808d269d
|
||||
F ext/misc/vfstrace.c 03f90dd465968e01f5d1d3e79c36cbc53a5bfe1bd55d239435ce94df19d5b0ac
|
||||
F ext/misc/vfstrace.c ac76a4ac4d907774fd423cc2b61410c756f9d0782e27cf6032e058594accaaca
|
||||
F ext/misc/vtablog.c 1100250ce8782db37c833e3a9a5c9a3ecf1af5e15b8325572b82e6e0a138ffb5
|
||||
F ext/misc/vtshim.c 1976e6dd68dd0d64508c91a6dfab8e75f8aaf6cd
|
||||
F ext/misc/wholenumber.c 0fa0c082676b7868bf2fa918e911133f2b349bcdceabd1198bba5f65b4fc0668
|
||||
F ext/misc/zipfile.c 5a3bf1b9cccb8e0da2389fe9e39e9c7f2b1351474b7e5090635f817d495eee3f
|
||||
F ext/misc/zipfile.c b62147ac4985eaac4e368d529b1f4f43ad6bc9ac13d6805d907fff3afdac64d3
|
||||
F ext/misc/zorder.c b0ff58fa643afa1d846786d51ea8d5c4b6b35aa0254ab5a82617db92f3adda64
|
||||
F ext/rbu/rbu.c 801450b24eaf14440d8fd20385aacc751d5c9d6123398df41b1b5aa804bf4ce8
|
||||
F ext/rbu/rbu1.test 25870dd7db7eb5597e2b4d6e29e7a7e095abf332660f67d89959552ce8f8f255
|
||||
@@ -504,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
|
||||
@@ -575,7 +583,7 @@ F ext/session/sessionG.test 3efe388282d641b65485b5462e67851002cd91a282dc95b685d0
|
||||
F ext/session/sessionH.test 71bbff6b1abb2c4ac62b84dee53273c37e0b21e5fde3aed80929403e091ef859
|
||||
F ext/session/session_common.tcl e5598096425486b363718e2cda48ee85d660c96b4f8ea9d9d7a4c3ef514769da
|
||||
F ext/session/session_speed_test.c dcf0ef58d76b70c8fbd9eab3be77cf9deb8bc1638fed8be518b62d6cbdef88b3
|
||||
F ext/session/sessionalter.test 460bdac2832a550519f6bc32e5db2c0cee94f335870aaf25a3a403a81ab20e17
|
||||
F ext/session/sessionalter.test e852acb3d2357aac7d0b920a2109da758c4331bfdf85b41d39aa3a8c18914f65
|
||||
F ext/session/sessionat.test 00c8badb35e43a2f12a716d2734a44d614ff62361979b6b85419035bc04b45ee
|
||||
F ext/session/sessionbig.test 47c381e7acfabeef17d98519a3080d69151723354d220afa2053852182ca7adf
|
||||
F ext/session/sessionchange.test 77c4702050f24270b58070e2cf01c95c3d232a3ef164b70f31974b386ce69903
|
||||
@@ -586,7 +594,7 @@ F ext/session/sessionfault2.test b0d6a7c1d7398a7e800d84657404909c7d385965ea8576d
|
||||
F ext/session/sessionfault3.test ce0b5d182133935c224d72507dbf1c5be1a1febf7e85d0b0fbd6d2f724b32b96
|
||||
F ext/session/sessioninvert.test 04075517a9497a80d39c495ba6b44f3982c7371129b89e2c52219819bc105a25
|
||||
F ext/session/sessionmem.test f2a735db84a3e9e19f571033b725b0b2daf847f3f28b1da55a0c1a4e74f1de09
|
||||
F ext/session/sessionnoact.test 506526a5fe29421ecc50d371774ef1bb04cbd9d906a8a468f0556cdbde184c22
|
||||
F ext/session/sessionnoact.test 2563dff62a2a80dc7c88002241b2fd1578c3e5438735e180fb7e941ebbc66214
|
||||
F ext/session/sessionnoop.test a9366a36a95ef85f8a3687856ebef46983df399541174cb1ede2ee53b8011bc7
|
||||
F ext/session/sessionnoop2.test de4672dce88464396ec9f30ed08c6c01643a69c53ae540fadbbf6d30642d64e8
|
||||
F ext/session/sessionrebase.test 702378bdcb5062f1106e74457beca8797d09c113a81768734a58b197b5b334e2
|
||||
@@ -594,53 +602,50 @@ F ext/session/sessionrowid.test 85187c2f1b38861a5844868126f69f9ec62223a03449a98a
|
||||
F ext/session/sessionsize.test 8fcf4685993c3dbaa46a24183940ab9f5aa9ed0d23e5fb63bfffbdb56134b795
|
||||
F ext/session/sessionstat1.test 5e718d5888c0c49bbb33a7a4f816366db85f59f6a4f97544a806421b85dc2dec
|
||||
F ext/session/sessionwor.test 6fd9a2256442cebde5b2284936ae9e0d54bde692d0f5fd009ecef8511f4cf3fc
|
||||
F ext/session/sqlite3session.c e74d3e58d4c20e72c14c23f909e1a6c7ea71ae31129fb1685babf2cab558d613
|
||||
F ext/session/sqlite3session.c 3d0a7f0f7a1c946e01818c716a55a40ae30542a29a9045cb05daf7fb658cdafa
|
||||
F ext/session/sqlite3session.h 683ccbf16e2c2521661fc4c1cf918ce57002039efbcabcd8097fa4bca569104b
|
||||
F ext/session/test_session.c aa29abdcc9011ac02f4fa38e8ede226106eaeee7c3ea7d8b2b999a124e0c368c
|
||||
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 d4f6586d9a36ee2869a8c7f77227a8b7f42b6c4623f3be594beafb1554ab20d9
|
||||
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-auth 7ac80cc3b6a6d52e041bb295e85555ce797be78c15ef2008a64ae58815014080
|
||||
F ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-core 400213eb52a7e5ad5f448053d375cacf4dac2cf45d134f3edfe485ae4a49a183
|
||||
F ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-preupdate d1d62a2212099f2c0782d730beb8cb84a7a52d99c15ead2cb9b1411fff5fd6b1
|
||||
F ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-core 2bcbbfe3b95c043ed6037e2708a2ee078d212dd1612c364f93588d8dc97300fe
|
||||
F ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-extras fe40d6d758646e38f8b15f709044951e10884214f5453d35502100179c388c13
|
||||
F ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-see fb29e62082a658f0d81102488414d422c393c4b20cc2f685b216bc566237957b
|
||||
F ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-session 213b6c04267cb9bd760172db011eb1650732805fb3d01f9395478a8ceec18eb0
|
||||
F ext/wasm/api/EXPORTED_FUNCTIONS.sqlite3-vtab fd57af1f4502a052be27d8402df74be1dc60fcb6a687d372972abd90e424120a
|
||||
F ext/wasm/api/EXPORTED_RUNTIME_METHODS.sqlite3-api 1ec3c73e7d66e95529c3c64ac3de2470b0e9e7fbf7a5b41261c367cf4f1b7287
|
||||
F ext/wasm/api/README.md 34fe11466f9c1d81b10a0469e1114e5f1c5a6365c73d80a1a6ca639a1a358b73
|
||||
F ext/wasm/api/extern-post-js.c-pp.js c4154a7f90c2d7e51fd6738273908152036c3457fdc0b6523f1be3ef51105aac
|
||||
F ext/wasm/api/extern-pre-js.js cc61c09c7a24a07dbecb4c352453c3985170cec12b4e7e7e7a4d11d43c5c8f41
|
||||
F ext/wasm/api/post-js-footer.js cd0a8ec768501d9bd45d325ab0442037fb0e33d1f3b4f08902f15c34720ee4a1
|
||||
F ext/wasm/api/post-js-header.js 04dc12c3edd666b64a1b4ef3b6690c88dcc653f26451fd4734472d8e29c1c122
|
||||
F ext/wasm/api/pre-js.c-pp.js ad906703f7429590f2fbf5e6498513bf727a1a4f0ebfa057afb08161d7511219
|
||||
F ext/wasm/api/pre-js.c-pp.js a614a2c82b12c4d96d8e3ba77330329efc53c4d56a8a7e60ade900f341866cfb
|
||||
F ext/wasm/api/sqlite3-api-cleanup.js d235ad237df6954145404305040991c72ef8b1881715d2a650dda7b3c2576d0e
|
||||
F ext/wasm/api/sqlite3-api-glue.c-pp.js 54b32b5321105a72d6f3d3e8b77f28f162d0367b08c63184263d3f85f3d7dbed
|
||||
F ext/wasm/api/sqlite3-api-glue.c-pp.js fb6dbfe692cc23000a65a4cd95a1a47ed5eb592dc9d8b55363b3c2952a787244
|
||||
F ext/wasm/api/sqlite3-api-oo1.c-pp.js f3a8e2004c6625d17946c11f2fb32008be78bc5207bf746fc77d59848813225f
|
||||
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 09a938fc570f282e602acd111147c7b74b5332da72540c512a79b916ab57882a
|
||||
F ext/wasm/api/sqlite3-wasm.c 83f5e9f998e9fa4261eb84e9f092210e3ffe03895119f5ded0429eb34ab9d2be
|
||||
F ext/wasm/api/sqlite3-worker1-promiser.c-pp.js 46f303ba8ddd1b2f0a391798837beddfa72e8c897038c8047eda49ce7d5ed46b
|
||||
F ext/wasm/api/sqlite3-worker1.c-pp.js 5e8706c2c4af2a57fbcdc02f4e7ef79869971bc21bb8ede777687786ce1c92d5
|
||||
F ext/wasm/batch-runner-sahpool.html e9a38fdeb36a13eac7b50241dfe7ae066fe3f51f5c0b0151e7baee5fce0d07a7
|
||||
F ext/wasm/batch-runner-sahpool.js 54a3ac228e6c4703fe72fb65c897e19156263a51fe9b7e21d2834a45e876aabd
|
||||
F ext/wasm/batch-runner.html 4deeed44fe41496dc6898d9fb17938ea3291f40f4bfb977e29d0cef96fbbe4c8
|
||||
F ext/wasm/batch-runner.js 05ec254f5dbfe605146d9640b3db17d6ef8c3fbef6aa8396051ca72bb5884e3f
|
||||
F ext/wasm/c-pp.c 6d80d8569d85713effe8b0818a3cf51dc779e3f0bf8dc88771b8998552ee25b4
|
||||
F ext/wasm/c-pp.c 6d131069644964223305582a80973477fa8b06b57306781690d7874ebd3a4f84
|
||||
F ext/wasm/common/SqliteTestUtil.js 7adaeffef757d8708418dc9190f72df22367b531831775804b31598b44f6aa51
|
||||
F ext/wasm/common/emscripten.css 11bd104b6c0d597c67d40cc8ecc0a60dae2b965151e3b6a37fa5708bac3acd15
|
||||
F ext/wasm/common/testing.css e97549bab24126c24e0daabfe2de9bb478fb0a69fdb2ddd0a73a992c091aad6f
|
||||
@@ -656,19 +661,20 @@ F ext/wasm/demo-worker1.html 2c178c1890a2beb5a5fecb1453e796d067a4b8d3d2a04d65ca2
|
||||
F ext/wasm/demo-worker1.js 836bece8615b17b1b572584f7b15912236a5947fe8c68b98d2737d7e287447ef
|
||||
F ext/wasm/dist.make 653e212c1e84aa3be168d62a10616ccea45ee9585b0192745d2706707a5248ce
|
||||
F ext/wasm/example_extra_init.c 2347cd69d19d839ef4e5e77b7855103a7fe3ef2af86f2e8c95839afd8b05862f
|
||||
F ext/wasm/fiddle.make 2406b02473878a99fb6a2eaff0923277017adc45eb041b2afb2d7707bf7b375c
|
||||
F ext/wasm/fiddle.make ec2353f0eddade864f67b993376a0949e27b72465c24b1970940e48b70bc2df1
|
||||
F ext/wasm/fiddle/fiddle-worker.js 850e66fce39b89d59e161d1abac43a181a4caa89ddeea162765d660277cd84ce
|
||||
F ext/wasm/fiddle/fiddle.js b444a5646a9aac9f3fc06c53d78af5e1912eb235d69a8e6010723e4eb0e9d4a1
|
||||
F ext/wasm/fiddle/index.html 739e0b75bc592679665d25e2f7649d2b8b2db678f3b41a772a8720b609b8482d
|
||||
F ext/wasm/fiddle/index.html c79b1741cbeba78f88af0a84cf5ec7de87a909a6a8d10a369b1f4824c66c2088
|
||||
F ext/wasm/index-dist.html 564b5ec5669676482c5a25dea9e721d8eafed426ecb155f93d29aeff8507511f
|
||||
F ext/wasm/index.html 4337f495416756802669f69f9f9f3df9f87ee4c1918e6718719b4b5718e4713a
|
||||
F ext/wasm/index.html e4bbffdb3d40eff12b3f9c7abedef91787e2935620b7f8d40f2c774b80ad8fa9
|
||||
F ext/wasm/jaccwabyt/jaccwabyt.js 1264710db3cfbcb6887d95665b7aeba60c1126eaef789ca4cf1a4a17d5bc7f54
|
||||
F ext/wasm/jaccwabyt/jaccwabyt.md 59a20df389abcc3606eb4eaea7fb7ba14504beb3e345dbea9b99a0618ba3bec8
|
||||
F ext/wasm/mkwasmbuilds.c e3580b26bc393e4e4beb25f6349b999878782f3319b740469f64c2e772632e03
|
||||
F ext/wasm/module-symbols.html dc476b403369b26a1a23773e13b80f41b9a49f0825e81435fe3600a7cfbbe337
|
||||
F ext/wasm/scratchpad-wasmfs.html a3d7388f3c4b263676b58b526846e9d02dfcb4014ff29d3a5040935286af5b96
|
||||
F ext/wasm/scratchpad-wasmfs.mjs 66034b9256b218de59248aad796760a1584c1dd842231505895eff00dbd57c63
|
||||
F ext/wasm/speedtest1-wasmfs.html 0e9d335a9b5b5fafe6e1bc8dc0f0ca7e22e6eb916682a2d7c36218bb7d67379d
|
||||
F ext/wasm/speedtest1-wasmfs.mjs ac5cadbf4ffe69e9eaac8b45e8523f030521e02bb67d654c6eb5236d9c456cbe
|
||||
F ext/wasm/speedtest1-wasmfs.mjs c77c7231338ed5c0e1ce16aa29106df8e5b5cf11a48319c49433490a8d3ded30
|
||||
F ext/wasm/speedtest1-worker.html 864b65ed78ce24847a348c180e7f267621a02ca027068a1863ec1c90187c1852
|
||||
F ext/wasm/speedtest1-worker.js 95e549e13a4d35863a9a7fc66122b5f546c0130d3be7b06dfcc556eb66d24bde
|
||||
F ext/wasm/speedtest1.html ff048b4a623aa192e83e143e48f1ce2a899846dd42c023fdedc8772b6e3f07da
|
||||
@@ -679,15 +685,15 @@ 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 a88b9c669715adc1c5e76750ca8c0994ae33d04572e3bf295b6f4f5870f3bdf3
|
||||
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
|
||||
F ext/wasm/wasmfs.make 8a4955882aaa0783b3f60a9484a1f0f3d8b6f775c0fcd17c082f31966f1bc16a
|
||||
F ext/wasm/wasmfs.make bc8bb227f35d5bd3863a7bd2233437c37472a0d81585979f058f9b9b503bef35
|
||||
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
|
||||
F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
|
||||
F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0
|
||||
F main.mk 67e622f31d10fee8f0f62655b4f9b47cd97fe70a125674ca6754b3549d69cc0e
|
||||
F main.mk c6501abe2d915ed1a2ec3d074e652c096177f93c50ac91f815c831e3417f9019
|
||||
F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271
|
||||
F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504
|
||||
F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421
|
||||
@@ -700,28 +706,28 @@ 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 444c4d1eaac40103461e3b6f0881846dd3aafc1cec1dd169d3482fa331667da7
|
||||
F src/expr.c 6d5f2c38fe3ec06a7eac599dac822788b36064124e20112a844e9cd5156cb239
|
||||
F src/delete.c 03a77ba20e54f0f42ebd8eddf15411ed6bdb06a2c472ac4b6b336521bf7cea42
|
||||
F src/expr.c a9d9f5fdfbdd3b2c94d7af1b11f181464b8a641736cf32cb92fa3c5e7ecb30df
|
||||
F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007
|
||||
F src/fkey.c 928ed2517e8732113d2b9821aa37af639688d752f4ea9ac6e0e393d713eeb76f
|
||||
F src/func.c df400a1d3f4625997d4dd8a81951c303e066277c29b861d37e03cd152d7858dd
|
||||
F src/global.c 61a419dd9e993b9be0f91de4c4ccf322b053eb829868e089f0321dd669be3b90
|
||||
F src/func.c 1d093b93b8f097665721e59a1c404d7db4dc591e1a777a7a1022dfbda21e108b
|
||||
F src/global.c a19e4b1ca1335f560e9560e590fc13081e21f670643367f99cb9e8f9dc7d615b
|
||||
F src/hash.c 9ee4269fb1d6632a6fecfb9479c93a1f29271bddbbaf215dd60420bcb80c7220
|
||||
F src/hash.h 3340ab6e1d13e725571d7cee6d3e3135f0779a7d8e76a9ce0a85971fa3953c51
|
||||
F src/hwtime.h f9c2dfb84dce7acf95ce6d289e46f5f9d3d1afd328e53da8f8e9008e3b3caae6
|
||||
@@ -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 e7b53893f9fb3ad76baa8513f85c167b34d5c8e25ce64608db440f5637d0fe9e
|
||||
F src/main.c d55d27db5a3b7bb12e1b723e350efd833586f22baa4b15ca2c0b4bde9a44ae29
|
||||
F src/malloc.c 410e570b30c26cc36e3372577df50f7a96ee3eed5b2b161c6b6b48773c650c5e
|
||||
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
|
||||
F src/mem1.c 3bb59158c38e05f6270e761a9f435bf19827a264c13d1631c58b84bdc96d73b2
|
||||
@@ -751,34 +757,34 @@ 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 6e3e4fc75904ff85184091dbab996e6e35c1799e771788961cc3b4fcbe8f852c
|
||||
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 d99931f45416652895e502328ca49fe782cfc4e1ebdcda13b3736d991ebf42ce
|
||||
F src/printf.c 6a87534ebfb9e5346011191b1f3a7ebc457f5938c7e4feeea478ecf53f6a41b2
|
||||
F src/prepare.c 3ba0ad907b7773ed642f66cea8a2c9c8edc18841aa1050b6218dbb3479e86225
|
||||
F src/printf.c 96f7f8baeedc7639da94e4e7a4a2c200e2537c4eec9e5e1c2ffc821f40eb3105
|
||||
F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c
|
||||
F src/resolve.c 2c127880c0634962837f16f2f48a295e514357af959330cc038de73015d5b5e8
|
||||
F src/resolve.c c8a5372b97b2a2e972a280676f06ddb5b74e885d3b1f5ce383f839907b57ef68
|
||||
F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
|
||||
F src/select.c 4b14337a2742f0c0beeba490e9a05507e9b4b12184b9cd12773501d08d48e3fe
|
||||
F src/shell.c.in 375f8a183126be96ec73db4e42c57917ff10a0900846b1b722dd4f8cef537812
|
||||
F src/sqlite.h.in 77f55bd1978a04a14db211732f0a609077cf60ba4ccf9baf39988f508945419c
|
||||
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 889cd632f4386bbd8619b166abb7d25f1c8ce6514e90cb7f22f63bd530fc6107
|
||||
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 8d7cd219c004cd2ced60659ebf045025cc5c16ce19d12459589dacd4310f7f07
|
||||
F src/test1.c 8bf8b74145b768f42386787f93f6d6dad7bc400a4ee2d50e4ad5a06a20a97ef1
|
||||
F src/test2.c 7ebc518e6735939d8979273a6f7b1d9b5702babf059f6ad62499f7f60a9eb9a3
|
||||
F src/test3.c e7573aa0f78ee4e070a4bc8c3493941c1aa64d5c66d4825c74c0f055451f432b
|
||||
F src/test4.c 13e57ae7ec7a959ee180970aef09deed141252fe9bb07c61054f0dfa4f1dfd5d
|
||||
@@ -792,7 +798,7 @@ F src/test_backup.c bd901e3c116c7f3b3bbbd4aae4ce87d99b400c9cbb0a9e7b4610af451d97
|
||||
F src/test_bestindex.c 3401bee51665cbf7f9ed2552b5795452a8b86365e4c9ece745b54155a55670c6
|
||||
F src/test_blob.c bcdf6a6c22d0bcc13c41479d63692ef413add2a4d30e1e26b9f74ab85b9fb4d5
|
||||
F src/test_btree.c 28283787d32b8fa953eb77412ad0de2c9895260e4e5bd5a94b3c7411664f90d5
|
||||
F src/test_config.c 345b8e383f71cecc36d0fa05f2f06639c254b188f98101c3c97749df43037086
|
||||
F src/test_config.c e8d041a84151cbaee4dd82eb32e4153abe06856bcfab4771968a8cf930a86332
|
||||
F src/test_delete.c e2fe07646dff6300b48d49b2fee2fe192ed389e834dd635e3b3bac0ce0bf9f8f
|
||||
F src/test_demovfs.c 3efa2adf4f21e10d95521721687d5ca047aea91fa62dd8cc22ac9e5a9c942383
|
||||
F src/test_devsym.c 649434ed34d0b03fbd5a6b42df80f0f9a7e53f94dd1710aad5dd8831e91c4e86
|
||||
@@ -834,28 +840,28 @@ F src/treeview.c 88aa39b754f5ef7214385c1bbbdd2f3dc20efafeed0cf590e8d1199b9c6e44a
|
||||
F src/trigger.c 0bb986a5b96047fd597c6aac28588853df56064e576e6b81ba777ef2ccaac461
|
||||
F src/update.c 0e01aa6a3edf9ec112b33eb714b9016a81241497b1fb7c3e74332f4f71756508
|
||||
F src/upsert.c 215328c3f91623c520ec8672c44323553f12caeb4f01b1090ebdca99fdf7b4f1
|
||||
F src/utf.c f23165685a67b4caf8ec08fb274cb3f319103decfb2a980b7cfd55d18dfa855e
|
||||
F src/util.c 5d1a0134cf4240648d1c6bb5cc8efaca0ea2b5d5c840985aec7e947271f04375
|
||||
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 483a391801ecacfeaa1d202c1d4dc2d7e520ba67566ca540868602117d6bdec5
|
||||
F src/vdbeaux.c 676dbee99b4febdd94bc9658667a2e3bc413c4c0e356242d90f98a1155d513e5
|
||||
F src/vdbeapi.c 53c7e26a2c0821a892b20eee2cde4656e31998212f3d515576c780dfaa45fd17
|
||||
F src/vdbeaux.c f06f011e4fac948941ea821ac365a9f1c163ef473e63756d6e499a37c6bda9ef
|
||||
F src/vdbeblob.c 255be187436da38b01f276c02e6a08103489bbe2a7c6c21537b7aecbe0e1f797
|
||||
F src/vdbemem.c 831a244831eaa45335f9ae276b50a7a82ee10d8c46c2c72492d4eb8c98d94d89
|
||||
F src/vdbemem.c df568ef0187e4be2788c35174f6d9b8566ab9475f9aff2d73907ed05aa5684b2
|
||||
F src/vdbesort.c d0a3c7056c081703c8b6d91ad60f17da5e062a5c64bf568ed0fa1b5f4cae311f
|
||||
F src/vdbetrace.c fe0bc29ebd4e02c8bc5c1945f1d2e6be5927ec12c06d89b03ef2a4def34bf823
|
||||
F src/vdbevtab.c fc46b9cbd759dc013f0b3724549cc0d71379183c667df3a5988f7e2f1bd485f3
|
||||
F src/vtab.c 5fb499d20494b7eecaadb7584634af9afcb374cb0524912b475fcb1712458a1b
|
||||
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 7fb55836eb7fd07f0a0d8400c50619fc02cda1f46a617cfb003c2990f040193d
|
||||
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 f2765d7fdc1348ae58b279d096d301a208e46da623213877b2ba580dc2768975
|
||||
F test/atof1.test bd21c4a0e718ab1470de07a2a79f2544d7903be34feebcc80de04beee4807b00
|
||||
F test/atomic.test 065a453dde33c77ff586d91ccaa6ed419829d492dbb1a5694b8a09f3f9d7d061
|
||||
F test/atomic2.test b6863b4aa552543874f80b42fb3063f1c8c2e3d8e56b6562f00a3cc347b5c1da
|
||||
F test/atrc.c c388fac43dbba05c804432a7135ae688b32e8f25818e9994ffba4b64cf60c27c
|
||||
@@ -989,7 +995,7 @@ F test/capi3c.test 31d3a6778f2d06f2d9222bd7660c41a516d1518a059b069e96ebbeadb5a49
|
||||
F test/capi3d.test 8b778794af891b0dca3d900bd345fbc8ebd2aa2aae425a9dccdd10d5233dfbde
|
||||
F test/capi3e.test 3d49c01ef2a1a55f41d73cba2b23b5059ec460fe
|
||||
F test/carray01.test 23ed7074307c4a829ba5ff2970993a9d87db7c5cdbbe1a2cbef672d0df6d6e31
|
||||
F test/cast.test 42f7d79d88ab5e8080e96c650c52fcf72eef3e6476aaaee2c9f6e074396cfdfc
|
||||
F test/cast.test 6d095303492432a973e6dfc0071cb94cac2969ffbe2e6a68432be0c7b3b0a2d3
|
||||
F test/cffault.test 9d6b20606afe712374952eec4f8fd74b1a8097ef
|
||||
F test/changes.test 4377d202a487f66fc2822c1bf57c46798c8b2caf7446f4f701723b1dbb6b86f6
|
||||
F test/changes2.test 07949edcc732af28cb54276bfb7d99723bccc1e905a423648bf57ac5cb0dc792
|
||||
@@ -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
|
||||
@@ -1153,7 +1160,7 @@ F test/fkey8.test 51deda7f1a1448bca95875e4a6e1a3a75b4bd7215e924e845bd60de60e4d84
|
||||
F test/fkey_malloc.test 594a7ea1fbab553c036c70813cd8bd9407d63749
|
||||
F test/fordelete.test ba98f14446b310f9c9d935b97ec748753d0144a28b356ba30d1f4f6958fdde5c
|
||||
F test/format4.test eeae341953db8b6bda7f549044797c3278a6cc345d11ada81471671b654f8ef4
|
||||
F test/fp-speed-1.c ca95152d579530c967240ead1387dc1208052d310dfa22bc9ebded56d4e6c026
|
||||
F test/fp-speed-1.c b37de94eba034e1703668816225f54510ec60fb0685406608cc707afe6b8234d
|
||||
F test/fpconv1.test d5d8aa0c427533006c112fb1957cdd1ea68c1d0709470dabb9ca02c2e4c06ad8
|
||||
F test/fts-9fd058691.test 78b887e30ae6816df0e1fed6259de4b5a64ad33c
|
||||
F test/fts3.test 672a040ea57036fb4b6fdc09027c18d7d24ab654
|
||||
@@ -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
|
||||
@@ -1251,10 +1259,10 @@ F test/fts4umlaut.test fcaca4471de7e78c9d1f7e8976e3e8704d7d8ad979d57a739d00f3f75
|
||||
F test/fts4unicode.test 82a9c16b68ba2f358a856226bb2ee02f81583797bc4744061c54401bf1a0f4c9
|
||||
F test/fts4upfrom.test f25835162c989dffd5e2ef91ec24c4848cc9973093e2d492d1c7b32afac1b49d
|
||||
F test/full.test 6b3c8fb43c6beab6b95438c1675374b95fab245d
|
||||
F test/func.test b56905748ce0567c01d60005f3e6ad1af19453d224ba4730ee687d048fd09ef9
|
||||
F test/func.test 098d28ecd1284e0625797a981c9dbf7c1664763af2900f96b9716af80e6cbe40
|
||||
F test/func2.test 69f6ae3751b4ec765bdc3b803c0a255aa0f693f28f44805bef03e6b4a3fd242f
|
||||
F test/func3.test 600a632c305a88f3946d38f9a51efe145c989b2e13bd2b2a488db47fe76bab6a
|
||||
F test/func4.test a3f9062487dbd826776f54f4e0e9517fe8c3cf689af92735308965774d51fac5
|
||||
F test/func4.test a02e695f62beb31cb092dccf6873ff97543407fff97a5f3ec4da70b5b337bc84
|
||||
F test/func5.test 863e6d1bd0013d09c17236f8a13ea34008dd857d87d85a13a673960e4c25d82a
|
||||
F test/func6.test 3bc89ec0f2605736d3a118f43d25ef58115a7db4dba8ae939a363917d815c0bb
|
||||
F test/func7.test 7e009275f52c52954c8c028fdb62f8bc16cc47276fcc8753c1d2b22c6e074598
|
||||
@@ -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 490bf9d0c7c9564fea318c46d49369f4690b825b584c9a544dbdccf61bc0babc
|
||||
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
|
||||
@@ -1668,7 +1677,7 @@ F test/speed3.test 694affeb9100526007436334cf7d08f3d74b85ef
|
||||
F test/speed4.test abc0ad3399dcf9703abed2fff8705e4f8e416715
|
||||
F test/speed4p.explain 6b5f104ebeb34a038b2f714150f51d01143e59aa
|
||||
F test/speed4p.test 377a0c48e5a92e0b11c1c5ebb1bc9d83a7312c922bc0cb05970ef5d6a96d1f0c
|
||||
F test/speedtest1.c 19c9b60908d25502d2831f97efee8b81006c356ab8c08327e25d24a4144f2131
|
||||
F test/speedtest1.c cc503febbb8559d541a67d7a33d3d7bb8a2c8cbbfc89eb336e2e2bd6ad6a63ee
|
||||
F test/spellfix.test 951a6405d49d1a23d6b78027d3877b4a33eeb8221dcab5704b499755bb4f552e
|
||||
F test/spellfix2.test dfc8f519a3fc204cb2dfa8b4f29821ae90f6f8c3
|
||||
F test/spellfix3.test 0f9efaaa502a0e0a09848028518a6fb096c8ad33
|
||||
@@ -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,8 +1724,8 @@ 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_data.tcl dbc0bb1c5b912dfd1e32b25d544318e412edd6085bd5fc9e6619cb93a739b786
|
||||
F test/testrunner.tcl 6215e11be403a16947bbb3b31cf4905b417155df242e4c5229f85bcda1c28f50 x
|
||||
F test/testrunner_data.tcl c7b3b911e44f7e8c01cc6bc7571e16115cdc2e4db46630bd2acd7a931a46380e
|
||||
F test/thread001.test a0985c117eab62c0c65526e9fa5d1360dd1cac5b03bde223902763274ce21899
|
||||
F test/thread002.test c24c83408e35ba5a952a3638b7ac03ccdf1ce4409289c54a050ac4c5f1de7502
|
||||
F test/thread003.test ee4c9efc3b86a6a2767516a37bd64251272560a7
|
||||
@@ -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
|
||||
@@ -2165,7 +2174,7 @@ F tool/showstat4.c 0682ebea7abf4d3657f53c4a243f2e7eab48eab344ed36a94bb75dcd19a5c
|
||||
F tool/showwal.c 11eca547980a066b081f512636151233350ac679f29ecf4ebfce7f4530230b3d
|
||||
F tool/soak1.tcl 8d407956e1a45b485a8e072470a3e629a27037fe
|
||||
F tool/spaceanal.tcl 1f83962090a6b60e1d7bf92495d643e622bef9fe82ea3f2d22350dcbce9a12d0
|
||||
F tool/speed-check.sh e8d20cc2eb9c85ec1ba562226de144435456dcdff4ee618de49603c6958f6116
|
||||
F tool/speed-check.sh e566ab3934d7d78631743a984ad3f67c331c911bb18ff5d0a6c616a2afee7f91
|
||||
F tool/speedtest.tcl 06c76698485ccf597b9e7dbb1ac70706eb873355
|
||||
F tool/speedtest16.c ecb6542862151c3e6509bbc00509b234562ae81e
|
||||
F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
|
||||
@@ -2173,12 +2182,12 @@ F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
||||
F tool/speedtest8inst1.c 7ce07da76b5e745783e703a834417d725b7d45fd
|
||||
F tool/spellsift.tcl 52b4b04dc4333c7ab024f09d9d66ed6b6f7c6eb00b38497a09f338fa55d40618 x
|
||||
F tool/split-sqlite3c.tcl 5aa60643afca558bc732b1444ae81a522326f91e1dc5665b369c54f09e20de60
|
||||
F tool/sqldiff.c 847fc8fcfddf5ce4797b7394cad6372f2f5dc17d8186e2ef8fb44d50fae4f44a
|
||||
F tool/sqlite3-rsync.c f4904e012de382a6ffaf67032f684c209c003eb819e3db7999f393550798c53a
|
||||
F tool/sqlite3_analyzer.c.in 8da2b08f56eeac331a715036cf707cc20f879f231362be0c22efd682e2b89b4f
|
||||
F tool/sqldiff.c 2a0987d183027c795ced13d6749061c1d2f38e24eddb428f56fa64c3a8f51e4b
|
||||
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,11 +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 a63e412b6b2939422ecfa99d91fccb7a9c61e1533bb0db20ff12f3815ef41a2c
|
||||
R 2022f5c82821db1ada9b61c2c71e65f9
|
||||
T *branch * preupdate-hook-fix
|
||||
T *sym-preupdate-hook-fix *
|
||||
T -sym-trunk *
|
||||
U dan
|
||||
Z c649b0105c7af3011732c3c809572a4f
|
||||
P 07bd06b13c42edb3a3efa8f26d48823c9ffa3d5ec8d06ee21a33b6c1d29b4726
|
||||
R 3df4e8abea3bba7571d6c59d3633b08c
|
||||
T +sym-release *
|
||||
T +sym-version-3.47.2 *
|
||||
U drh
|
||||
Z 2b27d6949c6873483f90ec22ca9e3998
|
||||
# Remove this line to create a well-formed Fossil manifest.
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
00a398cf900179aa5a8aab09fe4a671d99e7a31583282848ef39390f2ef246eb
|
||||
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 */
|
||||
};
|
||||
|
||||
@@ -75,6 +75,7 @@ void sqlite3CodeChangeCount(Vdbe *v, int regCounter, const char *zColName){
|
||||
** is for a top-level SQL statement.
|
||||
*/
|
||||
static int vtabIsReadOnly(Parse *pParse, Table *pTab){
|
||||
assert( IsVirtual(pTab) );
|
||||
if( sqlite3GetVTable(pParse->db, pTab)->pMod->pModule->xUpdate==0 ){
|
||||
return 1;
|
||||
}
|
||||
|
||||
+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 ),
|
||||
|
||||
@@ -243,7 +243,6 @@ SQLITE_WSD struct Sqlite3Config sqlite3Config = {
|
||||
SQLITE_ALLOW_COVERING_INDEX_SCAN, /* bUseCis */
|
||||
0, /* bSmallMalloc */
|
||||
1, /* bExtraSchemaChecks */
|
||||
sizeof(LONGDOUBLE_TYPE)>8, /* bUseLongDouble */
|
||||
#ifdef SQLITE_DEBUG
|
||||
0, /* bJsonSelfcheck */
|
||||
#endif
|
||||
|
||||
+5
-51
@@ -159,32 +159,6 @@ char *sqlite3_temp_directory = 0;
|
||||
*/
|
||||
char *sqlite3_data_directory = 0;
|
||||
|
||||
/*
|
||||
** Determine whether or not high-precision (long double) floating point
|
||||
** math works correctly on CPU currently running.
|
||||
*/
|
||||
static SQLITE_NOINLINE int hasHighPrecisionDouble(int rc){
|
||||
if( sizeof(LONGDOUBLE_TYPE)<=8 ){
|
||||
/* If the size of "long double" is not more than 8, then
|
||||
** high-precision math is not possible. */
|
||||
return 0;
|
||||
}else{
|
||||
/* Just because sizeof(long double)>8 does not mean that the underlying
|
||||
** hardware actually supports high-precision floating point. For example,
|
||||
** clearing the 0x100 bit in the floating-point control word on Intel
|
||||
** processors will make long double work like double, even though long
|
||||
** double takes up more space. The only way to determine if long double
|
||||
** actually works is to run an experiment. */
|
||||
LONGDOUBLE_TYPE a, b, c;
|
||||
rc++;
|
||||
a = 1.0+rc*0.1;
|
||||
b = 1.0e+18+rc*25.0;
|
||||
c = a+b;
|
||||
return b!=c;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Initialize SQLite.
|
||||
**
|
||||
@@ -379,13 +353,6 @@ int sqlite3_initialize(void){
|
||||
rc = SQLITE_EXTRA_INIT(0);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Experimentally determine if high-precision floating point is
|
||||
** available. */
|
||||
#ifndef SQLITE_OMIT_WSD
|
||||
sqlite3Config.bUseLongDouble = hasHighPrecisionDouble(rc);
|
||||
#endif
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -3482,6 +3449,7 @@ static int openDatabase(
|
||||
if( ((1<<(flags&7)) & 0x46)==0 ){
|
||||
rc = SQLITE_MISUSE_BKPT; /* IMP: R-18321-05872 */
|
||||
}else{
|
||||
if( zFilename==0 ) zFilename = ":memory:";
|
||||
rc = sqlite3ParseUri(zVfs, zFilename, &flags, &db->pVfs, &zOpen, &zErrMsg);
|
||||
}
|
||||
if( rc!=SQLITE_OK ){
|
||||
@@ -4637,24 +4605,6 @@ int sqlite3_test_control(int op, ...){
|
||||
break;
|
||||
}
|
||||
|
||||
#if !defined(SQLITE_OMIT_WSD)
|
||||
/* sqlite3_test_control(SQLITE_TESTCTRL_USELONGDOUBLE, int X);
|
||||
**
|
||||
** X<0 Make no changes to the bUseLongDouble. Just report value.
|
||||
** X==0 Disable bUseLongDouble
|
||||
** X==1 Enable bUseLongDouble
|
||||
** X>=2 Set bUseLongDouble to its default value for this platform
|
||||
*/
|
||||
case SQLITE_TESTCTRL_USELONGDOUBLE: {
|
||||
int b = va_arg(ap, int);
|
||||
if( b>=2 ) b = hasHighPrecisionDouble(b);
|
||||
if( b>=0 ) sqlite3Config.bUseLongDouble = b>0;
|
||||
rc = sqlite3Config.bUseLongDouble!=0;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(SQLITE_DEBUG) && !defined(SQLITE_OMIT_WSD)
|
||||
/* sqlite3_test_control(SQLITE_TESTCTRL_TUNE, id, *piValue)
|
||||
**
|
||||
@@ -4962,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);
|
||||
}
|
||||
|
||||
+24
-44
@@ -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;
|
||||
}
|
||||
@@ -4159,7 +4139,7 @@ static void setDeviceCharacteristics(unixFile *pFd){
|
||||
static void setDeviceCharacteristics(unixFile *pFile){
|
||||
if( pFile->sectorSize == 0 ){
|
||||
struct statvfs fsInfo;
|
||||
|
||||
|
||||
/* Set defaults for non-supported filesystems */
|
||||
pFile->sectorSize = SQLITE_DEFAULT_SECTOR_SIZE;
|
||||
pFile->deviceCharacteristics = 0;
|
||||
@@ -4199,7 +4179,7 @@ static void setDeviceCharacteristics(unixFile *pFile){
|
||||
pFile->sectorSize = fsInfo.f_bsize;
|
||||
pFile->deviceCharacteristics =
|
||||
/* full bitset of atomics from max sector size and smaller */
|
||||
((pFile->sectorSize / 512 * SQLITE_IOCAP_ATOMIC512) << 1) - 2 |
|
||||
(((pFile->sectorSize / 512 * SQLITE_IOCAP_ATOMIC512) << 1) - 2) |
|
||||
SQLITE_IOCAP_SEQUENTIAL | /* The ram filesystem has no write behind
|
||||
** so it is ordered */
|
||||
0;
|
||||
@@ -4207,7 +4187,7 @@ static void setDeviceCharacteristics(unixFile *pFile){
|
||||
pFile->sectorSize = fsInfo.f_bsize;
|
||||
pFile->deviceCharacteristics =
|
||||
/* full bitset of atomics from max sector size and smaller */
|
||||
((pFile->sectorSize / 512 * SQLITE_IOCAP_ATOMIC512) << 1) - 2 |
|
||||
(((pFile->sectorSize / 512 * SQLITE_IOCAP_ATOMIC512) << 1) - 2) |
|
||||
SQLITE_IOCAP_SEQUENTIAL | /* The ram filesystem has no write behind
|
||||
** so it is ordered */
|
||||
0;
|
||||
|
||||
+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 */
|
||||
|
||||
+13
-1
@@ -1007,12 +1007,24 @@ static int sqlite3Prepare16(
|
||||
if( !sqlite3SafetyCheckOk(db)||zSql==0 ){
|
||||
return SQLITE_MISUSE_BKPT;
|
||||
}
|
||||
|
||||
/* Make sure nBytes is non-negative and correct. It should be the
|
||||
** number of bytes until the end of the input buffer or until the first
|
||||
** U+0000 character. If the input nBytes is odd, convert it into
|
||||
** an even number. If the input nBytes is negative, then the input
|
||||
** must be terminated by at least one U+0000 character */
|
||||
if( nBytes>=0 ){
|
||||
int sz;
|
||||
const char *z = (const char*)zSql;
|
||||
for(sz=0; sz<nBytes && (z[sz]!=0 || z[sz+1]!=0); sz += 2){}
|
||||
nBytes = sz;
|
||||
}else{
|
||||
int sz;
|
||||
const char *z = (const char*)zSql;
|
||||
for(sz=0; z[sz]!=0 || z[sz+1]!=0; sz += 2){}
|
||||
nBytes = sz;
|
||||
}
|
||||
|
||||
sqlite3_mutex_enter(db->mutex);
|
||||
zSql8 = sqlite3Utf16to8(db, zSql, nBytes, SQLITE_UTF16NATIVE);
|
||||
if( zSql8 ){
|
||||
@@ -1026,7 +1038,7 @@ static int sqlite3Prepare16(
|
||||
** the same number of characters into the UTF-16 string.
|
||||
*/
|
||||
int chars_parsed = sqlite3Utf8CharLen(zSql8, (int)(zTail8-zSql8));
|
||||
*pzTail = (u8 *)zSql + sqlite3Utf16ByteLen(zSql, chars_parsed);
|
||||
*pzTail = (u8 *)zSql + sqlite3Utf16ByteLen(zSql, nBytes, chars_parsed);
|
||||
}
|
||||
sqlite3DbFree(db, zSql8);
|
||||
rc = sqlite3ApiExit(db, rc);
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
+23
-3
@@ -486,7 +486,7 @@ static int lookupName(
|
||||
*/
|
||||
if( cntTab==0
|
||||
|| (cntTab==1
|
||||
&& ALWAYS(pMatch!=0)
|
||||
&& pMatch!=0
|
||||
&& ALWAYS(pMatch->pSTab!=0)
|
||||
&& (pMatch->pSTab->tabFlags & TF_Ephemeral)!=0
|
||||
&& (pTab->tabFlags & TF_Ephemeral)==0)
|
||||
@@ -1119,8 +1119,8 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
|
||||
/* Resolve function names
|
||||
*/
|
||||
case TK_FUNCTION: {
|
||||
ExprList *pList = pExpr->x.pList; /* The argument list */
|
||||
int n = pList ? pList->nExpr : 0; /* Number of arguments */
|
||||
ExprList *pList; /* The argument list */
|
||||
int n; /* Number of arguments */
|
||||
int no_such_func = 0; /* True if no such function exists */
|
||||
int wrong_num_args = 0; /* True if wrong number of arguments */
|
||||
int is_agg = 0; /* True if is an aggregate function */
|
||||
@@ -1133,6 +1133,8 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
|
||||
#endif
|
||||
assert( !ExprHasProperty(pExpr, EP_xIsSelect|EP_IntValue) );
|
||||
assert( pExpr->pLeft==0 || pExpr->pLeft->op==TK_ORDER );
|
||||
pList = pExpr->x.pList;
|
||||
n = pList ? pList->nExpr : 0;
|
||||
zId = pExpr->u.zToken;
|
||||
pDef = sqlite3FindFunction(pParse->db, zId, n, enc, 0);
|
||||
if( pDef==0 ){
|
||||
@@ -1181,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{
|
||||
|
||||
+1069
-755
File diff suppressed because it is too large
Load Diff
+35
-4
@@ -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
|
||||
@@ -4222,13 +4231,17 @@ int sqlite3_limit(sqlite3*, int id, int newVal);
|
||||
** and sqlite3_prepare16_v3() use UTF-16.
|
||||
**
|
||||
** ^If the nByte argument is negative, then zSql is read up to the
|
||||
** first zero terminator. ^If nByte is positive, then it is the
|
||||
** number of bytes read from zSql. ^If nByte is zero, then no prepared
|
||||
** first zero terminator. ^If nByte is positive, then it is the maximum
|
||||
** number of bytes read from zSql. When nByte is positive, zSql is read
|
||||
** up to the first zero terminator or until the nByte bytes have been read,
|
||||
** whichever comes first. ^If nByte is zero, then no prepared
|
||||
** statement is generated.
|
||||
** If the caller knows that the supplied string is nul-terminated, then
|
||||
** there is a small performance advantage to passing an nByte parameter that
|
||||
** 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 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
|
||||
@@ -5599,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.
|
||||
@@ -8364,7 +8377,7 @@ int sqlite3_test_control(int op, ...);
|
||||
#define SQLITE_TESTCTRL_TRACEFLAGS 31
|
||||
#define SQLITE_TESTCTRL_TUNE 32
|
||||
#define SQLITE_TESTCTRL_LOGEST 33
|
||||
#define SQLITE_TESTCTRL_USELONGDOUBLE 34
|
||||
#define SQLITE_TESTCTRL_USELONGDOUBLE 34 /* NOT USED */
|
||||
#define SQLITE_TESTCTRL_LAST 34 /* Largest TESTCTRL */
|
||||
|
||||
/*
|
||||
@@ -9340,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 */
|
||||
@@ -10539,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
|
||||
|
||||
+5
-18
@@ -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.
|
||||
@@ -660,7 +661,6 @@
|
||||
# define float sqlite_int64
|
||||
# define fabs(X) ((X)<0?-(X):(X))
|
||||
# define sqlite3IsOverflow(X) 0
|
||||
# define LONGDOUBLE_TYPE sqlite_int64
|
||||
# ifndef SQLITE_BIG_DBL
|
||||
# define SQLITE_BIG_DBL (((sqlite3_int64)1)<<50)
|
||||
# endif
|
||||
@@ -835,9 +835,6 @@
|
||||
# define INT8_TYPE signed char
|
||||
# endif
|
||||
#endif
|
||||
#ifndef LONGDOUBLE_TYPE
|
||||
# define LONGDOUBLE_TYPE long double
|
||||
#endif
|
||||
typedef sqlite_int64 i64; /* 8-byte signed integer */
|
||||
typedef sqlite_uint64 u64; /* 8-byte unsigned integer */
|
||||
typedef UINT32_TYPE u32; /* 4-byte unsigned integer */
|
||||
@@ -3107,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.
|
||||
@@ -3663,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 ...)".
|
||||
**
|
||||
@@ -4262,7 +4259,6 @@ struct Sqlite3Config {
|
||||
u8 bUseCis; /* Use covering indices for full-scans */
|
||||
u8 bSmallMalloc; /* Avoid large memory allocations if true */
|
||||
u8 bExtraSchemaChecks; /* Verify type,name,tbl_name in schema */
|
||||
u8 bUseLongDouble; /* Make use of long double */
|
||||
#ifdef SQLITE_DEBUG
|
||||
u8 bJsonSelfcheck; /* Double-check JSON parsing */
|
||||
#endif
|
||||
@@ -4637,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
|
||||
@@ -5267,7 +5254,7 @@ int sqlite3GetInt32(const char *, int*);
|
||||
int sqlite3GetUInt32(const char*, u32*);
|
||||
int sqlite3Atoi(const char*);
|
||||
#ifndef SQLITE_OMIT_UTF16
|
||||
int sqlite3Utf16ByteLen(const void *pData, int nChar);
|
||||
int sqlite3Utf16ByteLen(const void *pData, int nByte, int nChar);
|
||||
#endif
|
||||
int sqlite3Utf8CharLen(const char *pData, int nByte);
|
||||
u32 sqlite3Utf8Read(const u8**);
|
||||
|
||||
+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"
|
||||
|
||||
-35
@@ -7313,37 +7313,6 @@ static int SQLITE_TCLAPI extra_schema_checks(
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** tclcmd: use_long_double BOOLEAN|"default"
|
||||
**
|
||||
** If no argument, report the current value of the use-long-double flag.
|
||||
**
|
||||
** If argument is "default", set the use-long-double flag to the default
|
||||
** value for this build, based on the size of LONGDOUBLE_TYPE.
|
||||
**
|
||||
** If argument is a boolean, set the use-long-double flag accordingly.
|
||||
**
|
||||
** Return the new setting.
|
||||
*/
|
||||
static int SQLITE_TCLAPI use_long_double(
|
||||
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
|
||||
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
|
||||
int objc, /* Number of arguments */
|
||||
Tcl_Obj *CONST objv[] /* Command arguments */
|
||||
){
|
||||
int i = -1;
|
||||
if( objc==2 ){
|
||||
if( strcmp(Tcl_GetString(objv[1]),"default")==0 ){
|
||||
i = 2;
|
||||
}else{
|
||||
if( Tcl_GetBooleanFromObj(interp,objv[1],&i) ) return TCL_ERROR;
|
||||
}
|
||||
}
|
||||
i = sqlite3_test_control(SQLITE_TESTCTRL_USELONGDOUBLE, i);
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(i));
|
||||
return TCL_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
** tclcmd: database_may_be_corrupt
|
||||
**
|
||||
@@ -9150,7 +9119,6 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
|
||||
{ "reset_prng_state", reset_prng_state, 0 },
|
||||
{ "prng_seed", prng_seed, 0 },
|
||||
{ "extra_schema_checks", extra_schema_checks, 0},
|
||||
{ "use_long_double", use_long_double, 0},
|
||||
{ "database_never_corrupt", database_never_corrupt, 0},
|
||||
{ "database_may_be_corrupt", database_may_be_corrupt, 0},
|
||||
{ "optimization_control", optimization_control,0},
|
||||
@@ -9299,7 +9267,6 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
|
||||
#endif
|
||||
};
|
||||
static int bitmask_size = sizeof(Bitmask)*8;
|
||||
static int longdouble_size = sizeof(LONGDOUBLE_TYPE);
|
||||
int i;
|
||||
extern int sqlite3_sync_count, sqlite3_fullsync_count;
|
||||
extern int sqlite3_opentemp_count;
|
||||
@@ -9400,8 +9367,6 @@ int Sqlitetest1_Init(Tcl_Interp *interp){
|
||||
(char*)&sqlite3_data_directory, TCL_LINK_STRING);
|
||||
Tcl_LinkVar(interp, "bitmask_size",
|
||||
(char*)&bitmask_size, TCL_LINK_INT|TCL_LINK_READ_ONLY);
|
||||
Tcl_LinkVar(interp, "longdouble_size",
|
||||
(char*)&longdouble_size, TCL_LINK_INT|TCL_LINK_READ_ONLY);
|
||||
Tcl_LinkVar(interp, "sqlite_sync_count",
|
||||
(char*)&sqlite3_sync_count, TCL_LINK_INT);
|
||||
Tcl_LinkVar(interp, "sqlite_fullsync_count",
|
||||
|
||||
@@ -512,10 +512,6 @@ static void set_options(Tcl_Interp *interp){
|
||||
Tcl_SetVar2(interp, "sqlite_options", "lookaside", "1", TCL_GLOBAL_ONLY);
|
||||
#endif
|
||||
|
||||
Tcl_SetVar2(interp, "sqlite_options", "long_double",
|
||||
sizeof(LONGDOUBLE_TYPE)>sizeof(double) ? "1" : "0",
|
||||
TCL_GLOBAL_ONLY);
|
||||
|
||||
#ifdef SQLITE_OMIT_MEMORYDB
|
||||
Tcl_SetVar2(interp, "sqlite_options", "memorydb", "0", TCL_GLOBAL_ONLY);
|
||||
#else
|
||||
|
||||
@@ -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 \
|
||||
@@ -514,20 +514,22 @@ char *sqlite3Utf16to8(sqlite3 *db, const void *z, int nByte, u8 enc){
|
||||
}
|
||||
|
||||
/*
|
||||
** zIn is a UTF-16 encoded unicode string at least nChar characters long.
|
||||
** zIn is a UTF-16 encoded unicode string at least nByte bytes long.
|
||||
** Return the number of bytes in the first nChar unicode characters
|
||||
** in pZ. nChar must be non-negative.
|
||||
** in pZ. nChar must be non-negative. Surrogate pairs count as a single
|
||||
** character.
|
||||
*/
|
||||
int sqlite3Utf16ByteLen(const void *zIn, int nChar){
|
||||
int sqlite3Utf16ByteLen(const void *zIn, int nByte, int nChar){
|
||||
int c;
|
||||
unsigned char const *z = zIn;
|
||||
unsigned char const *zEnd = &z[nByte-1];
|
||||
int n = 0;
|
||||
|
||||
if( SQLITE_UTF16NATIVE==SQLITE_UTF16LE ) z++;
|
||||
while( n<nChar ){
|
||||
while( n<nChar && ALWAYS(z<=zEnd) ){
|
||||
c = z[0];
|
||||
z += 2;
|
||||
if( c>=0xd8 && c<0xdc && z[0]>=0xdc && z[0]<0xe0 ) z += 2;
|
||||
if( c>=0xd8 && c<0xdc && z<=zEnd && z[0]>=0xdc && z[0]<0xe0 ) z += 2;
|
||||
n++;
|
||||
}
|
||||
return (int)(z-(unsigned char const *)zIn)
|
||||
|
||||
+74
-119
@@ -539,6 +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];
|
||||
|
||||
assert( enc==SQLITE_UTF8 || enc==SQLITE_UTF16LE || enc==SQLITE_UTF16BE );
|
||||
*pResult = 0.0; /* Default return value, in case of an error */
|
||||
@@ -641,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--;
|
||||
}
|
||||
@@ -650,68 +652,46 @@ do_atof_calc:
|
||||
e++;
|
||||
}
|
||||
|
||||
if( e==0 ){
|
||||
*pResult = s;
|
||||
}else if( sqlite3Config.bUseLongDouble ){
|
||||
LONGDOUBLE_TYPE r = (LONGDOUBLE_TYPE)s;
|
||||
if( e>0 ){
|
||||
while( e>=100 ){ e-=100; r *= 1.0e+100L; }
|
||||
while( e>=10 ){ e-=10; r *= 1.0e+10L; }
|
||||
while( e>=1 ){ e-=1; r *= 1.0e+01L; }
|
||||
}else{
|
||||
while( e<=-100 ){ e+=100; r *= 1.0e-100L; }
|
||||
while( e<=-10 ){ e+=10; r *= 1.0e-10L; }
|
||||
while( e<=-1 ){ e+=1; r *= 1.0e-01L; }
|
||||
rr[0] = (double)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;
|
||||
dekkerMul2(rr, 1.0e+100, -1.5902891109759918046e+83);
|
||||
}
|
||||
assert( r>=0.0 );
|
||||
if( r>+1.7976931348623157081452742373e+308L ){
|
||||
#ifdef INFINITY
|
||||
*pResult = +INFINITY;
|
||||
#else
|
||||
*pResult = 1.0e308*10.0;
|
||||
#endif
|
||||
}else{
|
||||
*pResult = (double)r;
|
||||
while( e>=10 ){
|
||||
e -= 10;
|
||||
dekkerMul2(rr, 1.0e+10, 0.0);
|
||||
}
|
||||
while( e>=1 ){
|
||||
e -= 1;
|
||||
dekkerMul2(rr, 1.0e+01, 0.0);
|
||||
}
|
||||
}else{
|
||||
double rr[2];
|
||||
u64 s2;
|
||||
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);
|
||||
if( e>0 ){
|
||||
while( e>=100 ){
|
||||
e -= 100;
|
||||
dekkerMul2(rr, 1.0e+100, -1.5902891109759918046e+83);
|
||||
}
|
||||
while( e>=10 ){
|
||||
e -= 10;
|
||||
dekkerMul2(rr, 1.0e+10, 0.0);
|
||||
}
|
||||
while( e>=1 ){
|
||||
e -= 1;
|
||||
dekkerMul2(rr, 1.0e+01, 0.0);
|
||||
}
|
||||
}else{
|
||||
while( e<=-100 ){
|
||||
e += 100;
|
||||
dekkerMul2(rr, 1.0e-100, -1.99918998026028836196e-117);
|
||||
}
|
||||
while( e<=-10 ){
|
||||
e += 10;
|
||||
dekkerMul2(rr, 1.0e-10, -3.6432197315497741579e-27);
|
||||
}
|
||||
while( e<=-1 ){
|
||||
e += 1;
|
||||
dekkerMul2(rr, 1.0e-01, -5.5511151231257827021e-18);
|
||||
}
|
||||
while( e<=-100 ){
|
||||
e += 100;
|
||||
dekkerMul2(rr, 1.0e-100, -1.99918998026028836196e-117);
|
||||
}
|
||||
while( e<=-10 ){
|
||||
e += 10;
|
||||
dekkerMul2(rr, 1.0e-10, -3.6432197315497741579e-27);
|
||||
}
|
||||
while( e<=-1 ){
|
||||
e += 1;
|
||||
dekkerMul2(rr, 1.0e-01, -5.5511151231257827021e-18);
|
||||
}
|
||||
*pResult = rr[0]+rr[1];
|
||||
if( sqlite3IsNaN(*pResult) ) *pResult = 1e300*1e300;
|
||||
}
|
||||
*pResult = rr[0]+rr[1];
|
||||
if( sqlite3IsNaN(*pResult) ) *pResult = 1e300*1e300;
|
||||
if( sign<0 ) *pResult = -*pResult;
|
||||
assert( !sqlite3IsNaN(*pResult) );
|
||||
|
||||
@@ -1032,9 +1012,10 @@ void sqlite3FpDecode(FpDecode *p, double r, int iRound, int mxRound){
|
||||
int i;
|
||||
u64 v;
|
||||
int e, exp = 0;
|
||||
double rr[2];
|
||||
|
||||
p->isSpecial = 0;
|
||||
p->z = p->zBuf;
|
||||
|
||||
assert( mxRound>0 );
|
||||
|
||||
/* Convert negative numbers to positive. Deal with Infinity, 0.0, and
|
||||
@@ -1062,62 +1043,45 @@ void sqlite3FpDecode(FpDecode *p, double r, int iRound, int mxRound){
|
||||
|
||||
/* Multiply r by powers of ten until it lands somewhere in between
|
||||
** 1.0e+19 and 1.0e+17.
|
||||
**
|
||||
** Use Dekker-style double-double computation to increase the
|
||||
** precision.
|
||||
**
|
||||
** The error terms on constants like 1.0e+100 computed using the
|
||||
** decimal extension, for example as follows:
|
||||
**
|
||||
** SELECT decimal_exp(decimal_sub('1.0e+100',decimal(1.0e+100)));
|
||||
*/
|
||||
if( sqlite3Config.bUseLongDouble ){
|
||||
LONGDOUBLE_TYPE rr = r;
|
||||
if( rr>=1.0e+19 ){
|
||||
while( rr>=1.0e+119L ){ exp+=100; rr *= 1.0e-100L; }
|
||||
while( rr>=1.0e+29L ){ exp+=10; rr *= 1.0e-10L; }
|
||||
while( rr>=1.0e+19L ){ exp++; rr *= 1.0e-1L; }
|
||||
}else{
|
||||
while( rr<1.0e-97L ){ exp-=100; rr *= 1.0e+100L; }
|
||||
while( rr<1.0e+07L ){ exp-=10; rr *= 1.0e+10L; }
|
||||
while( rr<1.0e+17L ){ exp--; rr *= 1.0e+1L; }
|
||||
rr[0] = r;
|
||||
rr[1] = 0.0;
|
||||
if( rr[0]>9.223372036854774784e+18 ){
|
||||
while( rr[0]>9.223372036854774784e+118 ){
|
||||
exp += 100;
|
||||
dekkerMul2(rr, 1.0e-100, -1.99918998026028836196e-117);
|
||||
}
|
||||
while( rr[0]>9.223372036854774784e+28 ){
|
||||
exp += 10;
|
||||
dekkerMul2(rr, 1.0e-10, -3.6432197315497741579e-27);
|
||||
}
|
||||
while( rr[0]>9.223372036854774784e+18 ){
|
||||
exp += 1;
|
||||
dekkerMul2(rr, 1.0e-01, -5.5511151231257827021e-18);
|
||||
}
|
||||
v = (u64)rr;
|
||||
}else{
|
||||
/* If high-precision floating point is not available using "long double",
|
||||
** then use Dekker-style double-double computation to increase the
|
||||
** precision.
|
||||
**
|
||||
** The error terms on constants like 1.0e+100 computed using the
|
||||
** decimal extension, for example as follows:
|
||||
**
|
||||
** SELECT decimal_exp(decimal_sub('1.0e+100',decimal(1.0e+100)));
|
||||
*/
|
||||
double rr[2];
|
||||
rr[0] = r;
|
||||
rr[1] = 0.0;
|
||||
if( rr[0]>9.223372036854774784e+18 ){
|
||||
while( rr[0]>9.223372036854774784e+118 ){
|
||||
exp += 100;
|
||||
dekkerMul2(rr, 1.0e-100, -1.99918998026028836196e-117);
|
||||
}
|
||||
while( rr[0]>9.223372036854774784e+28 ){
|
||||
exp += 10;
|
||||
dekkerMul2(rr, 1.0e-10, -3.6432197315497741579e-27);
|
||||
}
|
||||
while( rr[0]>9.223372036854774784e+18 ){
|
||||
exp += 1;
|
||||
dekkerMul2(rr, 1.0e-01, -5.5511151231257827021e-18);
|
||||
}
|
||||
}else{
|
||||
while( rr[0]<9.223372036854774784e-83 ){
|
||||
exp -= 100;
|
||||
dekkerMul2(rr, 1.0e+100, -1.5902891109759918046e+83);
|
||||
}
|
||||
while( rr[0]<9.223372036854774784e+07 ){
|
||||
exp -= 10;
|
||||
dekkerMul2(rr, 1.0e+10, 0.0);
|
||||
}
|
||||
while( rr[0]<9.22337203685477478e+17 ){
|
||||
exp -= 1;
|
||||
dekkerMul2(rr, 1.0e+01, 0.0);
|
||||
}
|
||||
while( rr[0]<9.223372036854774784e-83 ){
|
||||
exp -= 100;
|
||||
dekkerMul2(rr, 1.0e+100, -1.5902891109759918046e+83);
|
||||
}
|
||||
while( rr[0]<9.223372036854774784e+07 ){
|
||||
exp -= 10;
|
||||
dekkerMul2(rr, 1.0e+10, 0.0);
|
||||
}
|
||||
while( rr[0]<9.22337203685477478e+17 ){
|
||||
exp -= 1;
|
||||
dekkerMul2(rr, 1.0e+01, 0.0);
|
||||
}
|
||||
v = rr[1]<0.0 ? (u64)rr[0]-(u64)(-rr[1]) : (u64)rr[0]+(u64)rr[1];
|
||||
}
|
||||
|
||||
v = rr[1]<0.0 ? (u64)rr[0]-(u64)(-rr[1]) : (u64)rr[0]+(u64)rr[1];
|
||||
|
||||
/* Extract significant digits. */
|
||||
i = sizeof(p->zBuf)-1;
|
||||
@@ -1887,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
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user