Compare commits
38 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e8f850e7bd | |||
| 0a4af54a7e | |||
| 6cc36dfb16 | |||
| b2972b8c6f | |||
| 8f79342f6a | |||
| dadd0b4085 | |||
| 9dfc2c61ec | |||
| 3ea05b5b4f | |||
| a0d35d44e4 | |||
| 93df8109fc | |||
| 3efac4aa78 | |||
| 3bdebaeabb | |||
| b85b7f257d | |||
| 79d0aa6f56 | |||
| 63f4926524 | |||
| e108f97256 | |||
| 00bc96c05c | |||
| f858182689 | |||
| 3e06f2d79b | |||
| 5b0b8653b6 | |||
| 66172ceb89 | |||
| 9d90a3af2f | |||
| 03c65171b8 | |||
| 297a95bad5 | |||
| f62d053b49 | |||
| 7df570421c | |||
| 84b0f221f4 | |||
| 7fd936e5ed | |||
| 189a4a0bbb | |||
| ede1690cce | |||
| 7a7002143c | |||
| d8452a9517 | |||
| 4192a95d23 | |||
| 6b3010a134 | |||
| 038424727b | |||
| 65552a7ae1 | |||
| 01bfe2a531 | |||
| 3c013479c3 |
+5
-14
@@ -79,7 +79,7 @@ libdir = @libdir@
|
||||
|
||||
INSTALL = @BIN_INSTALL@
|
||||
AR = @AR@
|
||||
AR.flags = cr
|
||||
AR.flags = cr # TODO? Add a configure test to determine this?
|
||||
CC = @CC@
|
||||
B.cc = @CC_FOR_BUILD@ @BUILD_CFLAGS@
|
||||
T.cc = $(CC)
|
||||
@@ -118,25 +118,16 @@ LDFLAGS.dlopen = @LDFLAGS_DLOPEN@
|
||||
LDFLAGS.readline = @LDFLAGS_READLINE@
|
||||
CFLAGS.readline = @CFLAGS_READLINE@
|
||||
LDFLAGS.icu = @LDFLAGS_ICU@
|
||||
LDFLAGS.rt = @LDFLAGS_RT@
|
||||
CFLAGS.icu = @CFLAGS_ICU@
|
||||
LDFLAGS.libsqlite3.soname = @LDFLAGS_LIBSQLITE3_SONAME@
|
||||
# soname: see https://sqlite.org/src/forumpost/5a3b44f510df8ded
|
||||
LDFLAGS.libsqlite3.os-specific = \
|
||||
@LDFLAGS_MAC_CVERSION@ @LDFLAGS_MAC_INSTALL_NAME@ @LDFLAGS_OUT_IMPLIB@
|
||||
LDFLAGS.libsqlite3.os-specific = @LDFLAGS_MAC_CVERSION@ @LDFLAGS_OUT_IMPLIB@
|
||||
# os-specific: see
|
||||
# - https://sqlite.org/forum/forumpost/9dfd5b8fd525a5d7
|
||||
# - https://sqlite.org/forum/forumpost/0c7fc097b2
|
||||
# - https://sqlite.org/forum/forumpost/5651662b8875ec0a
|
||||
|
||||
libsqlite3.DLL.basename = @SQLITE_DLL_BASENAME@
|
||||
# DLL.basename: see https://sqlite.org/forum/forumpost/828fdfe904
|
||||
libsqlite3.out.implib = @SQLITE_OUT_IMPLIB@
|
||||
# libsqlite3.out.implib => the output filename part of LDFLAGS_OUT_IMPLIB.
|
||||
ENABLE_LIB_SHARED = @ENABLE_LIB_SHARED@
|
||||
ENABLE_LIB_STATIC = @ENABLE_LIB_STATIC@
|
||||
ENABLE_SHARED = @ENABLE_SHARED@
|
||||
ENABLE_STATIC = @ENABLE_STATIC@
|
||||
HAVE_WASI_SDK = @HAVE_WASI_SDK@
|
||||
libsqlite3.DLL.install-rules = @SQLITE_DLL_INSTALL_RULES@
|
||||
|
||||
T.cc.sqlite = $(T.cc) @TARGET_DEBUG@
|
||||
|
||||
@@ -155,7 +146,7 @@ T.cc.sqlite += -D_HAVE_SQLITE_CONFIG_H -DBUILD_sqlite
|
||||
# shell command.
|
||||
#
|
||||
CFLAGS.jimsh = @CFLAGS_JIMSH@
|
||||
JIMSH = ./jimsh$(T.exe)
|
||||
JIMSH = ./jimsh$(TEXE)
|
||||
|
||||
#
|
||||
# $(B.tclsh) is documented in main.mk.
|
||||
|
||||
@@ -2846,4 +2846,5 @@ clean:
|
||||
del /Q fts5.* fts5parse.* 2>NUL
|
||||
del /Q lsm.h lsm1.c 2>NUL
|
||||
del /q src-verify.exe 2>NUL
|
||||
del /q jimsh.exe jimsh0.exe 2>NUL
|
||||
# <</mark>>
|
||||
|
||||
@@ -1,47 +1,279 @@
|
||||
#!/do/not/tclsh
|
||||
#/do/not/tclsh
|
||||
# ^^^ help out editors which guess this file's content type.
|
||||
#
|
||||
# This is the main autosetup-compatible configure script for the
|
||||
# SQLite project.
|
||||
#
|
||||
# This script and all of its dependencies must be kept compatible with
|
||||
# JimTCL, a copy of which is included in this source tree as
|
||||
# ./autosetup/jimsh0.c. The number of incompatibilities between
|
||||
# canonical TCL and JimTCL is very low and alternative formulations of
|
||||
# incompatible constructs have, so far, been easy to find.
|
||||
# This script should be kept compatible with JimTCL, a copy of which
|
||||
# is included in this source tree as ./autosetup/jimsh0.c. The number
|
||||
# of incompatibilities between canonical TCL and JimTCL is very low
|
||||
# and alternative formulations of incompatible constructs have, so
|
||||
# far, been easy to find.
|
||||
#
|
||||
# JimTCL: https://jim.tcl.tk
|
||||
#
|
||||
|
||||
use sqlite-config
|
||||
sqlite-configure canonical {
|
||||
proj-if-opt-truthy dev {
|
||||
# --enable-dev needs to come early so that the downstream tests
|
||||
# which check for the following flags use their updated state.
|
||||
proj-opt-set all 1
|
||||
proj-opt-set debug 1
|
||||
proj-opt-set amalgamation 0
|
||||
define CFLAGS [get-env CFLAGS {-O0 -g}]
|
||||
# -------------^^^^^^^ intentionally using [get-env] instead of
|
||||
# [proj-get-env] here because [sqlite-setup-default-cflags] uses
|
||||
# [proj-get-env] and we want this to supercede that.
|
||||
}
|
||||
sqlite-check-common-bins ;# must come before [sqlite-handle-wasi-sdk]
|
||||
sqlite-handle-wasi-sdk ;# must run relatively early, as it changes the environment
|
||||
sqlite-check-common-system-deps
|
||||
|
||||
proj-define-for-opt amalgamation USE_AMALGAMATION "Use amalgamation for builds?"
|
||||
|
||||
proj-define-for-opt gcov USE_GCOV "Use gcov?"
|
||||
|
||||
proj-define-for-opt test-status TSTRNNR_OPTS \
|
||||
"test-runner flags:" {--status} {}
|
||||
|
||||
proj-define-for-opt linemacros AMALGAMATION_LINE_MACROS \
|
||||
"Use #line macros in the amalgamation:"
|
||||
|
||||
define LINK_TOOLS_DYNAMICALLY [proj-opt-was-provided dynlink-tools]
|
||||
|
||||
sqlite-handle-tcl
|
||||
sqlite-handle-emsdk
|
||||
if {[string first " " $autosetup(srcdir)] != -1} {
|
||||
user-error "The pathname of the source tree\
|
||||
may not contain space characters"
|
||||
}
|
||||
if {[string first " " $autosetup(builddir)] != -1} {
|
||||
user-error "The pathname of the build directory\
|
||||
may not contain space characters"
|
||||
}
|
||||
|
||||
|
||||
########################################################################
|
||||
# Regarding flag compatibility with the historical autotool configure
|
||||
# script:
|
||||
#
|
||||
# A very long story made short, autosetup's --flag handling has
|
||||
# some behaviors which make it impossible to implement 100% identical
|
||||
# flags compared to the historical autotools build. The differences
|
||||
# are documented here:
|
||||
#
|
||||
# 1) --debug is used by autosetup itself, but we patch it because
|
||||
# decades of muscle memory expect --debug to apply to this code,
|
||||
# not the configure script (details are in autosetup/README.md).
|
||||
#
|
||||
# 2) In autosetup, all flags starting with (--enable, --disable) are
|
||||
# forced to be booleans and receive special handling in how they're
|
||||
# resolved. Because of that we have to rename:
|
||||
#
|
||||
# 2.1) --enable-tempstore[=no] to --with-tempstore[=no], noting that
|
||||
# it has four legal values, not two.
|
||||
#
|
||||
########################################################################
|
||||
# A gentle introduction to flags handling in autosetup
|
||||
#
|
||||
# Reference: https://msteveb.github.io/autosetup/developer/
|
||||
#
|
||||
# All configure flags must be described in an 'options' call, which
|
||||
# must appear very early on in this script. The general syntax is:
|
||||
#
|
||||
# FLAG => {Help text}
|
||||
#
|
||||
# Where FLAG can have any of the following formats:
|
||||
#
|
||||
# boolopt => "a boolean option which defaults to disabled"
|
||||
# boolopt2=1 => "a boolean option which defaults to enabled"
|
||||
# stringopt: => "an option which takes an argument, e.g. --stringopt=value"
|
||||
# stringopt2:=value => "an option where the argument is optional and defaults to 'value'"
|
||||
# optalias booltopt3 => "a boolean with a hidden alias. --optalias is not shown in --help"
|
||||
#
|
||||
# Autosetup does no small amount of specialized handling for flags,
|
||||
# especially booleans. Each bool-type --FLAG implicitly gets
|
||||
# --enable-FLAG and --disable-FLAG forms. e.g. we define a flag
|
||||
# "readline", which will be interpreted in one of two ways, depending
|
||||
# on how it's invoked and how its default is defined:
|
||||
#
|
||||
# --enable-readline ==> boolean true
|
||||
# --disable-readline ==> boolean false
|
||||
#
|
||||
# Passing --readline or --readline=1 is equivalent to passing
|
||||
# --enable-readline, and --readline=0 is equivalent to
|
||||
# --disable-readline.
|
||||
#
|
||||
# The behavior described above can lead lead to some confusion when
|
||||
# writing help text. For example:
|
||||
#
|
||||
# options { json=1 {Disable JSON functions} }
|
||||
#
|
||||
# The reason the help text says "disable" is because a boolean option
|
||||
# which defaults to true is, in the --help text, rendered as:
|
||||
#
|
||||
# --disable-json Disable JSON functions
|
||||
#
|
||||
# Whereas a bool flag which defaults to false will instead render as:
|
||||
#
|
||||
# --enable-FLAG
|
||||
#
|
||||
# Non-boolean flags, in contrast, use the names specifically given to
|
||||
# them in the [options] invocation. e.g. "with-tcl" is the --with-tcl
|
||||
# flag.
|
||||
#
|
||||
# Fetching values for flags:
|
||||
#
|
||||
# booleans: use one of:
|
||||
# - [opt-bool FLAG] is autosetup's built-in command for this, but we
|
||||
# have some convenience variants:
|
||||
# - [proj-opt-truthy FLAG]
|
||||
# - [proj-opt-if-truthy FLAG {THEN} {ELSE}]
|
||||
#
|
||||
# Non-boolean (i.e. string) flags:
|
||||
# - [opt-val FLAG ?default?]
|
||||
# - [opt-str ...] - see the docs in ./autosetup/autosetup
|
||||
#
|
||||
########################################################################
|
||||
set flags {
|
||||
# When writing {help text blocks}, be aware that autosetup formats
|
||||
# them differently (left-aligned, directly under the --flag) if the
|
||||
# block starts with a newline. It does NOT expand vars and commands,
|
||||
# but we use a [subst] call below which will replace (only) var
|
||||
# refs.
|
||||
|
||||
# <build-modes>
|
||||
shared=1 => {Disable build of shared libary}
|
||||
static=1 => {Disable build of static library (mostly)}
|
||||
amalgamation=1 => {Disable the amalgamation and instead build all files separately.}
|
||||
# </build-modes>
|
||||
# <lib-feature>
|
||||
threadsafe=1 => {Disable mutexing}
|
||||
with-tempstore:=no => {Use an in-RAM database for temporary tables: never,no,yes,always}
|
||||
largefile=1 => {Disable large file support}
|
||||
load-extension=1 => {Disable loading of external extensions}
|
||||
math=1 => {Disable math functions}
|
||||
json=1 => {Disable JSON functions}
|
||||
memsys5 => {Enable MEMSYS5}
|
||||
memsys3 => {Enable MEMSYS3}
|
||||
fts3 => {Enable the FTS3 extension}
|
||||
fts4 => {Enable the FTS4 extension}
|
||||
fts5 => {Enable the FTS5 extension}
|
||||
update-limit => {Enable the UPDATE/DELETE LIMIT clause}
|
||||
geopoly => {Enable the GEOPOLY extension}
|
||||
rtree => {Enable the RTREE extension}
|
||||
session => {Enable the SESSION extension}
|
||||
all => {Enable FTS4, FTS5, Geopoly, RTree, Sessions}
|
||||
# </lib-feature>
|
||||
# <tcl>
|
||||
with-tcl:DIR =>
|
||||
{Directory containing tclConfig.sh or a directory one level up from
|
||||
that, from which we can derive a directory containing tclConfig.sh.
|
||||
A dir name of "prefix" is equivalent to the directory specified by
|
||||
the --prefix flag.}
|
||||
with-tclsh:PATH =>
|
||||
{Full pathname of tclsh to use. It is used for (A) trying to find
|
||||
tclConfig.sh and (B) all TCL-based code generation. Warning: if
|
||||
its containing dir has multiple tclsh versions, it may select the
|
||||
wrong tclConfig.sh!}
|
||||
tcl=1 =>
|
||||
{Disable components which require TCL, including all tests.
|
||||
This tree requires TCL for code generation but can use the in-tree
|
||||
copy of autosetup/jimsh0.c for that. The SQLite TCL extension and the
|
||||
test code require a canonical tclsh.}
|
||||
# <tcl>
|
||||
# <line-editing>
|
||||
readline=1 => {Disable readline support}
|
||||
# --with-readline-lib is a backwards-compatible alias for
|
||||
# --with-readline-ldflags
|
||||
with-readline-lib:
|
||||
with-readline-ldflags:=auto
|
||||
=> {Readline LDFLAGS, e.g. -lreadline -lncurses}
|
||||
# --with-readline-inc is a backwards-compatible alias for
|
||||
# --with-readline-cflags.
|
||||
with-readline-inc:
|
||||
with-readline-cflags:=auto
|
||||
=> {Readline CFLAGS, e.g. -I/path/to/includes}
|
||||
with-readline-header:PATH
|
||||
=> {Full path to readline.h, from which --with-readline-cflags will be derived}
|
||||
with-linenoise:DIR => {Source directory for linenoise.c and linenoise.h}
|
||||
editline=0 => {Enable BSD editline support}
|
||||
# </line-editing>
|
||||
# <icu>
|
||||
with-icu-ldflags:LDFLAGS
|
||||
=> {Enable SQLITE_ENABLE_ICU and add the given linker flags for the ICU libraries}
|
||||
with-icu-cflags:CFLAGS
|
||||
=> {Apply extra CFLAGS/CPPFLAGS necessary for building with ICU. e.g. -I/usr/local/include}
|
||||
with-icu-config:=auto => {Enable SQLITE_ENABLE_ICU. Value must be one of: auto, pkg-config, /path/to/icu-config}
|
||||
icu-collations=0 => {Enable SQLITE_ENABLE_ICU_COLLATIONS. Requires --with-icu-ldflags=... or --with-icu-config}
|
||||
# </icu>
|
||||
# <alternative-builds>
|
||||
with-wasi-sdk:=/opt/wasi-sdk
|
||||
=> {Top-most dir of the wasi-sdk for a WASI build}
|
||||
with-emsdk:=auto => {Top-most dir of the Emscripten SDK installation. Default = EMSDK env var.}
|
||||
# </alternative-builds>
|
||||
# <developer>
|
||||
# Note that using the --debug/--enable-debug flag here requires patching
|
||||
# autosetup/autosetup to rename the --debug to --autosetup-debug.
|
||||
with-debug=0
|
||||
debug=0 =>
|
||||
{Enable debug build flags. This option will impact performance by
|
||||
as much as 4x, as it includes large numbers of assert()s in
|
||||
performance-critical loops. Never use --debug for production
|
||||
builds.}
|
||||
scanstatus => {Enable the SQLITE_ENABLE_STMT_SCANSTATUS feature flag}
|
||||
dev => {Enable dev-mode build: automatically enables certain other flags}
|
||||
test-status => {Enable status of tests}
|
||||
gcov=0 => {Enable coverage testing using gcov}
|
||||
linemacros => {Enable #line macros in the amalgamation}
|
||||
dynlink-tools => {Dynamically link libsqlite3 to certain tools which normally statically embed it.}
|
||||
soname:=legacy =>
|
||||
# --soname has a long story behind it: https://sqlite.org/src/forumpost/5a3b44f510df8ded
|
||||
{SONAME for libsqlite3.so. "none", or not using this flag, sets no
|
||||
soname. "legacy" sets it to its historical value of
|
||||
libsqlite3.so.0. A value matching the glob "libsqlite3.*" sets
|
||||
it to that literal value. Any other value is assumed to be a
|
||||
suffix which gets applied to "libsqlite3.so.",
|
||||
e.g. --soname=9.10 equates to "libsqlite3.so.9.10".
|
||||
}
|
||||
dump-defines=0 => {Dump autosetup defines to $::sqliteConfig(dump-defines-txt) (for build debugging)}
|
||||
# </developer>
|
||||
}
|
||||
if {"" ne $::sqliteConfig(dump-defines-json)} {
|
||||
lappend flags \
|
||||
defines-json-include-lowercase=0 \
|
||||
=> {Include lower-case defines (primarily system paths) in $::sqliteConfig(dump-defines-json)}
|
||||
}
|
||||
|
||||
options [subst -nobackslashes -nocommands $flags]
|
||||
unset flags
|
||||
sqlite-post-options-init
|
||||
|
||||
sqlite-setup-default-cflags
|
||||
proj-if-opt-truthy dev {
|
||||
# --enable-dev needs to come early so that the downstream tests
|
||||
# which check for the following flags use their updated state.
|
||||
proj-opt-set all 1
|
||||
proj-opt-set debug 1
|
||||
proj-opt-set amalgamation 0
|
||||
define CFLAGS [get-env CFLAGS {-O0 -g}]
|
||||
# -------------^^^^^^^ intentionally using [get-env] instead of
|
||||
# [proj-get-env] here because [sqlite-setup-default-cflags] uses
|
||||
# [proj-get-env] and we want this to supercede that.
|
||||
}
|
||||
|
||||
sqlite-check-common-bins ;# must come before [sqlite-handle-wasi-sdk]
|
||||
sqlite-handle-wasi-sdk ;# must run relatively early, as it changes the environment
|
||||
sqlite-check-common-system-deps
|
||||
|
||||
#
|
||||
# Enable large file support (if special flags are necessary)
|
||||
#
|
||||
define HAVE_LFS 0
|
||||
if {[opt-bool largefile]} {
|
||||
cc-check-lfs
|
||||
}
|
||||
|
||||
proj-define-for-opt shared ENABLE_SHARED "Build shared library?"
|
||||
|
||||
if {![proj-define-for-opt static ENABLE_STATIC \
|
||||
"Build static library?"]} {
|
||||
proj-warn "Static lib build may be implicitly re-activated by other components, e.g. some test apps."
|
||||
}
|
||||
|
||||
proj-define-for-opt amalgamation USE_AMALGAMATION "Use amalgamation for builds?"
|
||||
|
||||
proj-define-for-opt gcov USE_GCOV "Use gcov?"
|
||||
|
||||
proj-define-for-opt test-status TSTRNNR_OPTS \
|
||||
"test-runner flags:" {--status} {}
|
||||
|
||||
proj-define-for-opt linemacros AMALGAMATION_LINE_MACROS \
|
||||
"Use #line macros in the amalgamation:"
|
||||
|
||||
define LINK_TOOLS_DYNAMICALLY [proj-opt-was-provided dynlink-tools]
|
||||
|
||||
proj-check-rpath
|
||||
sqlite-handle-soname
|
||||
sqlite-handle-debug
|
||||
sqlite-handle-tcl
|
||||
sqlite-handle-threadsafe
|
||||
sqlite-handle-tempstore
|
||||
sqlite-handle-line-editing
|
||||
sqlite-handle-load-extension
|
||||
sqlite-handle-math
|
||||
sqlite-handle-icu
|
||||
sqlite-handle-emsdk
|
||||
sqlite-common-late-stage-config
|
||||
sqlite-dump-defines
|
||||
|
||||
+46
-80
@@ -67,7 +67,6 @@ LDFLAGS.pthread = @LDFLAGS_PTHREAD@
|
||||
LDFLAGS.dlopen = @LDFLAGS_DLOPEN@
|
||||
LDFLAGS.readline = @LDFLAGS_READLINE@
|
||||
CFLAGS.readline = @CFLAGS_READLINE@
|
||||
LDFLAGS.rt = @LDFLAGS_RT@
|
||||
LDFLAGS.icu = @LDFLAGS_ICU@
|
||||
CFLAGS.icu = @CFLAGS_ICU@
|
||||
|
||||
@@ -87,7 +86,7 @@ install-dir.all = $(install-dir.bin) $(install-dir.include) \
|
||||
$(install-dir.lib) $(install-dir.man1) \
|
||||
$(install-dir.pkgconfig)
|
||||
$(install-dir.all):
|
||||
@if [ ! -d "$@" ]; then set -x; $(INSTALL) -d "$@"; fi
|
||||
if [ ! -d "$@" ]; then $(INSTALL) -d "$@"; fi
|
||||
# ^^^^ on some platforms, install -d fails if the target already exists.
|
||||
|
||||
|
||||
@@ -127,90 +126,67 @@ OPT_FEATURE_FLAGS = @OPT_FEATURE_FLAGS@
|
||||
|
||||
LDFLAGS.libsqlite3.soname = @LDFLAGS_LIBSQLITE3_SONAME@
|
||||
# soname: see https://sqlite.org/src/forumpost/5a3b44f510df8ded
|
||||
LDFLAGS.libsqlite3.os-specific = \
|
||||
@LDFLAGS_MAC_CVERSION@ @LDFLAGS_MAC_INSTALL_NAME@ @LDFLAGS_OUT_IMPLIB@
|
||||
LDFLAGS.libsqlite3.os-specific = @LDFLAGS_MAC_CVERSION@ @LDFLAGS_OUT_IMPLIB@
|
||||
# os-specific: see
|
||||
# - https://sqlite.org/forum/forumpost/9dfd5b8fd525a5d7
|
||||
# - https://sqlite.org/forum/forumpost/0c7fc097b2
|
||||
|
||||
LDFLAGS.libsqlite3 = \
|
||||
$(LDFLAGS.rpath) $(LDFLAGS.pthread) \
|
||||
$(LDFLAGS.math) $(LDFLAGS.dlopen) \
|
||||
$(LDFLAGS.zlib) $(LDFLAGS.icu) \
|
||||
$(LDFLAGS.rt) $(LDFLAGS.configure)
|
||||
$(LDFLAGS.configure)
|
||||
CFLAGS.libsqlite3 = -I. $(CFLAGS.core) $(CFLAGS.icu) $(OPT_FEATURE_FLAGS)
|
||||
|
||||
sqlite3.o: $(TOP)/sqlite3.h $(TOP)/sqlite3.c
|
||||
$(CC) -c $(TOP)/sqlite3.c -o $@ $(CFLAGS) $(CFLAGS.libsqlite3)
|
||||
|
||||
libsqlite3.LIB = libsqlite3$(T.lib)
|
||||
libsqlite3.DLL.basename = @SQLITE_DLL_BASENAME@
|
||||
libsqlite3.out.implib = @SQLITE_OUT_IMPLIB@
|
||||
libsqlite3.DLL = $(libsqlite3.DLL.basename)$(T.dll)
|
||||
libsqlite3.DLL.install-rules = @SQLITE_DLL_INSTALL_RULES@
|
||||
libsqlite3.SO = libsqlite3$(T.dll)
|
||||
|
||||
$(libsqlite3.DLL): sqlite3.o
|
||||
$(libsqlite3.SO): sqlite3.o
|
||||
$(CC) -o $@ sqlite3.o $(LDFLAGS.shlib) \
|
||||
$(LDFLAGS) $(LDFLAGS.libsqlite3) \
|
||||
$(LDFLAGS.libsqlite3.os-specific) $(LDFLAGS.libsqlite3.soname)
|
||||
$(libsqlite3.DLL)-1: $(libsqlite3.DLL)
|
||||
$(libsqlite3.DLL)-0:
|
||||
all: $(libsqlite3.DLL)-$(ENABLE_LIB_SHARED)
|
||||
all: $(libsqlite3.SO)
|
||||
|
||||
$(libsqlite3.LIB): sqlite3.o
|
||||
$(AR) $(AR.flags) $@ sqlite3.o
|
||||
$(libsqlite3.LIB)-1: $(libsqlite3.LIB)
|
||||
$(libsqlite3.LIB)-0:
|
||||
all: $(libsqlite3.LIB)-$(ENABLE_LIB_STATIC)
|
||||
all: $(libsqlite3.LIB)
|
||||
|
||||
#
|
||||
# Maintenance reminder: the install-dll-... rules must be kept in sync
|
||||
# with the main copies rom /main.mk.
|
||||
#
|
||||
install-dll-out-implib: $(install-dir.lib) $(libsqlite3.DLL)
|
||||
if [ x != "x$(libsqlite3.out.implib)" ] && [ -f "$(libsqlite3.out.implib)" ]; then \
|
||||
$(INSTALL) $(libsqlite3.out.implib) "$(install-dir.lib)"; \
|
||||
install-so-1: $(install-dir.lib) $(libsqlite3.SO)
|
||||
$(INSTALL) $(libsqlite3.SO) "$(install-dir.lib)"
|
||||
@echo "Setting up $(libsqlite3.SO) version symlinks..."; \
|
||||
cd "$(install-dir.lib)" || exit $$?; \
|
||||
if [ x.dylib = x$(T.dll) ]; then \
|
||||
rm -f libsqlite3.0$(T.dll) libsqlite3.$(PACKAGE_VERSION)$(T.dll) || exit $$?; \
|
||||
dllname=libsqlite3.$(PACKAGE_VERSION)$(T.dll); \
|
||||
mv $(libsqlite3.SO) $$dllname || exit $$?; \
|
||||
ln -s $$dllname $(libsqlite3.SO) || exit $$?; \
|
||||
ln -s $$dllname libsqlite3.0$(T.dll) || exit $$?; \
|
||||
ls -la $$dllname $(libsqlite3.SO) libsqlite3.0$(T.dll); \
|
||||
else \
|
||||
rm -f $(libsqlite3.SO).0 $(libsqlite3.SO).$(PACKAGE_VERSION) || exit $$?; \
|
||||
mv $(libsqlite3.SO) $(libsqlite3.SO).$(PACKAGE_VERSION) || exit $$?; \
|
||||
ln -s $(libsqlite3.SO).$(PACKAGE_VERSION) $(libsqlite3.SO) || exit $$?; \
|
||||
ln -s $(libsqlite3.SO).$(PACKAGE_VERSION) $(libsqlite3.SO).0 || exit $$?; \
|
||||
ls -la $(libsqlite3.SO) $(libsqlite3.SO).[03]*; \
|
||||
if [ -e $(libsqlite3.SO).0.8.6 ]; then \
|
||||
echo "ACHTUNG: legacy libtool-compatible install found. Re-linking it..."; \
|
||||
rm -f libsqlite3.la $(libsqlite3.SO).0.8.6 || exit $$?; \
|
||||
ln -s $(libsqlite3.SO).$(PACKAGE_VERSION) $(libsqlite3.SO).0.8.6 || exit $$?; \
|
||||
ls -la $(libsqlite3.SO).0.8.6; \
|
||||
elif [ x1 = "x$(INSTALL_SO_086_LINK)" ]; then \
|
||||
echo "ACHTUNG: installing legacy libtool-style links because INSTALL_SO_086_LINK=1"; \
|
||||
rm -f libsqlite3.la $(libsqlite3.SO).0.8.6 || exit $$?; \
|
||||
ln -s $(libsqlite3.SO).$(PACKAGE_VERSION) $(libsqlite3.SO).0.8.6 || exit $$?; \
|
||||
ls -la $(libsqlite3.SO).0.8.6; \
|
||||
fi; \
|
||||
fi
|
||||
|
||||
install-dll-unix-generic: install-dll-out-implib
|
||||
$(INSTALL) $(libsqlite3.DLL) "$(install-dir.lib)"
|
||||
@echo "Setting up $(libsqlite3.DLL) version symlinks..."; \
|
||||
cd "$(install-dir.lib)" || exit $$?; \
|
||||
rm -f $(libsqlite3.DLL).0 $(libsqlite3.DLL).$(PACKAGE_VERSION) || exit $$?; \
|
||||
mv $(libsqlite3.DLL) $(libsqlite3.DLL).$(PACKAGE_VERSION) || exit $$?; \
|
||||
ln -s $(libsqlite3.DLL).$(PACKAGE_VERSION) $(libsqlite3.DLL) || exit $$?; \
|
||||
ln -s $(libsqlite3.DLL).$(PACKAGE_VERSION) $(libsqlite3.DLL).0 || exit $$?; \
|
||||
ls -la $(libsqlite3.DLL) $(libsqlite3.DLL).[a03]*; \
|
||||
if [ -e $(libsqlite3.DLL).0.8.6 ]; then \
|
||||
echo "ACHTUNG: legacy libtool-compatible install found. Re-linking it..."; \
|
||||
rm -f libsqlite3.la $(libsqlite3.DLL).0.8.6 || exit $$?; \
|
||||
ln -s $(libsqlite3.DLL).$(PACKAGE_VERSION) $(libsqlite3.DLL).0.8.6 || exit $$?; \
|
||||
ls -la $(libsqlite3.DLL).0.8.6; \
|
||||
elif [ x1 = "x$(INSTALL_SO_086_LINK)" ]; then \
|
||||
echo "ACHTUNG: installing legacy libtool-style links because INSTALL_SO_086_LINK=1"; \
|
||||
rm -f libsqlite3.la $(libsqlite3.DLL).0.8.6 || exit $$?; \
|
||||
ln -s $(libsqlite3.DLL).$(PACKAGE_VERSION) $(libsqlite3.DLL).0.8.6 || exit $$?; \
|
||||
ls -la $(libsqlite3.DLL).0.8.6; \
|
||||
fi
|
||||
|
||||
install-dll-msys: install-dll-out-implib $(install-dir.bin)
|
||||
$(INSTALL) $(libsqlite3.DLL) "$(install-dir.bin)"
|
||||
# ----------------------------------------------^^^ yes, bin
|
||||
install-dll-mingw: install-dll-msys
|
||||
install-dll-cygwin: install-dll-msys
|
||||
|
||||
install-dll-darwin: $(install-dir.lib) $(libsqlite3.DLL)
|
||||
$(INSTALL) $(libsqlite3.DLL) "$(install-dir.lib)"
|
||||
@echo "Setting up $(libsqlite3.DLL) version symlinks..."; \
|
||||
cd "$(install-dir.lib)" || exit $$?; \
|
||||
rm -f libsqlite3.0$(T.dll) libsqlite3.$(PACKAGE_VERSION)$(T.dll) || exit $$?; \
|
||||
dllname=libsqlite3.$(PACKAGE_VERSION)$(T.dll); \
|
||||
mv $(libsqlite3.DLL) $$dllname || exit $$?; \
|
||||
ln -s $$dllname $(libsqlite3.DLL) || exit $$?; \
|
||||
ln -s $$dllname libsqlite3.0$(T.dll) || exit $$?; \
|
||||
ls -la $$dllname $(libsqlite3.DLL) libsqlite3.0$(T.dll)
|
||||
|
||||
install-dll-1: install-dll-$(libsqlite3.DLL.install-rules)
|
||||
install-dll-0 install-dll-:
|
||||
install-dll: install-dll-$(ENABLE_LIB_SHARED)
|
||||
install: install-dll
|
||||
install-so-0 install-so-:
|
||||
install-so: install-so-$(ENABLE_LIB_SHARED)
|
||||
install: install-so
|
||||
|
||||
install-lib-1: $(install-dir.lib) $(libsqlite3.LIB)
|
||||
$(INSTALL.noexec) $(libsqlite3.LIB) "$(install-dir.lib)"
|
||||
@@ -219,21 +195,12 @@ install-lib: install-lib-$(ENABLE_LIB_STATIC)
|
||||
install: install-lib
|
||||
|
||||
|
||||
# Flags to link the shell app either directly against sqlite3.c
|
||||
# (ENABLE_STATIC_SHELL==1) or libsqlite3.so (ENABLE_STATIC_SHELL==0).
|
||||
#
|
||||
ENABLE_STATIC_SHELL = @ENABLE_STATIC_SHELL@
|
||||
sqlite3-shell-link-flags.1 = $(TOP)/sqlite3.c $(LDFLAGS.libsqlite3)
|
||||
sqlite3-shell-link-flags.0 = -L. -lsqlite3 $(LDFLAGS.zlib)
|
||||
sqlite3-shell-deps.1 = $(TOP)/sqlite3.c
|
||||
sqlite3-shell-deps.0 = $(libsqlite3.DLL)
|
||||
sqlite3$(T.exe): $(TOP)/shell.c $(sqlite3-shell-deps.$(ENABLE_STATIC_SHELL))
|
||||
sqlite3$(T.exe): $(TOP)/shell.c $(TOP)/sqlite3.c
|
||||
$(CC) -o $@ \
|
||||
$(TOP)/shell.c $(sqlite3-shell-link-flags.$(ENABLE_STATIC_SHELL)) \
|
||||
$(TOP)/shell.c $(TOP)/sqlite3.c \
|
||||
-I. $(OPT_FEATURE_FLAGS) $(SHELL_OPT) \
|
||||
$(CFLAGS) $(CFLAGS.readline) $(CFLAGS.icu) \
|
||||
$(LDFLAGS) $(LDFLAGS.readline)
|
||||
|
||||
$(LDFLAGS) $(LDFLAGS.libsqlite3) $(LDFLAGS.readline)
|
||||
all: sqlite3$(T.exe)
|
||||
|
||||
install-shell: sqlite3$(T.exe) $(install-dir.bin)
|
||||
@@ -254,10 +221,10 @@ install: install-man1
|
||||
|
||||
clean:
|
||||
rm -f *.o sqlite3$(T.exe)
|
||||
rm -f $(libsqlite3.LIB) $(libsqlite3.DLL) libsqlite3$(T.dll).a
|
||||
rm -f $(libsqlite3.LIB) $(libsqlite3.SO) $(libsqlite3.SO).a
|
||||
|
||||
distclean: clean
|
||||
rm -f jimsh0$(T.exe) config.* sqlite3.pc sqlite_cfg.h Makefile
|
||||
rm -f jimsh0$(T.exe) config.* sqlite3.pc
|
||||
|
||||
DIST_FILES := \
|
||||
README.txt VERSION \
|
||||
@@ -275,7 +242,6 @@ dist:
|
||||
rm -fr $(dist_name)
|
||||
mkdir -p $(dist_name)
|
||||
cp -rp $(DIST_FILES) $(dist_name)/.
|
||||
rm -f $(dist_name)/tea/configure.ac.in
|
||||
tar czf $(dist_tarball) $(dist_name)
|
||||
rm -fr $(dist_name)
|
||||
ls -l $(dist_tarball)
|
||||
|
||||
+91
-4
@@ -1,10 +1,97 @@
|
||||
#!/do/not/tclsh
|
||||
#/do/not/tclsh
|
||||
# ^^^ help out editors which guess this file's content type.
|
||||
#
|
||||
# This is the main autosetup-compatible configure script for the
|
||||
# "autoconf" bundle of the SQLite project.
|
||||
#
|
||||
# This script must be kept compatible with JimTCL, a copy of which is
|
||||
# included in this source tree as ./autosetup/jimsh0.c.
|
||||
#
|
||||
use sqlite-config
|
||||
sqlite-configure autoconf {
|
||||
sqlite-check-common-bins
|
||||
sqlite-check-common-system-deps
|
||||
|
||||
options {
|
||||
# <build-modes>
|
||||
static=1 => {Disable build of static library}
|
||||
shared=1 => {Disable build of shared library}
|
||||
# </build-modes>
|
||||
# <lib-feature>
|
||||
threadsafe=1 => {Disable mutexing}
|
||||
with-tempstore:=no => {Use an in-RAM database for temporary tables: never,no,yes,always}
|
||||
load-extension=1 => {Disable loading of external extensions}
|
||||
math=1 => {Disable math functions}
|
||||
json=1 => {Disable JSON functions}
|
||||
memsys5 => {Enable MEMSYS5}
|
||||
memsys3 => {Enable MEMSYS3}
|
||||
fts3 => {Enable the FTS3 extension}
|
||||
fts4 => {Enable the FTS4 extension}
|
||||
fts5 => {Enable the FTS5 extension}
|
||||
update-limit => {Enable the UPDATE/DELETE LIMIT clause}
|
||||
geopoly => {Enable the GEOPOLY extension}
|
||||
rtree => {Enable the RTREE extension}
|
||||
session => {Enable the SESSION extension}
|
||||
all => {Enable FTS4, FTS5, Geopoly, RTree, Sessions}
|
||||
# </lib-feature>
|
||||
# <line-editing>
|
||||
readline=1 => {Disable readline support}
|
||||
# --with-readline-lib is a backwards-compatible alias for
|
||||
# --with-readline-ldflags
|
||||
with-readline-lib:
|
||||
with-readline-ldflags:=auto
|
||||
=> {Readline LDFLAGS, e.g. -lreadline -lncurses}
|
||||
# --with-readline-inc is a backwards-compatible alias for
|
||||
# --with-readline-cflags.
|
||||
with-readline-inc:
|
||||
with-readline-cflags:=auto
|
||||
=> {Readline CFLAGS, e.g. -I/path/to/includes}
|
||||
with-readline-header:PATH
|
||||
=> {Full path to readline.h, from which --with-readline-cflags will be derived}
|
||||
with-linenoise:DIR => {Source directory for linenoise.c and linenoise.h}
|
||||
editline=0 => {Enable BSD editline support}
|
||||
# </line-editing>
|
||||
# <icu>
|
||||
with-icu-ldflags:LDFLAGS
|
||||
=> {Enable SQLITE_ENABLE_ICU and add the given linker flags for the ICU libraries}
|
||||
with-icu-cflags:CFLAGS
|
||||
=> {Apply extra CFLAGS/CPPFLAGS necessary for building with ICU. e.g. -I/usr/local/include}
|
||||
with-icu-config:=auto => {Enable SQLITE_ENABLE_ICU. Value must be one of: auto, pkg-config, /path/to/icu-config}
|
||||
icu-collations=0 => {Enable SQLITE_ENABLE_ICU_COLLATIONS. Requires --with-icu-ldflags=... or --with-icu-config}
|
||||
# </icu>
|
||||
# <developer>
|
||||
# Note that using the --debug/--enable-debug flag here requires patching
|
||||
# autosetup/autosetup to rename the --debug to --autosetup-debug.
|
||||
with-debug=0
|
||||
debug=0 =>
|
||||
{Enable debug build flags. This option will impact performance by
|
||||
as much as 4x, as it includes large numbers of assert()s in
|
||||
performance-critical loops. Never use --debug for production
|
||||
builds.}
|
||||
# </developer>
|
||||
soname:=legacy =>
|
||||
# --soname has a long story behind it: https://sqlite.org/src/forumpost/5a3b44f510df8ded
|
||||
{SONAME for libsqlite3.so. "none", or not using this flag, sets no
|
||||
soname. "legacy" sets it to its historical value of
|
||||
libsqlite3.so.0. A value matching the glob "libsqlite3.*" sets
|
||||
it to that literal value. Any other value is assumed to be a
|
||||
suffix which gets applied to "libsqlite3.so.",
|
||||
e.g. --soname=9.10 equates to "libsqlite3.so.9.10".
|
||||
}
|
||||
}
|
||||
|
||||
sqlite-post-options-init
|
||||
sqlite-check-common-bins
|
||||
sqlite-check-common-system-deps
|
||||
proj-check-rpath
|
||||
sqlite-handle-soname
|
||||
sqlite-setup-default-cflags
|
||||
sqlite-handle-debug
|
||||
sqlite-handle-threadsafe
|
||||
sqlite-handle-tempstore
|
||||
sqlite-handle-line-editing
|
||||
sqlite-handle-load-extension
|
||||
sqlite-handle-math
|
||||
sqlite-handle-icu
|
||||
|
||||
define ENABLE_LIB_SHARED [opt-bool shared]
|
||||
define ENABLE_LIB_STATIC [opt-bool static]
|
||||
|
||||
sqlite-common-late-stage-config
|
||||
|
||||
@@ -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],[@VERSION@])
|
||||
AC_INIT([sqlite],[3.50.0])
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Call TEA_INIT as the first TEA_ macro to set up initial vars.
|
||||
+4
-8
@@ -1634,8 +1634,8 @@ proc automf_command_reference {} {
|
||||
|
||||
if {[regexp {^#.*@section (.*)$} $line -> section]} {
|
||||
lappend doc($current) [list section $section]
|
||||
continue
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
# Find embedded module names
|
||||
if {[regexp {^#.*@module ([^ ]*)} $line -> modulename]} {
|
||||
@@ -1651,7 +1651,7 @@ proc automf_command_reference {} {
|
||||
if {$cmd eq "synopsis:"} {
|
||||
set current $modulename
|
||||
lappend doc($current) [list section "Module: $modulename"]
|
||||
} else {
|
||||
} else {
|
||||
lappend doc($current) [list subsection $cmd]
|
||||
}
|
||||
|
||||
@@ -2088,12 +2088,8 @@ if {$autosetup(iswin)} {
|
||||
proc split-path {} {
|
||||
split [getenv PATH .] :
|
||||
}
|
||||
# Check for an executable file
|
||||
proc file-isexec {exec} {
|
||||
if {[file executable $exec] && [file isfile $exec]} {
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
file executable $exec
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ for tclsh in ./jimsh0 $autosetup_tclsh jimsh tclsh tclsh8.5 tclsh8.6 tclsh8.7; d
|
||||
done
|
||||
echo 1>&2 "No installed jimsh or tclsh, building local bootstrap jimsh0"
|
||||
for cc in ${CC_FOR_BUILD:-cc} gcc; do
|
||||
{ $cc -o jimsh0 "$d/jimsh0.c"; } 2>/dev/null >/dev/null || continue
|
||||
{ $cc -o jimsh0 "$d/jimsh0.c"; } >/dev/null 2>&1 || continue
|
||||
./jimsh0 "$d/${1-autosetup-test-tclsh}" && exit 0
|
||||
done
|
||||
echo 1>&2 "No working C compiler found. Tried ${CC_FOR_BUILD:-cc} and gcc."
|
||||
|
||||
+12
-8
@@ -1252,14 +1252,6 @@ int Jim_OpenForRead(const char *filename);
|
||||
|
||||
#endif
|
||||
|
||||
# ifndef MAXPATHLEN
|
||||
# ifdef PATH_MAX
|
||||
# define MAXPATHLEN PATH_MAX
|
||||
# else
|
||||
# define MAXPATHLEN JIM_PATH_LEN
|
||||
# endif
|
||||
# endif
|
||||
|
||||
|
||||
int Jim_FileStoreStatData(Jim_Interp *interp, Jim_Obj *varName, const jim_stat_t *sb);
|
||||
|
||||
@@ -2096,6 +2088,10 @@ enum wbuftype {
|
||||
#define UNIX_SOCKETS 0
|
||||
#endif
|
||||
|
||||
#ifndef MAXPATHLEN
|
||||
#define MAXPATHLEN JIM_PATH_LEN
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -4177,6 +4173,14 @@ int Jim_regexpInit(Jim_Interp *interp)
|
||||
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
|
||||
#endif
|
||||
|
||||
# ifndef MAXPATHLEN
|
||||
# ifdef PATH_MAX
|
||||
# define MAXPATHLEN PATH_MAX
|
||||
# else
|
||||
# define MAXPATHLEN JIM_PATH_LEN
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#if defined(__MINGW32__) || defined(__MSYS__) || defined(_MSC_VER)
|
||||
#define ISWINDOWS 1
|
||||
|
||||
|
||||
+27
-56
@@ -184,8 +184,8 @@ proc proj-lshift_ {listVar {count 1}} {
|
||||
|
||||
########################################################################
|
||||
# Expects to receive string input, which it splits on newlines, strips
|
||||
# out any lines which begin with an number of whitespace followed by a
|
||||
# '#', and returns a value containing the [append]ed results of each
|
||||
# out any lines which begin with any number of whitespace followed by
|
||||
# a '#', and returns a value containing the [append]ed results of each
|
||||
# remaining line with a \n between each.
|
||||
proc proj-strip-hash-comments {val} {
|
||||
set x {}
|
||||
@@ -203,7 +203,7 @@ proc proj-strip-hash-comments {val} {
|
||||
# A proxy for cc-check-function-in-lib which does not make any global
|
||||
# changes to the LIBS define. Returns the result of
|
||||
# cc-check-function-in-lib (i.e. true or false). The resulting linker
|
||||
# flags are stored in ${lib_${function}}.
|
||||
# flags are stored in the [define] named lib_${function}.
|
||||
proc proj-check-function-in-lib {function libs {otherlibs {}}} {
|
||||
set found 0
|
||||
define-push {LIBS} {
|
||||
@@ -353,6 +353,7 @@ proc proj-opt-was-provided {key} {
|
||||
#
|
||||
# Returns $val.
|
||||
proc proj-opt-set {flag {val 1}} {
|
||||
global autosetup
|
||||
if {$flag ni $::autosetup(options)} {
|
||||
# We have to add this to autosetup(options) or else future calls
|
||||
# to [opt-bool $flag] will fail validation of $flag.
|
||||
@@ -362,15 +363,6 @@ proc proj-opt-set {flag {val 1}} {
|
||||
return $val
|
||||
}
|
||||
|
||||
########################################################################
|
||||
# @proj-opt-exists flag
|
||||
#
|
||||
# Returns 1 if the given flag has been defined as a legal configure
|
||||
# option, else returns 0.
|
||||
proc proj-opt-exists {flag} {
|
||||
expr {$flag in $::autosetup(options)};
|
||||
}
|
||||
|
||||
########################################################################
|
||||
# @proj-val-truthy val
|
||||
#
|
||||
@@ -915,35 +907,6 @@ proc proj-check-emsdk {} {
|
||||
return $rc
|
||||
}
|
||||
|
||||
########################################################################
|
||||
# @proj-cc-check-Wl-flag ?flag ?args??
|
||||
#
|
||||
# Checks whether the given linker flag (and optional arguments) can be
|
||||
# passed from the compiler to the linker using one of these formats:
|
||||
#
|
||||
# - -Wl,flag[,arg1[,...argN]]
|
||||
# - -Wl,flag -Wl,arg1 ...-Wl,argN
|
||||
#
|
||||
# If so, that flag string is returned, else an empty string is
|
||||
# returned.
|
||||
proc proj-cc-check-Wl-flag {args} {
|
||||
cc-with {-link 1} {
|
||||
# Try -Wl,flag,...args
|
||||
set fli "-Wl"
|
||||
foreach f $args { append fli ",$f" }
|
||||
if {[cc-check-flags $fli]} {
|
||||
return $fli
|
||||
}
|
||||
# Try -Wl,flag -Wl,arg1 ...-Wl,argN
|
||||
set fli ""
|
||||
foreach f $args { append fli "-Wl,$f " }
|
||||
if {[cc-check-flags $fli]} {
|
||||
return [string trim $fli]
|
||||
}
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
########################################################################
|
||||
# @proj-check-rpath
|
||||
#
|
||||
@@ -955,7 +918,12 @@ proc proj-cc-check-Wl-flag {args} {
|
||||
# --exec-prefix=... or --libdir=... are explicitly passed to
|
||||
# configure then [get-define libdir] is used (noting that it derives
|
||||
# from exec-prefix by default).
|
||||
#
|
||||
# Achtung: we have seen platforms which report that a given option
|
||||
# checked here will work but then fails at build-time, and the current
|
||||
# order of checks reflects that.
|
||||
proc proj-check-rpath {} {
|
||||
set rc 1
|
||||
if {[proj-opt-was-provided libdir]
|
||||
|| [proj-opt-was-provided exec-prefix]} {
|
||||
set lp "[get-define libdir]"
|
||||
@@ -966,18 +934,21 @@ proc proj-check-rpath {} {
|
||||
# CFLAGS or LIBS or whatever it is that cc-check-flags updates) then
|
||||
# downstream tests may fail because the resulting rpath gets
|
||||
# implicitly injected into them.
|
||||
cc-with {-link 1} {
|
||||
cc-with {} {
|
||||
if {[cc-check-flags "-rpath $lp"]} {
|
||||
define LDFLAGS_RPATH "-rpath $lp"
|
||||
} elseif {[cc-check-flags "-Wl,-rpath,$lp"]} {
|
||||
define LDFLAGS_RPATH "-Wl,-rpath,$lp"
|
||||
} elseif {[cc-check-flags "-Wl,-rpath -Wl,$lp"]} {
|
||||
define LDFLAGS_RPATH "-Wl,-rpath -Wl,$lp"
|
||||
} elseif {[cc-check-flags -Wl,-R$lp]} {
|
||||
define LDFLAGS_RPATH "-Wl,-R$lp"
|
||||
} else {
|
||||
set wl [proj-cc-check-Wl-flag -rpath $lp]
|
||||
if {"" eq $wl} {
|
||||
set wl [proj-cc-check-Wl-flag -R$lp]
|
||||
}
|
||||
define LDFLAGS_RPATH $wl
|
||||
define LDFLAGS_RPATH ""
|
||||
set rc 0
|
||||
}
|
||||
}
|
||||
expr {"" ne [get-define LDFLAGS_RPATH]}
|
||||
return $rc
|
||||
}
|
||||
|
||||
########################################################################
|
||||
@@ -994,7 +965,7 @@ proc proj-check-rpath {} {
|
||||
# potentially avoid some end-user confusion by using their own lib's
|
||||
# name here (which shows up in the "checking..." output).
|
||||
proc proj-check-soname {{libname "libfoo.so.0"}} {
|
||||
cc-with {-link 1} {
|
||||
cc-with {} {
|
||||
if {[cc-check-flags "-Wl,-soname,${libname}"]} {
|
||||
define LDFLAGS_SONAME_PREFIX "-Wl,-soname,"
|
||||
return 1
|
||||
@@ -1167,7 +1138,7 @@ proc proj-xfer-options-aliases {mapping} {
|
||||
########################################################################
|
||||
# Arguable/debatable...
|
||||
#
|
||||
# When _not_ cross-compiling and CC_FOR_BUILD is _not_ explicitly
|
||||
# When _not_ cross-compiling and CC_FOR_BUILD is _not_ explcitely
|
||||
# specified, force CC_FOR_BUILD to be the same as CC, so that:
|
||||
#
|
||||
# ./configure CC=clang
|
||||
@@ -1175,7 +1146,7 @@ proc proj-xfer-options-aliases {mapping} {
|
||||
# will use CC_FOR_BUILD=clang, instead of cc, for building in-tree
|
||||
# tools. This is based off of an email discussion and is thought to
|
||||
# be likely to cause less confusion than seeing 'cc' invocations
|
||||
# when when the user passes CC=clang.
|
||||
# will when the user passes CC=clang.
|
||||
#
|
||||
# Sidebar: if we do this before the cc package is installed, it gets
|
||||
# reverted by that package. Ergo, the cc package init will tell the
|
||||
@@ -1220,11 +1191,11 @@ proc proj-which-linenoise {dotH} {
|
||||
#
|
||||
# In that make invocation, $(libdir) would, at make-time, normally be
|
||||
# hard-coded to /foo/lib, rather than /blah/lib. That happens because
|
||||
# autosetup exports conventional $prefix-based values for the numerous
|
||||
# autoconfig-compatible XYZdir vars at configure-time. What we would
|
||||
# normally want, however, is that --libdir derives from the make-time
|
||||
# $(prefix). The distinction between configure-time and make-time is
|
||||
# the significant factor there.
|
||||
# the autosetup exports conventional $prefix-based values for the
|
||||
# numerous autoconfig-compatible XYZdir vars at configure-time. What
|
||||
# we would normally want, however, is that --libdir derives from the
|
||||
# make-time $(prefix). The distinction between configure-time and
|
||||
# make-time is the significant factor there.
|
||||
#
|
||||
# This function attempts to reconcile those vars in such a way that
|
||||
# they will derive, at make-time, from $(prefix) in a conventional
|
||||
|
||||
+91
-716
@@ -3,28 +3,7 @@
|
||||
# that they can be reused in the TEA sub-tree. This file requires
|
||||
# functions from proj.tcl.
|
||||
|
||||
if {[string first " " $autosetup(srcdir)] != -1} {
|
||||
user-error "The pathname of the source tree\
|
||||
may not contain space characters"
|
||||
}
|
||||
if {[string first " " $autosetup(builddir)] != -1} {
|
||||
user-error "The pathname of the build directory\
|
||||
may not contain space characters"
|
||||
}
|
||||
|
||||
use proj
|
||||
# We want this version info to be emitted up front, but we have to
|
||||
# 'use system' for --prefix=... to work. Ergo, this bit is up here
|
||||
# instead of in [sqlite-configure].
|
||||
define PACKAGE_VERSION [proj-file-content -trim $::autosetup(srcdir)/VERSION]
|
||||
if {"--help" ni $::argv} {
|
||||
msg-result "Configuring SQLite version [get-define PACKAGE_VERSION]"
|
||||
}
|
||||
use system ; # Will output "Host System" and "Build System" lines
|
||||
if {"--help" ni $::argv} {
|
||||
msg-result "Source dir = $::autosetup(srcdir)"
|
||||
msg-result "Build dir = $::autosetup(builddir)"
|
||||
}
|
||||
use cc cc-db cc-shared cc-lib pkg-config proj
|
||||
|
||||
#
|
||||
# Object for communicating config-time state across various
|
||||
@@ -44,9 +23,13 @@ array set sqliteConfig [proj-strip-hash-comments {
|
||||
# and not part of the public build interface.
|
||||
dump-defines-txt ./config.defines.txt
|
||||
#
|
||||
# If not empty then --dump-defines will dump not only
|
||||
# (dump-defines-txt) but also a JSON file named after this option's
|
||||
# value.
|
||||
# Output file for --dump-defines-json. This is the autosetup
|
||||
# counterpart of the historical "DEFS" var which was generated by
|
||||
# the autotools in the pre-processed autotools builds (but not in
|
||||
# the canonical tree). Generation of this file is disabled (via an
|
||||
# empty file name) until/unless someone voices a specific interest
|
||||
# in it. The original motivating use case is handled fine by
|
||||
# sqlite_cfg.h.
|
||||
dump-defines-json ""
|
||||
}]
|
||||
|
||||
@@ -58,369 +41,6 @@ array set sqliteConfig [proj-strip-hash-comments {
|
||||
#
|
||||
set sqliteConfig(is-cross-compiling) [proj-is-cross-compiling]
|
||||
|
||||
########################################################################
|
||||
# Processes all configure --flags for this build $buildMode must be
|
||||
# either "canonical" or "autoconf", and others may be added in the
|
||||
# future. After bootstrapping, $configScript is eval'd in the caller's
|
||||
# scope, then post-configuration finalization is run. $configScript is
|
||||
# intended to hold configure code which is specific to the given
|
||||
# $buildMode, with the caveat that _some_ build-specific code is
|
||||
# encapsulated in the configuration finalization step.
|
||||
proc sqlite-configure {buildMode configScript} {
|
||||
set allBuildModes {canonical autoconf}
|
||||
if {$buildMode ni $allBuildModes} {
|
||||
user-error "Invalid build mode: $buildMode. Expecting one of: $allBuildModes"
|
||||
}
|
||||
set ::sqliteConfig(build-mode) $buildMode
|
||||
########################################################################
|
||||
# A gentle introduction to flags handling in autosetup
|
||||
#
|
||||
# Reference: https://msteveb.github.io/autosetup/developer/
|
||||
#
|
||||
# All configure flags must be described in an 'options' call. The
|
||||
# general syntax is:
|
||||
#
|
||||
# FLAG => {Help text}
|
||||
#
|
||||
# Where FLAG can have any of the following formats:
|
||||
#
|
||||
# boolopt => "a boolean option which defaults to disabled"
|
||||
# boolopt2=1 => "a boolean option which defaults to enabled"
|
||||
# stringopt: => "an option which takes an argument, e.g. --stringopt=value"
|
||||
# stringopt2:=value => "an option where the argument is optional and defaults to 'value'"
|
||||
# optalias booltopt3 => "a boolean with a hidden alias. --optalias is not shown in --help"
|
||||
#
|
||||
# Autosetup does no small amount of specialized handling for flags,
|
||||
# especially booleans. Each bool-type --FLAG implicitly gets
|
||||
# --enable-FLAG and --disable-FLAG forms. That can lead lead to some
|
||||
# confusion when writing help text. For example:
|
||||
#
|
||||
# options { json=1 {Disable JSON functions} }
|
||||
#
|
||||
# The reason the help text says "disable" is because a boolean option
|
||||
# which defaults to true is, in the --help text, rendered as:
|
||||
#
|
||||
# --disable-json Disable JSON functions
|
||||
#
|
||||
# Whereas a bool flag which defaults to false will instead render as:
|
||||
#
|
||||
# --enable-FLAG
|
||||
#
|
||||
# Non-boolean flags, in contrast, use the names specifically given to
|
||||
# them in the [options] invocation. e.g. "with-tcl" is the --with-tcl
|
||||
# flag.
|
||||
#
|
||||
# Fetching values for flags:
|
||||
#
|
||||
# booleans: use one of:
|
||||
# - [opt-bool FLAG] is autosetup's built-in command for this, but we
|
||||
# have some convenience variants:
|
||||
# - [proj-opt-truthy FLAG]
|
||||
# - [proj-opt-if-truthy FLAG {THEN} {ELSE}]
|
||||
#
|
||||
# Non-boolean (i.e. string) flags:
|
||||
# - [opt-val FLAG ?default?]
|
||||
# - [opt-str ...] - see the docs in ./autosetup/autosetup
|
||||
#
|
||||
# [proj-opt-was-provided] can be used to determine whether a flag was
|
||||
# explicitly provided, which is often useful for distinguishing from
|
||||
# the case of a default value.
|
||||
########################################################################
|
||||
set allFlags {
|
||||
# Structure: a list of M {Z} pairs, where M is a descriptive
|
||||
# option group name and Z is a list of X Y pairs. X is a list of
|
||||
# $buildMode name(s) to which the Y flags apply, or {*} to apply
|
||||
# to all builds. Y is a {block} in the form expected by
|
||||
# autosetup's [options] command. Each block which is applicable
|
||||
# to $buildMode is appended to a new list before that list is
|
||||
# passed on to [options]. The order of each Y and sub-Y is
|
||||
# retained, which is significant for rendering of --help.
|
||||
|
||||
# When writing {help text blocks}, be aware that:
|
||||
#
|
||||
# A) autosetup formats them differently if the {block} starts with
|
||||
# a newline: it starts left-aligned, directly under the --flag, and
|
||||
# the rest of the block is pasted verbatim rather than
|
||||
# pretty-printed.
|
||||
#
|
||||
# B) Vars and commands are NOT expanded, but we use a [subst] call
|
||||
# below which will replace (only) var refs.
|
||||
|
||||
# Options for how to build the library
|
||||
build-modes {
|
||||
{*} {
|
||||
shared=1 => {Disable build of shared libary}
|
||||
static=1 => {Disable build of static library}
|
||||
}
|
||||
{canonical} {
|
||||
amalgamation=1 => {Disable the amalgamation and instead build all files separately}
|
||||
}
|
||||
}
|
||||
|
||||
# Library-level features and defaults
|
||||
lib-features {
|
||||
{*} {
|
||||
threadsafe=1 => {Disable mutexing}
|
||||
with-tempstore:=no => {Use an in-RAM database for temporary tables: never,no,yes,always}
|
||||
largefile=1
|
||||
=> {This legacy flag has no effect on the library but may influence
|
||||
the contents of the generated sqlite_cfg.h}
|
||||
# ^^^ It's not clear that this actually does anything, as
|
||||
# HAVE_LFS is not checked anywhere in the .c/.h/.in files.
|
||||
load-extension=1 => {Disable loading of external extensions}
|
||||
math=1 => {Disable math functions}
|
||||
json=1 => {Disable JSON functions}
|
||||
memsys5 => {Enable MEMSYS5}
|
||||
memsys3 => {Enable MEMSYS3}
|
||||
fts3 => {Enable the FTS3 extension}
|
||||
fts4 => {Enable the FTS4 extension}
|
||||
fts5 => {Enable the FTS5 extension}
|
||||
update-limit => {Enable the UPDATE/DELETE LIMIT clause}
|
||||
geopoly => {Enable the GEOPOLY extension}
|
||||
rtree => {Enable the RTREE extension}
|
||||
session => {Enable the SESSION extension}
|
||||
all => {Enable FTS4, FTS5, Geopoly, RTree, Sessions}
|
||||
}
|
||||
}
|
||||
|
||||
# Options for TCL support
|
||||
tcl {
|
||||
{canonical} {
|
||||
with-tcl:DIR
|
||||
=> {Directory containing tclConfig.sh or a directory one level up from
|
||||
that, from which we can derive a directory containing tclConfig.sh.
|
||||
A dir name of "prefix" is equivalent to the directory specified by
|
||||
the --prefix flag.}
|
||||
with-tclsh:PATH
|
||||
=> {Full pathname of tclsh to use. It is used for (A) trying to find
|
||||
tclConfig.sh and (B) all TCL-based code generation. Warning: if
|
||||
its containing dir has multiple tclsh versions, it may select the
|
||||
wrong tclConfig.sh!}
|
||||
tcl=1
|
||||
=> {Disable components which require TCL, including all tests.
|
||||
This tree requires TCL for code generation but can use the in-tree
|
||||
copy of autosetup/jimsh0.c for that. The SQLite TCL extension and the
|
||||
test code require a canonical tclsh.}
|
||||
}
|
||||
}
|
||||
|
||||
# Options for line-editing modes for the CLI shell
|
||||
line-editing {
|
||||
{*} {
|
||||
readline=1
|
||||
=> {Disable readline support}
|
||||
# --with-readline-lib is a backwards-compatible alias for
|
||||
# --with-readline-ldflags
|
||||
with-readline-lib:
|
||||
with-readline-ldflags:=auto
|
||||
=> {Readline LDFLAGS, e.g. -lreadline -lncurses}
|
||||
# --with-readline-inc is a backwards-compatible alias for
|
||||
# --with-readline-cflags.
|
||||
with-readline-inc:
|
||||
with-readline-cflags:=auto
|
||||
=> {Readline CFLAGS, e.g. -I/path/to/includes}
|
||||
with-readline-header:PATH
|
||||
=> {Full path to readline.h, from which --with-readline-cflags will be derived}
|
||||
with-linenoise:DIR
|
||||
=> {Source directory for linenoise.c and linenoise.h}
|
||||
editline=0
|
||||
=> {Enable BSD editline support}
|
||||
}
|
||||
}
|
||||
|
||||
# Options for ICU: International Components for Unicode
|
||||
icu {
|
||||
{*} {
|
||||
with-icu-ldflags:LDFLAGS
|
||||
=> {Enable SQLITE_ENABLE_ICU and add the given linker flags for the
|
||||
ICU libraries. e.g. on Ubuntu systems, try '-licui18n -licuuc -licudata'.}
|
||||
with-icu-cflags:CFLAGS
|
||||
=> {Apply extra CFLAGS/CPPFLAGS necessary for building with ICU.
|
||||
e.g. -I/usr/local/include}
|
||||
with-icu-config:=auto
|
||||
=> {Enable SQLITE_ENABLE_ICU. Value must be one of: auto, pkg-config,
|
||||
/path/to/icu-config}
|
||||
icu-collations=0
|
||||
=> {Enable SQLITE_ENABLE_ICU_COLLATIONS. Requires --with-icu-ldflags=...
|
||||
or --with-icu-config}
|
||||
}
|
||||
}
|
||||
|
||||
# Options for exotic/alternative build modes
|
||||
alternative-builds {
|
||||
{canonical} {
|
||||
# Potential TODO: add --with-wasi-sdk support to the autoconf
|
||||
# build
|
||||
with-wasi-sdk:=/opt/wasi-sdk
|
||||
=> {Top-most dir of the wasi-sdk for a WASI build}
|
||||
|
||||
with-emsdk:=auto
|
||||
=> {Top-most dir of the Emscripten SDK installation.
|
||||
Needed only by ext/wasm build. Default=EMSDK env var.}
|
||||
}
|
||||
}
|
||||
|
||||
# Options primarily for downstream packagers/package maintainers
|
||||
packaging {
|
||||
{autoconf} {
|
||||
# --disable-static-shell: https://sqlite.org/forum/forumpost/cc219ee704
|
||||
static-shell=1
|
||||
=> {Link the sqlite3 shell app against the DLL instead of embedding sqlite3.c}
|
||||
}
|
||||
{*} {
|
||||
# A potential TODO without a current use case:
|
||||
#rpath=1 => {Disable use of the rpath linker flag}
|
||||
# soname: https://sqlite.org/src/forumpost/5a3b44f510df8ded
|
||||
soname:=legacy
|
||||
=> {SONAME for libsqlite3.so. "none", or not using this flag, sets no
|
||||
soname. "legacy" sets it to its historical value of
|
||||
libsqlite3.so.0. A value matching the glob "libsqlite3.*" sets
|
||||
it to that literal value. Any other value is assumed to be a
|
||||
suffix which gets applied to "libsqlite3.so.",
|
||||
e.g. --soname=9.10 equates to "libsqlite3.so.9.10".}
|
||||
# dll-basename: https://sqlite.org/forum/forumpost/828fdfe904
|
||||
dll-basename:=auto
|
||||
=> {Specifies the base name of the resulting DLL file.
|
||||
If not provided, libsqlite3 is usually assumed but on some platforms
|
||||
a platform-dependent default is used. On some platforms this flag
|
||||
gets automatically enabled if it is not provided. Use "default" to
|
||||
explicitly disable platform-dependent activation on such systems.}
|
||||
# out-implib: https://sqlite.org/forum/forumpost/0c7fc097b2
|
||||
out-implib:=auto
|
||||
=> {Enable use of --out-implib linker flag to generate an
|
||||
"import library" for the DLL. The output's base name name is
|
||||
specified by the value, with "auto" meaning to figure out a
|
||||
name automatically. On some platforms this flag gets
|
||||
automatically enabled if it is not provided. Use "none" to
|
||||
explicitly disable this feature on such platforms.}
|
||||
}
|
||||
}
|
||||
|
||||
# Options mostly for sqlite's own development
|
||||
developer {
|
||||
{*} {
|
||||
# Note that using the --debug/--enable-debug flag here
|
||||
# requires patching autosetup/autosetup to rename its builtin
|
||||
# --debug to --autosetup-debug. See details in
|
||||
# autosetup/README.md#patching.
|
||||
with-debug=0
|
||||
debug=0
|
||||
=> {Enable debug build flags. This option will impact performance by
|
||||
as much as 4x, as it includes large numbers of assert()s in
|
||||
performance-critical loops. Never use --debug for production
|
||||
builds.}
|
||||
scanstatus
|
||||
=> {Enable the SQLITE_ENABLE_STMT_SCANSTATUS feature flag}
|
||||
}
|
||||
{canonical} {
|
||||
dev
|
||||
=> {Enable dev-mode build: automatically enables certain other flags}
|
||||
test-status
|
||||
=> {Enable status of tests}
|
||||
gcov=0
|
||||
=> {Enable coverage testing using gcov}
|
||||
linemacros
|
||||
=> {Enable #line macros in the amalgamation}
|
||||
dynlink-tools
|
||||
=> {Dynamically link libsqlite3 to certain tools which normally statically embed it}
|
||||
}
|
||||
{*} {
|
||||
dump-defines=0
|
||||
=> {Dump autosetup defines to $::sqliteConfig(dump-defines-txt)
|
||||
(for build debugging)}
|
||||
}
|
||||
}
|
||||
}; # $allOpts
|
||||
|
||||
# Filter allOpts to create the set of [options] legal for this build
|
||||
set opts {}
|
||||
foreach {group XY} [subst -nobackslashes -nocommands \
|
||||
[proj-strip-hash-comments $allFlags]] {
|
||||
foreach {X Y} $XY {
|
||||
if { $buildMode in $X || "*" in $X } {
|
||||
foreach y $Y {
|
||||
lappend opts $y
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#lappend opts "soname:=duplicateEntry => {x}"; #just testing
|
||||
if {[catch {options $opts} msg xopts]} {
|
||||
# Workaround for <https://github.com/msteveb/autosetup/issues/73>
|
||||
# where [options] behaves oddly on _some_ TCL builds when it's
|
||||
# called from deeper than the global scope.
|
||||
dict incr xopts -level
|
||||
return {*}$xopts $msg
|
||||
}
|
||||
# The following uplevel is largely cosmetic, the intent being to put
|
||||
# the most-frequently-useful info at the top of the ./configure
|
||||
# output, but also avoiding outputing it if --help is used.
|
||||
uplevel 1 {
|
||||
use cc cc-db cc-shared cc-lib pkg-config
|
||||
}
|
||||
sqlite-post-options-init
|
||||
uplevel 1 $configScript
|
||||
sqlite-configure-finalize
|
||||
}; # sqlite-configure
|
||||
|
||||
########################################################################
|
||||
# Performs late-stage config steps common to both the canonical and
|
||||
# autoconf bundle builds.
|
||||
proc sqlite-configure-finalize {} {
|
||||
set buildMode $::sqliteConfig(build-mode)
|
||||
set isCanonical [expr {$buildMode eq "canonical"}]
|
||||
set isAutoconf [expr {$buildMode eq "autoconf"}]
|
||||
|
||||
define HAVE_LFS 0
|
||||
if {[opt-bool largefile]} {
|
||||
#
|
||||
# Insofar as we can determine HAVE_LFS has no effect on the
|
||||
# library. Perhaps it did back in the early 2000's. The
|
||||
# --enable/disable-largefile flag is retained because it's
|
||||
# harmless, but it doesn't do anything useful. It does have
|
||||
# visible side-effects, though: the generated sqlite_cfg.h may (or
|
||||
# may not) define HAVE_LFS.
|
||||
#
|
||||
cc-check-lfs
|
||||
}
|
||||
|
||||
if {$isCanonical} {
|
||||
if {![opt-bool static]} {
|
||||
proj-indented-notice {
|
||||
NOTICE: static lib build may be implicitly re-activated by
|
||||
other components, e.g. some test apps.
|
||||
}
|
||||
}
|
||||
} else {
|
||||
proj-assert { $isAutoconf } "Invalid build mode"
|
||||
proj-define-for-opt static-shell ENABLE_STATIC_SHELL \
|
||||
"Link library statically into the CLI shell?"
|
||||
if {![opt-bool shared] && ![opt-bool static-shell]} {
|
||||
proj-opt-set shared 1
|
||||
proj-indented-notice {
|
||||
NOTICE: ignoring --disable-shared because --disable-static-shell
|
||||
was specified.
|
||||
}
|
||||
}
|
||||
}
|
||||
proj-define-for-opt shared ENABLE_LIB_SHARED "Build shared library?"
|
||||
proj-define-for-opt static ENABLE_LIB_STATIC "Build static library?"
|
||||
|
||||
sqlite-handle-debug
|
||||
sqlite-handle-rpath
|
||||
sqlite-handle-soname
|
||||
sqlite-handle-threadsafe
|
||||
sqlite-handle-tempstore
|
||||
sqlite-handle-line-editing
|
||||
sqlite-handle-load-extension
|
||||
sqlite-handle-math
|
||||
sqlite-handle-icu
|
||||
sqlite-handle-env-quirks
|
||||
sqlite-process-dot-in-files
|
||||
sqlite-post-config-validation
|
||||
sqlite-dump-defines
|
||||
}; # sqlite-configure-finalize
|
||||
|
||||
########################################################################
|
||||
# Runs some common initialization which must happen immediately after
|
||||
# autosetup's [options] function is called. This is also a convenient
|
||||
@@ -428,10 +48,6 @@ proc sqlite-configure-finalize {} {
|
||||
# top-level build and the "autoconf" build, but it's not intended to
|
||||
# be a catch-all dumping ground for such.
|
||||
proc sqlite-post-options-init {} {
|
||||
define PACKAGE_NAME "sqlite"
|
||||
define PACKAGE_URL {https://sqlite.org}
|
||||
define PACKAGE_BUGREPORT [get-define PACKAGE_URL]/forum
|
||||
define PACKAGE_STRING "[get-define PACKAGE_NAME] [get-define PACKAGE_VERSION]"
|
||||
#
|
||||
# Carry values from hidden --flag aliases over to their canonical
|
||||
# flag forms. This list must include only options which are common
|
||||
@@ -452,7 +68,23 @@ proc sqlite-post-options-init {} {
|
||||
define SQLITE_OS_WIN 0
|
||||
}
|
||||
set ::sqliteConfig(msg-debug-enabled) [proj-val-truthy [get-env msg-debug 0]]
|
||||
sqlite-setup-default-cflags
|
||||
sqlite-setup-package-info
|
||||
}
|
||||
|
||||
########################################################################
|
||||
# Called by [sqlite-post-options-init] to set up PACKAGE_NAME and
|
||||
# related defines.
|
||||
proc sqlite-setup-package-info {} {
|
||||
set srcdir $::autosetup(srcdir)
|
||||
set PACKAGE_VERSION [proj-file-content -trim $srcdir/VERSION]
|
||||
define PACKAGE_NAME "sqlite"
|
||||
define PACKAGE_URL {https://sqlite.org}
|
||||
define PACKAGE_VERSION $PACKAGE_VERSION
|
||||
define PACKAGE_STRING "[get-define PACKAGE_NAME] $PACKAGE_VERSION"
|
||||
define PACKAGE_BUGREPORT [get-define PACKAGE_URL]/forum
|
||||
msg-result "Source dir = $srcdir"
|
||||
msg-result "Build dir = $::autosetup(builddir)"
|
||||
msg-result "Configuring SQLite version $PACKAGE_VERSION"
|
||||
}
|
||||
|
||||
########################################################################
|
||||
@@ -472,19 +104,19 @@ proc sqlite-autoreconfig {} {
|
||||
# configure script with the same arguments it was initially invoked
|
||||
# with. This can be used to automatically reconfigure
|
||||
#
|
||||
set squote {{arg} {
|
||||
proc squote {arg} {
|
||||
# Wrap $arg in single-quotes if it looks like it might need that
|
||||
# to avoid mis-handling as a shell argument. We assume that $arg
|
||||
# will never contain any single-quote characters.
|
||||
if {[string match {*[ &;$*"]*} $arg]} { return '$arg' }
|
||||
return $arg
|
||||
}}
|
||||
define-append SQLITE_AUTORECONFIG cd [apply $squote $::autosetup(builddir)] \
|
||||
&& [apply $squote $::autosetup(srcdir)/configure]
|
||||
}
|
||||
define-append SQLITE_AUTORECONFIG cd [squote $::autosetup(builddir)] && [squote $::autosetup(srcdir)/configure]
|
||||
#{*}$::autosetup(argv) breaks with --flag='val with spaces', so...
|
||||
foreach arg $::autosetup(argv) {
|
||||
define-append SQLITE_AUTORECONFIG [apply $squote $arg]
|
||||
define-append SQLITE_AUTORECONFIG [squote $arg]
|
||||
}
|
||||
rename squote ""
|
||||
}
|
||||
|
||||
define OPT_FEATURE_FLAGS {} ; # -DSQLITE_OMIT/ENABLE flags.
|
||||
@@ -555,15 +187,9 @@ proc sqlite-check-common-system-deps {} {
|
||||
cc-check-functions gmtime_r isnan localtime_r localtime_s \
|
||||
malloc_usable_size strchrnul usleep utime pread pread64 pwrite pwrite64
|
||||
|
||||
set ldrt ""
|
||||
# Collapse funcs from librt into LDFLAGS_RT.
|
||||
# Some systems (ex: SunOS) require -lrt in order to use nanosleep
|
||||
foreach func {fdatasync nanosleep} {
|
||||
if {[proj-check-function-in-lib $func rt]} {
|
||||
lappend ldrt [get-define lib_${func}]
|
||||
}
|
||||
}
|
||||
define LDFLAGS_RT [join [lsort -unique $ldrt] ""]
|
||||
proj-check-function-in-lib fdatasync rt
|
||||
define LDFLAGS_FDATASYNC [get-define lib_fdatasync]
|
||||
undefine lib_fdatasync
|
||||
|
||||
#
|
||||
# Check for needed/wanted headers
|
||||
@@ -651,41 +277,15 @@ proc sqlite-setup-default-cflags {} {
|
||||
# Handle various SQLITE_ENABLE_... feature flags.
|
||||
proc sqlite-handle-common-feature-flags {} {
|
||||
msg-result "Feature flags..."
|
||||
if {"tcl-extension" eq $::sqliteConfig(build-mode)} {
|
||||
set allFlagEnables {fts3 fts4 fts5 rtree geopoly}
|
||||
} else {
|
||||
set allFlagEnables {fts4 fts5 rtree rtree geopoly session}
|
||||
}
|
||||
if {![opt-bool all]} {
|
||||
# Special handling for --disable-all
|
||||
foreach flag $allFlagEnables {
|
||||
if {![proj-opt-was-provided $flag]} {
|
||||
proj-opt-set $flag 0
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach {boolFlag featureFlag ifSetEvalThis} [proj-strip-hash-comments {
|
||||
foreach {boolFlag featureFlag ifSetEvalThis} {
|
||||
all {} {
|
||||
# The 'all' option must be first in this list. This impl makes
|
||||
# an effort to only apply flags which the user did not already
|
||||
# apply, so that combinations like (--all --disable-geopoly)
|
||||
# will indeed disable geopoly. There are corner cases where
|
||||
# flags which depend on each other will behave in non-intuitive
|
||||
# ways:
|
||||
#
|
||||
# --all --disable-rtree
|
||||
#
|
||||
# Will NOT disable geopoly, though geopoly depends on rtree.
|
||||
# The --geopoly flag, though, will automatically re-enable
|
||||
# --rtree, so --disable-rtree won't actually disable anything in
|
||||
# that case.
|
||||
foreach k $allFlagEnables {
|
||||
if {![proj-opt-was-provided $k]} {
|
||||
proj-opt-set $k 1
|
||||
}
|
||||
}
|
||||
# The 'all' option must be first in this list.
|
||||
proj-opt-set fts4
|
||||
proj-opt-set fts5
|
||||
proj-opt-set geopoly
|
||||
proj-opt-set rtree
|
||||
proj-opt-set session
|
||||
}
|
||||
fts3 -DSQLITE_ENABLE_FTS3 {sqlite-affirm-have-math fts3}
|
||||
fts4 -DSQLITE_ENABLE_FTS4 {sqlite-affirm-have-math fts4}
|
||||
fts5 -DSQLITE_ENABLE_FTS5 {sqlite-affirm-have-math fts5}
|
||||
geopoly -DSQLITE_ENABLE_GEOPOLY {proj-opt-set rtree}
|
||||
@@ -702,7 +302,7 @@ proc sqlite-handle-common-feature-flags {} {
|
||||
}
|
||||
}
|
||||
scanstatus -DSQLITE_ENABLE_STMT_SCANSTATUS {}
|
||||
}] {
|
||||
} {
|
||||
if {$boolFlag ni $::autosetup(options)} {
|
||||
# Skip flags which are in the canonical build but not
|
||||
# the autoconf bundle.
|
||||
@@ -810,35 +410,29 @@ proc sqlite-handle-soname {} {
|
||||
}
|
||||
|
||||
########################################################################
|
||||
# If --enable-threadsafe is set, this adds -DSQLITE_THREADSAFE=1 to
|
||||
# If --enable-thresafe is set, this adds -DSQLITE_THREADSAFE=1 to
|
||||
# OPT_FEATURE_FLAGS and sets LDFLAGS_PTHREAD to the linker flags
|
||||
# needed for linking pthread (possibly an empty string). If
|
||||
# --enable-threadsafe is not set, adds -DSQLITE_THREADSAFE=0 to
|
||||
# OPT_FEATURE_FLAGS and sets LDFLAGS_PTHREAD to an empty string.
|
||||
# needed for linking pthread. If --enable-threadsafe is not set, adds
|
||||
# -DSQLITE_THREADSAFE=0 to OPT_FEATURE_FLAGS and sets LDFLAGS_PTHREAD
|
||||
# to an empty string.
|
||||
proc sqlite-handle-threadsafe {} {
|
||||
msg-checking "Support threadsafe operation? "
|
||||
define LDFLAGS_PTHREAD ""
|
||||
set enable 0
|
||||
proj-if-opt-truthy threadsafe {
|
||||
msg-result "Checking for libs..."
|
||||
if {[proj-check-function-in-lib pthread_create pthread]
|
||||
&& [proj-check-function-in-lib pthread_mutexattr_init pthread]} {
|
||||
set enable 1
|
||||
define LDFLAGS_PTHREAD [get-define lib_pthread_create]
|
||||
undefine lib_pthread_create
|
||||
undefine lib_pthread_mutexattr_init
|
||||
} elseif {[proj-opt-was-provided threadsafe]} {
|
||||
user-error "Missing required pthread libraries. Use --disable-threadsafe to disable this check."
|
||||
} else {
|
||||
msg-result "pthread support not detected"
|
||||
msg-result yes
|
||||
sqlite-add-feature-flag -DSQLITE_THREADSAFE=1
|
||||
if {![proj-check-function-in-lib pthread_create pthread]
|
||||
|| ![proj-check-function-in-lib pthread_mutexattr_init pthread]} {
|
||||
user-error "Missing required pthread bits"
|
||||
}
|
||||
define LDFLAGS_PTHREAD [get-define lib_pthread_create]
|
||||
undefine lib_pthread_create
|
||||
# Recall that LDFLAGS_PTHREAD might be empty even if pthreads if
|
||||
# found because it's in -lc on some platforms.
|
||||
} {
|
||||
msg-result "Disabled using --disable-threadsafe"
|
||||
msg-result no
|
||||
sqlite-add-feature-flag -DSQLITE_THREADSAFE=0
|
||||
define LDFLAGS_PTHREAD ""
|
||||
}
|
||||
sqlite-add-feature-flag -DSQLITE_THREADSAFE=${enable}
|
||||
return $enable
|
||||
}
|
||||
|
||||
########################################################################
|
||||
@@ -924,35 +518,6 @@ proc sqlite-handle-emsdk {} {
|
||||
}
|
||||
}
|
||||
|
||||
########################################################################
|
||||
# Internal helper for [sqlite-check-line-editing]. Returns a list of
|
||||
# potential locations under which readline.h might be found.
|
||||
proc sqlite-get-readline-dir-list {} {
|
||||
# Historical note: the dirs list, except for the inclusion of
|
||||
# $prefix and some platform-specific dirs, originates from the
|
||||
# legacy configure script
|
||||
set dirs [list [get-define prefix]]
|
||||
switch -glob -- [get-define host] {
|
||||
*-linux-android {
|
||||
# Possibly termux
|
||||
lappend dirs /data/data/com.termux/files/usr
|
||||
}
|
||||
*-mingw32 {
|
||||
lappend dirs /mingw32 /mingw
|
||||
}
|
||||
*-mingw64 {
|
||||
lappend dirs /mingw64 /mingw
|
||||
}
|
||||
}
|
||||
lappend dirs /usr /usr/local /usr/local/readline /usr/contrib
|
||||
set rv {}
|
||||
foreach d $dirs {
|
||||
if {[file isdir $d]} {lappend rv $d}
|
||||
}
|
||||
#msg-debug "sqlite-get-readline-dir-list dirs=$rv"
|
||||
return $rv
|
||||
}
|
||||
|
||||
########################################################################
|
||||
# sqlite-check-line-editing jumps through proverbial hoops to try to
|
||||
# find a working line-editing library, setting:
|
||||
@@ -1089,7 +654,7 @@ proc sqlite-check-line-editing {} {
|
||||
# ^^^ this check is derived from the legacy configure script.
|
||||
proj-warn "Skipping check for readline.h because we're cross-compiling."
|
||||
} else {
|
||||
set dirs [sqlite-get-readline-dir-list]
|
||||
set dirs "[get-define prefix] /usr /usr/local /usr/local/readline /usr/contrib /mingw"
|
||||
set subdirs "include/$editLibName"
|
||||
if {"editline" eq $editLibName} {
|
||||
lappend subdirs include/readline
|
||||
@@ -1097,14 +662,16 @@ proc sqlite-check-line-editing {} {
|
||||
# and uses libreadline's header.
|
||||
}
|
||||
lappend subdirs include
|
||||
# ^^^ The dirs and subdirs lists are, except for the inclusion
|
||||
# of $prefix and editline, from the legacy configure script
|
||||
set rlInc [proj-search-for-header-dir readline.h \
|
||||
-dirs $dirs -subdirs $subdirs]
|
||||
if {"" ne $rlInc} {
|
||||
if {[string match */readline $rlInc]} {
|
||||
set rlInc [file dirname $rlInc]; # CLI shell: #include <readline/readline.h>
|
||||
set rlInc [file dirname $rlInc]; # shell #include's <readline/readline.h>
|
||||
} elseif {[string match */editline $rlInc]} {
|
||||
set editLibDef HAVE_EDITLINE
|
||||
set rlInc [file dirname $rlInc]; # CLI shell: #include <editline/readline.h>
|
||||
set rlInc [file dirname $rlInc]; # shell #include's <editline/readline.h>
|
||||
}
|
||||
set rlInc "-I${rlInc}"
|
||||
}
|
||||
@@ -1123,7 +690,7 @@ proc sqlite-check-line-editing {} {
|
||||
set rlLib ""
|
||||
if {"" ne $rlInc} {
|
||||
set rlLib [opt-val with-readline-ldflags]
|
||||
if {$rlLib eq "auto" || $rlLib eq ""} {
|
||||
if {"" eq $rlLib || "auto" eq $rlLib} {
|
||||
set rlLib ""
|
||||
set libTerm ""
|
||||
if {[proj-check-function-in-lib tgetent "$editLibName ncurses curses termcap"]} {
|
||||
@@ -1148,7 +715,7 @@ proc sqlite-check-line-editing {} {
|
||||
# linking to the GPL'd libreadline. Presumably that distinction is
|
||||
# significant for those using --editline.
|
||||
proj-indented-notice {
|
||||
NOTE: the local libedit uses <readline/readline.h> so we
|
||||
NOTE: the local libedit but uses <readline/readline.h> so we
|
||||
will compile with -DHAVE_READLINE=1 but will link with
|
||||
libedit.
|
||||
}
|
||||
@@ -1230,7 +797,6 @@ proc sqlite-handle-icu {} {
|
||||
define LDFLAGS_ICU [join [opt-val with-icu-ldflags ""]]
|
||||
define CFLAGS_ICU [join [opt-val with-icu-cflags ""]]
|
||||
if {[proj-opt-was-provided with-icu-config]} {
|
||||
msg-result "Checking for ICU support..."
|
||||
set icuConfigBin [opt-val with-icu-config]
|
||||
set tryIcuConfigBin 1; # set to 0 if we end up using pkg-config
|
||||
if {"auto" eq $icuConfigBin || "pkg-config" eq $icuConfigBin} {
|
||||
@@ -1254,28 +820,19 @@ proc sqlite-handle-icu {} {
|
||||
/usr/local/bin/icu-config \
|
||||
/usr/bin/icu-config]
|
||||
if {"" eq $icuConfigBin} {
|
||||
proj-indented-notice -error {
|
||||
--with-icu-config=auto cannot find (pkg-config icu-io) or icu-config binary.
|
||||
On Ubuntu-like systems try:
|
||||
--with-icu-ldflags='-licui18n -licuuc -licudata'
|
||||
}
|
||||
proj-fatal "--with-icu-config=auto cannot find (pkg-config icu-io) or icu-config binary"
|
||||
}
|
||||
}
|
||||
if {[file-isexec $icuConfigBin]} {
|
||||
set x [exec $icuConfigBin --ldflags]
|
||||
if {"" eq $x} {
|
||||
proj-indented-notice -error \
|
||||
[subst {
|
||||
$icuConfigBin --ldflags returned no data.
|
||||
On Ubuntu-like systems try:
|
||||
--with-icu-ldflags='-licui18n -licuuc -licudata'
|
||||
}]
|
||||
proj-fatal "$icuConfigBin --ldflags returned no data"
|
||||
}
|
||||
define-append LDFLAGS_ICU $x
|
||||
set x [exec $icuConfigBin --cppflags]
|
||||
define-append CFLAGS_ICU $x
|
||||
} else {
|
||||
proj-fatal "--with-icu-config=$icuConfigBin does not refer to an executable"
|
||||
proj-fatal "--with-icu-config=$bin does not refer to an executable"
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1375,11 +932,11 @@ proc sqlite-handle-math {} {
|
||||
# libtool applied only on Mac platforms.
|
||||
#
|
||||
# Based on https://sqlite.org/forum/forumpost/9dfd5b8fd525a5d7.
|
||||
proc sqlite-handle-mac-cversion {} {
|
||||
proc sqlite-check-mac-cversion {} {
|
||||
define LDFLAGS_MAC_CVERSION ""
|
||||
set rc 0
|
||||
if {[proj-looks-like-mac]} {
|
||||
cc-with {-link 1} {
|
||||
cc-with {} {
|
||||
# These version numbers are historical libtool-defined values, not
|
||||
# library-defined ones
|
||||
if {[cc-check-flags "-Wl,-current_version,9.6.0"]
|
||||
@@ -1397,196 +954,34 @@ proc sqlite-handle-mac-cversion {} {
|
||||
}
|
||||
|
||||
########################################################################
|
||||
# If this is a Mac platform, check for support for
|
||||
# -Wl,-install_name,... and, if it's set, define
|
||||
# LDFLAGS_MAC_INSTALL_NAME to a variant of that string which is
|
||||
# intended to expand at make-time, else set LDFLAGS_MAC_INSTALL_NAME
|
||||
# to an empty string.
|
||||
#
|
||||
# https://sqlite.org/forum/forumpost/5651662b8875ec0a
|
||||
proc sqlite-handle-mac-install-name {} {
|
||||
define LDFLAGS_MAC_INSTALL_NAME ""; # {-Wl,-install_name,"$(install-dir.lib)/$(libsqlite3.DLL)"}
|
||||
set rc 0
|
||||
if {[proj-looks-like-mac]} {
|
||||
cc-with {-link 1} {
|
||||
if {[cc-check-flags "-Wl,-install_name,/usr/local/lib/libsqlite3.dylib"]} {
|
||||
define LDFLAGS_MAC_INSTALL_NAME {-Wl,-install_name,"$(install-dir.lib)/$(libsqlite3.DLL)"}
|
||||
set rc 1
|
||||
}
|
||||
}
|
||||
}
|
||||
return $rc
|
||||
}
|
||||
|
||||
########################################################################
|
||||
# Handles the --dll-basename configure flag. [define]'s
|
||||
# SQLITE_DLL_BASENAME to the DLL's preferred base name (minus
|
||||
# extension). If --dll-basename is not provided then this is always
|
||||
# "libsqlite3", otherwise it may use a different value based on the
|
||||
# value of [get-define host].
|
||||
proc sqlite-handle-dll-basename {} {
|
||||
if {[proj-opt-was-provided dll-basename]} {
|
||||
set dn [join [opt-val dll-basename] ""]
|
||||
if {$dn in {none default}} { set dn libsqlite3 }
|
||||
} else {
|
||||
set dn libsqlite3
|
||||
}
|
||||
if {$dn in {auto ""}} {
|
||||
switch -glob -- [get-define host] {
|
||||
*-*-cygwin { set dn cygsqlite3-0 }
|
||||
*-*-ming* { set dn libsqlite3-0 }
|
||||
*-*-msys { set dn msys-sqlite3-0 }
|
||||
default { set dn libsqlite3 }
|
||||
}
|
||||
}
|
||||
define SQLITE_DLL_BASENAME $dn
|
||||
}
|
||||
|
||||
########################################################################
|
||||
# [define]s LDFLAGS_OUT_IMPLIB to either an empty string or to a
|
||||
# Define LDFLAGS_OUT_IMPLIB to either an empty string or to a
|
||||
# -Wl,... flag for the platform-specific --out-implib flag, which is
|
||||
# used for building an "import library .dll.a" file on some platforms
|
||||
# (e.g. msys2, mingw). Returns 1 if supported, else 0.
|
||||
#
|
||||
# The name of the import library is [define]d in SQLITE_OUT_IMPLIB.
|
||||
#
|
||||
# If the configure flag --out-implib is not used then this is a no-op.
|
||||
# If that flag is used but the capability is not available, a fatal
|
||||
# error is triggered.
|
||||
#
|
||||
# This feature is specifically opt-in because it's supported on far
|
||||
# more platforms than actually need it and enabling it causes creation
|
||||
# of libsqlite3.so.a files which are unnecessary in most environments.
|
||||
# (e.g. mingw). Returns 1 if supported, else 0.
|
||||
#
|
||||
# Added in response to: https://sqlite.org/forum/forumpost/0c7fc097b2
|
||||
#
|
||||
# Platform notes:
|
||||
#
|
||||
# - cygwin sqlite packages historically install no .dll.a file.
|
||||
#
|
||||
# - msys2 and mingw sqlite packages historically install
|
||||
# /usr/lib/libsqlite3.dll.a despite the DLL being in
|
||||
# /usr/bin/msys-sqlite3-0.dll.
|
||||
proc sqlite-handle-out-implib {} {
|
||||
proc sqlite-check-out-implib {} {
|
||||
define LDFLAGS_OUT_IMPLIB ""
|
||||
define SQLITE_OUT_IMPLIB ""
|
||||
set rc 0
|
||||
if {[proj-opt-was-provided out-implib]} {
|
||||
set olBaseName [join [opt-val out-implib] ""]
|
||||
if {$olBaseName in {auto ""}} {
|
||||
set olBaseName "libsqlite3" ;# [get-define SQLITE_DLL_BASENAME]
|
||||
# Based on discussions with mingw/msys users, the import lib
|
||||
# should always be called libsqlite3.dll.a even on platforms
|
||||
# which rename libsqlite3.dll to something else.
|
||||
}
|
||||
if {$olBaseName ne "none"} {
|
||||
cc-with {-link 1} {
|
||||
set dll "${olBaseName}[get-define TARGET_DLLEXT]"
|
||||
set flags [proj-cc-check-Wl-flag --out-implib ${dll}.a]
|
||||
if {"" ne $flags} {
|
||||
define LDFLAGS_OUT_IMPLIB $flags
|
||||
define SQLITE_OUT_IMPLIB ${dll}.a
|
||||
set rc 1
|
||||
}
|
||||
}
|
||||
if {!$rc} {
|
||||
user-error "--out-implib is not supported on this platform"
|
||||
}
|
||||
cc-with {} {
|
||||
set dll "libsqlite3[get-define TARGET_DLLEXT]"
|
||||
set flags "-Wl,--out-implib,${dll}.a"
|
||||
if {[cc-check-flags $flags]} {
|
||||
define LDFLAGS_OUT_IMPLIB $flags
|
||||
set rc 1
|
||||
}
|
||||
}
|
||||
return $rc
|
||||
}
|
||||
|
||||
########################################################################
|
||||
# If the given platform identifier (defaulting to [get-define host])
|
||||
# appears to be one of the Unix-on-Windows environments, returns a
|
||||
# brief symbolic name for that environment, else returns an empty
|
||||
# string.
|
||||
#
|
||||
# It does not distinguish between msys and msys2, returning msys for
|
||||
# both. The build does not, as of this writing, specifically support
|
||||
# msys v1.
|
||||
proc sqlite-env-is-unix-on-windows {{envTuple ""}} {
|
||||
if {"" eq $envTuple} {
|
||||
set envTuple [get-define host]
|
||||
}
|
||||
set name ""
|
||||
switch -glob -- $envTuple {
|
||||
*-*-cygwin { set name cygwin }
|
||||
*-*-ming* { set name mingw }
|
||||
*-*-msys { set name msys }
|
||||
}
|
||||
return $name;
|
||||
}
|
||||
|
||||
########################################################################
|
||||
# Performs various tweaks to the build which are only relevant on
|
||||
# certain platforms, e.g. Mac and "Unix on Windows" platforms (msys2,
|
||||
# cygwin, ...).
|
||||
#
|
||||
# 1) DLL installation:
|
||||
#
|
||||
# [define]s SQLITE_DLL_INSTALL_RULES to a symbolic name suffix for a
|
||||
# set of "make install" rules to use for installation of the DLL
|
||||
# deliverable. The makefile is tasked with with providing rules named
|
||||
# install-dll-NAME which runs the installation for that set, as well
|
||||
# as providing a rule named install-dll which resolves to
|
||||
# install-dll-NAME (perhaps indirectly, depending on whether the DLL
|
||||
# is (de)activated).
|
||||
#
|
||||
# The default value is "unix-generic".
|
||||
#
|
||||
# 2) --out-implib:
|
||||
#
|
||||
# On platforms where an "import library" is conventionally used but
|
||||
# --out-implib was not explicitly used, automatically add that flag.
|
||||
# This conventionally applies to the "Unix on Windows" environments
|
||||
# like msys and cygwin.
|
||||
#
|
||||
# 3) --dll-basename:
|
||||
#
|
||||
# On the same platforms addressed by --out-implib, if --dll-basename
|
||||
# is not specified, --dll-basename=auto is implied.
|
||||
proc sqlite-handle-env-quirks {} {
|
||||
set instName unix-generic; # name of installation rules set
|
||||
set autoDll 0; # true if --out-implib/--dll-basename should be implied
|
||||
set host [get-define host]
|
||||
switch -glob -- $host {
|
||||
*apple* -
|
||||
*darwin* { set instName darwin }
|
||||
default {
|
||||
set x [sqlite-env-is-unix-on-windows $host]
|
||||
if {"" ne $x} {
|
||||
set instName $x
|
||||
set autoDll 1
|
||||
}
|
||||
}
|
||||
}
|
||||
define SQLITE_DLL_INSTALL_RULES $instName
|
||||
if {$autoDll} {
|
||||
if {![proj-opt-was-provided out-implib]} {
|
||||
# Imply --out-implib=auto
|
||||
proj-indented-notice [subst -nocommands -nobackslashes {
|
||||
NOTICE: auto-enabling --out-implib for environment [$host].
|
||||
Use --out-implib=none to disable this special case
|
||||
or --out-implib=auto to squelch this notice.
|
||||
}]
|
||||
proj-opt-set out-implib auto
|
||||
}
|
||||
if {![proj-opt-was-provided dll-basename]} {
|
||||
# Imply --dll-basename=auto
|
||||
proj-indented-notice [subst -nocommands -nobackslashes {
|
||||
NOTICE: auto-enabling --dll-basename for environment [$host].
|
||||
Use --dll-basename=default to disable this special case
|
||||
or --dll-basename=auto to squelch this notice.
|
||||
}]
|
||||
proj-opt-set dll-basename auto
|
||||
}
|
||||
}
|
||||
sqlite-handle-dll-basename
|
||||
sqlite-handle-out-implib
|
||||
sqlite-handle-mac-cversion
|
||||
sqlite-handle-mac-install-name
|
||||
# Performs late-stage config steps common to both the canonical and
|
||||
# autoconf bundle builds.
|
||||
proc sqlite-common-late-stage-config {} {
|
||||
sqlite-check-mac-cversion
|
||||
sqlite-check-out-implib
|
||||
sqlite-process-dot-in-files
|
||||
sqlite-post-config-validation
|
||||
}
|
||||
|
||||
########################################################################
|
||||
@@ -1840,9 +1235,9 @@ proc sqlite-check-tcl {} {
|
||||
proj-fatal "No tclConfig.sh found under ${with_tcl}"
|
||||
}
|
||||
} else {
|
||||
# If we have not yet found a tclConfig.sh file, look in $libdir
|
||||
# which is set automatically by autosetup or via the --prefix
|
||||
# command-line option. See
|
||||
# If we have not yet found a tclConfig.sh file, look in
|
||||
# $libdir which is set automatically by autosetup or by the
|
||||
# --prefix command-line option. See
|
||||
# https://sqlite.org/forum/forumpost/e04e693439a22457
|
||||
set libdir [get-define libdir]
|
||||
if {[file readable "${libdir}/tclConfig.sh"]} {
|
||||
@@ -2028,7 +1423,7 @@ proc sqlite-determine-codegen-tcl {} {
|
||||
}
|
||||
define BTCLSH "\$(TCLSH_CMD)"
|
||||
}
|
||||
}; # /define-push $flagsToRestore
|
||||
}; # CC swap-out
|
||||
return $cgtcl
|
||||
}; # sqlite-determine-codegen-tcl
|
||||
|
||||
@@ -2039,26 +1434,6 @@ proc sqlite-handle-tcl {} {
|
||||
msg-result "TCL for code generation: [sqlite-determine-codegen-tcl]"
|
||||
}
|
||||
|
||||
########################################################################
|
||||
# Handle the --enable/disable-rpath flag.
|
||||
proc sqlite-handle-rpath {} {
|
||||
proj-check-rpath
|
||||
# autosetup/cc-shared.tcl sets the rpath flag definition in
|
||||
# [get-define SH_LINKRPATH], but it does so on a per-platform basis
|
||||
# rather than as a compiler check. Though we should do a proper
|
||||
# compiler check (as proj-check-rpath does), we may want to consider
|
||||
# adopting its approach of clearing the rpath flags for environments
|
||||
# for which sqlite-env-is-unix-on-windows returns a non-empty
|
||||
# string.
|
||||
|
||||
# if {[proj-opt-truthy rpath]} {
|
||||
# proj-check-rpath
|
||||
# } else {
|
||||
# msg-result "Disabling use of rpath."
|
||||
# define LDFLAGS_RPATH ""
|
||||
# }
|
||||
}
|
||||
|
||||
########################################################################
|
||||
# If the --dump-defines configure flag is provided then emit a list of
|
||||
# all [define] values to config.defines.txt, else do nothing.
|
||||
@@ -2084,10 +1459,10 @@ proc sqlite-dump-defines {} {
|
||||
-array {*.list}
|
||||
-auto {OPT_* PACKAGE_* HAVE_*}
|
||||
}
|
||||
# if {$::sqliteConfig(dump-defines-json-include-lowercase)} {
|
||||
# lappend dumpDefsOpt -none {lib_*} ; # remnants from proj-check-function-in-lib and friends
|
||||
# lappend dumpDefsOpt -auto {[a-z]*}
|
||||
# }
|
||||
if {[opt-bool defines-json-include-lowercase]} {
|
||||
lappend dumpDefsOpt -none {lib_*} ; # remnants from proj-check-function-in-lib and friends
|
||||
lappend dumpDefsOpt -auto {[a-z]*}
|
||||
}
|
||||
lappend dumpDefsOpt -none *
|
||||
proj-dump-defs-json $::sqliteConfig(dump-defines-json) {*}$dumpDefsOpt
|
||||
undefine OPT_FEATURE_FLAGS.list
|
||||
|
||||
+22
-49
@@ -60,7 +60,8 @@
|
||||
** step HIDDEN
|
||||
** );
|
||||
**
|
||||
** The virtual table also has a rowid which is an alias for the value.
|
||||
** The virtual table also has a rowid, logically equivalent to n+1 where
|
||||
** "n" is the ascending integer in the aforesaid production definition.
|
||||
**
|
||||
** Function arguments in queries against this virtual table are translated
|
||||
** into equality constraints against successive hidden columns. In other
|
||||
@@ -115,7 +116,6 @@ SQLITE_EXTENSION_INIT1
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
#include <math.h>
|
||||
|
||||
#ifndef SQLITE_OMIT_VIRTUALTABLE
|
||||
/*
|
||||
@@ -276,7 +276,6 @@ static int seriesConnect(
|
||||
int rc;
|
||||
|
||||
/* Column numbers */
|
||||
#define SERIES_COLUMN_ROWID (-1)
|
||||
#define SERIES_COLUMN_VALUE 0
|
||||
#define SERIES_COLUMN_START 1
|
||||
#define SERIES_COLUMN_STOP 2
|
||||
@@ -364,11 +363,13 @@ static int seriesColumn(
|
||||
#endif
|
||||
|
||||
/*
|
||||
** The rowid is the same as the value.
|
||||
** Return the rowid for the current row, logically equivalent to n+1 where
|
||||
** "n" is the ascending integer in the aforesaid production definition.
|
||||
*/
|
||||
static int seriesRowid(sqlite3_vtab_cursor *cur, sqlite_int64 *pRowid){
|
||||
series_cursor *pCur = (series_cursor*)cur;
|
||||
*pRowid = pCur->ss.iValueNow;
|
||||
sqlite3_uint64 n = pCur->ss.uSeqIndexNow;
|
||||
*pRowid = (sqlite3_int64)((n<LARGEST_UINT64)? n+1 : 0);
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
@@ -481,52 +482,25 @@ static int seriesFilter(
|
||||
** constraints on the "value" column.
|
||||
*/
|
||||
if( idxNum & 0x0080 ){
|
||||
if( sqlite3_value_numeric_type(argv[i])==SQLITE_FLOAT ){
|
||||
double r = sqlite3_value_double(argv[i++]);
|
||||
if( r==ceil(r) ){
|
||||
iMin = iMax = (sqlite3_int64)r;
|
||||
}else{
|
||||
returnNoRows = 1;
|
||||
}
|
||||
}else{
|
||||
iMin = iMax = sqlite3_value_int64(argv[i++]);
|
||||
}
|
||||
iMin = iMax = sqlite3_value_int64(argv[i++]);
|
||||
}else{
|
||||
if( idxNum & 0x0300 ){
|
||||
if( sqlite3_value_numeric_type(argv[i])==SQLITE_FLOAT ){
|
||||
double r = sqlite3_value_double(argv[i++]);
|
||||
if( idxNum & 0x0200 && r==ceil(r) ){
|
||||
iMin = (sqlite3_int64)ceil(r+1.0);
|
||||
iMin = sqlite3_value_int64(argv[i++]);
|
||||
if( idxNum & 0x0200 ){
|
||||
if( iMin==LARGEST_INT64 ){
|
||||
returnNoRows = 1;
|
||||
}else{
|
||||
iMin = (sqlite3_int64)ceil(r);
|
||||
}
|
||||
}else{
|
||||
iMin = sqlite3_value_int64(argv[i++]);
|
||||
if( idxNum & 0x0200 ){
|
||||
if( iMin==LARGEST_INT64 ){
|
||||
returnNoRows = 1;
|
||||
}else{
|
||||
iMin++;
|
||||
}
|
||||
iMin++;
|
||||
}
|
||||
}
|
||||
}
|
||||
if( idxNum & 0x3000 ){
|
||||
if( sqlite3_value_numeric_type(argv[i])==SQLITE_FLOAT ){
|
||||
double r = sqlite3_value_double(argv[i++]);
|
||||
if( (idxNum & 0x2000)!=0 && r==floor(r) ){
|
||||
iMax = (sqlite3_int64)(r-1.0);
|
||||
iMax = sqlite3_value_int64(argv[i++]);
|
||||
if( idxNum & 0x2000 ){
|
||||
if( iMax==SMALLEST_INT64 ){
|
||||
returnNoRows = 1;
|
||||
}else{
|
||||
iMax = (sqlite3_int64)floor(r);
|
||||
}
|
||||
}else{
|
||||
iMax = sqlite3_value_int64(argv[i++]);
|
||||
if( idxNum & 0x2000 ){
|
||||
if( iMax==SMALLEST_INT64 ){
|
||||
returnNoRows = 1;
|
||||
}else{
|
||||
iMax--;
|
||||
}
|
||||
iMax--;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -545,7 +519,8 @@ static int seriesFilter(
|
||||
pCur->ss.iBase += ((d+szStep-1)/szStep)*szStep;
|
||||
}
|
||||
if( pCur->ss.iTerm>iMax ){
|
||||
pCur->ss.iTerm = iMax;
|
||||
sqlite3_uint64 d = pCur->ss.iTerm - iMax;
|
||||
pCur->ss.iTerm -= ((d+szStep-1)/szStep)*szStep;
|
||||
}
|
||||
}else{
|
||||
sqlite3_int64 szStep = -pCur->ss.iStep;
|
||||
@@ -555,7 +530,8 @@ static int seriesFilter(
|
||||
pCur->ss.iBase -= ((d+szStep-1)/szStep)*szStep;
|
||||
}
|
||||
if( pCur->ss.iTerm<iMin ){
|
||||
pCur->ss.iTerm = iMin;
|
||||
sqlite3_uint64 d = iMin - pCur->ss.iTerm;
|
||||
pCur->ss.iTerm += ((d+szStep-1)/szStep)*szStep;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -683,10 +659,7 @@ static int seriesBestIndex(
|
||||
continue;
|
||||
}
|
||||
if( pConstraint->iColumn<SERIES_COLUMN_START ){
|
||||
if( (pConstraint->iColumn==SERIES_COLUMN_VALUE ||
|
||||
pConstraint->iColumn==SERIES_COLUMN_ROWID)
|
||||
&& pConstraint->usable
|
||||
){
|
||||
if( pConstraint->iColumn==SERIES_COLUMN_VALUE && pConstraint->usable ){
|
||||
switch( op ){
|
||||
case SQLITE_INDEX_CONSTRAINT_EQ:
|
||||
case SQLITE_INDEX_CONSTRAINT_IS: {
|
||||
|
||||
@@ -619,6 +619,12 @@ emcc.exportedRuntimeMethods := \
|
||||
emcc.jsflags += $(emcc.exportedRuntimeMethods)
|
||||
emcc.jsflags += -sUSE_CLOSURE_COMPILER=0
|
||||
emcc.jsflags += -sIMPORTED_MEMORY
|
||||
ifeq (,$(filter -O0,$(emcc_opt)))
|
||||
emcc.assert ?= 0
|
||||
else
|
||||
emcc.assert ?= 2
|
||||
endif
|
||||
emcc.jsflags += -sASSERTIONS=$(emcc.assert)
|
||||
emcc.jsflags += -sSTRICT_JS=0
|
||||
# STRICT_JS disabled due to:
|
||||
# https://github.com/emscripten-core/emscripten/issues/18610
|
||||
|
||||
@@ -8,16 +8,16 @@
|
||||
point the sqlite3 JS API bits will get set up.
|
||||
*/
|
||||
Module.runSQLite3PostLoadInit = function(EmscriptenModule/*the Emscripten-style module object*/){
|
||||
/** ^^^ As don't use Module.postRun, as that runs a different time
|
||||
/** ^^^ Don't use Module.postRun, as that runs a different time
|
||||
depending on whether this file is built with emcc 3.1.x or
|
||||
4.0.x. This function name is intentionally obnoxiously verbose to
|
||||
ensure that we don't collide with current and future Emscripten
|
||||
symbol names. */
|
||||
'use strict';
|
||||
//console.warn("This is the start of the Module.postRun handler.");
|
||||
//console.warn("This is the start of Module.runSQLite3PostLoadInit()");
|
||||
/* This function will contain at least the following:
|
||||
|
||||
- post-js-header.js (this file)
|
||||
- post-js-header.js => this file
|
||||
- sqlite3-api-prologue.js => Bootstrapping bits to attach the rest to
|
||||
- common/whwasmutil.js => Replacements for much of Emscripten's glue
|
||||
- jaccwabyt/jaccwabyt.js => Jaccwabyt (C/JS struct binding)
|
||||
@@ -26,8 +26,8 @@ Module.runSQLite3PostLoadInit = function(EmscriptenModule/*the Emscripten-style
|
||||
- sqlite3-api-worker1.js => Worker-based API
|
||||
- sqlite3-vfs-helper.c-pp.js => Utilities for VFS impls
|
||||
- sqlite3-vtab-helper.c-pp.js => Utilities for virtual table impls
|
||||
- sqlite3-vfs-opfs.c-pp.js => OPFS VFS
|
||||
- sqlite3-vfs-opfs.c-pp.js => OPFS VFS
|
||||
- sqlite3-vfs-opfs-sahpool.c-pp.js => OPFS SAHPool VFS
|
||||
- sqlite3-api-cleanup.js => final API cleanup
|
||||
- post-js-footer.js => closes this postRun() function
|
||||
- post-js-footer.js => closes this function
|
||||
*/
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
|
||||
This file is intended to be combined at build-time with other
|
||||
related code, most notably a header and footer which wraps this
|
||||
whole file into an Emscripten Module.postRun()-style handler. The
|
||||
sqlite3 JS API has no hard requirements on Emscripten and does not
|
||||
expose any Emscripten APIs to clients. It is structured such that
|
||||
its build can be tweaked to include it in arbitrary WASM
|
||||
environments which can supply the necessary underlying features
|
||||
(e.g. a POSIX file I/O layer).
|
||||
whole file into a single callback which can be run after Emscripten
|
||||
loads the corresponding WASM module. The sqlite3 JS API has no hard
|
||||
requirements on Emscripten and does not expose any Emscripten APIs
|
||||
to clients. It is structured such that its build can be tweaked to
|
||||
include it in arbitrary WASM environments which can supply the
|
||||
necessary underlying features (e.g. a POSIX file I/O layer).
|
||||
|
||||
Main project home page: https://sqlite.org
|
||||
|
||||
|
||||
@@ -279,11 +279,11 @@
|
||||
The arguments are in the same form accepted by oo1.DB.exec(), with
|
||||
the exceptions noted below.
|
||||
|
||||
If the `countChanges` arguments property (added in version 3.43) is
|
||||
truthy then the `result` property contained by the returned object
|
||||
will have a `changeCount` property which holds the number of changes
|
||||
made by the provided SQL. Because the SQL may contain an arbitrary
|
||||
number of statements, the `changeCount` is calculated by calling
|
||||
If `args.countChanges` (added in version 3.43) is truthy then the
|
||||
`result` property contained by the returned object will have a
|
||||
`changeCount` property which holds the number of changes made by the
|
||||
provided SQL. Because the SQL may contain an arbitrary number of
|
||||
statements, the `changeCount` is calculated by calling
|
||||
`sqlite3_total_changes()` before and after the SQL is evaluated. If
|
||||
the value of `countChanges` is 64 then the `changeCount` property
|
||||
will be returned as a 64-bit integer in the form of a BigInt (noting
|
||||
@@ -292,6 +292,15 @@
|
||||
calling `sqlite3_total_changes64()` before and after the SQL is
|
||||
evaluated.
|
||||
|
||||
If the `args.lastInsertRowId` (added in version 3.50.0) is truthy
|
||||
then the `result` property contained by the returned object will
|
||||
have a `lastInsertRowId` will hold a BigInt-type value corresponding
|
||||
to the result of sqlite3_last_insert_rowid(). This value is only
|
||||
fetched once, after the SQL is run, regardless of how many
|
||||
statements the SQL contains. This API has no idea whether the SQL
|
||||
contains any INSERTs, so it is up to the client to apply/rely on
|
||||
this property only when it makes sense to do so.
|
||||
|
||||
A function-type args.callback property cannot cross
|
||||
the window/Worker boundary, so is not useful here. If
|
||||
args.callback is a string then it is assumed to be a
|
||||
@@ -542,6 +551,12 @@ sqlite3.initWorker1API = function(){
|
||||
if(undefined !== changeCount){
|
||||
rc.changeCount = db.changes(true,64===rc.countChanges) - changeCount;
|
||||
}
|
||||
const lastInsertRowId = !!rc.lastInsertRowId
|
||||
? sqlite3.capi.sqlite3_last_insert_rowid(db)
|
||||
: undefined;
|
||||
if( undefined!==lastInsertRowId ){
|
||||
rc.lastInsertRowId = lastInsertRowId;
|
||||
}
|
||||
if(rc.callback instanceof Function){
|
||||
rc.callback = theCallback;
|
||||
/* Post a sentinel message to tell the client that the end
|
||||
|
||||
@@ -115,6 +115,7 @@ delete globalThis.sqlite3Worker1Promiser;
|
||||
"insert into t(a,b) values(1,2),(3,4),(5,6)"
|
||||
].join(';'),
|
||||
resultRows: [], columnNames: [],
|
||||
lastInsertRowId: true,
|
||||
countChanges: sqConfig.bigIntEnabled ? 64 : true
|
||||
}, function(ev){
|
||||
ev = ev.result;
|
||||
@@ -122,7 +123,9 @@ delete globalThis.sqlite3Worker1Promiser;
|
||||
.assert(0===ev.columnNames.length)
|
||||
.assert(sqConfig.bigIntEnabled
|
||||
? (3n===ev.changeCount)
|
||||
: (3===ev.changeCount));
|
||||
: (3===ev.changeCount))
|
||||
.assert('bigint'===typeof ev.lastInsertRowId)
|
||||
.assert(ev.lastInsertRowId>=3);
|
||||
});
|
||||
|
||||
await wtest('exec',{
|
||||
|
||||
@@ -156,11 +156,14 @@
|
||||
sql: ["create table t(a,b);",
|
||||
"insert into t(a,b) values(1,2),(3,4),(5,6)"
|
||||
],
|
||||
lastInsertRowId: true,
|
||||
resultRows: [], columnNames: []
|
||||
}, function(ev){
|
||||
ev = ev.result;
|
||||
T.assert(0===ev.resultRows.length)
|
||||
.assert(0===ev.columnNames.length);
|
||||
.assert(0===ev.columnNames.length)
|
||||
.assert('bigint'===typeof ev.lastInsertRowId)
|
||||
.assert(ev.lastInsertRowId>=3);
|
||||
});
|
||||
runOneTest('exec',{
|
||||
sql: 'select a a, b b from t order by a',
|
||||
|
||||
@@ -163,7 +163,6 @@ LDFLAGS.rpath ?= -Wl,-rpath -Wl,$(prefix)/lib
|
||||
LDFLAGS.pthread ?= -lpthread
|
||||
LDFLAGS.dlopen ?= -ldl
|
||||
LDFLAGS.shlib ?= -shared
|
||||
LDFLAGS.rt ?= # nanosleep on some platforms
|
||||
LDFLAGS.icu ?= # -licui18n -licuuc -licudata
|
||||
CFLAGS.icu ?=
|
||||
LDFLAGS.libsqlite3.soname ?= # see https://sqlite.org/src/forumpost/5a3b44f510df8ded
|
||||
@@ -189,19 +188,19 @@ CFLAGS.readline ?= -I$(prefix)/include
|
||||
#
|
||||
INSTALL ?= install
|
||||
#
|
||||
# $(ENABLE_LIB_SHARED) =
|
||||
# $(ENABLE_SHARED) =
|
||||
#
|
||||
# 1 if libsqlite3$(T.dll) should be built.
|
||||
# 1 if libsqlite3.$(T.dll) should be built.
|
||||
#
|
||||
ENABLE_LIB_SHARED ?= 1
|
||||
ENABLE_SHARED ?= 1
|
||||
#
|
||||
# $(ENABLE_LIB_STATIC) =
|
||||
# $(ENABLE_STATIC) =
|
||||
#
|
||||
# 1 if libsqlite3$(T.lib) should be built. Some components,
|
||||
# 1 if libsqlite3.$(T.lib) should be built. Some components,
|
||||
# e.g. libtclsqlite3 and some test apps, implicitly require the static
|
||||
# library and will ignore this preference.
|
||||
#
|
||||
ENABLE_LIB_STATIC ?= 1
|
||||
ENABLE_STATIC ?= 1
|
||||
#
|
||||
# $(USE_AMALGAMATION)
|
||||
#
|
||||
@@ -220,7 +219,7 @@ USE_AMALGAMATION ?= 1
|
||||
# may require that the user specifically prepend "." to their
|
||||
# $LD_LIBRARY_PATH so that the dynamic linker does not pick up a
|
||||
# libsqlite3.so from outside the source tree. Alternately, symlinking
|
||||
# the in-build-tree $(libsqlite3.DLL) to some dir in the system's
|
||||
# the in-build-tree $(libsqlite3.SO) to some dir in the system's
|
||||
# library path will work for giving the apps access to the in-tree
|
||||
# DLL.
|
||||
#
|
||||
@@ -414,7 +413,7 @@ LDFLAGS.libsqlite3 = \
|
||||
$(LDFLAGS.rpath) $(LDFLAGS.pthread) \
|
||||
$(LDFLAGS.math) $(LDFLAGS.dlopen) \
|
||||
$(LDFLAGS.zlib) $(LDFLAGS.icu) \
|
||||
$(LDFLAGS.rt) $(LDFLAGS.configure)
|
||||
$(LDFLAGS.configure)
|
||||
|
||||
#
|
||||
# $(install-dir.XYZ) = dirs for installation.
|
||||
@@ -436,7 +435,7 @@ install-dir.all = $(install-dir.bin) $(install-dir.include) \
|
||||
$(install-dir.lib) $(install-dir.man1) \
|
||||
$(install-dir.pkgconfig)
|
||||
$(install-dir.all):
|
||||
@if [ ! -d "$@" ]; then set -x; $(INSTALL) -d "$@"; fi
|
||||
if [ ! -d "$@" ]; then $(INSTALL) -d "$@"; fi
|
||||
# ^^^^ on some platforms, install -d fails if the target already exists.
|
||||
|
||||
#
|
||||
@@ -1052,35 +1051,8 @@ T.link.tcl = $(T.tcl.env.source); $(T.link)
|
||||
cp fts5.c fts5.h tsrc
|
||||
touch .target_source
|
||||
|
||||
#
|
||||
# libsqlite3.DLL.basename = the base name of the resulting DLL. This
|
||||
# is typically libsqlite3 but varies wildly on Unix-like Windows
|
||||
# environments (msys, cygwin, and friends). Conversely, the base name
|
||||
# of the static library ($(libsqlite3.LIB)) is constant on all tested
|
||||
# platforms.
|
||||
#
|
||||
libsqlite3.DLL.basename ?= libsqlite3
|
||||
#
|
||||
# libsqlite3.DLL => the DLL library
|
||||
#
|
||||
libsqlite3.DLL = $(libsqlite3.DLL.basename)$(T.dll)
|
||||
#
|
||||
# libsqlite3.out.implib => "import library" file generated by the
|
||||
# --out-implib linker flag. Not commonly used on Unix systems but is
|
||||
# on the Windows-side Unix-esque environments and typically as a value
|
||||
# of "libsqlite3.dll.a". It is expected to match the filename, if any,
|
||||
# provided by the -Wl,--out-implib,FILENAME flag.
|
||||
#
|
||||
libsqlite3.out.implib ?=
|
||||
#
|
||||
# libsqlite3.LIB => the static library
|
||||
#
|
||||
libsqlite3.LIB = libsqlite3$(T.lib)
|
||||
|
||||
#
|
||||
# libsqlite3.DLL.install-rules => the suffix of the symoblic name of
|
||||
# the makefile rules for installing the DLL.
|
||||
libsqlite3.DLL.install-rules ?= unix-generic
|
||||
libsqlite3.SO = libsqlite3$(T.dll)
|
||||
|
||||
# Rules to build the LEMON compiler generator
|
||||
#
|
||||
@@ -1384,9 +1356,9 @@ tclsqlite-shell.o: $(T.tcl.env.sh) $(TOP)/src/tclsqlite.c $(DEPS_OBJ_COMMON)
|
||||
tclsqlite-stubs.o: $(T.tcl.env.sh) $(TOP)/src/tclsqlite.c $(DEPS_OBJ_COMMON)
|
||||
$(T.compile.tcl) -DUSE_TCL_STUBS=1 -o $@ -c $(TOP)/src/tclsqlite.c $$TCL_INCLUDE_SPEC
|
||||
|
||||
tclsqlite3$(T.exe): $(T.tcl.env.sh) tclsqlite-shell.o $(libsqlite3.DLL)
|
||||
tclsqlite3$(T.exe): $(T.tcl.env.sh) tclsqlite-shell.o $(libsqlite3.SO)
|
||||
$(T.link.tcl) -o $@ tclsqlite-shell.o \
|
||||
$(libsqlite3.DLL) $$TCL_INCLUDE_SPEC $$TCL_LIB_SPEC \
|
||||
$(libsqlite3.SO) $$TCL_INCLUDE_SPEC $$TCL_LIB_SPEC \
|
||||
$(LDFLAGS.libsqlite3)
|
||||
tclsqlite3$(T.exe)-1: tclsqlite3$(T.exe)
|
||||
tclsqlite3$(T.exe)-0 tclsqlite3$(T.exe)-:
|
||||
@@ -1433,33 +1405,34 @@ $(libsqlite3.LIB): $(LIBOBJ)
|
||||
$(AR) $(AR.flags) $@ $(LIBOBJ)
|
||||
$(libsqlite3.LIB)-1: $(libsqlite3.LIB)
|
||||
$(libsqlite3.LIB)-0 $(libsqlite3.LIB)-:
|
||||
lib: $(libsqlite3.LIB)-$(ENABLE_LIB_STATIC)
|
||||
lib: $(libsqlite3.LIB)-$(ENABLE_STATIC)
|
||||
all: lib
|
||||
|
||||
#
|
||||
# Dynamic libsqlite3
|
||||
#
|
||||
$(libsqlite3.DLL): $(LIBOBJ)
|
||||
$(libsqlite3.SO): $(LIBOBJ)
|
||||
$(T.link.shared) -o $@ $(LIBOBJ) $(LDFLAGS.libsqlite3) \
|
||||
$(LDFLAGS.libsqlite3.os-specific) $(LDFLAGS.libsqlite3.soname)
|
||||
$(libsqlite3.DLL)-1: $(libsqlite3.DLL)
|
||||
$(libsqlite3.DLL)-0 $(libsqlite3.DLL)-:
|
||||
so: $(libsqlite3.DLL)-$(ENABLE_LIB_SHARED)
|
||||
$(libsqlite3.SO)-1: $(libsqlite3.SO)
|
||||
$(libsqlite3.SO)-0 $(libsqlite3.SO)-:
|
||||
so: $(libsqlite3.SO)-$(ENABLE_SHARED)
|
||||
all: so
|
||||
|
||||
#
|
||||
# DLL installation...
|
||||
#
|
||||
# On most Unix-like platforms, install the $(libsqlite3.DLL) as
|
||||
# $(libsqlite3.DLL).$(PACKAGE_VERSION) and create symlinks which point
|
||||
# to it:
|
||||
# Install the $(libsqlite3.SO) as $(libsqlite3.SO).$(PACKAGE_VERSION)
|
||||
# and create symlinks which point to it:
|
||||
#
|
||||
# - libsqlite3.so.$(PACKAGE_VERSION)
|
||||
# - libsqlite3.so.0 =symlink-> libsqlite3.so.$(PACKAGE_VERSION) (see below)
|
||||
# - libsqlite3.so =symlink-> libsqlite3.so.3
|
||||
#
|
||||
# Different rules apply for platforms where $(T.dll)==.dylib and for
|
||||
# the "Unix on Windows" environments.
|
||||
# N.B. we initially had a link named libsqlite3.so.3 but it's
|
||||
# unnecessary unless we want to set SONAME to libsqlite3.so.3, which
|
||||
# is also unnecessary.
|
||||
#
|
||||
# N.B. different transformations are applied on systems where $(T.dll)
|
||||
# is ".dylib" and none of the following docs apply on such systems.
|
||||
#
|
||||
# The link named libsqlite3.so.0 is provided in an attempt to reduce
|
||||
# downstream disruption when performing upgrades from pre-3.48 to a
|
||||
@@ -1481,7 +1454,7 @@ all: so
|
||||
# 1) If libsqlite3.so.0.8.6 is found in the target installation
|
||||
# directory then it is re-linked to point to the newer-style
|
||||
# names. We cannot retain both the old and new installation because
|
||||
# they both share the high-level name $(libsqlite3.DLL). The
|
||||
# they both share the high-level name $(libsqlite3.SO). The
|
||||
# down-side of this is that it may upset packaging tools when we
|
||||
# replace libsqlite3.so (from a legacy package) with a new symlink.
|
||||
#
|
||||
@@ -1495,54 +1468,38 @@ all: so
|
||||
# In either case, libsqlite3.la, if found, is deleted because it would
|
||||
# contain stale state, refering to non-libtool-generated libraries.
|
||||
#
|
||||
|
||||
install-dll-out-implib: $(install-dir.lib) $(libsqlite3.DLL)
|
||||
if [ x != "x$(libsqlite3.out.implib)" ] && [ -f "$(libsqlite3.out.implib)" ]; then \
|
||||
$(INSTALL) $(libsqlite3.out.implib) "$(install-dir.lib)"; \
|
||||
fi
|
||||
|
||||
install-dll-unix-generic: install-dll-out-implib
|
||||
$(INSTALL) $(libsqlite3.DLL) "$(install-dir.lib)"
|
||||
@echo "Setting up $(libsqlite3.DLL) version symlinks..."; \
|
||||
install-so-1: $(install-dir.lib) $(libsqlite3.SO)
|
||||
$(INSTALL) $(libsqlite3.SO) "$(install-dir.lib)"
|
||||
@echo "Setting up $(libsqlite3.SO) version symlinks..."; \
|
||||
cd "$(install-dir.lib)" || exit $$?; \
|
||||
rm -f $(libsqlite3.DLL).0 $(libsqlite3.DLL).$(PACKAGE_VERSION) || exit $$?; \
|
||||
mv $(libsqlite3.DLL) $(libsqlite3.DLL).$(PACKAGE_VERSION) || exit $$?; \
|
||||
ln -s $(libsqlite3.DLL).$(PACKAGE_VERSION) $(libsqlite3.DLL) || exit $$?; \
|
||||
ln -s $(libsqlite3.DLL).$(PACKAGE_VERSION) $(libsqlite3.DLL).0 || exit $$?; \
|
||||
ls -la $(libsqlite3.DLL) $(libsqlite3.DLL).[a03]*; \
|
||||
if [ -e $(libsqlite3.DLL).0.8.6 ]; then \
|
||||
echo "ACHTUNG: legacy libtool-compatible install found. Re-linking it..."; \
|
||||
rm -f libsqlite3.la $(libsqlite3.DLL).0.8.6 || exit $$?; \
|
||||
ln -s $(libsqlite3.DLL).$(PACKAGE_VERSION) $(libsqlite3.DLL).0.8.6 || exit $$?; \
|
||||
ls -la $(libsqlite3.DLL).0.8.6; \
|
||||
elif [ x1 = "x$(INSTALL_SO_086_LINK)" ]; then \
|
||||
echo "ACHTUNG: installing legacy libtool-style links because INSTALL_SO_086_LINK=1"; \
|
||||
rm -f libsqlite3.la $(libsqlite3.DLL).0.8.6 || exit $$?; \
|
||||
ln -s $(libsqlite3.DLL).$(PACKAGE_VERSION) $(libsqlite3.DLL).0.8.6 || exit $$?; \
|
||||
ls -la $(libsqlite3.DLL).0.8.6; \
|
||||
if [ x.dylib = x$(T.dll) ]; then \
|
||||
rm -f libsqlite3.0$(T.dll) libsqlite3.$(PACKAGE_VERSION)$(T.dll) || exit $$?; \
|
||||
dllname=libsqlite3.$(PACKAGE_VERSION)$(T.dll); \
|
||||
mv $(libsqlite3.SO) $$dllname || exit $$?; \
|
||||
ln -s $$dllname $(libsqlite3.SO) || exit $$?; \
|
||||
ln -s $$dllname libsqlite3.0$(T.dll) || exit $$?; \
|
||||
ls -la $$dllname $(libsqlite3.SO) libsqlite3.0$(T.dll); \
|
||||
else \
|
||||
rm -f $(libsqlite3.SO).0 $(libsqlite3.SO).$(PACKAGE_VERSION) || exit $$?; \
|
||||
mv $(libsqlite3.SO) $(libsqlite3.SO).$(PACKAGE_VERSION) || exit $$?; \
|
||||
ln -s $(libsqlite3.SO).$(PACKAGE_VERSION) $(libsqlite3.SO) || exit $$?; \
|
||||
ln -s $(libsqlite3.SO).$(PACKAGE_VERSION) $(libsqlite3.SO).0 || exit $$?; \
|
||||
ls -la $(libsqlite3.SO) $(libsqlite3.SO).[03]*; \
|
||||
if [ -e $(libsqlite3.SO).0.8.6 ]; then \
|
||||
echo "ACHTUNG: legacy libtool-compatible install found. Re-linking it..."; \
|
||||
rm -f libsqlite3.la $(libsqlite3.SO).0.8.6 || exit $$?; \
|
||||
ln -s $(libsqlite3.SO).$(PACKAGE_VERSION) $(libsqlite3.SO).0.8.6 || exit $$?; \
|
||||
ls -la $(libsqlite3.SO).0.8.6; \
|
||||
elif [ x1 = "x$(INSTALL_SO_086_LINK)" ]; then \
|
||||
echo "ACHTUNG: installing legacy libtool-style links because INSTALL_SO_086_LINK=1"; \
|
||||
rm -f libsqlite3.la $(libsqlite3.SO).0.8.6 || exit $$?; \
|
||||
ln -s $(libsqlite3.SO).$(PACKAGE_VERSION) $(libsqlite3.SO).0.8.6 || exit $$?; \
|
||||
ls -la $(libsqlite3.SO).0.8.6; \
|
||||
fi; \
|
||||
fi
|
||||
|
||||
install-dll-msys: install-dll-out-implib $(install-dir.bin)
|
||||
$(INSTALL) $(libsqlite3.DLL) "$(install-dir.bin)"
|
||||
# ----------------------------------------------^^^ yes, bin
|
||||
install-dll-mingw: install-dll-msys
|
||||
install-dll-cygwin: install-dll-msys
|
||||
|
||||
install-dll-darwin: $(install-dir.lib) $(libsqlite3.DLL)
|
||||
$(INSTALL) $(libsqlite3.DLL) "$(install-dir.lib)"
|
||||
@echo "Setting up $(libsqlite3.DLL) version symlinks..."; \
|
||||
cd "$(install-dir.lib)" || exit $$?; \
|
||||
rm -f libsqlite3.0$(T.dll) libsqlite3.$(PACKAGE_VERSION)$(T.dll) || exit $$?; \
|
||||
dllname=libsqlite3.$(PACKAGE_VERSION)$(T.dll); \
|
||||
mv $(libsqlite3.DLL) $$dllname || exit $$?; \
|
||||
ln -s $$dllname $(libsqlite3.DLL) || exit $$?; \
|
||||
ln -s $$dllname libsqlite3.0$(T.dll) || exit $$?; \
|
||||
ls -la $$dllname $(libsqlite3.DLL) libsqlite3.0$(T.dll)
|
||||
|
||||
install-dll-1: install-dll-$(libsqlite3.DLL.install-rules)
|
||||
install-dll-0 install-dll-:
|
||||
install-dll: install-dll-$(ENABLE_LIB_SHARED)
|
||||
install: install-dll
|
||||
install-so-0 install-so-:
|
||||
install-so: install-so-$(ENABLE_SHARED)
|
||||
install: install-so
|
||||
|
||||
#
|
||||
# Install $(libsqlite3.LIB)
|
||||
@@ -1550,7 +1507,7 @@ install: install-dll
|
||||
install-lib-1: $(install-dir.lib) $(libsqlite3.LIB)
|
||||
$(INSTALL.noexec) $(libsqlite3.LIB) "$(install-dir.lib)"
|
||||
install-lib-0 install-lib-:
|
||||
install-lib: install-lib-$(ENABLE_LIB_STATIC)
|
||||
install-lib: install-lib-$(ENABLE_STATIC)
|
||||
install: install-lib
|
||||
|
||||
#
|
||||
@@ -1739,7 +1696,7 @@ fuzztest: fuzzcheck$(T.exe) $(FUZZDATA) sessionfuzz$(T.exe)
|
||||
./fuzzcheck$(T.exe) $(FUZZDATA)
|
||||
./sessionfuzz$(T.exe) run $(TOP)/test/sessionfuzz-data1.db
|
||||
|
||||
valgrindfuzz: fuzzcheck$(T.exe) $(FUZZDATA) sessionfuzz$(T.exe)
|
||||
valgrindfuzz: fuzzcheck$(TEXT) $(FUZZDATA) sessionfuzz$(T.exe)
|
||||
valgrind ./fuzzcheck$(T.exe) --cell-size-check --limit-mem 10M $(FUZZDATA)
|
||||
valgrind ./sessionfuzz$(T.exe) run $(TOP)/test/sessionfuzz-data1.db
|
||||
|
||||
@@ -1835,7 +1792,7 @@ sqlite3_analyzer.c: sqlite3.c $(TOP)/src/tclsqlite.c $(TOP)/tool/spaceanal.tcl \
|
||||
#
|
||||
sqlite3_analyzer.flags.1 = -L. -lsqlite3
|
||||
sqlite3_analyzer.flags.0 = $(LDFLAGS.libsqlite3)
|
||||
sqlite3_analyzer.deps.1 = $(libsqlite3.DLL)
|
||||
sqlite3_analyzer.deps.1 = $(libsqlite3.SO)
|
||||
sqlite3_analyzer.deps.0 =
|
||||
sqlite3_analyzer$(T.exe): $(T.tcl.env.sh) sqlite3_analyzer.c \
|
||||
$(sqlite3_analyzer.deps.$(LINK_TOOLS_DYNAMICALLY))
|
||||
@@ -2082,7 +2039,7 @@ install: install-shell-$(HAVE_WASI_SDK)
|
||||
#
|
||||
sqldiff.0.deps = $(TOP)/tool/sqldiff.c $(TOP)/ext/misc/sqlite3_stdio.h sqlite3.o sqlite3.h
|
||||
sqldiff.0.rules = $(T.link) -o $@ $(TOP)/tool/sqldiff.c sqlite3.o $(LDFLAGS.libsqlite3)
|
||||
sqldiff.1.deps = $(TOP)/tool/sqldiff.c $(TOP)/ext/misc/sqlite3_stdio.h $(libsqlite3.DLL)
|
||||
sqldiff.1.deps = $(TOP)/tool/sqldiff.c $(TOP)/ext/misc/sqlite3_stdio.h $(libsqlite3.SO)
|
||||
sqldiff.1.rules = $(T.link) -o $@ $(TOP)/tool/sqldiff.c -L. -lsqlite3 $(LDFLAGS.configure)
|
||||
sqldiff$(T.exe): $(sqldiff.$(LINK_TOOLS_DYNAMICALLY).deps)
|
||||
$(sqldiff.$(LINK_TOOLS_DYNAMICALLY).rules)
|
||||
@@ -2375,7 +2332,7 @@ tidy: tidy-.
|
||||
rm -f lemon$(B.exe) sqlite*.tar.gz
|
||||
rm -f mkkeywordhash$(B.exe) mksourceid$(B.exe)
|
||||
rm -f parse.* fts5parse.*
|
||||
rm -f $(libsqlite3.DLL) $(libsqlite3.LIB) $(libtclsqlite3.SO) libsqlite3$(T.dll).a
|
||||
rm -f $(libsqlite3.SO) $(libsqlite3.LIB) $(libtclsqlite3.SO) libsqlite3$(T.dll).a
|
||||
rm -f tclsqlite3$(T.exe) $(TESTPROGS)
|
||||
rm -f LogEst$(T.exe) fts3view$(T.exe) rollback-test$(T.exe) showdb$(T.exe)
|
||||
rm -f showjournal$(T.exe) showstat4$(T.exe) showwal$(T.exe) speedtest1$(T.exe)
|
||||
@@ -2409,7 +2366,7 @@ distclean: distclean-. clean
|
||||
|
||||
|
||||
# Show important variable settings.
|
||||
show-variables:
|
||||
show-variables:
|
||||
@echo "CC = $(CC)"
|
||||
@echo "B.cc = $(B.cc)"
|
||||
@echo "T.cc = $(T.cc)"
|
||||
|
||||
@@ -1,30 +1,30 @@
|
||||
C Version\s3.49.2
|
||||
D 2025-05-07T10:39:52.886
|
||||
C Attempt\sto\simprovement\sperformance\sof\smultiple\sOP_Columns\sthat\soccur\sin\sa\srow.\nMinimal\simprovement\sfor\sa\slot\sof\scomplexity\sand\srisk.
|
||||
D 2025-02-11T16:00:52.467
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d
|
||||
F Makefile.in d588d01af5f4f1e37468cd197b5614a64fabbab7be17b75728b75388f7e34f5e
|
||||
F Makefile.in 63c4d6e535dac4b7f6a6ffa566c96e3d68fa7f244799c38ee1e3d59305c5b55b
|
||||
F Makefile.linux-generic bd3e3cacd369821a6241d4ea1967395c962dfe3057e38cb0a435cee0e8b789d0
|
||||
F Makefile.msc a9b95ae9807e17f9b0734ebe97d68032141c3f95286bb64593cb73b206f043cf
|
||||
F Makefile.msc 990e4ea94a417135d1b2fd35550997c3f40fc1758bd7546bd17c0f4312f0babc
|
||||
F README.md c3c0f19532ce28f6297a71870f3c7b424729f0e6d9ab889616d3587dd2332159
|
||||
F VERSION 5008c952d977ab40afea04fd86fa8ed8720ce13a0ea878bf948ab1b26c610d98
|
||||
F VERSION 001dea55eb8304ec9130b6b44a32d3fc349f279d45a7e224fc0730c3cb8e2372
|
||||
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 auto.def a8c935b5c3c0b27c6a8b1b788bb47b06cc0ca3e9e92dc1b87e4b02659ba95ff6
|
||||
F auto.def fdd6965e06bce02a8b9f9ed57a52d05bcbec4b56e4bef2174866bb5713c65fda
|
||||
F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac
|
||||
F autoconf/Makefile.in ec1157e153ecad7c40bb8149250f10ef153dfa4514b93219e1342fe7caa6a533
|
||||
F autoconf/Makefile.in f706b48abb13553ecc5034d5fc296d424fd36d73c222285b7590004dec508925
|
||||
F autoconf/Makefile.msc 0a071367537dc395285a5d624ac4f99f3a387b27cc5e89752423c0499e15aec4
|
||||
F autoconf/README.first f1d3876e9a7852c22f275a6f06814e64934cecbc0b5b9617d64849094c1fd136
|
||||
F autoconf/README.txt 7f01dc3915e2d68f329011073662369e62a0938a2c69398807823c57591cb288
|
||||
F autoconf/auto.def 8d81c1d728d8462a9b6c1ca0714013bbb097aee0ae5e79309d7939cead98e295
|
||||
F autoconf/auto.def 71dde17158afcd6fb097b66853371991bb6ca5517b034e2efa9f0c47a2e730f2
|
||||
F autoconf/tea/Makefile.in ba0556fee8da09c066bad85a4457904e46ee2c2eabaa309c0e83a78f2f151a8e
|
||||
F autoconf/tea/README.txt 61e62e519579e4a112791354d6d440f8b51ea6db3b0bab58d59f29df42d2dfe3
|
||||
F autoconf/tea/aclocal.m4 52c47aac44ce0ddb1f918b6993e8beb8eee88f43
|
||||
F autoconf/tea/configure.ac.in da18360dfdeac7414fa8deb549f3d65aeca0ae1150ff1a8b902019b39ce019a4
|
||||
F autoconf/tea/configure.ac 830cb2af5a3888312d0fd88402c2509d551d60e4c03f0481006a07c78313ef12
|
||||
F autoconf/tea/doc/sqlite3.n e1fe45d4f5286ee3d0ccc877aca2a0def488e9bb
|
||||
F autoconf/tea/license.terms 13bd403c9610fd2b76ece0ab50c4c5eda933d523
|
||||
F autoconf/tea/pkgIndex.tcl.in 55aec3c6d7e9a1de9b8d2fdc9c27fd055da3ac3a51b572195e2ae7300bcfd3a2
|
||||
@@ -38,19 +38,19 @@ F autoconf/tea/win/targets.vc 96a25a1fa6e9e9cfb348fd3760a5395b4ce8acafc8ed10f041
|
||||
F autosetup/LICENSE 41a26aebdd2cd185d1e2b210f71b7ce234496979f6b35aef2cbf6b80cbed4ce4
|
||||
F autosetup/README.autosetup a78ff8c4a3d2636a4268736672a74bf14a82f42687fcf0631a70c516075c031e
|
||||
F autosetup/README.md b306314e8a87ccf873cb5b2a360c4a27bbf841df5b76f3acbd65322cff165476
|
||||
F autosetup/autosetup 74a9782b68d07934510190fbd03fc6ad92e63f0ea3b5cbffa5f0bd271ad60f01 x
|
||||
F autosetup/autosetup df8b53928b1fe3c67db5bc77c8e1eb8160c1b6a26c370e9a06c68748f803b7e4 x
|
||||
F autosetup/autosetup-config.guess dfa101c5e8220e864d5e9c72a85e87110df60260d36cb951ad0a85d6d9eaa463 x
|
||||
F autosetup/autosetup-config.sub a38fb074d0dece01cf919e9fb534a26011608aa8fa606490864295328526cd73 x
|
||||
F autosetup/autosetup-find-tclsh b08f883f5753cfff1ecb8581f98b314e190b7e3f3059798e274ae5f5aad571af x
|
||||
F autosetup/autosetup-find-tclsh 25905f6c302959db80c2951aa267b4411c5645b598ce761cfc24a166141e2c4c x
|
||||
F autosetup/autosetup-test-tclsh 749d20defee533a3842139df47d700fc7a334a5da7bdbd444ae5331744b06c5f
|
||||
F autosetup/cc-db.tcl 6e0ed90146197a5a05b245e649975c07c548e30926b218ca3e1d4dc034b10a7b
|
||||
F autosetup/cc-lib.tcl 493c5935b5dd3bf9bd4eca89b07c8b1b1a9356d61783035144e21795facf7360
|
||||
F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1de1e5460d78
|
||||
F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e45f
|
||||
F autosetup/jimsh0.c a57c16e65dcffc9c76e496757cb3f7fb47e01ecbd1631a0a5e01751fc856f049
|
||||
F autosetup/jimsh0.c 6573f6bc6ff204de0139692648d7037ca0b6c067bac83a7b4e087f20a86866a4
|
||||
F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba
|
||||
F autosetup/proj.tcl 187d82550cfa55df00e285542e88278c51876d7813d63eaffb2fc5af40566d9f
|
||||
F autosetup/sqlite-config.tcl 4b0205282099a1016bc9565b7b893eb9d4f739bd76acfcba74ad157d8e13acd7
|
||||
F autosetup/proj.tcl cef1e0aa0f2dee2042af66f28c97a9445f84d55d858ba9db4f6116846a1a325f
|
||||
F autosetup/sqlite-config.tcl 341c2751f42c6c8eeeae50bec13d2bb28db73ca2c8b9b97598332aed02e0a71b
|
||||
F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9
|
||||
F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x
|
||||
F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad
|
||||
@@ -436,7 +436,7 @@ F ext/misc/regexp.c 388e7f237307c7dfbfb8dde44e097946f6c437801d63f0d7ad63f3320d4e
|
||||
F ext/misc/remember.c add730f0f7e7436cd15ea3fd6a90fd83c3f706ab44169f7f048438b7d6baa69c
|
||||
F ext/misc/rot13.c 51ac5f51e9d5fd811db58a9c23c628ad5f333c173f1fc53c8491a3603d38556c
|
||||
F ext/misc/scrub.c 2a44b0d44c69584c0580ad2553f6290a307a49df4668941d2812135bfb96a946
|
||||
F ext/misc/series.c 2ef2f7452d63a8c59295d8503456576882e4de444c06f17f94c1a6c1ca9be6bb
|
||||
F ext/misc/series.c cbdda2e2eb8159a1331974d246984c6e2693c6ea93930e6165046c8dbb8db0e9
|
||||
F ext/misc/sha1.c cb5002148c2661b5946f34561701e9105e9d339b713ec8ac057fd888b196dcb9
|
||||
F ext/misc/shathree.c f3a778f27bf3e71b666a77f28e463a3b931c4dbe4219447e61bb678b4bc121c3
|
||||
F ext/misc/showauth.c 732578f0fe4ce42d577e1c86dc89dd14a006ab52
|
||||
@@ -619,7 +619,7 @@ F ext/session/sqlite3session.c 52a680dbb03c4734748b215d95987fb4d95ab23baaf053a01
|
||||
F ext/session/sqlite3session.h 683ccbf16e2c2521661fc4c1cf918ce57002039efbcabcd8097fa4bca569104b
|
||||
F ext/session/test_session.c 12e0a2c15fd60f92da4bb29c697c9177ff0c0dbcdc5129a54c47e999f147937a
|
||||
F ext/wasm/EXPORTED_FUNCTIONS.fiddle.in 27450c8b8c70875a260aca55435ec927068b34cef801a96205adb81bdcefc65c
|
||||
F ext/wasm/GNUmakefile 2b19c10968295f50ebd1c97c33bfb9038bda8e42fe3be9fb0eed8ae634d45742
|
||||
F ext/wasm/GNUmakefile 06e0556e9840fd3d8870997025c2507ace9ba7bf11195f770295fc7947dfc1b5
|
||||
F ext/wasm/README-dist.txt f01081a850ce38a56706af6b481e3a7878e24e42b314cfcd4b129f0f8427066a
|
||||
F ext/wasm/README.md b89605f65661cf35bf034ff6d43e448cc169b8017fc105d498e33b81218b482c
|
||||
F ext/wasm/SQLTester/GNUmakefile e0794f676d55819951bbfae45cc5e8d7818dc460492dc317ce7f0d2eca15caff
|
||||
@@ -635,13 +635,13 @@ F ext/wasm/api/README.md c64ec8e84449c069e0217706d9d7d31b3bd53627228b2ba0c3cddbd
|
||||
F ext/wasm/api/extern-post-js.c-pp.js 3fcd904f1204685dea84e5ae90d8b7e65a1dcebab1e838386d8328b74cce46c9
|
||||
F ext/wasm/api/extern-pre-js.js cc61c09c7a24a07dbecb4c352453c3985170cec12b4e7e7e7a4d11d43c5c8f41
|
||||
F ext/wasm/api/post-js-footer.js 365405929f41ca0e6d389ed8a8da3f3c93e11d3ef43a90ae151e37fa9f75bf41
|
||||
F ext/wasm/api/post-js-header.js 54b2b4294501b3866245cc94315a16f5424c0e87729d0fb610fba151593c6d26
|
||||
F ext/wasm/api/post-js-header.js 53740d824e5d9027eb1e6fd59e216abbd2136740ce260ea5f0699ff2acb0a701
|
||||
F ext/wasm/api/pre-js.c-pp.js a614a2c82b12c4d96d8e3ba77330329efc53c4d56a8a7e60ade900f341866cfb
|
||||
F ext/wasm/api/sqlite3-api-cleanup.js 3ac1786e461ada63033143be8c3b00b26b939540661f3e839515bb92f2e35359
|
||||
F ext/wasm/api/sqlite3-api-glue.c-pp.js 5c0209e6a28164b4c2c1a34b0bb4aee3b7b1a264988d7e71fac08b8ede5b7ae3
|
||||
F ext/wasm/api/sqlite3-api-oo1.c-pp.js f3a8e2004c6625d17946c11f2fb32008be78bc5207bf746fc77d59848813225f
|
||||
F ext/wasm/api/sqlite3-api-prologue.js 5ff913355b3144f1c9719d0406667fa6e13eb813c71ed7ce29440e2e65363e82
|
||||
F ext/wasm/api/sqlite3-api-worker1.c-pp.js 5cc22a3c0d52828cb32aad8691488719f47d27567e63e8bc8b832d74371c352d
|
||||
F ext/wasm/api/sqlite3-api-prologue.js 9e7d89a2c0d02b8b2052a62757a89f1e7e4dbcc0d9cd3f2dafa896786954dad2
|
||||
F ext/wasm/api/sqlite3-api-worker1.c-pp.js f646a65257973b8c4481f8a6a216370b85644f23e64b126e7ae113570587c0ab
|
||||
F ext/wasm/api/sqlite3-license-version-header.js 0c807a421f0187e778dc1078f10d2994b915123c1223fe752b60afdcd1263f89
|
||||
F ext/wasm/api/sqlite3-opfs-async-proxy.js 3774befd97cd1a5e2895c8225a894aad946848c6d9b4028acc988b5d123475af
|
||||
F ext/wasm/api/sqlite3-vfs-helper.c-pp.js 3f828cc66758acb40e9c5b4dcfd87fd478a14c8fb7f0630264e6c7fa0e57515d
|
||||
@@ -667,9 +667,9 @@ F ext/wasm/demo-123.js c7b3cca50c55841c381a9ca4f9396e5bbdc6114273d0b10a43e378e32
|
||||
F ext/wasm/demo-jsstorage.html 409c4be4af5f207fb2877160724b91b33ea36a3cd8c204e8da1acb828ffe588e
|
||||
F ext/wasm/demo-jsstorage.js 44e3ae7ec2483b6c511384c3c290beb6f305c721186bcf5398ca4e00004a06b8
|
||||
F ext/wasm/demo-worker1-promiser.c-pp.html 635cf90685805e21772a5f7a35d1ace80f98a9ef7c42ff04d7a125ddca7e5db8
|
||||
F ext/wasm/demo-worker1-promiser.c-pp.js fcc628cb42fcfaf07d250477801de1e6deb1e319d003976612a0db8d76b9fccc
|
||||
F ext/wasm/demo-worker1-promiser.c-pp.js af168699d3cab1c27ad2364ebe06cd49db300bdbf404e23b00d5742ed52816ba
|
||||
F ext/wasm/demo-worker1.html 2c178c1890a2beb5a5fecb1453e796d067a4b8d3d2a04d65ca2eb1ab2c68ef5d
|
||||
F ext/wasm/demo-worker1.js 836bece8615b17b1b572584f7b15912236a5947fe8c68b98d2737d7e287447ef
|
||||
F ext/wasm/demo-worker1.js 08720227e98fa5b44761cf6e219269cee3e9dd0421d8d91459535da776950314
|
||||
F ext/wasm/dist.make 92ef4ffe33022a50f92d602acabad10bd8dd91759f3eb7df27fc6d7d37072b96
|
||||
F ext/wasm/example_extra_init.c 2347cd69d19d839ef4e5e77b7855103a7fe3ef2af86f2e8c95839afd8b05862f
|
||||
F ext/wasm/fiddle.make d4969f0322a582c57a22ce3541f10a5b09a609d14eab32891f613f43b3c14d8b
|
||||
@@ -702,7 +702,7 @@ F ext/wasm/tests/opfs/concurrency/test.js d08889a5bb6e61937d0b8cbb78c9efbefbf65a
|
||||
F ext/wasm/tests/opfs/concurrency/worker.js 0a8c1a3e6ebb38aabbee24f122693f1fb29d599948915c76906681bb7da1d3d2
|
||||
F ext/wasm/wasmfs.make 68999f5bd8c489239592d59a420f8c627c99169bbd6fa16a404751f757b9f702
|
||||
F magic.txt 5ade0bc977aa135e79e3faaea894d5671b26107cc91e70783aa7dc83f22f3ba0
|
||||
F main.mk ae183c31bef504b89d1bbcc5b59a07e5eedfcc55bb543b4aa254808f4dd85149
|
||||
F main.mk 7c9df07a41c406a5fbe4e7e4021f29fa4f18821d61354721fd0435fc24f95321
|
||||
F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271
|
||||
F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504
|
||||
F mptest/crash01.test 61e61469e257df0850df4293d7d4d6c2af301421
|
||||
@@ -712,8 +712,8 @@ F mptest/multiwrite01.test dab5c5f8f9534971efce679152c5146da265222d
|
||||
F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b
|
||||
F sqlite3.1 acdff36db796e2d00225b911d3047d580cd136547298435426ce9d40347973cc
|
||||
F sqlite3.pc.in 0977c03a4da7c4204bd60e784a0efb8d51a190448aba78a4e973fe7192bdaf03
|
||||
F src/alter.c aa93e37e4a36a0525bbb2a2aeda20d2018f0aa995542c7dc658e031375e3f532
|
||||
F src/analyze.c 9a8b67239d899ac12289db5db3f5bfe7f7a0ad1277f80f87ead1d048085876eb
|
||||
F src/alter.c 1751e231d8385067fa0d0145f0d461a092db6bd3d7edbfc3172db625aceccd9a
|
||||
F src/analyze.c 0823d2edb3ce564157e9d62714cc729027933209b712e95fbabb23e47fff0aec
|
||||
F src/attach.c 3a5cb9ee4aad6c5b22268287340a4f2f7b07959b7a522201be30fee23cd802e9
|
||||
F src/auth.c 54ab9c6c5803b47c0d45b76ce27eff22a03b4b1f767c5945a3a4eb13aa4c78dc
|
||||
F src/backup.c 5c97e8023aab1ce14a42387eb3ae00ba5a0644569e3476f38661fa6f824c3523
|
||||
@@ -722,7 +722,7 @@ F src/btmutex.c 79a43670447eacc651519a429f6ece9fd638563cf95b469d6891185ddae2b522
|
||||
F src/btree.c 63ca6b647342e8cef643863cd0962a542f133e1069460725ba4461dcda92b03c
|
||||
F src/btree.h 18e5e7b2124c23426a283523e5f31a4bff029131b795bb82391f9d2f3136fc50
|
||||
F src/btreeInt.h 98aadb6dcb77b012cab2574d6a728fad56b337fc946839b9898c4b4c969e30b6
|
||||
F src/build.c 86a7efd263eb7d6a4dc24dda0981c55202b22f84765023d3ef4878d228bee5c6
|
||||
F src/build.c 602fc45ea6301a3dc03ec20a9f9b294c492b7e1766ae96651f2ba8044dc445a6
|
||||
F src/callback.c acae8c8dddda41ee85cfdf19b926eefe830f371069f8aadca3aa39adf5b1c859
|
||||
F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e
|
||||
F src/ctime.c d35723024b963edce9c0fad5b3303e8bb9266083784844baed10a6dedfe26f3b
|
||||
@@ -730,20 +730,20 @@ F src/date.c 842c08ac143a56a627b05ac51d68624f2b7b03e3b4cba596205e735eed64ee57
|
||||
F src/dbpage.c 2e677acb658a29965e55398bbc61161cb7819da538057c8032adac7ab8e4a8c0
|
||||
F src/dbstat.c 73362c0df0f40ad5523a6f5501224959d0976757b511299bf892313e79d14f5c
|
||||
F src/delete.c 03a77ba20e54f0f42ebd8eddf15411ed6bdb06a2c472ac4b6b336521bf7cea42
|
||||
F src/expr.c 3fc2f37dbc172293239600cc6f041830e7e2bc3ddaaebfbb2a89520317b4a09f
|
||||
F src/expr.c ca943270395374afc65256ce86cdb152a22fa6ff146895175833b89ba870e117
|
||||
F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007
|
||||
F src/fkey.c 928ed2517e8732113d2b9821aa37af639688d752f4ea9ac6e0e393d713eeb76f
|
||||
F src/func.c 1ab83fd94f97af9797bdf1027169e3e19482fce06b090c3acceb4bf92ae452cd
|
||||
F src/func.c b2fb33139972d7d65640b27ea962a49f1616265428001090cab39fcf270228e1
|
||||
F src/global.c a19e4b1ca1335f560e9560e590fc13081e21f670643367f99cb9e8f9dc7d615b
|
||||
F src/hash.c 9ee4269fb1d6632a6fecfb9479c93a1f29271bddbbaf215dd60420bcb80c7220
|
||||
F src/hash.h 3340ab6e1d13e725571d7cee6d3e3135f0779a7d8e76a9ce0a85971fa3953c51
|
||||
F src/hash.c 73934a7f7ab1cb110614a9388cb516893b0cf5b7b69e4fd1a0780ac4ce166be7
|
||||
F src/hash.h 46b92795a95bfefb210f52f0c316e9d7cdbcdd7e7fcfb0d8be796d3a5767cddf
|
||||
F src/hwtime.h f9c2dfb84dce7acf95ce6d289e46f5f9d3d1afd328e53da8f8e9008e3b3caae6
|
||||
F src/in-operator.md 10cd8f4bcd225a32518407c2fb2484089112fd71
|
||||
F src/insert.c db8bfff30fd7f71812651df3ddf5d1624b9e19104b31e349cd9055bbc9d622c4
|
||||
F src/json.c 68a98c020c22127f2d65f08855f7fc7460ff352a6ce0b543d8931dde83319c22
|
||||
F src/insert.c 05e04ef637cbc0dccb9a5c5d188a5a2608891e554c8ec17c7a71afe2cf896a06
|
||||
F src/json.c 2663a0c7e574cb928de944720dcdcc11c931877d877549b8f1258a4002efd6f7
|
||||
F src/legacy.c d7874bc885906868cd51e6c2156698f2754f02d9eee1bae2d687323c3ca8e5aa
|
||||
F src/loadext.c 7432c944ff197046d67a1207790a1b13eec4548c85a9457eb0896bb3641dfb36
|
||||
F src/main.c 54e7f07a41e3424f5c2f39db9e96d5c33bbc1555362478d90700a39b694994e6
|
||||
F src/main.c b99d15d843f7a86adbec855de77b1656dde07359722ef63a9d9393678dbb58d1
|
||||
F src/malloc.c 410e570b30c26cc36e3372577df50f7a96ee3eed5b2b161c6b6b48773c650c5e
|
||||
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
|
||||
F src/mem1.c 3bb59158c38e05f6270e761a9f435bf19827a264c13d1631c58b84bdc96d73b2
|
||||
@@ -769,23 +769,23 @@ F src/os_win.c 49c7725b500f5867e8360e75eeb30f9d70b62fa1f05c8a101da627210578df32
|
||||
F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a
|
||||
F src/pager.c 3a1c4e7f69af482e33c8cba8a75afe0dda0ea6391240adac22b040ce1bdeef44
|
||||
F src/pager.h 6137149346e6c8a3ddc1eeb40aee46381e9bc8b0fcc6dda8a1efde993c2275b8
|
||||
F src/parse.y 5dce477d23c6cd41da97ff9bc4ef93fba0e0a0aaa72a15ddb8a3f71618d76cac
|
||||
F src/parse.y f84673f1454e2bcf517623d4346e67fb2d73e57826ea103681ad5848238f6029
|
||||
F src/pcache.c 588cc3c5ccaaadde689ed35ce5c5c891a1f7b1f4d1f56f6cf0143b74d8ee6484
|
||||
F src/pcache.h 1497ce1b823cf00094bb0cf3bac37b345937e6f910890c626b16512316d3abf5
|
||||
F src/pcache1.c 49516ad7718a3626f28f710fa7448ef1fce3c07fd169acbb4817341950264319
|
||||
F src/pragma.c ce1182217aa540e034c6da2f17515e3706bf52c837e8222361be9ccd7a9d495a
|
||||
F src/pragma.h 5edad5943dba8ec69727e719fb841b6b505204b9cdbfc50142806f79458fcce6
|
||||
F src/pragma.h e690a356c18e98414d2e870ea791c1be1545a714ba623719deb63f7f226d8bb7
|
||||
F src/prepare.c 1832be043fce7d489959aae6f994c452d023914714c4d5457beaed51c0f3d126
|
||||
F src/printf.c 96f7f8baeedc7639da94e4e7a4a2c200e2537c4eec9e5e1c2ffc821f40eb3105
|
||||
F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c
|
||||
F src/resolve.c c8a5372b97b2a2e972a280676f06ddb5b74e885d3b1f5ce383f839907b57ef68
|
||||
F src/resolve.c 626c24b258b111f75c22107aa5614ad89810df3026f5ca071116d3fe75925c75
|
||||
F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
|
||||
F src/select.c c94f7fe33a3f481cc68472ba845301e343e0412c216fee06f58ad64e7e88bf45
|
||||
F src/select.c 57893cc8b099f231f7ed5b84faff14841f2aabb4776e32e17fae00aeae0a8993
|
||||
F src/shell.c.in b377a59822f207106424f08aead37e78b609222e98f86f04cc8a03563ccf3237
|
||||
F src/sqlite.h.in d2902f13ace94d3d3609646bd6d12a2d7a4f6cbdf6a5a4097580ac305f54c3f0
|
||||
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
|
||||
F src/sqlite3ext.h 3f046c04ea3595d6bfda99b781926b17e672fd6d27da2ba6d8d8fc39981dcb54
|
||||
F src/sqliteInt.h aeb5ed59db92bfa2bf987366769a48681735c9da58e88e76f1f47d1fc26a2e46
|
||||
F src/sqliteInt.h 8cbfef6c26efd539eb93011905f4d3ce7fdb77475d1280764d86f9e7954c464b
|
||||
F src/sqliteLimit.h 1bbdbf72bd0411d003267ffebc59a262f061df5653027a75627d03f48ca30523
|
||||
F src/status.c cb11f8589a6912af2da3bb1ec509a94dd8ef27df4d4c1a97e0bcf2309ece972b
|
||||
F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1
|
||||
@@ -843,30 +843,30 @@ F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9
|
||||
F src/threads.c 4ae07fa022a3dc7c5beb373cf744a85d3c5c6c3c
|
||||
F src/tokenize.c 375a772e2342274f4bf73605a70633237da09deed00a9bf4c4816a56777ea7c9
|
||||
F src/treeview.c d85ce76e6d1498d781957c07cb234da6d77ce0ed2d196480d516f54dabc62279
|
||||
F src/trigger.c 247e2d712d5edc6021d52a169f6ac9a9c10d7144bc4ac7ea06c1ed2aa414659f
|
||||
F src/update.c 0e01aa6a3edf9ec112b33eb714b9016a81241497b1fb7c3e74332f4f71756508
|
||||
F src/trigger.c da3c25786870d8bf97cd46b493374c2375d1abaf20a9b0f5f8629a3f2f2ce383
|
||||
F src/update.c 3e5e7ff66fa19ebe4d1b113d480639a24cc1175adbefabbd1a948a07f28e37cf
|
||||
F src/upsert.c 215328c3f91623c520ec8672c44323553f12caeb4f01b1090ebdca99fdf7b4f1
|
||||
F src/utf.c 8b29d9a5956569ea2700f869669b8ef67a9662ee5e724ff77ab3c387e27094ba
|
||||
F src/util.c e5f6a5eeaa26b69054a43bbd0048cfe3d2851f6961052b35aed8f695df922850
|
||||
F src/util.c 9ff6470dabcf943fd796d2da766c98bd328c8f6fe036a31e5b338e628603f989
|
||||
F src/vacuum.c b763b6457bd058d2072ef9364832351fd8d11e8abf70cbb349657360f7d55c40
|
||||
F src/vdbe.c 3c9e4dacc5db859cfe61ed364023f0889ca082061cbb064f44e772d274006ec2
|
||||
F src/vdbe.c eeb0882a45918150d9576f5bbcaa255689082e70cc9abf82287439bc39440edf
|
||||
F src/vdbe.h 3d26d5c7660c5c7bd33ffb0d8784615072d8b23c81f8110870efe2631136bc89
|
||||
F src/vdbeInt.h 895b1ab7536f018d3d70d690f6c0adbd1062b6dddce1c2cad912927856d4033c
|
||||
F src/vdbeInt.h 078b1c15b26587b54c1c1879d0d2f4dec812b9de4c337fed9faf73fbcc3bf091
|
||||
F src/vdbeapi.c 82fe278a7c71b653235c6f9fb5de0b5de589908dfcb011ba2a782e8becf06f86
|
||||
F src/vdbeaux.c 885e16100597507fbbe09d82cbb963bff3fd8a9c1e358dc4f463fc95feb18e8b
|
||||
F src/vdbeblob.c 255be187436da38b01f276c02e6a08103489bbe2a7c6c21537b7aecbe0e1f797
|
||||
F src/vdbemem.c 977438546df236c6a3e7d8b4fe86c0643c13b89b00235db1f11c3a91a4796d30
|
||||
F src/vdbeaux.c 541d3d232714455960eab4ed10b34cb48b4bcd565d7539ef31092f5e73648e6b
|
||||
F src/vdbeblob.c 9166b6eb7054e5da82e35255892fb1ed551355a4716452539e8e3ac14f25fbe3
|
||||
F src/vdbemem.c 4af21a948820259ced96e3d46d70f9af347afa2deb7cb60a8b3981d5748e4279
|
||||
F src/vdbesort.c d0a3c7056c081703c8b6d91ad60f17da5e062a5c64bf568ed0fa1b5f4cae311f
|
||||
F src/vdbetrace.c fe0bc29ebd4e02c8bc5c1945f1d2e6be5927ec12c06d89b03ef2a4def34bf823
|
||||
F src/vdbevtab.c fc46b9cbd759dc013f0b3724549cc0d71379183c667df3a5988f7e2f1bd485f3
|
||||
F src/vtab.c bd4ab699ac4d1ee6da7339d3fbbb5edf23d9737c1fd322ccd75984329d070472
|
||||
F src/vtab.c 828221bdbeaaa6d62126ee6d07fd4ec0d09dcaea846f87ad01944d8b7e548859
|
||||
F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
|
||||
F src/wal.c 4e6181d8780ab0af2e1388d0754cbe6f2f04593d2b1ab6c41699a89942fd8997
|
||||
F src/wal.h ba252daaa94f889f4b2c17c027e823d9be47ce39da1d3799886bbd51f0490452
|
||||
F src/walker.c d5006d6b005e4ea7302ad390957a8d41ed83faa177e412f89bc5600a7462a014
|
||||
F src/where.c 8bf66eb9911356da811fd5bcbbd42dbc53c9381e04eb7ed32959264e24cf8082
|
||||
F src/where.c 09dc313e7223ca1217c39c7026b00f16ff449a8323511a762fcba7863a00f4cd
|
||||
F src/whereInt.h d20cddddb1d61b18d5cb1fcfa9b77fbeebbc4afe44d996e603452a23b3009ee1
|
||||
F src/wherecode.c 0c3d3199a2b769a5e2bb70feb5003dc85b3d86842ecaf903a47f2b4205ca5dab
|
||||
F src/wherecode.c 5baa06f0daae7d38aca1d4814030b82ad4f127fe6bad18f0644776a474f6088b
|
||||
F src/whereexpr.c 2415c8eee5ff89a8b709d7d83d71c1ff986cd720d0520057e1d8a5371339012a
|
||||
F src/window.c 2bf01f9941a64fbcead61a0e3cb5db3fca5094b30d2ff0d23274c2a81d2e2385
|
||||
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
|
||||
@@ -972,7 +972,7 @@ F test/bind2.test 918bc35135f4141809ead7585909cde57d44db90a7a62aef540127148f91aa
|
||||
F test/bindxfer.test efecd12c580c14df5f4ad3b3e83c667744a4f7e0
|
||||
F test/bitvec.test 75894a880520164d73b1305c1c3f96882615e142
|
||||
F test/blob.test e7ac6c7d3a985cc4678c64f325292529a69ae252
|
||||
F test/bloom1.test 04f3a17df8912bfdc292c41b59d79f93893fe69799f3089a64451f9112f9658f
|
||||
F test/bloom1.test cf613a27054bbaf61c5bfc440a5cfd3ff76798d0695f3fc5e5d1bbc819b8dab1
|
||||
F test/boundary1.tcl 6421b2d920d8b09539503a8673339d32f7609eb1
|
||||
F test/boundary1.test 66d7f4706ccdb42d58eafdb081de07b0eb42d77b
|
||||
F test/boundary2.tcl e34ef4e930cf1083150d4d2c603e146bd3b76bcb
|
||||
@@ -1572,7 +1572,7 @@ F test/round1.test 29c3c9039936ed024d672f003c4d35ee11c14c0acb75c5f7d6188ff16190c
|
||||
F test/rowallock.test 3f88ec6819489d0b2341c7a7528ae17c053ab7cc
|
||||
F test/rowhash.test 0bc1d31415e4575d10cacf31e1a66b5cc0f8be81
|
||||
F test/rowid.test d27191b5ce794c05bf61081e8b2c546a1844c1641321dcaf7fb785234256cc8e
|
||||
F test/rowvalue.test 0b023643162dfe3036780d78eb8daa52b144b6c2dee1216967cc72eafe19aa3d
|
||||
F test/rowvalue.test baf4fa3ec1a8c1c920c3faa5fd25959cb454bbd99ac8960397c34549d9fc4abe
|
||||
F test/rowvalue2.test 060d238b7e5639a7c5630cb5e63e311b44efef2b
|
||||
F test/rowvalue3.test 1347e25ca11c547c5a6ff0cc5626f95aa9740e9275bfaec096029f57cb2130ce
|
||||
F test/rowvalue4.test bac9326d1e886656650f67c0ec484eb5f452244a8209c6af508e9a862ace08ed
|
||||
@@ -1638,7 +1638,7 @@ F test/sharedB.test 1a84863d7a2204e0d42f2e1606577c5e92e4473fa37ea0f5bdf829e4bf8e
|
||||
F test/shared_err.test 32634e404a3317eeb94abc7a099c556a346fdb8fb3858dbe222a4cbb8926a939
|
||||
F test/sharedlock.test 5ede3c37439067c43b0198f580fd374ebf15d304
|
||||
F test/shell1.test 5d84e415adf7cc4edd5913c4f23c761104ff135b9c190fcf7b430a4cbca6cb65
|
||||
F test/shell2.test ac102ebc0a9ec166257600c4ee8bdefec242163afced295f10b004f4af3fc9dd
|
||||
F test/shell2.test 01a01f76ed98088ce598794fbf5b359e148271541a8ddbf79d21cc353cc67a24
|
||||
F test/shell3.test db1953a8e59d08e9240b7cc5948878e184f7eb2623591587f8fd1f1a5bd536d8
|
||||
F test/shell4.test 522fdc628c55eff697b061504fb0a9e4e6dfc5d9087a633ab0f3dd11bcc4f807
|
||||
F test/shell5.test 0e5f8ce08206b9998a778cfe1989e20e47839153c05af2da29198150172e22fc
|
||||
@@ -1680,8 +1680,8 @@ F test/speed4.test abc0ad3399dcf9703abed2fff8705e4f8e416715
|
||||
F test/speed4p.explain 6b5f104ebeb34a038b2f714150f51d01143e59aa
|
||||
F test/speed4p.test 377a0c48e5a92e0b11c1c5ebb1bc9d83a7312c922bc0cb05970ef5d6a96d1f0c
|
||||
F test/speedtest.md ee958457ae1b729d9715ae33c0320600000bf1d9ddea1a88dcf79f56729d6fad
|
||||
F test/speedtest.tcl 8a9362c1e429318e741b91d26888e7edcc326f98c3aea505ffd618cc5b9e7f0a x
|
||||
F test/speedtest1.c 204acd8af326bbca2c28f68166635d4574381f4cabbac1bc243663f5dcc5051d
|
||||
F test/speedtest.tcl 926d1e168f4a14e6fb68c5dc174de743536b547f365264bd5bac533b3621a4a0 x
|
||||
F test/speedtest1.c 132cd5ba064f48910bb4b68337442b0ef419218c8de9e9855f66d98015286ddb
|
||||
F test/spellfix.test 951a6405d49d1a23d6b78027d3877b4a33eeb8221dcab5704b499755bb4f552e
|
||||
F test/spellfix2.test dfc8f519a3fc204cb2dfa8b4f29821ae90f6f8c3
|
||||
F test/spellfix3.test 0f9efaaa502a0e0a09848028518a6fb096c8ad33
|
||||
@@ -1715,7 +1715,7 @@ F test/sync.test 89539f4973c010eda5638407e71ca7fddbcd8e0594f4c9980229f804d433309
|
||||
F test/sync2.test 8f9f7d4f6d5be8ca8941a8dadcc4299e558cb6a1ff653a9469146c7a76ef2039
|
||||
F test/syscall.test a067468b43b8cb2305e9f9fe414e5f40c875bb5d2cba5f00b8154396e95fcf37
|
||||
F test/sysfault.test c9f2b0d8d677558f74de750c75e12a5454719d04
|
||||
F test/tabfunc01.test e85679a3800aa632dee787966b8482fce0bd47629dad82f102fd52f319d2c281
|
||||
F test/tabfunc01.test 7be82bd50c7ede7f01b2dd17cd1b84f352c516078222d0b067d858f081e3f9a7
|
||||
F test/table.test 7862a00b58b5541511a26757ea9c5c7c3f8298766e98aa099deec703d9c0a8e0
|
||||
F test/tableapi.test ecbcc29c4ab62c1912c3717c48ea5c5e59f7d64e4a91034e6148bd2b82f177f4
|
||||
F test/tableopts.test dba698ba97251017b7c80d738c198d39ab747930
|
||||
@@ -2144,7 +2144,7 @@ F tool/logest.c c34e5944318415de513d29a6098df247a9618c96d83c38d4abd88641fe46e669
|
||||
F tool/max-limits.c cbb635fbb37ae4d05f240bfb5b5270bb63c54439
|
||||
F tool/merge-test.tcl de76b62f2de2a92d4c1ca4f976bce0aea6899e0229e250479b229b2a1914b176
|
||||
F tool/mkamalzip.tcl 8aa5ebe7973c8b8774062d34e15fea9815c4cc2ceea3a9b184695f005910876a
|
||||
F tool/mkautoconfamal.sh c5e65fa1c922f2e3b3e4f6cd0331ec7d84bdef085f32cb1c46673cdf95ec8090
|
||||
F tool/mkautoconfamal.sh 14d2144043c6455958012f92324f4ce7c90a261b5daa2f2c7509498468475f8d
|
||||
F tool/mkccode.tcl 210159febe0ef0ecbc53c79833500663ceaba0115b2b374405818dc835b5f84b x
|
||||
F tool/mkctimec.tcl ef6a67ec82e5b6fc19152a4c79f237227b18bf67ff16d155bac7adb94355d9cf x
|
||||
F tool/mkkeywordhash.c 6b0be901c47f9ad42215fc995eb2f4384ac49213b1fba395102ec3e999acf559
|
||||
@@ -2152,13 +2152,13 @@ F tool/mkmsvcmin.tcl d76c45efda1cce2d4005bcea7b8a22bb752e3256009f331120fb4fecb14
|
||||
F tool/mkopcodec.tcl 33d20791e191df43209b77d37f0ff0904620b28465cca6990cf8d60da61a07ef
|
||||
F tool/mkopcodeh.tcl 2b4e6967a670ef21bf53a164964c35c6163277d002a4c6f56fa231d68c88d023
|
||||
F tool/mkopts.tcl 680f785fdb09729fd9ac50632413da4eadbdf9071535e3f26d03795828ab07fa
|
||||
F tool/mkpragmatab.tcl f9339d207de40cb57e8dc7a53817dac8e63a4d4f38a7b815e62cd67f68be70d8
|
||||
F tool/mkpragmatab.tcl 32e359ccb21011958a821955254bd7a5fa7915d01a8c16fed91ffc8b40cb4adf
|
||||
F tool/mkshellc.tcl 9ce74de0fa904a2c56a96f8d8b5261246bacb0eaa8d7e184f9e18ff94145ebbc
|
||||
F tool/mksourceid.c 36aa8020014aed0836fd13c51d6dc9219b0df1761d6b5f58ff5b616211b079b9
|
||||
F tool/mkspeedsql.tcl a1a334d288f7adfe6e996f2e712becf076745c97
|
||||
F tool/mksqlite3c-noext.tcl 351c55256213154cabb051a3c870ef9f4487de905015141ae50dc7578a901b84
|
||||
F tool/mksqlite3c.tcl ba13086555b3cb835eba5e47a9250300ab85304d23fd1081abd3f29d8ab71a2b
|
||||
F tool/mksqlite3h.tcl 989948c6a26e188e673d7c2f2f093ea3acd816ad6ac65bab596280075c8f3a45
|
||||
F tool/mksqlite3h.tcl b05b85c32295bad3fe64807729693d1f19faed3c464c5faac6c53bb6b972ac2f
|
||||
F tool/mksqlite3internalh.tcl eb994013e833359137eb53a55acdad0b5ae1049b
|
||||
F tool/mksrczip.tcl 81efd9974dbb36005383f2cd655520057a2ae5aa85ac2441a80c7c28f803ac52
|
||||
F tool/mktoolzip.tcl 34b4e92be544f820e2cc26f143f7d5aec511e826ec394cc82969a5dcf7c7a27c
|
||||
@@ -2195,7 +2195,7 @@ F tool/sqltclsh.c.in 1bcc2e9da58fadf17b0bf6a50e68c1159e602ce057210b655d50bad5aaa
|
||||
F tool/sqltclsh.tcl 862f4cf1418df5e1315b5db3b5ebe88969e2a784525af5fbf9596592f14ed848
|
||||
F tool/src-verify.c d00f93263aa2fa6ba0cba0106d95458e6effb94fdb5fc634f56834f90c05bbb4
|
||||
F tool/srcck1.c 371de5363b70154012955544f86fdee8f6e5326f
|
||||
F tool/srctree-check.tcl 9dfdaf37653df0b58a309c405cc115026468eee4c1ffad5f2af7428c531e554d
|
||||
F tool/srctree-check.tcl 1f1f505835a4beca64c1751a7ebec5c41a1ddf22b1e80481345b95059eef6583
|
||||
F tool/stack_usage.tcl f8e71b92cdb099a147dad572375595eae55eca43
|
||||
F tool/stripccomments.c dfe9cc03cf87728ac9836be30763f8aa52b82caca0780b3d3f3572e4643b01d3
|
||||
F tool/symbols-mingw.sh 4dbcea7e74768305384c9fd2ed2b41bbf9f0414d
|
||||
@@ -2209,10 +2209,12 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350
|
||||
F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
|
||||
F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139
|
||||
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
||||
P 9d1f01aac909a0689ab881e269c3f1e4b583b0b135689a39fd2822de7a059e5f
|
||||
R 95cfc65226e423aa18b9e0671f876db9
|
||||
T +sym-release *
|
||||
T +sym-version-3.49.2 *
|
||||
P 57b2b812c8c5524f315e20cee0e6a12a3b1635aeb42925bf891532a7029d0eb0
|
||||
R 5b40ead92f50e29d43d44519f8927a47
|
||||
T *branch * column-optimization
|
||||
T *sym-column-optimization *
|
||||
T +closed *
|
||||
T -sym-trunk *
|
||||
U drh
|
||||
Z 26aa19dada18db86c2026c3614aef5cb
|
||||
Z 359be1e71666f10555b25682f42340bf
|
||||
# Remove this line to create a well-formed Fossil manifest.
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
17144570b0d96ae63cd6f3edca39e27ebd74925252bbaf6723bcb2f6b4861fb1
|
||||
53478f29347c7f17d46ec2a1e7c390c9be9e9fc32f31da77a4ba7a9d67440a8e
|
||||
|
||||
+2
-4
@@ -632,10 +632,8 @@ void sqlite3AlterRenameColumn(
|
||||
** altered. Set iCol to be the index of the column being renamed */
|
||||
zOld = sqlite3NameFromToken(db, pOld);
|
||||
if( !zOld ) goto exit_rename_column;
|
||||
for(iCol=0; iCol<pTab->nCol; iCol++){
|
||||
if( 0==sqlite3StrICmp(pTab->aCol[iCol].zCnName, zOld) ) break;
|
||||
}
|
||||
if( iCol==pTab->nCol ){
|
||||
iCol = sqlite3ColumnIndex(pTab, zOld);
|
||||
if( iCol<0 ){
|
||||
sqlite3ErrorMsg(pParse, "no such column: \"%T\"", pOld);
|
||||
goto exit_rename_column;
|
||||
}
|
||||
|
||||
+2
-1
@@ -215,7 +215,8 @@ static void openStatTable(
|
||||
sqlite3NestedParse(pParse,
|
||||
"CREATE TABLE %Q.%s(%s)", pDb->zDbSName, zTab, aTable[i].zCols
|
||||
);
|
||||
aRoot[i] = (u32)pParse->regRoot;
|
||||
assert( pParse->isCreate || pParse->nErr );
|
||||
aRoot[i] = (u32)pParse->u1.cr.regRoot;
|
||||
aCreateTbl[i] = OPFLAG_P2ISREG;
|
||||
}
|
||||
}else{
|
||||
|
||||
+41
-35
@@ -168,10 +168,12 @@ void sqlite3FinishCoding(Parse *pParse){
|
||||
|| sqlite3VdbeAssertMayAbort(v, pParse->mayAbort));
|
||||
if( v ){
|
||||
if( pParse->bReturning ){
|
||||
Returning *pReturning = pParse->u1.pReturning;
|
||||
Returning *pReturning;
|
||||
int addrRewind;
|
||||
int reg;
|
||||
|
||||
assert( !pParse->isCreate );
|
||||
pReturning = pParse->u1.d.pReturning;
|
||||
if( pReturning->nRetCol ){
|
||||
sqlite3VdbeAddOp0(v, OP_FkCheck);
|
||||
addrRewind =
|
||||
@@ -247,7 +249,9 @@ void sqlite3FinishCoding(Parse *pParse){
|
||||
}
|
||||
|
||||
if( pParse->bReturning ){
|
||||
Returning *pRet = pParse->u1.pReturning;
|
||||
Returning *pRet;
|
||||
assert( !pParse->isCreate );
|
||||
pRet = pParse->u1.d.pReturning;
|
||||
if( pRet->nRetCol ){
|
||||
sqlite3VdbeAddOp2(v, OP_OpenEphemeral, pRet->iRetCur, pRet->nRetCol);
|
||||
}
|
||||
@@ -1319,8 +1323,9 @@ void sqlite3StartTable(
|
||||
/* If the file format and encoding in the database have not been set,
|
||||
** set them now.
|
||||
*/
|
||||
reg1 = pParse->regRowid = ++pParse->nMem;
|
||||
reg2 = pParse->regRoot = ++pParse->nMem;
|
||||
assert( pParse->isCreate );
|
||||
reg1 = pParse->u1.cr.regRowid = ++pParse->nMem;
|
||||
reg2 = pParse->u1.cr.regRoot = ++pParse->nMem;
|
||||
reg3 = ++pParse->nMem;
|
||||
sqlite3VdbeAddOp3(v, OP_ReadCookie, iDb, reg3, BTREE_FILE_FORMAT);
|
||||
sqlite3VdbeUsesBtree(v, iDb);
|
||||
@@ -1335,8 +1340,8 @@ void sqlite3StartTable(
|
||||
** The record created does not contain anything yet. It will be replaced
|
||||
** by the real entry in code generated at sqlite3EndTable().
|
||||
**
|
||||
** The rowid for the new entry is left in register pParse->regRowid.
|
||||
** The root page number of the new table is left in reg pParse->regRoot.
|
||||
** The rowid for the new entry is left in register pParse->u1.cr.regRowid.
|
||||
** The root page of the new table is left in reg pParse->u1.cr.regRoot.
|
||||
** The rowid and root page number values are needed by the code that
|
||||
** sqlite3EndTable will generate.
|
||||
*/
|
||||
@@ -1347,7 +1352,7 @@ void sqlite3StartTable(
|
||||
#endif
|
||||
{
|
||||
assert( !pParse->bReturning );
|
||||
pParse->u1.addrCrTab =
|
||||
pParse->u1.cr.addrCrTab =
|
||||
sqlite3VdbeAddOp3(v, OP_CreateBtree, iDb, reg2, BTREE_INTKEY);
|
||||
}
|
||||
sqlite3OpenSchemaTable(pParse, iDb);
|
||||
@@ -1425,7 +1430,8 @@ void sqlite3AddReturning(Parse *pParse, ExprList *pList){
|
||||
sqlite3ExprListDelete(db, pList);
|
||||
return;
|
||||
}
|
||||
pParse->u1.pReturning = pRet;
|
||||
assert( !pParse->isCreate );
|
||||
pParse->u1.d.pReturning = pRet;
|
||||
pRet->pParse = pParse;
|
||||
pRet->pReturnEL = pList;
|
||||
sqlite3ParserAddCleanup(pParse, sqlite3DeleteReturning, pRet);
|
||||
@@ -1467,7 +1473,6 @@ void sqlite3AddColumn(Parse *pParse, Token sName, Token sType){
|
||||
char *zType;
|
||||
Column *pCol;
|
||||
sqlite3 *db = pParse->db;
|
||||
u8 hName;
|
||||
Column *aNew;
|
||||
u8 eType = COLTYPE_CUSTOM;
|
||||
u8 szEst = 1;
|
||||
@@ -1521,13 +1526,10 @@ void sqlite3AddColumn(Parse *pParse, Token sName, Token sType){
|
||||
memcpy(z, sName.z, sName.n);
|
||||
z[sName.n] = 0;
|
||||
sqlite3Dequote(z);
|
||||
hName = sqlite3StrIHash(z);
|
||||
for(i=0; i<p->nCol; i++){
|
||||
if( p->aCol[i].hName==hName && sqlite3StrICmp(z, p->aCol[i].zCnName)==0 ){
|
||||
sqlite3ErrorMsg(pParse, "duplicate column name: %s", z);
|
||||
sqlite3DbFree(db, z);
|
||||
return;
|
||||
}
|
||||
if( p->nCol && sqlite3ColumnIndex(p, z)>=0 ){
|
||||
sqlite3ErrorMsg(pParse, "duplicate column name: %s", z);
|
||||
sqlite3DbFree(db, z);
|
||||
return;
|
||||
}
|
||||
aNew = sqlite3DbRealloc(db,p->aCol,((i64)p->nCol+1)*sizeof(p->aCol[0]));
|
||||
if( aNew==0 ){
|
||||
@@ -1538,7 +1540,7 @@ void sqlite3AddColumn(Parse *pParse, Token sName, Token sType){
|
||||
pCol = &p->aCol[p->nCol];
|
||||
memset(pCol, 0, sizeof(p->aCol[0]));
|
||||
pCol->zCnName = z;
|
||||
pCol->hName = hName;
|
||||
pCol->hName = sqlite3StrIHash(z);
|
||||
sqlite3ColumnPropertiesFromName(p, pCol);
|
||||
|
||||
if( sType.n==0 ){
|
||||
@@ -1562,9 +1564,14 @@ void sqlite3AddColumn(Parse *pParse, Token sName, Token sType){
|
||||
pCol->affinity = sqlite3AffinityType(zType, pCol);
|
||||
pCol->colFlags |= COLFLAG_HASTYPE;
|
||||
}
|
||||
if( p->nCol<=0xff ){
|
||||
u8 h = pCol->hName % sizeof(p->aHx);
|
||||
p->aHx[h] = p->nCol;
|
||||
}
|
||||
p->nCol++;
|
||||
p->nNVCol++;
|
||||
pParse->constraintName.n = 0;
|
||||
assert( pParse->isCreate );
|
||||
pParse->u1.cr.constraintName.n = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1828,15 +1835,11 @@ void sqlite3AddPrimaryKey(
|
||||
assert( pCExpr!=0 );
|
||||
sqlite3StringToId(pCExpr);
|
||||
if( pCExpr->op==TK_ID ){
|
||||
const char *zCName;
|
||||
assert( !ExprHasProperty(pCExpr, EP_IntValue) );
|
||||
zCName = pCExpr->u.zToken;
|
||||
for(iCol=0; iCol<pTab->nCol; iCol++){
|
||||
if( sqlite3StrICmp(zCName, pTab->aCol[iCol].zCnName)==0 ){
|
||||
pCol = &pTab->aCol[iCol];
|
||||
makeColumnPartOfPrimaryKey(pParse, pCol);
|
||||
break;
|
||||
}
|
||||
iCol = sqlite3ColumnIndex(pTab, pCExpr->u.zToken);
|
||||
if( iCol>=0 ){
|
||||
pCol = &pTab->aCol[iCol];
|
||||
makeColumnPartOfPrimaryKey(pParse, pCol);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1888,8 +1891,10 @@ void sqlite3AddCheckConstraint(
|
||||
&& !sqlite3BtreeIsReadonly(db->aDb[db->init.iDb].pBt)
|
||||
){
|
||||
pTab->pCheck = sqlite3ExprListAppend(pParse, pTab->pCheck, pCheckExpr);
|
||||
if( pParse->constraintName.n ){
|
||||
sqlite3ExprListSetName(pParse, pTab->pCheck, &pParse->constraintName, 1);
|
||||
assert( pParse->isCreate );
|
||||
if( pParse->u1.cr.constraintName.n ){
|
||||
sqlite3ExprListSetName(pParse, pTab->pCheck,
|
||||
&pParse->u1.cr.constraintName, 1);
|
||||
}else{
|
||||
Token t;
|
||||
for(zStart++; sqlite3Isspace(zStart[0]); zStart++){}
|
||||
@@ -2339,9 +2344,9 @@ static void convertToWithoutRowidTable(Parse *pParse, Table *pTab){
|
||||
** into BTREE_BLOBKEY.
|
||||
*/
|
||||
assert( !pParse->bReturning );
|
||||
if( pParse->u1.addrCrTab ){
|
||||
if( pParse->u1.cr.addrCrTab ){
|
||||
assert( v );
|
||||
sqlite3VdbeChangeP3(v, pParse->u1.addrCrTab, BTREE_BLOBKEY);
|
||||
sqlite3VdbeChangeP3(v, pParse->u1.cr.addrCrTab, BTREE_BLOBKEY);
|
||||
}
|
||||
|
||||
/* Locate the PRIMARY KEY index. Or, if this table was originally
|
||||
@@ -2781,7 +2786,7 @@ void sqlite3EndTable(
|
||||
|
||||
/* If this is a CREATE TABLE xx AS SELECT ..., execute the SELECT
|
||||
** statement to populate the new table. The root-page number for the
|
||||
** new table is in register pParse->regRoot.
|
||||
** new table is in register pParse->u1.cr.regRoot.
|
||||
**
|
||||
** Once the SELECT has been coded by sqlite3Select(), it is in a
|
||||
** suitable state to query for the column names and types to be used
|
||||
@@ -2812,7 +2817,8 @@ void sqlite3EndTable(
|
||||
regRec = ++pParse->nMem;
|
||||
regRowid = ++pParse->nMem;
|
||||
sqlite3MayAbort(pParse);
|
||||
sqlite3VdbeAddOp3(v, OP_OpenWrite, iCsr, pParse->regRoot, iDb);
|
||||
assert( pParse->isCreate );
|
||||
sqlite3VdbeAddOp3(v, OP_OpenWrite, iCsr, pParse->u1.cr.regRoot, iDb);
|
||||
sqlite3VdbeChangeP5(v, OPFLAG_P2ISREG);
|
||||
addrTop = sqlite3VdbeCurrentAddr(v) + 1;
|
||||
sqlite3VdbeAddOp3(v, OP_InitCoroutine, regYield, 0, addrTop);
|
||||
@@ -2857,6 +2863,7 @@ void sqlite3EndTable(
|
||||
** schema table. We just need to update that slot with all
|
||||
** the information we've collected.
|
||||
*/
|
||||
assert( pParse->isCreate );
|
||||
sqlite3NestedParse(pParse,
|
||||
"UPDATE %Q." LEGACY_SCHEMA_TABLE
|
||||
" SET type='%s', name=%Q, tbl_name=%Q, rootpage=#%d, sql=%Q"
|
||||
@@ -2865,9 +2872,9 @@ void sqlite3EndTable(
|
||||
zType,
|
||||
p->zName,
|
||||
p->zName,
|
||||
pParse->regRoot,
|
||||
pParse->u1.cr.regRoot,
|
||||
zStmt,
|
||||
pParse->regRowid
|
||||
pParse->u1.cr.regRowid
|
||||
);
|
||||
sqlite3DbFree(db, zStmt);
|
||||
sqlite3ChangeCookie(pParse, iDb);
|
||||
@@ -4191,7 +4198,6 @@ void sqlite3CreateIndex(
|
||||
assert( j<=0x7fff );
|
||||
if( j<0 ){
|
||||
j = pTab->iPKey;
|
||||
pIndex->bIdxRowid = 1;
|
||||
}else{
|
||||
if( pTab->aCol[j].notNull==0 ){
|
||||
pIndex->uniqNotNull = 0;
|
||||
|
||||
+5
-12
@@ -1849,7 +1849,6 @@ ExprList *sqlite3ExprListDup(sqlite3 *db, const ExprList *p, int flags){
|
||||
}
|
||||
pItem->zEName = sqlite3DbStrDup(db, pOldItem->zEName);
|
||||
pItem->fg = pOldItem->fg;
|
||||
pItem->fg.done = 0;
|
||||
pItem->u = pOldItem->u;
|
||||
}
|
||||
return pNew;
|
||||
@@ -2966,13 +2965,7 @@ const char *sqlite3RowidAlias(Table *pTab){
|
||||
int ii;
|
||||
assert( VisibleRowid(pTab) );
|
||||
for(ii=0; ii<ArraySize(azOpt); ii++){
|
||||
int iCol;
|
||||
for(iCol=0; iCol<pTab->nCol; iCol++){
|
||||
if( sqlite3_stricmp(azOpt[ii], pTab->aCol[iCol].zCnName)==0 ) break;
|
||||
}
|
||||
if( iCol==pTab->nCol ){
|
||||
return azOpt[ii];
|
||||
}
|
||||
if( sqlite3ColumnIndex(pTab, azOpt[ii])<0 ) return azOpt[ii];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -5936,11 +5929,11 @@ void sqlite3ExprIfTrue(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){
|
||||
assert( TK_ISNULL==OP_IsNull ); testcase( op==TK_ISNULL );
|
||||
assert( TK_NOTNULL==OP_NotNull ); testcase( op==TK_NOTNULL );
|
||||
r1 = sqlite3ExprCodeTemp(pParse, pExpr->pLeft, ®Free1);
|
||||
assert( regFree1==0 || regFree1==r1 );
|
||||
if( regFree1 ) sqlite3VdbeTypeofColumn(v, r1);
|
||||
sqlite3VdbeTypeofColumn(v, r1);
|
||||
sqlite3VdbeAddOp2(v, op, r1, dest);
|
||||
VdbeCoverageIf(v, op==TK_ISNULL);
|
||||
VdbeCoverageIf(v, op==TK_NOTNULL);
|
||||
testcase( regFree1==0 );
|
||||
break;
|
||||
}
|
||||
case TK_BETWEEN: {
|
||||
@@ -6111,11 +6104,11 @@ void sqlite3ExprIfFalse(Parse *pParse, Expr *pExpr, int dest, int jumpIfNull){
|
||||
case TK_ISNULL:
|
||||
case TK_NOTNULL: {
|
||||
r1 = sqlite3ExprCodeTemp(pParse, pExpr->pLeft, ®Free1);
|
||||
assert( regFree1==0 || regFree1==r1 );
|
||||
if( regFree1 ) sqlite3VdbeTypeofColumn(v, r1);
|
||||
sqlite3VdbeTypeofColumn(v, r1);
|
||||
sqlite3VdbeAddOp2(v, op, r1, dest);
|
||||
testcase( op==TK_ISNULL ); VdbeCoverageIf(v, op==TK_ISNULL);
|
||||
testcase( op==TK_NOTNULL ); VdbeCoverageIf(v, op==TK_NOTNULL);
|
||||
testcase( regFree1==0 );
|
||||
break;
|
||||
}
|
||||
case TK_BETWEEN: {
|
||||
|
||||
+13
-14
@@ -356,11 +356,6 @@ static void substrFunc(
|
||||
i64 p1, p2;
|
||||
|
||||
assert( argc==3 || argc==2 );
|
||||
if( sqlite3_value_type(argv[1])==SQLITE_NULL
|
||||
|| (argc==3 && sqlite3_value_type(argv[2])==SQLITE_NULL)
|
||||
){
|
||||
return;
|
||||
}
|
||||
p0type = sqlite3_value_type(argv[0]);
|
||||
p1 = sqlite3_value_int64(argv[1]);
|
||||
if( p0type==SQLITE_BLOB ){
|
||||
@@ -378,19 +373,23 @@ static void substrFunc(
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef SQLITE_SUBSTR_COMPATIBILITY
|
||||
/* If SUBSTR_COMPATIBILITY is defined then substr(X,0,N) work the same as
|
||||
** as substr(X,1,N) - it returns the first N characters of X. This
|
||||
** is essentially a back-out of the bug-fix in check-in [5fc125d362df4b8]
|
||||
** from 2009-02-02 for compatibility of applications that exploited the
|
||||
** old buggy behavior. */
|
||||
if( p1==0 ) p1 = 1; /* <rdar://problem/6778339> */
|
||||
#endif
|
||||
if( argc==3 ){
|
||||
p2 = sqlite3_value_int64(argv[2]);
|
||||
if( p2==0 && sqlite3_value_type(argv[2])==SQLITE_NULL ) return;
|
||||
}else{
|
||||
p2 = sqlite3_context_db_handle(context)->aLimit[SQLITE_LIMIT_LENGTH];
|
||||
}
|
||||
if( p1==0 ){
|
||||
#ifdef SQLITE_SUBSTR_COMPATIBILITY
|
||||
/* If SUBSTR_COMPATIBILITY is defined then substr(X,0,N) work the same as
|
||||
** as substr(X,1,N) - it returns the first N characters of X. This
|
||||
** is essentially a back-out of the bug-fix in check-in [5fc125d362df4b8]
|
||||
** from 2009-02-02 for compatibility of applications that exploited the
|
||||
** old buggy behavior. */
|
||||
p1 = 1; /* <rdar://problem/6778339> */
|
||||
#endif
|
||||
if( sqlite3_value_type(argv[1])==SQLITE_NULL ) return;
|
||||
}
|
||||
if( p1<0 ){
|
||||
p1 += len;
|
||||
if( p1<0 ){
|
||||
@@ -1571,7 +1570,7 @@ static void concatFuncCore(
|
||||
for(i=0; i<argc; i++){
|
||||
n += sqlite3_value_bytes(argv[i]);
|
||||
}
|
||||
n += (argc-1)*(i64)nSep;
|
||||
n += (argc-1)*nSep;
|
||||
z = sqlite3_malloc64(n+1);
|
||||
if( z==0 ){
|
||||
sqlite3_result_error_nomem(context);
|
||||
|
||||
+24
-22
@@ -54,12 +54,19 @@ void sqlite3HashClear(Hash *pH){
|
||||
*/
|
||||
static unsigned int strHash(const char *z){
|
||||
unsigned int h = 0;
|
||||
unsigned char c;
|
||||
while( (c = (unsigned char)*z++)!=0 ){ /*OPTIMIZATION-IF-TRUE*/
|
||||
while( z[0] ){ /*OPTIMIZATION-IF-TRUE*/
|
||||
/* Knuth multiplicative hashing. (Sorting & Searching, p. 510).
|
||||
** 0x9e3779b1 is 2654435761 which is the closest prime number to
|
||||
** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2. */
|
||||
h += sqlite3UpperToLower[c];
|
||||
** (2**32)*golden_ratio, where golden_ratio = (sqrt(5) - 1)/2.
|
||||
**
|
||||
** Only bits 0xdf for ASCII and bits 0xbf for EBCDIC each octet are
|
||||
** hashed since the omitted bits determine the upper/lower case difference.
|
||||
*/
|
||||
#ifdef SQLITE_EBCDIC
|
||||
h += 0xbf & (unsigned char)*(z++);
|
||||
#else
|
||||
h += 0xdf & (unsigned char)*(z++);
|
||||
#endif
|
||||
h *= 0x9e3779b1;
|
||||
}
|
||||
return h;
|
||||
@@ -132,9 +139,8 @@ static int rehash(Hash *pH, unsigned int new_size){
|
||||
pH->htsize = new_size = sqlite3MallocSize(new_ht)/sizeof(struct _ht);
|
||||
memset(new_ht, 0, new_size*sizeof(struct _ht));
|
||||
for(elem=pH->first, pH->first=0; elem; elem = next_elem){
|
||||
unsigned int h = strHash(elem->pKey) % new_size;
|
||||
next_elem = elem->next;
|
||||
insertElement(pH, &new_ht[h], elem);
|
||||
insertElement(pH, &new_ht[elem->h % new_size], elem);
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -152,23 +158,22 @@ static HashElem *findElementWithHash(
|
||||
HashElem *elem; /* Used to loop thru the element list */
|
||||
unsigned int count; /* Number of elements left to test */
|
||||
unsigned int h; /* The computed hash */
|
||||
static HashElem nullElement = { 0, 0, 0, 0 };
|
||||
static HashElem nullElement = { 0, 0, 0, 0, 0 };
|
||||
|
||||
h = strHash(pKey);
|
||||
if( pH->ht ){ /*OPTIMIZATION-IF-TRUE*/
|
||||
struct _ht *pEntry;
|
||||
h = strHash(pKey) % pH->htsize;
|
||||
pEntry = &pH->ht[h];
|
||||
pEntry = &pH->ht[h % pH->htsize];
|
||||
elem = pEntry->chain;
|
||||
count = pEntry->count;
|
||||
}else{
|
||||
h = 0;
|
||||
elem = pH->first;
|
||||
count = pH->count;
|
||||
}
|
||||
if( pHash ) *pHash = h;
|
||||
while( count ){
|
||||
assert( elem!=0 );
|
||||
if( sqlite3StrICmp(elem->pKey,pKey)==0 ){
|
||||
if( h==elem->h && sqlite3StrICmp(elem->pKey,pKey)==0 ){
|
||||
return elem;
|
||||
}
|
||||
elem = elem->next;
|
||||
@@ -180,10 +185,9 @@ static HashElem *findElementWithHash(
|
||||
/* Remove a single entry from the hash table given a pointer to that
|
||||
** element and a hash on the element's key.
|
||||
*/
|
||||
static void removeElementGivenHash(
|
||||
static void removeElement(
|
||||
Hash *pH, /* The pH containing "elem" */
|
||||
HashElem* elem, /* The element to be removed from the pH */
|
||||
unsigned int h /* Hash value for the element */
|
||||
HashElem *elem /* The element to be removed from the pH */
|
||||
){
|
||||
struct _ht *pEntry;
|
||||
if( elem->prev ){
|
||||
@@ -195,7 +199,7 @@ static void removeElementGivenHash(
|
||||
elem->next->prev = elem->prev;
|
||||
}
|
||||
if( pH->ht ){
|
||||
pEntry = &pH->ht[h];
|
||||
pEntry = &pH->ht[elem->h % pH->htsize];
|
||||
if( pEntry->chain==elem ){
|
||||
pEntry->chain = elem->next;
|
||||
}
|
||||
@@ -246,7 +250,7 @@ void *sqlite3HashInsert(Hash *pH, const char *pKey, void *data){
|
||||
if( elem->data ){
|
||||
void *old_data = elem->data;
|
||||
if( data==0 ){
|
||||
removeElementGivenHash(pH,elem,h);
|
||||
removeElement(pH,elem);
|
||||
}else{
|
||||
elem->data = data;
|
||||
elem->pKey = pKey;
|
||||
@@ -257,14 +261,12 @@ void *sqlite3HashInsert(Hash *pH, const char *pKey, void *data){
|
||||
new_elem = (HashElem*)sqlite3Malloc( sizeof(HashElem) );
|
||||
if( new_elem==0 ) return data;
|
||||
new_elem->pKey = pKey;
|
||||
new_elem->h = h;
|
||||
new_elem->data = data;
|
||||
pH->count++;
|
||||
if( pH->count>=10 && pH->count > 2*pH->htsize ){
|
||||
if( rehash(pH, pH->count*2) ){
|
||||
assert( pH->htsize>0 );
|
||||
h = strHash(pKey) % pH->htsize;
|
||||
}
|
||||
if( pH->count>=5 && pH->count > 2*pH->htsize ){
|
||||
rehash(pH, pH->count*3);
|
||||
}
|
||||
insertElement(pH, pH->ht ? &pH->ht[h] : 0, new_elem);
|
||||
insertElement(pH, pH->ht ? &pH->ht[new_elem->h % pH->htsize] : 0, new_elem);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -60,6 +60,7 @@ struct HashElem {
|
||||
HashElem *next, *prev; /* Next and previous elements in the table */
|
||||
void *data; /* Data associated with this element */
|
||||
const char *pKey; /* Key associated with this element */
|
||||
unsigned int h; /* hash for pKey */
|
||||
};
|
||||
|
||||
/*
|
||||
|
||||
+16
-22
@@ -1075,28 +1075,22 @@ void sqlite3Insert(
|
||||
aTabColMap = sqlite3DbMallocZero(db, pTab->nCol*sizeof(int));
|
||||
if( aTabColMap==0 ) goto insert_cleanup;
|
||||
for(i=0; i<pColumn->nId; i++){
|
||||
const char *zCName = pColumn->a[i].zName;
|
||||
u8 hName = sqlite3StrIHash(zCName);
|
||||
for(j=0; j<pTab->nCol; j++){
|
||||
if( pTab->aCol[j].hName!=hName ) continue;
|
||||
if( sqlite3StrICmp(zCName, pTab->aCol[j].zCnName)==0 ){
|
||||
if( aTabColMap[j]==0 ) aTabColMap[j] = i+1;
|
||||
if( i!=j ) bIdListInOrder = 0;
|
||||
if( j==pTab->iPKey ){
|
||||
ipkColumn = i; assert( !withoutRowid );
|
||||
}
|
||||
#ifndef SQLITE_OMIT_GENERATED_COLUMNS
|
||||
if( pTab->aCol[j].colFlags & (COLFLAG_STORED|COLFLAG_VIRTUAL) ){
|
||||
sqlite3ErrorMsg(pParse,
|
||||
"cannot INSERT into generated column \"%s\"",
|
||||
pTab->aCol[j].zCnName);
|
||||
goto insert_cleanup;
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
j = sqlite3ColumnIndex(pTab, pColumn->a[i].zName);
|
||||
if( j>=0 ){
|
||||
if( aTabColMap[j]==0 ) aTabColMap[j] = i+1;
|
||||
if( i!=j ) bIdListInOrder = 0;
|
||||
if( j==pTab->iPKey ){
|
||||
ipkColumn = i; assert( !withoutRowid );
|
||||
}
|
||||
}
|
||||
if( j>=pTab->nCol ){
|
||||
#ifndef SQLITE_OMIT_GENERATED_COLUMNS
|
||||
if( pTab->aCol[j].colFlags & (COLFLAG_STORED|COLFLAG_VIRTUAL) ){
|
||||
sqlite3ErrorMsg(pParse,
|
||||
"cannot INSERT into generated column \"%s\"",
|
||||
pTab->aCol[j].zCnName);
|
||||
goto insert_cleanup;
|
||||
}
|
||||
#endif
|
||||
}else{
|
||||
if( sqlite3IsRowid(pColumn->a[i].zName) && !withoutRowid ){
|
||||
ipkColumn = i;
|
||||
bIdListInOrder = 0;
|
||||
@@ -1394,7 +1388,7 @@ void sqlite3Insert(
|
||||
continue;
|
||||
}else if( pColumn==0 ){
|
||||
/* Hidden columns that are not explicitly named in the INSERT
|
||||
** get there default value */
|
||||
** get their default value */
|
||||
sqlite3ExprCodeFactorable(pParse,
|
||||
sqlite3ColumnExpr(pTab, &pTab->aCol[i]),
|
||||
iRegStore);
|
||||
|
||||
+9
-9
@@ -2054,10 +2054,7 @@ static u32 jsonbPayloadSize(const JsonParse *pParse, u32 i, u32 *pSz){
|
||||
u8 x;
|
||||
u32 sz;
|
||||
u32 n;
|
||||
if( NEVER(i>pParse->nBlob) ){
|
||||
*pSz = 0;
|
||||
return 0;
|
||||
}
|
||||
assert( i<=pParse->nBlob );
|
||||
x = pParse->aBlob[i]>>4;
|
||||
if( x<=11 ){
|
||||
sz = x;
|
||||
@@ -2101,8 +2098,8 @@ static u32 jsonbPayloadSize(const JsonParse *pParse, u32 i, u32 *pSz){
|
||||
if( (i64)i+sz+n > pParse->nBlob
|
||||
&& (i64)i+sz+n > pParse->nBlob-pParse->delta
|
||||
){
|
||||
sz = 0;
|
||||
n = 0;
|
||||
*pSz = 0;
|
||||
return 0;
|
||||
}
|
||||
*pSz = sz;
|
||||
return n;
|
||||
@@ -2199,9 +2196,12 @@ static u32 jsonTranslateBlobToText(
|
||||
}
|
||||
case JSONB_TEXT:
|
||||
case JSONB_TEXTJ: {
|
||||
jsonAppendChar(pOut, '"');
|
||||
jsonAppendRaw(pOut, (const char*)&pParse->aBlob[i+n], sz);
|
||||
jsonAppendChar(pOut, '"');
|
||||
if( pOut->nUsed+sz+2<=pOut->nAlloc || jsonStringGrow(pOut, sz+2)==0 ){
|
||||
pOut->zBuf[pOut->nUsed] = '"';
|
||||
memcpy(pOut->zBuf+pOut->nUsed+1,(const char*)&pParse->aBlob[i+n],sz);
|
||||
pOut->zBuf[pOut->nUsed+sz+1] = '"';
|
||||
pOut->nUsed += sz+2;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSONB_TEXT5: {
|
||||
|
||||
+6
-11
@@ -767,7 +767,7 @@ int sqlite3_config(int op, ...){
|
||||
static int setupLookaside(sqlite3 *db, void *pBuf, int sz, int cnt){
|
||||
#ifndef SQLITE_OMIT_LOOKASIDE
|
||||
void *pStart;
|
||||
sqlite3_int64 szAlloc;
|
||||
sqlite3_int64 szAlloc = sz*(sqlite3_int64)cnt;
|
||||
int nBig; /* Number of full-size slots */
|
||||
int nSm; /* Number smaller LOOKASIDE_SMALL-byte slots */
|
||||
|
||||
@@ -786,9 +786,7 @@ static int setupLookaside(sqlite3 *db, void *pBuf, int sz, int cnt){
|
||||
*/
|
||||
sz = ROUNDDOWN8(sz); /* IMP: R-33038-09382 */
|
||||
if( sz<=(int)sizeof(LookasideSlot*) ) sz = 0;
|
||||
if( sz>65528 ) sz = 65528;
|
||||
if( cnt<0 ) cnt = 0;
|
||||
szAlloc = (i64)sz*(i64)cnt;
|
||||
if( sz==0 || cnt==0 ){
|
||||
sz = 0;
|
||||
pStart = 0;
|
||||
@@ -803,10 +801,10 @@ static int setupLookaside(sqlite3 *db, void *pBuf, int sz, int cnt){
|
||||
#ifndef SQLITE_OMIT_TWOSIZE_LOOKASIDE
|
||||
if( sz>=LOOKASIDE_SMALL*3 ){
|
||||
nBig = szAlloc/(3*LOOKASIDE_SMALL+sz);
|
||||
nSm = (szAlloc - (i64)sz*(i64)nBig)/LOOKASIDE_SMALL;
|
||||
nSm = (szAlloc - sz*nBig)/LOOKASIDE_SMALL;
|
||||
}else if( sz>=LOOKASIDE_SMALL*2 ){
|
||||
nBig = szAlloc/(LOOKASIDE_SMALL+sz);
|
||||
nSm = (szAlloc - (i64)sz*(i64)nBig)/LOOKASIDE_SMALL;
|
||||
nSm = (szAlloc - sz*nBig)/LOOKASIDE_SMALL;
|
||||
}else
|
||||
#endif /* SQLITE_OMIT_TWOSIZE_LOOKASIDE */
|
||||
if( sz>0 ){
|
||||
@@ -3945,13 +3943,10 @@ int sqlite3_table_column_metadata(
|
||||
if( zColumnName==0 ){
|
||||
/* Query for existence of table only */
|
||||
}else{
|
||||
for(iCol=0; iCol<pTab->nCol; iCol++){
|
||||
iCol = sqlite3ColumnIndex(pTab, zColumnName);
|
||||
if( iCol>=0 ){
|
||||
pCol = &pTab->aCol[iCol];
|
||||
if( 0==sqlite3StrICmp(pCol->zCnName, zColumnName) ){
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( iCol==pTab->nCol ){
|
||||
}else{
|
||||
if( HasRowid(pTab) && sqlite3IsRowid(zColumnName) ){
|
||||
iCol = pTab->iPKey;
|
||||
pCol = iCol>=0 ? &pTab->aCol[iCol] : 0;
|
||||
|
||||
+19
-4
@@ -62,6 +62,11 @@
|
||||
%include {
|
||||
#include "sqliteInt.h"
|
||||
|
||||
/*
|
||||
** Verify that the pParse->isCreate field is set
|
||||
*/
|
||||
#define ASSERT_IS_CREATE assert(pParse->isCreate)
|
||||
|
||||
/*
|
||||
** Disable all error recovery processing in the parser push-down
|
||||
** automaton.
|
||||
@@ -125,6 +130,10 @@ static void parserSyntaxError(Parse *pParse, Token *p){
|
||||
static void disableLookaside(Parse *pParse){
|
||||
sqlite3 *db = pParse->db;
|
||||
pParse->disableLookaside++;
|
||||
#ifdef SQLITE_DEBUG
|
||||
pParse->isCreate = 1;
|
||||
#endif
|
||||
memset(&pParse->u1.cr, 0, sizeof(pParse->u1.cr));
|
||||
DisableLookaside;
|
||||
}
|
||||
|
||||
@@ -197,7 +206,9 @@ cmd ::= create_table create_table_args.
|
||||
create_table ::= createkw temp(T) TABLE ifnotexists(E) nm(Y) dbnm(Z). {
|
||||
sqlite3StartTable(pParse,&Y,&Z,T,0,0,E);
|
||||
}
|
||||
createkw(A) ::= CREATE(A). {disableLookaside(pParse);}
|
||||
createkw(A) ::= CREATE(A). {
|
||||
disableLookaside(pParse);
|
||||
}
|
||||
|
||||
%type ifnotexists {int}
|
||||
ifnotexists(A) ::= . {A = 0;}
|
||||
@@ -373,7 +384,7 @@ scantok(A) ::= . {
|
||||
//
|
||||
carglist ::= carglist ccons.
|
||||
carglist ::= .
|
||||
ccons ::= CONSTRAINT nm(X). {pParse->constraintName = X;}
|
||||
ccons ::= CONSTRAINT nm(X). {ASSERT_IS_CREATE; pParse->u1.cr.constraintName = X;}
|
||||
ccons ::= DEFAULT scantok(A) term(X).
|
||||
{sqlite3AddDefaultValue(pParse,X,A.z,&A.z[A.n]);}
|
||||
ccons ::= DEFAULT LP(A) expr(X) RP(Z).
|
||||
@@ -448,9 +459,9 @@ conslist_opt(A) ::= . {A.n = 0; A.z = 0;}
|
||||
conslist_opt(A) ::= COMMA(A) conslist.
|
||||
conslist ::= conslist tconscomma tcons.
|
||||
conslist ::= tcons.
|
||||
tconscomma ::= COMMA. {pParse->constraintName.n = 0;}
|
||||
tconscomma ::= COMMA. {ASSERT_IS_CREATE; pParse->u1.cr.constraintName.n = 0;}
|
||||
tconscomma ::= .
|
||||
tcons ::= CONSTRAINT nm(X). {pParse->constraintName = X;}
|
||||
tcons ::= CONSTRAINT nm(X). {ASSERT_IS_CREATE; pParse->u1.cr.constraintName = X;}
|
||||
tcons ::= PRIMARY KEY LP sortlist(X) autoinc(I) RP onconf(R).
|
||||
{sqlite3AddPrimaryKey(pParse,X,R,I,0);}
|
||||
tcons ::= UNIQUE LP sortlist(X) RP onconf(R).
|
||||
@@ -1659,6 +1670,10 @@ trigger_decl(A) ::= temp(T) TRIGGER ifnotexists(NOERR) nm(B) dbnm(Z)
|
||||
ON fullname(E) foreach_clause when_clause(G). {
|
||||
sqlite3BeginTrigger(pParse, &B, &Z, C, D.a, D.b, E, G, T, NOERR);
|
||||
A = (Z.n==0?B:Z); /*A-overwrites-T*/
|
||||
#ifdef SQLITE_DEBUG
|
||||
assert( pParse->isCreate ); /* Set by createkw reduce action */
|
||||
pParse->isCreate = 0; /* But, should not be set for CREATE TRIGGER */
|
||||
#endif
|
||||
}
|
||||
|
||||
%type trigger_time {int}
|
||||
|
||||
+44
-44
@@ -83,48 +83,48 @@ static const char *const pragCName[] = {
|
||||
/* 13 */ "pk",
|
||||
/* 14 */ "hidden",
|
||||
/* table_info reuses 8 */
|
||||
/* 15 */ "name", /* Used by: function_list */
|
||||
/* 16 */ "builtin",
|
||||
/* 15 */ "schema", /* Used by: table_list */
|
||||
/* 16 */ "name",
|
||||
/* 17 */ "type",
|
||||
/* 18 */ "enc",
|
||||
/* 19 */ "narg",
|
||||
/* 20 */ "flags",
|
||||
/* 21 */ "schema", /* Used by: table_list */
|
||||
/* 22 */ "name",
|
||||
/* 23 */ "type",
|
||||
/* 24 */ "ncol",
|
||||
/* 25 */ "wr",
|
||||
/* 26 */ "strict",
|
||||
/* 27 */ "seqno", /* Used by: index_xinfo */
|
||||
/* 28 */ "cid",
|
||||
/* 29 */ "name",
|
||||
/* 30 */ "desc",
|
||||
/* 31 */ "coll",
|
||||
/* 32 */ "key",
|
||||
/* 33 */ "seq", /* Used by: index_list */
|
||||
/* 34 */ "name",
|
||||
/* 35 */ "unique",
|
||||
/* 36 */ "origin",
|
||||
/* 37 */ "partial",
|
||||
/* 38 */ "tbl", /* Used by: stats */
|
||||
/* 39 */ "idx",
|
||||
/* 40 */ "wdth",
|
||||
/* 41 */ "hght",
|
||||
/* 42 */ "flgs",
|
||||
/* 18 */ "ncol",
|
||||
/* 19 */ "wr",
|
||||
/* 20 */ "strict",
|
||||
/* 21 */ "seqno", /* Used by: index_xinfo */
|
||||
/* 22 */ "cid",
|
||||
/* 23 */ "name",
|
||||
/* 24 */ "desc",
|
||||
/* 25 */ "coll",
|
||||
/* 26 */ "key",
|
||||
/* 27 */ "name", /* Used by: function_list */
|
||||
/* 28 */ "builtin",
|
||||
/* 29 */ "type",
|
||||
/* 30 */ "enc",
|
||||
/* 31 */ "narg",
|
||||
/* 32 */ "flags",
|
||||
/* 33 */ "tbl", /* Used by: stats */
|
||||
/* 34 */ "idx",
|
||||
/* 35 */ "wdth",
|
||||
/* 36 */ "hght",
|
||||
/* 37 */ "flgs",
|
||||
/* 38 */ "seq", /* Used by: index_list */
|
||||
/* 39 */ "name",
|
||||
/* 40 */ "unique",
|
||||
/* 41 */ "origin",
|
||||
/* 42 */ "partial",
|
||||
/* 43 */ "table", /* Used by: foreign_key_check */
|
||||
/* 44 */ "rowid",
|
||||
/* 45 */ "parent",
|
||||
/* 46 */ "fkid",
|
||||
/* 47 */ "busy", /* Used by: wal_checkpoint */
|
||||
/* 48 */ "log",
|
||||
/* 49 */ "checkpointed",
|
||||
/* 50 */ "seq", /* Used by: database_list */
|
||||
/* 51 */ "name",
|
||||
/* 52 */ "file",
|
||||
/* index_info reuses 27 */
|
||||
/* index_info reuses 21 */
|
||||
/* 47 */ "seq", /* Used by: database_list */
|
||||
/* 48 */ "name",
|
||||
/* 49 */ "file",
|
||||
/* 50 */ "busy", /* Used by: wal_checkpoint */
|
||||
/* 51 */ "log",
|
||||
/* 52 */ "checkpointed",
|
||||
/* collation_list reuses 38 */
|
||||
/* 53 */ "database", /* Used by: lock_status */
|
||||
/* 54 */ "status",
|
||||
/* collation_list reuses 33 */
|
||||
/* 55 */ "cache_size", /* Used by: default_cache_size */
|
||||
/* module_list pragma_list reuses 9 */
|
||||
/* 56 */ "timeout", /* Used by: busy_timeout */
|
||||
@@ -217,7 +217,7 @@ static const PragmaName aPragmaName[] = {
|
||||
{/* zName: */ "collation_list",
|
||||
/* ePragTyp: */ PragTyp_COLLATION_LIST,
|
||||
/* ePragFlg: */ PragFlg_Result0,
|
||||
/* ColNames: */ 33, 2,
|
||||
/* ColNames: */ 38, 2,
|
||||
/* iArg: */ 0 },
|
||||
#endif
|
||||
#if !defined(SQLITE_OMIT_COMPILEOPTION_DIAGS)
|
||||
@@ -252,7 +252,7 @@ static const PragmaName aPragmaName[] = {
|
||||
{/* zName: */ "database_list",
|
||||
/* ePragTyp: */ PragTyp_DATABASE_LIST,
|
||||
/* ePragFlg: */ PragFlg_Result0,
|
||||
/* ColNames: */ 50, 3,
|
||||
/* ColNames: */ 47, 3,
|
||||
/* iArg: */ 0 },
|
||||
#endif
|
||||
#if !defined(SQLITE_OMIT_PAGER_PRAGMAS) && !defined(SQLITE_OMIT_DEPRECATED)
|
||||
@@ -332,7 +332,7 @@ static const PragmaName aPragmaName[] = {
|
||||
{/* zName: */ "function_list",
|
||||
/* ePragTyp: */ PragTyp_FUNCTION_LIST,
|
||||
/* ePragFlg: */ PragFlg_Result0,
|
||||
/* ColNames: */ 15, 6,
|
||||
/* ColNames: */ 27, 6,
|
||||
/* iArg: */ 0 },
|
||||
#endif
|
||||
#endif
|
||||
@@ -361,17 +361,17 @@ static const PragmaName aPragmaName[] = {
|
||||
{/* zName: */ "index_info",
|
||||
/* ePragTyp: */ PragTyp_INDEX_INFO,
|
||||
/* ePragFlg: */ PragFlg_NeedSchema|PragFlg_Result1|PragFlg_SchemaOpt,
|
||||
/* ColNames: */ 27, 3,
|
||||
/* ColNames: */ 21, 3,
|
||||
/* iArg: */ 0 },
|
||||
{/* zName: */ "index_list",
|
||||
/* ePragTyp: */ PragTyp_INDEX_LIST,
|
||||
/* ePragFlg: */ PragFlg_NeedSchema|PragFlg_Result1|PragFlg_SchemaOpt,
|
||||
/* ColNames: */ 33, 5,
|
||||
/* ColNames: */ 38, 5,
|
||||
/* iArg: */ 0 },
|
||||
{/* zName: */ "index_xinfo",
|
||||
/* ePragTyp: */ PragTyp_INDEX_INFO,
|
||||
/* ePragFlg: */ PragFlg_NeedSchema|PragFlg_Result1|PragFlg_SchemaOpt,
|
||||
/* ColNames: */ 27, 6,
|
||||
/* ColNames: */ 21, 6,
|
||||
/* iArg: */ 1 },
|
||||
#endif
|
||||
#if !defined(SQLITE_OMIT_INTEGRITY_CHECK)
|
||||
@@ -550,7 +550,7 @@ static const PragmaName aPragmaName[] = {
|
||||
{/* zName: */ "stats",
|
||||
/* ePragTyp: */ PragTyp_STATS,
|
||||
/* ePragFlg: */ PragFlg_NeedSchema|PragFlg_Result0|PragFlg_SchemaReq,
|
||||
/* ColNames: */ 38, 5,
|
||||
/* ColNames: */ 33, 5,
|
||||
/* iArg: */ 0 },
|
||||
#endif
|
||||
#if !defined(SQLITE_OMIT_PAGER_PRAGMAS)
|
||||
@@ -569,7 +569,7 @@ static const PragmaName aPragmaName[] = {
|
||||
{/* zName: */ "table_list",
|
||||
/* ePragTyp: */ PragTyp_TABLE_LIST,
|
||||
/* ePragFlg: */ PragFlg_NeedSchema|PragFlg_Result1,
|
||||
/* ColNames: */ 21, 6,
|
||||
/* ColNames: */ 15, 6,
|
||||
/* iArg: */ 0 },
|
||||
{/* zName: */ "table_xinfo",
|
||||
/* ePragTyp: */ PragTyp_TABLE_INFO,
|
||||
@@ -646,7 +646,7 @@ static const PragmaName aPragmaName[] = {
|
||||
{/* zName: */ "wal_checkpoint",
|
||||
/* ePragTyp: */ PragTyp_WAL_CHECKPOINT,
|
||||
/* ePragFlg: */ PragFlg_NeedSchema,
|
||||
/* ColNames: */ 47, 3,
|
||||
/* ColNames: */ 50, 3,
|
||||
/* iArg: */ 0 },
|
||||
#endif
|
||||
#if !defined(SQLITE_OMIT_FLAG_PRAGMAS)
|
||||
|
||||
+39
-51
@@ -294,7 +294,6 @@ static int lookupName(
|
||||
Schema *pSchema = 0; /* Schema of the expression */
|
||||
int eNewExprOp = TK_COLUMN; /* New value for pExpr->op on success */
|
||||
Table *pTab = 0; /* Table holding the row */
|
||||
Column *pCol; /* A column of pTab */
|
||||
ExprList *pFJMatch = 0; /* Matches for FULL JOIN .. USING */
|
||||
const char *zCol = pRight->u.zToken;
|
||||
|
||||
@@ -345,7 +344,6 @@ static int lookupName(
|
||||
|
||||
if( pSrcList ){
|
||||
for(i=0, pItem=pSrcList->a; i<pSrcList->nSrc; i++, pItem++){
|
||||
u8 hCol;
|
||||
pTab = pItem->pSTab;
|
||||
assert( pTab!=0 && pTab->zName!=0 );
|
||||
assert( pTab->nCol>0 || pParse->nErr );
|
||||
@@ -433,43 +431,38 @@ static int lookupName(
|
||||
sqlite3RenameTokenRemap(pParse, 0, (void*)&pExpr->y.pTab);
|
||||
}
|
||||
}
|
||||
hCol = sqlite3StrIHash(zCol);
|
||||
for(j=0, pCol=pTab->aCol; j<pTab->nCol; j++, pCol++){
|
||||
if( pCol->hName==hCol
|
||||
&& sqlite3StrICmp(pCol->zCnName, zCol)==0
|
||||
){
|
||||
if( cnt>0 ){
|
||||
if( pItem->fg.isUsing==0
|
||||
|| sqlite3IdListIndex(pItem->u3.pUsing, zCol)<0
|
||||
){
|
||||
/* Two or more tables have the same column name which is
|
||||
** not joined by USING. This is an error. Signal as much
|
||||
** by clearing pFJMatch and letting cnt go above 1. */
|
||||
sqlite3ExprListDelete(db, pFJMatch);
|
||||
pFJMatch = 0;
|
||||
}else
|
||||
if( (pItem->fg.jointype & JT_RIGHT)==0 ){
|
||||
/* An INNER or LEFT JOIN. Use the left-most table */
|
||||
continue;
|
||||
}else
|
||||
if( (pItem->fg.jointype & JT_LEFT)==0 ){
|
||||
/* A RIGHT JOIN. Use the right-most table */
|
||||
cnt = 0;
|
||||
sqlite3ExprListDelete(db, pFJMatch);
|
||||
pFJMatch = 0;
|
||||
}else{
|
||||
/* For a FULL JOIN, we must construct a coalesce() func */
|
||||
extendFJMatch(pParse, &pFJMatch, pMatch, pExpr->iColumn);
|
||||
}
|
||||
j = sqlite3ColumnIndex(pTab, zCol);
|
||||
if( j>=0 ){
|
||||
if( cnt>0 ){
|
||||
if( pItem->fg.isUsing==0
|
||||
|| sqlite3IdListIndex(pItem->u3.pUsing, zCol)<0
|
||||
){
|
||||
/* Two or more tables have the same column name which is
|
||||
** not joined by USING. This is an error. Signal as much
|
||||
** by clearing pFJMatch and letting cnt go above 1. */
|
||||
sqlite3ExprListDelete(db, pFJMatch);
|
||||
pFJMatch = 0;
|
||||
}else
|
||||
if( (pItem->fg.jointype & JT_RIGHT)==0 ){
|
||||
/* An INNER or LEFT JOIN. Use the left-most table */
|
||||
continue;
|
||||
}else
|
||||
if( (pItem->fg.jointype & JT_LEFT)==0 ){
|
||||
/* A RIGHT JOIN. Use the right-most table */
|
||||
cnt = 0;
|
||||
sqlite3ExprListDelete(db, pFJMatch);
|
||||
pFJMatch = 0;
|
||||
}else{
|
||||
/* For a FULL JOIN, we must construct a coalesce() func */
|
||||
extendFJMatch(pParse, &pFJMatch, pMatch, pExpr->iColumn);
|
||||
}
|
||||
cnt++;
|
||||
pMatch = pItem;
|
||||
/* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */
|
||||
pExpr->iColumn = j==pTab->iPKey ? -1 : (i16)j;
|
||||
if( pItem->fg.isNestedFrom ){
|
||||
sqlite3SrcItemColumnUsed(pItem, j);
|
||||
}
|
||||
break;
|
||||
}
|
||||
cnt++;
|
||||
pMatch = pItem;
|
||||
/* Substitute the rowid (column -1) for the INTEGER PRIMARY KEY */
|
||||
pExpr->iColumn = j==pTab->iPKey ? -1 : (i16)j;
|
||||
if( pItem->fg.isNestedFrom ){
|
||||
sqlite3SrcItemColumnUsed(pItem, j);
|
||||
}
|
||||
}
|
||||
if( 0==cnt && VisibleRowid(pTab) ){
|
||||
@@ -559,23 +552,18 @@ static int lookupName(
|
||||
|
||||
if( pTab ){
|
||||
int iCol;
|
||||
u8 hCol = sqlite3StrIHash(zCol);
|
||||
pSchema = pTab->pSchema;
|
||||
cntTab++;
|
||||
for(iCol=0, pCol=pTab->aCol; iCol<pTab->nCol; iCol++, pCol++){
|
||||
if( pCol->hName==hCol
|
||||
&& sqlite3StrICmp(pCol->zCnName, zCol)==0
|
||||
){
|
||||
if( iCol==pTab->iPKey ){
|
||||
iCol = -1;
|
||||
}
|
||||
break;
|
||||
iCol = sqlite3ColumnIndex(pTab, zCol);
|
||||
if( iCol>=0 ){
|
||||
if( pTab->iPKey==iCol ) iCol = -1;
|
||||
}else{
|
||||
if( sqlite3IsRowid(zCol) && VisibleRowid(pTab) ){
|
||||
iCol = -1;
|
||||
}else{
|
||||
iCol = pTab->nCol;
|
||||
}
|
||||
}
|
||||
if( iCol>=pTab->nCol && sqlite3IsRowid(zCol) && VisibleRowid(pTab) ){
|
||||
/* IMP: R-51414-32910 */
|
||||
iCol = -1;
|
||||
}
|
||||
if( iCol<pTab->nCol ){
|
||||
cnt++;
|
||||
pMatch = 0;
|
||||
|
||||
+28
-11
@@ -319,10 +319,33 @@ int sqlite3JoinType(Parse *pParse, Token *pA, Token *pB, Token *pC){
|
||||
*/
|
||||
int sqlite3ColumnIndex(Table *pTab, const char *zCol){
|
||||
int i;
|
||||
u8 h = sqlite3StrIHash(zCol);
|
||||
Column *pCol;
|
||||
for(pCol=pTab->aCol, i=0; i<pTab->nCol; pCol++, i++){
|
||||
if( pCol->hName==h && sqlite3StrICmp(pCol->zCnName, zCol)==0 ) return i;
|
||||
u8 h;
|
||||
const Column *aCol;
|
||||
int nCol;
|
||||
|
||||
h = sqlite3StrIHash(zCol);
|
||||
aCol = pTab->aCol;
|
||||
nCol = pTab->nCol;
|
||||
|
||||
/* See if the aHx gives us a lucky match */
|
||||
i = pTab->aHx[h % sizeof(pTab->aHx)];
|
||||
assert( i<nCol );
|
||||
if( aCol[i].hName==h
|
||||
&& sqlite3StrICmp(aCol[i].zCnName, zCol)==0
|
||||
){
|
||||
return i;
|
||||
}
|
||||
|
||||
/* No lucky match from the hash table. Do a full search. */
|
||||
i = 0;
|
||||
while( 1 /*exit-by-break*/ ){
|
||||
if( aCol[i].hName==h
|
||||
&& sqlite3StrICmp(aCol[i].zCnName, zCol)==0
|
||||
){
|
||||
return i;
|
||||
}
|
||||
i++;
|
||||
if( i>=nCol ) break;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
@@ -3224,7 +3247,6 @@ static int multiSelect(
|
||||
multi_select_end:
|
||||
pDest->iSdst = dest.iSdst;
|
||||
pDest->nSdst = dest.nSdst;
|
||||
pDest->iSDParm2 = dest.iSDParm2;
|
||||
if( pDelete ){
|
||||
sqlite3ParserAddCleanup(pParse, sqlite3SelectDeleteGeneric, pDelete);
|
||||
}
|
||||
@@ -7179,7 +7201,6 @@ static void agginfoFree(sqlite3 *db, void *pArg){
|
||||
** * There is no WHERE or GROUP BY or HAVING clauses on the subqueries
|
||||
** * The outer query is a simple count(*) with no WHERE clause or other
|
||||
** extraneous syntax.
|
||||
** * None of the subqueries are DISTINCT (forumpost/a860f5fb2e 2025-03-10)
|
||||
**
|
||||
** Return TRUE if the optimization is undertaken.
|
||||
*/
|
||||
@@ -7212,11 +7233,7 @@ static int countOfViewOptimization(Parse *pParse, Select *p){
|
||||
if( pSub->op!=TK_ALL && pSub->pPrior ) return 0; /* Must be UNION ALL */
|
||||
if( pSub->pWhere ) return 0; /* No WHERE clause */
|
||||
if( pSub->pLimit ) return 0; /* No LIMIT clause */
|
||||
if( pSub->selFlags & (SF_Aggregate|SF_Distinct) ){
|
||||
testcase( pSub->selFlags & SF_Aggregate );
|
||||
testcase( pSub->selFlags & SF_Distinct );
|
||||
return 0; /* Not an aggregate nor DISTINCT */
|
||||
}
|
||||
if( pSub->selFlags & SF_Aggregate ) return 0; /* Not an aggregate */
|
||||
assert( pSub->pHaving==0 ); /* Due to the previous */
|
||||
pSub = pSub->pPrior; /* Repeat over compound */
|
||||
}while( pSub );
|
||||
|
||||
+31
-20
@@ -843,6 +843,11 @@ typedef INT16_TYPE i16; /* 2-byte signed integer */
|
||||
typedef UINT8_TYPE u8; /* 1-byte unsigned integer */
|
||||
typedef INT8_TYPE i8; /* 1-byte signed integer */
|
||||
|
||||
/* A bitfield type for use inside of structures. Always follow with :N where
|
||||
** N is the number of bits.
|
||||
*/
|
||||
typedef unsigned bft; /* Bit Field Type */
|
||||
|
||||
/*
|
||||
** SQLITE_MAX_U32 is a u64 constant that is the maximum u64 value
|
||||
** that can be stored in a u32 without loss of data. The value
|
||||
@@ -2426,6 +2431,7 @@ struct Table {
|
||||
} u;
|
||||
Trigger *pTrigger; /* List of triggers on this object */
|
||||
Schema *pSchema; /* Schema that contains this table */
|
||||
u8 aHx[16]; /* Column aHt[K%sizeof(aHt)] might have hash K */
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -2757,7 +2763,6 @@ struct Index {
|
||||
unsigned bLowQual:1; /* sqlite_stat1 says this is a low-quality index */
|
||||
unsigned bNoQuery:1; /* Do not use this index to optimize queries */
|
||||
unsigned bAscKeyBug:1; /* True if the bba7b69f9849b5bf bug applies */
|
||||
unsigned bIdxRowid:1; /* One or more of the index keys is the ROWID */
|
||||
unsigned bHasVCol:1; /* Index references one or more VIRTUAL columns */
|
||||
unsigned bHasExpr:1; /* Index contains an expression, either a literal
|
||||
** expression, or a reference to a VIRTUAL column */
|
||||
@@ -3824,25 +3829,32 @@ struct Parse {
|
||||
char *zErrMsg; /* An error message */
|
||||
Vdbe *pVdbe; /* An engine for executing database bytecode */
|
||||
int rc; /* Return code from execution */
|
||||
u8 colNamesSet; /* TRUE after OP_ColumnName has been issued to pVdbe */
|
||||
u8 checkSchema; /* Causes schema cookie check after an error */
|
||||
LogEst nQueryLoop; /* Est number of iterations of a query (10*log2(N)) */
|
||||
u8 nested; /* Number of nested calls to the parser/code generator */
|
||||
u8 nTempReg; /* Number of temporary registers in aTempReg[] */
|
||||
u8 isMultiWrite; /* True if statement may modify/insert multiple rows */
|
||||
u8 mayAbort; /* True if statement may throw an ABORT exception */
|
||||
u8 hasCompound; /* Need to invoke convertCompoundSelectToSubquery() */
|
||||
u8 okConstFactor; /* OK to factor out constants */
|
||||
u8 disableLookaside; /* Number of times lookaside has been disabled */
|
||||
u8 prepFlags; /* SQLITE_PREPARE_* flags */
|
||||
u8 withinRJSubrtn; /* Nesting level for RIGHT JOIN body subroutines */
|
||||
u8 bHasWith; /* True if statement contains WITH */
|
||||
u8 mSubrtnSig; /* mini Bloom filter on available SubrtnSig.selId */
|
||||
u8 eTriggerOp; /* TK_UPDATE, TK_INSERT or TK_DELETE */
|
||||
u8 bReturning; /* Coding a RETURNING trigger */
|
||||
u8 eOrconf; /* Default ON CONFLICT policy for trigger steps */
|
||||
u8 disableTriggers; /* True to disable triggers */
|
||||
#if defined(SQLITE_DEBUG) || defined(SQLITE_COVERAGE_TEST)
|
||||
u8 earlyCleanup; /* OOM inside sqlite3ParserAddCleanup() */
|
||||
#endif
|
||||
#ifdef SQLITE_DEBUG
|
||||
u8 ifNotExists; /* Might be true if IF NOT EXISTS. Assert()s only */
|
||||
u8 isCreate; /* CREATE TABLE, INDEX, or VIEW (but not TRIGGER)
|
||||
** and ALTER TABLE ADD COLUMN. */
|
||||
#endif
|
||||
bft colNamesSet :1; /* TRUE after OP_ColumnName has been issued to pVdbe */
|
||||
bft bHasWith :1; /* True if statement contains WITH */
|
||||
bft okConstFactor :1; /* OK to factor out constants */
|
||||
bft checkSchema :1; /* Causes schema cookie check after an error */
|
||||
int nRangeReg; /* Size of the temporary register block */
|
||||
int iRangeReg; /* First register in temporary register block */
|
||||
int nErr; /* Number of errors seen */
|
||||
@@ -3857,12 +3869,9 @@ struct Parse {
|
||||
ExprList *pConstExpr;/* Constant expressions */
|
||||
IndexedExpr *pIdxEpr;/* List of expressions used by active indexes */
|
||||
IndexedExpr *pIdxPartExpr; /* Exprs constrained by index WHERE clauses */
|
||||
Token constraintName;/* Name of the constraint currently being parsed */
|
||||
yDbMask writeMask; /* Start a write transaction on these databases */
|
||||
yDbMask cookieMask; /* Bitmask of schema verified databases */
|
||||
int regRowid; /* Register holding rowid of CREATE TABLE entry */
|
||||
int regRoot; /* Register holding root page number for new objects */
|
||||
int nMaxArg; /* Max args passed to user function by sub-program */
|
||||
int nMaxArg; /* Max args to xUpdate and xFilter vtab methods */
|
||||
int nSelect; /* Number of SELECT stmts. Counter for Select.selId */
|
||||
#ifndef SQLITE_OMIT_PROGRESS_CALLBACK
|
||||
u32 nProgressSteps; /* xProgress steps taken during sqlite3_prepare() */
|
||||
@@ -3876,17 +3885,6 @@ struct Parse {
|
||||
Table *pTriggerTab; /* Table triggers are being coded for */
|
||||
TriggerPrg *pTriggerPrg; /* Linked list of coded triggers */
|
||||
ParseCleanup *pCleanup; /* List of cleanup operations to run after parse */
|
||||
union {
|
||||
int addrCrTab; /* Address of OP_CreateBtree on CREATE TABLE */
|
||||
Returning *pReturning; /* The RETURNING clause */
|
||||
} u1;
|
||||
u32 oldmask; /* Mask of old.* columns referenced */
|
||||
u32 newmask; /* Mask of new.* columns referenced */
|
||||
LogEst nQueryLoop; /* Est number of iterations of a query (10*log2(N)) */
|
||||
u8 eTriggerOp; /* TK_UPDATE, TK_INSERT or TK_DELETE */
|
||||
u8 bReturning; /* Coding a RETURNING trigger */
|
||||
u8 eOrconf; /* Default ON CONFLICT policy for trigger steps */
|
||||
u8 disableTriggers; /* True to disable triggers */
|
||||
|
||||
/**************************************************************************
|
||||
** Fields above must be initialized to zero. The fields that follow,
|
||||
@@ -3898,6 +3896,19 @@ struct Parse {
|
||||
int aTempReg[8]; /* Holding area for temporary registers */
|
||||
Parse *pOuterParse; /* Outer Parse object when nested */
|
||||
Token sNameToken; /* Token with unqualified schema object name */
|
||||
u32 oldmask; /* Mask of old.* columns referenced */
|
||||
u32 newmask; /* Mask of new.* columns referenced */
|
||||
union {
|
||||
struct { /* These fields available when isCreate is true */
|
||||
int addrCrTab; /* Address of OP_CreateBtree on CREATE TABLE */
|
||||
int regRowid; /* Register holding rowid of CREATE TABLE entry */
|
||||
int regRoot; /* Register holding root page for new objects */
|
||||
Token constraintName; /* Name of the constraint currently being parsed */
|
||||
} cr;
|
||||
struct { /* These fields available to all other statements */
|
||||
Returning *pReturning; /* The RETURNING clause */
|
||||
} d;
|
||||
} u1;
|
||||
|
||||
/************************************************************************
|
||||
** Above is constant between recursions. Below is reset before and after
|
||||
|
||||
+6
-2
@@ -70,7 +70,8 @@ Trigger *sqlite3TriggerList(Parse *pParse, Table *pTab){
|
||||
assert( pParse->db->pVtabCtx==0 );
|
||||
#endif
|
||||
assert( pParse->bReturning );
|
||||
assert( &(pParse->u1.pReturning->retTrig) == pTrig );
|
||||
assert( !pParse->isCreate );
|
||||
assert( &(pParse->u1.d.pReturning->retTrig) == pTrig );
|
||||
pTrig->table = pTab->zName;
|
||||
pTrig->pTabSchema = pTab->pSchema;
|
||||
pTrig->pNext = pList;
|
||||
@@ -1047,7 +1048,8 @@ static void codeReturningTrigger(
|
||||
return;
|
||||
}
|
||||
assert( db->pParse==pParse );
|
||||
pReturning = pParse->u1.pReturning;
|
||||
assert( !pParse->isCreate );
|
||||
pReturning = pParse->u1.d.pReturning;
|
||||
if( pTrigger != &(pReturning->retTrig) ){
|
||||
/* This RETURNING trigger is for a different statement */
|
||||
return;
|
||||
@@ -1277,6 +1279,8 @@ static TriggerPrg *codeRowTrigger(
|
||||
sSubParse.eTriggerOp = pTrigger->op;
|
||||
sSubParse.nQueryLoop = pParse->nQueryLoop;
|
||||
sSubParse.prepFlags = pParse->prepFlags;
|
||||
sSubParse.oldmask = 0;
|
||||
sSubParse.newmask = 0;
|
||||
|
||||
v = sqlite3GetVdbe(&sSubParse);
|
||||
if( v ){
|
||||
|
||||
+20
-26
@@ -465,38 +465,32 @@ void sqlite3Update(
|
||||
*/
|
||||
chngRowid = chngPk = 0;
|
||||
for(i=0; i<pChanges->nExpr; i++){
|
||||
u8 hCol = sqlite3StrIHash(pChanges->a[i].zEName);
|
||||
/* If this is an UPDATE with a FROM clause, do not resolve expressions
|
||||
** here. The call to sqlite3Select() below will do that. */
|
||||
if( nChangeFrom==0 && sqlite3ResolveExprNames(&sNC, pChanges->a[i].pExpr) ){
|
||||
goto update_cleanup;
|
||||
}
|
||||
for(j=0; j<pTab->nCol; j++){
|
||||
if( pTab->aCol[j].hName==hCol
|
||||
&& sqlite3StrICmp(pTab->aCol[j].zCnName, pChanges->a[i].zEName)==0
|
||||
){
|
||||
if( j==pTab->iPKey ){
|
||||
chngRowid = 1;
|
||||
pRowidExpr = pChanges->a[i].pExpr;
|
||||
iRowidExpr = i;
|
||||
}else if( pPk && (pTab->aCol[j].colFlags & COLFLAG_PRIMKEY)!=0 ){
|
||||
chngPk = 1;
|
||||
}
|
||||
#ifndef SQLITE_OMIT_GENERATED_COLUMNS
|
||||
else if( pTab->aCol[j].colFlags & COLFLAG_GENERATED ){
|
||||
testcase( pTab->aCol[j].colFlags & COLFLAG_VIRTUAL );
|
||||
testcase( pTab->aCol[j].colFlags & COLFLAG_STORED );
|
||||
sqlite3ErrorMsg(pParse,
|
||||
"cannot UPDATE generated column \"%s\"",
|
||||
pTab->aCol[j].zCnName);
|
||||
goto update_cleanup;
|
||||
}
|
||||
#endif
|
||||
aXRef[j] = i;
|
||||
break;
|
||||
j = sqlite3ColumnIndex(pTab, pChanges->a[i].zEName);
|
||||
if( j>=0 ){
|
||||
if( j==pTab->iPKey ){
|
||||
chngRowid = 1;
|
||||
pRowidExpr = pChanges->a[i].pExpr;
|
||||
iRowidExpr = i;
|
||||
}else if( pPk && (pTab->aCol[j].colFlags & COLFLAG_PRIMKEY)!=0 ){
|
||||
chngPk = 1;
|
||||
}
|
||||
}
|
||||
if( j>=pTab->nCol ){
|
||||
#ifndef SQLITE_OMIT_GENERATED_COLUMNS
|
||||
else if( pTab->aCol[j].colFlags & COLFLAG_GENERATED ){
|
||||
testcase( pTab->aCol[j].colFlags & COLFLAG_VIRTUAL );
|
||||
testcase( pTab->aCol[j].colFlags & COLFLAG_STORED );
|
||||
sqlite3ErrorMsg(pParse,
|
||||
"cannot UPDATE generated column \"%s\"",
|
||||
pTab->aCol[j].zCnName);
|
||||
goto update_cleanup;
|
||||
}
|
||||
#endif
|
||||
aXRef[j] = i;
|
||||
}else{
|
||||
if( pPk==0 && sqlite3IsRowid(pChanges->a[i].zEName) ){
|
||||
j = -1;
|
||||
chngRowid = 1;
|
||||
|
||||
+5
-1
@@ -1130,7 +1130,11 @@ void sqlite3FpDecode(FpDecode *p, double r, int iRound, int mxRound){
|
||||
}
|
||||
p->z = &p->zBuf[i+1];
|
||||
assert( i+p->n < sizeof(p->zBuf) );
|
||||
while( ALWAYS(p->n>0) && p->z[p->n-1]=='0' ){ p->n--; }
|
||||
assert( p->n>0 );
|
||||
while( p->z[p->n-1]=='0' ){
|
||||
p->n--;
|
||||
assert( p->n>0 );
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+27
-1
@@ -3055,6 +3055,7 @@ op_column_restart:
|
||||
goto op_column_restart;
|
||||
}
|
||||
|
||||
op_column_again:
|
||||
/* Make sure at least the first p2+1 entries of the header have been
|
||||
** parsed and valid information is in aOffset[] and pC->aType[].
|
||||
*/
|
||||
@@ -3210,6 +3211,30 @@ op_column_restart:
|
||||
}
|
||||
}
|
||||
|
||||
/* Try to save work if two or more OP_Columns against the same
|
||||
** cursor occur one right after another.
|
||||
**
|
||||
** This optimization saves CPU cycles when it applies. But it is
|
||||
** not applicable very often. So we often burn more CPU cycles
|
||||
** determining whether or not the optimization does apply than the
|
||||
** optimization actually saves, depending on the workload. Even
|
||||
** when there is a net gain, it is not that much.
|
||||
**
|
||||
** This change (and this comment) are saved for future reference.
|
||||
** But unless some further improvement is found, it does not seem
|
||||
** worth the added complexity.
|
||||
*/
|
||||
if( pOp[1].opcode==OP_Column
|
||||
&& pC==p->apCsr[pOp[1].p1]
|
||||
){
|
||||
UPDATE_MAX_BLOBSIZE(pDest);
|
||||
REGISTER_TRACE(pOp->p3, pDest);
|
||||
pOp++;
|
||||
nVmStep++;
|
||||
p2 = (u32)pOp->p2;
|
||||
goto op_column_again;
|
||||
}
|
||||
|
||||
op_column_out:
|
||||
UPDATE_MAX_BLOBSIZE(pDest);
|
||||
REGISTER_TRACE(pOp->p3, pDest);
|
||||
@@ -3705,7 +3730,6 @@ case OP_MakeRecord: {
|
||||
zHdr += sqlite3PutVarint(zHdr, serial_type);
|
||||
if( pRec->n ){
|
||||
assert( pRec->z!=0 );
|
||||
assert( pRec->z!=(const char*)sqlite3CtypeMap );
|
||||
memcpy(zPayload, pRec->z, pRec->n);
|
||||
zPayload += pRec->n;
|
||||
}
|
||||
@@ -8364,6 +8388,7 @@ case OP_VFilter: { /* jump, ncycle */
|
||||
|
||||
/* Invoke the xFilter method */
|
||||
apArg = p->apArg;
|
||||
assert( nArg<=p->napArg );
|
||||
for(i = 0; i<nArg; i++){
|
||||
apArg[i] = &pArgc[i+1];
|
||||
}
|
||||
@@ -8574,6 +8599,7 @@ case OP_VUpdate: {
|
||||
u8 vtabOnConflict = db->vtabOnConflict;
|
||||
apArg = p->apArg;
|
||||
pX = &aMem[pOp->p3];
|
||||
assert( nArg<=p->napArg );
|
||||
for(i=0; i<nArg; i++){
|
||||
assert( memIsValid(pX) );
|
||||
memAboutToChange(p, pX);
|
||||
|
||||
+2
-5
@@ -398,10 +398,6 @@ struct sqlite3_context {
|
||||
sqlite3_value *argv[1]; /* Argument set */
|
||||
};
|
||||
|
||||
/* A bitfield type for use inside of structures. Always follow with :N where
|
||||
** N is the number of bits.
|
||||
*/
|
||||
typedef unsigned bft; /* Bit Field Type */
|
||||
|
||||
/* The ScanStatus object holds a single value for the
|
||||
** sqlite3_stmt_scanstatus() interface.
|
||||
@@ -462,7 +458,7 @@ struct Vdbe {
|
||||
i64 nStmtDefCons; /* Number of def. constraints when stmt started */
|
||||
i64 nStmtDefImmCons; /* Number of def. imm constraints when stmt started */
|
||||
Mem *aMem; /* The memory locations */
|
||||
Mem **apArg; /* Arguments to currently executing user function */
|
||||
Mem **apArg; /* Arguments xUpdate and xFilter vtab methods */
|
||||
VdbeCursor **apCsr; /* One element of this array for each open cursor */
|
||||
Mem *aVar; /* Values for the OP_Variable opcode. */
|
||||
|
||||
@@ -482,6 +478,7 @@ struct Vdbe {
|
||||
#ifdef SQLITE_DEBUG
|
||||
int rcApp; /* errcode set by sqlite3_result_error_code() */
|
||||
u32 nWrite; /* Number of write operations that have occurred */
|
||||
int napArg; /* Size of the apArg[] array */
|
||||
#endif
|
||||
u16 nResColumn; /* Number of columns in one row of the result set */
|
||||
u16 nResAlloc; /* Column slots allocated to aColName[] */
|
||||
|
||||
+15
-8
@@ -856,8 +856,8 @@ void sqlite3VdbeAssertAbortable(Vdbe *p){
|
||||
** (1) For each jump instruction with a negative P2 value (a label)
|
||||
** resolve the P2 value to an actual address.
|
||||
**
|
||||
** (2) Compute the maximum number of arguments used by any SQL function
|
||||
** and store that value in *pMaxFuncArgs.
|
||||
** (2) Compute the maximum number of arguments used by the xUpdate/xFilter
|
||||
** methods of any virtual table and store that value in *pMaxVtabArgs.
|
||||
**
|
||||
** (3) Update the Vdbe.readOnly and Vdbe.bIsReader flags to accurately
|
||||
** indicate what the prepared statement actually does.
|
||||
@@ -870,8 +870,8 @@ void sqlite3VdbeAssertAbortable(Vdbe *p){
|
||||
** script numbers the opcodes correctly. Changes to this routine must be
|
||||
** coordinated with changes to mkopcodeh.tcl.
|
||||
*/
|
||||
static void resolveP2Values(Vdbe *p, int *pMaxFuncArgs){
|
||||
int nMaxArgs = *pMaxFuncArgs;
|
||||
static void resolveP2Values(Vdbe *p, int *pMaxVtabArgs){
|
||||
int nMaxVtabArgs = *pMaxVtabArgs;
|
||||
Op *pOp;
|
||||
Parse *pParse = p->pParse;
|
||||
int *aLabel = pParse->aLabel;
|
||||
@@ -916,15 +916,19 @@ static void resolveP2Values(Vdbe *p, int *pMaxFuncArgs){
|
||||
}
|
||||
#ifndef SQLITE_OMIT_VIRTUALTABLE
|
||||
case OP_VUpdate: {
|
||||
if( pOp->p2>nMaxArgs ) nMaxArgs = pOp->p2;
|
||||
if( pOp->p2>nMaxVtabArgs ) nMaxVtabArgs = pOp->p2;
|
||||
break;
|
||||
}
|
||||
case OP_VFilter: {
|
||||
int n;
|
||||
/* The instruction immediately prior to VFilter will be an
|
||||
** OP_Integer that sets the "argc" value for the VFilter. See
|
||||
** the code where OP_VFilter is generated at tag-20250207a. */
|
||||
assert( (pOp - p->aOp) >= 3 );
|
||||
assert( pOp[-1].opcode==OP_Integer );
|
||||
assert( pOp[-1].p2==pOp->p3+1 );
|
||||
n = pOp[-1].p1;
|
||||
if( n>nMaxArgs ) nMaxArgs = n;
|
||||
if( n>nMaxVtabArgs ) nMaxVtabArgs = n;
|
||||
/* Fall through into the default case */
|
||||
/* no break */ deliberate_fall_through
|
||||
}
|
||||
@@ -965,7 +969,7 @@ resolve_p2_values_loop_exit:
|
||||
pParse->aLabel = 0;
|
||||
}
|
||||
pParse->nLabel = 0;
|
||||
*pMaxFuncArgs = nMaxArgs;
|
||||
*pMaxVtabArgs = nMaxVtabArgs;
|
||||
assert( p->bIsReader!=0 || DbMaskAllZero(p->btreeMask) );
|
||||
}
|
||||
|
||||
@@ -2643,7 +2647,7 @@ void sqlite3VdbeMakeReady(
|
||||
int nVar; /* Number of parameters */
|
||||
int nMem; /* Number of VM memory registers */
|
||||
int nCursor; /* Number of cursors required */
|
||||
int nArg; /* Number of arguments in subprograms */
|
||||
int nArg; /* Max number args to xFilter or xUpdate */
|
||||
int n; /* Loop counter */
|
||||
struct ReusableSpace x; /* Reusable bulk memory */
|
||||
|
||||
@@ -2715,6 +2719,9 @@ void sqlite3VdbeMakeReady(
|
||||
p->apCsr = allocSpace(&x, p->apCsr, nCursor*sizeof(VdbeCursor*));
|
||||
}
|
||||
}
|
||||
#ifdef SQLITE_DEBUG
|
||||
p->napArg = nArg;
|
||||
#endif
|
||||
|
||||
if( db->mallocFailed ){
|
||||
p->nVar = 0;
|
||||
|
||||
+2
-6
@@ -192,12 +192,8 @@ int sqlite3_blob_open(
|
||||
pBlob->zDb = db->aDb[sqlite3SchemaToIndex(db, pTab->pSchema)].zDbSName;
|
||||
|
||||
/* Now search pTab for the exact column. */
|
||||
for(iCol=0; iCol<pTab->nCol; iCol++) {
|
||||
if( sqlite3StrICmp(pTab->aCol[iCol].zCnName, zColumn)==0 ){
|
||||
break;
|
||||
}
|
||||
}
|
||||
if( iCol==pTab->nCol ){
|
||||
iCol = sqlite3ColumnIndex(pTab, zColumn);
|
||||
if( iCol<0 ){
|
||||
sqlite3DbFree(db, zErr);
|
||||
zErr = sqlite3MPrintf(db, "no such column: \"%s\"", zColumn);
|
||||
rc = SQLITE_ERROR;
|
||||
|
||||
+1
-1
@@ -327,7 +327,7 @@ void sqlite3VdbeMemZeroTerminateIfAble(Mem *pMem){
|
||||
return;
|
||||
}
|
||||
if( pMem->enc!=SQLITE_UTF8 ) return;
|
||||
if( NEVER(pMem->z==0) ) return;
|
||||
assert( pMem->z!=0 );
|
||||
if( pMem->flags & MEM_Dyn ){
|
||||
if( pMem->xDel==sqlite3_free
|
||||
&& sqlite3_msize(pMem->z) >= (u64)(pMem->n+1)
|
||||
|
||||
+3
-2
@@ -479,11 +479,12 @@ void sqlite3VtabFinishParse(Parse *pParse, Token *pEnd){
|
||||
** schema table. We just need to update that slot with all
|
||||
** the information we've collected.
|
||||
**
|
||||
** The VM register number pParse->regRowid holds the rowid of an
|
||||
** The VM register number pParse->u1.cr.regRowid holds the rowid of an
|
||||
** entry in the sqlite_schema table that was created for this vtab
|
||||
** by sqlite3StartTable().
|
||||
*/
|
||||
iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
|
||||
assert( pParse->isCreate );
|
||||
sqlite3NestedParse(pParse,
|
||||
"UPDATE %Q." LEGACY_SCHEMA_TABLE " "
|
||||
"SET type='table', name=%Q, tbl_name=%Q, rootpage=0, sql=%Q "
|
||||
@@ -492,7 +493,7 @@ void sqlite3VtabFinishParse(Parse *pParse, Token *pEnd){
|
||||
pTab->zName,
|
||||
pTab->zName,
|
||||
zStmt,
|
||||
pParse->regRowid
|
||||
pParse->u1.cr.regRowid
|
||||
);
|
||||
v = sqlite3GetVdbe(pParse);
|
||||
sqlite3ChangeCookie(pParse, iDb);
|
||||
|
||||
+1
-1
@@ -3469,7 +3469,7 @@ static int whereLoopAddBtreeIndex(
|
||||
if( (pNew->wsFlags & WHERE_TOP_LIMIT)==0
|
||||
&& pNew->u.btree.nEq<pProbe->nColumn
|
||||
&& (pNew->u.btree.nEq<pProbe->nKeyCol ||
|
||||
(pProbe->idxType!=SQLITE_IDXTYPE_PRIMARYKEY && !pProbe->bIdxRowid))
|
||||
pProbe->idxType!=SQLITE_IDXTYPE_PRIMARYKEY)
|
||||
){
|
||||
if( pNew->u.btree.nEq>3 ){
|
||||
sqlite3ProgressCheck(pParse);
|
||||
|
||||
@@ -1608,6 +1608,9 @@ Bitmask sqlite3WhereCodeOneLoopStart(
|
||||
}
|
||||
sqlite3VdbeAddOp2(v, OP_Integer, pLoop->u.vtab.idxNum, iReg);
|
||||
sqlite3VdbeAddOp2(v, OP_Integer, nConstraint, iReg+1);
|
||||
/* The instruction immediately prior to OP_VFilter must be an OP_Integer
|
||||
** that sets the "argc" value for xVFilter. This is necessary for
|
||||
** resolveP2() to work correctly. See tag-20250207a. */
|
||||
sqlite3VdbeAddOp4(v, OP_VFilter, iCur, addrNotFound, iReg,
|
||||
pLoop->u.vtab.idxStr,
|
||||
pLoop->u.vtab.needFree ? P4_DYNAMIC : P4_STATIC);
|
||||
|
||||
@@ -183,47 +183,6 @@ do_execsql_test 4.3 {
|
||||
do_execsql_test 4.4 {
|
||||
SELECT * FROM t0 LEFT JOIN t1 LEFT JOIN t2 ON (b NOTNULL)==(c IN ()) WHERE c;
|
||||
} {xyz {} 7.0}
|
||||
|
||||
reset_db
|
||||
do_execsql_test 5.0 {
|
||||
CREATE TABLE t1 (c1);
|
||||
INSERT INTO t1 VALUES (101);
|
||||
CREATE TABLE t2 ( x );
|
||||
INSERT INTO t2 VALUES(404);
|
||||
}
|
||||
|
||||
do_execsql_test 5.1 {
|
||||
SELECT 'val' in (
|
||||
select 'val' from ( select 'valueB' from t1 order by 1 )
|
||||
union all
|
||||
select 'val'
|
||||
);
|
||||
} {1}
|
||||
|
||||
do_execsql_test 5.2 {
|
||||
select * from t2
|
||||
where 'val' in (
|
||||
select 'val' from ( select 'valueB' from t1 order by 1 )
|
||||
union all
|
||||
select 'val'
|
||||
);
|
||||
} {404}
|
||||
|
||||
do_execsql_test 5.3 {
|
||||
SELECT subq_1.c_0 as c_0
|
||||
FROM ( SELECT 0 as c_0) as subq_1
|
||||
WHERE (subq_1.c_0) IN (
|
||||
SELECT subq_2.c_0 as c_0
|
||||
FROM (
|
||||
SELECT 0 as c_0
|
||||
FROM t1 as ref_1
|
||||
WHERE (ref_1.c1) = (2)
|
||||
ORDER BY c_0 desc
|
||||
) as subq_2
|
||||
UNION ALL
|
||||
SELECT 0 as c_0
|
||||
);
|
||||
} {0}
|
||||
|
||||
|
||||
finish_test
|
||||
|
||||
@@ -782,27 +782,4 @@ do_execsql_test 33.3 {
|
||||
SELECT * FROM t1 WHERE (a,b) BETWEEN (2,99) AND (4,0);
|
||||
} {3 100}
|
||||
|
||||
# 2025-04-15 https://sqlite.org/forum/forumpost/b9647a113b465950
|
||||
# Incorrect result when the schema includes a table with a UNIQUE
|
||||
# constraint and one of the columns in the UNIQUE constraint is the
|
||||
# INTEGER PRIMARY KEY, and the columns that UNIQUE constraint are
|
||||
# used in a rowvalue-IN operator constraint.
|
||||
#
|
||||
reset_db
|
||||
do_execsql_test 34.1 {
|
||||
CREATE TABLE items (
|
||||
Id INTEGER /* rowid alias */,
|
||||
Item INTEGER /* any type */,
|
||||
Test TEXT /* TEXT or BLOB */,
|
||||
Filler, /* any type */
|
||||
PRIMARY KEY(Id),
|
||||
UNIQUE(Item, Id)
|
||||
);
|
||||
INSERT INTO items (Id, Item)
|
||||
VALUES (1, 2), (2, 2), (3, 3), (4, 5);
|
||||
UPDATE items SET test='ok'
|
||||
WHERE (Id, Item) IN (SELECT Id, Item FROM items);
|
||||
SELECT Id, Item, test FROM items ORDER BY id;
|
||||
} {1 2 ok 2 2 ok 3 3 ok 4 5 ok}
|
||||
|
||||
finish_test
|
||||
|
||||
+6
-6
@@ -224,24 +224,24 @@ do_test shell2-1.4.10 {
|
||||
set res [catchcmd :memory: [string trim {
|
||||
SELECT * FROM generate_series(9223372036854775807,9223372036854775807,1);
|
||||
SELECT * FROM generate_series(9223372036854775807,9223372036854775807,-1);
|
||||
SELECT avg(value),min(value),max(value) FROM generate_series(
|
||||
SELECT avg(rowid),min(value),max(value) FROM generate_series(
|
||||
-9223372036854775808,9223372036854775807,1085102592571150095);
|
||||
SELECT * FROM generate_series(-9223372036854775808,9223372036854775807,
|
||||
9223372036854775807);
|
||||
SELECT value FROM generate_series(-4611686018427387904,
|
||||
SELECT value,rowid FROM generate_series(-4611686018427387904,
|
||||
4611686018427387904, 4611686018427387904) ORDER BY value DESC;
|
||||
SELECT * FROM generate_series(0,-2,-1);
|
||||
SELECT * FROM generate_series(0,-2);
|
||||
SELECT * FROM generate_series(0,2) LIMIT 3;}]]
|
||||
} {0 {9223372036854775807
|
||||
9223372036854775807
|
||||
-0.5|-9223372036854775808|9223372036854775807
|
||||
9.5|-9223372036854775808|9223372036854775807
|
||||
-9223372036854775808
|
||||
-1
|
||||
9223372036854775806
|
||||
4611686018427387904
|
||||
0
|
||||
-4611686018427387904
|
||||
4611686018427387904|3
|
||||
0|2
|
||||
-4611686018427387904|1
|
||||
0
|
||||
-1
|
||||
-2
|
||||
|
||||
@@ -27,6 +27,7 @@ Other options include:
|
||||
--lookaside N SZ Lookahead uses N slots of SZ bytes each.
|
||||
--pagesize N Use N as the page size.
|
||||
--quiet | -q "Quite". Put results in file but don't pop up editor
|
||||
--size N Change the test size. 100 means 100%. Default: 5.
|
||||
--testset TEST Specify the specific testset to use. The default
|
||||
is "mix1". Other options include: "main", "json",
|
||||
"cte", "orm", "fp", "rtree".
|
||||
@@ -78,6 +79,14 @@ for {set i 0} {$i<[llength $argv]} {incr i} {
|
||||
incr i
|
||||
set testset [lindex $argv $i]
|
||||
}
|
||||
-size -
|
||||
--size {
|
||||
incr i
|
||||
set newsize [lindex $argv $i]
|
||||
if {$newsize<1} {set newsize 1}
|
||||
set speedtestflags \
|
||||
[regsub {.-size \d+} $speedtestflags "-size $newsize"]
|
||||
}
|
||||
-n -
|
||||
-dryrun -
|
||||
--dryrun {
|
||||
@@ -174,9 +183,14 @@ if {!$dryrun} {
|
||||
}
|
||||
lappend speedtestflags --testset $testset
|
||||
set stcmd [list valgrind --tool=cachegrind ./speedtest1 {*}$speedtestflags]
|
||||
lappend stcmd speedtest1.db
|
||||
lappend stcmd >valgrind-out.txt 2>valgrind-err.txt
|
||||
puts $stcmd
|
||||
if {!$dryrun} {
|
||||
foreach file {speedtest1.db speedtest1.db-journal speedtest1.db-wal
|
||||
speedtest1.db-shm} {
|
||||
if {[file exists $file]} {file delete $file}
|
||||
}
|
||||
exec {*}$stcmd
|
||||
}
|
||||
|
||||
|
||||
+582
-19
@@ -64,10 +64,9 @@ static const char zHelp[] =
|
||||
" --stats Show statistics at the end\n"
|
||||
" --stmtscanstatus Activate SQLITE_DBCONFIG_STMT_SCANSTATUS\n"
|
||||
" --temp N N from 0 to 9. 0: no temp table. 9: all temp tables\n"
|
||||
" --testset T Run test-set T (main, cte, rtree, orm, fp, json,"
|
||||
" debug)\n"
|
||||
" Can be a comma-separated list of values, with /SCALE\n"
|
||||
" suffixes or macro \"mix1\"\n"
|
||||
" --testset T Run test-set T (main, cte, rtree, orm, fp, json,\n"
|
||||
" star, app, debug). Can be a comma-separated list\n"
|
||||
" of values, with /SCALE suffixes or macro \"mix1\"\n"
|
||||
" --trace Turn on SQL tracing\n"
|
||||
" --threads N Use up to N threads for sorting\n"
|
||||
" --utf16be Set text encoding to UTF-16BE\n"
|
||||
@@ -113,6 +112,8 @@ struct HashContext {
|
||||
/* All global state is held in this structure */
|
||||
static struct Global {
|
||||
sqlite3 *db; /* The open database connection */
|
||||
const char *zDbName; /* Name of the database file */
|
||||
const char *zVfs; /* --vfs NAME */
|
||||
sqlite3_stmt *pStmt; /* Current SQL statement */
|
||||
sqlite3_int64 iStart; /* Start-time for the current test */
|
||||
sqlite3_int64 iTotal; /* Total time */
|
||||
@@ -1458,6 +1459,561 @@ void testset_fp(void){
|
||||
speedtest1_end_test();
|
||||
}
|
||||
|
||||
/*
|
||||
** A testset for star-schema queries.
|
||||
*/
|
||||
void testset_star(void){
|
||||
int n;
|
||||
int i;
|
||||
n = g.szTest*50;
|
||||
speedtest1_begin_test(100, "Create a fact table with %d entries", n);
|
||||
speedtest1_exec(
|
||||
"CREATE TABLE facttab("
|
||||
" attr01 INT,"
|
||||
" attr02 INT,"
|
||||
" attr03 INT,"
|
||||
" data01 TEXT,"
|
||||
" attr04 INT,"
|
||||
" attr05 INT,"
|
||||
" attr06 INT,"
|
||||
" attr07 INT,"
|
||||
" attr08 INT,"
|
||||
" factid INTEGER PRIMARY KEY,"
|
||||
" data02 TEXT"
|
||||
");"
|
||||
);
|
||||
speedtest1_exec(
|
||||
"WITH RECURSIVE counter(nnn) AS"
|
||||
"(VALUES(1) UNION ALL SELECT nnn+1 FROM counter WHERE nnn<%d)"
|
||||
"INSERT INTO facttab(attr01,attr02,attr03,attr04,attr05,"
|
||||
"attr06,attr07,attr08,data01,data02)"
|
||||
"SELECT random()%%12, random()%%13, random()%%14, random()%%15,"
|
||||
"random()%%16, random()%%17, random()%%18, random()%%19,"
|
||||
"concat('data-',nnn), format('%%x',random()) FROM counter;",
|
||||
n
|
||||
);
|
||||
speedtest1_end_test();
|
||||
|
||||
speedtest1_begin_test(110, "Create indexes on all attributes columns");
|
||||
for(i=1; i<=8; i++){
|
||||
speedtest1_exec(
|
||||
"CREATE INDEX fact_attr%02d ON facttab(attr%02d)", i, i
|
||||
);
|
||||
}
|
||||
speedtest1_end_test();
|
||||
|
||||
speedtest1_begin_test(120, "Create dimension tables");
|
||||
for(i=1; i<=8; i++){
|
||||
speedtest1_exec(
|
||||
"CREATE TABLE dimension%02d("
|
||||
"beta%02d INT, "
|
||||
"content%02d TEXT, "
|
||||
"rate%02d REAL)",
|
||||
i, i, i, i
|
||||
);
|
||||
speedtest1_exec(
|
||||
"WITH RECURSIVE ctr(nn) AS"
|
||||
" (VALUES(1) UNION ALL SELECT nn+1 FROM ctr WHERE nn<%d)"
|
||||
" INSERT INTO dimension%02d"
|
||||
" SELECT nn%%(%d), concat('content-%02d-',nn),"
|
||||
" (random()%%10000)*0.125 FROM ctr;",
|
||||
4*(i+1), i, 2*(i+1), i
|
||||
);
|
||||
if( i&2 ){
|
||||
speedtest1_exec(
|
||||
"CREATE INDEX dim%02d ON dimension%02d(beta%02d);",
|
||||
i, i, i
|
||||
);
|
||||
}else{
|
||||
speedtest1_exec(
|
||||
"CREATE INDEX dim%02d ON dimension%02d(beta%02d,content%02d);",
|
||||
i, i, i, i
|
||||
);
|
||||
}
|
||||
}
|
||||
speedtest1_end_test();
|
||||
|
||||
speedtest1_begin_test(130, "Star query over the entire fact table");
|
||||
speedtest1_exec(
|
||||
"SELECT count(*), max(content04), min(content03), sum(rate04), avg(rate05)"
|
||||
" FROM facttab, dimension01, dimension02, dimension03, dimension04,"
|
||||
" dimension05, dimension06, dimension07, dimension08"
|
||||
" WHERE attr01=beta01"
|
||||
" AND attr02=beta02"
|
||||
" AND attr03=beta03"
|
||||
" AND attr04=beta04"
|
||||
" AND attr05=beta05"
|
||||
" AND attr06=beta06"
|
||||
" AND attr07=beta07"
|
||||
" AND attr08=beta08"
|
||||
";"
|
||||
);
|
||||
speedtest1_end_test();
|
||||
|
||||
speedtest1_begin_test(130, "Star query with LEFT JOINs");
|
||||
speedtest1_exec(
|
||||
"SELECT count(*), max(content04), min(content03), sum(rate04), avg(rate05)"
|
||||
" FROM facttab LEFT JOIN dimension01 ON attr01=beta01"
|
||||
" LEFT JOIN dimension02 ON attr02=beta02"
|
||||
" JOIN dimension03 ON attr03=beta03"
|
||||
" JOIN dimension04 ON attr04=beta04"
|
||||
" JOIN dimension05 ON attr05=beta05"
|
||||
" LEFT JOIN dimension06 ON attr06=beta06"
|
||||
" JOIN dimension07 ON attr07=beta07"
|
||||
" JOIN dimension08 ON attr08=beta08"
|
||||
" WHERE facttab.data01 LIKE 'data-9%%'"
|
||||
";"
|
||||
);
|
||||
speedtest1_end_test();
|
||||
}
|
||||
|
||||
/*
|
||||
** Tests that simulate an application opening and closing an SQLite database
|
||||
** frequently. Fossil is used as the model. The focus here is on rapidly
|
||||
** parsing the database schema and rapidly generating prepared statements,
|
||||
** in other words, rapid start-up of Fossil-like applications.
|
||||
**
|
||||
** The same database has no data, so the performance of sqlite3_step() is
|
||||
** not significant to this testset.
|
||||
*/
|
||||
static void testset_app(void){
|
||||
int i, n;
|
||||
speedtest1_begin_test(100, "Generate a Fossil-like database schema");
|
||||
speedtest1_exec(
|
||||
"BEGIN;"
|
||||
"CREATE TABLE blob(\n"
|
||||
" rid INTEGER PRIMARY KEY,\n"
|
||||
" rcvid INTEGER,\n"
|
||||
" size INTEGER,\n"
|
||||
" uuid TEXT UNIQUE NOT NULL,\n"
|
||||
" content BLOB,\n"
|
||||
" CHECK( length(uuid)>=40 AND rid>0 )\n"
|
||||
");\n"
|
||||
"CREATE TABLE delta(\n"
|
||||
" rid INTEGER PRIMARY KEY,\n"
|
||||
" srcid INTEGER NOT NULL REFERENCES blob\n"
|
||||
");\n"
|
||||
"CREATE TABLE rcvfrom(\n"
|
||||
" rcvid INTEGER PRIMARY KEY,\n"
|
||||
" uid INTEGER REFERENCES user,\n"
|
||||
" mtime DATETIME,\n"
|
||||
" nonce TEXT UNIQUE,\n"
|
||||
" ipaddr TEXT\n"
|
||||
");\n"
|
||||
"CREATE TABLE private(rid INTEGER PRIMARY KEY);\n"
|
||||
"CREATE TABLE accesslog(\n"
|
||||
" uname TEXT,\n"
|
||||
" ipaddr TEXT,\n"
|
||||
" success BOOLEAN,\n"
|
||||
" mtime TIMESTAMP\n"
|
||||
");\n"
|
||||
"CREATE TABLE user(\n"
|
||||
" uid INTEGER PRIMARY KEY,\n"
|
||||
" login TEXT UNIQUE,\n"
|
||||
" pw TEXT,\n"
|
||||
" cap TEXT,\n"
|
||||
" cookie TEXT,\n"
|
||||
" ipaddr TEXT,\n"
|
||||
" cexpire DATETIME,\n"
|
||||
" info TEXT,\n"
|
||||
" mtime DATE,\n"
|
||||
" photo BLOB\n"
|
||||
", jx TEXT DEFAULT '{}');\n"
|
||||
"CREATE TABLE reportfmt(\n"
|
||||
" rn INTEGER PRIMARY KEY,\n"
|
||||
" owner TEXT,\n"
|
||||
" title TEXT UNIQUE,\n"
|
||||
" mtime INTEGER,\n"
|
||||
" cols TEXT,\n"
|
||||
" sqlcode TEXT\n"
|
||||
", jx TEXT DEFAULT '{}');\n"
|
||||
"CREATE TABLE config(\n"
|
||||
" name TEXT PRIMARY KEY NOT NULL,\n"
|
||||
" value CLOB, mtime INTEGER,\n"
|
||||
" CHECK( typeof(name)='text' AND length(name)>=1 )\n"
|
||||
") WITHOUT ROWID;\n"
|
||||
"CREATE TABLE shun(uuid PRIMARY KEY, mtime INTEGER, scom TEXT)\n"
|
||||
" WITHOUT ROWID;\n"
|
||||
"CREATE TABLE concealed(\n"
|
||||
" hash TEXT PRIMARY KEY,\n"
|
||||
" content TEXT\n"
|
||||
", mtime INTEGER) WITHOUT ROWID;\n"
|
||||
"CREATE TABLE admin_log(\n"
|
||||
" id INTEGER PRIMARY KEY,\n"
|
||||
" time INTEGER, -- Seconds since 1970\n"
|
||||
" page TEXT, -- path of page\n"
|
||||
" who TEXT, -- User who made the change\n"
|
||||
" what TEXT -- What changed\n"
|
||||
");\n"
|
||||
"CREATE TABLE unversioned(\n"
|
||||
" name TEXT PRIMARY KEY,\n"
|
||||
" rcvid INTEGER,\n"
|
||||
" mtime DATETIME,\n"
|
||||
" hash TEXT,\n"
|
||||
" sz INTEGER,\n"
|
||||
" encoding INT,\n"
|
||||
" content BLOB\n"
|
||||
") WITHOUT ROWID;\n"
|
||||
"CREATE TABLE subscriber(\n"
|
||||
" subscriberId INTEGER PRIMARY KEY,\n"
|
||||
" subscriberCode BLOB DEFAULT (randomblob(32)) UNIQUE,\n"
|
||||
" semail TEXT UNIQUE COLLATE nocase,\n"
|
||||
" suname TEXT,\n"
|
||||
" sverified BOOLEAN DEFAULT true,\n"
|
||||
" sdonotcall BOOLEAN,\n"
|
||||
" sdigest BOOLEAN,\n"
|
||||
" ssub TEXT,\n"
|
||||
" sctime INTDATE,\n"
|
||||
" mtime INTDATE,\n"
|
||||
" smip TEXT\n"
|
||||
", lastContact INT);\n"
|
||||
"CREATE TABLE pending_alert(\n"
|
||||
" eventid TEXT PRIMARY KEY,\n"
|
||||
" sentSep BOOLEAN DEFAULT false,\n"
|
||||
" sentDigest BOOLEAN DEFAULT false\n"
|
||||
", sentMod BOOLEAN DEFAULT false) WITHOUT ROWID;\n"
|
||||
"CREATE TABLE filename(\n"
|
||||
" fnid INTEGER PRIMARY KEY,\n"
|
||||
" name TEXT UNIQUE\n"
|
||||
") STRICT;\n"
|
||||
"CREATE TABLE mlink(\n"
|
||||
" mid INTEGER,\n"
|
||||
" fid INTEGER,\n"
|
||||
" pmid INTEGER,\n"
|
||||
" pid INTEGER,\n"
|
||||
" fnid INTEGER REFERENCES filename,\n"
|
||||
" pfnid INTEGER,\n"
|
||||
" mperm INTEGER,\n"
|
||||
" isaux INT DEFAULT 0\n"
|
||||
") STRICT;\n"
|
||||
"CREATE TABLE plink(\n"
|
||||
" pid INTEGER REFERENCES blob,\n"
|
||||
" cid INTEGER REFERENCES blob,\n"
|
||||
" isprim INT,\n"
|
||||
" mtime REAL,\n"
|
||||
" baseid INTEGER REFERENCES blob,\n"
|
||||
" UNIQUE(pid, cid)\n"
|
||||
") STRICT;\n"
|
||||
"CREATE TABLE leaf(rid INTEGER PRIMARY KEY);\n"
|
||||
"CREATE TABLE event(\n"
|
||||
" type TEXT,\n"
|
||||
" mtime REAL,\n"
|
||||
" objid INTEGER PRIMARY KEY,\n"
|
||||
" tagid INTEGER,\n"
|
||||
" uid INTEGER REFERENCES user,\n"
|
||||
" bgcolor TEXT,\n"
|
||||
" euser TEXT,\n"
|
||||
" user TEXT,\n"
|
||||
" ecomment TEXT,\n"
|
||||
" comment TEXT,\n"
|
||||
" brief TEXT,\n"
|
||||
" omtime REAL\n"
|
||||
") STRICT;\n"
|
||||
"CREATE TABLE phantom(\n"
|
||||
" rid INTEGER PRIMARY KEY\n"
|
||||
");\n"
|
||||
"CREATE TABLE orphan(\n"
|
||||
" rid INTEGER PRIMARY KEY,\n"
|
||||
" baseline INTEGER\n"
|
||||
") STRICT;\n"
|
||||
"CREATE TABLE unclustered(\n"
|
||||
" rid INTEGER PRIMARY KEY\n"
|
||||
");\n"
|
||||
"CREATE TABLE unsent(\n"
|
||||
" rid INTEGER PRIMARY KEY\n"
|
||||
");\n"
|
||||
"CREATE TABLE tag(\n"
|
||||
" tagid INTEGER PRIMARY KEY,\n"
|
||||
" tagname TEXT UNIQUE\n"
|
||||
") STRICT;\n"
|
||||
"CREATE TABLE tagxref(\n"
|
||||
" tagid INTEGER REFERENCES tag,\n"
|
||||
" tagtype INTEGER,\n"
|
||||
" srcid INTEGER REFERENCES blob,\n"
|
||||
" origid INTEGER REFERENCES blob,\n"
|
||||
" value TEXT,\n"
|
||||
" mtime REAL,\n"
|
||||
" rid INTEGER REFERENCES blob,\n"
|
||||
" UNIQUE(rid, tagid)\n"
|
||||
") STRICT;\n"
|
||||
"CREATE TABLE backlink(\n"
|
||||
" target TEXT,\n"
|
||||
" srctype INT,\n"
|
||||
" srcid INT,\n"
|
||||
" mtime REAL,\n"
|
||||
" UNIQUE(target, srctype, srcid)\n"
|
||||
") STRICT;\n"
|
||||
"CREATE TABLE attachment(\n"
|
||||
" attachid INTEGER PRIMARY KEY,\n"
|
||||
" isLatest INT DEFAULT 0,\n"
|
||||
" mtime REAL,\n"
|
||||
" src TEXT,\n"
|
||||
" target TEXT,\n"
|
||||
" filename TEXT,\n"
|
||||
" comment TEXT,\n"
|
||||
" user TEXT\n"
|
||||
") STRICT;\n"
|
||||
"CREATE TABLE cherrypick(\n"
|
||||
" parentid INT,\n"
|
||||
" childid INT,\n"
|
||||
" isExclude INT DEFAULT false,\n"
|
||||
" PRIMARY KEY(parentid, childid)\n"
|
||||
") WITHOUT ROWID, STRICT;\n"
|
||||
"CREATE TABLE vcache(\n"
|
||||
" vid INTEGER, -- check-in ID\n"
|
||||
" fname TEXT, -- filename\n"
|
||||
" rid INTEGER, -- artifact ID\n"
|
||||
" PRIMARY KEY(vid,fname)\n"
|
||||
") WITHOUT ROWID;\n"
|
||||
"CREATE TABLE synclog(\n"
|
||||
" sfrom TEXT,\n"
|
||||
" sto TEXT,\n"
|
||||
" stime INT NOT NULL,\n"
|
||||
" stype TEXT,\n"
|
||||
" PRIMARY KEY(sfrom,sto)\n"
|
||||
") WITHOUT ROWID;\n"
|
||||
"CREATE TABLE chat(\n"
|
||||
" msgid INTEGER PRIMARY KEY AUTOINCREMENT,\n"
|
||||
" mtime JULIANDAY,\n"
|
||||
" lmtime TEXT,\n"
|
||||
" xfrom TEXT,\n"
|
||||
" xmsg TEXT,\n"
|
||||
" fname TEXT,\n"
|
||||
" fmime TEXT,\n"
|
||||
" mdel INT,\n"
|
||||
" file BLOB\n"
|
||||
");\n"
|
||||
"CREATE TABLE ftsdocs(\n"
|
||||
" rowid INTEGER PRIMARY KEY,\n"
|
||||
" type CHAR(1),\n"
|
||||
" rid INTEGER,\n"
|
||||
" name TEXT,\n"
|
||||
" idxed BOOLEAN,\n"
|
||||
" label TEXT,\n"
|
||||
" url TEXT,\n"
|
||||
" mtime DATE,\n"
|
||||
" bx TEXT,\n"
|
||||
" UNIQUE(type,rid)\n"
|
||||
");\n"
|
||||
"CREATE TABLE ticket(\n"
|
||||
" -- Do not change any column that begins with tkt_\n"
|
||||
" tkt_id INTEGER PRIMARY KEY,\n"
|
||||
" tkt_uuid TEXT UNIQUE,\n"
|
||||
" tkt_mtime DATE,\n"
|
||||
" tkt_ctime DATE,\n"
|
||||
" -- Add as many fields as required below this line\n"
|
||||
" type TEXT,\n"
|
||||
" status TEXT,\n"
|
||||
" subsystem TEXT,\n"
|
||||
" priority TEXT,\n"
|
||||
" severity TEXT,\n"
|
||||
" foundin TEXT,\n"
|
||||
" private_contact TEXT,\n"
|
||||
" resolution TEXT,\n"
|
||||
" title TEXT,\n"
|
||||
" comment TEXT\n"
|
||||
");\n"
|
||||
"CREATE TABLE ticketchng(\n"
|
||||
" -- Do not change any column that begins with tkt_\n"
|
||||
" tkt_id INTEGER REFERENCES ticket,\n"
|
||||
" tkt_rid INTEGER REFERENCES blob,\n"
|
||||
" tkt_mtime DATE,\n"
|
||||
" tkt_user TEXT,\n"
|
||||
" -- Add as many fields as required below this line\n"
|
||||
" login TEXT,\n"
|
||||
" username TEXT,\n"
|
||||
" mimetype TEXT,\n"
|
||||
" icomment TEXT\n"
|
||||
");\n"
|
||||
"CREATE TABLE forumpost(\n"
|
||||
" fpid INTEGER PRIMARY KEY,\n"
|
||||
" froot INT,\n"
|
||||
" fprev INT,\n"
|
||||
" firt INT,\n"
|
||||
" fmtime REAL\n"
|
||||
");\n"
|
||||
"CREATE INDEX delta_i1 ON delta(srcid);\n"
|
||||
"CREATE INDEX blob_rcvid ON blob(rcvid);\n"
|
||||
"CREATE INDEX subscriberUname\n"
|
||||
" ON subscriber(suname) WHERE suname IS NOT NULL;\n"
|
||||
"CREATE INDEX mlink_i1 ON mlink(mid);\n"
|
||||
"CREATE INDEX mlink_i2 ON mlink(fnid);\n"
|
||||
"CREATE INDEX mlink_i3 ON mlink(fid);\n"
|
||||
"CREATE INDEX mlink_i4 ON mlink(pid);\n"
|
||||
"CREATE INDEX plink_i2 ON plink(cid,pid);\n"
|
||||
"CREATE INDEX event_i1 ON event(mtime);\n"
|
||||
"CREATE INDEX orphan_baseline ON orphan(baseline);\n"
|
||||
"CREATE INDEX tagxref_i1 ON tagxref(tagid, mtime);\n"
|
||||
"CREATE INDEX backlink_src ON backlink(srcid, srctype);\n"
|
||||
"CREATE INDEX attachment_idx1 ON attachment(target, filename, mtime);\n"
|
||||
"CREATE INDEX attachment_idx2 ON attachment(src);\n"
|
||||
"CREATE INDEX cherrypick_cid ON cherrypick(childid);\n"
|
||||
"CREATE INDEX ftsdocIdxed ON ftsdocs(type,rid,name) WHERE idxed==0;\n"
|
||||
"CREATE INDEX ftsdocName ON ftsdocs(name) WHERE type='w';\n"
|
||||
"CREATE INDEX ticketchng_idx1 ON ticketchng(tkt_id, tkt_mtime);\n"
|
||||
"CREATE INDEX forumthread ON forumpost(froot,fmtime);\n"
|
||||
"CREATE VIEW artifact(rid,rcvid,size,atype,srcid,hash,content) AS\n"
|
||||
" SELECT blob.rid,rcvid,size,1,srcid,uuid,content\n"
|
||||
" FROM blob LEFT JOIN delta ON (blob.rid=delta.rid);\n"
|
||||
"CREATE VIEW ftscontent AS\n"
|
||||
" SELECT rowid, type, rid, name, idxed, label, url, mtime,\n"
|
||||
" title(type,rid,name) AS 'title', body(type,rid,name) AS 'body'\n"
|
||||
" FROM ftsdocs;\n"
|
||||
);
|
||||
if( sqlite3_compileoption_used("ENABLE_FTS5") ){
|
||||
speedtest1_exec(
|
||||
"CREATE VIRTUAL TABLE ftsidx\n"
|
||||
" USING fts5(content=\"ftscontent\", title, body);\n"
|
||||
"CREATE VIRTUAL TABLE chatfts1 USING fts5(\n"
|
||||
" xmsg, content=chat, content_rowid=msgid,tokenize=porter);\n"
|
||||
);
|
||||
}else{
|
||||
speedtest1_exec(
|
||||
"CREATE TABLE ftsidx_data(id INTEGER PRIMARY KEY, block BLOB);\n"
|
||||
"CREATE TABLE ftsidx_idx(segid, term, pgno, PRIMARY KEY(segid, term))\n"
|
||||
" WITHOUT ROWID;\n"
|
||||
"CREATE TABLE ftsidx_docsize(id INTEGER PRIMARY KEY, sz BLOB);\n"
|
||||
"CREATE TABLE ftsidx_config(k PRIMARY KEY, v) WITHOUT ROWID;\n"
|
||||
"CREATE TABLE chatfts1_data(id INTEGER PRIMARY KEY, block BLOB);\n"
|
||||
"CREATE TABLE chatfts1_idx(segid, term, pgno, PRIMARY KEY(segid, term))\n"
|
||||
" WITHOUT ROWID;\n"
|
||||
"CREATE TABLE chatfts1_docsize(id INTEGER PRIMARY KEY, sz BLOB);\n"
|
||||
"CREATE TABLE chatfts1_config(k PRIMARY KEY, v) WITHOUT ROWID;\n"
|
||||
);
|
||||
}
|
||||
speedtest1_exec(
|
||||
"ANALYZE sqlite_schema;\n"
|
||||
"INSERT INTO sqlite_stat1(tbl,idx,stat) VALUES\n"
|
||||
" ('ftsidx_config','ftsidx_config','1 1'),\n"
|
||||
" ('ftsidx_idx','ftsidx_idx','4215 401 1'),\n"
|
||||
" ('user','sqlite_autoindex_user_1','25 1'),\n"
|
||||
" ('phantom',NULL,'26'),\n"
|
||||
" ('reportfmt','sqlite_autoindex_reportfmt_1','9 1'),\n"
|
||||
" ('rcvfrom','sqlite_autoindex_rcvfrom_1','18445 401'),\n"
|
||||
" ('private',NULL,'99'),\n"
|
||||
" ('mlink','mlink_i4','116678 401'),\n"
|
||||
" ('mlink','mlink_i3','121212 2'),\n"
|
||||
" ('mlink','mlink_i2','106372 401'),\n"
|
||||
" ('mlink','mlink_i1','99298 5'),\n"
|
||||
" ('ftsidx_data',NULL,'3795'),\n"
|
||||
" ('leaf',NULL,'1559'),\n"
|
||||
" ('delta','delta_i1','66340 1'),\n"
|
||||
" ('unversioned','unversioned','3 1'),\n"
|
||||
" ('pending_alert','pending_alert','3 1'),\n"
|
||||
" ('cherrypick','cherrypick_cid','680 2'),\n"
|
||||
" ('cherrypick','cherrypick','628 1 1'),\n"
|
||||
" ('config','config','128 1'),\n"
|
||||
" ('ftsidx_docsize',NULL,'33848'),\n"
|
||||
" ('event','event_i1','36096 1'),\n"
|
||||
" ('plink','plink_i2','38236 1 1'),\n"
|
||||
" ('plink','sqlite_autoindex_plink_1','38357 1 1'),\n"
|
||||
" ('shun','shun','10 1'),\n"
|
||||
" ('concealed','concealed','110 1'),\n"
|
||||
" ('vcache','vcache','1888 401 1'),\n"
|
||||
" ('ftsdocs','ftsdocName','19 1'),\n"
|
||||
" ('ftsdocs','ftsdocIdxed','168 84 1 1'),\n"
|
||||
" ('ftsdocs','sqlite_autoindex_ftsdocs_1','37312 401 1'),\n"
|
||||
" ('subscriber','subscriberUname','5 1'),\n"
|
||||
" ('subscriber','sqlite_autoindex_subscriber_2','37 1'),\n"
|
||||
" ('subscriber','sqlite_autoindex_subscriber_1','37 1'),\n"
|
||||
" ('tag','sqlite_autoindex_tag_1','2990 1'),\n"
|
||||
" ('filename','sqlite_autoindex_filename_1','3168 1'),\n"
|
||||
" ('chat',NULL,'56124'),\n"
|
||||
" ('tagxref','tagxref_i1','40992 401 2'),\n"
|
||||
" ('tagxref','sqlite_autoindex_tagxref_1','79233 3 1'),\n"
|
||||
" ('attachment','attachment_idx2','11 1'),\n"
|
||||
" ('attachment','attachment_idx1','11 2 2 1'),\n"
|
||||
" ('blob','blob_rcvid','128240 201'),\n"
|
||||
" ('blob','sqlite_autoindex_blob_1','126480 1'),\n"
|
||||
" ('synclog','synclog','12 3 1'),\n"
|
||||
" ('backlink','backlink_src','2160 2 2'),\n"
|
||||
" ('backlink','sqlite_autoindex_backlink_1','2340 2 2 1'),\n"
|
||||
" ('accesslog',NULL,'38'),\n"
|
||||
" ('chatfts1_config','chatfts1_config','1 1'),\n"
|
||||
" ('chatfts1_idx','chatfts1_idx','688 230 1'),\n"
|
||||
" ('ticket','sqlite_autoindex_ticket_1','794 1'),\n"
|
||||
" ('ticketchng','ticketchng_idx1','2089 3 1'),\n"
|
||||
" ('forumpost','forumthread','4 4 1'),\n"
|
||||
" ('unclustered',NULL,'12');\n"
|
||||
"COMMIT;"
|
||||
);
|
||||
speedtest1_end_test();
|
||||
|
||||
n = g.szTest*3;
|
||||
speedtest1_begin_test(110, "Open and use the database %d times", n);
|
||||
for(i=0; i<n; i++){
|
||||
sqlite3 *dbMain = g.db;
|
||||
sqlite3 *dbAux = 0;
|
||||
if( g.zDbName && g.zDbName[0] ){
|
||||
if( sqlite3_open_v2(g.zDbName, &dbAux, SQLITE_OPEN_READWRITE, g.zVfs) ){
|
||||
fatal_error("Cannot open database file: %s\n", g.zDbName);
|
||||
}
|
||||
g.db = dbAux;
|
||||
}
|
||||
speedtest1_exec(
|
||||
"SELECT name FROM pragma_table_list /*scan*/"
|
||||
" WHERE schema='repository' AND type IN ('table','virtual')"
|
||||
" AND name NOT IN ('admin_log', 'blob','delta','rcvfrom','user','alias',"
|
||||
"'config','shun','private','reportfmt',"
|
||||
"'concealed','accesslog','modreq',"
|
||||
"'purgeevent','purgeitem','unversioned',"
|
||||
"'subscriber','pending_alert','chat')"
|
||||
" AND name NOT GLOB 'sqlite_*'"
|
||||
" AND name NOT GLOB 'fx_*';"
|
||||
"SELECT 1 FROM pragma_table_xinfo('ticket') WHERE name = 'mimetype';"
|
||||
);
|
||||
speedtest1_exec(
|
||||
"SELECT"
|
||||
" name,"
|
||||
" value,"
|
||||
" unixepoch()/86400-value,"
|
||||
" date(value*86400,'unixepoch')"
|
||||
" FROM config"
|
||||
" WHERE name in ('email-renew-warning','email-renew-cutoff');"
|
||||
"SELECT count(*) FROM pending_alert WHERE NOT sentDigest;"
|
||||
);
|
||||
speedtest1_exec(
|
||||
"WITH priors(rid,who) AS ("
|
||||
" SELECT firt, coalesce(euser,user)"
|
||||
" FROM forumpost LEFT JOIN event ON fpid=objid"
|
||||
" WHERE fpid=12345"
|
||||
" UNION ALL"
|
||||
" SELECT firt, coalesce(euser,user)"
|
||||
" FROM priors, forumpost LEFT JOIN event ON fpid=objid"
|
||||
" WHERE fpid=rid"
|
||||
")"
|
||||
"SELECT ','||group_concat(DISTINCT 'u'||who)||"
|
||||
"','||group_concat(rid) FROM priors;"
|
||||
);
|
||||
speedtest1_exec(
|
||||
"CREATE TEMP TABLE IF NOT EXISTS ok(rid INTEGER PRIMARY KEY);\n"
|
||||
);
|
||||
speedtest1_exec(
|
||||
"WITH RECURSIVE\n"
|
||||
" parent(pid,cid,isCP) AS (\n"
|
||||
" SELECT plink.pid, plink.cid, 0 AS xisCP FROM plink\n"
|
||||
" UNION ALL\n"
|
||||
" SELECT parentid, childid, 1 FROM cherrypick WHERE NOT isExclude\n"
|
||||
" ),\n"
|
||||
" ancestor(rid, mtime, isCP) AS (\n"
|
||||
" SELECT 123, mtime, 0 FROM event WHERE objid=$object\n"
|
||||
" UNION\n"
|
||||
" SELECT parent.pid, event.mtime, parent.isCP\n"
|
||||
" FROM ancestor, parent, event\n"
|
||||
" WHERE parent.cid=ancestor.rid\n"
|
||||
" AND event.objid=parent.pid\n"
|
||||
" AND NOT ancestor.isCP\n"
|
||||
" AND (event.mtime>=$date OR parent.pid=$pid)\n"
|
||||
" ORDER BY mtime DESC LIMIT 10\n"
|
||||
" )\n"
|
||||
" INSERT OR IGNORE INTO ok SELECT rid FROM ancestor;"
|
||||
);
|
||||
sqlite3_close(dbAux);
|
||||
g.db = dbMain;
|
||||
}
|
||||
speedtest1_end_test();
|
||||
}
|
||||
|
||||
#ifdef SQLITE_ENABLE_RTREE
|
||||
/* Generate two numbers between 1 and mx. The first number is less than
|
||||
** the second. Usually the numbers are near each other but can sometimes
|
||||
@@ -2404,11 +2960,9 @@ int main(int argc, char **argv){
|
||||
int memDb = 0; /* --memdb. Use an in-memory database */
|
||||
int openFlags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE
|
||||
; /* SQLITE_OPEN_xxx flags. */
|
||||
char *zTSet = "main"; /* Which --testset torun */
|
||||
const char * zVfs = 0; /* --vfs NAME */
|
||||
char *zTSet = "mix1"; /* Which --testset torun */
|
||||
int doTrace = 0; /* True for --trace */
|
||||
const char *zEncoding = 0; /* --utf16be or --utf16le */
|
||||
const char *zDbName = 0; /* Name of the test database */
|
||||
|
||||
void *pHeap = 0; /* Allocated heap space */
|
||||
void *pLook = 0; /* Allocated lookaside space */
|
||||
@@ -2417,6 +2971,10 @@ int main(int argc, char **argv){
|
||||
int i; /* Loop counter */
|
||||
int rc; /* API return code */
|
||||
|
||||
/* "mix1" is a macro testset: */
|
||||
static char zMix1Tests[] =
|
||||
"main,orm/25,cte/20,json,fp/3,parsenumber/25,rtree/10,star,app";
|
||||
|
||||
#ifdef SQLITE_SPEEDTEST1_WASM
|
||||
/* Resetting all state is important for the WASM build, which may
|
||||
** call main() multiple times. */
|
||||
@@ -2435,6 +2993,8 @@ int main(int argc, char **argv){
|
||||
sqlite3_libversion(), sqlite3_sourceid());
|
||||
|
||||
/* Process command-line arguments */
|
||||
g.zDbName = 0;
|
||||
g.zVfs = 0;
|
||||
g.zWR = "";
|
||||
g.zNN = "";
|
||||
g.zPK = "UNIQUE";
|
||||
@@ -2560,10 +3120,8 @@ int main(int argc, char **argv){
|
||||
}
|
||||
g.eTemp = argv[i][0] - '0';
|
||||
}else if( strcmp(z,"testset")==0 ){
|
||||
static char zMix1Tests[] = "main,orm/25,cte/20,json,fp/3,parsenumber/25,rtree/10";
|
||||
ARGC_VALUE_CHECK(1);
|
||||
zTSet = argv[++i];
|
||||
if( strcmp(zTSet,"mix1")==0 ) zTSet = zMix1Tests;
|
||||
}else if( strcmp(z,"trace")==0 ){
|
||||
doTrace = 1;
|
||||
}else if( strcmp(z,"threads")==0 ){
|
||||
@@ -2580,7 +3138,7 @@ int main(int argc, char **argv){
|
||||
#endif
|
||||
}else if( strcmp(z,"vfs")==0 ){
|
||||
ARGC_VALUE_CHECK(1);
|
||||
zVfs = argv[++i];
|
||||
g.zVfs = argv[++i];
|
||||
}else if( strcmp(z,"reserve")==0 ){
|
||||
ARGC_VALUE_CHECK(1);
|
||||
g.nReserve = atoi(argv[++i]);
|
||||
@@ -2610,8 +3168,8 @@ int main(int argc, char **argv){
|
||||
fatal_error("unknown option: %s\nUse \"%s -?\" for help\n",
|
||||
argv[i], argv[0]);
|
||||
}
|
||||
}else if( zDbName==0 ){
|
||||
zDbName = argv[i];
|
||||
}else if( g.zDbName==0 ){
|
||||
g.zDbName = argv[i];
|
||||
}else{
|
||||
fatal_error("surplus argument: %s\nUse \"%s -?\" for help\n",
|
||||
argv[i], argv[0]);
|
||||
@@ -2640,8 +3198,8 @@ int main(int argc, char **argv){
|
||||
#endif
|
||||
sqlite3_initialize();
|
||||
|
||||
if( zDbName!=0 ){
|
||||
sqlite3_vfs *pVfs = sqlite3_vfs_find(zVfs);
|
||||
if( g.zDbName!=0 ){
|
||||
sqlite3_vfs *pVfs = sqlite3_vfs_find(g.zVfs);
|
||||
/* For some VFSes, e.g. opfs, unlink() is not sufficient. Use the
|
||||
** selected (or default) VFS's xDelete method to delete the
|
||||
** database. This is specifically important for the "opfs" VFS
|
||||
@@ -2649,15 +3207,15 @@ int main(int argc, char **argv){
|
||||
** can be cleaned up properly. For historical compatibility, we'll
|
||||
** also simply unlink(). */
|
||||
if( pVfs!=0 ){
|
||||
pVfs->xDelete(pVfs, zDbName, 1);
|
||||
pVfs->xDelete(pVfs, g.zDbName, 1);
|
||||
}
|
||||
unlink(zDbName);
|
||||
unlink(g.zDbName);
|
||||
}
|
||||
|
||||
/* Open the database and the input file */
|
||||
if( sqlite3_open_v2(memDb ? ":memory:" : zDbName, &g.db,
|
||||
openFlags, zVfs) ){
|
||||
fatal_error("Cannot open database file: %s\n", zDbName);
|
||||
if( sqlite3_open_v2(memDb ? ":memory:" : g.zDbName, &g.db,
|
||||
openFlags, g.zVfs) ){
|
||||
fatal_error("Cannot open database file: %s\n", g.zDbName);
|
||||
}
|
||||
#if SQLITE_VERSION_NUMBER>=3006001
|
||||
if( nLook>0 && szLook>0 ){
|
||||
@@ -2715,6 +3273,7 @@ int main(int argc, char **argv){
|
||||
}
|
||||
|
||||
if( g.bExplain ) printf(".explain\n.echo on\n");
|
||||
if( strcmp(zTSet,"mix1")==0 ) zTSet = zMix1Tests;
|
||||
do{
|
||||
char *zThisTest = zTSet;
|
||||
char *zSep;
|
||||
@@ -2749,6 +3308,10 @@ int main(int argc, char **argv){
|
||||
testset_orm();
|
||||
}else if( strcmp(zThisTest,"cte")==0 ){
|
||||
testset_cte();
|
||||
}else if( strcmp(zThisTest,"star")==0 ){
|
||||
testset_star();
|
||||
}else if( strcmp(zThisTest,"app")==0 ){
|
||||
testset_app();
|
||||
}else if( strcmp(zThisTest,"fp")==0 ){
|
||||
testset_fp();
|
||||
}else if( strcmp(zThisTest,"json")==0 ){
|
||||
|
||||
+3
-84
@@ -61,10 +61,10 @@ do_execsql_test tabfunc01-1.8 {
|
||||
} {30 25 20 15 10 5 0}
|
||||
do_execsql_test tabfunc01-1.9 {
|
||||
SELECT rowid, * FROM generate_series(0,32,5) ORDER BY value DESC;
|
||||
} {30 30 25 25 20 20 15 15 10 10 5 5 0 0}
|
||||
} {7 30 6 25 5 20 4 15 3 10 2 5 1 0}
|
||||
do_execsql_test tabfunc01-1.10 {
|
||||
SELECT rowid, * FROM generate_series(0,32,5) ORDER BY +value DESC;
|
||||
} {30 30 25 25 20 20 15 15 10 10 5 5 0 0}
|
||||
} {7 30 6 25 5 20 4 15 3 10 2 5 1 0}
|
||||
|
||||
do_execsql_test tabfunc01-1.20 {
|
||||
CREATE VIEW v1(a,b) AS VALUES(1,2),(3,4);
|
||||
@@ -181,76 +181,6 @@ do_execsql_test tabfunc01-4.4 {
|
||||
SELECT * FROM (generate_series(1,5,2)) AS x LIMIT 10;
|
||||
} {1 3 5}
|
||||
|
||||
# 2025-03-13 forum post bf2dc8e909983511
|
||||
#
|
||||
do_execsql_test tabfunc01-5.1 {
|
||||
SELECT value
|
||||
FROM generate_series(60,73,6)
|
||||
WHERE value=66;
|
||||
} 66
|
||||
do_execsql_test tabfunc01-5.2 {
|
||||
SELECT value
|
||||
FROM generate_series(73,60,-6)
|
||||
WHERE value=67;
|
||||
} 67
|
||||
|
||||
# 2025-03-22 forum post 0d5d63257e3ff4f6
|
||||
#
|
||||
do_execsql_test tabfunc01-6.1 {
|
||||
SELECT value FROM generate_series(1,10) WHERE value<5.5;
|
||||
} {1 2 3 4 5}
|
||||
do_execsql_test tabfunc01-6.2 {
|
||||
SELECT value FROM generate_series(1,10) WHERE value<5.0;
|
||||
} {1 2 3 4}
|
||||
do_execsql_test tabfunc01-6.3 {
|
||||
SELECT value FROM generate_series(1,10) WHERE value<=5.5;
|
||||
} {1 2 3 4 5}
|
||||
do_execsql_test tabfunc01-6.4 {
|
||||
SELECT value FROM generate_series(1,10) WHERE value<=5.0;
|
||||
} {1 2 3 4 5}
|
||||
do_execsql_test tabfunc01-6.5 {
|
||||
SELECT value FROM generate_series(1,10) WHERE value>5.5;
|
||||
} {6 7 8 9 10}
|
||||
do_execsql_test tabfunc01-6.6 {
|
||||
SELECT value FROM generate_series(1,10) WHERE value>5.0;
|
||||
} {6 7 8 9 10}
|
||||
do_execsql_test tabfunc01-6.7 {
|
||||
SELECT value FROM generate_series(1,10) WHERE value>=5.5;
|
||||
} {6 7 8 9 10}
|
||||
do_execsql_test tabfunc01-6.8 {
|
||||
SELECT value FROM generate_series(1,10) WHERE value>=5.0;
|
||||
} {5 6 7 8 9 10}
|
||||
do_execsql_test tabfunc01-6.9 {
|
||||
SELECT value FROM generate_series(10,1,-1) WHERE value<5.5;
|
||||
} {5 4 3 2 1}
|
||||
do_execsql_test tabfunc01-6.10 {
|
||||
SELECT value FROM generate_series(10,1,-1) WHERE value<5.0;
|
||||
} {4 3 2 1}
|
||||
do_execsql_test tabfunc01-6.11 {
|
||||
SELECT value FROM generate_series(10,1,-1) WHERE value<=5.5;
|
||||
} {5 4 3 2 1}
|
||||
do_execsql_test tabfunc01-6.12 {
|
||||
SELECT value FROM generate_series(10,1,-1) WHERE value<=5.0;
|
||||
} {5 4 3 2 1}
|
||||
do_execsql_test tabfunc01-6.13 {
|
||||
SELECT value FROM generate_series(10,1,-1) WHERE value>5.5;
|
||||
} {10 9 8 7 6}
|
||||
do_execsql_test tabfunc01-6.14 {
|
||||
SELECT value FROM generate_series(10,1,-1) WHERE value>5.0;
|
||||
} {10 9 8 7 6}
|
||||
do_execsql_test tabfunc01-6.15 {
|
||||
SELECT value FROM generate_series(10,1,-1) WHERE value>=5.5;
|
||||
} {10 9 8 7 6}
|
||||
do_execsql_test tabfunc01-6.16 {
|
||||
SELECT value FROM generate_series(10,1,-1) WHERE value>=5.0;
|
||||
} {10 9 8 7 6 5}
|
||||
do_execsql_test tabfunc01-6.17 {
|
||||
SELECT value FROM generate_series(1,10) WHERE value==5.5;
|
||||
} {}
|
||||
do_execsql_test tabfunc01-6.18 {
|
||||
SELECT value FROM generate_series(1,10) WHERE value==5.0;
|
||||
} {5}
|
||||
|
||||
# The next series of tests is verifying that virtual table are able
|
||||
# to optimize the IN operator, even on terms that are not marked "omit".
|
||||
# When the generate_series virtual table is compiled for the testfixture,
|
||||
@@ -440,18 +370,7 @@ do_execsql_test 1100 {
|
||||
where (ref_3.value) in (select 1);
|
||||
} {1}
|
||||
|
||||
# 2025-03-18 /forumpost/1e17219c88
|
||||
# The generate_series() table-valued function is modified so that its
|
||||
# rowid is always its value. That way it can be used on the RHS of a
|
||||
# RIGHT JOIN.
|
||||
#
|
||||
do_execsql_test 1200 {
|
||||
DROP TABLE IF EXISTS t1;
|
||||
CREATE TABLE t1(value INT);
|
||||
INSERT INTO t1 VALUES (1),(2),(3);
|
||||
SELECT t1.value, t2.value
|
||||
FROM t1 RIGHT JOIN generate_series(1,3,1) AS t2 USING(value);
|
||||
} {1 1 2 2 3 3}
|
||||
|
||||
|
||||
# Free up memory allocations
|
||||
intarray_addr
|
||||
|
||||
@@ -25,14 +25,10 @@ VERSION=`cat $TOP/VERSION`
|
||||
HASH=`cut -c1-10 $TOP/manifest.uuid`
|
||||
DATETIME=`grep '^D' $TOP/manifest | tr -c -d '[0-9]' | cut -c1-12`
|
||||
|
||||
# Inject the current version into the TEA autoconf file.
|
||||
# Verify that the version number in the TEA autoconf file is correct.
|
||||
# Fail with an error if not.
|
||||
#
|
||||
sed -e "s/@VERSION@/$VERSION/" \
|
||||
< $TOP/autoconf/tea/configure.ac.in \
|
||||
> $TOP/autoconf/tea/configure.ac
|
||||
# And then verify that that worked...
|
||||
#
|
||||
if grep $VERSION $TOP/autoconf/tea/configure.ac > /dev/null
|
||||
if grep $VERSION $TOP/autoconf/tea/configure.ac
|
||||
then echo "TEA version number ok"
|
||||
else echo "TEA version number mismatch. Should be $VERSION"; exit 1
|
||||
fi
|
||||
@@ -95,8 +91,10 @@ cat <<EOF > tea/generic/tclsqlite3.c
|
||||
EOF
|
||||
cat $TOP/src/tclsqlite.c >> tea/generic/tclsqlite3.c
|
||||
|
||||
sed "s/AC_INIT(\[sqlite\], .*)/AC_INIT([sqlite], [$VERSION])/" tea/configure.ac > tmp
|
||||
mv tmp tea/configure.ac
|
||||
|
||||
cd tea
|
||||
rm -f configure.ac.in
|
||||
autoconf
|
||||
rm -rf autom4te.cache
|
||||
|
||||
|
||||
@@ -528,13 +528,10 @@ foreach f [lsort [array names allflags]] {
|
||||
set fv [expr {$fv*2}]
|
||||
}
|
||||
|
||||
# Sort the column lists so that longer column lists occur first.
|
||||
# In the event of a tie, sort column lists lexicographically.
|
||||
# Sort the column lists so that longer column lists occur first
|
||||
#
|
||||
proc colscmp {a b} {
|
||||
set rc [expr {[llength $b] - [llength $a]}]
|
||||
if {$rc} {return $rc}
|
||||
return [string compare $a $b]
|
||||
return [expr {[llength $b] - [llength $a]}]
|
||||
}
|
||||
set cols_list [lsort -command colscmp $cols_list]
|
||||
|
||||
|
||||
+1
-7
@@ -82,13 +82,7 @@ set nVersion [eval format "%d%03d%03d" [split $zVersion .]]
|
||||
set PWD [pwd]
|
||||
cd $TOP
|
||||
set tmpfile $PWD/tmp-[clock millisec]-[expr {int(rand()*100000000000)}].txt
|
||||
set mksourceid $PWD/mksourceid
|
||||
if {![file exists $mksourceid] && [file exists ${mksourceid}.exe]} {
|
||||
# Workaround for Windows-based Unix-like environments
|
||||
# https://sqlite.org/forum/forumpost/41ba710dd9943453
|
||||
set mksourceid ${mksourceid}.exe
|
||||
}
|
||||
exec $mksourceid manifest > $tmpfile
|
||||
exec $PWD/mksourceid manifest > $tmpfile
|
||||
set fd [open $tmpfile rb]
|
||||
set zSourceId [string trim [read $fd]]
|
||||
close $fd
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#
|
||||
# * Makefile.msc and autoconf/Makefile.msc agree
|
||||
# * src/ctime.tcl is consistent with tool/mkctimec.tcl
|
||||
# * VERSION agrees with autoconf/tea/configure.ac
|
||||
# * src/pragma.h agrees with tool/mkpragmatab.tcl
|
||||
#
|
||||
# Other tests might be added later.
|
||||
@@ -35,6 +36,21 @@ set TCLSH [info nameofexe]
|
||||
#
|
||||
set NERR 0
|
||||
|
||||
######################### autoconf/tea/configure.ac ###########################
|
||||
|
||||
set confac [readfile $ROOT/autoconf/tea/configure.ac]
|
||||
set vers [readfile $ROOT/VERSION]
|
||||
set pattern {AC_INIT([sqlite],[}
|
||||
append pattern [string trim $vers]
|
||||
append pattern {])}
|
||||
if {[string first $pattern $confac]<=0} {
|
||||
puts "ERROR: ./autoconf/tea/configure.ac does not agree with ./VERSION"
|
||||
puts "...... Fix: manually edit ./autoconf/tea/configure.ac and put the"
|
||||
puts "...... correct version number in AC_INIT()"
|
||||
incr NERR
|
||||
}
|
||||
unset confac
|
||||
|
||||
######################### autoconf/Makefile.msc ###############################
|
||||
|
||||
set f1 [readfile $ROOT/autoconf/Makefile.msc]
|
||||
|
||||
Reference in New Issue
Block a user