Compare commits
38 Commits
expr-opt
...
zipfile-fix
| Author | SHA1 | Date | |
|---|---|---|---|
| 5a05c59d4d | |||
| 4a33eed6e9 | |||
| 97b5c8c624 | |||
| 6cc0da6e7d | |||
| 4ccd61107f | |||
| 4ddf151841 | |||
| 5fb9d599ed | |||
| cff66960fd | |||
| a3647d17c8 | |||
| 989e893392 | |||
| 1af2607177 | |||
| 8da97114b5 | |||
| 14706ff98d | |||
| e1a2674f06 | |||
| 38ba1adb36 | |||
| 959e49c081 | |||
| 49cde92f39 | |||
| 2087fa2d97 | |||
| 5192fec123 | |||
| 72e54123c6 | |||
| 001f36f9af | |||
| 3749e75c68 | |||
| fa7abfdf0b | |||
| 5ef150c223 | |||
| 2121fc4141 | |||
| 27a7770f52 | |||
| ab63da3f1c | |||
| 7b60ed803b | |||
| 73937f0ca8 | |||
| 928276043b | |||
| ac0f2d5897 | |||
| eeab52901c | |||
| b2029ca07d | |||
| 074b753bca | |||
| 055cc9c9b9 | |||
| 45fe5b35be | |||
| 1b599c8286 | |||
| 11b6fc93f6 |
+158
-97
@@ -11,6 +11,8 @@
|
||||
TOP = .
|
||||
|
||||
# <<mark>>
|
||||
# ^^^^^^^^-- content between mark and /mark omitted from autoconf/Makefile.msc
|
||||
#
|
||||
# Set this non-0 to create and use the SQLite amalgamation file.
|
||||
#
|
||||
!IFNDEF USE_AMALGAMATION
|
||||
@@ -101,13 +103,6 @@ NO_WARN = $(NO_WARN) -wd4210 -wd4232 -wd4244 -wd4305 -wd4306 -wd4702 -wd4706
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
# Set this non-0 to use the library paths and other options necessary for
|
||||
# Windows Phone 8.1.
|
||||
#
|
||||
!IFNDEF USE_WP81_OPTS
|
||||
USE_WP81_OPTS = 0
|
||||
!ENDIF
|
||||
|
||||
# Set this non-0 to split the SQLite amalgamation file into chunks to
|
||||
# be used for debugging with Visual Studio.
|
||||
#
|
||||
@@ -116,14 +111,8 @@ SPLIT_AMALGAMATION = 0
|
||||
!ENDIF
|
||||
|
||||
# <<mark>>
|
||||
# Set this non-0 to have this makefile assume the Tcl shell executable
|
||||
# (tclsh*.exe) is available in the PATH. By default, this is disabled
|
||||
# for compatibility with older build environments. This setting only
|
||||
# applies if TCLSH_CMD is not set manually.
|
||||
# ^^^^^^^^-- content between mark and /mark omitted from autoconf/Makefile.msc
|
||||
#
|
||||
!IFNDEF USE_TCLSH_IN_PATH
|
||||
USE_TCLSH_IN_PATH = 0
|
||||
!ENDIF
|
||||
|
||||
# Set this non-0 to use zlib, possibly compiling it from source code.
|
||||
#
|
||||
@@ -186,14 +175,6 @@ USE_NATIVE_LIBPATHS = 0
|
||||
USE_RC = 1
|
||||
!ENDIF
|
||||
|
||||
# Set this non-0 to compile binaries suitable for the WinRT environment.
|
||||
# This setting does not apply to any binaries that require Tcl to operate
|
||||
# properly (i.e. the text fixture, etc).
|
||||
#
|
||||
!IFNDEF FOR_WINRT
|
||||
FOR_WINRT = 0
|
||||
!ENDIF
|
||||
|
||||
# Set this non-0 to compile binaries suitable for the UWP environment.
|
||||
# This setting does not apply to any binaries that require Tcl to operate
|
||||
# properly (i.e. the text fixture, etc).
|
||||
@@ -209,6 +190,8 @@ FOR_WIN10 = 0
|
||||
!ENDIF
|
||||
|
||||
# <<mark>>
|
||||
# ^^^^^^^^-- content between mark and /mark omitted from autoconf/Makefile.msc
|
||||
#
|
||||
# Set this non-0 to skip attempting to look for and/or link with the Tcl
|
||||
# runtime library.
|
||||
#
|
||||
@@ -265,6 +248,8 @@ DEBUG = 0
|
||||
!ENDIF
|
||||
|
||||
# <<mark>>
|
||||
# ^^^^^^^^-- content between mark and /mark omitted from autoconf/Makefile.msc
|
||||
#
|
||||
# By default, use --linemacros=1 argument to the mksqlite3c.tcl tool, which
|
||||
# is used to build the amalgamation. This can be turned off to ease debug
|
||||
# of the amalgamation away from the source tree.
|
||||
@@ -360,6 +345,8 @@ SQLITE3EXEPDB = /pdb:sqlite3sh.pdb
|
||||
!ENDIF
|
||||
|
||||
# <<mark>>
|
||||
# ^^^^^^^^-- content between mark and /mark omitted from autoconf/Makefile.msc
|
||||
#
|
||||
# These are the names of the customized Tcl header files used by various parts
|
||||
# of this makefile when the stdcall calling convention is in use. It is not
|
||||
# used for any other purpose.
|
||||
@@ -641,16 +628,24 @@ RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) -I$(TOP)\src $(RCOPTS) $(RCCOPTS)
|
||||
!IF "$(PLATFORM)"=="x86"
|
||||
CORE_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
|
||||
SHELL_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
|
||||
|
||||
# <<mark>>
|
||||
# ^^^^^^^^-- content between mark and /mark omitted from autoconf/Makefile.msc
|
||||
#
|
||||
TEST_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall -DINCLUDE_SQLITE_TCL_H=1 -DSQLITE_TCLAPI=__cdecl
|
||||
# <</mark>>
|
||||
|
||||
!ELSE
|
||||
!IFNDEF PLATFORM
|
||||
CORE_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
|
||||
SHELL_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
|
||||
|
||||
# <<mark>>
|
||||
# ^^^^^^^^-- content between mark and /mark omitted from autoconf/Makefile.msc
|
||||
#
|
||||
TEST_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall -DINCLUDE_SQLITE_TCL_H=1 -DSQLITE_TCLAPI=__cdecl
|
||||
# <</mark>>
|
||||
|
||||
!ELSE
|
||||
CORE_CCONV_OPTS =
|
||||
SHELL_CCONV_OPTS =
|
||||
@@ -777,18 +772,6 @@ SHELL_LINK_OPTS = $(SHELL_CORE_LIB)
|
||||
TCC = $(TCC) -FAcs
|
||||
!ENDIF
|
||||
|
||||
# When compiling the library for use in the WinRT environment,
|
||||
# the following compile-time options must be used as well to
|
||||
# disable use of Win32 APIs that are not available and to enable
|
||||
# use of Win32 APIs that are specific to Windows 8 and/or WinRT.
|
||||
#
|
||||
!IF $(FOR_WINRT)!=0
|
||||
TCC = $(TCC) -DSQLITE_OS_WINRT=1
|
||||
RCC = $(RCC) -DSQLITE_OS_WINRT=1
|
||||
TCC = $(TCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
|
||||
RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
|
||||
!ENDIF
|
||||
|
||||
# C compiler options for the Windows 10 platform (needs MSVC 2015).
|
||||
#
|
||||
!IF $(FOR_WIN10)!=0
|
||||
@@ -801,7 +784,7 @@ BCC = $(BCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
|
||||
# USE_CRT_DLL option is set to force dynamically linking to the
|
||||
# MSVC runtime library.
|
||||
#
|
||||
!IF $(FOR_WINRT)!=0 || $(USE_CRT_DLL)!=0
|
||||
!IF $(USE_CRT_DLL)!=0
|
||||
!IF $(DEBUG)>1
|
||||
TCC = $(TCC) -MDd
|
||||
BCC = $(BCC) -MDd
|
||||
@@ -820,6 +803,8 @@ BCC = $(BCC) -MT
|
||||
!ENDIF
|
||||
|
||||
# <<mark>>
|
||||
# ^^^^^^^^-- content between mark and /mark omitted from autoconf/Makefile.msc
|
||||
#
|
||||
# The mksqlite3c.tcl and mksqlite3h.tcl scripts will pull in
|
||||
# any extension header files by default. For non-amalgamation
|
||||
# builds, we need to make sure the compiler can find these.
|
||||
@@ -870,16 +855,6 @@ MKSQLITE3H_ARGS =
|
||||
!ENDIF
|
||||
# <</mark>>
|
||||
|
||||
# Define -DNDEBUG to compile without debugging (i.e., for production usage)
|
||||
# Omitting the define will cause extra debugging code to be inserted and
|
||||
# includes extra comments when "EXPLAIN stmt" is used.
|
||||
#
|
||||
!IF $(DEBUG)==0
|
||||
TCC = $(TCC) -DNDEBUG
|
||||
BCC = $(BCC) -DNDEBUG
|
||||
RCC = $(RCC) -DNDEBUG
|
||||
!ENDIF
|
||||
|
||||
!IF $(DEBUG)>0 || $(API_ARMOR)!=0 || $(FOR_WIN10)!=0
|
||||
TCC = $(TCC) -DSQLITE_ENABLE_API_ARMOR=1
|
||||
RCC = $(RCC) -DSQLITE_ENABLE_API_ARMOR=1
|
||||
@@ -945,6 +920,8 @@ TCC = $(TCC) /fsanitize=address
|
||||
!ENDIF
|
||||
|
||||
# <<mark>>
|
||||
# ^^^^^^^^-- content between mark and /mark omitted from autoconf/Makefile.msc
|
||||
#
|
||||
# The locations of the Tcl header and library files. Also, the library that
|
||||
# non-stubs enabled programs using Tcl must link against. These variables
|
||||
# (TCLINCDIR, TCLLIBDIR, and LIBTCL) may be overridden via the environment
|
||||
@@ -1184,6 +1161,8 @@ BCC = $(BCC) -Zi
|
||||
!ENDIF
|
||||
|
||||
# <<mark>>
|
||||
# ^^^^^^^^-- content between mark and /mark omitted from autoconf/Makefile.msc
|
||||
#
|
||||
# If zlib support is enabled, add the compiler options for it.
|
||||
#
|
||||
!IF $(USE_ZLIB)!=0
|
||||
@@ -1236,56 +1215,6 @@ LTLINKOPTS = /NOLOGO
|
||||
LTLIBOPTS = /NOLOGO
|
||||
!ENDIF
|
||||
|
||||
# When compiling for use in the WinRT environment, the following
|
||||
# linker option must be used to mark the executable as runnable
|
||||
# only in the context of an application container.
|
||||
#
|
||||
!IF $(FOR_WINRT)!=0
|
||||
LTLINKOPTS = $(LTLINKOPTS) /APPCONTAINER
|
||||
!IF "$(VISUALSTUDIOVERSION)"=="12.0" || "$(VISUALSTUDIOVERSION)"=="14.0"
|
||||
!IFNDEF STORELIBPATH
|
||||
!IF "$(PLATFORM)"=="x86"
|
||||
STORELIBPATH = $(CRTLIBPATH)\store
|
||||
!ELSEIF "$(PLATFORM)"=="x64"
|
||||
STORELIBPATH = $(CRTLIBPATH)\store\amd64
|
||||
!ELSEIF "$(PLATFORM)"=="ARM"
|
||||
STORELIBPATH = $(CRTLIBPATH)\store\arm
|
||||
!ELSE
|
||||
STORELIBPATH = $(CRTLIBPATH)\store
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
STORELIBPATH = $(STORELIBPATH:\\=\)
|
||||
LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(STORELIBPATH)"
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
# When compiling for Windows Phone 8.1, an extra library path is
|
||||
# required.
|
||||
#
|
||||
!IF $(USE_WP81_OPTS)!=0
|
||||
!IFNDEF WP81LIBPATH
|
||||
!IF "$(PLATFORM)"=="x86"
|
||||
WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
|
||||
!ELSEIF "$(PLATFORM)"=="ARM"
|
||||
WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\ARM
|
||||
!ELSE
|
||||
WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
# When compiling for Windows Phone 8.1, some extra linker options
|
||||
# are also required.
|
||||
#
|
||||
!IF $(USE_WP81_OPTS)!=0
|
||||
!IFDEF WP81LIBPATH
|
||||
LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)"
|
||||
!ENDIF
|
||||
LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE
|
||||
LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib
|
||||
LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib
|
||||
!ENDIF
|
||||
|
||||
# When compiling for UWP or the Windows 10 platform, some extra linker
|
||||
# options are also required.
|
||||
#
|
||||
@@ -1309,12 +1238,14 @@ LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib
|
||||
# If either debugging or symbols are enabled, enable PDBs.
|
||||
#
|
||||
!IF $(DEBUG)>1 || $(SYMBOLS)!=0
|
||||
LDFLAGS = /DEBUG $(LDOPTS)
|
||||
LDFLAGS = /NODEFAULTLIB:msvcrt /DEBUG $(LDOPTS)
|
||||
!ELSE
|
||||
LDFLAGS = $(LDOPTS)
|
||||
LDFLAGS = /NODEFAULTLIB:msvcrt $(LDOPTS)
|
||||
!ENDIF
|
||||
|
||||
# <<mark>>
|
||||
# ^^^^^^^^-- content between mark and /mark omitted from autoconf/Makefile.msc
|
||||
#
|
||||
# Start with the Tcl related linker options.
|
||||
#
|
||||
!IF $(NO_TCL)==0
|
||||
@@ -1341,6 +1272,8 @@ LTLIBS = $(LTLIBS) $(LIBICU)
|
||||
###############################################################################
|
||||
|
||||
# <<mark>>
|
||||
# ^^^^^^^^-- content between mark and /mark omitted from autoconf/Makefile.msc
|
||||
#
|
||||
# Object files for the SQLite library (non-amalgamation).
|
||||
#
|
||||
LIBOBJS0 = vdbe.lo parse.lo alter.lo analyze.lo attach.lo auth.lo \
|
||||
@@ -2835,6 +2768,134 @@ tcl-env:
|
||||
@echo JIM_TCLSH = $(JIM_TCLSH)
|
||||
@echo VISUALSTUDIOVERSION = $(VISUALSTUDIOVERSION)
|
||||
|
||||
env:
|
||||
@echo ALL_TCL_TARGETS = $(ALL_TCL_TARGETS)
|
||||
@echo API_ARMOR = $(API_ARMOR)
|
||||
@echo ASAN = $(ASAN)
|
||||
@echo BCC = $(BCC)
|
||||
@echo BUILD_ZLIB = $(BUILD_ZLIB)
|
||||
@echo CC = $(CC)
|
||||
@echo CCOPTS = $(CCOPTS)
|
||||
@echo CHECKER_DEPS = $(CHECKER_DEPS)
|
||||
@echo CORE_CCONV_OPTS = $(CORE_CCONV_OPTS)
|
||||
@echo CORE_COMPILE_OPTS = $(CORE_COMPILE_OPTS)
|
||||
@echo CORE_LINK_DEP = $(CORE_LINK_DEP)
|
||||
@echo CORE_LINK_OPTS = $(CORE_LINK_OPTS)
|
||||
@echo CRTLIBPATH = $(CRTLIBPATH)
|
||||
@echo CSC = $(CSC)
|
||||
@echo DBFUZZ_COMPILE_OPTS = $(DBFUZZ_COMPILE_OPTS)
|
||||
@echo DEBUG = $(DEBUG)
|
||||
@echo DYNAMIC_SHELL = $(DYNAMIC_SHELL)
|
||||
@echo EXT_FEATURE_FLAGS = $(EXT_FEATURE_FLAGS)
|
||||
@echo EXTHDR = $(EXTHDR)
|
||||
@echo EXTRA_SRC = $(EXTRA_SRC)
|
||||
@echo FOR_UWP = $(FOR_UWP)
|
||||
@echo FUZZCHECK_OPTS = $(FUZZCHECK_OPTS)
|
||||
@echo FUZZCHECK_SRC = $(FUZZCHECK_SRC)
|
||||
@echo FUZZDATA = $(FUZZDATA)
|
||||
@echo FUZZERSHELL_COMPILE_OPTS = $(FUZZERSHELL_COMPILE_OPTS)
|
||||
@echo HDR = $(HDR)
|
||||
@echo ICUDIR = $(ICUDIR)
|
||||
@echo ICUINCDIR = $(ICUINCDIR)
|
||||
@echo ICULIBDIR = $(ICULIBDIR)
|
||||
@echo JIM_TCLSH = $(JIM_TCLSH)
|
||||
@echo KV_COMPILE_OPTS = $(KV_COMPILE_OPTS)
|
||||
@echo LDFLAGS = $(LDFLAGS)
|
||||
@echo LD = $(LD)
|
||||
@echo LIBICU = $(LIBICU)
|
||||
@echo LIBOBJ = $(LIBOBJ)
|
||||
@echo LIBREADLINE = $(LIBREADLINE)
|
||||
@echo LIBRESOBJS = $(LIBRESOBJS)
|
||||
@echo LIBTCLPATH = $(LIBTCLPATH)
|
||||
@echo LIBTCLSTUB = $(LIBTCLSTUB)
|
||||
@echo LIBTCL = $(LIBTCL)
|
||||
@echo LTCOMPILE = $(LTCOMPILE)
|
||||
@echo LTLIB = $(LTLIB)
|
||||
@echo LTLIBOPTS = $(LTLIBOPTS)
|
||||
@echo LTLIBPATHS = $(LTLIBPATHS)
|
||||
@echo LTLIBS = $(LTLIBS)
|
||||
@echo LTLINK = $(LTLINK)
|
||||
@echo LTLINKOPTS = $(LTLINKOPTS)
|
||||
@echo LTRCOMPILE = $(LTRCOMPILE)
|
||||
@echo MEMDEBUG = $(MEMDEBUG)
|
||||
@echo MINIMAL_AMALGAMATION = $(MINIMAL_AMALGAMATION)
|
||||
@echo MPTESTER_COMPILE_OPTS = $(MPTESTER_COMPILE_OPTS)
|
||||
@echo NCC = $(NCC)
|
||||
@echo NCRTLIBPATH = $(NCRTLIBPATH)
|
||||
@echo NLTLIBPATHS = $(NLTLIBPATHS)
|
||||
@echo NO_LINEMACROS = $(NO_LINEMACROS)
|
||||
@echo NO_TCL = $(NO_TCL)
|
||||
@echo NO_WARN = $(NO_WARN)
|
||||
@echo NSDKLIBPATH = $(NSDKLIBPATH)
|
||||
@echo NUCRTLIBPATH = $(NUCRTLIBPATH)
|
||||
@echo OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS)
|
||||
@echo OPTIMIZATIONS = $(OPTIMIZATIONS)
|
||||
@echo OSSSHELL_SRC = $(OSSSHELL_SRC)
|
||||
@echo OSTRACE = $(OSTRACE)
|
||||
@echo RBU = $(RBU)
|
||||
@echo RCC = $(RCC)
|
||||
@echo RC = $(RC)
|
||||
@echo READLINE_FLAGS = $(READLINE_FLAGS)
|
||||
@echo REQ_FEATURE_FLAGS = $(REQ_FEATURE_FLAGS)
|
||||
@echo RSYNC_OPT = $(RSYNC_OPT)
|
||||
@echo RSYNC_SRC = $(RSYNC_SRC)
|
||||
@echo SESSION = $(SESSION)
|
||||
@echo SETLK_TIMEOUT = $(SETLK_TIMEOUT)
|
||||
@echo SHELL_CCONV_OPTS = $(SHELL_CCONV_OPTS)
|
||||
@echo SHELL_COMPILE_OPTS = $(SHELL_COMPILE_OPTS)
|
||||
@echo SHELL_CORE_DEP = $(SHELL_CORE_DEP)
|
||||
@echo SHELL_CORE_LIB = $(SHELL_CORE_LIB)
|
||||
@echo SHELL_CORE_SRC = $(SHELL_CORE_SRC)
|
||||
@echo SHELL_DEP = $(SHELL_DEP)
|
||||
@echo SHELL_LINK_OPTS = $(SHELL_LINK_OPTS)
|
||||
@echo SPLIT_AMALGAMATION = $(SPLIT_AMALGAMATION)
|
||||
@echo SQLITETCLDECLSH = $(SQLITETCLDECLSH)
|
||||
@echo SQLITE_TCL_DEP = $(SQLITE_TCL_DEP)
|
||||
@echo SQLITETCLH = $(SQLITETCLH)
|
||||
@echo SRC = $(SRC)
|
||||
@echo STATICALLY_LINK_TCL = $(STATICALLY_LINK_TCL)
|
||||
@echo ST_COMPILE_OPTS = $(ST_COMPILE_OPTS)
|
||||
@echo STORELIBPATH = $(STORELIBPATH)
|
||||
@echo SYMBOLS = $(SYMBOLS)
|
||||
@echo TCC = $(TCC)
|
||||
@echo TCLDIR = $(TCLDIR)
|
||||
@echo TCLINCDIR = $(TCLINCDIR)
|
||||
@echo TCLLIBDIR = $(TCLLIBDIR)
|
||||
@echo TCLLIBPATHS = $(TCLLIBPATHS)
|
||||
@echo TCLLIBS = $(TCLLIBS)
|
||||
@echo TCLSH_CMD = $(TCLSH_CMD)
|
||||
@echo TCLSQLITEEX = $(TCLSQLITEEX)
|
||||
@echo TCLSUFFIX = $(TCLSUFFIX)
|
||||
@echo TCLVERSION = $(TCLVERSION)
|
||||
@echo TEST_CCONV_OPTS = $(TEST_CCONV_OPTS)
|
||||
@echo TESTEXT = $(TESTEXT)
|
||||
@echo TESTFIXTURE_DEP = $(TESTFIXTURE_DEP)
|
||||
@echo TESTFIXTURE_FLAGS = $(TESTFIXTURE_FLAGS)
|
||||
@echo TESTFIXTURE_SRC = $(TESTFIXTURE_SRC)
|
||||
@echo TESTOPTS = $(TESTOPTS)
|
||||
@echo TESTPROGS = $(TESTPROGS)
|
||||
@echo TESTSRC = $(TESTSRC)
|
||||
@echo TLIBS = $(TLIBS)
|
||||
@echo TOP = $(TOP)
|
||||
@echo UCRTLIBPATH = $(UCRTLIBPATH)
|
||||
@echo USE_AMALGAMATION = $(USE_AMALGAMATION)
|
||||
@echo USE_CRT_DLL = $(USE_CRT_DLL)
|
||||
@echo USE_FATAL_WARN = $(USE_FATAL_WARN)
|
||||
@echo USE_FULLWARN = $(USE_FULLWARN)
|
||||
@echo USE_ICU = $(USE_ICU)
|
||||
@echo USE_LISTINGS = $(USE_LISTINGS)
|
||||
@echo USE_NATIVE_LIBPATHS = $(USE_NATIVE_LIBPATHS)
|
||||
@echo USE_RC = $(USE_RC)
|
||||
@echo USE_RUNTIME_CHECKS = $(USE_RUNTIME_CHECKS)
|
||||
@echo USE_SEH = $(USE_SEH)
|
||||
@echo USE_STDCALL = $(USE_STDCALL)
|
||||
@echo USE_ZLIB = $(USE_ZLIB)
|
||||
@echo XCOMPILE = $(XCOMPILE)
|
||||
@echo ZLIBDIR = $(ZLIBDIR)
|
||||
@echo ZLIBINCDIR = $(ZLIBINCDIR)
|
||||
@echo ZLIBLIBDIR = $(ZLIBLIBDIR)
|
||||
@echo ZLIBLIB = $(ZLIBLIB)
|
||||
|
||||
moreclean: clean
|
||||
del /Q $(SQLITE3C) $(SQLITE3H) 2>NUL
|
||||
# <</mark>>
|
||||
|
||||
+7
-90
@@ -101,13 +101,6 @@ NO_WARN = $(NO_WARN) -wd4210 -wd4232 -wd4244 -wd4305 -wd4306 -wd4702 -wd4706
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
# Set this non-0 to use the library paths and other options necessary for
|
||||
# Windows Phone 8.1.
|
||||
#
|
||||
!IFNDEF USE_WP81_OPTS
|
||||
USE_WP81_OPTS = 0
|
||||
!ENDIF
|
||||
|
||||
# Set this non-0 to split the SQLite amalgamation file into chunks to
|
||||
# be used for debugging with Visual Studio.
|
||||
#
|
||||
@@ -156,14 +149,6 @@ USE_NATIVE_LIBPATHS = 0
|
||||
USE_RC = 1
|
||||
!ENDIF
|
||||
|
||||
# Set this non-0 to compile binaries suitable for the WinRT environment.
|
||||
# This setting does not apply to any binaries that require Tcl to operate
|
||||
# properly (i.e. the text fixture, etc).
|
||||
#
|
||||
!IFNDEF FOR_WINRT
|
||||
FOR_WINRT = 0
|
||||
!ENDIF
|
||||
|
||||
# Set this non-0 to compile binaries suitable for the UWP environment.
|
||||
# This setting does not apply to any binaries that require Tcl to operate
|
||||
# properly (i.e. the text fixture, etc).
|
||||
@@ -563,10 +548,14 @@ RCC = $(RC) -DSQLITE_OS_WIN=1 -I. -I$(TOP) $(RCOPTS) $(RCCOPTS)
|
||||
!IF "$(PLATFORM)"=="x86"
|
||||
CORE_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
|
||||
SHELL_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
|
||||
|
||||
|
||||
!ELSE
|
||||
!IFNDEF PLATFORM
|
||||
CORE_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
|
||||
SHELL_CCONV_OPTS = -Gz -guard:cf -DSQLITE_CDECL=__cdecl -DSQLITE_APICALL=__stdcall -DSQLITE_CALLBACK=__stdcall -DSQLITE_SYSAPI=__stdcall
|
||||
|
||||
|
||||
!ELSE
|
||||
CORE_CCONV_OPTS =
|
||||
SHELL_CCONV_OPTS =
|
||||
@@ -667,18 +656,6 @@ SHELL_LINK_OPTS = $(SHELL_CORE_LIB)
|
||||
TCC = $(TCC) -FAcs
|
||||
!ENDIF
|
||||
|
||||
# When compiling the library for use in the WinRT environment,
|
||||
# the following compile-time options must be used as well to
|
||||
# disable use of Win32 APIs that are not available and to enable
|
||||
# use of Win32 APIs that are specific to Windows 8 and/or WinRT.
|
||||
#
|
||||
!IF $(FOR_WINRT)!=0
|
||||
TCC = $(TCC) -DSQLITE_OS_WINRT=1
|
||||
RCC = $(RCC) -DSQLITE_OS_WINRT=1
|
||||
TCC = $(TCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
|
||||
RCC = $(RCC) -DWINAPI_FAMILY=WINAPI_FAMILY_APP
|
||||
!ENDIF
|
||||
|
||||
# C compiler options for the Windows 10 platform (needs MSVC 2015).
|
||||
#
|
||||
!IF $(FOR_WIN10)!=0
|
||||
@@ -691,7 +668,7 @@ BCC = $(BCC) /d2guard4 -D_ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE
|
||||
# USE_CRT_DLL option is set to force dynamically linking to the
|
||||
# MSVC runtime library.
|
||||
#
|
||||
!IF $(FOR_WINRT)!=0 || $(USE_CRT_DLL)!=0
|
||||
!IF $(USE_CRT_DLL)!=0
|
||||
!IF $(DEBUG)>1
|
||||
TCC = $(TCC) -MDd
|
||||
BCC = $(BCC) -MDd
|
||||
@@ -710,16 +687,6 @@ BCC = $(BCC) -MT
|
||||
!ENDIF
|
||||
|
||||
|
||||
# Define -DNDEBUG to compile without debugging (i.e., for production usage)
|
||||
# Omitting the define will cause extra debugging code to be inserted and
|
||||
# includes extra comments when "EXPLAIN stmt" is used.
|
||||
#
|
||||
!IF $(DEBUG)==0
|
||||
TCC = $(TCC) -DNDEBUG
|
||||
BCC = $(BCC) -DNDEBUG
|
||||
RCC = $(RCC) -DNDEBUG
|
||||
!ENDIF
|
||||
|
||||
!IF $(DEBUG)>0 || $(API_ARMOR)!=0 || $(FOR_WIN10)!=0
|
||||
TCC = $(TCC) -DSQLITE_ENABLE_API_ARMOR=1
|
||||
RCC = $(RCC) -DSQLITE_ENABLE_API_ARMOR=1
|
||||
@@ -909,56 +876,6 @@ LTLINKOPTS = /NOLOGO
|
||||
LTLIBOPTS = /NOLOGO
|
||||
!ENDIF
|
||||
|
||||
# When compiling for use in the WinRT environment, the following
|
||||
# linker option must be used to mark the executable as runnable
|
||||
# only in the context of an application container.
|
||||
#
|
||||
!IF $(FOR_WINRT)!=0
|
||||
LTLINKOPTS = $(LTLINKOPTS) /APPCONTAINER
|
||||
!IF "$(VISUALSTUDIOVERSION)"=="12.0" || "$(VISUALSTUDIOVERSION)"=="14.0"
|
||||
!IFNDEF STORELIBPATH
|
||||
!IF "$(PLATFORM)"=="x86"
|
||||
STORELIBPATH = $(CRTLIBPATH)\store
|
||||
!ELSEIF "$(PLATFORM)"=="x64"
|
||||
STORELIBPATH = $(CRTLIBPATH)\store\amd64
|
||||
!ELSEIF "$(PLATFORM)"=="ARM"
|
||||
STORELIBPATH = $(CRTLIBPATH)\store\arm
|
||||
!ELSE
|
||||
STORELIBPATH = $(CRTLIBPATH)\store
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
STORELIBPATH = $(STORELIBPATH:\\=\)
|
||||
LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(STORELIBPATH)"
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
# When compiling for Windows Phone 8.1, an extra library path is
|
||||
# required.
|
||||
#
|
||||
!IF $(USE_WP81_OPTS)!=0
|
||||
!IFNDEF WP81LIBPATH
|
||||
!IF "$(PLATFORM)"=="x86"
|
||||
WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
|
||||
!ELSEIF "$(PLATFORM)"=="ARM"
|
||||
WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\ARM
|
||||
!ELSE
|
||||
WP81LIBPATH = $(PROGRAMFILES_X86)\Windows Phone Kits\8.1\lib\x86
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
!ENDIF
|
||||
|
||||
# When compiling for Windows Phone 8.1, some extra linker options
|
||||
# are also required.
|
||||
#
|
||||
!IF $(USE_WP81_OPTS)!=0
|
||||
!IFDEF WP81LIBPATH
|
||||
LTLINKOPTS = $(LTLINKOPTS) "/LIBPATH:$(WP81LIBPATH)"
|
||||
!ENDIF
|
||||
LTLINKOPTS = $(LTLINKOPTS) /DYNAMICBASE
|
||||
LTLINKOPTS = $(LTLINKOPTS) WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib
|
||||
LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib
|
||||
!ENDIF
|
||||
|
||||
# When compiling for UWP or the Windows 10 platform, some extra linker
|
||||
# options are also required.
|
||||
#
|
||||
@@ -982,9 +899,9 @@ LTLINKOPTS = $(LTLINKOPTS) /NODEFAULTLIB:libucrt.lib /DEFAULTLIB:ucrt.lib
|
||||
# If either debugging or symbols are enabled, enable PDBs.
|
||||
#
|
||||
!IF $(DEBUG)>1 || $(SYMBOLS)!=0
|
||||
LDFLAGS = /DEBUG $(LDOPTS)
|
||||
LDFLAGS = /NODEFAULTLIB:msvcrt /DEBUG $(LDOPTS)
|
||||
!ELSE
|
||||
LDFLAGS = $(LDOPTS)
|
||||
LDFLAGS = /NODEFAULTLIB:msvcrt $(LDOPTS)
|
||||
!ENDIF
|
||||
|
||||
|
||||
|
||||
@@ -679,6 +679,7 @@ proc sqlite-check-common-system-deps {} {
|
||||
define HAVE_ZLIB 1
|
||||
define LDFLAGS_ZLIB -lz
|
||||
sqlite-add-shell-opt -DSQLITE_HAVE_ZLIB=1
|
||||
sqlite-add-feature-flag -DSQLITE_HAVE_ZLIB=1
|
||||
} else {
|
||||
define HAVE_ZLIB 0
|
||||
define LDFLAGS_ZLIB ""
|
||||
|
||||
@@ -760,7 +760,8 @@ static int fts3PendingTermsAddOne(
|
||||
|
||||
pList = (PendingList *)fts3HashFind(pHash, zToken, nToken);
|
||||
if( pList ){
|
||||
assert( pList->nData+nToken+sizeof(Fts3HashElem) <= (i64)p->nPendingData );
|
||||
assert( (i64)pList->nData+(i64)nToken+(i64)sizeof(Fts3HashElem)
|
||||
<= (i64)p->nPendingData );
|
||||
p->nPendingData -= (int)(pList->nData + nToken + sizeof(Fts3HashElem));
|
||||
}
|
||||
if( fts3PendingListAppend(&pList, p->iPrevDocid, iCol, iPos, &rc) ){
|
||||
|
||||
+1
-2
@@ -329,6 +329,7 @@ static int fileStat(
|
||||
b1[sz] = 0;
|
||||
rc = _wstat(b1, pStatBuf);
|
||||
if( rc==0 ) statTimesToUtc(zPath, pStatBuf);
|
||||
sqlite3_free(b1);
|
||||
return rc;
|
||||
#else
|
||||
return stat(zPath, pStatBuf);
|
||||
@@ -459,7 +460,6 @@ static int writeFile(
|
||||
|
||||
if( mtime>=0 ){
|
||||
#if defined(_WIN32)
|
||||
#if !SQLITE_OS_WINRT
|
||||
/* Windows */
|
||||
FILETIME lastAccess;
|
||||
FILETIME lastWrite;
|
||||
@@ -490,7 +490,6 @@ static int writeFile(
|
||||
}else{
|
||||
return 1;
|
||||
}
|
||||
#endif
|
||||
#elif defined(AT_FDCWD) && 0 /* utimensat() is not universally available */
|
||||
/* Recent unix */
|
||||
struct timespec times[2];
|
||||
|
||||
+3
-2
@@ -900,11 +900,12 @@ static int zipfileGetEntry(
|
||||
rc = zipfileReadData(pFile, aRead, szFix, pNew->cds.iOffset, pzErr);
|
||||
}else{
|
||||
aRead = (u8*)&aBlob[pNew->cds.iOffset];
|
||||
if( (pNew->cds.iOffset + ZIPFILE_LFH_FIXED_SZ)>nBlob ){
|
||||
if( (pNew->cds.iOffset + ZIPFILE_LFH_FIXED_SZ)>(unsigned)nBlob ){
|
||||
rc = zipfileCorrupt(pzErr);
|
||||
}
|
||||
}
|
||||
|
||||
memset(&lfh, 0, sizeof(lfh));
|
||||
if( rc==SQLITE_OK ) rc = zipfileReadLFH(aRead, &lfh);
|
||||
if( rc==SQLITE_OK ){
|
||||
pNew->iDataOff = pNew->cds.iOffset + ZIPFILE_LFH_FIXED_SZ;
|
||||
@@ -1008,7 +1009,7 @@ static void zipfileInflate(
|
||||
if( err!=Z_STREAM_END ){
|
||||
zipfileCtxErrorMsg(pCtx, "inflate() failed (%d)", err);
|
||||
}else{
|
||||
sqlite3_result_blob(pCtx, aRes, nOut, zipfileFree);
|
||||
sqlite3_result_blob(pCtx, aRes, (int)str.total_out, zipfileFree);
|
||||
aRes = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -254,6 +254,7 @@ Both fields can have one of the following values:
|
||||
#define QRF_TEXT_Html 4 /* HTML-style quoting */
|
||||
#define QRF_TEXT_Tcl 5 /* C/Tcl quoting */
|
||||
#define QRF_TEXT_Json 6 /* JSON quoting */
|
||||
#define QRF_TEXT_Relaxed 7 /* Relaxed SQL quoting */
|
||||
~~~
|
||||
|
||||
A value of QRF_TEXT_Auto means that the query result formatter will choose
|
||||
@@ -267,6 +268,14 @@ look like SQL literals. That means the value will be surrounded by
|
||||
single-quotes (U+0027) and any single-quotes contained within the text
|
||||
will be doubled.
|
||||
|
||||
QRF_TEXT_Relaxed is similar to QRF_TEXT_Sql, except that it automatically
|
||||
reverts to QRF_TEXT_Plain if the value to be displayed does not contain
|
||||
special characters and is not easily confused with a NULL or a numeric
|
||||
value. QRF_TEXT_Relaxed strives to minimize the amount of quoting syntax
|
||||
while keeping the result unambiguous and easy for humans to read. The
|
||||
precise rules for when quoting is omitted in QRF_TEXT_Relaxed, and when
|
||||
it is applied, might be adjusted in future releases.
|
||||
|
||||
A value of QRF_TEXT_Csv means that text values are escaped in accordance
|
||||
with RFC 4180, which defines Comma-Separated-Value or CSV files.
|
||||
Text strings that contain no special values appears as-is. Text strings
|
||||
|
||||
+86
-16
@@ -102,6 +102,15 @@ static const char qrfCType[] = {
|
||||
#define qrfAlpha(x) ((qrfCType[(unsigned char)x]&4)!=0)
|
||||
#define qrfAlnum(x) ((qrfCType[(unsigned char)x]&6)!=0)
|
||||
|
||||
#ifndef deliberate_fall_through
|
||||
/* Quiet some compilers about some of our intentional code. */
|
||||
# if defined(GCC_VERSION) && GCC_VERSION>=7000000
|
||||
# define deliberate_fall_through __attribute__((fallthrough));
|
||||
# else
|
||||
# define deliberate_fall_through
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Set an error code and error message.
|
||||
*/
|
||||
@@ -703,6 +712,45 @@ static void qrfEscape(
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** Determine if the string z[] can be shown as plain text. Return true
|
||||
** if z[] is unambiguously text. Return false if z[] needs to be
|
||||
** quoted.
|
||||
**
|
||||
** All of the following must be true in order for z[] to be relaxable:
|
||||
**
|
||||
** (1) z[] does not begin or end with ' or whitespace
|
||||
** (2) z[] is not the same as the NULL rendering
|
||||
** (3) z[] does not looks like a numeric literal
|
||||
*/
|
||||
static int qrfRelaxable(Qrf *p, const char *z){
|
||||
size_t i, n;
|
||||
if( z[0]=='\'' || qrfSpace(z[0]) ) return 0;
|
||||
if( z[0]==0 && (p->spec.zNull==0 || p->spec.zNull[0]==0) ) return 0;
|
||||
n = strlen(z);
|
||||
if( z[n-1]=='\'' || qrfSpace(z[n-1]) ) return 0;
|
||||
if( p->spec.zNull && strcmp(p->spec.zNull,z)==0 ) return 0;
|
||||
i = (z[0]=='-' || z[0]=='+');
|
||||
if( strcmp(z+i,"Inf")==0 ) return 0;
|
||||
if( !qrfDigit(z[i]) ) return 1;
|
||||
i++;
|
||||
while( qrfDigit(z[i]) ){ i++; }
|
||||
if( z[i]==0 ) return 0;
|
||||
if( z[i]=='.' ){
|
||||
i++;
|
||||
while( qrfDigit(z[i]) ){ i++; }
|
||||
if( z[i]==0 ) return 0;
|
||||
}
|
||||
if( z[i]=='e' || z[i]=='E' ){
|
||||
i++;
|
||||
if( z[i]=='+' || z[i]=='-' ){ i++; }
|
||||
if( !qrfDigit(z[i]) ) return 1;
|
||||
i++;
|
||||
while( qrfDigit(z[i]) ){ i++; }
|
||||
}
|
||||
return z[i]!=0;
|
||||
}
|
||||
|
||||
/*
|
||||
** If a field contains any character identified by a 1 in the following
|
||||
** array, then the string must be quoted for CSV.
|
||||
@@ -732,6 +780,12 @@ static const char qrfCsvQuote[] = {
|
||||
static void qrfEncodeText(Qrf *p, sqlite3_str *pOut, const char *zTxt){
|
||||
int iStart = sqlite3_str_length(pOut);
|
||||
switch( p->spec.eText ){
|
||||
case QRF_TEXT_Relaxed:
|
||||
if( qrfRelaxable(p, zTxt) ){
|
||||
sqlite3_str_appendall(pOut, zTxt);
|
||||
break;
|
||||
}
|
||||
deliberate_fall_through; /* FALLTHRU */
|
||||
case QRF_TEXT_Sql: {
|
||||
if( p->spec.eEsc==QRF_ESC_Off ){
|
||||
sqlite3_str_appendf(pOut, "%Q", zTxt);
|
||||
@@ -1432,20 +1486,33 @@ static void qrfRowSeparator(sqlite3_str *pOut, qrfColData *p, char cSep){
|
||||
#define BOX_124 "\342\224\264" /* U+2534 -'- */
|
||||
#define BOX_1234 "\342\224\274" /* U+253c -|- */
|
||||
|
||||
/* Rounded corners: */
|
||||
#define BOX_R12 "\342\225\260" /* U+2570 '- */
|
||||
#define BOX_R23 "\342\225\255" /* U+256d ,- */
|
||||
#define BOX_R34 "\342\225\256" /* U+256e -, */
|
||||
#define BOX_R14 "\342\225\257" /* U+256f -' */
|
||||
|
||||
/* Doubled horizontal lines: */
|
||||
#define DBL_24 "\342\225\220" /* U+2550 === */
|
||||
#define DBL_123 "\342\225\236" /* U+255e |= */
|
||||
#define DBL_134 "\342\225\241" /* U+2561 =| */
|
||||
#define DBL_1234 "\342\225\252" /* U+256a =|= */
|
||||
|
||||
/* Draw horizontal line N characters long using unicode box
|
||||
** characters
|
||||
*/
|
||||
static void qrfBoxLine(sqlite3_str *pOut, int N){
|
||||
const char zDash[] =
|
||||
BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24
|
||||
BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24;
|
||||
const int nDash = sizeof(zDash) - 1;
|
||||
static void qrfBoxLine(sqlite3_str *pOut, int N, int bDbl){
|
||||
const char *azDash[2] = {
|
||||
BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24 BOX_24,
|
||||
DBL_24 DBL_24 DBL_24 DBL_24 DBL_24 DBL_24 DBL_24 DBL_24 DBL_24 DBL_24
|
||||
};/* 0 1 2 3 4 5 6 7 8 9 */
|
||||
const int nDash = 30;
|
||||
N *= 3;
|
||||
while( N>nDash ){
|
||||
sqlite3_str_append(pOut, zDash, nDash);
|
||||
sqlite3_str_append(pOut, azDash[bDbl], nDash);
|
||||
N -= nDash;
|
||||
}
|
||||
sqlite3_str_append(pOut, zDash, N);
|
||||
sqlite3_str_append(pOut, azDash[bDbl], N);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1456,7 +1523,8 @@ static void qrfBoxSeparator(
|
||||
qrfColData *p,
|
||||
const char *zSep1,
|
||||
const char *zSep2,
|
||||
const char *zSep3
|
||||
const char *zSep3,
|
||||
int bDbl
|
||||
){
|
||||
int i;
|
||||
if( p->nCol>0 ){
|
||||
@@ -1464,10 +1532,10 @@ static void qrfBoxSeparator(
|
||||
if( useBorder ){
|
||||
sqlite3_str_appendall(pOut, zSep1);
|
||||
}
|
||||
qrfBoxLine(pOut, p->a[0].w+p->nMargin);
|
||||
qrfBoxLine(pOut, p->a[0].w+p->nMargin, bDbl);
|
||||
for(i=1; i<p->nCol; i++){
|
||||
sqlite3_str_appendall(pOut, zSep2);
|
||||
qrfBoxLine(pOut, p->a[i].w+p->nMargin);
|
||||
qrfBoxLine(pOut, p->a[i].w+p->nMargin, bDbl);
|
||||
}
|
||||
if( useBorder ){
|
||||
sqlite3_str_appendall(pOut, zSep3);
|
||||
@@ -1875,7 +1943,7 @@ static void qrfColumnar(Qrf *p){
|
||||
rowStart += 3;
|
||||
rowSep = "\n";
|
||||
}else{
|
||||
qrfBoxSeparator(p->pOut, &data, BOX_23, BOX_234, BOX_34);
|
||||
qrfBoxSeparator(p->pOut, &data, BOX_R23, BOX_234, BOX_R34, 0);
|
||||
}
|
||||
break;
|
||||
case QRF_STYLE_Table:
|
||||
@@ -2008,8 +2076,10 @@ static void qrfColumnar(Qrf *p){
|
||||
break;
|
||||
}
|
||||
case QRF_STYLE_Box: {
|
||||
if( isTitleDataSeparator || data.bMultiRow ){
|
||||
qrfBoxSeparator(p->pOut, &data, BOX_123, BOX_1234, BOX_134);
|
||||
if( isTitleDataSeparator ){
|
||||
qrfBoxSeparator(p->pOut, &data, DBL_123, DBL_1234, DBL_134, 1);
|
||||
}else if( data.bMultiRow ){
|
||||
qrfBoxSeparator(p->pOut, &data, BOX_123, BOX_1234, BOX_134, 0);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2044,7 +2114,7 @@ static void qrfColumnar(Qrf *p){
|
||||
if( p->spec.bBorder!=QRF_No ){
|
||||
switch( p->spec.eStyle ){
|
||||
case QRF_STYLE_Box:
|
||||
qrfBoxSeparator(p->pOut, &data, BOX_12, BOX_124, BOX_14);
|
||||
qrfBoxSeparator(p->pOut, &data, BOX_R12, BOX_124, BOX_R14, 0);
|
||||
break;
|
||||
case QRF_STYLE_Table:
|
||||
qrfRowSeparator(p->pOut, &data, '+');
|
||||
@@ -2501,8 +2571,8 @@ static void qrfInitialize(
|
||||
if( p->mxHeight<=0 ) p->mxHeight = 2147483647;
|
||||
if( p->spec.eStyle>QRF_STYLE_Table ) p->spec.eStyle = QRF_Auto;
|
||||
if( p->spec.eEsc>QRF_ESC_Symbol ) p->spec.eEsc = QRF_Auto;
|
||||
if( p->spec.eText>QRF_TEXT_Json ) p->spec.eText = QRF_Auto;
|
||||
if( p->spec.eTitle>QRF_TEXT_Json ) p->spec.eTitle = QRF_Auto;
|
||||
if( p->spec.eText>QRF_TEXT_Relaxed ) p->spec.eText = QRF_Auto;
|
||||
if( p->spec.eTitle>QRF_TEXT_Relaxed ) p->spec.eTitle = QRF_Auto;
|
||||
if( p->spec.eBlob>QRF_BLOB_Size ) p->spec.eBlob = QRF_Auto;
|
||||
qrf_reinit:
|
||||
switch( p->spec.eStyle ){
|
||||
|
||||
@@ -109,6 +109,7 @@ int sqlite3_format_query_result(
|
||||
#define QRF_TEXT_Html 4 /* HTML-style quoting */
|
||||
#define QRF_TEXT_Tcl 5 /* C/Tcl quoting */
|
||||
#define QRF_TEXT_Json 6 /* JSON quoting */
|
||||
#define QRF_TEXT_Relaxed 7 /* Relaxed SQL quoting */
|
||||
|
||||
/*
|
||||
** Quoting styles for BLOBs
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
C More\saggressive\soptimization\sof\sIS\sNULL\sand\sIS\sNOT\sNULL\soperators.
|
||||
D 2025-12-03T18:18:29.761
|
||||
C In\sthe\szipfile\sextension,\sonly\sreturn\sas\smany\sbytes\sas\sInflate\sactually\ngenerated.\s\s[forum:/forumpost/761eac3c82|Forum\spost\s761eac3c82].\nAdjust\s./configure\sso\sthat\sit\sbuilds\szipfile\sinto\stestfixture\sif\sZLIB\nis\savailable,\sso\sthat\stests\sget\srun\son\sunix\splatforms.
|
||||
D 2025-12-06T20:41:24.037
|
||||
F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
F LICENSE.md 6bc480fc673fb4acbc4094e77edb326267dd460162d7723c7f30bee2d3d9e97d
|
||||
F Makefile.in 3ce07126d7e87c7464301482e161fdae6a51d0a2aa06b200b8f0000ef4d6163b
|
||||
F Makefile.linux-generic bd3e3cacd369821a6241d4ea1967395c962dfe3057e38cb0a435cee0e8b789d0
|
||||
F Makefile.msc 295bc62fdd8663a6581cc43252403fac3cb784002164ff53fac8d15fc72fdfaa
|
||||
F Makefile.msc cc18f77083ff3b94f8bba823a3759b7a0c0e87ffe8733c8b8dff66371df4e880
|
||||
F README.md 3fa51fc7ababc32edd175ae8b2986c86d5ea120c1cb1e57c7f7849492d1405ec
|
||||
F VERSION 74672bfd4c7826c0fc6f84762488a707c52e7d2d94af42ccb0edcc6c74311c41
|
||||
F art/icon-243x273.gif 9750b734f82fdb3dc43127753d5e6fbf3b62c9f4e136c2fbf573b2f57ea87af5
|
||||
@@ -18,7 +18,7 @@ F art/sqlite370.svg 40b7e2fe8aac3add5d56dd86ab8d427a4eca5bcb3fe4f8946cb3794e1821
|
||||
F auto.def 44a0d1bf09d78355fc88251ccbf8e64e6341fd89c11de68a01c3645e53a2bade
|
||||
F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac
|
||||
F autoconf/Makefile.in 306f500fce8cae9e1af9459f1ac7fe89ce46999594ef3fdc62dc9d7d651fb091
|
||||
F autoconf/Makefile.msc 7952ed1fbb824f9421688e6b46d09fc4d5a13decec791a6264be4f65e64dfc08
|
||||
F autoconf/Makefile.msc 5edea0afa71af09f45ab25a6a09d204e8744cbe9f3cf54222502cf9e41aa4325
|
||||
F autoconf/README.first f1d3876e9a7852c22f275a6f06814e64934cecbc0b5b9617d64849094c1fd136
|
||||
F autoconf/README.txt b749816b8452b3af994dc6d607394bef3df1736d7e09359f1087de8439a52807
|
||||
F autoconf/auto.def 3d994f3a9cc9b712dbce92a5708570ddcf3b988141b6eb738f2ed16127a9f0ac
|
||||
@@ -47,7 +47,7 @@ F autosetup/find_tclconfig.tcl e64886ffe3b982d4df42cd28ed91fe0b5940c2c5785e126c1
|
||||
F autosetup/jimsh0.c 916bbdf8023fbda9937afae57d81a853d8c2ea00f2320aa27becbc33574f963d
|
||||
F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba
|
||||
F autosetup/proj.tcl 6fc14ef82b19b77a95788ffbcfad7989b4e3cb4ce96a21dcb5cf7312f362fba9
|
||||
F autosetup/sqlite-config.tcl 97dc76d332ae3344d02d15c99c57db0ac063537e9133cbee0520d48ba0eddc08
|
||||
F autosetup/sqlite-config.tcl 7463d59c9c5e86ca286ea16fdab943058beb9346110049eca435154795890f71
|
||||
F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9
|
||||
F autosetup/teaish/README.txt b40071e6f8506500a2f7f71d5fc69e0bf87b9d7678dd9da1e5b4d0acbf40b1ca
|
||||
F autosetup/teaish/core.tcl e014dd95900c7f9a34e8e0f460f47e94841059827bce8b4c49668b0c7ae3f1a0
|
||||
@@ -97,7 +97,7 @@ F ext/fts3/fts3_tokenizer.h 64c6ef6c5272c51ebe60fc607a896e84288fcbc3
|
||||
F ext/fts3/fts3_tokenizer1.c c1de4ae28356ad98ccb8b2e3388a7fdcce7607b5523738c9afb6275dab765154
|
||||
F ext/fts3/fts3_unicode.c de426ff05c1c2e7bce161cf6b706638419c3a1d9c2667de9cb9dc0458c18e226
|
||||
F ext/fts3/fts3_unicode2.c 416eb7e1e81142703520d284b768ca2751d40e31fa912cae24ba74860532bf0f
|
||||
F ext/fts3/fts3_write.c 66abcd0a35c722ad13ea73d4c31fc7773b9a01b35d434ad945cbf17b4f2563bd
|
||||
F ext/fts3/fts3_write.c 3a412c62e39c72283e34a51ec60c59eee6d684882fea7156b09a9733bd1f10e8
|
||||
F ext/fts3/fts3speed.tcl b54caf6a18d38174f1a6e84219950d85e98bb1e9
|
||||
F ext/fts3/tool/fts3cov.sh c331d006359456cf6f8f953e37f2b9c7d568f3863f00bb5f7eb87fea4ac01b73
|
||||
F ext/fts3/tool/fts3view.c 413c346399159df81f86c4928b7c4a455caab73bfbc8cd68f950f632e5751674
|
||||
@@ -372,7 +372,7 @@ F ext/misc/dbdump.c 678f1b9ae2317b4473f65d03132a2482c3f4b08920799ed80feedd2941a0
|
||||
F ext/misc/decimal.c d4883de142f6dcd36eda23da40b55e2b51374e7b01eb54a7173940191389fc5e
|
||||
F ext/misc/eval.c 04bc9aada78c888394204b4ed996ab834b99726fb59603b0ee3ed6e049755dc1
|
||||
F ext/misc/explain.c 606100185fb90d6a1eade1ed0414d53503c86820d8956a06e3b0a56291894f2b
|
||||
F ext/misc/fileio.c 61af623160c073b605b4ff1f67d278c4c348956efa08f6201756577c7a050d17
|
||||
F ext/misc/fileio.c 452300ca34fadafd2bb9eb09557de5a518da1fd2349f9f9cedd22b1566a7164f
|
||||
F ext/misc/fossildelta.c 2fc2dd4f34f478df674887db62586b1071c4cd3c9e73ee40f9ee669670e482d1
|
||||
F ext/misc/fuzzer.c 6b231352815304ba60d8e9ec2ee73d4918e74d9b76bda8940ba2b64e8777515e
|
||||
F ext/misc/ieee754.c 176c061c94857b543313959289cb60cf777c999fd002f82b53d194b95e9f347a
|
||||
@@ -414,12 +414,12 @@ F ext/misc/vtablog.c 2d04386c2f5a3bb93bc9ae978f0b7dcd5a264e126abd640dd6d82aa9067
|
||||
F ext/misc/vtshim.c e5bce24ab8c532f4fdc600148718fe1802cb6ed57417f1c1032d8961f72b0e8f
|
||||
F ext/misc/wholenumber.c 0fa0c082676b7868bf2fa918e911133f2b349bcdceabd1198bba5f65b4fc0668
|
||||
F ext/misc/windirent.h 02211ce51f3034c675f2dbf4d228194d51b3ee05734678bad5106fff6292e60c
|
||||
F ext/misc/zipfile.c 09e6e3a3ff40a99677de3c0bc6569bd5f4709b1844ac3d1c1452a456c5a62f1c
|
||||
F ext/misc/zipfile.c d792ed9b936ddfe9a210ecc893352afaee306c63b084187f6e44951f6f669e21
|
||||
F ext/misc/zorder.c bddff2e1b9661a90c95c2a9a9c7ecd8908afab5763256294dd12d609d4664eee
|
||||
F ext/qrf/README.md 86fc5c3c5e3eddbe54fc1235cbdc52b8c2c0732791d224345c3014cd45c4c0e7
|
||||
F ext/qrf/README.md 6ee2f6431c8260854f815123c7e14769e77c7d0547424b852ae6216099cfdc50
|
||||
F ext/qrf/dev-notes.md e68a6d91ce4c7eb296ef2daadc2bb79c95c317ad15b9fafe40850c67b29c2430
|
||||
F ext/qrf/qrf.c c50368ea2be3ab67bd6698d8b34bf70210d3fbf6b3659ed328543e5ec8d69eff
|
||||
F ext/qrf/qrf.h 2cd7bd43579c522d3ae5c16034c7fdf41085684189811ae8e18ebc932a1cc79f
|
||||
F ext/qrf/qrf.c 7fb2c4b600fcba4439a3ce8f7aed95f726f15548ce375b78cd983388a0ecebf7
|
||||
F ext/qrf/qrf.h 0f0387eb4c56eaa46405cd640132624933377e46df3d2baa940392f9a7d35768
|
||||
F ext/rbu/rbu.c 801450b24eaf14440d8fd20385aacc751d5c9d6123398df41b1b5aa804bf4ce8
|
||||
F ext/rbu/rbu1.test 25870dd7db7eb5597e2b4d6e29e7a7e095abf332660f67d89959552ce8f8f255
|
||||
F ext/rbu/rbu10.test 7c22caa32c2ff26983ca8320779a31495a6555737684af7aba3daaf762ef3363
|
||||
@@ -669,9 +669,9 @@ F mptest/multiwrite01.test dab5c5f8f9534971efce679152c5146da265222d
|
||||
F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b
|
||||
F sqlite3.1 1b9c24374a85dfc7eb8fa7c4266ee0db4f9609cceecfc5481cd8307e5af04366
|
||||
F sqlite3.pc.in e6dee284fba59ef500092fdc1843df3be8433323a3733c91da96690a50a5b398
|
||||
F src/alter.c 4f483968fcbb985d4e2608fcd78ff24de66d83231fc1c96f33ab014ccb9dffa0
|
||||
F src/alter.c fc36b19273ffe364aeb4d00ba04bda8798ad7a67fec7a035ee8ee56272e1bdbe
|
||||
F src/analyze.c 03bcfc083fc0cccaa9ded93604e1d4244ea245c17285d463ef6a60425fcb247d
|
||||
F src/attach.c 9af61b63b10ee702b1594ecd24fb8cea0839cfdb6addee52fba26fa879f5db9d
|
||||
F src/attach.c 7cf07d4fa42b9fc8662237c60c40b730326c30aa90ae5fffc0b18b2d726ebf61
|
||||
F src/auth.c 54ab9c6c5803b47c0d45b76ce27eff22a03b4b1f767c5945a3a4eb13aa4c78dc
|
||||
F src/backup.c 5c97e8023aab1ce14a42387eb3ae00ba5a0644569e3476f38661fa6f824c3523
|
||||
F src/bitvec.c e242d4496774dfc88fa278177dd23b607dce369ccafb3f61b41638eea2c9b399
|
||||
@@ -687,9 +687,9 @@ F src/date.c e19e0cfff9a41bfdd884c655755f6f00bca4c1a22272b56e0dd6667b7ea893a2
|
||||
F src/dbpage.c c9ea81c11727f27e02874611e92773e68e2a90a875ef2404b084564c235fd91f
|
||||
F src/dbstat.c 73362c0df0f40ad5523a6f5501224959d0976757b511299bf892313e79d14f5c
|
||||
F src/delete.c 03a77ba20e54f0f42ebd8eddf15411ed6bdb06a2c472ac4b6b336521bf7cea42
|
||||
F src/expr.c a8f43b1a61b7083a5bba00a70df0aa13cd33e9422a81405135d8d6c9b63bb990
|
||||
F src/expr.c b4530f3e23d8ea38c7de4c7b55af52d43156c79128c042a580e670776f59a9bc
|
||||
F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007
|
||||
F src/fkey.c 928ed2517e8732113d2b9821aa37af639688d752f4ea9ac6e0e393d713eeb76f
|
||||
F src/fkey.c c065da737307a29e4d240ac727758dbf4102cb3218a1f651eb689b6a6fa12531
|
||||
F src/func.c 0b802107498048d3dcac0b757720bcb8506507ce02159e213ab8161458eb293b
|
||||
F src/global.c a19e4b1ca1335f560e9560e590fc13081e21f670643367f99cb9e8f9dc7d615b
|
||||
F src/hash.c 03c8c0f4be9e8bcb6de65aa26d34a61d48a9430747084a69f9469fbb00ea52ca
|
||||
@@ -700,7 +700,7 @@ F src/insert.c dfd311b0ac2d4f6359e62013db67799757f4d2cc56cca5c10f4888acfbbfa3fd
|
||||
F src/json.c fb031340edee159c07ad37dbe668ffe945ed86f525b0eb3822e4a67cbc498a72
|
||||
F src/legacy.c d7874bc885906868cd51e6c2156698f2754f02d9eee1bae2d687323c3ca8e5aa
|
||||
F src/loadext.c 4747f72084dc80520a2d23e5bb0bc0760672208a81a2b115ce0b657acd65edf4
|
||||
F src/main.c c99e86fd7dc6c8c2c0f67395562e3300bca2780b845db9bdc2bdac6acf13c6aa
|
||||
F src/main.c 8ee5d36123330e7a6a8ef3acd6c05cdc254d6d4ef6ca2e472c702ac1ee9a5617
|
||||
F src/malloc.c 410e570b30c26cc36e3372577df50f7a96ee3eed5b2b161c6b6b48773c650c5e
|
||||
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
|
||||
F src/mem1.c 3bb59158c38e05f6270e761a9f435bf19827a264c13d1631c58b84bdc96d73b2
|
||||
@@ -714,19 +714,19 @@ F src/mutex.c 06bcd9c3dbf2d9b21fcd182606c00fafb9bfe0287983c8e17acd13d2c81a2fa9
|
||||
F src/mutex.h a7b2293c48db5f27007c3bdb21d438873637d12658f5a0bf8ad025bb96803c4a
|
||||
F src/mutex_noop.c 9d4309c075ba9cc7249e19412d3d62f7f94839c4
|
||||
F src/mutex_unix.c f7ee5a2061a4c11815a2bf4fc0e2bfa6fb8d9dc89390eb613ca0cec32fc9a3d1
|
||||
F src/mutex_w32.c 28f8d480387db5b2ef5248705dd4e19db0cfc12c3ba426695a7d2c45c48e6885
|
||||
F src/mutex_w32.c e1d317d29cb623667d43de94714264d1e1871cc4bb39fa67dd17048e8138c739
|
||||
F src/notify.c 57c2d1a2805d6dee32acd5d250d928ab94e02d76369ae057dee7d445fd64e878
|
||||
F src/os.c 509452169d5ea739723e213b8e2481cf0e587f0e88579a912d200db5269f5f6d
|
||||
F src/os.h 1ff5ae51d339d0e30d8a9d814f4b8f8e448169304d83a7ed9db66a65732f3e63
|
||||
F src/os_common.h 6c0eb8dd40ef3e12fe585a13e709710267a258e2c8dd1c40b1948a1d14582e06
|
||||
F src/os_kv.c fb7ba8d6204197357f1eb7e1c7450d09c10043bf7e99aba602f4aa46b8fb11a3
|
||||
F src/os_setup.h 8efc64eda6a6c2f221387eefc2e7e45fd5a3d5c8337a7a83519ba4fbd2957ae2
|
||||
F src/os_unix.c 7945ede1e85b2d1b910e1b4af9ba342e964b1e30e79f4176480a60736445cb36
|
||||
F src/os_win.c a89b501fc195085c7d6c9eec7f5bd782625e94bb2a96b000f4d009703df1083f
|
||||
F src/os_win.h 4c247cdb6d407c75186c94a1e84d5a22cbae4adcec93fcae8d2bc1f956fd1f19
|
||||
F src/os_unix.c dcf7988ddbdd68619b821c9a722f9377abb46f1d26c9279eb5a50402fd43d749
|
||||
F src/os_win.c 7eb8a49b18ac8bbd0b8e31bf346469074b65d4cebd6ff7259d07190d0853b534
|
||||
F src/os_win.h 5e168adf482484327195d10f9c3bce3520f598e04e07ffe62c9c5a8067c1037b
|
||||
F src/pager.c a81461de271ac4886ad75b7ca2cca8157a48635820c4646cd2714acdc2c17e5f
|
||||
F src/pager.h 6137149346e6c8a3ddc1eeb40aee46381e9bc8b0fcc6dda8a1efde993c2275b8
|
||||
F src/parse.y 6afdb006a4a8aac04a4dd37efd8b5e2d5cc39f9751b63e02cf11d9486ba3562a
|
||||
F src/parse.y 7c2184b5665c671258c4e96a10bbc9dbf7e1ede462ebc4e614249de0d54c8a26
|
||||
F src/pcache.c 588cc3c5ccaaadde689ed35ce5c5c891a1f7b1f4d1f56f6cf0143b74d8ee6484
|
||||
F src/pcache.h 1497ce1b823cf00094bb0cf3bac37b345937e6f910890c626b16512316d3abf5
|
||||
F src/pcache1.c 131ca0daf4e66b4608d2945ae76d6ed90de3f60539afbd5ef9ec65667a5f2fcd
|
||||
@@ -736,16 +736,16 @@ F src/printf.c b1b29b5e58e1530d5daeee5963d3c318d8ab2d7e38437580e28755753e0c1ded
|
||||
F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c
|
||||
F src/resolve.c 8d53771eb51a4ab5f970150c3a70969d8db79cd04a8774c2d296bbcf471a0dd0
|
||||
F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
|
||||
F src/select.c 9d4704ac072fdc86cf1b4184353ee7cca73aae4176bb30bb71c49aeb2901e427
|
||||
F src/shell.c.in 62b286951404fd72c116bb3b96b5ee9330de4dc4c8753ca33967ca1a47b3b972
|
||||
F src/select.c 344518c1bba9c4636bf651b7642304abd2e7075ba35feb4bae42a51e5efe991f
|
||||
F src/shell.c.in 5eb15c585bd49b8cce88e762353a92b470b99a95e459bb434da41576a4f1b6eb
|
||||
F src/sqlite.h.in 706cacea5308b0244fb6cec92e08310fb427a125375c64137cc1f878ae4cf5c0
|
||||
F src/sqlite3.rc 015537e6ac1eec6c7050e17b616c2ffe6f70fca241835a84a4f0d5937383c479
|
||||
F src/sqlite3ext.h 5d5330f5f8461f5ce74960436ddcfa53ecd09c2b8b23901e22ae38aec3243998
|
||||
F src/sqliteInt.h bbb5c3b914de199a1b3dba4c9789788dd6d60162b88986d44666229cbf82ad1b
|
||||
F src/sqliteLimit.h 0a5516b4ec192a205c541e05f67009028a9451dc6678aae4cf8e68596903c246
|
||||
F src/sqliteInt.h af67bc95fa6b66cd3c7f3d18d2d040ad386e4cbb02965ee318cc721ee9d5fa45
|
||||
F src/sqliteLimit.h 7e705474d59912388832cc5465edbc0dbb552872e23452812846e90d280987f3
|
||||
F src/status.c 7565d63a79aa2f326339a24a0461a60096d0bd2bce711fefb50b5c89335f3592
|
||||
F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1
|
||||
F src/tclsqlite.c 4b6f6b142b951a8a127e0cbd2e37284fc71f8e6a391ec8c6188fb831b51ec0b8
|
||||
F src/tclsqlite.c 1411438584e8e08c0959e6341acb0487039de662dab223ae0fef26d361211b6e
|
||||
F src/tclsqlite.h 614b3780a62522bc9f8f2b9fb22689e8009958e7aa77e572d0f3149050af348a
|
||||
F src/test1.c 0e71fbcb484a271564e98e0158192c28c24f5521594218c3ba48bcb4cf634f91
|
||||
F src/test2.c 62f0830958f9075692c29c6de51b495ae8969e1bef85f239ffcd9ba5fb44a5ff
|
||||
@@ -760,7 +760,7 @@ F src/test_backup.c a2bfd90d2ff2511b8635507bdb30fa9b605ade19c16b533066cae3077f5b
|
||||
F src/test_bestindex.c d75fad21369d80910238032bcf8d9ca1f2bffda13c1ceec63bfbb7f704448b15
|
||||
F src/test_blob.c 77b994e17f2c87055f44fd96c9a206c5a7155bae2cda2769af60c2f3582f962c
|
||||
F src/test_btree.c 28283787d32b8fa953eb77412ad0de2c9895260e4e5bd5a94b3c7411664f90d5
|
||||
F src/test_config.c 18aa596d37de1d5968c439fd58ebf38bc4d9c9d1db63621504e241fde375cecd
|
||||
F src/test_config.c 9b6dac5bc4ab56c9c6289ca9a6a73a156e178e58bcfdac19a69f6e17e28ad5ac
|
||||
F src/test_delete.c d0e8f6dc55cfc98a7c27c057fb88d512260564bf0b611482656c68b8f7f401ed
|
||||
F src/test_demovfs.c 3efa2adf4f21e10d95521721687d5ca047aea91fa62dd8cc22ac9e5a9c942383
|
||||
F src/test_devsym.c 649434ed34d0b03fbd5a6b42df80f0f9a7e53f94dd1710aad5dd8831e91c4e86
|
||||
@@ -780,7 +780,7 @@ F src/test_mutex.c dacae6790956c0d4e705aaed2090227792e291b0496cccd688e9994c1e21f
|
||||
F src/test_onefile.c f31e52e891c5fef6709b9fcef54ce660648a34172423a9cbdf4cbce3ba0049f4
|
||||
F src/test_osinst.c 269039d9c0820a02ee928014c30860d57ee757ecda54df42e463d0ca1377b835
|
||||
F src/test_pcache.c 496da3f7e2ca66aefbc36bbf22138b1eff43ba0dff175c228b760fa020a37bd0
|
||||
F src/test_quota.c 180e87437250bed7e17e4e61c106730939e39fec9be73d28961f27f579a92078
|
||||
F src/test_quota.c 5bb44452b9c6c248bb3c82d2466a20915aa6d12801f6c1784b6499aaa04d9811
|
||||
F src/test_quota.h 2a8ad1952d1d2ca9af0ce0465e56e6c023b5e15d
|
||||
F src/test_rtree.c d844d746a3cc027247318b970025a927f14772339c991f40e7911583ea5ed0d9
|
||||
F src/test_schema.c b06d3ddc3edc173c143878f3edb869dd200d57d918ae2f38820534f9a5e3d7d9
|
||||
@@ -797,7 +797,7 @@ F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9
|
||||
F src/threads.c 4ae07fa022a3dc7c5beb373cf744a85d3c5c6c3c
|
||||
F src/tokenize.c ca1382f02a3990d1a770acd5c55731dee10cd644465b2855eca33e4d2ea299ed
|
||||
F src/treeview.c 3ce7ac9835d2d70cc1c868b01b747ae8a062322e155701e58e3d62ca79aada7a
|
||||
F src/trigger.c d5cf2541ff048f30b6a0507eb3d1ec4e695c53584e3b2298a5bf248714fe185e
|
||||
F src/trigger.c 96e5ceb7461b0c469a6e155feb00f39b992b6205f3f5118d01905f45f8234372
|
||||
F src/update.c 3e5e7ff66fa19ebe4d1b113d480639a24cc1175adbefabbd1a948a07f28e37cf
|
||||
F src/upsert.c 215328c3f91623c520ec8672c44323553f12caeb4f01b1090ebdca99fdf7b4f1
|
||||
F src/utf.c 7267c3fb9e2467020507601af3354c2446c61f444387e094c779dccd5ca62165
|
||||
@@ -818,7 +818,7 @@ F src/vxworks.h 9d18819c5235b49c2340a8a4d48195ec5d5afb637b152406de95a9436beeaeab
|
||||
F src/wal.c 505a98fbc599a971d92cb90371cf54546c404cd61e04fd093e7b0c8ff978f9b6
|
||||
F src/wal.h ba252daaa94f889f4b2c17c027e823d9be47ce39da1d3799886bbd51f0490452
|
||||
F src/walker.c d5006d6b005e4ea7302ad390957a8d41ed83faa177e412f89bc5600a7462a014
|
||||
F src/where.c 1b554a868134cbc9ca2192385403c0b63e5073ff01a6cdd600a846c09f843165
|
||||
F src/where.c 287324fe73a0ae8e55b3be89bb2fe4148e3a8394e1e2f10ed2113713a037d8a3
|
||||
F src/whereInt.h 8d94cb116c9e06205c3d5ac87af065fc044f8cf08bfdccd94b6ea1c1308e65da
|
||||
F src/wherecode.c 71c5c6804b7f882dec8ec858758accae02fcfca13df3cc720f1f258e663ec7c5
|
||||
F src/whereexpr.c 5f412da6616e26b8000dd736a5ce5da0018dff0933cd656bbb25f407db16bf93
|
||||
@@ -844,7 +844,7 @@ F test/altercons2.test 3c1f58312817df43aeada3b1827fdc3ce3fc50c6f49a95ef62cf4cbba
|
||||
F test/altercorrupt.test 2e1d705342cf9d7de884518ddbb053fd52d7e60d2b8869b7b63b2fda68435c12
|
||||
F test/alterdropcol.test a653a3945f964d26845ec0cd0a8e74189f46de3119a984c5bc45457da392612e
|
||||
F test/alterdropcol2.test 527fce683b200d620f560f666c44ae33e22728e990a10a48a543280dfd4b4d41
|
||||
F test/alterfault.test 9baff95be91ad77e955701454fa9e4bdd8c94f7fe6e814939962d3d5efb83220
|
||||
F test/alterfault.test 2bb3103954ea60f2e2777b1ae12e79ec3e1fd278f2b1398ad316c68835a62898
|
||||
F test/alterlegacy.test f38c6d06cda39e1f7b955bbce57f2e3ef5b7cb566d3d1234502093e228c15811
|
||||
F test/altermalloc.test 167a47de41b5c638f5f5c6efb59784002b196fff70f98d9b4ed3cd74a3fb80c9
|
||||
F test/altermalloc2.test 17fb3724c4b004c469c27dc4ef181608aa644555fbd3f3236767584f73747c81
|
||||
@@ -853,7 +853,7 @@ F test/alterqf.test 8ec03d776de9c391daa0078ea8f838903bdcfb11dfae4ba3576b48436834
|
||||
F test/altertab.test 8a2712f9076da5012a002d0b5cc0a421398a5bf61c25bab41b77c427586a7a27
|
||||
F test/altertab2.test 0889ba0700cc1cdb7bc7d25975aa61fece34f621de963d0886e2395716b38576
|
||||
F test/altertab3.test 575e771e2f02b13eb98798dc92eabacd187d6dbcf596e70f11d699b0b6b5d0b2
|
||||
F test/altertrig.test aacc980b657354fe2d3d4d3a004f07d04ccc1a93e5ef82d68a79088c274ddc6b
|
||||
F test/altertrig.test b1590647076add5a47aea0f2236c609ca0bc8a7a2462463edd3e5882c7894802
|
||||
F test/amatch1.test b5ae7065f042b7f4c1c922933f4700add50cdb9f
|
||||
F test/analyze.test 2fb21d7d64748636384e6cb8998dbf83968caf644c07fcb4f76c18f2e7ede94b
|
||||
F test/analyze3.test c5156cef33f04b90a6b9e9d5d0bbc273a0fb44147d4508407bf1080811e2c6c8
|
||||
@@ -1075,7 +1075,7 @@ F test/e_resolve.test a61751c368b109db73df0f20fc75fb47e166b1d8
|
||||
F test/e_select.test 327a15f14068bbd6f647cedc67210f8680fcb2f05e481a0a855fccd2abfa1292
|
||||
F test/e_select2.test aceb80ab927d46fba5ce7586ebabf23e2bb0604f
|
||||
F test/e_totalchanges.test c927f7499dc3aa28b9b556b7d6d115a2f0fe41f012b128d16bf1f3b30e9b41e4
|
||||
F test/e_update.test f46c2554d915c9197548681e8d8c33a267e84528
|
||||
F test/e_update.test 9f8bb82b8760ac66f2c9c2aadb78a418bd639d22f041d712570c9db56f20afda
|
||||
F test/e_uri.test 86564382132d9c453845eeb5293c7e375487b625900ab56c181a0464908417d8
|
||||
F test/e_vacuum.test 89fc48e8beee2f9dfd6de1fbb2edea6542dae9121dc0fbe6313764169e742104
|
||||
F test/e_wal.test db7c33642711cf3c7959714b5f012aca08cacfa78da0382f95e849eb3ba66aa4
|
||||
@@ -1107,7 +1107,7 @@ F test/extension01.test 5de412c66276105901c370770175003381fdcb0c4da7054fa43cf4a3
|
||||
F test/external_reader.test 6fdec43eeca23eb32faad1e95a4d1abc402bc8b3db70df12d6fc08a637f4a2b5
|
||||
F test/extraquick.test cb254400bd42bfb777ff675356aabf3287978f79
|
||||
F test/fallocate.test 37a62e396a68eeede8f8d2ecf23573a80faceb630788d314d0a073d862616717
|
||||
F test/filectrl.test 4b720117388cf6766d0b798e2dddd785953f8f371633b0c0084d2f34cf72336a
|
||||
F test/filectrl.test 3344987f143f3cb9914895dc63d9e9518a535ef1b1438d22caf3ba2fa76cc6da
|
||||
F test/filefmt.test f393e80c4b8d493b7a7f8f3809a8425bbf4292af1f5140f01cb1427798a2bbd4
|
||||
F test/filter1.test 590f8ba9a0cd0823b80d89ac75c5ce72276189cef9225d2436adaf1ee87f3727
|
||||
F test/filter2.tcl 44e525497ce07382915f01bd29ffd0fa49dab3adb87253b5e5103ba8f93393e8
|
||||
@@ -1441,7 +1441,7 @@ F test/mmap4.test 2e2b4e32555b58da15176e6fe750f17c9dcf7f93
|
||||
F test/mmapcorrupt.test 470fb44fe92e99c1d23701d156f8c17865f5b027063c9119dcfdb842791f4465
|
||||
F test/mmapfault.test d4c9eff9cd8c2dc14bc43e71e042f175b0a26fe3
|
||||
F test/mmapwarm.test 2272005969cd17a910077bd5082f70bc1fefad9a875afec7fc9af483898ecaf3
|
||||
F test/modeA.clitest e0c63c28e2651dd322e21de683fec7d247028b80f7a753663244ba0087215dc8
|
||||
F test/modeA.clitest 96939c5fac8595213d84de82f3e09e4d126bafed19ec30167953627f4afa1723
|
||||
F test/multiplex.test d74c034e52805f6de8cc5432cef8c9eb774bb64ec29b83a22effc8ca4dac1f08
|
||||
F test/multiplex2.test 580ca5817c7edbe4cc68fa150609c9473393003a
|
||||
F test/multiplex3.test fac575e0b1b852025575a6a8357701d80933e98b5d2fe6d35ddaa68f92f6a1f7
|
||||
@@ -1511,12 +1511,12 @@ F test/printf2.test 3f55c1871a5a65507416076f6eb97e738d5210aeda7595a74ee895f2224c
|
||||
F test/progress.test ebab27f670bd0d4eb9d20d49cef96e68141d92fb
|
||||
F test/ptrchng.test ef1aa72d6cf35a2bbd0869a649b744e9d84977fc
|
||||
F test/pushdown.test 46a626ef1c0ca79b85296ff2e078b9da20a50e9b804b38f441590c3987580ddd
|
||||
F test/qrf01.test 48c86e90f606739e67b73937babb662ef0edf1ede06954489c588815fa17b560
|
||||
F test/qrf01.test 7ad8bb08eaaf9dee2a76a807741dfe4d6752614baa3c03afc734580bccc59afa
|
||||
F test/qrf02.test 39b4afdc000bedccdafc0aecf17638df67a67aaa2d2942865ae6abcc48ba0e92
|
||||
F test/qrf03.test ad7fa339fb46b26b08625f3a77a4827bdee9f0dad402d8ddc1fcb8f05aa64a54
|
||||
F test/qrf03.test e7efe46d204671726b4707585126cd78d107368de4a7d0c7b8d5157cdd8624ed
|
||||
F test/qrf04.test 0894692c998d2401dcc33449c02051b503ecce0c94217be54fb007c82d2d1379
|
||||
F test/qrf05.test 8ade5bfa7ef0b448e531687203fa8ae9ef41f1d7e4c11d5ba0c4846af75b13d5
|
||||
F test/qrf06.test 3907f81c79fd884802cc7552d4a07fd8d73c381ade9d5108e6d7f56fd962b99b
|
||||
F test/qrf06.test cd7d0f0e2904904ab88141630a8fff5718ef7e3cc23e5a9c519cf29bb0919d89
|
||||
F test/queryonly.test 5f653159e0f552f0552d43259890c1089391dcca
|
||||
F test/quick.test 1681febc928d686362d50057c642f77a02c62e57
|
||||
F test/quickcheck.test a4b7e878cd97e46108291c409b0bf8214f29e18fddd68a42bc5c1375ad1fb80a
|
||||
@@ -1610,8 +1610,8 @@ F test/sharedA.test 64bdd21216dda2c6a3bd3475348ccdc108160f34682c97f2f51c19fc0e21
|
||||
F test/sharedB.test 1a84863d7a2204e0d42f2e1606577c5e92e4473fa37ea0f5bdf829e4bf8ee707
|
||||
F test/shared_err.test 32634e404a3317eeb94abc7a099c556a346fdb8fb3858dbe222a4cbb8926a939
|
||||
F test/sharedlock.test 5ede3c37439067c43b0198f580fd374ebf15d304
|
||||
F test/shell1.test b49a89913c194c37ca10c9ded1b6b6866506104621c6cc599e557e4cb5ed8cc2
|
||||
F test/shell2.test 103140814bdc7508aa41dd3462413cbc4aa84b4261112cb8d501d74275cb7d48
|
||||
F test/shell1.test 4e1b57c43b6246fb3e617903992b704ce3798c437b01cbf1e7a5e75060fdb7ea
|
||||
F test/shell2.test 9d55aa53ca36c6889dedf5a23d849793afbd2dbe62d512ce066cb293a8a66a88
|
||||
F test/shell3.test 840192774cc4edf7653520c0434a311c7477b9bc324abbc7bd2887915792fa8c
|
||||
F test/shell4.test e25580a792b7b54560c3a76b6968bd8189261f38979fe28e6bc6312c5db280db
|
||||
F test/shell5.test 7a249400bb2af59ac8524f357f8cf2844a62b6ac5ff8ecd69b045ceb688700ae
|
||||
@@ -1619,7 +1619,7 @@ F test/shell6.test e3b883b61d4916b6906678a35f9d19054861123ad91b856461e0a456273bd
|
||||
F test/shell7.test 43fd8e511c533bab5232e95c7b4be93b243451709e89582600d4b6e67693d5c3
|
||||
F test/shell8.test 641cf21a99c59404c24e3062923734951c4099a6b6b6520de00cf7a1249ee871
|
||||
F test/shell9.test 8742a5b390cdcef6369f5aa223e415aa4255a4129ef249b177887dc635a87209
|
||||
F test/shellA.test 4f57da76ed1f6d4a4eba0b2a27cdef4c756f1da2c813dc7034079e4df493110f
|
||||
F test/shellA.test 5fa0bdb7a19b0c1ba32649eab3eca0f7164bd9d33d391fff17586abcbc6c6e18
|
||||
F test/shellB.test de879b1ea7c25daf1a06b2c882b45a5d002e6580c81c57169ce47084cc6afb6b
|
||||
F test/shmlock.test 9f1f729a7fe2c46c88b156af819ac9b72c0714ac6f7246638a73c5752b5fd13c
|
||||
F test/shortread1.test bb591ef20f0fd9ed26d0d12e80eee6d7ac8897a3
|
||||
@@ -1675,7 +1675,7 @@ F test/strict1.test a7f9091603fe71cdc62baab0766684cba12a97ec69bfbb70be965532669c
|
||||
F test/strict2.test b22c7a98b5000aef937f1990776497f0e979b1a23bc4f63e2d53b00e59b20070
|
||||
F test/subjournal.test 8d4e2572c0ee9a15549f0d8e40863161295107e52f07a3e8012a2e1fdd093c49
|
||||
F test/subquery.test 23087f9b1c15ab9cc5231d04946bdebc51db527c95eb9d7434a2222127e17a84
|
||||
F test/subquery2.test 5f06ec2dbce42a3f595ab1b73b146592f9ce001cd4ff023d887d643d3560c281
|
||||
F test/subquery2.test ab96ff3fa9c4e3dce0d699f74e61c50250ed4335bc8f400e127707d552a8999e
|
||||
F test/subselect.test 0966aa8e720224dbd6a5e769a3ec2a723e332303
|
||||
F test/substr.test a673e3763e247e9b5e497a6cacbaf3da2bd8ec8921c0677145c109f2e633f36b
|
||||
F test/subtype1.test 96fd2a59bfc845c955b5f339d23b37ef4d50de5f8a04acd1450a68605fa2e3e7
|
||||
@@ -1701,11 +1701,12 @@ F test/tempfault.test 0c0d349c9a99bf5f374655742577f8712c647900
|
||||
F test/temptable.test d2c9b87a54147161bcd1822e30c1d1cd891e5b30
|
||||
F test/temptable2.test 76821347810ecc88203e6ef0dd6897b6036ac788e9dd3e6b04fd4d1631311a16
|
||||
F test/temptable3.test d11a0974e52b347e45ee54ef1923c91ed91e4637
|
||||
F test/temptrigger.test 38f0ca479b1822d3117069e014daabcaacefffcc
|
||||
F test/tester.tcl 463ae33b8bf75ac77451df19bd65e7c415c2e9891227c7c9e657d0a2d8e1074a
|
||||
F test/temptrigfault.tes fc5918e64f3867156fefe7cfca9d8e1f495134a5229b2b511b0dc11c07f2eab4
|
||||
F test/temptrigger.test a00f258ed8d21a0e8fd4f322f15e8cfb5cef2e43655670e07a753e3fb4769d61
|
||||
F test/tester.tcl 2d943f60200e0a36bcd3f1f0baf181a751cd3604ef6b6bd4c8dc39b4e8a53116
|
||||
F test/testloadext.c 862b848783eaed9985fbce46c65cd214664376b549fae252b364d5d1ef350a27
|
||||
F test/testrunner.tcl 6cbda5d6ff9b26b11993f1e1ddd57d9521cec7c31676ad323a40a6821ce43ad6 x
|
||||
F test/testrunner_data.tcl c507a9afa911c03446ed90442ffd4a98aca02882c3d51bd1177c24795674def8
|
||||
F test/testrunner_data.tcl 87b8afd37c8e517fa87b7936540b2fc1ede8291f0567fb88744b9bff272a2e8b
|
||||
F test/testrunner_estwork.tcl 81e2ae10238f50540f42fbf2d94913052a99bfb494b69e546506323f195dcff9
|
||||
F test/thread001.test a0985c117eab62c0c65526e9fa5d1360dd1cac5b03bde223902763274ce21899
|
||||
F test/thread002.test c24c83408e35ba5a952a3638b7ac03ccdf1ce4409289c54a050ac4c5f1de7502
|
||||
@@ -2045,7 +2046,7 @@ F test/wherelimit3.test 22d73e046870cf8bbe15573eda6b432b07ebe64a88711f9f849c6b36
|
||||
F test/widetab1.test c296a98e123762de79917350e45fa33fdf88577a2571eb3a64c8bf7e44ef74d1
|
||||
F test/win32heap.test 1ec2ce646aee491ec23bfcdfd005b33c79f13bf91467966f374a76ffe7c7e85f
|
||||
F test/win32lock.test e56d7a9b6cf9d5f3867c2dd19ff36c5326881e4038c6867610ecb3a9868ea4eb
|
||||
F test/win32longpath.test 0f9837039b306735c13521c5f25b6ed42937b600dace58e28a3d2f8baf429b6a
|
||||
F test/win32longpath.test 2641e3a5dbb59f49456f6caf78c0acd6ec7dbba27cb56363bab8fbfe93995caa
|
||||
F test/win32nolock.test 95854dc0206b8a95e4aee15a76acc082767b38f079b2e24676aed6cbb0f32798
|
||||
F test/window1.test b46d28b9698559e66aa4adafd8074b940faee498bf0c4fbdb62548bfcccc67e7
|
||||
F test/window2.tcl 492c125fa550cda1dd3555768a2303b3effbeceee215293adf8871efc25f1476
|
||||
@@ -2089,13 +2090,13 @@ F test/writecrash.test 13520af28f376bfc8c0bcd130efc1fff20bb165198e8b94cf153f1f75
|
||||
F test/zeroblob.test 7b74cefc7b281dfa2b07cd237987fbe94b4a2037a7771e9e83f2d5f608b1d99e
|
||||
F test/zeroblobfault.test 861d8191a0d944dfebb3cb4d2c5b4e46a5a119eaec5a63dd996c2389f8063441
|
||||
F test/zerodamage.test 9c41628db7e8d9e8a0181e59ea5f189df311a9f6ce99cc376dc461f66db6f8dc
|
||||
F test/zipfile.test 82d402903199d193073af2c3c56b3c6839d229160fdc9ba437fa959db8da3ecc
|
||||
F test/zipfile.test ca3fb01d900c06efd7cf61b709576b714eeb249cbc7cae30af303536f1b4e91e
|
||||
F test/zipfile2.test a577e0775e32ef8972e7d5e9a45bc071a5ae061b5b965a08c9c4b709ad036a25
|
||||
F test/zipfilefault.test 44d4d7a7f7cca7521d569d7f71026b241d65a6b1757aa409c1a168827edbbc2c
|
||||
F tool/GetFile.cs 47852aa0d806fe47ed1ac5138bdce7f000fe87aaa7f28107d0cb1e26682aeb44
|
||||
F tool/GetTclKit.bat d84033c6a93dfe735d247f48ba00292a1cc284dcf69963e5e672444e04534bbf
|
||||
F tool/Replace.cs 02c67258801c2fb5f63231e0ac0f220b4b36ba91
|
||||
F tool/build-all-msvc.bat 1960a7a3e5d8176c4329e31476f6e3dfa9543675355fa9020a569f4452628458 x
|
||||
F tool/build-all-msvc.bat 1ee9dbadcc07fc23268025854e97b392bcbad72376b47aee7b22f3797a4f2c87 x
|
||||
F tool/build-shell.sh 369c4b171cc877ad974fef691e4da782b4c1e99fe8f4361316c735f64d49280f
|
||||
F tool/buildtclext.tcl d09b753d7858314104eeaf5f4def85d35784470279809e47a633f142226f2b3f
|
||||
F tool/cg_anno.tcl c1f875f5a4c9caca3d59937b16aff716f8b1883935f1b4c9ae23124705bc8099 x
|
||||
@@ -2183,8 +2184,11 @@ F tool/version-info.c 33d0390ef484b3b1cb685d59362be891ea162123cea181cb8e6d2cf6dd
|
||||
F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7
|
||||
F tool/warnings.sh d924598cf2f55a4ecbc2aeb055c10bd5f48114793e7ba25f9585435da29e7e98
|
||||
F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
|
||||
P 38d06f69e516dd13becbfb735a2a0035c2f3c50ea5d661a668b109a996656523
|
||||
R e345b725a39db244a730c4ef212bf292
|
||||
P 108691a3cb2f296f0ede06c34271ee185f299bfd76e97a1bd06c730a28d94ff4
|
||||
R 24c7fadd707464dc0ec7c3ced472d67c
|
||||
T *branch * zipfile-fix
|
||||
T *sym-zipfile-fix *
|
||||
T -sym-trunk *
|
||||
U drh
|
||||
Z 8f73060af5100688a4299f0ba560aae8
|
||||
Z fd7beb6b2e5c6334685d635e089624bf
|
||||
# Remove this line to create a well-formed Fossil manifest.
|
||||
|
||||
+2
-2
@@ -1,2 +1,2 @@
|
||||
branch expr-opt
|
||||
tag expr-opt
|
||||
branch zipfile-fix
|
||||
tag zipfile-fix
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
c69eec9909af40e1e22d44a6859ef52378ebe06a587373f332f9d379cb39a84d
|
||||
3d459f1fb1bd1b5e723629c463ab392af7b206ece3388bda216c6a4c26160909
|
||||
|
||||
+16
-20
@@ -1368,8 +1368,8 @@ static int renameResolveTrigger(Parse *pParse){
|
||||
sqlite3SelectPrep(pParse, pStep->pSelect, &sNC);
|
||||
if( pParse->nErr ) rc = pParse->rc;
|
||||
}
|
||||
if( rc==SQLITE_OK && pStep->zTarget ){
|
||||
SrcList *pSrc = sqlite3TriggerStepSrc(pParse, pStep);
|
||||
if( rc==SQLITE_OK && pStep->pSrc ){
|
||||
SrcList *pSrc = sqlite3SrcListDup(db, pStep->pSrc, 0);
|
||||
if( pSrc ){
|
||||
Select *pSel = sqlite3SelectNew(
|
||||
pParse, pStep->pExprList, pSrc, 0, 0, 0, 0, 0, 0
|
||||
@@ -1397,10 +1397,10 @@ static int renameResolveTrigger(Parse *pParse){
|
||||
pSel->pSrc = 0;
|
||||
sqlite3SelectDelete(db, pSel);
|
||||
}
|
||||
if( pStep->pFrom ){
|
||||
if( ALWAYS(pStep->pSrc) ){
|
||||
int i;
|
||||
for(i=0; i<pStep->pFrom->nSrc && rc==SQLITE_OK; i++){
|
||||
SrcItem *p = &pStep->pFrom->a[i];
|
||||
for(i=0; i<pStep->pSrc->nSrc && rc==SQLITE_OK; i++){
|
||||
SrcItem *p = &pStep->pSrc->a[i];
|
||||
if( p->fg.isSubquery ){
|
||||
assert( p->u4.pSubq!=0 );
|
||||
sqlite3SelectPrep(pParse, p->u4.pSubq->pSelect, 0);
|
||||
@@ -1469,13 +1469,13 @@ static void renameWalkTrigger(Walker *pWalker, Trigger *pTrigger){
|
||||
sqlite3WalkExpr(pWalker, pUpsert->pUpsertWhere);
|
||||
sqlite3WalkExpr(pWalker, pUpsert->pUpsertTargetWhere);
|
||||
}
|
||||
if( pStep->pFrom ){
|
||||
if( pStep->pSrc ){
|
||||
int i;
|
||||
SrcList *pFrom = pStep->pFrom;
|
||||
for(i=0; i<pFrom->nSrc; i++){
|
||||
if( pFrom->a[i].fg.isSubquery ){
|
||||
assert( pFrom->a[i].u4.pSubq!=0 );
|
||||
sqlite3WalkSelect(pWalker, pFrom->a[i].u4.pSubq->pSelect);
|
||||
SrcList *pSrc = pStep->pSrc;
|
||||
for(i=0; i<pSrc->nSrc; i++){
|
||||
if( pSrc->a[i].fg.isSubquery ){
|
||||
assert( pSrc->a[i].u4.pSubq!=0 );
|
||||
sqlite3WalkSelect(pWalker, pSrc->a[i].u4.pSubq->pSelect);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1646,8 +1646,8 @@ static void renameColumnFunc(
|
||||
if( rc!=SQLITE_OK ) goto renameColumnFunc_done;
|
||||
|
||||
for(pStep=sParse.pNewTrigger->step_list; pStep; pStep=pStep->pNext){
|
||||
if( pStep->zTarget ){
|
||||
Table *pTarget = sqlite3LocateTable(&sParse, 0, pStep->zTarget, zDb);
|
||||
if( pStep->pSrc ){
|
||||
Table *pTarget = sqlite3LocateTableItem(&sParse, 0, &pStep->pSrc->a[0]);
|
||||
if( pTarget==pTab ){
|
||||
if( pStep->pUpsert ){
|
||||
ExprList *pUpsertSet = pStep->pUpsert->pUpsertSet;
|
||||
@@ -1659,7 +1659,6 @@ static void renameColumnFunc(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Find tokens to edit in UPDATE OF clause */
|
||||
if( sParse.pTriggerTab==pTab ){
|
||||
renameColumnIdlistNames(&sParse, &sCtx,sParse.pNewTrigger->pColumns,zOld);
|
||||
@@ -1861,13 +1860,10 @@ static void renameTableFunc(
|
||||
if( rc==SQLITE_OK ){
|
||||
renameWalkTrigger(&sWalker, pTrigger);
|
||||
for(pStep=pTrigger->step_list; pStep; pStep=pStep->pNext){
|
||||
if( pStep->zTarget && 0==sqlite3_stricmp(pStep->zTarget, zOld) ){
|
||||
renameTokenFind(&sParse, &sCtx, pStep->zTarget);
|
||||
}
|
||||
if( pStep->pFrom ){
|
||||
if( pStep->pSrc ){
|
||||
int i;
|
||||
for(i=0; i<pStep->pFrom->nSrc; i++){
|
||||
SrcItem *pItem = &pStep->pFrom->a[i];
|
||||
for(i=0; i<pStep->pSrc->nSrc; i++){
|
||||
SrcItem *pItem = &pStep->pSrc->a[i];
|
||||
if( 0==sqlite3_stricmp(pItem->zName, zOld) ){
|
||||
renameTokenFind(&sParse, &sCtx, pItem->zName);
|
||||
}
|
||||
|
||||
+1
-1
@@ -596,7 +596,7 @@ int sqlite3FixTriggerStep(
|
||||
if( sqlite3WalkSelect(&pFix->w, pStep->pSelect)
|
||||
|| sqlite3WalkExpr(&pFix->w, pStep->pWhere)
|
||||
|| sqlite3WalkExprList(&pFix->w, pStep->pExprList)
|
||||
|| sqlite3FixSrcList(pFix, pStep->pFrom)
|
||||
|| sqlite3FixSrcList(pFix, pStep->pSrc)
|
||||
){
|
||||
return 1;
|
||||
}
|
||||
|
||||
+15
-2
@@ -3897,9 +3897,22 @@ int sqlite3CodeSubselect(Parse *pParse, Expr *pExpr){
|
||||
pParse->nMem += nReg;
|
||||
if( pExpr->op==TK_SELECT ){
|
||||
dest.eDest = SRT_Mem;
|
||||
dest.iSdst = dest.iSDParm;
|
||||
if( (pSel->selFlags&SF_Distinct) && pSel->pLimit && pSel->pLimit->pRight ){
|
||||
/* If there is both a DISTINCT and an OFFSET clause, then allocate
|
||||
** a separate dest.iSdst array for sqlite3Select() and other
|
||||
** routines to populate. In this case results will be copied over
|
||||
** into the dest.iSDParm array only after OFFSET processing. This
|
||||
** ensures that in the case where OFFSET excludes all rows, the
|
||||
** dest.iSDParm array is not left populated with the contents of the
|
||||
** last row visited - it should be all NULLs if all rows were
|
||||
** excluded by OFFSET. */
|
||||
dest.iSdst = pParse->nMem+1;
|
||||
pParse->nMem += nReg;
|
||||
}else{
|
||||
dest.iSdst = dest.iSDParm;
|
||||
}
|
||||
dest.nSdst = nReg;
|
||||
sqlite3VdbeAddOp3(v, OP_Null, 0, dest.iSDParm, dest.iSDParm+nReg-1);
|
||||
sqlite3VdbeAddOp3(v, OP_Null, 0, dest.iSDParm, pParse->nMem);
|
||||
VdbeComment((v, "Init subquery result"));
|
||||
}else{
|
||||
dest.eDest = SRT_Exists;
|
||||
|
||||
+6
-5
@@ -688,6 +688,7 @@ FKey *sqlite3FkReferences(Table *pTab){
|
||||
static void fkTriggerDelete(sqlite3 *dbMem, Trigger *p){
|
||||
if( p ){
|
||||
TriggerStep *pStep = p->step_list;
|
||||
sqlite3SrcListDelete(dbMem, pStep->pSrc);
|
||||
sqlite3ExprDelete(dbMem, pStep->pWhere);
|
||||
sqlite3ExprListDelete(dbMem, pStep->pExprList);
|
||||
sqlite3SelectDelete(dbMem, pStep->pSelect);
|
||||
@@ -1354,14 +1355,14 @@ static Trigger *fkActionTrigger(
|
||||
|
||||
pTrigger = (Trigger *)sqlite3DbMallocZero(db,
|
||||
sizeof(Trigger) + /* struct Trigger */
|
||||
sizeof(TriggerStep) + /* Single step in trigger program */
|
||||
nFrom + 1 /* Space for pStep->zTarget */
|
||||
sizeof(TriggerStep) /* Single step in trigger program */
|
||||
);
|
||||
if( pTrigger ){
|
||||
pStep = pTrigger->step_list = (TriggerStep *)&pTrigger[1];
|
||||
pStep->zTarget = (char *)&pStep[1];
|
||||
memcpy((char *)pStep->zTarget, zFrom, nFrom);
|
||||
|
||||
pStep->pSrc = sqlite3SrcListAppend(pParse, 0, 0, 0);
|
||||
if( pStep->pSrc ){
|
||||
pStep->pSrc->a[0].zName = sqlite3DbStrNDup(db, zFrom, nFrom);
|
||||
}
|
||||
pStep->pWhere = sqlite3ExprDup(db, pWhere, EXPRDUP_REDUCE);
|
||||
pStep->pExprList = sqlite3ExprListDup(db, pList, EXPRDUP_REDUCE);
|
||||
pStep->pSelect = sqlite3SelectDup(db, pSelect, EXPRDUP_REDUCE);
|
||||
|
||||
@@ -2945,6 +2945,9 @@ static const int aHardLimit[] = {
|
||||
#if SQLITE_MAX_SQL_LENGTH>SQLITE_MAX_LENGTH
|
||||
# error SQLITE_MAX_SQL_LENGTH must not be greater than SQLITE_MAX_LENGTH
|
||||
#endif
|
||||
#if SQLITE_MAX_SQL_LENGTH>2147482624 /* 1024 less than 2^31 */
|
||||
# error SQLITE_MAX_SQL_LENGTH must not be greater than 2147482624
|
||||
#endif
|
||||
#if SQLITE_MAX_COMPOUND_SELECT<2
|
||||
# error SQLITE_MAX_COMPOUND_SELECT must be at least 2
|
||||
#endif
|
||||
|
||||
@@ -129,11 +129,7 @@ static int winMutexInit(void){
|
||||
if( InterlockedCompareExchange(&winMutex_lock, 1, 0)==0 ){
|
||||
int i;
|
||||
for(i=0; i<ArraySize(winMutex_staticMutexes); i++){
|
||||
#if SQLITE_OS_WINRT
|
||||
InitializeCriticalSectionEx(&winMutex_staticMutexes[i].mutex, 0, 0);
|
||||
#else
|
||||
InitializeCriticalSection(&winMutex_staticMutexes[i].mutex);
|
||||
#endif
|
||||
}
|
||||
winMutex_isInit = 1;
|
||||
}else{
|
||||
@@ -223,11 +219,7 @@ static sqlite3_mutex *winMutexAlloc(int iType){
|
||||
p->trace = 1;
|
||||
#endif
|
||||
#endif
|
||||
#if SQLITE_OS_WINRT
|
||||
InitializeCriticalSectionEx(&p->mutex, 0, 0);
|
||||
#else
|
||||
InitializeCriticalSection(&p->mutex);
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
+20
-19
@@ -2027,12 +2027,18 @@ static int unixLock(sqlite3_file *id, int eFileLock){
|
||||
pInode->nLock++;
|
||||
pInode->nShared = 1;
|
||||
}
|
||||
}else if( (eFileLock==EXCLUSIVE_LOCK && pInode->nShared>1)
|
||||
|| unixIsSharingShmNode(pFile)
|
||||
){
|
||||
}else if( eFileLock==EXCLUSIVE_LOCK && pInode->nShared>1 ){
|
||||
/* We are trying for an exclusive lock but another thread in this
|
||||
** same process is still holding a shared lock. */
|
||||
rc = SQLITE_BUSY;
|
||||
}else if( unixIsSharingShmNode(pFile) ){
|
||||
/* We are in WAL mode and attempting to delete the SHM and WAL
|
||||
** files due to closing the connection or changing out of WAL mode,
|
||||
** but another process still holds locks on the SHM file, thus
|
||||
** indicating that database locks have been broken, perhaps due
|
||||
** to a rogue close(open(dbFile)) or similar.
|
||||
*/
|
||||
rc = SQLITE_BUSY;
|
||||
}else{
|
||||
/* The request was for a RESERVED or EXCLUSIVE lock. It is
|
||||
** assumed that there is a SHARED or greater lock on the file
|
||||
@@ -4671,26 +4677,21 @@ static int unixFcntlExternalReader(unixFile *pFile, int *piOut){
|
||||
** still not a disaster.
|
||||
*/
|
||||
static int unixIsSharingShmNode(unixFile *pFile){
|
||||
int rc;
|
||||
unixShmNode *pShmNode;
|
||||
struct flock lock;
|
||||
if( pFile->pShm==0 ) return 0;
|
||||
if( pFile->ctrlFlags & UNIXFILE_EXCL ) return 0;
|
||||
pShmNode = pFile->pShm->pShmNode;
|
||||
rc = 1;
|
||||
unixEnterMutex();
|
||||
if( ALWAYS(pShmNode->nRef==1) ){
|
||||
struct flock lock;
|
||||
lock.l_whence = SEEK_SET;
|
||||
lock.l_start = UNIX_SHM_DMS;
|
||||
lock.l_len = 1;
|
||||
lock.l_type = F_WRLCK;
|
||||
osFcntl(pShmNode->hShm, F_GETLK, &lock);
|
||||
if( lock.l_type==F_UNLCK ){
|
||||
rc = 0;
|
||||
}
|
||||
}
|
||||
unixLeaveMutex();
|
||||
return rc;
|
||||
#if SQLITE_ATOMIC_INTRINSICS
|
||||
assert( AtomicLoad(&pShmNode->nRef)==1 );
|
||||
#endif
|
||||
memset(&lock, 0, sizeof(lock));
|
||||
lock.l_whence = SEEK_SET;
|
||||
lock.l_start = UNIX_SHM_DMS;
|
||||
lock.l_len = 1;
|
||||
lock.l_type = F_WRLCK;
|
||||
osFcntl(pShmNode->hShm, F_GETLK, &lock);
|
||||
return (lock.l_type!=F_UNLCK);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
+42
-326
@@ -43,7 +43,7 @@
|
||||
** Are most of the Win32 ANSI APIs available (i.e. with certain exceptions
|
||||
** based on the sub-platform)?
|
||||
*/
|
||||
#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && !defined(SQLITE_WIN32_NO_ANSI)
|
||||
#if !SQLITE_OS_WINCE && !defined(SQLITE_WIN32_NO_ANSI)
|
||||
# define SQLITE_WIN32_HAS_ANSI
|
||||
#endif
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
** Are most of the Win32 Unicode APIs available (i.e. with certain exceptions
|
||||
** based on the sub-platform)?
|
||||
*/
|
||||
#if (SQLITE_OS_WINCE || SQLITE_OS_WINNT || SQLITE_OS_WINRT) && \
|
||||
#if (SQLITE_OS_WINCE || SQLITE_OS_WINNT) && \
|
||||
!defined(SQLITE_WIN32_NO_WIDE)
|
||||
# define SQLITE_WIN32_HAS_WIDE
|
||||
#endif
|
||||
@@ -190,16 +190,7 @@
|
||||
*/
|
||||
#if SQLITE_WIN32_FILEMAPPING_API && \
|
||||
(!defined(SQLITE_OMIT_WAL) || SQLITE_MAX_MMAP_SIZE>0)
|
||||
/*
|
||||
** Two of the file mapping APIs are different under WinRT. Figure out which
|
||||
** set we need.
|
||||
*/
|
||||
#if SQLITE_OS_WINRT
|
||||
WINBASEAPI HANDLE WINAPI CreateFileMappingFromApp(HANDLE, \
|
||||
LPSECURITY_ATTRIBUTES, ULONG, ULONG64, LPCWSTR);
|
||||
|
||||
WINBASEAPI LPVOID WINAPI MapViewOfFileFromApp(HANDLE, ULONG, ULONG64, SIZE_T);
|
||||
#else
|
||||
#if defined(SQLITE_WIN32_HAS_ANSI)
|
||||
WINBASEAPI HANDLE WINAPI CreateFileMappingA(HANDLE, LPSECURITY_ATTRIBUTES, \
|
||||
DWORD, DWORD, DWORD, LPCSTR);
|
||||
@@ -211,7 +202,6 @@ WINBASEAPI HANDLE WINAPI CreateFileMappingW(HANDLE, LPSECURITY_ATTRIBUTES, \
|
||||
#endif /* defined(SQLITE_WIN32_HAS_WIDE) */
|
||||
|
||||
WINBASEAPI LPVOID WINAPI MapViewOfFile(HANDLE, DWORD, DWORD, DWORD, SIZE_T);
|
||||
#endif /* SQLITE_OS_WINRT */
|
||||
|
||||
/*
|
||||
** These file mapping APIs are common to both Win32 and WinRT.
|
||||
@@ -502,7 +492,7 @@ static LONG SQLITE_WIN32_VOLATILE sqlite3_os_type = 0;
|
||||
** This function is not available on Windows CE or WinRT.
|
||||
*/
|
||||
|
||||
#if SQLITE_OS_WINCE || SQLITE_OS_WINRT
|
||||
#if SQLITE_OS_WINCE
|
||||
# define osAreFileApisANSI() 1
|
||||
#endif
|
||||
|
||||
@@ -517,7 +507,7 @@ static struct win_syscall {
|
||||
sqlite3_syscall_ptr pCurrent; /* Current value of the system call */
|
||||
sqlite3_syscall_ptr pDefault; /* Default value */
|
||||
} aSyscall[] = {
|
||||
#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT
|
||||
#if !SQLITE_OS_WINCE
|
||||
{ "AreFileApisANSI", (SYSCALL)AreFileApisANSI, 0 },
|
||||
#else
|
||||
{ "AreFileApisANSI", (SYSCALL)0, 0 },
|
||||
@@ -556,7 +546,7 @@ static struct win_syscall {
|
||||
#define osCreateFileA ((HANDLE(WINAPI*)(LPCSTR,DWORD,DWORD, \
|
||||
LPSECURITY_ATTRIBUTES,DWORD,DWORD,HANDLE))aSyscall[4].pCurrent)
|
||||
|
||||
#if !SQLITE_OS_WINRT && defined(SQLITE_WIN32_HAS_WIDE)
|
||||
#if defined(SQLITE_WIN32_HAS_WIDE)
|
||||
{ "CreateFileW", (SYSCALL)CreateFileW, 0 },
|
||||
#else
|
||||
{ "CreateFileW", (SYSCALL)0, 0 },
|
||||
@@ -565,7 +555,7 @@ static struct win_syscall {
|
||||
#define osCreateFileW ((HANDLE(WINAPI*)(LPCWSTR,DWORD,DWORD, \
|
||||
LPSECURITY_ATTRIBUTES,DWORD,DWORD,HANDLE))aSyscall[5].pCurrent)
|
||||
|
||||
#if !SQLITE_OS_WINRT && defined(SQLITE_WIN32_HAS_ANSI) && \
|
||||
#if defined(SQLITE_WIN32_HAS_ANSI) && \
|
||||
(!defined(SQLITE_OMIT_WAL) || SQLITE_MAX_MMAP_SIZE>0) && \
|
||||
SQLITE_WIN32_CREATEFILEMAPPINGA
|
||||
{ "CreateFileMappingA", (SYSCALL)CreateFileMappingA, 0 },
|
||||
@@ -576,8 +566,8 @@ static struct win_syscall {
|
||||
#define osCreateFileMappingA ((HANDLE(WINAPI*)(HANDLE,LPSECURITY_ATTRIBUTES, \
|
||||
DWORD,DWORD,DWORD,LPCSTR))aSyscall[6].pCurrent)
|
||||
|
||||
#if SQLITE_OS_WINCE || (!SQLITE_OS_WINRT && defined(SQLITE_WIN32_HAS_WIDE) && \
|
||||
(!defined(SQLITE_OMIT_WAL) || SQLITE_MAX_MMAP_SIZE>0))
|
||||
#if (SQLITE_OS_WINCE || defined(SQLITE_WIN32_HAS_WIDE)) && \
|
||||
(!defined(SQLITE_OMIT_WAL) || SQLITE_MAX_MMAP_SIZE>0)
|
||||
{ "CreateFileMappingW", (SYSCALL)CreateFileMappingW, 0 },
|
||||
#else
|
||||
{ "CreateFileMappingW", (SYSCALL)0, 0 },
|
||||
@@ -586,7 +576,7 @@ static struct win_syscall {
|
||||
#define osCreateFileMappingW ((HANDLE(WINAPI*)(HANDLE,LPSECURITY_ATTRIBUTES, \
|
||||
DWORD,DWORD,DWORD,LPCWSTR))aSyscall[7].pCurrent)
|
||||
|
||||
#if !SQLITE_OS_WINRT && defined(SQLITE_WIN32_HAS_WIDE)
|
||||
#if defined(SQLITE_WIN32_HAS_WIDE)
|
||||
{ "CreateMutexW", (SYSCALL)CreateMutexW, 0 },
|
||||
#else
|
||||
{ "CreateMutexW", (SYSCALL)0, 0 },
|
||||
@@ -672,7 +662,7 @@ static struct win_syscall {
|
||||
#define osGetDiskFreeSpaceA ((BOOL(WINAPI*)(LPCSTR,LPDWORD,LPDWORD,LPDWORD, \
|
||||
LPDWORD))aSyscall[18].pCurrent)
|
||||
|
||||
#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && defined(SQLITE_WIN32_HAS_WIDE)
|
||||
#if !SQLITE_OS_WINCE && defined(SQLITE_WIN32_HAS_WIDE)
|
||||
{ "GetDiskFreeSpaceW", (SYSCALL)GetDiskFreeSpaceW, 0 },
|
||||
#else
|
||||
{ "GetDiskFreeSpaceW", (SYSCALL)0, 0 },
|
||||
@@ -689,7 +679,7 @@ static struct win_syscall {
|
||||
|
||||
#define osGetFileAttributesA ((DWORD(WINAPI*)(LPCSTR))aSyscall[20].pCurrent)
|
||||
|
||||
#if !SQLITE_OS_WINRT && defined(SQLITE_WIN32_HAS_WIDE)
|
||||
#if defined(SQLITE_WIN32_HAS_WIDE)
|
||||
{ "GetFileAttributesW", (SYSCALL)GetFileAttributesW, 0 },
|
||||
#else
|
||||
{ "GetFileAttributesW", (SYSCALL)0, 0 },
|
||||
@@ -706,11 +696,7 @@ static struct win_syscall {
|
||||
#define osGetFileAttributesExW ((BOOL(WINAPI*)(LPCWSTR,GET_FILEEX_INFO_LEVELS, \
|
||||
LPVOID))aSyscall[22].pCurrent)
|
||||
|
||||
#if !SQLITE_OS_WINRT
|
||||
{ "GetFileSize", (SYSCALL)GetFileSize, 0 },
|
||||
#else
|
||||
{ "GetFileSize", (SYSCALL)0, 0 },
|
||||
#endif
|
||||
|
||||
#define osGetFileSize ((DWORD(WINAPI*)(HANDLE,LPDWORD))aSyscall[23].pCurrent)
|
||||
|
||||
@@ -723,7 +709,7 @@ static struct win_syscall {
|
||||
#define osGetFullPathNameA ((DWORD(WINAPI*)(LPCSTR,DWORD,LPSTR, \
|
||||
LPSTR*))aSyscall[24].pCurrent)
|
||||
|
||||
#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && defined(SQLITE_WIN32_HAS_WIDE)
|
||||
#if !SQLITE_OS_WINCE && defined(SQLITE_WIN32_HAS_WIDE)
|
||||
{ "GetFullPathNameW", (SYSCALL)GetFullPathNameW, 0 },
|
||||
#else
|
||||
{ "GetFullPathNameW", (SYSCALL)0, 0 },
|
||||
@@ -758,16 +744,10 @@ static struct win_syscall {
|
||||
#define osGetProcAddressA ((FARPROC(WINAPI*)(HMODULE, \
|
||||
LPCSTR))aSyscall[27].pCurrent)
|
||||
|
||||
#if !SQLITE_OS_WINRT
|
||||
{ "GetSystemInfo", (SYSCALL)GetSystemInfo, 0 },
|
||||
#else
|
||||
{ "GetSystemInfo", (SYSCALL)0, 0 },
|
||||
#endif
|
||||
|
||||
#define osGetSystemInfo ((VOID(WINAPI*)(LPSYSTEM_INFO))aSyscall[28].pCurrent)
|
||||
|
||||
{ "GetSystemTime", (SYSCALL)GetSystemTime, 0 },
|
||||
|
||||
#define osGetSystemTime ((VOID(WINAPI*)(LPSYSTEMTIME))aSyscall[29].pCurrent)
|
||||
|
||||
#if !SQLITE_OS_WINCE
|
||||
@@ -787,7 +767,7 @@ static struct win_syscall {
|
||||
|
||||
#define osGetTempPathA ((DWORD(WINAPI*)(DWORD,LPSTR))aSyscall[31].pCurrent)
|
||||
|
||||
#if !SQLITE_OS_WINRT && defined(SQLITE_WIN32_HAS_WIDE)
|
||||
#if defined(SQLITE_WIN32_HAS_WIDE)
|
||||
{ "GetTempPathW", (SYSCALL)GetTempPathW, 0 },
|
||||
#else
|
||||
{ "GetTempPathW", (SYSCALL)0, 0 },
|
||||
@@ -795,11 +775,7 @@ static struct win_syscall {
|
||||
|
||||
#define osGetTempPathW ((DWORD(WINAPI*)(DWORD,LPWSTR))aSyscall[32].pCurrent)
|
||||
|
||||
#if !SQLITE_OS_WINRT
|
||||
{ "GetTickCount", (SYSCALL)GetTickCount, 0 },
|
||||
#else
|
||||
{ "GetTickCount", (SYSCALL)0, 0 },
|
||||
#endif
|
||||
|
||||
#define osGetTickCount ((DWORD(WINAPI*)(VOID))aSyscall[33].pCurrent)
|
||||
|
||||
@@ -812,7 +788,7 @@ static struct win_syscall {
|
||||
#define osGetVersionExA ((BOOL(WINAPI*)( \
|
||||
LPOSVERSIONINFOA))aSyscall[34].pCurrent)
|
||||
|
||||
#if !SQLITE_OS_WINRT && defined(SQLITE_WIN32_HAS_WIDE) && \
|
||||
#if defined(SQLITE_WIN32_HAS_WIDE) && \
|
||||
SQLITE_WIN32_GETVERSIONEX
|
||||
{ "GetVersionExW", (SYSCALL)GetVersionExW, 0 },
|
||||
#else
|
||||
@@ -827,20 +803,12 @@ static struct win_syscall {
|
||||
#define osHeapAlloc ((LPVOID(WINAPI*)(HANDLE,DWORD, \
|
||||
SIZE_T))aSyscall[36].pCurrent)
|
||||
|
||||
#if !SQLITE_OS_WINRT
|
||||
{ "HeapCreate", (SYSCALL)HeapCreate, 0 },
|
||||
#else
|
||||
{ "HeapCreate", (SYSCALL)0, 0 },
|
||||
#endif
|
||||
|
||||
#define osHeapCreate ((HANDLE(WINAPI*)(DWORD,SIZE_T, \
|
||||
SIZE_T))aSyscall[37].pCurrent)
|
||||
|
||||
#if !SQLITE_OS_WINRT
|
||||
{ "HeapDestroy", (SYSCALL)HeapDestroy, 0 },
|
||||
#else
|
||||
{ "HeapDestroy", (SYSCALL)0, 0 },
|
||||
#endif
|
||||
|
||||
#define osHeapDestroy ((BOOL(WINAPI*)(HANDLE))aSyscall[38].pCurrent)
|
||||
|
||||
@@ -858,16 +826,12 @@ static struct win_syscall {
|
||||
#define osHeapSize ((SIZE_T(WINAPI*)(HANDLE,DWORD, \
|
||||
LPCVOID))aSyscall[41].pCurrent)
|
||||
|
||||
#if !SQLITE_OS_WINRT
|
||||
{ "HeapValidate", (SYSCALL)HeapValidate, 0 },
|
||||
#else
|
||||
{ "HeapValidate", (SYSCALL)0, 0 },
|
||||
#endif
|
||||
|
||||
#define osHeapValidate ((BOOL(WINAPI*)(HANDLE,DWORD, \
|
||||
LPCVOID))aSyscall[42].pCurrent)
|
||||
|
||||
#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT
|
||||
#if !SQLITE_OS_WINCE
|
||||
{ "HeapCompact", (SYSCALL)HeapCompact, 0 },
|
||||
#else
|
||||
{ "HeapCompact", (SYSCALL)0, 0 },
|
||||
@@ -883,7 +847,7 @@ static struct win_syscall {
|
||||
|
||||
#define osLoadLibraryA ((HMODULE(WINAPI*)(LPCSTR))aSyscall[44].pCurrent)
|
||||
|
||||
#if !SQLITE_OS_WINRT && defined(SQLITE_WIN32_HAS_WIDE) && \
|
||||
#if defined(SQLITE_WIN32_HAS_WIDE) && \
|
||||
!defined(SQLITE_OMIT_LOAD_EXTENSION)
|
||||
{ "LoadLibraryW", (SYSCALL)LoadLibraryW, 0 },
|
||||
#else
|
||||
@@ -892,15 +856,11 @@ static struct win_syscall {
|
||||
|
||||
#define osLoadLibraryW ((HMODULE(WINAPI*)(LPCWSTR))aSyscall[45].pCurrent)
|
||||
|
||||
#if !SQLITE_OS_WINRT
|
||||
{ "LocalFree", (SYSCALL)LocalFree, 0 },
|
||||
#else
|
||||
{ "LocalFree", (SYSCALL)0, 0 },
|
||||
#endif
|
||||
|
||||
#define osLocalFree ((HLOCAL(WINAPI*)(HLOCAL))aSyscall[46].pCurrent)
|
||||
|
||||
#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT
|
||||
#if !SQLITE_OS_WINCE
|
||||
{ "LockFile", (SYSCALL)LockFile, 0 },
|
||||
#else
|
||||
{ "LockFile", (SYSCALL)0, 0 },
|
||||
@@ -922,8 +882,7 @@ static struct win_syscall {
|
||||
LPOVERLAPPED))aSyscall[48].pCurrent)
|
||||
#endif
|
||||
|
||||
#if SQLITE_OS_WINCE || (!SQLITE_OS_WINRT && \
|
||||
(!defined(SQLITE_OMIT_WAL) || SQLITE_MAX_MMAP_SIZE>0))
|
||||
#if SQLITE_OS_WINCE || !defined(SQLITE_OMIT_WAL) || SQLITE_MAX_MMAP_SIZE>0
|
||||
{ "MapViewOfFile", (SYSCALL)MapViewOfFile, 0 },
|
||||
#else
|
||||
{ "MapViewOfFile", (SYSCALL)0, 0 },
|
||||
@@ -951,20 +910,12 @@ static struct win_syscall {
|
||||
|
||||
#define osSetEndOfFile ((BOOL(WINAPI*)(HANDLE))aSyscall[53].pCurrent)
|
||||
|
||||
#if !SQLITE_OS_WINRT
|
||||
{ "SetFilePointer", (SYSCALL)SetFilePointer, 0 },
|
||||
#else
|
||||
{ "SetFilePointer", (SYSCALL)0, 0 },
|
||||
#endif
|
||||
|
||||
#define osSetFilePointer ((DWORD(WINAPI*)(HANDLE,LONG,PLONG, \
|
||||
DWORD))aSyscall[54].pCurrent)
|
||||
|
||||
#if !SQLITE_OS_WINRT
|
||||
{ "Sleep", (SYSCALL)Sleep, 0 },
|
||||
#else
|
||||
{ "Sleep", (SYSCALL)0, 0 },
|
||||
#endif
|
||||
|
||||
#define osSleep ((VOID(WINAPI*)(DWORD))aSyscall[55].pCurrent)
|
||||
|
||||
@@ -973,7 +924,7 @@ static struct win_syscall {
|
||||
#define osSystemTimeToFileTime ((BOOL(WINAPI*)(const SYSTEMTIME*, \
|
||||
LPFILETIME))aSyscall[56].pCurrent)
|
||||
|
||||
#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT
|
||||
#if !SQLITE_OS_WINCE
|
||||
{ "UnlockFile", (SYSCALL)UnlockFile, 0 },
|
||||
#else
|
||||
{ "UnlockFile", (SYSCALL)0, 0 },
|
||||
@@ -1011,11 +962,7 @@ static struct win_syscall {
|
||||
#define osWriteFile ((BOOL(WINAPI*)(HANDLE,LPCVOID,DWORD,LPDWORD, \
|
||||
LPOVERLAPPED))aSyscall[61].pCurrent)
|
||||
|
||||
#if SQLITE_OS_WINRT
|
||||
{ "CreateEventExW", (SYSCALL)CreateEventExW, 0 },
|
||||
#else
|
||||
{ "CreateEventExW", (SYSCALL)0, 0 },
|
||||
#endif
|
||||
|
||||
#define osCreateEventExW ((HANDLE(WINAPI*)(LPSECURITY_ATTRIBUTES,LPCWSTR, \
|
||||
DWORD,DWORD))aSyscall[62].pCurrent)
|
||||
@@ -1040,64 +987,26 @@ static struct win_syscall {
|
||||
#define osWaitForSingleObjectEx ((DWORD(WINAPI*)(HANDLE,DWORD, \
|
||||
BOOL))aSyscall[64].pCurrent)
|
||||
|
||||
#if SQLITE_OS_WINRT
|
||||
{ "SetFilePointerEx", (SYSCALL)SetFilePointerEx, 0 },
|
||||
#else
|
||||
{ "SetFilePointerEx", (SYSCALL)0, 0 },
|
||||
#endif
|
||||
|
||||
#define osSetFilePointerEx ((BOOL(WINAPI*)(HANDLE,LARGE_INTEGER, \
|
||||
PLARGE_INTEGER,DWORD))aSyscall[65].pCurrent)
|
||||
|
||||
#if SQLITE_OS_WINRT
|
||||
{ "GetFileInformationByHandleEx", (SYSCALL)GetFileInformationByHandleEx, 0 },
|
||||
#else
|
||||
{ "GetFileInformationByHandleEx", (SYSCALL)0, 0 },
|
||||
#endif
|
||||
|
||||
#define osGetFileInformationByHandleEx ((BOOL(WINAPI*)(HANDLE, \
|
||||
FILE_INFO_BY_HANDLE_CLASS,LPVOID,DWORD))aSyscall[66].pCurrent)
|
||||
|
||||
#if SQLITE_OS_WINRT && (!defined(SQLITE_OMIT_WAL) || SQLITE_MAX_MMAP_SIZE>0)
|
||||
{ "MapViewOfFileFromApp", (SYSCALL)MapViewOfFileFromApp, 0 },
|
||||
#else
|
||||
{ "MapViewOfFileFromApp", (SYSCALL)0, 0 },
|
||||
#endif
|
||||
|
||||
#define osMapViewOfFileFromApp ((LPVOID(WINAPI*)(HANDLE,ULONG,ULONG64, \
|
||||
SIZE_T))aSyscall[67].pCurrent)
|
||||
|
||||
#if SQLITE_OS_WINRT
|
||||
{ "CreateFile2", (SYSCALL)CreateFile2, 0 },
|
||||
#else
|
||||
{ "CreateFile2", (SYSCALL)0, 0 },
|
||||
#endif
|
||||
|
||||
#define osCreateFile2 ((HANDLE(WINAPI*)(LPCWSTR,DWORD,DWORD,DWORD, \
|
||||
LPCREATEFILE2_EXTENDED_PARAMETERS))aSyscall[68].pCurrent)
|
||||
|
||||
#if SQLITE_OS_WINRT && !defined(SQLITE_OMIT_LOAD_EXTENSION)
|
||||
{ "LoadPackagedLibrary", (SYSCALL)LoadPackagedLibrary, 0 },
|
||||
#else
|
||||
{ "LoadPackagedLibrary", (SYSCALL)0, 0 },
|
||||
#endif
|
||||
|
||||
#define osLoadPackagedLibrary ((HMODULE(WINAPI*)(LPCWSTR, \
|
||||
DWORD))aSyscall[69].pCurrent)
|
||||
|
||||
#if SQLITE_OS_WINRT
|
||||
{ "GetTickCount64", (SYSCALL)GetTickCount64, 0 },
|
||||
#else
|
||||
{ "GetTickCount64", (SYSCALL)0, 0 },
|
||||
#endif
|
||||
|
||||
#define osGetTickCount64 ((ULONGLONG(WINAPI*)(VOID))aSyscall[70].pCurrent)
|
||||
|
||||
#if SQLITE_OS_WINRT
|
||||
{ "GetNativeSystemInfo", (SYSCALL)GetNativeSystemInfo, 0 },
|
||||
#else
|
||||
{ "GetNativeSystemInfo", (SYSCALL)0, 0 },
|
||||
#endif
|
||||
|
||||
#define osGetNativeSystemInfo ((VOID(WINAPI*)( \
|
||||
LPSYSTEM_INFO))aSyscall[71].pCurrent)
|
||||
@@ -1122,15 +1031,6 @@ static struct win_syscall {
|
||||
|
||||
#define osGetProcessHeap ((HANDLE(WINAPI*)(VOID))aSyscall[74].pCurrent)
|
||||
|
||||
#if SQLITE_OS_WINRT && (!defined(SQLITE_OMIT_WAL) || SQLITE_MAX_MMAP_SIZE>0)
|
||||
{ "CreateFileMappingFromApp", (SYSCALL)CreateFileMappingFromApp, 0 },
|
||||
#else
|
||||
{ "CreateFileMappingFromApp", (SYSCALL)0, 0 },
|
||||
#endif
|
||||
|
||||
#define osCreateFileMappingFromApp ((HANDLE(WINAPI*)(HANDLE, \
|
||||
LPSECURITY_ATTRIBUTES,ULONG,ULONG64,LPCWSTR))aSyscall[75].pCurrent)
|
||||
|
||||
/*
|
||||
** NOTE: On some sub-platforms, the InterlockedCompareExchange "function"
|
||||
** is really just a macro that uses a compiler intrinsic (e.g. x64).
|
||||
@@ -1147,7 +1047,7 @@ static struct win_syscall {
|
||||
SQLITE_WIN32_VOLATILE*, LONG,LONG))aSyscall[76].pCurrent)
|
||||
#endif /* defined(InterlockedCompareExchange) */
|
||||
|
||||
#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && SQLITE_WIN32_USE_UUID
|
||||
#if !SQLITE_OS_WINCE && SQLITE_WIN32_USE_UUID
|
||||
{ "UuidCreate", (SYSCALL)UuidCreate, 0 },
|
||||
#else
|
||||
{ "UuidCreate", (SYSCALL)0, 0 },
|
||||
@@ -1155,7 +1055,7 @@ static struct win_syscall {
|
||||
|
||||
#define osUuidCreate ((RPC_STATUS(RPC_ENTRY*)(UUID*))aSyscall[77].pCurrent)
|
||||
|
||||
#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && SQLITE_WIN32_USE_UUID
|
||||
#if !SQLITE_OS_WINCE && SQLITE_WIN32_USE_UUID
|
||||
{ "UuidCreateSequential", (SYSCALL)UuidCreateSequential, 0 },
|
||||
#else
|
||||
{ "UuidCreateSequential", (SYSCALL)0, 0 },
|
||||
@@ -1366,10 +1266,10 @@ int sqlite3_win32_compact_heap(LPUINT pnLargest){
|
||||
hHeap = winMemGetHeap();
|
||||
assert( hHeap!=0 );
|
||||
assert( hHeap!=INVALID_HANDLE_VALUE );
|
||||
#if !SQLITE_OS_WINRT && defined(SQLITE_WIN32_MALLOC_VALIDATE)
|
||||
#if defined(SQLITE_WIN32_MALLOC_VALIDATE)
|
||||
assert( osHeapValidate(hHeap, SQLITE_WIN32_HEAP_FLAGS, NULL) );
|
||||
#endif
|
||||
#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT
|
||||
#if !SQLITE_OS_WINCE
|
||||
if( (nLargest=osHeapCompact(hHeap, SQLITE_WIN32_HEAP_FLAGS))==0 ){
|
||||
DWORD lastErrno = osGetLastError();
|
||||
if( lastErrno==NO_ERROR ){
|
||||
@@ -1482,28 +1382,11 @@ void sqlite3_win32_write_debug(const char *zBuf, int nBuf){
|
||||
}
|
||||
#endif /* _WIN32 */
|
||||
|
||||
/*
|
||||
** The following routine suspends the current thread for at least ms
|
||||
** milliseconds. This is equivalent to the Win32 Sleep() interface.
|
||||
*/
|
||||
#if SQLITE_OS_WINRT
|
||||
static HANDLE sleepObj = NULL;
|
||||
#endif
|
||||
|
||||
void sqlite3_win32_sleep(DWORD milliseconds){
|
||||
#if SQLITE_OS_WINRT
|
||||
if ( sleepObj==NULL ){
|
||||
sleepObj = osCreateEventExW(NULL, NULL, CREATE_EVENT_MANUAL_RESET,
|
||||
SYNCHRONIZE);
|
||||
}
|
||||
assert( sleepObj!=NULL );
|
||||
osWaitForSingleObjectEx(sleepObj, milliseconds, FALSE);
|
||||
#else
|
||||
osSleep(milliseconds);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if SQLITE_MAX_WORKER_THREADS>0 && !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && \
|
||||
#if SQLITE_MAX_WORKER_THREADS>0 && !SQLITE_OS_WINCE && \
|
||||
SQLITE_THREADSAFE>0
|
||||
DWORD sqlite3Win32Wait(HANDLE hObject){
|
||||
DWORD rc;
|
||||
@@ -1527,7 +1410,7 @@ DWORD sqlite3Win32Wait(HANDLE hObject){
|
||||
|
||||
#if !SQLITE_WIN32_GETVERSIONEX
|
||||
# define osIsNT() (1)
|
||||
#elif SQLITE_OS_WINCE || SQLITE_OS_WINRT || !defined(SQLITE_WIN32_HAS_ANSI)
|
||||
#elif SQLITE_OS_WINCE || !defined(SQLITE_WIN32_HAS_ANSI)
|
||||
# define osIsNT() (1)
|
||||
#elif !defined(SQLITE_WIN32_HAS_WIDE)
|
||||
# define osIsNT() (0)
|
||||
@@ -1540,13 +1423,7 @@ DWORD sqlite3Win32Wait(HANDLE hObject){
|
||||
** based on the NT kernel.
|
||||
*/
|
||||
int sqlite3_win32_is_nt(void){
|
||||
#if SQLITE_OS_WINRT
|
||||
/*
|
||||
** NOTE: The WinRT sub-platform is always assumed to be based on the NT
|
||||
** kernel.
|
||||
*/
|
||||
return 1;
|
||||
#elif SQLITE_WIN32_GETVERSIONEX
|
||||
#if SQLITE_WIN32_GETVERSIONEX
|
||||
if( osInterlockedCompareExchange(&sqlite3_os_type, 0, 0)==0 ){
|
||||
#if defined(SQLITE_WIN32_HAS_ANSI)
|
||||
OSVERSIONINFOA sInfo;
|
||||
@@ -1588,7 +1465,7 @@ static void *winMemMalloc(int nBytes){
|
||||
hHeap = winMemGetHeap();
|
||||
assert( hHeap!=0 );
|
||||
assert( hHeap!=INVALID_HANDLE_VALUE );
|
||||
#if !SQLITE_OS_WINRT && defined(SQLITE_WIN32_MALLOC_VALIDATE)
|
||||
#if defined(SQLITE_WIN32_MALLOC_VALIDATE)
|
||||
assert( osHeapValidate(hHeap, SQLITE_WIN32_HEAP_FLAGS, NULL) );
|
||||
#endif
|
||||
assert( nBytes>=0 );
|
||||
@@ -1610,7 +1487,7 @@ static void winMemFree(void *pPrior){
|
||||
hHeap = winMemGetHeap();
|
||||
assert( hHeap!=0 );
|
||||
assert( hHeap!=INVALID_HANDLE_VALUE );
|
||||
#if !SQLITE_OS_WINRT && defined(SQLITE_WIN32_MALLOC_VALIDATE)
|
||||
#if defined(SQLITE_WIN32_MALLOC_VALIDATE)
|
||||
assert( osHeapValidate(hHeap, SQLITE_WIN32_HEAP_FLAGS, pPrior) );
|
||||
#endif
|
||||
if( !pPrior ) return; /* Passing NULL to HeapFree is undefined. */
|
||||
@@ -1631,7 +1508,7 @@ static void *winMemRealloc(void *pPrior, int nBytes){
|
||||
hHeap = winMemGetHeap();
|
||||
assert( hHeap!=0 );
|
||||
assert( hHeap!=INVALID_HANDLE_VALUE );
|
||||
#if !SQLITE_OS_WINRT && defined(SQLITE_WIN32_MALLOC_VALIDATE)
|
||||
#if defined(SQLITE_WIN32_MALLOC_VALIDATE)
|
||||
assert( osHeapValidate(hHeap, SQLITE_WIN32_HEAP_FLAGS, pPrior) );
|
||||
#endif
|
||||
assert( nBytes>=0 );
|
||||
@@ -1659,7 +1536,7 @@ static int winMemSize(void *p){
|
||||
hHeap = winMemGetHeap();
|
||||
assert( hHeap!=0 );
|
||||
assert( hHeap!=INVALID_HANDLE_VALUE );
|
||||
#if !SQLITE_OS_WINRT && defined(SQLITE_WIN32_MALLOC_VALIDATE)
|
||||
#if defined(SQLITE_WIN32_MALLOC_VALIDATE)
|
||||
assert( osHeapValidate(hHeap, SQLITE_WIN32_HEAP_FLAGS, p) );
|
||||
#endif
|
||||
if( !p ) return 0;
|
||||
@@ -1689,7 +1566,7 @@ static int winMemInit(void *pAppData){
|
||||
assert( pWinMemData->magic1==WINMEM_MAGIC1 );
|
||||
assert( pWinMemData->magic2==WINMEM_MAGIC2 );
|
||||
|
||||
#if !SQLITE_OS_WINRT && SQLITE_WIN32_HEAP_CREATE
|
||||
#if SQLITE_WIN32_HEAP_CREATE
|
||||
if( !pWinMemData->hHeap ){
|
||||
DWORD dwInitialSize = SQLITE_WIN32_HEAP_INIT_SIZE;
|
||||
DWORD dwMaximumSize = (DWORD)sqlite3GlobalConfig.nHeap;
|
||||
@@ -1722,7 +1599,7 @@ static int winMemInit(void *pAppData){
|
||||
#endif
|
||||
assert( pWinMemData->hHeap!=0 );
|
||||
assert( pWinMemData->hHeap!=INVALID_HANDLE_VALUE );
|
||||
#if !SQLITE_OS_WINRT && defined(SQLITE_WIN32_MALLOC_VALIDATE)
|
||||
#if defined(SQLITE_WIN32_MALLOC_VALIDATE)
|
||||
assert( osHeapValidate(pWinMemData->hHeap, SQLITE_WIN32_HEAP_FLAGS, NULL) );
|
||||
#endif
|
||||
return SQLITE_OK;
|
||||
@@ -1740,7 +1617,7 @@ static void winMemShutdown(void *pAppData){
|
||||
|
||||
if( pWinMemData->hHeap ){
|
||||
assert( pWinMemData->hHeap!=INVALID_HANDLE_VALUE );
|
||||
#if !SQLITE_OS_WINRT && defined(SQLITE_WIN32_MALLOC_VALIDATE)
|
||||
#if defined(SQLITE_WIN32_MALLOC_VALIDATE)
|
||||
assert( osHeapValidate(pWinMemData->hHeap, SQLITE_WIN32_HEAP_FLAGS, NULL) );
|
||||
#endif
|
||||
if( pWinMemData->bOwned ){
|
||||
@@ -2121,17 +1998,6 @@ static int winGetLastErrorMsg(DWORD lastErrno, int nBuf, char *zBuf){
|
||||
char *zOut = 0;
|
||||
|
||||
if( osIsNT() ){
|
||||
#if SQLITE_OS_WINRT
|
||||
WCHAR zTempWide[SQLITE_WIN32_MAX_ERRMSG_CHARS+1];
|
||||
dwLen = osFormatMessageW(FORMAT_MESSAGE_FROM_SYSTEM |
|
||||
FORMAT_MESSAGE_IGNORE_INSERTS,
|
||||
NULL,
|
||||
lastErrno,
|
||||
0,
|
||||
zTempWide,
|
||||
SQLITE_WIN32_MAX_ERRMSG_CHARS,
|
||||
0);
|
||||
#else
|
||||
LPWSTR zTempWide = NULL;
|
||||
dwLen = osFormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER |
|
||||
FORMAT_MESSAGE_FROM_SYSTEM |
|
||||
@@ -2142,16 +2008,13 @@ static int winGetLastErrorMsg(DWORD lastErrno, int nBuf, char *zBuf){
|
||||
(LPWSTR) &zTempWide,
|
||||
0,
|
||||
0);
|
||||
#endif
|
||||
if( dwLen > 0 ){
|
||||
/* allocate a buffer and convert to UTF8 */
|
||||
sqlite3BeginBenignMalloc();
|
||||
zOut = winUnicodeToUtf8(zTempWide);
|
||||
sqlite3EndBenignMalloc();
|
||||
#if !SQLITE_OS_WINRT
|
||||
/* free the system buffer allocated by FormatMessage */
|
||||
osLocalFree(zTempWide);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#ifdef SQLITE_WIN32_HAS_ANSI
|
||||
@@ -2812,7 +2675,6 @@ static int winHandleUnlock(HANDLE h, int iOff, int nByte){
|
||||
static int winHandleSeek(HANDLE h, sqlite3_int64 iOffset){
|
||||
int rc = SQLITE_OK; /* Return value */
|
||||
|
||||
#if !SQLITE_OS_WINRT
|
||||
LONG upperBits; /* Most sig. 32 bits of new offset */
|
||||
LONG lowerBits; /* Least sig. 32 bits of new offset */
|
||||
DWORD dwRet; /* Value returned by SetFilePointer() */
|
||||
@@ -2834,20 +2696,7 @@ static int winHandleSeek(HANDLE h, sqlite3_int64 iOffset){
|
||||
rc = SQLITE_IOERR_SEEK;
|
||||
}
|
||||
}
|
||||
#else
|
||||
/* This implementation works for WinRT. */
|
||||
LARGE_INTEGER x; /* The new offset */
|
||||
BOOL bRet; /* Value returned by SetFilePointerEx() */
|
||||
|
||||
x.QuadPart = iOffset;
|
||||
bRet = osSetFilePointerEx(h, x, 0, FILE_BEGIN);
|
||||
|
||||
if(!bRet){
|
||||
rc = SQLITE_IOERR_SEEK;
|
||||
}
|
||||
#endif
|
||||
|
||||
OSTRACE(("SEEK file=%p, offset=%lld rc=%s\n", h, iOffset, sqlite3ErrName(rc)));
|
||||
OSTRACE(("SEEK file=%p, offset=%lld rc=%s\n", h, iOffset,sqlite3ErrName(rc)));
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -3148,17 +2997,6 @@ static int winHandleTruncate(HANDLE h, sqlite3_int64 nByte){
|
||||
*/
|
||||
static int winHandleSize(HANDLE h, sqlite3_int64 *pnByte){
|
||||
int rc = SQLITE_OK;
|
||||
|
||||
#if SQLITE_OS_WINRT
|
||||
FILE_STANDARD_INFO info;
|
||||
BOOL b;
|
||||
b = osGetFileInformationByHandleEx(h, FileStandardInfo, &info, sizeof(info));
|
||||
if( b ){
|
||||
*pnByte = info.EndOfFile.QuadPart;
|
||||
}else{
|
||||
rc = SQLITE_IOERR_FSTAT;
|
||||
}
|
||||
#else
|
||||
DWORD upperBits = 0;
|
||||
DWORD lowerBits = 0;
|
||||
|
||||
@@ -3168,8 +3006,6 @@ static int winHandleSize(HANDLE h, sqlite3_int64 *pnByte){
|
||||
if( lowerBits==INVALID_FILE_SIZE && osGetLastError()!=NO_ERROR ){
|
||||
rc = SQLITE_IOERR_FSTAT;
|
||||
}
|
||||
#endif
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -3368,20 +3204,6 @@ static int winFileSize(sqlite3_file *id, sqlite3_int64 *pSize){
|
||||
assert( pSize!=0 );
|
||||
SimulateIOError(return SQLITE_IOERR_FSTAT);
|
||||
OSTRACE(("SIZE file=%p, pSize=%p\n", pFile->h, pSize));
|
||||
|
||||
#if SQLITE_OS_WINRT
|
||||
{
|
||||
FILE_STANDARD_INFO info;
|
||||
if( osGetFileInformationByHandleEx(pFile->h, FileStandardInfo,
|
||||
&info, sizeof(info)) ){
|
||||
*pSize = info.EndOfFile.QuadPart;
|
||||
}else{
|
||||
pFile->lastErrno = osGetLastError();
|
||||
rc = winLogError(SQLITE_IOERR_FSTAT, pFile->lastErrno,
|
||||
"winFileSize", pFile->zPath);
|
||||
}
|
||||
}
|
||||
#else
|
||||
{
|
||||
DWORD upperBits;
|
||||
DWORD lowerBits;
|
||||
@@ -3396,7 +3218,6 @@ static int winFileSize(sqlite3_file *id, sqlite3_int64 *pSize){
|
||||
"winFileSize", pFile->zPath);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
OSTRACE(("SIZE file=%p, pSize=%p, *pSize=%lld, rc=%s\n",
|
||||
pFile->h, pSize, *pSize, sqlite3ErrName(rc)));
|
||||
return rc;
|
||||
@@ -4358,20 +4179,6 @@ static int winHandleOpen(
|
||||
** TODO: retry-on-ioerr.
|
||||
*/
|
||||
if( osIsNT() ){
|
||||
#if SQLITE_OS_WINRT
|
||||
CREATEFILE2_EXTENDED_PARAMETERS extendedParameters;
|
||||
memset(&extendedParameters, 0, sizeof(extendedParameters));
|
||||
extendedParameters.dwSize = sizeof(extendedParameters);
|
||||
extendedParameters.dwFileAttributes = FILE_ATTRIBUTE_NORMAL;
|
||||
extendedParameters.dwFileFlags = flag_overlapped;
|
||||
extendedParameters.dwSecurityQosFlags = SECURITY_ANONYMOUS;
|
||||
h = osCreateFile2((LPCWSTR)zConverted,
|
||||
(GENERIC_READ | (bReadonly ? 0 : GENERIC_WRITE)),/* dwDesiredAccess */
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE, /* dwShareMode */
|
||||
OPEN_ALWAYS, /* dwCreationDisposition */
|
||||
&extendedParameters
|
||||
);
|
||||
#else
|
||||
h = osCreateFileW((LPCWSTR)zConverted, /* lpFileName */
|
||||
(GENERIC_READ | (bReadonly ? 0 : GENERIC_WRITE)), /* dwDesiredAccess */
|
||||
FILE_SHARE_READ | FILE_SHARE_WRITE, /* dwShareMode */
|
||||
@@ -4380,7 +4187,6 @@ static int winHandleOpen(
|
||||
FILE_ATTRIBUTE_NORMAL|flag_overlapped,
|
||||
NULL
|
||||
);
|
||||
#endif
|
||||
}else{
|
||||
/* Due to pre-processor directives earlier in this file,
|
||||
** SQLITE_WIN32_HAS_ANSI is always defined if osIsNT() is false. */
|
||||
@@ -4848,9 +4654,7 @@ static int winShmMap(
|
||||
HANDLE hMap = NULL; /* file-mapping handle */
|
||||
void *pMap = 0; /* Mapped memory region */
|
||||
|
||||
#if SQLITE_OS_WINRT
|
||||
hMap = osCreateFileMappingFromApp(hShared, NULL, protect, nByte, NULL);
|
||||
#elif defined(SQLITE_WIN32_HAS_WIDE)
|
||||
#if defined(SQLITE_WIN32_HAS_WIDE)
|
||||
hMap = osCreateFileMappingW(hShared, NULL, protect, 0, nByte, NULL);
|
||||
#elif defined(SQLITE_WIN32_HAS_ANSI) && SQLITE_WIN32_CREATEFILEMAPPINGA
|
||||
hMap = osCreateFileMappingA(hShared, NULL, protect, 0, nByte, NULL);
|
||||
@@ -4862,15 +4666,9 @@ static int winShmMap(
|
||||
if( hMap ){
|
||||
int iOffset = pShmNode->nRegion*szRegion;
|
||||
int iOffsetShift = iOffset % winSysInfo.dwAllocationGranularity;
|
||||
#if SQLITE_OS_WINRT
|
||||
pMap = osMapViewOfFileFromApp(hMap, flags,
|
||||
iOffset - iOffsetShift, szRegion + iOffsetShift
|
||||
);
|
||||
#else
|
||||
pMap = osMapViewOfFile(hMap, flags,
|
||||
0, iOffset - iOffsetShift, szRegion + iOffsetShift
|
||||
);
|
||||
#endif
|
||||
OSTRACE(("SHM-MAP-MAP pid=%lu, region=%d, offset=%d, size=%d, rc=%s\n",
|
||||
osGetCurrentProcessId(), pShmNode->nRegion, iOffset,
|
||||
szRegion, pMap ? "ok" : "failed"));
|
||||
@@ -5003,9 +4801,7 @@ static int winMapfile(winFile *pFd, sqlite3_int64 nByte){
|
||||
flags |= FILE_MAP_WRITE;
|
||||
}
|
||||
#endif
|
||||
#if SQLITE_OS_WINRT
|
||||
pFd->hMap = osCreateFileMappingFromApp(pFd->h, NULL, protect, nMap, NULL);
|
||||
#elif defined(SQLITE_WIN32_HAS_WIDE)
|
||||
#if defined(SQLITE_WIN32_HAS_WIDE)
|
||||
pFd->hMap = osCreateFileMappingW(pFd->h, NULL, protect,
|
||||
(DWORD)((nMap>>32) & 0xffffffff),
|
||||
(DWORD)(nMap & 0xffffffff), NULL);
|
||||
@@ -5025,11 +4821,7 @@ static int winMapfile(winFile *pFd, sqlite3_int64 nByte){
|
||||
}
|
||||
assert( (nMap % winSysInfo.dwPageSize)==0 );
|
||||
assert( sizeof(SIZE_T)==sizeof(sqlite3_int64) || nMap<=0xffffffff );
|
||||
#if SQLITE_OS_WINRT
|
||||
pNew = osMapViewOfFileFromApp(pFd->hMap, flags, 0, (SIZE_T)nMap);
|
||||
#else
|
||||
pNew = osMapViewOfFile(pFd->hMap, flags, 0, 0, (SIZE_T)nMap);
|
||||
#endif
|
||||
if( pNew==NULL ){
|
||||
osCloseHandle(pFd->hMap);
|
||||
pFd->hMap = NULL;
|
||||
@@ -5364,7 +5156,6 @@ static int winGetTempname(sqlite3_vfs *pVfs, char **pzBuf){
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !SQLITE_OS_WINRT && defined(_WIN32)
|
||||
else if( osIsNT() ){
|
||||
char *zMulti;
|
||||
LPWSTR zWidePath = sqlite3MallocZero( nMax*sizeof(WCHAR) );
|
||||
@@ -5418,7 +5209,6 @@ static int winGetTempname(sqlite3_vfs *pVfs, char **pzBuf){
|
||||
}
|
||||
}
|
||||
#endif /* SQLITE_WIN32_HAS_ANSI */
|
||||
#endif /* !SQLITE_OS_WINRT */
|
||||
|
||||
/*
|
||||
** Check to make sure the temporary directory ends with an appropriate
|
||||
@@ -5593,13 +5383,6 @@ static int winOpen(
|
||||
memset(pFile, 0, sizeof(winFile));
|
||||
pFile->h = INVALID_HANDLE_VALUE;
|
||||
|
||||
#if SQLITE_OS_WINRT
|
||||
if( !zUtf8Name && !sqlite3_temp_directory ){
|
||||
sqlite3_log(SQLITE_ERROR,
|
||||
"sqlite3_temp_directory variable should be set for WinRT");
|
||||
}
|
||||
#endif
|
||||
|
||||
/* If the second argument to this function is NULL, generate a
|
||||
** temporary file name to use
|
||||
*/
|
||||
@@ -5682,31 +5465,6 @@ static int winOpen(
|
||||
#endif
|
||||
|
||||
if( osIsNT() ){
|
||||
#if SQLITE_OS_WINRT
|
||||
CREATEFILE2_EXTENDED_PARAMETERS extendedParameters;
|
||||
extendedParameters.dwSize = sizeof(CREATEFILE2_EXTENDED_PARAMETERS);
|
||||
extendedParameters.dwFileAttributes =
|
||||
dwFlagsAndAttributes & FILE_ATTRIBUTE_MASK;
|
||||
extendedParameters.dwFileFlags = dwFlagsAndAttributes & FILE_FLAG_MASK;
|
||||
extendedParameters.dwSecurityQosFlags = SECURITY_ANONYMOUS;
|
||||
extendedParameters.lpSecurityAttributes = NULL;
|
||||
extendedParameters.hTemplateFile = NULL;
|
||||
do{
|
||||
h = osCreateFile2((LPCWSTR)zConverted,
|
||||
dwDesiredAccess,
|
||||
dwShareMode,
|
||||
dwCreationDisposition,
|
||||
&extendedParameters);
|
||||
if( h!=INVALID_HANDLE_VALUE ) break;
|
||||
if( isReadWrite ){
|
||||
int rc2;
|
||||
sqlite3BeginBenignMalloc();
|
||||
rc2 = winAccess(pVfs, zUtf8Name, SQLITE_ACCESS_READ|NORETRY, &isRO);
|
||||
sqlite3EndBenignMalloc();
|
||||
if( rc2==SQLITE_OK && isRO ) break;
|
||||
}
|
||||
}while( winRetryIoerr(&cnt, &lastErrno) );
|
||||
#else
|
||||
do{
|
||||
h = osCreateFileW((LPCWSTR)zConverted,
|
||||
dwDesiredAccess,
|
||||
@@ -5723,7 +5481,6 @@ static int winOpen(
|
||||
if( rc2==SQLITE_OK && isRO ) break;
|
||||
}
|
||||
}while( winRetryIoerr(&cnt, &lastErrno) );
|
||||
#endif
|
||||
}
|
||||
#ifdef SQLITE_WIN32_HAS_ANSI
|
||||
else{
|
||||
@@ -5860,25 +5617,7 @@ static int winDelete(
|
||||
}
|
||||
if( osIsNT() ){
|
||||
do {
|
||||
#if SQLITE_OS_WINRT
|
||||
WIN32_FILE_ATTRIBUTE_DATA sAttrData;
|
||||
memset(&sAttrData, 0, sizeof(sAttrData));
|
||||
if ( osGetFileAttributesExW(zConverted, GetFileExInfoStandard,
|
||||
&sAttrData) ){
|
||||
attr = sAttrData.dwFileAttributes;
|
||||
}else{
|
||||
lastErrno = osGetLastError();
|
||||
if( lastErrno==ERROR_FILE_NOT_FOUND
|
||||
|| lastErrno==ERROR_PATH_NOT_FOUND ){
|
||||
rc = SQLITE_IOERR_DELETE_NOENT; /* Already gone? */
|
||||
}else{
|
||||
rc = SQLITE_ERROR;
|
||||
}
|
||||
break;
|
||||
}
|
||||
#else
|
||||
attr = osGetFileAttributesW(zConverted);
|
||||
#endif
|
||||
if ( attr==INVALID_FILE_ATTRIBUTES ){
|
||||
lastErrno = osGetLastError();
|
||||
if( lastErrno==ERROR_FILE_NOT_FOUND
|
||||
@@ -6169,7 +5908,7 @@ static int winFullPathnameNoMutex(
|
||||
int nFull, /* Size of output buffer in bytes */
|
||||
char *zFull /* Output buffer */
|
||||
){
|
||||
#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT
|
||||
#if !SQLITE_OS_WINCE
|
||||
int nByte;
|
||||
void *zConverted;
|
||||
char *zOut;
|
||||
@@ -6258,7 +5997,7 @@ static int winFullPathnameNoMutex(
|
||||
}
|
||||
#endif /* __CYGWIN__ */
|
||||
|
||||
#if (SQLITE_OS_WINCE || SQLITE_OS_WINRT) && defined(_WIN32)
|
||||
#if SQLITE_OS_WINCE && defined(_WIN32)
|
||||
SimulateIOError( return SQLITE_ERROR );
|
||||
/* WinCE has no concept of a relative pathname, or so I am told. */
|
||||
/* WinRT has no way to convert a relative path to an absolute one. */
|
||||
@@ -6277,7 +6016,7 @@ static int winFullPathnameNoMutex(
|
||||
return SQLITE_OK;
|
||||
#endif
|
||||
|
||||
#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT
|
||||
#if !SQLITE_OS_WINCE
|
||||
#if defined(_WIN32)
|
||||
/* It's odd to simulate an io-error here, but really this is just
|
||||
** using the io-error infrastructure to test that SQLite handles this
|
||||
@@ -6409,11 +6148,7 @@ static void *winDlOpen(sqlite3_vfs *pVfs, const char *zFilename){
|
||||
return 0;
|
||||
}
|
||||
if( osIsNT() ){
|
||||
#if SQLITE_OS_WINRT
|
||||
h = osLoadPackagedLibrary((LPCWSTR)zConverted, 0);
|
||||
#else
|
||||
h = osLoadLibraryW((LPCWSTR)zConverted);
|
||||
#endif
|
||||
}
|
||||
#ifdef SQLITE_WIN32_HAS_ANSI
|
||||
else{
|
||||
@@ -6495,23 +6230,16 @@ static int winRandomness(sqlite3_vfs *pVfs, int nBuf, char *zBuf){
|
||||
DWORD pid = osGetCurrentProcessId();
|
||||
xorMemory(&e, (unsigned char*)&pid, sizeof(DWORD));
|
||||
}
|
||||
#if SQLITE_OS_WINRT
|
||||
{
|
||||
ULONGLONG cnt = osGetTickCount64();
|
||||
xorMemory(&e, (unsigned char*)&cnt, sizeof(ULONGLONG));
|
||||
}
|
||||
#else
|
||||
{
|
||||
DWORD cnt = osGetTickCount();
|
||||
xorMemory(&e, (unsigned char*)&cnt, sizeof(DWORD));
|
||||
}
|
||||
#endif /* SQLITE_OS_WINRT */
|
||||
{
|
||||
LARGE_INTEGER i;
|
||||
osQueryPerformanceCounter(&i);
|
||||
xorMemory(&e, (unsigned char*)&i, sizeof(LARGE_INTEGER));
|
||||
}
|
||||
#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && SQLITE_WIN32_USE_UUID
|
||||
#if !SQLITE_OS_WINCE && SQLITE_WIN32_USE_UUID
|
||||
{
|
||||
UUID id;
|
||||
memset(&id, 0, sizeof(UUID));
|
||||
@@ -6521,7 +6249,7 @@ static int winRandomness(sqlite3_vfs *pVfs, int nBuf, char *zBuf){
|
||||
osUuidCreateSequential(&id);
|
||||
xorMemory(&e, (unsigned char*)&id, sizeof(UUID));
|
||||
}
|
||||
#endif /* !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && SQLITE_WIN32_USE_UUID */
|
||||
#endif /* !SQLITE_OS_WINCE && SQLITE_WIN32_USE_UUID */
|
||||
return e.nXor>nBuf ? nBuf : e.nXor;
|
||||
#endif /* defined(SQLITE_TEST) || defined(SQLITE_OMIT_RANDOMNESS) */
|
||||
}
|
||||
@@ -6752,15 +6480,11 @@ int sqlite3_os_init(void){
|
||||
|
||||
/* Double-check that the aSyscall[] array has been constructed
|
||||
** correctly. See ticket [bb3a86e890c8e96ab] */
|
||||
assert( ArraySize(aSyscall)==89 );
|
||||
assert( ArraySize(aSyscall)==86 );
|
||||
|
||||
/* get memory map allocation granularity */
|
||||
memset(&winSysInfo, 0, sizeof(SYSTEM_INFO));
|
||||
#if SQLITE_OS_WINRT
|
||||
osGetNativeSystemInfo(&winSysInfo);
|
||||
#else
|
||||
osGetSystemInfo(&winSysInfo);
|
||||
#endif
|
||||
assert( winSysInfo.dwAllocationGranularity>0 );
|
||||
assert( winSysInfo.dwPageSize>0 );
|
||||
|
||||
@@ -6784,17 +6508,9 @@ int sqlite3_os_init(void){
|
||||
}
|
||||
|
||||
int sqlite3_os_end(void){
|
||||
#if SQLITE_OS_WINRT
|
||||
if( sleepObj!=NULL ){
|
||||
osCloseHandle(sleepObj);
|
||||
sleepObj = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef SQLITE_OMIT_WAL
|
||||
winBigLock = 0;
|
||||
#endif
|
||||
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
|
||||
+1
-9
@@ -58,14 +58,6 @@
|
||||
# define SQLITE_OS_WINCE 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Determine if we are dealing with WinRT, which provides only a subset of
|
||||
** the full Win32 API.
|
||||
*/
|
||||
#if !defined(SQLITE_OS_WINRT)
|
||||
# define SQLITE_OS_WINRT 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
** For WinCE, some API function parameters do not appear to be declared as
|
||||
** volatile.
|
||||
@@ -80,7 +72,7 @@
|
||||
** For some Windows sub-platforms, the _beginthreadex() / _endthreadex()
|
||||
** functions are not available (e.g. those not using MSVC, Cygwin, etc).
|
||||
*/
|
||||
#if SQLITE_OS_WIN && !SQLITE_OS_WINCE && !SQLITE_OS_WINRT && \
|
||||
#if SQLITE_OS_WIN && !SQLITE_OS_WINCE && \
|
||||
SQLITE_THREADSAFE>0 && !defined(__CYGWIN__)
|
||||
# define SQLITE_OS_WIN_THREADS 1
|
||||
#else
|
||||
|
||||
+33
-31
@@ -833,18 +833,35 @@ fullname(A) ::= nm(X) DOT nm(Y). {
|
||||
|
||||
%type xfullname {SrcList*}
|
||||
%destructor xfullname {sqlite3SrcListDelete(pParse->db, $$);}
|
||||
xfullname(A) ::= nm(X).
|
||||
{A = sqlite3SrcListAppend(pParse,0,&X,0); /*A-overwrites-X*/}
|
||||
xfullname(A) ::= nm(X) DOT nm(Y).
|
||||
{A = sqlite3SrcListAppend(pParse,0,&X,&Y); /*A-overwrites-X*/}
|
||||
xfullname(A) ::= nm(X) DOT nm(Y) AS nm(Z). {
|
||||
A = sqlite3SrcListAppend(pParse,0,&X,&Y); /*A-overwrites-X*/
|
||||
if( A ) A->a[0].zAlias = sqlite3NameFromToken(pParse->db, &Z);
|
||||
xfullname(A) ::= nm(X). {
|
||||
A = sqlite3SrcListAppend(pParse,0,&X,0);
|
||||
if( IN_RENAME_OBJECT && A ) sqlite3RenameTokenMap(pParse, A->a[0].zName, &X);
|
||||
}
|
||||
xfullname(A) ::= nm(X) AS nm(Z). {
|
||||
A = sqlite3SrcListAppend(pParse,0,&X,0); /*A-overwrites-X*/
|
||||
if( A ) A->a[0].zAlias = sqlite3NameFromToken(pParse->db, &Z);
|
||||
xfullname(A) ::= nm(X) DOT nm(Y). {
|
||||
A = sqlite3SrcListAppend(pParse,0,&X,&Y);
|
||||
if( IN_RENAME_OBJECT && A ) sqlite3RenameTokenMap(pParse, A->a[0].zName, &Y);
|
||||
}
|
||||
xfullname(A) ::= nm(X) AS nm(Z). {
|
||||
A = sqlite3SrcListAppend(pParse,0,&X,0);
|
||||
if( A ){
|
||||
if( IN_RENAME_OBJECT ){
|
||||
sqlite3RenameTokenMap(pParse, A->a[0].zName, &X);
|
||||
}else{
|
||||
A->a[0].zAlias = sqlite3NameFromToken(pParse->db, &Z);
|
||||
}
|
||||
}
|
||||
}
|
||||
xfullname(A) ::= nm(X) DOT nm(Y) AS nm(Z). {
|
||||
A = sqlite3SrcListAppend(pParse,0,&X,&Y);
|
||||
if( A ){
|
||||
if( IN_RENAME_OBJECT ){
|
||||
sqlite3RenameTokenMap(pParse, A->a[0].zName, &Y);
|
||||
}else{
|
||||
A->a[0].zAlias = sqlite3NameFromToken(pParse->db, &Z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
%type joinop {int}
|
||||
joinop(X) ::= COMMA|JOIN. { X = JT_INNER; }
|
||||
@@ -1753,28 +1770,13 @@ when_clause(A) ::= WHEN expr(X). { A = X; }
|
||||
%type trigger_cmd_list {TriggerStep*}
|
||||
%destructor trigger_cmd_list {sqlite3DeleteTriggerStep(pParse->db, $$);}
|
||||
trigger_cmd_list(A) ::= trigger_cmd_list(A) trigger_cmd(X) SEMI. {
|
||||
assert( A!=0 );
|
||||
A->pLast->pNext = X;
|
||||
A->pLast = X;
|
||||
}
|
||||
trigger_cmd_list(A) ::= trigger_cmd(A) SEMI. {
|
||||
assert( A!=0 );
|
||||
A->pLast = A;
|
||||
}
|
||||
|
||||
// Disallow qualified table names on INSERT, UPDATE, and DELETE statements
|
||||
// within a trigger. The table to INSERT, UPDATE, or DELETE is always in
|
||||
// the same database as the table that the trigger fires on.
|
||||
//
|
||||
%type trnm {Token}
|
||||
trnm(A) ::= nm(A).
|
||||
trnm(A) ::= nm DOT nm(X). {
|
||||
A = X;
|
||||
sqlite3ErrorMsg(pParse,
|
||||
"qualified table names are not allowed on INSERT, UPDATE, and DELETE "
|
||||
"statements within triggers");
|
||||
}
|
||||
|
||||
// Disallow the INDEX BY and NOT INDEXED clauses on UPDATE and DELETE
|
||||
// statements within triggers. We make a specific error message for this
|
||||
// since it is an exception to the default grammar rules.
|
||||
@@ -1797,17 +1799,17 @@ tridxby ::= NOT INDEXED. {
|
||||
%destructor trigger_cmd {sqlite3DeleteTriggerStep(pParse->db, $$);}
|
||||
// UPDATE
|
||||
trigger_cmd(A) ::=
|
||||
UPDATE(B) orconf(R) trnm(X) tridxby SET setlist(Y) from(F) where_opt(Z) scanpt(E).
|
||||
{A = sqlite3TriggerUpdateStep(pParse, &X, F, Y, Z, R, B.z, E);}
|
||||
UPDATE(B) orconf(R) xfullname(X) tridxby SET setlist(Y) from(F) where_opt(Z) scanpt(E).
|
||||
{A = sqlite3TriggerUpdateStep(pParse, X, F, Y, Z, R, B.z, E);}
|
||||
|
||||
// INSERT
|
||||
trigger_cmd(A) ::= scanpt(B) insert_cmd(R) INTO
|
||||
trnm(X) idlist_opt(F) select(S) upsert(U) scanpt(Z). {
|
||||
A = sqlite3TriggerInsertStep(pParse,&X,F,S,R,U,B,Z);/*A-overwrites-R*/
|
||||
xfullname(X) idlist_opt(F) select(S) upsert(U) scanpt(Z). {
|
||||
A = sqlite3TriggerInsertStep(pParse,X,F,S,R,U,B,Z);/*A-overwrites-R*/
|
||||
}
|
||||
// DELETE
|
||||
trigger_cmd(A) ::= DELETE(B) FROM trnm(X) tridxby where_opt(Y) scanpt(E).
|
||||
{A = sqlite3TriggerDeleteStep(pParse, &X, Y, B.z, E);}
|
||||
trigger_cmd(A) ::= DELETE(B) FROM xfullname(X) tridxby where_opt(Y) scanpt(E).
|
||||
{A = sqlite3TriggerDeleteStep(pParse, X, Y, B.z, E);}
|
||||
|
||||
// SELECT
|
||||
trigger_cmd(A) ::= scanpt(B) select(X) scanpt(E).
|
||||
|
||||
+6
-1
@@ -1445,9 +1445,14 @@ static void selectInnerLoop(
|
||||
assert( nResultCol<=pDest->nSdst );
|
||||
pushOntoSorter(
|
||||
pParse, pSort, p, regResult, regOrig, nResultCol, nPrefixReg);
|
||||
pDest->iSDParm = regResult;
|
||||
}else{
|
||||
assert( nResultCol==pDest->nSdst );
|
||||
assert( regResult==iParm );
|
||||
if( regResult!=iParm ){
|
||||
/* This occurs in cases where the SELECT had both a DISTINCT and
|
||||
** an OFFSET clause. */
|
||||
sqlite3VdbeAddOp3(v, OP_Copy, regResult, iParm, nResultCol-1);
|
||||
}
|
||||
/* The LIMIT clause will jump out of the loop for us */
|
||||
}
|
||||
break;
|
||||
|
||||
+13
-32
@@ -31,14 +31,6 @@ typedef unsigned short int u16;
|
||||
# include SHELL_STRINGIFY(SQLITE_CUSTOM_INCLUDE)
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Determine if we are dealing with WinRT, which provides only a subset of
|
||||
** the full Win32 API.
|
||||
*/
|
||||
#if !defined(SQLITE_OS_WINRT)
|
||||
# define SQLITE_OS_WINRT 0
|
||||
#endif
|
||||
|
||||
/*
|
||||
** If SQLITE_SHELL_FIDDLE is defined then the shell is modified
|
||||
** somewhat for use as a WASM module in a web browser. This flag
|
||||
@@ -178,9 +170,6 @@ typedef unsigned char u8;
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) || defined(WIN32)
|
||||
# if SQLITE_OS_WINRT
|
||||
# define SQLITE_OMIT_POPEN 1
|
||||
# else
|
||||
# include <io.h>
|
||||
# include <fcntl.h>
|
||||
# define isatty(h) _isatty(h)
|
||||
@@ -195,7 +184,6 @@ typedef unsigned char u8;
|
||||
# endif
|
||||
# undef pclose
|
||||
# define pclose _pclose
|
||||
# endif
|
||||
#else
|
||||
/* Make sure isatty() has a prototype. */
|
||||
extern int isatty(int);
|
||||
@@ -226,9 +214,6 @@ typedef unsigned char u8;
|
||||
#define IsAlpha(X) isalpha((unsigned char)X)
|
||||
|
||||
#if defined(_WIN32) || defined(WIN32)
|
||||
#if SQLITE_OS_WINRT
|
||||
#include <intrin.h>
|
||||
#endif
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
@@ -436,7 +421,6 @@ static int hasTimer(void){
|
||||
if( getProcessTimesAddr ){
|
||||
return 1;
|
||||
} else {
|
||||
#if !SQLITE_OS_WINRT
|
||||
/* GetProcessTimes() isn't supported in WIN95 and some other Windows
|
||||
** versions. See if the version we are running on has it, and if it
|
||||
** does, save off a pointer to it and the current process handle.
|
||||
@@ -453,7 +437,6 @@ static int hasTimer(void){
|
||||
FreeLibrary(hinstLib);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -1386,7 +1369,7 @@ static ShellState shellState;
|
||||
*/
|
||||
static const char *qrfEscNames[] = { "auto", "off", "ascii", "symbol" };
|
||||
static const char *qrfQuoteNames[] =
|
||||
{ "off","off","sql","hex","csv","tcl","json"};
|
||||
{ "off","off","sql","hex","csv","tcl","json","relaxed"};
|
||||
|
||||
/*
|
||||
** These are the allowed shellFlgs values
|
||||
@@ -1642,6 +1625,7 @@ static void modeChange(ShellState *p, unsigned char eMode){
|
||||
modeFree(&p->mode);
|
||||
modeChange(p, MODE_QBox);
|
||||
p->mode.bAutoScreenWidth = 1;
|
||||
p->mode.spec.eText = QRF_TEXT_Relaxed;
|
||||
p->mode.spec.nCharLimit = 300;
|
||||
p->mode.spec.nLineLimit = 5;
|
||||
p->mode.spec.bTextJsonb = QRF_Yes;
|
||||
@@ -3207,6 +3191,7 @@ static int shell_exec(
|
||||
}
|
||||
if( spec.eBlob==QRF_BLOB_Auto ){
|
||||
switch( spec.eText ){
|
||||
case QRF_TEXT_Relaxed: /* fall through */
|
||||
case QRF_TEXT_Sql: spec.eBlob = QRF_BLOB_Sql; break;
|
||||
case QRF_TEXT_Json: spec.eBlob = QRF_BLOB_Json; break;
|
||||
default: spec.eBlob = QRF_BLOB_Text; break;
|
||||
@@ -3220,7 +3205,7 @@ static int shell_exec(
|
||||
}
|
||||
#endif
|
||||
|
||||
while( zSql[0] && (SQLITE_OK == rc) ){
|
||||
while( zSql && zSql[0] && (SQLITE_OK == rc) ){
|
||||
static const char *zStmtSql;
|
||||
rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, &zLeftover);
|
||||
if( SQLITE_OK != rc ){
|
||||
@@ -7706,8 +7691,8 @@ static int modeTitleDsply(ShellState *p, int bAll){
|
||||
** --once Setting changes to the right are reverted after
|
||||
** the next SQL command.
|
||||
** --quote ARG Enable/disable quoting of text. ARG can be
|
||||
** "off", "on", "sql", "csv", "html", "tcl",
|
||||
** or "json". "off" means show the text as-is.
|
||||
** "off", "on", "sql", "relaxed", "csv", "html",
|
||||
** "tcl", or "json". "off" means show the text as-is.
|
||||
** "on" is an alias for "sql".
|
||||
** --reset Changes all mode settings back to their default.
|
||||
** --rowsep STRING Use STRING as the row separator
|
||||
@@ -7916,9 +7901,10 @@ static int dotCmdMode(ShellState *p){
|
||||
if( (k = pickStr(azArg[i],0,"no","yes","0","1",""))>=0 ){
|
||||
k &= 1; /* 0 for "off". 1 for "on". */
|
||||
}else{
|
||||
char *zErr = 0; /* 0 1 2 3 4 5 6 */
|
||||
k = pickStr(azArg[i],&zErr,"off","on","sql","csv","html","tcl","json",
|
||||
"");
|
||||
char *zErr = 0;
|
||||
k = pickStr(azArg[i],&zErr,
|
||||
"off","on","sql","csv","html","tcl","json","relaxed","");
|
||||
/* 0 1 2 3 4 5 6 7 */
|
||||
if( k<0 ){
|
||||
dotCmdError(p, i, "unknown", "%z", zErr);
|
||||
return 1;
|
||||
@@ -7947,6 +7933,9 @@ static int dotCmdMode(ShellState *p){
|
||||
case 6: /* json */
|
||||
p->mode.spec.eText = QRF_TEXT_Json;
|
||||
break;
|
||||
case 7: /* relaxed */
|
||||
p->mode.spec.eText = QRF_TEXT_Relaxed;
|
||||
break;
|
||||
default: /* off */
|
||||
p->mode.spec.eText = QRF_TEXT_Plain;
|
||||
break;
|
||||
@@ -12372,18 +12361,14 @@ static void main_init(ShellState *p) {
|
||||
*/
|
||||
#if defined(_WIN32) || defined(WIN32)
|
||||
static void printBold(const char *zText){
|
||||
#if !SQLITE_OS_WINRT
|
||||
HANDLE out = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
CONSOLE_SCREEN_BUFFER_INFO defaultScreenInfo;
|
||||
GetConsoleScreenBufferInfo(out, &defaultScreenInfo);
|
||||
SetConsoleTextAttribute(out,
|
||||
FOREGROUND_RED|FOREGROUND_INTENSITY
|
||||
);
|
||||
#endif
|
||||
sputz(stdout, zText);
|
||||
#if !SQLITE_OS_WINRT
|
||||
SetConsoleTextAttribute(out, defaultScreenInfo.wAttributes);
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
static void printBold(const char *zText){
|
||||
@@ -12489,11 +12474,7 @@ int SQLITE_CDECL wmain(int argc, wchar_t **wargv){
|
||||
}
|
||||
}else{
|
||||
#if defined(_WIN32) || defined(WIN32)
|
||||
#if SQLITE_OS_WINRT
|
||||
__debugbreak();
|
||||
#else
|
||||
DebugBreak();
|
||||
#endif
|
||||
#elif defined(SIGTRAP)
|
||||
raise(SIGTRAP);
|
||||
#endif
|
||||
|
||||
+7
-10
@@ -4152,19 +4152,19 @@ struct Trigger {
|
||||
** orconf -> stores the ON CONFLICT algorithm
|
||||
** pSelect -> The content to be inserted - either a SELECT statement or
|
||||
** a VALUES clause.
|
||||
** zTarget -> Dequoted name of the table to insert into.
|
||||
** pSrc -> Table to insert into.
|
||||
** pIdList -> If this is an INSERT INTO ... (<column-names>) VALUES ...
|
||||
** statement, then this stores the column-names to be
|
||||
** inserted into.
|
||||
** pUpsert -> The ON CONFLICT clauses for an Upsert
|
||||
**
|
||||
** (op == TK_DELETE)
|
||||
** zTarget -> Dequoted name of the table to delete from.
|
||||
** pSrc -> Table to delete from
|
||||
** pWhere -> The WHERE clause of the DELETE statement if one is specified.
|
||||
** Otherwise NULL.
|
||||
**
|
||||
** (op == TK_UPDATE)
|
||||
** zTarget -> Dequoted name of the table to update.
|
||||
** pSrc -> Table to update, followed by any FROM clause tables.
|
||||
** pWhere -> The WHERE clause of the UPDATE statement if one is specified.
|
||||
** Otherwise NULL.
|
||||
** pExprList -> A list of the columns to update and the expressions to update
|
||||
@@ -4184,8 +4184,7 @@ struct TriggerStep {
|
||||
u8 orconf; /* OE_Rollback etc. */
|
||||
Trigger *pTrig; /* The trigger that this step is a part of */
|
||||
Select *pSelect; /* SELECT statement or RHS of INSERT INTO SELECT ... */
|
||||
char *zTarget; /* Target table for DELETE, UPDATE, INSERT */
|
||||
SrcList *pFrom; /* FROM clause for UPDATE statement (if any) */
|
||||
SrcList *pSrc; /* Table to insert/update/delete */
|
||||
Expr *pWhere; /* The WHERE clause for DELETE or UPDATE steps */
|
||||
ExprList *pExprList; /* SET clause for UPDATE, or RETURNING clause */
|
||||
IdList *pIdList; /* Column names for INSERT */
|
||||
@@ -5253,17 +5252,16 @@ void sqlite3MaterializeView(Parse*, Table*, Expr*, ExprList*,Expr*,int);
|
||||
void sqlite3DeleteTriggerStep(sqlite3*, TriggerStep*);
|
||||
TriggerStep *sqlite3TriggerSelectStep(sqlite3*,Select*,
|
||||
const char*,const char*);
|
||||
TriggerStep *sqlite3TriggerInsertStep(Parse*,Token*, IdList*,
|
||||
TriggerStep *sqlite3TriggerInsertStep(Parse*,SrcList*, IdList*,
|
||||
Select*,u8,Upsert*,
|
||||
const char*,const char*);
|
||||
TriggerStep *sqlite3TriggerUpdateStep(Parse*,Token*,SrcList*,ExprList*,
|
||||
TriggerStep *sqlite3TriggerUpdateStep(Parse*,SrcList*,SrcList*,ExprList*,
|
||||
Expr*, u8, const char*,const char*);
|
||||
TriggerStep *sqlite3TriggerDeleteStep(Parse*,Token*, Expr*,
|
||||
TriggerStep *sqlite3TriggerDeleteStep(Parse*,SrcList*, Expr*,
|
||||
const char*,const char*);
|
||||
void sqlite3DeleteTrigger(sqlite3*, Trigger*);
|
||||
void sqlite3UnlinkAndDeleteTrigger(sqlite3*,int,const char*);
|
||||
u32 sqlite3TriggerColmask(Parse*,Trigger*,ExprList*,int,int,Table*,int);
|
||||
SrcList *sqlite3TriggerStepSrc(Parse*, TriggerStep*);
|
||||
# define sqlite3ParseToplevel(p) ((p)->pToplevel ? (p)->pToplevel : (p))
|
||||
# define sqlite3IsToplevel(p) ((p)->pToplevel==0)
|
||||
#else
|
||||
@@ -5277,7 +5275,6 @@ void sqlite3MaterializeView(Parse*, Table*, Expr*, ExprList*,Expr*,int);
|
||||
# define sqlite3ParseToplevel(p) p
|
||||
# define sqlite3IsToplevel(p) 1
|
||||
# define sqlite3TriggerColmask(A,B,C,D,E,F,G) 0
|
||||
# define sqlite3TriggerStepSrc(A,B) 0
|
||||
#endif
|
||||
|
||||
int sqlite3JoinType(Parse*, Token*, Token*, Token*);
|
||||
|
||||
@@ -60,6 +60,9 @@
|
||||
** It used to be the case that setting this value to zero would
|
||||
** turn the limit off. That is no longer true. It is not possible
|
||||
** to turn this limit off.
|
||||
**
|
||||
** The hard limit is the largest possible 32-bit signed integer less
|
||||
** 1024, or 2147482624.
|
||||
*/
|
||||
#ifndef SQLITE_MAX_SQL_LENGTH
|
||||
# define SQLITE_MAX_SQL_LENGTH 1000000000
|
||||
|
||||
+4
-4
@@ -2193,13 +2193,13 @@ static int dbQrf(SqliteDb *pDb, int objc, Tcl_Obj *const*objv){
|
||||
** thrid element of the array when processing --text */
|
||||
static const char *azText[] = { "off", "on",
|
||||
"auto", "csv", "html",
|
||||
"json", "plain", "sql",
|
||||
"tcl", 0
|
||||
"json", "plain", "relaxed",
|
||||
"sql", "tcl", 0
|
||||
};
|
||||
static unsigned char aTextMap[] = {
|
||||
QRF_TEXT_Auto, QRF_TEXT_Csv, QRF_TEXT_Html,
|
||||
QRF_TEXT_Json, QRF_TEXT_Plain, QRF_TEXT_Sql,
|
||||
QRF_TEXT_Tcl
|
||||
QRF_TEXT_Json, QRF_TEXT_Plain, QRF_TEXT_Relaxed,
|
||||
QRF_TEXT_Sql, QRF_TEXT_Tcl
|
||||
};
|
||||
int txt;
|
||||
int k = zArg[2]=='e';
|
||||
|
||||
+1
-7
@@ -82,7 +82,7 @@ static void set_options(Tcl_Interp *interp){
|
||||
Tcl_SetVar2(interp, "sqlite_options","configslower","1.0",TCL_GLOBAL_ONLY);
|
||||
#endif
|
||||
|
||||
#if !SQLITE_OS_WINCE && !SQLITE_OS_WINRT
|
||||
#if !SQLITE_OS_WINCE
|
||||
Tcl_SetVar2(interp, "sqlite_options", "curdir", "1", TCL_GLOBAL_ONLY);
|
||||
#else
|
||||
Tcl_SetVar2(interp, "sqlite_options", "curdir", "0", TCL_GLOBAL_ONLY);
|
||||
@@ -94,12 +94,6 @@ static void set_options(Tcl_Interp *interp){
|
||||
Tcl_SetVar2(interp, "sqlite_options", "win32malloc", "0", TCL_GLOBAL_ONLY);
|
||||
#endif
|
||||
|
||||
#if defined(SQLITE_OS_WINRT) && SQLITE_OS_WINRT
|
||||
Tcl_SetVar2(interp, "sqlite_options", "winrt", "1", TCL_GLOBAL_ONLY);
|
||||
#else
|
||||
Tcl_SetVar2(interp, "sqlite_options", "winrt", "0", TCL_GLOBAL_ONLY);
|
||||
#endif
|
||||
|
||||
#ifdef SQLITE_DEBUG
|
||||
Tcl_SetVar2(interp, "sqlite_options", "debug", "1", TCL_GLOBAL_ONLY);
|
||||
#else
|
||||
|
||||
@@ -387,11 +387,7 @@ static char *quota_utf8_to_mbcs(const char *zUtf8){
|
||||
zTmpWide = (LPWSTR)sqlite3_malloc( (nWide+1)*sizeof(zTmpWide[0]) );
|
||||
if( zTmpWide==0 ) return 0;
|
||||
MultiByteToWideChar(CP_UTF8, 0, zUtf8, -1, zTmpWide, nWide);
|
||||
#ifdef SQLITE_OS_WINRT
|
||||
codepage = CP_ACP;
|
||||
#else
|
||||
codepage = AreFileApisANSI() ? CP_ACP : CP_OEMCP;
|
||||
#endif
|
||||
nMbcs = WideCharToMultiByte(codepage, 0, zTmpWide, nWide, 0, 0, 0, 0);
|
||||
zMbcs = nMbcs ? (char*)sqlite3_malloc( nMbcs+1 ) : 0;
|
||||
if( zMbcs ){
|
||||
|
||||
+56
-74
@@ -26,7 +26,7 @@ void sqlite3DeleteTriggerStep(sqlite3 *db, TriggerStep *pTriggerStep){
|
||||
sqlite3SelectDelete(db, pTmp->pSelect);
|
||||
sqlite3IdListDelete(db, pTmp->pIdList);
|
||||
sqlite3UpsertDelete(db, pTmp->pUpsert);
|
||||
sqlite3SrcListDelete(db, pTmp->pFrom);
|
||||
sqlite3SrcListDelete(db, pTmp->pSrc);
|
||||
sqlite3DbFree(db, pTmp->zSpan);
|
||||
|
||||
sqlite3DbFree(db, pTmp);
|
||||
@@ -365,12 +365,12 @@ void sqlite3FinishTrigger(
|
||||
if( sqlite3ReadOnlyShadowTables(db) ){
|
||||
TriggerStep *pStep;
|
||||
for(pStep=pTrig->step_list; pStep; pStep=pStep->pNext){
|
||||
if( pStep->zTarget!=0
|
||||
&& sqlite3ShadowTableName(db, pStep->zTarget)
|
||||
if( pStep->pSrc!=0
|
||||
&& sqlite3ShadowTableName(db, pStep->pSrc->a[0].zName)
|
||||
){
|
||||
sqlite3ErrorMsg(pParse,
|
||||
"trigger \"%s\" may not write to shadow table \"%s\"",
|
||||
pTrig->zName, pStep->zTarget);
|
||||
pTrig->zName, pStep->pSrc->a[0].zName);
|
||||
goto triggerfinish_cleanup;
|
||||
}
|
||||
}
|
||||
@@ -461,26 +461,39 @@ TriggerStep *sqlite3TriggerSelectStep(
|
||||
static TriggerStep *triggerStepAllocate(
|
||||
Parse *pParse, /* Parser context */
|
||||
u8 op, /* Trigger opcode */
|
||||
Token *pName, /* The target name */
|
||||
SrcList *pTabList, /* Target table */
|
||||
const char *zStart, /* Start of SQL text */
|
||||
const char *zEnd /* End of SQL text */
|
||||
){
|
||||
Trigger *pNew = pParse->pNewTrigger;
|
||||
sqlite3 *db = pParse->db;
|
||||
TriggerStep *pTriggerStep;
|
||||
TriggerStep *pTriggerStep = 0;
|
||||
|
||||
if( pParse->nErr ) return 0;
|
||||
pTriggerStep = sqlite3DbMallocZero(db, sizeof(TriggerStep) + pName->n + 1);
|
||||
if( pTriggerStep ){
|
||||
char *z = (char*)&pTriggerStep[1];
|
||||
memcpy(z, pName->z, pName->n);
|
||||
sqlite3Dequote(z);
|
||||
pTriggerStep->zTarget = z;
|
||||
pTriggerStep->op = op;
|
||||
pTriggerStep->zSpan = triggerSpanDup(db, zStart, zEnd);
|
||||
if( IN_RENAME_OBJECT ){
|
||||
sqlite3RenameTokenMap(pParse, pTriggerStep->zTarget, pName);
|
||||
if( pParse->nErr==0 ){
|
||||
if( pNew
|
||||
&& pNew->pSchema!=db->aDb[1].pSchema
|
||||
&& pTabList->a[0].u4.zDatabase
|
||||
){
|
||||
sqlite3ErrorMsg(pParse,
|
||||
"qualified table names are not allowed on INSERT, UPDATE, and DELETE "
|
||||
"statements within triggers");
|
||||
}else{
|
||||
pTriggerStep = sqlite3DbMallocZero(db, sizeof(TriggerStep));
|
||||
if( pTriggerStep ){
|
||||
pTriggerStep->pSrc = sqlite3SrcListDup(db, pTabList, EXPRDUP_REDUCE);
|
||||
pTriggerStep->op = op;
|
||||
pTriggerStep->zSpan = triggerSpanDup(db, zStart, zEnd);
|
||||
if( pTriggerStep->pSrc && IN_RENAME_OBJECT ){
|
||||
sqlite3RenameTokenRemap(pParse,
|
||||
pTriggerStep->pSrc->a[0].zName,
|
||||
pTabList->a[0].zName
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
sqlite3SrcListDelete(db, pTabList);
|
||||
return pTriggerStep;
|
||||
}
|
||||
|
||||
@@ -493,7 +506,7 @@ static TriggerStep *triggerStepAllocate(
|
||||
*/
|
||||
TriggerStep *sqlite3TriggerInsertStep(
|
||||
Parse *pParse, /* Parser */
|
||||
Token *pTableName, /* Name of the table into which we insert */
|
||||
SrcList *pTabList, /* Table to INSERT into */
|
||||
IdList *pColumn, /* List of columns in pTableName to insert into */
|
||||
Select *pSelect, /* A SELECT statement that supplies values */
|
||||
u8 orconf, /* The conflict algorithm (OE_Abort, OE_Replace, etc.) */
|
||||
@@ -506,7 +519,7 @@ TriggerStep *sqlite3TriggerInsertStep(
|
||||
|
||||
assert(pSelect != 0 || db->mallocFailed);
|
||||
|
||||
pTriggerStep = triggerStepAllocate(pParse, TK_INSERT, pTableName,zStart,zEnd);
|
||||
pTriggerStep = triggerStepAllocate(pParse, TK_INSERT, pTabList, zStart, zEnd);
|
||||
if( pTriggerStep ){
|
||||
if( IN_RENAME_OBJECT ){
|
||||
pTriggerStep->pSelect = pSelect;
|
||||
@@ -538,7 +551,7 @@ TriggerStep *sqlite3TriggerInsertStep(
|
||||
*/
|
||||
TriggerStep *sqlite3TriggerUpdateStep(
|
||||
Parse *pParse, /* Parser */
|
||||
Token *pTableName, /* Name of the table to be updated */
|
||||
SrcList *pTabList, /* Name of the table to be updated */
|
||||
SrcList *pFrom, /* FROM clause for an UPDATE-FROM, or NULL */
|
||||
ExprList *pEList, /* The SET clause: list of column and new values */
|
||||
Expr *pWhere, /* The WHERE clause */
|
||||
@@ -549,21 +562,36 @@ TriggerStep *sqlite3TriggerUpdateStep(
|
||||
sqlite3 *db = pParse->db;
|
||||
TriggerStep *pTriggerStep;
|
||||
|
||||
pTriggerStep = triggerStepAllocate(pParse, TK_UPDATE, pTableName,zStart,zEnd);
|
||||
pTriggerStep = triggerStepAllocate(pParse, TK_UPDATE, pTabList, zStart, zEnd);
|
||||
if( pTriggerStep ){
|
||||
SrcList *pFromDup = 0;
|
||||
if( IN_RENAME_OBJECT ){
|
||||
pTriggerStep->pExprList = pEList;
|
||||
pTriggerStep->pWhere = pWhere;
|
||||
pTriggerStep->pFrom = pFrom;
|
||||
pFromDup = pFrom;
|
||||
pEList = 0;
|
||||
pWhere = 0;
|
||||
pFrom = 0;
|
||||
}else{
|
||||
pTriggerStep->pExprList = sqlite3ExprListDup(db, pEList, EXPRDUP_REDUCE);
|
||||
pTriggerStep->pWhere = sqlite3ExprDup(db, pWhere, EXPRDUP_REDUCE);
|
||||
pTriggerStep->pFrom = sqlite3SrcListDup(db, pFrom, EXPRDUP_REDUCE);
|
||||
pFromDup = sqlite3SrcListDup(db, pFrom, EXPRDUP_REDUCE);
|
||||
}
|
||||
pTriggerStep->orconf = orconf;
|
||||
|
||||
if( pFromDup && !IN_RENAME_OBJECT){
|
||||
Select *pSub;
|
||||
Token as = {0, 0};
|
||||
pSub = sqlite3SelectNew(pParse, 0, pFromDup, 0,0,0,0, SF_NestedFrom, 0);
|
||||
pFromDup = sqlite3SrcListAppendFromTerm(pParse, 0, 0, 0, &as, pSub ,0);
|
||||
}
|
||||
if( pFromDup && pTriggerStep->pSrc ){
|
||||
pTriggerStep->pSrc = sqlite3SrcListAppendList(
|
||||
pParse, pTriggerStep->pSrc, pFromDup
|
||||
);
|
||||
}else{
|
||||
sqlite3SrcListDelete(db, pFromDup);
|
||||
}
|
||||
}
|
||||
sqlite3ExprListDelete(db, pEList);
|
||||
sqlite3ExprDelete(db, pWhere);
|
||||
@@ -578,7 +606,7 @@ TriggerStep *sqlite3TriggerUpdateStep(
|
||||
*/
|
||||
TriggerStep *sqlite3TriggerDeleteStep(
|
||||
Parse *pParse, /* Parser */
|
||||
Token *pTableName, /* The table from which rows are deleted */
|
||||
SrcList *pTabList, /* The table from which rows are deleted */
|
||||
Expr *pWhere, /* The WHERE clause */
|
||||
const char *zStart, /* Start of SQL text */
|
||||
const char *zEnd /* End of SQL text */
|
||||
@@ -586,7 +614,7 @@ TriggerStep *sqlite3TriggerDeleteStep(
|
||||
sqlite3 *db = pParse->db;
|
||||
TriggerStep *pTriggerStep;
|
||||
|
||||
pTriggerStep = triggerStepAllocate(pParse, TK_DELETE, pTableName,zStart,zEnd);
|
||||
pTriggerStep = triggerStepAllocate(pParse, TK_DELETE, pTabList, zStart, zEnd);
|
||||
if( pTriggerStep ){
|
||||
if( IN_RENAME_OBJECT ){
|
||||
pTriggerStep->pWhere = pWhere;
|
||||
@@ -848,52 +876,6 @@ Trigger *sqlite3TriggersExist(
|
||||
return triggersReallyExist(pParse,pTab,op,pChanges,pMask);
|
||||
}
|
||||
|
||||
/*
|
||||
** Convert the pStep->zTarget string into a SrcList and return a pointer
|
||||
** to that SrcList.
|
||||
**
|
||||
** This routine adds a specific database name, if needed, to the target when
|
||||
** forming the SrcList. This prevents a trigger in one database from
|
||||
** referring to a target in another database. An exception is when the
|
||||
** trigger is in TEMP in which case it can refer to any other database it
|
||||
** wants.
|
||||
*/
|
||||
SrcList *sqlite3TriggerStepSrc(
|
||||
Parse *pParse, /* The parsing context */
|
||||
TriggerStep *pStep /* The trigger containing the target token */
|
||||
){
|
||||
sqlite3 *db = pParse->db;
|
||||
SrcList *pSrc; /* SrcList to be returned */
|
||||
char *zName = sqlite3DbStrDup(db, pStep->zTarget);
|
||||
pSrc = sqlite3SrcListAppend(pParse, 0, 0, 0);
|
||||
assert( pSrc==0 || pSrc->nSrc==1 );
|
||||
assert( zName || pSrc==0 );
|
||||
if( pSrc ){
|
||||
Schema *pSchema = pStep->pTrig->pSchema;
|
||||
pSrc->a[0].zName = zName;
|
||||
if( pSchema!=db->aDb[1].pSchema ){
|
||||
assert( pSrc->a[0].fg.fixedSchema || pSrc->a[0].u4.zDatabase==0 );
|
||||
pSrc->a[0].u4.pSchema = pSchema;
|
||||
pSrc->a[0].fg.fixedSchema = 1;
|
||||
}
|
||||
if( pStep->pFrom ){
|
||||
SrcList *pDup = sqlite3SrcListDup(db, pStep->pFrom, 0);
|
||||
if( pDup && pDup->nSrc>1 && !IN_RENAME_OBJECT ){
|
||||
Select *pSubquery;
|
||||
Token as;
|
||||
pSubquery = sqlite3SelectNew(pParse,0,pDup,0,0,0,0,SF_NestedFrom,0);
|
||||
as.n = 0;
|
||||
as.z = 0;
|
||||
pDup = sqlite3SrcListAppendFromTerm(pParse,0,0,0,&as,pSubquery,0);
|
||||
}
|
||||
pSrc = sqlite3SrcListAppendList(pParse, pSrc, pDup);
|
||||
}
|
||||
}else{
|
||||
sqlite3DbFree(db, zName);
|
||||
}
|
||||
return pSrc;
|
||||
}
|
||||
|
||||
/*
|
||||
** Return true if the pExpr term from the RETURNING clause argument
|
||||
** list is of the form "*". Raise an error if the terms if of the
|
||||
@@ -1159,7 +1141,7 @@ static int codeTriggerProgram(
|
||||
switch( pStep->op ){
|
||||
case TK_UPDATE: {
|
||||
sqlite3Update(pParse,
|
||||
sqlite3TriggerStepSrc(pParse, pStep),
|
||||
sqlite3SrcListDup(db, pStep->pSrc, 0),
|
||||
sqlite3ExprListDup(db, pStep->pExprList, 0),
|
||||
sqlite3ExprDup(db, pStep->pWhere, 0),
|
||||
pParse->eOrconf, 0, 0, 0
|
||||
@@ -1169,7 +1151,7 @@ static int codeTriggerProgram(
|
||||
}
|
||||
case TK_INSERT: {
|
||||
sqlite3Insert(pParse,
|
||||
sqlite3TriggerStepSrc(pParse, pStep),
|
||||
sqlite3SrcListDup(db, pStep->pSrc, 0),
|
||||
sqlite3SelectDup(db, pStep->pSelect, 0),
|
||||
sqlite3IdListDup(db, pStep->pIdList),
|
||||
pParse->eOrconf,
|
||||
@@ -1180,7 +1162,7 @@ static int codeTriggerProgram(
|
||||
}
|
||||
case TK_DELETE: {
|
||||
sqlite3DeleteFrom(pParse,
|
||||
sqlite3TriggerStepSrc(pParse, pStep),
|
||||
sqlite3SrcListDup(db, pStep->pSrc, 0),
|
||||
sqlite3ExprDup(db, pStep->pWhere, 0), 0, 0
|
||||
);
|
||||
sqlite3VdbeAddOp0(v, OP_ResetCount);
|
||||
|
||||
+30
-23
@@ -7380,6 +7380,9 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){
|
||||
sqlite3 *db = pParse->db;
|
||||
int iEnd = sqlite3VdbeCurrentAddr(v);
|
||||
int nRJ = 0;
|
||||
#ifndef SQLITE_DISABLE_SKIPAHEAD_DISTINCT
|
||||
int addrSeek = 0;
|
||||
#endif
|
||||
|
||||
/* Generate loop termination code.
|
||||
*/
|
||||
@@ -7392,7 +7395,10 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){
|
||||
** the RIGHT JOIN table */
|
||||
WhereRightJoin *pRJ = pLevel->pRJ;
|
||||
sqlite3VdbeResolveLabel(v, pLevel->addrCont);
|
||||
pLevel->addrCont = 0;
|
||||
/* Replace addrCont with a new label that will never be used, just so
|
||||
** the subsequent call to resolve pLevel->addrCont will have something
|
||||
** to resolve. */
|
||||
pLevel->addrCont = sqlite3VdbeMakeLabel(pParse);
|
||||
pRJ->endSubrtn = sqlite3VdbeCurrentAddr(v);
|
||||
sqlite3VdbeAddOp3(v, OP_Return, pRJ->regReturn, pRJ->addrSubrtn, 1);
|
||||
VdbeCoverage(v);
|
||||
@@ -7401,7 +7407,6 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){
|
||||
pLoop = pLevel->pWLoop;
|
||||
if( pLevel->op!=OP_Noop ){
|
||||
#ifndef SQLITE_DISABLE_SKIPAHEAD_DISTINCT
|
||||
int addrSeek = 0;
|
||||
Index *pIdx;
|
||||
int n;
|
||||
if( pWInfo->eDistinct==WHERE_DISTINCT_ORDERED
|
||||
@@ -7424,25 +7429,26 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){
|
||||
sqlite3VdbeAddOp2(v, OP_Goto, 1, pLevel->p2);
|
||||
}
|
||||
#endif /* SQLITE_DISABLE_SKIPAHEAD_DISTINCT */
|
||||
if( pTabList->a[pLevel->iFrom].fg.fromExists && i==pWInfo->nLevel-1 ){
|
||||
/* If the EXISTS-to-JOIN optimization was applied, then the EXISTS
|
||||
** loop(s) will be the inner-most loops of the join. There might be
|
||||
** multiple EXISTS loops, but they will all be nested, and the join
|
||||
** order will not have been changed by the query planner. If the
|
||||
** inner-most EXISTS loop sees a single successful row, it should
|
||||
** break out of *all* EXISTS loops. But only the inner-most of the
|
||||
** nested EXISTS loops should do this breakout. */
|
||||
int nOuter = 0; /* Nr of outer EXISTS that this one is nested within */
|
||||
while( nOuter<i ){
|
||||
if( !pTabList->a[pLevel[-nOuter-1].iFrom].fg.fromExists ) break;
|
||||
nOuter++;
|
||||
}
|
||||
testcase( nOuter>0 );
|
||||
sqlite3VdbeAddOp2(v, OP_Goto, 0, pLevel[-nOuter].addrBrk);
|
||||
VdbeComment((v, "EXISTS break"));
|
||||
}
|
||||
if( pTabList->a[pLevel->iFrom].fg.fromExists && i==pWInfo->nLevel-1 ){
|
||||
/* If the EXISTS-to-JOIN optimization was applied, then the EXISTS
|
||||
** loop(s) will be the inner-most loops of the join. There might be
|
||||
** multiple EXISTS loops, but they will all be nested, and the join
|
||||
** order will not have been changed by the query planner. If the
|
||||
** inner-most EXISTS loop sees a single successful row, it should
|
||||
** break out of *all* EXISTS loops. But only the inner-most of the
|
||||
** nested EXISTS loops should do this breakout. */
|
||||
int nOuter = 0; /* Nr of outer EXISTS that this one is nested within */
|
||||
while( nOuter<i ){
|
||||
if( !pTabList->a[pLevel[-nOuter-1].iFrom].fg.fromExists ) break;
|
||||
nOuter++;
|
||||
}
|
||||
/* The common case: Advance to the next row */
|
||||
if( pLevel->addrCont ) sqlite3VdbeResolveLabel(v, pLevel->addrCont);
|
||||
testcase( nOuter>0 );
|
||||
sqlite3VdbeAddOp2(v, OP_Goto, 0, pLevel[-nOuter].addrBrk);
|
||||
VdbeComment((v, "EXISTS break"));
|
||||
}
|
||||
sqlite3VdbeResolveLabel(v, pLevel->addrCont);
|
||||
if( pLevel->op!=OP_Noop ){
|
||||
sqlite3VdbeAddOp3(v, pLevel->op, pLevel->p1, pLevel->p2, pLevel->p3);
|
||||
sqlite3VdbeChangeP5(v, pLevel->p5);
|
||||
VdbeCoverage(v);
|
||||
@@ -7455,10 +7461,11 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){
|
||||
VdbeCoverage(v);
|
||||
}
|
||||
#ifndef SQLITE_DISABLE_SKIPAHEAD_DISTINCT
|
||||
if( addrSeek ) sqlite3VdbeJumpHere(v, addrSeek);
|
||||
if( addrSeek ){
|
||||
sqlite3VdbeJumpHere(v, addrSeek);
|
||||
addrSeek = 0;
|
||||
}
|
||||
#endif
|
||||
}else if( pLevel->addrCont ){
|
||||
sqlite3VdbeResolveLabel(v, pLevel->addrCont);
|
||||
}
|
||||
if( (pLoop->wsFlags & WHERE_IN_ABLE)!=0 && pLevel->u.in.nIn>0 ){
|
||||
struct InLoop *pIn;
|
||||
|
||||
@@ -23,6 +23,9 @@ ifcapable !altertable {
|
||||
|
||||
do_execsql_test 1.0 {
|
||||
CREATE TABLE t1(a);
|
||||
CREATE TEMP TRIGGER tr1 AFTER INSERT ON t1 BEGIN
|
||||
SELECT 123;
|
||||
END;
|
||||
}
|
||||
faultsim_save_and_close
|
||||
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ do_execsql_test 1.0 {
|
||||
CREATE TABLE t4(a);
|
||||
|
||||
CREATE TRIGGER r1 INSERT ON t1 BEGIN
|
||||
UPDATE t1 SET d='xyz' FROM t2, t3;
|
||||
UPDATE t1 SET d='xyz' FROM t2, t3;
|
||||
END;
|
||||
}
|
||||
|
||||
|
||||
+9
-5
@@ -325,6 +325,8 @@ foreach {tn sql error ac data } {
|
||||
# EVIDENCE-OF: R-43190-62442 In other words, the schema-name. prefix on
|
||||
# the table name of the UPDATE is not allowed within triggers.
|
||||
#
|
||||
# Update: Unless the trigger is in the temp schema.
|
||||
#
|
||||
do_update_tests e_update-2.1 -error {
|
||||
qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers
|
||||
} {
|
||||
@@ -339,12 +341,14 @@ do_update_tests e_update-2.1 -error {
|
||||
UPDATE aux.t1 SET a=1, b=2;
|
||||
END;
|
||||
} {}
|
||||
}
|
||||
|
||||
3 {
|
||||
CREATE TRIGGER tr1 AFTER DELETE ON t4 BEGIN
|
||||
UPDATE main.t1 SET a=1, b=2;
|
||||
END;
|
||||
} {}
|
||||
# Qualified table name is allowed as t4 is a temp table.
|
||||
do_execsql_test e_update-2.1.3 {
|
||||
CREATE TRIGGER tr1 AFTER DELETE ON t4 BEGIN
|
||||
UPDATE main.t1 SET a=1, b=2;
|
||||
END;
|
||||
DROP TRIGGER tr1;
|
||||
}
|
||||
|
||||
# EVIDENCE-OF: R-06085-13761 Unless the table to which the trigger is
|
||||
|
||||
+5
-7
@@ -36,13 +36,11 @@ do_test filectrl-1.5 {
|
||||
sqlite3 db test_control_lockproxy.db
|
||||
file_control_lockproxy_test db [get_pwd]
|
||||
} {}
|
||||
ifcapable !winrt {
|
||||
do_test filectrl-1.6 {
|
||||
sqlite3 db test.db
|
||||
set fn [file_control_tempfilename db]
|
||||
set fn
|
||||
} {/etilqs_/}
|
||||
}
|
||||
do_test filectrl-1.6 {
|
||||
sqlite3 db test.db
|
||||
set fn [file_control_tempfilename db]
|
||||
set fn
|
||||
} {/etilqs_/}
|
||||
db close
|
||||
forcedelete .test_control_lockproxy.db-conch test.proxy
|
||||
forcedelete test.db test2.db
|
||||
|
||||
+45
-6
@@ -24,28 +24,67 @@ INSERT INTO t1 SELECT d,e,a,b,c FROM t1;
|
||||
.output memory
|
||||
SELECT * FROM t1;
|
||||
.output --verify END
|
||||
┌─────┬───────┬───────┬───────┬───────┐
|
||||
╭─────┬───────┬───────┬───────┬───────╮
|
||||
│ a │ b │ c │ d │ e │
|
||||
├─────┼───────┼───────┼───────┼───────┤
|
||||
╞═════╪═══════╪═══════╪═══════╪═══════╡
|
||||
│ 1 │ 2.5 │ three │ DD │ │
|
||||
│ 2.5 │ three │ DD │ │ 1 │
|
||||
│ DD │ │ 1 │ 2.5 │ three │
|
||||
│ │ 1 │ 2.5 │ three │ DD │
|
||||
└─────┴───────┴───────┴───────┴───────┘
|
||||
╰─────┴───────┴───────┴───────┴───────╯
|
||||
END
|
||||
|
||||
.output memory
|
||||
.mode --null xyz
|
||||
SELECT * FROM t1;
|
||||
.output --verify END
|
||||
┌─────┬───────┬───────┬───────┬───────┐
|
||||
╭─────┬───────┬───────┬───────┬───────╮
|
||||
│ a │ b │ c │ d │ e │
|
||||
├─────┼───────┼───────┼───────┼───────┤
|
||||
╞═════╪═══════╪═══════╪═══════╪═══════╡
|
||||
│ 1 │ 2.5 │ three │ DD │ xyz │
|
||||
│ 2.5 │ three │ DD │ xyz │ 1 │
|
||||
│ DD │ xyz │ 1 │ 2.5 │ three │
|
||||
│ xyz │ 1 │ 2.5 │ three │ DD │
|
||||
└─────┴───────┴───────┴───────┴───────┘
|
||||
╰─────┴───────┴───────┴───────┴───────╯
|
||||
END
|
||||
|
||||
# Default output mode is qbox --quote relaxed
|
||||
#
|
||||
.mode tty --wrap 10
|
||||
CREATE TABLE t2(a,b,c,d);
|
||||
INSERT INTO t2 VALUES(1,2.5,'three',x'4444');
|
||||
INSERT INTO t2 VALUES('The quick fox jumps over the lazy brown dog',2,3,4);
|
||||
INSERT INTO t2 VALUES('10','', -1.25,NULL);
|
||||
INSERT INTO t2 VALUES('a,b,c','"Double-Quoted"','-1.25','NULL');
|
||||
.output memory
|
||||
SELECT * FROM t2;
|
||||
.output --verify END
|
||||
╭────────────┬────────────┬─────────┬─────────╮
|
||||
│ a │ b │ c │ d │
|
||||
╞════════════╪════════════╪═════════╪═════════╡
|
||||
│ 1 │ 2.5 │ three │ x'4444' │
|
||||
├────────────┼────────────┼─────────┼─────────┤
|
||||
│ The quick │ 2 │ 3 │ 4 │
|
||||
│ fox jumps │ │ │ │
|
||||
│ over the │ │ │ │
|
||||
│ lazy brown │ │ │ │
|
||||
│ dog │ │ │ │
|
||||
├────────────┼────────────┼─────────┼─────────┤
|
||||
│ '10' │ │ -1.25 │ NULL │
|
||||
├────────────┼────────────┼─────────┼─────────┤
|
||||
│ a,b,c │ "Double- │ '-1.25' │ 'NULL' │
|
||||
│ │ Quoted" │ │ │
|
||||
╰────────────┴────────────┴─────────┴─────────╯
|
||||
END
|
||||
.output memory
|
||||
.mode
|
||||
.output --verify END
|
||||
current output mode: qbox --limits 5,300 --quote relaxed --screenwidth auto --textjsonb on
|
||||
END
|
||||
.output memory
|
||||
.mode -v
|
||||
.output --verify END
|
||||
current output mode: qbox --align "" --border on --blob-quote auto --colsep "" --escape auto --limits 5,300 --null "NULL" --quote relaxed --rowsep "" --screenwidth auto --tablename "" --textjsonb on --titles on --widths "" --wordwrap off --wrap 10
|
||||
END
|
||||
|
||||
.output memory --error-prefix "Error:"
|
||||
|
||||
+174
-99
@@ -24,63 +24,72 @@ do_execsql_test 1.0 {
|
||||
do_test 1.10 {
|
||||
set result "\n[db format {SELECT * FROM t1}]"
|
||||
} {
|
||||
┌──────┬─────┬───────┐
|
||||
╭──────┬─────┬───────╮
|
||||
│ a │ b │ c │
|
||||
├──────┼─────┼───────┤
|
||||
│ 1 │ 2.5 │ three │
|
||||
╞══════╪═════╪═══════╡
|
||||
│ 1 │ 2.5 │ three │
|
||||
│ BLOB │ │ Ἀμήν │
|
||||
└──────┴─────┴───────┘
|
||||
╰──────┴─────┴───────╯
|
||||
}
|
||||
do_test 1.11a {
|
||||
set result "\n[db format -title off {SELECT * FROM t1}]"
|
||||
} {
|
||||
┌──────┬─────┬───────┐
|
||||
│ 1 │ 2.5 │ three │
|
||||
╭──────┬─────┬───────╮
|
||||
│ 1 │ 2.5 │ three │
|
||||
│ BLOB │ │ Ἀμήν │
|
||||
└──────┴─────┴───────┘
|
||||
╰──────┴─────┴───────╯
|
||||
}
|
||||
do_test 1.11b {
|
||||
set result "\n[db format -text sql {SELECT * FROM t1}]"
|
||||
} {
|
||||
┌─────────────┬─────┬─────────┐
|
||||
╭─────────────┬─────┬─────────╮
|
||||
│ a │ b │ c │
|
||||
├─────────────┼─────┼─────────┤
|
||||
│ 1 │ 2.5 │ 'three' │
|
||||
╞═════════════╪═════╪═════════╡
|
||||
│ 1 │ 2.5 │ 'three' │
|
||||
│ x'424c4f42' │ │ 'Ἀμήν' │
|
||||
└─────────────┴─────┴─────────┘
|
||||
╰─────────────┴─────┴─────────╯
|
||||
}
|
||||
do_test 1.11c {
|
||||
set result "\n[db format -text sql -border off {SELECT * FROM t1}]"
|
||||
} {
|
||||
a │ b │ c
|
||||
─────────────┼─────┼─────────
|
||||
═════════════╪═════╪═════════
|
||||
1 │ 2.5 │ 'three'
|
||||
x'424c4f42' │ │ 'Ἀμήν'
|
||||
}
|
||||
do_test 1.11d {
|
||||
set result "\n[db format -text relaxed -blob sql -border off \
|
||||
{SELECT * FROM t1}]"
|
||||
} {
|
||||
a │ b │ c
|
||||
═════════════╪═════╪═══════
|
||||
1 │ 2.5 │ three
|
||||
x'424c4f42' │ │ Ἀμήν
|
||||
}
|
||||
do_test 1.12 {
|
||||
set result "\n[db format -text csv {SELECT * FROM t1}]"
|
||||
} {
|
||||
┌────────────────────┬─────┬────────┐
|
||||
╭────────────────────┬─────┬────────╮
|
||||
│ a │ b │ c │
|
||||
├────────────────────┼─────┼────────┤
|
||||
│ 1 │ 2.5 │ three │
|
||||
╞════════════════════╪═════╪════════╡
|
||||
│ 1 │ 2.5 │ three │
|
||||
│ "\102\114\117\102" │ │ "Ἀμήν" │
|
||||
└────────────────────┴─────┴────────┘
|
||||
╰────────────────────┴─────┴────────╯
|
||||
}
|
||||
do_test 1.13 {
|
||||
set result "\n[db format -text csv -blob hex {SELECT * FROM t1}]"
|
||||
} {
|
||||
┌──────────┬─────┬────────┐
|
||||
╭──────────┬─────┬────────╮
|
||||
│ a │ b │ c │
|
||||
├──────────┼─────┼────────┤
|
||||
│ 1 │ 2.5 │ three │
|
||||
╞══════════╪═════╪════════╡
|
||||
│ 1 │ 2.5 │ three │
|
||||
│ 424c4f42 │ │ "Ἀμήν" │
|
||||
└──────────┴─────┴────────┘
|
||||
╰──────────┴─────┴────────╯
|
||||
}
|
||||
do_test 1.14 {
|
||||
catch {db format -text unk -blob hex {SELECT * FROM t1}} res
|
||||
set res
|
||||
} {bad -text "unk": must be auto, csv, html, json, plain, sql, or tcl}
|
||||
} {bad -text "unk": must be auto, csv, html, json, plain, relaxed, sql, or tcl}
|
||||
do_test 1.15 {
|
||||
catch {db format -text sql -blob unk {SELECT * FROM t1}} res
|
||||
set res
|
||||
@@ -94,12 +103,12 @@ do_test 1.16 {
|
||||
do_test 1.20 {
|
||||
set result "\n[db format -style box {SELECT * FROM t1}]"
|
||||
} {
|
||||
┌──────┬─────┬───────┐
|
||||
╭──────┬─────┬───────╮
|
||||
│ a │ b │ c │
|
||||
├──────┼─────┼───────┤
|
||||
│ 1 │ 2.5 │ three │
|
||||
╞══════╪═════╪═══════╡
|
||||
│ 1 │ 2.5 │ three │
|
||||
│ BLOB │ │ Ἀμήν │
|
||||
└──────┴─────┴───────┘
|
||||
╰──────┴─────┴───────╯
|
||||
}
|
||||
|
||||
do_test 1.30 {
|
||||
@@ -144,7 +153,7 @@ do_test 1.34 {
|
||||
{SELECT * FROM t1}]"
|
||||
} {
|
||||
a │ b │ c
|
||||
──────┼─────┼───────
|
||||
══════╪═════╪═══════
|
||||
1 │ 2.5 │ three
|
||||
BLOB │ │ Ἀμήν
|
||||
}
|
||||
@@ -154,7 +163,7 @@ do_test 1.35 {
|
||||
{SELECT * FROM t1}]"
|
||||
} {
|
||||
a │ b │ c
|
||||
────┼───┼─────
|
||||
════╪═══╪═════
|
||||
1│2.5│three
|
||||
BLOB│ │Ἀμήν
|
||||
}
|
||||
@@ -336,7 +345,7 @@ x'424c4f42'|NULL|'Ἀμήν'
|
||||
do_test 1.118 {
|
||||
set rc [catch {db format -style list -title unk {SELECT * FROM t1}} res]
|
||||
lappend rc $res
|
||||
} {1 {bad -title "unk": must be off, on, auto, csv, html, json, plain, sql, or tcl}}
|
||||
} {1 {bad -title "unk": must be off, on, auto, csv, html, json, plain, relaxed, sql, or tcl}}
|
||||
|
||||
|
||||
do_test 1.120 {
|
||||
@@ -377,86 +386,86 @@ do_test 2.1 {
|
||||
set result "\n[db format -widths {5 -5 19} -wordwrap on \
|
||||
{SELECT * FROM t1}]"
|
||||
} {
|
||||
┌───────┬───────┬─────────────────────┐
|
||||
╭───────┬───────┬─────────────────────╮
|
||||
│ a │ b │ c │
|
||||
├───────┼───────┼─────────────────────┤
|
||||
│ 1 │ 2 │ The quick fox jumps │
|
||||
╞═══════╪═══════╪═════════════════════╡
|
||||
│ 1 │ 2 │ The quick fox jumps │
|
||||
│ │ │ over the lazy brown │
|
||||
│ │ │ dog. │
|
||||
└───────┴───────┴─────────────────────┘
|
||||
╰───────┴───────┴─────────────────────╯
|
||||
}
|
||||
do_test 2.2 {
|
||||
set result "\n[db format -widths {5 -5 19} -wordwrap off \
|
||||
{SELECT * FROM t1}]"
|
||||
} {
|
||||
┌───────┬───────┬─────────────────────┐
|
||||
╭───────┬───────┬─────────────────────╮
|
||||
│ a │ b │ c │
|
||||
├───────┼───────┼─────────────────────┤
|
||||
│ 1 │ 2 │ The quick fox jumps │
|
||||
╞═══════╪═══════╪═════════════════════╡
|
||||
│ 1 │ 2 │ The quick fox jumps │
|
||||
│ │ │ over the lazy brown │
|
||||
│ │ │ dog. │
|
||||
└───────┴───────┴─────────────────────┘
|
||||
╰───────┴───────┴─────────────────────╯
|
||||
}
|
||||
do_test 2.3 {
|
||||
set result "\n[db format -widths {5 -5 18} -wordwrap on \
|
||||
{SELECT * FROM t1}]"
|
||||
} {
|
||||
┌───────┬───────┬────────────────────┐
|
||||
╭───────┬───────┬────────────────────╮
|
||||
│ a │ b │ c │
|
||||
├───────┼───────┼────────────────────┤
|
||||
│ 1 │ 2 │ The quick fox │
|
||||
╞═══════╪═══════╪════════════════════╡
|
||||
│ 1 │ 2 │ The quick fox │
|
||||
│ │ │ jumps over the │
|
||||
│ │ │ lazy brown dog. │
|
||||
└───────┴───────┴────────────────────┘
|
||||
╰───────┴───────┴────────────────────╯
|
||||
}
|
||||
do_test 2.4 {
|
||||
set result "\n[db format -widths {5 -5 -18} -wordwrap on \
|
||||
{SELECT * FROM t1}]"
|
||||
} {
|
||||
┌───────┬───────┬────────────────────┐
|
||||
╭───────┬───────┬────────────────────╮
|
||||
│ a │ b │ c │
|
||||
├───────┼───────┼────────────────────┤
|
||||
│ 1 │ 2 │ The quick fox │
|
||||
╞═══════╪═══════╪════════════════════╡
|
||||
│ 1 │ 2 │ The quick fox │
|
||||
│ │ │ jumps over the │
|
||||
│ │ │ lazy brown dog. │
|
||||
└───────┴───────┴────────────────────┘
|
||||
╰───────┴───────┴────────────────────╯
|
||||
}
|
||||
do_test 2.5 {
|
||||
set result "\n[db format -widths {5 -5 19} -wordwrap off \
|
||||
{SELECT * FROM t1}]"
|
||||
} {
|
||||
┌───────┬───────┬─────────────────────┐
|
||||
╭───────┬───────┬─────────────────────╮
|
||||
│ a │ b │ c │
|
||||
├───────┼───────┼─────────────────────┤
|
||||
│ 1 │ 2 │ The quick fox jumps │
|
||||
╞═══════╪═══════╪═════════════════════╡
|
||||
│ 1 │ 2 │ The quick fox jumps │
|
||||
│ │ │ over the lazy brown │
|
||||
│ │ │ dog. │
|
||||
└───────┴───────┴─────────────────────┘
|
||||
╰───────┴───────┴─────────────────────╯
|
||||
}
|
||||
do_test 2.6 {
|
||||
set result "\n[db format -widths {5 -5 18} -wordwrap off \
|
||||
{SELECT * FROM t1}]"
|
||||
} {
|
||||
┌───────┬───────┬────────────────────┐
|
||||
╭───────┬───────┬────────────────────╮
|
||||
│ a │ b │ c │
|
||||
├───────┼───────┼────────────────────┤
|
||||
│ 1 │ 2 │ The quick fox jump │
|
||||
╞═══════╪═══════╪════════════════════╡
|
||||
│ 1 │ 2 │ The quick fox jump │
|
||||
│ │ │ s over the lazy br │
|
||||
│ │ │ own dog. │
|
||||
└───────┴───────┴────────────────────┘
|
||||
╰───────┴───────┴────────────────────╯
|
||||
}
|
||||
do_test 2.7 {
|
||||
set result "\n[db format -widths {5 5 18} -wordwrap yes \
|
||||
-align {left center right} -titlealign right \
|
||||
{SELECT * FROM t1}]"
|
||||
} {
|
||||
┌───────┬───────┬────────────────────┐
|
||||
╭───────┬───────┬────────────────────╮
|
||||
│ a │ b │ c │
|
||||
├───────┼───────┼────────────────────┤
|
||||
╞═══════╪═══════╪════════════════════╡
|
||||
│ 1 │ 2 │ The quick fox │
|
||||
│ │ │ jumps over the │
|
||||
│ │ │ lazy brown dog. │
|
||||
└───────┴───────┴────────────────────┘
|
||||
╰───────┴───────┴────────────────────╯
|
||||
}
|
||||
do_test 2.8 {
|
||||
set result "\n[db format -widths {5 8 11} -wordwrap yes \
|
||||
@@ -464,15 +473,15 @@ do_test 2.8 {
|
||||
-defaultalign right \
|
||||
{SELECT * FROM t1}]"
|
||||
} {
|
||||
┌───────┬──────────┬─────────────┐
|
||||
╭───────┬──────────┬─────────────╮
|
||||
│ a │ b │ c │
|
||||
├───────┼──────────┼─────────────┤
|
||||
╞═══════╪══════════╪═════════════╡
|
||||
│ 1 │ 2 │ The quick │
|
||||
│ │ │ fox jumps │
|
||||
│ │ │ over the │
|
||||
│ │ │ lazy brown │
|
||||
│ │ │ dog. │
|
||||
└───────┴──────────┴─────────────┘
|
||||
╰───────┴──────────┴─────────────╯
|
||||
}
|
||||
do_test 2.9 {
|
||||
catch {db format -align {auto xyz 123} {SELECT * FROM t1}} res
|
||||
@@ -496,27 +505,27 @@ do_test 2.31 {
|
||||
set result "\n[db format -widths {5 -5 18} -wordwrap on \
|
||||
{SELECT * FROM t1}]"
|
||||
} {
|
||||
┌───────┬───────┬────────────────────┐
|
||||
╭───────┬───────┬────────────────────╮
|
||||
│ a │ b │ c │
|
||||
├───────┼───────┼────────────────────┤
|
||||
│ 1 │ 2 │ Η γρήγορη αλεπού │
|
||||
╞═══════╪═══════╪════════════════════╡
|
||||
│ 1 │ 2 │ Η γρήγορη αλεπού │
|
||||
│ │ │ πηδάει πάνω από το │
|
||||
│ │ │ τεμπέλικο καφέ │
|
||||
│ │ │ σκυλί │
|
||||
└───────┴───────┴────────────────────┘
|
||||
╰───────┴───────┴────────────────────╯
|
||||
}
|
||||
do_test 2.32 {
|
||||
set result "\n[db format -widths {5 5 18} -align {left center center} -wordwrap on \
|
||||
{SELECT * FROM t1}]"
|
||||
} {
|
||||
┌───────┬───────┬────────────────────┐
|
||||
╭───────┬───────┬────────────────────╮
|
||||
│ a │ b │ c │
|
||||
├───────┼───────┼────────────────────┤
|
||||
│ 1 │ 2 │ Η γρήγορη αλεπού │
|
||||
╞═══════╪═══════╪════════════════════╡
|
||||
│ 1 │ 2 │ Η γρήγορη αλεπού │
|
||||
│ │ │ πηδάει πάνω από το │
|
||||
│ │ │ τεμπέλικο καφέ │
|
||||
│ │ │ σκυλί │
|
||||
└───────┴───────┴────────────────────┘
|
||||
│ │ │ τεμπέλικο καφέ │
|
||||
│ │ │ σκυλί │
|
||||
╰───────┴───────┴────────────────────╯
|
||||
}
|
||||
|
||||
|
||||
@@ -527,39 +536,39 @@ do_execsql_test 3.0 {
|
||||
do_test 3.1 {
|
||||
set result "\n[db format {SELECT * FROM t1}]"
|
||||
} {
|
||||
┌───┬───┬────────────────────────┐
|
||||
╭───┬───┬────────────────────────╮
|
||||
│ a │ b │ c │
|
||||
├───┼───┼────────────────────────┤
|
||||
╞═══╪═══╪════════════════════════╡
|
||||
│ 1 │ 2 │ abc^[[1;31m123^[[0mxyz │
|
||||
└───┴───┴────────────────────────┘
|
||||
╰───┴───┴────────────────────────╯
|
||||
}
|
||||
do_test 3.2 {
|
||||
set result "\n[db format -esc off {SELECT * FROM t1}]"
|
||||
string map [list \033 X] $result
|
||||
} {
|
||||
┌───┬───┬───────────┐
|
||||
╭───┬───┬───────────╮
|
||||
│ a │ b │ c │
|
||||
├───┼───┼───────────┤
|
||||
╞═══╪═══╪═══════════╡
|
||||
│ 1 │ 2 │ abcX[1;31m123X[0mxyz │
|
||||
└───┴───┴───────────┘
|
||||
╰───┴───┴───────────╯
|
||||
}
|
||||
do_test 3.3 {
|
||||
set result "\n[db format -esc symbol {SELECT * FROM t1}]"
|
||||
} {
|
||||
┌───┬───┬──────────────────────┐
|
||||
╭───┬───┬──────────────────────╮
|
||||
│ a │ b │ c │
|
||||
├───┼───┼──────────────────────┤
|
||||
╞═══╪═══╪══════════════════════╡
|
||||
│ 1 │ 2 │ abc␛[1;31m123␛[0mxyz │
|
||||
└───┴───┴──────────────────────┘
|
||||
╰───┴───┴──────────────────────╯
|
||||
}
|
||||
do_test 3.4 {
|
||||
set result "\n[db format -esc ascii {SELECT * FROM t1}]"
|
||||
} {
|
||||
┌───┬───┬────────────────────────┐
|
||||
╭───┬───┬────────────────────────╮
|
||||
│ a │ b │ c │
|
||||
├───┼───┼────────────────────────┤
|
||||
╞═══╪═══╪════════════════════════╡
|
||||
│ 1 │ 2 │ abc^[[1;31m123^[[0mxyz │
|
||||
└───┴───┴────────────────────────┘
|
||||
╰───┴───┴────────────────────────╯
|
||||
}
|
||||
do_test 3.5 {
|
||||
catch {db format -esc unk {SELECT * FROM t1}} res
|
||||
@@ -573,31 +582,31 @@ do_execsql_test 4.0 {
|
||||
do_test 4.1 {
|
||||
set result "\n[db format -text sql {SELECT * FROM t1}]"
|
||||
} {
|
||||
┌─────────────────┬───────────────────────┬────┐
|
||||
╭─────────────────┬───────────────────────┬────╮
|
||||
│ a │ b │ c │
|
||||
├─────────────────┼───────────────────────┼────┤
|
||||
╞═════════════════╪═══════════════════════╪════╡
|
||||
│ '{"a":5,"b":6}' │ x'8c1763133117641332' │ 99 │
|
||||
└─────────────────┴───────────────────────┴────┘
|
||||
╰─────────────────┴───────────────────────┴────╯
|
||||
}
|
||||
do_test 4.2 {
|
||||
set result "\n[db format -text sql -textjsonb on {SELECT * FROM t1}]"
|
||||
} {
|
||||
┌─────────────────┬────────────────────────┬────┐
|
||||
╭─────────────────┬────────────────────────┬────╮
|
||||
│ a │ b │ c │
|
||||
├─────────────────┼────────────────────────┼────┤
|
||||
╞═════════════════╪════════════════════════╪════╡
|
||||
│ '{"a":5,"b":6}' │ jsonb('{"c":1,"d":2}') │ 99 │
|
||||
└─────────────────┴────────────────────────┴────┘
|
||||
╰─────────────────┴────────────────────────┴────╯
|
||||
}
|
||||
do_test 4.3 {
|
||||
set result "\n[db format -text plain -textjsonb on -wrap 11 \
|
||||
{SELECT a AS json, b AS jsonb, c AS num FROM t1}]"
|
||||
} {
|
||||
┌─────────────┬─────────────┬─────┐
|
||||
╭─────────────┬─────────────┬─────╮
|
||||
│ json │ jsonb │ num │
|
||||
├─────────────┼─────────────┼─────┤
|
||||
│ {"a":5,"b": │ {"c":1,"d": │ 99 │
|
||||
╞═════════════╪═════════════╪═════╡
|
||||
│ {"a":5,"b": │ {"c":1,"d": │ 99 │
|
||||
│ 6} │ 2} │ │
|
||||
└─────────────┴─────────────┴─────┘
|
||||
╰─────────────┴─────────────┴─────╯
|
||||
}
|
||||
|
||||
do_execsql_test 5.0 {
|
||||
@@ -683,9 +692,9 @@ do_test 5.3a {
|
||||
-text plain -esc off -textjsonb no \
|
||||
-wordwrap yes -linelimit 2 $sql]"
|
||||
} {
|
||||
┌──────────────┬────────────┬────────────┬────────────────┐
|
||||
╭──────────────┬────────────┬────────────┬────────────────╮
|
||||
│ name │ mtime │ time │ value │
|
||||
├──────────────┼────────────┼────────────┼────────────────┤
|
||||
╞══════════════╪════════════╪════════════╪════════════════╡
|
||||
│ sample-jsonb │ 1333101221 │ 2012-03-30 │ x'cc7c57616c70 │
|
||||
│ │ │ 09:53:41 │ 6861b535332e31 │
|
||||
│ │ │ │ ... │
|
||||
@@ -697,7 +706,7 @@ do_test 5.3a {
|
||||
│ entry-one │ 1708791504 │ 2024-02-24 │ x'000000000000 │
|
||||
│ │ │ 16:18:24 │ 00000000000000 │
|
||||
│ │ │ │ ... │
|
||||
└──────────────┴────────────┴────────────┴────────────────┘
|
||||
╰──────────────┴────────────┴────────────┴────────────────╯
|
||||
}
|
||||
do_test 5.3b {
|
||||
set result "\n[db format -style table -widths {0 10 10 14}\
|
||||
@@ -754,14 +763,14 @@ do_test 5.4 {
|
||||
set result "\n[db format -style box -widths {1 2 3 4 5}\
|
||||
-linelimit 3 -wordwrap off {SELECT *, 'x' AS x FROM t2}]"
|
||||
} {
|
||||
┌────┬────┬─────┬──────┬───────┬───┐
|
||||
╭────┬────┬─────┬──────┬───────┬───╮
|
||||
│ a │ b │ c │ d │ e │ x │
|
||||
├────┼────┼─────┼──────┼───────┼───┤
|
||||
╞════╪════╪═════╪══════╪═══════╪═══╡
|
||||
│ ab │ ab │ abc │ abcd │ abcde │ x │
|
||||
│ cd │ cd │ def │ efgh │ fghij │ │
|
||||
│ ef │ ef │ ghi │ ijkl │ klmno │ │
|
||||
│ .. │ .. │ ... │ ... │ ... │ │
|
||||
└────┴────┴─────┴──────┴───────┴───┘
|
||||
╰────┴────┴─────┴──────┴───────┴───╯
|
||||
}
|
||||
|
||||
do_execsql_test 6.0 {
|
||||
@@ -1024,11 +1033,77 @@ do_test 12.1 {
|
||||
set result "\n[db format -style box -text html \
|
||||
{SELECT 'abc','','xyz'}]"
|
||||
} {
|
||||
┌───────┬────┬───────┐
|
||||
╭───────┬────┬───────╮
|
||||
│ 'abc' │ '' │ 'xyz' │
|
||||
├───────┼────┼───────┤
|
||||
╞═══════╪════╪═══════╡
|
||||
│ abc │ │ xyz │
|
||||
└───────┴────┴───────┘
|
||||
╰───────┴────┴───────╯
|
||||
}
|
||||
|
||||
# Tests for "relaxed" quoting
|
||||
#
|
||||
do_test 13.2 {
|
||||
db eval {
|
||||
CREATE TABLE t13(a,b);
|
||||
INSERT INTO t13(a,b) VALUES
|
||||
(1,'NULL'),
|
||||
(0,'-NULL-'),
|
||||
(0,''),
|
||||
(1,'''abcde'),
|
||||
(1,'abcde'''),
|
||||
(0,'abcde'),
|
||||
(1,' abcde'),
|
||||
(1,'abcde '),
|
||||
(1,'+0'),
|
||||
(1,'-0'),
|
||||
(1,'012345'),
|
||||
(0,'012xyz345'),
|
||||
(1,'0123.45'),
|
||||
(0,'12.34.56'),
|
||||
(0,'12.3e'),
|
||||
(1,'12.3e+123'),
|
||||
(1,'12.3e-34'),
|
||||
(1,'12.3E56'),
|
||||
(1,'12E56'),
|
||||
(0,'12.5E5.6'),
|
||||
(0,'12.5e+'),
|
||||
(0,'12.5e-'),
|
||||
(1,'+Inf'),(1,'-Inf'),(1,'Inf');
|
||||
}
|
||||
set result \n[db format -style box -text relaxed -null NULL \
|
||||
-align {center left} \
|
||||
{SELECT if(a,'yes','') AS 'quoted?', b AS string
|
||||
FROM t13 ORDER BY rowid}]
|
||||
} {
|
||||
╭─────────┬─────────────╮
|
||||
│ quoted? │ string │
|
||||
╞═════════╪═════════════╡
|
||||
│ yes │ 'NULL' │
|
||||
│ │ -NULL- │
|
||||
│ │ │
|
||||
│ yes │ '''abcde' │
|
||||
│ yes │ 'abcde''' │
|
||||
│ │ abcde │
|
||||
│ yes │ ' abcde' │
|
||||
│ yes │ 'abcde ' │
|
||||
│ yes │ '+0' │
|
||||
│ yes │ '-0' │
|
||||
│ yes │ '012345' │
|
||||
│ │ 012xyz345 │
|
||||
│ yes │ '0123.45' │
|
||||
│ │ 12.34.56 │
|
||||
│ │ 12.3e │
|
||||
│ yes │ '12.3e+123' │
|
||||
│ yes │ '12.3e-34' │
|
||||
│ yes │ '12.3E56' │
|
||||
│ yes │ '12E56' │
|
||||
│ │ 12.5E5.6 │
|
||||
│ │ 12.5e+ │
|
||||
│ │ 12.5e- │
|
||||
│ yes │ '+Inf' │
|
||||
│ yes │ '-Inf' │
|
||||
│ yes │ 'Inf' │
|
||||
╰─────────┴─────────────╯
|
||||
}
|
||||
|
||||
db close
|
||||
|
||||
+6
-6
@@ -60,30 +60,30 @@ do_test 1.10 {
|
||||
{SELECT * FROM mlink ORDER BY rowid}]"
|
||||
|
||||
} {
|
||||
┌───────┬───────┬───────┬───────┬──────┬───────┬───────┬───────┐
|
||||
╭───────┬───────┬───────┬───────┬──────┬───────┬───────┬───────╮
|
||||
│ mid │ fid │ pmid │ pid │ fnid │ pfnid │ mperm │ isaux │
|
||||
├───────┼───────┼───────┼───────┼──────┼───────┼───────┼───────┤
|
||||
╞═══════╪═══════╪═══════╪═══════╪══════╪═══════╪═══════╪═══════╡
|
||||
│ 28775 │ 28774 │ 28773 │ 28706 │ 1 │ 0 │ 0 │ 0 │
|
||||
│ 28773 │ 28706 │ 28770 │ 28685 │ 1 │ 0 │ 0 │ 0 │
|
||||
│ 28770 │ 28736 │ 28769 │ 28695 │ 2 │ 0 │ 0 │ 0 │
|
||||
│ 28770 │ 28697 │ 28769 │ 28698 │ 3 │ 0 │ 0 │ 0 │
|
||||
│ 28767 │ 28768 │ 28759 │ 28746 │ 4 │ 0 │ 0 │ 0 │
|
||||
└───────┴───────┴───────┴───────┴──────┴───────┴───────┴───────┘
|
||||
╰───────┴───────┴───────┴───────┴──────┴───────┴───────┴───────╯
|
||||
}
|
||||
do_test 1.11 {
|
||||
set x "\n[db format -style box -screenwidth 52 \
|
||||
{SELECT * FROM mlink ORDER BY rowid}]"
|
||||
|
||||
} {
|
||||
┌─────┬─────┬─────┬─────┬────┬─────┬─────┬─────┐
|
||||
╭─────┬─────┬─────┬─────┬────┬─────┬─────┬─────╮
|
||||
│ mid │ fid │pmid │ pid │fnid│pfnid│mperm│isaux│
|
||||
├─────┼─────┼─────┼─────┼────┼─────┼─────┼─────┤
|
||||
╞═════╪═════╪═════╪═════╪════╪═════╪═════╪═════╡
|
||||
│28775│28774│28773│28706│ 1│ 0│ 0│ 0│
|
||||
│28773│28706│28770│28685│ 1│ 0│ 0│ 0│
|
||||
│28770│28736│28769│28695│ 2│ 0│ 0│ 0│
|
||||
│28770│28697│28769│28698│ 3│ 0│ 0│ 0│
|
||||
│28767│28768│28759│28746│ 4│ 0│ 0│ 0│
|
||||
└─────┴─────┴─────┴─────┴────┴─────┴─────┴─────┘
|
||||
╰─────┴─────┴─────┴─────┴────┴─────┴─────┴─────╯
|
||||
}
|
||||
|
||||
do_test 1.20 {
|
||||
|
||||
+15
-15
@@ -372,14 +372,14 @@ do_test 1.2 {
|
||||
ORDER BY name
|
||||
}]
|
||||
set exp {
|
||||
┌──────┬─────┐
|
||||
╭──────┬─────╮
|
||||
│ name │ id │
|
||||
├──────┼─────┤
|
||||
╞══════╪═════╡
|
||||
│ 中文 │ 18 │
|
||||
│ 吴语 │ 173 │
|
||||
│ 文言 │ 172 │
|
||||
│ 粵語 │ 75 │
|
||||
└──────┴─────┘
|
||||
╰──────┴─────╯
|
||||
}
|
||||
if {$res ne $exp} {
|
||||
puts [list $res]
|
||||
@@ -395,16 +395,16 @@ do_test 1.3 {
|
||||
ORDER BY name
|
||||
}]
|
||||
set exp {
|
||||
┌────────┬─────┐
|
||||
╭────────┬─────╮
|
||||
│ name │ id │
|
||||
├────────┼─────┤
|
||||
╞════════╪═════╡
|
||||
│ Ido │ 108 │
|
||||
│ Twi │ 297 │
|
||||
│ ߒߞߏ │ 258 │
|
||||
│ ᏣᎳᎩ │ 335 │
|
||||
│ 日本語 │ 10 │
|
||||
│ 한국어 │ 37 │
|
||||
└────────┴─────┘
|
||||
╰────────┴─────╯
|
||||
}
|
||||
if {$res ne $exp} {
|
||||
puts [list $res]
|
||||
@@ -420,9 +420,9 @@ do_test 1.4 {
|
||||
ORDER BY name
|
||||
}]
|
||||
set exp {
|
||||
┌──────┬─────┐
|
||||
╭──────┬─────╮
|
||||
│ name │ id │
|
||||
├──────┼─────┤
|
||||
╞══════╪═════╡
|
||||
│ Igbo │ 109 │
|
||||
│ Jawa │ 115 │
|
||||
│ Nupe │ 323 │
|
||||
@@ -440,7 +440,7 @@ do_test 1.4 {
|
||||
│ ತುಳು │ 311 │
|
||||
│ ትግርኛ │ 333 │
|
||||
│ አማርኛ │ 78 │
|
||||
└──────┴─────┘
|
||||
╰──────┴─────╯
|
||||
}
|
||||
if {$res ne $exp} {
|
||||
puts [list $res]
|
||||
@@ -456,9 +456,9 @@ do_test 1.5 {
|
||||
ORDER BY name
|
||||
}]
|
||||
set exp {
|
||||
┌───────┬─────┐
|
||||
╭───────┬─────╮
|
||||
│ name │ id │
|
||||
├───────┼─────┤
|
||||
╞═══════╪═════╡
|
||||
│ Aymar │ 193 │
|
||||
│ Corsu │ 202 │
|
||||
│ Dansk │ 31 │
|
||||
@@ -497,7 +497,7 @@ do_test 1.5 {
|
||||
│ ಕನ್ನಡ │ 116 │
|
||||
│ සිංහල │ 158 │
|
||||
│ ꠍꠤꠟꠐꠤ │ 284 │
|
||||
└───────┴─────┘
|
||||
╰───────┴─────╯
|
||||
}
|
||||
if {$res ne $exp} {
|
||||
puts [list $res]
|
||||
@@ -513,9 +513,9 @@ do_test 1.6 {
|
||||
ORDER BY name
|
||||
}]
|
||||
set exp {
|
||||
┌────────┬─────┐
|
||||
╭────────┬─────╮
|
||||
│ name │ id │
|
||||
├────────┼─────┤
|
||||
╞════════╪═════╡
|
||||
│ Betawi │ 195 │
|
||||
│ Català │ 28 │
|
||||
│ Eʋegbe │ 212 │
|
||||
@@ -564,7 +564,7 @@ do_test 1.6 {
|
||||
│ മലയാളം │ 130 │
|
||||
│ རྫོང་ཁ │ 316 │
|
||||
│ ရခိုင် │ 312 │
|
||||
└────────┴─────┘
|
||||
╰────────┴─────╯
|
||||
}
|
||||
if {$res ne $exp} {
|
||||
puts [list $res]
|
||||
|
||||
+21
-26
@@ -302,9 +302,7 @@ do_test shell1-3.2.4 {
|
||||
catchcmd "test.db" ".bail OFF BAD"
|
||||
} {1 {Usage: .bail on|off}}
|
||||
|
||||
# This test will not work on winrt, as winrt has no concept of the absolute
|
||||
# paths that the test expects in the result. It uses relative paths only.
|
||||
ifcapable vtab&&!winrt {
|
||||
ifcapable vtab {
|
||||
# .databases List names and files of attached databases
|
||||
do_test shell1-3.3.1 {
|
||||
catchcmd "-csv test.db" ".databases"
|
||||
@@ -752,12 +750,9 @@ do_test shell1-3.26.6 {
|
||||
do_test shell1-3.27.1 {
|
||||
catchcmd "test.db" ".timer"
|
||||
} {1 {Usage: .timer on|off}}
|
||||
ifcapable !winrt {
|
||||
# No timer support on winrt.
|
||||
do_test shell1-3.27.2 {
|
||||
catchcmd "test.db" ".timer ON"
|
||||
} {0 {}}
|
||||
}
|
||||
do_test shell1-3.27.2 {
|
||||
catchcmd "test.db" ".timer ON"
|
||||
} {0 {}}
|
||||
do_test shell1-3.27.3 {
|
||||
catchcmd "test.db" ".timer OFF"
|
||||
} {0 {}}
|
||||
@@ -1304,20 +1299,20 @@ do_test_with_ansi_output shell1-8.2 {
|
||||
.mode box
|
||||
SELECT ieee754(47.49) AS x;
|
||||
}
|
||||
} {0 {┌───────────────────────────────┐
|
||||
} {0 {╭───────────────────────────────╮
|
||||
│ x │
|
||||
├───────────────────────────────┤
|
||||
╞═══════════════════════════════╡
|
||||
│ ieee754(6683623321994527,-47) │
|
||||
└───────────────────────────────┘}}
|
||||
╰───────────────────────────────╯}}
|
||||
do_test_with_ansi_output shell1-8.3 {
|
||||
catchcmd ":memory: --box" {
|
||||
select ieee754(6683623321994527,-47) as x;
|
||||
}
|
||||
} {0 {┌───────┐
|
||||
} {0 {╭───────╮
|
||||
│ x │
|
||||
├───────┤
|
||||
╞═══════╡
|
||||
│ 47.49 │
|
||||
└───────┘}}
|
||||
╰───────╯}}
|
||||
do_test shell1-8.4 {
|
||||
catchcmd ":memory: --table" {SELECT ieee754_mantissa(47.49) AS M, ieee754_exponent(47.49) AS E;}
|
||||
} {0 {+------------------+-----+
|
||||
@@ -1340,15 +1335,15 @@ insert into t values ('too long for one line', 1), ('shorter', NULL);
|
||||
.width 10 10
|
||||
.nullvalue NADA
|
||||
select * from t;}
|
||||
} {0 {┌────────────┬────────────┐
|
||||
} {0 {╭────────────┬────────────╮
|
||||
│ a │ b │
|
||||
├────────────┼────────────┤
|
||||
│ too long f │ 1 │
|
||||
╞════════════╪════════════╡
|
||||
│ too long f │ 1 │
|
||||
│ or one lin │ │
|
||||
│ e │ │
|
||||
├────────────┼────────────┤
|
||||
│ shorter │ NADA │
|
||||
└────────────┴────────────┘}}
|
||||
╰────────────┴────────────╯}}
|
||||
|
||||
#----------------------------------------------------------------------------
|
||||
# Test cases shell1-9.*: Basic test that "dot" commands and SQL intermix ok.
|
||||
@@ -1404,24 +1399,24 @@ select base85(zeroblob(2000000000));
|
||||
# qbox --screenwidth auto --linelimit 5 --charlimit 300 --textjsonb on
|
||||
#
|
||||
do_test shell1-12.1 {
|
||||
catchcmd :memory: {.mode tty
|
||||
catchcmd :memory: {.mode tty -quote sql
|
||||
.print
|
||||
SELECT jsonb(1234) AS x;}
|
||||
} {0 {
|
||||
┌───────────────┐
|
||||
╭───────────────╮
|
||||
│ x │
|
||||
├───────────────┤
|
||||
╞═══════════════╡
|
||||
│ jsonb('1234') │
|
||||
└───────────────┘}}
|
||||
╰───────────────╯}}
|
||||
do_test shell1-12.2 {
|
||||
catchcmd :memory: {.mode box --textjsonb on
|
||||
.print
|
||||
SELECT jsonb(1234) AS x;}
|
||||
} {0 {
|
||||
┌──────┐
|
||||
╭──────╮
|
||||
│ x │
|
||||
├──────┤
|
||||
╞══════╡
|
||||
│ 1234 │
|
||||
└──────┘}}
|
||||
╰──────╯}}
|
||||
|
||||
finish_test
|
||||
|
||||
+32
-32
@@ -275,49 +275,49 @@ do_test shell2-1.4.10b {
|
||||
SELECT * FROM generate_series(0,-2);
|
||||
SELECT * FROM generate_series(0,2) LIMIT 3;}]]
|
||||
} {0 {
|
||||
┌─────────────────────┐
|
||||
╭─────────────────────╮
|
||||
│ value │
|
||||
├─────────────────────┤
|
||||
╞═════════════════════╡
|
||||
│ 9223372036854775807 │
|
||||
└─────────────────────┘
|
||||
┌─────────────────────┐
|
||||
╰─────────────────────╯
|
||||
╭─────────────────────╮
|
||||
│ value │
|
||||
├─────────────────────┤
|
||||
╞═════════════════════╡
|
||||
│ 9223372036854775807 │
|
||||
└─────────────────────┘
|
||||
┌────────────┬──────────────────────┬─────────────────────┐
|
||||
╰─────────────────────╯
|
||||
╭────────────┬──────────────────────┬─────────────────────╮
|
||||
│ avg(value) │ min(value) │ max(value) │
|
||||
├────────────┼──────────────────────┼─────────────────────┤
|
||||
│ -0.5 │ -9223372036854775808 │ 9223372036854775807 │
|
||||
└────────────┴──────────────────────┴─────────────────────┘
|
||||
┌──────────────────────┐
|
||||
╞════════════╪══════════════════════╪═════════════════════╡
|
||||
│ -0.5 │ -9223372036854775808 │ 9223372036854775807 │
|
||||
╰────────────┴──────────────────────┴─────────────────────╯
|
||||
╭──────────────────────╮
|
||||
│ value │
|
||||
├──────────────────────┤
|
||||
╞══════════════════════╡
|
||||
│ -9223372036854775808 │
|
||||
│ -1 │
|
||||
│ 9223372036854775806 │
|
||||
└──────────────────────┘
|
||||
┌──────────────────────┐
|
||||
│ -1 │
|
||||
│ 9223372036854775806 │
|
||||
╰──────────────────────╯
|
||||
╭──────────────────────╮
|
||||
│ value │
|
||||
├──────────────────────┤
|
||||
│ 4611686018427387904 │
|
||||
│ 0 │
|
||||
╞══════════════════════╡
|
||||
│ 4611686018427387904 │
|
||||
│ 0 │
|
||||
│ -4611686018427387904 │
|
||||
└──────────────────────┘
|
||||
┌───────┐
|
||||
╰──────────────────────╯
|
||||
╭───────╮
|
||||
│ value │
|
||||
├───────┤
|
||||
│ 0 │
|
||||
│ -1 │
|
||||
│ -2 │
|
||||
└───────┘
|
||||
┌───────┐
|
||||
╞═══════╡
|
||||
│ 0 │
|
||||
│ -1 │
|
||||
│ -2 │
|
||||
╰───────╯
|
||||
╭───────╮
|
||||
│ value │
|
||||
├───────┤
|
||||
│ 0 │
|
||||
│ 1 │
|
||||
│ 2 │
|
||||
└───────┘}}
|
||||
╞═══════╡
|
||||
│ 0 │
|
||||
│ 1 │
|
||||
│ 2 │
|
||||
╰───────╯}}
|
||||
} ;# ifcapable vtab
|
||||
|
||||
ifcapable vtab {
|
||||
|
||||
+11
-11
@@ -38,9 +38,9 @@ do_execsql_test shellA-1.0 {
|
||||
do_test_with_ansi_output shellA-1.2 {
|
||||
exec {*}$CLI -noinit test.db {.mode box -quote off --escape symbol} {SELECT * FROM t1;}
|
||||
} {
|
||||
┌───┬──────────────────────────┐
|
||||
╭───┬──────────────────────────╮
|
||||
│ a │ x │
|
||||
├───┼──────────────────────────┤
|
||||
╞═══╪══════════════════════════╡
|
||||
│ 1 │ line with ' single quote │
|
||||
├───┼──────────────────────────┤
|
||||
│ 2 │ ␛[31mVT-100 codes␛[0m │
|
||||
@@ -57,7 +57,7 @@ do_test_with_ansi_output shellA-1.2 {
|
||||
│ 7 │ carriage␍return │
|
||||
├───┼──────────────────────────┤
|
||||
│ 8 │ last line │
|
||||
└───┴──────────────────────────┘
|
||||
╰───┴──────────────────────────╯
|
||||
}
|
||||
|
||||
# ".mode list"
|
||||
@@ -182,9 +182,9 @@ do_test_with_ansi_output shellA-4.1 {
|
||||
exec {*}$CLI -noinit test.db --box --escape ascii \
|
||||
{SELECT a, x FROM t1 WHERE a IN (1,2,6,7,8)}
|
||||
} {
|
||||
┌───┬──────────────────────────┐
|
||||
╭───┬──────────────────────────╮
|
||||
│ a │ x │
|
||||
├───┼──────────────────────────┤
|
||||
╞═══╪══════════════════════════╡
|
||||
│ 1 │ line with ' single quote │
|
||||
├───┼──────────────────────────┤
|
||||
│ 2 │ ^[[31mVT-100 codes^[[0m │
|
||||
@@ -195,7 +195,7 @@ do_test_with_ansi_output shellA-4.1 {
|
||||
│ 7 │ carriage^Mreturn │
|
||||
├───┼──────────────────────────┤
|
||||
│ 8 │ last line │
|
||||
└───┴──────────────────────────┘
|
||||
╰───┴──────────────────────────╯
|
||||
}
|
||||
do_test_with_ansi_output shellA-4.1b {
|
||||
exec {*}$CLI -noinit test.db --box --escape ascii \
|
||||
@@ -203,7 +203,7 @@ do_test_with_ansi_output shellA-4.1b {
|
||||
{SELECT a, x FROM t1 WHERE a IN (1,2,6,7,8)}
|
||||
} {
|
||||
a │ x
|
||||
───┼──────────────────────────
|
||||
═══╪══════════════════════════
|
||||
1 │ line with ' single quote
|
||||
───┼──────────────────────────
|
||||
2 │ ^[[31mVT-100 codes^[[0m
|
||||
@@ -218,22 +218,22 @@ do_test_with_ansi_output shellA-4.1b {
|
||||
do_test_with_ansi_output shellA-4.2 {
|
||||
exec {*}$CLI -noinit test.db {.mode qbox} {SELECT a, x FROM t1 WHERE a IN (1,2,6,7,8)}
|
||||
} {
|
||||
┌───┬───────────────────────────────────────────┐
|
||||
╭───┬───────────────────────────────────────────╮
|
||||
│ a │ x │
|
||||
├───┼───────────────────────────────────────────┤
|
||||
╞═══╪═══════════════════════════════════════════╡
|
||||
│ 1 │ 'line with '' single quote' │
|
||||
│ 2 │ unistr('\u001b[31mVT-100 codes\u001b[0m') │
|
||||
│ 6 │ unistr('new\u000aline') │
|
||||
│ 7 │ unistr('carriage\u000dreturn') │
|
||||
│ 8 │ 'last line' │
|
||||
└───┴───────────────────────────────────────────┘
|
||||
╰───┴───────────────────────────────────────────╯
|
||||
}
|
||||
do_test_with_ansi_output shellA-4.2b {
|
||||
exec {*}$CLI -noinit test.db {.mode qbox -border off} \
|
||||
{SELECT a, x FROM t1 WHERE a IN (1,2,6,7,8)}
|
||||
} {
|
||||
a │ x
|
||||
───┼───────────────────────────────────────────
|
||||
═══╪═══════════════════════════════════════════
|
||||
1 │ 'line with '' single quote'
|
||||
2 │ unistr('\u001b[31mVT-100 codes\u001b[0m')
|
||||
6 │ unistr('new\u000aline')
|
||||
|
||||
@@ -215,4 +215,72 @@ do_execsql_test 5.1 {
|
||||
SELECT ( SELECT y FROM t2 WHERE x = y ORDER BY y, z) FROM t1;
|
||||
} {ALFKI ANATR}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
reset_db
|
||||
do_execsql_test 6.0 {
|
||||
CREATE TABLE t1(x);
|
||||
INSERT INTO t1 VALUES(1234);
|
||||
}
|
||||
|
||||
do_execsql_test 6.1 {
|
||||
SELECT DISTINCT 'string' FROM t1 LIMIT 1 OFFSET 5;
|
||||
}
|
||||
|
||||
do_execsql_test 6.2 {
|
||||
SELECT (
|
||||
SELECT 'string' FROM t1 LIMIT 1 OFFSET 5
|
||||
);
|
||||
} {{}}
|
||||
|
||||
do_execsql_test 6.3 {
|
||||
SELECT (
|
||||
SELECT DISTINCT 'string' FROM t1 LIMIT 1 OFFSET 5
|
||||
);
|
||||
} {{}}
|
||||
|
||||
do_execsql_test 6.4 {
|
||||
SELECT (
|
||||
SELECT DISTINCT 'string' FROM t1 ORDER BY 1 LIMIT 1 OFFSET 5
|
||||
);
|
||||
} {{}}
|
||||
|
||||
do_execsql_test 6.5 {
|
||||
SELECT (
|
||||
SELECT 'string' FROM t1 ORDER BY 1 LIMIT 1 OFFSET 5
|
||||
);
|
||||
} {{}}
|
||||
|
||||
do_execsql_test 6.6 {
|
||||
SELECT (SELECT DISTINCT x, x FROM t1 LIMIT 1 OFFSET 5)==(1234, 1234)
|
||||
} {{}}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
reset_db
|
||||
do_execsql_test 7.0 {
|
||||
CREATE TABLE t1(x);
|
||||
CREATE INDEX i1 ON t1(x);
|
||||
INSERT INTO t1 VALUES(1234);
|
||||
}
|
||||
|
||||
do_execsql_test 7.1 {
|
||||
SELECT (
|
||||
SELECT DISTINCT 'string' FROM t1 ORDER BY x LIMIT 1 OFFSET 5
|
||||
);
|
||||
} {{}}
|
||||
|
||||
do_execsql_test 7.2 {
|
||||
DROP INDEX i1;
|
||||
CREATE UNIQUE INDEX i1 ON t1(x);
|
||||
}
|
||||
|
||||
do_execsql_test 7.3 {
|
||||
SELECT (
|
||||
SELECT DISTINCT x FROM t1 ORDER BY 1 LIMIT 1 OFFSET 5
|
||||
);
|
||||
} {{}}
|
||||
|
||||
do_execsql_test 7.4 {
|
||||
SELECT (SELECT DISTINCT x FROM t1 ORDER BY +x LIMIT 1 OFFSET 0);
|
||||
} {1234}
|
||||
|
||||
finish_test
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
# 2025 November 11
|
||||
#
|
||||
# The author disclaims copyright to this source code. In place of
|
||||
# a legal notice, here is a blessing:
|
||||
#
|
||||
# May you do good and not evil.
|
||||
# May you find forgiveness for yourself and forgive others.
|
||||
# May you share freely, never taking more than you give.
|
||||
#
|
||||
#***********************************************************************
|
||||
#
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
set testprefix temptrigfault
|
||||
|
||||
forcedelete test.db2
|
||||
do_execsql_test 1.0 {
|
||||
CREATE TABLE t1(x, y);
|
||||
ATTACH 'test.db2' AS aux;
|
||||
CREATE TABLE aux.t1(x, y);
|
||||
}
|
||||
|
||||
do_faultsim_test 1.1 -faults oom* -prep {
|
||||
} -body {
|
||||
execsql {
|
||||
CREATE TEMP TRIGGER tmptrig AFTER INSERT ON t1 BEGIN
|
||||
INSERT INTO aux.t1 VALUES(new.x, new.y);
|
||||
END;
|
||||
}
|
||||
} -test {
|
||||
faultsim_test_result {0 {}}
|
||||
catchsql { DROP TRIGGER tmptrig }
|
||||
}
|
||||
|
||||
do_execsql_test 2.0 {
|
||||
CREATE TEMP TRIGGER tmptrig AFTER INSERT ON t1 BEGIN
|
||||
INSERT INTO aux.t1 VALUES(new.x, new.y);
|
||||
END;
|
||||
}
|
||||
|
||||
do_faultsim_test 2 -faults oom* -prep {
|
||||
} -body {
|
||||
execsql {
|
||||
INSERT INTO t1 VALUES('x', 'y');
|
||||
}
|
||||
} -test {
|
||||
faultsim_test_result {0 {}}
|
||||
}
|
||||
|
||||
do_execsql_test 3.0.1 {
|
||||
SELECT * FROM t1;
|
||||
DELETE FROM t1;
|
||||
DELETE FROM aux.t1;
|
||||
} [db eval {SELECT * FROM aux.t1}]
|
||||
|
||||
do_execsql_test 3.0.2 {
|
||||
CREATE TEMP TRIGGER tmptrig2 AFTER INSERT ON aux.t1 BEGIN
|
||||
INSERT INTO t1 VALUES(new.x||'2', new.y||'2');
|
||||
END;
|
||||
}
|
||||
|
||||
do_faultsim_test 3 -faults oom* -prep {
|
||||
} -body {
|
||||
execsql {
|
||||
INSERT INTO aux.t1 VALUES('aaa', 'bbb');
|
||||
}
|
||||
} -test {
|
||||
faultsim_test_result {0 {}}
|
||||
}
|
||||
|
||||
proc repeatlist {list n} {
|
||||
set ret [list]
|
||||
for {set i 0} {$i < $n} {incr i} {
|
||||
set ret [concat $ret $list]
|
||||
}
|
||||
set ret
|
||||
}
|
||||
|
||||
do_execsql_test 3.x.1 {
|
||||
SELECT * FROM main.t1;
|
||||
} [repeatlist {aaa2 bbb2} 5]
|
||||
|
||||
do_execsql_test 3.x.2 {
|
||||
SELECT * FROM aux.t1;
|
||||
} [repeatlist {aaa bbb aaa2 bbb2} 5]
|
||||
|
||||
faultsim_save_and_close
|
||||
do_faultsim_test 4 -faults oom* -prep {
|
||||
faultsim_restore_and_reopen
|
||||
execsql { ATTACH 'test.db2' AS aux; }
|
||||
} -body {
|
||||
execsql {
|
||||
CREATE TEMP TRIGGER xyz AFTER DELETE ON main.t1 BEGIN
|
||||
DELETE FROM aux.t1 WHERE rowid=old.rowid;
|
||||
END;
|
||||
|
||||
DELETE FROM t1 WHERE rowid=2;
|
||||
}
|
||||
} -test {
|
||||
faultsim_test_result {0 {}} {1 {unable to open a temporary database file for storing temporary tables}}
|
||||
}
|
||||
|
||||
faultsim_save_and_close
|
||||
do_faultsim_test 5 -faults oom* -prep {
|
||||
faultsim_restore_and_reopen
|
||||
execsql { ATTACH 'test.db2' AS aux; }
|
||||
} -body {
|
||||
execsql {
|
||||
CREATE TEMP TRIGGER xyz AFTER UPDATE ON aux.t1 BEGIN
|
||||
UPDATE main.t1 SET x=new.x, y=new.y WHERE rowid=new.rowid;
|
||||
END;
|
||||
UPDATE aux.t1 SET x=x||x WHERE rowid=1+abs(random() % 5);
|
||||
}
|
||||
} -test {
|
||||
faultsim_test_result {0 {}} {1 {unable to open a temporary database file for storing temporary tables}}
|
||||
}
|
||||
|
||||
|
||||
finish_test
|
||||
@@ -276,4 +276,191 @@ do_catchsql_test 6.3 {
|
||||
} {1 error}
|
||||
db2 close
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
reset_db
|
||||
forcedelete test.db2
|
||||
|
||||
do_execsql_test 7.0 {
|
||||
CREATE TABLE m1(a, b);
|
||||
ATTACH 'test.db2' AS aux;
|
||||
CREATE TABLE aux.a1(c, d);
|
||||
}
|
||||
|
||||
do_execsql_test 7.1 {
|
||||
CREATE TEMP TRIGGER tr1 AFTER INSERT ON m1 BEGIN
|
||||
INSERT INTO a1 VALUES(new.a, new.b);
|
||||
END;
|
||||
|
||||
INSERT INTO m1 VALUES(5, 6);
|
||||
SELECT * FROM aux.a1;
|
||||
} {5 6}
|
||||
|
||||
do_execsql_test 7.2 {
|
||||
CREATE TABLE a1(e, f);
|
||||
INSERT INTO m1 VALUES(7, 8);
|
||||
}
|
||||
|
||||
do_execsql_test 7.3.1 { SELECT * FROM main.a1 } {7 8}
|
||||
do_execsql_test 7.3.2 { SELECT * FROM aux.a1 } {5 6}
|
||||
|
||||
do_execsql_test 7.4 {
|
||||
DROP TRIGGER tr1;
|
||||
CREATE TEMP TRIGGER tr1 AFTER INSERT ON m1 BEGIN
|
||||
INSERT INTO a1 SELECT d, c FROM aux.a1;
|
||||
END;
|
||||
|
||||
DELETE FROM aux.a1;
|
||||
DELETE FROM main.a1;
|
||||
INSERT INTO aux.a1 VALUES('hello', 'world');
|
||||
}
|
||||
|
||||
do_execsql_test 7.5 {
|
||||
INSERT INTO m1 VALUES(9, 10);
|
||||
SELECT * FROM main.a1;
|
||||
} {world hello}
|
||||
|
||||
do_catchsql_test 7.6 {
|
||||
DROP TRIGGER tr1;
|
||||
CREATE TRIGGER tr1 AFTER INSERT ON m1 BEGIN
|
||||
INSERT INTO a1 SELECT d, c FROM aux.a1;
|
||||
END;
|
||||
} {1 {trigger tr1 cannot reference objects in database aux}}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# Check that temp triggers may INSERT/UPDATE/DELETE to fully qualified
|
||||
# table names.
|
||||
reset_db
|
||||
forcedelete {*}[glob -nocomplain *mj*]
|
||||
forcedelete test.db2
|
||||
do_execsql_test 8.0 {
|
||||
ATTACH 'test.db2' AS aux;
|
||||
CREATE TABLE t1(a, b);
|
||||
CREATE TABLE t2(c, d);
|
||||
CREATE TABLE aux.t1(e, f);
|
||||
CREATE TABLE aux.t2(g, h);
|
||||
}
|
||||
|
||||
do_catchsql_test 8.1.1 {
|
||||
CREATE TRIGGER tr1 AFTER INSERT ON t2 BEGIN
|
||||
INSERT INTO aux.t1 VALUES(new.c, new.d);
|
||||
END;
|
||||
} {1 {qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers}}
|
||||
|
||||
do_execsql_test 8.1.2 {
|
||||
CREATE TEMP TRIGGER tr1 AFTER INSERT ON t2 BEGIN
|
||||
INSERT INTO aux.t1 VALUES(new.c, new.d);
|
||||
END;
|
||||
|
||||
INSERT INTO main.t2 VALUES('x', 'y');
|
||||
SELECT * FROM aux.t1;
|
||||
} {x y}
|
||||
|
||||
do_execsql_test 8.1.3 { SELECT * FROM t1 } {}
|
||||
|
||||
do_catchsql_test 8.2.1 {
|
||||
CREATE TRIGGER aux.tr2 AFTER UPDATE ON aux.t1 BEGIN
|
||||
UPDATE main.t2 SET c=new.e, d=new.f;
|
||||
END;
|
||||
} {1 {qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers}}
|
||||
|
||||
do_execsql_test 8.2.2 {
|
||||
CREATE TEMP TRIGGER tr2 AFTER UPDATE ON aux.t1 BEGIN
|
||||
UPDATE main.t2 SET c=new.e, d=new.f;
|
||||
END;
|
||||
|
||||
UPDATE aux.t1 SET e=1, f=2;
|
||||
SELECT * FROM t2;
|
||||
} {1 2}
|
||||
|
||||
do_execsql_test 8.2.3 { SELECT * FROM aux.t2 } {}
|
||||
|
||||
do_catchsql_test 8.3.1 {
|
||||
CREATE TRIGGER tr3 AFTER DELETE ON t2 BEGIN
|
||||
DELETE FROM aux.t1;
|
||||
END;
|
||||
} {1 {qualified table names are not allowed on INSERT, UPDATE, and DELETE statements within triggers}}
|
||||
|
||||
do_execsql_test 8.3.2 {
|
||||
INSERT INTO main.t1 VALUES('a', 'b');
|
||||
CREATE TEMP TRIGGER tr3 AFTER DELETE ON t2 BEGIN
|
||||
DELETE FROM aux.t1;
|
||||
END;
|
||||
|
||||
DELETE FROM main.t2;
|
||||
SELECT * FROM aux.t1;
|
||||
} {}
|
||||
|
||||
do_execsql_test 8.3.3 { SELECT * FROM t1 } {a b}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
reset_db
|
||||
set nDb 8
|
||||
do_test 9.0 {
|
||||
for {set ii 0} {$ii < $nDb} {incr ii} {
|
||||
db eval "ATTACH ':memory:' AS db$ii"
|
||||
db eval "CREATE TABLE db$ii.tbl(a, b, c)"
|
||||
}
|
||||
|
||||
for {set ii 0} {$ii < ($nDb-1)} {incr ii} {
|
||||
set jj [expr $ii+1]
|
||||
db eval "
|
||||
CREATE TEMP TRIGGER tr$ii AFTER INSERT ON db$ii.tbl BEGIN
|
||||
INSERT INTO db$jj.tbl VALUES(new.b, new.c, new.a);
|
||||
END;
|
||||
"
|
||||
}
|
||||
} {}
|
||||
|
||||
do_execsql_test 9.1 { INSERT INTO db0.tbl VALUES('a', 'b', 'c'); }
|
||||
do_execsql_test 9.1.1 { SELECT * FROM db0.tbl } {a b c}
|
||||
do_execsql_test 9.1.2 { SELECT * FROM db1.tbl } {b c a}
|
||||
do_execsql_test 9.1.3 { SELECT * FROM db2.tbl } {c a b}
|
||||
do_execsql_test 9.1.1 { SELECT * FROM db3.tbl } {a b c}
|
||||
do_execsql_test 9.1.2 { SELECT * FROM db4.tbl } {b c a}
|
||||
do_execsql_test 9.1.3 { SELECT * FROM db5.tbl } {c a b}
|
||||
do_execsql_test 9.1.1 { SELECT * FROM db6.tbl } {a b c}
|
||||
do_execsql_test 9.1.2 { SELECT * FROM db7.tbl } {b c a}
|
||||
|
||||
do_test 9.2 {
|
||||
for {set ii 0} {$ii < ($nDb-1)} {incr ii} {
|
||||
set jj [expr $ii+1]
|
||||
db eval "
|
||||
CREATE TEMP TRIGGER tru$ii AFTER UPDATE ON db$ii.tbl BEGIN
|
||||
UPDATE db$jj.tbl SET a=new.b, b=new.c, c=new.a;
|
||||
END;
|
||||
"
|
||||
}
|
||||
} {}
|
||||
|
||||
do_execsql_test 9.3 { UPDATE db0.tbl SET a=1, b=2, c=3 }
|
||||
do_execsql_test 9.3.1 { SELECT * FROM db0.tbl } {1 2 3}
|
||||
do_execsql_test 9.3.2 { SELECT * FROM db1.tbl } {2 3 1}
|
||||
do_execsql_test 9.3.3 { SELECT * FROM db2.tbl } {3 1 2}
|
||||
do_execsql_test 9.3.1 { SELECT * FROM db3.tbl } {1 2 3}
|
||||
do_execsql_test 9.3.2 { SELECT * FROM db4.tbl } {2 3 1}
|
||||
do_execsql_test 9.3.3 { SELECT * FROM db5.tbl } {3 1 2}
|
||||
do_execsql_test 9.3.1 { SELECT * FROM db6.tbl } {1 2 3}
|
||||
do_execsql_test 9.3.2 { SELECT * FROM db7.tbl } {2 3 1}
|
||||
|
||||
do_test 9.4 {
|
||||
for {set ii 0} {$ii < ($nDb-1)} {incr ii} {
|
||||
set jj [expr $ii+1]
|
||||
db eval "
|
||||
CREATE TEMP TRIGGER trd$ii BEFORE DELETE ON db$ii.tbl BEGIN
|
||||
DELETE FROM db$jj.tbl;
|
||||
END;
|
||||
"
|
||||
}
|
||||
} {}
|
||||
|
||||
do_execsql_test 9.5 { DELETE FROM db0.tbl }
|
||||
do_execsql_test 9.5.1 { SELECT * FROM db0.tbl } {}
|
||||
do_execsql_test 9.5.2 { SELECT * FROM db1.tbl } {}
|
||||
do_execsql_test 9.5.3 { SELECT * FROM db2.tbl } {}
|
||||
do_execsql_test 9.5.1 { SELECT * FROM db3.tbl } {}
|
||||
do_execsql_test 9.5.2 { SELECT * FROM db4.tbl } {}
|
||||
do_execsql_test 9.5.3 { SELECT * FROM db5.tbl } {}
|
||||
do_execsql_test 9.5.1 { SELECT * FROM db6.tbl } {}
|
||||
do_execsql_test 9.5.2 { SELECT * FROM db7.tbl } {}
|
||||
|
||||
finish_test
|
||||
|
||||
@@ -1785,11 +1785,6 @@ proc crashsql {args} {
|
||||
# cfSync(), which can be different then what TCL uses by
|
||||
# default, so here we force it to the "nativename" format.
|
||||
set cfile [string map {\\ \\\\} [file nativename [file join [get_pwd] $crashfile]]]
|
||||
ifcapable winrt {
|
||||
# Except on winrt. Winrt has no way to transform a relative path into
|
||||
# an absolute one, so it just uses the relative paths.
|
||||
set cfile $crashfile
|
||||
}
|
||||
|
||||
set f [open crash.tcl w]
|
||||
puts $f "sqlite3_initialize ; sqlite3_shutdown"
|
||||
|
||||
@@ -37,7 +37,6 @@ namespace eval trd {
|
||||
set tcltest(win.Windows-Memdebug) veryquick
|
||||
set tcltest(win.Windows-Win32Heap) veryquick
|
||||
set tcltest(win.Windows-Sanitize) veryquick
|
||||
set tcltest(win.Windows-WinRT) veryquick
|
||||
set tcltest(win.Default) {full win_unc_locking}
|
||||
|
||||
# Extra [make xyz] tests that should be run for various builds.
|
||||
@@ -364,12 +363,6 @@ namespace eval trd {
|
||||
set build(Windows-Sanitize) {
|
||||
ASAN=1
|
||||
}
|
||||
|
||||
set build(Windows-WinRT) {
|
||||
FOR_WINRT=1
|
||||
ENABLE_SETLK=1
|
||||
-DSQLITE_TEMP_STORE=3
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -115,11 +115,7 @@ do_test 1.6 {
|
||||
|
||||
db3 close
|
||||
|
||||
# winrt platforms do not handle paths with unix-style '/' directory separators.
|
||||
#
|
||||
set lUri [list 1a 1b 1c 1d 1e 1f]
|
||||
ifcapable winrt { set lUri [list 1a 1c 1e] }
|
||||
|
||||
foreach tn $lUri {
|
||||
sqlite3 db3 $uri($tn) -vfs win32-longpath -uri 1 -translatefilename 0
|
||||
|
||||
|
||||
@@ -885,7 +885,10 @@ do_test 19.1 {
|
||||
INSERT INTO v0 DEFAULT VALUES;
|
||||
}
|
||||
} {}
|
||||
db close
|
||||
forcedelete zipfile19.zip
|
||||
sqlite3 db :memory:
|
||||
load_static_extension db zipfile
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
do_catchsql_test 20.0 {
|
||||
|
||||
@@ -105,7 +105,6 @@ REM When set, these values are expanded and passed to the NMAKE command line,
|
||||
REM after its other arguments. These may be used to specify additional NMAKE
|
||||
REM options, for example:
|
||||
REM
|
||||
REM SET NMAKE_ARGS=FOR_WINRT=1
|
||||
REM SET NMAKE_ARGS_DEBUG=MEMDEBUG=1
|
||||
REM SET NMAKE_ARGS_RETAIL=WIN32HEAP=1
|
||||
REM
|
||||
@@ -861,4 +860,4 @@ GOTO no_errors
|
||||
GOTO end_of_file
|
||||
|
||||
:end_of_file
|
||||
%__ECHO% EXIT /B %ERRORLEVEL%
|
||||
%__ECHO% EXIT /B %ERRORLEVEL%
|
||||
|
||||
Reference in New Issue
Block a user