Compare commits
127 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8bec96953b | |||
| ac18487e2a | |||
| ea602ac6b0 | |||
| 378c763eb3 | |||
| 5b878c61d3 | |||
| 199077fb70 | |||
| dafde4b7de | |||
| 0313979b6b | |||
| 1703ac81c7 | |||
| 63bb13dc5a | |||
| 3c1d7e4b84 | |||
| d01206ffc2 | |||
| 97060e5aa2 | |||
| 01a8ad231a | |||
| 3c48ee9e0e | |||
| 49e6e5a04f | |||
| 340fd0bc23 | |||
| 4cf34a5e73 | |||
| 66f9655599 | |||
| 93eb906488 | |||
| d685dd6be6 | |||
| 080fe6dec9 | |||
| f09a1794d8 | |||
| ca237a8b7b | |||
| 42d2aec1e9 | |||
| 8d81aac13f | |||
| 76f7b16f1e | |||
| 5a4a15fd2e | |||
| 8df014979e | |||
| eeee8a5f01 | |||
| 8e7c82ca3f | |||
| 918232aadb | |||
| e44ac3858c | |||
| 2b994ce5d3 | |||
| 176b04c476 | |||
| 8b04094c4f | |||
| 51ddfef74d | |||
| 42470513b7 | |||
| a7d8d4a07a | |||
| 0d3485f019 | |||
| 0f503f6696 | |||
| 3fee67533e | |||
| 776a578c21 | |||
| 67d4bbf6c1 | |||
| b0f23784f6 | |||
| 5cad178b86 | |||
| 21f0f694ff | |||
| a7eaa518f8 | |||
| 67c4ce131b | |||
| c9f1a7d1df | |||
| 6127d73abc | |||
| 7bdbe59829 | |||
| d8b4befdef | |||
| 0e8075ab78 | |||
| 44d441313a | |||
| 9c0fee296a | |||
| f1c43ea647 | |||
| 0ca23aa437 | |||
| 9d59e3b1bf | |||
| ab6098cfa6 | |||
| 3ddc3809bf | |||
| 407cfe994d | |||
| 632f0ed265 | |||
| 3fb7bd5ee0 | |||
| 55b2e8b062 | |||
| 662a1426cb | |||
| 4d17e30624 | |||
| ba34b79f15 | |||
| 099b385d17 | |||
| bc3c4e0830 | |||
| 3be2b860d0 | |||
| a1c467f51f | |||
| c5edbd1cf6 | |||
| a94c484584 | |||
| 4049ede97d | |||
| 0db20c490a | |||
| 45e4cb8e77 | |||
| 6d0053cfa7 | |||
| e7a377046d | |||
| 42c93b5e9f | |||
| 24ec37c3b3 | |||
| 657a7a66c3 | |||
| ddf4972063 | |||
| 52a0753152 | |||
| e58b2b4a80 | |||
| baca9807f9 | |||
| 7ae0549961 | |||
| b47e4c2819 | |||
| fb645d20bc | |||
| e021890954 | |||
| 1e6f334645 | |||
| 40942f22f1 | |||
| 5777380d19 | |||
| 7e398c04fe | |||
| b2e9640155 | |||
| 1b22ad8ae6 | |||
| 4bb4293b2a | |||
| 7f8653a257 | |||
| fa9011ec70 | |||
| 747cc9425d | |||
| 1f8f131a8b | |||
| feecc9f547 | |||
| 70149ba47e | |||
| 68d4f07577 | |||
| 0d08072b68 | |||
| a7e16a2f05 | |||
| bc7819d176 | |||
| b14d14696b | |||
| 05edf729f7 | |||
| 91be05a910 | |||
| 39b6bd5e17 | |||
| 5f0922b96c | |||
| e8dd6a4e77 | |||
| aae0f74e64 | |||
| 50f9f6c649 | |||
| 8718f0b613 | |||
| 0bff34aea3 | |||
| c6920cdb0c | |||
| fad1ad0526 | |||
| 3083d5f5ea | |||
| bb05976dac | |||
| 898ec7927a | |||
| 730629680a | |||
| eefef9ae80 | |||
| 1b1a1dda9e | |||
| 2d7a691fba | |||
| 531d01cae0 |
+2
-1
@@ -440,6 +440,7 @@ TESTSRC += \
|
||||
$(TOP)/ext/expert/sqlite3expert.c \
|
||||
$(TOP)/ext/expert/test_expert.c \
|
||||
$(TOP)/ext/misc/amatch.c \
|
||||
$(TOP)/ext/misc/appendvfs.c \
|
||||
$(TOP)/ext/misc/carray.c \
|
||||
$(TOP)/ext/misc/cksumvfs.c \
|
||||
$(TOP)/ext/misc/closure.c \
|
||||
@@ -1267,7 +1268,7 @@ fuzztest: fuzzcheck$(TEXE) $(FUZZDATA) sessionfuzz$(TEXE) $(TOP)/test/sessionfuz
|
||||
./sessionfuzz$(TEXE) run $(TOP)/test/sessionfuzz-data1.db
|
||||
|
||||
valgrindfuzz: fuzzcheck$(TEXT) $(FUZZDATA) sessionfuzz$(TEXE) $(TOP)/test/sessionfuzz-data1.db
|
||||
valgrind ./fuzzcheck$(TEXE) --cell-size-check --limit-mem 10M --timeout 600 $(FUZZDATA)
|
||||
valgrind ./fuzzcheck$(TEXE) --cell-size-check --limit-mem 10M $(FUZZDATA)
|
||||
valgrind ./sessionfuzz$(TEXE) run $(TOP)/test/sessionfuzz-data1.db
|
||||
|
||||
# The veryquick.test TCL tests.
|
||||
|
||||
@@ -1560,6 +1560,7 @@ TESTEXT = \
|
||||
$(TOP)\ext\expert\sqlite3expert.c \
|
||||
$(TOP)\ext\expert\test_expert.c \
|
||||
$(TOP)\ext\misc\amatch.c \
|
||||
$(TOP)\ext\misc\appendvfs.c \
|
||||
$(TOP)\ext\misc\carray.c \
|
||||
$(TOP)\ext\misc\cksumvfs.c \
|
||||
$(TOP)\ext\misc\closure.c \
|
||||
|
||||
@@ -303,6 +303,9 @@ OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_SESSION=1
|
||||
OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_PREUPDATE_HOOK=1
|
||||
!ENDIF
|
||||
|
||||
# Always enable math functions on Windows
|
||||
OPT_FEATURE_FLAGS = $(OPT_FEATURE_FLAGS) -DSQLITE_ENABLE_MATH_FUNCTIONS
|
||||
|
||||
# Should the rbu extension be enabled? If so, add compilation options
|
||||
# to enable it.
|
||||
#
|
||||
|
||||
@@ -111,14 +111,34 @@ AC_MSG_CHECKING([for whether to support dynamic extensions])
|
||||
AC_MSG_RESULT($enable_dynamic_extensions)
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# --enable-math
|
||||
#
|
||||
AC_ARG_ENABLE(math, [AS_HELP_STRING(
|
||||
[--enable-math], [SQL math functions [default=yes]])],
|
||||
[], [enable_math=yes])
|
||||
AC_MSG_CHECKING([SQL math functions])
|
||||
if test x"$enable_math" = "xyes"; then
|
||||
BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_MATH_FUNCTIONS"
|
||||
AC_MSG_RESULT([enabled])
|
||||
AC_SEARCH_LIBS(ceil, m)
|
||||
else
|
||||
AC_MSG_RESULT([disabled])
|
||||
fi
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
#-----------------------------------------------------------------------
|
||||
# --enable-fts4
|
||||
#
|
||||
AC_ARG_ENABLE(fts4, [AS_HELP_STRING(
|
||||
[--enable-fts4], [include fts4 support [default=yes]])],
|
||||
[], [enable_fts4=yes])
|
||||
AC_MSG_CHECKING([FTS4 extension])
|
||||
if test x"$enable_fts4" = "xyes"; then
|
||||
BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS4"
|
||||
AC_MSG_RESULT([enabled])
|
||||
else
|
||||
AC_MSG_RESULT([disabled])
|
||||
fi
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
@@ -128,8 +148,12 @@ fi
|
||||
AC_ARG_ENABLE(fts3, [AS_HELP_STRING(
|
||||
[--enable-fts3], [include fts3 support [default=no]])],
|
||||
[], [])
|
||||
AC_MSG_CHECKING([FTS3 extension])
|
||||
if test x"$enable_fts3" = "xyes" -a x"$enable_fts4" = "xno"; then
|
||||
BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS3"
|
||||
AC_MSG_RESULT([enabled])
|
||||
else
|
||||
AC_MSG_RESULT([disabled])
|
||||
fi
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
@@ -139,9 +163,13 @@ fi
|
||||
AC_ARG_ENABLE(fts5, [AS_HELP_STRING(
|
||||
[--enable-fts5], [include fts5 support [default=yes]])],
|
||||
[], [enable_fts5=yes])
|
||||
AC_MSG_CHECKING([FTS5 extension])
|
||||
if test x"$enable_fts5" = "xyes"; then
|
||||
AC_MSG_RESULT([enabled])
|
||||
AC_SEARCH_LIBS(log, m)
|
||||
BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_FTS5"
|
||||
else
|
||||
AC_MSG_RESULT([disabled])
|
||||
fi
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
@@ -151,8 +179,12 @@ fi
|
||||
AC_ARG_ENABLE(json1, [AS_HELP_STRING(
|
||||
[--enable-json1], [include json1 support [default=yes]])],
|
||||
[],[enable_json1=yes])
|
||||
AC_MSG_CHECKING([JSON functions])
|
||||
if test x"$enable_json1" = "xyes"; then
|
||||
BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_JSON1"
|
||||
AC_MSG_RESULT([enabled])
|
||||
else
|
||||
AC_MSG_RESULT([disabled])
|
||||
fi
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
@@ -162,8 +194,12 @@ fi
|
||||
AC_ARG_ENABLE(rtree, [AS_HELP_STRING(
|
||||
[--enable-rtree], [include rtree support [default=yes]])],
|
||||
[], [enable_rtree=yes])
|
||||
AC_MSG_CHECKING([RTREE extension])
|
||||
if test x"$enable_rtree" = "xyes"; then
|
||||
BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_RTREE -DSQLITE_ENABLE_GEOPOLY"
|
||||
AC_MSG_RESULT([enabled])
|
||||
else
|
||||
AC_MSG_RESULT([disabled])
|
||||
fi
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
@@ -173,8 +209,12 @@ fi
|
||||
AC_ARG_ENABLE(session, [AS_HELP_STRING(
|
||||
[--enable-session], [enable the session extension [default=no]])],
|
||||
[], [])
|
||||
AC_MSG_CHECKING([Session extension])
|
||||
if test x"$enable_session" = "xyes"; then
|
||||
BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_ENABLE_SESSION -DSQLITE_ENABLE_PREUPDATE_HOOK"
|
||||
AC_MSG_RESULT([enabled])
|
||||
else
|
||||
AC_MSG_RESULT([disabled])
|
||||
fi
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
@@ -184,9 +224,13 @@ fi
|
||||
AC_ARG_ENABLE(debug, [AS_HELP_STRING(
|
||||
[--enable-debug], [build with debugging features enabled [default=no]])],
|
||||
[], [])
|
||||
AC_MSG_CHECKING([Build type])
|
||||
if test x"$enable_debug" = "xyes"; then
|
||||
BUILD_CFLAGS="$BUILD_CFLAGS -DSQLITE_DEBUG -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE"
|
||||
CFLAGS="-g -O0"
|
||||
AC_MSG_RESULT([debug])
|
||||
else
|
||||
AC_MSG_RESULT([release])
|
||||
fi
|
||||
#-----------------------------------------------------------------------
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#! /bin/sh
|
||||
# Guess values for system-dependent variables and create Makefiles.
|
||||
# Generated by GNU Autoconf 2.69 for sqlite 3.35.0.
|
||||
# Generated by GNU Autoconf 2.69 for sqlite 3.35.4.
|
||||
#
|
||||
#
|
||||
# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
|
||||
@@ -726,8 +726,8 @@ MAKEFLAGS=
|
||||
# Identity of this package.
|
||||
PACKAGE_NAME='sqlite'
|
||||
PACKAGE_TARNAME='sqlite'
|
||||
PACKAGE_VERSION='3.35.0'
|
||||
PACKAGE_STRING='sqlite 3.35.0'
|
||||
PACKAGE_VERSION='3.35.4'
|
||||
PACKAGE_STRING='sqlite 3.35.4'
|
||||
PACKAGE_BUGREPORT=''
|
||||
PACKAGE_URL=''
|
||||
|
||||
@@ -904,9 +904,9 @@ enable_debug
|
||||
enable_amalgamation
|
||||
enable_load_extension
|
||||
enable_math
|
||||
enable_all
|
||||
enable_memsys5
|
||||
enable_memsys3
|
||||
enable_all
|
||||
enable_fts3
|
||||
enable_fts4
|
||||
enable_fts5
|
||||
@@ -1467,7 +1467,7 @@ if test "$ac_init_help" = "long"; then
|
||||
# Omit some internal or obsolete options to make the list less imposing.
|
||||
# This message is too long to be a string in the A/UX 3.1 sh.
|
||||
cat <<_ACEOF
|
||||
\`configure' configures sqlite 3.35.0 to adapt to many kinds of systems.
|
||||
\`configure' configures sqlite 3.35.4 to adapt to many kinds of systems.
|
||||
|
||||
Usage: $0 [OPTION]... [VAR=VALUE]...
|
||||
|
||||
@@ -1532,7 +1532,7 @@ fi
|
||||
|
||||
if test -n "$ac_init_help"; then
|
||||
case $ac_init_help in
|
||||
short | recursive ) echo "Configuration of sqlite 3.35.0:";;
|
||||
short | recursive ) echo "Configuration of sqlite 3.35.4:";;
|
||||
esac
|
||||
cat <<\_ACEOF
|
||||
|
||||
@@ -1559,9 +1559,9 @@ Optional Features:
|
||||
--disable-load-extension
|
||||
Disable loading of external extensions
|
||||
--disable-math Disable math functions
|
||||
--enable-all Enable FTS4, FTS5, Geopoly, JSON, RTree, Sessions
|
||||
--enable-memsys5 Enable MEMSYS5
|
||||
--enable-memsys3 Enable MEMSYS3
|
||||
--enable-all Enable FTS4, FTS5, Geopoly, JSON, RTree, Sessions
|
||||
--enable-fts3 Enable the FTS3 extension
|
||||
--enable-fts4 Enable the FTS4 extension
|
||||
--enable-fts5 Enable the FTS5 extension
|
||||
@@ -1660,7 +1660,7 @@ fi
|
||||
test -n "$ac_init_help" && exit $ac_status
|
||||
if $ac_init_version; then
|
||||
cat <<\_ACEOF
|
||||
sqlite configure 3.35.0
|
||||
sqlite configure 3.35.4
|
||||
generated by GNU Autoconf 2.69
|
||||
|
||||
Copyright (C) 2012 Free Software Foundation, Inc.
|
||||
@@ -2079,7 +2079,7 @@ cat >config.log <<_ACEOF
|
||||
This file contains any messages produced by compilers while
|
||||
running configure, to aid debugging if configure makes a mistake.
|
||||
|
||||
It was created by sqlite $as_me 3.35.0, which was
|
||||
It was created by sqlite $as_me 3.35.4, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
$ $0 $@
|
||||
@@ -11251,10 +11251,16 @@ if test "${enable_debug+set}" = set; then :
|
||||
enableval=$enable_debug;
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build type" >&5
|
||||
$as_echo_n "checking build type... " >&6; }
|
||||
if test "${enable_debug}" = "yes" ; then
|
||||
TARGET_DEBUG="-DSQLITE_DEBUG=1 -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE -O0"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: debug" >&5
|
||||
$as_echo "debug" >&6; }
|
||||
else
|
||||
TARGET_DEBUG="-DNDEBUG"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: release" >&5
|
||||
$as_echo "release" >&6; }
|
||||
fi
|
||||
|
||||
|
||||
@@ -11490,6 +11496,16 @@ fi
|
||||
|
||||
fi
|
||||
|
||||
|
||||
########
|
||||
# The --enable-all argument is short-hand to enable
|
||||
# multiple extensions.
|
||||
# Check whether --enable-all was given.
|
||||
if test "${enable_all+set}" = set; then :
|
||||
enableval=$enable_all;
|
||||
fi
|
||||
|
||||
|
||||
##########
|
||||
# Do we want to support memsys3 and/or memsys5
|
||||
#
|
||||
@@ -11524,15 +11540,6 @@ else
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
########
|
||||
# The --enable-extensions argument is short-hand to enable
|
||||
# multiple extensions.
|
||||
# Check whether --enable-all was given.
|
||||
if test "${enable_all+set}" = set; then :
|
||||
enableval=$enable_all;
|
||||
fi
|
||||
|
||||
|
||||
#########
|
||||
# See whether we should enable Full Text Search extensions
|
||||
# Check whether --enable-fts3 was given.
|
||||
@@ -11540,15 +11547,26 @@ if test "${enable_fts3+set}" = set; then :
|
||||
enableval=$enable_fts3;
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support FTS3" >&5
|
||||
$as_echo_n "checking whether to support FTS3... " >&6; }
|
||||
if test "${enable_fts3}" = "yes" ; then
|
||||
OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_FTS3"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
# Check whether --enable-fts4 was given.
|
||||
if test "${enable_fts4+set}" = set; then :
|
||||
enableval=$enable_fts4;
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support FTS4" >&5
|
||||
$as_echo_n "checking whether to support FTS4... " >&6; }
|
||||
if test "${enable_fts4}" = "yes" -o "${enable_all}" = "yes" ; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_FTS4"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing log" >&5
|
||||
$as_echo_n "checking for library containing log... " >&6; }
|
||||
@@ -11606,13 +11624,20 @@ if test "$ac_res" != no; then :
|
||||
|
||||
fi
|
||||
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
# Check whether --enable-fts5 was given.
|
||||
if test "${enable_fts5+set}" = set; then :
|
||||
enableval=$enable_fts5;
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support FTS5" >&5
|
||||
$as_echo_n "checking whether to support FTS5... " >&6; }
|
||||
if test "${enable_fts5}" = "yes" -o "${enable_all}" = "yes" ; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_FTS5"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing log" >&5
|
||||
$as_echo_n "checking for library containing log... " >&6; }
|
||||
@@ -11670,6 +11695,9 @@ if test "$ac_res" != no; then :
|
||||
|
||||
fi
|
||||
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
#########
|
||||
@@ -11679,8 +11707,15 @@ if test "${enable_json1+set}" = set; then :
|
||||
enableval=$enable_json1;
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support JSON" >&5
|
||||
$as_echo_n "checking whether to support JSON... " >&6; }
|
||||
if test "${enable_json1}" = "yes" -o "${enable_all}" = "yes" ; then
|
||||
OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_JSON1"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
#########
|
||||
@@ -11691,8 +11726,15 @@ if test "${enable_update_limit+set}" = set; then :
|
||||
enableval=$enable_update_limit;
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support LIMIT on UPDATE and DELETE statements" >&5
|
||||
$as_echo_n "checking whether to support LIMIT on UPDATE and DELETE statements... " >&6; }
|
||||
if test "${enable_update_limit}" = "yes" ; then
|
||||
OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
#########
|
||||
@@ -11704,9 +11746,16 @@ else
|
||||
enable_geopoly=no
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support GEOPOLY" >&5
|
||||
$as_echo_n "checking whether to support GEOPOLY... " >&6; }
|
||||
if test "${enable_geopoly}" = "yes" -o "${enable_all}" = "yes" ; then
|
||||
OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_GEOPOLY"
|
||||
enable_rtree=yes
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
#########
|
||||
@@ -11716,8 +11765,15 @@ if test "${enable_rtree+set}" = set; then :
|
||||
enableval=$enable_rtree;
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support RTREE" >&5
|
||||
$as_echo_n "checking whether to support RTREE... " >&6; }
|
||||
if test "${enable_rtree}" = "yes" ; then
|
||||
OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_RTREE"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
#########
|
||||
@@ -11727,9 +11783,16 @@ if test "${enable_session+set}" = set; then :
|
||||
enableval=$enable_session;
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to support SESSION" >&5
|
||||
$as_echo_n "checking whether to support SESSION... " >&6; }
|
||||
if test "${enable_session}" = "yes" -o "${enable_all}" = "yes" ; then
|
||||
OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_SESSION"
|
||||
OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_PREUPDATE_HOOK"
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
fi
|
||||
|
||||
#########
|
||||
@@ -12315,7 +12378,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
|
||||
# report actual input values of CONFIG_FILES etc. instead of their
|
||||
# values after options handling.
|
||||
ac_log="
|
||||
This file was extended by sqlite $as_me 3.35.0, which was
|
||||
This file was extended by sqlite $as_me 3.35.4, which was
|
||||
generated by GNU Autoconf 2.69. Invocation command line was
|
||||
|
||||
CONFIG_FILES = $CONFIG_FILES
|
||||
@@ -12381,7 +12444,7 @@ _ACEOF
|
||||
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
|
||||
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
|
||||
ac_cs_version="\\
|
||||
sqlite config.status 3.35.0
|
||||
sqlite config.status 3.35.4
|
||||
configured by $0, generated by GNU Autoconf 2.69,
|
||||
with options \\"\$ac_cs_config\\"
|
||||
|
||||
|
||||
+42
-6
@@ -555,10 +555,13 @@ AC_SEARCH_LIBS(fdatasync, [rt])
|
||||
#########
|
||||
# check for debug enabled
|
||||
AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],[enable debugging & verbose explain]))
|
||||
AC_MSG_CHECKING([build type])
|
||||
if test "${enable_debug}" = "yes" ; then
|
||||
TARGET_DEBUG="-DSQLITE_DEBUG=1 -DSQLITE_ENABLE_SELECTTRACE -DSQLITE_ENABLE_WHERETRACE -O0"
|
||||
AC_MSG_RESULT([debug])
|
||||
else
|
||||
TARGET_DEBUG="-DNDEBUG"
|
||||
AC_MSG_RESULT([release])
|
||||
fi
|
||||
AC_SUBST(TARGET_DEBUG)
|
||||
|
||||
@@ -602,6 +605,13 @@ else
|
||||
AC_SEARCH_LIBS(ceil, m)
|
||||
fi
|
||||
|
||||
|
||||
########
|
||||
# The --enable-all argument is short-hand to enable
|
||||
# multiple extensions.
|
||||
AC_ARG_ENABLE(all, AC_HELP_STRING([--enable-all],
|
||||
[Enable FTS4, FTS5, Geopoly, JSON, RTree, Sessions]))
|
||||
|
||||
##########
|
||||
# Do we want to support memsys3 and/or memsys5
|
||||
#
|
||||
@@ -624,37 +634,47 @@ else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
########
|
||||
# The --enable-extensions argument is short-hand to enable
|
||||
# multiple extensions.
|
||||
AC_ARG_ENABLE(all, AC_HELP_STRING([--enable-all],
|
||||
[Enable FTS4, FTS5, Geopoly, JSON, RTree, Sessions]))
|
||||
|
||||
#########
|
||||
# See whether we should enable Full Text Search extensions
|
||||
AC_ARG_ENABLE(fts3, AC_HELP_STRING([--enable-fts3],
|
||||
[Enable the FTS3 extension]))
|
||||
AC_MSG_CHECKING([whether to support FTS3])
|
||||
if test "${enable_fts3}" = "yes" ; then
|
||||
OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_FTS3"
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
AC_ARG_ENABLE(fts4, AC_HELP_STRING([--enable-fts4],
|
||||
[Enable the FTS4 extension]))
|
||||
AC_MSG_CHECKING([whether to support FTS4])
|
||||
if test "${enable_fts4}" = "yes" -o "${enable_all}" = "yes" ; then
|
||||
AC_MSG_RESULT([yes])
|
||||
OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_FTS4"
|
||||
AC_SEARCH_LIBS([log],[m])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
AC_ARG_ENABLE(fts5, AC_HELP_STRING([--enable-fts5],
|
||||
[Enable the FTS5 extension]))
|
||||
AC_MSG_CHECKING([whether to support FTS5])
|
||||
if test "${enable_fts5}" = "yes" -o "${enable_all}" = "yes" ; then
|
||||
AC_MSG_RESULT([yes])
|
||||
OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_FTS5"
|
||||
AC_SEARCH_LIBS([log],[m])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
#########
|
||||
# See whether we should enable JSON1
|
||||
AC_ARG_ENABLE(json1, AC_HELP_STRING([--enable-json1],[Enable the JSON1 extension]))
|
||||
AC_MSG_CHECKING([whether to support JSON])
|
||||
if test "${enable_json1}" = "yes" -o "${enable_all}" = "yes" ; then
|
||||
OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_JSON1"
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
#########
|
||||
@@ -662,8 +682,12 @@ fi
|
||||
# statements.
|
||||
AC_ARG_ENABLE(update-limit, AC_HELP_STRING([--enable-update-limit],
|
||||
[Enable the UPDATE/DELETE LIMIT clause]))
|
||||
AC_MSG_CHECKING([whether to support LIMIT on UPDATE and DELETE statements])
|
||||
if test "${enable_update_limit}" = "yes" ; then
|
||||
OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_UPDATE_DELETE_LIMIT"
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
#########
|
||||
@@ -671,26 +695,38 @@ fi
|
||||
AC_ARG_ENABLE(geopoly, AC_HELP_STRING([--enable-geopoly],
|
||||
[Enable the GEOPOLY extension]),
|
||||
[enable_geopoly=yes],[enable_geopoly=no])
|
||||
AC_MSG_CHECKING([whether to support GEOPOLY])
|
||||
if test "${enable_geopoly}" = "yes" -o "${enable_all}" = "yes" ; then
|
||||
OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_GEOPOLY"
|
||||
enable_rtree=yes
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
#########
|
||||
# See whether we should enable RTREE
|
||||
AC_ARG_ENABLE(rtree, AC_HELP_STRING([--enable-rtree],
|
||||
[Enable the RTREE extension]))
|
||||
AC_MSG_CHECKING([whether to support RTREE])
|
||||
if test "${enable_rtree}" = "yes" ; then
|
||||
OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_RTREE"
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
#########
|
||||
# See whether we should enable the SESSION extension
|
||||
AC_ARG_ENABLE(session, AC_HELP_STRING([--enable-session],
|
||||
[Enable the SESSION extension]))
|
||||
AC_MSG_CHECKING([whether to support SESSION])
|
||||
if test "${enable_session}" = "yes" -o "${enable_all}" = "yes" ; then
|
||||
OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_SESSION"
|
||||
OPT_FEATURE_FLAGS="${OPT_FEATURE_FLAGS} -DSQLITE_ENABLE_PREUPDATE_HOOK"
|
||||
AC_MSG_RESULT([yes])
|
||||
else
|
||||
AC_MSG_RESULT([no])
|
||||
fi
|
||||
|
||||
#########
|
||||
|
||||
+2
-2
@@ -5212,9 +5212,9 @@ static int fts3EvalNearTrim(
|
||||
);
|
||||
if( res ){
|
||||
nNew = (int)(pOut - pPhrase->doclist.pList) - 1;
|
||||
if( nNew>=0 ){
|
||||
assert_fts3_nc( nNew<=pPhrase->doclist.nList && nNew>0 );
|
||||
if( nNew>=0 && nNew<=pPhrase->doclist.nList ){
|
||||
assert( pPhrase->doclist.pList[nNew]=='\0' );
|
||||
assert( nNew<=pPhrase->doclist.nList && nNew>0 );
|
||||
memset(&pPhrase->doclist.pList[nNew], 0, pPhrase->doclist.nList - nNew);
|
||||
pPhrase->doclist.nList = nNew;
|
||||
}
|
||||
|
||||
@@ -493,6 +493,11 @@ static int getNextNode(
|
||||
if( *zInput=='(' ){
|
||||
int nConsumed = 0;
|
||||
pParse->nNest++;
|
||||
#if !defined(SQLITE_MAX_EXPR_DEPTH)
|
||||
if( pParse->nNest>1000 ) return SQLITE_ERROR;
|
||||
#elif SQLITE_MAX_EXPR_DEPTH>0
|
||||
if( pParse->nNest>SQLITE_MAX_EXPR_DEPTH ) return SQLITE_ERROR;
|
||||
#endif
|
||||
rc = fts3ExprParse(pParse, zInput+1, nInput-1, ppExpr, &nConsumed);
|
||||
*pnConsumed = (int)(zInput - z) + 1 + nConsumed;
|
||||
return rc;
|
||||
|
||||
@@ -285,6 +285,7 @@ static int unicodeOpen(
|
||||
pCsr->aInput = (const unsigned char *)aInput;
|
||||
if( aInput==0 ){
|
||||
pCsr->nInput = 0;
|
||||
pCsr->aInput = (const unsigned char*)"";
|
||||
}else if( nInput<0 ){
|
||||
pCsr->nInput = (int)strlen(aInput);
|
||||
}else{
|
||||
|
||||
+18
-19
@@ -4335,27 +4335,26 @@ static int fts3IncrmergeLoad(
|
||||
while( reader.aNode && rc==SQLITE_OK ) rc = nodeReaderNext(&reader);
|
||||
blobGrowBuffer(&pNode->key, reader.term.n, &rc);
|
||||
if( rc==SQLITE_OK ){
|
||||
if( reader.term.n<=0 ){
|
||||
rc = FTS_CORRUPT_VTAB;
|
||||
}else{
|
||||
assert_fts3_nc( reader.term.n>0 || reader.aNode==0 );
|
||||
if( reader.term.n>0 ){
|
||||
memcpy(pNode->key.a, reader.term.a, reader.term.n);
|
||||
pNode->key.n = reader.term.n;
|
||||
if( i>0 ){
|
||||
char *aBlock = 0;
|
||||
int nBlock = 0;
|
||||
pNode = &pWriter->aNodeWriter[i-1];
|
||||
pNode->iBlock = reader.iChild;
|
||||
rc = sqlite3Fts3ReadBlock(p, reader.iChild, &aBlock, &nBlock,0);
|
||||
blobGrowBuffer(&pNode->block,
|
||||
MAX(nBlock, p->nNodeSize)+FTS3_NODE_PADDING, &rc
|
||||
);
|
||||
if( rc==SQLITE_OK ){
|
||||
memcpy(pNode->block.a, aBlock, nBlock);
|
||||
pNode->block.n = nBlock;
|
||||
memset(&pNode->block.a[nBlock], 0, FTS3_NODE_PADDING);
|
||||
}
|
||||
sqlite3_free(aBlock);
|
||||
}
|
||||
pNode->key.n = reader.term.n;
|
||||
if( i>0 ){
|
||||
char *aBlock = 0;
|
||||
int nBlock = 0;
|
||||
pNode = &pWriter->aNodeWriter[i-1];
|
||||
pNode->iBlock = reader.iChild;
|
||||
rc = sqlite3Fts3ReadBlock(p, reader.iChild, &aBlock, &nBlock,0);
|
||||
blobGrowBuffer(&pNode->block,
|
||||
MAX(nBlock, p->nNodeSize)+FTS3_NODE_PADDING, &rc
|
||||
);
|
||||
if( rc==SQLITE_OK ){
|
||||
memcpy(pNode->block.a, aBlock, nBlock);
|
||||
pNode->block.n = nBlock;
|
||||
memset(&pNode->block.a[nBlock], 0, FTS3_NODE_PADDING);
|
||||
}
|
||||
sqlite3_free(aBlock);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+10
-4
@@ -4822,6 +4822,9 @@ static void fts5DoclistIterNext(Fts5DoclistIter *pIter){
|
||||
}
|
||||
|
||||
pIter->aPoslist = p;
|
||||
if( &pIter->aPoslist[pIter->nPoslist]>pIter->aEof ){
|
||||
pIter->aPoslist = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4830,9 +4833,11 @@ static void fts5DoclistIterInit(
|
||||
Fts5DoclistIter *pIter
|
||||
){
|
||||
memset(pIter, 0, sizeof(*pIter));
|
||||
pIter->aPoslist = pBuf->p;
|
||||
pIter->aEof = &pBuf->p[pBuf->n];
|
||||
fts5DoclistIterNext(pIter);
|
||||
if( pBuf->n>0 ){
|
||||
pIter->aPoslist = pBuf->p;
|
||||
pIter->aEof = &pBuf->p[pBuf->n];
|
||||
fts5DoclistIterNext(pIter);
|
||||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
@@ -5594,8 +5599,9 @@ int sqlite3Fts5IterNextFrom(Fts5IndexIter *pIndexIter, i64 iMatch){
|
||||
const char *sqlite3Fts5IterTerm(Fts5IndexIter *pIndexIter, int *pn){
|
||||
int n;
|
||||
const char *z = (const char*)fts5MultiIterTerm((Fts5Iter*)pIndexIter, &n);
|
||||
assert_nc( z || n<=1 );
|
||||
*pn = n-1;
|
||||
return &z[1];
|
||||
return (z ? &z[1] : 0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -2177,7 +2177,8 @@ static int fts5ApiPhraseFirst(
|
||||
int n;
|
||||
int rc = fts5CsrPoslist(pCsr, iPhrase, &pIter->a, &n);
|
||||
if( rc==SQLITE_OK ){
|
||||
pIter->b = &pIter->a[n];
|
||||
assert( pIter->a || n==0 );
|
||||
pIter->b = (pIter->a ? &pIter->a[n] : 0);
|
||||
*piCol = 0;
|
||||
*piOff = 0;
|
||||
fts5ApiPhraseNext(pCtx, pIter, piCol, piOff);
|
||||
@@ -2236,7 +2237,8 @@ static int fts5ApiPhraseFirstColumn(
|
||||
rc = sqlite3Fts5ExprPhraseCollist(pCsr->pExpr, iPhrase, &pIter->a, &n);
|
||||
}
|
||||
if( rc==SQLITE_OK ){
|
||||
pIter->b = &pIter->a[n];
|
||||
assert( pIter->a || n==0 );
|
||||
pIter->b = (pIter->a ? &pIter->a[n] : 0);
|
||||
*piCol = 0;
|
||||
fts5ApiPhraseNextColumn(pCtx, pIter, piCol);
|
||||
}
|
||||
@@ -2244,7 +2246,8 @@ static int fts5ApiPhraseFirstColumn(
|
||||
int n;
|
||||
rc = fts5CsrPoslist(pCsr, iPhrase, &pIter->a, &n);
|
||||
if( rc==SQLITE_OK ){
|
||||
pIter->b = &pIter->a[n];
|
||||
assert( pIter->a || n==0 );
|
||||
pIter->b = (pIter->a ? &pIter->a[n] : 0);
|
||||
if( n<=0 ){
|
||||
*piCol = -1;
|
||||
}else if( pIter->a[0]==0x01 ){
|
||||
@@ -2722,7 +2725,7 @@ int sqlite3Fts5GetTokenizer(
|
||||
*pzErr = sqlite3_mprintf("no such tokenizer: %s", azArg[0]);
|
||||
}else{
|
||||
rc = pMod->x.xCreate(
|
||||
pMod->pUserData, &azArg[1], (nArg?nArg-1:0), &pConfig->pTok
|
||||
pMod->pUserData, (azArg?&azArg[1]:0), (nArg?nArg-1:0), &pConfig->pTok
|
||||
);
|
||||
pConfig->pTokApi = &pMod->x;
|
||||
if( rc!=SQLITE_OK ){
|
||||
|
||||
@@ -211,7 +211,7 @@ static int fts5tokConnectMethod(
|
||||
|
||||
rc = pApi->xFindTokenizer(pApi, zModule, &pTokCtx, &pTab->tok);
|
||||
if( rc==SQLITE_OK ){
|
||||
const char **azArg = (const char **)&azDequote[1];
|
||||
const char **azArg = (nDequote>1 ? (const char **)&azDequote[1] : 0);
|
||||
int nArg = nDequote>0 ? nDequote-1 : 0;
|
||||
rc = pTab->tok.xCreate(pTokCtx, azArg, nArg, &pTab->pTok);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+220
-116
@@ -14,24 +14,23 @@
|
||||
** appended onto the end of some other file, such as an executable.
|
||||
**
|
||||
** A special record must appear at the end of the file that identifies the
|
||||
** file as an appended database and provides an offset to page 1. For
|
||||
** best performance page 1 should be located at a disk page boundary, though
|
||||
** that is not required.
|
||||
** file as an appended database and provides the offset to the first page
|
||||
** of the exposed content. (Or, it is the length of the content prefix.)
|
||||
** For best performance page 1 should be located at a disk page boundary,
|
||||
** though that is not required.
|
||||
**
|
||||
** When opening a database using this VFS, the connection might treat
|
||||
** the file as an ordinary SQLite database, or it might treat is as a
|
||||
** database appended onto some other file. Here are the rules:
|
||||
** the file as an ordinary SQLite database, or it might treat it as a
|
||||
** database appended onto some other file. The decision is made by
|
||||
** applying the following rules in order:
|
||||
**
|
||||
** (1) When opening a new empty file, that file is treated as an ordinary
|
||||
** database.
|
||||
** (1) An empty file is an ordinary database.
|
||||
**
|
||||
** (2) When opening a file that begins with the standard SQLite prefix
|
||||
** string "SQLite format 3", that file is treated as an ordinary
|
||||
** database.
|
||||
** (2) If the file ends with the appendvfs trailer string
|
||||
** "Start-Of-SQLite3-NNNNNNNN" that file is an appended database.
|
||||
**
|
||||
** (3) When opening a file that ends with the appendvfs trailer string
|
||||
** "Start-Of-SQLite3-NNNNNNNN" that file is treated as an appended
|
||||
** database.
|
||||
** (3) If the file begins with the standard SQLite prefix string
|
||||
** "SQLite format 3", that file is an ordinary database.
|
||||
**
|
||||
** (4) If none of the above apply and the SQLITE_OPEN_CREATE flag is
|
||||
** set, then a new database is appended to the already existing file.
|
||||
@@ -39,13 +38,13 @@
|
||||
** (5) Otherwise, SQLITE_CANTOPEN is returned.
|
||||
**
|
||||
** To avoid unnecessary complications with the PENDING_BYTE, the size of
|
||||
** the file containing the database is limited to 1GB. This VFS will refuse
|
||||
** to read or write past the 1GB mark. This restriction might be lifted in
|
||||
** future versions. For now, if you need a large database, then keep the
|
||||
** database in a separate file.
|
||||
** the file containing the database is limited to 1GiB. (1073741824 bytes)
|
||||
** This VFS will not read or write past the 1GiB mark. This restriction
|
||||
** might be lifted in future versions. For now, if you need a larger
|
||||
** database, then keep it in a separate file.
|
||||
**
|
||||
** If the file being opened is not an appended database, then this shim is
|
||||
** a pass-through into the default underlying VFS.
|
||||
** If the file being opened is a plain database (not an appended one), then
|
||||
** this shim is a pass-through into the default underlying VFS. (rule 3)
|
||||
**/
|
||||
#include "sqlite3ext.h"
|
||||
SQLITE_EXTENSION_INIT1
|
||||
@@ -58,17 +57,27 @@ SQLITE_EXTENSION_INIT1
|
||||
** 123456789 123456789 12345
|
||||
**
|
||||
** The NNNNNNNN represents a 64-bit big-endian unsigned integer which is
|
||||
** the offset to page 1.
|
||||
** the offset to page 1, and also the length of the prefix content.
|
||||
*/
|
||||
#define APND_MARK_PREFIX "Start-Of-SQLite3-"
|
||||
#define APND_MARK_PREFIX_SZ 17
|
||||
#define APND_MARK_SIZE 25
|
||||
#define APND_MARK_FOS_SZ 8
|
||||
#define APND_MARK_SIZE (APND_MARK_PREFIX_SZ+APND_MARK_FOS_SZ)
|
||||
|
||||
/*
|
||||
** Maximum size of the combined prefix + database + append-mark. This
|
||||
** must be less than 0x40000000 to avoid locking issues on Windows.
|
||||
*/
|
||||
#define APND_MAX_SIZE (65536*15259)
|
||||
#define APND_MAX_SIZE (0x40000000)
|
||||
|
||||
/*
|
||||
** Try to align the database to an even multiple of APND_ROUNDUP bytes.
|
||||
*/
|
||||
#ifndef APND_ROUNDUP
|
||||
#define APND_ROUNDUP 4096
|
||||
#endif
|
||||
#define APND_ALIGN_MASK ((sqlite3_int64)(APND_ROUNDUP-1))
|
||||
#define APND_START_ROUNDUP(fsz) (((fsz)+APND_ALIGN_MASK) & ~APND_ALIGN_MASK)
|
||||
|
||||
/*
|
||||
** Forward declaration of objects used by this utility
|
||||
@@ -82,11 +91,45 @@ typedef struct ApndFile ApndFile;
|
||||
#define ORIGVFS(p) ((sqlite3_vfs*)((p)->pAppData))
|
||||
#define ORIGFILE(p) ((sqlite3_file*)(((ApndFile*)(p))+1))
|
||||
|
||||
/* An open file */
|
||||
/* An open appendvfs file
|
||||
**
|
||||
** An instance of this structure describes the appended database file.
|
||||
** A separate sqlite3_file object is always appended. The appended
|
||||
** sqlite3_file object (which can be accessed using ORIGFILE()) describes
|
||||
** the entire file, including the prefix, the database, and the
|
||||
** append-mark.
|
||||
**
|
||||
** The structure of an AppendVFS database is like this:
|
||||
**
|
||||
** +-------------+---------+----------+-------------+
|
||||
** | prefix-file | padding | database | append-mark |
|
||||
** +-------------+---------+----------+-------------+
|
||||
** ^ ^
|
||||
** | |
|
||||
** iPgOne iMark
|
||||
**
|
||||
**
|
||||
** "prefix file" - file onto which the database has been appended.
|
||||
** "padding" - zero or more bytes inserted so that "database"
|
||||
** starts on an APND_ROUNDUP boundary
|
||||
** "database" - The SQLite database file
|
||||
** "append-mark" - The 25-byte "Start-Of-SQLite3-NNNNNNNN" that indicates
|
||||
** the offset from the start of prefix-file to the start
|
||||
** of "database".
|
||||
**
|
||||
** The size of the database is iMark - iPgOne.
|
||||
**
|
||||
** The NNNNNNNN in the "Start-Of-SQLite3-NNNNNNNN" suffix is the value
|
||||
** of iPgOne stored as a big-ending 64-bit integer.
|
||||
**
|
||||
** iMark will be the size of the underlying file minus 25 (APND_MARKSIZE).
|
||||
** Or, iMark is -1 to indicate that it has not yet been written.
|
||||
*/
|
||||
struct ApndFile {
|
||||
sqlite3_file base; /* IO methods */
|
||||
sqlite3_int64 iPgOne; /* File offset to page 1 */
|
||||
sqlite3_int64 iMark; /* Start of the append-mark */
|
||||
sqlite3_file base; /* Subclass. MUST BE FIRST! */
|
||||
sqlite3_int64 iPgOne; /* Offset to the start of the database */
|
||||
sqlite3_int64 iMark; /* Offset of the append mark. -1 if unwritten */
|
||||
/* Always followed by another sqlite3_file that describes the whole file */
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -178,8 +221,6 @@ static const sqlite3_io_methods apnd_io_methods = {
|
||||
apndUnfetch /* xUnfetch */
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*
|
||||
** Close an apnd-file.
|
||||
*/
|
||||
@@ -197,22 +238,37 @@ static int apndRead(
|
||||
int iAmt,
|
||||
sqlite_int64 iOfst
|
||||
){
|
||||
ApndFile *p = (ApndFile *)pFile;
|
||||
ApndFile *paf = (ApndFile *)pFile;
|
||||
pFile = ORIGFILE(pFile);
|
||||
return pFile->pMethods->xRead(pFile, zBuf, iAmt, iOfst+p->iPgOne);
|
||||
return pFile->pMethods->xRead(pFile, zBuf, iAmt, paf->iPgOne+iOfst);
|
||||
}
|
||||
|
||||
/*
|
||||
** Add the append-mark onto the end of the file.
|
||||
** Add the append-mark onto what should become the end of the file.
|
||||
* If and only if this succeeds, internal ApndFile.iMark is updated.
|
||||
* Parameter iWriteEnd is the appendvfs-relative offset of the new mark.
|
||||
*/
|
||||
static int apndWriteMark(ApndFile *p, sqlite3_file *pFile){
|
||||
int i;
|
||||
static int apndWriteMark(
|
||||
ApndFile *paf,
|
||||
sqlite3_file *pFile,
|
||||
sqlite_int64 iWriteEnd
|
||||
){
|
||||
sqlite_int64 iPgOne = paf->iPgOne;
|
||||
unsigned char a[APND_MARK_SIZE];
|
||||
int i = APND_MARK_FOS_SZ;
|
||||
int rc;
|
||||
assert(pFile == ORIGFILE(paf));
|
||||
memcpy(a, APND_MARK_PREFIX, APND_MARK_PREFIX_SZ);
|
||||
for(i=0; i<8; i++){
|
||||
a[APND_MARK_PREFIX_SZ+i] = (p->iPgOne >> (56 - i*8)) & 0xff;
|
||||
while( --i >= 0 ){
|
||||
a[APND_MARK_PREFIX_SZ+i] = (unsigned char)(iPgOne & 0xff);
|
||||
iPgOne >>= 8;
|
||||
}
|
||||
return pFile->pMethods->xWrite(pFile, a, APND_MARK_SIZE, p->iMark);
|
||||
iWriteEnd += paf->iPgOne;
|
||||
if( SQLITE_OK==(rc = pFile->pMethods->xWrite
|
||||
(pFile, a, APND_MARK_SIZE, iWriteEnd)) ){
|
||||
paf->iMark = iWriteEnd;
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -224,38 +280,28 @@ static int apndWrite(
|
||||
int iAmt,
|
||||
sqlite_int64 iOfst
|
||||
){
|
||||
int rc;
|
||||
ApndFile *p = (ApndFile *)pFile;
|
||||
ApndFile *paf = (ApndFile *)pFile;
|
||||
sqlite_int64 iWriteEnd = iOfst + iAmt;
|
||||
if( iWriteEnd>=APND_MAX_SIZE ) return SQLITE_FULL;
|
||||
pFile = ORIGFILE(pFile);
|
||||
if( iOfst+iAmt>=APND_MAX_SIZE ) return SQLITE_FULL;
|
||||
rc = pFile->pMethods->xWrite(pFile, zBuf, iAmt, iOfst+p->iPgOne);
|
||||
if( rc==SQLITE_OK && iOfst + iAmt + p->iPgOne > p->iMark ){
|
||||
sqlite3_int64 sz = 0;
|
||||
rc = pFile->pMethods->xFileSize(pFile, &sz);
|
||||
if( rc==SQLITE_OK ){
|
||||
p->iMark = sz - APND_MARK_SIZE;
|
||||
if( iOfst + iAmt + p->iPgOne > p->iMark ){
|
||||
p->iMark = p->iPgOne + iOfst + iAmt;
|
||||
rc = apndWriteMark(p, pFile);
|
||||
}
|
||||
}
|
||||
/* If append-mark is absent or will be overwritten, write it. */
|
||||
if( paf->iMark < 0 || paf->iPgOne + iWriteEnd > paf->iMark ){
|
||||
int rc = apndWriteMark(paf, pFile, iWriteEnd);
|
||||
if( SQLITE_OK!=rc ) return rc;
|
||||
}
|
||||
return rc;
|
||||
return pFile->pMethods->xWrite(pFile, zBuf, iAmt, paf->iPgOne+iOfst);
|
||||
}
|
||||
|
||||
/*
|
||||
** Truncate an apnd-file.
|
||||
*/
|
||||
static int apndTruncate(sqlite3_file *pFile, sqlite_int64 size){
|
||||
int rc;
|
||||
ApndFile *p = (ApndFile *)pFile;
|
||||
ApndFile *paf = (ApndFile *)pFile;
|
||||
pFile = ORIGFILE(pFile);
|
||||
rc = pFile->pMethods->xTruncate(pFile, size+p->iPgOne+APND_MARK_SIZE);
|
||||
if( rc==SQLITE_OK ){
|
||||
p->iMark = p->iPgOne+size;
|
||||
rc = apndWriteMark(p, pFile);
|
||||
}
|
||||
return rc;
|
||||
/* The append mark goes out first so truncate failure does not lose it. */
|
||||
if( SQLITE_OK!=apndWriteMark(paf, pFile, size) ) return SQLITE_IOERR;
|
||||
/* Truncate underlying file just past append mark */
|
||||
return pFile->pMethods->xTruncate(pFile, paf->iMark+APND_MARK_SIZE);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -268,16 +314,12 @@ static int apndSync(sqlite3_file *pFile, int flags){
|
||||
|
||||
/*
|
||||
** Return the current file-size of an apnd-file.
|
||||
** If the append mark is not yet there, the file-size is 0.
|
||||
*/
|
||||
static int apndFileSize(sqlite3_file *pFile, sqlite_int64 *pSize){
|
||||
ApndFile *p = (ApndFile *)pFile;
|
||||
int rc;
|
||||
pFile = ORIGFILE(p);
|
||||
rc = pFile->pMethods->xFileSize(pFile, pSize);
|
||||
if( rc==SQLITE_OK && p->iPgOne ){
|
||||
*pSize -= p->iPgOne + APND_MARK_SIZE;
|
||||
}
|
||||
return rc;
|
||||
ApndFile *paf = (ApndFile *)pFile;
|
||||
*pSize = ( paf->iMark >= 0 )? (paf->iMark - paf->iPgOne) : 0;
|
||||
return SQLITE_OK;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -308,12 +350,13 @@ static int apndCheckReservedLock(sqlite3_file *pFile, int *pResOut){
|
||||
** File control method. For custom operations on an apnd-file.
|
||||
*/
|
||||
static int apndFileControl(sqlite3_file *pFile, int op, void *pArg){
|
||||
ApndFile *p = (ApndFile *)pFile;
|
||||
ApndFile *paf = (ApndFile *)pFile;
|
||||
int rc;
|
||||
pFile = ORIGFILE(pFile);
|
||||
if( op==SQLITE_FCNTL_SIZE_HINT ) *(sqlite3_int64*)pArg += paf->iPgOne;
|
||||
rc = pFile->pMethods->xFileControl(pFile, op, pArg);
|
||||
if( rc==SQLITE_OK && op==SQLITE_FCNTL_VFSNAME ){
|
||||
*(char**)pArg = sqlite3_mprintf("apnd(%lld)/%z", p->iPgOne, *(char**)pArg);
|
||||
*(char**)pArg = sqlite3_mprintf("apnd(%lld)/%z", paf->iPgOne,*(char**)pArg);
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
@@ -372,6 +415,9 @@ static int apndFetch(
|
||||
void **pp
|
||||
){
|
||||
ApndFile *p = (ApndFile *)pFile;
|
||||
if( p->iMark < 0 || iOfst+iAmt > p->iMark ){
|
||||
return SQLITE_IOERR; /* Cannot read what is not yet there. */
|
||||
}
|
||||
pFile = ORIGFILE(pFile);
|
||||
return pFile->pMethods->xFetch(pFile, iOfst+p->iPgOne, iAmt, pp);
|
||||
}
|
||||
@@ -383,95 +429,153 @@ static int apndUnfetch(sqlite3_file *pFile, sqlite3_int64 iOfst, void *pPage){
|
||||
return pFile->pMethods->xUnfetch(pFile, iOfst+p->iPgOne, pPage);
|
||||
}
|
||||
|
||||
/*
|
||||
** Check to see if the file is an ordinary SQLite database file.
|
||||
*/
|
||||
static int apndIsOrdinaryDatabaseFile(sqlite3_int64 sz, sqlite3_file *pFile){
|
||||
int rc;
|
||||
char zHdr[16];
|
||||
static const char aSqliteHdr[] = "SQLite format 3";
|
||||
if( sz<512 ) return 0;
|
||||
rc = pFile->pMethods->xRead(pFile, zHdr, sizeof(zHdr), 0);
|
||||
if( rc ) return 0;
|
||||
return memcmp(zHdr, aSqliteHdr, sizeof(zHdr))==0;
|
||||
}
|
||||
|
||||
/*
|
||||
** Try to read the append-mark off the end of a file. Return the
|
||||
** start of the appended database if the append-mark is present. If
|
||||
** there is no append-mark, return -1;
|
||||
** start of the appended database if the append-mark is present.
|
||||
** If there is no valid append-mark, return -1;
|
||||
**
|
||||
** An append-mark is only valid if the NNNNNNNN start-of-database offset
|
||||
** indicates that the appended database contains at least one page. The
|
||||
** start-of-database value must be a multiple of 512.
|
||||
*/
|
||||
static sqlite3_int64 apndReadMark(sqlite3_int64 sz, sqlite3_file *pFile){
|
||||
int rc, i;
|
||||
sqlite3_int64 iMark;
|
||||
int msbs = 8 * (APND_MARK_FOS_SZ-1);
|
||||
unsigned char a[APND_MARK_SIZE];
|
||||
|
||||
if( sz<=APND_MARK_SIZE ) return -1;
|
||||
if( APND_MARK_SIZE!=(sz & 0x1ff) ) return -1;
|
||||
rc = pFile->pMethods->xRead(pFile, a, APND_MARK_SIZE, sz-APND_MARK_SIZE);
|
||||
if( rc ) return -1;
|
||||
if( memcmp(a, APND_MARK_PREFIX, APND_MARK_PREFIX_SZ)!=0 ) return -1;
|
||||
iMark = ((sqlite3_int64)(a[APND_MARK_PREFIX_SZ]&0x7f))<<56;
|
||||
for(i=1; i<8; i++){
|
||||
iMark += (sqlite3_int64)a[APND_MARK_PREFIX_SZ+i]<<(56-8*i);
|
||||
iMark = ((sqlite3_int64)(a[APND_MARK_PREFIX_SZ] & 0x7f)) << msbs;
|
||||
for(i=1; i<8; i++){
|
||||
msbs -= 8;
|
||||
iMark |= (sqlite3_int64)a[APND_MARK_PREFIX_SZ+i]<<msbs;
|
||||
}
|
||||
if( iMark > (sz - APND_MARK_SIZE - 512) ) return -1;
|
||||
if( iMark & 0x1ff ) return -1;
|
||||
return iMark;
|
||||
}
|
||||
|
||||
static const char apvfsSqliteHdr[] = "SQLite format 3";
|
||||
/*
|
||||
** Check to see if the file is an appendvfs SQLite database file.
|
||||
** Return true iff it is such. Parameter sz is the file's size.
|
||||
*/
|
||||
static int apndIsAppendvfsDatabase(sqlite3_int64 sz, sqlite3_file *pFile){
|
||||
int rc;
|
||||
char zHdr[16];
|
||||
sqlite3_int64 iMark = apndReadMark(sz, pFile);
|
||||
if( iMark>=0 ){
|
||||
/* If file has the correct end-marker, the expected odd size, and the
|
||||
** SQLite DB type marker where the end-marker puts it, then it
|
||||
** is an appendvfs database.
|
||||
*/
|
||||
rc = pFile->pMethods->xRead(pFile, zHdr, sizeof(zHdr), iMark);
|
||||
if( SQLITE_OK==rc
|
||||
&& memcmp(zHdr, apvfsSqliteHdr, sizeof(zHdr))==0
|
||||
&& (sz & 0x1ff) == APND_MARK_SIZE
|
||||
&& sz>=512+APND_MARK_SIZE
|
||||
){
|
||||
return 1; /* It's an appendvfs database */
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
** Check to see if the file is an ordinary SQLite database file.
|
||||
** Return true iff so. Parameter sz is the file's size.
|
||||
*/
|
||||
static int apndIsOrdinaryDatabaseFile(sqlite3_int64 sz, sqlite3_file *pFile){
|
||||
char zHdr[16];
|
||||
if( apndIsAppendvfsDatabase(sz, pFile) /* rule 2 */
|
||||
|| (sz & 0x1ff) != 0
|
||||
|| SQLITE_OK!=pFile->pMethods->xRead(pFile, zHdr, sizeof(zHdr), 0)
|
||||
|| memcmp(zHdr, apvfsSqliteHdr, sizeof(zHdr))!=0
|
||||
){
|
||||
return 0;
|
||||
}else{
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
** Open an apnd file handle.
|
||||
*/
|
||||
static int apndOpen(
|
||||
sqlite3_vfs *pVfs,
|
||||
sqlite3_vfs *pApndVfs,
|
||||
const char *zName,
|
||||
sqlite3_file *pFile,
|
||||
int flags,
|
||||
int *pOutFlags
|
||||
){
|
||||
ApndFile *p;
|
||||
sqlite3_file *pSubFile;
|
||||
sqlite3_vfs *pSubVfs;
|
||||
ApndFile *pApndFile = (ApndFile*)pFile;
|
||||
sqlite3_file *pBaseFile = ORIGFILE(pFile);
|
||||
sqlite3_vfs *pBaseVfs = ORIGVFS(pApndVfs);
|
||||
int rc;
|
||||
sqlite3_int64 sz;
|
||||
pSubVfs = ORIGVFS(pVfs);
|
||||
sqlite3_int64 sz = 0;
|
||||
if( (flags & SQLITE_OPEN_MAIN_DB)==0 ){
|
||||
return pSubVfs->xOpen(pSubVfs, zName, pFile, flags, pOutFlags);
|
||||
/* The appendvfs is not to be used for transient or temporary databases.
|
||||
** Just use the base VFS open to initialize the given file object and
|
||||
** open the underlying file. (Appendvfs is then unused for this file.)
|
||||
*/
|
||||
return pBaseVfs->xOpen(pBaseVfs, zName, pFile, flags, pOutFlags);
|
||||
}
|
||||
p = (ApndFile*)pFile;
|
||||
memset(p, 0, sizeof(*p));
|
||||
pSubFile = ORIGFILE(pFile);
|
||||
memset(pApndFile, 0, sizeof(ApndFile));
|
||||
pFile->pMethods = &apnd_io_methods;
|
||||
rc = pSubVfs->xOpen(pSubVfs, zName, pSubFile, flags, pOutFlags);
|
||||
if( rc ) goto apnd_open_done;
|
||||
rc = pSubFile->pMethods->xFileSize(pSubFile, &sz);
|
||||
if( rc ){
|
||||
pSubFile->pMethods->xClose(pSubFile);
|
||||
goto apnd_open_done;
|
||||
pApndFile->iMark = -1; /* Append mark not yet written */
|
||||
|
||||
rc = pBaseVfs->xOpen(pBaseVfs, zName, pBaseFile, flags, pOutFlags);
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = pBaseFile->pMethods->xFileSize(pBaseFile, &sz);
|
||||
}
|
||||
if( apndIsOrdinaryDatabaseFile(sz, pSubFile) ){
|
||||
memmove(pFile, pSubFile, pSubVfs->szOsFile);
|
||||
if( rc ){
|
||||
pBaseFile->pMethods->xClose(pBaseFile);
|
||||
pFile->pMethods = 0;
|
||||
return rc;
|
||||
}
|
||||
if( apndIsOrdinaryDatabaseFile(sz, pBaseFile) ){
|
||||
/* The file being opened appears to be just an ordinary DB. Copy
|
||||
** the base dispatch-table so this instance mimics the base VFS.
|
||||
*/
|
||||
memmove(pApndFile, pBaseFile, pBaseVfs->szOsFile);
|
||||
return SQLITE_OK;
|
||||
}
|
||||
p->iMark = 0;
|
||||
p->iPgOne = apndReadMark(sz, pFile);
|
||||
if( p->iPgOne>0 ){
|
||||
pApndFile->iPgOne = apndReadMark(sz, pFile);
|
||||
if( pApndFile->iPgOne>=0 ){
|
||||
pApndFile->iMark = sz - APND_MARK_SIZE; /* Append mark found */
|
||||
return SQLITE_OK;
|
||||
}
|
||||
if( (flags & SQLITE_OPEN_CREATE)==0 ){
|
||||
pSubFile->pMethods->xClose(pSubFile);
|
||||
pBaseFile->pMethods->xClose(pBaseFile);
|
||||
rc = SQLITE_CANTOPEN;
|
||||
pFile->pMethods = 0;
|
||||
}else{
|
||||
/* Round newly added appendvfs location to #define'd page boundary.
|
||||
** Note that nothing has yet been written to the underlying file.
|
||||
** The append mark will be written along with first content write.
|
||||
** Until then, paf->iMark value indicates it is not yet written.
|
||||
*/
|
||||
pApndFile->iPgOne = APND_START_ROUNDUP(sz);
|
||||
}
|
||||
p->iPgOne = (sz+0xfff) & ~(sqlite3_int64)0xfff;
|
||||
apnd_open_done:
|
||||
if( rc ) pFile->pMethods = 0;
|
||||
return rc;
|
||||
}
|
||||
|
||||
/*
|
||||
** Delete an apnd file.
|
||||
** For an appendvfs, this could mean delete the appendvfs portion,
|
||||
** leaving the appendee as it was before it gained an appendvfs.
|
||||
** For now, this code deletes the underlying file too.
|
||||
*/
|
||||
static int apndDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){
|
||||
return ORIGVFS(pVfs)->xDelete(ORIGVFS(pVfs), zPath, dirSync);
|
||||
}
|
||||
|
||||
/*
|
||||
** All other VFS methods are pass-thrus.
|
||||
*/
|
||||
static int apndDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){
|
||||
return ORIGVFS(pVfs)->xDelete(ORIGVFS(pVfs), zPath, dirSync);
|
||||
}
|
||||
static int apndAccess(
|
||||
sqlite3_vfs *pVfs,
|
||||
const char *zPath,
|
||||
|
||||
@@ -167,6 +167,14 @@ static void ieee754func(
|
||||
int isNeg = 0;
|
||||
m = sqlite3_value_int64(argv[0]);
|
||||
e = sqlite3_value_int64(argv[1]);
|
||||
|
||||
/* Limit the range of e. Ticket 22dea1cfdb9151e4 2021-03-02 */
|
||||
if( e>10000 ){
|
||||
e = 10000;
|
||||
}else if( e<-10000 ){
|
||||
e = -10000;
|
||||
}
|
||||
|
||||
if( m<0 ){
|
||||
isNeg = 1;
|
||||
m = -m;
|
||||
|
||||
@@ -220,7 +220,7 @@ static int wholenumberBestIndex(
|
||||
pIdxInfo->orderByConsumed = 1;
|
||||
}
|
||||
if( (idxNum & 12)==0 ){
|
||||
pIdxInfo->estimatedCost = (double)100000000;
|
||||
pIdxInfo->estimatedCost = 1e99;
|
||||
}else if( (idxNum & 3)==0 ){
|
||||
pIdxInfo->estimatedCost = (double)5;
|
||||
}else{
|
||||
|
||||
@@ -268,6 +268,14 @@ tablE t1 USING FTs5(c);
|
||||
DELETE FROM t1 WHERE rowid = 1;
|
||||
INSERT INTO t1 VALUES('a b c');
|
||||
}
|
||||
4 {
|
||||
creAte virTUal tablE t1 USING FTs5(c);
|
||||
INSERT INTO t1 VALUES('a b c');
|
||||
INSERT INTO t1 VALUES('a b c');
|
||||
} {
|
||||
DELETE FROM t1 WHERE rowid = 1;
|
||||
INSERT INTO t1 VALUES('a b c');
|
||||
}
|
||||
|
||||
} {
|
||||
forcedelete test.db test.db2
|
||||
|
||||
@@ -550,18 +550,23 @@ int sqlite3changeset_next(sqlite3_changeset_iter *pIter);
|
||||
** call to [sqlite3changeset_next()] must have returned [SQLITE_ROW]. If this
|
||||
** is not the case, this function returns [SQLITE_MISUSE].
|
||||
**
|
||||
** If argument pzTab is not NULL, then *pzTab is set to point to a
|
||||
** nul-terminated utf-8 encoded string containing the name of the table
|
||||
** affected by the current change. The buffer remains valid until either
|
||||
** sqlite3changeset_next() is called on the iterator or until the
|
||||
** conflict-handler function returns. If pnCol is not NULL, then *pnCol is
|
||||
** set to the number of columns in the table affected by the change. If
|
||||
** pbIndirect is not NULL, then *pbIndirect is set to true (1) if the change
|
||||
** Arguments pOp, pnCol and pzTab may not be NULL. Upon return, three
|
||||
** outputs are set through these pointers:
|
||||
**
|
||||
** *pOp is set to one of [SQLITE_INSERT], [SQLITE_DELETE] or [SQLITE_UPDATE],
|
||||
** depending on the type of change that the iterator currently points to;
|
||||
**
|
||||
** *pnCol is set to the number of columns in the table affected by the change; and
|
||||
**
|
||||
** *pzTab is set to point to a nul-terminated utf-8 encoded string containing
|
||||
** the name of the table affected by the current change. The buffer remains
|
||||
** valid until either sqlite3changeset_next() is called on the iterator
|
||||
** or until the conflict-handler function returns.
|
||||
**
|
||||
** If pbIndirect is not NULL, then *pbIndirect is set to true (1) if the change
|
||||
** is an indirect change, or false (0) otherwise. See the documentation for
|
||||
** [sqlite3session_indirect()] for a description of direct and indirect
|
||||
** changes. Finally, if pOp is not NULL, then *pOp is set to one of
|
||||
** [SQLITE_INSERT], [SQLITE_DELETE] or [SQLITE_UPDATE], depending on the
|
||||
** type of change that the iterator currently points to.
|
||||
** changes.
|
||||
**
|
||||
** If no error occurs, SQLITE_OK is returned. If an error does occur, an
|
||||
** SQLite error code is returned. The values of the output variables may not
|
||||
|
||||
@@ -146,7 +146,10 @@ static int SQLITE_TCLAPI test_sql_exec_changeset(
|
||||
static int test_tcl_integer(Tcl_Interp *interp, const char *zVar){
|
||||
Tcl_Obj *pObj;
|
||||
int iVal = 0;
|
||||
pObj = Tcl_ObjGetVar2(interp, Tcl_NewStringObj(zVar, -1), 0, TCL_GLOBAL_ONLY);
|
||||
Tcl_Obj *pName = Tcl_NewStringObj(zVar, -1);
|
||||
Tcl_IncrRefCount(pName);
|
||||
pObj = Tcl_ObjGetVar2(interp, pName, 0, TCL_GLOBAL_ONLY);
|
||||
Tcl_DecrRefCount(pName);
|
||||
if( pObj ) Tcl_GetIntFromObj(0, pObj, &iVal);
|
||||
return iVal;
|
||||
}
|
||||
|
||||
@@ -360,6 +360,7 @@ TESTSRC = \
|
||||
#
|
||||
TESTSRC += \
|
||||
$(TOP)/ext/misc/amatch.c \
|
||||
$(TOP)/ext/misc/appendvfs.c \
|
||||
$(TOP)/ext/misc/carray.c \
|
||||
$(TOP)/ext/misc/cksumvfs.c \
|
||||
$(TOP)/ext/misc/closure.c \
|
||||
@@ -954,7 +955,7 @@ fuzztest: fuzzcheck$(EXE) $(FUZZDATA) sessionfuzz$(EXE) $(TOP)/test/sessionfuzz-
|
||||
./sessionfuzz run $(TOP)/test/sessionfuzz-data1.db
|
||||
|
||||
valgrindfuzz: fuzzcheck$(EXE) $(FUZZDATA) sessionfuzz$(EXE) $(TOP)/test/sessionfuzz-data1.db
|
||||
valgrind ./fuzzcheck$(EXE) --cell-size-check --limit-mem 10M --timeout 600 $(FUZZDATA)
|
||||
valgrind ./fuzzcheck$(EXE) --cell-size-check --limit-mem 10M $(FUZZDATA)
|
||||
valgrind ./sessionfuzz run $(TOP)/test/sessionfuzz-data1.db
|
||||
|
||||
# The veryquick.test TCL tests.
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
C Fix\sanother\smsan\scomplain\striggered\sby\sa\scorrupt\sdatabase.
|
||||
D 2021-03-01T16:15:41.526
|
||||
C Version\s3.35.4
|
||||
D 2021-04-02T15:20:15.843
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
||||
F Makefile.in 9cae1bffe5cb811216bf7425395e7fc0594daa2ce31f625835a9d0c3fb25315f
|
||||
F Makefile.in fe6cc1db11e02b308f3ab0ec2504344697b9eaaa410fa73f48d16a143462e5d3
|
||||
F Makefile.linux-gcc f609543700659711fbd230eced1f01353117621dccae7b9fb70daa64236c5241
|
||||
F Makefile.msc ad07bbd645132533e1fd7164a03acfa9afecda378b3787c10f62ab4c7c45e6ea
|
||||
F Makefile.msc 6b5428cef2af1288e02faeb602dabe68fbf2de7bc8a8e29c7299778ee08cd35c
|
||||
F README.md 1514a365ffca3c138e00c5cc839906108a01011a6b082bad19b09781e3aa498a
|
||||
F VERSION 92f3e4c5cdee6f0779aef1eae857dfc21d0eabb1f2af169dc90e63cd76b15bb2
|
||||
F VERSION ecb003bb32c9abbcabbfb2f4fc1e5f0011eb407ad28b041d1c7ae68f0739da3d
|
||||
F aclocal.m4 a5c22d164aff7ed549d53a90fa56d56955281f50
|
||||
F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2
|
||||
F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90
|
||||
@@ -15,10 +15,10 @@ F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2
|
||||
F autoconf/INSTALL 83e4a25da9fd053c7b3665eaaaf7919707915903
|
||||
F autoconf/Makefile.am a8d1d24affe52ebf8d7ddcf91aa973fa0316618ab95bb68c87cabf8faf527dc8
|
||||
F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac
|
||||
F autoconf/Makefile.msc e0f1dafc48d000fd6ddfdb01815271528db55cbc7299ca888df5b93367f0d5a4
|
||||
F autoconf/Makefile.msc ebe7e66edbb2f453593cbde186d1a0fa0dcd8cae9977febcae27aef1dab5678d
|
||||
F autoconf/README.first 6c4f34fe115ff55d4e8dbfa3cecf04a0188292f7
|
||||
F autoconf/README.txt 4f04b0819303aabaa35fff5f7b257fb0c1ef95f1
|
||||
F autoconf/configure.ac 55be6fc04a5b030b367fe317b72dc8c0eafc4713991fe6182cf647b02fb782cb
|
||||
F autoconf/configure.ac a8ba2a9e61216f5093d44f3b7d2cb8fe1890d6b7dc330a02f802d8efaa1fdc79
|
||||
F autoconf/tea/Makefile.in b438a7020446c8a8156e8d97c8914a04833da6fd
|
||||
F autoconf/tea/README 3e9a3c060f29a44344ab50aec506f4db903fb873
|
||||
F autoconf/tea/aclocal.m4 52c47aac44ce0ddb1f918b6993e8beb8eee88f43
|
||||
@@ -34,8 +34,8 @@ F autoconf/tea/win/rules.vc c511f222b80064096b705dbeb97060ee1d6b6d63
|
||||
F config.guess 883205ddf25b46f10c181818bf42c09da9888884af96f79e1719264345053bd6
|
||||
F config.h.in 6376abec766e9a0785178b1823b5a587e9f1ccbc
|
||||
F config.sub c2d0260f17f3e4bc0b6808fccf1b291cb5e9126c14fc5890efc77b9fd0175559
|
||||
F configure 91893a81f698778dda4d8fb24bfca606ded31ef02bcfbc2ab072d30fb67138d6 x
|
||||
F configure.ac 412b65c6107e41c098ad7f5f2e6a3f74ac02ffc6e92b9a6264b9f1060c235a04
|
||||
F configure 1ef01982e256c82a74885886ef5cc05e3d1d85a50d3b93941903dcf3f93cae56 x
|
||||
F configure.ac 4e4b58b32f88c8da9914a2f2c3158f80e69907eccc019fcc7e3ba14ffd91c640
|
||||
F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad
|
||||
F doc/F2FS.txt c1d4a0ae9711cfe0e1d8b019d154f1c29e0d3abfe820787ba1e9ed7691160fcd
|
||||
F doc/lemon.html 1bb72ece6271df0d901d233551dd985f2c6ba30d09382cf2d321ed951ab57491
|
||||
@@ -84,11 +84,11 @@ F ext/fts3/README.content b9078d0843a094d86af0d48dffbff13c906702b4c3558012e67b9c
|
||||
F ext/fts3/README.syntax a19711dc5458c20734b8e485e75fb1981ec2427a
|
||||
F ext/fts3/README.tokenizers b92bdeb8b46503f0dd301d364efc5ef59ef9fa8e2758b8e742f39fa93a2e422d
|
||||
F ext/fts3/README.txt 8c18f41574404623b76917b9da66fcb0ab38328d
|
||||
F ext/fts3/fts3.c 4809e0b05af4519ad8bfa13d684f7ad635d1390a758299d2302f7e85c48ec160
|
||||
F ext/fts3/fts3.c 7b449348226a91cc851fe969f5c1932d4f00c359a32fd17f2afea92bf875147b
|
||||
F ext/fts3/fts3.h 3a10a0af180d502cecc50df77b1b22df142817fe
|
||||
F ext/fts3/fts3Int.h 045179f538c478ced266ca14327269cde8ad8d573c5be902230a5ebaa5636c59
|
||||
F ext/fts3/fts3_aux.c 96708c8b3a7d9b8ca1b68ea2b7e503e283f20e95f145becadedfad096dbd0f34
|
||||
F ext/fts3/fts3_expr.c f081e38da641724cd72c20e23b71db2bf4d0c9517c14637442f6910259f11a34
|
||||
F ext/fts3/fts3_expr.c 5853cd7a35a79d193614add9b4c461b2d56f465d90899ca4309f05d9d1536558
|
||||
F ext/fts3/fts3_hash.c 8b6e31bfb0844c27dc6092c2620bdb1fca17ed613072db057d96952c6bdb48b7
|
||||
F ext/fts3/fts3_hash.h 39cf6874dc239d6b4e30479b1975fe5b22a3caaf
|
||||
F ext/fts3/fts3_icu.c 305ce7fb6036484085b5556a9c8e62acdc7763f0f4cdf5fd538212a9f3720116
|
||||
@@ -100,9 +100,9 @@ F ext/fts3/fts3_tokenize_vtab.c 8d15b148e7d88a4280389a200b26e8d52abda4c4ec2e9a35
|
||||
F ext/fts3/fts3_tokenizer.c 6d8fc150c48238955d5182bf661498db0dd473c8a2a80e00c16994a646fa96e7
|
||||
F ext/fts3/fts3_tokenizer.h 64c6ef6c5272c51ebe60fc607a896e84288fcbc3
|
||||
F ext/fts3/fts3_tokenizer1.c 5c98225a53705e5ee34824087478cf477bdb7004
|
||||
F ext/fts3/fts3_unicode.c 4b9af6151c29b35ed09574937083cece7c31e911f69615e168a39677569b684d
|
||||
F ext/fts3/fts3_unicode.c de426ff05c1c2e7bce161cf6b706638419c3a1d9c2667de9cb9dc0458c18e226
|
||||
F ext/fts3/fts3_unicode2.c 416eb7e1e81142703520d284b768ca2751d40e31fa912cae24ba74860532bf0f
|
||||
F ext/fts3/fts3_write.c 3b5df74d6563df46f90103a84630613a9fdb782ed93161470df2186e8e906d8c
|
||||
F ext/fts3/fts3_write.c a5159accfd88f85fd3fc2298286d7a9427a02d1ea9a52b7c79730cff7a0bc03f
|
||||
F ext/fts3/fts3speed.tcl b54caf6a18d38174f1a6e84219950d85e98bb1e9
|
||||
F ext/fts3/mkfts3amal.tcl 252ecb7fe6467854f2aa237bf2c390b74e71f100
|
||||
F ext/fts3/tool/fts3cov.sh c331d006359456cf6f8f953e37f2b9c7d568f3863f00bb5f7eb87fea4ac01b73
|
||||
@@ -119,12 +119,12 @@ F ext/fts5/fts5_buffer.c 5a5fe0159752c0fb0a5a93c722e9db2662822709490769d482b76a6
|
||||
F ext/fts5/fts5_config.c be54f44fca491e96c6923a4b9a736f2da2b13811600eb6e38d1bcc91c4ea2e61
|
||||
F ext/fts5/fts5_expr.c 016bd06030679bd31b0f07ef87d62c42031e5da25cb3174a84e5b0f6ef4b47b0
|
||||
F ext/fts5/fts5_hash.c 1aa93c9b5f461afba66701ee226297dc78402b3bdde81e90a10de5fe3df14959
|
||||
F ext/fts5/fts5_index.c acbe3ccd36f5a7373009dfff02a11c4a817af73bc3ef8c340f2105d7d073f8b4
|
||||
F ext/fts5/fts5_main.c b4e4931c7fcc9acfa0c3b8b5e5e80b5b424b8d9207aae3a22b674bd35ccf149d
|
||||
F ext/fts5/fts5_index.c df5e18b705ac601e826576298a5ce23ef1e5d417fbfdb3feb5f702f89e5f6f41
|
||||
F ext/fts5/fts5_main.c d77648a52b8d73d13887306149912e420f7e0b2d7b3d7da2f54152bfa140ac02
|
||||
F ext/fts5/fts5_storage.c 58ba71e6cd3d43a5735815e7956ee167babb4d2cbfe206905174792af4d09d75
|
||||
F ext/fts5/fts5_tcl.c 39bcbae507f594aad778172fa914cad0f585bf92fd3b078c686e249282db0d95
|
||||
F ext/fts5/fts5_test_mi.c 08c11ec968148d4cb4119d96d819f8c1f329812c568bac3684f5464be177d3ee
|
||||
F ext/fts5/fts5_test_tok.c f96c6e193c466711d6d7828d5f190407fe7ab897062d371426dd3036f01258e7
|
||||
F ext/fts5/fts5_test_tok.c a2bed8edb25f6432e8cdb62aad5916935c19dba8dac2b8324950cfff397e25ff
|
||||
F ext/fts5/fts5_tokenize.c 5e251efb0f1af99a25ed50010ba6b1ad1250aca5921af1988fdcabe5ebc3cb43
|
||||
F ext/fts5/fts5_unicode2.c eca63dbc797f8ff0572e97caf4631389c0ab900d6364861b915bdd4735973f00
|
||||
F ext/fts5/fts5_varint.c e64d2113f6e1bfee0032972cffc1207b77af63319746951bf1d09885d1dadf80
|
||||
@@ -160,7 +160,7 @@ F ext/fts5/test/fts5connect.test 08030168fc96fc278fa81f28654fb7e90566f33aff269c0
|
||||
F ext/fts5/test/fts5content.test 213506436fb2c87567b8e31f6d43ab30aab99354cec74ed679f22aad0cdbf283
|
||||
F ext/fts5/test/fts5corrupt.test 77ae6f41a7eba10620efb921cf7dbe218b0ef232b04519deb43581cb17a57ebe
|
||||
F ext/fts5/test/fts5corrupt2.test 7453752ba12ce91690c469a6449d412561cc604b1dec994e16ab132952e7805f
|
||||
F ext/fts5/test/fts5corrupt3.test 5df97f353102f0078d0bb418d620652d03460ee1cceb2992a3b5ee6fb619b24e
|
||||
F ext/fts5/test/fts5corrupt3.test 1cad09897fc69084a904c921dee7f777e1c866964ee2ec2cc7a8a69cc3f1ab68
|
||||
F ext/fts5/test/fts5corrupt4.test f4c08e2182a48d8b70975fd869ee5391855c06d8a0ff87b6a2529e7c5a88a1d3
|
||||
F ext/fts5/test/fts5delete.test 619295b20dbc1d840b403ee07c878f52378849c3c02e44f2ee143b3e978a0aa7
|
||||
F ext/fts5/test/fts5detail.test 31b240dbf6d44ac3507e2f8b65f29fdc12465ffd531212378c7ce1066766f54e
|
||||
@@ -286,7 +286,7 @@ F ext/lsm1/tool/mklsm1c.tcl f31561bbee5349f0a554d1ad7236ac1991fc09176626f529f607
|
||||
F ext/misc/README.md d6dd0fe1d8af77040216798a6a2b0c46c73054d2f0ea544fbbcdccf6f238c240
|
||||
F ext/misc/amatch.c e3ad5532799cee9a97647f483f67f43b38796b84b5a8c60594fe782a4338f358
|
||||
F ext/misc/anycollseq.c 5ffdfde9829eeac52219136ad6aa7cd9a4edb3b15f4f2532de52f4a22525eddb
|
||||
F ext/misc/appendvfs.c 55121d311d408ba9c62c3cfa367408887638f02f9522dd9859891d0ee69a7eba
|
||||
F ext/misc/appendvfs.c bdc9de0a0e61c21327e975da178b4fd6f57de9c46123044aa6ee3a20798c5db2
|
||||
F ext/misc/blobio.c a867c4c4617f6ec223a307ebfe0eabb45e0992f74dd47722b96f3e631c0edb2a
|
||||
F ext/misc/btreeinfo.c d28ce349b40054eaa9473e835837bad7a71deec33ba13e39f963d50933bfa0f9
|
||||
F ext/misc/carray.c b75a0f207391038bf1540d3372f482a95c3613511c7c474db51ede1196321c7c
|
||||
@@ -304,7 +304,7 @@ F ext/misc/explain.c 0086fab288d4352ea638cf40ac382aad3b0dc5e845a1ea829a694c015fd
|
||||
F ext/misc/fileio.c 9b69e25da3b51d4a1d905a464ccb96709792ad627a742ba09215bc0d1447e7bd
|
||||
F ext/misc/fossildelta.c 1240b2d3e52eab1d50c160c7fe1902a9bd210e052dc209200a750bbf885402d5
|
||||
F ext/misc/fuzzer.c eae560134f66333e9e1ca4c8ffea75df42056e2ce8456734565dbe1c2a92bf3d
|
||||
F ext/misc/ieee754.c 5c7ca326361c7368f95f5743972eade3b8b24f60359ed7cba4706668a5682896
|
||||
F ext/misc/ieee754.c cd6ab89f85fda8a020559b3f4d03001a8a62dd856beda5af3f558621d12be913
|
||||
F ext/misc/json1.c f31e89171f932d1821c91f10d2cb4979fc0447030030a8bce70420cd43d074c0
|
||||
F ext/misc/memstat.c 3017a0832c645c0f8c773435620d663855f04690172316bd127270d1a7523d4d
|
||||
F ext/misc/memtrace.c 7c0d115d2ef716ad0ba632c91e05bd119cb16c1aedf3bec9f06196ead2d5537b
|
||||
@@ -336,7 +336,7 @@ F ext/misc/vfslog.c 3b25c2f56ba60788db247287be6ab024b53c4afffd412b4876db563389be
|
||||
F ext/misc/vfsstat.c 389ea13983d3af926504c314f06a83cc858d5adc24b40af74aaed1fece00c118
|
||||
F ext/misc/vtablog.c 5538acd0c8ddaae372331bee11608d76973436b77d6a91e8635cfc9432fba5ae
|
||||
F ext/misc/vtshim.c 1976e6dd68dd0d64508c91a6dfab8e75f8aaf6cd
|
||||
F ext/misc/wholenumber.c 520f34c3099e5b7d546f13708607dc2fa173c46b68952eecf0d19cd675fec85e
|
||||
F ext/misc/wholenumber.c a838d1bea913c514ff316c69695efbb49ea3b8cb37d22afc57f73b6b010b4546
|
||||
F ext/misc/zipfile.c e35e035bc2765b1ccdcb15f9815c2112843fcbc8f36aa071f0e5935df7072228
|
||||
F ext/misc/zorder.c b0ff58fa643afa1d846786d51ea8d5c4b6b35aa0254ab5a82617db92f3adda64
|
||||
F ext/rbu/rbu.c b880ca5cb857d6d6f52e72eb7397813058ef48c78c5402cd04ff2b6b5437f622
|
||||
@@ -359,7 +359,7 @@ F ext/rbu/rbu_common.tcl 60d904133ff843fe72cc0514e9dd2486707181e6e0fbab20979da28
|
||||
F ext/rbu/rbucollate.test cac528a9a46318cba42e61258bb42660bbbf4fdb9a8c863de5a54ad0c658d197
|
||||
F ext/rbu/rbucrash.test 000981a1fe8a6e4d9a684232f6a129e66a3ef595f5ed74655e2f9c68ffa613b4
|
||||
F ext/rbu/rbucrash2.test efa143cc94228eb0266d3f1abfbee60a5838a84cef7cc3fcb8c145b74d96fd41
|
||||
F ext/rbu/rbudiff.test 156957851136b63c143478518dc1bda6c832103cdbe8ac1d7cdd47edb3cbe0a3
|
||||
F ext/rbu/rbudiff.test abe895a8d479e4d33acb40e244e3d8e2cd25f55a18dfa8b9f83e13d00073f600
|
||||
F ext/rbu/rbudor.test e3e8623926012f43eebe51fedf06a102df2640750d971596b052495f2536db20
|
||||
F ext/rbu/rbuexpr.test 10d0420537c3bc7666e576d72adeffe7e86cfbb00dcc30aa9ce096c042415190
|
||||
F ext/rbu/rbufault.test 2d7f567b79d558f6e093c58808cab4354f8a174e3802f69e7790a9689b3c09f8
|
||||
@@ -456,15 +456,15 @@ F ext/session/sessionrebase.test ccfa716b23bd1d3b03217ee58cfd90c78d4b99f53e6a9a2
|
||||
F ext/session/sessionstat1.test 218d351cf9fcd6648f125a26b607b140310160184723c2666091b54450a68fb5
|
||||
F ext/session/sessionwor.test 6fd9a2256442cebde5b2284936ae9e0d54bde692d0f5fd009ecef8511f4cf3fc
|
||||
F ext/session/sqlite3session.c a7c5ac1acfe21d94b37921b29b0458d64d022a66b282338eee4aafa9c018cb1c
|
||||
F ext/session/sqlite3session.h f53c99731882bf59c7362855cdeba176ce1fe8eeba089e38a8cce0172f8473aa
|
||||
F ext/session/test_session.c 93ca965112d2b4d9d669c9c0be6b1e52942a268796050a145612df1eee175ce0
|
||||
F ext/session/sqlite3session.h f48662626e7a3176a188787a0bd360933dd46cccd98df01c208b02051c540fb7
|
||||
F ext/session/test_session.c 90ccf1c30c857bd2fb3f6c990163e8f389ddbdbdc7fa5baa2f6f5f287df41c08
|
||||
F ext/userauth/sqlite3userauth.h 7f3ea8c4686db8e40b0a0e7a8e0b00fac13aa7a3
|
||||
F ext/userauth/user-auth.txt e6641021a9210364665fe625d067617d03f27b04
|
||||
F ext/userauth/userauth.c 7f00cded7dcaa5d47f54539b290a43d2e59f4b1eb5f447545fa865f002fc80cb
|
||||
F install-sh 9d4de14ab9fb0facae2f48780b874848cbf2f895 x
|
||||
F ltmain.sh 3ff0879076df340d2e23ae905484d8c15d5fdea8
|
||||
F magic.txt 8273bf49ba3b0c8559cb2774495390c31fd61c60
|
||||
F main.mk 443a4ec1ca89ad267cbde45dadc68861154b99c7bd26e7b7dc74303a664002b8
|
||||
F main.mk c6afb1c8bcacc4c3e320ab10259879bc927f0747401e184b64e8f4b78f057ab2
|
||||
F mkso.sh fd21c06b063bb16a5d25deea1752c2da6ac3ed83
|
||||
F mptest/config01.test 3c6adcbc50b991866855f1977ff172eb6d901271
|
||||
F mptest/config02.test 4415dfe36c48785f751e16e32c20b077c28ae504
|
||||
@@ -476,25 +476,25 @@ F spec.template 86a4a43b99ebb3e75e6b9a735d5fd293a24e90ca
|
||||
F sqlite.pc.in 42b7bf0d02e08b9e77734a47798d1a55a9e0716b
|
||||
F sqlite3.1 fc7ad8990fc8409983309bb80de8c811a7506786
|
||||
F sqlite3.pc.in 48fed132e7cb71ab676105d2a4dc77127d8c1f3a
|
||||
F src/alter.c d5fd529509880eade9ea59ddb24a56e9fe0579ee7f2e9e18bac62b7bd05b3a10
|
||||
F src/alter.c 2d631213818b654faaf08755f26e934134c4769757ae9286981401cd6b571081
|
||||
F src/analyze.c 01c6c6765cb4d40b473b71d85535093730770bb186f2f473abac25f07fcdee5c
|
||||
F src/attach.c 9cbe761e464025694df8e6f6ee4d9f41432c3a255ca9443ccbb4130eeb87cf72
|
||||
F src/auth.c 08954fdc4cc2da5264ba5b75cfd90b67a6fc7d1710a02ccf917c38eadec77853
|
||||
F src/backup.c 3014889fa06e20e6adfa0d07b60097eec1f6e5b06671625f476a714d2356513d
|
||||
F src/bitvec.c 17ea48eff8ba979f1f5b04cc484c7bb2be632f33
|
||||
F src/btmutex.c 8acc2f464ee76324bf13310df5692a262b801808984c1b79defb2503bbafadb6
|
||||
F src/btree.c bafa3a2e8b6622a3aa8791f90c8ecc70e8ae551ba9023f865213890f5b8a8994
|
||||
F src/btree.h 285f8377aa1353185a32bf455faafa9ff9a0d40d074d60509534d14990c7829e
|
||||
F src/btreeInt.h 7614cae30f95b6aed0c7cac7718276a55cfe2c77058cbfd8bef5b75329757331
|
||||
F src/build.c e1790f21cd19708af231ceed5e52f495b94c4b2609e27d2b5ce2805a9aa3464e
|
||||
F src/btree.c cfd2a37794532d765e235a2550ad2732924a6d06b07a3bc9f6a71750e3b3cca1
|
||||
F src/btree.h 096cc53baa58be22b02c896d1cf933c38cfc6d65f9253c1367ece8cc88a24de5
|
||||
F src/btreeInt.h 7bc15a24a02662409ebcd6aeaa1065522d14b7fda71573a2b0568b458f514ae0
|
||||
F src/build.c 066c44421bf7b73c6fa47f6fb0c0fcf1357c10552bcf8f3f94c6ebede581cd01
|
||||
F src/callback.c d0b853dd413255d2e337b34545e54d888ea02f20da5ad0e63585b389624c4a6c
|
||||
F src/complete.c a3634ab1e687055cd002e11b8f43eb75c17da23e
|
||||
F src/ctime.c 2a322b9a3d75771fb4d99e0702851f4f68dda982507a0f798eefb0712969a410
|
||||
F src/date.c dace306a10d9b02ee553d454c8e1cf8d3c9b932e137738a6b15b90253a9bfc10
|
||||
F src/date.c e0632f335952b32401482d099321bbf12716b29d6e72836b53ae49683ebae4bf
|
||||
F src/dbpage.c 8a01e865bf8bc6d7b1844b4314443a6436c07c3efe1d488ed89e81719047833a
|
||||
F src/dbstat.c 3aa79fc3aed7ce906e4ea6c10e85d657299e304f6049861fe300053ac57de36c
|
||||
F src/delete.c 73f57a9a183532c344a3135cf8f2a5589376e39183e0b5f562d6b61b2af0f4d8
|
||||
F src/expr.c 6793c836aff149b14011ad546ae1648a18573779ee78f5a7d375f2a3047e8c8e
|
||||
F src/expr.c cfab1113f9eba24f1d6d11b710577c9fcc9cc8e29ed60bd7ac7906be7481dda4
|
||||
F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007
|
||||
F src/fkey.c e9063648396c58778f77583a678342fe4a9bc82436bf23c5f9f444f2df0fdaa4
|
||||
F src/func.c 479f6929be027eb0210cbdde9d3529c012facf082d64a6b854a9415940761e5e
|
||||
@@ -503,10 +503,10 @@ F src/hash.c 8d7dda241d0ebdafb6ffdeda3149a412d7df75102cecfc1021c98d6219823b19
|
||||
F src/hash.h 9d56a9079d523b648774c1784b74b89bd93fac7b365210157482e4319a468f38
|
||||
F src/hwtime.h cb1d7e3e1ed94b7aa6fde95ae2c2daccc3df826be26fc9ed7fd90d1750ae6144
|
||||
F src/in-operator.md 10cd8f4bcd225a32518407c2fb2484089112fd71
|
||||
F src/insert.c 8942baede303a54ba3b6d06200d5b74c9bc25ababec8a55823e06309748cd4a3
|
||||
F src/insert.c e36be69e3810902eaf7e171260c885bc9547b1d41616c868f1cc46e6a0a3b7fd
|
||||
F src/legacy.c d7874bc885906868cd51e6c2156698f2754f02d9eee1bae2d687323c3ca8e5aa
|
||||
F src/loadext.c 8c9c8cd2bd8eecdb06d9b6e89de7e9e65bae45cc8fc33609cc74023a5c296067
|
||||
F src/main.c 1c5de7b3fabcdf05f4fe563aab5d81d175b89c67a8678a12ba86629356afa356
|
||||
F src/main.c 2a7ece3a67c646e5fe9984ffe0277d6a76f80ce9715bf2faa591d8cb66b9d913
|
||||
F src/malloc.c c1af4ac5a463648cd2953fd4ac679b3ba9022ce5ec794a60806150ad69dfd33a
|
||||
F src/mem0.c 6a55ebe57c46ca1a7d98da93aaa07f99f1059645
|
||||
F src/mem1.c c12a42539b1ba105e3707d0e628ad70e611040d8f5e38cf942cee30c867083de
|
||||
@@ -514,7 +514,7 @@ F src/mem2.c b93b8762ab999a29ae7751532dadf0a1ac78040308a5fb1d17fcc365171d67eb
|
||||
F src/mem3.c 30301196cace2a085cbedee1326a49f4b26deff0af68774ca82c1f7c06fda4f6
|
||||
F src/mem5.c 9bf955937b07f8c32541c8a9991f33ce3173d944
|
||||
F src/memdb.c ab0632d42407e866d2b616bd19d4211ac0ad1b430f04c4e187d60005b8700b98
|
||||
F src/memjournal.c bb0533253ad4a9657c29742d8504b6813c8367ccf135c0fb553d786850a55ea9
|
||||
F src/memjournal.c 431c70a111223a8a6e2e7e9f014afc6c88d818d357d866afc563195f2277d50e
|
||||
F src/msvc.h 3a15918220367a8876be3fa4f2abe423a861491e84b864fb2b7426bf022a28f8
|
||||
F src/mutex.c 5e3409715552348732e97b9194abe92fdfcd934cfb681df4ba0ab87ac6c18d25
|
||||
F src/mutex.h a7b2293c48db5f27007c3bdb21d438873637d12658f5a0bf8ad025bb96803c4a
|
||||
@@ -526,33 +526,33 @@ F src/os.c 2d6e646370b1aa78942c68d7edf124e518963adf4a90bce87f365a5a5495529a
|
||||
F src/os.h 48388821692e87da174ea198bf96b1b2d9d83be5dfc908f673ee21fafbe0d432
|
||||
F src/os_common.h b2f4707a603e36811d9b1a13278bffd757857b85
|
||||
F src/os_setup.h 0dbaea40a7d36bf311613d31342e0b99e2536586
|
||||
F src/os_unix.c adbbcea4c63d3b400d405f60a5da4c01433753ec4a12e2dc695beb2bbd671fe9
|
||||
F src/os_unix.c 7a9eab7b11f552ab91ead980086b312c7e3b871efdee8c0c072b682bbec6592e
|
||||
F src/os_win.c 77d39873836f1831a9b0b91894fec45ab0e9ca8e067dc8c549e1d1eca1566fe9
|
||||
F src/os_win.h 7b073010f1451abe501be30d12f6bc599824944a
|
||||
F src/pager.c 970691daea03f9f15e34de671bd8675c1e136232b529e21bfd36d4dba6d41753
|
||||
F src/pager.h 4bf9b3213a4b2bebbced5eaa8b219cf25d4a82f385d093cd64b7e93e5285f66f
|
||||
F src/parse.y f3e8d7978c10495850c0bb502fe2669b55cf2841c4670b1f7261782e82069471
|
||||
F src/parse.y 2107aff88e361bbf8388fdede3fed20fda875f23ba7585ec83b20e3e16a95670
|
||||
F src/pcache.c 385ff064bca69789d199a98e2169445dc16e4291fa807babd61d4890c3b34177
|
||||
F src/pcache.h 4f87acd914cef5016fae3030343540d75f5b85a1877eed1a2a19b9f284248586
|
||||
F src/pcache1.c 388304fd2d91c39591080b5e0f3c62cfba87db20370e7e0554062bfb29740e9f
|
||||
F src/pragma.c 6daaaecc26a4b09481d21722525b079ce756751a43a79cc1d8f122d686806193
|
||||
F src/pragma.c eb42cb9bec189cf18cef5d8fcae56e13bb73ef2b019b198fb48740ced81bce95
|
||||
F src/pragma.h 8dc78ab7e9ec6ce3ded8332810a2066f1ef6267e2e03cd7356ee00276125c6cf
|
||||
F src/prepare.c f634a9e799a6b1c136d8ee12479cffa22862bfb807d307b1db406aa0cdb042a5
|
||||
F src/printf.c 10e61ec79dd9d41fdc77afee4e0df04fbb427f309c043118fe0b26a7d7db488a
|
||||
F src/prepare.c e21b54489b5c73b06ada15e6fc79b5c6f64b06701924a6ca98944ae59e06256f
|
||||
F src/printf.c 2b03a80d7c11bb422115dca175a18bf430e9c9dbaa0eee63b758f0c022f8f34f
|
||||
F src/random.c 80f5d666f23feb3e6665a6ce04c7197212a88384
|
||||
F src/resolve.c 2272b62c9f20cd6628c1d19963c4f96e41297b50cdfeffdcc47fcfded6a607d7
|
||||
F src/resolve.c fec151c9c33a6fa2e93d10b4e8cd4084a7c773df36fb3ec6788eb89ae493a1a4
|
||||
F src/rowset.c ba9515a922af32abe1f7d39406b9d35730ed65efab9443dc5702693b60854c92
|
||||
F src/select.c 7cf048e52f678726dadc448c41fab40262f6da37eeb1d8ff0f14ef1b17feed9e
|
||||
F src/shell.c.in 844417f84df1f6c4fce1c815629a888cfdcf219e86513e9c332bbcc38832f477
|
||||
F src/sqlite.h.in 8855a19f37ade8dad189a9e48233a2ebe1b46faf469c7eb0906a654e252dcc57
|
||||
F src/select.c 734cf12e42f81f2fe461e41214e6552375e55b62a802784a4f0066ac592e7f4a
|
||||
F src/shell.c.in aa28256887d049badaf93aa30ab5c76a2ec88143a674d685c0e739056702e5c3
|
||||
F src/sqlite.h.in 3426a080ea1f222a73e3bd91e7eacbd30570a0117c03d42c6dde606f33e5e318
|
||||
F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
|
||||
F src/sqlite3ext.h 61b38c073d5e1e96a3d45271b257aef27d0d13da2bea5347692ae579475cd95e
|
||||
F src/sqliteInt.h 11b9d47e9b9520b123bc75254da7a4e215463e811e62b89518fc5e9a192a0222
|
||||
F src/sqliteInt.h e56aa05ef78513cd596c30a56fda68cd9bba91d444ac40e135e919fed40cd875
|
||||
F src/sqliteLimit.h d7323ffea5208c6af2734574bae933ca8ed2ab728083caa117c9738581a31657
|
||||
F src/status.c 4b8bc2a6905163a38b739854a35b826c737333fab5b1f8e03fa7eb9a4799c4c1
|
||||
F src/table.c 0f141b58a16de7e2fbe81c308379e7279f4c6b50eb08efeec5892794a0ba30d1
|
||||
F src/tclsqlite.c 986b6391f02cd9b53c1d688be55899f6ffddeb8e8014cd83c1b73ff912579a71
|
||||
F src/test1.c 2197966d2f7211ef9eefaa6c3c7dd2c7d786d1f33f2aadef2f08c8c79eceec26
|
||||
F src/test1.c cff43d8e21be543b77651b4d2caf49bd6488fee220f8540ecd9f71d13169dbd1
|
||||
F src/test2.c 3efb99ab7f1fc8d154933e02ae1378bac9637da5
|
||||
F src/test3.c 61798bb0d38b915067a8c8e03f5a534b431181f802659a6616f9b4ff7d872644
|
||||
F src/test4.c 7c4420e01c577b5c4add2cb03119743b1a357543d347773b9e717195ea967159
|
||||
@@ -606,19 +606,19 @@ F src/test_windirent.h 90dfbe95442c9762357fe128dc7ae3dc199d006de93eb33ba3972e0a9
|
||||
F src/test_window.c cdae419fdcea5bad6dcd9368c685abdad6deb59e9fc8b84b153de513d394ba3f
|
||||
F src/test_wsd.c 41cadfd9d97fe8e3e4e44f61a4a8ccd6f7ca8fe9
|
||||
F src/threads.c 4ae07fa022a3dc7c5beb373cf744a85d3c5c6c3c
|
||||
F src/tokenize.c c64c49d7c2ec4490c2fef1f24350167ba16b03b0c6cee58ad1a1d70a4325d4e9
|
||||
F src/tokenize.c 0b9c82fa628b5adce93e2bcaf935a24d43eb83344fb51551f7835526d0693fc4
|
||||
F src/treeview.c c6260e1fa5f41c361b2409edc9b0050bcaef5bc4d6abc467fbc45f0d7ccf3d84
|
||||
F src/trigger.c 861c3ec2c5b0fc830bdf82470454a9324fad70cbaa96d2e208fb54577c9e8d28
|
||||
F src/trigger.c bce0908f714a5b89360c01e444521a648997425e2a91ff9b92b899cf8d53c20b
|
||||
F src/update.c 0f5a61f0787199983530a33f6fffe4f52742f35fcdf6ccfad1078b1a8bc17723
|
||||
F src/upsert.c df8f1727d62b5987c4fd302cd4d7c0c84ae57cd65683c5a34a740dfe24039235
|
||||
F src/utf.c ee39565f0843775cc2c81135751ddd93eceb91a673ea2c57f61c76f288b041a0
|
||||
F src/util.c 41c7a72da1df47864faa378a1c720b38adb288c6838cb6be5594511b6287a048
|
||||
F src/vacuum.c 492422c1463c076473bae1858799c7a0a5fe87a133d1223239447c422cd26286
|
||||
F src/vdbe.c d8d2f2a1247bada7db7acf1f4ae65088bc09f020f4acf15810ef67f4aabe1ce9
|
||||
F src/vdbe.c 5001a0d3003d3664615dd7ac3cedab1d51e2391b5bdd0878f40a41fdcd942e13
|
||||
F src/vdbe.h 25dabb25c7e157b84e59260cfb5b466c3ac103ede9f36f4db371332c47601abe
|
||||
F src/vdbeInt.h 3df118924e1711f1bbc8e30c46260d0ab6c3b029b32dd411f789111f76434f3c
|
||||
F src/vdbeInt.h 000d9ab1ea4cb55a80de15e28f3f595645b4fddef34bca4347fb3db8031d9041
|
||||
F src/vdbeapi.c 4a43e303ec3354c785f453e881521969378e85628278ab74ba4a9df790c0d93b
|
||||
F src/vdbeaux.c fb51483c2bcaf45c5de63c26cce8649ef37f1332e8e035867033d21ef5e7fc2c
|
||||
F src/vdbeaux.c 1b3eaa3a70d9d1877266e8ade0d0c3b2b4c6cf77d393d94dbcbd522b9bfefc15
|
||||
F src/vdbeblob.c 253ed82894924c362a7fa3079551d3554cd1cdace39aa833da77d3bc67e7c1b1
|
||||
F src/vdbemem.c 947f2a65910edb4014dc981d33e414a68c51f169f9df8c4c493a0ba840b6eb1f
|
||||
F src/vdbesort.c f5b5e473a7cee44e47a94817b042fd7172cf3aa2c0a7928a8339d612bcfdec5a
|
||||
@@ -632,8 +632,8 @@ F src/walker.c d42d6c80ea363ef689a462e65eefcfe87deab924c50de5baa37ecb6af7d7ddaa
|
||||
F src/where.c 10d06b16670a1d2a992d52a9f08e49426d38a08fb0a7ae5f7f62fd023d560e1e
|
||||
F src/whereInt.h 446e5e8018f83358ef917cf32d8e6a86dc8430113d0b17e720f1839d3faa44c4
|
||||
F src/wherecode.c e57a8690311a75d06e723e8d379f9831de04aba300e07174d236e32a7f9c7a13
|
||||
F src/whereexpr.c dbae38ffb500b5b8ba18d8d46666b2794efc5c5ff99e7a97fed07fec3b86c52a
|
||||
F src/window.c fdf01316f6cecf060378aa1713a29e527ab683823ba7d15b8978ec70165e8bdb
|
||||
F src/whereexpr.c 4ba94b8ebbff97c658b212de6ccdb6d3a41847800bdf99e7a2a967c250269f2c
|
||||
F src/window.c 32b03808aff2e7263889cce0cbcb2a68efefc2a9d5187514ddb6a2a1046dc7f5
|
||||
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
|
||||
F test/affinity2.test ce1aafc86e110685b324e9a763eab4f2a73f737842ec3b687bd965867de90627
|
||||
F test/affinity3.test eecb0dabee4b7765a8465439d5e99429279ffba23ca74a7eae270a452799f9e7
|
||||
@@ -641,21 +641,21 @@ F test/aggerror.test a867e273ef9e3d7919f03ef4f0e8c0d2767944f2
|
||||
F test/aggnested.test 2f65ec8132e0ca896de550b9908094d49ad65a99116a9d79deeb6017604ad4f6
|
||||
F test/alias.test 4529fbc152f190268a15f9384a5651bbbabc9d87
|
||||
F test/all.test 2ecb8bbd52416642e41c9081182a8df05d42c75637afd4488aace78cc4b69e13
|
||||
F test/alter.test 25e109787dc5e631e117eb6e1c57f96a572bb51228db3b4f8b5f41d665e2ccaa
|
||||
F test/alter.test f53d8a4ecd35f051c07e54a36beec5d0a30d30a9d98bc723f6cde6afbfb3c5ca
|
||||
F test/alter2.test a966ccfcddf9ce0a4e0e6ff1aca9e6e7948e0e242cd7e43fc091948521807687
|
||||
F test/alter3.test e487958dec7932453e0b83baf21d6b1e71d5e7d9a55bc20eadfa62a51ddffc29
|
||||
F test/alter4.test dfd6086faf461b27ca2d2999848dcd207edf23352fc1592d0005c0844f3f08cf
|
||||
F test/alterauth.test 63442ba61ceb0c1eeb63aac1f4f5cebfa509d352276059d27106ae256bafc959
|
||||
F test/alterauth2.test 794ac5cef251819fe364b4fe20f12f86e9c5d68070513c7fd26c17cb244c89af
|
||||
F test/altercol.test 1d6a6fe698b81e626baea4881f5717f9bc53d7d07f1cd23ee7ad1b931f117ddf
|
||||
F test/altercol.test 3456f7cc4196ef8f7d82d245d6e91940eb12bc95c36c91ac4b512f6b5c9a4fa9
|
||||
F test/altercorrupt.test 584d707a80e106952d6382790c8919bcf9f0db678ed3a1c09fd98b7f9d1d3a10
|
||||
F test/alterdropcol.test baad37ff9b07078ea02dcc33dbfb82bde655f3eee5c453e218f69501c36f02ba
|
||||
F test/alterdropcol2.test 3948c805ca52f4621051b35968c18c09d107eb117e2b656c78cee3b2870650c0
|
||||
F test/alterdropcol.test 596623cb8a72d9570bfb8417b0f302810efe007873796f03c17a9e9ff28dade1
|
||||
F test/alterdropcol2.test 527fce683b200d620f560f666c44ae33e22728e990a10a48a543280dfd4b4d41
|
||||
F test/alterlegacy.test f38c6d06cda39e1f7b955bbce57f2e3ef5b7cb566d3d1234502093e228c15811
|
||||
F test/altermalloc.test 167a47de41b5c638f5f5c6efb59784002b196fff70f98d9b4ed3cd74a3fb80c9
|
||||
F test/altermalloc2.test fa7b1c1139ea39b8dec407cf1feb032ca8e0076bd429574969b619175ad0174b
|
||||
F test/altermalloc3.test 2c7bbd8cf3e9c4a91e28675bb62bcc2ef70f227967fa74349f03d9f4642f0615
|
||||
F test/altertab.test 6d7bbac2c4a6ef71b775094a3298fa3a92274d95034ee23157ffba92768e47e6
|
||||
F test/altertab.test 7691872aadfe00a94b459af9086504bcf399dd936336e486da1b182930744b77
|
||||
F test/altertab2.test b0d62f323ca5dab42b0bc028c52e310ebdd13e655e8fac070fe622bad7852c2b
|
||||
F test/altertab3.test 2b82fa2236a3a91553d53ae5555d8e723c7eec174c41f1fa62ff497355398479
|
||||
F test/amatch1.test b5ae7065f042b7f4c1c922933f4700add50cdb9f
|
||||
@@ -682,7 +682,7 @@ F test/atof1.test 10049623e77006691c4c2978c1dc8a3f75276377a53417811aa85bda7493f9
|
||||
F test/atomic.test 065a453dde33c77ff586d91ccaa6ed419829d492dbb1a5694b8a09f3f9d7d061
|
||||
F test/atomic2.test b6863b4aa552543874f80b42fb3063f1c8c2e3d8e56b6562f00a3cc347b5c1da
|
||||
F test/atrc.c c388fac43dbba05c804432a7135ae688b32e8f25818e9994ffba4b64cf60c27c
|
||||
F test/attach.test d42862c72fef3d54367d962d41dcfb5363442a4a1bd898c22ae950cea1aa0dd3
|
||||
F test/attach.test 54f8e49e88d0de48f6428267a678465863d2b8f72320612f35bd5c02e240bc2f
|
||||
F test/attach2.test 256bd240da1835fb8408dd59fb7ef71f8358c7a756c46662434d11d07ba3a0ce
|
||||
F test/attach3.test c59d92791070c59272e00183b7353eeb94915976
|
||||
F test/attach4.test aa05b1d8218b24eba5a7cccf4f224f514ba57ba705c9267f09d2bb63fed0eea1
|
||||
@@ -699,6 +699,7 @@ F test/autoindex4.test 49d3cd791a9baa16fb461d7ea3de80d019a819cf
|
||||
F test/autoindex5.test a5d72fe8c217cc0ea356dc6fa06a282a8a3fc53aa807709d79dba07a8f248102
|
||||
F test/autovacuum.test 0831cd34e14695d297187f7f6519265e3121c5b0a1720e548e86829e796129e9
|
||||
F test/autovacuum_ioerr2.test 8a367b224183ad801e0e24dcb7d1501f45f244b4
|
||||
F test/avfs.test 0c3a38e03cccb0fc3127838462dc05dc3f4c1480d770c084b388304c25de3652
|
||||
F test/avtrans.test b7dc25459ecbd86c6fa9c606ee3068f59d81e225118617dcf2bbb6ded2ade89e
|
||||
F test/backcompat.test 3e64cedda754c778ef6bbe417b6e7a295e662a4d
|
||||
F test/backup.test dd4a5ff756e3df3931dacb1791db0584d4bad989
|
||||
@@ -821,7 +822,7 @@ F test/cursorhint.test 0175e4404181ace3ceca8b114eb0a98eae600d565aa4e2705abbe6614
|
||||
F test/cursorhint2.test 6f3aa9cb19e7418967a10ec6905209bcbb5968054da855fc36c8beee9ae9c42f
|
||||
F test/dataversion1.test 6e5e86ac681f0782e766ebcb56c019ae001522d114e0e111e5ebf68ccf2a7bb8
|
||||
F test/date.test 9b73bbeb1b82d9c1f44dec5cf563bf7da58d2373
|
||||
F test/date2.test 520a1708e4e14c682cf514560f3e9f2e5affa9d66560fbc2a6941ae291260daf
|
||||
F test/date2.test 7e12ec14aaf4d5e6294b4ba140445b0eca06ea50062a9c3a69c4ee13d0b6f8b1
|
||||
F test/dbdata.test 042f49acff3438f940eeba5868d3af080ae64ddf26ae78f80c92bec3ca7d8603
|
||||
F test/dbfuzz.c 73047c920d6210e5912c87cdffd9a1c281d4252e
|
||||
F test/dbfuzz001.test 55e1a3504f8dea84155e09912fe3b1c3ad77e0b1a938ec42ca03b8e51b321e30
|
||||
@@ -854,7 +855,7 @@ F test/e_delete.test ab39084f26ae1f033c940b70ebdbbd523dc4962e
|
||||
F test/e_droptrigger.test 235c610f8bf8ec44513e222b9085c7e49fad65ad0c1975ac2577109dd06fd8fa
|
||||
F test/e_dropview.test 74e405df7fa0f762e0c9445b166fe03955856532e2bb234c372f7c51228d75e7
|
||||
F test/e_expr.test 6ba7a51ece7b3e7fc145f14f924eed25ebb5a24e7b8596c78f3838d372cf0385
|
||||
F test/e_fkey.test 0b458b85f192cdb9e9933d5891848bb19bcc44d3f49faf111a375f2844a164d3
|
||||
F test/e_fkey.test a2907f749cccd0b2c30d8576b673002eebdcc1fc9964bae61e5117b1d54733e2
|
||||
F test/e_fts3.test 17ba7c373aba4d4f5696ba147ee23fd1a1ef70782af050e03e262ca187c5ee07
|
||||
F test/e_insert.test f02f7f17852b2163732c6611d193f84fc67bc641fb4882c77a464076e5eba80e
|
||||
F test/e_reindex.test 2b0e29344497d9a8a999453a003cb476b6b1d2eef2d6c120f83c2d3a429f3164
|
||||
@@ -881,7 +882,7 @@ F test/exclusive.test 7ff63be7503990921838d5c9f77f6e33e68e48ed1a9d48cd28745bf650
|
||||
F test/exclusive2.test 984090e8e9d1b331d2e8111daf6e5d61dda0bef7
|
||||
F test/exec.test e949714dc127eaa5ecc7d723efec1ec27118fdd7
|
||||
F test/exists.test 79a75323c78f02bbe9c251ea502a092f9ef63dac
|
||||
F test/exists2.test 3e5726d6a67ebd4bd3466db58be424c09156c1f276c7594abb260cbf6ad494d3
|
||||
F test/exists2.test 47970f2ce98826519cc38ce502b718641755b30a93d9b89915019ba1e770f361
|
||||
F test/existsfault.test 74f7edc713f5a335e7ff47adf503067bf05c6f8630f88b2a19c24f0fa5486ab8
|
||||
F test/expr.test 26cd01e8485bc48c8aa6a1add598e9ce1e706b4eb4f3f554e0b0223022e8c2cf
|
||||
F test/expr2.test c27327ae9c017a7ff6280123f67aff496f912da74d78c888926d68b46ec75fd8
|
||||
@@ -970,7 +971,7 @@ F test/fts3corrupt2.test e318f0676e5e78d5a4b702637e2bb25265954c08a1b1e4aaf93c788
|
||||
F test/fts3corrupt3.test 0d5b69a0998b4adf868cc301fc78f3d0707745f1d984ce044c205cdb764b491f
|
||||
F test/fts3corrupt4.test b71512ec391d39da96d60d01959e4e9f20d4237a964a94abcf5f5a2ad28378c1
|
||||
F test/fts3corrupt5.test 0549f85ec4bd22e992f645f13c59b99d652f2f5e643dac75568bfd23a6db7ed5
|
||||
F test/fts3corrupt6.test b6c55218b704b0cef224b284c756f9c55d0afd0b3c3837618bffeaa8c31e0d8e
|
||||
F test/fts3corrupt6.test d5896a8d389bd824457772dc1e2d2023cd5c5cf8e42733607b5d632103018d8b
|
||||
F test/fts3cov.test 7eacdbefd756cfa4dc2241974e3db2834e9b372ca215880e00032222f32194cf
|
||||
F test/fts3d.test 2bd8c97bcb9975f2334147173b4872505b6a41359a4f9068960a36afe07a679f
|
||||
F test/fts3defer.test f4c20e4c7153d20a98ee49ee5f3faef624fefc9a067f8d8d629db380c4d9f1de
|
||||
@@ -1044,7 +1045,7 @@ F test/fuzz3.test 9c813e6613b837cb7a277b0383cd66bfa07042b4cf0317157c35852f30043c
|
||||
F test/fuzz4.test c229bcdb45518a89e1d208a21343e061503460ac69fae1539320a89f572eb634
|
||||
F test/fuzz_common.tcl b7197de6ed1ee8250a4f82d67876f4561b42ee8cbbfc6160dcb66331bad3f830
|
||||
F test/fuzz_malloc.test f348276e732e814802e39f042b1f6da6362a610af73a528d8f76898fde6b22f2
|
||||
F test/fuzzcheck.c 95427205d6cedb8fdb95bf7738e95785c790febf782d9c1e6067baaa1adc871d
|
||||
F test/fuzzcheck.c 772110a59c6f839f95e49a9fd3e5f855bd9cbb90e9d366a6ccd15cb3616fc631
|
||||
F test/fuzzdata1.db d36e88741b4f23bcbaaf55b006290669d03c6c891cf13c7b3a53bc1b097b693f
|
||||
F test/fuzzdata2.db 128b3feeb78918d075c9b14b48610145a0dd4c8d6f1ca7c2870c7e425f5bf31f
|
||||
F test/fuzzdata3.db c6586d3e3cef0fbc18108f9bb649aa77bfc38aba
|
||||
@@ -1052,7 +1053,7 @@ F test/fuzzdata4.db b502c7d5498261715812dd8b3c2005bad08b3a26e6489414bd13926cd3e4
|
||||
F test/fuzzdata5.db e35f64af17ec48926481cfaf3b3855e436bd40d1cfe2d59a9474cb4b748a52a5
|
||||
F test/fuzzdata6.db 92a80e4afc172c24f662a10a612d188fb272de4a9bd19e017927c95f737de6d7
|
||||
F test/fuzzdata7.db 0166b56fd7a6b9636a1d60ef0a060f86ddaecf99400a666bb6e5bbd7199ad1f2
|
||||
F test/fuzzdata8.db 977cb95f4a5d828056dea804a6de416debe3fa0182c77f47fe19a0554aaf4db0
|
||||
F test/fuzzdata8.db c8325de6fbdd24d030cd3a01384a2ff325dda5d5e3ff5d531a26ada3d9d7e010
|
||||
F test/fuzzer1.test 3d4c4b7e547aba5e5511a2991e3e3d07166cfbb8
|
||||
F test/fuzzer2.test a85ef814ce071293bce1ad8dffa217cbbaad4c14
|
||||
F test/fuzzerfault.test f64c4aef4c9e9edf1d6dc0d3f1e65dcc81e67c996403c88d14f09b74807a42bc
|
||||
@@ -1093,7 +1094,7 @@ F test/index6.test f172653b35b20233e59200e8b92a76db61bf7285437bf777b93b306ba26a4
|
||||
F test/index7.test b8a0ba2110fd517bb48c4e76d26d60f1ab2ed9e257b18d71f820d7e71e9f8570
|
||||
F test/index8.test bc2e3db70e8e62459aaa1bd7e4a9b39664f8f9d7
|
||||
F test/index9.test 0aa3e509dddf81f93380396e40e9bb386904c1054924ba8fa9bcdfe85a8e7721
|
||||
F test/indexedby.test f54aac21c06948872010a956fd02de5178c362c7785a9887cf0b8616be17883b
|
||||
F test/indexedby.test a3ca11f0819a9279619099f36b624bcaa315f7a1ed65c3ed2219c2a944683d2c
|
||||
F test/indexexpr1.test 284e119999d132cc8bf37735a928c9859b28e8e295d02b7a6a4f93977c7f9ba5
|
||||
F test/indexexpr2.test dba11dbb0a58fcba4cd694f46b4004976123b81b0501f525d43c9be59f0207b1
|
||||
F test/indexfault.test 98d78a8ff1f5335628b62f886a1cb7c7dac1ef6d48fa39c51ec871c87dce9811
|
||||
@@ -1144,7 +1145,7 @@ F test/lemon-test01.y 58b764610fd934e189ffbb0bbfa33d171b9cb06019b55bdc04d090d676
|
||||
F test/like.test 0b7b4765ca59d95a1f92dfab9e4d810c9fb8280b5edd6332a01340a20db9e0ed
|
||||
F test/like2.test 3b2ee13149ba4a8a60b59756f4e5d345573852da
|
||||
F test/like3.test 03d1bdf848483b78d2cfd1db283d75c4ec2e37c8b8eccc006813f3978d78fbbd
|
||||
F test/limit.test 0c99a27a87b14c646a9d583c7c89fd06c352663e
|
||||
F test/limit.test 350f5d03c29e7dff9a2cde016f84f8d368d40bcd02fa2b2a52fa10c4bf3cbfaf
|
||||
F test/limit2.test 9409b033284642a859fafc95f29a5a6a557bd57c1f0d7c3f554bd64ed69df77e
|
||||
F test/loadext.test faa4f6eed07a5aac35d57fdd7bc07f8fc82464cfd327567c10cf0ba3c86cde04
|
||||
F test/loadext2.test 0408380b57adca04004247179837a18e866a74f7
|
||||
@@ -1225,6 +1226,7 @@ F test/notify2.test 2ecabaa1305083856b7c39cf32816b612740c161
|
||||
F test/notify3.test 10ff25cde502e72a92053a2f215d64bece4ef934
|
||||
F test/notnull.test a37b663d5bb728d66fc182016613fb8e4a0a4bbf3d75b8876a7527f7d4ed3f18
|
||||
F test/notnull2.test 965a893619751255e59c911a8c58504b3174a3788b1458b7c7365b232209711b
|
||||
F test/notnullfault.test 6126e31300632070ca6021698393c7fcf61ab4791bc2aa1d6d704242c0fcd4f8
|
||||
F test/null.test b7ff206a1c60fe01aa2abd33ef9ea83c93727d993ca8a613de86e925c9f2bc6f
|
||||
F test/nulls1.test 82c5bc33148405f21205865abf13c786084438d573a4ac4e87e11b6091cde526
|
||||
F test/numcast.test 5d126f7f581432e86a90d1e35cac625164aec4a1
|
||||
@@ -1261,7 +1263,7 @@ F test/parser1.test 6ccdf5e459a5dc4673d3273dc311a7e9742ca952dd0551a6a6320d27035c
|
||||
F test/pcache.test c8acbedd3b6fd0f9a7ca887a83b11d24a007972b
|
||||
F test/pcache2.test af7f3deb1a819f77a6d0d81534e97d1cf62cd442
|
||||
F test/percentile.test 4243af26b8f3f4555abe166f723715a1f74c77ff
|
||||
F test/permutations.test 661a4325a5717957a77836910ee164ba26594a502d7a3df0e1ae7b9cba829c5d
|
||||
F test/permutations.test 0a7cf0b6b1283cdd4f0d6e31cb7afbde81d20b1caef60b73914e85b6bf660b8a
|
||||
F test/pg_common.tcl 3b27542224db1e713ae387459b5d117c836a5f6e328846922993b6d2b7640d9f
|
||||
F test/pragma.test 50b91bedea9324d3ab48e793f908ee7d2c7dcf84bfa2281e792838be59641ec8
|
||||
F test/pragma2.test e5d5c176360c321344249354c0c16aec46214c9f
|
||||
@@ -1280,7 +1282,7 @@ F test/quick.test 1681febc928d686362d50057c642f77a02c62e57
|
||||
F test/quota-glob.test 32901e9eed6705d68ca3faee2a06b73b57cb3c26
|
||||
F test/quota.test bfb269ce81ea52f593f9648316cd5013d766dd2a
|
||||
F test/quota2.test 7dc12e08b11cbc4c16c9ba2aa2e040ea8d8ab4b8
|
||||
F test/quote.test 3f9238ab0e1db70dea89af9afa5859dbd759b0ce0a63da67d547553e2c316475
|
||||
F test/quote.test b8ddaba6b81dcf63bb31243219e28a2f96e04396adc50108cc7e5593019c3eb5
|
||||
F test/randexpr1.tcl 40dec52119ed3a2b8b2a773bce24b63a3a746459
|
||||
F test/randexpr1.test eda062a97e60f9c38ae8d806b03b0ddf23d796df
|
||||
F test/rbu.test 168573d353cd0fd10196b87b0caa322c144ef736
|
||||
@@ -1290,10 +1292,10 @@ F test/regexp1.test 497ea812f264d12b6198d6e50a76be4a1973a9d8
|
||||
F test/regexp2.test 40e894223b3d6672655481493f1be12012f2b33c
|
||||
F test/reindex.test cd9d6021729910ece82267b4f5e1b5ac2911a7566c43b43c176a6a4732e2118d
|
||||
F test/releasetest.tcl fb76d8fcc95ac29d6356cd9e52b726ab9e43a24082897618dfbcb7c2b0049153 x
|
||||
F test/releasetest_data.tcl d60628b6a04891e97cc4f5fbce08abe13c5b74cb23dcca5ac24800471a3bc6db
|
||||
F test/releasetest_data.tcl 3d41ddb3f04f474ac9d925485da24ce6576ff0ebc4c7201c8a340bc09846c261
|
||||
F test/resetdb.test 8062cf10a09d8c048f8de7711e94571c38b38168db0e5877ba7561789e5eeb2b
|
||||
F test/resolver01.test f4022acafda7f4d40eca94dbf16bc5fc4ac30ceb
|
||||
F test/returning1.test 684e1c73d961422a7376c932fcdd6dacf02bad21d12f749cfe8c19991ef379f6
|
||||
F test/returning1.test ce2192b40045cc94d53ac5ec5789a72a3ade233a6ea6e29666e296d151b59479
|
||||
F test/rollback.test 06680159bc6746d0f26276e339e3ae2f951c64812468308838e0a3362d911eaa
|
||||
F test/rollback2.test bc868d57899dc6972e2b4483faae0e03365a0556941474eec487ae21d8d38bb6
|
||||
F test/rollbackfault.test 0e646aeab8840c399cfbfa43daab46fd609cf04a
|
||||
@@ -1301,7 +1303,7 @@ F test/round1.test 768018b04522ca420b1aba8a24bd76091d269f3bce3902af3ec6ebcee41ab
|
||||
F test/rowallock.test 3f88ec6819489d0b2341c7a7528ae17c053ab7cc
|
||||
F test/rowhash.test 0bc1d31415e4575d10cacf31e1a66b5cc0f8be81
|
||||
F test/rowid.test bfbd7b97d9267660be3c8f28507c4ed7f205196b8877c0db42df347c2e8845e3
|
||||
F test/rowvalue.test b5436c767394a3f8fa5e7e474b2114ba430fdab34a5c8573c1b6256756534565
|
||||
F test/rowvalue.test 6795850abf6243e96f09ef041919d1ea61713332237b60d01371c0fee73f6379
|
||||
F test/rowvalue2.test 060d238b7e5639a7c5630cb5e63e311b44efef2b
|
||||
F test/rowvalue3.test 3068f508753af69884b12125995f023da0dbb256
|
||||
F test/rowvalue4.test 02e35f7762371c2f57ebd856aa056eac56cb27ef7715a0bb31eac1895a745356
|
||||
@@ -1334,7 +1336,7 @@ F test/securedel2.test 2d54c28e46eb1fd6902089958b20b1b056c6f1c5
|
||||
F test/select1.test 3d23f66bf9ba77570acfe2ca5f1540ece17037cc64ab1a00efec9758ac29c268
|
||||
F test/select2.test 352480e0e9c66eda9c3044e412abdf5be0215b56
|
||||
F test/select3.test c49fbb758903f3718e2de5aa4655eda4838131cbea24a86db908f8b6889aa68c
|
||||
F test/select4.test e8a2502e3623f3058871030599a48abb35789d2244d5b380ecf3696873fdd4a4
|
||||
F test/select4.test f0684d3da3bccacbe2a1ebadf6fb49d9df6f53acb4c6ebc228a88d0d6054cc7b
|
||||
F test/select5.test df9ec0d218cedceb4fe7b63262025b547b50a55e59148c6f40b60ca25f1d4546
|
||||
F test/select6.test 319d45e414cdd321bf17cfacedaf19e3935ad64dac357c53f1492338c6e9b801
|
||||
F test/select7.test f659f231489349e8c5734e610803d7654207318f
|
||||
@@ -1659,7 +1661,7 @@ F test/upsert1.test 88f9e258c6a0eeeb85937b08831e8daad440ba41f125af48439e9d33f266
|
||||
F test/upsert2.test 9c3cdbb1a890227f6504ce4b0e3de68f4cdfa16bb21d8641208a9239896c5a09
|
||||
F test/upsert3.test 88d7d590a1948a9cb6eac1b54b0642f67a9f35a1fc0f19b200e97d5d39e3179c
|
||||
F test/upsert4.test 25d2a1da92f149331ae0c51ca6e3eee78189577585eab92de149900d62994fa5
|
||||
F test/upsert5.test f49faf5f15b5c3641c6f5d7c7cc531ef5ac997567b2b6bb7bc96f7c88753ca0b
|
||||
F test/upsert5.test fff0dcfce73c649204543088d8e5bde01172676063ec9b8f8fc7f195abc386fe
|
||||
F test/upsertfault.test f21ca47740841fdb4d61acfa7b17646d773e67724fe8c185b71c018db8a94b35
|
||||
F test/uri.test 3481026f00ade6dfe8adb7acb6e1e47b04369568
|
||||
F test/uri2.test 9d3ba7a53ee167572d53a298ee4a5d38ec4a8fb7
|
||||
@@ -1675,7 +1677,7 @@ F test/vacuum6.test d3173a54edc81d13d99e4cf4972232b3cbb52f1d56ed48c3a939ef4e751c
|
||||
F test/vacuummem.test 7b42abb3208bd82dd23a7536588396f295a314f2
|
||||
F test/varint.test bbce22cda8fc4d135bcc2b589574be8410614e62
|
||||
F test/veryquick.test 57ab846bacf7b90cf4e9a672721ea5c5b669b661
|
||||
F test/view.test fd48eddb32a35a98c3de70062ebac66ebf4a2bbfc75a1cc1109159ef8bfc47a9
|
||||
F test/view.test ea88361d5e9bc8eabf9f573185a16aea73a885be9b6c6a95ae84908913416a80
|
||||
F test/vtab1.test c5d9e90ed02bcacd776dcbb7360199d290f7f53c26b484ddece543060c54319f
|
||||
F test/vtab2.test 14d4ab26cee13ba6cf5c5601b158e4f57552d3b055cdd9406cf7f711e9c84082
|
||||
F test/vtab3.test b45f47d20f225ccc9c28dc915d92740c2dee311e
|
||||
@@ -1698,7 +1700,7 @@ F test/vtab_alter.test 736e66fb5ec7b4fee58229aa3ada2f27ec58bc58c00edae4836890c37
|
||||
F test/vtab_err.test dcc8b7b9cb67522b3fe7a272c73856829dae4ab7fdb30399aea1b6981bda2b65
|
||||
F test/vtab_shared.test 5253bff2355a9a3f014c15337da7e177ab0ef8ad
|
||||
F test/vtabdrop.test 65d4cf6722972e5499bdaf0c0d70ee3b8133944a4e4bc31862563f32a7edca12
|
||||
F test/wal.test 16180bc4becda176428ad02eaea437b4b8f5ae099314de443a4e12b2dcc007a2
|
||||
F test/wal.test b7cc6984709f54afbf8441747ced1f646af120bf0c1b1d847bfa39306fbea089
|
||||
F test/wal2.test 31f6e2c404b9f2cdf9ca19b105a1742fdc19653c2c936da39e3658c617524046
|
||||
F test/wal3.test 2a93004bc0fb2b5c29888964024695bade278ab2
|
||||
F test/wal4.test 4744e155cd6299c6bd99d3eab1c82f77db9cdb3c
|
||||
@@ -1759,7 +1761,7 @@ F test/whereK.test f8e3cf26a8513ecc7f514f54df9f0572c046c42b
|
||||
F test/whereL.test 1afe47227f093dc0547236491fb37529b7be9724b8575925a321001b80e6a23a
|
||||
F test/wherefault.test 1374c3aa198388925246475f84ad4cd5f9528864
|
||||
F test/wherelfault.test 9012e4ef5259058b771606616bd007af5d154e64cc25fa9fd4170f6411db44e3
|
||||
F test/wherelimit.test daa0fd9122c5745cc459ec40b8d3c16ce13ce8382b5b847e7cfff4b871260cbf
|
||||
F test/wherelimit.test afb46397c6d7e964e6e294ba3569864a0c570fe3807afc634236c2b752372f31
|
||||
F test/wherelimit2.test 657a3f24aadee62d058c5091ea682dc4af4b95ffe32f137155be49799a58e721
|
||||
F test/win32heap.test 10fd891266bd00af68671e702317726375e5407561d859be1aa04696f2aeee74
|
||||
F test/win32lock.test fbf107c91d8f5512be5a5b87c4c42ab9fdd54972
|
||||
@@ -1778,16 +1780,16 @@ F test/window7.tcl 6a1210f05d40ec89c22960213a22cd3f98d4e2f2eb20646c83c8c30d4d761
|
||||
F test/window7.test 1d31276961ae7801edc72173edaf7593e3cbc79c06d1f1f09e20d8418af403cd
|
||||
F test/window8.tcl f2711aa3571e4e6b0dad98db8d95fd6cb8d9db0c92bbdf535f153b07606a1ce2
|
||||
F test/window8.test c4331b27a6f66d69fa8f8bab10cc731db1a81d293ae108a68f7c3487fa94e65b
|
||||
F test/window9.test 4d8c875b73febdbac9b8f2b52ec132b98f48261cdafd6b08db62bc6d8ff913fc
|
||||
F test/window9.test 349c71eab4288a1ffc19e2f65872ec2c37e6cf8a1dda2ad300364b7450ae4836
|
||||
F test/windowA.test 6d63dc1260daa17141a55007600581778523a8b420629f1282d2acfc36af23be
|
||||
F test/windowB.test 7a983ea1cc1cf72be7f378e4b32f6cb2d73014c5cd8b25aaee825164cd4269e5
|
||||
F test/windowB.test 6e601f8178ba8ba28b2f19e74fe613815084bb4a8d2ad942defc7d42e191e521
|
||||
F test/windowerr.tcl f5acd6fbc210d7b5546c0e879d157888455cd4a17a1d3f28f07c1c8a387019e0
|
||||
F test/windowerr.test a8b752402109c15aa1c5efe1b93ccb0ce1ef84fa964ae1cd6684dd0b3cc1819b
|
||||
F test/windowfault.test d543d46571b32d19f198cb04b6505747fabf3cc369970daae47074ee793612be
|
||||
F test/windowpushd.test 5b9c114e8173c3addacf58a0fcd941437b14649f2033700184479a13f188ad00
|
||||
F test/with1.test 780be387f01e290e768bdfd1827280f9e37ba37223eb4736aba386864fac5a94
|
||||
F test/with2.test e0030e2f0267a910d6c0e4f46f2dfe941c1cc0d4f659ba69b3597728e7e8f1ab
|
||||
F test/with3.test 85e059bf4c2ef5626411ee59f399b4bb4b4a0f009bcb7db86f254e570ed11831
|
||||
F test/with2.test 000fb95f1f29dae868cea0f41505eb5126077d49eb967ff88f9ee46212ad8863
|
||||
F test/with3.test 2f1e05aef7aeef9a741cbf36deeb4be73003dc541921c3abc78becbbf5b7852d
|
||||
F test/with4.test 257be66c0c67fee1defbbac0f685c3465e2cad037f21ce65f23f86084f198205
|
||||
F test/with5.test 6248213c41fab36290b5b73aa3f937309dfba337004d9d8434c3fabc8c7d4be8
|
||||
F test/with6.test 3001b59179cbdc26a8c67ff8f46944e3141fdece9ab064c49bbf08459b67b207
|
||||
@@ -1873,7 +1875,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
|
||||
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
||||
F tool/speedtest8inst1.c 7ce07da76b5e745783e703a834417d725b7d45fd
|
||||
F tool/split-sqlite3c.tcl 3efcd4240b738f6bb2b5af0aea7e1e0ef9bc1c61654f645076cec883030b710c
|
||||
F tool/sqldiff.c 4151108387cb56c08906e5ac8d6a353dcfe8fc6014eeded0f0910e2230ea0f5b
|
||||
F tool/sqldiff.c 21226ef092ec1e543b237c5d3d2d32d344a60f2437eadfea04f65b348fbd00e4
|
||||
F tool/sqlite3_analyzer.c.in 7eeaae8b0d7577662acaabbb11107af0659d1b41bc1dfdd4d91422de27127968
|
||||
F tool/sqltclsh.c.in 1bcc2e9da58fadf17b0bf6a50e68c1159e602ce057210b655d50bad5aaaef898
|
||||
F tool/sqltclsh.tcl 862f4cf1418df5e1315b5db3b5ebe88969e2a784525af5fbf9596592f14ed848
|
||||
@@ -1908,7 +1910,9 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
|
||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||
P 4cb2ea5795b0c0678665fd89bd560209beaab8a756fe00335dbfd07493b0542d
|
||||
R 77dd21d5cda99cecce763a4b3e142b99
|
||||
P 64b0eb7e1171611436031b8d2923ce947c37addbd8a776a7ded461fc486c3640
|
||||
R 55c5b4b708ce6050b44359864678297d
|
||||
T +sym-release *
|
||||
T +sym-version-3.35.4 *
|
||||
U dan
|
||||
Z 6cd7a73f945651c0ccd62f6c92141ec4
|
||||
Z 77a9a4e15883c7141df67ebe55a2c0d2
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
d235d406283191fc7b9e1299be602f1e8be6f36cee8b183cf85c8660519a1c3b
|
||||
5d4c65779dab868b285519b19e4cf9d451d50c6048f06f653aa701ec212df45e
|
||||
+32
-23
@@ -53,7 +53,8 @@ static void renameTestSchema(
|
||||
Parse *pParse, /* Parse context */
|
||||
const char *zDb, /* Name of db to verify schema of */
|
||||
int bTemp, /* True if this is the temp db */
|
||||
const char *zWhen /* "when" part of error message */
|
||||
const char *zWhen, /* "when" part of error message */
|
||||
const char *zDropColumn /* Name of column being dropped */
|
||||
){
|
||||
pParse->colNamesSet = 1;
|
||||
sqlite3NestedParse(pParse,
|
||||
@@ -61,9 +62,9 @@ static void renameTestSchema(
|
||||
"FROM \"%w\"." DFLT_SCHEMA_TABLE " "
|
||||
"WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X'"
|
||||
" AND sql NOT LIKE 'create virtual%%'"
|
||||
" AND sqlite_rename_test(%Q, sql, type, name, %d, %Q)=NULL ",
|
||||
" AND sqlite_rename_test(%Q, sql, type, name, %d, %Q, %Q)=NULL ",
|
||||
zDb,
|
||||
zDb, bTemp, zWhen
|
||||
zDb, bTemp, zWhen, zDropColumn
|
||||
);
|
||||
|
||||
if( bTemp==0 ){
|
||||
@@ -72,8 +73,8 @@ static void renameTestSchema(
|
||||
"FROM temp." DFLT_SCHEMA_TABLE " "
|
||||
"WHERE name NOT LIKE 'sqliteX_%%' ESCAPE 'X'"
|
||||
" AND sql NOT LIKE 'create virtual%%'"
|
||||
" AND sqlite_rename_test(%Q, sql, type, name, 1, %Q)=NULL ",
|
||||
zDb, zWhen
|
||||
" AND sqlite_rename_test(%Q, sql, type, name, 1, %Q, %Q)=NULL ",
|
||||
zDb, zWhen, zDropColumn
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -236,7 +237,7 @@ void sqlite3AlterRenameTable(
|
||||
"sql = sqlite_rename_table(%Q, type, name, sql, %Q, %Q, 1), "
|
||||
"tbl_name = "
|
||||
"CASE WHEN tbl_name=%Q COLLATE nocase AND "
|
||||
" sqlite_rename_test(%Q, sql, type, name, 1, 'after rename') "
|
||||
" sqlite_rename_test(%Q, sql, type, name, 1, 'after rename',0) "
|
||||
"THEN %Q ELSE tbl_name END "
|
||||
"WHERE type IN ('view', 'trigger')"
|
||||
, zDb, zTabName, zName, zTabName, zDb, zName);
|
||||
@@ -256,7 +257,7 @@ void sqlite3AlterRenameTable(
|
||||
#endif
|
||||
|
||||
renameReloadSchema(pParse, iDb, INITFLAG_AlterRename);
|
||||
renameTestSchema(pParse, zDb, iDb==1, "after rename");
|
||||
renameTestSchema(pParse, zDb, iDb==1, "after rename", 0);
|
||||
|
||||
exit_rename_table:
|
||||
sqlite3SrcListDelete(db, pSrc);
|
||||
@@ -624,7 +625,7 @@ void sqlite3AlterRenameColumn(
|
||||
|
||||
/* Drop and reload the database schema. */
|
||||
renameReloadSchema(pParse, iSchema, INITFLAG_AlterRename);
|
||||
renameTestSchema(pParse, zDb, iSchema==1, "after rename");
|
||||
renameTestSchema(pParse, zDb, iSchema==1, "after rename", 0);
|
||||
|
||||
exit_rename_column:
|
||||
sqlite3SrcListDelete(db, pSrc);
|
||||
@@ -1048,12 +1049,17 @@ static int renameParseSql(
|
||||
const char *zDb, /* Name of schema SQL belongs to */
|
||||
sqlite3 *db, /* Database handle */
|
||||
const char *zSql, /* SQL to parse */
|
||||
int bTemp /* True if SQL is from temp schema */
|
||||
int bTemp, /* True if SQL is from temp schema */
|
||||
const char *zDropColumn /* Name of column being dropped */
|
||||
){
|
||||
int rc;
|
||||
char *zErr = 0;
|
||||
|
||||
db->init.iDb = bTemp ? 1 : sqlite3FindDbName(db, zDb);
|
||||
if( zDropColumn ){
|
||||
db->init.bDropColumn = 1;
|
||||
db->init.azInit = (char**)&zDropColumn;
|
||||
}
|
||||
|
||||
/* Parse the SQL statement passed as the first argument. If no error
|
||||
** occurs and the parse does not result in a new table, index or
|
||||
@@ -1086,6 +1092,7 @@ static int renameParseSql(
|
||||
#endif
|
||||
|
||||
db->init.iDb = 0;
|
||||
db->init.bDropColumn = 0;
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -1241,9 +1248,8 @@ static int renameResolveTrigger(Parse *pParse){
|
||||
rc = sqlite3ResolveExprListNames(&sNC, pStep->pExprList);
|
||||
}
|
||||
assert( !pStep->pUpsert || (!pStep->pWhere && !pStep->pExprList) );
|
||||
if( pStep->pUpsert ){
|
||||
if( pStep->pUpsert && rc==SQLITE_OK ){
|
||||
Upsert *pUpsert = pStep->pUpsert;
|
||||
assert( rc==SQLITE_OK );
|
||||
pUpsert->pUpsertSrc = pSrc;
|
||||
sNC.uNC.pUpsert = pUpsert;
|
||||
sNC.ncFlags = NC_UUpsert;
|
||||
@@ -1388,7 +1394,7 @@ static void renameColumnFunc(
|
||||
#ifndef SQLITE_OMIT_AUTHORIZATION
|
||||
db->xAuth = 0;
|
||||
#endif
|
||||
rc = renameParseSql(&sParse, zDb, db, zSql, bTemp);
|
||||
rc = renameParseSql(&sParse, zDb, db, zSql, bTemp, 0);
|
||||
|
||||
/* Find tokens that need to be replaced. */
|
||||
memset(&sWalker, 0, sizeof(Walker));
|
||||
@@ -1430,12 +1436,12 @@ static void renameColumnFunc(
|
||||
for(pIdx=sParse.pNewIndex; pIdx; pIdx=pIdx->pNext){
|
||||
sqlite3WalkExprList(&sWalker, pIdx->aColExpr);
|
||||
}
|
||||
}
|
||||
#ifndef SQLITE_OMIT_GENERATED_COLUMNS
|
||||
for(i=0; i<sParse.pNewTable->nCol; i++){
|
||||
sqlite3WalkExpr(&sWalker, sParse.pNewTable->aCol[i].pDflt);
|
||||
}
|
||||
for(i=0; i<sParse.pNewTable->nCol; i++){
|
||||
sqlite3WalkExpr(&sWalker, sParse.pNewTable->aCol[i].pDflt);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
for(pFKey=sParse.pNewTable->pFKey; pFKey; pFKey=pFKey->pNextFrom){
|
||||
for(i=0; i<pFKey->nCol; i++){
|
||||
@@ -1592,7 +1598,7 @@ static void renameTableFunc(
|
||||
sWalker.xSelectCallback = renameTableSelectCb;
|
||||
sWalker.u.pRename = &sCtx;
|
||||
|
||||
rc = renameParseSql(&sParse, zDb, db, zInput, bTemp);
|
||||
rc = renameParseSql(&sParse, zDb, db, zInput, bTemp, 0);
|
||||
|
||||
if( rc==SQLITE_OK ){
|
||||
int isLegacy = (db->flags & SQLITE_LegacyAlter);
|
||||
@@ -1708,6 +1714,7 @@ static void renameTableFunc(
|
||||
** 3: Object name.
|
||||
** 4: True if object is from temp schema.
|
||||
** 5: "when" part of error message.
|
||||
** 6: Name of column being dropped, or NULL.
|
||||
**
|
||||
** Unless it finds an error, this function normally returns NULL. However, it
|
||||
** returns integer value 1 if:
|
||||
@@ -1726,6 +1733,7 @@ static void renameTableTest(
|
||||
int bTemp = sqlite3_value_int(argv[4]);
|
||||
int isLegacy = (db->flags & SQLITE_LegacyAlter);
|
||||
char const *zWhen = (const char*)sqlite3_value_text(argv[5]);
|
||||
char const *zDropColumn = (const char*)sqlite3_value_text(argv[6]);
|
||||
|
||||
#ifndef SQLITE_OMIT_AUTHORIZATION
|
||||
sqlite3_xauth xAuth = db->xAuth;
|
||||
@@ -1736,7 +1744,7 @@ static void renameTableTest(
|
||||
if( zDb && zInput ){
|
||||
int rc;
|
||||
Parse sParse;
|
||||
rc = renameParseSql(&sParse, zDb, db, zInput, bTemp);
|
||||
rc = renameParseSql(&sParse, zDb, db, zInput, bTemp, zDropColumn);
|
||||
if( rc==SQLITE_OK ){
|
||||
if( isLegacy==0 && sParse.pNewTable && sParse.pNewTable->pSelect ){
|
||||
NameContext sNC;
|
||||
@@ -1803,10 +1811,11 @@ static void dropColumnFunc(
|
||||
db->xAuth = 0;
|
||||
#endif
|
||||
|
||||
rc = renameParseSql(&sParse, zDb, db, zSql, iSchema==1);
|
||||
UNUSED_PARAMETER(NotUsed);
|
||||
rc = renameParseSql(&sParse, zDb, db, zSql, iSchema==1, 0);
|
||||
if( rc!=SQLITE_OK ) goto drop_column_done;
|
||||
pTab = sParse.pNewTable;
|
||||
if( pTab->nCol==1 || iCol>=pTab->nCol ){
|
||||
if( pTab==0 || pTab->nCol==1 || iCol>=pTab->nCol ){
|
||||
/* This can happen if the sqlite_schema table is corrupt */
|
||||
rc = SQLITE_CORRUPT_BKPT;
|
||||
goto drop_column_done;
|
||||
@@ -1896,7 +1905,7 @@ void sqlite3AlterDropColumn(Parse *pParse, SrcList *pSrc, Token *pName){
|
||||
iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
|
||||
assert( iDb>=0 );
|
||||
zDb = db->aDb[iDb].zDbSName;
|
||||
renameTestSchema(pParse, zDb, iDb==1, "");
|
||||
renameTestSchema(pParse, zDb, iDb==1, "", 0);
|
||||
sqlite3NestedParse(pParse,
|
||||
"UPDATE \"%w\"." DFLT_SCHEMA_TABLE " SET "
|
||||
"sql = sqlite_drop_column(%d, sql, %d) "
|
||||
@@ -1906,7 +1915,7 @@ void sqlite3AlterDropColumn(Parse *pParse, SrcList *pSrc, Token *pName){
|
||||
|
||||
/* Drop and reload the database schema. */
|
||||
renameReloadSchema(pParse, iDb, INITFLAG_AlterDrop);
|
||||
renameTestSchema(pParse, zDb, iDb==1, "after drop column");
|
||||
renameTestSchema(pParse, zDb, iDb==1, "after drop column", zCol);
|
||||
|
||||
/* Edit rows of table on disk */
|
||||
if( pParse->nErr==0 && (pTab->aCol[iCol].colFlags & COLFLAG_VIRTUAL)==0 ){
|
||||
@@ -1966,7 +1975,7 @@ void sqlite3AlterFunctions(void){
|
||||
static FuncDef aAlterTableFuncs[] = {
|
||||
INTERNAL_FUNCTION(sqlite_rename_column, 9, renameColumnFunc),
|
||||
INTERNAL_FUNCTION(sqlite_rename_table, 7, renameTableFunc),
|
||||
INTERNAL_FUNCTION(sqlite_rename_test, 6, renameTableTest),
|
||||
INTERNAL_FUNCTION(sqlite_rename_test, 7, renameTableTest),
|
||||
INTERNAL_FUNCTION(sqlite_drop_column, 3, dropColumnFunc),
|
||||
};
|
||||
sqlite3InsertBuiltinFuncs(aAlterTableFuncs, ArraySize(aAlterTableFuncs));
|
||||
|
||||
+21
-10
@@ -2737,19 +2737,23 @@ static void freeTempSpace(BtShared *pBt){
|
||||
*/
|
||||
int sqlite3BtreeClose(Btree *p){
|
||||
BtShared *pBt = p->pBt;
|
||||
BtCursor *pCur;
|
||||
|
||||
/* Close all cursors opened via this handle. */
|
||||
assert( sqlite3_mutex_held(p->db->mutex) );
|
||||
sqlite3BtreeEnter(p);
|
||||
pCur = pBt->pCursor;
|
||||
while( pCur ){
|
||||
BtCursor *pTmp = pCur;
|
||||
pCur = pCur->pNext;
|
||||
if( pTmp->pBtree==p ){
|
||||
sqlite3BtreeCloseCursor(pTmp);
|
||||
|
||||
/* Verify that no other cursors have this Btree open */
|
||||
#ifdef SQLITE_DEBUG
|
||||
{
|
||||
BtCursor *pCur = pBt->pCursor;
|
||||
while( pCur ){
|
||||
BtCursor *pTmp = pCur;
|
||||
pCur = pCur->pNext;
|
||||
assert( pTmp->pBtree!=p );
|
||||
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Rollback any active transaction and free the handle structure.
|
||||
** The call to sqlite3BtreeRollback() drops any table-locks held by
|
||||
@@ -4131,7 +4135,7 @@ int sqlite3BtreeCommitPhaseTwo(Btree *p, int bCleanup){
|
||||
sqlite3BtreeLeave(p);
|
||||
return rc;
|
||||
}
|
||||
p->iDataVersion--; /* Compensate for pPager->iDataVersion++; */
|
||||
p->iBDataVersion--; /* Compensate for pPager->iDataVersion++; */
|
||||
pBt->inTransaction = TRANS_READ;
|
||||
btreeClearHasContent(pBt);
|
||||
}
|
||||
@@ -4541,7 +4545,14 @@ int sqlite3BtreeCloseCursor(BtCursor *pCur){
|
||||
unlockBtreeIfUnused(pBt);
|
||||
sqlite3_free(pCur->aOverflow);
|
||||
sqlite3_free(pCur->pKey);
|
||||
sqlite3BtreeLeave(pBtree);
|
||||
if( (pBt->openFlags & BTREE_SINGLE) && pBt->pCursor==0 ){
|
||||
/* Since the BtShared is not sharable, there is no need to
|
||||
** worry about the missing sqlite3BtreeLeave() call here. */
|
||||
assert( pBtree->sharable==0 );
|
||||
sqlite3BtreeClose(pBtree);
|
||||
}else{
|
||||
sqlite3BtreeLeave(pBtree);
|
||||
}
|
||||
pCur->pBtree = 0;
|
||||
}
|
||||
return SQLITE_OK;
|
||||
@@ -9654,7 +9665,7 @@ void sqlite3BtreeGetMeta(Btree *p, int idx, u32 *pMeta){
|
||||
assert( idx>=0 && idx<=15 );
|
||||
|
||||
if( idx==BTREE_DATA_VERSION ){
|
||||
*pMeta = sqlite3PagerDataVersion(pBt->pPager) + p->iDataVersion;
|
||||
*pMeta = sqlite3PagerDataVersion(pBt->pPager) + p->iBDataVersion;
|
||||
}else{
|
||||
*pMeta = get4byte(&pBt->pPage1->aData[36 + idx*4]);
|
||||
}
|
||||
|
||||
+1
-1
@@ -262,7 +262,7 @@ int sqlite3BtreeDelete(BtCursor*, u8 flags);
|
||||
#define BTREE_SAVEPOSITION 0x02 /* Leave cursor pointing at NEXT or PREV */
|
||||
#define BTREE_AUXDELETE 0x04 /* not the primary delete operation */
|
||||
#define BTREE_APPEND 0x08 /* Insert is likely an append */
|
||||
#define BTREE_PREFORMAT 0x80 /* Insert is likely an append */
|
||||
#define BTREE_PREFORMAT 0x80 /* Inserted data is a preformated cell */
|
||||
|
||||
/* An instance of the BtreePayload object describes the content of a single
|
||||
** entry in either an index or table btree.
|
||||
|
||||
+1
-1
@@ -350,7 +350,7 @@ struct Btree {
|
||||
u8 hasIncrblobCur; /* True if there are one or more Incrblob cursors */
|
||||
int wantToLock; /* Number of nested calls to sqlite3BtreeEnter() */
|
||||
int nBackup; /* Number of backup operations reading this btree */
|
||||
u32 iDataVersion; /* Combines with pBt->pPager->iDataVersion */
|
||||
u32 iBDataVersion; /* Combines with pBt->pPager->iDataVersion */
|
||||
Btree *pNext; /* List of other sharable Btrees from the same db */
|
||||
Btree *pPrev; /* Back pointer of the same list */
|
||||
#ifdef SQLITE_DEBUG
|
||||
|
||||
+17
-2
@@ -1325,6 +1325,7 @@ void sqlite3AddReturning(Parse *pParse, ExprList *pList){
|
||||
pRet->pReturnEL = pList;
|
||||
sqlite3ParserAddCleanup(pParse,
|
||||
(void(*)(sqlite3*,void*))sqlite3DeleteReturning, pRet);
|
||||
testcase( pParse->earlyCleanup );
|
||||
if( db->mallocFailed ) return;
|
||||
pRet->retTrig.zName = RETURNING_TRIGGER_NAME;
|
||||
pRet->retTrig.op = TK_RETURNING;
|
||||
@@ -4148,7 +4149,11 @@ void sqlite3CreateIndex(
|
||||
/* Clean up before exiting */
|
||||
exit_create_index:
|
||||
if( pIndex ) sqlite3FreeIndex(db, pIndex);
|
||||
if( pTab ){ /* Ensure all REPLACE indexes are at the end of the list */
|
||||
if( pTab ){
|
||||
/* Ensure all REPLACE indexes on pTab are at the end of the pIndex list.
|
||||
** The list was already ordered when this routine was entered, so at this
|
||||
** point at most a single index (the newly added index) will be out of
|
||||
** order. So we have to reorder at most one index. */
|
||||
Index **ppFrom = &pTab->pIndex;
|
||||
Index *pThis;
|
||||
for(ppFrom=&pTab->pIndex; (pThis = *ppFrom)!=0; ppFrom=&pThis->pNext){
|
||||
@@ -4162,6 +4167,16 @@ exit_create_index:
|
||||
}
|
||||
break;
|
||||
}
|
||||
#ifdef SQLITE_DEBUG
|
||||
/* Verify that all REPLACE indexes really are now at the end
|
||||
** of the index list. In other words, no other index type ever
|
||||
** comes after a REPLACE index on the list. */
|
||||
for(pThis = pTab->pIndex; pThis; pThis=pThis->pNext){
|
||||
assert( pThis->onError!=OE_Replace
|
||||
|| pThis->pNext==0
|
||||
|| pThis->pNext->onError==OE_Replace );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
sqlite3ExprDelete(db, pPIWhere);
|
||||
sqlite3ExprListDelete(db, pList);
|
||||
@@ -4863,7 +4878,7 @@ int sqlite3OpenTempDatabase(Parse *pParse){
|
||||
static void sqlite3CodeVerifySchemaAtToplevel(Parse *pToplevel, int iDb){
|
||||
assert( iDb>=0 && iDb<pToplevel->db->nDb );
|
||||
assert( pToplevel->db->aDb[iDb].pBt!=0 || iDb==1 );
|
||||
assert( iDb<SQLITE_MAX_ATTACHED+2 );
|
||||
assert( iDb<SQLITE_MAX_DB );
|
||||
assert( sqlite3SchemaMutexHeld(pToplevel->db, iDb, 0) );
|
||||
if( DbMaskTest(pToplevel->cookieMask, iDb)==0 ){
|
||||
DbMaskSet(pToplevel->cookieMask, iDb);
|
||||
|
||||
@@ -881,6 +881,7 @@ static int isDate(
|
||||
int eType;
|
||||
memset(p, 0, sizeof(*p));
|
||||
if( argc==0 ){
|
||||
if( !sqlite3NotPureFunc(context) ) return 1;
|
||||
return setDateTimeToCurrent(context, p);
|
||||
}
|
||||
if( (eType = sqlite3_value_type(argv[0]))==SQLITE_FLOAT
|
||||
|
||||
+21
-7
@@ -958,8 +958,8 @@ Expr *sqlite3ExprAnd(Parse *pParse, Expr *pLeft, Expr *pRight){
|
||||
}else if( (ExprAlwaysFalse(pLeft) || ExprAlwaysFalse(pRight))
|
||||
&& !IN_RENAME_OBJECT
|
||||
){
|
||||
sqlite3ExprDelete(db, pLeft);
|
||||
sqlite3ExprDelete(db, pRight);
|
||||
sqlite3ExprDeferredDelete(pParse, pLeft);
|
||||
sqlite3ExprDeferredDelete(pParse, pRight);
|
||||
return sqlite3Expr(db, TK_INTEGER, "0");
|
||||
}else{
|
||||
return sqlite3PExpr(pParse, TK_AND, pLeft, pRight);
|
||||
@@ -1156,6 +1156,22 @@ void sqlite3ExprDelete(sqlite3 *db, Expr *p){
|
||||
if( p ) sqlite3ExprDeleteNN(db, p);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
** Arrange to cause pExpr to be deleted when the pParse is deleted.
|
||||
** This is similar to sqlite3ExprDelete() except that the delete is
|
||||
** deferred untilthe pParse is deleted.
|
||||
**
|
||||
** The pExpr might be deleted immediately on an OOM error.
|
||||
**
|
||||
** The deferred delete is (currently) implemented by adding the
|
||||
** pExpr to the pParse->pConstExpr list with a register number of 0.
|
||||
*/
|
||||
void sqlite3ExprDeferredDelete(Parse *pParse, Expr *pExpr){
|
||||
pParse->pConstExpr =
|
||||
sqlite3ExprListAppend(pParse, pParse->pConstExpr, pExpr);
|
||||
}
|
||||
|
||||
/* Invoke sqlite3RenameExprUnmap() and sqlite3ExprDelete() on the
|
||||
** expression.
|
||||
*/
|
||||
@@ -2585,7 +2601,7 @@ int sqlite3FindInIndex(
|
||||
|
||||
/* Code an OP_Transaction and OP_TableLock for <table>. */
|
||||
iDb = sqlite3SchemaToIndex(db, pTab->pSchema);
|
||||
assert( iDb>=0 && iDb<SQLITE_MAX_ATTACHED );
|
||||
assert( iDb>=0 && iDb<SQLITE_MAX_DB );
|
||||
sqlite3CodeVerifySchema(pParse, iDb);
|
||||
sqlite3TableLock(pParse, iDb, pTab->tnum, 0, pTab->zName);
|
||||
|
||||
@@ -5781,8 +5797,7 @@ static int agginfoPersistExprCb(Walker *pWalker, Expr *pExpr){
|
||||
pExpr = sqlite3ExprDup(db, pExpr, 0);
|
||||
if( pExpr ){
|
||||
pAggInfo->aCol[iAgg].pCExpr = pExpr;
|
||||
pParse->pConstExpr =
|
||||
sqlite3ExprListAppend(pParse, pParse->pConstExpr, pExpr);
|
||||
sqlite3ExprDeferredDelete(pParse, pExpr);
|
||||
}
|
||||
}
|
||||
}else{
|
||||
@@ -5791,8 +5806,7 @@ static int agginfoPersistExprCb(Walker *pWalker, Expr *pExpr){
|
||||
pExpr = sqlite3ExprDup(db, pExpr, 0);
|
||||
if( pExpr ){
|
||||
pAggInfo->aFunc[iAgg].pFExpr = pExpr;
|
||||
pParse->pConstExpr =
|
||||
sqlite3ExprListAppend(pParse, pParse->pConstExpr, pExpr);
|
||||
sqlite3ExprDeferredDelete(pParse, pExpr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+4
-2
@@ -1004,7 +1004,9 @@ void sqlite3Insert(
|
||||
pNx->iDataCur = iDataCur;
|
||||
pNx->iIdxCur = iIdxCur;
|
||||
if( pNx->pUpsertTarget ){
|
||||
sqlite3UpsertAnalyzeTarget(pParse, pTabList, pNx);
|
||||
if( sqlite3UpsertAnalyzeTarget(pParse, pTabList, pNx) ){
|
||||
goto insert_cleanup;
|
||||
}
|
||||
}
|
||||
pNx = pNx->pNextUpsert;
|
||||
}while( pNx!=0 );
|
||||
@@ -2426,7 +2428,7 @@ static void codeWithoutRowidPreupdate(
|
||||
Vdbe *v = pParse->pVdbe;
|
||||
int r = sqlite3GetTempReg(pParse);
|
||||
assert( !HasRowid(pTab) );
|
||||
assert( 0==(pParse->db->mDbFlags & DBFLAG_Vacuum) );
|
||||
assert( 0==(pParse->db->mDbFlags & DBFLAG_Vacuum) || CORRUPT_DB );
|
||||
sqlite3VdbeAddOp2(v, OP_Integer, 0, r);
|
||||
sqlite3VdbeAddOp4(v, OP_Insert, iCur, regData, r, (char*)pTab, P4_TABLE);
|
||||
sqlite3VdbeChangeP5(v, OPFLAG_ISNOOP);
|
||||
|
||||
+7
-3
@@ -2374,7 +2374,7 @@ int sqlite3_wal_checkpoint_v2(
|
||||
return SQLITE_OK;
|
||||
#else
|
||||
int rc; /* Return code */
|
||||
int iDb = SQLITE_MAX_ATTACHED; /* sqlite3.aDb[] index of db to checkpoint */
|
||||
int iDb; /* Schema to checkpoint */
|
||||
|
||||
#ifdef SQLITE_ENABLE_API_ARMOR
|
||||
if( !sqlite3SafetyCheckOk(db) ) return SQLITE_MISUSE_BKPT;
|
||||
@@ -2397,6 +2397,8 @@ int sqlite3_wal_checkpoint_v2(
|
||||
sqlite3_mutex_enter(db->mutex);
|
||||
if( zDb && zDb[0] ){
|
||||
iDb = sqlite3FindDbName(db, zDb);
|
||||
}else{
|
||||
iDb = SQLITE_MAX_DB; /* This means process all schemas */
|
||||
}
|
||||
if( iDb<0 ){
|
||||
rc = SQLITE_ERROR;
|
||||
@@ -2445,7 +2447,7 @@ int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb){
|
||||
** associated with the specific b-tree being checkpointed is taken by
|
||||
** this function while the checkpoint is running.
|
||||
**
|
||||
** If iDb is passed SQLITE_MAX_ATTACHED, then all attached databases are
|
||||
** If iDb is passed SQLITE_MAX_DB then all attached databases are
|
||||
** checkpointed. If an error is encountered it is returned immediately -
|
||||
** no attempt is made to checkpoint any remaining databases.
|
||||
**
|
||||
@@ -2460,9 +2462,11 @@ int sqlite3Checkpoint(sqlite3 *db, int iDb, int eMode, int *pnLog, int *pnCkpt){
|
||||
assert( sqlite3_mutex_held(db->mutex) );
|
||||
assert( !pnLog || *pnLog==-1 );
|
||||
assert( !pnCkpt || *pnCkpt==-1 );
|
||||
testcase( iDb==SQLITE_MAX_ATTACHED ); /* See forum post a006d86f72 */
|
||||
testcase( iDb==SQLITE_MAX_DB );
|
||||
|
||||
for(i=0; i<db->nDb && rc==SQLITE_OK; i++){
|
||||
if( i==iDb || iDb==SQLITE_MAX_ATTACHED ){
|
||||
if( i==iDb || iDb==SQLITE_MAX_DB ){
|
||||
rc = sqlite3BtreeCheckpoint(db->aDb[i].pBt, eMode, pnLog, pnCkpt);
|
||||
pnLog = 0;
|
||||
pnCkpt = 0;
|
||||
|
||||
+1
-1
@@ -267,7 +267,7 @@ static int memjrnlTruncate(sqlite3_file *pJfd, sqlite_int64 size){
|
||||
for(pIter=p->pFirst; ALWAYS(pIter) && iOff<=size; pIter=pIter->pNext){
|
||||
iOff += p->nChunkSize;
|
||||
}
|
||||
if( pIter ){
|
||||
if( ALWAYS(pIter) ){
|
||||
memjrnlFreeChunks(pIter->pNext);
|
||||
pIter->pNext = 0;
|
||||
}
|
||||
|
||||
+2
-1
@@ -6361,7 +6361,8 @@ static int unixBackupDir(const char *z, int *pJ){
|
||||
int j = *pJ;
|
||||
int i;
|
||||
if( j<=0 ) return 0;
|
||||
for(i=j-1; ALWAYS(i>0) && z[i-1]!='/'; i--){}
|
||||
for(i=j-1; i>0 && z[i-1]!='/'; i--){}
|
||||
if( i==0 ) return 0;
|
||||
if( z[i]=='.' && i==j-2 && z[i+1]=='.' ) return 0;
|
||||
*pJ = i-1;
|
||||
return 1;
|
||||
|
||||
+13
-3
@@ -497,11 +497,21 @@ cmd ::= select(X). {
|
||||
static void parserDoubleLinkSelect(Parse *pParse, Select *p){
|
||||
assert( p!=0 );
|
||||
if( p->pPrior ){
|
||||
Select *pNext = 0, *pLoop;
|
||||
int mxSelect, cnt = 0;
|
||||
for(pLoop=p; pLoop; pNext=pLoop, pLoop=pLoop->pPrior, cnt++){
|
||||
Select *pNext = 0, *pLoop = p;
|
||||
int mxSelect, cnt = 1;
|
||||
while(1){
|
||||
pLoop->pNext = pNext;
|
||||
pLoop->selFlags |= SF_Compound;
|
||||
pNext = pLoop;
|
||||
pLoop = pLoop->pPrior;
|
||||
if( pLoop==0 ) break;
|
||||
cnt++;
|
||||
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;
|
||||
}
|
||||
}
|
||||
if( (p->selFlags & SF_MultiValue)==0 &&
|
||||
(mxSelect = pParse->db->aLimit[SQLITE_LIMIT_COMPOUND_SELECT])>0 &&
|
||||
|
||||
+1
-1
@@ -1969,7 +1969,7 @@ void sqlite3Pragma(
|
||||
** Checkpoint the database.
|
||||
*/
|
||||
case PragTyp_WAL_CHECKPOINT: {
|
||||
int iBt = (pId2->z?iDb:SQLITE_MAX_ATTACHED);
|
||||
int iBt = (pId2->z?iDb:SQLITE_MAX_DB);
|
||||
int eMode = SQLITE_CHECKPOINT_PASSIVE;
|
||||
if( zRight ){
|
||||
if( sqlite3StrICmp(zRight, "full")==0 ){
|
||||
|
||||
+9
-1
@@ -589,13 +589,21 @@ void sqlite3ParserReset(Parse *pParse){
|
||||
** sqlite3ParserReset(), which reduces the total CPU cycle count.
|
||||
**
|
||||
** If a memory allocation error occurs, then the cleanup happens immediately.
|
||||
** When eithr SQLITE_DEBUG or SQLITE_COVERAGE_TEST are defined, the
|
||||
** When either SQLITE_DEBUG or SQLITE_COVERAGE_TEST are defined, the
|
||||
** pParse->earlyCleanup flag is set in that case. Calling code show verify
|
||||
** that test cases exist for which this happens, to guard against possible
|
||||
** use-after-free errors following an OOM. The preferred way to do this is
|
||||
** to immediately follow the call to this routine with:
|
||||
**
|
||||
** testcase( pParse->earlyCleanup );
|
||||
**
|
||||
** This routine returns a copy of its pPtr input (the third parameter)
|
||||
** except if an early cleanup occurs, in which case it returns NULL. So
|
||||
** another way to check for early cleanup is to check the return value.
|
||||
** Or, stop using the pPtr parameter with this call and use only its
|
||||
** return value thereafter. Something like this:
|
||||
**
|
||||
** pObj = sqlite3ParserAddCleanup(pParse, destructor, pObj);
|
||||
*/
|
||||
void *sqlite3ParserAddCleanup(
|
||||
Parse *pParse, /* Destroy when this Parser finishes */
|
||||
|
||||
+1
-1
@@ -921,7 +921,7 @@ static int sqlite3StrAccumEnlarge(StrAccum *p, int N){
|
||||
}else{
|
||||
char *zOld = isMalloced(p) ? p->zText : 0;
|
||||
i64 szNew = p->nChar;
|
||||
szNew += N + 1;
|
||||
szNew += (sqlite3_int64)N + 1;
|
||||
if( szNew+p->nChar<=p->mxAlloc ){
|
||||
/* Force exponential buffer size growth as long as it does not overflow,
|
||||
** to avoid having to call this routine too often */
|
||||
|
||||
+34
-17
@@ -376,15 +376,19 @@ static int lookupName(
|
||||
if( pParse->pTriggerTab!=0 ){
|
||||
int op = pParse->eTriggerOp;
|
||||
assert( op==TK_DELETE || op==TK_UPDATE || op==TK_INSERT );
|
||||
if( op!=TK_DELETE && zTab && sqlite3StrICmp("new",zTab) == 0 ){
|
||||
if( pParse->bReturning ){
|
||||
if( (pNC->ncFlags & NC_UBaseReg)!=0
|
||||
&& (zTab==0 || sqlite3StrICmp(zTab,pParse->pTriggerTab->zName)==0)
|
||||
){
|
||||
pExpr->iTable = op!=TK_DELETE;
|
||||
pTab = pParse->pTriggerTab;
|
||||
}
|
||||
}else if( op!=TK_DELETE && zTab && sqlite3StrICmp("new",zTab) == 0 ){
|
||||
pExpr->iTable = 1;
|
||||
pTab = pParse->pTriggerTab;
|
||||
}else if( op!=TK_INSERT && zTab && sqlite3StrICmp("old",zTab)==0 ){
|
||||
pExpr->iTable = 0;
|
||||
pTab = pParse->pTriggerTab;
|
||||
}else if( pParse->bReturning && (pNC->ncFlags & NC_UBaseReg)!=0 ){
|
||||
pExpr->iTable = op!=TK_DELETE;
|
||||
pTab = pParse->pTriggerTab;
|
||||
}
|
||||
}
|
||||
#endif /* SQLITE_OMIT_TRIGGER */
|
||||
@@ -417,6 +421,7 @@ static int lookupName(
|
||||
}
|
||||
if( iCol<pTab->nCol ){
|
||||
cnt++;
|
||||
pMatch = 0;
|
||||
#ifndef SQLITE_OMIT_UPSERT
|
||||
if( pExpr->iTable==EXCLUDED_TABLE_NUMBER ){
|
||||
testcase( iCol==(-1) );
|
||||
@@ -435,8 +440,8 @@ static int lookupName(
|
||||
pExpr->y.pTab = pTab;
|
||||
if( pParse->bReturning ){
|
||||
eNewExprOp = TK_REGISTER;
|
||||
pExpr->iTable = pNC->uNC.iBaseReg + (pTab->nCol+1)*pExpr->iTable
|
||||
+ iCol + 1;
|
||||
pExpr->iTable = pNC->uNC.iBaseReg + (pTab->nCol+1)*pExpr->iTable +
|
||||
sqlite3TableColumnToStorage(pTab, iCol) + 1;
|
||||
}else{
|
||||
pExpr->iColumn = (i16)iCol;
|
||||
eNewExprOp = TK_TRIGGER;
|
||||
@@ -558,6 +563,7 @@ static int lookupName(
|
||||
assert( pExpr->op==TK_ID );
|
||||
if( ExprHasProperty(pExpr,EP_DblQuoted)
|
||||
&& areDoubleQuotedStringsEnabled(db, pTopNC)
|
||||
&& (db->init.bDropColumn==0 || sqlite3StrICmp(zCol, db->init.azInit[0])!=0)
|
||||
){
|
||||
/* If a double-quoted identifier does not match any known column name,
|
||||
** then treat it as a string.
|
||||
@@ -572,6 +578,11 @@ static int lookupName(
|
||||
** Someday, I hope to get rid of this hack. Unfortunately there is
|
||||
** a huge amount of legacy SQL that uses it. So for now, we just
|
||||
** issue a warning.
|
||||
**
|
||||
** 2021-03-15: ticket 1c24a659e6d7f3a1
|
||||
** Do not do the ID-to-STRING conversion when doing the schema
|
||||
** sanity check following a DROP COLUMN if the identifer name matches
|
||||
** the name of the column being dropped.
|
||||
*/
|
||||
sqlite3_log(SQLITE_WARNING,
|
||||
"double-quoted string literal: \"%w\"", zCol);
|
||||
@@ -636,11 +647,13 @@ static int lookupName(
|
||||
lookupname_end:
|
||||
if( cnt==1 ){
|
||||
assert( pNC!=0 );
|
||||
#ifndef SQLITE_OMIT_AUTHORIZATION
|
||||
if( pParse->db->xAuth
|
||||
&& (pExpr->op==TK_COLUMN || pExpr->op==TK_TRIGGER)
|
||||
){
|
||||
sqlite3AuthRead(pParse, pExpr, pSchema, pNC->pSrcList);
|
||||
}
|
||||
#endif
|
||||
/* Increment the nRef value on all name contexts from TopNC up to
|
||||
** the point where the name matched. */
|
||||
for(;;){
|
||||
@@ -785,16 +798,19 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
|
||||
break;
|
||||
}
|
||||
|
||||
/* An "<expr> IS NOT NULL" or "<expr> IS NULL". After resolving the
|
||||
** LHS, check if there is a NOT NULL constraint in the schema that
|
||||
** means the value of the expression can be determined immediately.
|
||||
** If that is the case, replace the current expression node with
|
||||
** a TK_TRUEFALSE node.
|
||||
/* An optimization: Attempt to convert
|
||||
**
|
||||
** If the node is replaced with a TK_TRUEFALSE node, then also restore
|
||||
** the NameContext ref-counts to the state they where in before the
|
||||
** LHS expression was resolved. This prevents the current select
|
||||
** from being erroneously marked as correlated in some cases.
|
||||
** "expr IS NOT NULL" --> "TRUE"
|
||||
** "expr IS NULL" --> "FALSE"
|
||||
**
|
||||
** if we can prove that "expr" is never NULL. Call this the
|
||||
** "NOT NULL strength reduction optimization".
|
||||
**
|
||||
** If this optimization occurs, also restore the NameContext ref-counts
|
||||
** to the state they where in before the "column" LHS expression was
|
||||
** resolved. This prevents "column" from being counted as having been
|
||||
** referenced, which might prevent a SELECT from being erroneously
|
||||
** marked as correlated.
|
||||
*/
|
||||
case TK_NOTNULL:
|
||||
case TK_ISNULL: {
|
||||
@@ -805,7 +821,7 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
|
||||
anRef[i] = p->nRef;
|
||||
}
|
||||
sqlite3WalkExpr(pWalker, pExpr->pLeft);
|
||||
if( 0==sqlite3ExprCanBeNull(pExpr->pLeft) ){
|
||||
if( 0==sqlite3ExprCanBeNull(pExpr->pLeft) && !IN_RENAME_OBJECT ){
|
||||
if( pExpr->op==TK_NOTNULL ){
|
||||
pExpr->u.zToken = "true";
|
||||
ExprSetProperty(pExpr, EP_IsTrue);
|
||||
@@ -1050,6 +1066,7 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
|
||||
assert( pWin==pExpr->y.pWin );
|
||||
if( IN_RENAME_OBJECT==0 ){
|
||||
sqlite3WindowUpdate(pParse, pSel ? pSel->pWinDefn : 0, pWin, pDef);
|
||||
if( pParse->db->mallocFailed ) break;
|
||||
}
|
||||
sqlite3WalkExprList(pWalker, pWin->pPartition);
|
||||
sqlite3WalkExprList(pWalker, pWin->pOrderBy);
|
||||
@@ -1124,7 +1141,7 @@ static int resolveExprStep(Walker *pWalker, Expr *pExpr){
|
||||
assert( !ExprHasProperty(pExpr, EP_Reduced) );
|
||||
/* Handle special cases of "x IS TRUE", "x IS FALSE", "x IS NOT TRUE",
|
||||
** and "x IS NOT FALSE". */
|
||||
if( pRight && (pRight->op==TK_ID || pRight->op==TK_TRUEFALSE) ){
|
||||
if( ALWAYS(pRight) && (pRight->op==TK_ID || pRight->op==TK_TRUEFALSE) ){
|
||||
int rc = resolveExprStep(pWalker, pRight);
|
||||
if( rc==WRC_Abort ) return WRC_Abort;
|
||||
if( pRight->op==TK_TRUEFALSE ){
|
||||
|
||||
+53
-27
@@ -85,12 +85,16 @@ static void clearSelect(sqlite3 *db, Select *p, int bFree){
|
||||
sqlite3ExprDelete(db, p->pHaving);
|
||||
sqlite3ExprListDelete(db, p->pOrderBy);
|
||||
sqlite3ExprDelete(db, p->pLimit);
|
||||
if( OK_IF_ALWAYS_TRUE(p->pWith) ) sqlite3WithDelete(db, p->pWith);
|
||||
#ifndef SQLITE_OMIT_WINDOWFUNC
|
||||
if( OK_IF_ALWAYS_TRUE(p->pWinDefn) ){
|
||||
sqlite3WindowListDelete(db, p->pWinDefn);
|
||||
}
|
||||
while( p->pWin ){
|
||||
assert( p->pWin->ppThis==&p->pWin );
|
||||
sqlite3WindowUnlinkFromSelect(p->pWin);
|
||||
}
|
||||
#endif
|
||||
if( OK_IF_ALWAYS_TRUE(p->pWith) ) sqlite3WithDelete(db, p->pWith);
|
||||
if( bFree ) sqlite3DbFreeNN(db, p);
|
||||
p = pPrior;
|
||||
bFree = 1;
|
||||
@@ -1386,7 +1390,7 @@ KeyInfo *sqlite3KeyInfoFromExprList(
|
||||
/*
|
||||
** Name of the connection operator, used for error messages.
|
||||
*/
|
||||
static const char *selectOpName(int id){
|
||||
const char *sqlite3SelectOpName(int id){
|
||||
char *z;
|
||||
switch( id ){
|
||||
case TK_ALL: z = "UNION ALL"; break;
|
||||
@@ -1982,7 +1986,7 @@ int sqlite3ColumnsFromExprList(
|
||||
nCol = pEList->nExpr;
|
||||
aCol = sqlite3DbMallocZero(db, sizeof(aCol[0])*nCol);
|
||||
testcase( aCol==0 );
|
||||
if( nCol>32767 ) nCol = 32767;
|
||||
if( NEVER(nCol>32767) ) nCol = 32767;
|
||||
}else{
|
||||
nCol = 0;
|
||||
aCol = 0;
|
||||
@@ -2605,12 +2609,8 @@ static int multiSelect(
|
||||
db = pParse->db;
|
||||
pPrior = p->pPrior;
|
||||
dest = *pDest;
|
||||
if( pPrior->pOrderBy || pPrior->pLimit ){
|
||||
sqlite3ErrorMsg(pParse,"%s clause should come after %s not before",
|
||||
pPrior->pOrderBy!=0 ? "ORDER BY" : "LIMIT", selectOpName(p->op));
|
||||
rc = 1;
|
||||
goto multi_select_end;
|
||||
}
|
||||
assert( pPrior->pOrderBy==0 );
|
||||
assert( pPrior->pLimit==0 );
|
||||
|
||||
v = sqlite3GetVdbe(pParse);
|
||||
assert( v!=0 ); /* The VDBE already created by calling function */
|
||||
@@ -2667,7 +2667,7 @@ static int multiSelect(
|
||||
pPrior->iOffset = p->iOffset;
|
||||
pPrior->pLimit = p->pLimit;
|
||||
rc = sqlite3Select(pParse, pPrior, &dest);
|
||||
p->pLimit = 0;
|
||||
pPrior->pLimit = 0;
|
||||
if( rc ){
|
||||
goto multi_select_end;
|
||||
}
|
||||
@@ -2688,8 +2688,8 @@ static int multiSelect(
|
||||
pDelete = p->pPrior;
|
||||
p->pPrior = pPrior;
|
||||
p->nSelectRow = sqlite3LogEstAdd(p->nSelectRow, pPrior->nSelectRow);
|
||||
if( pPrior->pLimit
|
||||
&& sqlite3ExprIsInteger(pPrior->pLimit->pLeft, &nLimit)
|
||||
if( p->pLimit
|
||||
&& sqlite3ExprIsInteger(p->pLimit->pLeft, &nLimit)
|
||||
&& nLimit>0 && p->nSelectRow > sqlite3LogEst((u64)nLimit)
|
||||
){
|
||||
p->nSelectRow = sqlite3LogEst((u64)nLimit);
|
||||
@@ -2753,7 +2753,7 @@ static int multiSelect(
|
||||
p->pLimit = 0;
|
||||
uniondest.eDest = op;
|
||||
ExplainQueryPlan((pParse, 1, "%s USING TEMP B-TREE",
|
||||
selectOpName(p->op)));
|
||||
sqlite3SelectOpName(p->op)));
|
||||
rc = sqlite3Select(pParse, p, &uniondest);
|
||||
testcase( rc!=SQLITE_OK );
|
||||
assert( p->pOrderBy==0 );
|
||||
@@ -2829,7 +2829,7 @@ static int multiSelect(
|
||||
p->pLimit = 0;
|
||||
intersectdest.iSDParm = tab2;
|
||||
ExplainQueryPlan((pParse, 1, "%s USING TEMP B-TREE",
|
||||
selectOpName(p->op)));
|
||||
sqlite3SelectOpName(p->op)));
|
||||
rc = sqlite3Select(pParse, p, &intersectdest);
|
||||
testcase( rc!=SQLITE_OK );
|
||||
pDelete = p->pPrior;
|
||||
@@ -2938,7 +2938,8 @@ void sqlite3SelectWrongNumTermsError(Parse *pParse, Select *p){
|
||||
sqlite3ErrorMsg(pParse, "all VALUES must have the same number of terms");
|
||||
}else{
|
||||
sqlite3ErrorMsg(pParse, "SELECTs to the left and right of %s"
|
||||
" do not have the same number of result columns", selectOpName(p->op));
|
||||
" do not have the same number of result columns",
|
||||
sqlite3SelectOpName(p->op));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3035,10 +3036,8 @@ static int generateOutputSubroutine(
|
||||
** if it is the RHS of a row-value IN operator.
|
||||
*/
|
||||
case SRT_Mem: {
|
||||
if( pParse->nErr==0 ){
|
||||
testcase( pIn->nSdst>1 );
|
||||
sqlite3ExprCodeMove(pParse, pIn->iSdst, pDest->iSDParm, pIn->nSdst);
|
||||
}
|
||||
testcase( pIn->nSdst>1 );
|
||||
sqlite3ExprCodeMove(pParse, pIn->iSdst, pDest->iSDParm, pIn->nSdst);
|
||||
/* The LIMIT clause will jump out of the loop for us */
|
||||
break;
|
||||
}
|
||||
@@ -3330,7 +3329,7 @@ static int multiSelectOrderBy(
|
||||
sqlite3SelectDestInit(&destA, SRT_Coroutine, regAddrA);
|
||||
sqlite3SelectDestInit(&destB, SRT_Coroutine, regAddrB);
|
||||
|
||||
ExplainQueryPlan((pParse, 1, "MERGE (%s)", selectOpName(p->op)));
|
||||
ExplainQueryPlan((pParse, 1, "MERGE (%s)", sqlite3SelectOpName(p->op)));
|
||||
|
||||
/* Generate a coroutine to evaluate the SELECT statement to the
|
||||
** left of the compound operator - the "A" select.
|
||||
@@ -4040,6 +4039,7 @@ static int flattenSubquery(
|
||||
if( (p->selFlags & SF_Recursive) ) return 0;
|
||||
|
||||
if( pSrc->nSrc>1 ){
|
||||
if( pParse->nSelect>500 ) return 0;
|
||||
aCsrMap = sqlite3DbMallocZero(db, pParse->nTab*sizeof(int));
|
||||
}
|
||||
}
|
||||
@@ -4116,6 +4116,7 @@ static int flattenSubquery(
|
||||
if( pNew==0 ){
|
||||
p->pPrior = pPrior;
|
||||
}else{
|
||||
pNew->selId = ++pParse->nSelect;
|
||||
if( aCsrMap && db->mallocFailed==0 ){
|
||||
renumberCursors(pParse, pNew, iFrom, aCsrMap);
|
||||
}
|
||||
@@ -5059,16 +5060,24 @@ static int resolveFromTermToCte(
|
||||
pSavedWith = pParse->pWith;
|
||||
pParse->pWith = pWith;
|
||||
if( pSel->selFlags & SF_Recursive ){
|
||||
int rc;
|
||||
assert( pRecTerm!=0 );
|
||||
assert( (pRecTerm->selFlags & SF_Recursive)==0 );
|
||||
assert( pRecTerm->pNext!=0 );
|
||||
assert( (pRecTerm->pNext->selFlags & SF_Recursive)!=0 );
|
||||
assert( pRecTerm->pWith==0 );
|
||||
pRecTerm->pWith = pSel->pWith;
|
||||
sqlite3WalkSelect(pWalker, pRecTerm);
|
||||
rc = sqlite3WalkSelect(pWalker, pRecTerm);
|
||||
pRecTerm->pWith = 0;
|
||||
if( rc ){
|
||||
pParse->pWith = pSavedWith;
|
||||
return 2;
|
||||
}
|
||||
}else{
|
||||
sqlite3WalkSelect(pWalker, pSel);
|
||||
if( sqlite3WalkSelect(pWalker, pSel) ){
|
||||
pParse->pWith = pSavedWith;
|
||||
return 2;
|
||||
}
|
||||
}
|
||||
pParse->pWith = pWith;
|
||||
|
||||
@@ -5255,7 +5264,10 @@ static int selectExpander(Walker *pWalker, Select *p){
|
||||
u8 eCodeOrig = pWalker->eCode;
|
||||
if( sqlite3ViewGetColumnNames(pParse, pTab) ) return WRC_Abort;
|
||||
assert( pFrom->pSelect==0 );
|
||||
if( pTab->pSelect && (db->flags & SQLITE_EnableView)==0 ){
|
||||
if( pTab->pSelect
|
||||
&& (db->flags & SQLITE_EnableView)==0
|
||||
&& pTab->pSchema!=db->aDb[1].pSchema
|
||||
){
|
||||
sqlite3ErrorMsg(pParse, "access to view \"%s\" prohibited",
|
||||
pTab->zName);
|
||||
}
|
||||
@@ -6034,8 +6046,19 @@ int sqlite3Select(
|
||||
pDest->eDest==SRT_Except || pDest->eDest==SRT_Discard ||
|
||||
pDest->eDest==SRT_DistQueue || pDest->eDest==SRT_DistFifo );
|
||||
/* All of these destinations are also able to ignore the ORDER BY clause */
|
||||
sqlite3ExprListDelete(db, p->pOrderBy);
|
||||
p->pOrderBy = 0;
|
||||
if( p->pOrderBy ){
|
||||
#if SELECTTRACE_ENABLED
|
||||
SELECTTRACE(1,pParse,p, ("dropping superfluous ORDER BY:\n"));
|
||||
if( sqlite3SelectTrace & 0x100 ){
|
||||
sqlite3TreeViewExprList(0, p->pOrderBy, 0, "ORDERBY");
|
||||
}
|
||||
#endif
|
||||
sqlite3ParserAddCleanup(pParse,
|
||||
(void(*)(sqlite3*,void*))sqlite3ExprListDelete,
|
||||
p->pOrderBy);
|
||||
testcase( pParse->earlyCleanup );
|
||||
p->pOrderBy = 0;
|
||||
}
|
||||
p->selFlags &= ~SF_Distinct;
|
||||
p->selFlags |= SF_NoopOrderBy;
|
||||
}
|
||||
@@ -6363,7 +6386,9 @@ int sqlite3Select(
|
||||
sqlite3VdbeAddOp2(v, OP_OpenDup, pItem->iCursor, pPrior->iCursor);
|
||||
pSub->nSelectRow = pPrior->pSelect->nSelectRow;
|
||||
}else{
|
||||
/* Generate a subroutine that will materialize the view. */
|
||||
/* Materalize the view. If the view is not correlated, generate a
|
||||
** subroutine to do the materialization so that subsequent uses of
|
||||
** the same view can reuse the materialization. */
|
||||
int topAddr;
|
||||
int onceAddr = 0;
|
||||
int retAddr;
|
||||
@@ -6390,7 +6415,7 @@ int sqlite3Select(
|
||||
VdbeComment((v, "end %s", pItem->pTab->zName));
|
||||
sqlite3VdbeChangeP1(v, topAddr, retAddr);
|
||||
sqlite3ClearTempRegCache(pParse);
|
||||
if( pItem->fg.isCte ){
|
||||
if( pItem->fg.isCte && pItem->fg.isCorrelated==0 ){
|
||||
CteUse *pCteUse = pItem->u2.pCteUse;
|
||||
pCteUse->addrM9e = pItem->addrFillSub;
|
||||
pCteUse->regRtn = pItem->regReturn;
|
||||
@@ -6654,6 +6679,7 @@ int sqlite3Select(
|
||||
if( pAggInfo ){
|
||||
sqlite3ParserAddCleanup(pParse,
|
||||
(void(*)(sqlite3*,void*))agginfoFree, pAggInfo);
|
||||
testcase( pParse->earlyCleanup );
|
||||
}
|
||||
if( db->mallocFailed ){
|
||||
goto select_end;
|
||||
|
||||
+12
-3
@@ -3063,6 +3063,7 @@ static void exec_prepared_stmt_columnar(
|
||||
if( rc!=SQLITE_ROW ) return;
|
||||
nColumn = sqlite3_column_count(pStmt);
|
||||
nAlloc = nColumn*4;
|
||||
if( nAlloc<=0 ) nAlloc = 1;
|
||||
azData = sqlite3_malloc64( nAlloc*sizeof(char*) );
|
||||
if( azData==0 ) shell_out_of_memory();
|
||||
for(i=0; i<nColumn; i++){
|
||||
@@ -3102,6 +3103,7 @@ static void exec_prepared_stmt_columnar(
|
||||
if( n>p->actualWidth[j] ) p->actualWidth[j] = n;
|
||||
}
|
||||
if( seenInterrupt ) goto columnar_end;
|
||||
if( nColumn==0 ) goto columnar_end;
|
||||
switch( p->cMode ){
|
||||
case MODE_Column: {
|
||||
colSep = " ";
|
||||
@@ -3891,13 +3893,13 @@ static const char *(azHelp[]) = {
|
||||
".databases List names and files of attached databases",
|
||||
".dbconfig ?op? ?val? List or change sqlite3_db_config() options",
|
||||
".dbinfo ?DB? Show status information about the database",
|
||||
".dump ?TABLE? Render database content as SQL",
|
||||
".dump ?OBJECTS? Render database content as SQL",
|
||||
" Options:",
|
||||
" --data-only Output only INSERT statements",
|
||||
" --newlines Allow unescaped newline characters in output",
|
||||
" --nosys Omit system tables (ex: \"sqlite_stat1\")",
|
||||
" --preserve-rowids Include ROWID values in the output",
|
||||
" TABLE is a LIKE pattern for the tables to dump",
|
||||
" OBJECTS is a LIKE pattern for tables, indexes, triggers or views to dump",
|
||||
" Additional LIKE patterns can be given in subsequent arguments",
|
||||
".echo on|off Turn command echo on or off",
|
||||
".eqp on|off|full|... Enable or disable automatic EXPLAIN QUERY PLAN",
|
||||
@@ -9038,6 +9040,11 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
goto meta_command_exit;
|
||||
}
|
||||
if( azArg[1][0]=='|' ){
|
||||
#ifdef SQLITE_OMIT_POPEN
|
||||
raw_printf(stderr, "Error: pipes are not supported in this OS\n");
|
||||
rc = 1;
|
||||
p->out = stdout;
|
||||
#else
|
||||
p->in = popen(azArg[1]+1, "r");
|
||||
if( p->in==0 ){
|
||||
utf8_printf(stderr, "Error: cannot open \"%s\"\n", azArg[1]);
|
||||
@@ -9046,6 +9053,7 @@ static int do_meta_command(char *zLine, ShellState *p){
|
||||
rc = process_input(p);
|
||||
pclose(p->in);
|
||||
}
|
||||
#endif
|
||||
}else if( notNormalFile(azArg[1]) || (p->in = fopen(azArg[1], "rb"))==0 ){
|
||||
utf8_printf(stderr,"Error: cannot open \"%s\"\n", azArg[1]);
|
||||
rc = 1;
|
||||
@@ -10823,7 +10831,8 @@ static char *cmdline_option_value(int argc, char **argv, int i){
|
||||
}
|
||||
|
||||
#ifndef SQLITE_SHELL_IS_UTF8
|
||||
# if (defined(_WIN32) || defined(WIN32)) && defined(_MSC_VER)
|
||||
# if (defined(_WIN32) || defined(WIN32)) \
|
||||
&& (defined(_MSC_VER) || (defined(UNICODE) && defined(__GNUC__)))
|
||||
# define SQLITE_SHELL_IS_UTF8 (0)
|
||||
# else
|
||||
# define SQLITE_SHELL_IS_UTF8 (1)
|
||||
|
||||
+7
-1
@@ -2132,7 +2132,13 @@ struct sqlite3_mem_methods {
|
||||
** The second parameter is a pointer to an integer into which
|
||||
** is written 0 or 1 to indicate whether views are disabled or enabled
|
||||
** following this call. The second parameter may be a NULL pointer, in
|
||||
** which case the view setting is not reported back. </dd>
|
||||
** which case the view setting is not reported back.
|
||||
**
|
||||
** <p>Originally this option disabled all views. ^(However, since
|
||||
** SQLite version 3.35.0, TEMP views are still allowed even if
|
||||
** this option is off. So, in other words, this option now only disables
|
||||
** views in the main database schema or in the schemas of ATTACH-ed
|
||||
** databases.)^ </dd>
|
||||
**
|
||||
** [[SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER]]
|
||||
** <dt>SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER</dt>
|
||||
|
||||
@@ -1481,6 +1481,11 @@ void sqlite3CryptFunc(sqlite3_context*,int,sqlite3_value**);
|
||||
#endif /* SQLITE_OMIT_DEPRECATED */
|
||||
#define SQLITE_TRACE_NONLEGACY_MASK 0x0f /* Normal flags */
|
||||
|
||||
/*
|
||||
** Maximum number of sqlite3.aDb[] entries. This is the number of attached
|
||||
** databases plus 2 for "main" and "temp".
|
||||
*/
|
||||
#define SQLITE_MAX_DB (SQLITE_MAX_ATTACHED+2)
|
||||
|
||||
/*
|
||||
** Each database connection is an instance of the following structure.
|
||||
@@ -1528,7 +1533,10 @@ struct sqlite3 {
|
||||
unsigned orphanTrigger : 1; /* Last statement is orphaned TEMP trigger */
|
||||
unsigned imposterTable : 1; /* Building an imposter table */
|
||||
unsigned reopenMemdb : 1; /* ATTACH is really a reopen using MemDB */
|
||||
unsigned bDropColumn : 1; /* Doing schema check after DROP COLUMN */
|
||||
char **azInit; /* "type", "name", and "tbl_name" columns */
|
||||
/* or if bDropColumn, then azInit[0] is the */
|
||||
/* name of the column being dropped */
|
||||
} init;
|
||||
int nVdbeActive; /* Number of VDBEs currently running */
|
||||
int nVdbeRead; /* Number of active VDBEs that read or write */
|
||||
@@ -4282,6 +4290,7 @@ Expr *sqlite3ExprFunction(Parse*,ExprList*, Token*, int);
|
||||
void sqlite3ExprFunctionUsable(Parse*,Expr*,FuncDef*);
|
||||
void sqlite3ExprAssignVarNumber(Parse*, Expr*, u32);
|
||||
void sqlite3ExprDelete(sqlite3*, Expr*);
|
||||
void sqlite3ExprDeferredDelete(Parse*, Expr*);
|
||||
void sqlite3ExprUnmapAndDelete(Parse*, Expr*);
|
||||
ExprList *sqlite3ExprListAppend(Parse*,ExprList*,Expr*);
|
||||
ExprList *sqlite3ExprListAppendVector(Parse*,ExprList*,IdList*,Expr*);
|
||||
@@ -4795,6 +4804,7 @@ void sqlite3KeyInfoUnref(KeyInfo*);
|
||||
KeyInfo *sqlite3KeyInfoRef(KeyInfo*);
|
||||
KeyInfo *sqlite3KeyInfoOfIndex(Parse*, Index*);
|
||||
KeyInfo *sqlite3KeyInfoFromExprList(Parse*, ExprList*, int, int);
|
||||
const char *sqlite3SelectOpName(int);
|
||||
int sqlite3HasExplicitNulls(Parse*, ExprList*);
|
||||
|
||||
#ifdef SQLITE_DEBUG
|
||||
|
||||
+4
-2
@@ -6648,7 +6648,7 @@ static int SQLITE_TCLAPI prng_seed(
|
||||
Tcl_WrongNumArgs(interp, 1, objv, "SEED ?DB?");
|
||||
return TCL_ERROR;
|
||||
}
|
||||
if( Tcl_GetIntFromObj(interp,objv[0],&i) ) return TCL_ERROR;
|
||||
if( Tcl_GetIntFromObj(interp,objv[1],&i) ) return TCL_ERROR;
|
||||
if( objc==3 && getDbPointer(interp, Tcl_GetString(objv[2]), &db) ){
|
||||
return TCL_ERROR;
|
||||
}
|
||||
@@ -7494,6 +7494,7 @@ static int SQLITE_TCLAPI tclLoadStaticExtensionCmd(
|
||||
Tcl_Obj *CONST objv[]
|
||||
){
|
||||
extern int sqlite3_amatch_init(sqlite3*,char**,const sqlite3_api_routines*);
|
||||
extern int sqlite3_appendvfs_init(sqlite3*,char**,const sqlite3_api_routines*);
|
||||
extern int sqlite3_carray_init(sqlite3*,char**,const sqlite3_api_routines*);
|
||||
extern int sqlite3_closure_init(sqlite3*,char**,const sqlite3_api_routines*);
|
||||
extern int sqlite3_csv_init(sqlite3*,char**,const sqlite3_api_routines*);
|
||||
@@ -7523,6 +7524,7 @@ static int SQLITE_TCLAPI tclLoadStaticExtensionCmd(
|
||||
int (*pInit)(sqlite3*,char**,const sqlite3_api_routines*);
|
||||
} aExtension[] = {
|
||||
{ "amatch", sqlite3_amatch_init },
|
||||
{ "appendvfs", sqlite3_appendvfs_init },
|
||||
{ "carray", sqlite3_carray_init },
|
||||
{ "closure", sqlite3_closure_init },
|
||||
{ "csv", sqlite3_csv_init },
|
||||
@@ -7571,7 +7573,7 @@ static int SQLITE_TCLAPI tclLoadStaticExtensionCmd(
|
||||
}else{
|
||||
rc = SQLITE_OK;
|
||||
}
|
||||
if( rc!=SQLITE_OK || zErrMsg ){
|
||||
if( (rc!=SQLITE_OK && rc!=SQLITE_OK_LOAD_PERMANENTLY) || zErrMsg ){
|
||||
Tcl_AppendResult(interp, "initialization of ", zName, " failed: ", zErrMsg,
|
||||
(char*)0);
|
||||
sqlite3_free(zErrMsg);
|
||||
|
||||
+1
-1
@@ -80,7 +80,7 @@ static const unsigned char aiClass[] = {
|
||||
#ifdef SQLITE_EBCDIC
|
||||
/* x0 x1 x2 x3 x4 x5 x6 x7 x8 x9 xa xb xc xd xe xf */
|
||||
/* 0x */ 29, 28, 28, 28, 28, 7, 28, 28, 28, 28, 28, 28, 7, 7, 28, 28,
|
||||
/* 1x */ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
|
||||
/* 1x */ 28, 28, 28, 28, 28, 7, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
|
||||
/* 2x */ 28, 28, 28, 28, 28, 7, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
|
||||
/* 3x */ 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
|
||||
/* 4x */ 7, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 26, 12, 17, 20, 10,
|
||||
|
||||
+21
-1
@@ -823,6 +823,25 @@ SrcList *sqlite3TriggerStepSrc(
|
||||
return pSrc;
|
||||
}
|
||||
|
||||
/*
|
||||
** Return true if the pExpr term from the RETURNING clause argument
|
||||
** list is of the form "*". Raise an error if the terms if of the
|
||||
** form "table.*".
|
||||
*/
|
||||
static int isAsteriskTerm(
|
||||
Parse *pParse, /* Parsing context */
|
||||
Expr *pTerm /* A term in the RETURNING clause */
|
||||
){
|
||||
assert( pTerm!=0 );
|
||||
if( pTerm->op==TK_ASTERISK ) return 1;
|
||||
if( pTerm->op!=TK_DOT ) return 0;
|
||||
assert( pTerm->pRight!=0 );
|
||||
assert( pTerm->pLeft!=0 );
|
||||
if( pTerm->pRight->op!=TK_ASTERISK ) return 0;
|
||||
sqlite3ErrorMsg(pParse, "RETURNING may not use \"TABLE.*\" wildcards");
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* The input list pList is the list of result set terms from a RETURNING
|
||||
** clause. The table that we are returning from is pTab.
|
||||
**
|
||||
@@ -840,7 +859,8 @@ static ExprList *sqlite3ExpandReturning(
|
||||
|
||||
for(i=0; i<pList->nExpr; i++){
|
||||
Expr *pOldExpr = pList->a[i].pExpr;
|
||||
if( ALWAYS(pOldExpr!=0) && pOldExpr->op==TK_ASTERISK ){
|
||||
if( NEVER(pOldExpr==0) ) continue;
|
||||
if( isAsteriskTerm(pParse, pOldExpr) ){
|
||||
int jj;
|
||||
for(jj=0; jj<pTab->nCol; jj++){
|
||||
Expr *pNewExpr;
|
||||
|
||||
+45
-40
@@ -272,11 +272,6 @@ static VdbeCursor *allocateCursor(
|
||||
|
||||
assert( iCur>=0 && iCur<p->nCursor );
|
||||
if( p->apCsr[iCur] ){ /*OPTIMIZATION-IF-FALSE*/
|
||||
/* Before calling sqlite3VdbeFreeCursor(), ensure the isEphemeral flag
|
||||
** is clear. Otherwise, if this is an ephemeral cursor created by
|
||||
** OP_OpenDup, the cursor will not be closed and will still be part
|
||||
** of a BtShared.pCursor list. */
|
||||
if( p->apCsr[iCur]->pBtx==0 ) p->apCsr[iCur]->isEphemeral = 0;
|
||||
sqlite3VdbeFreeCursor(p, p->apCsr[iCur]);
|
||||
p->apCsr[iCur] = 0;
|
||||
}
|
||||
@@ -1461,7 +1456,7 @@ case OP_ChngCntRow: {
|
||||
if( (rc = sqlite3VdbeCheckFk(p,0))!=SQLITE_OK ){
|
||||
goto abort_due_to_error;
|
||||
}
|
||||
/* Fall through to the next case, OP_String */
|
||||
/* Fall through to the next case, OP_ResultRow */
|
||||
/* no break */ deliberate_fall_through
|
||||
}
|
||||
|
||||
@@ -3873,7 +3868,7 @@ case OP_OpenDup: {
|
||||
|
||||
pOrig = p->apCsr[pOp->p2];
|
||||
assert( pOrig );
|
||||
assert( pOrig->pBtx!=0 ); /* Only ephemeral cursors can be duplicated */
|
||||
assert( pOrig->isEphemeral ); /* Only ephemeral cursors can be duplicated */
|
||||
|
||||
pCx = allocateCursor(p, pOp->p1, pOrig->nField, -1, CURTYPE_BTREE);
|
||||
if( pCx==0 ) goto no_mem;
|
||||
@@ -3883,7 +3878,10 @@ case OP_OpenDup: {
|
||||
pCx->isTable = pOrig->isTable;
|
||||
pCx->pgnoRoot = pOrig->pgnoRoot;
|
||||
pCx->isOrdered = pOrig->isOrdered;
|
||||
rc = sqlite3BtreeCursor(pOrig->pBtx, pCx->pgnoRoot, BTREE_WRCSR,
|
||||
pCx->pBtx = pOrig->pBtx;
|
||||
pCx->hasBeenDuped = 1;
|
||||
pOrig->hasBeenDuped = 1;
|
||||
rc = sqlite3BtreeCursor(pCx->pBtx, pCx->pgnoRoot, BTREE_WRCSR,
|
||||
pCx->pKeyInfo, pCx->uc.pCursor);
|
||||
/* The sqlite3BtreeCursor() routine can only fail for the first cursor
|
||||
** opened for a database. Since there is already an open cursor when this
|
||||
@@ -3949,9 +3947,10 @@ case OP_OpenEphemeral: {
|
||||
aMem[pOp->p3].z = "";
|
||||
}
|
||||
pCx = p->apCsr[pOp->p1];
|
||||
if( pCx && ALWAYS(pCx->pBtx) ){
|
||||
/* If the ephermeral table is already open, erase all existing content
|
||||
** so that the table is empty again, rather than creating a new table. */
|
||||
if( pCx && !pCx->hasBeenDuped ){
|
||||
/* If the ephermeral table is already open and has no duplicates from
|
||||
** OP_OpenDup, then erase all existing content so that the table is
|
||||
** empty again, rather than creating a new table. */
|
||||
assert( pCx->isEphemeral );
|
||||
pCx->seqCount = 0;
|
||||
pCx->cacheStatus = CACHE_STALE;
|
||||
@@ -3965,33 +3964,36 @@ case OP_OpenEphemeral: {
|
||||
vfsFlags);
|
||||
if( rc==SQLITE_OK ){
|
||||
rc = sqlite3BtreeBeginTrans(pCx->pBtx, 1, 0);
|
||||
}
|
||||
if( rc==SQLITE_OK ){
|
||||
/* If a transient index is required, create it by calling
|
||||
** sqlite3BtreeCreateTable() with the BTREE_BLOBKEY flag before
|
||||
** opening it. If a transient table is required, just use the
|
||||
** automatically created table with root-page 1 (an BLOB_INTKEY table).
|
||||
*/
|
||||
if( (pCx->pKeyInfo = pKeyInfo = pOp->p4.pKeyInfo)!=0 ){
|
||||
assert( pOp->p4type==P4_KEYINFO );
|
||||
rc = sqlite3BtreeCreateTable(pCx->pBtx, &pCx->pgnoRoot,
|
||||
BTREE_BLOBKEY | pOp->p5);
|
||||
if( rc==SQLITE_OK ){
|
||||
assert( pCx->pgnoRoot==SCHEMA_ROOT+1 );
|
||||
assert( pKeyInfo->db==db );
|
||||
assert( pKeyInfo->enc==ENC(db) );
|
||||
rc = sqlite3BtreeCursor(pCx->pBtx, pCx->pgnoRoot, BTREE_WRCSR,
|
||||
pKeyInfo, pCx->uc.pCursor);
|
||||
if( rc==SQLITE_OK ){
|
||||
/* If a transient index is required, create it by calling
|
||||
** sqlite3BtreeCreateTable() with the BTREE_BLOBKEY flag before
|
||||
** opening it. If a transient table is required, just use the
|
||||
** automatically created table with root-page 1 (an BLOB_INTKEY table).
|
||||
*/
|
||||
if( (pCx->pKeyInfo = pKeyInfo = pOp->p4.pKeyInfo)!=0 ){
|
||||
assert( pOp->p4type==P4_KEYINFO );
|
||||
rc = sqlite3BtreeCreateTable(pCx->pBtx, &pCx->pgnoRoot,
|
||||
BTREE_BLOBKEY | pOp->p5);
|
||||
if( rc==SQLITE_OK ){
|
||||
assert( pCx->pgnoRoot==SCHEMA_ROOT+1 );
|
||||
assert( pKeyInfo->db==db );
|
||||
assert( pKeyInfo->enc==ENC(db) );
|
||||
rc = sqlite3BtreeCursor(pCx->pBtx, pCx->pgnoRoot, BTREE_WRCSR,
|
||||
pKeyInfo, pCx->uc.pCursor);
|
||||
}
|
||||
pCx->isTable = 0;
|
||||
}else{
|
||||
pCx->pgnoRoot = SCHEMA_ROOT;
|
||||
rc = sqlite3BtreeCursor(pCx->pBtx, SCHEMA_ROOT, BTREE_WRCSR,
|
||||
0, pCx->uc.pCursor);
|
||||
pCx->isTable = 1;
|
||||
}
|
||||
pCx->isTable = 0;
|
||||
}else{
|
||||
pCx->pgnoRoot = SCHEMA_ROOT;
|
||||
rc = sqlite3BtreeCursor(pCx->pBtx, SCHEMA_ROOT, BTREE_WRCSR,
|
||||
0, pCx->uc.pCursor);
|
||||
pCx->isTable = 1;
|
||||
}
|
||||
pCx->isOrdered = (pOp->p5!=BTREE_UNORDERED);
|
||||
if( rc ){
|
||||
sqlite3BtreeClose(pCx->pBtx);
|
||||
}
|
||||
}
|
||||
pCx->isOrdered = (pOp->p5!=BTREE_UNORDERED);
|
||||
}
|
||||
if( rc ) goto abort_due_to_error;
|
||||
pCx->nullRow = 1;
|
||||
@@ -4425,13 +4427,13 @@ seek_not_found:
|
||||
**
|
||||
** There are three possible outcomes from this opcode:<ol>
|
||||
**
|
||||
** <li> If after This.P1 steps, the cursor is still point to a place that
|
||||
** is earlier in the btree than the target row,
|
||||
** then fall through into the subsquence OP_SeekGE opcode.
|
||||
** <li> If after This.P1 steps, the cursor is still pointing to a place that
|
||||
** is earlier in the btree than the target row, then fall through
|
||||
** into the subsquence OP_SeekGE opcode.
|
||||
**
|
||||
** <li> If the cursor is successfully moved to the target row by 0 or more
|
||||
** sqlite3BtreeNext() calls, then jump to This.P2, which will land just
|
||||
** past the OP_IdxGT opcode that follows the OP_SeekGE.
|
||||
** past the OP_IdxGT or OP_IdxGE opcode that follows the OP_SeekGE.
|
||||
**
|
||||
** <li> If the cursor ends up past the target row (indicating the the target
|
||||
** row does not exist in the btree) then jump to SeekOP.P2.
|
||||
@@ -4448,7 +4450,8 @@ case OP_SeekScan: {
|
||||
/* pOp->p2 points to the first instruction past the OP_IdxGT that
|
||||
** follows the OP_SeekGE. */
|
||||
assert( pOp->p2>=(int)(pOp-aOp)+2 );
|
||||
assert( aOp[pOp->p2-1].opcode==OP_IdxGT );
|
||||
assert( aOp[pOp->p2-1].opcode==OP_IdxGT || aOp[pOp->p2-1].opcode==OP_IdxGE );
|
||||
testcase( aOp[pOp->p2-1].opcode==OP_IdxGE );
|
||||
assert( pOp[1].p1==aOp[pOp->p2-1].p1 );
|
||||
assert( pOp[1].p2==aOp[pOp->p2-1].p2 );
|
||||
assert( pOp[1].p3==aOp[pOp->p2-1].p3 );
|
||||
@@ -5983,6 +5986,8 @@ case OP_IdxRowid: { /* out2 */
|
||||
pTabCur->deferredMoveto = 1;
|
||||
assert( pOp->p4type==P4_INTARRAY || pOp->p4.ai==0 );
|
||||
pTabCur->aAltMap = pOp->p4.ai;
|
||||
assert( !pC->isEphemeral );
|
||||
assert( !pTabCur->isEphemeral );
|
||||
pTabCur->pAltCursor = pC;
|
||||
}else{
|
||||
pOut = out2Prerelease(p, pOp);
|
||||
|
||||
@@ -86,6 +86,7 @@ struct VdbeCursor {
|
||||
Bool isEphemeral:1; /* True for an ephemeral table */
|
||||
Bool useRandomRowid:1; /* Generate new record numbers semi-randomly */
|
||||
Bool isOrdered:1; /* True if the table is not BTREE_UNORDERED */
|
||||
Bool hasBeenDuped:1; /* This cursor was source or target of OP_OpenDup */
|
||||
u16 seekHit; /* See the OP_SeekHit and OP_IfNoHope opcodes */
|
||||
Btree *pBtx; /* Separate file holding temporary table */
|
||||
i64 seqCount; /* Sequence counter */
|
||||
|
||||
+4
-8
@@ -2472,20 +2472,15 @@ void sqlite3VdbeFreeCursor(Vdbe *p, VdbeCursor *pCx){
|
||||
return;
|
||||
}
|
||||
assert( pCx->pBtx==0 || pCx->eCurType==CURTYPE_BTREE );
|
||||
assert( pCx->pBtx==0 || pCx->isEphemeral );
|
||||
switch( pCx->eCurType ){
|
||||
case CURTYPE_SORTER: {
|
||||
sqlite3VdbeSorterClose(p->db, pCx);
|
||||
break;
|
||||
}
|
||||
case CURTYPE_BTREE: {
|
||||
if( pCx->isEphemeral ){
|
||||
if( pCx->pBtx ) sqlite3BtreeClose(pCx->pBtx);
|
||||
/* The pCx->pCursor will be close automatically, if it exists, by
|
||||
** the call above. */
|
||||
}else{
|
||||
assert( pCx->uc.pCursor!=0 );
|
||||
sqlite3BtreeCloseCursor(pCx->uc.pCursor);
|
||||
}
|
||||
assert( pCx->uc.pCursor!=0 );
|
||||
sqlite3BtreeCloseCursor(pCx->uc.pCursor);
|
||||
break;
|
||||
}
|
||||
#ifndef SQLITE_OMIT_VIRTUALTABLE
|
||||
@@ -3569,6 +3564,7 @@ int sqlite3VdbeCursorMoveto(VdbeCursor **pp, u32 *piCol){
|
||||
assert( p->eCurType==CURTYPE_BTREE || p->eCurType==CURTYPE_PSEUDO );
|
||||
if( p->deferredMoveto ){
|
||||
u32 iMap;
|
||||
assert( !p->isEphemeral );
|
||||
if( p->aAltMap && (iMap = p->aAltMap[1+*piCol])>0 && !p->nullRow ){
|
||||
*pp = p->pAltCursor;
|
||||
*piCol = iMap - 1;
|
||||
|
||||
+5
-1
@@ -1210,9 +1210,13 @@ static void exprAnalyzeExists(
|
||||
assert( pExpr->op==TK_EXISTS );
|
||||
assert( (pExpr->flags & EP_VarSelect) && (pExpr->flags & EP_xIsSelect) );
|
||||
|
||||
if( (pSel->selFlags & SF_Aggregate) || pSel->pWin ) return;
|
||||
if( pSel->selFlags & SF_Aggregate ) return;
|
||||
#ifndef SQLITE_OMIT_WINDOWFUNC
|
||||
if( pSel->pWin ) return;
|
||||
#endif
|
||||
if( pSel->pPrior ) return;
|
||||
if( pSel->pWhere==0 ) return;
|
||||
if( pSel->pLimit ) return;
|
||||
if( 0==exprAnalyzeExistsFindEq(pSel, 0, 0) ) return;
|
||||
|
||||
pDup = sqlite3ExprDup(db, pExpr, 0);
|
||||
|
||||
@@ -1469,6 +1469,7 @@ static void windowCheckValue(Parse *pParse, int reg, int eCond){
|
||||
VdbeCoverageIf(v, eCond==2);
|
||||
}
|
||||
sqlite3VdbeAddOp3(v, aOp[eCond], regZero, sqlite3VdbeCurrentAddr(v)+2, reg);
|
||||
sqlite3VdbeChangeP5(v, SQLITE_AFF_NUMERIC);
|
||||
VdbeCoverageNeverNullIf(v, eCond==0); /* NULL case captured by */
|
||||
VdbeCoverageNeverNullIf(v, eCond==1); /* the OP_MustBeInt */
|
||||
VdbeCoverageNeverNullIf(v, eCond==2);
|
||||
@@ -2065,6 +2066,7 @@ static void windowCodeRangeTest(
|
||||
int regString = ++pParse->nMem; /* Reg. for constant value '' */
|
||||
int arith = OP_Add; /* OP_Add or OP_Subtract */
|
||||
int addrGe; /* Jump destination */
|
||||
CollSeq *pColl;
|
||||
|
||||
assert( op==OP_Ge || op==OP_Gt || op==OP_Le );
|
||||
assert( pOrderBy && pOrderBy->nExpr==1 );
|
||||
@@ -2155,6 +2157,8 @@ static void windowCodeRangeTest(
|
||||
** control skips over this test if the BIGNULL flag is set and either
|
||||
** reg1 or reg2 contain a NULL value. */
|
||||
sqlite3VdbeAddOp3(v, op, reg2, lbl, reg1); VdbeCoverage(v);
|
||||
pColl = sqlite3ExprNNCollSeq(pParse, pOrderBy->a[0].pExpr);
|
||||
sqlite3VdbeAppendP4(v, (void*)pColl, P4_COLLSEQ);
|
||||
sqlite3VdbeChangeP5(v, SQLITE_NULLEQ);
|
||||
|
||||
assert( op==OP_Ge || op==OP_Gt || op==OP_Lt || op==OP_Le );
|
||||
|
||||
@@ -903,4 +903,16 @@ ifcapable rtree {
|
||||
} {1 1.0 2.0 3 1.5 3.5}
|
||||
}
|
||||
|
||||
# 2021-03-08 dbsqlfuzz 3f0a7245b69cd08617d7d7781ebaedb0fe765a93
|
||||
reset_db
|
||||
do_catchsql_test alter-18.1 {
|
||||
CREATE TABLE t1(a,b,c);
|
||||
CREATE TABLE log(a INTEGER PRIMARY KEY,b,c);
|
||||
CREATE TRIGGER tr1 AFTER INSERT ON t1 BEGIN
|
||||
INSERT INTO logx(a,b,c) VALUES(new.a,new.b,new.c)
|
||||
ON CONFLICT(a) DO UPDATE SET c=excluded.c, b=new.b;
|
||||
END;
|
||||
ALTER TABLE log RENAME COLUMN a TO x;
|
||||
} {1 {error in trigger tr1: no such table: main.logx}}
|
||||
|
||||
finish_test
|
||||
|
||||
+32
-2
@@ -13,8 +13,6 @@
|
||||
# file format change that may be used in the future to implement
|
||||
# "ALTER TABLE ... RENAME COLUMN ... TO".
|
||||
#
|
||||
# $Id: alter4.test,v 1.1 2009/02/02 18:03:22 drh Exp $
|
||||
#
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@@ -804,6 +802,38 @@ do_execsql_test 20.110 {
|
||||
SELECT sql FROM sqlite_master WHERE name='t1';
|
||||
} {{CREATE TABLE t1(xx UNIQUE,yy UNIQUE,zz UNIQUE,UNIQUE(xx),PRIMARY KEY(yy),UNIQUE(zz))}}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
reset_db
|
||||
do_execsql_test 21.0 {
|
||||
CREATE TABLE t1(a, b, c NOT NULL);
|
||||
CREATE TRIGGER tr1 AFTER INSERT ON t1 WHEN new.c IS NOT NULL BEGIN
|
||||
SELECT c NOT NULL FROM t1;
|
||||
END;
|
||||
}
|
||||
|
||||
do_execsql_test 21.1 {
|
||||
ALTER TABLE t1 RENAME c TO d;
|
||||
}
|
||||
|
||||
do_execsql_test 21.2 {
|
||||
SELECT sql FROM sqlite_schema WHERE name IS 'tr1'
|
||||
} {{CREATE TRIGGER tr1 AFTER INSERT ON t1 WHEN new.d IS NOT NULL BEGIN
|
||||
SELECT d NOT NULL FROM t1;
|
||||
END}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
reset_db
|
||||
do_execsql_test 22.0 {
|
||||
CREATE TABLE t1(a, b);
|
||||
CREATE TABLE t2(c, othername, extra AS (c + 1));
|
||||
ALTER TABLE t1 RENAME a to othername;
|
||||
SELECT sql FROM sqlite_schema;
|
||||
} {
|
||||
{CREATE TABLE t1(othername, b)}
|
||||
{CREATE TABLE t2(c, othername, extra AS (c + 1))}
|
||||
}
|
||||
|
||||
|
||||
finish_test
|
||||
|
||||
@@ -255,4 +255,25 @@ do_catchsql_test 5.5.2 {
|
||||
ALTER TABLE c1 DROP COLUMN y
|
||||
} {1 {error in trigger tr: no such column: new.z}}
|
||||
|
||||
# 2021-03-06 dbsqlfuzz crash-419aa525df93db6e463772c686ac6da27b46da9e
|
||||
reset_db
|
||||
do_catchsql_test 6.0 {
|
||||
CREATE TABLE t1(a,b,c);
|
||||
CREATE TABLE t2(x,y,z);
|
||||
PRAGMA writable_schema=ON;
|
||||
UPDATE sqlite_schema SET sql='CREATE INDEX t1b ON t1(b)' WHERE name='t2';
|
||||
PRAGMA writable_schema=OFF;
|
||||
ALTER TABLE t2 DROP COLUMN z;
|
||||
} {1 {database disk image is malformed}}
|
||||
reset_db
|
||||
do_catchsql_test 6.1 {
|
||||
CREATE TABLE t1(a,b,c);
|
||||
CREATE TABLE t2(x,y,z);
|
||||
PRAGMA writable_schema=ON;
|
||||
UPDATE sqlite_schema SET sql='CREATE VIEW t2(x,y,z) AS SELECT b,a,c FROM t1'
|
||||
WHERE name='t2';
|
||||
PRAGMA writable_schema=OFF;
|
||||
ALTER TABLE t2 DROP COLUMN z;
|
||||
} {1 {database disk image is malformed}}
|
||||
|
||||
finish_test
|
||||
|
||||
+13
-5
@@ -57,7 +57,7 @@ proc do_atdc_error_test {tn schema atdc error} {
|
||||
# and does not have a UNIQUE constraint.
|
||||
#
|
||||
|
||||
# EVIDENCE-OF: R-05184-13006 The column is a PRIMARY KEY.
|
||||
# EVIDENCE-OF: R-52436-31752 The column is a PRIMARY KEY or part of one.
|
||||
#
|
||||
do_atdc_error_test 2.1.1 {
|
||||
CREATE TABLE x1(a PRIMARY KEY, b, c);
|
||||
@@ -66,6 +66,13 @@ do_atdc_error_test 2.1.1 {
|
||||
} {
|
||||
cannot drop PRIMARY KEY column: "a"
|
||||
}
|
||||
do_atdc_error_test 2.1.2 {
|
||||
CREATE TABLE x1(a,b,c,d,e, PRIMARY KEY(b,c,d));
|
||||
} {
|
||||
ALTER TABLE x1 DROP COLUMN c
|
||||
} {
|
||||
cannot drop PRIMARY KEY column: "c"
|
||||
}
|
||||
|
||||
# EVIDENCE-OF: R-43412-16016 The column has a UNIQUE constraint.
|
||||
#
|
||||
@@ -84,7 +91,7 @@ do_atdc_error_test 2.2.2 {
|
||||
error in table x1 after drop column: no such column: c
|
||||
}
|
||||
|
||||
# EVIDENCE-OF: R-46731-08965: The column is indexed.
|
||||
# EVIDENCE-OF: R-46731-08965 The column is indexed.
|
||||
#
|
||||
do_atdc_error_test 2.3.1 {
|
||||
CREATE TABLE 'one two'('x y', 'z 1', 'a b');
|
||||
@@ -103,7 +110,7 @@ do_atdc_error_test 2.3.2 {
|
||||
error in index idx after drop column: no such column: a
|
||||
}
|
||||
|
||||
# EVIDENCE-OF: R-46731-08965: The column is indexed.
|
||||
# EVIDENCE-OF: R-46731-08965 The column is indexed.
|
||||
#
|
||||
do_atdc_error_test 2.4.1 {
|
||||
CREATE TABLE x1234(a, b, c PRIMARY KEY) WITHOUT ROWID;
|
||||
@@ -114,7 +121,8 @@ do_atdc_error_test 2.4.1 {
|
||||
error in index i1 after drop column: no such column: a
|
||||
}
|
||||
|
||||
# EVIDENCE-OF: R-18825-17786 The column appears in a table CHECK constraint.
|
||||
# EVIDENCE-OF: R-47838-03249 The column is named in a table or column
|
||||
# CHECK constraint not associated with the column being dropped.
|
||||
#
|
||||
do_atdc_error_test 2.5.1 {
|
||||
CREATE TABLE x1234(a, b, c PRIMARY KEY, CHECK(((a+5)%10)!=0)) WITHOUT ROWID;
|
||||
@@ -187,7 +195,7 @@ do_atdc_error_test 2.8.3 {
|
||||
# if the CHECK constraint was specified as part of the column definition.
|
||||
#
|
||||
|
||||
# EVIDENCE-OF: R-60924-11170 However, the column being deleted can be used in a
|
||||
# STALE-EVIDENCE: R-60924-11170 However, the column being deleted can be used in a
|
||||
# column CHECK constraint because the column CHECK constraint is dropped
|
||||
# together with the column itself.
|
||||
do_execsql_test 3.0 {
|
||||
|
||||
@@ -711,5 +711,31 @@ do_execsql_test 23.4 {
|
||||
{CREATE VIEW v1 AS SELECT * FROM "idx2" WHERE y='abc'}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
#
|
||||
reset_db
|
||||
do_execsql_test 24.1.0 {
|
||||
CREATE TABLE t1(a, b);
|
||||
CREATE TRIGGER AFTER INSERT ON t1 BEGIN
|
||||
INSERT INTO nosuchtable VALUES(new.a) ON CONFLICT(a) DO NOTHING;
|
||||
END;
|
||||
}
|
||||
do_catchsql_test 24.1.1 {
|
||||
ALTER TABLE t1 RENAME TO t2;
|
||||
} {1 {error in trigger AFTER: no such table: main.nosuchtable}}
|
||||
|
||||
reset_db
|
||||
do_execsql_test 24.2.0 {
|
||||
CREATE TABLE t1(a, b);
|
||||
CREATE TRIGGER AFTER INSERT ON t1 BEGIN
|
||||
INSERT INTO v1 VALUES(new.a) ON CONFLICT(a) DO NOTHING;
|
||||
END;
|
||||
CREATE VIEW v1 AS SELECT * FROM nosuchtable;
|
||||
}
|
||||
do_catchsql_test 24.2.1 {
|
||||
ALTER TABLE t1 RENAME TO t2;
|
||||
} {1 {error in trigger AFTER: no such table: main.nosuchtable}}
|
||||
|
||||
|
||||
finish_test
|
||||
|
||||
|
||||
@@ -910,4 +910,19 @@ do_execsql_test attach-12.1 {
|
||||
PRAGMA integrity_check;
|
||||
} {ok}
|
||||
|
||||
# 2021-03-10 Forum post https://sqlite.org/forum/forumpost/a006d86f72
|
||||
#
|
||||
reset_db
|
||||
do_test attach-13.1 {
|
||||
sqlite3 db :memory:
|
||||
db eval {CREATE TABLE base(x);}
|
||||
for {set i 0} {$i<$SQLITE_MAX_ATTACHED} {incr i} {
|
||||
db eval "ATTACH ':memory:' AS a$i"
|
||||
}
|
||||
set m "a[expr {$SQLITE_MAX_ATTACHED-1}]"
|
||||
db eval "CREATE TABLE $m.t1(a INTEGER PRIMARY KEY, b);"
|
||||
db eval "CREATE TABLE $m.t2(a INTEGER PRIMARY KEY, b);"
|
||||
db eval {SELECT a FROM t1 WHERE b IN (SELECT a FROM t2);}
|
||||
} {}
|
||||
|
||||
finish_test
|
||||
|
||||
+395
@@ -0,0 +1,395 @@
|
||||
# 2021-03-06
|
||||
#
|
||||
# The author disclaims copyright to this source code. In place of
|
||||
# a legal notice, here is a blessing:
|
||||
#
|
||||
# May you do good and not evil.
|
||||
# May you find forgiveness for yourself and forgive others.
|
||||
# May you share freely, never taking more than you give.
|
||||
#
|
||||
#***********************************************************************
|
||||
#
|
||||
# This file implements tests for the appendvfs extension.
|
||||
#
|
||||
# Tests performed:
|
||||
# avfs-1.0. Test that an appendvfs DB can be added to an empty (ZLF) file.
|
||||
# avfs-1.1. Test that the DB can be read with correct content upon reopen.
|
||||
# avfs-1.2. Test that an appendvfs DB can be added to a simple text file.
|
||||
# avfs-1.3. Test that the DB can be read with correct content upon reopen.
|
||||
# avfs-1.4. Test that appended DB is aligned to default page boundary.
|
||||
# avfs-2.1. Test that the simple text file retains its initial text.
|
||||
# avfs-3.1. Test that the appendvfs can grow and shrink, remaining intact.
|
||||
# avfs-3.2. Test that appendvfs is intact after grow/shrink/close/reopen.
|
||||
# avfs-3.3. Test that appendvfs can grow by many pages and be written.
|
||||
# avfs-3.4. Test that grown appendvfs can be reopened and appear intact.
|
||||
# avfs-3.5. Test that much grown appendvfs can shrink and reopen intact.
|
||||
# avfs-4.1. Test shell's ability to append to a non-appendvfs file.
|
||||
# avfs-4.2. Test shell's ability to append to empty or nonexistent file.
|
||||
# avfs-4.3. Test shell's ability to reopen and alter an appendvfs file.
|
||||
# avfs-5.1. Test appendvfs refusal to open too-tiny DB appended onto ZLF.
|
||||
# avfs-5.2. Test appendvfs refusal to open too-tiny DB appended on other.
|
||||
# ...
|
||||
# (more to come)
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
set ::testprefix avfs
|
||||
|
||||
# Do not attempt this test if SQLITE_OMIT_VIRTUALTABLE is defined.
|
||||
#
|
||||
ifcapable !vtab {
|
||||
finish_test
|
||||
return
|
||||
}
|
||||
|
||||
set CLI [test_find_cli]
|
||||
db close
|
||||
# forcedelete test.db
|
||||
|
||||
load_static_extension db appendvfs
|
||||
|
||||
set ::fa avfs.adb
|
||||
set ::fza avfs.sdb
|
||||
forcedelete $::fa $::fza
|
||||
set ::result {}
|
||||
|
||||
proc shellDoesAr {} {
|
||||
set shdo "sh_app1.sql"
|
||||
forcedelete $shdo
|
||||
set fd [open $shdo w]
|
||||
puts $fd ".help\n.q"
|
||||
close $fd
|
||||
set res [catchcmd "-batch -cmd \".read $shdo\""]
|
||||
return [regexp {^.archive} [lindex $res 1]]
|
||||
}
|
||||
|
||||
set ::vf "&vfs=apndvfs"
|
||||
|
||||
# Return file offset of appendvfs portion of a file, or {} if none such.
|
||||
proc fosAvfs {fname} {
|
||||
if {[file size $fname] < 25} {
|
||||
return {}
|
||||
}
|
||||
if {[catch {set fd [open $fname rb]}]} {
|
||||
return {}
|
||||
}
|
||||
seek $fd -25 end
|
||||
set am [read $fd 17]
|
||||
set ao [read $fd 8]
|
||||
close $fd
|
||||
if {$am ne "Start-Of-SQLite3-"} {
|
||||
return {}
|
||||
}
|
||||
binary scan $ao "W" rvo
|
||||
return $rvo
|
||||
}
|
||||
|
||||
do_test 1.0 {
|
||||
set results {}
|
||||
set out [open $::fza wb]
|
||||
close $out
|
||||
sqlite3 adb "file:$::fza?mode=rwc$::vf" -uri 1
|
||||
adb eval {
|
||||
PRAGMA page_size=1024;
|
||||
PRAGMA cache_size=10;
|
||||
CREATE TABLE t1(a TEXT);
|
||||
INSERT INTO t1 VALUES ('dog'),('cat');
|
||||
SELECT group_concat(a) as pets FROM (SELECT a FROM t1 ORDER BY a);
|
||||
} { lappend results $pets }
|
||||
adb close
|
||||
lappend results [fosAvfs $fza]
|
||||
set ::result [join $results " | "]
|
||||
} {cat,dog | 0}
|
||||
|
||||
do_test 1.1 {
|
||||
set results {}
|
||||
sqlite3 adb "file:$::fza?mode=rw$::vf" -uri 1
|
||||
adb eval {
|
||||
SELECT group_concat(a) as pets FROM (SELECT a FROM t1 ORDER BY a DESC);
|
||||
} { lappend results $pets }
|
||||
adb close
|
||||
set ::result [join $results " | "]
|
||||
} {dog,cat}
|
||||
|
||||
do_test 1.2 {
|
||||
set results {}
|
||||
set out [open $::fa wb]
|
||||
set ::tlo { "Just some text," "and more text," "ending at 3 lines." }
|
||||
puts $out [join $::tlo "\n"]
|
||||
close $out
|
||||
set adbSz [file size $::fa]
|
||||
sqlite3 adb "file:$::fa?mode=rwc$::vf" -uri 1
|
||||
adb eval {
|
||||
PRAGMA auto_vacuum = 0;
|
||||
PRAGMA page_size=512;
|
||||
PRAGMA cache_size=0;
|
||||
CREATE TABLE t1(a TEXT);
|
||||
INSERT INTO t1 VALUES ('dog'),('cat'),('pig');
|
||||
SELECT group_concat(a) as pets FROM (SELECT a FROM t1 ORDER BY a);
|
||||
} { lappend results $pets }
|
||||
adb close
|
||||
set adaSz [file size $::fa]
|
||||
lappend results "Bytes before/after $adbSz/$adaSz"
|
||||
set ::result [join $results " | "]
|
||||
} {cat,dog,pig | Bytes before/after 50/5145}
|
||||
|
||||
do_test 1.3 {
|
||||
set results {}
|
||||
sqlite3 adb "file:$::fa?mode=rw$::vf" -uri 1
|
||||
adb eval {
|
||||
SELECT group_concat(a) as pets FROM (SELECT a FROM t1 ORDER BY a DESC);
|
||||
} { lappend results $pets }
|
||||
adb close
|
||||
set ::result [join $results " | "]
|
||||
} {pig,dog,cat}
|
||||
|
||||
do_test 1.4 {
|
||||
set ::result [fosAvfs $fa]
|
||||
} {4096}
|
||||
|
||||
do_test 2.1 {
|
||||
set in [open $::fa r]
|
||||
set tli {}
|
||||
for {set i [llength $::tlo]} {$i > 0} {incr i -1} {
|
||||
lappend tli [gets $in]
|
||||
}
|
||||
close $in
|
||||
if { [join $tli ":"] ne [join $::tlo ":"] } {
|
||||
set ::result "Appendee changed."
|
||||
} else {
|
||||
set ::result "Appendee intact."
|
||||
}
|
||||
} {Appendee intact.}
|
||||
|
||||
# Set of repeatable random integers for a couple tests.
|
||||
set ::nrint 50000
|
||||
proc rint {v} {
|
||||
return [::tcl::mathfunc::int [expr $v * 100000]]
|
||||
}
|
||||
array set ::randints [list 0 [rint [::tcl::mathfunc::srand 0]]]
|
||||
for {set i 1} {$i < $::nrint} {incr i} {
|
||||
set ::randints($i) [rint [::tcl::mathfunc::rand]]
|
||||
}
|
||||
|
||||
do_test 3.1 {
|
||||
set results {}
|
||||
sqlite3 adb "file:$::fa?mode=rw$::vf" -uri 1
|
||||
adb eval {
|
||||
DROP TABLE t1;
|
||||
PRAGMA cache_size=10;
|
||||
CREATE TABLE ri (i INTEGER);
|
||||
BEGIN;
|
||||
}
|
||||
for {set i 0} {$i < $::nrint} {incr i} {
|
||||
set r $::randints($i)
|
||||
set s $::randints([incr i])
|
||||
set t $::randints([incr i])
|
||||
set u $::randints([incr i])
|
||||
set v $::randints([incr i])
|
||||
adb eval {
|
||||
INSERT INTO ri VALUES ($r),($s),($t),($u),($v)
|
||||
}
|
||||
}
|
||||
adb eval {
|
||||
COMMIT;
|
||||
SELECT integrity_check as ic FROM pragma_integrity_check();
|
||||
} { lappend results $ic }
|
||||
set adbSz [file size $::fa]
|
||||
set qr {}
|
||||
adb eval {
|
||||
SELECT count(*) as ic FROM ri;
|
||||
DELETE FROM ri WHERE (i % 50) <> 25;
|
||||
SELECT integrity_check as ic FROM pragma_integrity_check();
|
||||
VACUUM;
|
||||
SELECT integrity_check as ic FROM pragma_integrity_check();
|
||||
SELECT count(*) as ic FROM ri;
|
||||
} { lappend qr $ic }
|
||||
adb close
|
||||
set adaSz [file size $::fa]
|
||||
set adba [expr ($adbSz + 0.1)/$adaSz]
|
||||
# lappend results $adba
|
||||
set results [concat $results [lrange $qr 0 2]]
|
||||
lappend results [expr {$adba > 10.0}]
|
||||
set ::result [join $results " | "]
|
||||
} "ok | $::nrint | ok | ok | 1"
|
||||
|
||||
do_test 3.2 {
|
||||
set results {}
|
||||
sqlite3 adb "file:$::fa?mode=rw$::vf" -uri 1
|
||||
adb eval {
|
||||
SELECT integrity_check as ic FROM pragma_integrity_check();
|
||||
} { lappend results $ic }
|
||||
adb close
|
||||
set ::result [join $results " | "]
|
||||
} {ok}
|
||||
|
||||
# avfs-3.3. Test that appendvfs can grow by many pages and be written.
|
||||
do_test 3.3 {
|
||||
set results {}
|
||||
sqlite3 adb "file:$::fa?mode=rw$::vf" -uri 1
|
||||
set npages 300
|
||||
adb eval { BEGIN }
|
||||
while {$npages > 0} {
|
||||
adb eval { INSERT INTO ri VALUES (randomblob(1500)) }
|
||||
incr npages -1
|
||||
}
|
||||
adb eval { COMMIT }
|
||||
adb eval {
|
||||
SELECT integrity_check as ic FROM pragma_integrity_check();
|
||||
} { lappend results $ic }
|
||||
adb close
|
||||
set adaSzr [expr [file size $::fa] / 300.0 / 1500 ]
|
||||
set okSzr [expr $adaSzr > 1.0 && $adaSzr < 1.3 ]
|
||||
lappend results $okSzr
|
||||
set ::result [join $results " | "]
|
||||
} {ok | 1}
|
||||
|
||||
# avfs-3.4. Test that grown appendvfs can be reopened and appear intact.
|
||||
do_test 3.4 {
|
||||
set results {}
|
||||
sqlite3 adb "file:$::fa?mode=rw$::vf" -uri 1
|
||||
adb eval {
|
||||
SELECT integrity_check as ic FROM pragma_integrity_check();
|
||||
} { lappend results $ic }
|
||||
adb close
|
||||
set ::result $ic
|
||||
} {ok}
|
||||
|
||||
# avfs-3.5. Test that much grown appendvfs can shrink and reopen intact.
|
||||
do_test 3.5 {
|
||||
set results {}
|
||||
set adbsz [file size $::fa]
|
||||
sqlite3 adb "file:$::fa?mode=rw$::vf" -uri 1
|
||||
adb eval {
|
||||
DELETE FROM ri WHERE rowid % 8 <> 0;
|
||||
SELECT integrity_check as ic FROM pragma_integrity_check();
|
||||
VACUUM;
|
||||
SELECT integrity_check as ic FROM pragma_integrity_check();
|
||||
} { lappend results $ic }
|
||||
adb close
|
||||
set adasz [file size $::fa]
|
||||
lappend results [expr {$adbsz/$adasz > 5}]
|
||||
sqlite3 adb "file:$::fa?mode=rw$::vf" -uri 1
|
||||
adb eval {
|
||||
SELECT integrity_check as ic FROM pragma_integrity_check();
|
||||
} { lappend results $ic }
|
||||
adb close
|
||||
set ::result [join $results " | "]
|
||||
} {ok | ok | 1 | ok}
|
||||
|
||||
set ::cliDoesAr [shellDoesAr]
|
||||
|
||||
do_test 4.1 {
|
||||
set shdo "sh_app1.sql"
|
||||
set shod "sh_app1.adb"
|
||||
forcedelete $shdo $shod
|
||||
set ofd [open $shdo w]
|
||||
if {$::cliDoesAr} {
|
||||
puts $ofd ".ar -c"
|
||||
} else {
|
||||
puts $ofd "pragma page_size=512;"
|
||||
puts $ofd "create table sqlar (a);"
|
||||
}
|
||||
puts $ofd ".tables"
|
||||
puts $ofd ".q"
|
||||
close $ofd
|
||||
set ofd [open $shod wb]
|
||||
puts $ofd "Some text."
|
||||
close $ofd
|
||||
set res [catchcmd "-append -batch -init $shdo $shod" ""]
|
||||
lappend res [fosAvfs $shod]
|
||||
forcedelete $shdo $shod
|
||||
set ::result [join $res " | "]
|
||||
} {0 | sqlar | 4096}
|
||||
|
||||
do_test 4.2 {
|
||||
set shdo "sh_app1.sql"
|
||||
set shod "sh_app1.adb"
|
||||
forcedelete $shdo $shod
|
||||
set ofd [open $shdo w]
|
||||
if {$::cliDoesAr} {
|
||||
puts $ofd ".ar -c"
|
||||
} else {
|
||||
puts $ofd "pragma page_size=512;"
|
||||
puts $ofd "create table sqlar (a);"
|
||||
}
|
||||
puts $ofd ".tables"
|
||||
puts $ofd ".q"
|
||||
close $ofd
|
||||
set ofd [open $shod wb]
|
||||
close $ofd
|
||||
set res [catchcmd "-append -batch -init $shdo $shod" ""]
|
||||
lappend res [fosAvfs $shod]
|
||||
forcedelete $shdo ; # Leave $shod for next test.
|
||||
set ::result [join $res " | "]
|
||||
} {0 | sqlar | 0}
|
||||
|
||||
do_test 4.3 {
|
||||
set shdo "sh_app1.sql"
|
||||
set shod "sh_app1.adb" ; # Same as test 4.2, reusing ADB.
|
||||
forcedelete $shdo
|
||||
set ofd [open $shdo w]
|
||||
if {$::cliDoesAr} {
|
||||
puts $ofd ".ar -u $shdo"
|
||||
puts $ofd "select count(*) from sqlar where name = '$shdo';"
|
||||
} else {
|
||||
puts $ofd "insert into sqlar values (1);"
|
||||
puts $ofd "select count(*) from sqlar;"
|
||||
}
|
||||
puts $ofd ".q"
|
||||
close $ofd
|
||||
set res [catchcmd "-append -batch -init $shdo $shod" ""]
|
||||
sqlite3 adb "file:$shod?mode=rw$::vf" -uri 1
|
||||
adb eval {
|
||||
SELECT count(*) as n FROM sqlar
|
||||
} { lappend res $n }
|
||||
adb close
|
||||
forcedelete $shdo $shod;
|
||||
set ::result [join $res " | "]
|
||||
} {0 | 1 | 1}
|
||||
|
||||
do_test 5.1 {
|
||||
set fake "faketiny.sdb"
|
||||
forcedelete $fake
|
||||
set ofd [open $fake wb]
|
||||
puts -nonewline $ofd "SQLite format 3"
|
||||
puts -nonewline $ofd [binary format "c" 0]
|
||||
puts -nonewline $ofd "Start-Of-SQLite3-"
|
||||
puts -nonewline $ofd [binary format "W" 0]
|
||||
close $ofd
|
||||
if {[catch {sqlite3 adb "file:$fake?mode=rw$::vf" -uri 1}]} {
|
||||
set res "Open failed."
|
||||
} else {
|
||||
adb close
|
||||
set res "Opened when should not."
|
||||
}
|
||||
forcedelete $fake
|
||||
set ::result $res
|
||||
} {Open failed.}
|
||||
|
||||
do_test 5.2 {
|
||||
set fake "faketiny.sdb"
|
||||
forcedelete $fake
|
||||
set ofd [open $fake wb]
|
||||
set fakeAppendee "Dog ate my homework.\n"
|
||||
puts -nonewline $ofd $fakeAppendee
|
||||
puts -nonewline $ofd "SQLite format 3"
|
||||
puts -nonewline $ofd [binary format "c" 0]
|
||||
puts -nonewline $ofd "Start-Of-SQLite3-"
|
||||
puts -nonewline $ofd [binary format "W" [string length $fakeAppendee]]
|
||||
close $ofd
|
||||
if {[catch {sqlite3 adb "file:$fake?mode=rw$::vf" -uri 1}]} {
|
||||
set res "Open failed."
|
||||
} else {
|
||||
adb close
|
||||
set res "Opened when should not."
|
||||
}
|
||||
forcedelete $fake
|
||||
set ::result $res
|
||||
} {Open failed.}
|
||||
|
||||
forcedelete $::fa $::fza
|
||||
|
||||
unset -nocomplain ::fa ::fza ::tlo ::result ::randints ::nrint ::cliDoesAr
|
||||
|
||||
finish_test
|
||||
@@ -38,6 +38,13 @@ do_catchsql_test date2-130 {
|
||||
INSERT INTO t1(x,y) VALUES('2017-08-01','two');
|
||||
} {1 {CHECK constraint failed: date(x) BETWEEN '2017-07-01' AND '2017-07-31'}}
|
||||
|
||||
# 2021-03-16 Forum post https://sqlite.org/forum/forumpost/464afd4086
|
||||
do_catchsql_test date2-140 {
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(x, y, z AS (date()));
|
||||
INSERT INTO t1(x,y) VALUES(1,2);
|
||||
} {1 {non-deterministic use of date() in a generated column}}
|
||||
|
||||
do_execsql_test date2-200 {
|
||||
CREATE TABLE t2(x,y);
|
||||
INSERT INTO t2(x,y) VALUES(1, '2017-07-20'), (2, 'xyzzy');
|
||||
|
||||
+2
-2
@@ -2055,9 +2055,9 @@ do_test e_fkey-44.5 {
|
||||
#-------------------------------------------------------------------------
|
||||
# Test SET DEFAULT actions.
|
||||
#
|
||||
# EVIDENCE-OF: R-43054-54832 The "SET DEFAULT" actions are similar to
|
||||
# EVIDENCE-OF: R-55814-22637 The "SET DEFAULT" actions are similar to
|
||||
# "SET NULL", except that each of the child key columns is set to
|
||||
# contain the columns default value instead of NULL.
|
||||
# contain the column's default value instead of NULL.
|
||||
#
|
||||
drop_all_tables
|
||||
do_test e_fkey-45.1 {
|
||||
|
||||
@@ -164,6 +164,12 @@ do_execsql_test 2.7a {
|
||||
four one
|
||||
}
|
||||
|
||||
do_execsql_test 2.7b {
|
||||
SELECT a FROM t3 WHERE EXISTS (SELECT 1 FROM t4 WHERE (a,x)=(c,y) LIMIT 1)
|
||||
} {
|
||||
four one
|
||||
}
|
||||
|
||||
# EXISTS clauses using vector expressions in the WHERE clause.
|
||||
#
|
||||
reset_db
|
||||
|
||||
+10
-2
@@ -11,8 +11,6 @@
|
||||
# This file implements regression tests for SQLite library. The
|
||||
# focus of this script is testing the FTS3 module.
|
||||
#
|
||||
# $Id: fts3aa.test,v 1.1 2007/08/20 17:38:42 shess Exp $
|
||||
#
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
@@ -54,6 +52,16 @@ do_execsql_test 1.3 {
|
||||
SELECT 42+matchinfo(t1,'yxyyxy') FROM t1 WHERE t1 MATCH x'2b0a312b0a312a312a2a0b5d0a0b0b0a312a0a0b0b0a312a0b310a392a0b0a27312a2a0b5d0a312a0b310a31315d0b310a312a316d2a0b313b15bceaa50a312a0b0a27312a2a0b5d0a312a0b310a312b0b2a310a312a0b2a0b2a0b2e5d0a0bff313336e34a2a312a0b0a3c310b0a0b4b4b0b4b2a4bec40322b2a0b310a0a312a0a0a0a0a0a0a0a0a0b310a312a2a2a0b5d0a0b0b0a312a0b310a312a0b0a4e4541530b310a5df5ced70a0a0a0a0a4f520a0a0a0a0a0a0a312a0b0a4e4541520b310a5d616161610a0a0a0a4f520a0a0a0a0a0a312b0a312a312a0a0a0a0a0a0a004a0b0a310b220a0b0a310a4a22310a0b0a7e6fe0e0e030e0e0e0e0e01176e02000e0e0e0e0e01131320226310a0b0a310a4a22310a0b0a310a766f8b8b4ee0e0300ae0090909090909090909090909090909090909090909090909090909090909090947aaaa540b09090909090909090909090909090909090909090909090909090909090909fae0e0f2f22164e0e0f273e07fefefef7d6dfafafafa6d6d6d6d';
|
||||
} {42}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
reset_db
|
||||
do_execsql_test 2.0 {
|
||||
CREATE VIRTUAL TABLE t0 USING fts3(a);
|
||||
INSERT INTO t0_segdir VALUES(0,0,0,0,'0 42',X'000131030782000103323334050100fff200010461616161050101020200000462626262050101030200');
|
||||
}
|
||||
do_execsql_test 2.1 {
|
||||
SELECT count(*) FROM t0 WHERE t0 MATCH '(1 NEAR 1) AND (aaaa OR 1)';
|
||||
} 1
|
||||
|
||||
set sqlite_fts3_enable_parentheses $saved_sqlite_fts3_enable_parentheses
|
||||
finish_test
|
||||
|
||||
|
||||
+16
-11
@@ -735,7 +735,7 @@ static int progress_handler(void *pClientData) {
|
||||
** "PRAGMA parser_trace" since they can dramatically increase the
|
||||
** amount of output without actually testing anything useful.
|
||||
**
|
||||
** Also block ATTACH and DETACH
|
||||
** Also block ATTACH if attaching a file from the filesystem.
|
||||
*/
|
||||
static int block_troublesome_sql(
|
||||
void *Notused,
|
||||
@@ -750,18 +750,21 @@ static int block_troublesome_sql(
|
||||
(void)zArg3;
|
||||
(void)zArg4;
|
||||
if( eCode==SQLITE_PRAGMA ){
|
||||
if( sqlite3_strnicmp("vdbe_", zArg1, 5)==0
|
||||
|| sqlite3_stricmp("parser_trace", zArg1)==0
|
||||
|| sqlite3_stricmp("temp_store_directory", zArg1)==0
|
||||
){
|
||||
return SQLITE_DENY;
|
||||
}
|
||||
if( sqlite3_stricmp("oom",zArg1)==0 && zArg2!=0 && zArg2[0]!=0 ){
|
||||
if( eVerbosity==0 ){
|
||||
if( sqlite3_strnicmp("vdbe_", zArg1, 5)==0
|
||||
|| sqlite3_stricmp("parser_trace", zArg1)==0
|
||||
|| sqlite3_stricmp("temp_store_directory", zArg1)==0
|
||||
){
|
||||
return SQLITE_DENY;
|
||||
}
|
||||
}else if( sqlite3_stricmp("oom",zArg1)==0
|
||||
&& zArg2!=0 && zArg2[0]!=0 ){
|
||||
oomCounter = atoi(zArg2);
|
||||
}
|
||||
}else if( (eCode==SQLITE_ATTACH || eCode==SQLITE_DETACH)
|
||||
&& zArg1 && zArg1[0] ){
|
||||
return SQLITE_DENY;
|
||||
}else if( eCode==SQLITE_ATTACH ){
|
||||
if( zArg1==0 || (zArg1[0]!=0 && strcmp(zArg1,":memory:")!=0) ){
|
||||
return SQLITE_DENY;
|
||||
}
|
||||
}
|
||||
return SQLITE_OK;
|
||||
}
|
||||
@@ -1989,6 +1992,8 @@ int main(int argc, char **argv){
|
||||
sqlite3_limit(db, SQLITE_LIMIT_LIKE_PATTERN_LENGTH, 50);
|
||||
if( cellSzCkFlag ) runSql(db, "PRAGMA cell_size_check=ON", runFlags);
|
||||
setAlarm((iTimeout+999)/1000);
|
||||
/* Enable test functions */
|
||||
sqlite3_test_control(SQLITE_TESTCTRL_INTERNAL_FUNCTIONS, db);
|
||||
#ifndef SQLITE_OMIT_PROGRESS_CALLBACK
|
||||
if( sqlFuzz || vdbeLimitFlag ){
|
||||
sqlite3_progress_handler(db, 100000, progressHandler,
|
||||
|
||||
Binary file not shown.
+3
-3
@@ -90,9 +90,9 @@ do_test indexedby-2.4 {
|
||||
catchsql { SELECT * FROM t1 INDEXED BY i3 WHERE a = 'one' AND b = 'two'}
|
||||
} {1 {no such index: i3}}
|
||||
|
||||
# EVIDENCE-OF: R-62112-42456 If the query optimizer is unable to use the
|
||||
# index specified by the INDEX BY clause, then the query will fail with
|
||||
# an error.
|
||||
# EVIDENCE-OF: R-05301-32681 If the query optimizer is unable to use the
|
||||
# index specified by the INDEXED BY clause, then the query will fail
|
||||
# with an error.
|
||||
do_test indexedby-2.4.1 {
|
||||
catchsql { SELECT b FROM t1 INDEXED BY i1 WHERE b = 'two' }
|
||||
} {0 {}}
|
||||
|
||||
@@ -641,5 +641,28 @@ do_execsql_test limit-14.7 {
|
||||
SELECT 123 LIMIT -1 OFFSET 1
|
||||
} {}
|
||||
|
||||
# 2021-03-05 dbsqlfuzz crash-d811039c9f44f2d43199d5889fcf4085ef6221b9
|
||||
#
|
||||
reset_db
|
||||
do_execsql_test limit-15.1 {
|
||||
CREATE TABLE t1(a PRIMARY KEY, b TEXT);
|
||||
CREATE TABLE t4(c PRIMARY KEY, d);
|
||||
CREATE TABLE t5(e PRIMARY KEY, f);
|
||||
CREATE TABLE t6(g, h);
|
||||
CREATE TABLE t3_a(k, v);
|
||||
CREATE TABLE t3_b(k, v);
|
||||
CREATE VIEW t3 AS SELECT * FROM t3_a UNION ALL SELECT * FROM t3_b;
|
||||
INSERT INTO t5(e,f) VALUES(500000,'orange');
|
||||
INSERT INTO t4(c,d) VALUES(300000,'blue'),(400,'green'),(8000,'grey');
|
||||
INSERT INTO t1(a,b) VALUES(300000,'purple');
|
||||
INSERT INTO t3_a VALUES(300000,'yellow'),(500,'pink'),(8000,'red');
|
||||
INSERT INTO t6 default values;
|
||||
SELECT (
|
||||
SELECT 100000 FROM
|
||||
(SELECT 200000 FROM t6 WHERE a = ( SELECT 300000 FROM t3 WHERE a ) ),
|
||||
(SELECT 400000 FROM t5 WHERE e=500000),
|
||||
(SELECT 600000 FROM t4 WHERE c=a)
|
||||
) FROM t1;
|
||||
} {100000}
|
||||
|
||||
finish_test
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
# 2021 February 15
|
||||
#
|
||||
# The author disclaims copyright to this source code. In place of
|
||||
# a legal notice, here is a blessing:
|
||||
#
|
||||
# May you do good and not evil.
|
||||
# May you find forgiveness for yourself and forgive others.
|
||||
# May you share freely, never taking more than you give.
|
||||
#
|
||||
#***********************************************************************
|
||||
# This file implements regression tests for SQLite library. The
|
||||
# focus of this file is testing optimizations associated with "IS NULL"
|
||||
# and "IS NOT NULL" operators on columns with NOT NULL constraints.
|
||||
#
|
||||
|
||||
set testdir [file dirname $argv0]
|
||||
source $testdir/tester.tcl
|
||||
set testprefix notnullfault
|
||||
|
||||
do_execsql_test 1.0 {
|
||||
CREATE TABLE t1(a, b);
|
||||
CREATE TABLE t2(c, d NOT NULL);
|
||||
}
|
||||
faultsim_save_and_close
|
||||
|
||||
do_faultsim_test 1 -prep {
|
||||
faultsim_restore_and_reopen
|
||||
} -body {
|
||||
execsql {
|
||||
SELECT * FROM t2 WHERE d NOT NULL
|
||||
}
|
||||
} -test {
|
||||
faultsim_test_result {0 {}}
|
||||
}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
reset_db
|
||||
do_execsql_test 2.0 {
|
||||
CREATE TABLE t1(a, b, c);
|
||||
CREATE TABLE t2(a, b, c, PRIMARY KEY(a, b, c)) WITHOUT ROWID;
|
||||
}
|
||||
faultsim_save_and_close
|
||||
|
||||
do_faultsim_test 2.1 -faults oom-t* -prep {
|
||||
faultsim_restore_and_reopen
|
||||
} -body {
|
||||
execsql {
|
||||
SELECT dense_rank() OVER win FROM t2
|
||||
WINDOW win AS (ORDER BY c IS NULL)
|
||||
}
|
||||
} -test {
|
||||
faultsim_test_result {0 {}}
|
||||
}
|
||||
|
||||
finish_test
|
||||
|
||||
+14
-4
@@ -989,7 +989,7 @@ test_suite "journaltest" -description {
|
||||
pager1.test syscall.test tkt3457.test *malloc* mmap* multiplex* nolock*
|
||||
pager2.test *fault* rowal* snapshot* superlock* symlink.test
|
||||
delete_db.test shmlock.test chunksize.test
|
||||
busy2.test
|
||||
busy2.test avfs.test
|
||||
}]
|
||||
|
||||
if {[info commands register_demovfs] != ""} {
|
||||
@@ -1062,7 +1062,8 @@ test_suite "no_optimization" -description {
|
||||
where6.test where7.test where8.test where9.test \
|
||||
whereA.test whereB.test wherelimit.test \
|
||||
select1.test select2.test select3.test select4.test select5.test \
|
||||
select7.test select8.test selectA.test selectC.test
|
||||
select7.test select8.test selectA.test selectC.test \
|
||||
-exclude windowpushd.test
|
||||
] -dbconfig {
|
||||
optimization_control $::dbhandle all 0
|
||||
}
|
||||
@@ -1137,11 +1138,20 @@ proc run_tests {name args} {
|
||||
set ::G(perm:presql) $options(-presql)
|
||||
|
||||
foreach file [lsort $options(-files)] {
|
||||
uplevel $options(-initialize)
|
||||
if {[file tail $file] == $file} { set file [file join $::testdir $file] }
|
||||
|
||||
if {[info exists ::env(SQLITE_TEST_PATTERN_LIST)]} {
|
||||
set ok 0
|
||||
foreach p $::env(SQLITE_TEST_PATTERN_LIST) {
|
||||
set p [string map {% *} $p]
|
||||
if {[string match $p [file tail $file]]} {set ok 1 ; break}
|
||||
}
|
||||
if {!$ok} continue
|
||||
}
|
||||
|
||||
uplevel $options(-initialize)
|
||||
slave_test_file $file
|
||||
uplevel $options(-shutdown)
|
||||
|
||||
unset -nocomplain ::G(perm:sqlite3_args)
|
||||
}
|
||||
|
||||
|
||||
+42
-3
@@ -110,7 +110,7 @@ do_execsql_test 2.2 {
|
||||
PRAGMA writable_schema = 1;
|
||||
CREATE TABLE xyz(a, b, c CHECK (c!="null") );
|
||||
CREATE INDEX i2 ON t1(x, y, z||"abc");
|
||||
CREATE INDEX i3 ON t1("w");
|
||||
CREATE INDEX i3 ON t1("w"||"");
|
||||
CREATE INDEX i4 ON t1(x) WHERE z="w";
|
||||
}
|
||||
|
||||
@@ -135,10 +135,49 @@ do_execsql_test 2.5 {
|
||||
{CREATE TABLE t1(x, y, z)}
|
||||
{CREATE TABLE xyz(a, b, c CHECK (c!="null") )}
|
||||
{CREATE INDEX i2 ON t1(x, y, z||"abc")}
|
||||
{CREATE INDEX i3 ON t1("w")}
|
||||
{CREATE INDEX i3 ON t1("w"||"")}
|
||||
{CREATE INDEX i4 ON t1(x) WHERE z="w"}
|
||||
}
|
||||
|
||||
|
||||
# 2021-03-13
|
||||
# ticket 1c24a659e6d7f3a1
|
||||
reset_db
|
||||
do_catchsql_test 3.0 {
|
||||
CREATE TABLE t1(a,b);
|
||||
CREATE INDEX x1 on t1("b");
|
||||
ALTER TABLE t1 DROP COLUMN b;
|
||||
} {1 {error in index x1 after drop column: no such column: b}}
|
||||
do_catchsql_test 3.1 {
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(a,"b");
|
||||
CREATE INDEX x1 on t1("b");
|
||||
ALTER TABLE t1 DROP COLUMN b;
|
||||
} {1 {error in index x1 after drop column: no such column: b}}
|
||||
do_catchsql_test 3.2 {
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(a,'b');
|
||||
CREATE INDEX x1 on t1("b");
|
||||
ALTER TABLE t1 DROP COLUMN b;
|
||||
} {1 {error in index x1 after drop column: no such column: b}}
|
||||
do_catchsql_test 3.3 {
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(a,"b");
|
||||
CREATE INDEX x1 on t1('b');
|
||||
ALTER TABLE t1 DROP COLUMN b;
|
||||
} {1 {error in index x1 after drop column: no such column: b}}
|
||||
do_catchsql_test 3.4 {
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(a, b, c);
|
||||
CREATE INDEX x1 ON t1("a"||"b");
|
||||
INSERT INTO t1 VALUES(1,2,3),(1,4,5);
|
||||
ALTER TABLE t1 DROP COLUMN b;
|
||||
} {1 {error in index x1 after drop column: no such column: b}}
|
||||
do_catchsql_test 3.5 {
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1(a, b, c);
|
||||
CREATE INDEX x1 ON t1("a"||"x");
|
||||
INSERT INTO t1 VALUES(1,2,3),(1,4,5);
|
||||
ALTER TABLE t1 DROP COLUMN b;
|
||||
} {0 {}}
|
||||
|
||||
finish_test
|
||||
|
||||
@@ -283,7 +283,7 @@ array set ::Configs [strip_comments {
|
||||
FuzzFail2 {-O0}
|
||||
}]
|
||||
if {$tcl_platform(os)=="Darwin"} {
|
||||
lappend Configs(Apple -DSQLITE_ENABLE_LOCKING_STYLE=1
|
||||
lappend Configs(Apple) -DSQLITE_ENABLE_LOCKING_STYLE=1
|
||||
}
|
||||
|
||||
array set ::Platforms [strip_comments {
|
||||
@@ -302,7 +302,7 @@ array set ::Platforms [strip_comments {
|
||||
"No-lookaside" test
|
||||
"Devkit" test
|
||||
"Apple" test
|
||||
"Sanitize" {QUICKTEST_OMIT=crash*,shell*,sqldiff*,sessionB.test test}
|
||||
"Sanitize" test
|
||||
"Device-One" fulltest
|
||||
"Default" "threadtest fulltest"
|
||||
"Valgrind*" valgrindtest
|
||||
@@ -355,6 +355,14 @@ array set ::Platforms [strip_comments {
|
||||
}
|
||||
}]
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
#--------------------------------------------------------------------------
|
||||
#--------------------------------------------------------------------------
|
||||
# End of configuration section.
|
||||
#--------------------------------------------------------------------------
|
||||
#--------------------------------------------------------------------------
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
# Configuration verification: Check that each entry in the list of configs
|
||||
# specified for each platforms exists.
|
||||
#
|
||||
|
||||
@@ -83,5 +83,106 @@ do_execsql_test 4.5 {
|
||||
RETURNING *, '|';
|
||||
} {2 3 4 | 4 100 6 | 5 6 7 |}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# Test RETURNING on a table with virtual columns.
|
||||
#
|
||||
reset_db
|
||||
do_execsql_test 5.0 {
|
||||
CREATE TABLE t1(xyz);
|
||||
CREATE TABLE t2(a as (1+1), b);
|
||||
}
|
||||
|
||||
do_execsql_test 5.1 {
|
||||
UPDATE t2 SET b='123' WHERE b='abc' RETURNING (SELECT b FROM t1);
|
||||
} {}
|
||||
|
||||
do_execsql_test 5.2 {
|
||||
INSERT INTO t2(b) VALUES('abc');
|
||||
}
|
||||
|
||||
do_execsql_test 5.3 {
|
||||
UPDATE t2 SET b='123' WHERE b='abc' RETURNING (SELECT b FROM t1);
|
||||
} {{}}
|
||||
|
||||
do_execsql_test 5.4 {
|
||||
INSERT INTO t2(b) VALUES('abc');
|
||||
INSERT INTO t1(xyz) VALUES(1);
|
||||
UPDATE t2 SET b='123' WHERE b='abc' RETURNING b;
|
||||
} {123}
|
||||
|
||||
do_execsql_test 5.5 {
|
||||
INSERT INTO t2(b) VALUES('abc');
|
||||
UPDATE t2 SET b='123' WHERE b='abc' RETURNING (SELECT b FROM t1);
|
||||
} {123}
|
||||
|
||||
# Ticket 132994c8b1063bfb
|
||||
reset_db
|
||||
do_catchsql_test 6.0 {
|
||||
CREATE TABLE t1(id INTEGER PRIMARY KEY);
|
||||
CREATE TABLE t2(x INT, y INT);
|
||||
INSERT INTO t1 VALUES(1),(2),(4),(9);
|
||||
INSERT INTO t2 VALUES(3,7), (4,25), (5,99);
|
||||
UPDATE t1 SET id=id+y FROM t2 WHERE t1.id=t2.x RETURNING t2.*;
|
||||
} {1 {RETURNING may not use "TABLE.*" wildcards}}
|
||||
do_catchsql_test 6.1 {
|
||||
UPDATE t1 SET id=id+y FROM t2 WHERE t1.id=t2.x RETURNING *, '|';
|
||||
SELECT * FROM t1 ORDER BY id;
|
||||
} {0 {29 | 1 2 9 29}}
|
||||
|
||||
# Forum https://sqlite.org/forum/forumpost/85aef8bc01
|
||||
# Do not silently ignore nonsense table names in the RETURNING clause.
|
||||
# Raise an error.
|
||||
#
|
||||
reset_db
|
||||
do_execsql_test 7.1 {
|
||||
CREATE TABLE t1(a INT, b INT);
|
||||
CREATE TABLE t2(x INT, y INT);
|
||||
INSERT INTO t1(a,b) VALUES(1,2);
|
||||
INSERT INTO t2(x,y) VALUES(1,30);
|
||||
} {}
|
||||
do_catchsql_test 7.2 {
|
||||
UPDATE t1 SET b=b+1 RETURNING new.b;
|
||||
} {1 {no such column: new.b}}
|
||||
do_catchsql_test 7.3 {
|
||||
UPDATE t1 SET b=b+1 RETURNING old.b;
|
||||
} {1 {no such column: old.b}}
|
||||
do_catchsql_test 7.4 {
|
||||
UPDATE t1 SET b=b+1 RETURNING another.b;
|
||||
} {1 {no such column: another.b}}
|
||||
do_catchsql_test 7.5 {
|
||||
UPDATE t1 SET b=b+y FROM t2 WHERE t2.x=t1.a RETURNING t2.x;
|
||||
} {1 {no such column: t2.x}}
|
||||
do_catchsql_test 7.6 {
|
||||
UPDATE t1 SET b=b+y FROM t2 WHERE t2.x=t1.a RETURNING t1.b;
|
||||
} {0 32}
|
||||
|
||||
# This is goofy: The RETURNING clause does not honor the alias
|
||||
# for the table being modified. This might change in the future.
|
||||
#
|
||||
do_catchsql_test 7.7 {
|
||||
UPDATE t1 AS alias SET b=123 RETURNING alias.b;
|
||||
} {1 {no such column: alias.b}}
|
||||
do_catchsql_test 7.8 {
|
||||
UPDATE t1 AS alias SET b=alias.b+1000 RETURNING t1.b;
|
||||
} {0 1032}
|
||||
|
||||
# Forum: https://sqlite.org/forum/info/34c81d83c9177f46
|
||||
reset_db
|
||||
do_execsql_test 8.1 {
|
||||
CREATE TABLE t1(a);
|
||||
CREATE TABLE t2(b,c);
|
||||
INSERT INTO t1 VALUES(1);
|
||||
INSERT INTO t2 VALUES(3,40);
|
||||
} {}
|
||||
do_catchsql_test 8.2 {
|
||||
INSERT INTO t1 VALUES(3) RETURNING a, (SELECT c FROM t2 WHERE new.a=t2.b) AS x;
|
||||
} {1 {no such column: new.a}}
|
||||
do_catchsql_test 8.3 {
|
||||
INSERT INTO t1 VALUES(3) RETURNING a, (SELECT c FROM t2 WHERE old.a=t2.b) AS x;
|
||||
} {1 {no such column: old.a}}
|
||||
do_catchsql_test 8.4 {
|
||||
INSERT INTO t1 VALUES(3) RETURNING a, (SELECT c FROM t2 WHERE t1.a=t2.b) AS x;
|
||||
} {0 {3 40}}
|
||||
|
||||
finish_test
|
||||
|
||||
|
||||
@@ -657,4 +657,10 @@ do_catchsql_test 28.10 {
|
||||
DELETE FROM t0;
|
||||
} {1 {sub-select returns 2 columns - expected 1}}
|
||||
|
||||
# 2021-03-19
|
||||
# dbsqlfuzz find of a NEVER().
|
||||
do_catchsql_test 29.1 {
|
||||
SELECT (SELECT 1 WHERE ((SELECT 1 WHERE (2,(2,0)) IS (2,(20))),(2,0)) IS (2,(20))) WHERE (2,(2,0)) IS (2 IN(SELECT 1 WHERE (2,(2,2,0)) IS (2,(20))),(20));
|
||||
} {1 {row value misused}}
|
||||
|
||||
finish_test
|
||||
|
||||
@@ -1025,5 +1025,19 @@ do_execsql_test select4-18.3 {
|
||||
WHERE abs(z1.aa)=z2.aa AND z1.aa=123;
|
||||
} {123}
|
||||
|
||||
# 2021-03-31 Fix an assert() problem in the logic at the end of sqlite3Select()
|
||||
# that validates AggInfo. The checks to ensure that AggInfo.aCol[].pCExpr
|
||||
# references a valid expression was looking at an expression that had been
|
||||
# deleted by the truth optimization in sqlite3ExprAnd() which was invoked by
|
||||
# the push-down optimization. This is harmless in delivery builds, as that code
|
||||
# only runs with SQLITE_DEBUG. But it should still be fixed. The problem
|
||||
# was discovered by dbsqlfuzz (crash-dece7b67a3552ed7e571a7bda903afd1f7bd9b21)
|
||||
#
|
||||
reset_db
|
||||
do_execsql_test select4-19.1 {
|
||||
CREATE TABLE t1(x);
|
||||
INSERT INTO t1 VALUES(99);
|
||||
SELECT sum((SELECT 1 FROM (SELECT 2 WHERE x IS NULL) WHERE 0)) FROM t1;
|
||||
} {{}}
|
||||
|
||||
finish_test
|
||||
|
||||
@@ -394,4 +394,18 @@ foreach {tn sql} {
|
||||
|
||||
}
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
reset_db
|
||||
do_execsql_test 2.0 {
|
||||
CREATE TABLE t2(a, b, c REAL, d, e, PRIMARY KEY(a,b)) WITHOUT ROWID;
|
||||
CREATE UNIQUE INDEX t2c ON t2(c);
|
||||
}
|
||||
|
||||
do_catchsql_test 2.1 {
|
||||
INSERT INTO t2(a,b,c,e,d) VALUES(1,2,3,4,5)
|
||||
ON CONFLICT(c) DO UPDATE SET b=''
|
||||
ON CONFLICT((SELECT t2 FROM nosuchtable)) DO NOTHING;
|
||||
|
||||
} {1 {no such table: nosuchtable}}
|
||||
|
||||
finish_test
|
||||
|
||||
+6
-1
@@ -44,12 +44,17 @@ do_test view-1.1.100 {
|
||||
SELECT * FROM v1 ORDER BY a;
|
||||
}
|
||||
} {1 {access to view "v1" prohibited}}
|
||||
do_execsql_test view-1.1.101 {
|
||||
CREATE TEMP VIEW v1temp AS SELECT a, b FROM t1;
|
||||
SELECT * FROM v1temp ORDER BY a;
|
||||
} {1 2 4 5 7 8}
|
||||
do_test view-1.1.110 {
|
||||
db config enable_view on
|
||||
catchsql {
|
||||
SELECT * FROM v1 ORDER BY a;
|
||||
SELECT * FROM v1temp ORDER BY a;
|
||||
}
|
||||
} {0 {1 2 4 5 7 8}}
|
||||
} {0 {1 2 4 5 7 8 1 2 4 5 7 8}}
|
||||
do_test view-1.2 {
|
||||
catchsql {
|
||||
ROLLBACK;
|
||||
|
||||
@@ -1515,5 +1515,36 @@ foreach mode {OFF MEMORY PERSIST DELETE TRUNCATE WAL} {
|
||||
db close
|
||||
}
|
||||
|
||||
# 2021-03-10 forum post https://sqlite.org/forum/forumpost/a006d86f72
|
||||
#
|
||||
file delete test.db
|
||||
sqlite3 db test.db
|
||||
db eval {PRAGMA journal_mode=WAL}
|
||||
for {set i 0} {$i<$SQLITE_MAX_ATTACHED} {incr i} {
|
||||
do_test wal-26.1.$i {
|
||||
file delete attached-$i.db
|
||||
db eval "ATTACH 'attached-$i.db' AS a$i;"
|
||||
db eval "PRAGMA a$i.journal_mode=WAL;"
|
||||
db eval "CREATE TABLE a$i.t$i (x);"
|
||||
db eval "INSERT INTO t$i VALUES(zeroblob(10000));"
|
||||
db eval "DELETE FROM t$i;"
|
||||
db eval "INSERT INTO t$i VALUES(randomblob(10000));"
|
||||
expr {[file size attached-$i.db-wal]>10000}
|
||||
} {1}
|
||||
}
|
||||
for {set i [expr {$SQLITE_MAX_ATTACHED-1}]} {$i>=0} {incr i -1} {
|
||||
do_test wal-26.2.$i {
|
||||
db eval "PRAGMA a$i.wal_checkpoint(TRUNCATE);"
|
||||
file size attached-$i.db-wal
|
||||
} {0}
|
||||
for {set j 0} {$j<$i} {incr j} {
|
||||
do_test wal-26.2.$i.$j {
|
||||
expr {[file size attached-$j.db-wal]>10000}
|
||||
} {1}
|
||||
}
|
||||
}
|
||||
db close
|
||||
|
||||
|
||||
test_restore_config_pagecache
|
||||
finish_test
|
||||
|
||||
@@ -237,8 +237,8 @@ ifcapable {update_delete_limit} {
|
||||
} {11}
|
||||
create_test_data 6
|
||||
do_test wherelimit-3.2 {
|
||||
execsql {UPDATE t1 SET y=1 WHERE x=1 RETURNING x, old.y, '|' LIMIT 5}
|
||||
} {1 1 | 1 2 | 1 3 | 1 4 | 1 5 |}
|
||||
execsql {UPDATE t1 SET y=1 WHERE x=1 RETURNING x, y, '|' LIMIT 5}
|
||||
} {1 1 | 1 1 | 1 1 | 1 1 | 1 1 |}
|
||||
do_test wherelimit-3.2cnt {
|
||||
execsql {SELECT count(*) FROM t1 WHERE y=1}
|
||||
} {10}
|
||||
|
||||
@@ -265,4 +265,21 @@ do_execsql_test 8.4 {
|
||||
FROM v1;
|
||||
} {0.0 0.0}
|
||||
|
||||
#--------------------------------------------------------------------------
|
||||
reset_db
|
||||
do_execsql_test 9.0 {
|
||||
CREATE TABLE t1(a, b, c);
|
||||
INSERT INTO t1 VALUES(NULL,'bb',356);
|
||||
INSERT INTO t1 VALUES('CB','aa',158);
|
||||
INSERT INTO t1 VALUES('BB','aa',399);
|
||||
INSERT INTO t1 VALUES('FF','bb',938);
|
||||
}
|
||||
|
||||
do_catchsql_test 9.1 {
|
||||
SELECT sum(c) OVER (
|
||||
ORDER BY c RANGE BETWEEN 0 PRECEDING AND '-700' PRECEDING
|
||||
)
|
||||
FROM t1
|
||||
} {1 {frame ending offset must be a non-negative number}}
|
||||
|
||||
finish_test
|
||||
|
||||
@@ -336,4 +336,25 @@ do_execsql_test 7.4 {
|
||||
) FROM t1;
|
||||
} {{} 45 {} 45 7 {} 7 {} 8 {} 8 {} abc 1001 abc 1001 xyz 3333}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
reset_db
|
||||
do_execsql_test 8.0 {
|
||||
BEGIN TRANSACTION;
|
||||
CREATE TABLE t1(a, c);
|
||||
INSERT INTO t1 VALUES('aa', 111);
|
||||
INSERT INTO t1 VALUES('BB', 660);
|
||||
INSERT INTO t1 VALUES('CC', 938);
|
||||
INSERT INTO t1 VALUES('dd', 979);
|
||||
COMMIT;
|
||||
|
||||
CREATE INDEX i1 ON t1(a COLLATE nocase);
|
||||
}
|
||||
|
||||
do_execsql_test 8.1 {
|
||||
SELECT sum(c) OVER
|
||||
(ORDER BY a COLLATE nocase RANGE BETWEEN 10.0 PRECEDING AND 5.0 PRECEDING)
|
||||
FROM t1;
|
||||
} {111 660 938 979}
|
||||
|
||||
|
||||
finish_test
|
||||
|
||||
+134
@@ -414,5 +414,139 @@ do_execsql_test 8.3 {
|
||||
SELECT * FROM q;
|
||||
} {1 2 3 4 5}
|
||||
|
||||
# 2021-03-18
|
||||
# Ticket bb8a9fd4a9b7fce5
|
||||
reset_db
|
||||
do_execsql_test 9.1 {
|
||||
WITH xyz(a) AS (
|
||||
WITH abc AS ( SELECT 1234 ) SELECT * FROM abc
|
||||
)
|
||||
SELECT * FROM xyz AS one, xyz AS two, (
|
||||
SELECT * FROM xyz UNION ALL SELECT * FROM xyz
|
||||
);
|
||||
} {1234 1234 1234 1234 1234 1234}
|
||||
ifcapable vtab {
|
||||
load_static_extension db series
|
||||
do_execsql_test 9.2 {
|
||||
WITH
|
||||
cst(rsx, rsy) AS (
|
||||
SELECT 100, 100
|
||||
),
|
||||
cst2(minx, maxx, stepx, miny, maxy, stepy, qualitativex, qualitativey) AS (
|
||||
SELECT NULL, NULL, NULL, NULL, NULL, NULL, 0, 0
|
||||
),
|
||||
ds0(m, n, x, y, x2, y2, title, size, mark, label, markmode) AS (
|
||||
SELECT 1, 2, 3, 4, 5, 6, 7 , 8, 9, 10, 11
|
||||
),
|
||||
ds(m, n, x, y, x2, y2, title, size, mark, label, markmode) AS (
|
||||
SELECT m, n, x,
|
||||
y, x2,
|
||||
y2,
|
||||
title, size, mark, label, markmode
|
||||
FROM ds0
|
||||
WINDOW w AS (PARTITION BY m, x ORDER BY n)
|
||||
),
|
||||
d(m, n, x, y, x2, y2, labelx,labely,title,size,mark,label,markmode) AS (
|
||||
SELECT m, n, x, y, x2, y2, x, y, title, size, mark, label, markmode
|
||||
FROM ds, cst2
|
||||
),
|
||||
ylabels(y, label) AS (
|
||||
SELECT y, MIN(labely) FROM d GROUP BY y
|
||||
),
|
||||
yaxis(maxy, miny, stepy , minstepy) AS (
|
||||
WITH
|
||||
xt0(minx, maxx) AS (
|
||||
SELECT coalesce(miny, min(min(y2),
|
||||
min(y))), coalesce(maxy, max(max(y2),
|
||||
max(y))) + qualitativey
|
||||
FROM d, cst2
|
||||
),
|
||||
xt1(mx, mn) AS (SELECT maxx, minx FROM xt0),
|
||||
xt2(mx, mn, step) AS (SELECT mx, mn, (mx-mn) FROM xt1),
|
||||
|
||||
xt3(mx, mn, ms) AS (
|
||||
SELECT mx, mn, first_value(rs) OVER (order by x desc) AS ms
|
||||
FROM (SELECT mx, mn, step, f,(mx-mn) as rng,
|
||||
1.0*step/f as rs, 1.0*(mx-mn)/(step/f) AS x
|
||||
FROM xt2, (SELECT 1 AS f UNION ALL SELECT 2
|
||||
UNION ALL SELECT 4
|
||||
UNION ALL SELECT 5)) AS src
|
||||
WHERE x < 10 limit 1),
|
||||
xt4(minstepy) AS (
|
||||
SELECT MIN(abs(y2-y)) FROM d WHERE y2 != y
|
||||
)
|
||||
SELECT (mx/ms)*ms, (mn/ms)*ms, coalesce(stepy, ms),
|
||||
coalesce(minstepy, ms, stepy) FROM xt3, cst2,xt4
|
||||
),
|
||||
distinct_mark_n_m(mark, ze, zem, title) AS (
|
||||
SELECT DISTINCT mark, n AS ze, m AS zem, title FROM ds0
|
||||
),
|
||||
facet0(m, mi, title, radial) AS (
|
||||
SELECT md, row_number() OVER () - 1, title, 'radial'
|
||||
IN (SELECT mark FROM distinct_mark_n_m WHERE zem = md)
|
||||
FROM (SELECT DISTINCT zem AS md, title AS title
|
||||
FROM distinct_mark_n_m ORDER BY 2, 1)
|
||||
),
|
||||
facet(m, mi, xorigin, yorigin, title, radial) AS (
|
||||
SELECT m, mi,
|
||||
rsx * 1.2 * IFNULL(CASE WHEN (
|
||||
0
|
||||
) > 0 THEN mi / (
|
||||
0
|
||||
) ELSE mi % (
|
||||
2
|
||||
) END, mi),
|
||||
rsy * 1.2 * IFNULL(CASE WHEN (
|
||||
2
|
||||
) > 0 THEN mi / (
|
||||
2
|
||||
) ELSE mi / (
|
||||
0
|
||||
) END, 0),
|
||||
title, radial FROM facet0, cst
|
||||
),
|
||||
radygrid(m, mi, tty, wty, ttx, ttx2, xorigin, yorigin) AS (
|
||||
SELECT m, mi, rsy / 2 / ((maxy-miny)/stepy) * (value-1) AS tty,
|
||||
coalesce(NULL, miny + stepy * (value-1)) AS wty,
|
||||
xorigin, xorigin+rsx, xorigin + rsx / 2,
|
||||
yorigin + rsy / 2
|
||||
FROM generate_series(1), yaxis, cst,
|
||||
facet LEFT JOIN ylabels ON ylabels.y = (miny + (value-1) * stepy)
|
||||
WHERE radial AND stop = 1+1.0*(maxy-miny)/stepy
|
||||
),
|
||||
ypos(m, mi, pcx, pcy, radial) AS (
|
||||
SELECT m, mi, xorigin, yorigin + CASE
|
||||
WHEN 0 BETWEEN miny AND maxy THEN
|
||||
rsy - (0 - miny) * rsy / (maxy-miny)
|
||||
WHEN 0 >= maxy THEN 0
|
||||
ELSE rsy
|
||||
END, radial FROM yaxis, cst, facet WHERE NOT radial
|
||||
UNION ALL
|
||||
SELECT m, mi, xorigin + rsx / 2, yorigin + (CASE
|
||||
WHEN 0 BETWEEN miny AND maxy THEN
|
||||
rsy - (0 - miny) * rsy / 2 / (maxy-miny)
|
||||
WHEN 0 >= maxy THEN 0
|
||||
ELSE rsy
|
||||
END ) / 2, radial FROM yaxis, cst, facet WHERE radial
|
||||
)
|
||||
SELECT * FROM radygrid , ypos;
|
||||
} {}
|
||||
} ;# end ifcapable vtab
|
||||
|
||||
# 2021-03-19
|
||||
# dbsqlfuzz 01b8355086998f0a452cb31208e80b9d29ca739a
|
||||
#
|
||||
# Correlated CTEs should not be materialized.
|
||||
#
|
||||
reset_db
|
||||
do_execsql_test 10.1 {
|
||||
SELECT 1 AS c WHERE (
|
||||
SELECT (
|
||||
WITH t1(a) AS (VALUES( c ))
|
||||
SELECT ( SELECT t1a.a FROM t1 AS t1a, t1 AS t1x )
|
||||
FROM t1 AS xyz GROUP BY 1
|
||||
)
|
||||
)
|
||||
} {1}
|
||||
|
||||
finish_test
|
||||
|
||||
@@ -224,6 +224,23 @@ do_execsql_test 5.2 {
|
||||
ORDER BY 1;
|
||||
} {0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111}
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# At one point this would incorrectly report "circular reference: cte1"
|
||||
#
|
||||
do_catchsql_test 6.0 {
|
||||
with
|
||||
cte1(x, y) AS ( select 1, 2, 3 ),
|
||||
cte2(z) as ( select 1 from cte1 )
|
||||
select * from cte2, cte1;
|
||||
} {1 {table cte1 has 3 values for 2 columns}}
|
||||
|
||||
do_catchsql_test 6.1 {
|
||||
with
|
||||
cte1(x, y) AS ( select 1, 2, 3 ),
|
||||
cte2(z) as ( select 1 from cte1 UNION ALL SELECT z+1 FROM cte2 WHERE z<5)
|
||||
select * from cte2, cte1;
|
||||
} {1 {table cte1 has 3 values for 2 columns}}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
+11
-3
@@ -1712,20 +1712,28 @@ end_changeset_one_table:
|
||||
strFree(&sql);
|
||||
}
|
||||
|
||||
/*
|
||||
** Return true if the ascii character passed as the only argument is a
|
||||
** whitespace character. Otherwise return false.
|
||||
*/
|
||||
static int is_whitespace(char x){
|
||||
return (x==' ' || x=='\t' || x=='\n' || x=='\r');
|
||||
}
|
||||
|
||||
/*
|
||||
** Extract the next SQL keyword or quoted string from buffer zIn and copy it
|
||||
** (or a prefix of it if it will not fit) into buffer zBuf, size nBuf bytes.
|
||||
** Return a pointer to the character within zIn immediately following
|
||||
** the token or quoted string just extracted.
|
||||
*/
|
||||
const char *gobble_token(const char *zIn, char *zBuf, int nBuf){
|
||||
static const char *gobble_token(const char *zIn, char *zBuf, int nBuf){
|
||||
const char *p = zIn;
|
||||
char *pOut = zBuf;
|
||||
char *pEnd = &pOut[nBuf-1];
|
||||
char q = 0; /* quote character, if any */
|
||||
|
||||
if( p==0 ) return 0;
|
||||
while( *p==' ' ) p++;
|
||||
while( is_whitespace(*p) ) p++;
|
||||
switch( *p ){
|
||||
case '"': q = '"'; break;
|
||||
case '\'': q = '\''; break;
|
||||
@@ -1744,7 +1752,7 @@ const char *gobble_token(const char *zIn, char *zBuf, int nBuf){
|
||||
p++;
|
||||
}
|
||||
}else{
|
||||
while( *p && *p!=' ' && *p!='(' ){
|
||||
while( *p && !is_whitespace(*p) && *p!='(' ){
|
||||
if( pOut<pEnd ) *pOut++ = *p;
|
||||
p++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user