Comment: | Merge all the latest trunk enhancements, and especially theorder-by-subquery optimization, into the bedrock branch, via wal2. |
---|---|
Downloads: | Tarball| ZIP archive| SQL archive |
Timelines: | family| ancestors | bedrock |
Files: | files | file ages | folders |
SHA3-256: | d0591db3bb84c8f6325d3d5a44467f60 |
User&Date: | drh on 2024-08-16 19:04:36 |
OtherLinks: | branch diff |manifest| tags |
2024-08-16 | ||
19:04 | Merge all the latest trunk enhancements, and especially theorder-by-subquery optimization, into the bedrock branch, via wal2.(Leafcheck-in:d0591db3 user:drh tags:bedrock) | |
18:58 | Merge the latest trunk enhancements into the wal2 branch.(Leafcheck-in:a78208b5 user:drh tags:wal2) | |
2024-08-09 | ||
10:50 | Fix some signed/unsigned compiler warnings on this branch.(check-in:d615d529 user:dan tags:bedrock) | |
HideDiffsUnifiedDiffsIgnoreWhitespacePatch
Modified Makefile.infrom [377b5e6b]to [ef022e67].
︙ | ︙ | |||
117118119120121122123 | #TCLSH_CMD = @TCLSH_CMD@# Where do we want to install the tcl plugin#TCLLIBDIR = @TCLLIBDIR@ | <<<< | 117118119120121122123124125126127128129130 | #TCLSH_CMD = @TCLSH_CMD@# Where do we want to install the tcl plugin#TCLLIBDIR = @TCLLIBDIR@# If gcov support was enabled by the configure script, add the appropriate# flags here. It's not always as easy as just having the user add the right# CFLAGS / LDFLAGS, because libtool wants to use CFLAGS when linking, which# causes build errors with -fprofile-arcs -ftest-coverage with some GCCs.# Supposedly GCC does the right thing if you use --coverage, but in# practice it still fails. See:# |
︙ | ︙ | |||
1556155715581559156015611562156315641565156615671568156915701571157215731574 | $(INSTALL) -m 0644 sqlite3.h $(DESTDIR)$(includedir)$(INSTALL) -m 0644 $(TOP)/src/sqlite3ext.h $(DESTDIR)$(includedir)$(INSTALL) -d $(DESTDIR)$(pkgconfigdir)$(INSTALL) -m 0644 sqlite3.pc $(DESTDIR)$(pkgconfigdir)pkgIndex.tcl:echo 'package ifneeded sqlite3 $(RELEASE) [list load [file join $$dir libtclsqlite3[info sharedlibextension]] sqlite3]' > $@tcl_install:lib_install libtclsqlite3.la pkgIndex.tcl$(INSTALL) -d $(DESTDIR)$(TCLLIBDIR)$(LTINSTALL) libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)rm -f $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.a$(INSTALL) -m 0644 pkgIndex.tcl $(DESTDIR)$(TCLLIBDIR)clean:rm -f *.lo *.la *.o sqlite3$(TEXE) libsqlite3.larm -f sqlite3.h opcodes.*rm -rf .libs .depsrm -f lemon$(BEXE) lempar.c parse.* sqlite*.tar.gzrm -f mkkeywordhash$(BEXE) keywordhash.h | >>>>>>>>>>>>>>>>>>>>>>>>> | 1552155315541555155615571558156015611562156315641589159015911592159315941595 | $(INSTALL) -m 0644 sqlite3.h $(DESTDIR)$(includedir)$(INSTALL) -m 0644 $(TOP)/src/sqlite3ext.h $(DESTDIR)$(includedir)$(INSTALL) -d $(DESTDIR)$(pkgconfigdir)$(INSTALL) -m 0644 sqlite3.pc $(DESTDIR)$(pkgconfigdir)pkgIndex.tcl:echo 'package ifneeded sqlite3 $(RELEASE) [list load [file join $$dir libtclsqlite3[info sharedlibextension]] sqlite3]' > $@tcl_install:lib_install libtclsqlite3.la pkgIndex.tcl$(INSTALL) -d $(DESTDIR)$(TCLLIBDIR)$(LTINSTALL) libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)rm -f $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.a$(INSTALL) -m 0644 pkgIndex.tcl $(DESTDIR)$(TCLLIBDIR)clean:rm -f *.lo *.la *.o sqlite3$(TEXE) libsqlite3.larm -f sqlite3.h opcodes.*rm -rf .libs .depsrm -f lemon$(BEXE) lempar.c parse.* sqlite*.tar.gzrm -f mkkeywordhash$(BEXE) keywordhash.h |
︙ | ︙ |
Modified Makefile.mscfrom [e0e79546]to [f430e067].
︙ | ︙ | |||
18171818181918201821182218231824182518261827182818291830 | for /F %%V in ('type "$(TOP)\VERSION"') do ( \echo package ifneeded sqlite3 @version@ [list load [file join $$dir $(SQLITE3TCLDLL)] sqlite3] \| $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact @version@ %%V > pkgIndex.tcl \)$(SQLITE3TCLDLL):libtclsqlite3.lib $(LIBRESOBJS) tclsqlite3.def pkgIndex.tcl$(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /DEF:tclsqlite3.def /OUT:$@ libtclsqlite3.lib $(LIBRESOBJS) $(LTLIBS) $(TLIBS)# <</mark>>$(SQLITE3DLL):$(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)$(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)# <<block2>>sqlite3.def:libsqlite3.lib | >>>>>>>>>>>>> | 18171818181918201821182218231837183818391840184118421843 | for /F %%V in ('type "$(TOP)\VERSION"') do ( \echo package ifneeded sqlite3 @version@ [list load [file join $$dir $(SQLITE3TCLDLL)] sqlite3] \| $(TCLSH_CMD) $(TOP)\tool\replace.tcl exact @version@ %%V > pkgIndex.tcl \)$(SQLITE3TCLDLL):libtclsqlite3.lib $(LIBRESOBJS) tclsqlite3.def pkgIndex.tcl$(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL /DEF:tclsqlite3.def /OUT:$@ libtclsqlite3.lib $(LIBRESOBJS) $(LTLIBS) $(TLIBS)# <</mark>>$(SQLITE3DLL):$(LIBOBJ) $(LIBRESOBJS) $(CORE_LINK_DEP)$(LD) $(LDFLAGS) $(LTLINKOPTS) $(LTLIBPATHS) /DLL $(CORE_LINK_OPTS) /OUT:$@ $(LIBOBJ) $(LIBRESOBJS) $(LTLIBS) $(TLIBS)# <<block2>>sqlite3.def:libsqlite3.lib |
︙ | ︙ |
Modified configurefrom [e0efd210]to [2e5058c2].
︙ | ︙ | |||
777778779780781782783 | USE_AMALGAMATIONTARGET_DEBUGTARGET_HAVE_LINENOISETARGET_HAVE_EDITLINETARGET_HAVE_READLINETARGET_READLINE_INCTARGET_READLINE_LIBS | <<<<<<<<<<<<>>>> | 777778779780781782783784785786787788789790791792793794795796801802803804805806807 | USE_AMALGAMATIONTARGET_DEBUGTARGET_HAVE_LINENOISETARGET_HAVE_EDITLINETARGET_HAVE_READLINETARGET_READLINE_INCTARGET_READLINE_LIBSTARGET_EXEEXTSQLITE_OS_WINSQLITE_OS_UNIXBUILD_EXEEXTTEMP_STOREALLOWRELEASESQLITE_THREADSAFEBUILD_CCHAVE_WASI_SDKRELEASEVERSIONprogram_prefixTCLLIBDIRTCLSH_CMDINSTALL_DATAINSTALL_SCRIPTINSTALL_PROGRAMCPPOTOOL64OTOOL |
︙ | ︙ | |||
890891892893894895896897898899900 | enable_sharedenable_staticwith_picenable_fast_installwith_gnu_ldenable_libtool_lockenable_largefilewith_wasi_sdkenable_threadsafeenable_releasemodeenable_tempstore | >>><< | 882883884885886887888892893894895896897898899900901902 | enable_sharedenable_staticwith_picenable_fast_installwith_gnu_ldenable_libtool_lockenable_largefilewith_wasi_sdkenable_threadsafeenable_releasemodeenable_tempstoreenable_editlineenable_readlinewith_readline_libwith_readline_incwith_linenoiseenable_debugenable_amalgamation |
︙ | ︙ | |||
15471548154915501551155215531554155515561557 | --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-largefile omit support for large files --disable-threadsafe Disable mutexing --enable-releasemode Support libtool link to release mode --enable-tempstore Use an in-ram database for temporary tables (never,no,yes,always) | >>< | 154015411542154315441545154615491550155115521553155415551556155715581559 | --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-largefile omit support for large files --disable-threadsafe Disable mutexing --enable-releasemode Support libtool link to release mode --enable-tempstore Use an in-ram database for temporary tables (never,no,yes,always) --enable-editline enable BSD editline support --disable-readline disable readline support --enable-debug enable debugging & verbose explain --disable-amalgamation Disable the amalgamation and instead build all files separately --disable-load-extension Disable loading of external extensions |
︙ | ︙ | |||
157915801581158215831584158515861587 | Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-wasi-sdk=DIR directory containing the WASI SDK. Triggers cross-compile to WASM. | >><< | 1573157415751576157715781579158215831584158515861587158815891590 | Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-wasi-sdk=DIR directory containing the WASI SDK. Triggers cross-compile to WASM. --with-readline-lib specify readline library --with-readline-inc specify readline include paths --with-linenoise=DIR source directory for linenoise librarySome influential environment variables: CC C compiler command CFLAGS C compiler flags |
︙ | ︙ | |||
3941394239433944394539463947 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5$as_echo_n "checking the name lister ($NM) interface... " >&6; }if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext | ||| | 393539363937393839393940394139433944394639473949395039513952395339543955 | { $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5$as_echo_n "checking the name lister ($NM) interface... " >&6; }if ${lt_cv_nm_interface+:} false; then : $as_echo_n "(cached) " >&6else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*fi{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5 |
︙ | ︙ | |||
5153515451555156515751585159 | ;; esac fi rm -rf conftest* ;;*-*-irix6*) # Find out which ABI we are using. | | | 51475148514951505151515251535155515651575158515951605161 | ;; esac fi rm -rf conftest* ;;*-*-irix6*) # Find out which ABI we are using. if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in |
︙ | ︙ | |||
6678667966806681668266836684 | # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` | || | 66726673667466756676667766786680668166826684668566866687668866896690 | # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes |
︙ | ︙ | |||
7017701870197020702170227023 | # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` | || | 70117012701370147015701670177019702070217023702470257026702770287029 | # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes |
︙ | ︙ | |||
7122712371247125712671277128 | # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` | || | 71167117711871197120712171227124712571267128712971307131713271337134 | # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then |
︙ | ︙ | |||
7177717871797180718171827183 | # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` | || | 71717172717371747175717671777179718071817183718471857186718771887189 | # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then |
︙ | ︙ | |||
9557955895599560956195629563 | else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=crosselse lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF | | | 95519552955395549555955695579559956095619562956395649565 | else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=crosselse lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF#include "confdefs.h"#if HAVE_DLFCN_H#include <dlfcn.h>#endif#include <stdio.h> |
︙ | ︙ | |||
9653965496559656965796589659 | else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=crosselse lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF | | | 96479648964996509651965296539655965696579658965996609661 | else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=crosselse lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF#include "confdefs.h"#if HAVE_DLFCN_H#include <dlfcn.h>#endif#include <stdio.h> |
︙ | ︙ | |||
10310103111031210313103141031510316 | ########## By default, we use the amalgamation (this may be changed below...)#USE_AMALGAMATION=1######### | >>>|>>|>||>||>|>>>||<<<<<||<>| | 1030410305103061030710308103091031010335103361033710338103391034010341 | ########## By default, we use the amalgamation (this may be changed below...)#USE_AMALGAMATION=1#########do # Extract the first word of "$ac_prog", so it can be a program name with args.set dummy $ac_prog; ac_word=$2{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5$as_echo_n "checking for $ac_word... " >&6; }if ${ac_cv_prog_TCLSH_CMD+:} false; then : $as_echo_n "(cached) " >&6 |
︙ | ︙ | |||
1037010371103721037310374103751037610377103781037910380 | fi test -n "$TCLSH_CMD" && breakdonetest -n "$TCLSH_CMD" || TCLSH_CMD="none"fiif test "$TCLSH_CMD" = "none"; then # If we can't find a local tclsh, then building the amalgamation will fail. # We act as though --disable-amalgamation has been used. | >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>|<<<<<<< | 10370103711037210373103741037510376103781046010461104621046510466104671046810469104701047110472104731047410475104761047710478 | fi test -n "$TCLSH_CMD" && breakdonetest -n "$TCLSH_CMD" || TCLSH_CMD="none"fiif test "$TCLSH_CMD" = "none"; then # If we can't find a local tclsh, then building the amalgamation will fail. # We act as though --disable-amalgamation has been used. USE_AMALGAMATION=0 TCLSH_CMD="tclsh"fiif test "x${TCLLIBDIR+set}" != "xset" ; then for i in `echo 'puts stdout $auto_path' | ${TCLSH_CMD}` ; do if test -d $i ; then TCLLIBDIR=$i break fi done TCLLIBDIR="${TCLLIBDIR}/sqlite3" |
︙ | ︙ | |||
10784107851078610787107881078910790 | CFLAGS="$CFLAGS -DSQLITE_OS_UNIX=1"fi | <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | 1086010861108621086310864108651086610867108681086910870108711087210873 | CFLAGS="$CFLAGS -DSQLITE_OS_UNIX=1"fi########### Figure out what C libraries are required to compile programs# that use "readline()" library.#TARGET_READLINE_LIBS=""TARGET_READLINE_INC="" |
︙ | ︙ |
Modified configure.acfrom [7361a1dd]to [b7e26a69].
︙ | ︙ | |||
112113114115116117118 | ########## By default, we use the amalgamation (this may be changed below...)#USE_AMALGAMATION=1######### | ||<>>>>>>>>>>>>>|>>>>>>>>|>>>>>>>>>>|>>>>>||>>|<>>>|>>>>>|>>>>>>>>>>>>>>>>>>>>|>>>>|<<<<<< | 112113114115116117118121157171188204205206207209210211212213214215216217218219220221222 | ########## By default, we use the amalgamation (this may be changed below...)#USE_AMALGAMATION=1########## else fielsefiif test "$TCLSH_CMD" = "none"; then # If we can't find a local tclsh, then building the amalgamation will fail. # We act as though --disable-amalgamation has been used. USE_AMALGAMATION=0 TCLSH_CMD="tclsh"fiAC_SUBST(TCLSH_CMD)AC_ARG_VAR([TCLLIBDIR], [Where to install tcl plugin])if test "x${TCLLIBDIR+set}" != "xset" ; then for i in `echo 'puts stdout $auto_path' | ${TCLSH_CMD}` ; do if test -d $i ; then TCLLIBDIR=$i break fi done TCLLIBDIR="${TCLLIBDIR}/sqlite3" |
︙ | ︙ | |||
353354355356357358359 | fiAC_SUBST(BUILD_EXEEXT)AC_SUBST(SQLITE_OS_UNIX)AC_SUBST(SQLITE_OS_WIN)AC_SUBST(TARGET_EXEEXT) | <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | 415416417418419420421422423424425426427428 | fiAC_SUBST(BUILD_EXEEXT)AC_SUBST(SQLITE_OS_UNIX)AC_SUBST(SQLITE_OS_WIN)AC_SUBST(TARGET_EXEEXT)########### Figure out what C libraries are required to compile programs# that use "readline()" library.#TARGET_READLINE_LIBS=""TARGET_READLINE_INC=""TARGET_HAVE_READLINE=0 |
︙ | ︙ |
Modified ext/consio/console_io.cfrom [f32b757c]to [b4885dfe].
︙ | ︙ | |||
49505152535455 | # endif# define CIO_WIN_WC_XLATE 0 /* Use plain C library stream I/O at console */# endif#else# define CIO_WIN_WC_XLATE 0 /* Not exposing translation routines at all */#endif | <<<<< | 4950515253545556575859606162 | # endif# define CIO_WIN_WC_XLATE 0 /* Use plain C library stream I/O at console */# endif#else# define CIO_WIN_WC_XLATE 0 /* Not exposing translation routines at all */#endif#if CIO_WIN_WC_XLATEstatic HANDLE handleOfFile(FILE *pf){ int fileDesc = _fileno(pf); union { intptr_t osfh; HANDLE fh; } fid = { (fileDesc>=0)? _get_osfhandle(fileDesc) : (intptr_t)INVALID_HANDLE_VALUE }; return fid.fh; |
︙ | ︙ |
Modified ext/expert/expert1.testfrom [53a749de]to [661f873f].
︙ | ︙ | |||
461462463464465466467468469470471472473474 | t1 t1_idx_00000062 {100 20} t1 t1_idx_000123a7 {100 50 17} t2 t2_idx_00000063 {100 20} t2 t2_idx_00000064 {100 5} t2 t2_idx_0001295b {100 20 5}}if 0 {do_test expert1-6.0 { catchcmd :memory: {.expertselect base64('');.expertselect name from pragma_collation_list order by name collate uint; | >>>>>>> | 461462463464465466467475476477478479480481 | t1 t1_idx_00000062 {100 20} t1 t1_idx_000123a7 {100 50 17} t2 t2_idx_00000063 {100 20} t2 t2_idx_00000064 {100 5} t2 t2_idx_0001295b {100 20 5}}if 0 {do_test expert1-6.0 { catchcmd :memory: {.expertselect base64('');.expertselect name from pragma_collation_list order by name collate uint; |
︙ | ︙ |
Modified ext/expert/sqlite3expert.cfrom [c8cea5ff]to [8b09aeb2].
︙ | ︙ | |||
622623624625626627628 | (void)idxStr; (void)argc; (void)argv; rc = sqlite3_finalize(pCsr->pData); pCsr->pData = 0; if( rc==SQLITE_OK ){ rc = idxPrintfPrepareStmt(pExpert->db, &pCsr->pData, &pVtab->base.zErrMsg, | | | 622623624625626627628630631632633634635636 | (void)idxStr; (void)argc; (void)argv; rc = sqlite3_finalize(pCsr->pData); pCsr->pData = 0; if( rc==SQLITE_OK ){ rc = idxPrintfPrepareStmt(pExpert->db, &pCsr->pData, &pVtab->base.zErrMsg, ); } if( rc==SQLITE_OK ){ rc = expertNext(cur); } return rc; |
︙ | ︙ | |||
1496149714981499150015011502 | int nByte; /* Bytes of space allocated at z */ int n; /* Size of buffer z */ char *z; /* SQLITE_TEXT/BLOB value */ } aSlot[1];};/* | || | 14961497149814991500150115021504150515061507150815091510151115121513151415151517151815191520152115221523 | int nByte; /* Bytes of space allocated at z */ int n; /* Size of buffer z */ char *z; /* SQLITE_TEXT/BLOB value */ } aSlot[1];};/**/static void idxRemFunc( sqlite3_context *pCtx, int argc, sqlite3_value **argv){ struct IdxRemCtx *p = (struct IdxRemCtx*)sqlite3_user_data(pCtx); struct IdxRemSlot *pSlot; int iSlot; assert( argc==2 ); iSlot = sqlite3_value_int(argv[0]); pSlot = &p->aSlot[iSlot]; switch( pSlot->eType ){ case SQLITE_NULL: /* no-op */ break; |
︙ | ︙ | |||
1620162116221623162416251626 | /* Formulate the query text */ sqlite3_bind_text(pIndexXInfo, 1, zIdx, -1, SQLITE_STATIC); while( SQLITE_OK==rc && SQLITE_ROW==sqlite3_step(pIndexXInfo) ){ const char *zComma = zCols==0 ? "" : ", "; const char *zName = (const char*)sqlite3_column_text(pIndexXInfo, 0); const char *zColl = (const char*)sqlite3_column_text(pIndexXInfo, 1); zCols = idxAppendText(&rc, zCols, | >| | 16201621162216231624162516261629163016311632163316341635 | /* Formulate the query text */ sqlite3_bind_text(pIndexXInfo, 1, zIdx, -1, SQLITE_STATIC); while( SQLITE_OK==rc && SQLITE_ROW==sqlite3_step(pIndexXInfo) ){ const char *zComma = zCols==0 ? "" : ", "; const char *zName = (const char*)sqlite3_column_text(pIndexXInfo, 0); const char *zColl = (const char*)sqlite3_column_text(pIndexXInfo, 1); zCols = idxAppendText(&rc, zCols, ); zOrder = idxAppendText(&rc, zOrder, "%s%d", zComma, ++nCol); } sqlite3_reset(pIndexXInfo); if( rc==SQLITE_OK ){ if( p->iSample==100 ){ zQuery = sqlite3_mprintf( |
︙ | ︙ | |||
1753175417551756175717581759 | if( rc==SQLITE_OK ){ int nByte = sizeof(struct IdxRemCtx) + (sizeof(struct IdxRemSlot) * nMax); pCtx = (struct IdxRemCtx*)idxMalloc(&rc, nByte); } if( rc==SQLITE_OK ){ sqlite3 *dbrem = (p->iSample==100 ? p->db : p->dbv); | |||| | 17541755175617571758175917601763176417651768176917701771177217731774 | if( rc==SQLITE_OK ){ int nByte = sizeof(struct IdxRemCtx) + (sizeof(struct IdxRemSlot) * nMax); pCtx = (struct IdxRemCtx*)idxMalloc(&rc, nByte); } if( rc==SQLITE_OK ){ sqlite3 *dbrem = (p->iSample==100 ? p->db : p->dbv); ); } if( rc==SQLITE_OK ){ ); } if( rc==SQLITE_OK ){ pCtx->nSlot = nMax+1; rc = idxPrepareStmt(p->dbm, &pAllIndex, pzErr, zAllIndex); } |
︙ | ︙ | |||
18111812181318141815181618171818181918201821182218231824 | sqlite3_free(pCtx); } if( rc==SQLITE_OK ){ rc = sqlite3_exec(p->dbm, "ANALYZE sqlite_schema", 0, 0, 0); } sqlite3_exec(p->db, "DROP TABLE IF EXISTS temp."UNIQUE_TABLE_NAME,0,0,0); return rc;}/*** Define and possibly pretend to use a useless collation sequence.** This pretense allows expert to accept SQL using custom collations. | >>> | 18121813181418151816181718181822182318241825182618271828 | sqlite3_free(pCtx); } if( rc==SQLITE_OK ){ rc = sqlite3_exec(p->dbm, "ANALYZE sqlite_schema", 0, 0, 0); } sqlite3_exec(p->db, "DROP TABLE IF EXISTS temp."UNIQUE_TABLE_NAME,0,0,0); return rc;}/*** Define and possibly pretend to use a useless collation sequence.** This pretense allows expert to accept SQL using custom collations. |
︙ | ︙ |
Modified ext/fts3/fts3_snippet.cfrom [610328fe]to [c38117a2].
︙ | ︙ | |||
394395396397398399400401402403404405406407 | iEnd = pPhrase->iHead; } } if( iEnd==0x7FFFFFFF ){ return 1; } pIter->iCurrent = iStart = iEnd - pIter->nSnippet + 1; for(i=0; i<pIter->nPhrase; i++){ SnippetPhrase *pPhrase = &pIter->aPhrase[i]; fts3SnippetAdvance(&pPhrase->pHead, &pPhrase->iHead, iEnd+1); fts3SnippetAdvance(&pPhrase->pTail, &pPhrase->iTail, iStart); } } | > | 394395396397398399400402403404405406407408 | iEnd = pPhrase->iHead; } } if( iEnd==0x7FFFFFFF ){ return 1; } pIter->iCurrent = iStart = iEnd - pIter->nSnippet + 1; for(i=0; i<pIter->nPhrase; i++){ SnippetPhrase *pPhrase = &pIter->aPhrase[i]; fts3SnippetAdvance(&pPhrase->pHead, &pPhrase->iHead, iEnd+1); fts3SnippetAdvance(&pPhrase->pTail, &pPhrase->iTail, iStart); } } |
︙ | ︙ |
Modified ext/fts5/fts5_expr.cfrom [c7336d5f]to [4b7734db].
︙ | ︙ | |||
50515253545556 | int bDesc; /* Iterate in descending rowid order */ int nPhrase; /* Number of phrases in expression */ Fts5ExprPhrase **apExprPhrase; /* Pointers to phrase objects */};/*** eType: | |>>>> | 5051525354555658596061626368697071727374 | int bDesc; /* Iterate in descending rowid order */ int nPhrase; /* Number of phrases in expression */ Fts5ExprPhrase **apExprPhrase; /* Pointers to phrase objects */};/*** eType:**** FTS5_AND (nChild, apChild valid)** FTS5_OR (nChild, apChild valid)** FTS5_NOT (nChild, apChild valid)** FTS5_STRING (pNear valid)** FTS5_TERM (pNear valid)**** iHeight:** Distance from this node to furthest leaf. This is always 0 for nodes** of type FTS5_STRING and FTS5_TERM. For all other nodes it is one ** greater than the largest child value.*/struct Fts5ExprNode { |
︙ | ︙ | |||
22592260226122622263226422652266226722682269227022712272 | default: assert( pNode->eType==FTS5_NOT ); { pNode->xNext = fts5ExprNodeNext_NOT; break; }; }}static void fts5ExprAddChildren(Fts5ExprNode *p, Fts5ExprNode *pSub){ int ii = p->nChild; if( p->eType!=FTS5_NOT && pSub->eType==p->eType ){ int nByte = sizeof(Fts5ExprNode*) * pSub->nChild; memcpy(&p->apChild[p->nChild], pSub->apChild, nByte); p->nChild += pSub->nChild; sqlite3_free(pSub); | >>> | 22632264226522662267226822692273227422752276227722782279 | default: assert( pNode->eType==FTS5_NOT ); { pNode->xNext = fts5ExprNodeNext_NOT; break; }; }}static void fts5ExprAddChildren(Fts5ExprNode *p, Fts5ExprNode *pSub){ int ii = p->nChild; if( p->eType!=FTS5_NOT && pSub->eType==p->eType ){ int nByte = sizeof(Fts5ExprNode*) * pSub->nChild; memcpy(&p->apChild[p->nChild], pSub->apChild, nByte); p->nChild += pSub->nChild; sqlite3_free(pSub); |
︙ | ︙ | |||
2403240424052406240724082409 | || pPhrase->nTerm>1 || (pPhrase->nTerm>0 && pPhrase->aTerm[0].bFirst) ){ sqlite3Fts5ParseError(pParse, "fts5: %s queries are not supported (detail!=full)", pNear->nPhrase==1 ? "phrase": "NEAR" ); | |>>>>| | 2410241124122413241424152416241824212422242324252426242824292430243124322434243524362437243824392440 | || pPhrase->nTerm>1 || (pPhrase->nTerm>0 && pPhrase->aTerm[0].bFirst) ){ sqlite3Fts5ParseError(pParse, "fts5: %s queries are not supported (detail!=full)", pNear->nPhrase==1 ? "phrase": "NEAR" ); pRet = 0; } } }else{ fts5ExprAddChildren(pRet, pLeft); fts5ExprAddChildren(pRet, pRight); if( pRet->iHeight>SQLITE_FTS5_MAX_EXPR_DEPTH ){ sqlite3Fts5ParseError(pParse, "fts5 expression tree is too large (maximum depth %d)", SQLITE_FTS5_MAX_EXPR_DEPTH ); pRet = 0; } } } } } |
︙ | ︙ | |||
24532454245524562457245824592460246124622463246424652466 | || pLeft->eType==FTS5_TERM || pLeft->eType==FTS5_EOF || pLeft->eType==FTS5_AND ); assert( pRight->eType==FTS5_STRING || pRight->eType==FTS5_TERM || pRight->eType==FTS5_EOF ); if( pLeft->eType==FTS5_AND ){ pPrev = pLeft->apChild[pLeft->nChild-1]; }else{ pPrev = pLeft; } | > | 24642465246624672468246924702472247324742475247624772478 | || pLeft->eType==FTS5_TERM || pLeft->eType==FTS5_EOF || pLeft->eType==FTS5_AND ); assert( pRight->eType==FTS5_STRING || pRight->eType==FTS5_TERM || pRight->eType==FTS5_EOF ); if( pLeft->eType==FTS5_AND ){ pPrev = pLeft->apChild[pLeft->nChild-1]; }else{ pPrev = pLeft; } |
︙ | ︙ | |||
31003101310231033104310531063107310831093110311131123113 | }}static int fts5ExprCheckPoslists(Fts5ExprNode *pNode, i64 iRowid){ pNode->iRowid = iRowid; pNode->bEof = 0; switch( pNode->eType ){ case FTS5_TERM: case FTS5_STRING: return (pNode->pNear->apPhrase[0]->poslist.n>0); case FTS5_AND: { int i; for(i=0; i<pNode->nChild; i++){ | > | 31123113311431153116311731183120312131223123312431253126 | }}static int fts5ExprCheckPoslists(Fts5ExprNode *pNode, i64 iRowid){ pNode->iRowid = iRowid; pNode->bEof = 0; switch( pNode->eType ){ case FTS5_TERM: case FTS5_STRING: return (pNode->pNear->apPhrase[0]->poslist.n>0); case FTS5_AND: { int i; for(i=0; i<pNode->nChild; i++){ |
︙ | ︙ |
Modified ext/fts5/fts5_main.cfrom [c4c3971b]to [3bef3f3d].
︙ | ︙ | |||
2232223322342235223622372238 | } } return pRet;}static void fts5ApiPhraseNext( | |<>>>>| | 2232223322342235223622372238224022412242224322442245224622472248224922542256225722582259226022612262 | } } return pRet;}static void fts5ApiPhraseNext( Fts5PhraseIter *pIter, int *piCol, int *piOff){ if( pIter->a>=pIter->b ){ *piCol = -1; *piOff = -1; }else{ int iVal; pIter->a += fts5GetVarint32(pIter->a, iVal); if( iVal==1 ){ pIter->a += fts5GetVarint32(pIter->a, iVal); *piOff = 0; pIter->a += fts5GetVarint32(pIter->a, iVal); } *piOff += (iVal-2); }} |
︙ | ︙ |
Modified ext/fts5/fts5_tokenize.cfrom [fa549307]to [63ebe905].
︙ | ︙ | |||
75767778798081 | p = sqlite3_malloc(sizeof(AsciiTokenizer)); if( p==0 ){ rc = SQLITE_NOMEM; }else{ int i; memset(p, 0, sizeof(AsciiTokenizer)); memcpy(p->aTokenChar, aAsciiTokenChar, sizeof(aAsciiTokenChar)); | |> | 7576777879808183848586878889909192949596979899100 | p = sqlite3_malloc(sizeof(AsciiTokenizer)); if( p==0 ){ rc = SQLITE_NOMEM; }else{ int i; memset(p, 0, sizeof(AsciiTokenizer)); memcpy(p->aTokenChar, aAsciiTokenChar, sizeof(aAsciiTokenChar)); const char *zArg = azArg[i+1]; if( 0==sqlite3_stricmp(azArg[i], "tokenchars") ){ fts5AsciiAddExceptions(p, zArg, 1); }else if( 0==sqlite3_stricmp(azArg[i], "separators") ){ fts5AsciiAddExceptions(p, zArg, 0); }else{ rc = SQLITE_ERROR; } } if( rc!=SQLITE_OK ){ fts5AsciiDelete((Fts5Tokenizer*)p); p = 0; } } } |
︙ | ︙ | |||
377378379380381382383 | p->nFold = 64; p->aFold = sqlite3_malloc64(p->nFold * sizeof(char)); if( p->aFold==0 ){ rc = SQLITE_NOMEM; } /* Search for a "categories" argument */ | |<| | 378379380381382383384386387388389390391392393395396397398399400401 | p->nFold = 64; p->aFold = sqlite3_malloc64(p->nFold * sizeof(char)); if( p->aFold==0 ){ rc = SQLITE_NOMEM; } /* Search for a "categories" argument */ if( 0==sqlite3_stricmp(azArg[i], "categories") ){ zCat = azArg[i+1]; } } if( rc==SQLITE_OK ){ rc = unicodeSetCategories(p, zCat); } const char *zArg = azArg[i+1]; if( 0==sqlite3_stricmp(azArg[i], "remove_diacritics") ){ if( (zArg[0]!='0' && zArg[0]!='1' && zArg[0]!='2') || zArg[1] ){ rc = SQLITE_ERROR; }else{ p->eRemoveDiacritic = (zArg[0] - '0'); assert( p->eRemoveDiacritic==FTS5_REMOVE_DIACRITICS_NONE |
︙ | ︙ | |||
412413414415416417418419420421422423424425 | }else if( 0==sqlite3_stricmp(azArg[i], "categories") ){ /* no-op */ }else{ rc = SQLITE_ERROR; } } }else{ rc = SQLITE_NOMEM; } if( rc!=SQLITE_OK ){ fts5UnicodeDelete((Fts5Tokenizer*)p); p = 0; | > | 412413414415416417418420421422423424425426 | }else if( 0==sqlite3_stricmp(azArg[i], "categories") ){ /* no-op */ }else{ rc = SQLITE_ERROR; } } }else{ rc = SQLITE_NOMEM; } if( rc!=SQLITE_OK ){ fts5UnicodeDelete((Fts5Tokenizer*)p); p = 0; |
︙ | ︙ | |||
1294129512961297129812991300 | UNUSED_PARAM(pUnused); if( pNew==0 ){ rc = SQLITE_NOMEM; }else{ int i; pNew->bFold = 1; pNew->iFoldParam = 0; | |> | 1295129612971298129913001301130313041305130613071308130913101311131213131314131513161317131813191321132213231324132513261327 | UNUSED_PARAM(pUnused); if( pNew==0 ){ rc = SQLITE_NOMEM; }else{ int i; pNew->bFold = 1; pNew->iFoldParam = 0; const char *zArg = azArg[i+1]; if( 0==sqlite3_stricmp(azArg[i], "case_sensitive") ){ if( (zArg[0]!='0' && zArg[0]!='1') || zArg[1] ){ rc = SQLITE_ERROR; }else{ pNew->bFold = (zArg[0]=='0'); } }else if( 0==sqlite3_stricmp(azArg[i], "remove_diacritics") ){ if( (zArg[0]!='0' && zArg[0]!='1' && zArg[0]!='2') || zArg[1] ){ rc = SQLITE_ERROR; }else{ pNew->iFoldParam = (zArg[0]!='0') ? 2 : 0; } }else{ rc = SQLITE_ERROR; } } if( pNew->iFoldParam!=0 && pNew->bFold==0 ){ rc = SQLITE_ERROR; } if( rc!=SQLITE_OK ){ fts5TriDelete((Fts5Tokenizer*)pNew); |
︙ | ︙ |
Modified ext/fts5/test/fts5corrupt3.testfrom [3cbb18b8]to [b5f35d72].
︙ | ︙ | |||
8954895589568957895889598960 | CREATE VIRTUAL TABLE t3 USING fts5vocab('t1'(),'col' );} {/*malformed database schema*/}do_catchsql_test 61.2 { SELECT * FROM t3 ORDER BY rowid;} {/*malformed database schema*/} | < | 89548955895689578958895989608961896289638964896589668967 | CREATE VIRTUAL TABLE t3 USING fts5vocab('t1'(),'col' );} {/*malformed database schema*/}do_catchsql_test 61.2 { SELECT * FROM t3 ORDER BY rowid;} {/*malformed database schema*/}#-------------------------------------------------------------------------do_test 62.0 { sqlite3 db {} db deserialize [decode_hexdb {.open --hexdb| size 28672 pagesize 4096 filename crash-44942694542e1e.db| page 1 offset 0 |
︙ | ︙ | |||
1076410765107661076710768107691077010771107721077310774107751077610777 | * FROM ttt('e* NOT ee*e* NOT ee* NOT ee*e* NOT e*') ;} {1 {database disk image is malformed}}#-------------------------------------------------------------------------reset_dbdo_test 74.0 { sqlite3 db {} db deserialize [decode_hexdb {| size 106496 pagesize 4096 filename x.db| page 1 offset 0| 0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 SQLite format 3.| 16: 10 00 01 01 00 40 20 20 00 00 00 01 00 00 00 1a .....@ ........| 32: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 04 ................| 80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 ................ | > | 1076310764107651076610767107681076910771107721077310774107751077610777 | * FROM ttt('e* NOT ee*e* NOT ee* NOT ee*e* NOT e*') ;} {1 {database disk image is malformed}}#-------------------------------------------------------------------------reset_dbdo_test 74.0 { sqlite3 db {} db deserialize [decode_hexdb {| size 106496 pagesize 4096 filename x.db| page 1 offset 0| 0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 SQLite format 3.| 16: 10 00 01 01 00 40 20 20 00 00 00 01 00 00 00 1a .....@ ........| 32: 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 04 ................| 80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 01 ................ |
︙ | ︙ | |||
14583145841458514586145871458814589 | | 4032: b8 64 0a 02 34 02 03 b2 9a 9e 05 04 83 16 02 04 .d..4...........| 4048: b4 a7 93 36 06 04 83 7d 03 02 ba 9c 02 04 83 07 ...6............| 4064: 04 09 09 0a 0a 0c 0b 08 09 09 08 09 08 09 0a 0a ................| 4080: 0a 09 0a 0a 08 0a 08 09 0a 09 09 09 09 09 09 0a ................| end x.db}]} {} | ||>>>>> | 1458314584145851458614587145881458914592145931459814599146001460114603146041460514606146071460814609 | | 4032: b8 64 0a 02 34 02 03 b2 9a 9e 05 04 83 16 02 04 .d..4...........| 4048: b4 a7 93 36 06 04 83 7d 03 02 ba 9c 02 04 83 07 ...6............| 4064: 04 09 09 0a 0a 0c 0b 08 09 09 08 09 08 09 0a 0a ................| 4080: 0a 09 0a 0a 08 0a 08 09 0a 09 09 09 09 09 09 0a ................| end x.db}]} {}} {1 {unable to use function matchinfo in the requested context}}#-------------------------------------------------------------------------reset_dbdo_test 75.0 { sqlite3 db {} db deserialize [decode_hexdb {| size 32768 pagesize 4096 filename crash-033d665d5caa8d.db| page 1 offset 0| 0: 53 51 4c 69 74 65 20 66 6f 72 6d 61 74 20 33 00 SQLite format 3.| 16: 10 00 01 01 00 40 20 20 00 00 00 00 00 00 00 00 .....@ ........| 96: 00 00 00 00 0d 0f c7 00 07 0d 92 00 0f 8d 0f 36 ...............6| 112: 0e cb 0e 6b 0e 0e 0d b6 0d 92 00 00 00 00 00 00 ...k............ |
︙ | ︙ | |||
14787147881478914790147911479214793 | | page 8 offset 28672| 4048: 00 00 00 00 00 00 5d 03 02 2b 69 6e 74 00 00 00 ......]..+int...| end crash-033d665d5caa8d.db}]} {}do_catchsql_test 75.1 { SELECT rowid, quote(matchinfo(t1,'pcxybs')) FROM t1 WHERE t1 MATCH 'e*'; | | | 1479214793147941479514796147971479814800148011480214803148041480514806 | | page 8 offset 28672| 4048: 00 00 00 00 00 00 5d 03 02 2b 69 6e 74 00 00 00 ......]..+int...| end crash-033d665d5caa8d.db}]} {}do_catchsql_test 75.1 { SELECT rowid, quote(matchinfo(t1,'pcxybs')) FROM t1 WHERE t1 MATCH 'e*';#-------------------------------------------------------------------------reset_dbdo_test 76.0 { sqlite3 db {} db deserialize [decode_hexdb {| size 40960 pagesize 4096 filename crash-03b68c01d30713.db |
︙ | ︙ |
Added ext/fts5/test/fts5expr.test version [7e1b2d07].
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
Modified ext/fts5/test/fts5misc.testfrom [b88aa28f]to [b1682a40].
︙ | ︙ | |||
1617181920212223242526272829 | set testprefix fts5misc# If SQLITE_ENABLE_FTS5 is not defined, omit this file.ifcapable !fts5 { finish_test return}do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5(a);}do_catchsql_test 1.1.1 { SELECT highlight(t1, 4, '<b>', '</b>') FROM t1('*'); | >> | 1617181920212225262728293031 | set testprefix fts5misc# If SQLITE_ENABLE_FTS5 is not defined, omit this file.ifcapable !fts5 { finish_test return}do_execsql_test 1.0 { CREATE VIRTUAL TABLE t1 USING fts5(a);}do_catchsql_test 1.1.1 { SELECT highlight(t1, 4, '<b>', '</b>') FROM t1('*'); |
︙ | ︙ | |||
561562563564565566567568569570 | do_execsql_test 20.4 { SELECT rowid FROM x1 WHERE x1 MATCH 'a' OR (x1 MATCH 'y' AND x1 MATCH 'd');} {1 4 3}do_execsql_test 20.5 { SELECT rowid FROM x1 WHERE x1 MATCH 'z' OR (x1 MATCH 'a' AND x1 MATCH 'd');} {3 1}finish_test | >>>>>>>>>>>>>>>>>>>> | 563564565566567568569590591592 | do_execsql_test 20.4 { SELECT rowid FROM x1 WHERE x1 MATCH 'a' OR (x1 MATCH 'y' AND x1 MATCH 'd');} {1 4 3}do_execsql_test 20.5 { SELECT rowid FROM x1 WHERE x1 MATCH 'z' OR (x1 MATCH 'a' AND x1 MATCH 'd');} {3 1}finish_test |
Modified ext/fts5/test/fts5tokenizer2.testfrom [9c1ad8ef]to [ddb8b10f].
︙ | ︙ | |||
80818283848586878889 | do_execsql_test 1.6 { SELECT highlight(t1, 0, '>', '<') FROM t1('mess');} {AAdontBB>mess<}do_execsql_test 1.7 { SELECT highlight(t1, 0, '>', '<') FROM t1('BB mess');} {AAdont>BBmess<}finish_test | >>>>>>>>>>>>>>>>>>>> | 80818283848586107108109 | do_execsql_test 1.6 { SELECT highlight(t1, 0, '>', '<') FROM t1('mess');} {AAdontBB>mess<}do_execsql_test 1.7 { SELECT highlight(t1, 0, '>', '<') FROM t1('BB mess');} {AAdont>BBmess<}finish_test |
Modified ext/fts5/test/fts5trigram.testfrom [6c4e3786]to [be914555].
︙ | ︙ | |||
6566676869707172737475767778 | #-------------------------------------------------------------------------reset_dbdo_execsql_test 2.0 { CREATE VIRTUAL TABLE t1 USING fts5(y, tokenize="trigram case_sensitive 1"); INSERT INTO t1 VALUES('abcdefghijklm'); INSERT INTO t1 VALUES('กรุงเทพมหานคร');}foreach {tn s res} { 1 abc "(abc)defghijklm" 2 defgh "abc(defgh)ijklm" 3 abcdefghijklm "(abcdefghijklm)" 4 กรุ "(กรุ)งเทพมหานคร" 5 งเทพมห "กรุ(งเทพมห)านคร" | >>> | 6566676869707175767778798081 | #-------------------------------------------------------------------------reset_dbdo_execsql_test 2.0 { CREATE VIRTUAL TABLE t1 USING fts5(y, tokenize="trigram case_sensitive 1"); INSERT INTO t1 VALUES('abcdefghijklm'); INSERT INTO t1 VALUES('กรุงเทพมหานคร');}foreach {tn s res} { 1 abc "(abc)defghijklm" 2 defgh "abc(defgh)ijklm" 3 abcdefghijklm "(abcdefghijklm)" 4 กรุ "(กรุ)งเทพมหานคร" 5 งเทพมห "กรุ(งเทพมห)านคร" |
︙ | ︙ | |||
202203204205206207208 | do_execsql_test 7.0 { CREATE VIRTUAL TABLE f USING FTS5(filename, tokenize="trigram"); INSERT INTO f (rowid, filename) VALUES (10, "giraffe.png"), (20, "жираф.png"), (30, "cat.png"), (40, "кот.png"), | | | 205206207208209210211213214215216217218219 | do_execsql_test 7.0 { CREATE VIRTUAL TABLE f USING FTS5(filename, tokenize="trigram"); INSERT INTO f (rowid, filename) VALUES (10, "giraffe.png"), (20, "жираф.png"), (30, "cat.png"), (40, "кот.png"), }do_execsql_test 7.1 { SELECT rowid FROM f WHERE +filename GLOB '*ир*';} {20}do_execsql_test 7.2 { SELECT rowid FROM f WHERE filename GLOB '*ир*';} {20} |
︙ | ︙ |
Modified ext/fts5/test/fts5trigram2.testfrom [c91f0a94]to [6fde9de7].
︙ | ︙ | |||
1718192021222324252627282930 | set ::testprefix fts5trigram2do_execsql_test 1.0 " CREATE VIRTUAL TABLE t1 USING fts5(y, tokenize='trigram remove_diacritics 1'); INSERT INTO t1 VALUES('abc\u0303defghijklm'); INSERT INTO t1 VALUES('a\u0303b\u0303c\u0303defghijklm');"do_execsql_test 1.1 { SELECT highlight(t1, 0, '(', ')') FROM t1('abc');} [list \ "(abc\u0303)defghijklm" \ "(a\u0303b\u0303c\u0303)defghijklm" \] | >>> | 1718192021222327282930313233 | set ::testprefix fts5trigram2do_execsql_test 1.0 " CREATE VIRTUAL TABLE t1 USING fts5(y, tokenize='trigram remove_diacritics 1'); INSERT INTO t1 VALUES('abc\u0303defghijklm'); INSERT INTO t1 VALUES('a\u0303b\u0303c\u0303defghijklm');"do_execsql_test 1.1 { SELECT highlight(t1, 0, '(', ')') FROM t1('abc');} [list \ "(abc\u0303)defghijklm" \ "(a\u0303b\u0303c\u0303)defghijklm" \] |
︙ | ︙ | |||
112113114115116117118119120 | do_eqp_test 4.1 { SELECT rowid FROM t4 WHERE z LIKE '%abc%'} {VIRTUAL TABLE INDEX 0:L0}do_execsql_test 4.2 { SELECT rowid FROM t4 WHERE z LIKE '%abc%'} {1}finish_test | >>>>>>>>>>>>>> | 115116117118119120121122137 | do_eqp_test 4.1 { SELECT rowid FROM t4 WHERE z LIKE '%abc%'} {VIRTUAL TABLE INDEX 0:L0}do_execsql_test 4.2 { SELECT rowid FROM t4 WHERE z LIKE '%abc%'} {1}finish_test |
Modified ext/fts5/test/fts5unicode2.testfrom [3ff7ea5d]to [a5c38179].
︙ | ︙ | |||
466467468469470471472 | do_execsql_test 8.2.2 { SELECT rowid FROM t4 WHERE t4 MATCH 'o' ORDER BY rowid ASC;} {1 3}do_execsql_test 8.2.3 { SELECT rowid FROM t4 WHERE t4 MATCH 'a' ORDER BY rowid ASC;} {2 4} | <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< | 466467468469470471472473 | do_execsql_test 8.2.2 { SELECT rowid FROM t4 WHERE t4 MATCH 'o' ORDER BY rowid ASC;} {1 3}do_execsql_test 8.2.3 { SELECT rowid FROM t4 WHERE t4 MATCH 'a' ORDER BY rowid ASC;} {2 4}finish_test |
Modified ext/misc/shathree.cfrom [543af7ce]to [1821d90a].
︙ | ︙ | |||
11121314151617 | ********************************************************************************** This SQLite extension implements functions that compute SHA3 hashes** in the way described by the (U.S.) NIST FIPS 202 SHA-3 Standard.** Two SQL functions are implemented:**** sha3(X,SIZE) | >||>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> | 11121314151617202127333435363738101102103104105106107 | ********************************************************************************** This SQLite extension implements functions that compute SHA3 hashes** in the way described by the (U.S.) NIST FIPS 202 SHA-3 Standard.** Two SQL functions are implemented:**** sha3(X,SIZE)**** The sha3(X) function computes the SHA3 hash of the input X, or NULL if**** The sha3_query(Y) function evaluates all queries in the SQL statements of Y** and returns a hash of their results.**** The SIZE argument is optional. If omitted, the SHA3-256 hash algorithm** is used. If SIZE is included it must be one of the integers 224, 256,** 384, or 512, to determine SHA3 hash variant that is computed.*/#include "sqlite3ext.h"SQLITE_EXTENSION_INIT1#include <assert.h>#include <string.h>#include <stdarg.h> |
︙ | ︙ | |||
7172737475767778798081828384 | union { u64 s[25]; /* Keccak state. 5x5 lines of 64 bits each */ unsigned char x[1600]; /* ... or 1600 bytes */ } u; unsigned nRate; /* Bytes of input accepted per Keccak iteration */ unsigned nLoaded; /* Input bytes loaded into u.x[] so far this cycle */ unsigned ixMask; /* Insert next input into u.x[nLoaded^ixMask]. */};/*** A single step of the Keccak mixing function for a 1600-bit state*/static void KeccakF1600Step(SHA3Context *p){ int i; | > | 143144145146147148149151152153154155156157 | union { u64 s[25]; /* Keccak state. 5x5 lines of 64 bits each */ unsigned char x[1600]; /* ... or 1600 bytes */ } u; unsigned nRate; /* Bytes of input accepted per Keccak iteration */ unsigned nLoaded; /* Input bytes loaded into u.x[] so far this cycle */ unsigned ixMask; /* Insert next input into u.x[nLoaded^ixMask]. */};/*** A single step of the Keccak mixing function for a 1600-bit state*/static void KeccakF1600Step(SHA3Context *p){ int i; |
︙ | ︙ | |||
400401402403404405406407408409410411412413 | /*** Initialize a new hash. iSize determines the size of the hash** in bits and should be one of 224, 256, 384, or 512. Or iSize** can be zero to use the default hash size of 256 bits.*/static void SHA3Init(SHA3Context *p, int iSize){ memset(p, 0, sizeof(*p)); if( iSize>=128 && iSize<=512 ){ p->nRate = (1600 - ((iSize + 31)&~31)*2)/8; }else{ p->nRate = (1600 - 2*256)/8; }#if SHA3_BYTEORDER==1234 /* Known to be little-endian at compile-time. No-op */ | > | 473474475476477478479481482483484485486487 | /*** Initialize a new hash. iSize determines the size of the hash** in bits and should be one of 224, 256, 384, or 512. Or iSize** can be zero to use the default hash size of 256 bits.*/static void SHA3Init(SHA3Context *p, int iSize){ memset(p, 0, sizeof(*p)); if( iSize>=128 && iSize<=512 ){ p->nRate = (1600 - ((iSize + 31)&~31)*2)/8; }else{ p->nRate = (1600 - 2*256)/8; }#if SHA3_BYTEORDER==1234 /* Known to be little-endian at compile-time. No-op */ |
︙ | ︙ | |||
542543544545546547548549550551552553554555 | char zBuf[50]; va_start(ap, zFormat); sqlite3_vsnprintf(sizeof(zBuf),zBuf,zFormat,ap); va_end(ap); n = (int)strlen(zBuf); SHA3Update(p, (unsigned char*)zBuf, n);}/*** Implementation of the sha3_query(SQL,SIZE) function.**** This function compiles and runs the SQL statement(s) given in the** argument. The results are hashed using a SIZE-bit SHA3. The default** size is 256. | >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> | 616617618619620621622677678679680681682683 | char zBuf[50]; va_start(ap, zFormat); sqlite3_vsnprintf(sizeof(zBuf),zBuf,zFormat,ap); va_end(ap); n = (int)strlen(zBuf); SHA3Update(p, (unsigned char*)zBuf, n);}/*** Implementation of the sha3_query(SQL,SIZE) function.**** This function compiles and runs the SQL statement(s) given in the** argument. The results are hashed using a SIZE-bit SHA3. The default** size is 256. |
︙ | ︙ | |||
632633634635636637638 | SHA3Update(&cx,(unsigned char*)z,n); } /* Compute a hash over the result of the query */ while( SQLITE_ROW==sqlite3_step(pStmt) ){ SHA3Update(&cx,(const unsigned char*)"R",1); for(i=0; i<nCol; i++){ | |<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> | 760761762763764765766768769770771772773812813814815816817818 | SHA3Update(&cx,(unsigned char*)z,n); } /* Compute a hash over the result of the query */ while( SQLITE_ROW==sqlite3_step(pStmt) ){ SHA3Update(&cx,(const unsigned char*)"R",1); for(i=0; i<nCol; i++){ } } sqlite3_finalize(pStmt); } sqlite3_result_blob(context, SHA3Final(&cx), iSize/8, SQLITE_TRANSIENT);}#ifdef _WIN32__declspec(dllexport)#endifint sqlite3_shathree_init( sqlite3 *db, |
︙ | ︙ | |||
707708709710711712713714715716717718719720721722723724725 | SQLITE_UTF8 | SQLITE_INNOCUOUS | SQLITE_DETERMINISTIC, 0, sha3Func, 0, 0); if( rc==SQLITE_OK ){ rc = sqlite3_create_function(db, "sha3", 2, SQLITE_UTF8 | SQLITE_INNOCUOUS | SQLITE_DETERMINISTIC, 0, sha3Func, 0, 0); } if( rc==SQLITE_OK ){ rc = sqlite3_create_function(db, "sha3_query", 1, SQLITE_UTF8 | SQLITE_DIRECTONLY, 0, sha3QueryFunc, 0, 0); } if( rc==SQLITE_OK ){ rc = sqlite3_create_function(db, "sha3_query", 2, SQLITE_UTF8 | SQLITE_DIRECTONLY, 0, sha3QueryFunc, 0, 0); } return rc;} | >>>>>>>>>> | 826827828829830831832843844845846847848849850851852853854 | SQLITE_UTF8 | SQLITE_INNOCUOUS | SQLITE_DETERMINISTIC, 0, sha3Func, 0, 0); if( rc==SQLITE_OK ){ rc = sqlite3_create_function(db, "sha3", 2, SQLITE_UTF8 | SQLITE_INNOCUOUS | SQLITE_DETERMINISTIC, 0, sha3Func, 0, 0); } if( rc==SQLITE_OK ){ rc = sqlite3_create_function(db, "sha3_query", 1, SQLITE_UTF8 | SQLITE_DIRECTONLY, 0, sha3QueryFunc, 0, 0); } if( rc==SQLITE_OK ){ rc = sqlite3_create_function(db, "sha3_query", 2, SQLITE_UTF8 | SQLITE_DIRECTONLY, 0, sha3QueryFunc, 0, 0); } return rc;} |
Modified ext/recover/dbdata.cfrom [a22ecd68]to [5295f4f9].
︙ | ︙ | |||
675676677678679680681682683684685686687688 | }else{ /* Allocate space for payload. And a bit more to catch small buffer ** overruns caused by attempting to read a varint or similar from ** near the end of a corrupt record. */ rc = dbdataBufferSize(&pCsr->rec, nPayload+DBDATA_PADDING_BYTES); if( rc!=SQLITE_OK ) return rc; assert( nPayload!=0 ); /* Load the nLocal bytes of payload */ memcpy(pCsr->rec.aBuf, &pCsr->aPage[iOff], nLocal); iOff += nLocal; /* Load content from overflow pages */ | > | 675676677678679680681683684685686687688689 | }else{ /* Allocate space for payload. And a bit more to catch small buffer ** overruns caused by attempting to read a varint or similar from ** near the end of a corrupt record. */ rc = dbdataBufferSize(&pCsr->rec, nPayload+DBDATA_PADDING_BYTES); if( rc!=SQLITE_OK ) return rc; assert( nPayload!=0 ); /* Load the nLocal bytes of payload */ memcpy(pCsr->rec.aBuf, &pCsr->aPage[iOff], nLocal); iOff += nLocal; /* Load content from overflow pages */ |
︙ | ︙ |
Modified ext/recover/sqlite3recover.cfrom [65ef0f56]to [2dcf6b56].
︙ | ︙ | |||
359360361362363364365 | const char *zFmt, ...){ char *z = 0; va_list ap; va_start(ap, zFmt); if( zFmt ){ z = sqlite3_vmprintf(zFmt, ap); | <> | 359360361362363364365366368369370371372373374 | const char *zFmt, ...){ char *z = 0; va_list ap; va_start(ap, zFmt); if( zFmt ){ z = sqlite3_vmprintf(zFmt, ap); } sqlite3_free(p->zErrMsg); p->zErrMsg = z; p->errCode = errCode; return errCode;} |
︙ | ︙ |
Modified src/alter.cfrom [e1b6782b]to [bb663fdd].
︙ | ︙ | |||
1316131713181319132013211322 | pParse->pTriggerTab = sqlite3FindTable(db, pNew->table, db->aDb[sqlite3SchemaToIndex(db, pNew->pTabSchema)].zDbSName ); pParse->eTriggerOp = pNew->op; /* ALWAYS() because if the table of the trigger does not exist, the ** error would have been hit before this point */ if( ALWAYS(pParse->pTriggerTab) ){ | | | 13161317131813191320132113221324132513261327132813291330 | pParse->pTriggerTab = sqlite3FindTable(db, pNew->table, db->aDb[sqlite3SchemaToIndex(db, pNew->pTabSchema)].zDbSName ); pParse->eTriggerOp = pNew->op; /* ALWAYS() because if the table of the trigger does not exist, the ** error would have been hit before this point */ if( ALWAYS(pParse->pTriggerTab) ){ } /* Resolve symbols in WHEN clause */ if( rc==SQLITE_OK && pNew->pWhen ){ rc = sqlite3ResolveExprNames(&sNC, pNew->pWhen); } |
︙ | ︙ |
Modified src/analyze.cfrom [5c4e2bfd]to [30bf40ec].
︙ | ︙ | |||
1793179417951796179717981799 | rc = sqlite3_prepare(db, zSql, -1, &pStmt, 0); sqlite3DbFree(db, zSql); if( rc ) return rc; while( sqlite3_step(pStmt)==SQLITE_ROW ){ int nIdxCol = 1; /* Number of columns in stat4 records */ | ||||||>|>>| | 17931794179517961797179817991807180818091810181118121813181418151816181718181819182018211822182318241825182718281829183018311832183318341838183918401841184218431844 | rc = sqlite3_prepare(db, zSql, -1, &pStmt, 0); sqlite3DbFree(db, zSql); if( rc ) return rc; while( sqlite3_step(pStmt)==SQLITE_ROW ){ int nIdxCol = 1; /* Number of columns in stat4 records */ zIndex = (char *)sqlite3_column_text(pStmt, 0); if( zIndex==0 ) continue; nSample = sqlite3_column_int(pStmt, 1); pIdx = findIndexOrPrimaryKey(db, zIndex, zDb); assert( pIdx==0 || pIdx->nSample==0 ); if( pIdx==0 ) continue; if( pIdx->aSample!=0 ){ /* The same index appears in sqlite_stat4 under multiple names */ continue; } assert( !HasRowid(pIdx->pTable) || pIdx->nColumn==pIdx->nKeyCol+1 ); if( !HasRowid(pIdx->pTable) && IsPrimaryKeyIndex(pIdx) ){ nIdxCol = pIdx->nKeyCol; }else{ nIdxCol = pIdx->nColumn; } pIdx->nSampleCol = nIdxCol; pIdx->mxSample = nSample; nByte += sizeof(tRowcnt) * nIdxCol * 3 * nSample; nByte += nIdxCol * sizeof(tRowcnt); /* Space for Index.aAvgEq[] */ pIdx->aSample = sqlite3DbMallocZero(db, nByte); if( pIdx->aSample==0 ){ sqlite3_finalize(pStmt); return SQLITE_NOMEM_BKPT; } assert( EIGHT_BYTE_ALIGNMENT( pSpace ) ); pIdx->aAvgEq = pSpace; pSpace += nIdxCol; pIdx->pTable->tabFlags |= TF_HasStat4; for(i=0; i<nSample; i++){ pIdx->aSample[i].anEq = pSpace; pSpace += nIdxCol; pIdx->aSample[i].anLt = pSpace; pSpace += nIdxCol; pIdx->aSample[i].anDLt = pSpace; pSpace += nIdxCol; |
︙ | ︙ |
Modified src/insert.cfrom [4bd7c7e5]to [8ff11e9e].
︙ | ︙ | |||
713714715716717718719720721722723724725726 | } if( pRet ){ SelectDest dest; pRet->pSrc->nSrc = 1; pRet->pPrior = pLeft->pPrior; pRet->op = pLeft->op; pLeft->pPrior = 0; pLeft->op = TK_SELECT; assert( pLeft->pNext==0 ); assert( pRet->pNext==0 ); p = &pRet->pSrc->a[0]; p->pSelect = pLeft; p->fg.viaCoroutine = 1; | > | 713714715716717718719721722723724725726727 | } if( pRet ){ SelectDest dest; pRet->pSrc->nSrc = 1; pRet->pPrior = pLeft->pPrior; pRet->op = pLeft->op; pLeft->pPrior = 0; pLeft->op = TK_SELECT; assert( pLeft->pNext==0 ); assert( pRet->pNext==0 ); p = &pRet->pSrc->a[0]; p->pSelect = pLeft; p->fg.viaCoroutine = 1; |
︙ | ︙ |
Modified src/parse.yfrom [041390db]to [be8e4f8d].
︙ | ︙ | |||
543544545546547548549 | if( pLoop->pOrderBy || pLoop->pLimit ){ sqlite3ErrorMsg(pParse,"%s clause should come after %s not before", pLoop->pOrderBy!=0 ? "ORDER BY" : "LIMIT", sqlite3SelectOpName(pNext->op)); break; } } | ||| | 543544545546547548549553554555556557558559 | if( pLoop->pOrderBy || pLoop->pLimit ){ sqlite3ErrorMsg(pParse,"%s clause should come after %s not before", pLoop->pOrderBy!=0 ? "ORDER BY" : "LIMIT", sqlite3SelectOpName(pNext->op)); break; } } ){ sqlite3ErrorMsg(pParse, "too many terms in compound SELECT"); } } } /* Attach a With object describing the WITH clause to a Select |
︙ | ︙ |
Modified src/resolve.cfrom [7e8d23ce]to [0aee8a2e].
︙ | ︙ | |||
215021512152215321542155215621572158215921602161216221632164 | return pNC->nNcErr>0 || w.pParse->nErr>0;}/*** Resolve all names for all expression in an expression list. This is** just like sqlite3ResolveExprNames() except that it works for an expression** list rather than a single expression.*/int sqlite3ResolveExprListNames( NameContext *pNC, /* Namespace to resolve expressions in. */ ExprList *pList /* The expression list to be analyzed. */){ int i; int savedHasAgg = 0; Walker w; | >>>|||| | 21502151215221532154215521562160216121622163216421652166216721692170217121722173217421752176217721782179218021812183218421852186218721882189219021912192219321942195219621972198220022012203220422052206220722082209 | return pNC->nNcErr>0 || w.pParse->nErr>0;}/*** Resolve all names for all expression in an expression list. This is** just like sqlite3ResolveExprNames() except that it works for an expression** list rather than a single expression.*/int sqlite3ResolveExprListNames( NameContext *pNC, /* Namespace to resolve expressions in. */ ExprList *pList /* The expression list to be analyzed. */){ int i; int savedHasAgg = 0; Walker w; w.pParse = pNC->pParse; w.xExprCallback = resolveExprStep; w.xSelectCallback = resolveSelectStep; w.xSelectCallback2 = 0; w.u.pNC = pNC; savedHasAgg = pNC->ncFlags & (NC_HasAgg|NC_MinMaxAgg|NC_HasWin|NC_OrderAgg); pNC->ncFlags &= ~(NC_HasAgg|NC_MinMaxAgg|NC_HasWin|NC_OrderAgg); for(i=0; i<pList->nExpr; i++){ Expr *pExpr = pList->a[i].pExpr; if( pExpr==0 ) continue;#if SQLITE_MAX_EXPR_DEPTH>0 w.pParse->nHeight += pExpr->nHeight; if( sqlite3ExprCheckHeight(w.pParse, w.pParse->nHeight) ){ }#endif sqlite3WalkExprNN(&w, pExpr);#if SQLITE_MAX_EXPR_DEPTH>0 w.pParse->nHeight -= pExpr->nHeight;#endif assert( EP_Agg==NC_HasAgg ); assert( EP_Win==NC_HasWin ); testcase( pNC->ncFlags & NC_HasAgg ); testcase( pNC->ncFlags & NC_HasWin ); if( pNC->ncFlags & (NC_HasAgg|NC_MinMaxAgg|NC_HasWin|NC_OrderAgg) ){ ExprSetProperty(pExpr, pNC->ncFlags & (NC_HasAgg|NC_HasWin) ); savedHasAgg |= pNC->ncFlags & (NC_HasAgg|NC_MinMaxAgg|NC_HasWin|NC_OrderAgg); pNC->ncFlags &= ~(NC_HasAgg|NC_MinMaxAgg|NC_HasWin|NC_OrderAgg); } } pNC->ncFlags |= savedHasAgg;}/*** Resolve all names in all expressions of a SELECT and in all** descendants of the SELECT, including compounds off of p->pPrior,** subqueries in expressions, and subqueries used as FROM clause** terms. |
︙ | ︙ |
Modified src/shell.c.infrom [44c02fd1]to [94571558].
︙ | ︙ | |||
35413542354335443545354635473548354935503551355235533554 | }else if( sqlite3_strlike("_NAN", zVar, 0)==0 ){ sqlite3_bind_double(pStmt, i, NAN);#endif#ifdef INFINITY }else if( sqlite3_strlike("_INF", zVar, 0)==0 ){ sqlite3_bind_double(pStmt, i, INFINITY);#endif }else{ sqlite3_bind_null(pStmt, i); } sqlite3_reset(pQ); } sqlite3_finalize(pQ);} | >>>>>>>> | 35413542354335443545354635473556355735583559356035613562 | }else if( sqlite3_strlike("_NAN", zVar, 0)==0 ){ sqlite3_bind_double(pStmt, i, NAN);#endif#ifdef INFINITY }else if( sqlite3_strlike("_INF", zVar, 0)==0 ){ sqlite3_bind_double(pStmt, i, INFINITY);#endif }else{ sqlite3_bind_null(pStmt, i); } sqlite3_reset(pQ); } sqlite3_finalize(pQ);} |
︙ | ︙ | |||
11636116371163811639116401164111642 | int rc = SQLITE_OK; if( p->eRestoreState<7 ){ switch( p->eRestoreState ){ case 0: { const char *zExpect = "PRAGMA foreign_keys=OFF;"; assert( strlen(zExpect)==24 ); | |>>> | 1164411645116461164711648116491165011655116561165711658116591166011661 | int rc = SQLITE_OK; if( p->eRestoreState<7 ){ switch( p->eRestoreState ){ case 0: { const char *zExpect = "PRAGMA foreign_keys=OFF;"; assert( strlen(zExpect)==24 ); p->eRestoreState = 1; }else{ p->eRestoreState = 7; } break; }; |
︙ | ︙ |
Modified src/sqliteInt.hfrom [2e09aae8]to [03ecb10c].
︙ | ︙ | |||
19481949195019511952195319541955195619571958195919601961 | #define SQLITE_ReleaseReg 0x00400000 /* Use OP_ReleaseReg for testing */#define SQLITE_FlttnUnionAll 0x00800000 /* Disable the UNION ALL flattener */ /* TH3 expects this value ^^^^^^^^^^ See flatten04.test */#define SQLITE_IndexedExpr 0x01000000 /* Pull exprs from index when able */#define SQLITE_Coroutines 0x02000000 /* Co-routines for subqueries */#define SQLITE_NullUnusedCols 0x04000000 /* NULL unused columns in subqueries */#define SQLITE_OnePass 0x08000000 /* Single-pass DELETE and UPDATE */#define SQLITE_AllOpts 0xffffffff /* All optimizations *//*** Macros for testing whether or not optimizations are enabled or disabled.*/#define OptimizationDisabled(db, mask) (((db)->dbOptFlags&(mask))!=0)#define OptimizationEnabled(db, mask) (((db)->dbOptFlags&(mask))==0) | > | 19481949195019511952195319541956195719581959196019611962 | #define SQLITE_ReleaseReg 0x00400000 /* Use OP_ReleaseReg for testing */#define SQLITE_FlttnUnionAll 0x00800000 /* Disable the UNION ALL flattener */ /* TH3 expects this value ^^^^^^^^^^ See flatten04.test */#define SQLITE_IndexedExpr 0x01000000 /* Pull exprs from index when able */#define SQLITE_Coroutines 0x02000000 /* Co-routines for subqueries */#define SQLITE_NullUnusedCols 0x04000000 /* NULL unused columns in subqueries */#define SQLITE_OnePass 0x08000000 /* Single-pass DELETE and UPDATE */#define SQLITE_AllOpts 0xffffffff /* All optimizations *//*** Macros for testing whether or not optimizations are enabled or disabled.*/#define OptimizationDisabled(db, mask) (((db)->dbOptFlags&(mask))!=0)#define OptimizationEnabled(db, mask) (((db)->dbOptFlags&(mask))==0) |
︙ | ︙ | |||
29352936293729382939294029412942294329442945294629472948294929502951 | /*** Macros to compute aCol[] and aFunc[] register numbers.**** These macros should not be used prior to the call to** assignAggregateRegisters() that computes the value of pAggInfo->iFirstReg.** The assert()s that are part of this macro verify that constraint.*/#define AggInfoColumnReg(A,I) (assert((A)->iFirstReg),(A)->iFirstReg+(I))#define AggInfoFuncReg(A,I) \ (assert((A)->iFirstReg),(A)->iFirstReg+(A)->nColumn+(I))/*** The datatype ynVar is a signed integer, either 16-bit or 32-bit.** Usually it is 16-bits. But if SQLITE_MAX_VARIABLE_NUMBER is greater** than 32767 we have to make it 32-bit. 16-bit is preferred because** it uses less memory in the Expr object, which is a big memory user** in systems with lots of prepared statements. And few applications | >>>>>> | 29362937293829392940294129422944294529462952295329542955295629572958 | /*** Macros to compute aCol[] and aFunc[] register numbers.**** These macros should not be used prior to the call to** assignAggregateRegisters() that computes the value of pAggInfo->iFirstReg.** The assert()s that are part of this macro verify that constraint.*/#define AggInfoColumnReg(A,I) (assert((A)->iFirstReg),(A)->iFirstReg+(I))#define AggInfoFuncReg(A,I) \ (assert((A)->iFirstReg),(A)->iFirstReg+(A)->nColumn+(I))/*** The datatype ynVar is a signed integer, either 16-bit or 32-bit.** Usually it is 16-bits. But if SQLITE_MAX_VARIABLE_NUMBER is greater** than 32767 we have to make it 32-bit. 16-bit is preferred because** it uses less memory in the Expr object, which is a big memory user** in systems with lots of prepared statements. And few applications |
︙ | ︙ |
Modified src/tclsqlite.cfrom [8e86ab25]to [c6888598].
︙ | ︙ | |||
365366367368369370371372373374 | return -1; } p->iSeek += nWrite; return nWrite;}/*** Seek an incremental blob channel.*/ | >>>>>>>|| | 365366367368369370371379380381383385386387388389390391 | return -1; } p->iSeek += nWrite; return nWrite;}/*** Seek an incremental blob channel.*/ ClientData instanceData, int seekMode, int *errorCodePtr){ IncrblobChannel *p = (IncrblobChannel *)instanceData; switch( seekMode ){ case SEEK_SET: |
︙ | ︙ |
Modified src/test1.cfrom [17bfae7f]to [ecbd2714].
︙ | ︙ | |||
81738174817581768177817881798180818181828183818481858186 | { "none", 0 }, { "query-flattener", SQLITE_QueryFlattener }, { "groupby-order", SQLITE_GroupByOrder }, { "factor-constants", SQLITE_FactorOutConst }, { "distinct-opt", SQLITE_DistinctOpt }, { "cover-idx-scan", SQLITE_CoverIdxScan }, { "order-by-idx-join", SQLITE_OrderByIdxJoin }, { "transitive", SQLITE_Transitive }, { "omit-noop-join", SQLITE_OmitNoopJoin }, { "stat4", SQLITE_Stat4 }, { "skip-scan", SQLITE_SkipScan }, { "push-down", SQLITE_PushDown }, { "balanced-merge", SQLITE_BalancedMerge }, { "propagate-const", SQLITE_PropagateConst }, | > | 81738174817581768177817881798181818281838184818581868187 | { "none", 0 }, { "query-flattener", SQLITE_QueryFlattener }, { "groupby-order", SQLITE_GroupByOrder }, { "factor-constants", SQLITE_FactorOutConst }, { "distinct-opt", SQLITE_DistinctOpt }, { "cover-idx-scan", SQLITE_CoverIdxScan }, { "order-by-idx-join", SQLITE_OrderByIdxJoin }, { "transitive", SQLITE_Transitive }, { "omit-noop-join", SQLITE_OmitNoopJoin }, { "stat4", SQLITE_Stat4 }, { "skip-scan", SQLITE_SkipScan }, { "push-down", SQLITE_PushDown }, { "balanced-merge", SQLITE_BalancedMerge }, { "propagate-const", SQLITE_PropagateConst }, |
︙ | ︙ | |||
8397839883998400840184028403 | rc = sqlite3_prepare_v2(db, zSql1, -1, &pStmt, 0); if( rc!=SQLITE_OK ) goto sql_error; iB = sqlite3_column_count(pStmt)-1; for(iStep=0; iStep<nStep && SQLITE_ROW==sqlite3_step(pStmt); iStep++){ int a = sqlite3_column_int(pStmt, 0); if( a!=sqlite3_column_int(pStmt, iB) ){ | ||| | 8398839984008401840284038404840684078408840984108411841284138414841584168417841884198420842184228423842584268427842884298431843284338434843584368437 | rc = sqlite3_prepare_v2(db, zSql1, -1, &pStmt, 0); if( rc!=SQLITE_OK ) goto sql_error; iB = sqlite3_column_count(pStmt)-1; for(iStep=0; iStep<nStep && SQLITE_ROW==sqlite3_step(pStmt); iStep++){ int a = sqlite3_column_int(pStmt, 0); if( a!=sqlite3_column_int(pStmt, iB) ){ return TCL_ERROR; } iCksum1 += (iCksum1 << 3) + (unsigned int)a; } rc = sqlite3_finalize(pStmt); if( rc!=SQLITE_OK ) goto sql_error; rc = sqlite3_prepare_v2(db, zSql2, -1, &pStmt, 0); if( rc!=SQLITE_OK ) goto sql_error; for(iStep=0; SQLITE_ROW==sqlite3_step(pStmt); iStep++){ int a = sqlite3_column_int(pStmt, 0); iCksum2 += (iCksum2 << 3) + (unsigned int)a; } rc = sqlite3_finalize(pStmt); if( rc!=SQLITE_OK ) goto sql_error; if( iCksum1!=iCksum2 ){ return TCL_ERROR; } return TCL_OK; sql_error: return TCL_ERROR;}#ifdef SQLITE_USER_AUTHENTICATION#include "sqlite3userauth.h"/* |
︙ | ︙ | |||
8471847284738474847584768477 | ClientData clientData, /* Unused */ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ int objc, /* Number of arguments */ Tcl_Obj *CONST objv[] /* Command arguments */){ char *zUser = 0; char *zPasswd = 0; | |||| | 84728473847484758476847784788480848184828483848484858486848784888489849084918492849384958496849784988499850085018502850385048505850685078508850985108511851385148515851685178518851985208521852285238524852585268528852985308531853285338534 | ClientData clientData, /* Unused */ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ int objc, /* Number of arguments */ Tcl_Obj *CONST objv[] /* Command arguments */){ char *zUser = 0; char *zPasswd = 0; int isAdmin = 0; sqlite3 *db; int rc; if( objc!=5 ){ Tcl_WrongNumArgs(interp, 1, objv, "DB USERNAME PASSWORD ISADMIN"); return TCL_ERROR; } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ){ return TCL_ERROR; } zUser = Tcl_GetString(objv[2]); zPasswd = Tcl_GetStringFromObj(objv[3], &nPasswd); Tcl_GetBooleanFromObj(interp, objv[4], &isAdmin); Tcl_SetResult(interp, (char *)t1ErrorName(rc), TCL_STATIC); return TCL_OK;}#endif /* SQLITE_USER_AUTHENTICATION */#ifdef SQLITE_USER_AUTHENTICATION/*** tclcmd: sqlite3_user_change DB USERNAME PASSWORD ISADMIN*/static int SQLITE_TCLAPI test_user_change( ClientData clientData, /* Unused */ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ int objc, /* Number of arguments */ Tcl_Obj *CONST objv[] /* Command arguments */){ char *zUser = 0; char *zPasswd = 0; int isAdmin = 0; sqlite3 *db; int rc; if( objc!=5 ){ Tcl_WrongNumArgs(interp, 1, objv, "DB USERNAME PASSWORD ISADMIN"); return TCL_ERROR; } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ){ return TCL_ERROR; } zUser = Tcl_GetString(objv[2]); zPasswd = Tcl_GetStringFromObj(objv[3], &nPasswd); Tcl_GetBooleanFromObj(interp, objv[4], &isAdmin); Tcl_SetResult(interp, (char *)t1ErrorName(rc), TCL_STATIC); return TCL_OK;}#endif /* SQLITE_USER_AUTHENTICATION */#ifdef SQLITE_USER_AUTHENTICATION/* |
︙ | ︙ |
Modified src/test_hexio.cfrom [5ac8f07a]to [35704e7d].
︙ | ︙ | |||
409410411412413414415 | return TCL_ERROR; } if( Tcl_ListObjGetElements(interp, objv[1], &nArg, &aArg) ){ return TCL_ERROR; } for(i=0; i<(int)nArg; i++){ | | | 409410411412413414415417418419420421422423 | return TCL_ERROR; } if( Tcl_ListObjGetElements(interp, objv[1], &nArg, &aArg) ){ return TCL_ERROR; } for(i=0; i<(int)nArg; i++){ if( TCL_OK==Tcl_GetWideIntFromObj(0, aArg[i], &iVal) ){ if( nOut+10>nAlloc ){ int nNew = nAlloc?nAlloc*2:128; unsigned char *aNew = sqlite3_realloc(aOut, nNew); if( aNew==0 ){ sqlite3_free(aOut); return TCL_ERROR; |
︙ | ︙ |
Modified src/test_tclvar.cfrom [2c42fe9a]to [ae873248].
︙ | ︙ | |||
64656667686970 | /* A tclvar cursor object */struct tclvar_cursor { sqlite3_vtab_cursor base; Tcl_Obj *pList1; /* Result of [info vars ?pattern?] */ Tcl_Obj *pList2; /* Result of [array names [lindex $pList1 $i1]] */ | || | 6465666768697073747576777879 | /* A tclvar cursor object */struct tclvar_cursor { sqlite3_vtab_cursor base; Tcl_Obj *pList1; /* Result of [info vars ?pattern?] */ Tcl_Obj *pList2; /* Result of [array names [lindex $pList1 $i1]] */};/* Methods for the tclvar module */static int tclvarConnect( sqlite3 *db, void *pAux, int argc, const char *const*argv, |
︙ | ︙ | |||
145146147148149150151 | pCur->pList2 = Tcl_GetObjResult(interp); Tcl_IncrRefCount(pCur->pList2); assert( pCur->i2==0 ); }else{ Tcl_Size n = 0; pCur->i2++; Tcl_ListObjLength(0, pCur->pList2, &n); | || | 145146147148149150151153154155156157158159160161162163164165166167168169170171172174175176177178179180 | pCur->pList2 = Tcl_GetObjResult(interp); Tcl_IncrRefCount(pCur->pList2); assert( pCur->i2==0 ); }else{ Tcl_Size n = 0; pCur->i2++; Tcl_ListObjLength(0, pCur->pList2, &n); Tcl_DecrRefCount(pCur->pList2); pCur->pList2 = 0; pCur->i2 = 0; return 0; } } } return 1;}static int tclvarNext(sqlite3_vtab_cursor *cur){ Tcl_Obj *pObj; Tcl_Size n = 0; int ok = 0; tclvar_cursor *pCur = (tclvar_cursor *)cur; Tcl_Interp *interp = ((tclvar_vtab *)(cur->pVtab))->interp; Tcl_ListObjLength(0, pCur->pList1, &n); Tcl_ListObjIndex(0, pCur->pList1, pCur->i1, &pObj); ok = next2(interp, pCur, pObj); if( !ok ){ pCur->i1++; } } |
︙ | ︙ |
Modified src/vdbesort.cfrom [237840ca]to [d0a3c705].
︙ | ︙ | |||
552553554555556557558 | nRem = nByte - nAvail; /* The following loop copies up to p->nBuffer bytes per iteration into ** the p->aAlloc[] buffer. */ while( nRem>0 ){ int rc; /* vdbePmaReadBlob() return code */ int nCopy; /* Number of bytes to copy */ | |> | 552553554555556557558560561562563564565567568569570571572573 | nRem = nByte - nAvail; /* The following loop copies up to p->nBuffer bytes per iteration into ** the p->aAlloc[] buffer. */ while( nRem>0 ){ int rc; /* vdbePmaReadBlob() return code */ int nCopy; /* Number of bytes to copy */ nCopy = nRem; if( nRem>p->nBuffer ) nCopy = p->nBuffer; rc = vdbePmaReadBlob(p, nCopy, &aNext); if( rc!=SQLITE_OK ) return rc; assert( aNext!=p->aAlloc ); memcpy(&p->aAlloc[nByte - nRem], aNext, nCopy); nRem -= nCopy; } *ppOut = p->aAlloc; } |
︙ | ︙ |
Modified src/wal.cfrom [1f0202bc]to [eb62325a].
︙ | ︙ | |||
576577578579580581582 | pHdr->mxFrame2 = (pHdr->mxFrame2 & 0x80000000) | mxFrame; }else{ pHdr->mxFrame = mxFrame; } assert( walidxGetMxFrame(pHdr, iWal)==mxFrame );} | |< | 576577578579580581582584585586587588589590 | pHdr->mxFrame2 = (pHdr->mxFrame2 & 0x80000000) | mxFrame; }else{ pHdr->mxFrame = mxFrame; } assert( walidxGetMxFrame(pHdr, iWal)==mxFrame );}#define walidxSetFile(pHdr, iWal) ( \ (pHdr)->mxFrame2 = ((pHdr)->mxFrame2 & 0x7FFFFFFF) | (((u32)(iWal))<<31) \)/*** Argument is a pointer to a Wal structure. Return true if the current** cache of the wal-index header indicates "journal_mode=wal2" mode, or |
︙ | ︙ |
Modified src/where.cfrom [d87a4160]to [f5be664f].
︙ | ︙ | |||
14971498149915001501150215031504150515061507150815091510 | pHidden = (struct HiddenIndexInfo*)&pIdxInfo[1]; pIdxCons = (struct sqlite3_index_constraint*)&pHidden->aRhs[nTerm]; pIdxOrderBy = (struct sqlite3_index_orderby*)&pIdxCons[nTerm]; pUsage = (struct sqlite3_index_constraint_usage*)&pIdxOrderBy[nOrderBy]; pIdxInfo->aConstraint = pIdxCons; pIdxInfo->aOrderBy = pIdxOrderBy; pIdxInfo->aConstraintUsage = pUsage; pHidden->pWC = pWC; pHidden->pParse = pParse; pHidden->eDistinct = eDistinct; pHidden->mIn = 0; for(p=pWC, i=j=0; p; p=p->pOuter){ int nLast = i+p->nTerm;; for(pTerm=p->a; i<nLast; i++, pTerm++){ | >>>>>>>>>>>>> | 14971498149915001501150215031517151815191520152115221523 | pHidden = (struct HiddenIndexInfo*)&pIdxInfo[1]; pIdxCons = (struct sqlite3_index_constraint*)&pHidden->aRhs[nTerm]; pIdxOrderBy = (struct sqlite3_index_orderby*)&pIdxCons[nTerm]; pUsage = (struct sqlite3_index_constraint_usage*)&pIdxOrderBy[nOrderBy]; pIdxInfo->aConstraint = pIdxCons; pIdxInfo->aOrderBy = pIdxOrderBy; pIdxInfo->aConstraintUsage = pUsage; pHidden->pWC = pWC; pHidden->pParse = pParse; pHidden->eDistinct = eDistinct; pHidden->mIn = 0; for(p=pWC, i=j=0; p; p=p->pOuter){ int nLast = i+p->nTerm;; for(pTerm=p->a; i<nLast; i++, pTerm++){ |
︙ | ︙ | |||
39933994399539963997399839994000400140024003400440054006 | #ifdef SQLITE_ENABLE_STAT4 pNew->rRun = rSize + 16 - 2*((pTab->tabFlags & TF_HasStat4)!=0);#else pNew->rRun = rSize + 16;#endif ApplyCostMultiplier(pNew->rRun, pTab->costMult); whereLoopOutputAdjust(pWC, pNew, rSize); rc = whereLoopInsert(pBuilder, pNew); pNew->nOut = rSize; if( rc ) break; }else{ Bitmask m; if( pProbe->isCovering ){ m = 0; | >>>> | 40064007400840094010401140124017401840194020402140224023 | #ifdef SQLITE_ENABLE_STAT4 pNew->rRun = rSize + 16 - 2*((pTab->tabFlags & TF_HasStat4)!=0);#else pNew->rRun = rSize + 16;#endif ApplyCostMultiplier(pNew->rRun, pTab->costMult); whereLoopOutputAdjust(pWC, pNew, rSize); rc = whereLoopInsert(pBuilder, pNew); pNew->nOut = rSize; if( rc ) break; }else{ Bitmask m; if( pProbe->isCovering ){ m = 0; |
︙ | ︙ | |||
4030403140324033403440354036 | }else{ assert( isCov==WHERE_EXPRIDX ); WHERETRACE(0x200, ("-> %s might be a covering expression index" " according to whereIsCoveringIndex()\n", pProbe->zName)); } } | |>> | 40474048404940504051405240534057405840594060406140624063 | }else{ assert( isCov==WHERE_EXPRIDX ); WHERETRACE(0x200, ("-> %s might be a covering expression index" " according to whereIsCoveringIndex()\n", pProbe->zName)); } } WHERETRACE(0x200, ("-> %s a covering index according to bitmasks\n", pProbe->zName, m==0 ? "is" : "is not")); pNew->wsFlags = WHERE_IDX_ONLY | WHERE_INDEXED; } } |
︙ | ︙ | |||
4212421342144215421642174218 | assert( pIdxInfo->needToFreeIdxStr==0 ); pIdxInfo->idxStr = 0; pIdxInfo->idxNum = 0; pIdxInfo->orderByConsumed = 0; pIdxInfo->estimatedCost = SQLITE_BIG_DBL / (double)2; pIdxInfo->estimatedRows = 25; pIdxInfo->idxFlags = 0; | < | 42314232423342344235423642374238423942404241424242434244 | assert( pIdxInfo->needToFreeIdxStr==0 ); pIdxInfo->idxStr = 0; pIdxInfo->idxNum = 0; pIdxInfo->orderByConsumed = 0; pIdxInfo->estimatedCost = SQLITE_BIG_DBL / (double)2; pIdxInfo->estimatedRows = 25; pIdxInfo->idxFlags = 0; pHidden->mHandleIn = 0; /* Invoke the virtual table xBestIndex() method */ rc = vtabBestIndex(pParse, pSrc->pTab, pIdxInfo); if( rc ){ if( rc==SQLITE_CONSTRAINT ){ /* If the xBestIndex method returns SQLITE_CONSTRAINT, that means |
︙ | ︙ | |||
48244825482648274828482948304831483248334834483548364837 | } } } whereLoopClear(db, pNew); return rc;}/*** Examine a WherePath (with the addition of the extra WhereLoop of the 6th** parameters) to see if it outputs rows in the requested ORDER BY** (or GROUP BY) without requiring a separate sort operation. Return N:**** N>0: N terms of the ORDER BY clause are satisfied | >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> | 48424843484448454846484748484940494149424943494449454946 | } } } whereLoopClear(db, pNew); return rc;}/*** Examine a WherePath (with the addition of the extra WhereLoop of the 6th** parameters) to see if it outputs rows in the requested ORDER BY** (or GROUP BY) without requiring a separate sort operation. Return N:**** N>0: N terms of the ORDER BY clause are satisfied |
︙ | ︙ | |||
497049714972497349744975497649774978 | testcase( pTerm->pExpr->op==TK_IS ); } obSat |= MASKBIT(i); } if( (pLoop->wsFlags & WHERE_ONEROW)==0 ){ if( pLoop->wsFlags & WHERE_IPK ){ pIndex = 0; nKeyCol = 0; | >>>>>>>>>>< | 5079508050815082508350845085509650975098509951005101510251035104 | testcase( pTerm->pExpr->op==TK_IS ); } obSat |= MASKBIT(i); } if( (pLoop->wsFlags & WHERE_ONEROW)==0 ){ if( pLoop->wsFlags & WHERE_IPK ){ pIndex = 0; nKeyCol = 0; }else if( (pIndex = pLoop->u.btree.pIndex)==0 || pIndex->bUnordered ){ return 0; }else{ nKeyCol = pIndex->nKeyCol; nColumn = pIndex->nColumn; assert( nColumn==nKeyCol+1 || !HasRowid(pIndex->pTable) ); assert( pIndex->aiColumn[nColumn-1]==XN_ROWID |
︙ | ︙ | |||
5067506850695070507150725073 | } if( iColumn==XN_EXPR ){ isOrderDistinct = 0; } } /* Find the ORDER BY term that corresponds to the j-th column | | | 51855186518751885189519051915193519451955196519751985199 | } if( iColumn==XN_EXPR ){ isOrderDistinct = 0; } } /* Find the ORDER BY term that corresponds to the j-th column */ isMatch = 0; for(i=0; bOnce && i<nOrderBy; i++){ if( MASKBIT(i) & obSat ) continue; pOBExpr = sqlite3ExprSkipCollateAndLikely(pOrderBy->a[i].pExpr); testcase( wctrlFlags & WHERE_GROUPBY ); testcase( wctrlFlags & WHERE_DISTINCTBY ); |
︙ | ︙ | |||
7062706370647065706670677068 | VdbeOp *pOp ){ if( (db->flags & SQLITE_VdbeAddopTrace)==0 ) return; sqlite3VdbePrintOp(0, pc, pOp); }#endif | <<<<<<<<<<<<<<<<<<<< | 71807181718271837184718571867187718871897190719171927193 | VdbeOp *pOp ){ if( (db->flags & SQLITE_VdbeAddopTrace)==0 ) return; sqlite3VdbePrintOp(0, pc, pOp); }#endif/*** Generate the end of the WHERE loop. See comments on** sqlite3WhereBegin() for additional information.*/void sqlite3WhereEnd(WhereInfo *pWInfo){ Parse *pParse = pWInfo->pParse; Vdbe *v = pParse->pVdbe; |
︙ | ︙ | |||
7381738273837384738573867387 | pOp->p1 = pLevel->iIdxCur; OpcodeRewriteTrace(db, k, pOp); }else{ /* Unable to translate the table reference into an index ** reference. Verify that this is harmless - that the ** table being referenced really is open. */ | <|<<<>|<<<<> | 74797480748174827483748474857490749174927493749474957496 | pOp->p1 = pLevel->iIdxCur; OpcodeRewriteTrace(db, k, pOp); }else{ /* Unable to translate the table reference into an index ** reference. Verify that this is harmless - that the ** table being referenced really is open. */ } }else if( pOp->opcode==OP_Rowid ){ pOp->p1 = pLevel->iIdxCur; pOp->opcode = OP_IdxRowid; OpcodeRewriteTrace(db, k, pOp); }else if( pOp->opcode==OP_IfNullRow ){ pOp->p1 = pLevel->iIdxCur; |
︙ | ︙ |
Modified src/whereInt.hfrom [002adc3a]to [6444b888].
︙ | ︙ | |||
139140141142143144145146147148149150151152 | union { struct { /* Information for internal btree tables */ u16 nEq; /* Number of equality constraints */ u16 nBtm; /* Size of BTM vector */ u16 nTop; /* Size of TOP vector */ u16 nDistinctCol; /* Index columns used to sort for DISTINCT */ Index *pIndex; /* Index used, or NULL */ } btree; struct { /* Information for virtual tables */ int idxNum; /* Index number */ u32 needFree : 1; /* True if sqlite3_free(idxStr) is needed */ u32 bOmitOffset : 1; /* True to let virtual table handle offset */ i8 isOrdered; /* True if satisfies ORDER BY */ u16 omitMask; /* Terms that may be omitted */ | > | 139140141142143144145147148149150151152153 | union { struct { /* Information for internal btree tables */ u16 nEq; /* Number of equality constraints */ u16 nBtm; /* Size of BTM vector */ u16 nTop; /* Size of TOP vector */ u16 nDistinctCol; /* Index columns used to sort for DISTINCT */ Index *pIndex; /* Index used, or NULL */ } btree; struct { /* Information for virtual tables */ int idxNum; /* Index number */ u32 needFree : 1; /* True if sqlite3_free(idxStr) is needed */ u32 bOmitOffset : 1; /* True to let virtual table handle offset */ i8 isOrdered; /* True if satisfies ORDER BY */ u16 omitMask; /* Terms that may be omitted */ |
︙ | ︙ | |||
632633634635636637638 | #define WHERE_IN_EARLYOUT 0x00040000 /* Perhaps quit IN loops early */#define WHERE_BIGNULL_SORT 0x00080000 /* Column nEq of index is BIGNULL */#define WHERE_IN_SEEKSCAN 0x00100000 /* Seek-scan optimization for IN */#define WHERE_TRANSCONS 0x00200000 /* Uses a transitive constraint */#define WHERE_BLOOMFILTER 0x00400000 /* Consider using a Bloom-filter */#define WHERE_SELFCULL 0x00800000 /* nOut reduced by extra WHERE terms */#define WHERE_OMIT_OFFSET 0x01000000 /* Set offset counter to zero */ | |> | 633634635636637638639642643644 | #define WHERE_IN_EARLYOUT 0x00040000 /* Perhaps quit IN loops early */#define WHERE_BIGNULL_SORT 0x00080000 /* Column nEq of index is BIGNULL */#define WHERE_IN_SEEKSCAN 0x00100000 /* Seek-scan optimization for IN */#define WHERE_TRANSCONS 0x00200000 /* Uses a transitive constraint */#define WHERE_BLOOMFILTER 0x00400000 /* Consider using a Bloom-filter */#define WHERE_SELFCULL 0x00800000 /* nOut reduced by extra WHERE terms */#define WHERE_OMIT_OFFSET 0x01000000 /* Set offset counter to zero */#define WHERE_EXPRIDX 0x04000000 /* Uses an index-on-expressions */#endif /* !defined(SQLITE_WHEREINT_H) */ |
Added test/bestindexD.test version [6a8f6f84].
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
Modified test/eqp.testfrom [815418b6]to [82f221e8].
︙ | ︙ | |||
284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313 | QUERY PLAN |--CO-ROUTINE (subquery-xxxxxx) | |--SCAN t1 | `--USE TEMP B-TREE FOR ORDER BY |--SCAN (subquery-xxxxxx) `--USE TEMP B-TREE FOR ORDER BY}det 3.2.2 { SELECT * FROM (SELECT * FROM t1 ORDER BY x LIMIT 10) AS x1, (SELECT * FROM t2 ORDER BY x LIMIT 10) AS x2 ORDER BY x2.y LIMIT 5} { QUERY PLAN |--CO-ROUTINE x1 | |--SCAN t1 | `--USE TEMP B-TREE FOR ORDER BY |--MATERIALIZE x2 | `--SCAN t2 USING INDEX t2i1 |--SCAN x1 |--SCAN x2 `--USE TEMP B-TREE FOR ORDER BY}det 3.3.1 { SELECT * FROM t1 WHERE y IN (SELECT y FROM t2)} { QUERY PLAN |--SCAN t1 `--LIST SUBQUERY xxxxxx | >>>>>>>>>>> | 284285286287288289290292293294295296297298299300301302303304305306307318319320321322323324 | QUERY PLAN |--CO-ROUTINE (subquery-xxxxxx) | |--SCAN t1 | `--USE TEMP B-TREE FOR ORDER BY |--SCAN (subquery-xxxxxx) `--USE TEMP B-TREE FOR ORDER BY}det 3.2.2 { SELECT * FROM (SELECT * FROM t1 ORDER BY x LIMIT 10) AS x1, (SELECT * FROM t2 ORDER BY x LIMIT 10) AS x2 ORDER BY x2.y LIMIT 5} { QUERY PLAN |--CO-ROUTINE x1 | |--SCAN t1 | `--USE TEMP B-TREE FOR ORDER BY |--MATERIALIZE x2 | `--SCAN t2 USING INDEX t2i1 |--SCAN x1 |--SCAN x2 `--USE TEMP B-TREE FOR ORDER BY}det 3.3.1 { SELECT * FROM t1 WHERE y IN (SELECT y FROM t2)} { QUERY PLAN |--SCAN t1 `--LIST SUBQUERY xxxxxx |
︙ | ︙ | |||
803804805806807808809810811812813814815816 | comment TEXT, brief TEXT, omtime DATETIME ); CREATE INDEX event_i1 ON event(mtime); CREATE TABLE private(rid INTEGER PRIMARY KEY);}do_eqp_test 9.1 { WITH thread(age,duration,cnt,root,last) AS ( SELECT julianday('now') - max(fmtime) AS age, max(fmtime) - min(fmtime) AS duration, sum(fprev IS NULL) AS msg_count, froot, | > | 814815816817818819820822823824825826827828 | comment TEXT, brief TEXT, omtime DATETIME ); CREATE INDEX event_i1 ON event(mtime); CREATE TABLE private(rid INTEGER PRIMARY KEY);}do_eqp_test 9.1 { WITH thread(age,duration,cnt,root,last) AS ( SELECT julianday('now') - max(fmtime) AS age, max(fmtime) - min(fmtime) AS duration, sum(fprev IS NULL) AS msg_count, froot, |
︙ | ︙ | |||
843844845846847848849 | | | `--USING ROWID SEARCH ON TABLE private FOR IN-OPERATOR | `--USE TEMP B-TREE FOR ORDER BY |--SCAN thread |--SEARCH blob USING INTEGER PRIMARY KEY (rowid=?) |--SEARCH event USING INTEGER PRIMARY KEY (rowid=?) `--USE TEMP B-TREE FOR ORDER BY} | >>>>>>>>>>>>>>>>>|>>>>>>>>>>>>>>>>>>>>>>>> | 855856857858859860861904 | | | `--USING ROWID SEARCH ON TABLE private FOR IN-OPERATOR | `--USE TEMP B-TREE FOR ORDER BY |--SCAN thread |--SEARCH blob USING INTEGER PRIMARY KEY (rowid=?) |--SEARCH event USING INTEGER PRIMARY KEY (rowid=?) `--USE TEMP B-TREE FOR ORDER BY}finish_test |
Modified test/fts3snippet.testfrom [0887196d]to [560c7f38].
︙ | ︙ | |||
557558559560561562563 | do_test 4.3 { llength [db one { SELECT snippet(t4, '', '', '', 0, 150) FROM t4 WHERE t4 MATCH 'E' }]} {64} | < | 557558559560561562563564565566567568569570 | do_test 4.3 { llength [db one { SELECT snippet(t4, '', '', '', 0, 150) FROM t4 WHERE t4 MATCH 'E' }]} {64}#-------------------------------------------------------------------------# Request a snippet from a query with more than 64 phrases.#do_execsql_test 5.0 { CREATE VIRTUAL TABLE t5 USING fts3(x); INSERT INTO t5 VALUES('a1 a2 a3'); INSERT INTO t5 VALUES('a4 a5 a6'); |
︙ | ︙ | |||
583584585586587588589590591592 | 'a61 OR a62 OR a63 OR a64 OR a65 OR a66 OR a67 OR a68 OR a69 OR a60 OR ' || 'a71 OR a72 OR a73 OR a74 OR a75 OR a76 OR a77 OR a78 OR a79 OR a70'} { {[a1] [a2] [a3]} {[a4] [a5] [a6]} {[a70] [a71] [a72]}}set sqlite_fts3_enable_parentheses 0finish_test | >>>> | 582583584585586587588593594595 | 'a61 OR a62 OR a63 OR a64 OR a65 OR a66 OR a67 OR a68 OR a69 OR a60 OR ' || 'a71 OR a72 OR a73 OR a74 OR a75 OR a76 OR a77 OR a78 OR a79 OR a70'} { {[a1] [a2] [a3]} {[a4] [a5] [a6]} {[a70] [a71] [a72]}}set sqlite_fts3_enable_parentheses 0finish_test |
Modified test/fuzzcheck.cfrom [dc159967]to [6e87c27d].
︙ | ︙ | |||
10241025102610271028102910301031103210331034103510361037 | } rc = sqlite3_recover_finish(p); if( eVerbosity>0 && rc ){ printf("recovery returns error code %d\n", rc); } return rc;}/*** Run the SQL text*/static int runDbSql( sqlite3 *db, /* Run SQL on this database connection */ const char *zSql, /* The SQL to be run */ | >>>>>>>>>>>>>>>>>>>>>>>> | 10241025102610271028102910301055105610571058105910601061 | } rc = sqlite3_recover_finish(p); if( eVerbosity>0 && rc ){ printf("recovery returns error code %d\n", rc); } return rc;}/*** Run the SQL text*/static int runDbSql( sqlite3 *db, /* Run SQL on this database connection */ const char *zSql, /* The SQL to be run */ |
︙ | ︙ | |||
10471048104910501051105210531054105510561057105810591060 | printf("RUNNING-SQL: [%s]\n", zSql); fflush(stdout); } (*pBtsFlags) &= BTS_BADPRAGMA; rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0); if( rc==SQLITE_OK ){ int nRow = 0; while( (rc = sqlite3_step(pStmt))==SQLITE_ROW ){ nRow++; if( eVerbosity>=4 ){ int j; for(j=0; j<sqlite3_column_count(pStmt); j++){ if( j ) printf(","); switch( sqlite3_column_type(pStmt, j) ){ | > | 10711072107310741075107610771079108010811082108310841085 | printf("RUNNING-SQL: [%s]\n", zSql); fflush(stdout); } (*pBtsFlags) &= BTS_BADPRAGMA; rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0); if( rc==SQLITE_OK ){ int nRow = 0; while( (rc = sqlite3_step(pStmt))==SQLITE_ROW ){ nRow++; if( eVerbosity>=4 ){ int j; for(j=0; j<sqlite3_column_count(pStmt); j++){ if( j ) printf(","); switch( sqlite3_column_type(pStmt, j) ){ |
︙ | ︙ |
Modified test/fuzzinvariants.cfrom [0729b9d8]to [81167c9a].
︙ | ︙ | |||
3334353637383940414243444546 | static void reportInvariantFailed( sqlite3_stmt *pOrig, /* The original query */ sqlite3_stmt *pTest, /* The alternative test query with a missing row */ int iRow, /* Row number in pOrig */ unsigned int dbOpt, /* Optimization flags on pOrig */ int noOpt /* True if opt flags inverted for pTest */);/*** Do an invariant check on pStmt. iCnt determines which invariant check to** perform. The first check is iCnt==0.**** *pbCorrupt is a flag that, if true, indicates that the database file** is known to be corrupt. A value of non-zero means "yes, the database | >>>>>>>>>>>>>>>>>>>>>>>>> | 3334353637383965666768697071 | static void reportInvariantFailed( sqlite3_stmt *pOrig, /* The original query */ sqlite3_stmt *pTest, /* The alternative test query with a missing row */ int iRow, /* Row number in pOrig */ unsigned int dbOpt, /* Optimization flags on pOrig */ int noOpt /* True if opt flags inverted for pTest */);/*** Do an invariant check on pStmt. iCnt determines which invariant check to** perform. The first check is iCnt==0.**** *pbCorrupt is a flag that, if true, indicates that the database file** is known to be corrupt. A value of non-zero means "yes, the database |
︙ | ︙ | |||
103104105106107108109110111112113114115116 | sqlite3_errmsg(db), zTest); } sqlite3_free(zTest); sqlite3_finalize(pTestStmt); return rc; } sqlite3_free(zTest); nCol = sqlite3_column_count(pStmt); for(i=0; i<nCol; i++){ rc = sqlite3_bind_value(pTestStmt,i+1+nParam,sqlite3_column_value(pStmt,i)); if( rc!=SQLITE_OK && rc!=SQLITE_RANGE ){ sqlite3_finalize(pTestStmt); return rc; } | > | 128129130131132133134136137138139140141142 | sqlite3_errmsg(db), zTest); } sqlite3_free(zTest); sqlite3_finalize(pTestStmt); return rc; } sqlite3_free(zTest); nCol = sqlite3_column_count(pStmt); for(i=0; i<nCol; i++){ rc = sqlite3_bind_value(pTestStmt,i+1+nParam,sqlite3_column_value(pStmt,i)); if( rc!=SQLITE_OK && rc!=SQLITE_RANGE ){ sqlite3_finalize(pTestStmt); return rc; } |
︙ | ︙ | |||
167168169170171172173174175176177178179180 | sqlite3_prepare_v2(db, sqlite3_sql(pStmt), -1, &pCk, 0); sqlite3_db_config(db, SQLITE_DBCONFIG_REVERSE_SCANORDER, iOrigRSO, 0); if( eVerbosity>=2 ){ char *zSql = sqlite3_expanded_sql(pCk); printf("invariant-validity-check #2:\n%s\n", zSql); sqlite3_free(zSql); } while( (rc = sqlite3_step(pCk))==SQLITE_ROW ){ for(i=0; i<nCol; i++){ if( !sameValue(pStmt, i, pTestStmt, i, 0) ) break; } if( i>=nCol ) break; } sqlite3_finalize(pCk); | > | 193194195196197198199201202203204205206207 | sqlite3_prepare_v2(db, sqlite3_sql(pStmt), -1, &pCk, 0); sqlite3_db_config(db, SQLITE_DBCONFIG_REVERSE_SCANORDER, iOrigRSO, 0); if( eVerbosity>=2 ){ char *zSql = sqlite3_expanded_sql(pCk); printf("invariant-validity-check #2:\n%s\n", zSql); sqlite3_free(zSql); } while( (rc = sqlite3_step(pCk))==SQLITE_ROW ){ for(i=0; i<nCol; i++){ if( !sameValue(pStmt, i, pTestStmt, i, 0) ) break; } if( i>=nCol ) break; } sqlite3_finalize(pCk); |
︙ | ︙ | |||
195196197198199200201202203204205206207208 | if( eVerbosity>=2 ){ char *zSql = sqlite3_expanded_sql(pCk); printf("invariant-validity-check #3:\n%s\n", zSql); sqlite3_free(zSql); } sqlite3_reset(pTestStmt); while( (rc = sqlite3_step(pTestStmt))==SQLITE_ROW ){ for(i=0; i<nCol; i++){ if( !sameValue(pStmt, i, pTestStmt, i, pCk) ) break; } if( i>=nCol ){ sqlite3_finalize(pCk); goto not_a_fault; | > | 222223224225226227228230231232233234235236 | if( eVerbosity>=2 ){ char *zSql = sqlite3_expanded_sql(pCk); printf("invariant-validity-check #3:\n%s\n", zSql); sqlite3_free(zSql); } sqlite3_reset(pTestStmt); while( (rc = sqlite3_step(pTestStmt))==SQLITE_ROW ){ for(i=0; i<nCol; i++){ if( !sameValue(pStmt, i, pTestStmt, i, pCk) ) break; } if( i>=nCol ){ sqlite3_finalize(pCk); goto not_a_fault; |
︙ | ︙ | |||
294295296297298299300301302303304305306307 | sqlite3_str_append(pTest, zIn, (int)nIn); sqlite3_str_append(pTest, ")", 1); rc = sqlite3_prepare_v2(db, sqlite3_str_value(pTest), -1, &pBase, 0); if( rc ){ sqlite3_finalize(pBase); pBase = pStmt; } for(i=0; i<sqlite3_column_count(pStmt); i++){ const char *zColName = sqlite3_column_name(pBase,i); const char *zSuffix = zColName ? strrchr(zColName, ':') : 0; if( zSuffix && isdigit(zSuffix[1]) && (zSuffix[1]>'3' || isdigit(zSuffix[2])) ){ | > | 322323324325326327328330331332333334335336 | sqlite3_str_append(pTest, zIn, (int)nIn); sqlite3_str_append(pTest, ")", 1); rc = sqlite3_prepare_v2(db, sqlite3_str_value(pTest), -1, &pBase, 0); if( rc ){ sqlite3_finalize(pBase); pBase = pStmt; } for(i=0; i<sqlite3_column_count(pStmt); i++){ const char *zColName = sqlite3_column_name(pBase,i); const char *zSuffix = zColName ? strrchr(zColName, ':') : 0; if( zSuffix && isdigit(zSuffix[1]) && (zSuffix[1]>'3' || isdigit(zSuffix[2])) ){ |
︙ | ︙ |
Added test/orderbyB.test version [32576c7b].
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
Modified test/select7.testfrom [f659f231]to [b825420d].
︙ | ︙ | |||
150151152153154155156157158159160161162163 | append sql { UNION ALL SELECT 99999999} do_test select7-6.2 { catchsql $sql } {1 {too many terms in compound SELECT}} } }}# This block of tests verifies that bug aa92c76cd4 is fixed.#do_test select7-7.1 { execsql { CREATE TABLE t3(a REAL); INSERT INTO t3 VALUES(44.0); | >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> | 150151152153154155156189190191192193194195 | append sql { UNION ALL SELECT 99999999} do_test select7-6.2 { catchsql $sql } {1 {too many terms in compound SELECT}} } }}# This block of tests verifies that bug aa92c76cd4 is fixed.#do_test select7-7.1 { execsql { CREATE TABLE t3(a REAL); INSERT INTO t3 VALUES(44.0); |
︙ | ︙ |
Modified test/skipscan1.testfrom [e03ba5b9]to [9cbbb657].
︙ | ︙ | |||
333334335336337338339 | INSERT INTO sqlite_stat1 VALUES('t9a','t9a_ab','1000000 250000 1'); ANALYZE sqlite_master; EXPLAIN QUERY PLAN SELECT * FROM t9a WHERE b IN (SELECT x FROM t9b WHERE y!=5);} {/USING INDEX t9a_ab .ANY.a. AND b=./} | || | 333334335336337338339341342343344346347348349350351352 | INSERT INTO sqlite_stat1 VALUES('t9a','t9a_ab','1000000 250000 1'); ANALYZE sqlite_master; EXPLAIN QUERY PLAN SELECT * FROM t9a WHERE b IN (SELECT x FROM t9b WHERE y!=5);} {/USING INDEX t9a_ab .ANY.a. AND b=./}do_execsql_test skipscan1-9.3 { EXPLAIN QUERY PLAN SELECT * FROM t9a WHERE b IN (SELECT x FROM t9b WHERE y!=5);} {/{SCAN t9a}/}do_execsql_test skipscan1-2.1 { CREATE TABLE t6(a TEXT, b INT, c INT, d INT); CREATE INDEX t6abc ON t6(a,b,c); INSERT INTO t6 VALUES('abc',123,4,5); ANALYZE; |
︙ | ︙ |
Modified test/tester.tclfrom [e216c7a6]to [fa7006ff].
︙ | ︙ | |||
10521053105410551056105710581059106010611062106310641065 | } else { if {[string index $res 0]!="/"} { set res "/*$res*/" } uplevel do_execsql_test $name [list "EXPLAIN QUERY PLAN $sql"] [list $res] }}#-------------------------------------------------------------------------# Usage: do_select_tests PREFIX ?SWITCHES? TESTLIST## Where switches are:# | >>>>>>>>>>>>>>>>>>>>>>> | 10521053105410551056105710581082108310841085108610871088 | } else { if {[string index $res 0]!="/"} { set res "/*$res*/" } uplevel do_execsql_test $name [list "EXPLAIN QUERY PLAN $sql"] [list $res] }}#-------------------------------------------------------------------------# Usage: do_select_tests PREFIX ?SWITCHES? TESTLIST## Where switches are:# |
︙ | ︙ |
Modified test/testrunner.tclfrom [2d100e73]to [5d02deeb].
︙ | ︙ | |||
50515253545556575859 | proc usage {} { set a0 [file tail $::argv0] puts stderr [string trim [subst -nocommands {Usage: $a0 ?SWITCHES? ?PERMUTATION? ?PATTERNS? $a0 PERMUTATION FILE $a0 help $a0 njob ?NJOB? $a0 script ?-msvc? CONFIG | >|> | 50515253545556585960626364656667686971727374757677 | proc usage {} { set a0 [file tail $::argv0] puts stderr [string trim [subst -nocommands {Usage: $a0 ?SWITCHES? ?PERMUTATION? ?PATTERNS? $a0 PERMUTATION FILE $a0 help $a0 njob ?NJOB? $a0 script ?-msvc? CONFIG where SWITCHES are: --buildonly Build test exes but do not run tests --config CONFIGS Only use configs on comma-separate list CONFIGS --dryrun Write what would have happened to testrunner.log --explain Write summary to stdout --jobs NUM Run tests using NUM separate processes --omit CONFIGS Omit configs on comma-separated list CONFIGS --stop-on-coredump Stop running if any test segfaults --stop-on-error Stop running after any reported error --zipvfs ZIPVFSDIR ZIPVFS source directorySpecial values for PERMUTATION that work with plain tclsh: list - show all allowed PERMUTATION arguments. |
︙ | ︙ | |||
96979899100101102 | If a PERMUTATION is specified and is followed by the path to a Tcl scriptinstead of a list of patterns, then that single Tcl test script is runwith the specified permutation.The "status" and "njob" commands are designed to be run from the samedirectory as a running testrunner.tcl script that is running tests. The"status" command prints a report describing the current state and progress | >||>>>>> | 9899100101102103104108109110111117118119120121122123 | If a PERMUTATION is specified and is followed by the path to a Tcl scriptinstead of a list of patterns, then that single Tcl test script is runwith the specified permutation.The "status" and "njob" commands are designed to be run from the samedirectory as a running testrunner.tcl script that is running tests. The"status" command prints a report describing the current state and progress The "script" command outputs the script used to build a configuration.Add the "-msvc" option for a Windows-compatible script. For a list ofavailable configurations enter "$a0 script help".Full documentation here: https://sqlite.org/src/doc/trunk/doc/testrunner.md }]] exit 1}#------------------------------------------------------------------------- |
︙ | ︙ | |||
176177178179180181182183184185186187188189 | set TRG(buildonly) 0 ;# True if --buildonly option set TRG(config) {} ;# Only build the named configurationsset TRG(omitconfig) {} ;# Do not build these configurationsset TRG(dryrun) 0 ;# True if --dryrun option set TRG(explain) 0 ;# True for the --explain optionset TRG(stopOnError) 0 ;# Stop running at first failureset TRG(stopOnCore) 0 ;# Stop on a core-dumpswitch -nocase -glob -- $tcl_platform(os) { *darwin* { set TRG(platform) osx set TRG(make) make.sh set TRG(makecmd) "bash make.sh" set TRG(testfixture) testfixture | > | 184185186187188189190192193194195196197198 | set TRG(buildonly) 0 ;# True if --buildonly option set TRG(config) {} ;# Only build the named configurationsset TRG(omitconfig) {} ;# Do not build these configurationsset TRG(dryrun) 0 ;# True if --dryrun option set TRG(explain) 0 ;# True for the --explain optionset TRG(stopOnError) 0 ;# Stop running at first failureset TRG(stopOnCore) 0 ;# Stop on a core-dumpswitch -nocase -glob -- $tcl_platform(os) { *darwin* { set TRG(platform) osx set TRG(make) make.sh set TRG(makecmd) "bash make.sh" set TRG(testfixture) testfixture |
︙ | ︙ | |||
375376377378379380381 | set bMsvc [expr ([llength $argv]==3)] set config [lindex $argv [expr [llength $argv]-1]] puts [trd_buildscript $config [file dirname $testdir] $bMsvc] exit} | ||<<<<<<||<|<|>|>||>>>>>|<||||>>>>|||>>>>>>>>>|||>||||>>>>|>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> | 384385386387388389390393403419421422423424425426427429430431432433434435436446447448449454455456457459460461462463464465467468469470472474475527594595596597598599600 | set bMsvc [expr ([llength $argv]==3)] set config [lindex $argv [expr [llength $argv]-1]] puts [trd_buildscript $config [file dirname $testdir] $bMsvc] exit}# set now [clock_milliseconds] SELECT COALESCE((SELECT value FROM config WHERE name='end'), $now) - (SELECT value FROM config WHERE name='start') }] set total 0 foreach s {"" ready running done failed} { set S($s) 0 } SELECT state, count(*) AS cnt FROM jobs GROUP BY 1 } { incr S($state) $cnt incr total $cnt } set fin [expr $S(done)+$S(failed)] if {$cmdline!=""} {set cmdline " $cmdline"} set f "" if {$S(failed)>0} { set f "$S(failed) FAILED, " } set srcdir [file dirname [file dirname $TRG(info_script)]] if {$S(running)>0} { puts "Running: " SELECT * FROM jobs WHERE state='running' ORDER BY starttime } job { display_job [array get job] $now } } if {$S(failed)>0} { puts "Failures: " SELECT * FROM jobs WHERE state='failed' ORDER BY starttime } job { display_job [array get job] } if {$nOmit} { } } mydb close exit}#-------------------------------------------------------------------------# Parse the command line.#for {set ii 0} {$ii < [llength $argv]} {incr ii} { |
︙ | ︙ | |||
486487488489490491492493494495496497498499 | } elseif {($n>2 && [string match "$a*" --omit]) || $a=="-c"} { incr ii set TRG(omitconfig) [lindex $argv $ii] } elseif {[string match "$a*" --stop-on-error]} { set TRG(stopOnError) 1 } elseif {[string match "$a*" --stop-on-coredump]} { set TRG(stopOnCore) 1 } else { usage } } else { lappend TRG(patternlist) [string map {% *} $a] }} | >>>>>>>>>> | 623624625626627628629640641642643644645646 | } elseif {($n>2 && [string match "$a*" --omit]) || $a=="-c"} { incr ii set TRG(omitconfig) [lindex $argv $ii] } elseif {[string match "$a*" --stop-on-error]} { set TRG(stopOnError) 1 } elseif {[string match "$a*" --stop-on-coredump]} { set TRG(stopOnCore) 1 } else { usage } } else { lappend TRG(patternlist) [string map {% *} $a] }} |
︙ | ︙ | |||
599600601602603604605 | set ret [array get job] } } return $ret} | <<<<<< | 746747748749750751752753754755756757758759 | set ret [array get job] } } return $ret}# Usage:## add_job OPTION ARG OPTION ARG...## where available OPTIONS are:## -displaytype |
︙ | ︙ | |||
1121112211231124112511261127 | fconfigure $fd -blocking false -translation binary fileevent $fd readable [list script_input_ready $fd $iJob $job(jobid)] } return 1} | >>|>>>>>>>|||||||||||||||||||||||||||||||||||||||| | 1262126312641265126612671268127212731321132213231324132513261327 | fconfigure $fd -blocking false -translation binary fileevent $fd readable [list script_input_ready $fd $iJob $job(jobid)] } return 1} global TRG}proc launch_some_jobs {} { global TRG set nJob [trdb one { SELECT value FROM config WHERE name='njob' }] while {[dirs_nHelper]<$nJob} { |
︙ | ︙ | |||
1188118911901191119211931194 | set ii 0 set TRG(starttime) [clock_milliseconds] set TRG(log) [open $TRG(logname) w] launch_some_jobs | >|| | 1338133913401341134213431344134713481349135013511353135413551356135713581359 | set ii 0 set TRG(starttime) [clock_milliseconds] set TRG(log) [open $TRG(logname) w] launch_some_jobs while {[dirs_nHelper]>0} { after 500 {incr ::wakeup} vwait ::wakeup } close $TRG(log) r_write_db { set tm [clock_milliseconds] trdb eval { REPLACE INTO config VALUES('end', $tm ); } set nErr [trdb one {SELECT count(*) FROM jobs WHERE state='failed'}] if {$nErr>0} { puts "$nErr failures:" |
︙ | ︙ |
Modified test/windowpushd.testfrom [d8895d08]to [c420e226].
︙ | ︙ | |||
93949596979899 | INSERT INTO t2 VALUES('Y', 1, 9); INSERT INTO t2 VALUES('Y', 4, 2); INSERT INTO t2 VALUES('Z', 3, 3); INSERT INTO t2 VALUES('Z', 3, 4);}foreach tn {0 1} { | >|>>> | 93949596979899105106107108109110111 | INSERT INTO t2 VALUES('Y', 1, 9); INSERT INTO t2 VALUES('Y', 4, 2); INSERT INTO t2 VALUES('Z', 3, 3); INSERT INTO t2 VALUES('Z', 3, 4);}foreach tn {0 1} { do_execsql_test 2.$tn.1.1 { SELECT * FROM v1; } { A 1 4 A 2 4 A 3 4 A 4 4 B 5 8 B 6 8 B 7 8 B 8 8 C 9 12 C 10 12 C 11 12 C 12 12 |
︙ | ︙ |
Modified test/with6.testfrom [e097a03e]to [9ff3503c].
︙ | ︙ | |||
326327328329330331332333334335336337338339 | # query flattening optimization.#reset_dbdb eval { CREATE TABLE raw(country,date,total,delta, UNIQUE(country,date));}do_eqp_test 400 { with recursive init(country, date, fin) AS (SELECT country, min(date), max(date) FROM raw WHERE total > 0 GROUP BY country), src(country, date) AS (SELECT raw.country, raw.date FROM raw JOIN init i on raw.country = i.country AND raw.date > i.date ORDER BY raw.country, raw.date), vals(country, date, x, y) AS (SELECT src.country, src.date, julianday(raw.date) - julianday(src.date), log(delta+1) FROM src JOIN raw on raw.country = src.country AND raw.date > date(src.date,'-7 days') AND raw.date <= src.date AND delta >= 0), | >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> | 326327328329330331332377378379380381382383 | # query flattening optimization.#reset_dbdb eval { CREATE TABLE raw(country,date,total,delta, UNIQUE(country,date));}do_eqp_test 400 { with recursive init(country, date, fin) AS (SELECT country, min(date), max(date) FROM raw WHERE total > 0 GROUP BY country), src(country, date) AS (SELECT raw.country, raw.date FROM raw JOIN init i on raw.country = i.country AND raw.date > i.date ORDER BY raw.country, raw.date), vals(country, date, x, y) AS (SELECT src.country, src.date, julianday(raw.date) - julianday(src.date), log(delta+1) FROM src JOIN raw on raw.country = src.country AND raw.date > date(src.date,'-7 days') AND raw.date <= src.date AND delta >= 0), |
︙ | ︙ |
Added tool/buildtclext.tcl version [b64d2505].
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> |
Added tool/find_tclconfig.tcl version [e64886ff].
>>>>>>>>>>>>>>>>>>>>>>>> |