DELETED Makefile.arm-wince-mingw32ce-gcc Index: Makefile.arm-wince-mingw32ce-gcc ================================================================== --- Makefile.arm-wince-mingw32ce-gcc +++ /dev/null @@ -1,138 +0,0 @@ -#!/usr/make -# -# Makefile for SQLITE -# -# This is a template makefile for SQLite. Most people prefer to -# use the autoconf generated "configure" script to generate the -# makefile automatically. But that does not work for everybody -# and in every situation. If you are having problems with the -# "configure" script, you might want to try this makefile as an -# alternative. Create a copy of this file, edit the parameters -# below and type "make". -# - -#### The directory where to find the mingw32ce tools -MINGW32CE = /opt/mingw32ce/bin - -#### The target prefix of the mingw32ce tools -TARGET = arm-wince-mingw32ce - -#### The toplevel directory of the source tree. This is the directory -# that contains this "Makefile.in" and the "configure.in" script. -# -TOP = ../sqlite - -#### C Compiler and options for use in building executables that -# will run on the platform that is doing the build. -# -BCC = gcc -g -O2 -#BCC = /opt/ancic/bin/c89 -0 - -#### If the target operating system supports the "usleep()" system -# call, then define the HAVE_USLEEP macro for all C modules. -# -USLEEP = -#USLEEP = -DHAVE_USLEEP=1 - -#### If you want the SQLite library to be safe for use within a -# multi-threaded program, then define the following macro -# appropriately: -# -THREADSAFE = -DTHREADSAFE=1 -#THREADSAFE = -DTHREADSAFE=0 - -#### Specify any extra linker options needed to make the library -# thread safe -# -#THREADLIB = -lpthread -THREADLIB = - -#### Specify any extra libraries needed to access required functions. -# -#TLIBS = -lrt # fdatasync on Solaris 8 -TLIBS = - -#### Leave SQLITE_DEBUG undefined for maximum speed. Use SQLITE_DEBUG=1 -# to check for memory leaks. Use SQLITE_DEBUG=2 to print a log of all -# malloc()s and free()s in order to track down memory leaks. -# -# SQLite uses some expensive assert() statements in the inner loop. -# You can make the library go almost twice as fast if you compile -# with -DNDEBUG=1 -# -#OPTS = -DSQLITE_DEBUG=2 -#OPTS = -DSQLITE_DEBUG=1 -#OPTS = -OPTS = -DNDEBUG=1 -DSQLITE_OS_WIN=1 -D_WIN32_WCE=1 -#OPTS += -DHAVE_FDATASYNC=1 - -#### The suffix to add to executable files. ".exe" for windows. -# Nothing for unix. -# -EXE = .exe -#EXE = - -#### C Compile and options for use in building executables that -# will run on the target platform. This is usually the same -# as BCC, unless you are cross-compiling. -# -#TCC = gcc -O6 -#TCC = gcc -g -O0 -Wall -#TCC = gcc -g -O0 -Wall -fprofile-arcs -ftest-coverage -#TCC = /opt/mingw/bin/i386-mingw32-gcc -O6 -TCC = $(MINGW32CE)/$(TARGET)-gcc -O2 -#TCC = /opt/ansic/bin/c89 -O +z -Wl,-a,archive - -#### Tools used to build a static library. -# -#AR = ar cr -#AR = /opt/mingw/bin/i386-mingw32-ar cr -AR = $(MINGW32CE)/$(TARGET)-ar cr -#RANLIB = ranlib -#RANLIB = /opt/mingw/bin/i386-mingw32-ranlib -RANLIB = $(MINGW32CE)/$(TARGET)-ranlib - -#MKSHLIB = gcc -shared -#SO = so -#SHPREFIX = lib -MKSHLIB = $(MINGW32CE)/$(TARGET)-gcc -shared -SO = dll -SHPREFIX = - -#### Extra compiler options needed for programs that use the TCL library. -# -#TCL_FLAGS = -#TCL_FLAGS = -DSTATIC_BUILD=1 -TCL_FLAGS = -I/home/drh/tcltk/8.4linux -#TCL_FLAGS = -I/home/drh/tcltk/8.4win -DSTATIC_BUILD=1 -#TCL_FLAGS = -I/home/drh/tcltk/8.3hpux - -#### Linker options needed to link against the TCL library. -# -#LIBTCL = -ltcl -lm -ldl -LIBTCL = /home/drh/tcltk/8.4linux/libtcl8.4g.a -lm -ldl -#LIBTCL = /home/drh/tcltk/8.4win/libtcl84s.a -lmsvcrt -#LIBTCL = /home/drh/tcltk/8.3hpux/libtcl8.3.a -ldld -lm -lc - -#### Additional objects for SQLite library when TCL support is enabled. -TCLOBJ = -#TCLOBJ = tclsqlite.o - -#### Compiler options needed for programs that use the readline() library. -# -READLINE_FLAGS = -#READLINE_FLAGS = -DHAVE_READLINE=1 -I/usr/include/readline - -#### Linker options needed by programs using readline() must link against. -# -LIBREADLINE = -#LIBREADLINE = -static -lreadline -ltermcap - -#### Which "awk" program provides nawk compatibilty -# -# NAWK = nawk -NAWK = awk - -# You should not have to change anything below this line -############################################################################### -include $(TOP)/main.mk Index: Makefile.in ================================================================== --- Makefile.in +++ Makefile.in @@ -74,21 +74,17 @@ # tables to always be in memory. # TEMP_STORE = -DSQLITE_TEMP_STORE=@TEMP_STORE@ # Enable/disable loadable extensions, and other optional features -# based on configuration. (-DSQLITE_OMIT*, -DSQLITE_ENABLE*). -# The same set of OMIT and ENABLE flags should be passed to the -# LEMON parser generator and the mkkeywordhash tool as well. +# based on configuration. (-DSQLITE_OMIT*). The same set of OMIT +# flags should be passed to the LEMON parser generator and the +# mkkeywordhash tool as well. OPT_FEATURE_FLAGS = @OPT_FEATURE_FLAGS@ TCC += $(OPT_FEATURE_FLAGS) -# Add in any optional parameters specified on the make commane line -# ie. make "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1". -TCC += $(OPTS) - # Version numbers and release number for the SQLite being compiled. # VERSION = @VERSION@ VERSION_NUMBER = @VERSION_NUMBER@ RELEASE = @RELEASE@ @@ -108,14 +104,10 @@ # This is the command to use for tclsh - normally just "tclsh", but we may # know the specific version we want to use # TCLSH_CMD = @TCLSH_CMD@ -# Where do we want to install the tcl plugin -# -TCLLIBDIR = @TCLLIBDIR@ - # The suffix used on shared libraries. Ex: ".dll", ".so", ".dylib" # SHLIB_SUFFIX = @TCL_SHLIB_SUFFIX@ # If gcov support was enabled by the configure script, add the appropriate @@ -127,11 +119,11 @@ # # http://www.mail-archive.com/debian-gcc@lists.debian.org/msg26197.html # # for more info. # -GCOV_CFLAGS1 = -DSQLITE_COVERAGE_TEST=1 -fprofile-arcs -ftest-coverage +GCOV_CFLAGS1 = -fprofile-arcs -ftest-coverage GCOV_LDFLAGS1 = -lgcov USE_GCOV = @USE_GCOV@ LTCOMPILE_EXTRAS += $(GCOV_CFLAGS$(USE_GCOV)) LTLINK_EXTRAS += $(GCOV_LDFLAGS$(USE_GCOV)) @@ -165,19 +157,18 @@ # OBJS0 = alter.lo analyze.lo attach.lo auth.lo bitvec.lo btmutex.lo \ btree.lo build.lo callback.lo complete.lo date.lo \ delete.lo expr.lo fault.lo func.lo global.lo \ hash.lo journal.lo insert.lo legacy.lo loadext.lo \ - main.lo malloc.lo mem0.lo mem1.lo mem2.lo mem3.lo mem5.lo \ - memjournal.lo \ + main.lo malloc.lo mem1.lo mem2.lo mem3.lo mem4.lo mem5.lo mem6.lo \ mutex.lo mutex_noop.lo mutex_os2.lo mutex_unix.lo mutex_w32.lo \ opcodes.lo os.lo os_unix.lo os_win.lo os_os2.lo \ - pager.lo parse.lo pcache.lo pcache1.lo pragma.lo prepare.lo printf.lo \ - random.lo resolve.lo rowset.lo select.lo status.lo \ + pager.lo parse.lo pcache.lo pragma.lo prepare.lo printf.lo random.lo \ + resolve.lo select.lo status.lo \ table.lo tokenize.lo trigger.lo update.lo \ util.lo vacuum.lo \ - vdbe.lo vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbemem.lo \ + vdbe.lo vdbeapi.lo vdbeaux.lo vdbeblob.lo vdbefifo.lo vdbemem.lo \ walker.lo where.lo utf.lo vtab.lo # Object files for the amalgamation. # OBJS1 = sqlite3.lo @@ -193,11 +184,10 @@ SRC = \ $(TOP)/src/alter.c \ $(TOP)/src/analyze.c \ $(TOP)/src/attach.c \ $(TOP)/src/auth.c \ - $(TOP)/src/backup.c \ $(TOP)/src/bitvec.c \ $(TOP)/src/btmutex.c \ $(TOP)/src/btree.c \ $(TOP)/src/btree.h \ $(TOP)/src/btreeInt.h \ @@ -217,16 +207,16 @@ $(TOP)/src/journal.c \ $(TOP)/src/legacy.c \ $(TOP)/src/loadext.c \ $(TOP)/src/main.c \ $(TOP)/src/malloc.c \ - $(TOP)/src/mem0.c \ $(TOP)/src/mem1.c \ $(TOP)/src/mem2.c \ $(TOP)/src/mem3.c \ + $(TOP)/src/mem4.c \ $(TOP)/src/mem5.c \ - $(TOP)/src/memjournal.c \ + $(TOP)/src/mem6.c \ $(TOP)/src/mutex.c \ $(TOP)/src/mutex.h \ $(TOP)/src/mutex_noop.c \ $(TOP)/src/mutex_os2.c \ $(TOP)/src/mutex_unix.c \ @@ -240,17 +230,15 @@ $(TOP)/src/pager.c \ $(TOP)/src/pager.h \ $(TOP)/src/parse.y \ $(TOP)/src/pcache.c \ $(TOP)/src/pcache.h \ - $(TOP)/src/pcache1.c \ $(TOP)/src/pragma.c \ $(TOP)/src/prepare.c \ $(TOP)/src/printf.c \ $(TOP)/src/random.c \ $(TOP)/src/resolve.c \ - $(TOP)/src/rowset.c \ $(TOP)/src/select.c \ $(TOP)/src/status.c \ $(TOP)/src/shell.c \ $(TOP)/src/sqlite.h.in \ $(TOP)/src/sqlite3ext.h \ @@ -267,10 +255,11 @@ $(TOP)/src/vdbe.c \ $(TOP)/src/vdbe.h \ $(TOP)/src/vdbeapi.c \ $(TOP)/src/vdbeaux.c \ $(TOP)/src/vdbeblob.c \ + $(TOP)/src/vdbefifo.c \ $(TOP)/src/vdbemem.c \ $(TOP)/src/vdbeInt.h \ $(TOP)/src/vtab.c \ $(TOP)/src/walker.c \ $(TOP)/src/where.c @@ -307,12 +296,10 @@ $(TOP)/ext/fts2/fts2_tokenizer.c \ $(TOP)/ext/fts2/fts2_tokenizer1.c SRC += \ $(TOP)/ext/fts3/fts3.c \ $(TOP)/ext/fts3/fts3.h \ - $(TOP)/ext/fts3/fts3_expr.c \ - $(TOP)/ext/fts3/fts3_expr.h \ $(TOP)/ext/fts3/fts3_hash.c \ $(TOP)/ext/fts3/fts3_hash.h \ $(TOP)/ext/fts3/fts3_icu.c \ $(TOP)/ext/fts3/fts3_porter.c \ $(TOP)/ext/fts3/fts3_tokenizer.h \ @@ -327,11 +314,10 @@ # Source code to the library files needed by the test fixture # TESTSRC2 = \ $(TOP)/src/attach.c \ - $(TOP)/src/backup.c \ $(TOP)/src/bitvec.c \ $(TOP)/src/btree.c \ $(TOP)/src/build.c \ $(TOP)/src/date.c \ $(TOP)/src/expr.c \ @@ -342,11 +328,10 @@ $(TOP)/src/os_os2.c \ $(TOP)/src/os_unix.c \ $(TOP)/src/os_win.c \ $(TOP)/src/pager.c \ $(TOP)/src/pcache.c \ - $(TOP)/src/pcache1.c \ $(TOP)/src/pragma.c \ $(TOP)/src/prepare.c \ $(TOP)/src/printf.c \ $(TOP)/src/random.c \ $(TOP)/src/select.c \ @@ -372,23 +357,20 @@ $(TOP)/src/test7.c \ $(TOP)/src/test8.c \ $(TOP)/src/test9.c \ $(TOP)/src/test_autoext.c \ $(TOP)/src/test_async.c \ - $(TOP)/src/test_backup.c \ $(TOP)/src/test_btree.c \ $(TOP)/src/test_config.c \ $(TOP)/src/test_devsym.c \ $(TOP)/src/test_func.c \ $(TOP)/src/test_hexio.c \ - $(TOP)/src/test_journal.c \ $(TOP)/src/test_malloc.c \ $(TOP)/src/test_md5.c \ $(TOP)/src/test_mutex.c \ $(TOP)/src/test_onefile.c \ $(TOP)/src/test_osinst.c \ - $(TOP)/src/test_pcache.c \ $(TOP)/src/test_schema.c \ $(TOP)/src/test_server.c \ $(TOP)/src/test_tclvar.c \ $(TOP)/src/test_thread.c @@ -422,11 +404,10 @@ $(TOP)/ext/fts2/fts2.h \ $(TOP)/ext/fts2/fts2_hash.h \ $(TOP)/ext/fts2/fts2_tokenizer.h HDR += \ $(TOP)/ext/fts3/fts3.h \ - $(TOP)/ext/fts3/fts3_expr.h \ $(TOP)/ext/fts3/fts3_hash.h \ $(TOP)/ext/fts3/fts3_tokenizer.h HDR += \ $(TOP)/ext/rtree/rtree.h HDR += \ @@ -448,13 +429,10 @@ all: sqlite3.h libsqlite3.la sqlite3$(TEXE) $(HAVE_TCL:1=libtclsqlite3.la) Makefile: $(TOP)/Makefile.in ./config.status -sqlite3.pc: $(TOP)/sqlite3.pc.in - ./config.status - # Generate the file "last_change" which contains the date of change # of the most recently modified source code file # last_change: $(SRC) cat $(SRC) | grep '$$Id: ' | sort -k 5 | tail -1 \ @@ -465,13 +443,12 @@ ${ALLOWRELEASE} -rpath "$(libdir)" -version-info "8:6:8" libtclsqlite3.la: tclsqlite.lo libsqlite3.la $(LTLINK) -o $@ tclsqlite.lo \ libsqlite3.la @TCL_STUB_LIB_SPEC@ $(TLIBS) \ - -rpath "$(TCLLIBDIR)" \ - -version-info "8:6:8" \ - -avoid-version + -rpath "$(libdir)/sqlite" \ + -version-info "8:6:8" sqlite3$(TEXE): $(TOP)/src/shell.c libsqlite3.la sqlite3.h $(LTLINK) $(READLINE_FLAGS) \ -o $@ $(TOP)/src/shell.c libsqlite3.la \ $(LIBREADLINE) $(TLIBS) -rpath "$(libdir)" @@ -500,100 +477,100 @@ # Rule to build the amalgamation # sqlite3.lo: sqlite3.c - $(LTCOMPILE) $(TEMP_STORE) -c sqlite3.c + $(LTCOMPILE) -c sqlite3.c # Rules to build individual files # alter.lo: $(TOP)/src/alter.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/alter.c + $(LTCOMPILE) -c $(TOP)/src/alter.c analyze.lo: $(TOP)/src/analyze.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/analyze.c + $(LTCOMPILE) -c $(TOP)/src/analyze.c attach.lo: $(TOP)/src/attach.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/attach.c + $(LTCOMPILE) -c $(TOP)/src/attach.c auth.lo: $(TOP)/src/auth.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/auth.c + $(LTCOMPILE) -c $(TOP)/src/auth.c bitvec.lo: $(TOP)/src/bitvec.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/bitvec.c + $(LTCOMPILE) -c $(TOP)/src/bitvec.c btmutex.lo: $(TOP)/src/btmutex.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/btmutex.c + $(LTCOMPILE) -c $(TOP)/src/btmutex.c btree.lo: $(TOP)/src/btree.c $(HDR) $(TOP)/src/pager.h - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/btree.c + $(LTCOMPILE) -c $(TOP)/src/btree.c build.lo: $(TOP)/src/build.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/build.c + $(LTCOMPILE) -c $(TOP)/src/build.c callback.lo: $(TOP)/src/callback.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/callback.c + $(LTCOMPILE) -c $(TOP)/src/callback.c complete.lo: $(TOP)/src/complete.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/complete.c + $(LTCOMPILE) -c $(TOP)/src/complete.c date.lo: $(TOP)/src/date.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/date.c + $(LTCOMPILE) -c $(TOP)/src/date.c delete.lo: $(TOP)/src/delete.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/delete.c + $(LTCOMPILE) -c $(TOP)/src/delete.c expr.lo: $(TOP)/src/expr.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/expr.c + $(LTCOMPILE) -c $(TOP)/src/expr.c fault.lo: $(TOP)/src/fault.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/fault.c + $(LTCOMPILE) -c $(TOP)/src/fault.c func.lo: $(TOP)/src/func.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/func.c + $(LTCOMPILE) -c $(TOP)/src/func.c global.lo: $(TOP)/src/global.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/global.c + $(LTCOMPILE) -c $(TOP)/src/global.c hash.lo: $(TOP)/src/hash.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/hash.c + $(LTCOMPILE) -c $(TOP)/src/hash.c insert.lo: $(TOP)/src/insert.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/insert.c + $(LTCOMPILE) -c $(TOP)/src/insert.c journal.lo: $(TOP)/src/journal.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/journal.c + $(LTCOMPILE) -c $(TOP)/src/journal.c legacy.lo: $(TOP)/src/legacy.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/legacy.c + $(LTCOMPILE) -c $(TOP)/src/legacy.c loadext.lo: $(TOP)/src/loadext.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/loadext.c + $(LTCOMPILE) -c $(TOP)/src/loadext.c main.lo: $(TOP)/src/main.c $(HDR) $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/main.c malloc.lo: $(TOP)/src/malloc.c $(HDR) $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/malloc.c -mem0.lo: $(TOP)/src/mem0.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem0.c - mem1.lo: $(TOP)/src/mem1.c $(HDR) $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem1.c mem2.lo: $(TOP)/src/mem2.c $(HDR) $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem2.c mem3.lo: $(TOP)/src/mem3.c $(HDR) $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem3.c +mem4.lo: $(TOP)/src/mem4.c $(HDR) + $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem4.c + mem5.lo: $(TOP)/src/mem5.c $(HDR) $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem5.c -memjournal.lo: $(TOP)/src/memjournal.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/memjournal.c +mem6.lo: $(TOP)/src/mem6.c $(HDR) + $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mem6.c mutex.lo: $(TOP)/src/mutex.c $(HDR) $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex.c mutex_noop.lo: $(TOP)/src/mutex_noop.c $(HDR) @@ -607,129 +584,126 @@ mutex_w32.lo: $(TOP)/src/mutex_w32.c $(HDR) $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/mutex_w32.c pager.lo: $(TOP)/src/pager.c $(HDR) $(TOP)/src/pager.h - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pager.c + $(LTCOMPILE) -c $(TOP)/src/pager.c pcache.lo: $(TOP)/src/pcache.c $(HDR) $(TOP)/src/pcache.h - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pcache.c - -pcache1.lo: $(TOP)/src/pcache1.c $(HDR) $(TOP)/src/pcache.h - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pcache1.c + $(LTCOMPILE) -c $(TOP)/src/pcache.c opcodes.lo: opcodes.c - $(LTCOMPILE) $(TEMP_STORE) -c opcodes.c + $(LTCOMPILE) -c opcodes.c opcodes.c: opcodes.h $(TOP)/mkopcodec.awk sort -n -b -k 3 opcodes.h | $(NAWK) -f $(TOP)/mkopcodec.awk >opcodes.c opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/mkopcodeh.awk cat parse.h $(TOP)/src/vdbe.c | $(NAWK) -f $(TOP)/mkopcodeh.awk >opcodes.h os.lo: $(TOP)/src/os.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os.c + $(LTCOMPILE) -c $(TOP)/src/os.c os_unix.lo: $(TOP)/src/os_unix.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_unix.c + $(LTCOMPILE) -c $(TOP)/src/os_unix.c os_win.lo: $(TOP)/src/os_win.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_win.c + $(LTCOMPILE) -c $(TOP)/src/os_win.c os_os2.lo: $(TOP)/src/os_os2.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/os_os2.c + $(LTCOMPILE) -c $(TOP)/src/os_os2.c parse.lo: parse.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c parse.c + $(LTCOMPILE) -c parse.c parse.h: parse.c parse.c: $(TOP)/src/parse.y lemon$(BEXE) $(TOP)/addopcodes.awk cp $(TOP)/src/parse.y . - ./lemon$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) parse.y + ./lemon$(BEXE) $(OPTS) $(OPT_FEATURE_FLAGS) parse.y mv parse.h parse.h.temp $(NAWK) -f $(TOP)/addopcodes.awk parse.h.temp >parse.h pragma.lo: $(TOP)/src/pragma.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/pragma.c + $(LTCOMPILE) -c $(TOP)/src/pragma.c prepare.lo: $(TOP)/src/prepare.c $(HDR) $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/prepare.c printf.lo: $(TOP)/src/printf.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/printf.c + $(LTCOMPILE) -c $(TOP)/src/printf.c random.lo: $(TOP)/src/random.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/random.c + $(LTCOMPILE) -c $(TOP)/src/random.c resolve.lo: $(TOP)/src/resolve.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/resolve.c - -rowset.lo: $(TOP)/src/rowset.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/rowset.c + $(LTCOMPILE) -c $(TOP)/src/resolve.c select.lo: $(TOP)/src/select.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/select.c + $(LTCOMPILE) -c $(TOP)/src/select.c status.lo: $(TOP)/src/status.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/status.c + $(LTCOMPILE) -c $(TOP)/src/status.c sqlite3.h: $(TOP)/src/sqlite.h.in sed -e s/--VERS--/$(RELEASE)/ $(TOP)/src/sqlite.h.in | \ sed -e s/--VERSION-NUMBER--/$(VERSION_NUMBER)/ >sqlite3.h table.lo: $(TOP)/src/table.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/table.c + $(LTCOMPILE) -c $(TOP)/src/table.c tclsqlite.lo: $(TOP)/src/tclsqlite.c $(HDR) $(LTCOMPILE) -DUSE_TCL_STUBS=1 -c $(TOP)/src/tclsqlite.c tokenize.lo: $(TOP)/src/tokenize.c keywordhash.h $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/tokenize.c + $(LTCOMPILE) -c $(TOP)/src/tokenize.c keywordhash.h: $(TOP)/tool/mkkeywordhash.c - $(BCC) -o mkkeywordhash$(BEXE) $(OPT_FEATURE_FLAGS) $(OPTS) $(TOP)/tool/mkkeywordhash.c + $(BCC) -o mkkeywordhash$(BEXE) $(OPTS) $(OPT_FEATURE_FLAGS) $(TOP)/tool/mkkeywordhash.c ./mkkeywordhash$(BEXE) >keywordhash.h trigger.lo: $(TOP)/src/trigger.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/trigger.c + $(LTCOMPILE) -c $(TOP)/src/trigger.c update.lo: $(TOP)/src/update.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/update.c + $(LTCOMPILE) -c $(TOP)/src/update.c utf.lo: $(TOP)/src/utf.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/utf.c + $(LTCOMPILE) -c $(TOP)/src/utf.c util.lo: $(TOP)/src/util.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/util.c + $(LTCOMPILE) -c $(TOP)/src/util.c vacuum.lo: $(TOP)/src/vacuum.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vacuum.c + $(LTCOMPILE) -c $(TOP)/src/vacuum.c vdbe.lo: $(TOP)/src/vdbe.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbe.c + $(LTCOMPILE) -c $(TOP)/src/vdbe.c vdbeapi.lo: $(TOP)/src/vdbeapi.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeapi.c + $(LTCOMPILE) -c $(TOP)/src/vdbeapi.c vdbeaux.lo: $(TOP)/src/vdbeaux.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeaux.c + $(LTCOMPILE) -c $(TOP)/src/vdbeaux.c vdbeblob.lo: $(TOP)/src/vdbeblob.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbeblob.c + $(LTCOMPILE) -c $(TOP)/src/vdbeblob.c + +vdbefifo.lo: $(TOP)/src/vdbefifo.c $(HDR) + $(LTCOMPILE) -c $(TOP)/src/vdbefifo.c vdbemem.lo: $(TOP)/src/vdbemem.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vdbemem.c + $(LTCOMPILE) -c $(TOP)/src/vdbemem.c vtab.lo: $(TOP)/src/vtab.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/vtab.c + $(LTCOMPILE) -c $(TOP)/src/vtab.c walker.lo: $(TOP)/src/walker.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/walker.c + $(LTCOMPILE) -c $(TOP)/src/walker.c where.lo: $(TOP)/src/where.c $(HDR) - $(LTCOMPILE) $(TEMP_STORE) -c $(TOP)/src/where.c + $(LTCOMPILE) -c $(TOP)/src/where.c tclsqlite-shell.lo: $(TOP)/src/tclsqlite.c $(HDR) $(LTCOMPILE) -DTCLSH=1 -o $@ -c $(TOP)/src/tclsqlite.c tclsqlite-stubs.lo: $(TOP)/src/tclsqlite.c $(HDR) @@ -763,11 +737,11 @@ $(LTLINK) -DTCLSH=2 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1 \ -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE \ $(TEMP_STORE) -o $@ $(TESTFIXTURE_SRC) $(LIBTCL) -install: sqlite3$(BEXE) libsqlite3.la sqlite3.h sqlite3.pc ${HAVE_TCL:1=tcl_install} +install: sqlite3$(BEXE) libsqlite3.la sqlite3.h ${HAVE_TCL:1=tcl_install} $(INSTALL) -d $(DESTDIR)$(libdir) $(LTINSTALL) libsqlite3.la $(DESTDIR)$(libdir) $(INSTALL) -d $(DESTDIR)$(bindir) $(LTINSTALL) sqlite3$(BEXE) $(DESTDIR)$(bindir) $(INSTALL) -d $(DESTDIR)$(includedir) @@ -774,17 +748,12 @@ $(INSTALL) -m 0644 sqlite3.h $(DESTDIR)$(includedir) $(INSTALL) -m 0644 $(TOP)/src/sqlite3ext.h $(DESTDIR)$(includedir) $(INSTALL) -d $(DESTDIR)$(pkgconfigdir) $(INSTALL) -m 0644 sqlite3.pc $(DESTDIR)$(pkgconfigdir) -pkgIndex.tcl: - echo 'package ifneeded sqlite3 $(RELEASE) [list load $(TCLLIBDIR)/libtclsqlite3.so sqlite3]' > $@ -tcl_install: libtclsqlite3.la pkgIndex.tcl - $(INSTALL) -d $(DESTDIR)$(TCLLIBDIR) - $(LTINSTALL) libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR) - rm -f $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.la $(DESTDIR)$(TCLLIBDIR)/libtclsqlite3.a - $(INSTALL) -m 0644 pkgIndex.tcl $(DESTDIR)$(TCLLIBDIR) +tcl_install: libtclsqlite3.la + $(TCLSH_CMD) $(TOP)/tclinstaller.tcl $(RELEASE) clean: rm -f *.lo *.la *.o sqlite3$(TEXE) libsqlite3.la rm -f sqlite3.h opcodes.* rm -rf .libs .deps tsrc DELETED Makefile.vxwSH4 Index: Makefile.vxwSH4 ================================================================== --- Makefile.vxwSH4 +++ /dev/null @@ -1,635 +0,0 @@ -#!/usr/make -# -# Makefile for SQLITE on VxWorks - -ifeq ($(FORCPU),) - FORCPU = SH32gnule -endif - -TOOL_FAMILY = gnu - -include $(WIND_USR)/tool/gnu/make.$(FORCPU) - -#### The toplevel directory of the source tree. This is the directory -# that contains this "Makefile.in" and the "configure.in" script. -# -TOP = ../sqlite-3.6.5 - -#### C Compiler and options for use in building executables that -# will run on the platform that is doing the build. -# -BCC = gcc -g -O2 -#BCC = /opt/ancic/bin/c89 -0 - -#### If the target operating system supports the "usleep()" system -# call, then define the HAVE_USLEEP macro for all C modules. -# -USLEEP = -#USLEEP = -DHAVE_USLEEP=1 - -#### If you want the SQLite library to be safe for use within a -# multi-threaded program, then define the following macro -# appropriately: -# -THREADSAFE = -DSQLITE_THREADSAFE=1 -#THREADSAFE = -DSQLITE_THREADSAFE=0 - -#### Specify any extra linker options needed to make the library -# thread safe -# -#THREADLIB = -lpthread -THREADLIB = - -#### Specify any extra libraries needed to access required functions. -# -#TLIBS = -lrt # fdatasync on Solaris 8 -#for x86 vxWorks -#TLIBS += TLIBS = $(LD_LINK_PATH_ATEND) $(LD_PARTIAL_LAST_FLAGS) -#for SH4 shared library -TLIBS_SHARED += -L$(WIND_USR)/lib/sh/SH32/commonle/PIC -#TLIBS_SHARED += $(LD_LINK_PATH_ATEND) $(LD_PARTIAL_LAST_FLAGS) -#for SH4 static -TLIBS += $(LD_LINK_PATH_ATEND) $(LD_PARTIAL_LAST_FLAGS) - -#### Leave SQLITE_DEBUG undefined for maximum speed. Use SQLITE_DEBUG=1 -# to check for memory leaks. Use SQLITE_DEBUG=2 to print a log of all -# malloc()s and free()s in order to track down memory leaks. -# -# SQLite uses some expensive assert() statements in the inner loop. -# You can make the library go almost twice as fast if you compile -# with -DNDEBUG=1 -# -#OPTS = -DSQLITE_DEBUG=2 -#OPTS = -DSQLITE_DEBUG=1 -#OPTS = -OPTS = -DNDEBUG=1 -DSQLITE_OS_UNIX=1 $(THREADSAFE) -OPTS += -DSQLITE_OMIT_LOAD_EXTENSION=1 -OPTS += -DSQLITE_ENABLE_LOCKING_STYLE=1 -OPTS += -DSQLITE_THREAD_OVERRIDE_LOCK=0 -OPTS += -DSQLITE_ENABLE_COLUMN_METADATA=1 -OPTS += -DHAVE_FDATASYNC=1 - -#### The suffix to add to executable files. ".exe" for windows. -# Nothing for unix. -# -EXE = .vxe -#EXE = - -#### C Compile and options for use in building executables that -# will run on the target platform. This is usually the same -# as BCC, unless you are cross-compiling. -# -#TCC = gcc -O6 -#TCC = gcc -g -O0 -Wall -#TCC = gcc -g -O0 -Wall -fprofile-arcs -ftest-coverage -#TCC = /opt/mingw/bin/i386-mingw32-gcc -O6 -TCC = $(CC) $(DEFINE_CC) -O2 -g -mrtp $(CC_ARCH_SPEC) -D_REENTRANT=1 -D_VX_CPU=_VX_$(CPU) -D_VX_TOOL_FAMILY=$(TOOL_FAMILY) -D_VX_TOOL=$(TOOL) -TCC += -I$(WIND_USR)/h -I$(WIND_USR)/h/wrn/coreip -#TCC = /opt/ansic/bin/c89 -O +z -Wl,-a,archive - -#TCC_SHARED = $(TCC) -fPIC -TCC_SHARED = $(TCC) - -#### Tools used to build a static library. -# -#ARX = ar cr -#ARX = /opt/mingw/bin/i386-mingw32-ar cr -AR += cr -#RANLIB = ranlib -#RANLIB = /opt/mingw/bin/i386-mingw32-ranlib - -#MKSHLIB = gcc -shared -#SO = so -#SHPREFIX = lib -MKSHLIB = $(CC) $(DEFINE_CC) -mrtp -shared $(CC_ARCH_SPEC) -D_VX_CPU=_VX_$(CPU) -D_VX_TOOL_FAMILY=$(TOOL_FAMILY) -D_VX_TOOL=$(TOOL) -SO = so -SHPREFIX = lib - -#### Extra compiler options needed for programs that use the TCL library. -# -#TCL_FLAGS = -#TCL_FLAGS = -DSTATIC_BUILD=1 -TCL_FLAGS = -I/home/drh/tcltk/8.4linux -#TCL_FLAGS = -I/home/drh/tcltk/8.4win -DSTATIC_BUILD=1 -#TCL_FLAGS = -I/home/drh/tcltk/8.3hpux - -#### Linker options needed to link against the TCL library. -# -#LIBTCL = -ltcl -lm -ldl -LIBTCL = /home/drh/tcltk/8.4linux/libtcl8.4g.a -lm -ldl -#LIBTCL = /home/drh/tcltk/8.4win/libtcl84s.a -lmsvcrt -#LIBTCL = /home/drh/tcltk/8.3hpux/libtcl8.3.a -ldld -lm -lc - -#### Additional objects for SQLite library when TCL support is enabled. -TCLOBJ = -#TCLOBJ = tclsqlite.o - -#### Compiler options needed for programs that use the readline() library. -# -READLINE_FLAGS = -#READLINE_FLAGS = -DHAVE_READLINE=1 -I/usr/include/readline - -#### Linker options needed by programs using readline() must link against. -# -LIBREADLINE = -#LIBREADLINE = -static -lreadline -ltermcap - -#### Which "awk" program provides nawk compatibilty -# -# NAWK = nawk -NAWK = awk - - -#### Pasted and adapted main.mk file -############################################################################### -# The following macros should be defined before this script is -# invoked: -# -# TOP The toplevel directory of the source tree. This is the -# directory that contains this "Makefile.in" and the -# "configure.in" script. -# -# BCC C Compiler and options for use in building executables that -# will run on the platform that is doing the build. -# -# THREADLIB Specify any extra linker options needed to make the library -# thread safe -# -# OPTS Extra compiler command-line options. -# -# EXE The suffix to add to executable files. ".exe" for windows -# and "" for Unix. -# -# TCC C Compiler and options for use in building executables that -# will run on the target platform. This is usually the same -# as BCC, unless you are cross-compiling. -# -# AR Tools used to build a static library. -# RANLIB -# -# TCL_FLAGS Extra compiler options needed for programs that use the -# TCL library. -# -# LIBTCL Linker options needed to link against the TCL library. -# -# READLINE_FLAGS Compiler options needed for programs that use the -# readline() library. -# -# LIBREADLINE Linker options needed by programs using readline() must -# link against. -# -# NAWK Nawk compatible awk program. Older (obsolete?) solaris -# systems need this to avoid using the original AT&T AWK. -# -# Once the macros above are defined, the rest of this make script will -# build the SQLite library and testing tools. -################################################################################ - -# This is how we compile -# -TCCX = $(TCC) $(OPTS) -I. -I$(TOP)/src -I$(TOP) -I$(TOP)/ext/rtree -TCCX_SHARED = $(TCC_SHARED) $(OPTS) -I. -I$(TOP)/src -I$(TOP) -I$(TOP)/ext/rtree - -# Object files for the SQLite library. -# -LIBOBJ+= alter.o analyze.o attach.o auth.o \ - bitvec.o btmutex.o btree.o build.o \ - callback.o complete.o date.o delete.o \ - expr.o fault.o func.o global.o hash.o \ - icu.o insert.o journal.o legacy.o loadext.o \ - main.o malloc.o mem0.o mem1.o mem2.o mem3.o mem5.o memjournal.o \ - mutex.o mutex_os2.o mutex_unix.o mutex_w32.o mutex_noop.o \ - opcodes.o os.o os_os2.o os_unix.o os_win.o \ - pager.o parse.o pcache.o pragma.o prepare.o printf.o \ - random.o resolve.o rtree.o select.o status.o \ - table.o tokenize.o trigger.o \ - update.o util.o vacuum.o \ - vdbe.o vdbeapi.o vdbeaux.o vdbeblob.o vdbefifo.o vdbemem.o \ - walker.o where.o utf.o vtab.o - - -# All of the source code files. -# -SRC = \ - $(TOP)/src/alter.c \ - $(TOP)/src/analyze.c \ - $(TOP)/src/attach.c \ - $(TOP)/src/auth.c \ - $(TOP)/src/bitvec.c \ - $(TOP)/src/btmutex.c \ - $(TOP)/src/btree.c \ - $(TOP)/src/btree.h \ - $(TOP)/src/btreeInt.h \ - $(TOP)/src/build.c \ - $(TOP)/src/callback.c \ - $(TOP)/src/complete.c \ - $(TOP)/src/date.c \ - $(TOP)/src/delete.c \ - $(TOP)/src/expr.c \ - $(TOP)/src/fault.c \ - $(TOP)/src/func.c \ - $(TOP)/src/global.c \ - $(TOP)/src/hash.c \ - $(TOP)/src/hash.h \ - $(TOP)/src/hwtime.h \ - $(TOP)/src/insert.c \ - $(TOP)/src/journal.c \ - $(TOP)/src/legacy.c \ - $(TOP)/src/loadext.c \ - $(TOP)/src/main.c \ - $(TOP)/src/malloc.c \ - $(TOP)/src/mem0.c \ - $(TOP)/src/mem1.c \ - $(TOP)/src/mem2.c \ - $(TOP)/src/mem3.c \ - $(TOP)/src/mem5.c \ - $(TOP)/src/memjournal.c \ - $(TOP)/src/mutex.c \ - $(TOP)/src/mutex.h \ - $(TOP)/src/mutex_os2.c \ - $(TOP)/src/mutex_unix.c \ - $(TOP)/src/mutex_w32.c \ - $(TOP)/src/mutex_noop.c \ - $(TOP)/src/os.c \ - $(TOP)/src/os.h \ - $(TOP)/src/os_common.h \ - $(TOP)/src/os_os2.c \ - $(TOP)/src/os_unix.c \ - $(TOP)/src/os_win.c \ - $(TOP)/src/pager.c \ - $(TOP)/src/pager.h \ - $(TOP)/src/parse.y \ - $(TOP)/src/pcache.c \ - $(TOP)/src/pcache.h \ - $(TOP)/src/pragma.c \ - $(TOP)/src/prepare.c \ - $(TOP)/src/printf.c \ - $(TOP)/src/random.c \ - $(TOP)/src/resolve.c \ - $(TOP)/src/select.c \ - $(TOP)/src/status.c \ - $(TOP)/src/shell.c \ - $(TOP)/src/sqlite.h.in \ - $(TOP)/src/sqlite3ext.h \ - $(TOP)/src/sqliteInt.h \ - $(TOP)/src/sqliteLimit.h \ - $(TOP)/src/table.c \ - $(TOP)/src/tclsqlite.c \ - $(TOP)/src/tokenize.c \ - $(TOP)/src/trigger.c \ - $(TOP)/src/utf.c \ - $(TOP)/src/update.c \ - $(TOP)/src/util.c \ - $(TOP)/src/vacuum.c \ - $(TOP)/src/vdbe.c \ - $(TOP)/src/vdbe.h \ - $(TOP)/src/vdbeapi.c \ - $(TOP)/src/vdbeaux.c \ - $(TOP)/src/vdbeblob.c \ - $(TOP)/src/vdbefifo.c \ - $(TOP)/src/vdbemem.c \ - $(TOP)/src/vdbeInt.h \ - $(TOP)/src/vtab.c \ - $(TOP)/src/walker.c \ - $(TOP)/src/where.c - -# Source code for extensions -# -SRC += \ - $(TOP)/ext/fts1/fts1.c \ - $(TOP)/ext/fts1/fts1.h \ - $(TOP)/ext/fts1/fts1_hash.c \ - $(TOP)/ext/fts1/fts1_hash.h \ - $(TOP)/ext/fts1/fts1_porter.c \ - $(TOP)/ext/fts1/fts1_tokenizer.h \ - $(TOP)/ext/fts1/fts1_tokenizer1.c -SRC += \ - $(TOP)/ext/fts2/fts2.c \ - $(TOP)/ext/fts2/fts2.h \ - $(TOP)/ext/fts2/fts2_hash.c \ - $(TOP)/ext/fts2/fts2_hash.h \ - $(TOP)/ext/fts2/fts2_icu.c \ - $(TOP)/ext/fts2/fts2_porter.c \ - $(TOP)/ext/fts2/fts2_tokenizer.h \ - $(TOP)/ext/fts2/fts2_tokenizer.c \ - $(TOP)/ext/fts2/fts2_tokenizer1.c -SRC += \ - $(TOP)/ext/fts3/fts3.c \ - $(TOP)/ext/fts3/fts3.h \ - $(TOP)/ext/fts3/fts3_hash.c \ - $(TOP)/ext/fts3/fts3_hash.h \ - $(TOP)/ext/fts3/fts3_icu.c \ - $(TOP)/ext/fts3/fts3_porter.c \ - $(TOP)/ext/fts3/fts3_tokenizer.h \ - $(TOP)/ext/fts3/fts3_tokenizer.c \ - $(TOP)/ext/fts3/fts3_tokenizer1.c -SRC += \ - $(TOP)/ext/icu/icu.c \ - $(TOP)/ext/icu/sqliteicu.h -SRC += \ - $(TOP)/ext/rtree/rtree.h \ - $(TOP)/ext/rtree/rtree.c - - -# Generated source code files -# -SRC += \ - keywordhash.h \ - opcodes.c \ - opcodes.h \ - parse.c \ - parse.h \ - sqlite3.h - - -# Source code to the test files. -# -TESTSRC = \ - $(TOP)/src/test1.c \ - $(TOP)/src/test2.c \ - $(TOP)/src/test3.c \ - $(TOP)/src/test4.c \ - $(TOP)/src/test5.c \ - $(TOP)/src/test6.c \ - $(TOP)/src/test7.c \ - $(TOP)/src/test8.c \ - $(TOP)/src/test9.c \ - $(TOP)/src/test_autoext.c \ - $(TOP)/src/test_async.c \ - $(TOP)/src/test_btree.c \ - $(TOP)/src/test_config.c \ - $(TOP)/src/test_devsym.c \ - $(TOP)/src/test_func.c \ - $(TOP)/src/test_hexio.c \ - $(TOP)/src/test_malloc.c \ - $(TOP)/src/test_md5.c \ - $(TOP)/src/test_mutex.c \ - $(TOP)/src/test_onefile.c \ - $(TOP)/src/test_osinst.c \ - $(TOP)/src/test_schema.c \ - $(TOP)/src/test_server.c \ - $(TOP)/src/test_tclvar.c \ - $(TOP)/src/test_thread.c \ - -#TESTSRC += $(TOP)/ext/fts2/fts2_tokenizer.c -#TESTSRC += $(TOP)/ext/fts3/fts3_tokenizer.c - -TESTSRC2 = \ - $(TOP)/src/attach.c $(TOP)/src/btree.c $(TOP)/src/build.c $(TOP)/src/date.c \ - $(TOP)/src/expr.c $(TOP)/src/func.c $(TOP)/src/insert.c $(TOP)/src/os.c \ - $(TOP)/src/os_os2.c $(TOP)/src/os_unix.c $(TOP)/src/os_win.c \ - $(TOP)/src/pager.c $(TOP)/src/pragma.c $(TOP)/src/prepare.c \ - $(TOP)/src/printf.c $(TOP)/src/random.c $(TOP)/src/pcache.c \ - $(TOP)/src/select.c $(TOP)/src/tokenize.c \ - $(TOP)/src/utf.c $(TOP)/src/util.c $(TOP)/src/vdbeapi.c $(TOP)/src/vdbeaux.c \ - $(TOP)/src/vdbe.c $(TOP)/src/vdbemem.c $(TOP)/src/where.c parse.c - -# Header files used by all library source files. -# -HDR = \ - $(TOP)/src/btree.h \ - $(TOP)/src/btreeInt.h \ - $(TOP)/src/hash.h \ - $(TOP)/src/hwtime.h \ - keywordhash.h \ - $(TOP)/src/mutex.h \ - opcodes.h \ - $(TOP)/src/os.h \ - $(TOP)/src/os_common.h \ - $(TOP)/src/pager.h \ - $(TOP)/src/pcache.h \ - parse.h \ - sqlite3.h \ - $(TOP)/src/sqlite3ext.h \ - $(TOP)/src/sqliteInt.h \ - $(TOP)/src/sqliteLimit.h \ - $(TOP)/src/vdbe.h \ - $(TOP)/src/vdbeInt.h - -# Header files used by extensions -# -EXTHDR += \ - $(TOP)/ext/fts1/fts1.h \ - $(TOP)/ext/fts1/fts1_hash.h \ - $(TOP)/ext/fts1/fts1_tokenizer.h -EXTHDR += \ - $(TOP)/ext/fts2/fts2.h \ - $(TOP)/ext/fts2/fts2_hash.h \ - $(TOP)/ext/fts2/fts2_tokenizer.h -EXTHDR += \ - $(TOP)/ext/fts3/fts3.h \ - $(TOP)/ext/fts3/fts3_hash.h \ - $(TOP)/ext/fts3/fts3_tokenizer.h -EXTHDR += \ - $(TOP)/ext/rtree/rtree.h - -# This is the default Makefile target. The objects listed here -# are what get build when you type just "make" with no arguments. -# -all: sqlite3.h libsqlite3.a sqlite3$(EXE) - -libsqlite3.a: $(LIBOBJ) - $(AR) libsqlite3.a $(LIBOBJ) - $(RANLIB) libsqlite3.a - -$(SHPREFIX)sqlite3.$(SO): $(LIBOBJ) - $(MKSHLIB) -o $(SHPREFIX)sqlite3.$(SO) $(LIBOBJ) $(TLIBS_SHARED) - -sqlite3$(EXE): $(TOP)/src/shell.c libsqlite3.a sqlite3.h - $(TCCX) $(READLINE_FLAGS) -o sqlite3$(EXE) \ - $(TOP)/src/shell.c \ - $(LIBREADLINE) $(TLIBS) $(THREADLIB) -L. -lsqlite3 - -# This target creates a directory named "tsrc" and fills it with -# copies of all of the C source code and header files needed to -# build on the target system. Some of the C source code and header -# files are automatically generated. This target takes care of -# all that automatic generation. -# -target_source: $(SRC) - rm -rf tsrc - mkdir tsrc - cp -f $(SRC) tsrc - rm tsrc/sqlite.h.in tsrc/parse.y - touch target_source - -sqlite3.c: target_source $(TOP)/tool/mksqlite3c.tcl - tclsh $(TOP)/tool/mksqlite3c.tcl - cp sqlite3.c tclsqlite3.c - cat $(TOP)/src/tclsqlite.c >>tclsqlite3.c - -fts2amal.c: target_source $(TOP)/ext/fts2/mkfts2amal.tcl - tclsh $(TOP)/ext/fts2/mkfts2amal.tcl - -fts3amal.c: target_source $(TOP)/ext/fts3/mkfts3amal.tcl - tclsh $(TOP)/ext/fts3/mkfts3amal.tcl - -# Rules to build the LEMON compiler generator -# -lemon: $(TOP)/tool/lemon.c $(TOP)/tool/lempar.c - $(BCC) -o lemon $(TOP)/tool/lemon.c - cp $(TOP)/tool/lempar.c . - -# Rules to build individual *.o files from generated *.c files. This -# applies to: -# -# parse.o -# opcodes.o -# -%.o: %.c $(HDR) - $(TCCX_SHARED) -c $< - -# Rules to build individual *.o files from files in the src directory. -# -%.o: $(TOP)/src/%.c $(HDR) - $(TCCX_SHARED) -c $< - -tclsqlite.o: $(TOP)/src/tclsqlite.c $(HDR) - $(TCCX_SHARED) $(TCL_FLAGS) -c $(TOP)/src/tclsqlite.c - - - -# Rules to build opcodes.c and opcodes.h -# -opcodes.c: opcodes.h $(TOP)/mkopcodec.awk - sort -n -b -k 3 opcodes.h | $(NAWK) -f $(TOP)/mkopcodec.awk >opcodes.c - -opcodes.h: parse.h $(TOP)/src/vdbe.c $(TOP)/mkopcodeh.awk - cat parse.h $(TOP)/src/vdbe.c | \ - $(NAWK) -f $(TOP)/mkopcodeh.awk >opcodes.h - -# Rules to build parse.c and parse.h - the outputs of lemon. -# -parse.h: parse.c - -parse.c: $(TOP)/src/parse.y lemon $(TOP)/addopcodes.awk - cp $(TOP)/src/parse.y . - rm -f parse.h - ./lemon $(OPTS) parse.y - mv parse.h parse.h.temp - awk -f $(TOP)/addopcodes.awk parse.h.temp >parse.h - -sqlite3.h: $(TOP)/src/sqlite.h.in - sed -e s/--VERS--/`cat ${TOP}/VERSION`/ \ - -e s/--VERSION-NUMBER--/`cat ${TOP}/VERSION | sed 's/[^0-9]/ /g' | $(NAWK) '{printf "%d%03d%03d",$$1,$$2,$$3}'`/ \ - $(TOP)/src/sqlite.h.in >sqlite3.h - -keywordhash.h: $(TOP)/tool/mkkeywordhash.c - $(BCC) -o mkkeywordhash $(OPTS) $(TOP)/tool/mkkeywordhash.c - ./mkkeywordhash >keywordhash.h - - - -# Rules to build the extension objects. -# -icu.o: $(TOP)/ext/icu/icu.c $(HDR) $(EXTHDR) - $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/icu/icu.c - -fts2.o: $(TOP)/ext/fts2/fts2.c $(HDR) $(EXTHDR) - $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2.c - -fts2_hash.o: $(TOP)/ext/fts2/fts2_hash.c $(HDR) $(EXTHDR) - $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_hash.c - -fts2_icu.o: $(TOP)/ext/fts2/fts2_icu.c $(HDR) $(EXTHDR) - $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_icu.c - -fts2_porter.o: $(TOP)/ext/fts2/fts2_porter.c $(HDR) $(EXTHDR) - $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_porter.c - -fts2_tokenizer.o: $(TOP)/ext/fts2/fts2_tokenizer.c $(HDR) $(EXTHDR) - $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer.c - -fts2_tokenizer1.o: $(TOP)/ext/fts2/fts2_tokenizer1.c $(HDR) $(EXTHDR) - $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer1.c - -fts3.o: $(TOP)/ext/fts3/fts3.c $(HDR) $(EXTHDR) - $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3.c - -fts3_hash.o: $(TOP)/ext/fts3/fts3_hash.c $(HDR) $(EXTHDR) - $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_hash.c - -fts3_icu.o: $(TOP)/ext/fts3/fts3_icu.c $(HDR) $(EXTHDR) - $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_icu.c - -fts3_porter.o: $(TOP)/ext/fts3/fts3_porter.c $(HDR) $(EXTHDR) - $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_porter.c - -fts3_tokenizer.o: $(TOP)/ext/fts3/fts3_tokenizer.c $(HDR) $(EXTHDR) - $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer.c - -fts3_tokenizer1.o: $(TOP)/ext/fts3/fts3_tokenizer1.c $(HDR) $(EXTHDR) - $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_tokenizer1.c - -rtree.o: $(TOP)/ext/rtree/rtree.c $(HDR) $(EXTHDR) - $(TCCX_SHARED) -DSQLITE_CORE -c $(TOP)/ext/rtree/rtree.c - - -# Rules for building test programs and for running tests -# -tclsqlite3: $(TOP)/src/tclsqlite.c libsqlite3.a - $(TCCX_SHARED) $(TCL_FLAGS) -DTCLSH=1 -o tclsqlite3 \ - $(TOP)/src/tclsqlite.c libsqlite3.a $(LIBTCL) $(THREADLIB) - - -# Rules to build the 'testfixture' application. -# -TESTFIXTURE_FLAGS = -DTCLSH=1 -DSQLITE_TEST=1 -DSQLITE_CRASH_TEST=1 -TESTFIXTURE_FLAGS += -DSQLITE_SERVER=1 -DSQLITE_PRIVATE="" -DSQLITE_CORE - -testfixture$(EXE): $(TESTSRC2) libsqlite3.a $(TESTSRC) $(TOP)/src/tclsqlite.c - $(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS) \ - $(TESTSRC) $(TESTSRC2) $(TOP)/src/tclsqlite.c \ - -o testfixture$(EXE) $(LIBTCL) $(THREADLIB) libsqlite3.a - -amalgamation-testfixture$(EXE): sqlite3.c $(TESTSRC) $(TOP)/src/tclsqlite.c - $(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS) \ - $(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c \ - -o testfixture$(EXE) $(LIBTCL) $(THREADLIB) - -fts3-testfixture$(EXE): sqlite3.c fts3amal.c $(TESTSRC) $(TOP)/src/tclsqlite.c - $(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS) \ - -DSQLITE_ENABLE_FTS3=1 \ - $(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c fts3amal.c \ - -o testfixture$(EXE) $(LIBTCL) $(THREADLIB) - -fulltest: testfixture$(EXE) sqlite3$(EXE) - ./testfixture$(EXE) $(TOP)/test/all.test - -soaktest: testfixture$(EXE) sqlite3$(EXE) - ./testfixture$(EXE) $(TOP)/test/all.test -soak 1 - -test: testfixture$(EXE) sqlite3$(EXE) - ./testfixture$(EXE) $(TOP)/test/veryquick.test - -sqlite3_analyzer$(EXE): $(TOP)/src/tclsqlite.c sqlite3.c $(TESTSRC) \ - $(TOP)/tool/spaceanal.tcl - sed \ - -e '/^#/d' \ - -e 's,\\,\\\\,g' \ - -e 's,",\\",g' \ - -e 's,^,",' \ - -e 's,$$,\\n",' \ - $(TOP)/tool/spaceanal.tcl >spaceanal_tcl.h - $(TCCX) $(TCL_FLAGS) $(TESTFIXTURE_FLAGS) \ - -DTCLSH=2 -DSQLITE_TEST=1 -DSQLITE_DEBUG=1 -DSQLITE_PRIVATE="" \ - $(TESTSRC) $(TOP)/src/tclsqlite.c sqlite3.c \ - -o sqlite3_analyzer$(EXE) \ - $(LIBTCL) $(THREADLIB) - -TEST_EXTENSION = $(SHPREFIX)testloadext.$(SO) -$(TEST_EXTENSION): $(TOP)/src/test_loadext.c - $(MKSHLIB) $(TOP)/src/test_loadext.c -o $(TEST_EXTENSION) - -extensiontest: testfixture$(EXE) $(TEST_EXTENSION) - ./testfixture$(EXE) $(TOP)/test/loadext.test - -clean: - rm -f *.o sqlite3$(EXE) libsqlite3.a sqlite3.h opcodes.* - rm -f lemon lempar.c parse.* sqlite*.tar.gz mkkeywordhash keywordhash.h - rm -f $(PUBLISH) - rm -f *.da *.bb *.bbg gmon.out - rm -rf tsrc target_source - rm -f testloadext.dll libtestloadext.so - rm -f sqlite3.c fts?amal.c tclsqlite3.c - rm -f $(SHPREFIX)sqlite3.$(SO) Index: VERSION ================================================================== --- VERSION +++ VERSION @@ -1,1 +1,1 @@ -3.6.11 +3.6.4 Index: aclocal.m4 ================================================================== --- aclocal.m4 +++ aclocal.m4 @@ -1,6 +1,6 @@ -# generated automatically by aclocal 1.10.2 -*- Autoconf -*- +# generated automatically by aclocal 1.10.1 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -385,16 +385,16 @@ # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], -[m4_assert([$# <= 2])dnl -_$0(m4_quote(m4_default([$1], [[, ]])), - m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), - m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) -m4_define([_lt_decl_varnames_tagged], -[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) +[_$0(m4_quote(m4_default([$1], [[, ]])), + m4_quote(m4_if([$2], [], + m4_quote(lt_decl_tag_varnames), + m4_quote(m4_shift($@)))), + m4_split(m4_normalize(m4_quote(_LT_TAGS))))]) +m4_define([_lt_decl_varnames_tagged], [lt_combine([$1], [$2], [_], $3)]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], @@ -950,14 +950,14 @@ case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; - darwin*) # darwin 5.x on + darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment - # target defaults to 10.4. Don't you love it? + # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; @@ -995,15 +995,11 @@ _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(whole_archive_flag_spec, $1)='' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" - case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test "$_lt_dar_can_shared" = "yes"; then + if test "$GCC" = "yes"; then output_verbose_link_cmd=echo _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" @@ -1521,11 +1517,11 @@ # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; - cygwin* | mingw* | cegcc*) + cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). @@ -1688,10 +1684,14 @@ # endif # endif # endif # endif #endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -1704,11 +1704,11 @@ /* dlclose (self); */ } else puts (dlerror ()); - return status; + exit (status); }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? @@ -1743,11 +1743,11 @@ lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; - mingw* | pw32* | cegcc*) + mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) @@ -2040,11 +2040,10 @@ # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl -m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then @@ -2205,18 +2204,18 @@ # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ @@ -2235,11 +2234,11 @@ cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; - mingw* | cegcc*) + mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by @@ -2674,11 +2673,11 @@ tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + library_name_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; @@ -2698,11 +2697,11 @@ variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi - + if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" @@ -2975,11 +2974,10 @@ # ---------------------- # how to check for library dependencies # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_MAGIC_METHOD], [m4_require([_LT_DECL_EGREP]) -m4_require([_LT_DECL_OBJDUMP]) AC_CACHE_CHECK([how to recognize dependent libraries], lt_cv_deplibs_check_method, [lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' @@ -3026,16 +3024,10 @@ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; -cegcc) - # use the weaker test based on 'objdump'. See mingw*. - lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) @@ -3343,11 +3335,11 @@ # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | pw32*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' @@ -3589,11 +3581,11 @@ ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - mingw* | cygwin* | os2* | pw32* | cegcc*) + mingw* | cygwin* | os2* | pw32*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], @@ -3616,15 +3608,14 @@ if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. case $host_cpu in - hppa*64*) + hppa*64*|ia64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac @@ -3718,21 +3709,14 @@ KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; - ecpc* ) - # old Intel C++ for x86_64 which still supported -KPIC. + icpc* | ecpc* ) + # Intel C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - icpc* ) - # Intel C++, used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' @@ -3896,11 +3880,11 @@ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], @@ -3912,15 +3896,14 @@ # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. case $host_cpu in - hppa*64*) + hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; @@ -3966,11 +3949,11 @@ else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; @@ -3997,29 +3980,15 @@ _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu) case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. - ecc*) + icc* | ecc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' - _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' - _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' - _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' - ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' @@ -4197,11 +4166,11 @@ fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; - cygwin* | mingw* | cegcc*) + cygwin* | mingw*) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; @@ -4249,11 +4218,11 @@ # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no @@ -4336,11 +4305,11 @@ else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | pw32*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no @@ -4402,13 +4371,10 @@ tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; - lf95*) # Lahey Fortran 8.1 - _LT_TAGVAR(whole_archive_flag_spec, $1)= - tmp_sharedflag='--shared' ;; xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; esac case `$CC -V 2>&1 | sed 5q` in @@ -4636,11 +4602,10 @@ shared_flag='${wl}-bM:SRE' fi fi fi - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), @@ -4691,11 +4656,11 @@ bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' @@ -4795,11 +4760,11 @@ case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac @@ -5576,11 +5541,10 @@ shared_flag='${wl}-bM:SRE' fi fi fi - _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then @@ -5635,11 +5599,11 @@ _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | pw32*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no @@ -7015,22 +6979,10 @@ _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) - -# _LT_DECL_OBJDUMP -# -------------- -# If we don't have a new enough Autoconf to choose the best objdump -# available, choose the one first in the user's PATH. -m4_defun([_LT_DECL_OBJDUMP], -[AC_CHECK_TOOL(OBJDUMP, objdump, false) -test -z "$OBJDUMP" && OBJDUMP=objdump -_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) -AC_SUBST([OBJDUMP]) -]) - # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. @@ -7488,11 +7440,11 @@ # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in -*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) +*-*-cygwin* | *-*-mingw* | *-*-pw32*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac @@ -7729,18 +7681,18 @@ LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) # ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # -# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. -# Written by Gary V. Vaughan, 2004 +# Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. +# Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. -# serial 6 ltsugar.m4 +# serial 5 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) @@ -7792,18 +7744,18 @@ # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. -# Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], -[m4_if(m4_eval([$# > 3]), [1], - [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl -[[m4_foreach([_Lt_prefix], [$2], - [m4_foreach([_Lt_suffix], - ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, - [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) +[m4_if([$2], [], [], + [m4_if([$4], [], [], + [lt_join(m4_quote(m4_default([$1], [[, ]])), + lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_prefix, [$2], + [m4_foreach(_Lt_suffix, lt_car([m4_shiftn(3, $@)]), + [_Lt_prefix[]$3[]_Lt_suffix ])])))))])])dnl +]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited @@ -7862,19 +7814,19 @@ # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # Generated from ltversion.in. -# serial 3012 ltversion.m4 +# serial 2976 ltversion.m4 # This file is part of GNU Libtool -m4_define([LT_PACKAGE_VERSION], [2.2.6]) -m4_define([LT_PACKAGE_REVISION], [1.3012]) +m4_define([LT_PACKAGE_VERSION], [2.2.4]) +m4_define([LT_PACKAGE_REVISION], [1.2976]) AC_DEFUN([LTVERSION_VERSION], -[macro_version='2.2.6' -macro_revision='1.3012' +[macro_version='2.2.4' +macro_revision='1.2976' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) # lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- Index: config.h.in ================================================================== --- config.h.in +++ config.h.in @@ -1,104 +1,95 @@ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Define to 1 if you have the header file. */ -#undef HAVE_DLFCN_H - -/* Define to 1 if you have the `fdatasync' function. */ -#undef HAVE_FDATASYNC - -/* Define to 1 if you have the `gmtime_r' function. */ -#undef HAVE_GMTIME_R - -/* Define to 1 if the system has the type `int16_t'. */ -#undef HAVE_INT16_T - -/* Define to 1 if the system has the type `int32_t'. */ -#undef HAVE_INT32_T - -/* Define to 1 if the system has the type `int64_t'. */ -#undef HAVE_INT64_T - -/* Define to 1 if the system has the type `int8_t'. */ +/* +** 2008 March 6 +** +** 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. +** +************************************************************************* +** Configuration header template to be filled in by 'configure' script +** +** @(#) $Id: config.h.in,v 1.3 2008/07/22 05:05:02 shane Exp $ +*/ +#ifndef _CONFIG_H_ +#define _CONFIG_H_ + + +/***************************** +** Data types +*****************************/ + +/* Define as 1 if you have the int8_t type */ #undef HAVE_INT8_T -/* Define to 1 if the system has the type `intptr_t'. */ -#undef HAVE_INTPTR_T - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the `localtime_r' function. */ -#undef HAVE_LOCALTIME_R - -/* Define to 1 if you have the `localtime_s' function. */ -#undef HAVE_LOCALTIME_S - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ +/* Define as 1 if you have the int16_t type */ +#undef HAVE_INT16_T + +/* Define as 1 if you have the int32_t type */ +#undef HAVE_INT32_T + +/* Define as 1 if you have the int64_t type */ +#undef HAVE_INT64_T + +/* Define as 1 if you have the uint8_t type */ +#undef HAVE_UINT8_T + +/* Define as 1 if you have the uint16_t type */ +#undef HAVE_UINT16_T + +/* Define as 1 if you have the uint32_t type */ +#undef HAVE_UINT32_T + +/* Define as 1 if you have the uint64_t type */ +#undef HAVE_UINT64_T + + +/***************************** +** Header Files +*****************************/ + +/* Define as 1 if you have the sys/types.h header */ #undef HAVE_SYS_TYPES_H -/* Define to 1 if the system has the type `uint16_t'. */ -#undef HAVE_UINT16_T - -/* Define to 1 if the system has the type `uint32_t'. */ -#undef HAVE_UINT32_T - -/* Define to 1 if the system has the type `uint64_t'. */ -#undef HAVE_UINT64_T - -/* Define to 1 if the system has the type `uint8_t'. */ -#undef HAVE_UINT8_T - -/* Define to 1 if the system has the type `uintptr_t'. */ -#undef HAVE_UINTPTR_T - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the `usleep' function. */ +/* Define as 1 if you have the stdlib.h header */ +#undef HAVE_STDLIB_H + +/* Define as 1 if you have the stdint.h header */ +#undef HAVE_STDINT_H + +/* Define as 1 if you have the inttypes.h header */ +#undef HAVE_INTTYPES_H + + +/***************************** +** Functions +*****************************/ + +/* Define as 1 if you have the usleep() function */ #undef HAVE_USLEEP -/* Define to the sub-directory in which libtool stores uninstalled libraries. - */ -#undef LT_OBJDIR - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Number of bits in a file offset, on hosts where this is settable. */ -#undef _FILE_OFFSET_BITS - -/* Define for large files, on AIX-style hosts. */ -#undef _LARGE_FILES +/* Define as 1 if you have the fdatasync() function */ +#undef HAVE_FDATASYNC + +/* Define as 1 if you have the gmtime_r() function */ +#undef HAVE_GMTIME_R + +/* Define as 1 if you have the localtime_r() function */ +#undef HAVE_LOCALTIME_R + +/* Define as 1 if you have the localtime_s() function */ +#undef HAVE_LOCALTIME_S + + +/***************************** +** Large file support +*****************************/ + +#undef _FILE_OFFSET_BITS +#undef _LARGE_FILES + + +/* End of header */ +#endif Index: configure ================================================================== --- configure +++ configure @@ -1,577 +1,247 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63 for sqlite 3.6.10. +# Generated by GNU Autoconf 2.59 for sqlite 3.6.1. # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh +# Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - # Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done +$as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then +if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. -as_me=`$as_basename -- "$0" || +as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - -if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes -else - as_have_required=no -fi - - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : -else - as_candidate_shells= + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - case $as_dir in - /*) - for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" - done;; - esac -done -IFS=$as_save_IFS - - - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break -fi - -fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi - - -fi - -fi - - - -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell bug-autoconf@gnu.org about your system, - echo including any error possibly output before this message. - echo This can help us improve future autoconf versions. - echo Configuration will now proceed without shell functions. -} - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop - s/-\n.*// + s,-$,, + s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno # Exit status is that of the last command. exit } -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then + +if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} @@ -718,232 +388,83 @@ fi -exec 7<&0 &1 - # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 # # Initializations. # ac_default_prefix=/usr/local -ac_clean_files= ac_config_libobj_dir=. -LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} # Identity of this package. PACKAGE_NAME='sqlite' PACKAGE_TARNAME='sqlite' -PACKAGE_VERSION='3.6.10' -PACKAGE_STRING='sqlite 3.6.10' +PACKAGE_VERSION='3.6.1' +PACKAGE_STRING='sqlite 3.6.1' PACKAGE_BUGREPORT='' # Factoring default headers for most tests. ac_includes_default="\ #include -#ifdef HAVE_SYS_TYPES_H +#if HAVE_SYS_TYPES_H # include #endif -#ifdef HAVE_SYS_STAT_H +#if HAVE_SYS_STAT_H # include #endif -#ifdef STDC_HEADERS +#if STDC_HEADERS # include # include #else -# ifdef HAVE_STDLIB_H +# if HAVE_STDLIB_H # include # endif #endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif -#ifdef HAVE_STRINGS_H +#if HAVE_STRINGS_H # include #endif -#ifdef HAVE_INTTYPES_H +#if HAVE_INTTYPES_H # include -#endif -#ifdef HAVE_STDINT_H -# include +#else +# if HAVE_STDINT_H +# include +# endif #endif -#ifdef HAVE_UNISTD_H +#if HAVE_UNISTD_H # include #endif" -ac_subst_vars='LTLIBOBJS -LIBOBJS -BUILD_CFLAGS -USE_GCOV -OPT_FEATURE_FLAGS -USE_AMALGAMATION -TARGET_DEBUG -TARGET_HAVE_READLINE -TARGET_READLINE_INC -TARGET_READLINE_LIBS -HAVE_TCL -TCL_STUB_LIB_SPEC -TCL_STUB_LIB_FLAG -TCL_STUB_LIB_FILE -TCL_LIB_SPEC -TCL_LIB_FLAG -TCL_LIB_FILE -TCL_INCLUDE_SPEC -TCL_LIBS -TCL_SRC_DIR -TCL_BIN_DIR -TCL_VERSION -TARGET_EXEEXT -SQLITE_OS_OS2 -SQLITE_OS_WIN -SQLITE_OS_UNIX -BUILD_EXEEXT -TEMP_STORE -ALLOWRELEASE -THREADSOVERRIDELOCKS -XTHREADCONNECT -SQLITE_THREADSAFE -BUILD_CC -VERSION_NUMBER -RELEASE -VERSION -program_prefix -TCLLIBDIR -TCLSH_CMD -AWK -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -CPP -OTOOL64 -OTOOL -LIPO -NMEDIT -DSYMUTIL -lt_ECHO -RANLIB -STRIP -AR -OBJDUMP -LN_S -NM -ac_ct_DUMPBIN -DUMPBIN -LD -FGREP -EGREP -GREP -SED -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -LIBTOOL -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME -PATH_SEPARATOR -SHELL' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS LIBTOOL build build_cpu build_vendor build_os host host_cpu host_vendor host_os CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT SED EGREP FGREP GREP LD DUMPBIN ac_ct_DUMPBIN NM LN_S AR ac_ct_AR STRIP ac_ct_STRIP RANLIB ac_ct_RANLIB lt_ECHO DSYMUTIL ac_ct_DSYMUTIL NMEDIT ac_ct_NMEDIT LIPO ac_ct_LIPO OTOOL ac_ct_OTOOL OTOOL64 ac_ct_OTOOL64 CPP INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AWK TCLSH_CMD program_prefix VERSION RELEASE VERSION_NUMBER BUILD_CC SQLITE_THREADSAFE XTHREADCONNECT THREADSOVERRIDELOCKS ALLOWRELEASE TEMP_STORE BUILD_EXEEXT SQLITE_OS_UNIX SQLITE_OS_WIN SQLITE_OS_OS2 TARGET_EXEEXT TCL_VERSION TCL_BIN_DIR TCL_SRC_DIR TCL_LIBS TCL_INCLUDE_SPEC TCL_LIB_FILE TCL_LIB_FLAG TCL_LIB_SPEC TCL_STUB_LIB_FILE TCL_STUB_LIB_FLAG TCL_STUB_LIB_SPEC HAVE_TCL TARGET_READLINE_LIBS TARGET_READLINE_INC TARGET_HAVE_READLINE TARGET_DEBUG USE_AMALGAMATION OPT_FEATURE_FLAGS USE_GCOV BUILD_CFLAGS LIBOBJS LTLIBOBJS' ac_subst_files='' -ac_user_opts=' -enable_option_checking -enable_shared -enable_static -with_pic -enable_fast_install -with_gnu_ld -enable_libtool_lock -enable_largefile -with_hints -enable_threadsafe -enable_cross_thread_connections -enable_threads_override_locks -enable_releasemode -enable_tempstore -enable_tcl -with_tcl -enable_readline -with_readline_lib -with_readline_inc -enable_debug -enable_amalgamation -enable_load_extension -enable_gcov -' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP -TCLLIBDIR' - # Initialize some variables set by options. ac_init_help= ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= @@ -962,52 +483,38 @@ # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' +datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' +infodir='${prefix}/info' +mandir='${prefix}/man' ac_prev= -ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option + eval "$ac_prev=\$ac_option" ac_prev= continue fi - case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; - esac + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; + case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; @@ -1025,65 +532,37 @@ cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad) + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) datadir=$ac_optarg ;; - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; esac - eval enable_$ac_useropt=\$ac_optarg ;; + eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; @@ -1106,16 +585,10 @@ -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) @@ -1136,20 +609,17 @@ ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) @@ -1210,20 +680,10 @@ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) @@ -1270,42 +730,30 @@ -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; esac - eval with_$ac_useropt=\$ac_optarg ;; + eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; @@ -1321,70 +769,63 @@ ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) { $as_echo "$as_me: error: unrecognized option: $ac_option + -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } - eval $ac_envvar=\$ac_optarg + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { $as_echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 - { (exit 1); exit 1; }; } ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. @@ -1394,11 +835,11 @@ # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi @@ -1406,90 +847,88 @@ ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { $as_echo "$as_me: error: working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } - # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` + # Try the directory containing this script, then its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then + if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 - { (exit 1); exit 1; }; } - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP # # Report the --help message. # 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.6.10 to adapt to many kinds of systems. +\`configure' configures sqlite 3.6.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. @@ -1505,43 +944,39 @@ --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] +_ACEOF + + cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/sqlite] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF System types: @@ -1550,20 +985,21 @@ _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sqlite 3.6.10:";; + short | recursive ) echo "Configuration of sqlite 3.6.1:";; esac cat <<\_ACEOF Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-shared[=PKGS] build shared libraries [default=yes] - --enable-static[=PKGS] build static libraries [default=yes] + --enable-shared[=PKGS] + build shared libraries [default=yes] + --enable-static[=PKGS] + build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-largefile omit support for large files --enable-threadsafe Support threadsafe operation @@ -1597,102 +1033,132 @@ Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if - you have headers in a nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory CPP C preprocessor - TCLLIBDIR Where to install tcl plugin Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF -ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. + ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue + test -d $ac_dir || continue ac_builddir=. -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi case $srcdir in - .) # We are building in place. + .) # No --srcdir option. We are building in place. ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir done fi -test -n "$ac_init_help" && exit $ac_status +test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -sqlite configure 3.6.10 -generated by GNU Autoconf 2.63 +sqlite configure 3.6.1 +generated by GNU Autoconf 2.59 -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF - exit + exit 0 fi -cat >config.log <<_ACEOF +exec 5>config.log +cat >&5 <<_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.6.10, which was -generated by GNU Autoconf 2.63. Invocation command line was +It was created by sqlite $as_me 3.6.1, which was +generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF -exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## @@ -1707,11 +1173,11 @@ /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME @@ -1719,13 +1185,12 @@ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" + echo "PATH: $as_dir" done -IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF @@ -1743,10 +1208,11 @@ # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= +ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do @@ -1753,12 +1219,12 @@ case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; - *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" @@ -1775,11 +1241,13 @@ esac ;; -* ) ac_must_keep_next=true ;; esac fi - ac_configure_args="$ac_configure_args '$ac_arg'" + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } @@ -1786,12 +1254,12 @@ $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo @@ -1800,39 +1268,24 @@ ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done +{ (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; - esac | - sort -) + esac; +} echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## @@ -1839,32 +1292,26 @@ ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX -## ------------------- ## -## File substitutions. ## -## ------------------- ## +## ------------- ## +## Output files. ## +## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - $as_echo "$ac_var='\''$ac_val'\''" + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi if test -s confdefs.h; then @@ -1872,28 +1319,30 @@ ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo - cat confdefs.h + sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status -' 0 + ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" @@ -1919,158 +1368,144 @@ #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE -if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE -elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site -else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" -do - test "x$ac_site_file" = xNONE && continue +for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then - { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then - { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; esac fi else - { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then - { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi - - - - - - - - - - - - - - - - - - - - - - - - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + + + + + + + + + + # The following RCS revision string applies to configure.in -# $Revision: 1.67 $ +# $Revision: 1.64 $ ######### # Programs needed # case `pwd` in *\ * | *\ *) - { $as_echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 -$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; + { echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 +echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac -macro_version='2.2.6' -macro_revision='1.3012' +macro_version='2.2.4' +macro_revision='1.2976' @@ -2083,121 +1518,86 @@ ltmain="$ac_aux_dir/ltmain.sh" ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break - elif test -f "$ac_dir/install.sh"; then + elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break - elif test -f "$ac_dir/shtool"; then + elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then - { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 -$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } -{ $as_echo "$as_me:$LINENO: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } +echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 -$as_echo "$as_me: error: invalid value of canonical build" >&2;} - { (exit 1); exit 1; }; };; -esac +echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ $as_echo "$as_me:$LINENO: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + + +echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } -fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -$as_echo "$as_me: error: invalid value of canonical host" >&2;} - { (exit 1); exit 1; }; };; -esac +echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2204,14 +1604,94 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2218,40 +1698,38 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2258,93 +1736,42 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - - fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no @@ -2352,22 +1779,21 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift @@ -2381,29 +1807,28 @@ fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe + for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2410,44 +1835,42 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl.exe + for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -2454,94 +1877,62 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$ac_ct_CC" && break done - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi + CC=$ac_ct_CC fi fi -test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 -$as_echo "$as_me: error: no acceptable C compiler found in \$PATH +echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + { (exit 1); exit 1; }; } # Provide some information about the compiler. -$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -2556,189 +1947,149 @@ ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { (ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link_default") 2>&5 +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext break;; * ) break;; esac done -test "$ac_cv_exeext" = no && ac_cv_exeext= - else - ac_file='' -fi - -{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } -if test -z "$ac_file"; then - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 -$as_echo "$as_me: error: C compiler cannot create executables +echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 -# Check that the compiler produces executables we can run. If not, either +# Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot run C compiled programs. +echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + { (exit 1); exit 1; }; } fi fi fi -{ $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check that the compiler produces executables we can run. If not, either +# Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } - -{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext break;; * ) break;; esac done else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext -{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2752,52 +2103,43 @@ ; return 0; } _ACEOF rm -f conftest.o conftest.obj -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>&5 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile +echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2814,188 +2156,101 @@ ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_compiler_gnu=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_compiler_gnu=no +ac_compiler_gnu=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_prog_cc_g=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" @@ -3007,16 +2262,16 @@ CFLAGS="-O2" else CFLAGS= fi fi -{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_prog_cc_c89=no + ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3046,21 +2301,16 @@ } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get + as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ + that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; @@ -3071,138 +2321,273 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_c89=$ac_arg -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { $as_echo "$as_me:$LINENO: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:$LINENO: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; -esac - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -{ $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 -$as_echo_n "checking for a sed that does not truncate output... " >&6; } -if test "${ac_cv_path_SED+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ - for ac_i in 1 2 3 4 5 6 7; do - ac_script="$ac_script$as_nl$ac_script" - done - echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed - $as_unset ac_script || ac_script= - if test -z "$SED"; then - ac_path_SED_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in sed gsed; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue -# Check for GNU ac_path_SED and select it if it is found. - # Check for GNU $ac_path_SED -case `"$ac_path_SED" --version 2>&1` in -*GNU*) - ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo '' >> "conftest.nl" - "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_SED_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_SED="$ac_path_SED" - ac_path_SED_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_SED_found && break 3 - done - done -done -IFS=$as_save_IFS - if test -z "$ac_cv_path_SED"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable sed could be found in \$PATH" >&5 -$as_echo "$as_me: error: no acceptable sed could be found in \$PATH" >&2;} - { (exit 1); exit 1; }; } - fi -else - ac_cv_path_SED=$SED -fi - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5 -$as_echo "$ac_cv_path_SED" >&6; } - SED="$ac_cv_path_SED" - rm -f conftest.sed +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 +echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6 +if test "${lt_cv_path_SED+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Loop through the user's path and test for sed and gsed. +# Then use that list of sed's as ones to test for truncation. +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for lt_ac_prog in sed gsed; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then + lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" + fi + done + done +done +IFS=$as_save_IFS +lt_ac_max=0 +lt_ac_count=0 +# Add /usr/xpg4/bin/sed as it is typically found on Solaris +# along with /bin/sed that truncates output. +for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do + test ! -f $lt_ac_sed && continue + cat /dev/null > conftest.in + lt_ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >conftest.in + # Check for GNU sed and select it if it is found. + if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then + lt_cv_path_SED=$lt_ac_sed + break + fi + while true; do + cat conftest.in conftest.in >conftest.tmp + mv conftest.tmp conftest.in + cp conftest.in conftest.nl + echo >>conftest.nl + $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break + cmp -s conftest.out conftest.nl || break + # 10000 chars as input seems more than enough + test $lt_ac_count -gt 10 && break + lt_ac_count=`expr $lt_ac_count + 1` + if test $lt_ac_count -gt $lt_ac_max; then + lt_ac_max=$lt_ac_count + lt_cv_path_SED=$lt_ac_sed + fi + done +done + +fi + +SED=$lt_cv_path_SED + +echo "$as_me:$LINENO: result: $SED" >&5 +echo "${ECHO_T}$SED" >&6 test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" @@ -3213,211 +2598,38 @@ -{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done -done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done -done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:$LINENO: checking for fgrep" >&5 -$as_echo_n "checking for fgrep... " >&6; } -if test "${ac_cv_path_FGREP+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 - then ac_cv_path_FGREP="$GREP -F" - else - if test -z "$FGREP"; then - ac_path_FGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in fgrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue -# Check for GNU ac_path_FGREP and select it if it is found. - # Check for GNU $ac_path_FGREP -case `"$ac_path_FGREP" --version 2>&1` in -*GNU*) - ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'FGREP' >> "conftest.nl" - "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_FGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_FGREP="$ac_path_FGREP" - ac_path_FGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_FGREP_found && break 3 - done - done -done -IFS=$as_save_IFS - if test -z "$ac_cv_path_FGREP"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -$as_echo "$as_me: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } - fi -else - ac_cv_path_FGREP=$FGREP -fi - - fi -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_FGREP" >&5 -$as_echo "$ac_cv_path_FGREP" >&6; } - FGREP="$ac_cv_path_FGREP" +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep + + +echo "$as_me:$LINENO: checking for fgrep" >&5 +echo $ECHO_N "checking for fgrep... $ECHO_C" >&6 +if test "${ac_cv_prog_fgrep+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo 'ab*c' | (grep -F 'ab*c') >/dev/null 2>&1 + then ac_cv_prog_fgrep='grep -F' + else ac_cv_prog_fgrep='fgrep' + fi +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_fgrep" >&5 +echo "${ECHO_T}$ac_cv_prog_fgrep" >&6 + FGREP=$ac_cv_prog_fgrep test -z "$GREP" && GREP=grep @@ -3436,22 +2648,22 @@ -# Check whether --with-gnu-ld was given. +# Check whether --with-gnu-ld or --without-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then - withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes + withval="$with_gnu_ld" + test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no -fi - +fi; ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. - { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5 -$as_echo_n "checking for ld used by $CC... " >&6; } + echo "$as_me:$LINENO: checking for ld used by $CC" >&5 +echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6 case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) @@ -3476,18 +2688,18 @@ # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then - { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5 -$as_echo_n "checking for GNU ld... " >&6; } + echo "$as_me:$LINENO: checking for GNU ld" >&5 +echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6 else - { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5 -$as_echo_n "checking for non-GNU ld... " >&6; } + echo "$as_me:$LINENO: checking for non-GNU ld" >&5 +echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6 fi if test "${lt_cv_path_LD+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" @@ -3513,23 +2725,23 @@ fi fi LD="$lt_cv_path_LD" if test -n "$LD"; then - { $as_echo "$as_me:$LINENO: result: $LD" >&5 -$as_echo "$LD" >&6; } + echo "$as_me:$LINENO: result: $LD" >&5 +echo "${ECHO_T}$LD" >&6 else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi -test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 -$as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} +test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 +echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } -{ $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 -$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } +echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 +echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6 if test "${lt_cv_prog_gnu_ld+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 -$as_echo "$lt_cv_prog_gnu_ld" >&6; } +echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5 +echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6 with_gnu_ld=$lt_cv_prog_gnu_ld @@ -3549,14 +2761,14 @@ -{ $as_echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5 -$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } +echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5 +echo $ECHO_N "checking for BSD- or MS-compatible name lister (nm)... $ECHO_C" >&6 if test "${lt_cv_path_NM+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else @@ -3598,25 +2810,25 @@ IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 -$as_echo "$lt_cv_path_NM" >&6; } +echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 +echo "${ECHO_T}$lt_cv_path_NM" >&6 if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$ac_tool_prefix"; then for ac_prog in "dumpbin -symbols" "link -dump -symbols" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_DUMPBIN+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3623,30 +2835,28 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then - { $as_echo "$as_me:$LINENO: result: $DUMPBIN" >&5 -$as_echo "$DUMPBIN" >&6; } + echo "$as_me:$LINENO: result: $DUMPBIN" >&5 +echo "${ECHO_T}$DUMPBIN" >&6 else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then @@ -3653,14 +2863,14 @@ ac_ct_DUMPBIN=$DUMPBIN for ac_prog in "dumpbin -symbols" "link -dump -symbols" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -3667,45 +2877,34 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5 -$as_echo "$ac_ct_DUMPBIN" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5 +echo "${ECHO_T}$ac_ct_DUMPBIN" >&6 else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$ac_ct_DUMPBIN" && break done - - if test "x$ac_ct_DUMPBIN" = x; then - DUMPBIN=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DUMPBIN=$ac_ct_DUMPBIN - fi +test -n "$ac_ct_DUMPBIN" || ac_ct_DUMPBIN=":" + + DUMPBIN=$ac_ct_DUMPBIN fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" @@ -3716,49 +2915,49 @@ -{ $as_echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5 -$as_echo_n "checking the name lister ($NM) interface... " >&6; } +echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5 +echo $ECHO_N "checking the name lister ($NM) interface... $ECHO_C" >&6 if test "${lt_cv_nm_interface+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext - (eval echo "\"\$as_me:3728: $ac_compile\"" >&5) + (eval echo "\"\$as_me:2927: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 - (eval echo "\"\$as_me:3731: $NM \\\"conftest.$ac_objext\\\"\"" >&5) + (eval echo "\"\$as_me:2930: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 - (eval echo "\"\$as_me:3734: output\"" >&5) + (eval echo "\"\$as_me:2933: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5 -$as_echo "$lt_cv_nm_interface" >&6; } +echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5 +echo "${ECHO_T}$lt_cv_nm_interface" >&6 -{ $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5 -$as_echo_n "checking whether ln -s works... " >&6; } +echo "$as_me:$LINENO: checking whether ln -s works" >&5 +echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else - { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5 -$as_echo "no, using $LN_S" >&6; } + echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +echo "${ECHO_T}no, using $LN_S" >&6 fi # find the maximum length of command line arguments -{ $as_echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 -$as_echo_n "checking the maximum length of command line arguments... " >&6; } +echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 +echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6 if test "${lt_cv_sys_max_cmd_len+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else i=0 teststring="ABCD" case $build_os in @@ -3775,11 +2974,11 @@ # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; - cygwin* | mingw* | cegcc*) + cygwin* | mingw*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). @@ -3871,15 +3070,15 @@ esac fi if test -n $lt_cv_sys_max_cmd_len ; then - { $as_echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 -$as_echo "$lt_cv_sys_max_cmd_len" >&6; } + echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 +echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6 else - { $as_echo "$as_me:$LINENO: result: none" >&5 -$as_echo "none" >&6; } + echo "$as_me:$LINENO: result: none" >&5 +echo "${ECHO_T}none" >&6 fi max_cmd_len=$lt_cv_sys_max_cmd_len @@ -3888,32 +3087,32 @@ : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} -{ $as_echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5 -$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } +echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5 +echo $ECHO_N "checking whether the shell understands some XSI constructs... $ECHO_C" >&6 # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes -{ $as_echo "$as_me:$LINENO: result: $xsi_shell" >&5 -$as_echo "$xsi_shell" >&6; } +echo "$as_me:$LINENO: result: $xsi_shell" >&5 +echo "${ECHO_T}$xsi_shell" >&6 -{ $as_echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5 -$as_echo_n "checking whether the shell understands \"+=\"... " >&6; } +echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5 +echo $ECHO_N "checking whether the shell understands \"+=\"... $ECHO_C" >&6 lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes -{ $as_echo "$as_me:$LINENO: result: $lt_shell_append" >&5 -$as_echo "$lt_shell_append" >&6; } +echo "$as_me:$LINENO: result: $lt_shell_append" >&5 +echo "${ECHO_T}$lt_shell_append" >&6 if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else @@ -3943,19 +3142,19 @@ -{ $as_echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 -$as_echo_n "checking for $LD option to reload object files... " >&6; } +echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 +echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6 if test "${lt_cv_ld_reload_flag+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_reload_flag='-r' fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 -$as_echo "$lt_cv_ld_reload_flag" >&6; } +echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 +echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6 reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac @@ -3976,116 +3175,15 @@ -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. -set dummy ${ac_tool_prefix}objdump; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_OBJDUMP+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$OBJDUMP"; then - ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -OBJDUMP=$ac_cv_prog_OBJDUMP -if test -n "$OBJDUMP"; then - { $as_echo "$as_me:$LINENO: result: $OBJDUMP" >&5 -$as_echo "$OBJDUMP" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OBJDUMP"; then - ac_ct_OBJDUMP=$OBJDUMP - # Extract the first word of "objdump", so it can be a program name with args. -set dummy objdump; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_OBJDUMP"; then - ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_OBJDUMP="objdump" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP -if test -n "$ac_ct_OBJDUMP"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5 -$as_echo "$ac_ct_OBJDUMP" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OBJDUMP" = x; then - OBJDUMP="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OBJDUMP=$ac_ct_OBJDUMP - fi -else - OBJDUMP="$ac_cv_prog_OBJDUMP" -fi - -test -z "$OBJDUMP" && OBJDUMP=objdump - - - - - - - - - -{ $as_echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 -$as_echo_n "checking how to recognize dependent libraries... " >&6; } + +echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 +echo $ECHO_N "checking how to recognize dependent libraries... $ECHO_C" >&6 if test "${lt_cv_deplibs_check_method+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support @@ -4131,16 +3229,10 @@ lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; -cegcc) - # use the weaker test based on 'objdump'. See mingw*. - lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' - lt_cv_file_magic_cmd='$OBJDUMP -f' - ;; - darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) @@ -4274,12 +3366,12 @@ lt_cv_deplibs_check_method=pass_all ;; esac fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 -$as_echo "$lt_cv_deplibs_check_method" >&6; } +echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 +echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6 file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown @@ -4294,14 +3386,14 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AR+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4308,40 +3400,38 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - { $as_echo "$as_me:$LINENO: result: $AR" >&5 -$as_echo "$AR" >&6; } + echo "$as_me:$LINENO: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4348,41 +3438,31 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS + test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false" fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 -$as_echo "$ac_ct_AR" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_AR" = x; then - AR="false" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - AR=$ac_ct_AR - fi + echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + AR=$ac_ct_AR else AR="$ac_cv_prog_AR" fi test -z "$AR" && AR=ar @@ -4399,14 +3479,14 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4413,40 +3493,38 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4453,41 +3531,31 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS + test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":" fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: @@ -4498,14 +3566,14 @@ if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4512,40 +3580,38 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 -$as_echo "$RANLIB" >&6; } + echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6 else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4552,41 +3618,31 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS + test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 -$as_echo "$ac_ct_RANLIB" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_RANLIB" = x; then - RANLIB=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - RANLIB=$ac_ct_RANLIB - fi + echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: @@ -4655,14 +3711,14 @@ # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. -{ $as_echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 -$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } +echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 +echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6 if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] @@ -4675,11 +3731,11 @@ # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | pw32*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' @@ -4776,18 +3832,18 @@ _LT_EOF if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else @@ -4840,11 +3896,11 @@ LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" @@ -4875,15 +3931,15 @@ if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then - { $as_echo "$as_me:$LINENO: result: failed" >&5 -$as_echo "failed" >&6; } + echo "$as_me:$LINENO: result: failed" >&5 +echo "${ECHO_T}failed" >&6 else - { $as_echo "$as_me:$LINENO: result: ok" >&5 -$as_echo "ok" >&6; } + echo "$as_me:$LINENO: result: ok" >&5 +echo "${ECHO_T}ok" >&6 fi @@ -4904,15 +3960,15 @@ -# Check whether --enable-libtool-lock was given. +# Check whether --enable-libtool-lock or --disable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then - enableval=$enable_libtool_lock; -fi + enableval="$enable_libtool_lock" +fi; test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in @@ -4920,11 +3976,11 @@ # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; @@ -4935,15 +3991,15 @@ fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. - echo '#line 4940 "configure"' > conftest.$ac_ext + echo '#line 3996 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" @@ -4977,11 +4033,11 @@ # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) @@ -5027,14 +4083,14 @@ *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" - { $as_echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 -$as_echo_n "checking whether the C compiler needs -belf... " >&6; } + echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 +echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6 if test "${lt_cv_cc_needs_belf+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' @@ -5054,50 +4110,49 @@ ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then lt_cv_cc_needs_belf=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - lt_cv_cc_needs_belf=no +lt_cv_cc_needs_belf=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 -$as_echo "$lt_cv_cc_needs_belf" >&6; } +echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 +echo "${ECHO_T}$lt_cv_cc_needs_belf" >&6 if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; @@ -5105,11 +4160,11 @@ # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; @@ -5132,14 +4187,14 @@ case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_DSYMUTIL+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5146,40 +4201,38 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then - { $as_echo "$as_me:$LINENO: result: $DSYMUTIL" >&5 -$as_echo "$DSYMUTIL" >&6; } + echo "$as_me:$LINENO: result: $DSYMUTIL" >&5 +echo "${ECHO_T}$DSYMUTIL" >&6 else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5186,52 +4239,42 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS + test -z "$ac_cv_prog_ac_ct_DSYMUTIL" && ac_cv_prog_ac_ct_DSYMUTIL=":" fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5 -$as_echo "$ac_ct_DSYMUTIL" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_DSYMUTIL" = x; then - DSYMUTIL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - DSYMUTIL=$ac_ct_DSYMUTIL - fi + echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5 +echo "${ECHO_T}$ac_ct_DSYMUTIL" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + DSYMUTIL=$ac_ct_DSYMUTIL else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_NMEDIT+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5238,40 +4281,38 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then - { $as_echo "$as_me:$LINENO: result: $NMEDIT" >&5 -$as_echo "$NMEDIT" >&6; } + echo "$as_me:$LINENO: result: $NMEDIT" >&5 +echo "${ECHO_T}$NMEDIT" >&6 else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5278,52 +4319,42 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NMEDIT="nmedit" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS + test -z "$ac_cv_prog_ac_ct_NMEDIT" && ac_cv_prog_ac_ct_NMEDIT=":" fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5 -$as_echo "$ac_ct_NMEDIT" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_NMEDIT" = x; then - NMEDIT=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - NMEDIT=$ac_ct_NMEDIT - fi + echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5 +echo "${ECHO_T}$ac_ct_NMEDIT" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + NMEDIT=$ac_ct_NMEDIT else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_LIPO+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5330,40 +4361,38 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then - { $as_echo "$as_me:$LINENO: result: $LIPO" >&5 -$as_echo "$LIPO" >&6; } + echo "$as_me:$LINENO: result: $LIPO" >&5 +echo "${ECHO_T}$LIPO" >&6 else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5370,52 +4399,42 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_LIPO="lipo" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS + test -z "$ac_cv_prog_ac_ct_LIPO" && ac_cv_prog_ac_ct_LIPO=":" fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_LIPO" >&5 -$as_echo "$ac_ct_LIPO" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_LIPO" = x; then - LIPO=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - LIPO=$ac_ct_LIPO - fi + echo "$as_me:$LINENO: result: $ac_ct_LIPO" >&5 +echo "${ECHO_T}$ac_ct_LIPO" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + LIPO=$ac_ct_LIPO else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_OTOOL+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5422,40 +4441,38 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then - { $as_echo "$as_me:$LINENO: result: $OTOOL" >&5 -$as_echo "$OTOOL" >&6; } + echo "$as_me:$LINENO: result: $OTOOL" >&5 +echo "${ECHO_T}$OTOOL" >&6 else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5462,52 +4479,42 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL="otool" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS + test -z "$ac_cv_prog_ac_ct_OTOOL" && ac_cv_prog_ac_ct_OTOOL=":" fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL" >&5 -$as_echo "$ac_ct_OTOOL" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OTOOL" = x; then - OTOOL=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OTOOL=$ac_ct_OTOOL - fi + echo "$as_me:$LINENO: result: $ac_ct_OTOOL" >&5 +echo "${ECHO_T}$ac_ct_OTOOL" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + OTOOL=$ac_ct_OTOOL else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_OTOOL64+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5514,40 +4521,38 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then - { $as_echo "$as_me:$LINENO: result: $OTOOL64" >&5 -$as_echo "$OTOOL64" >&6; } + echo "$as_me:$LINENO: result: $OTOOL64" >&5 +echo "${ECHO_T}$OTOOL64" >&6 else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -5554,41 +4559,31 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OTOOL64="otool64" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS + test -z "$ac_cv_prog_ac_ct_OTOOL64" && ac_cv_prog_ac_ct_OTOOL64=":" fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL64" >&5 -$as_echo "$ac_ct_OTOOL64" >&6; } -else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_OTOOL64" = x; then - OTOOL64=":" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - OTOOL64=$ac_ct_OTOOL64 - fi + echo "$as_me:$LINENO: result: $ac_ct_OTOOL64" >&5 +echo "${ECHO_T}$ac_ct_OTOOL64" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + OTOOL64=$ac_ct_OTOOL64 else OTOOL64="$ac_cv_prog_OTOOL64" fi @@ -5615,14 +4610,14 @@ - { $as_echo "$as_me:$LINENO: checking for -single_module linker flag" >&5 -$as_echo_n "checking for -single_module linker flag... " >&6; } + echo "$as_me:$LINENO: checking for -single_module linker flag" >&5 +echo $ECHO_N "checking for -single_module linker flag... $ECHO_C" >&6 if test "${lt_cv_apple_cc_single_mod+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE @@ -5642,16 +4637,16 @@ fi rm -rf libconftest.dylib* rm -f conftest.* fi fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5 -$as_echo "$lt_cv_apple_cc_single_mod" >&6; } - { $as_echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5 -$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } +echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5 +echo "${ECHO_T}$lt_cv_apple_cc_single_mod" >&6 + echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5 +echo $ECHO_N "checking for -exported_symbols_list linker flag... $ECHO_C" >&6 if test "${lt_cv_ld_exported_symbols_list+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" @@ -5669,46 +4664,45 @@ ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then lt_cv_ld_exported_symbols_list=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - lt_cv_ld_exported_symbols_list=no +lt_cv_ld_exported_symbols_list=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5 -$as_echo "$lt_cv_ld_exported_symbols_list" >&6; } +echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5 +echo "${ECHO_T}$lt_cv_ld_exported_symbols_list" >&6 case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; @@ -5745,19 +4739,19 @@ ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false @@ -5780,76 +4774,76 @@ #else # include #endif Syntax error _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then : else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi - rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers + # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi - rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext @@ -5863,12 +4857,12 @@ fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi -{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 -$as_echo "$CPP" >&6; } +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. @@ -5887,104 +4881,102 @@ #else # include #endif Syntax error _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then : else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi - rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers + # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi - rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 -$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -6002,36 +4994,39 @@ ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_header_stdc=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_header_stdc=no +ac_cv_header_stdc=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6083,11 +5078,10 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include -#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ @@ -6103,54 +5097,40 @@ { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) - return 2; - return 0; + exit(2); + exit (0); } _ACEOF rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>&5 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_try") 2>&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -rf conftest.dSYM -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF @@ -6168,15 +5148,15 @@ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -6185,46 +5165,45 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done @@ -6231,15 +5210,15 @@ for ac_header in dlfcn.h do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -6248,46 +5227,45 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done @@ -6302,13 +5280,14 @@ enable_win32_dll=no - # Check whether --enable-shared was given. + # Check whether --enable-shared or --disable-shared was given. if test "${enable_shared+set}" = set; then - enableval=$enable_shared; p=${PACKAGE-default} + enableval="$enable_shared" + p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no @@ -6323,23 +5302,23 @@ IFS="$lt_save_ifs" ;; esac else enable_shared=yes -fi +fi; - - # Check whether --enable-static was given. + # Check whether --enable-static or --disable-static was given. if test "${enable_static+set}" = set; then - enableval=$enable_static; p=${PACKAGE-default} + enableval="$enable_static" + p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no @@ -6354,40 +5333,40 @@ IFS="$lt_save_ifs" ;; esac else enable_static=yes -fi +fi; - -# Check whether --with-pic was given. +# Check whether --with-pic or --without-pic was given. if test "${with_pic+set}" = set; then - withval=$with_pic; pic_mode="$withval" + withval="$with_pic" + pic_mode="$withval" else pic_mode=default -fi - +fi; test -z "$pic_mode" && pic_mode=default - # Check whether --enable-fast-install was given. + # Check whether --enable-fast-install or --disable-fast-install was given. if test "${enable_fast_install+set}" = set; then - enableval=$enable_fast_install; p=${PACKAGE-default} + enableval="$enable_fast_install" + p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no @@ -6402,12 +5381,11 @@ IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes -fi - +fi; @@ -6463,14 +5441,14 @@ if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi -{ $as_echo "$as_me:$LINENO: checking for objdir" >&5 -$as_echo_n "checking for objdir... " >&6; } +echo "$as_me:$LINENO: checking for objdir" >&5 +echo $ECHO_N "checking for objdir... $ECHO_C" >&6 if test "${lt_cv_objdir+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs @@ -6478,12 +5456,12 @@ # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 -$as_echo "$lt_cv_objdir" >&6; } +echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 +echo "${ECHO_T}$lt_cv_objdir" >&6 objdir=$lt_cv_objdir @@ -6571,14 +5549,14 @@ # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then - { $as_echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 -$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } + echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 +echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; @@ -6624,27 +5602,27 @@ esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then - { $as_echo "$as_me:$LINENO: checking for file" >&5 -$as_echo_n "checking for file... " >&6; } + echo "$as_me:$LINENO: checking for file" >&5 +echo $ECHO_N "checking for file... $ECHO_C" >&6 if test "${lt_cv_path_MAGIC_CMD+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; @@ -6690,15 +5668,15 @@ esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then - { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 -$as_echo "$MAGIC_CMD" >&6; } + echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 +echo "${ECHO_T}$MAGIC_CMD" >&6 else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi else MAGIC_CMD=: @@ -6770,14 +5748,14 @@ lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' - { $as_echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 -$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } + echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 +echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" @@ -6788,15 +5766,15 @@ # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:6793: $lt_compile\"" >&5) + (eval echo "\"\$as_me:5771: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:6797: \$? = $ac_status" >&5 + echo "$as_me:5775: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 @@ -6805,12 +5783,12 @@ fi fi $RM conftest* fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 -$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6 if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : @@ -6825,12 +5803,12 @@ lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= -{ $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 -$as_echo_n "checking for $compiler option to produce PIC... " >&6; } +echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 +echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6 if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' @@ -6860,11 +5838,11 @@ beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' @@ -6875,15 +5853,14 @@ # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; hpux*) - # PIC is the default for 64-bit PA HP-UX, but not for 32-bit - # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag - # sets the default TLS model and affects inlining. + # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but + # not for PA HP-UX. case $host_cpu in - hppa*64*) + hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; @@ -6929,11 +5906,11 @@ else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; - mingw* | cygwin* | pw32* | os2* | cegcc*) + mingw* | cygwin* | pw32* | os2*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; @@ -6959,29 +5936,15 @@ lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu) case $cc_basename in - # old Intel for x86_64 which still supported -KPIC. - ecc*) + icc* | ecc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; - # icc used to be incompatible with GCC. - # ICC 10 doesn't accept -KPIC any more. - icc* | ifort*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='-fPIC' - lt_prog_compiler_static='-static' - ;; - # Lahey Fortran 8.1. - lf95*) - lt_prog_compiler_wl='-Wl,' - lt_prog_compiler_pic='--shared' - lt_prog_compiler_static='--static' - ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' @@ -7097,12 +6060,12 @@ ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac -{ $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 -$as_echo "$lt_prog_compiler_pic" >&6; } +echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 +echo "${ECHO_T}$lt_prog_compiler_pic" >&6 @@ -7109,14 +6072,14 @@ # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then - { $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 -$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } + echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 +echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_pic_works+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" @@ -7127,15 +6090,15 @@ # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7132: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6095: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 - echo "$as_me:7136: \$? = $ac_status" >&5 + echo "$as_me:6099: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 @@ -7144,12 +6107,12 @@ fi fi $RM conftest* fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5 -$as_echo "$lt_cv_prog_compiler_pic_works" >&6; } +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_pic_works" >&6 if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; @@ -7168,14 +6131,14 @@ # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" -{ $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 -$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } +echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 +echo $ECHO_N "checking if $compiler static flag $lt_tmp_static_flag works... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_static_works+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext @@ -7196,12 +6159,12 @@ fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5 -$as_echo "$lt_cv_prog_compiler_static_works" >&6; } +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_static_works" >&6 if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= @@ -7211,14 +6174,14 @@ - { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } + echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest @@ -7232,15 +6195,15 @@ # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7237: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6200: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7241: \$? = $ac_status" >&5 + echo "$as_me:6204: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp @@ -7258,22 +6221,22 @@ cd .. $RM -r conftest $RM conftest* fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 - { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 -$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } + echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 +echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6 if test "${lt_cv_prog_compiler_c_o+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest @@ -7287,15 +6250,15 @@ # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` - (eval echo "\"\$as_me:7292: $lt_compile\"" >&5) + (eval echo "\"\$as_me:6255: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 - echo "$as_me:7296: \$? = $ac_status" >&5 + echo "$as_me:6259: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp @@ -7313,32 +6276,32 @@ cd .. $RM -r conftest $RM conftest* fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 -$as_echo "$lt_cv_prog_compiler_c_o" >&6; } +echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 +echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6 hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user - { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 -$as_echo_n "checking if we can lock with hard links... " >&6; } + echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 +echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6 hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no - { $as_echo "$as_me:$LINENO: result: $hard_links" >&5 -$as_echo "$hard_links" >&6; } + echo "$as_me:$LINENO: result: $hard_links" >&5 +echo "${ECHO_T}$hard_links" >&6 if test "$hard_links" = no; then - { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 -$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} + { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 +echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi @@ -7346,12 +6309,12 @@ - { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 -$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } + echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 +echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6 runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= @@ -7391,11 +6354,11 @@ # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no @@ -7478,11 +6441,11 @@ else ld_shlibs=no fi ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | pw32*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=no @@ -7544,13 +6507,10 @@ tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; - lf95*) # Lahey Fortran 8.1 - whole_archive_flag_spec= - tmp_sharedflag='--shared' ;; xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; esac case `$CC -V 2>&1 | sed 5q` in @@ -7778,11 +6738,10 @@ shared_flag='${wl}-bM:SRE' fi fi fi - export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), @@ -7804,30 +6763,31 @@ ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ @@ -7838,18 +6798,15 @@ # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" @@ -7875,30 +6832,31 @@ ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ @@ -7909,18 +6867,15 @@ # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, @@ -7953,11 +6908,11 @@ bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' @@ -7984,15 +6939,11 @@ hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='' link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" - case $cc_basename in - ifort*) _lt_dar_can_shared=yes ;; - *) _lt_dar_can_shared=$GCC ;; - esac - if test "$_lt_dar_can_shared" = "yes"; then + if test "$GCC" = "yes"; then output_verbose_link_cmd=echo archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" @@ -8080,11 +7031,11 @@ case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) - archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' + archive_cmds='$CC -shared ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac @@ -8133,41 +7084,39 @@ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat >conftest.$ac_ext <<_ACEOF int foo(void) {} _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' @@ -8420,12 +7369,12 @@ ;; esac fi fi -{ $as_echo "$as_me:$LINENO: result: $ld_shlibs" >&5 -$as_echo "$ld_shlibs" >&6; } +echo "$as_me:$LINENO: result: $ld_shlibs" >&5 +echo "${ECHO_T}$ld_shlibs" >&6 test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld @@ -8457,19 +7406,19 @@ ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. - { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 -$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } + echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 +echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6 $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= @@ -8483,11 +7432,11 @@ lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes @@ -8495,12 +7444,12 @@ allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* - { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 -$as_echo "$archive_cmds_need_lc" >&6; } + echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 +echo "${ECHO_T}$archive_cmds_need_lc" >&6 ;; esac fi ;; esac @@ -8659,12 +7608,12 @@ - { $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 -$as_echo_n "checking dynamic linker characteristics... " >&6; } + echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 +echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6 if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; @@ -8822,18 +7771,18 @@ # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; -cygwin* | mingw* | pw32* | cegcc*) +cygwin* | mingw* | pw32*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in - yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) + yes,cygwin* | yes,mingw* | yes,pw32*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ @@ -8852,11 +7801,11 @@ cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; - mingw* | cegcc*) + mingw*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by @@ -9110,43 +8059,41 @@ ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then shlibpath_overrides_runpath=yes fi else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir # This implies no fast_install, which is unacceptable. @@ -9338,11 +8285,11 @@ tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' + library_name_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; @@ -9355,12 +8302,12 @@ *) dynamic_linker=no ;; esac -{ $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5 -$as_echo "$dynamic_linker" >&6; } +echo "$as_me:$LINENO: result: $dynamic_linker" >&5 +echo "${ECHO_T}$dynamic_linker" >&6 test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" @@ -9457,12 +8404,12 @@ - { $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 -$as_echo_n "checking how to hardcode library paths into programs... " >&6; } + echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 +echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6 hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then @@ -9482,12 +8429,12 @@ else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi -{ $as_echo "$as_me:$LINENO: result: $hardcode_action" >&5 -$as_echo "$hardcode_action" >&6; } +echo "$as_me:$LINENO: result: $hardcode_action" >&5 +echo "${ECHO_T}$hardcode_action" >&6 if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no @@ -9515,11 +8462,11 @@ lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; - mingw* | pw32* | cegcc*) + mingw* | pw32*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) @@ -9527,14 +8474,14 @@ lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it - { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -9541,62 +8488,61 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char dlopen (); int main () { -return dlopen (); +dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_dl_dlopen=no +ac_cv_lib_dl_dlopen=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = x""yes; then +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= @@ -9605,14 +8551,14 @@ fi ;; *) - { $as_echo "$as_me:$LINENO: checking for shl_load" >&5 -$as_echo_n "checking for shl_load... " >&6; } + echo "$as_me:$LINENO: checking for shl_load" >&5 +echo $ECHO_N "checking for shl_load... $ECHO_C" >&6 if test "${ac_cv_func_shl_load+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -9633,74 +8579,79 @@ # include #endif #undef shl_load -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" +{ #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined __stub_shl_load || defined __stub___shl_load +#if defined (__stub_shl_load) || defined (__stub___shl_load) choke me +#else +char (*f) () = shl_load; +#endif +#ifdef __cplusplus +} #endif int main () { -return shl_load (); +return f != shl_load; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_func_shl_load=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_func_shl_load=no +ac_cv_func_shl_load=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 -$as_echo "$ac_cv_func_shl_load" >&6; } -if test "x$ac_cv_func_shl_load" = x""yes; then +echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 +echo "${ECHO_T}$ac_cv_func_shl_load" >&6 +if test $ac_cv_func_shl_load = yes; then lt_cv_dlopen="shl_load" else - { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 -$as_echo_n "checking for shl_load in -ldld... " >&6; } + echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 +echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_shl_load+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -9707,68 +8658,67 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char shl_load (); int main () { -return shl_load (); +shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_dld_shl_load=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_dld_shl_load=no +ac_cv_lib_dld_shl_load=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 -$as_echo "$ac_cv_lib_dld_shl_load" >&6; } -if test "x$ac_cv_lib_dld_shl_load" = x""yes; then +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6 +if test $ac_cv_lib_dld_shl_load = yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else - { $as_echo "$as_me:$LINENO: checking for dlopen" >&5 -$as_echo_n "checking for dlopen... " >&6; } + echo "$as_me:$LINENO: checking for dlopen" >&5 +echo $ECHO_N "checking for dlopen... $ECHO_C" >&6 if test "${ac_cv_func_dlopen+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -9789,74 +8739,79 @@ # include #endif #undef dlopen -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" +{ #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined __stub_dlopen || defined __stub___dlopen +#if defined (__stub_dlopen) || defined (__stub___dlopen) choke me +#else +char (*f) () = dlopen; +#endif +#ifdef __cplusplus +} #endif int main () { -return dlopen (); +return f != dlopen; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_func_dlopen=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_func_dlopen=no +ac_cv_func_dlopen=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 -$as_echo "$ac_cv_func_dlopen" >&6; } -if test "x$ac_cv_func_dlopen" = x""yes; then +echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 +echo "${ECHO_T}$ac_cv_func_dlopen" >&6 +if test $ac_cv_func_dlopen = yes; then lt_cv_dlopen="dlopen" else - { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 -$as_echo_n "checking for dlopen in -ldl... " >&6; } + echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 +echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlopen+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -9863,68 +8818,67 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char dlopen (); int main () { -return dlopen (); +dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_dl_dlopen=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_dl_dlopen=no +ac_cv_lib_dl_dlopen=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 -$as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = x""yes; then +echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6 +if test $ac_cv_lib_dl_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else - { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 -$as_echo_n "checking for dlopen in -lsvld... " >&6; } + echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 +echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6 if test "${ac_cv_lib_svld_dlopen+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -9931,68 +8885,67 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char dlopen (); int main () { -return dlopen (); +dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_svld_dlopen=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_svld_dlopen=no +ac_cv_lib_svld_dlopen=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 -$as_echo "$ac_cv_lib_svld_dlopen" >&6; } -if test "x$ac_cv_lib_svld_dlopen" = x""yes; then +echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 +echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6 +if test $ac_cv_lib_svld_dlopen = yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else - { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 -$as_echo_n "checking for dld_link in -ldld... " >&6; } + echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 +echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6 if test "${ac_cv_lib_dld_dld_link+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -9999,62 +8952,61 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char dld_link (); int main () { -return dld_link (); +dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_dld_dld_link=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_dld_dld_link=no +ac_cv_lib_dld_dld_link=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 -$as_echo "$ac_cv_lib_dld_dld_link" >&6; } -if test "x$ac_cv_lib_dld_dld_link" = x""yes; then +echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 +echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6 +if test $ac_cv_lib_dld_dld_link = yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi @@ -10089,22 +9041,22 @@ wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" - { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 -$as_echo_n "checking whether a program can dlopen itself... " >&6; } + echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 +echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10105 "configure" +#line 9057 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif @@ -10140,10 +9092,14 @@ # endif # endif # endif # endif #endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -10156,17 +9112,17 @@ /* dlclose (self); */ } else puts (dlerror ()); - return status; + exit (status); } _LT_EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; @@ -10180,27 +9136,27 @@ fi rm -fr conftest* fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 -$as_echo "$lt_cv_dlopen_self" >&6; } +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self" >&6 if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" - { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 -$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } + echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 +echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6 if test "${lt_cv_dlopen_self_static+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 10201 "configure" +#line 9157 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif @@ -10236,10 +9192,14 @@ # endif # endif # endif # endif #endif + +#ifdef __cplusplus +extern "C" void exit (int); +#endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); @@ -10252,17 +9212,17 @@ /* dlclose (self); */ } else puts (dlerror ()); - return status; + exit (status); } _LT_EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; @@ -10276,12 +9236,12 @@ fi rm -fr conftest* fi -{ $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 -$as_echo "$lt_cv_dlopen_self_static" >&6; } +echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 +echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6 fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" @@ -10315,34 +9275,34 @@ striplib= old_striplib= -{ $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 -$as_echo_n "checking whether stripping libraries is possible... " >&6; } +echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 +echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6 if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi ;; *) - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 ;; esac fi @@ -10355,17 +9315,17 @@ # Report which library types will actually be built - { $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 -$as_echo_n "checking if libtool supports shared libraries... " >&6; } - { $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5 -$as_echo "$can_build_shared" >&6; } + echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 +echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6 + echo "$as_me:$LINENO: result: $can_build_shared" >&5 +echo "${ECHO_T}$can_build_shared" >&6 - { $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 -$as_echo_n "checking whether to build shared libraries... " >&6; } + echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 +echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6 test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in @@ -10381,19 +9341,19 @@ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac - { $as_echo "$as_me:$LINENO: result: $enable_shared" >&5 -$as_echo "$enable_shared" >&6; } + echo "$as_me:$LINENO: result: $enable_shared" >&5 +echo "${ECHO_T}$enable_shared" >&6 - { $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5 -$as_echo_n "checking whether to build static libraries... " >&6; } + echo "$as_me:$LINENO: checking whether to build static libraries" >&5 +echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6 # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes - { $as_echo "$as_me:$LINENO: result: $enable_static" >&5 -$as_echo "$enable_static" >&6; } + echo "$as_me:$LINENO: result: $enable_static" >&5 +echo "${ECHO_T}$enable_static" >&6 fi @@ -10415,11 +9375,11 @@ - ac_config_commands="$ac_config_commands libtool" + ac_config_commands="$ac_config_commands libtool" # Only expand once: @@ -10436,16 +9396,15 @@ # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS @@ -10460,57 +9419,44 @@ # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 fi fi done done ;; esac - done -IFS=$as_save_IFS -rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is - # removed, or if the value is a relative name. + # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi -{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' @@ -10520,14 +9466,14 @@ for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -10534,56 +9480,54 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - { $as_echo "$as_me:$LINENO: result: $AWK" >&5 -$as_echo "$AWK" >&6; } + echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$AWK" && break done ######### # Enable large file support (if special flags are necessary) # -# Check whether --enable-largefile was given. +# Check whether --enable-largefile or --disable-largefile was given. if test "${enable_largefile+set}" = set; then - enableval=$enable_largefile; -fi + enableval="$enable_largefile" +fi; if test "$enable_largefile" != no; then - { $as_echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 -$as_echo_n "checking for special C compiler options needed for large files... " >&6; } + echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 +echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_largefile_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do - # IRIX 6.2 and later do not support large files by default, - # so use the C compiler's -n32 option if that helps. + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF @@ -10603,83 +9547,88 @@ ; return 0; } _ACEOF - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - fi - -rm -f core conftest.err conftest.$ac_objext - CC="$CC -n32" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 +rm -f conftest.err conftest.$ac_objext + CC="$CC -n32" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_sys_largefile_CC=' -n32'; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - fi - -rm -f core conftest.err conftest.$ac_objext +rm -f conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 -$as_echo "$ac_cv_sys_largefile_CC" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 +echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6 if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi - { $as_echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } + echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_file_offset_bits+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do + ac_cv_sys_file_offset_bits=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF @@ -10700,36 +9649,38 @@ ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_file_offset_bits=no; break + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF @@ -10751,58 +9702,58 @@ ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_sys_file_offset_bits=64; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_file_offset_bits=unknown +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext break done fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 -$as_echo "$ac_cv_sys_file_offset_bits" >&6; } -case $ac_cv_sys_file_offset_bits in #( - no | unknown) ;; - *) +echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 +echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6 +if test "$ac_cv_sys_file_offset_bits" != no; then + cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF -;; -esac -rm -rf conftest* - if test $ac_cv_sys_file_offset_bits = unknown; then - { $as_echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 -$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } + +fi +rm -f conftest* + echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 +echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_large_files+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do + ac_cv_sys_large_files=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF @@ -10823,36 +9774,38 @@ ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_large_files=no; break + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF @@ -10874,97 +9827,381 @@ ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_sys_large_files=1; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_large_files=unknown +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext break done fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 -$as_echo "$ac_cv_sys_large_files" >&6; } -case $ac_cv_sys_large_files in #( - no | unknown) ;; - *) +echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 +echo "${ECHO_T}$ac_cv_sys_large_files" >&6 +if test "$ac_cv_sys_large_files" != no; then + cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF -;; -esac -rm -rf conftest* - fi + +fi +rm -f conftest* fi ######### # Check for needed/wanted data types -{ $as_echo "$as_me:$LINENO: checking for int8_t" >&5 -$as_echo_n "checking for int8_t... " >&6; } +echo "$as_me:$LINENO: checking for int8_t" >&5 +echo $ECHO_N "checking for int8_t... $ECHO_C" >&6 if test "${ac_cv_type_int8_t+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_type_int8_t=no -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { +if ((int8_t *) 0) + return 0; if (sizeof (int8_t)) - return 0; + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_int8_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_int8_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_int8_t" >&5 +echo "${ECHO_T}$ac_cv_type_int8_t" >&6 +if test $ac_cv_type_int8_t = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_INT8_T 1 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking for int16_t" >&5 +echo $ECHO_N "checking for int16_t... $ECHO_C" >&6 +if test "${ac_cv_type_int16_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((int16_t *) 0) + return 0; +if (sizeof (int16_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_int16_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_int16_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_int16_t" >&5 +echo "${ECHO_T}$ac_cv_type_int16_t" >&6 +if test $ac_cv_type_int16_t = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_INT16_T 1 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking for int32_t" >&5 +echo $ECHO_N "checking for int32_t... $ECHO_C" >&6 +if test "${ac_cv_type_int32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((int32_t *) 0) + return 0; +if (sizeof (int32_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_int32_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_int32_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_int32_t" >&5 +echo "${ECHO_T}$ac_cv_type_int32_t" >&6 +if test $ac_cv_type_int32_t = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_INT32_T 1 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking for int64_t" >&5 +echo $ECHO_N "checking for int64_t... $ECHO_C" >&6 +if test "${ac_cv_type_int64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((int64_t *) 0) + return 0; +if (sizeof (int64_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_int64_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_int64_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 +echo "${ECHO_T}$ac_cv_type_int64_t" >&6 +if test $ac_cv_type_int64_t = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_INT64_T 1 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking for intptr_t" >&5 +echo $ECHO_N "checking for intptr_t... $ECHO_C" >&6 +if test "${ac_cv_type_intptr_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ +if ((intptr_t *) 0) + return 0; +if (sizeof (intptr_t)) + return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_intptr_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_intptr_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_intptr_t" >&5 +echo "${ECHO_T}$ac_cv_type_intptr_t" >&6 +if test $ac_cv_type_intptr_t = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_INTPTR_T 1 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking for uint8_t" >&5 +echo $ECHO_N "checking for uint8_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint8_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF @@ -10971,102 +10208,64 @@ /* end confdefs.h. */ $ac_includes_default int main () { -if (sizeof ((int8_t))) - return 0; +if ((uint8_t *) 0) + return 0; +if (sizeof (uint8_t)) + return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_int8_t=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_int8_t" >&5 -$as_echo "$ac_cv_type_int8_t" >&6; } -if test "x$ac_cv_type_int8_t" = x""yes; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint8_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uint8_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint8_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint8_t" >&6 +if test $ac_cv_type_uint8_t = yes; then cat >>confdefs.h <<_ACEOF -#define HAVE_INT8_T 1 +#define HAVE_UINT8_T 1 _ACEOF fi -{ $as_echo "$as_me:$LINENO: checking for int16_t" >&5 -$as_echo_n "checking for int16_t... " >&6; } -if test "${ac_cv_type_int16_t+set}" = set; then - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for uint16_t" >&5 +echo $ECHO_N "checking for uint16_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint16_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_type_int16_t=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if (sizeof (int16_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF @@ -11073,102 +10272,64 @@ /* end confdefs.h. */ $ac_includes_default int main () { -if (sizeof ((int16_t))) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_int16_t=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_int16_t" >&5 -$as_echo "$ac_cv_type_int16_t" >&6; } -if test "x$ac_cv_type_int16_t" = x""yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_INT16_T 1 -_ACEOF - - -fi -{ $as_echo "$as_me:$LINENO: checking for int32_t" >&5 -$as_echo_n "checking for int32_t... " >&6; } -if test "${ac_cv_type_int32_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_type_int32_t=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if (sizeof (int32_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ((uint16_t *) 0) + return 0; +if (sizeof (uint16_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint16_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uint16_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint16_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint16_t" >&6 +if test $ac_cv_type_uint16_t = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_UINT16_T 1 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking for uint32_t" >&5 +echo $ECHO_N "checking for uint32_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint32_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF @@ -11175,102 +10336,64 @@ /* end confdefs.h. */ $ac_includes_default int main () { -if (sizeof ((int32_t))) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_int32_t=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_int32_t" >&5 -$as_echo "$ac_cv_type_int32_t" >&6; } -if test "x$ac_cv_type_int32_t" = x""yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_INT32_T 1 -_ACEOF - - -fi -{ $as_echo "$as_me:$LINENO: checking for int64_t" >&5 -$as_echo_n "checking for int64_t... " >&6; } -if test "${ac_cv_type_int64_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_type_int64_t=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if (sizeof (int64_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ((uint32_t *) 0) + return 0; +if (sizeof (uint32_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint32_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uint32_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint32_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint32_t" >&6 +if test $ac_cv_type_uint32_t = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_UINT32_T 1 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking for uint64_t" >&5 +echo $ECHO_N "checking for uint64_t... $ECHO_C" >&6 +if test "${ac_cv_type_uint64_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF @@ -11277,204 +10400,64 @@ /* end confdefs.h. */ $ac_includes_default int main () { -if (sizeof ((int64_t))) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_int64_t=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_int64_t" >&5 -$as_echo "$ac_cv_type_int64_t" >&6; } -if test "x$ac_cv_type_int64_t" = x""yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_INT64_T 1 -_ACEOF - - -fi -{ $as_echo "$as_me:$LINENO: checking for intptr_t" >&5 -$as_echo_n "checking for intptr_t... " >&6; } -if test "${ac_cv_type_intptr_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_type_intptr_t=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if (sizeof (intptr_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if (sizeof ((intptr_t))) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_intptr_t=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_intptr_t" >&5 -$as_echo "$ac_cv_type_intptr_t" >&6; } -if test "x$ac_cv_type_intptr_t" = x""yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_INTPTR_T 1 -_ACEOF - - -fi -{ $as_echo "$as_me:$LINENO: checking for uint8_t" >&5 -$as_echo_n "checking for uint8_t... " >&6; } -if test "${ac_cv_type_uint8_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_type_uint8_t=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if (sizeof (uint8_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then +if ((uint64_t *) 0) + return 0; +if (sizeof (uint64_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uint64_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uint64_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 +echo "${ECHO_T}$ac_cv_type_uint64_t" >&6 +if test $ac_cv_type_uint64_t = yes; then + +cat >>confdefs.h <<_ACEOF +#define HAVE_UINT64_T 1 +_ACEOF + + +fi +echo "$as_me:$LINENO: checking for uintptr_t" >&5 +echo $ECHO_N "checking for uintptr_t... $ECHO_C" >&6 +if test "${ac_cv_type_uintptr_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF @@ -11481,463 +10464,52 @@ /* end confdefs.h. */ $ac_includes_default int main () { -if (sizeof ((uint8_t))) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_uint8_t=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uint8_t" >&5 -$as_echo "$ac_cv_type_uint8_t" >&6; } -if test "x$ac_cv_type_uint8_t" = x""yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_UINT8_T 1 -_ACEOF - - -fi -{ $as_echo "$as_me:$LINENO: checking for uint16_t" >&5 -$as_echo_n "checking for uint16_t... " >&6; } -if test "${ac_cv_type_uint16_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_type_uint16_t=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if (sizeof (uint16_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if (sizeof ((uint16_t))) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_uint16_t=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uint16_t" >&5 -$as_echo "$ac_cv_type_uint16_t" >&6; } -if test "x$ac_cv_type_uint16_t" = x""yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_UINT16_T 1 -_ACEOF - - -fi -{ $as_echo "$as_me:$LINENO: checking for uint32_t" >&5 -$as_echo_n "checking for uint32_t... " >&6; } -if test "${ac_cv_type_uint32_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_type_uint32_t=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if (sizeof (uint32_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if (sizeof ((uint32_t))) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_uint32_t=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uint32_t" >&5 -$as_echo "$ac_cv_type_uint32_t" >&6; } -if test "x$ac_cv_type_uint32_t" = x""yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_UINT32_T 1 -_ACEOF - - -fi -{ $as_echo "$as_me:$LINENO: checking for uint64_t" >&5 -$as_echo_n "checking for uint64_t... " >&6; } -if test "${ac_cv_type_uint64_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_type_uint64_t=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if (sizeof (uint64_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if (sizeof ((uint64_t))) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_uint64_t=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uint64_t" >&5 -$as_echo "$ac_cv_type_uint64_t" >&6; } -if test "x$ac_cv_type_uint64_t" = x""yes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_UINT64_T 1 -_ACEOF - - -fi -{ $as_echo "$as_me:$LINENO: checking for uintptr_t" >&5 -$as_echo_n "checking for uintptr_t... " >&6; } -if test "${ac_cv_type_uintptr_t+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_type_uintptr_t=no -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if (sizeof (uintptr_t)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ -if (sizeof ((uintptr_t))) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_uintptr_t=yes -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 -$as_echo "$ac_cv_type_uintptr_t" >&6; } -if test "x$ac_cv_type_uintptr_t" = x""yes; then +if ((uintptr_t *) 0) + return 0; +if (sizeof (uintptr_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_uintptr_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_type_uintptr_t=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 +echo "${ECHO_T}$ac_cv_type_uintptr_t" >&6 +if test $ac_cv_type_uintptr_t = yes; then cat >>confdefs.h <<_ACEOF #define HAVE_UINTPTR_T 1 _ACEOF @@ -11951,25 +10523,23 @@ for ac_header in sys/types.h stdlib.h stdint.h inttypes.h do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF @@ -11976,122 +10546,128 @@ /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_header_compiler=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no +ac_header_compiler=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then ac_header_preproc=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi - rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## --------------------------------- ## +## Report this to the sqlite lists. ## +## --------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done @@ -12105,15 +10681,15 @@ for ac_func in usleep fdatasync localtime_r gmtime_r localtime_s do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -12134,74 +10710,75 @@ # include #endif #undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" +{ #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif int main () { -return $ac_func (); +return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then eval "$as_ac_var=yes" else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" +eval "$as_ac_var=no" fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done @@ -12218,14 +10795,14 @@ # for ac_prog in tclsh8.4 tclsh do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_TCLSH_CMD+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$TCLSH_CMD"; then ac_cv_prog_TCLSH_CMD="$TCLSH_CMD" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -12232,30 +10809,28 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_TCLSH_CMD="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi TCLSH_CMD=$ac_cv_prog_TCLSH_CMD if test -n "$TCLSH_CMD"; then - { $as_echo "$as_me:$LINENO: result: $TCLSH_CMD" >&5 -$as_echo "$TCLSH_CMD" >&6; } + echo "$as_me:$LINENO: result: $TCLSH_CMD" >&5 +echo "${ECHO_T}$TCLSH_CMD" >&6 else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$TCLSH_CMD" && break done test -n "$TCLSH_CMD" || TCLSH_CMD="none" @@ -12266,20 +10841,10 @@ USE_AMALGAMATION=0 TCLSH_CMD="tclsh" fi - -if test "x${TCLLIBDIR+set}" != "xset" ; then - TCLLIBDIR='$(libdir)' - for i in `echo 'puts stdout $auto_path' | ${TCLSH_CMD}` ; do - TCLLIBDIR=$i - break - done - TCLLIBDIR="${TCLLIBDIR}/sqlite3" -fi - ######### # Set up an appropriate program prefix # if test "$program_prefix" = "NONE"; then @@ -12286,22 +10851,19 @@ program_prefix="" fi VERSION=`cat $srcdir/VERSION | sed 's/^\([0-9]*\.*[0-9]*\).*/\1/'` -{ $as_echo "$as_me:$LINENO: Version set to $VERSION" >&5 -$as_echo "$as_me: Version set to $VERSION" >&6;} +echo "Version set to $VERSION" RELEASE=`cat $srcdir/VERSION` -{ $as_echo "$as_me:$LINENO: Release set to $RELEASE" >&5 -$as_echo "$as_me: Release set to $RELEASE" >&6;} +echo "Release set to $RELEASE" -VERSION_NUMBER=`cat $srcdir/VERSION \ +VERSION_NUMBER=`cat $srcdir/VERSION \ | sed 's/[^0-9]/ /g' \ | awk '{printf "%d%03d%03d",$1,$2,$3}'` -{ $as_echo "$as_me:$LINENO: Version number set to $VERSION_NUMBER" >&5 -$as_echo "$as_me: Version number set to $VERSION_NUMBER" >&6;} +echo "Version number set to $VERSION_NUMBER" ######### # Check to see if the --with-hints=FILE option is used. If there is none, # then check for a files named "$host.hints" and ../$hosts.hints where @@ -12308,15 +10870,15 @@ # $host is the hostname of the build system. If still no hints are # found, try looking in $system.hints and ../$system.hints where # $system is the result of uname -s. # -# Check whether --with-hints was given. +# Check whether --with-hints or --without-hints was given. if test "${with_hints+set}" = set; then - withval=$with_hints; hints=$withval -fi - + withval="$with_hints" + hints=$withval +fi; if test "$hints" = ""; then host=`hostname | sed 's/\..*//'` if test -r $host.hints; then hints=$host.hints else @@ -12334,12 +10896,12 @@ hints=../$sys.hints fi fi fi if test "$hints" != ""; then - { $as_echo "$as_me:$LINENO: result: reading hints from $hints" >&5 -$as_echo "reading hints from $hints" >&6; } + echo "$as_me:$LINENO: result: reading hints from $hints" >&5 +echo "${ECHO_T}reading hints from $hints" >&6 . $hints fi ######### # Locate a compiler for the build machine. This compiler should @@ -12352,14 +10914,14 @@ if test "${BUILD_CC+set}" != set; then for ac_prog in gcc cc cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_BUILD_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$BUILD_CC"; then ac_cv_prog_BUILD_CC="$BUILD_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -12366,30 +10928,28 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_BUILD_CC="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi BUILD_CC=$ac_cv_prog_BUILD_CC if test -n "$BUILD_CC"; then - { $as_echo "$as_me:$LINENO: result: $BUILD_CC" >&5 -$as_echo "$BUILD_CC" >&6; } + echo "$as_me:$LINENO: result: $BUILD_CC" >&5 +echo "${ECHO_T}$BUILD_CC" >&6 else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$BUILD_CC" && break done fi @@ -12400,115 +10960,154 @@ ########## # Do we want to support multithreaded use of sqlite # -# Check whether --enable-threadsafe was given. +# Check whether --enable-threadsafe or --disable-threadsafe was given. if test "${enable_threadsafe+set}" = set; then - enableval=$enable_threadsafe; + enableval="$enable_threadsafe" + else enable_threadsafe=yes -fi - -{ $as_echo "$as_me:$LINENO: checking whether to support threadsafe operation" >&5 -$as_echo_n "checking whether to support threadsafe operation... " >&6; } +fi; +echo "$as_me:$LINENO: checking whether to support threadsafe operation" >&5 +echo $ECHO_N "checking whether to support threadsafe operation... $ECHO_C" >&6 if test "$enable_threadsafe" = "no"; then SQLITE_THREADSAFE=0 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 else SQLITE_THREADSAFE=1 - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 fi if test "$SQLITE_THREADSAFE" = "1"; then - { $as_echo "$as_me:$LINENO: checking for library containing pthread_create" >&5 -$as_echo_n "checking for library containing pthread_create... " >&6; } + echo "$as_me:$LINENO: checking for library containing pthread_create" >&5 +echo $ECHO_N "checking for library containing pthread_create... $ECHO_C" >&6 if test "${ac_cv_search_pthread_create+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS +ac_cv_search_pthread_create=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ +char pthread_create (); +int +main () +{ +pthread_create (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_pthread_create="none required" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_pthread_create" = no; then + for ac_lib in pthread; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char pthread_create (); int main () { -return pthread_create (); +pthread_create (); ; return 0; } _ACEOF -for ac_lib in '' pthread; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_search_pthread_create=$ac_res + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_pthread_create="-l$ac_lib" +break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_pthread_create+set}" = set; then - break -fi -done -if test "${ac_cv_search_pthread_create+set}" = set; then - : -else - ac_cv_search_pthread_create=no -fi -rm conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done +fi LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_pthread_create" >&5 -$as_echo "$ac_cv_search_pthread_create" >&6; } -ac_res=$ac_cv_search_pthread_create -if test "$ac_res" != no; then - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" +echo "$as_me:$LINENO: result: $ac_cv_search_pthread_create" >&5 +echo "${ECHO_T}$ac_cv_search_pthread_create" >&6 +if test "$ac_cv_search_pthread_create" != no; then + test "$ac_cv_search_pthread_create" = "none required" || LIBS="$ac_cv_search_pthread_create $LIBS" fi fi @@ -12515,116 +11114,116 @@ ########## # Do we want to allow a connection created in one thread to be used # in another thread. This does not work on many Linux systems (ex: RedHat 9) # due to bugs in the threading implementations. This is thus off by default. # -# Check whether --enable-cross-thread-connections was given. +# Check whether --enable-cross-thread-connections or --disable-cross-thread-connections was given. if test "${enable_cross_thread_connections+set}" = set; then - enableval=$enable_cross_thread_connections; + enableval="$enable_cross_thread_connections" + else enable_xthreadconnect=no -fi - -{ $as_echo "$as_me:$LINENO: checking whether to allow connections to be shared across threads" >&5 -$as_echo_n "checking whether to allow connections to be shared across threads... " >&6; } +fi; +echo "$as_me:$LINENO: checking whether to allow connections to be shared across threads" >&5 +echo $ECHO_N "checking whether to allow connections to be shared across threads... $ECHO_C" >&6 if test "$enable_xthreadconnect" = "no"; then XTHREADCONNECT='' - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 else XTHREADCONNECT='-DSQLITE_ALLOW_XTHREAD_CONNECT=1' - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 fi ########## # Do we want to set threadsOverrideEachOthersLocks variable to be 1 (true) by # default. Normally, a test at runtime is performed to determine the # appropriate value of this variable. Use this option only if you're sure that # threads can safely override each others locks in all runtime situations. # -# Check whether --enable-threads-override-locks was given. +# Check whether --enable-threads-override-locks or --disable-threads-override-locks was given. if test "${enable_threads_override_locks+set}" = set; then - enableval=$enable_threads_override_locks; + enableval="$enable_threads_override_locks" + else enable_threads_override_locks=no -fi - -{ $as_echo "$as_me:$LINENO: checking whether threads can override each others locks" >&5 -$as_echo_n "checking whether threads can override each others locks... " >&6; } +fi; +echo "$as_me:$LINENO: checking whether threads can override each others locks" >&5 +echo $ECHO_N "checking whether threads can override each others locks... $ECHO_C" >&6 if test "$enable_threads_override_locks" = "no"; then THREADSOVERRIDELOCKS='-1' - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 else THREADSOVERRIDELOCKS='1' - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 fi ########## # Do we want to support release # -# Check whether --enable-releasemode was given. +# Check whether --enable-releasemode or --disable-releasemode was given. if test "${enable_releasemode+set}" = set; then - enableval=$enable_releasemode; + enableval="$enable_releasemode" + else enable_releasemode=no -fi - -{ $as_echo "$as_me:$LINENO: checking whether to support shared library linked as release mode or not" >&5 -$as_echo_n "checking whether to support shared library linked as release mode or not... " >&6; } +fi; +echo "$as_me:$LINENO: checking whether to support shared library linked as release mode or not" >&5 +echo $ECHO_N "checking whether to support shared library linked as release mode or not... $ECHO_C" >&6 if test "$enable_releasemode" = "no"; then ALLOWRELEASE="" - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 else ALLOWRELEASE="-release `cat $srcdir/VERSION`" - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 fi ########## # Do we want temporary databases in memory # -# Check whether --enable-tempstore was given. +# Check whether --enable-tempstore or --disable-tempstore was given. if test "${enable_tempstore+set}" = set; then - enableval=$enable_tempstore; + enableval="$enable_tempstore" + else enable_tempstore=no -fi - -{ $as_echo "$as_me:$LINENO: checking whether to use an in-ram database for temporary tables" >&5 -$as_echo_n "checking whether to use an in-ram database for temporary tables... " >&6; } +fi; +echo "$as_me:$LINENO: checking whether to use an in-ram database for temporary tables" >&5 +echo $ECHO_N "checking whether to use an in-ram database for temporary tables... $ECHO_C" >&6 case "$enable_tempstore" in never ) TEMP_STORE=0 - { $as_echo "$as_me:$LINENO: result: never" >&5 -$as_echo "never" >&6; } + echo "$as_me:$LINENO: result: never" >&5 +echo "${ECHO_T}never" >&6 ;; no ) TEMP_STORE=1 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } - ;; - yes ) - TEMP_STORE=2 - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 ;; always ) TEMP_STORE=3 - { $as_echo "$as_me:$LINENO: result: always" >&5 -$as_echo "always" >&6; } + echo "$as_me:$LINENO: result: always" >&5 +echo "${ECHO_T}always" >&6 + ;; + yes ) + TEMP_STORE=3 + echo "$as_me:$LINENO: result: always" >&5 +echo "${ECHO_T}always" >&6 ;; * ) TEMP_STORE=1 - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 ;; esac @@ -12631,57 +11230,21 @@ ########### # Lots of things are different if we are compiling for Windows using # the CYGWIN environment. So check for that special case and handle # things accordingly. # -{ $as_echo "$as_me:$LINENO: checking if executables have the .exe suffix" >&5 -$as_echo_n "checking if executables have the .exe suffix... " >&6; } +echo "$as_me:$LINENO: checking if executables have the .exe suffix" >&5 +echo $ECHO_N "checking if executables have the .exe suffix... $ECHO_C" >&6 if test "$config_BUILD_EXEEXT" = ".exe"; then CYGWIN=yes - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 else - { $as_echo "$as_me:$LINENO: result: unknown" >&5 -$as_echo "unknown" >&6; } + echo "$as_me:$LINENO: result: unknown" >&5 +echo "${ECHO_T}unknown" >&6 fi if test "$CYGWIN" != "yes"; then - { $as_echo "$as_me:$LINENO: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } -if test "${ac_cv_host+set}" = set; then - $as_echo_n "(cached) " >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} - { (exit 1); exit 1; }; } -fi - -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -$as_echo "$as_me: error: invalid value of canonical host" >&2;} - { (exit 1); exit 1; }; };; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - case $host_os in *cygwin* ) CYGWIN=yes;; * ) CYGWIN=no;; esac @@ -12701,10 +11264,14 @@ if test $OS2_SHELL ; then SQLITE_OS_UNIX=0 SQLITE_OS_WIN=0 SQLITE_OS_OS2=1 CFLAGS="$CFLAGS -DSQLITE_OS_OS2=1" + if test "$ac_compiler_gnu" = "yes" ; then + CFLAGS="$CFLAGS -Zomf -Zexe -Zmap" + BUILD_CFLAGS="$BUILD_CFLAGS -Zomf -Zexe" + fi else SQLITE_OS_UNIX=0 SQLITE_OS_WIN=1 SQLITE_OS_OS2=0 CFLAGS="$CFLAGS -DSQLITE_OS_WIN=1" @@ -12728,52 +11295,40 @@ # This code is derived from the SC_PATH_TCLCONFIG and SC_LOAD_TCLCONFIG # macros in the in the tcl.m4 file of the standard TCL distribution. # Those macros could not be used directly since we have to make some # minor changes to accomodate systems that do not have TCL installed. # -# Check whether --enable-tcl was given. +# Check whether --enable-tcl or --disable-tcl was given. if test "${enable_tcl+set}" = set; then - enableval=$enable_tcl; use_tcl=$enableval + enableval="$enable_tcl" + use_tcl=$enableval else use_tcl=yes -fi - +fi; if test "${use_tcl}" = "yes" ; then -# Check whether --with-tcl was given. +# Check whether --with-tcl or --without-tcl was given. if test "${with_tcl+set}" = set; then - withval=$with_tcl; with_tclconfig=${withval} -fi - - { $as_echo "$as_me:$LINENO: checking for Tcl configuration" >&5 -$as_echo_n "checking for Tcl configuration... " >&6; } + withval="$with_tcl" + with_tclconfig=${withval} +fi; + echo "$as_me:$LINENO: checking for Tcl configuration" >&5 +echo $ECHO_N "checking for Tcl configuration... $ECHO_C" >&6 if test "${ac_cv_c_tclconfig+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else # First check to see if --with-tcl was specified. if test x"${with_tclconfig}" != x ; then if test -f "${with_tclconfig}/tclConfig.sh" ; then ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` else - { { $as_echo "$as_me:$LINENO: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5 -$as_echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&2;} + { { echo "$as_me:$LINENO: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&5 +echo "$as_me: error: ${with_tclconfig} directory doesn't contain tclConfig.sh" >&2;} { (exit 1); exit 1; }; } fi fi - - # Start autosearch by asking tclsh - if test x"$cross_compiling" = xno; then - for i in `echo 'puts stdout $auto_path' | ${TCLSH_CMD}` - do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig="$i" - break - fi - done - fi - # then check for a private Tcl installation if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ../tcl \ `ls -dr ../tcl[8-9].[0-9].[0-9]* 2>/dev/null` \ @@ -12828,30 +11383,30 @@ fi if test x"${ac_cv_c_tclconfig}" = x ; then use_tcl=no - { $as_echo "$as_me:$LINENO: WARNING: Can't find Tcl configuration definitions" >&5 -$as_echo "$as_me: WARNING: Can't find Tcl configuration definitions" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: *** Without Tcl the regression tests cannot be executed ***" >&5 -$as_echo "$as_me: WARNING: *** Without Tcl the regression tests cannot be executed ***" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: *** Consider using --with-tcl=... to define location of Tcl ***" >&5 -$as_echo "$as_me: WARNING: *** Consider using --with-tcl=... to define location of Tcl ***" >&2;} + { echo "$as_me:$LINENO: WARNING: Can't find Tcl configuration definitions" >&5 +echo "$as_me: WARNING: Can't find Tcl configuration definitions" >&2;} + { echo "$as_me:$LINENO: WARNING: *** Without Tcl the regression tests cannot be executed ***" >&5 +echo "$as_me: WARNING: *** Without Tcl the regression tests cannot be executed ***" >&2;} + { echo "$as_me:$LINENO: WARNING: *** Consider using --with-tcl=... to define location of Tcl ***" >&5 +echo "$as_me: WARNING: *** Consider using --with-tcl=... to define location of Tcl ***" >&2;} else TCL_BIN_DIR=${ac_cv_c_tclconfig} - { $as_echo "$as_me:$LINENO: result: found $TCL_BIN_DIR/tclConfig.sh" >&5 -$as_echo "found $TCL_BIN_DIR/tclConfig.sh" >&6; } + echo "$as_me:$LINENO: result: found $TCL_BIN_DIR/tclConfig.sh" >&5 +echo "${ECHO_T}found $TCL_BIN_DIR/tclConfig.sh" >&6 - { $as_echo "$as_me:$LINENO: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 -$as_echo_n "checking for existence of $TCL_BIN_DIR/tclConfig.sh... " >&6; } + echo "$as_me:$LINENO: checking for existence of $TCL_BIN_DIR/tclConfig.sh" >&5 +echo $ECHO_N "checking for existence of $TCL_BIN_DIR/tclConfig.sh... $ECHO_C" >&6 if test -f "$TCL_BIN_DIR/tclConfig.sh" ; then - { $as_echo "$as_me:$LINENO: result: loading" >&5 -$as_echo "loading" >&6; } + echo "$as_me:$LINENO: result: loading" >&5 +echo "${ECHO_T}loading" >&6 . $TCL_BIN_DIR/tclConfig.sh else - { $as_echo "$as_me:$LINENO: result: file not found" >&5 -$as_echo "file not found" >&6; } + echo "$as_me:$LINENO: result: file not found" >&5 +echo "${ECHO_T}file not found" >&6 fi # # If the TCL_BIN_DIR is the build directory (not the install directory), # then set the common variable name to the value of the build variables. @@ -12906,125 +11461,164 @@ # that use "readline()" library. # TARGET_READLINE_LIBS="" TARGET_READLINE_INC="" TARGET_HAVE_READLINE=0 -# Check whether --enable-readline was given. +# Check whether --enable-readline or --disable-readline was given. if test "${enable_readline+set}" = set; then - enableval=$enable_readline; with_readline=$enableval + enableval="$enable_readline" + with_readline=$enableval else with_readline=auto -fi - +fi; if test x"$with_readline" != xno; then found="yes" -# Check whether --with-readline-lib was given. +# Check whether --with-readline-lib or --without-readline-lib was given. if test "${with_readline_lib+set}" = set; then - withval=$with_readline_lib; with_readline_lib=$withval + withval="$with_readline_lib" + with_readline_lib=$withval else with_readline_lib="auto" -fi - +fi; if test "x$with_readline_lib" = xauto; then save_LIBS="$LIBS" LIBS="" - { $as_echo "$as_me:$LINENO: checking for library containing tgetent" >&5 -$as_echo_n "checking for library containing tgetent... " >&6; } + echo "$as_me:$LINENO: checking for library containing tgetent" >&5 +echo $ECHO_N "checking for library containing tgetent... $ECHO_C" >&6 if test "${ac_cv_search_tgetent+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS +ac_cv_search_tgetent=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ +char tgetent (); +int +main () +{ +tgetent (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_tgetent="none required" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_tgetent" = no; then + for ac_lib in readline ncurses curses termcap; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char tgetent (); int main () { -return tgetent (); +tgetent (); ; return 0; } _ACEOF -for ac_lib in '' readline ncurses curses termcap; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_search_tgetent=$ac_res + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_tgetent="-l$ac_lib" +break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_tgetent+set}" = set; then - break -fi -done -if test "${ac_cv_search_tgetent+set}" = set; then - : -else - ac_cv_search_tgetent=no -fi -rm conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done +fi LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_tgetent" >&5 -$as_echo "$ac_cv_search_tgetent" >&6; } -ac_res=$ac_cv_search_tgetent -if test "$ac_res" != no; then - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" +echo "$as_me:$LINENO: result: $ac_cv_search_tgetent" >&5 +echo "${ECHO_T}$ac_cv_search_tgetent" >&6 +if test "$ac_cv_search_tgetent" != no; then + test "$ac_cv_search_tgetent" = "none required" || LIBS="$ac_cv_search_tgetent $LIBS" term_LIBS="$LIBS" else term_LIBS="" fi - { $as_echo "$as_me:$LINENO: checking for readline in -lreadline" >&5 -$as_echo_n "checking for readline in -lreadline... " >&6; } + echo "$as_me:$LINENO: checking for readline in -lreadline" >&5 +echo $ECHO_N "checking for readline in -lreadline... $ECHO_C" >&6 if test "${ac_cv_lib_readline_readline+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lreadline $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -13031,62 +11625,61 @@ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char readline (); int main () { -return readline (); +readline (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_readline_readline=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_readline_readline=no +ac_cv_lib_readline_readline=no fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_readline_readline" >&5 -$as_echo "$ac_cv_lib_readline_readline" >&6; } -if test "x$ac_cv_lib_readline_readline" = x""yes; then +echo "$as_me:$LINENO: result: $ac_cv_lib_readline_readline" >&5 +echo "${ECHO_T}$ac_cv_lib_readline_readline" >&6 +if test $ac_cv_lib_readline_readline = yes; then TARGET_READLINE_LIBS="-lreadline" else found="no" fi @@ -13095,30 +11688,30 @@ else TARGET_READLINE_LIBS="$with_readline_lib" fi -# Check whether --with-readline-inc was given. +# Check whether --with-readline-inc or --without-readline-inc was given. if test "${with_readline_inc+set}" = set; then - withval=$with_readline_inc; with_readline_inc=$withval + withval="$with_readline_inc" + with_readline_inc=$withval else with_readline_inc="auto" -fi - +fi; if test "x$with_readline_inc" = xauto; then if test "${ac_cv_header_readline_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for readline.h" >&5 -$as_echo_n "checking for readline.h... " >&6; } + echo "$as_me:$LINENO: checking for readline.h" >&5 +echo $ECHO_N "checking for readline.h... $ECHO_C" >&6 if test "${ac_cv_header_readline_h+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_readline_h" >&5 -$as_echo "$ac_cv_header_readline_h" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_header_readline_h" >&5 +echo "${ECHO_T}$ac_cv_header_readline_h" >&6 else # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking readline.h usability" >&5 -$as_echo_n "checking readline.h usability... " >&6; } +echo "$as_me:$LINENO: checking readline.h usability" >&5 +echo $ECHO_N "checking readline.h usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF @@ -13125,146 +11718,152 @@ /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_header_compiler=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no +ac_header_compiler=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? -{ $as_echo "$as_me:$LINENO: checking readline.h presence" >&5 -$as_echo_n "checking readline.h presence... " >&6; } +echo "$as_me:$LINENO: checking readline.h presence" >&5 +echo $ECHO_N "checking readline.h presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then ac_header_preproc=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi - rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: readline.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: readline.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: readline.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: readline.h: proceeding with the compiler's result" >&2;} + { echo "$as_me:$LINENO: WARNING: readline.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: readline.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: readline.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: readline.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: readline.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: readline.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: readline.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: readline.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: readline.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: readline.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: readline.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: readline.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: readline.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: readline.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: readline.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: readline.h: in the future, the compiler will take precedence" >&2;} - + { echo "$as_me:$LINENO: WARNING: readline.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: readline.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: readline.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: readline.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: readline.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: readline.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: readline.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: readline.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: readline.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: readline.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: readline.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: readline.h: in the future, the compiler will take precedence" >&2;} + ( + cat <<\_ASBOX +## --------------------------------- ## +## Report this to the sqlite lists. ## +## --------------------------------- ## +_ASBOX + ) | + sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ $as_echo "$as_me:$LINENO: checking for readline.h" >&5 -$as_echo_n "checking for readline.h... " >&6; } +echo "$as_me:$LINENO: checking for readline.h" >&5 +echo $ECHO_N "checking for readline.h... $ECHO_C" >&6 if test "${ac_cv_header_readline_h+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_readline_h=$ac_header_preproc fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_readline_h" >&5 -$as_echo "$ac_cv_header_readline_h" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_header_readline_h" >&5 +echo "${ECHO_T}$ac_cv_header_readline_h" >&6 fi -if test "x$ac_cv_header_readline_h" = x""yes; then +if test $ac_cv_header_readline_h = yes; then found="yes" else found="no" if test "$cross_compiling" != yes; then for dir in /usr /usr/local /usr/local/readline /usr/contrib /mingw; do for subdir in include include/readline; do - as_ac_File=`$as_echo "ac_cv_file_$dir/$subdir/readline.h" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $dir/$subdir/readline.h" >&5 -$as_echo_n "checking for $dir/$subdir/readline.h... " >&6; } -if { as_var=$as_ac_File; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + as_ac_File=`echo "ac_cv_file_$dir/$subdir/readline.h" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $dir/$subdir/readline.h" >&5 +echo $ECHO_N "checking for $dir/$subdir/readline.h... $ECHO_C" >&6 +if eval "test \"\${$as_ac_File+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else test "$cross_compiling" = yes && - { { $as_echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 -$as_echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} + { { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5 +echo "$as_me: error: cannot check for file existence when cross compiling" >&2;} { (exit 1); exit 1; }; } if test -r "$dir/$subdir/readline.h"; then eval "$as_ac_File=yes" else eval "$as_ac_File=no" fi fi -ac_res=`eval 'as_val=${'$as_ac_File'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_File'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_File'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_File'}'`" >&6 +if test `eval echo '${'$as_ac_File'}'` = yes; then found=yes fi if test "$found" = "yes"; then TARGET_READLINE_INC="-I$dir/$subdir" @@ -13297,203 +11896,238 @@ ########## # Figure out what C libraries are required to compile programs # that use "fdatasync()" function. # -{ $as_echo "$as_me:$LINENO: checking for library containing fdatasync" >&5 -$as_echo_n "checking for library containing fdatasync... " >&6; } +echo "$as_me:$LINENO: checking for library containing fdatasync" >&5 +echo $ECHO_N "checking for library containing fdatasync... $ECHO_C" >&6 if test "${ac_cv_search_fdatasync+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_func_search_save_LIBS=$LIBS +ac_cv_search_fdatasync=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ +char fdatasync (); +int +main () +{ +fdatasync (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_fdatasync="none required" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +if test "$ac_cv_search_fdatasync" = no; then + for ac_lib in rt; do + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char fdatasync (); int main () { -return fdatasync (); +fdatasync (); ; return 0; } _ACEOF -for ac_lib in '' rt; do - if test -z "$ac_lib"; then - ac_res="none required" - else - ac_res=-l$ac_lib - LIBS="-l$ac_lib $ac_func_search_save_LIBS" - fi - rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_link") 2>conftest.er1 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then - ac_cv_search_fdatasync=$ac_res + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_search_fdatasync="-l$ac_lib" +break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - -fi - -rm -rf conftest.dSYM -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext - if test "${ac_cv_search_fdatasync+set}" = set; then - break -fi -done -if test "${ac_cv_search_fdatasync+set}" = set; then - : -else - ac_cv_search_fdatasync=no -fi -rm conftest.$ac_ext +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + done +fi LIBS=$ac_func_search_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_search_fdatasync" >&5 -$as_echo "$ac_cv_search_fdatasync" >&6; } -ac_res=$ac_cv_search_fdatasync -if test "$ac_res" != no; then - test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" +echo "$as_me:$LINENO: result: $ac_cv_search_fdatasync" >&5 +echo "${ECHO_T}$ac_cv_search_fdatasync" >&6 +if test "$ac_cv_search_fdatasync" != no; then + test "$ac_cv_search_fdatasync" = "none required" || LIBS="$ac_cv_search_fdatasync $LIBS" fi ######### # check for debug enabled -# Check whether --enable-debug was given. +# Check whether --enable-debug or --disable-debug was given. if test "${enable_debug+set}" = set; then - enableval=$enable_debug; use_debug=$enableval + enableval="$enable_debug" + use_debug=$enableval else use_debug=no -fi - +fi; if test "${use_debug}" = "yes" ; then TARGET_DEBUG="-DSQLITE_DEBUG=1" else TARGET_DEBUG="-DNDEBUG" fi ######### # See whether we should use the amalgamation to build -# Check whether --enable-amalgamation was given. +# Check whether --enable-amalgamation or --disable-amalgamation was given. if test "${enable_amalgamation+set}" = set; then - enableval=$enable_amalgamation; use_amalgamation=$enableval + enableval="$enable_amalgamation" + use_amalgamation=$enableval else use_amalgamation=yes -fi - +fi; if test "${use_amalgamation}" != "yes" ; then USE_AMALGAMATION=0 fi ######### # See whether we should allow loadable extensions -# Check whether --enable-load-extension was given. +# Check whether --enable-load-extension or --disable-load-extension was given. if test "${enable_load_extension+set}" = set; then - enableval=$enable_load_extension; use_loadextension=$enableval + enableval="$enable_load_extension" + use_loadextension=$enableval else use_loadextension=no -fi - +fi; if test "${use_loadextension}" = "yes" ; then OPT_FEATURE_FLAGS="" else OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1" fi ######### -# attempt to duplicate any OMITS and ENABLES into the $(OPT_FEATURE_FLAGS) parameter +# attempt to duplicate any OMITS into the $(OPT_FEATURE_FLAGS) parameter for option in $CFLAGS $CPPFLAGS do case $option in -DSQLITE_OMIT*) OPT_FEATURE_FLAGS="$OPT_FEATURE_FLAGS $option";; - -DSQLITE_ENABLE*) OPT_FEATURE_FLAGS="$OPT_FEATURE_FLAGS $option";; esac done -# attempt to remove any OMITS and ENABLES from the $(CFLAGS) parameter +# attempt to remove any OMITS from the $(CFLAGS) parameter ac_temp_CFLAGS="" for option in $CFLAGS do case $option in -DSQLITE_OMIT*) ;; - -DSQLITE_ENABLE*) ;; *) ac_temp_CFLAGS="$ac_temp_CFLAGS $option";; esac done CFLAGS=$ac_temp_CFLAGS -# attempt to remove any OMITS and ENABLES from the $(CPPFLAGS) parameter +# attempt to remove any OMITS from the $(CPPFLAGS) parameter ac_temp_CPPFLAGS="" for option in $CPPFLAGS do case $option in -DSQLITE_OMIT*) ;; - -DSQLITE_ENABLE*) ;; *) ac_temp_CPPFLAGS="$ac_temp_CPPFLAGS $option";; esac done CPPFLAGS=$ac_temp_CPPFLAGS -# attempt to remove any OMITS and ENABLES from the $(BUILD_CFLAGS) parameter +# attempt to remove any OMITS from the $(BUILD_CFLAGS) parameter ac_temp_BUILD_CFLAGS="" for option in $BUILD_CFLAGS do case $option in -DSQLITE_OMIT*) ;; - -DSQLITE_ENABLE*) ;; *) ac_temp_BUILD_CFLAGS="$ac_temp_BUILD_CFLAGS $option";; esac done BUILD_CFLAGS=$ac_temp_BUILD_CFLAGS ######### # See whether we should use GCOV -# Check whether --enable-gcov was given. +# Check whether --enable-gcov or --disable-gcov was given. if test "${enable_gcov+set}" = set; then - enableval=$enable_gcov; use_gcov=$enableval + enableval="$enable_gcov" + use_gcov=$enableval else use_gcov=no -fi - +fi; if test "${use_gcov}" = "yes" ; then USE_GCOV=1 else USE_GCOV=0 fi @@ -13500,19 +12134,18 @@ ######### # Output the config header -ac_config_headers="$ac_config_headers config.h" + ac_config_headers="$ac_config_headers config.h" ######### # Generate the output files. # -ac_config_files="$ac_config_files Makefile sqlite3.pc" - + ac_config_files="$ac_config_files Makefile sqlite3.pc" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't @@ -13527,97 +12160,90 @@ _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. +# So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - +{ (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( + ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; - esac | - sort -) | + esac; +} | sed ' - /^ac_cv_env_/b end t clear - :clear + : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && - { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else - { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : ${CONFIG_STATUS=./config.status} -ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. @@ -13626,360 +12252,310 @@ ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh +# Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } -fi +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - # Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done +$as_unset ENV MAIL MAILPATH PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then +if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. -as_me=`$as_basename -- "$0" || +as_me=`$as_basename "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - - + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop - s/-\n.*// + s,-$,, + s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno # Exit status is that of the last command. exit } -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then + +if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null -fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + exec 6>&1 -# Save the log message, to keep $[0] and so on meaningful, and to +# Open the log real soon, to keep \$[0] and so on meaningful, and to # 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.6.10, which was -generated by GNU Autoconf 2.63. Invocation command line was +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by sqlite $as_me 3.6.1, which was +generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 _ACEOF -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" -config_commands="$ac_config_commands" +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi -_ACEOF +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. -Usage: $0 [OPTION]... [FILE]... +Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - -q, --quiet, --silent - do not print progress messages + -V, --version print version number, then exit + -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE Configuration files: $config_files Configuration headers: @@ -13987,87 +12563,87 @@ Configuration commands: $config_commands Report bugs to ." - _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -sqlite config.status 3.6.10 -configured by $0, generated by GNU Autoconf 2.63, - with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +sqlite config.status 3.6.1 +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2008 Free Software Foundation, Inc. +Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -AWK='$AWK' -test -n "\$AWK" || AWK=awk +srcdir=$srcdir +INSTALL="$INSTALL" _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; - *) + -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; esac case $ac_option in # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" + CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - { $as_echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { $as_echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; - *) ac_config_targets="$ac_config_targets $1" - ac_need_defaults=false ;; + *) ac_config_targets="$ac_config_targets $1" ;; esac shift done @@ -14077,36 +12653,23 @@ exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' - export CONFIG_SHELL - exec "\$@" + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - $as_echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -# -# INIT-COMMANDS -# + +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS section. +# + # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH @@ -14140,11 +12703,10 @@ lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' -OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' @@ -14246,11 +12808,10 @@ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ -OBJDUMP \ deplibs_check_method \ file_magic_cmd \ AR \ AR_FLAGS \ STRIP \ @@ -14361,27 +12922,26 @@ _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# Handling of arguments. + +cat >>$CONFIG_STATUS <<\_ACEOF for ac_config_target in $ac_config_targets do - case $ac_config_target in - "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; - "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "sqlite3.pc") CONFIG_FILES="$CONFIG_FILES sqlite3.pc" ;; - - *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "sqlite3.pc" ) CONFIG_FILES="$CONFIG_FILES sqlite3.pc" ;; + "libtool" ) CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done - # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. @@ -14390,606 +12950,739 @@ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, +# simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. +# Create a temporary directory, and hook for its removal unless debugging. $debug || { - tmp= - trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status -' 0 + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } + # Create a (secure) tmp directory for tmp files. { - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) } || { - $as_echo "$as_me: cannot create a temporary directory in ." >&2 + echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. -if test -n "$CONFIG_FILES"; then - - -ac_cr=' ' -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$tmp/subs1.awk" && -_ACEOF - - -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } -ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then - break - elif $ac_last_try; then - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done -rm -f conf$$subs.sh - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && -_ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\).*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\).*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 -$as_echo "$as_me: error: could not setup config files machinery" >&2;} - { (exit 1); exit 1; }; } -_ACEOF - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ -s/:*$// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@LIBTOOL@,$LIBTOOL,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@SED@,$SED,;t t +s,@EGREP@,$EGREP,;t t +s,@FGREP@,$FGREP,;t t +s,@GREP@,$GREP,;t t +s,@LD@,$LD,;t t +s,@DUMPBIN@,$DUMPBIN,;t t +s,@ac_ct_DUMPBIN@,$ac_ct_DUMPBIN,;t t +s,@NM@,$NM,;t t +s,@LN_S@,$LN_S,;t t +s,@AR@,$AR,;t t +s,@ac_ct_AR@,$ac_ct_AR,;t t +s,@STRIP@,$STRIP,;t t +s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t +s,@RANLIB@,$RANLIB,;t t +s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t +s,@lt_ECHO@,$lt_ECHO,;t t +s,@DSYMUTIL@,$DSYMUTIL,;t t +s,@ac_ct_DSYMUTIL@,$ac_ct_DSYMUTIL,;t t +s,@NMEDIT@,$NMEDIT,;t t +s,@ac_ct_NMEDIT@,$ac_ct_NMEDIT,;t t +s,@LIPO@,$LIPO,;t t +s,@ac_ct_LIPO@,$ac_ct_LIPO,;t t +s,@OTOOL@,$OTOOL,;t t +s,@ac_ct_OTOOL@,$ac_ct_OTOOL,;t t +s,@OTOOL64@,$OTOOL64,;t t +s,@ac_ct_OTOOL64@,$ac_ct_OTOOL64,;t t +s,@CPP@,$CPP,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@AWK@,$AWK,;t t +s,@TCLSH_CMD@,$TCLSH_CMD,;t t +s,@program_prefix@,$program_prefix,;t t +s,@VERSION@,$VERSION,;t t +s,@RELEASE@,$RELEASE,;t t +s,@VERSION_NUMBER@,$VERSION_NUMBER,;t t +s,@BUILD_CC@,$BUILD_CC,;t t +s,@SQLITE_THREADSAFE@,$SQLITE_THREADSAFE,;t t +s,@XTHREADCONNECT@,$XTHREADCONNECT,;t t +s,@THREADSOVERRIDELOCKS@,$THREADSOVERRIDELOCKS,;t t +s,@ALLOWRELEASE@,$ALLOWRELEASE,;t t +s,@TEMP_STORE@,$TEMP_STORE,;t t +s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t +s,@SQLITE_OS_UNIX@,$SQLITE_OS_UNIX,;t t +s,@SQLITE_OS_WIN@,$SQLITE_OS_WIN,;t t +s,@SQLITE_OS_OS2@,$SQLITE_OS_OS2,;t t +s,@TARGET_EXEEXT@,$TARGET_EXEEXT,;t t +s,@TCL_VERSION@,$TCL_VERSION,;t t +s,@TCL_BIN_DIR@,$TCL_BIN_DIR,;t t +s,@TCL_SRC_DIR@,$TCL_SRC_DIR,;t t +s,@TCL_LIBS@,$TCL_LIBS,;t t +s,@TCL_INCLUDE_SPEC@,$TCL_INCLUDE_SPEC,;t t +s,@TCL_LIB_FILE@,$TCL_LIB_FILE,;t t +s,@TCL_LIB_FLAG@,$TCL_LIB_FLAG,;t t +s,@TCL_LIB_SPEC@,$TCL_LIB_SPEC,;t t +s,@TCL_STUB_LIB_FILE@,$TCL_STUB_LIB_FILE,;t t +s,@TCL_STUB_LIB_FLAG@,$TCL_STUB_LIB_FLAG,;t t +s,@TCL_STUB_LIB_SPEC@,$TCL_STUB_LIB_SPEC,;t t +s,@HAVE_TCL@,$HAVE_TCL,;t t +s,@TARGET_READLINE_LIBS@,$TARGET_READLINE_LIBS,;t t +s,@TARGET_READLINE_INC@,$TARGET_READLINE_INC,;t t +s,@TARGET_HAVE_READLINE@,$TARGET_HAVE_READLINE,;t t +s,@TARGET_DEBUG@,$TARGET_DEBUG,;t t +s,@USE_AMALGAMATION@,$USE_AMALGAMATION,;t t +s,@OPT_FEATURE_FLAGS@,$OPT_FEATURE_FLAGS,;t t +s,@USE_GCOV@,$USE_GCOV,;t t +s,@BUILD_CFLAGS@,$BUILD_CFLAGS,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi fi # test -n "$CONFIG_FILES" -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF - -# Transform confdefs.h into an awk script `defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_t=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_t"; then - break - elif $ac_last_try; then - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' >$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 -$as_echo "$as_me: error: could not setup config headers machinery" >&2;} - { (exit 1); exit 1; }; } -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" -shift -for ac_tag -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 -$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} - { (exit 1); exit 1; }; };; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; - esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - ac_file_inputs="$ac_file_inputs '$ac_f'" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} - fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac - - case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } ;; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + # Do quote $f, to prevent DOS paths from being IFS'd. + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +_ACEOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\_ACEOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +_ACEOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >>conftest.undefs <<\_ACEOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +_ACEOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # grep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.undefs >/dev/null +do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\_ACEOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - { as_dir="$ac_dir" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } + ac_builddir=. -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= - -ac_sed_dataroot=' -/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p -' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -$ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} - - rm -f "$tmp/stdin" - case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; - esac \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } - ;; - :H) - # - # CONFIG_HEADER - # - if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" - } >"$tmp/config.h" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } - if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f "$ac_file" - mv "$tmp/config.h" "$ac_file" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } - fi - else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ - || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 -$as_echo "$as_me: error: could not create -" >&2;} - { (exit 1); exit 1; }; } - fi - ;; - - :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5 -$as_echo "$as_me: executing $ac_file commands" >&6;} - ;; - esac - - - case $ac_file$ac_mode in - "libtool":C) + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + libtool ) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST @@ -15107,13 +13800,10 @@ # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds -# An object symbol dumper. -OBJDUMP=$lt_OBJDUMP - # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == "file_magic". file_magic_cmd=$lt_file_magic_cmd @@ -15620,25 +14310,21 @@ mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ;; - esac -done # for ac_tag +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save -test $ac_write_fail = 0 || - { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its @@ -15656,10 +14342,6 @@ exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi Index: configure.ac ================================================================== --- configure.ac +++ configure.ac @@ -90,11 +90,11 @@ AC_INIT(sqlite, m4_esyscmd([cat VERSION | tr -d '\n'])) dnl Put the RCS revision string after AC_INIT so that it will also dnl show in in configure. # The following RCS revision string applies to configure.in -# $Revision: 1.54 $ +# $Revision: 1.49 $ ######### # Programs needed # AC_PROG_LIBTOOL @@ -138,20 +138,10 @@ USE_AMALGAMATION=0 TCLSH_CMD="tclsh" fi AC_SUBST(TCLSH_CMD) -AC_ARG_VAR([TCLLIBDIR], [Where to install tcl plugin]) -if test "x${TCLLIBDIR+set}" != "xset" ; then - TCLLIBDIR='$(libdir)' - for i in `echo 'puts stdout $auto_path' | ${TCLSH_CMD}` ; do - TCLLIBDIR=$i - break - done - TCLLIBDIR="${TCLLIBDIR}/sqlite3" -fi - ######### # Set up an appropriate program prefix # if test "$program_prefix" = "NONE"; then @@ -158,19 +148,19 @@ program_prefix="" fi AC_SUBST(program_prefix) VERSION=[`cat $srcdir/VERSION | sed 's/^\([0-9]*\.*[0-9]*\).*/\1/'`] -AC_MSG_NOTICE(Version set to $VERSION) +echo "Version set to $VERSION" AC_SUBST(VERSION) RELEASE=`cat $srcdir/VERSION` -AC_MSG_NOTICE(Release set to $RELEASE) +echo "Release set to $RELEASE" AC_SUBST(RELEASE) -VERSION_NUMBER=[`cat $srcdir/VERSION \ +VERSION_NUMBER=[`cat $srcdir/VERSION \ | sed 's/[^0-9]/ /g' \ | awk '{printf "%d%03d%03d",$1,$2,$3}'`] -AC_MSG_NOTICE(Version number set to $VERSION_NUMBER) +echo "Version number set to $VERSION_NUMBER" AC_SUBST(VERSION_NUMBER) ######### # Check to see if the --with-hints=FILE option is used. If there is none, # then check for a files named "$host.hints" and ../$hosts.hints where @@ -305,21 +295,21 @@ ;; no ) TEMP_STORE=1 AC_MSG_RESULT([no]) ;; - yes ) - TEMP_STORE=2 - AC_MSG_RESULT([yes]) + always ) + TEMP_STORE=3 + AC_MSG_RESULT([always]) ;; - always ) + yes ) TEMP_STORE=3 AC_MSG_RESULT([always]) ;; * ) TEMP_STORE=1 - AC_MSG_RESULT([no]) + AC_MSG_RESULT([yes]) ;; esac AC_SUBST(TEMP_STORE) @@ -393,22 +383,10 @@ ac_cv_c_tclconfig=`(cd ${with_tclconfig}; pwd)` else AC_MSG_ERROR([${with_tclconfig} directory doesn't contain tclConfig.sh]) fi fi - - # Start autosearch by asking tclsh - if test x"$cross_compiling" = xno; then - for i in `echo 'puts stdout $auto_path' | ${TCLSH_CMD}` - do - if test -f "$i/tclConfig.sh" ; then - ac_cv_c_tclconfig="$i" - break - fi - done - fi - # then check for a private Tcl installation if test x"${ac_cv_c_tclconfig}" = x ; then for i in \ ../tcl \ `ls -dr ../tcl[[8-9]].[[0-9]].[[0-9]]* 2>/dev/null` \ @@ -631,54 +609,50 @@ else OPT_FEATURE_FLAGS="-DSQLITE_OMIT_LOAD_EXTENSION=1" fi ######### -# attempt to duplicate any OMITS and ENABLES into the $(OPT_FEATURE_FLAGS) parameter +# attempt to duplicate any OMITS into the $(OPT_FEATURE_FLAGS) parameter for option in $CFLAGS $CPPFLAGS do case $option in -DSQLITE_OMIT*) OPT_FEATURE_FLAGS="$OPT_FEATURE_FLAGS $option";; - -DSQLITE_ENABLE*) OPT_FEATURE_FLAGS="$OPT_FEATURE_FLAGS $option";; esac done AC_SUBST(OPT_FEATURE_FLAGS) -# attempt to remove any OMITS and ENABLES from the $(CFLAGS) parameter +# attempt to remove any OMITS from the $(CFLAGS) parameter ac_temp_CFLAGS="" for option in $CFLAGS do case $option in -DSQLITE_OMIT*) ;; - -DSQLITE_ENABLE*) ;; *) ac_temp_CFLAGS="$ac_temp_CFLAGS $option";; esac done CFLAGS=$ac_temp_CFLAGS -# attempt to remove any OMITS and ENABLES from the $(CPPFLAGS) parameter +# attempt to remove any OMITS from the $(CPPFLAGS) parameter ac_temp_CPPFLAGS="" for option in $CPPFLAGS do case $option in -DSQLITE_OMIT*) ;; - -DSQLITE_ENABLE*) ;; *) ac_temp_CPPFLAGS="$ac_temp_CPPFLAGS $option";; esac done CPPFLAGS=$ac_temp_CPPFLAGS -# attempt to remove any OMITS and ENABLES from the $(BUILD_CFLAGS) parameter +# attempt to remove any OMITS from the $(BUILD_CFLAGS) parameter ac_temp_BUILD_CFLAGS="" for option in $BUILD_CFLAGS do case $option in -DSQLITE_OMIT*) ;; - -DSQLITE_ENABLE*) ;; *) ac_temp_BUILD_CFLAGS="$ac_temp_BUILD_CFLAGS $option";; esac done BUILD_CFLAGS=$ac_temp_BUILD_CFLAGS Index: ext/fts2/fts2_icu.c ================================================================== --- ext/fts2/fts2_icu.c +++ ext/fts2/fts2_icu.c @@ -9,11 +9,11 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file implements a tokenizer for fts2 based on the ICU library. ** -** $Id: fts2_icu.c,v 1.3 2008/12/18 05:30:26 danielk1977 Exp $ +** $Id: fts2_icu.c,v 1.2 2008/07/22 22:20:50 shess Exp $ */ #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS2) #ifdef SQLITE_ENABLE_ICU @@ -110,13 +110,11 @@ int iInput = 0; int iOut = 0; *ppCursor = 0; - if( nInput<0 ){ - nInput = strlen(zInput); - } + if( -1 == nInput ) nInput = strlen(nInput); nChar = nInput+1; pCsr = (IcuCursor *)sqlite3_malloc( sizeof(IcuCursor) + /* IcuCursor */ nChar * sizeof(UChar) + /* IcuCursor.aChar[] */ (nChar+1) * sizeof(int) /* IcuCursor.aOffset[] */ Index: ext/fts2/fts2_tokenizer.c ================================================================== --- ext/fts2/fts2_tokenizer.c +++ ext/fts2/fts2_tokenizer.c @@ -237,11 +237,11 @@ return sqlite3_finalize(pStmt); } static -int queryFts2Tokenizer( +int queryTokenizer( sqlite3 *db, char *zName, const sqlite3_tokenizer_module **pp ){ int rc; @@ -270,11 +270,11 @@ ** Implementation of the scalar function fts2_tokenizer_internal_test(). ** This function is used for testing only, it is not included in the ** build unless SQLITE_TEST is defined. ** ** The purpose of this is to test that the fts2_tokenizer() function -** can be used as designed by the C-code in the queryFts2Tokenizer and +** can be used as designed by the C-code in the queryTokenizer and ** registerTokenizer() functions above. These two functions are repeated ** in the README.tokenizer file as an example, so it is important to ** test them. ** ** To run the tests, evaluate the fts2_tokenizer_internal_test() scalar @@ -294,22 +294,22 @@ const sqlite3_tokenizer_module *p2; sqlite3 *db = (sqlite3 *)sqlite3_user_data(context); /* Test the query function */ sqlite3Fts2SimpleTokenizerModule(&p1); - rc = queryFts2Tokenizer(db, "simple", &p2); + rc = queryTokenizer(db, "simple", &p2); assert( rc==SQLITE_OK ); assert( p1==p2 ); - rc = queryFts2Tokenizer(db, "nosuchtokenizer", &p2); + rc = queryTokenizer(db, "nosuchtokenizer", &p2); assert( rc==SQLITE_ERROR ); assert( p2==0 ); assert( 0==strcmp(sqlite3_errmsg(db), "unknown tokenizer: nosuchtokenizer") ); /* Test the storage function */ rc = registerTokenizer(db, "nosuchtokenizer", p1); assert( rc==SQLITE_OK ); - rc = queryFts2Tokenizer(db, "nosuchtokenizer", &p2); + rc = queryTokenizer(db, "nosuchtokenizer", &p2); assert( rc==SQLITE_OK ); assert( p2==p1 ); sqlite3_result_text(context, "ok", -1, SQLITE_STATIC); } DELETED ext/fts3/README.syntax Index: ext/fts3/README.syntax ================================================================== --- ext/fts3/README.syntax +++ /dev/null @@ -1,209 +0,0 @@ - -1. OVERVIEW - - This README file describes the syntax of the arguments that may be passed to - the FTS3 MATCH operator used for full-text queries. For example, if table - "t1" is an Fts3 virtual table, the following SQL query: - - SELECT * FROM t1 WHERE MATCH - - may be used to retrieve all rows that match a specified for full-text query. - The text "" should be replaced by either the name of the fts3 table - (in this case "t1"), or by the name of one of the columns of the fts3 - table. should be replaced by an SQL expression that - computes to a string containing an Fts3 query. - - If the left-hand-side of the MATCH operator is set to the name of the - fts3 table, then by default the query may be matched against any column - of the table. If it is set to a column name, then by default the query - may only match the specified column. In both cases this may be overriden - as part of the query text (see sections 2 and 3 below). - - As of SQLite version 3.6.8, Fts3 supports two slightly different query - formats; the standard syntax, which is used by default, and the enhanced - query syntax which can be selected by compiling with the pre-processor - symbol SQLITE_ENABLE_FTS3_PARENTHESIS defined. - - -DSQLITE_ENABLE_FTS3_PARENTHESIS - -2. STANDARD QUERY SYNTAX - - When using the standard Fts3 query syntax, a query usually consists of a - list of terms (words) separated by white-space characters. To match a - query, a row (or column) of an Fts3 table must contain each of the specified - terms. For example, the following query: - - MATCH 'hello world' - - matches rows (or columns, if is the name of a column name) that - contain at least one instance of the token "hello", and at least one - instance of the token "world". Tokens may be grouped into phrases using - quotation marks. In this case, a matching row or column must contain each - of the tokens in the phrase in the order specified, with no intervening - tokens. For example, the query: - - MATCH '"hello world" joe" - - matches the first of the following two documents, but not the second or - third: - - "'Hello world', said Joe." - "One should always greet the world with a cheery hello, thought Joe." - "How many hello world programs could their be?" - - As well as grouping tokens together by phrase, the binary NEAR operator - may be used to search for rows that contain two or more specified tokens - or phrases within a specified proximity of each other. The NEAR operator - must always be specified in upper case. The word "near" in lower or mixed - case is treated as an ordinary token. For example, the following query: - - MATCH 'engineering NEAR consultancy' - - matches rows that contain both the "engineering" and "consultancy" tokens - in the same column with not more than 10 other words between them. It does - not matter which of the two terms occurs first in the document, only that - they be seperated by only 10 tokens or less. The user may also specify - a different required proximity by adding "/N" immediately after the NEAR - operator, where N is an integer. For example: - - MATCH 'engineering NEAR/5 consultancy' - - searches for a row containing an instance of each specified token seperated - by not more than 5 other tokens. More than one NEAR operator can be used - in as sequence. For example this query: - - MATCH 'reliable NEAR/2 engineering NEAR/5 consultancy' - - searches for a row that contains an instance of the token "reliable" - seperated by not more than two tokens from an instance of "engineering", - which is in turn separated by not more than 5 other tokens from an - instance of the term "consultancy". Phrases enclosed in quotes may - also be used as arguments to the NEAR operator. - - Similar to the NEAR operator, one or more tokens or phrases may be - separated by OR operators. In this case, only one of the specified tokens - or phrases must appear in the document. For example, the query: - - MATCH 'hello OR world' - - matches rows that contain either the term "hello", or the term "world", - or both. Note that unlike in many programming languages, the OR operator - has a higher precedence than the AND operators implied between white-space - separated tokens. The following query matches documents that contain the - term 'sqlite' and at least one of the terms 'fantastic' or 'impressive', - not those that contain both 'sqlite' and 'fantastic' or 'impressive': - - MATCH 'sqlite fantastic OR impressive' - - Any token that is part of an Fts3 query expression, whether or not it is - part of a phrase enclosed in quotes, may have a '*' character appended to - it. In this case, the token matches all terms that begin with the characters - of the token, not just those that exactly match it. For example, the - following query: - - MATCH 'sql*' - - matches all rows that contain the term "SQLite", as well as those that - contain "SQL". - - A token that is not part of a quoted phrase may be preceded by a '-' - character, which indicates that matching rows must not contain the - specified term. For example, the following: - - MATCH '"database engine" -sqlite' - - matches rows that contain the phrase "database engine" but do not contain - the term "sqlite". If the '-' character occurs inside a quoted phrase, - it is ignored. It is possible to use both the '-' prefix and the '*' postfix - on a single term. At this time, all Fts3 queries must contain at least - one term or phrase that is not preceded by the '-' prefix. - - Regardless of whether or not a table name or column name is used on the - left hand side of the MATCH operator, a specific column of the fts3 table - may be associated with each token in a query by preceding a token with - a column name followed by a ':' character. For example, regardless of what - is specified for , the following query requires that column "col1" - of the table contains the term "hello", and that column "col2" of the - table contains the term "world". If the table does not contain columns - named "col1" and "col2", then an error is returned and the query is - not run. - - MATCH 'col1:hello col2:world' - - It is not possible to associate a specific table column with a quoted - phrase or a term preceded by a '-' operator. A '*' character may be - appended to a term associated with a specific column for prefix matching. - -3. ENHANCED QUERY SYNTAX - - The enhanced query syntax is quite similar to the standard query syntax, - with the following four differences: - - 1) Parenthesis are supported. When using the enhanced query syntax, - parenthesis may be used to overcome the built-in precedence of the - supplied binary operators. For example, the following query: - - MATCH '(hello world) OR (simple example)' - - matches documents that contain both "hello" and "world", and documents - that contain both "simple" and "example". It is not possible to forumlate - such a query using the standard syntax. - - 2) Instead of separating tokens and phrases by whitespace, an AND operator - may be explicitly specified. This does not change query processing at - all, but may be used to improve readability. For example, the following - query is handled identically to the one above: - - MATCH '(hello AND world) OR (simple AND example)' - - As with the OR and NEAR operators, the AND operator must be specified - in upper case. The word "and" specified in lower or mixed case is - handled as a regular token. - - 3) The '-' token prefix is not supported. Instead, a new binary operator, - NOT, is included. The NOT operator requires that the query specified - as its left-hand operator matches, but that the query specified as the - right-hand operator does not. For example, to query for all rows that - contain the term "example" but not the term "simple", the following - query could be used: - - MATCH 'example NOT simple' - - As for all other operators, the NOT operator must be specified in - upper case. Otherwise it will be treated as a regular token. - - 4) Unlike in the standard syntax, where the OR operator has a higher - precedence than the implicit AND operator, when using the enhanced - syntax implicit and explict AND operators have a higher precedence - than OR operators. Using the enhanced syntax, the following two - queries are equivalent: - - MATCH 'sqlite fantastic OR impressive' - MATCH '(sqlite AND fantastic) OR impressive' - - however, when using the standard syntax, the query: - - MATCH 'sqlite fantastic OR impressive' - - is equivalent to the enhanced syntax query: - - MATCH 'sqlite AND (fantastic OR impressive)' - - The precedence of all enhanced syntax operators, in order from highest - to lowest, is: - - NEAR (highest precedence, tightest grouping) - NOT - AND - OR (lowest precedence, loosest grouping) - - Using the advanced syntax, it is possible to specify expressions enclosed - in parenthesis as operands to the NOT, AND and OR operators. However both - the left and right hand side operands of NEAR operators must be either - tokens or phrases. Attempting the following query will return an error: - - MATCH 'sqlite NEAR (fantastic OR impressive)' - - Queries of this form must be re-written as: - - MATCH 'sqlite NEAR fantastic OR sqlite NEAR impressive' Index: ext/fts3/README.tokenizers ================================================================== --- ext/fts3/README.tokenizers +++ ext/fts3/README.tokenizers @@ -1,15 +1,15 @@ 1. FTS3 Tokenizers When creating a new full-text table, FTS3 allows the user to select the text tokenizer implementation to be used when indexing text - by specifying a "tokenize" clause as part of the CREATE VIRTUAL TABLE + by specifying a "tokenizer" clause as part of the CREATE VIRTUAL TABLE statement: CREATE VIRTUAL TABLE USING fts3( - [, tokenize []] + [, tokenizer []] ); The built-in tokenizers (valid values to pass as ) are "simple" and "porter". Index: ext/fts3/fts3.c ================================================================== --- ext/fts3/fts3.c +++ ext/fts3/fts3.c @@ -206,12 +206,12 @@ ** If the root node is a leaf node, then start_block, ** leaves_end_block, and end_block are all 0. ** ** **** Segment merging **** -** To amortize update costs, segments are grouped into levels and -** merged in batches. Each increase in level represents exponentially +** To amortize update costs, segments are groups into levels and +** merged in matches. Each increase in level represents exponentially ** more documents. ** ** New documents (actually, document updates) are tokenized and ** written individually (using LeafWriter) to a level 0 segment, with ** incrementing idx. When idx reaches MERGE_COUNT (default 16), all @@ -283,11 +283,10 @@ #include #include #include #include "fts3.h" -#include "fts3_expr.h" #include "fts3_hash.h" #include "fts3_tokenizer.h" #ifndef SQLITE_CORE # include "sqlite3ext.h" SQLITE_EXTENSION_INIT1 @@ -311,10 +310,15 @@ # define FTSTRACE(A) printf A; fflush(stdout) #else # define FTSTRACE(A) #endif +/* +** Default span for NEAR operators. +*/ +#define SQLITE_FTS3_DEFAULT_NEAR_PARAM 10 + /* It is not safe to call isspace(), tolower(), or isalnum() on ** hi-bit-set characters. This is the same solution used in the ** tokenizer. */ /* TODO(shess) The snippet-generation code should be using the @@ -1781,10 +1785,94 @@ /* end utility functions */ /* Forward reference */ typedef struct fulltext_vtab fulltext_vtab; + +/* A single term in a query is represented by an instances of +** the following structure. Each word which may match against +** document content is a term. Operators, like NEAR or OR, are +** not terms. Query terms are organized as a flat list stored +** in the Query.pTerms array. +** +** If the QueryTerm.nPhrase variable is non-zero, then the QueryTerm +** is the first in a contiguous string of terms that are either part +** of the same phrase, or connected by the NEAR operator. +** +** If the QueryTerm.nNear variable is non-zero, then the token is followed +** by a NEAR operator with span set to (nNear-1). For example, the +** following query: +** +** The QueryTerm.iPhrase variable stores the index of the token within +** its phrase, indexed starting at 1, or 1 if the token is not part +** of any phrase. +** +** For example, the data structure used to represent the following query: +** +** ... MATCH 'sqlite NEAR/5 google NEAR/2 "search engine"' +** +** is: +** +** {nPhrase=4, iPhrase=1, nNear=6, pTerm="sqlite"}, +** {nPhrase=0, iPhrase=1, nNear=3, pTerm="google"}, +** {nPhrase=0, iPhrase=1, nNear=0, pTerm="search"}, +** {nPhrase=0, iPhrase=2, nNear=0, pTerm="engine"}, +** +** compiling the FTS3 syntax to Query structures is done by the parseQuery() +** function. +*/ +typedef struct QueryTerm { + short int nPhrase; /* How many following terms are part of the same phrase */ + short int iPhrase; /* This is the i-th term of a phrase. */ + short int iColumn; /* Column of the index that must match this term */ + short int nNear; /* term followed by a NEAR operator with span=(nNear-1) */ + signed char isOr; /* this term is preceded by "OR" */ + signed char isNot; /* this term is preceded by "-" */ + signed char isPrefix; /* this term is followed by "*" */ + char *pTerm; /* text of the term. '\000' terminated. malloced */ + int nTerm; /* Number of bytes in pTerm[] */ +} QueryTerm; + + +/* A query string is parsed into a Query structure. + * + * We could, in theory, allow query strings to be complicated + * nested expressions with precedence determined by parentheses. + * But none of the major search engines do this. (Perhaps the + * feeling is that an parenthesized expression is two complex of + * an idea for the average user to grasp.) Taking our lead from + * the major search engines, we will allow queries to be a list + * of terms (with an implied AND operator) or phrases in double-quotes, + * with a single optional "-" before each non-phrase term to designate + * negation and an optional OR connector. + * + * OR binds more tightly than the implied AND, which is what the + * major search engines seem to do. So, for example: + * + * [one two OR three] ==> one AND (two OR three) + * [one OR two three] ==> (one OR two) AND three + * + * A "-" before a term matches all entries that lack that term. + * The "-" must occur immediately before the term with in intervening + * space. This is how the search engines do it. + * + * A NOT term cannot be the right-hand operand of an OR. If this + * occurs in the query string, the NOT is ignored: + * + * [one OR -two] ==> one OR two + * + */ +typedef struct Query { + fulltext_vtab *pFts; /* The full text index */ + int nTerms; /* Number of terms in the query */ + QueryTerm *pTerms; /* Array of terms. Space obtained from malloc() */ + int nextIsOr; /* Set the isOr flag on the next inserted term */ + int nextIsNear; /* Set the isOr flag on the next inserted term */ + int nextColumn; /* Next word parsed must be in this column */ + int dfltColumn; /* The default column */ +} Query; + /* ** An instance of the following structure keeps track of generated ** matching-word offset information and snippets. */ @@ -1932,18 +2020,18 @@ typedef struct fulltext_cursor { sqlite3_vtab_cursor base; /* Base class used by SQLite core */ QueryType iCursorType; /* Copy of sqlite3_index_info.idxNum */ sqlite3_stmt *pStmt; /* Prepared statement in use by the cursor */ int eof; /* True if at End Of Results */ - Fts3Expr *pExpr; /* Parsed MATCH query string */ + Query q; /* Parsed query string */ Snippet snippet; /* Cached snippet for the current row */ int iColumn; /* Column being searched */ DataBuffer result; /* Doclist results from fulltextQuery */ DLReader reader; /* Result reader if result not empty */ } fulltext_cursor; -static fulltext_vtab *cursor_vtab(fulltext_cursor *c){ +static struct fulltext_vtab *cursor_vtab(fulltext_cursor *c){ return (fulltext_vtab *) c->base.pVtab; } static const sqlite3_module fts3Module; /* forward declaration */ @@ -3087,20 +3175,31 @@ }else{ return SQLITE_NOMEM; } } + +/* Free all of the dynamically allocated memory held by *q +*/ +static void queryClear(Query *q){ + int i; + for(i = 0; i < q->nTerms; ++i){ + sqlite3_free(q->pTerms[i].pTerm); + } + sqlite3_free(q->pTerms); + CLEAR(q); +} + /* Free all of the dynamically allocated memory held by the ** Snippet */ static void snippetClear(Snippet *p){ sqlite3_free(p->aMatch); sqlite3_free(p->zOffset); sqlite3_free(p->zSnippet); CLEAR(p); } - /* ** Append a single entry to the p->aMatch[] log. */ static void snippetAppendMatch( Snippet *p, /* Append the entry to this snippet */ @@ -3132,87 +3231,28 @@ ** Sizing information for the circular buffer used in snippetOffsetsOfColumn() */ #define FTS3_ROTOR_SZ (32) #define FTS3_ROTOR_MASK (FTS3_ROTOR_SZ-1) -/* -** Function to iterate through the tokens of a compiled expression. -** -** Except, skip all tokens on the right-hand side of a NOT operator. -** This function is used to find tokens as part of snippet and offset -** generation and we do nt want snippets and offsets to report matches -** for tokens on the RHS of a NOT. -*/ -static int fts3NextExprToken(Fts3Expr **ppExpr, int *piToken){ - Fts3Expr *p = *ppExpr; - int iToken = *piToken; - if( iToken<0 ){ - /* In this case the expression p is the root of an expression tree. - ** Move to the first token in the expression tree. - */ - while( p->pLeft ){ - p = p->pLeft; - } - iToken = 0; - }else{ - assert(p && p->eType==FTSQUERY_PHRASE ); - if( iToken<(p->pPhrase->nToken-1) ){ - iToken++; - }else{ - iToken = 0; - while( p->pParent && p->pParent->pLeft!=p ){ - assert( p->pParent->pRight==p ); - p = p->pParent; - } - p = p->pParent; - if( p ){ - assert( p->pRight!=0 ); - p = p->pRight; - while( p->pLeft ){ - p = p->pLeft; - } - } - } - } - - *ppExpr = p; - *piToken = iToken; - return p?1:0; -} - -/* -** Return TRUE if the expression node pExpr is located beneath the -** RHS of a NOT operator. -*/ -static int fts3ExprBeneathNot(Fts3Expr *p){ - Fts3Expr *pParent; - while( p ){ - pParent = p->pParent; - if( pParent && pParent->eType==FTSQUERY_NOT && pParent->pRight==p ){ - return 1; - } - p = pParent; - } - return 0; -} - /* ** Add entries to pSnippet->aMatch[] for every match that occurs against ** document zDoc[0..nDoc-1] which is stored in column iColumn. */ static void snippetOffsetsOfColumn( - fulltext_cursor *pCur, /* The fulltest search cursor */ - Snippet *pSnippet, /* The Snippet object to be filled in */ - int iColumn, /* Index of fulltext table column */ - const char *zDoc, /* Text of the fulltext table column */ - int nDoc /* Length of zDoc in bytes */ + Query *pQuery, + Snippet *pSnippet, + int iColumn, + const char *zDoc, + int nDoc ){ const sqlite3_tokenizer_module *pTModule; /* The tokenizer module */ sqlite3_tokenizer *pTokenizer; /* The specific tokenizer */ sqlite3_tokenizer_cursor *pTCursor; /* Tokenizer cursor */ fulltext_vtab *pVtab; /* The full text index */ int nColumn; /* Number of columns in the index */ + const QueryTerm *aTerm; /* Query string terms */ + int nTerm; /* Number of query string terms */ int i, j; /* Loop counters */ int rc; /* Return code */ unsigned int match, prevMatch; /* Phrase search bitmasks */ const char *zToken; /* Next token from the tokenizer */ int nToken; /* Size of zToken */ @@ -3222,43 +3262,41 @@ ** few tokens */ unsigned int iRotor = 0; /* Index of current token */ int iRotorBegin[FTS3_ROTOR_SZ]; /* Beginning offset of token */ int iRotorLen[FTS3_ROTOR_SZ]; /* Length of token */ - pVtab = cursor_vtab(pCur); + pVtab = pQuery->pFts; nColumn = pVtab->nColumn; pTokenizer = pVtab->pTokenizer; pTModule = pTokenizer->pModule; rc = pTModule->xOpen(pTokenizer, zDoc, nDoc, &pTCursor); if( rc ) return; pTCursor->pTokenizer = pTokenizer; - + aTerm = pQuery->pTerms; + nTerm = pQuery->nTerms; + if( nTerm>=FTS3_ROTOR_SZ ){ + nTerm = FTS3_ROTOR_SZ - 1; + } prevMatch = 0; - while( !pTModule->xNext(pTCursor, &zToken, &nToken, &iBegin, &iEnd, &iPos) ){ - Fts3Expr *pIter = pCur->pExpr; - int iIter = -1; + while(1){ + rc = pTModule->xNext(pTCursor, &zToken, &nToken, &iBegin, &iEnd, &iPos); + if( rc ) break; iRotorBegin[iRotor&FTS3_ROTOR_MASK] = iBegin; iRotorLen[iRotor&FTS3_ROTOR_MASK] = iEnd-iBegin; match = 0; - for(i=0; i<(FTS3_ROTOR_SZ-1) && fts3NextExprToken(&pIter, &iIter); i++){ - int nPhrase; /* Number of tokens in current phrase */ - struct PhraseToken *pToken; /* Current token */ - int iCol; /* Column index */ - - if( fts3ExprBeneathNot(pIter) ) continue; - nPhrase = pIter->pPhrase->nToken; - pToken = &pIter->pPhrase->aToken[iIter]; - iCol = pIter->pPhrase->iColumn; + for(i=0; i=0 && iColn>nToken ) continue; - if( !pToken->isPrefix && pToken->nn<=nToken ); - if( memcmp(pToken->z, zToken, pToken->n) ) continue; - if( iIter>0 && (prevMatch & (1<nToken ) continue; + if( !aTerm[i].isPrefix && aTerm[i].nTerm1 && (prevMatch & (1<=0; j--){ + if( i==nTerm-1 || aTerm[i+1].iPhrase==1 ){ + for(j=aTerm[i].iPhrase-1; j>=0; j--){ int k = (iRotor-j) & FTS3_ROTOR_MASK; snippetAppendMatch(pSnippet, iColumn, i-j, iPos-j, iRotorBegin[k], iRotorLen[k]); } } @@ -3284,119 +3322,90 @@ ** A NEAR/0 E ** ** then when this function is called the Snippet contains token offsets ** 0, 4 and 5. This function removes the "0" entry (because the first A ** is not near enough to an E). -** -** When this function is called, the value pointed to by parameter piLeft is -** the integer id of the left-most token in the expression tree headed by -** pExpr. This function increments *piLeft by the total number of tokens -** in the expression tree headed by pExpr. -** -** Return 1 if any trimming occurs. Return 0 if no trimming is required. -*/ -static int trimSnippetOffsets( - Fts3Expr *pExpr, /* The search expression */ - Snippet *pSnippet, /* The set of snippet offsets to be trimmed */ - int *piLeft /* Index of left-most token in pExpr */ -){ - if( pExpr ){ - if( trimSnippetOffsets(pExpr->pLeft, pSnippet, piLeft) ){ - return 1; - } - - switch( pExpr->eType ){ - case FTSQUERY_PHRASE: - *piLeft += pExpr->pPhrase->nToken; - break; - case FTSQUERY_NEAR: { - /* The right-hand-side of a NEAR operator is always a phrase. The - ** left-hand-side is either a phrase or an expression tree that is - ** itself headed by a NEAR operator. The following initializations - ** set local variable iLeft to the token number of the left-most - ** token in the right-hand phrase, and iRight to the right most - ** token in the same phrase. For example, if we had: - ** - ** MATCH '"abc def" NEAR/2 "ghi jkl"' - ** - ** then iLeft will be set to 2 (token number of ghi) and nToken will - ** be set to 4. - */ - Fts3Expr *pLeft = pExpr->pLeft; - Fts3Expr *pRight = pExpr->pRight; - int iLeft = *piLeft; - int nNear = pExpr->nNear; - int nToken = pRight->pPhrase->nToken; - int jj, ii; - if( pLeft->eType==FTSQUERY_NEAR ){ - pLeft = pLeft->pRight; - } - assert( pRight->eType==FTSQUERY_PHRASE ); - assert( pLeft->eType==FTSQUERY_PHRASE ); - nToken += pLeft->pPhrase->nToken; - - for(ii=0; iinMatch; ii++){ - struct snippetMatch *p = &pSnippet->aMatch[ii]; - if( p->iTerm==iLeft ){ - int isOk = 0; - /* Snippet ii is an occurence of query term iLeft in the document. - ** It occurs at position (p->iToken) of the document. We now - ** search for an instance of token (iLeft-1) somewhere in the - ** range (p->iToken - nNear)...(p->iToken + nNear + nToken) within - ** the set of snippetMatch structures. If one is found, proceed. - ** If one cannot be found, then remove snippets ii..(ii+N-1) - ** from the matching snippets, where N is the number of tokens - ** in phrase pRight->pPhrase. - */ - for(jj=0; isOk==0 && jjnMatch; jj++){ - struct snippetMatch *p2 = &pSnippet->aMatch[jj]; - if( p2->iTerm==(iLeft-1) ){ - if( p2->iToken>=(p->iToken-nNear-1) - && p2->iToken<(p->iToken+nNear+nToken) - ){ - isOk = 1; - } - } - } - if( !isOk ){ - int kk; - for(kk=0; kkpPhrase->nToken; kk++){ - pSnippet->aMatch[kk+ii].iTerm = -2; - } - return 1; - } - } - if( p->iTerm==(iLeft-1) ){ - int isOk = 0; - for(jj=0; isOk==0 && jjnMatch; jj++){ - struct snippetMatch *p2 = &pSnippet->aMatch[jj]; - if( p2->iTerm==iLeft ){ - if( p2->iToken<=(p->iToken+nNear+1) - && p2->iToken>(p->iToken-nNear-nToken) - ){ - isOk = 1; - } - } - } - if( !isOk ){ - int kk; - for(kk=0; kkpPhrase->nToken; kk++){ - pSnippet->aMatch[ii-kk].iTerm = -2; - } - return 1; - } - } - } - break; - } - } - - if( trimSnippetOffsets(pExpr->pRight, pSnippet, piLeft) ){ - return 1; - } - } - return 0; +*/ +static void trimSnippetOffsetsForNear(Query *pQuery, Snippet *pSnippet){ + int ii; + int iDir = 1; + + while(iDir>-2) { + assert( iDir==1 || iDir==-1 ); + for(ii=0; iinMatch; ii++){ + int jj; + int nNear; + struct snippetMatch *pMatch = &pSnippet->aMatch[ii]; + QueryTerm *pQueryTerm = &pQuery->pTerms[pMatch->iTerm]; + + if( (pMatch->iTerm+iDir)<0 + || (pMatch->iTerm+iDir)>=pQuery->nTerms + ){ + continue; + } + + nNear = pQueryTerm->nNear; + if( iDir<0 ){ + nNear = pQueryTerm[-1].nNear; + } + + if( pMatch->iTerm>=0 && nNear ){ + int isOk = 0; + int iNextTerm = pMatch->iTerm+iDir; + int iPrevTerm = iNextTerm; + + int iEndToken; + int iStartToken; + + if( iDir<0 ){ + int nPhrase = 1; + iStartToken = pMatch->iToken; + while( (pMatch->iTerm+nPhrase)nTerms + && pQuery->pTerms[pMatch->iTerm+nPhrase].iPhrase>1 + ){ + nPhrase++; + } + iEndToken = iStartToken + nPhrase - 1; + }else{ + iEndToken = pMatch->iToken; + iStartToken = pMatch->iToken+1-pQueryTerm->iPhrase; + } + + while( pQuery->pTerms[iNextTerm].iPhrase>1 ){ + iNextTerm--; + } + while( (iPrevTerm+1)nTerms && + pQuery->pTerms[iPrevTerm+1].iPhrase>1 + ){ + iPrevTerm++; + } + + for(jj=0; isOk==0 && jjnMatch; jj++){ + struct snippetMatch *p = &pSnippet->aMatch[jj]; + if( p->iCol==pMatch->iCol && (( + p->iTerm==iNextTerm && + p->iToken>iEndToken && + p->iToken<=iEndToken+nNear + ) || ( + p->iTerm==iPrevTerm && + p->iTokeniToken>=iStartToken-nNear + ))){ + isOk = 1; + } + } + if( !isOk ){ + for(jj=1-pQueryTerm->iPhrase; jj<=0; jj++){ + pMatch[jj].iTerm = -1; + } + ii = -1; + iDir = 1; + } + } + } + iDir -= 2; + } } /* ** Compute all offsets for the current row of the query. ** If the offsets have already been computed, this routine is a no-op. @@ -3403,44 +3412,38 @@ */ static void snippetAllOffsets(fulltext_cursor *p){ int nColumn; int iColumn, i; int iFirst, iLast; - int iTerm = 0; - fulltext_vtab *pFts = cursor_vtab(p); + fulltext_vtab *pFts; - if( p->snippet.nMatch || p->pExpr==0 ){ - return; - } + if( p->snippet.nMatch ) return; + if( p->q.nTerms==0 ) return; + pFts = p->q.pFts; nColumn = pFts->nColumn; iColumn = (p->iCursorType - QUERY_FULLTEXT); if( iColumn<0 || iColumn>=nColumn ){ - /* Look for matches over all columns of the full-text index */ iFirst = 0; iLast = nColumn-1; }else{ - /* Look for matches in the iColumn-th column of the index only */ iFirst = iColumn; iLast = iColumn; } for(i=iFirst; i<=iLast; i++){ const char *zDoc; int nDoc; zDoc = (const char*)sqlite3_column_text(p->pStmt, i+1); nDoc = sqlite3_column_bytes(p->pStmt, i+1); - snippetOffsetsOfColumn(p, &p->snippet, i, zDoc, nDoc); + snippetOffsetsOfColumn(&p->q, &p->snippet, i, zDoc, nDoc); } - while( trimSnippetOffsets(p->pExpr, &p->snippet, &iTerm) ){ - iTerm = 0; - } + trimSnippetOffsetsForNear(&p->q, &p->snippet); } /* ** Convert the information in the aMatch[] array of the snippet -** into the string zOffset[0..nOffset-1]. This string is used as -** the return of the SQL offsets() function. +** into the string zOffset[0..nOffset-1]. */ static void snippetOffsetText(Snippet *p){ int i; int cnt = 0; StringBuffer sb; @@ -3551,11 +3554,11 @@ for(i=0; iq.nTerms; i++){ for(j=0; jpStmt); - sqlite3Fts3ExprFree(c->pExpr); + queryClear(&c->q); snippetClear(&c->snippet); - if( c->result.nData!=0 ){ - dlrDestroy(&c->reader); - } + if( c->result.nData!=0 ) dlrDestroy(&c->reader); dataBufferDestroy(&c->result); sqlite3_free(c); return SQLITE_OK; } @@ -3700,131 +3701,259 @@ */ static int termSelect(fulltext_vtab *v, int iColumn, const char *pTerm, int nTerm, int isPrefix, DocListType iType, DataBuffer *out); -/* -** Return a DocList corresponding to the phrase *pPhrase. +/* Return a DocList corresponding to the query term *pTerm. If *pTerm +** is the first term of a phrase query, go ahead and evaluate the phrase +** query and return the doclist for the entire phrase query. ** ** The resulting DL_DOCIDS doclist is stored in pResult, which is ** overwritten. */ -static int docListOfPhrase( - fulltext_vtab *pTab, /* The full text index */ - Fts3Phrase *pPhrase, /* Phrase to return a doclist corresponding to */ - DocListType eListType, /* Either DL_DOCIDS or DL_POSITIONS */ - DataBuffer *pResult /* Write the result here */ +static int docListOfTerm( + fulltext_vtab *v, /* The full text index */ + int iColumn, /* column to restrict to. No restriction if >=nColumn */ + QueryTerm *pQTerm, /* Term we are looking for, or 1st term of a phrase */ + DataBuffer *pResult /* Write the result here */ ){ - int ii; - int rc = SQLITE_OK; - int iCol = pPhrase->iColumn; - DocListType eType = eListType; - assert( eType==DL_POSITIONS || eType==DL_DOCIDS ); - if( pPhrase->nToken>1 ){ - eType = DL_POSITIONS; - } + DataBuffer left, right, new; + int i, rc; + + /* No phrase search if no position info. */ + assert( pQTerm->nPhrase==0 || DL_DEFAULT!=DL_DOCIDS ); /* This code should never be called with buffered updates. */ - assert( pTab->nPendingData<0 ); - - for(ii=0; rc==SQLITE_OK && iinToken; ii++){ - DataBuffer tmp; - struct PhraseToken *p = &pPhrase->aToken[ii]; - rc = termSelect(pTab, iCol, p->z, p->n, p->isPrefix, eType, &tmp); - if( rc==SQLITE_OK ){ - if( ii==0 ){ - *pResult = tmp; - }else{ - DataBuffer res = *pResult; - dataBufferInit(pResult, 0); - if( ii==(pPhrase->nToken-1) ){ - eType = eListType; - } - docListPhraseMerge( - res.pData, res.nData, tmp.pData, tmp.nData, 0, 0, eType, pResult - ); - dataBufferDestroy(&res); - dataBufferDestroy(&tmp); - } - } - } - - return rc; -} - -/* -** Evaluate the full-text expression pExpr against fts3 table pTab. Write -** the results into pRes. -*/ -static int evalFts3Expr( - fulltext_vtab *pTab, /* Fts3 Virtual table object */ - Fts3Expr *pExpr, /* Parsed fts3 expression */ - DataBuffer *pRes /* OUT: Write results of the expression here */ -){ - int rc = SQLITE_OK; - - /* Initialize the output buffer. If this is an empty query (pExpr==0), - ** this is all that needs to be done. Empty queries produce empty - ** result sets. - */ - dataBufferInit(pRes, 0); - - if( pExpr ){ - if( pExpr->eType==FTSQUERY_PHRASE ){ - DocListType eType = DL_DOCIDS; - if( pExpr->pParent && pExpr->pParent->eType==FTSQUERY_NEAR ){ - eType = DL_POSITIONS; - } - rc = docListOfPhrase(pTab, pExpr->pPhrase, eType, pRes); - }else{ - DataBuffer lhs; - DataBuffer rhs; - - dataBufferInit(&rhs, 0); - if( SQLITE_OK==(rc = evalFts3Expr(pTab, pExpr->pLeft, &lhs)) - && SQLITE_OK==(rc = evalFts3Expr(pTab, pExpr->pRight, &rhs)) - ){ - switch( pExpr->eType ){ - case FTSQUERY_NEAR: { - int nToken; - Fts3Expr *pLeft; - DocListType eType = DL_DOCIDS; - if( pExpr->pParent && pExpr->pParent->eType==FTSQUERY_NEAR ){ - eType = DL_POSITIONS; - } - pLeft = pExpr->pLeft; - while( pLeft->eType==FTSQUERY_NEAR ){ - pLeft=pLeft->pRight; - } - assert( pExpr->pRight->eType==FTSQUERY_PHRASE ); - assert( pLeft->eType==FTSQUERY_PHRASE ); - nToken = pLeft->pPhrase->nToken + pExpr->pRight->pPhrase->nToken; - docListPhraseMerge(lhs.pData, lhs.nData, rhs.pData, rhs.nData, - pExpr->nNear+1, nToken, eType, pRes - ); - break; - } - case FTSQUERY_NOT: { - docListExceptMerge(lhs.pData, lhs.nData, rhs.pData, rhs.nData,pRes); - break; - } - case FTSQUERY_AND: { - docListAndMerge(lhs.pData, lhs.nData, rhs.pData, rhs.nData, pRes); - break; - } - case FTSQUERY_OR: { - docListOrMerge(lhs.pData, lhs.nData, rhs.pData, rhs.nData, pRes); - break; - } - } - } - dataBufferDestroy(&lhs); - dataBufferDestroy(&rhs); - } - } - - return rc; + assert( v->nPendingData<0 ); + + dataBufferInit(&left, 0); + rc = termSelect(v, iColumn, pQTerm->pTerm, pQTerm->nTerm, pQTerm->isPrefix, + (0nPhrase ? DL_POSITIONS : DL_DOCIDS), &left); + if( rc ) return rc; + for(i=1; i<=pQTerm->nPhrase && left.nData>0; i++){ + /* If this token is connected to the next by a NEAR operator, and + ** the next token is the start of a phrase, then set nPhraseRight + ** to the number of tokens in the phrase. Otherwise leave it at 1. + */ + int nPhraseRight = 1; + while( (i+nPhraseRight)<=pQTerm->nPhrase + && pQTerm[i+nPhraseRight].nNear==0 + ){ + nPhraseRight++; + } + + dataBufferInit(&right, 0); + rc = termSelect(v, iColumn, pQTerm[i].pTerm, pQTerm[i].nTerm, + pQTerm[i].isPrefix, DL_POSITIONS, &right); + if( rc ){ + dataBufferDestroy(&left); + return rc; + } + dataBufferInit(&new, 0); + docListPhraseMerge(left.pData, left.nData, right.pData, right.nData, + pQTerm[i-1].nNear, pQTerm[i-1].iPhrase + nPhraseRight, + ((inPhrase) ? DL_POSITIONS : DL_DOCIDS), + &new); + dataBufferDestroy(&left); + dataBufferDestroy(&right); + left = new; + } + *pResult = left; + return SQLITE_OK; +} + +/* Add a new term pTerm[0..nTerm-1] to the query *q. +*/ +static void queryAdd(Query *q, const char *pTerm, int nTerm){ + QueryTerm *t; + ++q->nTerms; + q->pTerms = sqlite3_realloc(q->pTerms, q->nTerms * sizeof(q->pTerms[0])); + if( q->pTerms==0 ){ + q->nTerms = 0; + return; + } + t = &q->pTerms[q->nTerms - 1]; + CLEAR(t); + t->pTerm = sqlite3_malloc(nTerm+1); + memcpy(t->pTerm, pTerm, nTerm); + t->pTerm[nTerm] = 0; + t->nTerm = nTerm; + t->isOr = q->nextIsOr; + t->isPrefix = 0; + q->nextIsOr = 0; + t->iColumn = q->nextColumn; + q->nextColumn = q->dfltColumn; +} + +/* +** Check to see if the string zToken[0...nToken-1] matches any +** column name in the virtual table. If it does, +** return the zero-indexed column number. If not, return -1. +*/ +static int checkColumnSpecifier( + fulltext_vtab *pVtab, /* The virtual table */ + const char *zToken, /* Text of the token */ + int nToken /* Number of characters in the token */ +){ + int i; + for(i=0; inColumn; i++){ + if( memcmp(pVtab->azColumn[i], zToken, nToken)==0 + && pVtab->azColumn[i][nToken]==0 ){ + return i; + } + } + return -1; +} + +/* +** Parse the text at zSegment[0..nSegment-1]. Add additional terms +** to the query being assemblied in pQuery. +** +** inPhrase is true if zSegment[0..nSegement-1] is contained within +** double-quotes. If inPhrase is true, then the first term +** is marked with the number of terms in the phrase less one and +** OR and "-" syntax is ignored. If inPhrase is false, then every +** term found is marked with nPhrase=0 and OR and "-" syntax is significant. +*/ +static int tokenizeSegment( + sqlite3_tokenizer *pTokenizer, /* The tokenizer to use */ + const char *zSegment, int nSegment, /* Query expression being parsed */ + int inPhrase, /* True if within "..." */ + Query *pQuery /* Append results here */ +){ + const sqlite3_tokenizer_module *pModule = pTokenizer->pModule; + sqlite3_tokenizer_cursor *pCursor; + int firstIndex = pQuery->nTerms; + int iCol; + int nTerm = 1; + + int rc = pModule->xOpen(pTokenizer, zSegment, nSegment, &pCursor); + if( rc!=SQLITE_OK ) return rc; + pCursor->pTokenizer = pTokenizer; + + while( 1 ){ + const char *zToken; + int nToken, iBegin, iEnd, iPos; + + rc = pModule->xNext(pCursor, + &zToken, &nToken, + &iBegin, &iEnd, &iPos); + if( rc!=SQLITE_OK ) break; + if( !inPhrase && + zSegment[iEnd]==':' && + (iCol = checkColumnSpecifier(pQuery->pFts, zToken, nToken))>=0 ){ + pQuery->nextColumn = iCol; + continue; + } + if( !inPhrase && pQuery->nTerms>0 && nToken==2 + && zSegment[iBegin+0]=='O' + && zSegment[iBegin+1]=='R' + ){ + pQuery->nextIsOr = 1; + continue; + } + if( !inPhrase && pQuery->nTerms>0 && !pQuery->nextIsOr && nToken==4 + && memcmp(&zSegment[iBegin], "NEAR", 4)==0 + ){ + QueryTerm *pTerm = &pQuery->pTerms[pQuery->nTerms-1]; + if( (iBegin+6)nNear = 0; + for(k=5; (iBegin+k)<=nSegment && isdigit(zSegment[iBegin+k]); k++){ + pTerm->nNear = pTerm->nNear*10 + (zSegment[iBegin+k] - '0'); + } + pModule->xNext(pCursor, &zToken, &nToken, &iBegin, &iEnd, &iPos); + } else { + pTerm->nNear = SQLITE_FTS3_DEFAULT_NEAR_PARAM; + } + pTerm->nNear++; + continue; + } + + queryAdd(pQuery, zToken, nToken); + if( !inPhrase && iBegin>0 && zSegment[iBegin-1]=='-' ){ + pQuery->pTerms[pQuery->nTerms-1].isNot = 1; + } + if( iEndpTerms[pQuery->nTerms-1].isPrefix = 1; + } + pQuery->pTerms[pQuery->nTerms-1].iPhrase = nTerm; + if( inPhrase ){ + nTerm++; + } + } + + if( inPhrase && pQuery->nTerms>firstIndex ){ + pQuery->pTerms[firstIndex].nPhrase = pQuery->nTerms - firstIndex - 1; + } + + return pModule->xClose(pCursor); +} + +/* Parse a query string, yielding a Query object pQuery. +** +** The calling function will need to queryClear() to clean up +** the dynamically allocated memory held by pQuery. +*/ +static int parseQuery( + fulltext_vtab *v, /* The fulltext index */ + const char *zInput, /* Input text of the query string */ + int nInput, /* Size of the input text */ + int dfltColumn, /* Default column of the index to match against */ + Query *pQuery /* Write the parse results here. */ +){ + int iInput, inPhrase = 0; + int ii; + QueryTerm *aTerm; + + if( zInput==0 ) nInput = 0; + if( nInput<0 ) nInput = strlen(zInput); + pQuery->nTerms = 0; + pQuery->pTerms = NULL; + pQuery->nextIsOr = 0; + pQuery->nextColumn = dfltColumn; + pQuery->dfltColumn = dfltColumn; + pQuery->pFts = v; + + for(iInput=0; iInputiInput ){ + tokenizeSegment(v->pTokenizer, zInput+iInput, i-iInput, inPhrase, + pQuery); + } + iInput = i; + if( ipTerms; + for(ii=0; iinTerms; ii++){ + if( aTerm[ii].nNear || aTerm[ii].nPhrase ){ + while (aTerm[ii+aTerm[ii].nPhrase].nNear) { + aTerm[ii].nPhrase += (1 + aTerm[ii+aTerm[ii].nPhrase+1].nPhrase); + } + } + } + + return SQLITE_OK; } /* TODO(shess) Refactor the code to remove this forward decl. */ static int flushPendingTerms(fulltext_vtab *v); @@ -3839,13 +3968,16 @@ fulltext_vtab *v, /* The full text index */ int iColumn, /* Match against this column by default */ const char *zInput, /* The query string */ int nInput, /* Number of bytes in zInput[] */ DataBuffer *pResult, /* Write the result doclist here */ - Fts3Expr **ppExpr /* Put parsed query string here */ + Query *pQuery /* Put parsed query string here */ ){ - int rc; + int i, iNext, rc; + DataBuffer left, right, or, new; + int nNot = 0; + QueryTerm *aTerm; /* TODO(shess) Instead of flushing pendingTerms, we could query for ** the relevant term and merge the doclist into what we receive from ** the database. Wait and see if this is a common issue, first. ** @@ -3853,24 +3985,90 @@ ** error codes from here. */ /* Flush any buffered updates before executing the query. */ rc = flushPendingTerms(v); - if( rc!=SQLITE_OK ){ - return rc; + if( rc!=SQLITE_OK ) return rc; + + /* TODO(shess) I think that the queryClear() calls below are not + ** necessary, because fulltextClose() already clears the query. + */ + rc = parseQuery(v, zInput, nInput, iColumn, pQuery); + if( rc!=SQLITE_OK ) return rc; + + /* Empty or NULL queries return no results. */ + if( pQuery->nTerms==0 ){ + dataBufferInit(pResult, 0); + return SQLITE_OK; } - /* Parse the query passed to the MATCH operator. */ - rc = sqlite3Fts3ExprParse(v->pTokenizer, - v->azColumn, v->nColumn, iColumn, zInput, nInput, ppExpr - ); - if( rc!=SQLITE_OK ){ - assert( 0==(*ppExpr) ); - return rc; + /* Merge AND terms. */ + /* TODO(shess) I think we can early-exit if( i>nNot && left.nData==0 ). */ + aTerm = pQuery->pTerms; + for(i = 0; inTerms; i=iNext){ + if( aTerm[i].isNot ){ + /* Handle all NOT terms in a separate pass */ + nNot++; + iNext = i + aTerm[i].nPhrase+1; + continue; + } + iNext = i + aTerm[i].nPhrase + 1; + rc = docListOfTerm(v, aTerm[i].iColumn, &aTerm[i], &right); + if( rc ){ + if( i!=nNot ) dataBufferDestroy(&left); + queryClear(pQuery); + return rc; + } + while( iNextnTerms && aTerm[iNext].isOr ){ + rc = docListOfTerm(v, aTerm[iNext].iColumn, &aTerm[iNext], &or); + iNext += aTerm[iNext].nPhrase + 1; + if( rc ){ + if( i!=nNot ) dataBufferDestroy(&left); + dataBufferDestroy(&right); + queryClear(pQuery); + return rc; + } + dataBufferInit(&new, 0); + docListOrMerge(right.pData, right.nData, or.pData, or.nData, &new); + dataBufferDestroy(&right); + dataBufferDestroy(&or); + right = new; + } + if( i==nNot ){ /* first term processed. */ + left = right; + }else{ + dataBufferInit(&new, 0); + docListAndMerge(left.pData, left.nData, right.pData, right.nData, &new); + dataBufferDestroy(&right); + dataBufferDestroy(&left); + left = new; + } } - return evalFts3Expr(v, *ppExpr, pResult); + if( nNot==pQuery->nTerms ){ + /* We do not yet know how to handle a query of only NOT terms */ + return SQLITE_ERROR; + } + + /* Do the EXCEPT terms */ + for(i=0; inTerms; i += aTerm[i].nPhrase + 1){ + if( !aTerm[i].isNot ) continue; + rc = docListOfTerm(v, aTerm[i].iColumn, &aTerm[i], &right); + if( rc ){ + queryClear(pQuery); + dataBufferDestroy(&left); + return rc; + } + dataBufferInit(&new, 0); + docListExceptMerge(left.pData, left.nData, right.pData, right.nData, &new); + dataBufferDestroy(&right); + dataBufferDestroy(&left); + left = new; + } + + *pResult = left; + return rc; } /* ** This is the xFilter interface for the virtual table. See ** the virtual table xFilter method documentation for additional @@ -3946,22 +4144,22 @@ if( rc!=SQLITE_OK ) return rc; break; default: /* full-text search */ { - int iCol = idxNum-QUERY_FULLTEXT; const char *zQuery = (const char *)sqlite3_value_text(argv[0]); assert( idxNum<=QUERY_FULLTEXT+v->nColumn); assert( argc==1 ); + queryClear(&c->q); if( c->result.nData!=0 ){ /* This case happens if the same cursor is used repeatedly. */ dlrDestroy(&c->reader); dataBufferReset(&c->result); }else{ dataBufferInit(&c->result, 0); } - rc = fulltextQuery(v, iCol, zQuery, -1, &c->result, &c->pExpr); + rc = fulltextQuery(v, idxNum-QUERY_FULLTEXT, zQuery, -1, &c->result, &c->q); if( rc!=SQLITE_OK ) return rc; if( c->result.nData!=0 ){ dlrInit(&c->reader, DL_DOCIDS, c->result.pData, c->result.nData); } break; @@ -5841,28 +6039,22 @@ } /* Scan the database and merge together the posting lists for the term ** into *out. */ -static int termSelect( - fulltext_vtab *v, - int iColumn, - const char *pTerm, int nTerm, /* Term to query for */ - int isPrefix, /* True for a prefix search */ - DocListType iType, - DataBuffer *out /* Write results here */ -){ +static int termSelect(fulltext_vtab *v, int iColumn, + const char *pTerm, int nTerm, int isPrefix, + DocListType iType, DataBuffer *out){ DataBuffer doclist; sqlite3_stmt *s; int rc = sql_get_statement(v, SEGDIR_SELECT_ALL_STMT, &s); if( rc!=SQLITE_OK ) return rc; /* This code should never be called with buffered updates. */ assert( v->nPendingData<0 ); dataBufferInit(&doclist, 0); - dataBufferInit(out, 0); /* Traverse the segments from oldest to newest so that newer doclist ** elements for given docids overwrite older elements. */ while( (rc = sqlite3_step(s))==SQLITE_ROW ){ @@ -6976,14 +7168,10 @@ ){ rc = SQLITE_NOMEM; } } -#ifdef SQLITE_TEST - sqlite3Fts3ExprInitTestInterface(db); -#endif - /* Create the virtual table wrapper around the hash-table and overload ** the two scalar functions. If this is successful, register the ** module with sqlite. */ if( SQLITE_OK==rc DELETED ext/fts3/fts3_expr.c Index: ext/fts3/fts3_expr.c ================================================================== --- ext/fts3/fts3_expr.c +++ /dev/null @@ -1,890 +0,0 @@ -/* -** 2008 Nov 28 -** -** 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 module contains code that implements a parser for fts3 query strings -** (the right-hand argument to the MATCH operator). Because the supported -** syntax is relatively simple, the whole tokenizer/parser system is -** hand-coded. The public interface to this module is declared in source -** code file "fts3_expr.h". -*/ -#if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) - -/* -** By default, this module parses the legacy syntax that has been -** traditionally used by fts3. Or, if SQLITE_ENABLE_FTS3_PARENTHESIS -** is defined, then it uses the new syntax. The differences between -** the new and the old syntaxes are: -** -** a) The new syntax supports parenthesis. The old does not. -** -** b) The new syntax supports the AND and NOT operators. The old does not. -** -** c) The old syntax supports the "-" token qualifier. This is not -** supported by the new syntax (it is replaced by the NOT operator). -** -** d) When using the old syntax, the OR operator has a greater precedence -** than an implicit AND. When using the new, both implicity and explicit -** AND operators have a higher precedence than OR. -** -** If compiled with SQLITE_TEST defined, then this module exports the -** symbol "int sqlite3_fts3_enable_parentheses". Setting this variable -** to zero causes the module to use the old syntax. If it is set to -** non-zero the new syntax is activated. This is so both syntaxes can -** be tested using a single build of testfixture. -*/ -#ifdef SQLITE_TEST -int sqlite3_fts3_enable_parentheses = 0; -#else -# ifdef SQLITE_ENABLE_FTS3_PARENTHESIS -# define sqlite3_fts3_enable_parentheses 1 -# else -# define sqlite3_fts3_enable_parentheses 0 -# endif -#endif - -/* -** Default span for NEAR operators. -*/ -#define SQLITE_FTS3_DEFAULT_NEAR_PARAM 10 - -#include "fts3_expr.h" -#include "sqlite3.h" -#include -#include -#include - -typedef struct ParseContext ParseContext; -struct ParseContext { - sqlite3_tokenizer *pTokenizer; /* Tokenizer module */ - const char **azCol; /* Array of column names for fts3 table */ - int nCol; /* Number of entries in azCol[] */ - int iDefaultCol; /* Default column to query */ - sqlite3_context *pCtx; /* Write error message here */ - int nNest; /* Number of nested brackets */ -}; - -/* -** This function is equivalent to the standard isspace() function. -** -** The standard isspace() can be awkward to use safely, because although it -** is defined to accept an argument of type int, its behaviour when passed -** an integer that falls outside of the range of the unsigned char type -** is undefined (and sometimes, "undefined" means segfault). This wrapper -** is defined to accept an argument of type char, and always returns 0 for -** any values that fall outside of the range of the unsigned char type (i.e. -** negative values). -*/ -static int fts3isspace(char c){ - return (c&0x80)==0 ? isspace(c) : 0; -} - -/* -** Extract the next token from buffer z (length n) using the tokenizer -** and other information (column names etc.) in pParse. Create an Fts3Expr -** structure of type FTSQUERY_PHRASE containing a phrase consisting of this -** single token and set *ppExpr to point to it. If the end of the buffer is -** reached before a token is found, set *ppExpr to zero. It is the -** responsibility of the caller to eventually deallocate the allocated -** Fts3Expr structure (if any) by passing it to sqlite3_free(). -** -** Return SQLITE_OK if successful, or SQLITE_NOMEM if a memory allocation -** fails. -*/ -static int getNextToken( - ParseContext *pParse, /* fts3 query parse context */ - int iCol, /* Value for Fts3Phrase.iColumn */ - const char *z, int n, /* Input string */ - Fts3Expr **ppExpr, /* OUT: expression */ - int *pnConsumed /* OUT: Number of bytes consumed */ -){ - sqlite3_tokenizer *pTokenizer = pParse->pTokenizer; - sqlite3_tokenizer_module const *pModule = pTokenizer->pModule; - int rc; - sqlite3_tokenizer_cursor *pCursor; - Fts3Expr *pRet = 0; - int nConsumed = 0; - - rc = pModule->xOpen(pTokenizer, z, n, &pCursor); - if( rc==SQLITE_OK ){ - const char *zToken; - int nToken, iStart, iEnd, iPosition; - int nByte; /* total space to allocate */ - - pCursor->pTokenizer = pTokenizer; - rc = pModule->xNext(pCursor, &zToken, &nToken, &iStart, &iEnd, &iPosition); - - if( rc==SQLITE_OK ){ - nByte = sizeof(Fts3Expr) + sizeof(Fts3Phrase) + nToken; - pRet = (Fts3Expr *)sqlite3_malloc(nByte); - if( !pRet ){ - rc = SQLITE_NOMEM; - }else{ - memset(pRet, 0, nByte); - pRet->eType = FTSQUERY_PHRASE; - pRet->pPhrase = (Fts3Phrase *)&pRet[1]; - pRet->pPhrase->nToken = 1; - pRet->pPhrase->iColumn = iCol; - pRet->pPhrase->aToken[0].n = nToken; - pRet->pPhrase->aToken[0].z = (char *)&pRet->pPhrase[1]; - memcpy(pRet->pPhrase->aToken[0].z, zToken, nToken); - - if( iEndpPhrase->aToken[0].isPrefix = 1; - iEnd++; - } - if( !sqlite3_fts3_enable_parentheses && iStart>0 && z[iStart-1]=='-' ){ - pRet->pPhrase->isNot = 1; - } - } - nConsumed = iEnd; - } - - pModule->xClose(pCursor); - } - - *pnConsumed = nConsumed; - *ppExpr = pRet; - return rc; -} - - -/* -** Enlarge a memory allocation. If an out-of-memory allocation occurs, -** then free the old allocation. -*/ -void *fts3ReallocOrFree(void *pOrig, int nNew){ - void *pRet = sqlite3_realloc(pOrig, nNew); - if( !pRet ){ - sqlite3_free(pOrig); - } - return pRet; -} - -/* -** Buffer zInput, length nInput, contains the contents of a quoted string -** that appeared as part of an fts3 query expression. Neither quote character -** is included in the buffer. This function attempts to tokenize the entire -** input buffer and create an Fts3Expr structure of type FTSQUERY_PHRASE -** containing the results. -** -** If successful, SQLITE_OK is returned and *ppExpr set to point at the -** allocated Fts3Expr structure. Otherwise, either SQLITE_NOMEM (out of memory -** error) or SQLITE_ERROR (tokenization error) is returned and *ppExpr set -** to 0. -*/ -static int getNextString( - ParseContext *pParse, /* fts3 query parse context */ - const char *zInput, int nInput, /* Input string */ - Fts3Expr **ppExpr /* OUT: expression */ -){ - sqlite3_tokenizer *pTokenizer = pParse->pTokenizer; - sqlite3_tokenizer_module const *pModule = pTokenizer->pModule; - int rc; - Fts3Expr *p = 0; - sqlite3_tokenizer_cursor *pCursor = 0; - char *zTemp = 0; - int nTemp = 0; - - rc = pModule->xOpen(pTokenizer, zInput, nInput, &pCursor); - if( rc==SQLITE_OK ){ - int ii; - pCursor->pTokenizer = pTokenizer; - for(ii=0; rc==SQLITE_OK; ii++){ - const char *zToken; - int nToken, iBegin, iEnd, iPos; - rc = pModule->xNext(pCursor, &zToken, &nToken, &iBegin, &iEnd, &iPos); - if( rc==SQLITE_OK ){ - int nByte = sizeof(Fts3Expr) + sizeof(Fts3Phrase); - p = fts3ReallocOrFree(p, nByte+ii*sizeof(struct PhraseToken)); - zTemp = fts3ReallocOrFree(zTemp, nTemp + nToken); - if( !p || !zTemp ){ - goto no_mem; - } - if( ii==0 ){ - memset(p, 0, nByte); - p->pPhrase = (Fts3Phrase *)&p[1]; - p->eType = FTSQUERY_PHRASE; - p->pPhrase->iColumn = pParse->iDefaultCol; - } - p->pPhrase = (Fts3Phrase *)&p[1]; - p->pPhrase->nToken = ii+1; - p->pPhrase->aToken[ii].n = nToken; - memcpy(&zTemp[nTemp], zToken, nToken); - nTemp += nToken; - if( iEndpPhrase->aToken[ii].isPrefix = 1; - }else{ - p->pPhrase->aToken[ii].isPrefix = 0; - } - } - } - - pModule->xClose(pCursor); - pCursor = 0; - } - - if( rc==SQLITE_DONE ){ - int jj; - char *zNew; - int nNew = 0; - int nByte = sizeof(Fts3Expr) + sizeof(Fts3Phrase); - nByte += (p->pPhrase->nToken-1) * sizeof(struct PhraseToken); - p = fts3ReallocOrFree(p, nByte + nTemp); - if( !p ){ - goto no_mem; - } - p->pPhrase = (Fts3Phrase *)&p[1]; - zNew = &(((char *)p)[nByte]); - memcpy(zNew, zTemp, nTemp); - for(jj=0; jjpPhrase->nToken; jj++){ - p->pPhrase->aToken[jj].z = &zNew[nNew]; - nNew += p->pPhrase->aToken[jj].n; - } - sqlite3_free(zTemp); - rc = SQLITE_OK; - } - - *ppExpr = p; - return rc; -no_mem: - - if( pCursor ){ - pModule->xClose(pCursor); - } - sqlite3_free(zTemp); - sqlite3_free(p); - *ppExpr = 0; - return SQLITE_NOMEM; -} - -/* -** Function getNextNode(), which is called by fts3ExprParse(), may itself -** call fts3ExprParse(). So this forward declaration is required. -*/ -static int fts3ExprParse(ParseContext *, const char *, int, Fts3Expr **, int *); - -/* -** The output variable *ppExpr is populated with an allocated Fts3Expr -** structure, or set to 0 if the end of the input buffer is reached. -** -** Returns an SQLite error code. SQLITE_OK if everything works, SQLITE_NOMEM -** if a malloc failure occurs, or SQLITE_ERROR if a parse error is encountered. -** If SQLITE_ERROR is returned, pContext is populated with an error message. -*/ -static int getNextNode( - ParseContext *pParse, /* fts3 query parse context */ - const char *z, int n, /* Input string */ - Fts3Expr **ppExpr, /* OUT: expression */ - int *pnConsumed /* OUT: Number of bytes consumed */ -){ - static const struct Fts3Keyword { - char z[4]; /* Keyword text */ - unsigned char n; /* Length of the keyword */ - unsigned char parenOnly; /* Only valid in paren mode */ - unsigned char eType; /* Keyword code */ - } aKeyword[] = { - { "OR" , 2, 0, FTSQUERY_OR }, - { "AND", 3, 1, FTSQUERY_AND }, - { "NOT", 3, 1, FTSQUERY_NOT }, - { "NEAR", 4, 0, FTSQUERY_NEAR } - }; - int ii; - int iCol; - int iColLen; - int rc; - Fts3Expr *pRet = 0; - - const char *zInput = z; - int nInput = n; - - /* Skip over any whitespace before checking for a keyword, an open or - ** close bracket, or a quoted string. - */ - while( nInput>0 && fts3isspace(*zInput) ){ - nInput--; - zInput++; - } - if( nInput==0 ){ - return SQLITE_DONE; - } - - /* See if we are dealing with a keyword. */ - for(ii=0; ii<(int)(sizeof(aKeyword)/sizeof(struct Fts3Keyword)); ii++){ - const struct Fts3Keyword *pKey = &aKeyword[ii]; - - if( (pKey->parenOnly & ~sqlite3_fts3_enable_parentheses)!=0 ){ - continue; - } - - if( nInput>=pKey->n && 0==memcmp(zInput, pKey->z, pKey->n) ){ - int nNear = SQLITE_FTS3_DEFAULT_NEAR_PARAM; - int nKey = pKey->n; - char cNext; - - /* If this is a "NEAR" keyword, check for an explicit nearness. */ - if( pKey->eType==FTSQUERY_NEAR ){ - assert( nKey==4 ); - if( zInput[4]=='/' && zInput[5]>='0' && zInput[5]<='9' ){ - nNear = 0; - for(nKey=5; zInput[nKey]>='0' && zInput[nKey]<='9'; nKey++){ - nNear = nNear * 10 + (zInput[nKey] - '0'); - } - } - } - - /* At this point this is probably a keyword. But for that to be true, - ** the next byte must contain either whitespace, an open or close - ** parenthesis, a quote character, or EOF. - */ - cNext = zInput[nKey]; - if( fts3isspace(cNext) - || cNext=='"' || cNext=='(' || cNext==')' || cNext==0 - ){ - pRet = (Fts3Expr *)sqlite3_malloc(sizeof(Fts3Expr)); - memset(pRet, 0, sizeof(Fts3Expr)); - pRet->eType = pKey->eType; - pRet->nNear = nNear; - *ppExpr = pRet; - *pnConsumed = (zInput - z) + nKey; - return SQLITE_OK; - } - - /* Turns out that wasn't a keyword after all. This happens if the - ** user has supplied a token such as "ORacle". Continue. - */ - } - } - - /* Check for an open bracket. */ - if( sqlite3_fts3_enable_parentheses ){ - if( *zInput=='(' ){ - int nConsumed; - int rc; - pParse->nNest++; - rc = fts3ExprParse(pParse, &zInput[1], nInput-1, ppExpr, &nConsumed); - if( rc==SQLITE_OK && !*ppExpr ){ - rc = SQLITE_DONE; - } - *pnConsumed = (zInput - z) + 1 + nConsumed; - return rc; - } - - /* Check for a close bracket. */ - if( *zInput==')' ){ - pParse->nNest--; - *pnConsumed = (zInput - z) + 1; - return SQLITE_DONE; - } - } - - /* See if we are dealing with a quoted phrase. If this is the case, then - ** search for the closing quote and pass the whole string to getNextString() - ** for processing. This is easy to do, as fts3 has no syntax for escaping - ** a quote character embedded in a string. - */ - if( *zInput=='"' ){ - for(ii=1; iiiDefaultCol; - iColLen = 0; - for(ii=0; iinCol; ii++){ - const char *zStr = pParse->azCol[ii]; - int nStr = strlen(zStr); - if( nInput>nStr && zInput[nStr]==':' && memcmp(zStr, zInput, nStr)==0 ){ - iCol = ii; - iColLen = ((zInput - z) + nStr + 1); - break; - } - } - rc = getNextToken(pParse, iCol, &z[iColLen], n-iColLen, ppExpr, pnConsumed); - *pnConsumed += iColLen; - return rc; -} - -/* -** The argument is an Fts3Expr structure for a binary operator (any type -** except an FTSQUERY_PHRASE). Return an integer value representing the -** precedence of the operator. Lower values have a higher precedence (i.e. -** group more tightly). For example, in the C language, the == operator -** groups more tightly than ||, and would therefore have a higher precedence. -** -** When using the new fts3 query syntax (when SQLITE_ENABLE_FTS3_PARENTHESIS -** is defined), the order of the operators in precedence from highest to -** lowest is: -** -** NEAR -** NOT -** AND (including implicit ANDs) -** OR -** -** Note that when using the old query syntax, the OR operator has a higher -** precedence than the AND operator. -*/ -static int opPrecedence(Fts3Expr *p){ - assert( p->eType!=FTSQUERY_PHRASE ); - if( sqlite3_fts3_enable_parentheses ){ - return p->eType; - }else if( p->eType==FTSQUERY_NEAR ){ - return 1; - }else if( p->eType==FTSQUERY_OR ){ - return 2; - } - assert( p->eType==FTSQUERY_AND ); - return 3; -} - -/* -** Argument ppHead contains a pointer to the current head of a query -** expression tree being parsed. pPrev is the expression node most recently -** inserted into the tree. This function adds pNew, which is always a binary -** operator node, into the expression tree based on the relative precedence -** of pNew and the existing nodes of the tree. This may result in the head -** of the tree changing, in which case *ppHead is set to the new root node. -*/ -static void insertBinaryOperator( - Fts3Expr **ppHead, /* Pointer to the root node of a tree */ - Fts3Expr *pPrev, /* Node most recently inserted into the tree */ - Fts3Expr *pNew /* New binary node to insert into expression tree */ -){ - Fts3Expr *pSplit = pPrev; - while( pSplit->pParent && opPrecedence(pSplit->pParent)<=opPrecedence(pNew) ){ - pSplit = pSplit->pParent; - } - - if( pSplit->pParent ){ - assert( pSplit->pParent->pRight==pSplit ); - pSplit->pParent->pRight = pNew; - pNew->pParent = pSplit->pParent; - }else{ - *ppHead = pNew; - } - pNew->pLeft = pSplit; - pSplit->pParent = pNew; -} - -/* -** Parse the fts3 query expression found in buffer z, length n. This function -** returns either when the end of the buffer is reached or an unmatched -** closing bracket - ')' - is encountered. -** -** If successful, SQLITE_OK is returned, *ppExpr is set to point to the -** parsed form of the expression and *pnConsumed is set to the number of -** bytes read from buffer z. Otherwise, *ppExpr is set to 0 and SQLITE_NOMEM -** (out of memory error) or SQLITE_ERROR (parse error) is returned. -*/ -static int fts3ExprParse( - ParseContext *pParse, /* fts3 query parse context */ - const char *z, int n, /* Text of MATCH query */ - Fts3Expr **ppExpr, /* OUT: Parsed query structure */ - int *pnConsumed /* OUT: Number of bytes consumed */ -){ - Fts3Expr *pRet = 0; - Fts3Expr *pPrev = 0; - Fts3Expr *pNotBranch = 0; /* Only used in legacy parse mode */ - int nIn = n; - const char *zIn = z; - int rc = SQLITE_OK; - int isRequirePhrase = 1; - - while( rc==SQLITE_OK ){ - Fts3Expr *p = 0; - int nByte = 0; - rc = getNextNode(pParse, zIn, nIn, &p, &nByte); - if( rc==SQLITE_OK ){ - int isPhrase; - - if( !sqlite3_fts3_enable_parentheses - && p->eType==FTSQUERY_PHRASE && p->pPhrase->isNot - ){ - /* Create an implicit NOT operator. */ - Fts3Expr *pNot = sqlite3_malloc(sizeof(Fts3Expr)); - if( !pNot ){ - sqlite3Fts3ExprFree(p); - rc = SQLITE_NOMEM; - goto exprparse_out; - } - memset(pNot, 0, sizeof(Fts3Expr)); - pNot->eType = FTSQUERY_NOT; - pNot->pRight = p; - if( pNotBranch ){ - pNotBranch->pLeft = p; - pNot->pRight = pNotBranch; - } - pNotBranch = pNot; - }else{ - int eType = p->eType; - assert( eType!=FTSQUERY_PHRASE || !p->pPhrase->isNot ); - isPhrase = (eType==FTSQUERY_PHRASE || p->pLeft); - - /* The isRequirePhrase variable is set to true if a phrase or - ** an expression contained in parenthesis is required. If a - ** binary operator (AND, OR, NOT or NEAR) is encounted when - ** isRequirePhrase is set, this is a syntax error. - */ - if( !isPhrase && isRequirePhrase ){ - sqlite3Fts3ExprFree(p); - rc = SQLITE_ERROR; - goto exprparse_out; - } - - if( isPhrase && !isRequirePhrase ){ - /* Insert an implicit AND operator. */ - Fts3Expr *pAnd; - assert( pRet && pPrev ); - pAnd = sqlite3_malloc(sizeof(Fts3Expr)); - if( !pAnd ){ - sqlite3Fts3ExprFree(p); - rc = SQLITE_NOMEM; - goto exprparse_out; - } - memset(pAnd, 0, sizeof(Fts3Expr)); - pAnd->eType = FTSQUERY_AND; - insertBinaryOperator(&pRet, pPrev, pAnd); - pPrev = pAnd; - } - - /* This test catches attempts to make either operand of a NEAR - ** operator something other than a phrase. For example, either of - ** the following: - ** - ** (bracketed expression) NEAR phrase - ** phrase NEAR (bracketed expression) - ** - ** Return an error in either case. - */ - if( pPrev && ( - (eType==FTSQUERY_NEAR && !isPhrase && pPrev->eType!=FTSQUERY_PHRASE) - || (eType!=FTSQUERY_PHRASE && isPhrase && pPrev->eType==FTSQUERY_NEAR) - )){ - sqlite3Fts3ExprFree(p); - rc = SQLITE_ERROR; - goto exprparse_out; - } - - if( isPhrase ){ - if( pRet ){ - assert( pPrev && pPrev->pLeft && pPrev->pRight==0 ); - pPrev->pRight = p; - p->pParent = pPrev; - }else{ - pRet = p; - } - }else{ - insertBinaryOperator(&pRet, pPrev, p); - } - isRequirePhrase = !isPhrase; - } - assert( nByte>0 ); - } - assert( rc!=SQLITE_OK || (nByte>0 && nByte<=nIn) ); - nIn -= nByte; - zIn += nByte; - pPrev = p; - } - - if( rc==SQLITE_DONE && pRet && isRequirePhrase ){ - rc = SQLITE_ERROR; - } - - if( rc==SQLITE_DONE ){ - rc = SQLITE_OK; - if( !sqlite3_fts3_enable_parentheses && pNotBranch ){ - if( !pRet ){ - rc = SQLITE_ERROR; - }else{ - pNotBranch->pLeft = pRet; - pRet = pNotBranch; - } - } - } - *pnConsumed = n - nIn; - -exprparse_out: - if( rc!=SQLITE_OK ){ - sqlite3Fts3ExprFree(pRet); - sqlite3Fts3ExprFree(pNotBranch); - pRet = 0; - } - *ppExpr = pRet; - return rc; -} - -/* -** Parameters z and n contain a pointer to and length of a buffer containing -** an fts3 query expression, respectively. This function attempts to parse the -** query expression and create a tree of Fts3Expr structures representing the -** parsed expression. If successful, *ppExpr is set to point to the head -** of the parsed expression tree and SQLITE_OK is returned. If an error -** occurs, either SQLITE_NOMEM (out-of-memory error) or SQLITE_ERROR (parse -** error) is returned and *ppExpr is set to 0. -** -** If parameter n is a negative number, then z is assumed to point to a -** nul-terminated string and the length is determined using strlen(). -** -** The first parameter, pTokenizer, is passed the fts3 tokenizer module to -** use to normalize query tokens while parsing the expression. The azCol[] -** array, which is assumed to contain nCol entries, should contain the names -** of each column in the target fts3 table, in order from left to right. -** Column names must be nul-terminated strings. -** -** The iDefaultCol parameter should be passed the index of the table column -** that appears on the left-hand-side of the MATCH operator (the default -** column to match against for tokens for which a column name is not explicitly -** specified as part of the query string), or -1 if tokens may by default -** match any table column. -*/ -int sqlite3Fts3ExprParse( - sqlite3_tokenizer *pTokenizer, /* Tokenizer module */ - char **azCol, /* Array of column names for fts3 table */ - int nCol, /* Number of entries in azCol[] */ - int iDefaultCol, /* Default column to query */ - const char *z, int n, /* Text of MATCH query */ - Fts3Expr **ppExpr /* OUT: Parsed query structure */ -){ - int nParsed; - int rc; - ParseContext sParse; - sParse.pTokenizer = pTokenizer; - sParse.azCol = (const char **)azCol; - sParse.nCol = nCol; - sParse.iDefaultCol = iDefaultCol; - sParse.nNest = 0; - if( z==0 ){ - *ppExpr = 0; - return SQLITE_OK; - } - if( n<0 ){ - n = strlen(z); - } - rc = fts3ExprParse(&sParse, z, n, ppExpr, &nParsed); - - /* Check for mismatched parenthesis */ - if( rc==SQLITE_OK && sParse.nNest ){ - rc = SQLITE_ERROR; - sqlite3Fts3ExprFree(*ppExpr); - *ppExpr = 0; - } - - return rc; -} - -/* -** Free a parsed fts3 query expression allocated by sqlite3Fts3ExprParse(). -*/ -void sqlite3Fts3ExprFree(Fts3Expr *p){ - if( p ){ - sqlite3Fts3ExprFree(p->pLeft); - sqlite3Fts3ExprFree(p->pRight); - sqlite3_free(p); - } -} - -/**************************************************************************** -***************************************************************************** -** Everything after this point is just test code. -*/ - -#ifdef SQLITE_TEST - -#include - -/* -** Function to query the hash-table of tokenizers (see README.tokenizers). -*/ -static int queryTestTokenizer( - sqlite3 *db, - const char *zName, - const sqlite3_tokenizer_module **pp -){ - int rc; - sqlite3_stmt *pStmt; - const char zSql[] = "SELECT fts3_tokenizer(?)"; - - *pp = 0; - rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, 0); - if( rc!=SQLITE_OK ){ - return rc; - } - - sqlite3_bind_text(pStmt, 1, zName, -1, SQLITE_STATIC); - if( SQLITE_ROW==sqlite3_step(pStmt) ){ - if( sqlite3_column_type(pStmt, 0)==SQLITE_BLOB ){ - memcpy(pp, sqlite3_column_blob(pStmt, 0), sizeof(*pp)); - } - } - - return sqlite3_finalize(pStmt); -} - -/* -** This function is part of the test interface for the query parser. It -** writes a text representation of the query expression pExpr into the -** buffer pointed to by argument zBuf. It is assumed that zBuf is large -** enough to store the required text representation. -*/ -static void exprToString(Fts3Expr *pExpr, char *zBuf){ - switch( pExpr->eType ){ - case FTSQUERY_PHRASE: { - Fts3Phrase *pPhrase = pExpr->pPhrase; - int i; - zBuf += sprintf(zBuf, "PHRASE %d %d", pPhrase->iColumn, pPhrase->isNot); - for(i=0; inToken; i++){ - zBuf += sprintf(zBuf," %.*s",pPhrase->aToken[i].n,pPhrase->aToken[i].z); - zBuf += sprintf(zBuf,"%s", (pPhrase->aToken[i].isPrefix?"+":"")); - } - return; - } - - case FTSQUERY_NEAR: - zBuf += sprintf(zBuf, "NEAR/%d ", pExpr->nNear); - break; - case FTSQUERY_NOT: - zBuf += sprintf(zBuf, "NOT "); - break; - case FTSQUERY_AND: - zBuf += sprintf(zBuf, "AND "); - break; - case FTSQUERY_OR: - zBuf += sprintf(zBuf, "OR "); - break; - } - - zBuf += sprintf(zBuf, "{"); - exprToString(pExpr->pLeft, zBuf); - zBuf += strlen(zBuf); - zBuf += sprintf(zBuf, "} "); - - zBuf += sprintf(zBuf, "{"); - exprToString(pExpr->pRight, zBuf); - zBuf += strlen(zBuf); - zBuf += sprintf(zBuf, "}"); -} - -/* -** This is the implementation of a scalar SQL function used to test the -** expression parser. It should be called as follows: -** -** fts3_exprtest(, , , ...); -** -** The first argument, , is the name of the fts3 tokenizer used -** to parse the query expression (see README.tokenizers). The second argument -** is the query expression to parse. Each subsequent argument is the name -** of a column of the fts3 table that the query expression may refer to. -** For example: -** -** SELECT fts3_exprtest('simple', 'Bill col2:Bloggs', 'col1', 'col2'); -*/ -static void fts3ExprTest( - sqlite3_context *context, - int argc, - sqlite3_value **argv -){ - sqlite3_tokenizer_module const *pModule = 0; - sqlite3_tokenizer *pTokenizer = 0; - int rc; - char **azCol = 0; - const char *zExpr; - int nExpr; - int nCol; - int ii; - Fts3Expr *pExpr; - sqlite3 *db = sqlite3_context_db_handle(context); - - if( argc<3 ){ - sqlite3_result_error(context, - "Usage: fts3_exprtest(tokenizer, expr, col1, ...", -1 - ); - return; - } - - rc = queryTestTokenizer(db, - (const char *)sqlite3_value_text(argv[0]), &pModule); - if( rc==SQLITE_NOMEM ){ - sqlite3_result_error_nomem(context); - goto exprtest_out; - }else if( !pModule ){ - sqlite3_result_error(context, "No such tokenizer module", -1); - goto exprtest_out; - } - - rc = pModule->xCreate(0, 0, &pTokenizer); - assert( rc==SQLITE_NOMEM || rc==SQLITE_OK ); - if( rc==SQLITE_NOMEM ){ - sqlite3_result_error_nomem(context); - goto exprtest_out; - } - pTokenizer->pModule = pModule; - - zExpr = (const char *)sqlite3_value_text(argv[1]); - nExpr = sqlite3_value_bytes(argv[1]); - nCol = argc-2; - azCol = (char **)sqlite3_malloc(nCol*sizeof(char *)); - if( !azCol ){ - sqlite3_result_error_nomem(context); - goto exprtest_out; - } - for(ii=0; iixDestroy(pTokenizer); - } - sqlite3_free(azCol); -} - -/* -** Register the query expression parser test function fts3_exprtest() -** with database connection db. -*/ -void sqlite3Fts3ExprInitTestInterface(sqlite3* db){ - sqlite3_create_function( - db, "fts3_exprtest", -1, SQLITE_UTF8, 0, fts3ExprTest, 0, 0 - ); -} - -#endif -#endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_FTS3) */ DELETED ext/fts3/fts3_expr.h Index: ext/fts3/fts3_expr.h ================================================================== --- ext/fts3/fts3_expr.h +++ /dev/null @@ -1,96 +0,0 @@ -/* -** 2008 Nov 28 -** -** 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. -** -****************************************************************************** -** -*/ - -#include "fts3_tokenizer.h" -#include "sqlite3.h" - -/* -** The following describes the syntax supported by the fts3 MATCH -** operator in a similar format to that used by the lemon parser -** generator. This module does not use actually lemon, it uses a -** custom parser. -** -** query ::= andexpr (OR andexpr)*. -** -** andexpr ::= notexpr (AND? notexpr)*. -** -** notexpr ::= nearexpr (NOT nearexpr|-TOKEN)*. -** notexpr ::= LP query RP. -** -** nearexpr ::= phrase (NEAR distance_opt nearexpr)*. -** -** distance_opt ::= . -** distance_opt ::= / INTEGER. -** -** phrase ::= TOKEN. -** phrase ::= COLUMN:TOKEN. -** phrase ::= "TOKEN TOKEN TOKEN...". -*/ - -typedef struct Fts3Expr Fts3Expr; -typedef struct Fts3Phrase Fts3Phrase; - -/* -** A "phrase" is a sequence of one or more tokens that must match in -** sequence. A single token is the base case and the most common case. -** For a sequence of tokens contained in "...", nToken will be the number -** of tokens in the string. -*/ -struct Fts3Phrase { - int nToken; /* Number of tokens in the phrase */ - int iColumn; /* Index of column this phrase must match */ - int isNot; /* Phrase prefixed by unary not (-) operator */ - struct PhraseToken { - char *z; /* Text of the token */ - int n; /* Number of bytes in buffer pointed to by z */ - int isPrefix; /* True if token ends in with a "*" character */ - } aToken[1]; /* One entry for each token in the phrase */ -}; - -/* -** A tree of these objects forms the RHS of a MATCH operator. -*/ -struct Fts3Expr { - int eType; /* One of the FTSQUERY_XXX values defined below */ - int nNear; /* Valid if eType==FTSQUERY_NEAR */ - Fts3Expr *pParent; /* pParent->pLeft==this or pParent->pRight==this */ - Fts3Expr *pLeft; /* Left operand */ - Fts3Expr *pRight; /* Right operand */ - Fts3Phrase *pPhrase; /* Valid if eType==FTSQUERY_PHRASE */ -}; - -int sqlite3Fts3ExprParse(sqlite3_tokenizer *, char **, int, int, - const char *, int, Fts3Expr **); -void sqlite3Fts3ExprFree(Fts3Expr *); - -/* -** Candidate values for Fts3Query.eType. Note that the order of the first -** four values is in order of precedence when parsing expressions. For -** example, the following: -** -** "a OR b AND c NOT d NEAR e" -** -** is equivalent to: -** -** "a OR (b AND (c NOT (d NEAR e)))" -*/ -#define FTSQUERY_NEAR 1 -#define FTSQUERY_NOT 2 -#define FTSQUERY_AND 3 -#define FTSQUERY_OR 4 -#define FTSQUERY_PHRASE 5 - -#ifdef SQLITE_TEST -void sqlite3Fts3ExprInitTestInterface(sqlite3 *db); -#endif Index: ext/fts3/fts3_hash.c ================================================================== --- ext/fts3/fts3_hash.c +++ ext/fts3/fts3_hash.c @@ -336,17 +336,10 @@ elem->data = data; } return old_data; } if( data==0 ) return 0; - if( pH->htsize==0 ){ - fts3Rehash(pH,8); - if( pH->htsize==0 ){ - pH->count = 0; - return data; - } - } new_elem = (fts3HashElem*)fts3HashMalloc( sizeof(fts3HashElem) ); if( new_elem==0 ) return data; if( pH->copyKey && pKey!=0 ){ new_elem->pKey = fts3HashMalloc( nKey ); if( new_elem->pKey==0 ){ @@ -357,10 +350,18 @@ }else{ new_elem->pKey = (void*)pKey; } new_elem->nKey = nKey; pH->count++; + if( pH->htsize==0 ){ + fts3Rehash(pH,8); + if( pH->htsize==0 ){ + pH->count = 0; + fts3HashFree(new_elem); + return data; + } + } if( pH->count > pH->htsize ){ fts3Rehash(pH,pH->htsize*2); } assert( pH->htsize>0 ); assert( (pH->htsize & (pH->htsize-1))==0 ); Index: ext/fts3/fts3_tokenizer.h ================================================================== --- ext/fts3/fts3_tokenizer.h +++ ext/fts3/fts3_tokenizer.h @@ -111,14 +111,11 @@ ** *ppToken should be set to point at a buffer containing the ** normalized version of the token (i.e. after any case-folding and/or ** stemming has been performed). *pnBytes should be set to the length ** of this buffer in bytes. The input text that generated the token is ** identified by the byte offsets returned in *piStartOffset and - ** *piEndOffset. *piStartOffset should be set to the index of the first - ** byte of the token in the input buffer. *piEndOffset should be set - ** to the index of the first byte just past the end of the token in - ** the input buffer. + ** *piEndOffset. ** ** The buffer *ppToken is set to point at is managed by the tokenizer ** implementation. It is only required to be valid until the next call ** to xNext() or xClose(). */ DELETED ext/icu/sqliteicu.h Index: ext/icu/sqliteicu.h ================================================================== --- ext/icu/sqliteicu.h +++ /dev/null @@ -1,27 +0,0 @@ -/* -** 2008 May 26 -** -** The author disclaims copyright to this source code. In place of -** a legal notice, here is a blessing: -** -** May you do good and not evil. -** May you find forgiveness for yourself and forgive others. -** May you share freely, never taking more than you give. -** -****************************************************************************** -** -** This header file is used by programs that want to link against the -** ICU extension. All it does is declare the sqlite3IcuInit() interface. -*/ -#include "sqlite3.h" - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -int sqlite3IcuInit(sqlite3 *db); - -#ifdef __cplusplus -} /* extern "C" */ -#endif /* __cplusplus */ - Index: ext/rtree/rtree.c ================================================================== --- ext/rtree/rtree.c +++ ext/rtree/rtree.c @@ -10,11 +10,11 @@ ** ************************************************************************* ** This file contains code for implementations of the r-tree and r*-tree ** algorithms packaged as an SQLite virtual table module. ** -** $Id: rtree.c,v 1.12 2008/12/22 15:04:32 danielk1977 Exp $ +** $Id: rtree.c,v 1.9 2008/09/08 11:07:03 danielk1977 Exp $ */ #if !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_RTREE) /* @@ -224,16 +224,12 @@ struct RtreeCell { i64 iRowid; RtreeCoord aCoord[RTREE_MAX_DIMENSIONS*2]; }; -#ifndef MAX -# define MAX(x,y) ((x) < (y) ? (y) : (x)) -#endif -#ifndef MIN -# define MIN(x,y) ((x) > (y) ? (y) : (x)) -#endif +#define MAX(x,y) ((x) < (y) ? (y) : (x)) +#define MIN(x,y) ((x) > (y) ? (y) : (x)) /* ** Functions to deserialize a 16 bit integer, 32 bit real number and ** 64 bit integer. The deserialized value is returned. */ @@ -398,12 +394,11 @@ /* Check if the requested node is already in the hash table. If so, ** increase its reference count and return it. */ if( (pNode = nodeHashLookup(pRtree, iNode)) ){ assert( !pParent || !pNode->pParent || pNode->pParent==pParent ); - if( pParent && !pNode->pParent ){ - nodeReference(pParent); + if( pParent ){ pNode->pParent = pParent; } pNode->nRef++; *ppNode = pNode; return SQLITE_OK; @@ -603,11 +598,11 @@ /* Forward declaration for the function that does the work of ** the virtual table module xCreate() and xConnect() methods. */ static int rtreeInit( - sqlite3 *, void *, int, const char *const*, sqlite3_vtab **, char **, int + sqlite3 *, void *, int, const char *const*, sqlite3_vtab **, char **, int, int ); /* ** Rtree virtual table module xCreate method. */ @@ -616,11 +611,11 @@ void *pAux, int argc, const char *const*argv, sqlite3_vtab **ppVtab, char **pzErr ){ - return rtreeInit(db, pAux, argc, argv, ppVtab, pzErr, 1); + return rtreeInit(db, pAux, argc, argv, ppVtab, pzErr, 1, (int)pAux); } /* ** Rtree virtual table module xConnect method. */ @@ -629,11 +624,11 @@ void *pAux, int argc, const char *const*argv, sqlite3_vtab **ppVtab, char **pzErr ){ - return rtreeInit(db, pAux, argc, argv, ppVtab, pzErr, 0); + return rtreeInit(db, pAux, argc, argv, ppVtab, pzErr, 0, (int)pAux); } /* ** Increment the r-tree reference count. */ @@ -2654,22 +2649,22 @@ ** argv[2] -> table name ** argv[...] -> column names... */ static int rtreeInit( sqlite3 *db, /* Database connection */ - void *pAux, /* One of the RTREE_COORD_* constants */ + void *pAux, /* Pointer to head of rtree list */ int argc, const char *const*argv, /* Parameters to CREATE TABLE statement */ sqlite3_vtab **ppVtab, /* OUT: New virtual table */ char **pzErr, /* OUT: Error message, if any */ - int isCreate /* True for xCreate, false for xConnect */ + int isCreate, /* True for xCreate, false for xConnect */ + int eCoordType /* One of the RTREE_COORD_* constants */ ){ int rc = SQLITE_OK; int iPageSize = 0; Rtree *pRtree; int nDb; /* Length of string argv[1] */ int nName; /* Length of string argv[2] */ - int eCoordType = (int)pAux; const char *aErrMsg[] = { 0, /* 0 */ "Wrong number of columns for an rtree table", /* 1 */ "Too few columns for an rtree table", /* 2 */ Index: ext/rtree/rtree1.test ================================================================== --- ext/rtree/rtree1.test +++ ext/rtree/rtree1.test @@ -9,11 +9,11 @@ # #*********************************************************************** # # The focus of this file is testing the r-tree extension. # -# $Id: rtree1.test,v 1.6 2008/12/22 15:04:32 danielk1977 Exp $ +# $Id: rtree1.test,v 1.5 2008/07/14 15:37:01 danielk1977 Exp $ # if {![info exists testdir]} { set testdir [file join [file dirname $argv0] .. .. test] } @@ -358,39 +358,7 @@ do_test rtree-8.1.5 { execsql { SELECT ii FROM t6 WHERE x1>5 } } {} do_test rtree-8.1.6 { execsql { SELECT ii FROM t6 WHERE x1<3 } } {} do_test rtree-8.1.7 { execsql { SELECT ii FROM t6 WHERE x1<4 } } {1} do_test rtree-8.1.8 { execsql { SELECT ii FROM t6 WHERE x1<5 } } {1 2} -#---------------------------------------------------------------------------- -# Test cases rtree-9.* -# -# Test that ticket #3549 is fixed. -do_test rtree-9.1 { - execsql { - CREATE TABLE foo (id INTEGER PRIMARY KEY); - CREATE VIRTUAL TABLE bar USING rtree (id, minX, maxX, minY, maxY); - INSERT INTO foo VALUES (null); - INSERT INTO foo SELECT null FROM foo; - INSERT INTO foo SELECT null FROM foo; - INSERT INTO foo SELECT null FROM foo; - INSERT INTO foo SELECT null FROM foo; - INSERT INTO foo SELECT null FROM foo; - INSERT INTO foo SELECT null FROM foo; - DELETE FROM foo WHERE id > 40; - INSERT INTO bar SELECT NULL, 0, 0, 0, 0 FROM foo; - } -} {} - -# This used to crash. -do_test rtree-9.2 { - execsql { - SELECT count(*) FROM bar b1, bar b2, foo s1 WHERE s1.id = b1.id; - } -} {1600} -do_test rtree-9.3 { - execsql { - SELECT count(*) FROM bar b1, bar b2, foo s1 - WHERE b1.minX <= b2.maxX AND s1.id = b1.id; - } -} {1600} finish_test Index: ltmain.sh ================================================================== --- ltmain.sh +++ ltmain.sh @@ -1,8 +1,8 @@ # Generated from ltmain.m4sh. -# ltmain.sh (GNU libtool) 2.2.6 +# ltmain.sh (GNU libtool) 2.2.4 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. @@ -63,21 +63,21 @@ # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) -# $progname: (GNU libtool) 2.2.6 +# $progname: (GNU libtool) 2.2.4 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . PROGRAM=ltmain.sh PACKAGE=libtool -VERSION=2.2.6 +VERSION=2.2.4 TIMESTAMP="" -package_revision=1.3012 +package_revision=1.2976 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: @@ -810,11 +810,11 @@ esac done case $host in - *cygwin* | *mingw* | *pw32* | *cegcc*) + *cygwin* | *mingw* | *pw32*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_duplicate_deps @@ -898,13 +898,12 @@ # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { - test -f "$1" && - $SED -e 4q "$1" 2>/dev/null \ - | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 + $SED -e 4q "$1" 2>/dev/null \ + | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without @@ -913,11 +912,11 @@ # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no - if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then + if test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; @@ -1281,11 +1280,11 @@ removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in - cygwin* | mingw* | pw32* | os2* | cegcc*) + cygwin* | mingw* | pw32* | os2*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported @@ -2052,11 +2051,11 @@ # Install the shared library and build the symlinks. func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in - cygwin* | mingw* | pw32* | cegcc*) + cygwin* | mingw* | pw32*) case $realname in *.dll.a) tstripme="" ;; esac @@ -2158,11 +2157,11 @@ ;; esac # Do a test to see if this is really a libtool program. case $host in - *cygwin* | *mingw*) + *cygwin*|*mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" @@ -2364,11 +2363,11 @@ export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in - *cygwin* | *mingw* | *cegcc* ) + *cygwin* | *mingw* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } @@ -2376,11 +2375,11 @@ $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in - *cygwin | *mingw* | *cegcc* ) + *cygwin | *mingw* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } @@ -2432,11 +2431,11 @@ const char *name; void *address; } lt_dlsymlist; " case $host in - *cygwin* | *mingw* | *cegcc* ) + *cygwin* | *mingw* ) $ECHO >> "$output_objdir/$my_dlsyms" "\ /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */" lt_dlsym_const= ;; @@ -2518,11 +2517,11 @@ func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in - *cygwin* | *mingw* | *cegcc* ) + *cygwin* | *mingw* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` @@ -2697,20 +2696,29 @@ func_extract_archives_result="$my_oldobjs" } -# func_emit_wrapper_part1 [arg=no] -# -# Emit the first part of a libtool wrapper script on stdout. -# For more information, see the description associated with -# func_emit_wrapper(), below. -func_emit_wrapper_part1 () -{ - func_emit_wrapper_part1_arg1=no - if test -n "$1" ; then - func_emit_wrapper_part1_arg1=$1 +# func_emit_wrapper arg +# +# emit a libtool wrapper script on stdout +# don't directly open a file because we may want to +# incorporate the script contents within a cygwin/mingw +# wrapper executable. Must ONLY be called from within +# func_mode_link because it depends on a number of variable +# set therein. +# +# arg is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR +# variable will take. If 'yes', then the emitted script +# will assume that the directory in which it is stored is +# the '.lib' directory. This is a cygwin/mingw-specific +# behavior. +func_emit_wrapper () +{ + func_emit_wrapper_arg1=no + if test -n "$1" ; then + func_emit_wrapper_arg1=$1 fi $ECHO "\ #! $SHELL @@ -2791,31 +2799,14 @@ fi file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done -" -} -# end: func_emit_wrapper_part1 - -# func_emit_wrapper_part2 [arg=no] -# -# Emit the second part of a libtool wrapper script on stdout. -# For more information, see the description associated with -# func_emit_wrapper(), below. -func_emit_wrapper_part2 () -{ - func_emit_wrapper_part2_arg1=no - if test -n "$1" ; then - func_emit_wrapper_part2_arg1=$1 - fi - - $ECHO "\ # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. - WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1 + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi @@ -2902,11 +2893,11 @@ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows - *-*-mingw | *-*-os2* | *-cegcc*) + *-*-mingw | *-*-os2*) $ECHO "\ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; @@ -2928,211 +2919,11 @@ exit 1 fi fi\ " } -# end: func_emit_wrapper_part2 - - -# func_emit_wrapper [arg=no] -# -# Emit a libtool wrapper script on stdout. -# Don't directly open a file because we may want to -# incorporate the script contents within a cygwin/mingw -# wrapper executable. Must ONLY be called from within -# func_mode_link because it depends on a number of variables -# set therein. -# -# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR -# variable will take. If 'yes', then the emitted script -# will assume that the directory in which it is stored is -# the $objdir directory. This is a cygwin/mingw-specific -# behavior. -func_emit_wrapper () -{ - func_emit_wrapper_arg1=no - if test -n "$1" ; then - func_emit_wrapper_arg1=$1 - fi - - # split this up so that func_emit_cwrapperexe_src - # can call each part independently. - func_emit_wrapper_part1 "${func_emit_wrapper_arg1}" - func_emit_wrapper_part2 "${func_emit_wrapper_arg1}" -} - - -# func_to_host_path arg -# -# Convert paths to host format when used with build tools. -# Intended for use with "native" mingw (where libtool itself -# is running under the msys shell), or in the following cross- -# build environments: -# $build $host -# mingw (msys) mingw [e.g. native] -# cygwin mingw -# *nix + wine mingw -# where wine is equipped with the `winepath' executable. -# In the native mingw case, the (msys) shell automatically -# converts paths for any non-msys applications it launches, -# but that facility isn't available from inside the cwrapper. -# Similar accommodations are necessary for $host mingw and -# $build cygwin. Calling this function does no harm for other -# $host/$build combinations not listed above. -# -# ARG is the path (on $build) that should be converted to -# the proper representation for $host. The result is stored -# in $func_to_host_path_result. -func_to_host_path () -{ - func_to_host_path_result="$1" - if test -n "$1" ; then - case $host in - *mingw* ) - lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - case $build in - *mingw* ) # actually, msys - # awkward: cmd appends spaces to result - lt_sed_strip_trailing_spaces="s/[ ]*\$//" - func_to_host_path_tmp1=`( cmd //c echo "$1" |\ - $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` - func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ - $SED -e "$lt_sed_naive_backslashify"` - ;; - *cygwin* ) - func_to_host_path_tmp1=`cygpath -w "$1"` - func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ - $SED -e "$lt_sed_naive_backslashify"` - ;; - * ) - # Unfortunately, winepath does not exit with a non-zero - # error code, so we are forced to check the contents of - # stdout. On the other hand, if the command is not - # found, the shell will set an exit code of 127 and print - # *an error message* to stdout. So we must check for both - # error code of zero AND non-empty stdout, which explains - # the odd construction: - func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` - if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then - func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ - $SED -e "$lt_sed_naive_backslashify"` - else - # Allow warning below. - func_to_host_path_result="" - fi - ;; - esac - if test -z "$func_to_host_path_result" ; then - func_error "Could not determine host path corresponding to" - func_error " '$1'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback: - func_to_host_path_result="$1" - fi - ;; - esac - fi -} -# end: func_to_host_path - -# func_to_host_pathlist arg -# -# Convert pathlists to host format when used with build tools. -# See func_to_host_path(), above. This function supports the -# following $build/$host combinations (but does no harm for -# combinations not listed here): -# $build $host -# mingw (msys) mingw [e.g. native] -# cygwin mingw -# *nix + wine mingw -# -# Path separators are also converted from $build format to -# $host format. If ARG begins or ends with a path separator -# character, it is preserved (but converted to $host format) -# on output. -# -# ARG is a pathlist (on $build) that should be converted to -# the proper representation on $host. The result is stored -# in $func_to_host_pathlist_result. -func_to_host_pathlist () -{ - func_to_host_pathlist_result="$1" - if test -n "$1" ; then - case $host in - *mingw* ) - lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' - # Remove leading and trailing path separator characters from - # ARG. msys behavior is inconsistent here, cygpath turns them - # into '.;' and ';.', and winepath ignores them completely. - func_to_host_pathlist_tmp2="$1" - # Once set for this call, this variable should not be - # reassigned. It is used in tha fallback case. - func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\ - $SED -e 's|^:*||' -e 's|:*$||'` - case $build in - *mingw* ) # Actually, msys. - # Awkward: cmd appends spaces to result. - lt_sed_strip_trailing_spaces="s/[ ]*\$//" - func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\ - $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` - func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ - $SED -e "$lt_sed_naive_backslashify"` - ;; - *cygwin* ) - func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"` - func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ - $SED -e "$lt_sed_naive_backslashify"` - ;; - * ) - # unfortunately, winepath doesn't convert pathlists - func_to_host_pathlist_result="" - func_to_host_pathlist_oldIFS=$IFS - IFS=: - for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do - IFS=$func_to_host_pathlist_oldIFS - if test -n "$func_to_host_pathlist_f" ; then - func_to_host_path "$func_to_host_pathlist_f" - if test -n "$func_to_host_path_result" ; then - if test -z "$func_to_host_pathlist_result" ; then - func_to_host_pathlist_result="$func_to_host_path_result" - else - func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result" - fi - fi - fi - IFS=: - done - IFS=$func_to_host_pathlist_oldIFS - ;; - esac - if test -z "$func_to_host_pathlist_result" ; then - func_error "Could not determine the host path(s) corresponding to" - func_error " '$1'" - func_error "Continuing, but uninstalled executables may not work." - # Fallback. This may break if $1 contains DOS-style drive - # specifications. The fix is not to complicate the expression - # below, but for the user to provide a working wine installation - # with winepath so that path translation in the cross-to-mingw - # case works properly. - lt_replace_pathsep_nix_to_dos="s|:|;|g" - func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ - $SED -e "$lt_replace_pathsep_nix_to_dos"` - fi - # Now, add the leading and trailing path separators back - case "$1" in - :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" - ;; - esac - case "$1" in - *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;" - ;; - esac - ;; - esac - fi -} -# end: func_to_host_pathlist +# end: func_emit_wrapper # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. @@ -3165,16 +2956,10 @@ #else # include # include # ifdef __CYGWIN__ # include -# define HAVE_SETENV -# ifdef __STRICT_ANSI__ -char *realpath (const char *, char *); -int putenv (char *); -int setenv (const char *, const char *, int); -# endif # endif #endif #include #include #include @@ -3277,109 +3062,33 @@ char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_fatal (const char *message, ...); -void lt_setenv (const char *name, const char *value); -char *lt_extend_str (const char *orig_value, const char *add, int to_end); -void lt_opt_process_env_set (const char *arg); -void lt_opt_process_env_prepend (const char *arg); -void lt_opt_process_env_append (const char *arg); -int lt_split_name_value (const char *arg, char** name, char** value); -void lt_update_exe_path (const char *name, const char *value); -void lt_update_lib_path (const char *name, const char *value); - -static const char *script_text_part1 = -EOF - - func_emit_wrapper_part1 yes | - $SED -e 's/\([\\"]\)/\\\1/g' \ - -e 's/^/ "/' -e 's/$/\\n"/' - echo ";" - cat </dev/null || echo $SHELL` + case $lt_newargv0 in + *.exe | *.EXE) ;; + *) lt_newargv0=$lt_newargv0.exe ;; + esac + ;; + * ) lt_newargv0=$SHELL ;; + esac + fi + + cat <"))); - for (i = 0; i < newargc; i++) - { - LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : ""))); + newargz[i + 1] = xstrdup (argv[i]); + newargz[argc + 1] = NULL; + + for (i = 0; i < argc + 1; i++) + { + LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, newargz[i])); } EOF case $host_os in mingw*) - cat <<"EOF" + cat <"), - (value ? value : ""))); - { -#ifdef HAVE_SETENV - /* always make a copy, for consistency with !HAVE_SETENV */ - char *str = xstrdup (value); - setenv (name, str, 1); -#else - int len = strlen (name) + 1 + strlen (value) + 1; - char *str = XMALLOC (char, len); - sprintf (str, "%s=%s", name, value); - if (putenv (str) != EXIT_SUCCESS) - { - XFREE (str); - } -#endif - } -} - -char * -lt_extend_str (const char *orig_value, const char *add, int to_end) -{ - char *new_value; - if (orig_value && *orig_value) - { - int orig_value_len = strlen (orig_value); - int add_len = strlen (add); - new_value = XMALLOC (char, add_len + orig_value_len + 1); - if (to_end) - { - strcpy (new_value, orig_value); - strcpy (new_value + orig_value_len, add); - } - else - { - strcpy (new_value, add); - strcpy (new_value + add_len, orig_value); - } - } - else - { - new_value = xstrdup (add); - } - return new_value; -} - -int -lt_split_name_value (const char *arg, char** name, char** value) -{ - const char *p; - int len; - if (!arg || !*arg) - return 1; - - p = strchr (arg, (int)'='); - - if (!p) - return 1; - - *value = xstrdup (++p); - - len = strlen (arg) - strlen (*value); - *name = XMALLOC (char, len); - strncpy (*name, arg, len-1); - (*name)[len - 1] = '\0'; - - return 0; -} - -void -lt_opt_process_env_set (const char *arg) -{ - char *name = NULL; - char *value = NULL; - - if (lt_split_name_value (arg, &name, &value) != 0) - { - XFREE (name); - XFREE (value); - lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg); - } - - lt_setenv (name, value); - XFREE (name); - XFREE (value); -} - -void -lt_opt_process_env_prepend (const char *arg) -{ - char *name = NULL; - char *value = NULL; - char *new_value = NULL; - - if (lt_split_name_value (arg, &name, &value) != 0) - { - XFREE (name); - XFREE (value); - lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg); - } - - new_value = lt_extend_str (getenv (name), value, 0); - lt_setenv (name, new_value); - XFREE (new_value); - XFREE (name); - XFREE (value); -} - -void -lt_opt_process_env_append (const char *arg) -{ - char *name = NULL; - char *value = NULL; - char *new_value = NULL; - - if (lt_split_name_value (arg, &name, &value) != 0) - { - XFREE (name); - XFREE (value); - lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg); - } - - new_value = lt_extend_str (getenv (name), value, 1); - lt_setenv (name, new_value); - XFREE (new_value); - XFREE (name); - XFREE (value); -} - -void -lt_update_exe_path (const char *name, const char *value) -{ - LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n", - (name ? name : ""), - (value ? value : ""))); - - if (name && *name && value && *value) - { - char *new_value = lt_extend_str (getenv (name), value, 0); - /* some systems can't cope with a ':'-terminated path #' */ - int len = strlen (new_value); - while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) - { - new_value[len-1] = '\0'; - } - lt_setenv (name, new_value); - XFREE (new_value); - } -} - -void -lt_update_lib_path (const char *name, const char *value) -{ - LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n", - (name ? name : ""), - (value ? value : ""))); - - if (name && *name && value && *value) - { - char *new_value = lt_extend_str (getenv (name), value, 0); - lt_setenv (name, new_value); - XFREE (new_value); - } -} - - EOF } # end: func_emit_cwrapperexe_src # func_mode_link arg... func_mode_link () { $opt_debug case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no @@ -4482,17 +3964,10 @@ ;; -L*) func_stripname '-L' '' "$arg" dir=$func_stripname_result - if test -z "$dir"; then - if test "$#" -gt 0; then - func_fatal_error "require no space between \`-L' and \`$1'" - else - func_fatal_error "need path for \`-L' option" - fi - fi # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` @@ -4507,20 +3982,18 @@ deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; - ::) dllsearchpath=$dir;; *) dllsearchpath="$dllsearchpath:$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; - ::) dllsearchpath=$testbindir;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac continue @@ -4527,11 +4000,11 @@ ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*) + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) @@ -4604,11 +4077,11 @@ continue ;; -no-install) case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no @@ -5561,11 +5034,11 @@ use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in - *cygwin* | *mingw* | *cegcc*) + *cygwin* | *mingw*) # No point in relinking DLLs because paths are not encoded notinst_deplibs="$notinst_deplibs $lib" need_relink=no ;; *) @@ -5631,11 +5104,11 @@ if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in - *cygwin* | mingw* | *cegcc*) + *cygwin* | mingw*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac @@ -6410,11 +5883,11 @@ # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in - *.$objext | *.gcno) + *.$objext) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then @@ -6481,11 +5954,11 @@ done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*) + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs System.ltframework" @@ -6980,11 +6453,11 @@ delfiles="$delfiles $export_symbols" fi orig_export_symbols= case $host_os in - cygwin* | mingw* | cegcc*) + cygwin* | mingw*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag @@ -7605,20 +7078,18 @@ *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in - *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) + *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; - ::) dllsearchpath=$libdir;; *) dllsearchpath="$dllsearchpath:$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; - ::) dllsearchpath=$testbindir;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac done @@ -7684,14 +7155,10 @@ *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; - *cegcc) - # Disable wrappers for cegcc, we are cross compiling anyway. - wrappers_required=no - ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; @@ -7840,14 +7307,15 @@ $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource - # The wrapper executable is built using the $host compiler, - # because it contains $host paths and files. If cross- - # compiling, it, like the target executable, must be - # executed on the $host or under an emulation environment. + # we should really use a build-platform specific compiler + # here, but OTOH, the wrappers (shell script and this C one) + # are only useful if you want to execute the "real" binary. + # Since the "real" binary is built for $host, then this + # wrapper might as well be built for $host, too. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } @@ -8172,11 +7640,11 @@ fi $RM $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in - *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; + *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac # Do not add duplicates if test "$installed" = yes && test "$D"; then install_libdir=`echo "$install_libdir" |sed -e "s:$D:/:g" -e 's:/\+:/:g'` fi Index: main.mk ================================================================== --- main.mk +++ main.mk @@ -48,25 +48,24 @@ TCCX += -I$(TOP)/ext/rtree -I$(TOP)/ext/icu -I$(TOP)/ext/fts3 # Object files for the SQLite library. # LIBOBJ+= alter.o analyze.o attach.o auth.o \ - backup.o bitvec.o btmutex.o btree.o build.o \ + bitvec.o btmutex.o btree.o build.o \ callback.o complete.o date.o delete.o expr.o fault.o \ - fts3.o fts3_expr.o fts3_hash.o fts3_icu.o fts3_porter.o \ + fts3.o fts3_hash.o fts3_icu.o fts3_porter.o \ fts3_tokenizer.o fts3_tokenizer1.o \ func.o global.o hash.o \ icu.o insert.o journal.o legacy.o loadext.o \ - main.o malloc.o mem0.o mem1.o mem2.o mem3.o mem5.o \ - memjournal.o \ + main.o malloc.o mem1.o mem2.o mem3.o mem4.o mem5.o mem6.o \ mutex.o mutex_noop.o mutex_os2.o mutex_unix.o mutex_w32.o \ opcodes.o os.o os_os2.o os_unix.o os_win.o \ - pager.o parse.o pcache.o pcache1.o pragma.o prepare.o printf.o \ - random.o resolve.o rowset.o rtree.o select.o status.o \ + pager.o parse.o pcache.o pragma.o prepare.o printf.o \ + random.o resolve.o rtree.o select.o status.o \ table.o tokenize.o trigger.o \ update.o util.o vacuum.o \ - vdbe.o vdbeapi.o vdbeaux.o vdbeblob.o vdbemem.o \ + vdbe.o vdbeapi.o vdbeaux.o vdbeblob.o vdbefifo.o vdbemem.o \ walker.o where.o utf.o vtab.o # All of the source code files. @@ -74,11 +73,10 @@ SRC = \ $(TOP)/src/alter.c \ $(TOP)/src/analyze.c \ $(TOP)/src/attach.c \ $(TOP)/src/auth.c \ - $(TOP)/src/backup.c \ $(TOP)/src/bitvec.c \ $(TOP)/src/btmutex.c \ $(TOP)/src/btree.c \ $(TOP)/src/btree.h \ $(TOP)/src/btreeInt.h \ @@ -98,16 +96,16 @@ $(TOP)/src/journal.c \ $(TOP)/src/legacy.c \ $(TOP)/src/loadext.c \ $(TOP)/src/main.c \ $(TOP)/src/malloc.c \ - $(TOP)/src/mem0.c \ $(TOP)/src/mem1.c \ $(TOP)/src/mem2.c \ $(TOP)/src/mem3.c \ + $(TOP)/src/mem4.c \ $(TOP)/src/mem5.c \ - $(TOP)/src/memjournal.c \ + $(TOP)/src/mem6.c \ $(TOP)/src/mutex.c \ $(TOP)/src/mutex.h \ $(TOP)/src/mutex_noop.c \ $(TOP)/src/mutex_os2.c \ $(TOP)/src/mutex_unix.c \ @@ -121,17 +119,15 @@ $(TOP)/src/pager.c \ $(TOP)/src/pager.h \ $(TOP)/src/parse.y \ $(TOP)/src/pcache.c \ $(TOP)/src/pcache.h \ - $(TOP)/src/pcache1.c \ $(TOP)/src/pragma.c \ $(TOP)/src/prepare.c \ $(TOP)/src/printf.c \ $(TOP)/src/random.c \ $(TOP)/src/resolve.c \ - $(TOP)/src/rowset.c \ $(TOP)/src/select.c \ $(TOP)/src/status.c \ $(TOP)/src/shell.c \ $(TOP)/src/sqlite.h.in \ $(TOP)/src/sqlite3ext.h \ @@ -148,10 +144,11 @@ $(TOP)/src/vdbe.c \ $(TOP)/src/vdbe.h \ $(TOP)/src/vdbeapi.c \ $(TOP)/src/vdbeaux.c \ $(TOP)/src/vdbeblob.c \ + $(TOP)/src/vdbefifo.c \ $(TOP)/src/vdbemem.c \ $(TOP)/src/vdbeInt.h \ $(TOP)/src/vtab.c \ $(TOP)/src/walker.c \ $(TOP)/src/where.c @@ -177,12 +174,10 @@ $(TOP)/ext/fts2/fts2_tokenizer.c \ $(TOP)/ext/fts2/fts2_tokenizer1.c SRC += \ $(TOP)/ext/fts3/fts3.c \ $(TOP)/ext/fts3/fts3.h \ - $(TOP)/ext/fts3/fts3_expr.c \ - $(TOP)/ext/fts3/fts3_expr.h \ $(TOP)/ext/fts3/fts3_hash.c \ $(TOP)/ext/fts3/fts3_hash.h \ $(TOP)/ext/fts3/fts3_icu.c \ $(TOP)/ext/fts3/fts3_porter.c \ $(TOP)/ext/fts3/fts3_tokenizer.h \ @@ -219,23 +214,20 @@ $(TOP)/src/test7.c \ $(TOP)/src/test8.c \ $(TOP)/src/test9.c \ $(TOP)/src/test_autoext.c \ $(TOP)/src/test_async.c \ - $(TOP)/src/test_backup.c \ $(TOP)/src/test_btree.c \ $(TOP)/src/test_config.c \ $(TOP)/src/test_devsym.c \ $(TOP)/src/test_func.c \ $(TOP)/src/test_hexio.c \ - $(TOP)/src/test_journal.c \ $(TOP)/src/test_malloc.c \ $(TOP)/src/test_md5.c \ $(TOP)/src/test_mutex.c \ $(TOP)/src/test_onefile.c \ $(TOP)/src/test_osinst.c \ - $(TOP)/src/test_pcache.c \ $(TOP)/src/test_schema.c \ $(TOP)/src/test_server.c \ $(TOP)/src/test_tclvar.c \ $(TOP)/src/test_thread.c \ $(TOP)/src/test_wsd.c \ @@ -242,21 +234,19 @@ #TESTSRC += $(TOP)/ext/fts2/fts2_tokenizer.c #TESTSRC += $(TOP)/ext/fts3/fts3_tokenizer.c TESTSRC2 = \ - $(TOP)/src/attach.c $(TOP)/src/backup.c $(TOP)/src/btree.c \ - $(TOP)/src/build.c $(TOP)/src/date.c \ + $(TOP)/src/attach.c $(TOP)/src/btree.c $(TOP)/src/build.c $(TOP)/src/date.c \ $(TOP)/src/expr.c $(TOP)/src/func.c $(TOP)/src/insert.c $(TOP)/src/os.c \ $(TOP)/src/os_os2.c $(TOP)/src/os_unix.c $(TOP)/src/os_win.c \ $(TOP)/src/pager.c $(TOP)/src/pragma.c $(TOP)/src/prepare.c \ $(TOP)/src/printf.c $(TOP)/src/random.c $(TOP)/src/pcache.c \ - $(TOP)/src/pcache1.c $(TOP)/src/select.c $(TOP)/src/tokenize.c \ + $(TOP)/src/select.c $(TOP)/src/tokenize.c \ $(TOP)/src/utf.c $(TOP)/src/util.c $(TOP)/src/vdbeapi.c $(TOP)/src/vdbeaux.c \ $(TOP)/src/vdbe.c $(TOP)/src/vdbemem.c $(TOP)/src/where.c parse.c \ - $(TOP)/ext/fts3/fts3.c $(TOP)/ext/fts3/fts3_expr.c \ - $(TOP)/ext/fts3/fts3_tokenizer.c + $(TOP)/ext/fts3/fts3.c $(TOP)/ext/fts3/fts3_tokenizer.c # Header files used by all library source files. # HDR = \ $(TOP)/src/btree.h \ @@ -288,11 +278,10 @@ $(TOP)/ext/fts2/fts2.h \ $(TOP)/ext/fts2/fts2_hash.h \ $(TOP)/ext/fts2/fts2_tokenizer.h EXTHDR += \ $(TOP)/ext/fts3/fts3.h \ - $(TOP)/ext/fts3/fts3_expr.h \ $(TOP)/ext/fts3/fts3_hash.h \ $(TOP)/ext/fts3/fts3_tokenizer.h EXTHDR += \ $(TOP)/ext/rtree/rtree.h EXTHDR += \ @@ -418,13 +407,10 @@ $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts2/fts2_tokenizer1.c fts3.o: $(TOP)/ext/fts3/fts3.c $(HDR) $(EXTHDR) $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3.c -fts3_expr.o: $(TOP)/ext/fts3/fts3_expr.c $(HDR) $(EXTHDR) - $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_expr.c - fts3_hash.o: $(TOP)/ext/fts3/fts3_hash.c $(HDR) $(EXTHDR) $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_hash.c fts3_icu.o: $(TOP)/ext/fts3/fts3_icu.c $(HDR) $(EXTHDR) $(TCCX) -DSQLITE_CORE -c $(TOP)/ext/fts3/fts3_icu.c Index: src/alter.c ================================================================== --- src/alter.c +++ src/alter.c @@ -10,13 +10,14 @@ ** ************************************************************************* ** This file contains C code routines that used to generate VDBE code ** that implements the ALTER TABLE command. ** -** $Id: alter.c,v 1.52 2009/01/20 16:53:40 danielk1977 Exp $ +** $Id: alter.c,v 1.48 2008/08/08 14:19:41 drh Exp $ */ #include "sqliteInt.h" +#include /* ** The code in this file only exists if we are not omitting the ** ALTER TABLE logic from the build. */ @@ -36,11 +37,11 @@ ** sqlite_rename_table('CREATE INDEX i ON abc(a)', 'def') ** -> 'CREATE INDEX i ON def(a, b, c)' */ static void renameTableFunc( sqlite3_context *context, - int NotUsed, + int argc, sqlite3_value **argv ){ unsigned char const *zSql = sqlite3_value_text(argv[0]); unsigned char const *zTableName = sqlite3_value_text(argv[1]); @@ -50,12 +51,10 @@ int len = 0; char *zRet; sqlite3 *db = sqlite3_context_db_handle(context); - UNUSED_PARAMETER(NotUsed); - /* The principle used to locate the table name in the CREATE TABLE ** statement is that the table name is the first non-space token that ** is immediately followed by a TK_LP or TK_USING token. */ if( zSql ){ @@ -93,11 +92,11 @@ ** returned. This is analagous to renameTableFunc() above, except for CREATE ** TRIGGER, not CREATE INDEX and CREATE TABLE. */ static void renameTriggerFunc( sqlite3_context *context, - int NotUsed, + int argc, sqlite3_value **argv ){ unsigned char const *zSql = sqlite3_value_text(argv[0]); unsigned char const *zTableName = sqlite3_value_text(argv[1]); @@ -105,13 +104,12 @@ Token tname; int dist = 3; unsigned char const *zCsr = zSql; int len = 0; char *zRet; - sqlite3 *db = sqlite3_context_db_handle(context); - UNUSED_PARAMETER(NotUsed); + sqlite3 *db = sqlite3_context_db_handle(context); /* The principle used to locate the table name in the CREATE TRIGGER ** statement is that the table name is the first token that is immediatedly ** preceded by either TK_ON or TK_DOT and immediatedly followed by one ** of TK_WHEN, TK_BEGIN or TK_FOR. @@ -302,13 +300,11 @@ } /* Make sure it is not a system table being altered, or a reserved name ** that the table is being renamed to. */ - if( sqlite3Strlen30(pTab->zName)>6 - && 0==sqlite3StrNICmp(pTab->zName, "sqlite_", 7) - ){ + if( strlen(pTab->zName)>6 && 0==sqlite3StrNICmp(pTab->zName, "sqlite_", 7) ){ sqlite3ErrorMsg(pParse, "table %s may not be altered", pTab->zName); goto exit_rename_table; } if( SQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){ goto exit_rename_table; @@ -443,15 +439,15 @@ char *zCol; /* Null-terminated column definition */ Column *pCol; /* The new column */ Expr *pDflt; /* Default value for the new column */ sqlite3 *db; /* The database connection; */ - db = pParse->db; - if( pParse->nErr || db->mallocFailed ) return; + if( pParse->nErr ) return; pNew = pParse->pNewTable; assert( pNew ); + db = pParse->db; assert( sqlite3BtreeHoldsAllMutexes(db) ); iDb = sqlite3SchemaToIndex(db, pNew->pSchema); zDb = db->aDb[iDb].zName; zTab = pNew->zName; pCol = &pNew->aCol[pNew->nCol-1]; @@ -510,11 +506,11 @@ /* Modify the CREATE TABLE statement. */ zCol = sqlite3DbStrNDup(db, (char*)pColDef->z, pColDef->n); if( zCol ){ char *zEnd = &zCol[pColDef->n-1]; - while( (zEnd>zCol && *zEnd==';') || sqlite3Isspace(*zEnd) ){ + while( (zEnd>zCol && *zEnd==';') || isspace(*(unsigned char *)zEnd) ){ *zEnd-- = '\0'; } sqlite3NestedParse(pParse, "UPDATE \"%w\".%s SET " "sql = substr(sql,1,%d) || ', ' || %Q || substr(sql,%d) " Index: src/analyze.c ================================================================== --- src/analyze.c +++ src/analyze.c @@ -9,11 +9,11 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains code associated with the ANALYZE command. ** -** @(#) $Id: analyze.c,v 1.47 2008/12/10 16:45:51 drh Exp $ +** @(#) $Id: analyze.c,v 1.43 2008/07/28 19:34:53 drh Exp $ */ #ifndef SQLITE_OMIT_ANALYZE #include "sqliteInt.h" /* @@ -31,11 +31,11 @@ const char *zWhere /* Delete entries associated with this table */ ){ sqlite3 *db = pParse->db; Db *pDb; int iRootPage; - u8 createStat1 = 0; + int createStat1 = 0; Table *pStat; Vdbe *v = sqlite3GetVdbe(pParse); if( v==0 ) return; assert( sqlite3BtreeHoldsAllMutexes(db) ); @@ -84,15 +84,15 @@ ** a single table. */ static void analyzeOneTable( Parse *pParse, /* Parser context */ Table *pTab, /* Table whose indices are to be analyzed */ - int iStatCur, /* Index of VdbeCursor that writes the sqlite_stat1 table */ + int iStatCur, /* Cursor that writes to the sqlite_stat1 table */ int iMem /* Available memory locations begin here */ ){ Index *pIdx; /* An index to being analyzed */ - int iIdxCur; /* Index of VdbeCursor for index being analyzed */ + int iIdxCur; /* Cursor number for index being analyzed */ int nCol; /* Number of columns in the index */ Vdbe *v; /* The virtual machine being built up */ int i; /* Loop counter */ int topOfLoop; /* The top of the loop */ int endOfLoop; /* The end of the loop */ @@ -354,20 +354,18 @@ ** sqlite_stat1 table. ** ** argv[0] = name of the index ** argv[1] = results of analysis - on integer for each column */ -static int analysisLoader(void *pData, int argc, char **argv, char **NotUsed){ +static int analysisLoader(void *pData, int argc, char **argv, char **azNotUsed){ analysisInfo *pInfo = (analysisInfo*)pData; Index *pIndex; int i, c; unsigned int v; const char *z; assert( argc==2 ); - UNUSED_PARAMETER2(NotUsed, argc); - if( argv==0 || argv[0]==0 || argv[1]==0 ){ return 0; } pIndex = sqlite3FindIndex(pInfo->db, argv[0], pInfo->zDatabase); if( pIndex==0 ){ Index: src/attach.c ================================================================== --- src/attach.c +++ src/attach.c @@ -9,11 +9,11 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains code used to implement the ATTACH and DETACH commands. ** -** $Id: attach.c,v 1.82 2009/02/03 16:51:25 danielk1977 Exp $ +** $Id: attach.c,v 1.78 2008/08/20 16:35:10 drh Exp $ */ #include "sqliteInt.h" #ifndef SQLITE_OMIT_ATTACH /* @@ -62,11 +62,11 @@ ** If the optional "KEY z" syntax is omitted, an SQL NULL is passed as the ** third argument. */ static void attachFunc( sqlite3_context *context, - int NotUsed, + int argc, sqlite3_value **argv ){ int i; int rc = 0; sqlite3 *db = sqlite3_context_db_handle(context); @@ -74,12 +74,10 @@ const char *zFile; Db *aNew; char *zErrDyn = 0; char zErr[128]; - UNUSED_PARAMETER(NotUsed); - zFile = (const char *)sqlite3_value_text(argv[0]); zName = (const char *)sqlite3_value_text(argv[1]); if( zFile==0 ) zFile = ""; if( zName==0 ) zName = ""; @@ -232,21 +230,19 @@ ** ** SELECT sqlite_detach(x) */ static void detachFunc( sqlite3_context *context, - int NotUsed, + int argc, sqlite3_value **argv ){ const char *zName = (const char *)sqlite3_value_text(argv[0]); sqlite3 *db = sqlite3_context_db_handle(context); int i; Db *pDb = 0; char zErr[128]; - UNUSED_PARAMETER(NotUsed); - if( zName==0 ) zName = ""; for(i=0; inDb; i++){ pDb = &db->aDb[i]; if( pDb->pBt==0 ) continue; if( sqlite3StrICmp(pDb->zName, zName)==0 ) break; @@ -263,11 +259,11 @@ if( !db->autoCommit ){ sqlite3_snprintf(sizeof(zErr), zErr, "cannot DETACH database within transaction"); goto detach_error; } - if( sqlite3BtreeIsInReadTrans(pDb->pBt) || sqlite3BtreeIsInBackup(pDb->pBt) ){ + if( sqlite3BtreeIsInReadTrans(pDb->pBt) ){ sqlite3_snprintf(sizeof(zErr),zErr, "database %s is locked", zName); goto detach_error; } sqlite3BtreeClose(pDb->pBt); @@ -285,19 +281,21 @@ ** sqlite_detach() or sqlite_attach() SQL user functions. */ static void codeAttach( Parse *pParse, /* The parser context */ int type, /* Either SQLITE_ATTACH or SQLITE_DETACH */ - FuncDef *pFunc, /* FuncDef wrapper for detachFunc() or attachFunc() */ + const char *zFunc, /* Either "sqlite_attach" or "sqlite_detach */ + int nFunc, /* Number of args to pass to zFunc */ Expr *pAuthArg, /* Expression to pass to authorization callback */ Expr *pFilename, /* Name of database file */ Expr *pDbname, /* Name of the database to use internally */ Expr *pKey /* Database key for encryption extension */ ){ int rc; NameContext sName; Vdbe *v; + FuncDef *pFunc; sqlite3* db = pParse->db; int regArgs; #ifndef SQLITE_OMIT_AUTHORIZATION assert( db->mallocFailed || pAuthArg ); @@ -332,13 +330,13 @@ sqlite3ExprCode(pParse, pDbname, regArgs+1); sqlite3ExprCode(pParse, pKey, regArgs+2); assert( v || db->mallocFailed ); if( v ){ - sqlite3VdbeAddOp3(v, OP_Function, 0, regArgs+3-pFunc->nArg, regArgs+3); - assert( pFunc->nArg==-1 || (pFunc->nArg&0xff)==pFunc->nArg ); - sqlite3VdbeChangeP5(v, (u8)(pFunc->nArg)); + sqlite3VdbeAddOp3(v, OP_Function, 0, regArgs+3-nFunc, regArgs+3); + sqlite3VdbeChangeP5(v, nFunc); + pFunc = sqlite3FindFunction(db, zFunc, strlen(zFunc), nFunc, SQLITE_UTF8,0); sqlite3VdbeChangeP4(v, -1, (char *)pFunc, P4_FUNCDEF); /* Code an OP_Expire. For an ATTACH statement, set P1 to true (expire this ** statement only). For DETACH, set it to false (expire all existing ** statements). @@ -356,46 +354,33 @@ ** Called by the parser to compile a DETACH statement. ** ** DETACH pDbname */ void sqlite3Detach(Parse *pParse, Expr *pDbname){ - static FuncDef detach_func = { - 1, /* nArg */ - SQLITE_UTF8, /* iPrefEnc */ - 0, /* flags */ - 0, /* pUserData */ - 0, /* pNext */ - detachFunc, /* xFunc */ - 0, /* xStep */ - 0, /* xFinalize */ - "sqlite_detach", /* zName */ - 0 /* pHash */ - }; - codeAttach(pParse, SQLITE_DETACH, &detach_func, pDbname, 0, 0, pDbname); + codeAttach(pParse, SQLITE_DETACH, "sqlite_detach", 1, pDbname, 0, 0, pDbname); } /* ** Called by the parser to compile an ATTACH statement. ** ** ATTACH p AS pDbname KEY pKey */ void sqlite3Attach(Parse *pParse, Expr *p, Expr *pDbname, Expr *pKey){ - static FuncDef attach_func = { - 3, /* nArg */ - SQLITE_UTF8, /* iPrefEnc */ - 0, /* flags */ - 0, /* pUserData */ - 0, /* pNext */ - attachFunc, /* xFunc */ - 0, /* xStep */ - 0, /* xFinalize */ - "sqlite_attach", /* zName */ - 0 /* pHash */ - }; - codeAttach(pParse, SQLITE_ATTACH, &attach_func, p, p, pDbname, pKey); + codeAttach(pParse, SQLITE_ATTACH, "sqlite_attach", 3, p, p, pDbname, pKey); } #endif /* SQLITE_OMIT_ATTACH */ + +/* +** Register the functions sqlite_attach and sqlite_detach. +*/ +void sqlite3AttachFunctions(sqlite3 *db){ +#ifndef SQLITE_OMIT_ATTACH + static const int enc = SQLITE_UTF8; + sqlite3CreateFunc(db, "sqlite_attach", 3, enc, 0, attachFunc, 0, 0); + sqlite3CreateFunc(db, "sqlite_detach", 1, enc, 0, detachFunc, 0, 0); +#endif +} /* ** Initialize a DbFixer structure. This routine must be called prior ** to passing the structure to one of the sqliteFixAAAA() routines below. ** DELETED src/backup.c Index: src/backup.c ================================================================== --- src/backup.c +++ /dev/null @@ -1,605 +0,0 @@ -/* -** 2009 January 28 -** -** 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 contains the implementation of the sqlite3_backup_XXX() -** API functions and the related features. -** -** $Id: backup.c,v 1.9 2009/02/09 18:55:46 danielk1977 Exp $ -*/ -#include "sqliteInt.h" -#include "btreeInt.h" - -/* Macro to find the minimum of two numeric values. -*/ -#ifndef MIN -# define MIN(x,y) ((x)<(y)?(x):(y)) -#endif - -/* -** Structure allocated for each backup operation. -*/ -struct sqlite3_backup { - sqlite3* pDestDb; /* Destination database handle */ - Btree *pDest; /* Destination b-tree file */ - u32 iDestSchema; /* Original schema cookie in destination */ - int bDestLocked; /* True once a write-transaction is open on pDest */ - - Pgno iNext; /* Page number of the next source page to copy */ - sqlite3* pSrcDb; /* Source database handle */ - Btree *pSrc; /* Source b-tree file */ - - int rc; /* Backup process error code */ - - /* These two variables are set by every call to backup_step(). They are - ** read by calls to backup_remaining() and backup_pagecount(). - */ - Pgno nRemaining; /* Number of pages left to copy */ - Pgno nPagecount; /* Total number of pages to copy */ - - sqlite3_backup *pNext; /* Next backup associated with source pager */ -}; - -/* -** THREAD SAFETY NOTES: -** -** Once it has been created using backup_init(), a single sqlite3_backup -** structure may be accessed via two groups of thread-safe entry points: -** -** * Via the sqlite3_backup_XXX() API function backup_step() and -** backup_finish(). Both these functions obtain the source database -** handle mutex and the mutex associated with the source BtShared -** structure, in that order. -** -** * Via the BackupUpdate() and BackupRestart() functions, which are -** invoked by the pager layer to report various state changes in -** the page cache associated with the source database. The mutex -** associated with the source database BtShared structure will always -** be held when either of these functions are invoked. -** -** The other sqlite3_backup_XXX() API functions, backup_remaining() and -** backup_pagecount() are not thread-safe functions. If they are called -** while some other thread is calling backup_step() or backup_finish(), -** the values returned may be invalid. There is no way for a call to -** BackupUpdate() or BackupRestart() to interfere with backup_remaining() -** or backup_pagecount(). -** -** Depending on the SQLite configuration, the database handles and/or -** the Btree objects may have their own mutexes that require locking. -** Non-sharable Btrees (in-memory databases for example), do not have -** associated mutexes. -*/ - -/* -** Return a pointer corresponding to database zDb (i.e. "main", "temp") -** in connection handle pDb. If such a database cannot be found, return -** a NULL pointer and write an error message to pErrorDb. -** -** If the "temp" database is requested, it may need to be opened by this -** function. If an error occurs while doing so, return 0 and write an -** error message to pErrorDb. -*/ -static Btree *findBtree(sqlite3 *pErrorDb, sqlite3 *pDb, const char *zDb){ - int i = sqlite3FindDbName(pDb, zDb); - - if( i==1 ){ - Parse sParse; - memset(&sParse, 0, sizeof(sParse)); - sParse.db = pDb; - if( sqlite3OpenTempDatabase(&sParse) ){ - sqlite3ErrorClear(&sParse); - sqlite3Error(pErrorDb, sParse.rc, "%s", sParse.zErrMsg); - return 0; - } - assert( sParse.zErrMsg==0 ); - } - - if( i<0 ){ - sqlite3Error(pErrorDb, SQLITE_ERROR, "unknown database %s", zDb); - return 0; - } - - return pDb->aDb[i].pBt; -} - -/* -** Create an sqlite3_backup process to copy the contents of zSrcDb from -** connection handle pSrcDb to zDestDb in pDestDb. If successful, return -** a pointer to the new sqlite3_backup object. -** -** If an error occurs, NULL is returned and an error code and error message -** stored in database handle pDestDb. -*/ -sqlite3_backup *sqlite3_backup_init( - sqlite3* pDestDb, /* Database to write to */ - const char *zDestDb, /* Name of database within pDestDb */ - sqlite3* pSrcDb, /* Database connection to read from */ - const char *zSrcDb /* Name of database within pSrcDb */ -){ - sqlite3_backup *p; /* Value to return */ - - /* Lock the source database handle. The destination database - ** handle is not locked in this routine, but it is locked in - ** sqlite3_backup_step(). The user is required to ensure that no - ** other thread accesses the destination handle for the duration - ** of the backup operation. Any attempt to use the destination - ** database connection while a backup is in progress may cause - ** a malfunction or a deadlock. - */ - sqlite3_mutex_enter(pSrcDb->mutex); - sqlite3_mutex_enter(pDestDb->mutex); - - if( pSrcDb==pDestDb ){ - sqlite3Error( - pDestDb, SQLITE_ERROR, "source and destination must be distinct" - ); - p = 0; - }else { - /* Allocate space for a new sqlite3_backup object */ - p = (sqlite3_backup *)sqlite3_malloc(sizeof(sqlite3_backup)); - if( !p ){ - sqlite3Error(pDestDb, SQLITE_NOMEM, 0); - } - } - - /* If the allocation succeeded, populate the new object. */ - if( p ){ - memset(p, 0, sizeof(sqlite3_backup)); - p->pSrc = findBtree(pDestDb, pSrcDb, zSrcDb); - p->pDest = findBtree(pDestDb, pDestDb, zDestDb); - p->pDestDb = pDestDb; - p->pSrcDb = pSrcDb; - p->iNext = 1; - - if( 0==p->pSrc || 0==p->pDest ){ - /* One (or both) of the named databases did not exist. An error has - ** already been written into the pDestDb handle. All that is left - ** to do here is free the sqlite3_backup structure. - */ - sqlite3_free(p); - p = 0; - } - } - - /* If everything has gone as planned, attach the backup object to the - ** source pager. The source pager calls BackupUpdate() and BackupRestart() - ** to notify this module if the source file is modified mid-backup. - */ - if( p ){ - sqlite3_backup **pp; /* Pointer to head of pagers backup list */ - sqlite3BtreeEnter(p->pSrc); - pp = sqlite3PagerBackupPtr(sqlite3BtreePager(p->pSrc)); - p->pNext = *pp; - *pp = p; - sqlite3BtreeLeave(p->pSrc); - p->pSrc->nBackup++; - } - - sqlite3_mutex_leave(pDestDb->mutex); - sqlite3_mutex_leave(pSrcDb->mutex); - return p; -} - -/* -** Argument rc is an SQLite error code. Return true if this error is -** considered fatal if encountered during a backup operation. All errors -** are considered fatal except for SQLITE_BUSY and SQLITE_LOCKED. -*/ -static int isFatalError(int rc){ - return (rc!=SQLITE_OK && rc!=SQLITE_BUSY && rc!=SQLITE_LOCKED); -} - -/* -** Parameter zSrcData points to a buffer containing the data for -** page iSrcPg from the source database. Copy this data into the -** destination database. -*/ -static int backupOnePage(sqlite3_backup *p, Pgno iSrcPg, const u8 *zSrcData){ - Pager * const pDestPager = sqlite3BtreePager(p->pDest); - const int nSrcPgsz = sqlite3BtreeGetPageSize(p->pSrc); - int nDestPgsz = sqlite3BtreeGetPageSize(p->pDest); - const int nCopy = MIN(nSrcPgsz, nDestPgsz); - const i64 iEnd = (i64)iSrcPg*(i64)nSrcPgsz; - - int rc = SQLITE_OK; - i64 iOff; - - assert( p->bDestLocked ); - assert( !isFatalError(p->rc) ); - assert( iSrcPg!=PENDING_BYTE_PAGE(p->pSrc->pBt) ); - assert( zSrcData ); - - /* Catch the case where the destination is an in-memory database and the - ** page sizes of the source and destination differ. - */ - if( nSrcPgsz!=nDestPgsz && sqlite3PagerIsMemdb(sqlite3BtreePager(p->pDest)) ){ - rc = SQLITE_READONLY; - } - - /* This loop runs once for each destination page spanned by the source - ** page. For each iteration, variable iOff is set to the byte offset - ** of the destination page. - */ - for(iOff=iEnd-(i64)nSrcPgsz; rc==SQLITE_OK && iOffpDest->pBt) ) continue; - if( SQLITE_OK==(rc = sqlite3PagerGet(pDestPager, iDest, &pDestPg)) - && SQLITE_OK==(rc = sqlite3PagerWrite(pDestPg)) - ){ - const u8 *zIn = &zSrcData[iOff%nSrcPgsz]; - u8 *zDestData = sqlite3PagerGetData(pDestPg); - u8 *zOut = &zDestData[iOff%nDestPgsz]; - - /* Copy the data from the source page into the destination page. - ** Then clear the Btree layer MemPage.isInit flag. Both this module - ** and the pager code use this trick (clearing the first byte - ** of the page 'extra' space to invalidate the Btree layers - ** cached parse of the page). MemPage.isInit is marked - ** "MUST BE FIRST" for this purpose. - */ - memcpy(zOut, zIn, nCopy); - ((u8 *)sqlite3PagerGetExtra(pDestPg))[0] = 0; - } - sqlite3PagerUnref(pDestPg); - } - - return rc; -} - -/* -** If pFile is currently larger than iSize bytes, then truncate it to -** exactly iSize bytes. If pFile is not larger than iSize bytes, then -** this function is a no-op. -** -** Return SQLITE_OK if everything is successful, or an SQLite error -** code if an error occurs. -*/ -static int backupTruncateFile(sqlite3_file *pFile, i64 iSize){ - i64 iCurrent; - int rc = sqlite3OsFileSize(pFile, &iCurrent); - if( rc==SQLITE_OK && iCurrent>iSize ){ - rc = sqlite3OsTruncate(pFile, iSize); - } - return rc; -} - -/* -** Copy nPage pages from the source b-tree to the destination. -*/ -int sqlite3_backup_step(sqlite3_backup *p, int nPage){ - int rc; - - sqlite3_mutex_enter(p->pSrcDb->mutex); - sqlite3BtreeEnter(p->pSrc); - if( p->pDestDb ){ - sqlite3_mutex_enter(p->pDestDb->mutex); - } - - rc = p->rc; - if( !isFatalError(rc) ){ - Pager * const pSrcPager = sqlite3BtreePager(p->pSrc); /* Source pager */ - Pager * const pDestPager = sqlite3BtreePager(p->pDest); /* Dest pager */ - int ii; /* Iterator variable */ - int nSrcPage = -1; /* Size of source db in pages */ - int bCloseTrans = 0; /* True if src db requires unlocking */ - - /* If the source pager is currently in a write-transaction, return - ** SQLITE_LOCKED immediately. - */ - if( p->pDestDb && p->pSrc->pBt->inTransaction==TRANS_WRITE ){ - rc = SQLITE_LOCKED; - }else{ - rc = SQLITE_OK; - } - - /* Lock the destination database, if it is not locked already. */ - if( SQLITE_OK==rc && p->bDestLocked==0 - && SQLITE_OK==(rc = sqlite3BtreeBeginTrans(p->pDest, 2)) - ){ - p->bDestLocked = 1; - rc = sqlite3BtreeGetMeta(p->pDest, 1, &p->iDestSchema); - } - - /* If there is no open read-transaction on the source database, open - ** one now. If a transaction is opened here, then it will be closed - ** before this function exits. - */ - if( rc==SQLITE_OK && 0==sqlite3BtreeIsInReadTrans(p->pSrc) ){ - rc = sqlite3BtreeBeginTrans(p->pSrc, 0); - bCloseTrans = 1; - } - - /* Now that there is a read-lock on the source database, query the - ** source pager for the number of pages in the database. - */ - if( rc==SQLITE_OK ){ - rc = sqlite3PagerPagecount(pSrcPager, &nSrcPage); - } - for(ii=0; (nPage<0 || iiiNext<=(Pgno)nSrcPage && !rc; ii++){ - const Pgno iSrcPg = p->iNext; /* Source page number */ - if( iSrcPg!=PENDING_BYTE_PAGE(p->pSrc->pBt) ){ - DbPage *pSrcPg; /* Source page object */ - rc = sqlite3PagerGet(pSrcPager, iSrcPg, &pSrcPg); - if( rc==SQLITE_OK ){ - rc = backupOnePage(p, iSrcPg, sqlite3PagerGetData(pSrcPg)); - sqlite3PagerUnref(pSrcPg); - } - } - p->iNext++; - } - if( rc==SQLITE_OK ){ - p->nPagecount = nSrcPage; - p->nRemaining = nSrcPage+1-p->iNext; - if( p->iNext>(Pgno)nSrcPage ){ - rc = SQLITE_DONE; - } - } - - if( rc==SQLITE_DONE ){ - const int nSrcPagesize = sqlite3BtreeGetPageSize(p->pSrc); - const int nDestPagesize = sqlite3BtreeGetPageSize(p->pDest); - int nDestTruncate; - - /* Update the schema version field in the destination database. This - ** is to make sure that the schema-version really does change in - ** the case where the source and destination databases have the - ** same schema version. - */ - sqlite3BtreeUpdateMeta(p->pDest, 1, p->iDestSchema+1); - if( p->pDestDb ){ - sqlite3ResetInternalSchema(p->pDestDb, 0); - } - - /* Set nDestTruncate to the final number of pages in the destination - ** database. The complication here is that the destination page - ** size may be different to the source page size. - ** - ** If the source page size is smaller than the destination page size, - ** round up. In this case the call to sqlite3OsTruncate() below will - ** fix the size of the file. However it is important to call - ** sqlite3PagerTruncateImage() here so that any pages in the - ** destination file that lie beyond the nDestTruncate page mark are - ** journalled by PagerCommitPhaseOne() before they are destroyed - ** by the file truncation. - */ - if( nSrcPagesize= iSize ); - if( SQLITE_OK==(rc = sqlite3PagerCommitPhaseOne(pDestPager, 0, 1)) - && SQLITE_OK==(rc = backupTruncateFile(pFile, iSize)) - && SQLITE_OK==(rc = sqlite3PagerSync(pDestPager)) - ){ - i64 iOff; - i64 iEnd = MIN(PENDING_BYTE + nDestPagesize, iSize); - for( - iOff=PENDING_BYTE+nSrcPagesize; - rc==SQLITE_OK && iOffpDest)) - ){ - rc = SQLITE_DONE; - } - } - - /* If bCloseTrans is true, then this function opened a read transaction - ** on the source database. Close the read transaction here. There is - ** no need to check the return values of the btree methods here, as - ** "committing" a read-only transaction cannot fail. - */ - if( bCloseTrans ){ - TESTONLY( int rc2 ); - TESTONLY( rc2 = ) sqlite3BtreeCommitPhaseOne(p->pSrc, 0); - TESTONLY( rc2 |= ) sqlite3BtreeCommitPhaseTwo(p->pSrc); - assert( rc2==SQLITE_OK ); - } - - p->rc = rc; - } - if( p->pDestDb ){ - sqlite3_mutex_leave(p->pDestDb->mutex); - } - sqlite3BtreeLeave(p->pSrc); - sqlite3_mutex_leave(p->pSrcDb->mutex); - return rc; -} - -/* -** Release all resources associated with an sqlite3_backup* handle. -*/ -int sqlite3_backup_finish(sqlite3_backup *p){ - sqlite3_backup **pp; /* Ptr to head of pagers backup list */ - sqlite3_mutex *mutex; /* Mutex to protect source database */ - int rc; /* Value to return */ - - /* Enter the mutexes */ - sqlite3_mutex_enter(p->pSrcDb->mutex); - sqlite3BtreeEnter(p->pSrc); - mutex = p->pSrcDb->mutex; - if( p->pDestDb ){ - sqlite3_mutex_enter(p->pDestDb->mutex); - } - - /* Detach this backup from the source pager. */ - if( p->pDestDb ){ - pp = sqlite3PagerBackupPtr(sqlite3BtreePager(p->pSrc)); - while( *pp!=p ){ - pp = &(*pp)->pNext; - } - *pp = p->pNext; - p->pSrc->nBackup--; - } - - /* If a transaction is still open on the Btree, roll it back. */ - sqlite3BtreeRollback(p->pDest); - - /* Set the error code of the destination database handle. */ - rc = (p->rc==SQLITE_DONE) ? SQLITE_OK : p->rc; - sqlite3Error(p->pDestDb, rc, 0); - - /* Exit the mutexes and free the backup context structure. */ - if( p->pDestDb ){ - sqlite3_mutex_leave(p->pDestDb->mutex); - } - sqlite3BtreeLeave(p->pSrc); - if( p->pDestDb ){ - sqlite3_free(p); - } - sqlite3_mutex_leave(mutex); - return rc; -} - -/* -** Return the number of pages still to be backed up as of the most recent -** call to sqlite3_backup_step(). -*/ -int sqlite3_backup_remaining(sqlite3_backup *p){ - return p->nRemaining; -} - -/* -** Return the total number of pages in the source database as of the most -** recent call to sqlite3_backup_step(). -*/ -int sqlite3_backup_pagecount(sqlite3_backup *p){ - return p->nPagecount; -} - -/* -** This function is called after the contents of page iPage of the -** source database have been modified. If page iPage has already been -** copied into the destination database, then the data written to the -** destination is now invalidated. The destination copy of iPage needs -** to be updated with the new data before the backup operation is -** complete. -** -** It is assumed that the mutex associated with the BtShared object -** corresponding to the source database is held when this function is -** called. -*/ -void sqlite3BackupUpdate(sqlite3_backup *pBackup, Pgno iPage, const u8 *aData){ - sqlite3_backup *p; /* Iterator variable */ - for(p=pBackup; p; p=p->pNext){ - assert( sqlite3_mutex_held(p->pSrc->pBt->mutex) ); - if( !isFatalError(p->rc) && iPageiNext ){ - /* The backup process p has already copied page iPage. But now it - ** has been modified by a transaction on the source pager. Copy - ** the new data into the backup. - */ - int rc = backupOnePage(p, iPage, aData); - assert( rc!=SQLITE_BUSY && rc!=SQLITE_LOCKED ); - if( rc!=SQLITE_OK ){ - p->rc = rc; - } - } - } -} - -/* -** Restart the backup process. This is called when the pager layer -** detects that the database has been modified by an external database -** connection. In this case there is no way of knowing which of the -** pages that have been copied into the destination database are still -** valid and which are not, so the entire process needs to be restarted. -** -** It is assumed that the mutex associated with the BtShared object -** corresponding to the source database is held when this function is -** called. -*/ -void sqlite3BackupRestart(sqlite3_backup *pBackup){ - sqlite3_backup *p; /* Iterator variable */ - for(p=pBackup; p; p=p->pNext){ - assert( sqlite3_mutex_held(p->pSrc->pBt->mutex) ); - p->iNext = 1; - } -} - -#ifndef SQLITE_OMIT_VACUUM -/* -** Copy the complete content of pBtFrom into pBtTo. A transaction -** must be active for both files. -** -** The size of file pTo may be reduced by this operation. If anything -** goes wrong, the transaction on pTo is rolled back. If successful, the -** transaction is committed before returning. -*/ -int sqlite3BtreeCopyFile(Btree *pTo, Btree *pFrom){ - int rc; - sqlite3_backup b; - sqlite3BtreeEnter(pTo); - sqlite3BtreeEnter(pFrom); - - /* Set up an sqlite3_backup object. sqlite3_backup.pDestDb must be set - ** to 0. This is used by the implementations of sqlite3_backup_step() - ** and sqlite3_backup_finish() to detect that they are being called - ** from this function, not directly by the user. - */ - memset(&b, 0, sizeof(b)); - b.pSrcDb = pFrom->db; - b.pSrc = pFrom; - b.pDest = pTo; - b.iNext = 1; - - /* 0x7FFFFFFF is the hard limit for the number of pages in a database - ** file. By passing this as the number of pages to copy to - ** sqlite3_backup_step(), we can guarantee that the copy finishes - ** within a single call (unless an error occurs). The assert() statement - ** checks this assumption - (p->rc) should be set to either SQLITE_DONE - ** or an error code. - */ - sqlite3_backup_step(&b, 0x7FFFFFFF); - assert( b.rc!=SQLITE_OK ); - rc = sqlite3_backup_finish(&b); - if( rc==SQLITE_OK ){ - pTo->pBt->pageSizeFixed = 0; - } - - sqlite3BtreeLeave(pFrom); - sqlite3BtreeLeave(pTo); - return rc; -} -#endif /* SQLITE_OMIT_VACUUM */ Index: src/bitvec.c ================================================================== --- src/bitvec.c +++ src/bitvec.c @@ -10,18 +10,16 @@ ** ************************************************************************* ** This file implements an object that represents a fixed-length ** bitmap. Bits are numbered starting with 1. ** -** A bitmap is used to record which pages of a database file have been -** journalled during a transaction, or which pages have the "dont-write" -** property. Usually only a few pages are meet either condition. -** So the bitmap is usually sparse and has low cardinality. +** A bitmap is used to record what pages a database file have been +** journalled during a transaction. Usually only a few pages are +** journalled. So the bitmap is usually sparse and has low cardinality. ** But sometimes (for example when during a DROP of a large table) most -** or all of the pages in a database can get journalled. In those cases, -** the bitmap becomes dense with high cardinality. The algorithm needs -** to handle both cases well. +** or all of the pages get journalled. In those cases, the bitmap becomes +** dense. The algorithm needs to handle both cases well. ** ** The size of the bitmap is fixed when the object is created. ** ** All bits are clear when the bitmap is created. Individual bits ** may be set or cleared one at a time. @@ -32,46 +30,25 @@ ** sometimes grow into tens of thousands or larger. The size of the ** Bitvec object is the number of pages in the database file at the ** start of a transaction, and is thus usually less than a few thousand, ** but can be as large as 2 billion for a really big database. ** -** @(#) $Id: bitvec.c,v 1.13 2009/01/20 17:06:27 danielk1977 Exp $ +** @(#) $Id: bitvec.c,v 1.6 2008/06/20 14:59:51 danielk1977 Exp $ */ #include "sqliteInt.h" -/* Size of the Bitvec structure in bytes. */ #define BITVEC_SZ 512 - /* Round the union size down to the nearest pointer boundary, since that's how ** it will be aligned within the Bitvec struct. */ -#define BITVEC_USIZE (((BITVEC_SZ-(3*sizeof(u32)))/sizeof(Bitvec*))*sizeof(Bitvec*)) - -/* Type of the array "element" for the bitmap representation. -** Should be a power of 2, and ideally, evenly divide into BITVEC_USIZE. -** Setting this to the "natural word" size of your CPU may improve -** performance. */ -#define BITVEC_TELEM u8 -/* Size, in bits, of the bitmap element. */ -#define BITVEC_SZELEM 8 -/* Number of elements in a bitmap array. */ -#define BITVEC_NELEM (BITVEC_USIZE/sizeof(BITVEC_TELEM)) -/* Number of bits in the bitmap array. */ -#define BITVEC_NBIT (BITVEC_NELEM*BITVEC_SZELEM) - -/* Number of u32 values in hash table. */ -#define BITVEC_NINT (BITVEC_USIZE/sizeof(u32)) -/* Maximum number of entries in hash table before -** sub-dividing and re-hashing. */ +#define BITVEC_USIZE (((BITVEC_SZ-12)/sizeof(Bitvec*))*sizeof(Bitvec*)) +#define BITVEC_NCHAR BITVEC_USIZE +#define BITVEC_NBIT (BITVEC_NCHAR*8) +#define BITVEC_NINT (BITVEC_USIZE/4) #define BITVEC_MXHASH (BITVEC_NINT/2) -/* Hashing function for the aHash representation. -** Empirical testing showed that the *37 multiplier -** (an arbitrary prime)in the hash function provided -** no fewer collisions than the no-op *1. */ -#define BITVEC_HASH(X) (((X)*1)%BITVEC_NINT) - #define BITVEC_NPTR (BITVEC_USIZE/sizeof(Bitvec *)) +#define BITVEC_HASH(X) (((X)*37)%BITVEC_NINT) /* ** A bitmap is an instance of the following structure. ** ** This bitmap records the existance of zero or more bits @@ -91,19 +68,15 @@ ** iDivisor+1 and 2*iDivisor. apSub[N] holds values between ** N*iDivisor+1 and (N+1)*iDivisor. Each subbitmap is normalized ** to hold deal with values between 1 and iDivisor. */ struct Bitvec { - u32 iSize; /* Maximum bit index. Max iSize is 4,294,967,296. */ - u32 nSet; /* Number of bits that are set - only valid for aHash element */ - /* Max nSet is BITVEC_NINT. For BITVEC_SZ of 512, this would be 125. */ - u32 iDivisor; /* Number of bits handled by each apSub[] entry. */ - /* Should >=0 for apSub element. */ - /* Max iDivisor is max(u32) / BITVEC_NPTR + 1. */ - /* For a BITVEC_SZ of 512, this would be 34,359,739. */ + u32 iSize; /* Maximum bit index */ + u32 nSet; /* Number of bits that are set */ + u32 iDivisor; /* Number of bits handled by each apSub[] entry */ union { - BITVEC_TELEM aBitmap[BITVEC_NELEM]; /* Bitmap representation */ + u8 aBitmap[BITVEC_NCHAR]; /* Bitmap representation */ u32 aHash[BITVEC_NINT]; /* Hash table representation */ Bitvec *apSub[BITVEC_NPTR]; /* Recursive representation */ } u; }; @@ -128,23 +101,20 @@ ** i is out of range, then return false. */ int sqlite3BitvecTest(Bitvec *p, u32 i){ if( p==0 ) return 0; if( i>p->iSize || i==0 ) return 0; - i--; - while( p->iDivisor ){ - u32 bin = i/p->iDivisor; - i = i%p->iDivisor; - p = p->u.apSub[bin]; - if (!p) { - return 0; - } - } if( p->iSize<=BITVEC_NBIT ){ - return (p->u.aBitmap[i/BITVEC_SZELEM] & (1<<(i&(BITVEC_SZELEM-1))))!=0; - } else{ - u32 h = BITVEC_HASH(i++); + i--; + return (p->u.aBitmap[i/8] & (1<<(i&7)))!=0; + } + if( p->iDivisor>0 ){ + u32 bin = (i-1)/p->iDivisor; + i = (i-1)%p->iDivisor + 1; + return sqlite3BitvecTest(p->u.apSub[bin], i); + }else{ + u32 h = BITVEC_HASH(i); while( p->u.aHash[h] ){ if( p->u.aHash[h]==i ) return 1; h++; if( h>=BITVEC_NINT ) h = 0; } @@ -153,111 +123,80 @@ } /* ** Set the i-th bit. Return 0 on success and an error code if ** anything goes wrong. -** -** This routine might cause sub-bitmaps to be allocated. Failing -** to get the memory needed to hold the sub-bitmap is the only -** that can go wrong with an insert, assuming p and i are valid. -** -** The calling function must ensure that p is a valid Bitvec object -** and that the value for "i" is within range of the Bitvec object. -** Otherwise the behavior is undefined. */ int sqlite3BitvecSet(Bitvec *p, u32 i){ u32 h; assert( p!=0 ); assert( i>0 ); assert( i<=p->iSize ); - i--; - while((p->iSize > BITVEC_NBIT) && p->iDivisor) { - u32 bin = i/p->iDivisor; - i = i%p->iDivisor; - if( p->u.apSub[bin]==0 ){ - p->u.apSub[bin] = sqlite3BitvecCreate( p->iDivisor ); - if( p->u.apSub[bin]==0 ) return SQLITE_NOMEM; - } - p = p->u.apSub[bin]; - } if( p->iSize<=BITVEC_NBIT ){ - p->u.aBitmap[i/BITVEC_SZELEM] |= 1 << (i&(BITVEC_SZELEM-1)); + i--; + p->u.aBitmap[i/8] |= 1 << (i&7); return SQLITE_OK; } - h = BITVEC_HASH(i++); - /* if there wasn't a hash collision, and this doesn't */ - /* completely fill the hash, then just add it without */ - /* worring about sub-dividing and re-hashing. */ - if( !p->u.aHash[h] ){ - if (p->nSet<(BITVEC_NINT-1)) { - goto bitvec_set_end; - } else { - goto bitvec_set_rehash; - } - } - /* there was a collision, check to see if it's already */ - /* in hash, if not, try to find a spot for it */ - do { + if( p->iDivisor ){ + u32 bin = (i-1)/p->iDivisor; + i = (i-1)%p->iDivisor + 1; + if( p->u.apSub[bin]==0 ){ + sqlite3BeginBenignMalloc(); + p->u.apSub[bin] = sqlite3BitvecCreate( p->iDivisor ); + sqlite3EndBenignMalloc(); + if( p->u.apSub[bin]==0 ) return SQLITE_NOMEM; + } + return sqlite3BitvecSet(p->u.apSub[bin], i); + } + h = BITVEC_HASH(i); + while( p->u.aHash[h] ){ if( p->u.aHash[h]==i ) return SQLITE_OK; h++; - if( h>=BITVEC_NINT ) h = 0; - } while( p->u.aHash[h] ); - /* we didn't find it in the hash. h points to the first */ - /* available free spot. check to see if this is going to */ - /* make our hash too "full". */ -bitvec_set_rehash: + if( h==BITVEC_NINT ) h = 0; + } + p->nSet++; if( p->nSet>=BITVEC_MXHASH ){ - unsigned int j; - int rc; + int j, rc; u32 aiValues[BITVEC_NINT]; memcpy(aiValues, p->u.aHash, sizeof(aiValues)); - memset(p->u.apSub, 0, sizeof(aiValues)); + memset(p->u.apSub, 0, sizeof(p->u.apSub[0])*BITVEC_NPTR); p->iDivisor = (p->iSize + BITVEC_NPTR - 1)/BITVEC_NPTR; rc = sqlite3BitvecSet(p, i); for(j=0; jnSet++; p->u.aHash[h] = i; return SQLITE_OK; } /* -** Clear the i-th bit. +** Clear the i-th bit. Return 0 on success and an error code if +** anything goes wrong. */ void sqlite3BitvecClear(Bitvec *p, u32 i){ assert( p!=0 ); assert( i>0 ); - i--; - while( p->iDivisor ){ - u32 bin = i/p->iDivisor; - i = i%p->iDivisor; - p = p->u.apSub[bin]; - if (!p) { - return; - } - } - if( p->iSize<=BITVEC_NBIT ){ - p->u.aBitmap[i/BITVEC_SZELEM] &= ~(1 << (i&(BITVEC_SZELEM-1))); - }else{ - unsigned int j; + if( p->iSize<=BITVEC_NBIT ){ + i--; + p->u.aBitmap[i/8] &= ~(1 << (i&7)); + }else if( p->iDivisor ){ + u32 bin = (i-1)/p->iDivisor; + i = (i-1)%p->iDivisor + 1; + if( p->u.apSub[bin] ){ + sqlite3BitvecClear(p->u.apSub[bin], i); + } + }else{ + int j; u32 aiValues[BITVEC_NINT]; memcpy(aiValues, p->u.aHash, sizeof(aiValues)); - memset(p->u.aHash, 0, sizeof(aiValues)); + memset(p->u.aHash, 0, sizeof(p->u.aHash[0])*BITVEC_NINT); p->nSet = 0; for(j=0; jnSet++; - while( p->u.aHash[h] ){ - h++; - if( h>=BITVEC_NINT ) h = 0; - } - p->u.aHash[h] = aiValues[j]; + if( aiValues[j] && aiValues[j]!=i ){ + sqlite3BitvecSet(p, aiValues[j]); } } } } @@ -265,26 +204,18 @@ ** Destroy a bitmap object. Reclaim all memory used. */ void sqlite3BitvecDestroy(Bitvec *p){ if( p==0 ) return; if( p->iDivisor ){ - unsigned int i; + int i; for(i=0; iu.apSub[i]); } } sqlite3_free(p); } -/* -** Return the value of the iSize parameter specified when Bitvec *p -** was created. -*/ -u32 sqlite3BitvecSize(Bitvec *p){ - return p->iSize; -} - #ifndef SQLITE_OMIT_BUILTIN_TEST /* ** Let V[] be an array of unsigned characters sufficient to hold ** up to N bits. Let I be an integer between 0 and N. 0<=IaBtree[i]!=pBtree ); } } #endif assert( pArray->nMutex>=0 ); - assert( pArray->nMutexaBtree)-1 ); + assert( pArray->nMutexaBtree)/sizeof(pArray->aBtree[0])-1 ); pBt = pBtree->pBt; for(i=0; inMutex; i++){ assert( pArray->aBtree[i]!=pBtree ); if( pArray->aBtree[i]->pBt>pBt ){ for(j=pArray->nMutex; j>i; j--){ Index: src/btree.c ================================================================== --- src/btree.c +++ src/btree.c @@ -7,11 +7,11 @@ ** 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. ** ************************************************************************* -** $Id: btree.c,v 1.565 2009/02/04 01:49:30 shane Exp $ +** $Id: btree.c,v 1.525 2008/10/08 17:58:49 danielk1977 Exp $ ** ** This file implements a external (disk-based) database using BTrees. ** See the header comment on "btreeInt.h" for additional information. ** Including a description of file format and an overview of operation. */ @@ -32,10 +32,24 @@ # define TRACE(X) if(sqlite3BtreeTrace){printf X;fflush(stdout);} #else # define TRACE(X) #endif +/* +** Sometimes we need a small amount of code such as a variable initialization +** to setup for a later assert() statement. We do not want this code to +** appear when assert() is disabled. The following macro is therefore +** used to contain that setup code. The "VVA" acronym stands for +** "Verification, Validation, and Accreditation". In other words, the +** code within VVA_ONLY() will only run during verification processes. +*/ +#ifndef NDEBUG +# define VVA_ONLY(X) X +#else +# define VVA_ONLY(X) +#endif + #ifndef SQLITE_OMIT_SHARED_CACHE /* ** A list of BtShared objects that are eligible for participation @@ -280,84 +294,10 @@ #else #define invalidateOverflowCache(x) #define invalidateAllOverflowCache(x) #endif -/* -** Set bit pgno of the BtShared.pHasContent bitvec. This is called -** when a page that previously contained data becomes a free-list leaf -** page. -** -** The BtShared.pHasContent bitvec exists to work around an obscure -** bug caused by the interaction of two useful IO optimizations surrounding -** free-list leaf pages: -** -** 1) When all data is deleted from a page and the page becomes -** a free-list leaf page, the page is not written to the database -** (as free-list leaf pages contain no meaningful data). Sometimes -** such a page is not even journalled (as it will not be modified, -** why bother journalling it?). -** -** 2) When a free-list leaf page is reused, its content is not read -** from the database or written to the journal file (why should it -** be, if it is not at all meaningful?). -** -** By themselves, these optimizations work fine and provide a handy -** performance boost to bulk delete or insert operations. However, if -** a page is moved to the free-list and then reused within the same -** transaction, a problem comes up. If the page is not journalled when -** it is moved to the free-list and it is also not journalled when it -** is extracted from the free-list and reused, then the original data -** may be lost. In the event of a rollback, it may not be possible -** to restore the database to its original configuration. -** -** The solution is the BtShared.pHasContent bitvec. Whenever a page is -** moved to become a free-list leaf page, the corresponding bit is -** set in the bitvec. Whenever a leaf page is extracted from the free-list, -** optimization 2 above is ommitted if the corresponding bit is already -** set in BtShared.pHasContent. The contents of the bitvec are cleared -** at the end of every transaction. -*/ -static int btreeSetHasContent(BtShared *pBt, Pgno pgno){ - int rc = SQLITE_OK; - if( !pBt->pHasContent ){ - int nPage; - rc = sqlite3PagerPagecount(pBt->pPager, &nPage); - if( rc==SQLITE_OK ){ - pBt->pHasContent = sqlite3BitvecCreate((u32)nPage); - if( !pBt->pHasContent ){ - rc = SQLITE_NOMEM; - } - } - } - if( rc==SQLITE_OK && pgno<=sqlite3BitvecSize(pBt->pHasContent) ){ - rc = sqlite3BitvecSet(pBt->pHasContent, pgno); - } - return rc; -} - -/* -** Query the BtShared.pHasContent vector. -** -** This function is called when a free-list leaf page is removed from the -** free-list for reuse. It returns false if it is safe to retrieve the -** page from the pager layer with the 'no-content' flag set. True otherwise. -*/ -static int btreeGetHasContent(BtShared *pBt, Pgno pgno){ - Bitvec *p = pBt->pHasContent; - return (p && (pgno>sqlite3BitvecSize(p) || sqlite3BitvecTest(p, pgno))); -} - -/* -** Clear (destroy) the BtShared.pHasContent bitvec. This should be -** invoked at the conclusion of each write-transaction. -*/ -static void btreeClearHasContent(BtShared *pBt){ - sqlite3BitvecDestroy(pBt->pHasContent); - pBt->pHasContent = 0; -} - /* ** Save the current cursor position in the variables BtCursor.nKey ** and BtCursor.pKey. The cursor's state is set to CURSOR_REQUIRESEEK. */ static int saveCursorPosition(BtCursor *pCur){ @@ -374,13 +314,13 @@ ** all that is required. Otherwise, if pCur is not open on an intKey ** table, then malloc space for and store the pCur->nKey bytes of key ** data. */ if( rc==SQLITE_OK && 0==pCur->apPage[0]->intKey){ - void *pKey = sqlite3Malloc( (int)pCur->nKey ); + void *pKey = sqlite3Malloc(pCur->nKey); if( pKey ){ - rc = sqlite3BtreeKey(pCur, 0, (int)pCur->nKey, pKey); + rc = sqlite3BtreeKey(pCur, 0, pCur->nKey, pKey); if( rc==SQLITE_OK ){ pCur->pKey = pKey; }else{ sqlite3_free(pKey); } @@ -464,11 +404,11 @@ sqlite3BtreeRestoreCursorPosition(p) : \ SQLITE_OK) /* ** Determine whether or not a cursor has moved from the position it -** was last placed at. Cursors can move when the row they are pointing +** was last placed at. Cursor can move when the row they are pointing ** at is deleted out from under them. ** ** This routine returns an error code if something goes wrong. The ** integer *pHasMoved is set to one if the cursor has moved and 0 if not. */ @@ -493,12 +433,11 @@ ** Given a page number of a regular database page, return the page ** number for the pointer-map page that contains the entry for the ** input page number. */ static Pgno ptrmapPageno(BtShared *pBt, Pgno pgno){ - int nPagesPerMapPage; - Pgno iPtrMap, ret; + int nPagesPerMapPage, iPtrMap, ret; assert( sqlite3_mutex_held(pBt->mutex) ); nPagesPerMapPage = (pBt->usableSize/5)+1; iPtrMap = (pgno-2)/nPagesPerMapPage; ret = (iPtrMap*nPagesPerMapPage) + 2; if( ret==PENDING_BYTE_PAGE(pBt) ){ @@ -633,11 +572,11 @@ void sqlite3BtreeParseCellPtr( MemPage *pPage, /* Page containing the cell */ u8 *pCell, /* Pointer to the cell text. */ CellInfo *pInfo /* Fill in this structure */ ){ - u16 n; /* Number bytes in cell content header */ + int n; /* Number bytes in cell content header */ u32 nPayload; /* Number of bytes of cell payload */ assert( sqlite3_mutex_held(pPage->pBt->mutex) ); pInfo->pCell = pCell; @@ -663,16 +602,16 @@ /* This is the (easy) common case where the entire payload fits ** on the local page. No overflow is required. */ int nSize; /* Total size of cell content in bytes */ nSize = nPayload + n; - pInfo->nLocal = (u16)nPayload; + pInfo->nLocal = nPayload; pInfo->iOverflow = 0; if( (nSize & ~3)==0 ){ nSize = 4; /* Minimum cell size is 4 */ } - pInfo->nSize = (u16)nSize; + pInfo->nSize = nSize; }else{ /* If the payload will not fit completely on the local page, we have ** to decide how much to store locally and how much to spill onto ** overflow pages. The strategy is to minimize the amount of unused ** space on overflow pages while keeping the amount of local storage @@ -687,15 +626,15 @@ minLocal = pPage->minLocal; maxLocal = pPage->maxLocal; surplus = minLocal + (nPayload - minLocal)%(pPage->pBt->usableSize - 4); if( surplus <= maxLocal ){ - pInfo->nLocal = (u16)surplus; + pInfo->nLocal = surplus; }else{ - pInfo->nLocal = (u16)minLocal; + pInfo->nLocal = minLocal; } - pInfo->iOverflow = (u16)(pInfo->nLocal + n); + pInfo->iOverflow = pInfo->nLocal + n; pInfo->nSize = pInfo->iOverflow + 4; } } #define parseCell(pPage, iCell, pInfo) \ sqlite3BtreeParseCellPtr((pPage), findCell((pPage), (iCell)), (pInfo)) @@ -761,11 +700,11 @@ ** Defragment the page given. All Cells are moved to the ** end of the page and all free space is collected into one ** big FreeBlk that occurs in between the header and cell ** pointer array and the cell content area. */ -static int defragmentPage(MemPage *pPage){ +static void defragmentPage(MemPage *pPage){ int i; /* Loop counter */ int pc; /* Address of a i-th cell */ int addr; /* Offset of first byte after cell pointer array */ int hdr; /* Offset to the page header */ int size; /* Size of a cell */ @@ -793,19 +732,13 @@ cbrk = usableSize; for(i=0; i=usableSize ){ - return SQLITE_CORRUPT_BKPT; - } + assert( pcpBt->usableSize ); size = cellSizePtr(pPage, &temp[pc]); cbrk -= size; - if( cbrkusableSize ){ - return SQLITE_CORRUPT_BKPT; - } - assert( cbrk+size<=usableSize && cbrk>=0 ); memcpy(&data[cbrk], &temp[pc], size); put2byte(pAddr, cbrk); } assert( cbrk>=cellOffset+2*nCell ); put2byte(&data[hdr+5], cbrk); @@ -812,15 +745,10 @@ data[hdr+1] = 0; data[hdr+2] = 0; data[hdr+7] = 0; addr = cellOffset+2*nCell; memset(&data[addr], 0, cbrk-addr); - assert( sqlite3PagerIswriteable(pPage->pDbPage) ); - if( cbrk-addr!=pPage->nFree ){ - return SQLITE_CORRUPT_BKPT; - } - return SQLITE_OK; } /* ** Allocate nByte bytes of space on a page. ** @@ -847,11 +775,11 @@ assert( pPage->pBt ); assert( sqlite3_mutex_held(pPage->pBt->mutex) ); assert( nByte>=0 ); /* Minimum cell size is 4 */ assert( pPage->nFree>=nByte ); assert( pPage->nOverflow==0 ); - pPage->nFree -= (u16)nByte; + pPage->nFree -= nByte; hdr = pPage->hdrOffset; nFrag = data[hdr+7]; if( nFrag<60 ){ /* Search the freelist looking for a slot big enough to satisfy the @@ -858,18 +786,17 @@ ** space request. */ addr = hdr+1; while( (pc = get2byte(&data[addr]))>0 ){ size = get2byte(&data[pc+2]); if( size>=nByte ){ - int x = size - nByte; if( sizepDbPage) ); return top; } /* ** Return a section of the pPage->aData to the freelist. @@ -897,11 +823,11 @@ ** and the size of the block is "size" bytes. ** ** Most of the effort here is involved in coalesing adjacent ** free blocks into a single big free block. */ -static int freeSpace(MemPage *pPage, int start, int size){ +static void freeSpace(MemPage *pPage, int start, int size){ int addr, pbegin, hdr; unsigned char *data = pPage->aData; assert( pPage->pBt!=0 ); assert( sqlite3PagerIswriteable(pPage->pDbPage) ); @@ -919,42 +845,34 @@ /* Add the space back into the linked list of freeblocks */ hdr = pPage->hdrOffset; addr = hdr + 1; while( (pbegin = get2byte(&data[addr]))0 ){ assert( pbegin<=pPage->pBt->usableSize-4 ); - if( pbegin<=addr ) { - return SQLITE_CORRUPT_BKPT; - } + assert( pbegin>addr ); addr = pbegin; } - if ( pbegin>pPage->pBt->usableSize-4 ) { - return SQLITE_CORRUPT_BKPT; - } + assert( pbegin<=pPage->pBt->usableSize-4 ); assert( pbegin>addr || pbegin==0 ); put2byte(&data[addr], start); put2byte(&data[start], pbegin); put2byte(&data[start+2], size); - pPage->nFree += (u16)size; + pPage->nFree += size; /* Coalesce adjacent free blocks */ addr = pPage->hdrOffset + 1; while( (pbegin = get2byte(&data[addr]))>0 ){ - int pnext, psize, x; + int pnext, psize; assert( pbegin>addr ); assert( pbegin<=pPage->pBt->usableSize-4 ); pnext = get2byte(&data[pbegin]); psize = get2byte(&data[pbegin+2]); if( pbegin + psize + 3 >= pnext && pnext>0 ){ int frag = pnext - (pbegin+psize); - if( (frag<0) || (frag>(int)data[pPage->hdrOffset+7]) ){ - return SQLITE_CORRUPT_BKPT; - } - data[pPage->hdrOffset+7] -= (u8)frag; - x = get2byte(&data[pnext]); - put2byte(&data[pbegin], x); - x = pnext + get2byte(&data[pnext+2]) - pbegin; - put2byte(&data[pbegin+2], x); + assert( frag<=data[pPage->hdrOffset+7] ); + data[pPage->hdrOffset+7] -= frag; + put2byte(&data[pbegin], get2byte(&data[pnext])); + put2byte(&data[pbegin+2], pnext+get2byte(&data[pnext+2])-pbegin); }else{ addr = pbegin; } } @@ -961,15 +879,13 @@ /* If the cell content area begins with a freeblock, remove it. */ if( data[hdr+1]==data[hdr+5] && data[hdr+2]==data[hdr+6] ){ int top; pbegin = get2byte(&data[hdr+1]); memcpy(&data[hdr+1], &data[pbegin], 2); - top = get2byte(&data[hdr+5]) + get2byte(&data[pbegin+2]); - put2byte(&data[hdr+5], top); + top = get2byte(&data[hdr+5]); + put2byte(&data[hdr+5], top + get2byte(&data[pbegin+2])); } - assert( sqlite3PagerIswriteable(pPage->pDbPage) ); - return SQLITE_OK; } /* ** Decode the flags byte (the first byte of the header) for a page ** and initialize fields of the MemPage structure accordingly. @@ -985,11 +901,11 @@ static int decodeFlags(MemPage *pPage, int flagByte){ BtShared *pBt; /* A copy of pPage->pBt */ assert( pPage->hdrOffset==(pPage->pgno==1 ? 100 : 0) ); assert( sqlite3_mutex_held(pPage->pBt->mutex) ); - pPage->leaf = (u8)(flagByte>>3); assert( PTF_LEAF == 1<<3 ); + pPage->leaf = flagByte>>3; assert( PTF_LEAF == 1<<3 ); flagByte &= ~PTF_LEAF; pPage->childPtrSize = 4-4*pPage->leaf; pBt = pPage->pBt; if( flagByte==(PTF_LEAFDATA | PTF_INTKEY) ){ pPage->intKey = 1; @@ -1023,18 +939,18 @@ assert( pPage->pgno==sqlite3PagerPagenumber(pPage->pDbPage) ); assert( pPage == sqlite3PagerGetExtra(pPage->pDbPage) ); assert( pPage->aData == sqlite3PagerGetData(pPage->pDbPage) ); if( !pPage->isInit ){ - u16 pc; /* Address of a freeblock within pPage->aData[] */ - u8 hdr; /* Offset to beginning of page header */ + int pc; /* Address of a freeblock within pPage->aData[] */ + int hdr; /* Offset to beginning of page header */ u8 *data; /* Equal to pPage->aData */ BtShared *pBt; /* The main btree structure */ - u16 usableSize; /* Amount of usable space on each page */ - u16 cellOffset; /* Offset from start of page to first cell pointer */ - u16 nFree; /* Number of unused bytes on the page */ - u16 top; /* First byte of the cell content area */ + int usableSize; /* Amount of usable space on each page */ + int cellOffset; /* Offset from start of page to first cell pointer */ + int nFree; /* Number of unused bytes on the page */ + int top; /* First byte of the cell content area */ pBt = pPage->pBt; hdr = pPage->hdrOffset; data = pPage->aData; @@ -1053,11 +969,11 @@ /* Compute the total free space on the page */ pc = get2byte(&data[hdr+1]); nFree = data[hdr+7] + top - (cellOffset + 2*pPage->nCell); while( pc>0 ){ - u16 next, size; + int next, size; if( pc>usableSize-4 ){ /* Free block is off the page */ return SQLITE_CORRUPT_BKPT; } next = get2byte(&data[pc]); @@ -1067,11 +983,11 @@ return SQLITE_CORRUPT_BKPT; } nFree += size; pc = next; } - pPage->nFree = (u16)nFree; + pPage->nFree = nFree; if( nFree>=usableSize ){ /* Free space cannot exceed total page size */ return SQLITE_CORRUPT_BKPT; } @@ -1105,21 +1021,21 @@ ** no entries. */ static void zeroPage(MemPage *pPage, int flags){ unsigned char *data = pPage->aData; BtShared *pBt = pPage->pBt; - u8 hdr = pPage->hdrOffset; - u16 first; + int hdr = pPage->hdrOffset; + int first; assert( sqlite3PagerPagenumber(pPage->pDbPage)==pPage->pgno ); assert( sqlite3PagerGetExtra(pPage->pDbPage) == (void*)pPage ); assert( sqlite3PagerGetData(pPage->pDbPage) == data ); assert( sqlite3PagerIswriteable(pPage->pDbPage) ); assert( sqlite3_mutex_held(pBt->mutex) ); /*memset(&data[hdr], 0, pBt->usableSize - hdr);*/ - data[hdr] = (char)flags; - first = hdr + 8 + 4*((flags&PTF_LEAF)==0 ?1:0); + data[hdr] = flags; + first = hdr + 8 + 4*((flags&PTF_LEAF)==0); memset(&data[hdr+1], 0, 4); data[hdr+7] = 0; put2byte(&data[hdr+5], pBt->usableSize); pPage->nFree = pBt->usableSize - first; decodeFlags(pPage, flags); @@ -1173,35 +1089,18 @@ *ppPage = btreePageFromDbPage(pDbPage, pgno, pBt); return SQLITE_OK; } /* -** Retrieve a page from the pager cache. If the requested page is not -** already in the pager cache return NULL. Initialize the MemPage.pBt and -** MemPage.aData elements if needed. -*/ -static MemPage *btreePageLookup(BtShared *pBt, Pgno pgno){ - DbPage *pDbPage; - assert( sqlite3_mutex_held(pBt->mutex) ); - pDbPage = sqlite3PagerLookup(pBt->pPager, pgno); - if( pDbPage ){ - return btreePageFromDbPage(pDbPage, pgno, pBt); - } - return 0; -} - -/* -** Return the size of the database file in pages. If there is any kind of -** error, return ((unsigned int)-1). -*/ -static Pgno pagerPagecount(BtShared *pBt){ - int nPage = -1; +** Return the size of the database file in pages. Or return -1 if +** there is any kind of error. +*/ +static int pagerPagecount(Pager *pPager){ int rc; - assert( pBt->pPage1 ); - rc = sqlite3PagerPagecount(pBt->pPager, &nPage); - assert( rc==SQLITE_OK || nPage==-1 ); - return (Pgno)nPage; + int nPage; + rc = sqlite3PagerPagecount(pPager, &nPage); + return (rc==SQLITE_OK?nPage:-1); } /* ** Get a page from the pager and initialize it. This routine ** is just a convenience wrapper around separate calls to @@ -1211,10 +1110,11 @@ BtShared *pBt, /* The database file */ Pgno pgno, /* Number of the page to get */ MemPage **ppPage /* Write the page pointer here */ ){ int rc; + DbPage *pDbPage; MemPage *pPage; assert( sqlite3_mutex_held(pBt->mutex) ); if( pgno==0 ){ return SQLITE_CORRUPT_BKPT; @@ -1223,17 +1123,18 @@ /* It is often the case that the page we want is already in cache. ** If so, get it directly. This saves us from having to call ** pagerPagecount() to make sure pgno is within limits, which results ** in a measureable performance improvements. */ - *ppPage = pPage = btreePageLookup(pBt, pgno); - if( pPage ){ + pDbPage = sqlite3PagerLookup(pBt->pPager, pgno); + if( pDbPage ){ /* Page is already in cache */ + *ppPage = pPage = btreePageFromDbPage(pDbPage, pgno, pBt); rc = SQLITE_OK; }else{ /* Page not in cache. Acquire it. */ - if( pgno>pagerPagecount(pBt) ){ + if( pgno>pagerPagecount(pBt->pPager) ){ return SQLITE_CORRUPT_BKPT; } rc = sqlite3BtreeGetPage(pBt, pgno, ppPage, 0); if( rc ) return rc; pPage = *ppPage; @@ -1252,11 +1153,10 @@ ** Release a MemPage. This should be called once for each prior ** call to sqlite3BtreeGetPage. */ static void releasePage(MemPage *pPage){ if( pPage ){ - assert( pPage->nOverflow==0 || sqlite3PagerPageRefcount(pPage->pDbPage)>1 ); assert( pPage->aData ); assert( pPage->pBt ); assert( sqlite3PagerGetExtra(pPage->pDbPage) == (void*)pPage ); assert( sqlite3PagerGetData(pPage->pDbPage)==pPage->aData ); assert( sqlite3_mutex_held(pPage->pBt->mutex) ); @@ -1285,11 +1185,11 @@ } /* ** Invoke the busy handler for a btree. */ -static int btreeInvokeBusyHandler(void *pArg){ +static int sqlite3BtreeInvokeBusyHandler(void *pArg, int n){ BtShared *pBt = (BtShared*)pArg; assert( pBt->db ); assert( sqlite3_mutex_held(pBt->db->mutex) ); return sqlite3InvokeBusyHandler(&pBt->db->busyHandler); } @@ -1312,11 +1212,11 @@ ){ sqlite3_vfs *pVfs; /* The VFS to use for this btree */ BtShared *pBt = 0; /* Shared part of btree structure */ Btree *p; /* Handle to return */ int rc = SQLITE_OK; - u8 nReserve; + int nReserve; unsigned char zDbHeader[100]; /* Set the variable isMemdb to true for an in-memory database, or ** false for a file-based database. This symbol is only required if ** either of the shared-data or autovacuum features are compiled @@ -1402,19 +1302,21 @@ pBt = sqlite3MallocZero( sizeof(*pBt) ); if( pBt==0 ){ rc = SQLITE_NOMEM; goto btree_open_out; } + pBt->busyHdr.xFunc = sqlite3BtreeInvokeBusyHandler; + pBt->busyHdr.pArg = pBt; rc = sqlite3PagerOpen(pVfs, &pBt->pPager, zFilename, EXTRA_SIZE, flags, vfsFlags); if( rc==SQLITE_OK ){ rc = sqlite3PagerReadFileheader(pBt->pPager,sizeof(zDbHeader),zDbHeader); } if( rc!=SQLITE_OK ){ goto btree_open_out; } - sqlite3PagerSetBusyhandler(pBt->pPager, btreeInvokeBusyHandler, pBt); + sqlite3PagerSetBusyhandler(pBt->pPager, &pBt->busyHdr); p->pBt = pBt; sqlite3PagerSetReiniter(pBt->pPager, pageReinit); pBt->pCursor = 0; pBt->pPage1 = 0; @@ -1709,29 +1611,27 @@ ** bytes per page is left unchanged. */ int sqlite3BtreeSetPageSize(Btree *p, int pageSize, int nReserve){ int rc = SQLITE_OK; BtShared *pBt = p->pBt; - assert( nReserve>=-1 && nReserve<=255 ); sqlite3BtreeEnter(p); if( pBt->pageSizeFixed ){ sqlite3BtreeLeave(p); return SQLITE_READONLY; } if( nReserve<0 ){ nReserve = pBt->pageSize - pBt->usableSize; } - assert( nReserve>=0 && nReserve<=255 ); if( pageSize>=512 && pageSize<=SQLITE_MAX_PAGE_SIZE && ((pageSize-1)&pageSize)==0 ){ assert( (pageSize & 7)==0 ); assert( !pBt->pPage1 && !pBt->pCursor ); - pBt->pageSize = (u16)pageSize; + pBt->pageSize = pageSize; freeTempSpace(pBt); rc = sqlite3PagerSetPagesize(pBt->pPager, &pBt->pageSize); } - pBt->usableSize = pBt->pageSize - (u16)nReserve; + pBt->usableSize = pBt->pageSize - nReserve; sqlite3BtreeLeave(p); return rc; } /* @@ -1772,11 +1672,11 @@ #ifdef SQLITE_OMIT_AUTOVACUUM return SQLITE_READONLY; #else BtShared *pBt = p->pBt; int rc = SQLITE_OK; - u8 av = autoVacuum ?1:0; + int av = (autoVacuum?1:0); sqlite3BtreeEnter(p); if( pBt->pageSizeFixed && av!=pBt->autoVacuum ){ rc = SQLITE_READONLY; }else{ @@ -1870,21 +1770,21 @@ ** actually pageSize. Unlock the database, leave pBt->pPage1 at ** zero and return SQLITE_OK. The caller will call this function ** again with the correct page-size. */ releasePage(pPage1); - pBt->usableSize = (u16)usableSize; - pBt->pageSize = (u16)pageSize; + pBt->usableSize = usableSize; + pBt->pageSize = pageSize; freeTempSpace(pBt); sqlite3PagerSetPagesize(pBt->pPager, &pBt->pageSize); return SQLITE_OK; } if( usableSize<500 ){ goto page1_init_failed; } - pBt->pageSize = (u16)pageSize; - pBt->usableSize = (u16)usableSize; + pBt->pageSize = pageSize; + pBt->usableSize = usableSize; #ifndef SQLITE_OMIT_AUTOVACUUM pBt->autoVacuum = (get4byte(&page1[36 + 4*4])?1:0); pBt->incrVacuum = (get4byte(&page1[36 + 7*4])?1:0); #endif } @@ -1992,12 +1892,11 @@ memcpy(data, zMagicHeader, sizeof(zMagicHeader)); assert( sizeof(zMagicHeader)==16 ); put2byte(&data[16], pBt->pageSize); data[18] = 1; data[19] = 1; - assert( pBt->usableSize<=pBt->pageSize && pBt->usableSize+255>=pBt->pageSize); - data[20] = (u8)(pBt->pageSize - pBt->usableSize); + data[20] = pBt->pageSize - pBt->usableSize; data[21] = 64; data[22] = 32; data[23] = 32; memset(&data[24], 0, 100-24); zeroPage(pP1, PTF_INTKEY|PTF_LEAF|PTF_LEAFDATA ); @@ -2098,11 +1997,11 @@ if( rc==SQLITE_OK && wrflag ){ if( pBt->readOnly ){ rc = SQLITE_READONLY; }else{ - rc = sqlite3PagerBegin(pBt->pPager, wrflag>1); + rc = sqlite3PagerBegin(pBt->pPage1->pDbPage, wrflag>1); if( rc==SQLITE_OK ){ rc = newDatabase(pBt); } } } @@ -2111,11 +2010,11 @@ if( wrflag ) pBt->inStmt = 0; }else{ unlockBtreeIfUnused(pBt); } }while( rc==SQLITE_BUSY && pBt->inTransaction==TRANS_NONE && - btreeInvokeBusyHandler(pBt) ); + sqlite3BtreeInvokeBusyHandler(pBt, 0) ); if( rc==SQLITE_OK ){ if( p->inTrans==TRANS_NONE ){ pBt->nTransaction++; } @@ -2131,22 +2030,15 @@ #endif } trans_begun: - if( rc==SQLITE_OK && wrflag ){ - /* This call makes sure that the pager has the correct number of - ** open savepoints. If the second parameter is greater than 0 and - ** the sub-journal is not already open, then it will be opened here. - */ - rc = sqlite3PagerOpenSavepoint(pBt->pPager, p->db->nSavepoint); - } - btreeIntegrity(p); sqlite3BtreeLeave(p); return rc; } + #ifndef SQLITE_OMIT_AUTOVACUUM /* ** Set the pointer-map entries for all children of page pPage. Also, if @@ -2156,11 +2048,11 @@ static int setChildPtrmaps(MemPage *pPage){ int i; /* Counter variable */ int nCell; /* Number of cells in page pPage */ int rc; /* Return code */ BtShared *pBt = pPage->pBt; - u8 isInitOrig = pPage->isInit; + int isInitOrig = pPage->isInit; Pgno pgno = pPage->pgno; assert( sqlite3_mutex_held(pPage->pBt->mutex) ); rc = sqlite3BtreeInitPage(pPage); if( rc!=SQLITE_OK ){ @@ -2208,19 +2100,18 @@ ** PTRMAP_OVERFLOW2: pPage is an overflow-page. The pointer points at the next ** overflow page in the list. */ static int modifyPagePointer(MemPage *pPage, Pgno iFrom, Pgno iTo, u8 eType){ assert( sqlite3_mutex_held(pPage->pBt->mutex) ); - assert( sqlite3PagerIswriteable(pPage->pDbPage) ); if( eType==PTRMAP_OVERFLOW2 ){ /* The pointer is always the first 4 bytes of the page in this case. */ if( get4byte(pPage->aData)!=iFrom ){ return SQLITE_CORRUPT_BKPT; } put4byte(pPage->aData, iTo); }else{ - u8 isInitOrig = pPage->isInit; + int isInitOrig = pPage->isInit; int i; int nCell; sqlite3BtreeInitPage(pPage); nCell = pPage->nCell; @@ -2351,14 +2242,19 @@ ** that the caller will keep calling incrVacuumStep() until ** it returns SQLITE_DONE or an error, and that nFin is the ** number of pages the database file will contain after this ** process is complete. */ -static int incrVacuumStep(BtShared *pBt, Pgno nFin, Pgno iLastPg){ +static int incrVacuumStep(BtShared *pBt, Pgno nFin){ + Pgno iLastPg; /* Last page in the database */ Pgno nFreeList; /* Number of pages still on the free-list */ assert( sqlite3_mutex_held(pBt->mutex) ); + iLastPg = pBt->nTrunc; + if( iLastPg==0 ){ + iLastPg = pagerPagecount(pBt->pPager); + } if( !PTRMAP_ISPAGE(pBt, iLastPg) && iLastPg!=PENDING_BYTE_PAGE(pBt) ){ int rc; u8 eType; Pgno iPtrPage; @@ -2428,16 +2324,13 @@ return rc; } } } - if( nFin==0 ){ - iLastPg--; - while( iLastPg==PENDING_BYTE_PAGE(pBt)||PTRMAP_ISPAGE(pBt, iLastPg) ){ - iLastPg--; - } - sqlite3PagerTruncateImage(pBt->pPager, iLastPg); + pBt->nTrunc = iLastPg - 1; + while( pBt->nTrunc==PENDING_BYTE_PAGE(pBt)||PTRMAP_ISPAGE(pBt, pBt->nTrunc) ){ + pBt->nTrunc--; } return SQLITE_OK; } /* @@ -2457,11 +2350,11 @@ assert( pBt->inTransaction==TRANS_WRITE && p->inTrans==TRANS_WRITE ); if( !pBt->autoVacuum ){ rc = SQLITE_DONE; }else{ invalidateAllOverflowCache(pBt); - rc = incrVacuumStep(pBt, 0, pagerPagecount(pBt)); + rc = incrVacuumStep(pBt, 0); } sqlite3BtreeLeave(p); return rc; } @@ -2472,62 +2365,71 @@ ** If SQLITE_OK is returned, then *pnTrunc is set to the number of pages ** the database file should be truncated to during the commit process. ** i.e. the database has been reorganized so that only the first *pnTrunc ** pages are in use. */ -static int autoVacuumCommit(BtShared *pBt){ +static int autoVacuumCommit(BtShared *pBt, Pgno *pnTrunc){ int rc = SQLITE_OK; Pager *pPager = pBt->pPager; VVA_ONLY( int nRef = sqlite3PagerRefcount(pPager) ); assert( sqlite3_mutex_held(pBt->mutex) ); invalidateAllOverflowCache(pBt); assert(pBt->autoVacuum); if( !pBt->incrVacuum ){ - Pgno nFin; - Pgno nFree; - Pgno nPtrmap; - Pgno iFree; - const int pgsz = pBt->pageSize; - Pgno nOrig = pagerPagecount(pBt); - - if( PTRMAP_ISPAGE(pBt, nOrig) ){ - return SQLITE_CORRUPT_BKPT; - } - if( nOrig==PENDING_BYTE_PAGE(pBt) ){ - nOrig--; - } - nFree = get4byte(&pBt->pPage1->aData[36]); - nPtrmap = (nFree-nOrig+PTRMAP_PAGENO(pBt, nOrig)+pgsz/5)/(pgsz/5); - nFin = nOrig - nFree - nPtrmap; - if( nOrig>PENDING_BYTE_PAGE(pBt) && nFin<=PENDING_BYTE_PAGE(pBt) ){ - nFin--; - } - while( PTRMAP_ISPAGE(pBt, nFin) || nFin==PENDING_BYTE_PAGE(pBt) ){ - nFin--; - } - - for(iFree=nOrig; iFree>nFin && rc==SQLITE_OK; iFree--){ - rc = incrVacuumStep(pBt, nFin, iFree); - } - if( (rc==SQLITE_DONE || rc==SQLITE_OK) && nFree>0 ){ + Pgno nFin = 0; + + if( pBt->nTrunc==0 ){ + Pgno nFree; + Pgno nPtrmap; + const int pgsz = pBt->pageSize; + int nOrig = pagerPagecount(pBt->pPager); + + if( PTRMAP_ISPAGE(pBt, nOrig) ){ + return SQLITE_CORRUPT_BKPT; + } + if( nOrig==PENDING_BYTE_PAGE(pBt) ){ + nOrig--; + } + nFree = get4byte(&pBt->pPage1->aData[36]); + nPtrmap = (nFree-nOrig+PTRMAP_PAGENO(pBt, nOrig)+pgsz/5)/(pgsz/5); + nFin = nOrig - nFree - nPtrmap; + if( nOrig>PENDING_BYTE_PAGE(pBt) && nFin<=PENDING_BYTE_PAGE(pBt) ){ + nFin--; + } + while( PTRMAP_ISPAGE(pBt, nFin) || nFin==PENDING_BYTE_PAGE(pBt) ){ + nFin--; + } + } + + while( rc==SQLITE_OK ){ + rc = incrVacuumStep(pBt, nFin); + } + if( rc==SQLITE_DONE ){ + assert(nFin==0 || pBt->nTrunc==0 || nFin<=pBt->nTrunc); rc = SQLITE_OK; - rc = sqlite3PagerWrite(pBt->pPage1->pDbPage); - put4byte(&pBt->pPage1->aData[32], 0); - put4byte(&pBt->pPage1->aData[36], 0); - sqlite3PagerTruncateImage(pBt->pPager, nFin); + if( pBt->nTrunc && nFin ){ + rc = sqlite3PagerWrite(pBt->pPage1->pDbPage); + put4byte(&pBt->pPage1->aData[32], 0); + put4byte(&pBt->pPage1->aData[36], 0); + pBt->nTrunc = nFin; + } } if( rc!=SQLITE_OK ){ sqlite3PagerRollback(pPager); } } + if( rc==SQLITE_OK ){ + *pnTrunc = pBt->nTrunc; + pBt->nTrunc = 0; + } assert( nRef==sqlite3PagerRefcount(pPager) ); return rc; } -#endif /* ifndef SQLITE_OMIT_AUTOVACUUM */ +#endif /* ** This routine does the first phase of a two-phase commit. This routine ** causes a rollback journal to be created (if it does not already exist) ** and populated with enough information so that if a power loss occurs @@ -2555,22 +2457,23 @@ */ int sqlite3BtreeCommitPhaseOne(Btree *p, const char *zMaster){ int rc = SQLITE_OK; if( p->inTrans==TRANS_WRITE ){ BtShared *pBt = p->pBt; + Pgno nTrunc = 0; sqlite3BtreeEnter(p); pBt->db = p->db; #ifndef SQLITE_OMIT_AUTOVACUUM if( pBt->autoVacuum ){ - rc = autoVacuumCommit(pBt); + rc = autoVacuumCommit(pBt, &nTrunc); if( rc!=SQLITE_OK ){ sqlite3BtreeLeave(p); return rc; } } #endif - rc = sqlite3PagerCommitPhaseOne(pBt->pPager, zMaster, 0); + rc = sqlite3PagerCommitPhaseOne(pBt->pPager, zMaster, nTrunc, 0); sqlite3BtreeLeave(p); } return rc; } @@ -2625,11 +2528,10 @@ } /* Set the handles current transaction state to TRANS_NONE and unlock ** the pager if this call closed the only read or write transaction. */ - btreeClearHasContent(pBt); p->inTrans = TRANS_NONE; unlockBtreeIfUnused(pBt); btreeIntegrity(p); sqlite3BtreeLeave(p); @@ -2690,18 +2592,13 @@ */ void sqlite3BtreeTripAllCursors(Btree *pBtree, int errCode){ BtCursor *p; sqlite3BtreeEnter(pBtree); for(p=pBtree->pBt->pCursor; p; p=p->pNext){ - int i; sqlite3BtreeClearCursor(p); p->eState = CURSOR_FAULT; p->skip = errCode; - for(i=0; i<=p->iPage; i++){ - releasePage(p->apPage[i]); - p->apPage[i] = 0; - } } sqlite3BtreeLeave(pBtree); } /* @@ -2736,10 +2633,14 @@ btreeIntegrity(p); unlockAllTables(p); if( p->inTrans==TRANS_WRITE ){ int rc2; + +#ifndef SQLITE_OMIT_AUTOVACUUM + pBt->nTrunc = 0; +#endif assert( TRANS_WRITE==pBt->inTransaction ); rc2 = sqlite3PagerRollback(pBt->pPager); if( rc2!=SQLITE_OK ){ rc = rc2; @@ -2761,11 +2662,10 @@ if( 0==pBt->nTransaction ){ pBt->inTransaction = TRANS_NONE; } } - btreeClearHasContent(pBt); p->inTrans = TRANS_NONE; pBt->inStmt = 0; unlockBtreeIfUnused(pBt); btreeIntegrity(p); @@ -2791,28 +2691,21 @@ int sqlite3BtreeBeginStmt(Btree *p){ int rc; BtShared *pBt = p->pBt; sqlite3BtreeEnter(p); pBt->db = p->db; - assert( p->inTrans==TRANS_WRITE ); - assert( !pBt->inStmt ); - assert( pBt->readOnly==0 ); - if( NEVER(p->inTrans!=TRANS_WRITE || pBt->inStmt || pBt->readOnly) ){ - rc = SQLITE_INTERNAL; + if( (p->inTrans!=TRANS_WRITE) || pBt->inStmt ){ + rc = pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR; }else{ assert( pBt->inTransaction==TRANS_WRITE ); - /* At the pager level, a statement transaction is a savepoint with - ** an index greater than all savepoints created explicitly using - ** SQL statements. It is illegal to open, release or rollback any - ** such savepoints while the statement transaction savepoint is active. - */ - rc = sqlite3PagerOpenSavepoint(pBt->pPager, p->db->nSavepoint+1); + rc = pBt->readOnly ? SQLITE_OK : sqlite3PagerStmtBegin(pBt->pPager); pBt->inStmt = 1; } sqlite3BtreeLeave(p); return rc; } + /* ** Commit the statment subtransaction currently in progress. If no ** subtransaction is active, this is a no-op. */ @@ -2819,14 +2712,12 @@ int sqlite3BtreeCommitStmt(Btree *p){ int rc; BtShared *pBt = p->pBt; sqlite3BtreeEnter(p); pBt->db = p->db; - assert( pBt->readOnly==0 ); - if( pBt->inStmt ){ - int iStmtpoint = p->db->nSavepoint; - rc = sqlite3PagerSavepoint(pBt->pPager, SAVEPOINT_RELEASE, iStmtpoint); + if( pBt->inStmt && !pBt->readOnly ){ + rc = sqlite3PagerStmtCommit(pBt->pPager); }else{ rc = SQLITE_OK; } pBt->inStmt = 0; sqlite3BtreeLeave(p); @@ -2844,50 +2735,15 @@ int sqlite3BtreeRollbackStmt(Btree *p){ int rc = SQLITE_OK; BtShared *pBt = p->pBt; sqlite3BtreeEnter(p); pBt->db = p->db; - assert( pBt->readOnly==0 ); - if( pBt->inStmt ){ - int iStmtpoint = p->db->nSavepoint; - rc = sqlite3PagerSavepoint(pBt->pPager, SAVEPOINT_ROLLBACK, iStmtpoint); - if( rc==SQLITE_OK ){ - rc = sqlite3PagerSavepoint(pBt->pPager, SAVEPOINT_RELEASE, iStmtpoint); - } + if( pBt->inStmt && !pBt->readOnly ){ + rc = sqlite3PagerStmtRollback(pBt->pPager); pBt->inStmt = 0; } sqlite3BtreeLeave(p); - return rc; -} - -/* -** The second argument to this function, op, is always SAVEPOINT_ROLLBACK -** or SAVEPOINT_RELEASE. This function either releases or rolls back the -** savepoint identified by parameter iSavepoint, depending on the value -** of op. -** -** Normally, iSavepoint is greater than or equal to zero. However, if op is -** SAVEPOINT_ROLLBACK, then iSavepoint may also be -1. In this case the -** contents of the entire transaction are rolled back. This is different -** from a normal transaction rollback, as no locks are released and the -** transaction remains open. -*/ -int sqlite3BtreeSavepoint(Btree *p, int op, int iSavepoint){ - int rc = SQLITE_OK; - if( p && p->inTrans==TRANS_WRITE ){ - BtShared *pBt = p->pBt; - assert( pBt->inStmt==0 ); - assert( op==SAVEPOINT_RELEASE || op==SAVEPOINT_ROLLBACK ); - assert( iSavepoint>=0 || (iSavepoint==-1 && op==SAVEPOINT_ROLLBACK) ); - sqlite3BtreeEnter(p); - pBt->db = p->db; - rc = sqlite3PagerSavepoint(pBt->pPager, op, iSavepoint); - if( rc==SQLITE_OK ){ - rc = newDatabase(pBt); - } - sqlite3BtreeLeave(p); - } return rc; } /* ** Create a new cursor for the BTree whose root is on the page @@ -2925,18 +2781,15 @@ int wrFlag, /* 1 to write. 0 read-only */ struct KeyInfo *pKeyInfo, /* First arg to comparison function */ BtCursor *pCur /* Space for new cursor */ ){ int rc; - Pgno nPage; BtShared *pBt = p->pBt; assert( sqlite3BtreeHoldsMutex(p) ); - assert( wrFlag==0 || wrFlag==1 ); if( wrFlag ){ - assert( !pBt->readOnly ); - if( NEVER(pBt->readOnly) ){ + if( pBt->readOnly ){ return SQLITE_READONLY; } if( checkReadLocks(p, iTable, 0, 0) ){ return SQLITE_LOCKED; } @@ -2945,17 +2798,16 @@ if( pBt->pPage1==0 ){ rc = lockBtreeWithRetry(p); if( rc!=SQLITE_OK ){ return rc; } + if( pBt->readOnly && wrFlag ){ + return SQLITE_READONLY; + } } pCur->pgnoRoot = (Pgno)iTable; - rc = sqlite3PagerPagecount(pBt->pPager, (int *)&nPage); - if( rc!=SQLITE_OK ){ - return rc; - } - if( iTable==1 && nPage==0 ){ + if( iTable==1 && pagerPagecount(pBt->pPager)==0 ){ rc = SQLITE_EMPTY; goto create_cursor_exception; } rc = getAndInitPage(pBt, pCur->pgnoRoot, &pCur->apPage[0]); if( rc!=SQLITE_OK ){ @@ -2967,11 +2819,11 @@ ** output argument to this function). */ pCur->pKeyInfo = pKeyInfo; pCur->pBtree = p; pCur->pBt = pBt; - pCur->wrFlag = (u8)wrFlag; + pCur->wrFlag = wrFlag; pCur->pNext = pBt->pCursor; if( pCur->pNext ){ pCur->pNext->pPrev = pCur; } pBt->pCursor = pCur; @@ -3046,11 +2898,10 @@ pTempCur->pNext = 0; pTempCur->pPrev = 0; for(i=0; i<=pTempCur->iPage; i++){ sqlite3PagerRef(pTempCur->apPage[i]->pDbPage); } - assert( pTempCur->pKey==0 ); } /* ** Delete a temporary cursor such as was made by the CreateTemporaryCursor() ** function above. @@ -3059,11 +2910,10 @@ int i; assert( cursorHoldsMutex(pCur) ); for(i=0; i<=pCur->iPage; i++){ sqlite3PagerUnref(pCur->apPage[i]->pDbPage); } - sqlite3_free(pCur->pKey); } /* ** Make sure the BtCursor* given in the argument has a valid ** BtCursor.info structure. If it is not already valid, call @@ -3169,33 +3019,38 @@ ** linked list of overflow pages. If possible, it uses the auto-vacuum ** pointer-map data instead of reading the content of page ovfl to do so. ** ** If an error occurs an SQLite error code is returned. Otherwise: ** -** The page number of the next overflow page in the linked list is -** written to *pPgnoNext. If page ovfl is the last page in its linked -** list, *pPgnoNext is set to zero. +** Unless pPgnoNext is NULL, the page number of the next overflow +** page in the linked list is written to *pPgnoNext. If page ovfl +** is the last page in its linked list, *pPgnoNext is set to zero. ** -** If ppPage is not NULL, and a reference to the MemPage object corresponding -** to page number pOvfl was obtained, then *ppPage is set to point to that -** reference. It is the responsibility of the caller to call releasePage() -** on *ppPage to free the reference. In no reference was obtained (because -** the pointer-map was used to obtain the value for *pPgnoNext), then -** *ppPage is set to zero. +** If ppPage is not NULL, *ppPage is set to the MemPage* handle +** for page ovfl. The underlying pager page may have been requested +** with the noContent flag set, so the page data accessable via +** this handle may not be trusted. */ static int getOverflowPage( BtShared *pBt, Pgno ovfl, /* Overflow page */ - MemPage **ppPage, /* OUT: MemPage handle (may be NULL) */ + MemPage **ppPage, /* OUT: MemPage handle */ Pgno *pPgnoNext /* OUT: Next overflow page number */ ){ Pgno next = 0; - MemPage *pPage = 0; - int rc = SQLITE_OK; + int rc; assert( sqlite3_mutex_held(pBt->mutex) ); - assert(pPgnoNext); + /* One of these must not be NULL. Otherwise, why call this function? */ + assert(ppPage || pPgnoNext); + + /* If pPgnoNext is NULL, then this function is being called to obtain + ** a MemPage* reference only. No page-data is required in this case. + */ + if( !pPgnoNext ){ + return sqlite3BtreeGetPage(pBt, ovfl, ppPage, 1); + } #ifndef SQLITE_OMIT_AUTOVACUUM /* Try to find the next page in the overflow list using the ** autovacuum pointer-map pages. Guess that the next page in ** the overflow list is page number (ovfl+1). If that guess turns @@ -3209,35 +3064,40 @@ while( PTRMAP_ISPAGE(pBt, iGuess) || iGuess==PENDING_BYTE_PAGE(pBt) ){ iGuess++; } - if( iGuess<=pagerPagecount(pBt) ){ + if( iGuess<=pagerPagecount(pBt->pPager) ){ rc = ptrmapGet(pBt, iGuess, &eType, &pgno); - if( rc==SQLITE_OK && eType==PTRMAP_OVERFLOW2 && pgno==ovfl ){ + if( rc!=SQLITE_OK ){ + return rc; + } + if( eType==PTRMAP_OVERFLOW2 && pgno==ovfl ){ next = iGuess; - rc = SQLITE_DONE; } } } #endif - if( rc==SQLITE_OK ){ - rc = sqlite3BtreeGetPage(pBt, ovfl, &pPage, 0); + if( next==0 || ppPage ){ + MemPage *pPage = 0; + + rc = sqlite3BtreeGetPage(pBt, ovfl, &pPage, next!=0); assert(rc==SQLITE_OK || pPage==0); if( next==0 && rc==SQLITE_OK ){ next = get4byte(pPage->aData); } + + if( ppPage ){ + *ppPage = pPage; + }else{ + releasePage(pPage); + } } - *pPgnoNext = next; - if( ppPage ){ - *ppPage = pPage; - }else{ - releasePage(pPage); - } - return (rc==SQLITE_DONE ? SQLITE_OK : rc); + + return rc; } /* ** Copy data from a buffer to a page, or from a page to a buffer. ** @@ -3300,38 +3160,37 @@ ** * A commit in auto_vacuum="full" mode, ** * Creating a table (may require moving an overflow page). */ static int accessPayload( BtCursor *pCur, /* Cursor pointing to entry to read from */ - u32 offset, /* Begin reading this far into payload */ - u32 amt, /* Read this many bytes */ + int offset, /* Begin reading this far into payload */ + int amt, /* Read this many bytes */ unsigned char *pBuf, /* Write the bytes into this buffer */ int skipKey, /* offset begins at data if this is true */ int eOp /* zero to read. non-zero to write. */ ){ unsigned char *aPayload; int rc = SQLITE_OK; u32 nKey; int iIdx = 0; MemPage *pPage = pCur->apPage[pCur->iPage]; /* Btree page of current entry */ - BtShared *pBt = pCur->pBt; /* Btree this cursor belongs to */ + BtShared *pBt; /* Btree this cursor belongs to */ assert( pPage ); assert( pCur->eState==CURSOR_VALID ); assert( pCur->aiIdx[pCur->iPage]nCell ); + assert( offset>=0 ); assert( cursorHoldsMutex(pCur) ); getCellInfo(pCur); aPayload = pCur->info.pCell + pCur->info.nHeader; - nKey = (pPage->intKey ? 0 : (int)pCur->info.nKey); + nKey = (pPage->intKey ? 0 : pCur->info.nKey); if( skipKey ){ offset += nKey; } - if( offset+amt > nKey+pCur->info.nData - || &aPayload[pCur->info.nLocal] > &pPage->aData[pBt->usableSize] - ){ + if( offset+amt > nKey+pCur->info.nData ){ /* Trying to read or write past the end of the data is an error */ return SQLITE_CORRUPT_BKPT; } /* Check if data must be read/written to/from the btree page itself. */ @@ -3346,12 +3205,13 @@ amt -= a; }else{ offset -= pCur->info.nLocal; } + pBt = pCur->pBt; if( rc==SQLITE_OK && amt>0 ){ - const u32 ovflSize = pBt->usableSize - 4; /* Bytes content per ovfl page */ + const int ovflSize = pBt->usableSize - 4; /* Bytes content per ovfl page */ Pgno nextPage; nextPage = get4byte(&aPayload[pCur->info.nLocal]); #ifndef SQLITE_OMIT_INCRBLOB @@ -3514,11 +3374,11 @@ int skipKey /* read beginning at data if this is true */ ){ unsigned char *aPayload; MemPage *pPage; u32 nKey; - u32 nLocal; + int nLocal; assert( pCur!=0 && pCur->iPage>=0 && pCur->apPage[pCur->iPage]); assert( pCur->eState==CURSOR_VALID ); assert( cursorHoldsMutex(pCur) ); pPage = pCur->apPage[pCur->iPage]; @@ -3527,11 +3387,11 @@ aPayload = pCur->info.pCell; aPayload += pCur->info.nHeader; if( pPage->intKey ){ nKey = 0; }else{ - nKey = (int)pCur->info.nKey; + nKey = pCur->info.nKey; } if( skipKey ){ aPayload += nKey; nLocal = pCur->info.nLocal - nKey; }else{ @@ -3737,11 +3597,11 @@ ** key in ascending order. */ static int moveToRightmost(BtCursor *pCur){ Pgno pgno; int rc = SQLITE_OK; - MemPage *pPage = 0; + MemPage *pPage; assert( cursorHoldsMutex(pCur) ); assert( pCur->eState==CURSOR_VALID ); while( rc==SQLITE_OK && !(pPage = pCur->apPage[pCur->iPage])->leaf ){ pgno = get4byte(&pPage->aData[pPage->hdrOffset+8]); @@ -3797,11 +3657,11 @@ }else{ assert( pCur->eState==CURSOR_VALID ); *pRes = 0; rc = moveToRightmost(pCur); getCellInfo(pCur); - pCur->atLast = rc==SQLITE_OK ?1:0; + pCur->atLast = rc==SQLITE_OK; } } return rc; } @@ -3815,24 +3675,23 @@ ** If an exact match is not found, then the cursor is always ** left pointing at a leaf page which would hold the entry if it ** were present. The cursor might point to an entry that comes ** before or after the key. ** -** An integer is written into *pRes which is the result of -** comparing the key with the entry to which the cursor is -** pointing. The meaning of the integer written into -** *pRes is as follows: +** The result of comparing the key with the entry to which the +** cursor is written to *pRes if pRes!=NULL. The meaning of +** this value is as follows: ** ** *pRes<0 The cursor is left pointing at an entry that -** is smaller than intKey/pIdxKey or if the table is empty +** is smaller than pKey or if the table is empty ** and the cursor is therefore left point to nothing. ** ** *pRes==0 The cursor is left pointing at an entry that -** exactly matches intKey/pIdxKey. +** exactly matches pKey. ** ** *pRes>0 The cursor is left pointing at an entry that -** is larger than intKey/pIdxKey. +** is larger than pKey. ** */ int sqlite3BtreeMovetoUnpacked( BtCursor *pCur, /* The cursor to be moved */ UnpackedRecord *pIdxKey, /* Unpacked index key */ @@ -3877,20 +3736,20 @@ Pgno chldPg; MemPage *pPage = pCur->apPage[pCur->iPage]; int c = -1; /* pRes return if table is empty must be -1 */ lwr = 0; upr = pPage->nCell-1; - if( (!pPage->intKey && pIdxKey==0) || upr<0 ){ + if( !pPage->intKey && pIdxKey==0 ){ rc = SQLITE_CORRUPT_BKPT; goto moveto_finish; } if( biasRight ){ - pCur->aiIdx[pCur->iPage] = (u16)upr; + pCur->aiIdx[pCur->iPage] = upr; }else{ - pCur->aiIdx[pCur->iPage] = (u16)((upr+lwr)/2); + pCur->aiIdx[pCur->iPage] = (upr+lwr)/2; } - for(;;){ + if( lwr<=upr ) for(;;){ void *pCellKey; i64 nCellKey; int idx = pCur->aiIdx[pCur->iPage]; pCur->info.nSize = 0; pCur->validNKey = 1; @@ -3913,19 +3772,19 @@ }else{ int available; pCellKey = (void *)fetchPayload(pCur, &available, 0); nCellKey = pCur->info.nKey; if( available>=nCellKey ){ - c = sqlite3VdbeRecordCompare((int)nCellKey, pCellKey, pIdxKey); + c = sqlite3VdbeRecordCompare(nCellKey, pCellKey, pIdxKey); }else{ - pCellKey = sqlite3Malloc( (int)nCellKey ); + pCellKey = sqlite3Malloc( nCellKey ); if( pCellKey==0 ){ rc = SQLITE_NOMEM; goto moveto_finish; } - rc = sqlite3BtreeKey(pCur, 0, (int)nCellKey, (void*)pCellKey); - c = sqlite3VdbeRecordCompare((int)nCellKey, pCellKey, pIdxKey); + rc = sqlite3BtreeKey(pCur, 0, nCellKey, (void *)pCellKey); + c = sqlite3VdbeRecordCompare(nCellKey, pCellKey, pIdxKey); sqlite3_free(pCellKey); if( rc ) goto moveto_finish; } } if( c==0 ){ @@ -3933,11 +3792,11 @@ if( pPage->intKey && !pPage->leaf ){ lwr = idx; upr = lwr - 1; break; }else{ - *pRes = 0; + if( pRes ) *pRes = 0; rc = SQLITE_OK; goto moveto_finish; } } if( c<0 ){ @@ -3947,11 +3806,11 @@ } if( lwr>upr ){ pCur->info.nKey = nCellKey; break; } - pCur->aiIdx[pCur->iPage] = (u16)((lwr+upr)/2); + pCur->aiIdx[pCur->iPage] = (lwr+upr)/2; } assert( lwr==upr+1 ); assert( pPage->isInit ); if( pPage->leaf ){ chldPg = 0; @@ -3964,11 +3823,11 @@ assert( pCur->aiIdx[pCur->iPage]apPage[pCur->iPage]->nCell ); if( pRes ) *pRes = c; rc = SQLITE_OK; goto moveto_finish; } - pCur->aiIdx[pCur->iPage] = (u16)lwr; + pCur->aiIdx[pCur->iPage] = lwr; pCur->info.nSize = 0; pCur->validNKey = 0; rc = moveToChild(pCur, chldPg); if( rc ) goto moveto_finish; } @@ -3991,12 +3850,11 @@ int rc; /* Status code */ UnpackedRecord *pIdxKey; /* Unpacked index key */ UnpackedRecord aSpace[16]; /* Temp space for pIdxKey - to avoid a malloc */ if( pKey ){ - assert( nKey==(i64)(int)nKey ); - pIdxKey = sqlite3VdbeRecordUnpack(pCur->pKeyInfo, (int)nKey, pKey, + pIdxKey = sqlite3VdbeRecordUnpack(pCur->pKeyInfo, nKey, pKey, aSpace, sizeof(aSpace)); if( pIdxKey==0 ) return SQLITE_NOMEM; }else{ pIdxKey = 0; } @@ -4206,11 +4064,11 @@ /* If the 'exact' parameter was true and a query of the pointer-map ** shows that the page 'nearby' is somewhere on the free-list, then ** the entire-list will be searched for that page. */ #ifndef SQLITE_OMIT_AUTOVACUUM - if( exact && nearby<=pagerPagecount(pBt) ){ + if( exact && nearby<=pagerPagecount(pBt->pPager) ){ u8 eType; assert( nearby>0 ); assert( pBt->autoVacuum ); rc = ptrmapGet(pBt, nearby, &eType, 0); if( rc ) return rc; @@ -4301,11 +4159,10 @@ memcpy(&pNewTrunk->aData[0], &pTrunk->aData[0], 4); put4byte(&pNewTrunk->aData[4], k-1); memcpy(&pNewTrunk->aData[8], &pTrunk->aData[12], (k-1)*4); releasePage(pNewTrunk); if( !pPrevTrunk ){ - assert( sqlite3PagerIswriteable(pPage1->pDbPage) ); put4byte(&pPage1->aData[32], iNewTrunk); }else{ rc = sqlite3PagerWrite(pPrevTrunk->pDbPage); if( rc ){ goto end_allocate_page; @@ -4342,14 +4199,13 @@ closest = 0; } iPage = get4byte(&aData[8+closest*4]); if( !searchList || iPage==nearby ){ - int noContent; - Pgno nPage; + int nPage; *pPgno = iPage; - nPage = pagerPagecount(pBt); + nPage = pagerPagecount(pBt->pPager); if( *pPgno>nPage ){ /* Free page off the end of the file */ rc = SQLITE_CORRUPT_BKPT; goto end_allocate_page; } @@ -4358,14 +4214,13 @@ *pPgno, closest+1, k, pTrunk->pgno, n-1)); if( closestpDbPage) ); - noContent = !btreeGetHasContent(pBt, *pPgno); - rc = sqlite3BtreeGetPage(pBt, *pPgno, ppPage, noContent); + rc = sqlite3BtreeGetPage(pBt, *pPgno, ppPage, 1); if( rc==SQLITE_OK ){ + sqlite3PagerDontRollback((*ppPage)->pDbPage); rc = sqlite3PagerWrite((*ppPage)->pDbPage); if( rc!=SQLITE_OK ){ releasePage(*ppPage); } } @@ -4376,18 +4231,24 @@ pPrevTrunk = 0; }while( searchList ); }else{ /* There are no pages on the freelist, so create a new page at the ** end of the file */ - int nPage = pagerPagecount(pBt); + int nPage = pagerPagecount(pBt->pPager); *pPgno = nPage + 1; - if( *pPgno==PENDING_BYTE_PAGE(pBt) ){ - (*pPgno)++; - } - #ifndef SQLITE_OMIT_AUTOVACUUM + if( pBt->nTrunc ){ + /* An incr-vacuum has already run within this transaction. So the + ** page to allocate is not from the physical end of the file, but + ** at pBt->nTrunc. + */ + *pPgno = pBt->nTrunc+1; + if( *pPgno==PENDING_BYTE_PAGE(pBt) ){ + (*pPgno)++; + } + } if( pBt->autoVacuum && PTRMAP_ISPAGE(pBt, *pPgno) ){ /* If *pPgno refers to a pointer-map page, allocate two new pages ** at the end of the file instead of one. The first allocated page ** becomes a new pointer-map page, the second is used by the caller. */ @@ -4394,10 +4255,13 @@ TRACE(("ALLOCATE: %d from end of file (pointer-map page)\n", *pPgno)); assert( *pPgno!=PENDING_BYTE_PAGE(pBt) ); (*pPgno)++; if( *pPgno==PENDING_BYTE_PAGE(pBt) ){ (*pPgno)++; } } + if( pBt->nTrunc ){ + pBt->nTrunc = *pPgno; + } #endif assert( *pPgno!=PENDING_BYTE_PAGE(pBt) ); rc = sqlite3BtreeGetPage(pBt, *pPgno, ppPage, 0); if( rc ) return rc; @@ -4411,101 +4275,72 @@ assert( *pPgno!=PENDING_BYTE_PAGE(pBt) ); end_allocate_page: releasePage(pTrunk); releasePage(pPrevTrunk); - if( rc==SQLITE_OK ){ - if( sqlite3PagerPageRefcount((*ppPage)->pDbPage)>1 ){ - releasePage(*ppPage); - return SQLITE_CORRUPT_BKPT; - } - (*ppPage)->isInit = 0; + if( rc==SQLITE_OK && sqlite3PagerPageRefcount((*ppPage)->pDbPage)>1 ){ + releasePage(*ppPage); + return SQLITE_CORRUPT_BKPT; } return rc; } /* -** This function is used to add page iPage to the database file free-list. -** It is assumed that the page is not already a part of the free-list. -** -** The value passed as the second argument to this function is optional. -** If the caller happens to have a pointer to the MemPage object -** corresponding to page iPage handy, it may pass it as the second value. -** Otherwise, it may pass NULL. -** -** If a pointer to a MemPage object is passed as the second argument, -** its reference count is not altered by this function. +** Add a page of the database file to the freelist. +** +** sqlite3PagerUnref() is NOT called for pPage. */ -static int freePage2(BtShared *pBt, MemPage *pMemPage, Pgno iPage){ - MemPage *pTrunk = 0; /* Free-list trunk page */ - Pgno iTrunk = 0; /* Page number of free-list trunk page */ - MemPage *pPage1 = pBt->pPage1; /* Local reference to page 1 */ - MemPage *pPage; /* Page being freed. May be NULL. */ - int rc; /* Return Code */ - int nFree; /* Initial number of pages on free-list */ - - assert( sqlite3_mutex_held(pBt->mutex) ); - assert( iPage>1 ); - assert( !pMemPage || pMemPage->pgno==iPage ); - - if( pMemPage ){ - pPage = pMemPage; - sqlite3PagerRef(pPage->pDbPage); - }else{ - pPage = btreePageLookup(pBt, iPage); - } +static int freePage(MemPage *pPage){ + BtShared *pBt = pPage->pBt; + MemPage *pPage1 = pBt->pPage1; + int rc, n, k; + + /* Prepare the page for freeing */ + assert( sqlite3_mutex_held(pPage->pBt->mutex) ); + assert( pPage->pgno>1 ); + pPage->isInit = 0; /* Increment the free page count on pPage1 */ rc = sqlite3PagerWrite(pPage1->pDbPage); - if( rc ) goto freepage_out; - nFree = get4byte(&pPage1->aData[36]); - put4byte(&pPage1->aData[36], nFree+1); + if( rc ) return rc; + n = get4byte(&pPage1->aData[36]); + put4byte(&pPage1->aData[36], n+1); #ifdef SQLITE_SECURE_DELETE /* If the SQLITE_SECURE_DELETE compile-time option is enabled, then ** always fully overwrite deleted information with zeros. */ - if( (!pPage && (rc = sqlite3BtreeGetPage(pBt, iPage, &pPage, 0))) - || (rc = sqlite3PagerWrite(pPage->pDbPage)) - ){ - goto freepage_out; - } + rc = sqlite3PagerWrite(pPage->pDbPage); + if( rc ) return rc; memset(pPage->aData, 0, pPage->pBt->pageSize); #endif /* If the database supports auto-vacuum, write an entry in the pointer-map ** to indicate that the page is free. */ if( ISAUTOVACUUM ){ - rc = ptrmapPut(pBt, iPage, PTRMAP_FREEPAGE, 0); - if( rc ) goto freepage_out; - } - - /* Now manipulate the actual database free-list structure. There are two - ** possibilities. If the free-list is currently empty, or if the first - ** trunk page in the free-list is full, then this page will become a - ** new free-list trunk page. Otherwise, it will become a leaf of the - ** first trunk page in the current free-list. This block tests if it - ** is possible to add the page as a new free-list leaf. - */ - if( nFree!=0 ){ - int nLeaf; /* Initial number of leaf cells on trunk page */ - - iTrunk = get4byte(&pPage1->aData[32]); - rc = sqlite3BtreeGetPage(pBt, iTrunk, &pTrunk, 0); - if( rc!=SQLITE_OK ){ - goto freepage_out; - } - - nLeaf = get4byte(&pTrunk->aData[4]); - if( nLeaf<0 ){ - rc = SQLITE_CORRUPT_BKPT; - goto freepage_out; - } - if( nLeafusableSize/4 - 8 ){ - /* In this case there is room on the trunk page to insert the page - ** being freed as a new leaf. + rc = ptrmapPut(pBt, pPage->pgno, PTRMAP_FREEPAGE, 0); + if( rc ) return rc; + } + + if( n==0 ){ + /* This is the first free page */ + rc = sqlite3PagerWrite(pPage->pDbPage); + if( rc ) return rc; + memset(pPage->aData, 0, 8); + put4byte(&pPage1->aData[32], pPage->pgno); + TRACE(("FREE-PAGE: %d first\n", pPage->pgno)); + }else{ + /* Other free pages already exist. Retrive the first trunk page + ** of the freelist and find out how many leaves it has. */ + MemPage *pTrunk; + rc = sqlite3BtreeGetPage(pBt, get4byte(&pPage1->aData[32]), &pTrunk, 0); + if( rc ) return rc; + k = get4byte(&pTrunk->aData[4]); + if( k>=pBt->usableSize/4 - 8 ){ + /* The trunk is full. Turn the page being freed into a new + ** trunk page with no leaves. ** ** Note that the trunk page is not really full until it contains ** usableSize/4 - 2 entries, not usableSize/4 - 8 entries as we have ** coded. But due to a coding error in versions of SQLite prior to ** 3.6.0, databases with freelist trunk pages holding more than @@ -4514,52 +4349,35 @@ ** we will contain to restrict the number of entries to usableSize/4 - 8 ** for now. At some point in the future (once everyone has upgraded ** to 3.6.0 or later) we should consider fixing the conditional above ** to read "usableSize/4-2" instead of "usableSize/4-8". */ + rc = sqlite3PagerWrite(pPage->pDbPage); + if( rc==SQLITE_OK ){ + put4byte(pPage->aData, pTrunk->pgno); + put4byte(&pPage->aData[4], 0); + put4byte(&pPage1->aData[32], pPage->pgno); + TRACE(("FREE-PAGE: %d new trunk page replacing %d\n", + pPage->pgno, pTrunk->pgno)); + } + }else if( k<0 ){ + rc = SQLITE_CORRUPT; + }else{ + /* Add the newly freed page as a leaf on the current trunk */ rc = sqlite3PagerWrite(pTrunk->pDbPage); if( rc==SQLITE_OK ){ - put4byte(&pTrunk->aData[4], nLeaf+1); - put4byte(&pTrunk->aData[8+nLeaf*4], iPage); + put4byte(&pTrunk->aData[4], k+1); + put4byte(&pTrunk->aData[8+k*4], pPage->pgno); #ifndef SQLITE_SECURE_DELETE - if( pPage ){ - sqlite3PagerDontWrite(pPage->pDbPage); - } + rc = sqlite3PagerDontWrite(pPage->pDbPage); #endif - rc = btreeSetHasContent(pBt, iPage); } TRACE(("FREE-PAGE: %d leaf on trunk page %d\n",pPage->pgno,pTrunk->pgno)); - goto freepage_out; - } - } - - /* If control flows to this point, then it was not possible to add the - ** the page being freed as a leaf page of the first trunk in the free-list. - ** Possibly because the free-list is empty, or possibly because the - ** first trunk in the free-list is full. Either way, the page being freed - ** will become the new first trunk page in the free-list. - */ - if( ((!pPage) && (0 != (rc = sqlite3BtreeGetPage(pBt, iPage, &pPage, 0)))) - || (0 != (rc = sqlite3PagerWrite(pPage->pDbPage))) - ){ - goto freepage_out; - } - put4byte(pPage->aData, iTrunk); - put4byte(&pPage->aData[4], 0); - put4byte(&pPage1->aData[32], iPage); - TRACE(("FREE-PAGE: %d new trunk page replacing %d\n", pPage->pgno, iTrunk)); - -freepage_out: - if( pPage ){ - pPage->isInit = 0; - } - releasePage(pPage); - releasePage(pTrunk); - return rc; -} -static int freePage(MemPage *pPage){ - return freePage2(pPage->pBt, pPage, pPage->pgno); + } + releasePage(pTrunk); + } + return rc; } /* ** Free any overflow pages associated with the given Cell. */ @@ -4567,38 +4385,32 @@ BtShared *pBt = pPage->pBt; CellInfo info; Pgno ovflPgno; int rc; int nOvfl; - u16 ovflPageSize; + int ovflPageSize; assert( sqlite3_mutex_held(pPage->pBt->mutex) ); sqlite3BtreeParseCellPtr(pPage, pCell, &info); if( info.iOverflow==0 ){ return SQLITE_OK; /* No overflow pages. Return without doing anything */ } ovflPgno = get4byte(&pCell[info.iOverflow]); - assert( pBt->usableSize > 4 ); ovflPageSize = pBt->usableSize - 4; nOvfl = (info.nPayload - info.nLocal + ovflPageSize - 1)/ovflPageSize; assert( ovflPgno==0 || nOvfl>0 ); while( nOvfl-- ){ - Pgno iNext = 0; - MemPage *pOvfl = 0; - if( ovflPgno==0 || ovflPgno>pagerPagecount(pBt) ){ + MemPage *pOvfl; + if( ovflPgno==0 || ovflPgno>pagerPagecount(pBt->pPager) ){ return SQLITE_CORRUPT_BKPT; } - if( nOvfl ){ - rc = getOverflowPage(pBt, ovflPgno, &pOvfl, &iNext); - if( rc ) return rc; - } - rc = freePage2(pBt, pOvfl, ovflPgno); - if( pOvfl ){ - sqlite3PagerUnref(pOvfl->pDbPage); - } - if( rc ) return rc; - ovflPgno = iNext; + + rc = getOverflowPage(pBt, ovflPgno, &pOvfl, (nOvfl==0)?0:&ovflPgno); + if( rc ) return rc; + rc = freePage(pOvfl); + sqlite3PagerUnref(pOvfl->pDbPage); + if( rc ) return rc; } return SQLITE_OK; } /* @@ -4634,15 +4446,10 @@ int nHeader; CellInfo info; assert( sqlite3_mutex_held(pPage->pBt->mutex) ); - /* pPage is not necessarily writeable since pCell might be auxiliary - ** buffer space that is separate from the pPage buffer area */ - assert( pCellaData || pCell>=&pPage->aData[pBt->pageSize] - || sqlite3PagerIswriteable(pPage->pDbPage) ); - /* Fill in the header. */ nHeader = 0; if( !pPage->leaf ){ nHeader += 4; } @@ -4653,44 +4460,45 @@ } nHeader += putVarint(&pCell[nHeader], *(u64*)&nKey); sqlite3BtreeParseCellPtr(pPage, pCell, &info); assert( info.nHeader==nHeader ); assert( info.nKey==nKey ); - assert( info.nData==(u32)(nData+nZero) ); + assert( info.nData==nData+nZero ); /* Fill in the payload */ nPayload = nData + nZero; if( pPage->intKey ){ pSrc = pData; nSrc = nData; nData = 0; - }else{ - if( nKey>0x7fffffff || pKey==0 ){ - return SQLITE_CORRUPT; - } - nPayload += (int)nKey; + }else{ + nPayload += nKey; pSrc = pKey; - nSrc = (int)nKey; + nSrc = nKey; } *pnSize = info.nSize; spaceLeft = info.nLocal; pPayload = &pCell[nHeader]; pPrior = &pCell[info.iOverflow]; while( nPayload>0 ){ if( spaceLeft==0 ){ + int isExact = 0; #ifndef SQLITE_OMIT_AUTOVACUUM Pgno pgnoPtrmap = pgnoOvfl; /* Overflow page pointer-map entry page */ if( pBt->autoVacuum ){ do{ pgnoOvfl++; } while( PTRMAP_ISPAGE(pBt, pgnoOvfl) || pgnoOvfl==PENDING_BYTE_PAGE(pBt) ); + if( pgnoOvfl>1 ){ + /* isExact = 1; */ + } } #endif - rc = allocateBtreePage(pBt, &pOvfl, &pgnoOvfl, pgnoOvfl, 0); + rc = allocateBtreePage(pBt, &pOvfl, &pgnoOvfl, pgnoOvfl, isExact); #ifndef SQLITE_OMIT_AUTOVACUUM /* If the database supports auto-vacuum, and the second or subsequent ** overflow page is being allocated, add an entry to the pointer-map ** for that page now. ** @@ -4710,20 +4518,10 @@ #endif if( rc ){ releasePage(pToRelease); return rc; } - - /* If pToRelease is not zero than pPrior points into the data area - ** of pToRelease. Make sure pToRelease is still writeable. */ - assert( pToRelease==0 || sqlite3PagerIswriteable(pToRelease->pDbPage) ); - - /* If pPrior is part of the data area of pPage, then make sure pPage - ** is still writeable */ - assert( pPrioraData || pPrior>=&pPage->aData[pBt->pageSize] - || sqlite3PagerIswriteable(pPage->pDbPage) ); - put4byte(pPrior, pgnoOvfl); releasePage(pToRelease); pToRelease = pOvfl; pPrior = pOvfl->aData; put4byte(pPrior, 0); @@ -4730,20 +4528,10 @@ pPayload = &pOvfl->aData[4]; spaceLeft = pBt->usableSize - 4; } n = nPayload; if( n>spaceLeft ) n = spaceLeft; - - /* If pToRelease is not zero than pPayload points into the data area - ** of pToRelease. Make sure pToRelease is still writeable. */ - assert( pToRelease==0 || sqlite3PagerIswriteable(pToRelease->pDbPage) ); - - /* If pPayload is part of the data area of pPage, then make sure pPage - ** is still writeable */ - assert( pPayloadaData || pPayload>=&pPage->aData[pBt->pageSize] - || sqlite3PagerIswriteable(pPage->pDbPage) ); - if( nSrc>0 ){ if( n>nSrc ) n = nSrc; assert( pSrc ); memcpy(pPayload, pSrc, n); }else{ @@ -4769,40 +4557,32 @@ ** the cell content has been copied someplace else. This routine just ** removes the reference to the cell from pPage. ** ** "sz" must be the number of bytes in the cell. */ -static int dropCell(MemPage *pPage, int idx, int sz){ +static void dropCell(MemPage *pPage, int idx, int sz){ int i; /* Loop counter */ int pc; /* Offset to cell content of cell being deleted */ u8 *data; /* pPage->aData */ u8 *ptr; /* Used to move bytes around within data[] */ - int rc; /* The return code */ assert( idx>=0 && idxnCell ); assert( sz==cellSize(pPage, idx) ); assert( sqlite3PagerIswriteable(pPage->pDbPage) ); assert( sqlite3_mutex_held(pPage->pBt->mutex) ); data = pPage->aData; ptr = &data[pPage->cellOffset + 2*idx]; pc = get2byte(ptr); - if( (pchdrOffset+6+(pPage->leaf?0:4)) - || (pc+sz>pPage->pBt->usableSize) ){ - return SQLITE_CORRUPT_BKPT; - } - rc = freeSpace(pPage, pc, sz); - if( rc!=SQLITE_OK ){ - return rc; - } + assert( pc>10 && pc+sz<=pPage->pBt->usableSize ); + freeSpace(pPage, pc, sz); for(i=idx+1; inCell; i++, ptr+=2){ ptr[0] = ptr[2]; ptr[1] = ptr[3]; } pPage->nCell--; put2byte(&data[pPage->hdrOffset+3], pPage->nCell); pPage->nFree += 2; - return SQLITE_OK; } /* ** Insert a new cell on pPage at cell index "i". pCell points to the ** content of the cell. @@ -4837,23 +4617,21 @@ int cellOffset; /* Address of first cell pointer in data[] */ u8 *data; /* The content of the whole page */ u8 *ptr; /* Used for moving information around in data[] */ assert( i>=0 && i<=pPage->nCell+pPage->nOverflow ); - assert( pPage->nCell<=MX_CELL(pPage->pBt) && MX_CELL(pPage->pBt)<=5460 ); - assert( pPage->nOverflow<=ArraySize(pPage->aOvfl) ); assert( sz==cellSizePtr(pPage, pCell) ); assert( sqlite3_mutex_held(pPage->pBt->mutex) ); if( pPage->nOverflow || sz+2>pPage->nFree ){ if( pTemp ){ memcpy(pTemp+nSkip, pCell+nSkip, sz-nSkip); pCell = pTemp; } j = pPage->nOverflow++; - assert( j<(int)(sizeof(pPage->aOvfl)/sizeof(pPage->aOvfl[0])) ); + assert( jaOvfl)/sizeof(pPage->aOvfl[0]) ); pPage->aOvfl[j].pCell = pCell; - pPage->aOvfl[j].idx = (u16)i; + pPage->aOvfl[j].idx = i; pPage->nFree = 0; }else{ int rc = sqlite3PagerWrite(pPage->pDbPage); if( rc!=SQLITE_OK ){ return rc; @@ -4864,23 +4642,17 @@ top = get2byte(&data[hdr+5]); cellOffset = pPage->cellOffset; end = cellOffset + 2*pPage->nCell + 2; ins = cellOffset + 2*i; if( end > top - sz ){ - rc = defragmentPage(pPage); - if( rc!=SQLITE_OK ){ - return rc; - } + defragmentPage(pPage); top = get2byte(&data[hdr+5]); assert( end + sz <= top ); } idx = allocateSpace(pPage, sz); assert( idx>0 ); assert( end <= get2byte(&data[hdr+5]) ); - if (idx+sz > pPage->pBt->usableSize) { - return SQLITE_CORRUPT_BKPT; - } pPage->nCell++; pPage->nFree -= 2; memcpy(&data[idx+nSkip], pCell+nSkip, sz-nSkip); for(j=end-2, ptr=&data[j]; j>ins; j-=2, ptr-=2){ ptr[0] = ptr[-2]; @@ -4925,18 +4697,16 @@ int cellbody; /* Address of next cell body */ u8 *data; /* Data for the page */ assert( pPage->nOverflow==0 ); assert( sqlite3_mutex_held(pPage->pBt->mutex) ); - assert( nCell>=0 && nCell<=MX_CELL(pPage->pBt) && MX_CELL(pPage->pBt)<=5460 ); totalSize = 0; for(i=0; inFree ); assert( pPage->nCell==0 ); - assert( sqlite3PagerIswriteable(pPage->pDbPage) ); cellptr = pPage->cellOffset; data = pPage->aData; hdr = pPage->hdrOffset; put2byte(&data[hdr+3], nCell); if( nCell ){ @@ -4950,11 +4720,11 @@ cellptr += 2; cellbody += aSize[i]; } assert( cellbody==pPage->pBt->usableSize ); } - pPage->nCell = (u16)nCell; + pPage->nCell = nCell; } /* ** The following parameters determine how many adjacent pages get involved ** in a balancing operation. NN is the number of neighbors on either side @@ -5012,11 +4782,10 @@ */ rc = allocateBtreePage(pBt, &pNew, &pgnoNew, 0, 0); if( rc==SQLITE_OK ){ pCell = pPage->aOvfl[0].pCell; szCell = cellSizePtr(pPage, pCell); - assert( sqlite3PagerIswriteable(pNew->pDbPage) ); zeroPage(pNew, pPage->aData[0]); assemblePage(pNew, 1, &pCell, &szCell); pPage->nOverflow = 0; /* pPage is currently the right-child of pParent. Change this @@ -5071,11 +4840,10 @@ ** it will not be rolled back and so it is important to make sure that ** the page data and contents of MemPage are consistent. */ pPage->isInit = 0; sqlite3BtreeInitPage(pPage); - assert( pPage->nOverflow==0 ); /* If everything else succeeded, balance the parent page, in ** case the divider cell inserted caused it to become overfull. */ if( rc==SQLITE_OK ){ @@ -5120,12 +4888,12 @@ MemPage *pPage; /* The over or underfull page to balance */ MemPage *pParent; /* The parent of pPage */ BtShared *pBt; /* The whole database */ int nCell = 0; /* Number of cells in apCell[] */ int nMaxCells = 0; /* Allocated size of apCell, szCell, aFrom. */ - int nOld = 0; /* Number of pages in apOld[] */ - int nNew = 0; /* Number of pages in apNew[] */ + int nOld; /* Number of pages in apOld[] */ + int nNew; /* Number of pages in apNew[] */ int nDiv; /* Number of cells in apDiv[] */ int i, j, k; /* Loop counters */ int idx; /* Index of pPage in pParent->aCell[] */ int nxDiv; /* Next divider slot in pParent->aCell[] */ int rc; /* The return code */ @@ -5164,11 +4932,11 @@ assert( sqlite3PagerIswriteable(pPage->pDbPage) || pPage->nOverflow==1 ); pBt = pPage->pBt; pParent = pCur->apPage[pCur->iPage-1]; assert( pParent ); if( SQLITE_OK!=(rc = sqlite3PagerWrite(pParent->pDbPage)) ){ - goto balance_cleanup; + return rc; } TRACE(("BALANCE: begin page %d child of %d\n", pPage->pgno, pParent->pgno)); #ifndef SQLITE_OMIT_QUICKBALANCE @@ -5195,11 +4963,11 @@ return balance_quick(pCur); } #endif if( SQLITE_OK!=(rc = sqlite3PagerWrite(pPage->pDbPage)) ){ - goto balance_cleanup; + return rc; } /* ** Find the cell in the parent page whose left child points back ** to pPage. The "idx" variable is the index of that cell. If pPage @@ -5206,10 +4974,16 @@ ** is the rightmost child of pParent then set idx to pParent->nCell */ idx = pCur->aiIdx[pCur->iPage-1]; assertParentIndex(pParent, idx, pPage->pgno); + /* + ** Initialize variables so that it will be safe to jump + ** directly to balance_cleanup at any moment. + */ + nOld = nNew = 0; + /* ** Find sibling pages to pPage and the cells in pParent that divide ** the siblings. An attempt is made to find NN siblings on either ** side of pPage. More siblings are taken from one side, however, if ** pPage there are fewer than NN siblings on the other side. If pParent @@ -5261,17 +5035,17 @@ rc = SQLITE_NOMEM; goto balance_cleanup; } szCell = (u16*)&apCell[nMaxCells]; aCopy[0] = (u8*)&szCell[nMaxCells]; - assert( ((aCopy[0] - (u8*)0) & 7)==0 ); /* 8-byte alignment required */ + assert( ((aCopy[0] - (u8*)apCell) & 7)==0 ); /* 8-byte alignment required */ for(i=1; ipageSize+ROUND8(sizeof(MemPage))]; - assert( ((aCopy[i] - (u8*)0) & 7)==0 ); /* 8-byte alignment required */ + assert( ((aCopy[i] - (u8*)apCell) & 7)==0 ); /* 8-byte alignment required */ } aSpace1 = &aCopy[NB-1][pBt->pageSize+ROUND8(sizeof(MemPage))]; - assert( ((aSpace1 - (u8*)0) & 7)==0 ); /* 8-byte alignment required */ + assert( ((aSpace1 - (u8*)apCell) & 7)==0 ); /* 8-byte alignment required */ if( ISAUTOVACUUM ){ aFrom = &aSpace1[pBt->pageSize]; } aSpace2 = sqlite3PageMalloc(pBt->pageSize); if( aSpace2==0 ){ @@ -5318,11 +5092,11 @@ assert( nCell=0 && i<6 ); + aFrom[nCell] = i; for(a=0; anOverflow; a++){ if( pOld->aOvfl[a].pCell==apCell[nCell] ){ aFrom[nCell] = 0xFF; break; } @@ -5351,12 +5125,11 @@ apCell[nCell] = pTemp+leafCorrection; if( ISAUTOVACUUM ){ aFrom[nCell] = 0xFF; } dropCell(pParent, nxDiv, sz); - assert( leafCorrection==0 || leafCorrection==4 ); - szCell[nCell] -= (u16)leafCorrection; + szCell[nCell] -= leafCorrection; assert( get4byte(pTemp)==pgnoOld[i] ); if( !pOld->leaf ){ assert( leafCorrection==0 ); /* The right pointer of the child page pOld becomes the left ** pointer of the divider cell */ @@ -5586,14 +5359,11 @@ */ CellInfo info; j--; sqlite3BtreeParseCellPtr(pNew, apCell[j], &info); pCell = pTemp; - rc = fillInCell(pParent, pCell, 0, info.nKey, 0, 0, 0, &sz); - if( rc!=SQLITE_OK ){ - goto balance_cleanup; - } + fillInCell(pParent, pCell, 0, info.nKey, 0, 0, 0, &sz); pTemp = 0; }else{ pCell -= 4; /* Obscure case for non-leaf-data trees: If the cell at pCell was ** previously stored on a leaf node, and its reported size was 4 @@ -5614,11 +5384,10 @@ iSpace2 += sz; assert( sz<=pBt->pageSize/4 ); assert( iSpace2<=pBt->pageSize ); rc = insertCell(pParent, nxDiv, pCell, sz, pTemp, 4); if( rc!=SQLITE_OK ) goto balance_cleanup; - assert( sqlite3PagerIswriteable(pParent->pDbPage) ); put4byte(findOverflowCell(pParent,nxDiv), pNew->pgno); /* If this is an auto-vacuum database, and not a leaf-data tree, ** then update the pointer map with an entry for the overflow page ** that the cell just inserted points to (if any). @@ -5652,11 +5421,10 @@ if( rc!=SQLITE_OK ){ goto balance_cleanup; } } } - assert( sqlite3PagerIswriteable(pParent->pDbPage) ); if( nxDiv==pParent->nCell+pParent->nOverflow ){ /* Right-most sibling is the right-most child of pParent */ put4byte(&pParent->aData[pParent->hdrOffset+8], pgnoNew[nNew-1]); }else{ /* Right-most sibling is the left child of the first entry in pParent @@ -5670,13 +5438,10 @@ ** But the parent page will always be initialized. */ assert( pParent->isInit ); sqlite3ScratchFree(apCell); apCell = 0; - TRACE(("BALANCE: finished with %d: old=%d new=%d cells=%d\n", - pPage->pgno, nOld, nNew, nCell)); - pPage->nOverflow = 0; releasePage(pPage); pCur->iPage--; rc = balance(pCur, 0); /* @@ -5689,11 +5454,14 @@ releasePage(apOld[i]); } for(i=0; iapPage[pCur->iPage]->nOverflow = 0; + + /* releasePage(pParent); */ + TRACE(("BALANCE: finished with %d: old=%d new=%d cells=%d\n", + pPage->pgno, nOld, nNew, nCell)); return rc; } /* @@ -5738,11 +5506,11 @@ ** the virtual root of the tree. */ VVA_ONLY( pCur->pagesShuffled = 1 ); pgnoChild = get4byte(&pPage->aData[pPage->hdrOffset+8]); assert( pgnoChild>0 ); - assert( pgnoChild<=pagerPagecount(pPage->pBt) ); + assert( pgnoChild<=pagerPagecount(pPage->pBt->pPager) ); rc = sqlite3BtreeGetPage(pPage->pBt, pgnoChild, &pChild, 0); if( rc ) goto end_shallow_balance; if( pPage->pgno==1 ){ rc = sqlite3BtreeInitPage(pChild); if( rc ) goto end_shallow_balance; @@ -5756,14 +5524,13 @@ apCell[i] = findCell(pChild,i); szCell[i] = cellSizePtr(pChild, apCell[i]); } assemblePage(pPage, pChild->nCell, apCell, szCell); /* Copy the right-pointer of the child to the parent. */ - assert( sqlite3PagerIswriteable(pPage->pDbPage) ); put4byte(&pPage->aData[pPage->hdrOffset+8], get4byte(&pChild->aData[pChild->hdrOffset+8])); - rc = freePage(pChild); + freePage(pChild); TRACE(("BALANCE: child %d transfer to page 1\n", pChild->pgno)); }else{ /* The child has more information that will fit on the root. ** The tree is already balanced. Do nothing. */ TRACE(("BALANCE: child %d will not fit on page 1\n", pChild->pgno)); @@ -5776,15 +5543,13 @@ freePage(pChild); TRACE(("BALANCE: transfer child %d into root %d\n", pChild->pgno, pPage->pgno)); } assert( pPage->nOverflow==0 ); -#ifndef SQLITE_OMIT_AUTOVACUUM - if( ISAUTOVACUUM && rc==SQLITE_OK ){ + if( ISAUTOVACUUM ){ rc = setChildPtrmaps(pPage); } -#endif releasePage(pChild); } end_shallow_balance: sqlite3_free(apCell); return rc; @@ -5817,11 +5582,10 @@ VVA_ONLY( pCur->pagesShuffled = 1 ); pPage = pCur->apPage[0]; pBt = pPage->pBt; assert( sqlite3_mutex_held(pBt->mutex) ); - assert( sqlite3PagerIswriteable(pPage->pDbPage) ); rc = allocateBtreePage(pBt, &pChild, &pgnoChild, pPage->pgno, 0); if( rc ) return rc; assert( sqlite3PagerIswriteable(pChild->pDbPage) ); usableSize = pBt->usableSize; data = pPage->aData; @@ -5828,35 +5592,28 @@ hdr = pPage->hdrOffset; cbrk = get2byte(&data[hdr+5]); cdata = pChild->aData; memcpy(cdata, &data[hdr], pPage->cellOffset+2*pPage->nCell-hdr); memcpy(&cdata[cbrk], &data[cbrk], usableSize-cbrk); - - assert( pChild->isInit==0 ); + rc = sqlite3BtreeInitPage(pChild); if( rc==SQLITE_OK ){ int nCopy = pPage->nOverflow*sizeof(pPage->aOvfl[0]); memcpy(pChild->aOvfl, pPage->aOvfl, nCopy); pChild->nOverflow = pPage->nOverflow; if( pChild->nOverflow ){ pChild->nFree = 0; } assert( pChild->nCell==pPage->nCell ); - assert( sqlite3PagerIswriteable(pPage->pDbPage) ); zeroPage(pPage, pChild->aData[0] & ~PTF_LEAF); put4byte(&pPage->aData[pPage->hdrOffset+8], pgnoChild); TRACE(("BALANCE: copy root %d into %d\n", pPage->pgno, pChild->pgno)); if( ISAUTOVACUUM ){ rc = ptrmapPut(pBt, pChild->pgno, PTRMAP_BTREE, pPage->pgno); -#ifndef SQLITE_OMIT_AUTOVACUUM if( rc==SQLITE_OK ){ rc = setChildPtrmaps(pChild); } - if( rc ){ - pChild->nOverflow = 0; - } -#endif } } if( rc==SQLITE_OK ){ pCur->iPage++; @@ -5886,17 +5643,13 @@ assert( sqlite3_mutex_held(pPage->pBt->mutex) ); if( pCur->iPage==0 ){ rc = sqlite3PagerWrite(pPage->pDbPage); if( rc==SQLITE_OK && pPage->nOverflow>0 ){ rc = balance_deeper(pCur); - assert( pCur->apPage[0]==pPage ); - assert( pPage->nOverflow==0 || rc!=SQLITE_OK ); } if( rc==SQLITE_OK && pPage->nCell==0 ){ rc = balance_shallower(pCur); - assert( pCur->apPage[0]==pPage ); - assert( pPage->nOverflow==0 || rc!=SQLITE_OK ); } }else{ if( pPage->nOverflow>0 || (!isInsert && pPage->nFree>pPage->pBt->usableSize*2/3) ){ rc = balance_nonroot(pCur); @@ -5999,13 +5752,19 @@ BtShared *pBt = p->pBt; unsigned char *oldCell; unsigned char *newCell = 0; assert( cursorHoldsMutex(pCur) ); - assert( pBt->inTransaction==TRANS_WRITE ); + if( pBt->inTransaction!=TRANS_WRITE ){ + /* Must start a transaction before doing an insert */ + rc = pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR; + return rc; + } assert( !pBt->readOnly ); - assert( pCur->wrFlag ); + if( !pCur->wrFlag ){ + return SQLITE_PERM; /* Cursor not open for writing */ + } if( checkReadLocks(pCur->pBtree, pCur->pgnoRoot, pCur, nKey) ){ return SQLITE_LOCKED; /* The table pCur points to has a read lock */ } if( pCur->eState==CURSOR_FAULT ){ return pCur->skip; @@ -6047,31 +5806,22 @@ memcpy(newCell, oldCell, 4); } szOld = cellSizePtr(pPage, oldCell); rc = clearCell(pPage, oldCell); if( rc ) goto end_insert; - rc = dropCell(pPage, idx, szOld); - if( rc!=SQLITE_OK ) { - goto end_insert; - } + dropCell(pPage, idx, szOld); }else if( loc<0 && pPage->nCell>0 ){ assert( pPage->leaf ); idx = ++pCur->aiIdx[pCur->iPage]; pCur->info.nSize = 0; pCur->validNKey = 0; }else{ assert( pPage->leaf ); } rc = insertCell(pPage, idx, newCell, szNew, 0, 0); - if( rc==SQLITE_OK ){ - rc = balance(pCur, 1); - } - - /* Must make sure nOverflow is reset to zero even if the balance() - ** fails. Internal data structure corruption will result otherwise. */ - pCur->apPage[pCur->iPage]->nOverflow = 0; - + if( rc!=SQLITE_OK ) goto end_insert; + rc = balance(pCur, 1); if( rc==SQLITE_OK ){ moveToRoot(pCur); } end_insert: return rc; @@ -6090,19 +5840,25 @@ Btree *p = pCur->pBtree; BtShared *pBt = p->pBt; assert( cursorHoldsMutex(pCur) ); assert( pPage->isInit ); - assert( pBt->inTransaction==TRANS_WRITE ); + if( pBt->inTransaction!=TRANS_WRITE ){ + /* Must start a transaction before doing a delete */ + rc = pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR; + return rc; + } assert( !pBt->readOnly ); if( pCur->eState==CURSOR_FAULT ){ return pCur->skip; } - if( NEVER(pCur->aiIdx[pCur->iPage]>=pPage->nCell) ){ + if( pCur->aiIdx[pCur->iPage]>=pPage->nCell ){ return SQLITE_ERROR; /* The cursor is not pointing to anything */ } - assert( pCur->wrFlag ); + if( !pCur->wrFlag ){ + return SQLITE_PERM; /* Did not open this cursor for writing */ + } if( checkReadLocks(pCur->pBtree, pCur->pgnoRoot, pCur, pCur->info.nKey) ){ return SQLITE_LOCKED; /* The table pCur points to has a read lock */ } /* Restore the current cursor position (a no-op if the cursor is not in @@ -6139,11 +5895,11 @@ ** We have to fill the hole by moving in a cell from a leaf. The ** next Cell after the one to be deleted is guaranteed to exist and ** to be a leaf so we can use it. */ BtCursor leafCur; - MemPage *pLeafPage = 0; + MemPage *pLeafPage; unsigned char *pNext; int notUsed; unsigned char *tempCell = 0; assert( !pPage->intKey ); @@ -6210,11 +5966,10 @@ testcase( pLeafPage->nFree+2+szNext==pBt->usableSize*2/3+1 ); leafCursorInvalid = 1; } if( rc==SQLITE_OK ){ - assert( sqlite3PagerIswriteable(pPage->pDbPage) ); put4byte(findOverflowCell(pPage, idx), pgnoChild); VVA_ONLY( pCur->pagesShuffled = 0 ); rc = balance(pCur, 0); } @@ -6250,13 +6005,11 @@ pLeafPage = leafCur.apPage[leafCur.iPage]; assert( pLeafPage->pgno==leafPgno ); assert( leafCur.aiIdx[leafCur.iPage]==0 ); } - if( SQLITE_OK==rc - && SQLITE_OK==(rc = sqlite3PagerWrite(pLeafPage->pDbPage)) - ){ + if( rc==SQLITE_OK ){ dropCell(pLeafPage, 0, szNext); VVA_ONLY( leafCur.pagesShuffled = 0 ); rc = balance(&leafCur, 0); assert( leafCursorInvalid || !leafCur.pagesShuffled || !pCur->pagesShuffled ); @@ -6264,14 +6017,12 @@ } sqlite3BtreeReleaseTempCursor(&leafCur); }else{ TRACE(("DELETE: table=%d delete from leaf %d\n", pCur->pgnoRoot, pPage->pgno)); - rc = dropCell(pPage, idx, cellSizePtr(pPage, pCell)); - if( rc==SQLITE_OK ){ - rc = balance(pCur, 0); - } + dropCell(pPage, idx, cellSizePtr(pPage, pCell)); + rc = balance(pCur, 0); } if( rc==SQLITE_OK ){ moveToRoot(pCur); } return rc; @@ -6293,11 +6044,15 @@ MemPage *pRoot; Pgno pgnoRoot; int rc; assert( sqlite3BtreeHoldsMutex(p) ); - assert( pBt->inTransaction==TRANS_WRITE ); + if( pBt->inTransaction!=TRANS_WRITE ){ + /* Must start a transaction first */ + rc = pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR; + return rc; + } assert( !pBt->readOnly ); #ifdef SQLITE_OMIT_AUTOVACUUM rc = allocateBtreePage(pBt, &pRoot, &pgnoRoot, 1, 0); if( rc ){ @@ -6365,10 +6120,15 @@ releasePage(pRoot); return rc; } assert( eType!=PTRMAP_ROOTPAGE ); assert( eType!=PTRMAP_FREEPAGE ); + rc = sqlite3PagerWrite(pRoot->pDbPage); + if( rc!=SQLITE_OK ){ + releasePage(pRoot); + return rc; + } rc = relocatePage(pBt, pRoot, eType, iPtrPage, pgnoMove, 0); releasePage(pRoot); /* Obtain the page at pgnoRoot */ if( rc!=SQLITE_OK ){ @@ -6424,40 +6184,37 @@ ** the page to the freelist. */ static int clearDatabasePage( BtShared *pBt, /* The BTree that contains the table */ Pgno pgno, /* Page number to clear */ - int freePageFlag, /* Deallocate page if true */ - int *pnChange + MemPage *pParent, /* Parent page. NULL for the root */ + int freePageFlag /* Deallocate page if true */ ){ MemPage *pPage = 0; int rc; unsigned char *pCell; int i; assert( sqlite3_mutex_held(pBt->mutex) ); - if( pgno>pagerPagecount(pBt) ){ + if( pgno>pagerPagecount(pBt->pPager) ){ return SQLITE_CORRUPT_BKPT; } rc = getAndInitPage(pBt, pgno, &pPage); if( rc ) goto cleardatabasepage_out; for(i=0; inCell; i++){ pCell = findCell(pPage, i); if( !pPage->leaf ){ - rc = clearDatabasePage(pBt, get4byte(pCell), 1, pnChange); + rc = clearDatabasePage(pBt, get4byte(pCell), pPage, 1); if( rc ) goto cleardatabasepage_out; } rc = clearCell(pPage, pCell); if( rc ) goto cleardatabasepage_out; } if( !pPage->leaf ){ - rc = clearDatabasePage(pBt, get4byte(&pPage->aData[8]), 1, pnChange); + rc = clearDatabasePage(pBt, get4byte(&pPage->aData[8]), pPage, 1); if( rc ) goto cleardatabasepage_out; - }else if( pnChange ){ - assert( pPage->intKey ); - *pnChange += pPage->nCell; } if( freePageFlag ){ rc = freePage(pPage); }else if( (rc = sqlite3PagerWrite(pPage->pDbPage))==0 ){ zeroPage(pPage, pPage->aData[0] | PTF_LEAF); @@ -6474,27 +6231,24 @@ ** the root page is empty, but still exists. ** ** This routine will fail with SQLITE_LOCKED if there are any open ** read cursors on the table. Open write cursors are moved to the ** root of the table. -** -** If pnChange is not NULL, then table iTable must be an intkey table. The -** integer value pointed to by pnChange is incremented by the number of -** entries in the table. */ -int sqlite3BtreeClearTable(Btree *p, int iTable, int *pnChange){ +int sqlite3BtreeClearTable(Btree *p, int iTable){ int rc; BtShared *pBt = p->pBt; sqlite3BtreeEnter(p); pBt->db = p->db; - assert( p->inTrans==TRANS_WRITE ); - if( (rc = checkReadLocks(p, iTable, 0, 1))!=SQLITE_OK ){ + if( p->inTrans!=TRANS_WRITE ){ + rc = pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR; + }else if( (rc = checkReadLocks(p, iTable, 0, 1))!=SQLITE_OK ){ /* nothing to do */ }else if( SQLITE_OK!=(rc = saveAllCursors(pBt, iTable, 0)) ){ /* nothing to do */ }else{ - rc = clearDatabasePage(pBt, (Pgno)iTable, 0, pnChange); + rc = clearDatabasePage(pBt, (Pgno)iTable, 0, 0); } sqlite3BtreeLeave(p); return rc; } @@ -6516,17 +6270,19 @@ ** page number that used to be the last root page in the file before ** the move. If no page gets moved, *piMoved is set to 0. ** The last root page is recorded in meta[3] and the value of ** meta[3] is updated by this procedure. */ -static int btreeDropTable(Btree *p, Pgno iTable, int *piMoved){ +static int btreeDropTable(Btree *p, int iTable, int *piMoved){ int rc; MemPage *pPage = 0; BtShared *pBt = p->pBt; assert( sqlite3BtreeHoldsMutex(p) ); - assert( p->inTrans==TRANS_WRITE ); + if( p->inTrans!=TRANS_WRITE ){ + return pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR; + } /* It is illegal to drop a table if any cursors are open on the ** database. This is because in auto-vacuum mode the backend may ** need to move another root-page to fill a gap left by the deleted ** root page. If an open cursor was using this page a problem would @@ -6536,11 +6292,11 @@ return SQLITE_LOCKED; } rc = sqlite3BtreeGetPage(pBt, (Pgno)iTable, &pPage, 0); if( rc ) return rc; - rc = sqlite3BtreeClearTable(p, iTable, 0); + rc = sqlite3BtreeClearTable(p, iTable); if( rc ){ releasePage(pPage); return rc; } @@ -6642,11 +6398,11 @@ ** The schema layer numbers meta values differently. At the schema ** layer (and the SetCookie and ReadCookie opcodes) the number of ** free pages is not visible. So Cookie[0] is the same as Meta[1]. */ int sqlite3BtreeGetMeta(Btree *p, int idx, u32 *pMeta){ - DbPage *pDbPage = 0; + DbPage *pDbPage; int rc; unsigned char *pP1; BtShared *pBt = p->pBt; sqlite3BtreeEnter(p); @@ -6713,23 +6469,26 @@ unsigned char *pP1; int rc; assert( idx>=1 && idx<=15 ); sqlite3BtreeEnter(p); pBt->db = p->db; - assert( p->inTrans==TRANS_WRITE ); - assert( pBt->pPage1!=0 ); - pP1 = pBt->pPage1->aData; - rc = sqlite3PagerWrite(pBt->pPage1->pDbPage); - if( rc==SQLITE_OK ){ - put4byte(&pP1[36 + idx*4], iMeta); + if( p->inTrans!=TRANS_WRITE ){ + rc = pBt->readOnly ? SQLITE_READONLY : SQLITE_ERROR; + }else{ + assert( pBt->pPage1!=0 ); + pP1 = pBt->pPage1->aData; + rc = sqlite3PagerWrite(pBt->pPage1->pDbPage); + if( rc==SQLITE_OK ){ + put4byte(&pP1[36 + idx*4], iMeta); #ifndef SQLITE_OMIT_AUTOVACUUM - if( idx==7 ){ - assert( pBt->autoVacuum || iMeta==0 ); - assert( iMeta==0 || iMeta==1 ); - pBt->incrVacuum = (u8)iMeta; - } + if( idx==7 ){ + assert( pBt->autoVacuum || iMeta==0 ); + assert( iMeta==0 || iMeta==1 ); + pBt->incrVacuum = iMeta; + } #endif + } } sqlite3BtreeLeave(p); return rc; } @@ -6743,13 +6502,12 @@ */ MemPage *pPage; restoreCursorPosition(pCur); pPage = pCur->apPage[pCur->iPage]; assert( cursorHoldsMutex(pCur) ); - assert( pPage!=0 ); assert( pPage->pBt==pCur->pBt ); - return pPage->aData[pPage->hdrOffset]; + return pPage ? pPage->aData[pPage->hdrOffset] : 0; } /* ** Return the pager associated with a BTree. This routine is used for @@ -6795,13 +6553,13 @@ ** Return 1 if there are 2 ore more references to the page and 0 if ** if this is the first reference to the page. ** ** Also check that the page number is in bounds. */ -static int checkRef(IntegrityCk *pCheck, Pgno iPage, char *zContext){ +static int checkRef(IntegrityCk *pCheck, int iPage, char *zContext){ if( iPage==0 ) return 1; - if( iPage>pCheck->nPage ){ + if( iPage>pCheck->nPage || iPage<0 ){ checkAppendMsg(pCheck, zContext, "invalid page number %d", iPage); return 1; } if( pCheck->anRef[iPage]==1 ){ checkAppendMsg(pCheck, zContext, "2nd reference to page %d", iPage); @@ -6827,11 +6585,10 @@ u8 ePtrmapType; Pgno iPtrmapParent; rc = ptrmapGet(pCheck->pBt, iChild, &ePtrmapType, &iPtrmapParent); if( rc!=SQLITE_OK ){ - if( rc==SQLITE_NOMEM ) pCheck->mallocFailed = 1; checkAppendMsg(pCheck, zContext, "Failed to read ptrmap key=%d", iChild); return; } if( ePtrmapType!=eType || iPtrmapParent!=iParent ){ @@ -6933,10 +6690,11 @@ ** the root of the tree. */ static int checkTreePage( IntegrityCk *pCheck, /* Context for the sanity check */ int iPage, /* Page number of the page to check */ + MemPage *pParent, /* Parent page */ char *zParentContext /* Parent context */ ){ MemPage *pPage; int i, rc, depth, d2, pgno, cnt; int hdr, cellStart; @@ -6943,11 +6701,11 @@ int nCell; u8 *data; BtShared *pBt; int usableSize; char zContext[100]; - char *hit = 0; + char *hit; sqlite3_snprintf(sizeof(zContext), zContext, "Page %d: ", iPage); /* Check that the page exists */ @@ -6954,17 +6712,15 @@ pBt = pCheck->pBt; usableSize = pBt->usableSize; if( iPage==0 ) return 0; if( checkRef(pCheck, iPage, zParentContext) ) return 0; if( (rc = sqlite3BtreeGetPage(pBt, (Pgno)iPage, &pPage, 0))!=0 ){ - if( rc==SQLITE_NOMEM ) pCheck->mallocFailed = 1; checkAppendMsg(pCheck, zContext, "unable to get the page. error code=%d", rc); return 0; } if( (rc = sqlite3BtreeInitPage(pPage))!=0 ){ - assert( rc==SQLITE_CORRUPT ); /* The only possible error from InitPage */ checkAppendMsg(pCheck, zContext, "sqlite3BtreeInitPage() returns error code %d", rc); releasePage(pPage); return 0; } @@ -6972,21 +6728,21 @@ /* Check out all the cells. */ depth = 0; for(i=0; inCell && pCheck->mxErr; i++){ u8 *pCell; - u32 sz; + int sz; CellInfo info; /* Check payload overflow pages */ sqlite3_snprintf(sizeof(zContext), zContext, "On tree page %d cell %d: ", iPage, i); pCell = findCell(pPage,i); sqlite3BtreeParseCellPtr(pPage, pCell, &info); sz = info.nData; - if( !pPage->intKey ) sz += (int)info.nKey; + if( !pPage->intKey ) sz += info.nKey; assert( sz==info.nPayload ); if( sz>info.nLocal ){ int nPage = (sz - info.nLocal + usableSize - 5)/(usableSize - 4); Pgno pgnoOvfl = get4byte(&pCell[info.iOverflow]); #ifndef SQLITE_OMIT_AUTOVACUUM @@ -7004,11 +6760,11 @@ #ifndef SQLITE_OMIT_AUTOVACUUM if( pBt->autoVacuum ){ checkPtrmap(pCheck, pgno, PTRMAP_BTREE, iPage, zContext); } #endif - d2 = checkTreePage(pCheck, pgno, zContext); + d2 = checkTreePage(pCheck,pgno,pPage,zContext); if( i>0 && d2!=depth ){ checkAppendMsg(pCheck, zContext, "Child page depth differs"); } depth = d2; } @@ -7020,11 +6776,11 @@ #ifndef SQLITE_OMIT_AUTOVACUUM if( pBt->autoVacuum ){ checkPtrmap(pCheck, pgno, PTRMAP_BTREE, iPage, 0); } #endif - checkTreePage(pCheck, pgno, zContext); + checkTreePage(pCheck, pgno, pPage, zContext); } /* Check for complete coverage of the page */ data = pPage->aData; @@ -7031,18 +6787,12 @@ hdr = pPage->hdrOffset; hit = sqlite3PageMalloc( pBt->pageSize ); if( hit==0 ){ pCheck->mallocFailed = 1; }else{ - u16 contentOffset = get2byte(&data[hdr+5]); - if (contentOffset > usableSize) { - checkAppendMsg(pCheck, 0, - "Corruption detected in header on page %d",iPage,0); - goto check_page_abort; - } - memset(hit+contentOffset, 0, usableSize-contentOffset); - memset(hit, 1, contentOffset); + memset(hit, 0, usableSize ); + memset(hit, 1, get2byte(&data[hdr+5])); nCell = get2byte(&data[hdr+3]); cellStart = hdr + 12 - 4*pPage->leaf; for(i=0; ipBt; char zErr[100]; @@ -7124,15 +6873,20 @@ sqlite3BtreeLeave(p); return sqlite3DbStrDup(0, "cannot acquire a read lock on the database"); } sCheck.pBt = pBt; sCheck.pPager = pBt->pPager; - sCheck.nPage = pagerPagecount(sCheck.pBt); + sCheck.nPage = pagerPagecount(sCheck.pPager); sCheck.mxErr = mxErr; sCheck.nErr = 0; sCheck.mallocFailed = 0; *pnErr = 0; +#ifndef SQLITE_OMIT_AUTOVACUUM + if( pBt->nTrunc!=0 ){ + sCheck.nPage = pBt->nTrunc; + } +#endif if( sCheck.nPage==0 ){ unlockBtreeIfUnused(pBt); sqlite3BtreeLeave(p); return 0; } @@ -7155,18 +6909,18 @@ checkList(&sCheck, 1, get4byte(&pBt->pPage1->aData[32]), get4byte(&pBt->pPage1->aData[36]), "Main freelist: "); /* Check all the tables. */ - for(i=0; (int)iautoVacuum && aRoot[i]>1 ){ checkPtrmap(&sCheck, aRoot[i], PTRMAP_ROOTPAGE, 0, 0); } #endif - checkTreePage(&sCheck, aRoot[i], "List of tree roots: "); + checkTreePage(&sCheck, aRoot[i], 0, "List of tree roots: "); } /* Make sure every page in the file is referenced */ for(i=1; i<=sCheck.nPage && sCheck.mxErr; i++){ @@ -7187,16 +6941,14 @@ checkAppendMsg(&sCheck, 0, "Pointer map page %d is referenced", i); } #endif } - /* Make sure this analysis did not leave any unref() pages. - ** This is an internal consistency check; an integrity check - ** of the integrity check. + /* Make sure this analysis did not leave any unref() pages */ unlockBtreeIfUnused(pBt); - if( NEVER(nRef != sqlite3PagerRefcount(pBt->pPager)) ){ + if( nRef != sqlite3PagerRefcount(pBt->pPager) ){ checkAppendMsg(&sCheck, 0, "Outstanding page count goes from %d to %d during this analysis", nRef, sqlite3PagerRefcount(pBt->pPager) ); } @@ -7224,10 +6976,21 @@ */ const char *sqlite3BtreeGetFilename(Btree *p){ assert( p->pBt->pPager!=0 ); return sqlite3PagerFilename(p->pBt->pPager); } + +/* +** Return the pathname of the directory that contains the database file. +** +** The pager directory name is invariant as long as the pager is +** open so it is safe to access without the BtShared mutex. +*/ +const char *sqlite3BtreeGetDirname(Btree *p){ + assert( p->pBt->pPager!=0 ); + return sqlite3PagerDirname(p->pBt->pPager); +} /* ** Return the pathname of the journal file for this database. The return ** value of this routine is the same regardless of whether the journal file ** has been created or not. @@ -7238,10 +7001,232 @@ const char *sqlite3BtreeGetJournalname(Btree *p){ assert( p->pBt->pPager!=0 ); return sqlite3PagerJournalname(p->pBt->pPager); } +#ifndef SQLITE_OMIT_VACUUM +/* +** Copy the complete content of pBtFrom into pBtTo. A transaction +** must be active for both files. +** +** The size of file pTo may be reduced by this operation. +** If anything goes wrong, the transaction on pTo is rolled back. +** +** If successful, CommitPhaseOne() may be called on pTo before returning. +** The caller should finish committing the transaction on pTo by calling +** sqlite3BtreeCommit(). +*/ +static int btreeCopyFile(Btree *pTo, Btree *pFrom){ + int rc = SQLITE_OK; + Pgno i; + + Pgno nFromPage; /* Number of pages in pFrom */ + Pgno nToPage; /* Number of pages in pTo */ + Pgno nNewPage; /* Number of pages in pTo after the copy */ + + Pgno iSkip; /* Pending byte page in pTo */ + int nToPageSize; /* Page size of pTo in bytes */ + int nFromPageSize; /* Page size of pFrom in bytes */ + + BtShared *pBtTo = pTo->pBt; + BtShared *pBtFrom = pFrom->pBt; + pBtTo->db = pTo->db; + pBtFrom->db = pFrom->db; + + nToPageSize = pBtTo->pageSize; + nFromPageSize = pBtFrom->pageSize; + + if( pTo->inTrans!=TRANS_WRITE || pFrom->inTrans!=TRANS_WRITE ){ + return SQLITE_ERROR; + } + if( pBtTo->pCursor ){ + return SQLITE_BUSY; + } + + nToPage = pagerPagecount(pBtTo->pPager); + nFromPage = pagerPagecount(pBtFrom->pPager); + iSkip = PENDING_BYTE_PAGE(pBtTo); + + /* Variable nNewPage is the number of pages required to store the + ** contents of pFrom using the current page-size of pTo. + */ + nNewPage = ((i64)nFromPage * (i64)nFromPageSize + (i64)nToPageSize - 1) / + (i64)nToPageSize; + + for(i=1; rc==SQLITE_OK && (i<=nToPage || i<=nNewPage); i++){ + + /* Journal the original page. + ** + ** iSkip is the page number of the locking page (PENDING_BYTE_PAGE) + ** in database *pTo (before the copy). This page is never written + ** into the journal file. Unless i==iSkip or the page was not + ** present in pTo before the copy operation, journal page i from pTo. + */ + if( i!=iSkip && i<=nToPage ){ + DbPage *pDbPage = 0; + rc = sqlite3PagerGet(pBtTo->pPager, i, &pDbPage); + if( rc==SQLITE_OK ){ + rc = sqlite3PagerWrite(pDbPage); + if( rc==SQLITE_OK && i>nFromPage ){ + /* Yeah. It seems wierd to call DontWrite() right after Write(). But + ** that is because the names of those procedures do not exactly + ** represent what they do. Write() really means "put this page in the + ** rollback journal and mark it as dirty so that it will be written + ** to the database file later." DontWrite() undoes the second part of + ** that and prevents the page from being written to the database. The + ** page is still on the rollback journal, though. And that is the + ** whole point of this block: to put pages on the rollback journal. + */ + rc = sqlite3PagerDontWrite(pDbPage); + } + sqlite3PagerUnref(pDbPage); + } + } + + /* Overwrite the data in page i of the target database */ + if( rc==SQLITE_OK && i!=iSkip && i<=nNewPage ){ + + DbPage *pToPage = 0; + sqlite3_int64 iOff; + + rc = sqlite3PagerGet(pBtTo->pPager, i, &pToPage); + if( rc==SQLITE_OK ){ + rc = sqlite3PagerWrite(pToPage); + } + + for( + iOff=(i-1)*nToPageSize; + rc==SQLITE_OK && iOffpPager, iFrom, &pFromPage); + if( rc==SQLITE_OK ){ + char *zTo = sqlite3PagerGetData(pToPage); + char *zFrom = sqlite3PagerGetData(pFromPage); + int nCopy; + + if( nFromPageSize>=nToPageSize ){ + zFrom += ((i-1)*nToPageSize - ((iFrom-1)*nFromPageSize)); + nCopy = nToPageSize; + }else{ + zTo += (((iFrom-1)*nFromPageSize) - (i-1)*nToPageSize); + nCopy = nFromPageSize; + } + + memcpy(zTo, zFrom, nCopy); + sqlite3PagerUnref(pFromPage); + } + } + + if( pToPage ){ + MemPage *p = (MemPage *)sqlite3PagerGetExtra(pToPage); + p->isInit = 0; + sqlite3PagerUnref(pToPage); + } + } + } + + /* If things have worked so far, the database file may need to be + ** truncated. The complex part is that it may need to be truncated to + ** a size that is not an integer multiple of nToPageSize - the current + ** page size used by the pager associated with B-Tree pTo. + ** + ** For example, say the page-size of pTo is 2048 bytes and the original + ** number of pages is 5 (10 KB file). If pFrom has a page size of 1024 + ** bytes and 9 pages, then the file needs to be truncated to 9KB. + */ + if( rc==SQLITE_OK ){ + if( nFromPageSize!=nToPageSize ){ + sqlite3_file *pFile = sqlite3PagerFile(pBtTo->pPager); + i64 iSize = (i64)nFromPageSize * (i64)nFromPage; + i64 iNow = (i64)((nToPage>nNewPage)?nToPage:nNewPage) * (i64)nToPageSize; + i64 iPending = ((i64)PENDING_BYTE_PAGE(pBtTo)-1) *(i64)nToPageSize; + + assert( iSize<=iNow ); + + /* Commit phase one syncs the journal file associated with pTo + ** containing the original data. It does not sync the database file + ** itself. After doing this it is safe to use OsTruncate() and other + ** file APIs on the database file directly. + */ + pBtTo->db = pTo->db; + rc = sqlite3PagerCommitPhaseOne(pBtTo->pPager, 0, 0, 1); + if( iSizeiPending){ + i64 iOff; + for( + iOff=iPending; + rc==SQLITE_OK && iOff<(iPending+nToPageSize); + iOff += nFromPageSize + ){ + DbPage *pFromPage = 0; + Pgno iFrom = (iOff/nFromPageSize)+1; + + if( iFrom==PENDING_BYTE_PAGE(pBtFrom) || iFrom>nFromPage ){ + continue; + } + + rc = sqlite3PagerGet(pBtFrom->pPager, iFrom, &pFromPage); + if( rc==SQLITE_OK ){ + char *zFrom = sqlite3PagerGetData(pFromPage); + rc = sqlite3OsWrite(pFile, zFrom, nFromPageSize, iOff); + sqlite3PagerUnref(pFromPage); + } + } + } + + /* Sync the database file */ + if( rc==SQLITE_OK ){ + rc = sqlite3PagerSync(pBtTo->pPager); + } + }else{ + rc = sqlite3PagerTruncate(pBtTo->pPager, nNewPage); + } + if( rc==SQLITE_OK ){ + pBtTo->pageSizeFixed = 0; + } + } + + if( rc ){ + sqlite3BtreeRollback(pTo); + } + + return rc; +} +int sqlite3BtreeCopyFile(Btree *pTo, Btree *pFrom){ + int rc; + sqlite3BtreeEnter(pTo); + sqlite3BtreeEnter(pFrom); + rc = btreeCopyFile(pTo, pFrom); + sqlite3BtreeLeave(pFrom); + sqlite3BtreeLeave(pTo); + return rc; +} + +#endif /* SQLITE_OMIT_VACUUM */ + /* ** Return non-zero if a transaction is active. */ int sqlite3BtreeIsInTrans(Btree *p){ assert( p==0 || sqlite3_mutex_held(p->db->mutex) ); @@ -7251,26 +7236,19 @@ /* ** Return non-zero if a statement transaction is active. */ int sqlite3BtreeIsInStmt(Btree *p){ assert( sqlite3BtreeHoldsMutex(p) ); - return ALWAYS(p->pBt) && p->pBt->inStmt; + return (p->pBt && p->pBt->inStmt); } /* ** Return non-zero if a read (or write) transaction is active. */ int sqlite3BtreeIsInReadTrans(Btree *p){ - assert( p ); - assert( sqlite3_mutex_held(p->db->mutex) ); - return p->inTrans!=TRANS_NONE; -} - -int sqlite3BtreeIsInBackup(Btree *p){ - assert( p ); - assert( sqlite3_mutex_held(p->db->mutex) ); - return p->nBackup!=0; + assert( sqlite3_mutex_held(p->db->mutex) ); + return (p && (p->inTrans!=TRANS_NONE)); } /* ** This function returns a pointer to a blob of memory associated with ** a single shared-btree. The memory is used by client code for its own Index: src/btree.h ================================================================== --- src/btree.h +++ src/btree.h @@ -11,11 +11,11 @@ ************************************************************************* ** This header file defines the interface that the sqlite B-Tree file ** subsystem. See comments in the source code for a detailed description ** of what each interface routine does. ** -** @(#) $Id: btree.h,v 1.108 2009/02/03 16:51:25 danielk1977 Exp $ +** @(#) $Id: btree.h,v 1.104 2008/10/08 17:58:49 danielk1977 Exp $ */ #ifndef _BTREE_H_ #define _BTREE_H_ /* TODO: This definition is just included so other modules compile. It @@ -96,17 +96,16 @@ int sqlite3BtreeRollbackStmt(Btree*); int sqlite3BtreeCreateTable(Btree*, int*, int flags); int sqlite3BtreeIsInTrans(Btree*); int sqlite3BtreeIsInStmt(Btree*); int sqlite3BtreeIsInReadTrans(Btree*); -int sqlite3BtreeIsInBackup(Btree*); void *sqlite3BtreeSchema(Btree *, int, void(*)(void *)); int sqlite3BtreeSchemaLocked(Btree *); int sqlite3BtreeLockTable(Btree *, int, u8); -int sqlite3BtreeSavepoint(Btree *, int, int); const char *sqlite3BtreeGetFilename(Btree *); +const char *sqlite3BtreeGetDirname(Btree *); const char *sqlite3BtreeGetJournalname(Btree *); int sqlite3BtreeCopyFile(Btree *, Btree *); int sqlite3BtreeIncrVacuum(Btree *); @@ -116,11 +115,11 @@ #define BTREE_INTKEY 1 /* Table has only 64-bit signed integer keys */ #define BTREE_ZERODATA 2 /* Table has keys only - no data */ #define BTREE_LEAFDATA 4 /* Data stored in leaves only. Implies INTKEY */ int sqlite3BtreeDropTable(Btree*, int, int*); -int sqlite3BtreeClearTable(Btree*, int, int*); +int sqlite3BtreeClearTable(Btree*, int); int sqlite3BtreeGetMeta(Btree*, int idx, u32 *pValue); int sqlite3BtreeUpdateMeta(Btree*, int idx, u32 value); void sqlite3BtreeTripAllCursors(Btree*, int); int sqlite3BtreeCursor( Index: src/btreeInt.h ================================================================== --- src/btreeInt.h +++ src/btreeInt.h @@ -7,11 +7,11 @@ ** 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. ** ************************************************************************* -** $Id: btreeInt.h,v 1.42 2009/02/03 16:51:25 danielk1977 Exp $ +** $Id: btreeInt.h,v 1.34 2008/09/30 17:18:17 drh Exp $ ** ** This file implements a external (disk-based) database using BTrees. ** For a detailed discussion of BTrees, refer to ** ** Donald E. Knuth, THE ART OF COMPUTER PROGRAMMING, Volume 3: @@ -202,10 +202,14 @@ ** 4 Page number of next trunk page ** 4 Number of leaf pointers on this page ** * zero or more pages numbers of leaves */ #include "sqliteInt.h" +#include "pager.h" +#include "btree.h" +#include "os.h" +#include /* Round up a number to the next larger multiple of 8. This is used ** to force 8-byte alignment on 64-bit architectures. */ #define ROUND8(x) ((x+7)&~7) @@ -322,11 +326,10 @@ BtShared *pBt; /* Sharable content of this btree */ u8 inTrans; /* TRANS_NONE, TRANS_READ or TRANS_WRITE */ u8 sharable; /* True if we can share pBt with another db */ u8 locked; /* True if db currently has pBt locked */ int wantToLock; /* Number of nested calls to sqlite3BtreeEnter() */ - int nBackup; /* Number of backup operations reading this btree */ Btree *pNext; /* List of other sharable Btrees from the same db */ Btree *pPrev; /* Back pointer of the same list */ }; /* @@ -366,23 +369,24 @@ u8 readOnly; /* True if the underlying file is readonly */ u8 pageSizeFixed; /* True if the page size can no longer be changed */ #ifndef SQLITE_OMIT_AUTOVACUUM u8 autoVacuum; /* True if auto-vacuum is enabled */ u8 incrVacuum; /* True if incr-vacuum is enabled */ + Pgno nTrunc; /* Non-zero if the db will be truncated (incr vacuum) */ #endif u16 pageSize; /* Total number of bytes on a page */ u16 usableSize; /* Number of usable bytes on each page */ - u16 maxLocal; /* Maximum local payload in non-LEAFDATA tables */ - u16 minLocal; /* Minimum local payload in non-LEAFDATA tables */ - u16 maxLeaf; /* Maximum local payload in a LEAFDATA table */ - u16 minLeaf; /* Minimum local payload in a LEAFDATA table */ + int maxLocal; /* Maximum local payload in non-LEAFDATA tables */ + int minLocal; /* Minimum local payload in non-LEAFDATA tables */ + int maxLeaf; /* Maximum local payload in a LEAFDATA table */ + int minLeaf; /* Minimum local payload in a LEAFDATA table */ u8 inTransaction; /* Transaction state */ int nTransaction; /* Number of open transactions (read + write) */ void *pSchema; /* Pointer to space allocated by sqlite3BtreeSchema() */ void (*xFreeSchema)(void*); /* Destructor for BtShared.pSchema */ sqlite3_mutex *mutex; /* Non-recursive mutex required to access this struct */ - Bitvec *pHasContent; /* Set of pages moved to free-list this transaction */ + BusyHandler busyHdr; /* The busy handler for this btree */ #ifndef SQLITE_OMIT_SHARED_CACHE int nRef; /* Number of references to this structure */ BtShared *pNext; /* Next on a list of sharable BtShared structs */ BtLock *pLock; /* List of locks held on this shared-btree struct */ Btree *pExclusive; /* Btree with an EXCLUSIVE lock on the whole db */ @@ -486,14 +490,22 @@ #define CURSOR_INVALID 0 #define CURSOR_VALID 1 #define CURSOR_REQUIRESEEK 2 #define CURSOR_FAULT 3 -/* -** The database page the PENDING_BYTE occupies. This page is never used. +/* The database page the PENDING_BYTE occupies. This page is never used. +** TODO: This macro is very similary to PAGER_MJ_PGNO() in pager.c. They +** should possibly be consolidated (presumably in pager.h). +** +** If disk I/O is omitted (meaning that the database is stored purely +** in memory) then there is no pending byte. */ -# define PENDING_BYTE_PAGE(pBt) PAGER_MJ_PGNO(pBt) +#ifdef SQLITE_OMIT_DISKIO +# define PENDING_BYTE_PAGE(pBt) 0x7fffffff +#else +# define PENDING_BYTE_PAGE(pBt) ((PENDING_BYTE/(pBt)->pageSize)+1) +#endif /* ** A linked list of the following structures is stored at BtShared.pLock. ** Locks are added (or upgraded from READ_LOCK to WRITE_LOCK) when a cursor ** is opened on the table with root page BtShared.iTable. Locks are removed @@ -595,11 +607,11 @@ */ typedef struct IntegrityCk IntegrityCk; struct IntegrityCk { BtShared *pBt; /* The tree being checked out */ Pager *pPager; /* The associated pager. Also accessible by pBt->pPager */ - Pgno nPage; /* Number of pages in the database */ + int nPage; /* Number of pages in the database */ int *anRef; /* Number of times each page is referenced */ int mxErr; /* Stop accumulating errors when this reaches zero */ int nErr; /* Number of messages written to zErrMsg so far */ int mallocFailed; /* A memory allocation error has occurred */ StrAccum errMsg; /* Accumulate the error message text here */ @@ -607,11 +619,11 @@ /* ** Read or write a two- and four-byte big-endian integer values. */ #define get2byte(x) ((x)[0]<<8 | (x)[1]) -#define put2byte(p,v) ((p)[0] = (u8)((v)>>8), (p)[1] = (u8)(v)) +#define put2byte(p,v) ((p)[0] = (v)>>8, (p)[1] = (v)) #define get4byte sqlite3Get4byte #define put4byte sqlite3Put4byte /* ** Internal routines that should be accessed by the btree layer only. Index: src/build.c ================================================================== --- src/build.c +++ src/build.c @@ -20,20 +20,21 @@ ** creating ID lists ** BEGIN TRANSACTION ** COMMIT ** ROLLBACK ** -** $Id: build.c,v 1.517 2009/02/10 10:44:42 danielk1977 Exp $ +** $Id: build.c,v 1.498 2008/10/06 16:18:40 danielk1977 Exp $ */ #include "sqliteInt.h" +#include /* ** This routine is called when a new SQL statement is beginning to ** be parsed. Initialize the pParse structure as needed. */ void sqlite3BeginParse(Parse *pParse, int explainFlag){ - pParse->explain = (u8)explainFlag; + pParse->explain = explainFlag; pParse->nVar = 0; } #ifndef SQLITE_OMIT_SHARED_CACHE /* @@ -184,12 +185,11 @@ /* Change the P4 argument of the first opcode (which will always be ** an OP_Trace) to be the complete text of the current SQL statement. */ VdbeOp *pOp = sqlite3VdbeGetOp(v, 0); if( pOp && pOp->opcode==OP_Trace ){ - sqlite3VdbeChangeP4(v, 0, pParse->zSql, - (int)(pParse->zTail - pParse->zSql)); + sqlite3VdbeChangeP4(v, 0, pParse->zSql, pParse->zTail-pParse->zSql); } } #endif /* SQLITE_OMIT_TRACE */ } @@ -367,12 +367,11 @@ */ static void sqliteDeleteIndex(Index *p){ Index *pOld; const char *zName = p->zName; - pOld = sqlite3HashInsert(&p->pSchema->idxHash, zName, - sqlite3Strlen30(zName)+1, 0); + pOld = sqlite3HashInsert(&p->pSchema->idxHash, zName, strlen(zName)+1, 0); assert( pOld==0 || pOld==p ); freeIndex(p); } /* @@ -408,12 +407,12 @@ ** a single database. This routine is called to reclaim memory ** before the database closes. It is also called during a rollback ** if there were schema changes during the transaction or if a ** schema-cookie mismatch occurs. ** -** If iDb==0 then reset the internal schema tables for all database -** files. If iDb>=1 then reset the internal schema for only the +** If iDb<=0 then reset the internal schema tables for all database +** files. If iDb>=2 then reset the internal schema for only the ** single file indicated. */ void sqlite3ResetInternalSchema(sqlite3 *db, int iDb){ int i, j; assert( iDb>=0 && iDbnDb ); @@ -533,11 +532,11 @@ ** should have already been unlinked from the pSchema->aFKey hash table */ for(pFKey=pTable->pFKey; pFKey; pFKey=pNextFKey){ pNextFKey = pFKey->pNextFrom; assert( sqlite3HashFind(&pTable->pSchema->aFKey, - pFKey->zTo, sqlite3Strlen30(pFKey->zTo)+1)!=pFKey ); + pFKey->zTo, strlen(pFKey->zTo)+1)!=pFKey ); sqlite3DbFree(db, pFKey); } #endif /* Delete the Table structure itself. @@ -564,16 +563,15 @@ assert( db!=0 ); assert( iDb>=0 && iDbnDb ); assert( zTabName && zTabName[0] ); pDb = &db->aDb[iDb]; - p = sqlite3HashInsert(&pDb->pSchema->tblHash, zTabName, - sqlite3Strlen30(zTabName)+1,0); + p = sqlite3HashInsert(&pDb->pSchema->tblHash, zTabName, strlen(zTabName)+1,0); if( p ){ #ifndef SQLITE_OMIT_FOREIGN_KEY for(pF1=p->pFKey; pF1; pF1=pF1->pNextFrom){ - int nTo = sqlite3Strlen30(pF1->zTo) + 1; + int nTo = strlen(pF1->zTo) + 1; pF2 = sqlite3HashFind(&pDb->pSchema->aFKey, pF1->zTo, nTo); if( pF2==pF1 ){ sqlite3HashInsert(&pDb->pSchema->aFKey, pF1->zTo, nTo, pF1->pNextTo); }else{ while( pF2 && pF2->pNextTo!=pF1 ){ pF2=pF2->pNextTo; } @@ -618,43 +616,33 @@ sqlite3TableLock(p, iDb, MASTER_ROOT, 1, SCHEMA_TABLE(iDb)); sqlite3VdbeAddOp2(v, OP_SetNumColumns, 0, 5);/* sqlite_master has 5 columns */ sqlite3VdbeAddOp3(v, OP_OpenWrite, 0, MASTER_ROOT, iDb); } -/* -** Parameter zName points to a nul-terminated buffer containing the name -** of a database ("main", "temp" or the name of an attached db). This -** function returns the index of the named database in db->aDb[], or -** -1 if the named db cannot be found. -*/ -int sqlite3FindDbName(sqlite3 *db, const char *zName){ - int i = -1; /* Database number */ - if( zName ){ - Db *pDb; - int n = sqlite3Strlen30(zName); - for(i=(db->nDb-1), pDb=&db->aDb[i]; i>=0; i--, pDb--){ - if( (!OMIT_TEMPDB || i!=1 ) && n==sqlite3Strlen30(pDb->zName) && - 0==sqlite3StrICmp(pDb->zName, zName) ){ - break; - } - } - } - return i; -} - /* ** The token *pName contains the name of a database (either "main" or ** "temp" or the name of an attached db). This routine returns the ** index of the named database in db->aDb[], or -1 if the named db ** does not exist. */ int sqlite3FindDb(sqlite3 *db, Token *pName){ - int i; /* Database number */ - char *zName; /* Name we are searching for */ + int i = -1; /* Database number */ + int n; /* Number of characters in the name */ + Db *pDb; /* A database whose name space is being searched */ + char *zName; /* Name we are searching for */ + zName = sqlite3NameFromToken(db, pName); - i = sqlite3FindDbName(db, zName); - sqlite3DbFree(db, zName); + if( zName ){ + n = strlen(zName); + for(i=(db->nDb-1), pDb=&db->aDb[i]; i>=0; i--, pDb--){ + if( (!OMIT_TEMPDB || i!=1 ) && n==strlen(pDb->zName) && + 0==sqlite3StrICmp(pDb->zName, zName) ){ + break; + } + } + sqlite3DbFree(db, zName); + } return i; } /* The table or view or trigger name is passed to this routine via tokens ** pName1 and pName2. If the table name was fully qualified, for example: @@ -680,15 +668,11 @@ ){ int iDb; /* Database holding the object */ sqlite3 *db = pParse->db; if( pName2 && pName2->n>0 ){ - if( db->init.busy ) { - sqlite3ErrorMsg(pParse, "corrupt database"); - pParse->nErr++; - return -1; - } + assert( !db->init.busy ); *pUnqual = pName2; iDb = sqlite3FindDb(db, pName1); if( iDb<0 ){ sqlite3ErrorMsg(pParse, "unknown database %T", pName1); pParse->nErr++; @@ -962,11 +946,11 @@ if( p->nCol+1>db->aLimit[SQLITE_LIMIT_COLUMN] ){ sqlite3ErrorMsg(pParse, "too many columns on %s", p->zName); return; } #endif - z = sqlite3NameFromToken(db, pName); + z = sqlite3NameFromToken(pParse->db, pName); if( z==0 ) return; for(i=0; inCol; i++){ if( STRICMP(z, p->aCol[i].zName) ){ sqlite3ErrorMsg(pParse, "duplicate column name: %s", z); sqlite3DbFree(db, z); @@ -973,11 +957,11 @@ return; } } if( (p->nCol & 0x7)==0 ){ Column *aNew; - aNew = sqlite3DbRealloc(db,p->aCol,(p->nCol+8)*sizeof(p->aCol[0])); + aNew = sqlite3DbRealloc(pParse->db,p->aCol,(p->nCol+8)*sizeof(p->aCol[0])); if( aNew==0 ){ sqlite3DbFree(db, z); return; } p->aCol = aNew; @@ -1003,11 +987,11 @@ void sqlite3AddNotNull(Parse *pParse, int onError){ Table *p; int i; if( (p = pParse->pNewTable)==0 ) return; i = p->nCol-1; - if( i>=0 ) p->aCol[i].notNull = (u8)onError; + if( i>=0 ) p->aCol[i].notNull = onError; } /* ** Scan the column type name zType (length nType) and return the ** associated affinity type. @@ -1182,11 +1166,11 @@ zType = pTab->aCol[iCol].zType; } if( zType && sqlite3StrICmp(zType, "INTEGER")==0 && sortOrder==SQLITE_SO_ASC ){ pTab->iPKey = iCol; - pTab->keyConf = (u8)onError; + pTab->keyConf = onError; assert( autoInc==0 || autoInc==1 ); pTab->tabFlags |= autoInc*TF_Autoincrement; }else if( autoInc ){ #ifndef SQLITE_OMIT_AUTOINCREMENT sqlite3ErrorMsg(pParse, "AUTOINCREMENT is only allowed on an " @@ -1346,13 +1330,13 @@ static void identPut(char *z, int *pIdx, char *zSignedIdent){ unsigned char *zIdent = (unsigned char*)zSignedIdent; int i, j, needQuote; i = *pIdx; for(j=0; zIdent[j]; j++){ - if( !sqlite3Isalnum(zIdent[j]) && zIdent[j]!='_' ) break; + if( !isalnum(zIdent[j]) && zIdent[j]!='_' ) break; } - needQuote = zIdent[j]!=0 || sqlite3Isdigit(zIdent[0]) + needQuote = zIdent[j]!=0 || isdigit(zIdent[0]) || sqlite3KeywordCode(zIdent, j)!=TK_ID; if( needQuote ) z[i++] = '"'; for(j=0; zIdent[j]; j++){ z[i++] = zIdent[j]; if( zIdent[j]=='"' ) z[i++] = '"'; @@ -1365,21 +1349,21 @@ /* ** Generate a CREATE TABLE statement appropriate for the given ** table. Memory to hold the text of the statement is obtained ** from sqliteMalloc() and must be freed by the calling function. */ -static char *createTableStmt(sqlite3 *db, Table *p){ +static char *createTableStmt(sqlite3 *db, Table *p, int isTemp){ int i, k, n; char *zStmt; char *zSep, *zSep2, *zEnd, *z; Column *pCol; n = 0; for(pCol = p->aCol, i=0; inCol; i++, pCol++){ n += identLength(pCol->zName); z = pCol->zType; if( z ){ - n += (sqlite3Strlen30(z) + 1); + n += (strlen(z) + 1); } } n += identLength(p->zName); if( n<50 ){ zSep = ""; @@ -1394,24 +1378,25 @@ zStmt = sqlite3Malloc( n ); if( zStmt==0 ){ db->mallocFailed = 1; return 0; } - sqlite3_snprintf(n, zStmt, "CREATE TABLE "); - k = sqlite3Strlen30(zStmt); + sqlite3_snprintf(n, zStmt, + !OMIT_TEMPDB&&isTemp ? "CREATE TEMP TABLE ":"CREATE TABLE "); + k = strlen(zStmt); identPut(zStmt, &k, p->zName); zStmt[k++] = '('; for(pCol=p->aCol, i=0; inCol; i++, pCol++){ sqlite3_snprintf(n-k, &zStmt[k], zSep); - k += sqlite3Strlen30(&zStmt[k]); + k += strlen(&zStmt[k]); zSep = zSep2; identPut(zStmt, &k, pCol->zName); if( (z = pCol->zType)!=0 ){ zStmt[k++] = ' '; - assert( (int)(sqlite3Strlen30(z)+k+1)<=n ); + assert( strlen(z)+k+1<=n ); sqlite3_snprintf(n-k, &zStmt[k], "%s", z); - k += sqlite3Strlen30(z); + k += strlen(z); } } sqlite3_snprintf(n-k, &zStmt[k], "%s", zEnd); return zStmt; } @@ -1559,13 +1544,13 @@ } } /* Compute the complete text of the CREATE statement */ if( pSelect ){ - zStmt = createTableStmt(db, p); + zStmt = createTableStmt(db, p, p->pSchema==db->aDb[1].pSchema); }else{ - n = (int)(pEnd->z - pParse->sNameToken.z) + 1; + n = pEnd->z - pParse->sNameToken.z + 1; zStmt = sqlite3MPrintf(db, "CREATE %s %.*s", zType2, n, pParse->sNameToken.z ); } @@ -1615,21 +1600,20 @@ */ if( db->init.busy && pParse->nErr==0 ){ Table *pOld; FKey *pFKey; Schema *pSchema = p->pSchema; - pOld = sqlite3HashInsert(&pSchema->tblHash, p->zName, - sqlite3Strlen30(p->zName)+1,p); + pOld = sqlite3HashInsert(&pSchema->tblHash, p->zName, strlen(p->zName)+1,p); if( pOld ){ assert( p==pOld ); /* Malloc must have failed inside HashInsert() */ db->mallocFailed = 1; return; } #ifndef SQLITE_OMIT_FOREIGN_KEY for(pFKey=p->pFKey; pFKey; pFKey=pFKey->pNextFrom){ void *data; - int nTo = sqlite3Strlen30(pFKey->zTo) + 1; + int nTo = strlen(pFKey->zTo) + 1; pFKey->pNextTo = sqlite3HashFind(&pSchema->aFKey, pFKey->zTo, nTo); data = sqlite3HashInsert(&pSchema->aFKey, pFKey->zTo, nTo, pFKey); if( data==(void *)pFKey ){ db->mallocFailed = 1; } @@ -1645,11 +1629,11 @@ int nName; assert( !pSelect && pCons && pEnd ); if( pCons->z==0 ){ pCons = pEnd; } - nName = (int)((const char *)pCons->z - zName); + nName = (const char *)pCons->z - zName; p->addColOffset = 13 + sqlite3Utf8CharLen(zName, nName); } #endif } } @@ -1716,13 +1700,13 @@ sEnd = pParse->sLastToken; if( sEnd.z[0]!=0 && sEnd.z[0]!=';' ){ sEnd.z += sEnd.n; } sEnd.n = 0; - n = (int)(sEnd.z - pBegin->z); + n = sEnd.z - pBegin->z; z = (const unsigned char*)pBegin->z; - while( n>0 && (z[n-1]==';' || sqlite3Isspace(z[n-1])) ){ n--; } + while( n>0 && (z[n-1]==';' || isspace(z[n-1])) ){ n--; } sEnd.z = &z[n-1]; sEnd.n = 1; /* Use sqlite3EndTable() to add the view to the SQLITE_MASTER table */ sqlite3EndTable(pParse, 0, &sEnd, 0); @@ -2056,10 +2040,11 @@ Db *pDb = &db->aDb[iDb]; sqlite3BeginWriteOperation(pParse, 1, iDb); #ifndef SQLITE_OMIT_VIRTUALTABLE if( IsVirtual(pTab) ){ + Vdbe *v = sqlite3GetVdbe(pParse); if( v ){ sqlite3VdbeAddOp0(v, OP_VBegin); } } #endif @@ -2182,11 +2167,11 @@ nCol = pFromCol->nExpr; } nByte = sizeof(*pFKey) + nCol*sizeof(pFKey->aCol[0]) + pTo->n + 1; if( pToCol ){ for(i=0; inExpr; i++){ - nByte += sqlite3Strlen30(pToCol->a[i].zName) + 1; + nByte += strlen(pToCol->a[i].zName) + 1; } } pFKey = sqlite3DbMallocZero(db, nByte ); if( pFKey==0 ){ goto fk_end; @@ -2221,21 +2206,21 @@ } } } if( pToCol ){ for(i=0; ia[i].zName); + int n = strlen(pToCol->a[i].zName); pFKey->aCol[i].zCol = z; memcpy(z, pToCol->a[i].zName, n); z[n] = 0; z += n+1; } } pFKey->isDeferred = 0; - pFKey->deleteConf = (u8)(flags & 0xff); - pFKey->updateConf = (u8)((flags >> 8 ) & 0xff); - pFKey->insertConf = (u8)((flags >> 16 ) & 0xff); + pFKey->deleteConf = flags & 0xff; + pFKey->updateConf = (flags >> 8 ) & 0xff; + pFKey->insertConf = (flags >> 16 ) & 0xff; /* Link the foreign key to the table as the last step. */ p->pFKey = pFKey; pFKey = 0; @@ -2257,12 +2242,11 @@ void sqlite3DeferForeignKey(Parse *pParse, int isDeferred){ #ifndef SQLITE_OMIT_FOREIGN_KEY Table *pTab; FKey *pFKey; if( (pTab = pParse->pNewTable)==0 || (pFKey = pTab->pFKey)==0 ) return; - assert( isDeferred==0 || isDeferred==1 ); - pFKey->isDeferred = (u8)isDeferred; + pFKey->isDeferred = isDeferred; #endif } /* ** Generate code that will erase and refill index *pIdx. This is @@ -2415,11 +2399,11 @@ ** sqlite3FixSrcList can never fail. */ assert(0); } pTab = sqlite3LocateTable(pParse, 0, pTblName->a[0].zName, pTblName->a[0].zDatabase); - if( !pTab || db->mallocFailed ) goto exit_create_index; + if( !pTab ) goto exit_create_index; assert( db->aDb[iDb].pSchema==pTab->pSchema ); }else{ assert( pName==0 ); pTab = pParse->pNewTable; if( !pTab ) goto exit_create_index; @@ -2508,31 +2492,31 @@ ** key out of the last column added to the table under construction. ** So create a fake list to simulate this. */ if( pList==0 ){ nullId.z = (u8*)pTab->aCol[pTab->nCol-1].zName; - nullId.n = sqlite3Strlen30((char*)nullId.z); + nullId.n = strlen((char*)nullId.z); pList = sqlite3ExprListAppend(pParse, 0, 0, &nullId); if( pList==0 ) goto exit_create_index; - pList->a[0].sortOrder = (u8)sortOrder; + pList->a[0].sortOrder = sortOrder; } /* Figure out how many bytes of space are required to store explicitly ** specified collation sequence names. */ for(i=0; inExpr; i++){ Expr *pExpr; CollSeq *pColl; if( (pExpr = pList->a[i].pExpr)!=0 && (pColl = pExpr->pColl)!=0 ){ - nExtra += (1 + sqlite3Strlen30(pColl->zName)); + nExtra += (1 + strlen(pColl->zName)); } } /* ** Allocate the index structure. */ - nName = sqlite3Strlen30(zName); + nName = strlen(zName); nCol = pList->nExpr; pIndex = sqlite3DbMallocZero(db, sizeof(Index) + /* Index structure */ sizeof(int)*nCol + /* Index.aiColumn */ sizeof(int)*(nCol+1) + /* Index.aiRowEst */ @@ -2551,12 +2535,12 @@ pIndex->zName = (char *)(&pIndex->aSortOrder[nCol]); zExtra = (char *)(&pIndex->zName[nName+1]); memcpy(pIndex->zName, zName, nName+1); pIndex->pTable = pTab; pIndex->nColumn = pList->nExpr; - pIndex->onError = (u8)onError; - pIndex->autoIndex = (u8)(pName==0); + pIndex->onError = onError; + pIndex->autoIndex = pName==0; pIndex->pSchema = db->aDb[iDb].pSchema; /* Check to see if we should honor DESC requests on index columns */ if( pDb->pSchema->file_format>=4 ){ @@ -2592,11 +2576,11 @@ pIndex->aiColumn[i] = j; if( pListItem->pExpr && pListItem->pExpr->pColl ){ assert( pListItem->pExpr->pColl ); zColl = zExtra; sqlite3_snprintf(nExtra, zExtra, "%s", pListItem->pExpr->pColl->zName); - zExtra += (sqlite3Strlen30(zColl) + 1); + zExtra += (strlen(zColl) + 1); }else{ zColl = pTab->aCol[j].zColl; if( !zColl ){ zColl = db->pDfltColl->zName; } @@ -2604,11 +2588,11 @@ if( !db->init.busy && !sqlite3LocateCollSeq(pParse, zColl, -1) ){ goto exit_create_index; } pIndex->azColl[i] = zColl; requestedSortOrder = pListItem->sortOrder & sortOrderMask; - pIndex->aSortOrder[i] = (u8)requestedSortOrder; + pIndex->aSortOrder[i] = requestedSortOrder; } sqlite3DefaultRowEst(pIndex); if( pTab==pParse->pNewTable ){ /* This routine has been called to create an automatic index as a @@ -2665,12 +2649,11 @@ ** in-memory database structures. */ if( db->init.busy ){ Index *p; p = sqlite3HashInsert(&pIndex->pSchema->idxHash, - pIndex->zName, sqlite3Strlen30(pIndex->zName)+1, - pIndex); + pIndex->zName, strlen(pIndex->zName)+1, pIndex); if( p ){ assert( p==pIndex ); /* Malloc must have failed */ db->mallocFailed = 1; goto exit_create_index; } @@ -2940,11 +2923,11 @@ pNew = sqlite3DbRealloc(db, pArray, newSize*szEntry); if( pNew==0 ){ *pIdx = -1; return pArray; } - *pnAlloc = sqlite3DbMallocSize(db, pNew)/szEntry; + *pnAlloc = newSize; pArray = pNew; } z = (char*)pArray; memset(&z[*pnEntry * szEntry], 0, szEntry); *pIdx = *pnEntry; @@ -3005,88 +2988,16 @@ for(i=0; inId; i++){ if( sqlite3StrICmp(pList->a[i].zName, zName)==0 ) return i; } return -1; } - -/* -** Expand the space allocated for the given SrcList object by -** creating nExtra new slots beginning at iStart. iStart is zero based. -** New slots are zeroed. -** -** For example, suppose a SrcList initially contains two entries: A,B. -** To append 3 new entries onto the end, do this: -** -** sqlite3SrcListEnlarge(db, pSrclist, 3, 2); -** -** After the call above it would contain: A, B, nil, nil, nil. -** If the iStart argument had been 1 instead of 2, then the result -** would have been: A, nil, nil, nil, B. To prepend the new slots, -** the iStart value would be 0. The result then would -** be: nil, nil, nil, A, B. -** -** If a memory allocation fails the SrcList is unchanged. The -** db->mallocFailed flag will be set to true. -*/ -SrcList *sqlite3SrcListEnlarge( - sqlite3 *db, /* Database connection to notify of OOM errors */ - SrcList *pSrc, /* The SrcList to be enlarged */ - int nExtra, /* Number of new slots to add to pSrc->a[] */ - int iStart /* Index in pSrc->a[] of first new slot */ -){ - int i; - - /* Sanity checking on calling parameters */ - assert( iStart>=0 ); - assert( nExtra>=1 ); - if( pSrc==0 || iStart>pSrc->nSrc ){ - assert( db->mallocFailed ); - return pSrc; - } - - /* Allocate additional space if needed */ - if( pSrc->nSrc+nExtra>pSrc->nAlloc ){ - SrcList *pNew; - int nAlloc = pSrc->nSrc+nExtra; - int nGot; - pNew = sqlite3DbRealloc(db, pSrc, - sizeof(*pSrc) + (nAlloc-1)*sizeof(pSrc->a[0]) ); - if( pNew==0 ){ - assert( db->mallocFailed ); - return pSrc; - } - pSrc = pNew; - nGot = (sqlite3DbMallocSize(db, pNew) - sizeof(*pSrc))/sizeof(pSrc->a[0])+1; - pSrc->nAlloc = (u16)nGot; - } - - /* Move existing slots that come after the newly inserted slots - ** out of the way */ - for(i=pSrc->nSrc-1; i>=iStart; i--){ - pSrc->a[i+nExtra] = pSrc->a[i]; - } - pSrc->nSrc += (i16)nExtra; - - /* Zero the newly allocated slots */ - memset(&pSrc->a[iStart], 0, sizeof(pSrc->a[0])*nExtra); - for(i=iStart; ia[i].iCursor = -1; - } - - /* Return a pointer to the enlarged SrcList */ - return pSrc; -} - /* ** Append a new table name to the given SrcList. Create a new SrcList if ** need be. A new entry is created in the SrcList even if pToken is NULL. ** -** A SrcList is returned, or NULL if there is an OOM error. The returned -** SrcList might be the same as the SrcList that was input or it might be -** a new one. If an OOM error does occurs, then the prior value of pList -** that is input to this routine is automatically freed. +** A new SrcList is returned, or NULL if malloc() fails. ** ** If pDatabase is not null, it means that the table has an optional ** database name prefix. Like this: "database.table". The pDatabase ** points to the table name and the pTable points to the database name. ** The SrcList.a[].zName field is filled with the table name which might @@ -3115,16 +3026,23 @@ if( pList==0 ){ pList = sqlite3DbMallocZero(db, sizeof(SrcList) ); if( pList==0 ) return 0; pList->nAlloc = 1; } - pList = sqlite3SrcListEnlarge(db, pList, 1, pList->nSrc); - if( db->mallocFailed ){ - sqlite3SrcListDelete(db, pList); - return 0; + if( pList->nSrc>=pList->nAlloc ){ + SrcList *pNew; + pList->nAlloc *= 2; + pNew = sqlite3DbRealloc(db, pList, + sizeof(*pList) + (pList->nAlloc-1)*sizeof(pList->a[0]) ); + if( pNew==0 ){ + sqlite3SrcListDelete(db, pList); + return 0; + } + pList = pNew; } - pItem = &pList->a[pList->nSrc-1]; + pItem = &pList->a[pList->nSrc]; + memset(pItem, 0, sizeof(pList->a[0])); if( pDatabase && pDatabase->z==0 ){ pDatabase = 0; } if( pDatabase && pTable ){ Token *pTemp = pDatabase; @@ -3131,15 +3049,17 @@ pDatabase = pTable; pTable = pTemp; } pItem->zName = sqlite3NameFromToken(db, pTable); pItem->zDatabase = sqlite3NameFromToken(db, pDatabase); + pItem->iCursor = -1; + pList->nSrc++; return pList; } /* -** Assign VdbeCursor index numbers to all tables in a SrcList +** Assign cursors to all tables in a SrcList */ void sqlite3SrcListAssignCursors(Parse *pParse, SrcList *pList){ int i; struct SrcList_item *pItem; assert(pList || pParse->db->mallocFailed ); @@ -3317,30 +3237,10 @@ if( v ){ sqlite3VdbeAddOp2(v, OP_AutoCommit, 1, 1); } } -/* -** This function is called by the parser when it parses a command to create, -** release or rollback an SQL savepoint. -*/ -void sqlite3Savepoint(Parse *pParse, int op, Token *pName){ - char *zName = sqlite3NameFromToken(pParse->db, pName); - if( zName ){ - Vdbe *v = sqlite3GetVdbe(pParse); -#ifndef SQLITE_OMIT_AUTHORIZATION - static const char *az[] = { "BEGIN", "RELEASE", "ROLLBACK" }; - assert( !SAVEPOINT_BEGIN && SAVEPOINT_RELEASE==1 && SAVEPOINT_ROLLBACK==2 ); -#endif - if( !v || sqlite3AuthCheck(pParse, SQLITE_SAVEPOINT, az[op], zName, 0) ){ - sqlite3DbFree(pParse->db, zName); - return; - } - sqlite3VdbeAddOp4(v, OP_Savepoint, op, 0, 0, zName, P4_DYNAMIC); - } -} - /* ** Make sure the TEMP database is open and available for use. Return ** the number of errors. Leave any error messages in the pParse structure. */ int sqlite3OpenTempDatabase(Parse *pParse){ @@ -3428,18 +3328,26 @@ ** be set for operations that might fail (due to a constraint) part of ** the way through and which will need to undo some writes without having to ** rollback the whole transaction. For operations where all constraints ** can be checked before any changes are made to the database, it is never ** necessary to undo a write and the checkpoint should not be set. +** +** Only database iDb and the temp database are made writable by this call. +** If iDb==0, then the main and temp databases are made writable. If +** iDb==1 then only the temp database is made writable. If iDb>1 then the +** specified auxiliary database and the temp database are made writable. */ void sqlite3BeginWriteOperation(Parse *pParse, int setStatement, int iDb){ Vdbe *v = sqlite3GetVdbe(pParse); if( v==0 ) return; sqlite3CodeVerifySchema(pParse, iDb); pParse->writeMask |= 1<nested==0 ){ sqlite3VdbeAddOp1(v, OP_Statement, iDb); + } + if( (OMIT_TEMPDB || iDb!=1) && pParse->db->aDb[1].pBt!=0 ){ + sqlite3BeginWriteOperation(pParse, setStatement, 1); } } /* ** Check to see if pIndex uses the collating sequence pColl. Return @@ -3594,14 +3502,14 @@ char *zColl = pIdx->azColl[i]; assert( zColl ); pKey->aColl[i] = sqlite3LocateCollSeq(pParse, zColl, -1); pKey->aSortOrder[i] = pIdx->aSortOrder[i]; } - pKey->nField = (u16)nCol; + pKey->nField = nCol; } if( pParse->nErr ){ sqlite3DbFree(db, pKey); pKey = 0; } return pKey; } Index: src/callback.c ================================================================== --- src/callback.c +++ src/callback.c @@ -11,11 +11,11 @@ ************************************************************************* ** ** This file contains functions used to access the internal hash tables ** of user defined functions and collation sequences. ** -** $Id: callback.c,v 1.35 2009/01/31 22:28:49 drh Exp $ +** $Id: callback.c,v 1.32 2008/10/10 17:41:29 drh Exp $ */ #include "sqliteInt.h" /* @@ -54,11 +54,11 @@ ** possible. */ static int synthCollSeq(sqlite3 *db, CollSeq *pColl){ CollSeq *pColl2; char *z = pColl->zName; - int n = sqlite3Strlen30(z); + int n = strlen(z); int i; static const u8 aEnc[] = { SQLITE_UTF16BE, SQLITE_UTF16LE, SQLITE_UTF8 }; for(i=0; i<3; i++){ pColl2 = sqlite3FindCollSeq(db, aEnc[i], z, n, 0); if( pColl2->xCmp!=0 ){ @@ -226,13 +226,12 @@ ** is called to test how well the function passed as the first argument ** matches the request for a function with nArg arguments in a system ** that uses encoding enc. The value returned indicates how well the ** request is matched. A higher value indicates a better match. ** -** The returned value is always between 0 and 6, as follows: +** The returned value is always between 1 and 6, as follows: ** -** 0: Not a match, or if nArg<0 and the function is has no implementation. ** 1: A variable arguments function that prefers UTF-8 when a UTF-16 ** encoding is requested, or vice versa. ** 2: A variable arguments function that uses UTF-16BE when UTF-16LE is ** requested, or vice versa. ** 3: A variable arguments function using the same text encoding. @@ -243,13 +242,11 @@ ** 6: An exact match. ** */ static int matchQuality(FuncDef *p, int nArg, u8 enc){ int match = 0; - if( p->nArg==-1 || p->nArg==nArg - || (nArg==-1 && (p->xFunc!=0 || p->xStep!=0)) - ){ + if( p->nArg==-1 || p->nArg==nArg || nArg==-1 ){ match = 1; if( p->nArg==nArg || nArg==-1 ){ match = 4; } if( enc==p->iPrefEnc ){ @@ -288,11 +285,11 @@ void sqlite3FuncDefInsert( FuncDefHash *pHash, /* The hash table into which to insert */ FuncDef *pDef /* The function definition to insert */ ){ FuncDef *pOther; - int nName = sqlite3Strlen30(pDef->zName); + int nName = strlen(pDef->zName); u8 c1 = (u8)pDef->zName[0]; int h = (sqlite3UpperToLower[c1] + nName) % ArraySize(pHash->a); pOther = functionSearch(pHash, h, pDef->zName, nName); if( pOther ){ pDef->pNext = pOther->pNext; @@ -382,11 +379,11 @@ ** new entry to the hash table and return it. */ if( createFlag && (bestScore<6 || pBest->nArg!=nArg) && (pBest = sqlite3DbMallocZero(db, sizeof(*pBest)+nName+1))!=0 ){ pBest->zName = (char *)&pBest[1]; - pBest->nArg = (u16)nArg; + pBest->nArg = nArg; pBest->iPrefEnc = enc; memcpy(pBest->zName, zName, nName); pBest->zName[nName] = 0; sqlite3FuncDefInsert(&db->aFunc, pBest); } Index: src/date.c ================================================================== --- src/date.c +++ src/date.c @@ -14,11 +14,11 @@ ** ** There is only one exported symbol in this file - the function ** sqlite3RegisterDateTimeFunctions() found at the bottom of the file. ** All other code has file scope. ** -** $Id: date.c,v 1.103 2009/02/04 03:59:25 shane Exp $ +** $Id: date.c,v 1.92 2008/10/13 15:35:09 drh Exp $ ** ** SQLite processes all times and dates as Julian Day numbers. The ** dates and times are stored as the number of days since noon ** in Greenwich on November 24, 4714 B.C. according to the Gregorian ** calendar system. @@ -44,10 +44,11 @@ ** ISBM 0-943396-61-1 ** Willmann-Bell, Inc ** Richmond, Virginia (USA) */ #include "sqliteInt.h" +#include #include #include #include #ifndef SQLITE_OMIT_DATETIME_FUNCS @@ -77,14 +78,14 @@ sqlite3_int64 iJD; /* The julian day number times 86400000 */ int Y, M, D; /* Year, month, and day */ int h, m; /* Hour and minutes */ int tz; /* Timezone offset in minutes */ double s; /* Seconds */ - char validYMD; /* True (1) if Y,M,D are valid */ - char validHMS; /* True (1) if h,m,s are valid */ - char validJD; /* True (1) if iJD is valid */ - char validTZ; /* True (1) if tz is valid */ + char validYMD; /* True if Y,M,D are valid */ + char validHMS; /* True if h,m,s are valid */ + char validJD; /* True if iJD is valid */ + char validTZ; /* True if tz is valid */ }; /* ** Convert zDate into one or more integers. Additional arguments @@ -115,11 +116,11 @@ max = va_arg(ap, int); nextC = va_arg(ap, int); pVal = va_arg(ap, int*); val = 0; while( N-- ){ - if( !sqlite3Isdigit(*zDate) ){ + if( !isdigit(*(u8*)zDate) ){ goto end_getDigits; } val = val*10 + *zDate - '0'; zDate++; } @@ -159,11 +160,11 @@ */ static int parseTimezone(const char *zDate, DateTime *p){ int sgn = 0; int nHr, nMn; int c; - while( sqlite3Isspace(*zDate) ){ zDate++; } + while( isspace(*(u8*)zDate) ){ zDate++; } p->tz = 0; c = *zDate; if( c=='-' ){ sgn = -1; }else if( c=='+' ){ @@ -179,11 +180,11 @@ return 1; } zDate += 5; p->tz = sgn*(nMn + nHr*60); zulu_time: - while( sqlite3Isspace(*zDate) ){ zDate++; } + while( isspace(*(u8*)zDate) ){ zDate++; } return *zDate!=0; } /* ** Parse times of the form HH:MM or HH:MM:SS or HH:MM:SS.FFFF. @@ -203,14 +204,14 @@ zDate++; if( getDigits(zDate, 2, 0, 59, 0, &s)!=1 ){ return 1; } zDate += 2; - if( *zDate=='.' && sqlite3Isdigit(zDate[1]) ){ + if( *zDate=='.' && isdigit((u8)zDate[1]) ){ double rScale = 1.0; zDate++; - while( sqlite3Isdigit(*zDate) ){ + while( isdigit(*(u8*)zDate) ){ ms = ms*10.0 + *zDate - '0'; rScale *= 10.0; zDate++; } ms /= rScale; @@ -222,11 +223,11 @@ p->validHMS = 1; p->h = h; p->m = m; p->s = s + ms; if( parseTimezone(zDate, p) ) return 1; - p->validTZ = (p->tz!=0)?1:0; + p->validTZ = p->tz!=0; return 0; } /* ** Convert from YYYY-MM-DD HH:MM:SS to julian day. We always assume @@ -251,16 +252,16 @@ Y--; M += 12; } A = Y/100; B = 2 - A + (A/4); - X1 = 36525*(Y+4716)/100; - X2 = 306001*(M+1)/10000; - p->iJD = (sqlite3_int64)((X1 + X2 + D + B - 1524.5 ) * 86400000); + X1 = 365.25*(Y+4716); + X2 = 30.6001*(M+1); + p->iJD = (X1 + X2 + D + B - 1524.5)*86400000; p->validJD = 1; if( p->validHMS ){ - p->iJD += p->h*3600000 + p->m*60000 + (sqlite3_int64)(p->s*1000); + p->iJD += p->h*3600000 + p->m*60000 + p->s*1000; if( p->validTZ ){ p->iJD -= p->tz*60000; p->validYMD = 0; p->validHMS = 0; p->validTZ = 0; @@ -291,11 +292,11 @@ } if( getDigits(zDate,4,0,9999,'-',&Y,2,1,12,'-',&M,2,1,31,0,&D)!=3 ){ return 1; } zDate += 10; - while( sqlite3Isspace(*zDate) || 'T'==*(u8*)zDate ){ zDate++; } + while( isspace(*(u8*)zDate) || 'T'==*(u8*)zDate ){ zDate++; } if( parseHhMmSs(zDate, p)==0 ){ /* We got the time */ }else if( *zDate==0 ){ p->validHMS = 0; }else{ @@ -370,18 +371,18 @@ if( !p->validJD ){ p->Y = 2000; p->M = 1; p->D = 1; }else{ - Z = (int)((p->iJD + 43200000)/86400000); - A = (int)((Z - 1867216.25)/36524.25); + Z = (p->iJD + 43200000)/86400000; + A = (Z - 1867216.25)/36524.25; A = Z + 1 + A - (A/4); B = A + 1524; - C = (int)((B - 122.1)/365.25); - D = (36525*C)/100; - E = (int)((B-D)/30.6001); - X1 = (int)(30.6001*E); + C = (B - 122.1)/365.25; + D = 365.25*C; + E = (B-D)/30.6001; + X1 = 30.6001*E; p->D = B - D - X1; p->M = E<14 ? E-1 : E-13; p->Y = p->M>2 ? C - 4716 : C - 4715; } p->validYMD = 1; @@ -392,13 +393,13 @@ */ static void computeHMS(DateTime *p){ int s; if( p->validHMS ) return; computeJD(p); - s = (int)((p->iJD + 43200000) % 86400000); + s = (p->iJD + 43200000) % 86400000; p->s = s/1000.0; - s = (int)p->s; + s = p->s; p->s -= s; p->h = s/3600; s -= p->h*3600; p->m = s/60; p->s += s - p->m*60; @@ -426,11 +427,11 @@ /* ** Compute the difference (in milliseconds) ** between localtime and UTC (a.k.a. GMT) ** for the time value p where p is in UTC. */ -static sqlite3_int64 localtimeOffset(DateTime *p){ +static int localtimeOffset(DateTime *p){ DateTime x, y; time_t t; x = *p; computeYMD_HMS(&x); if( x.Y<1971 || x.Y>=2038 ){ @@ -439,17 +440,17 @@ x.D = 1; x.h = 0; x.m = 0; x.s = 0.0; } else { - int s = (int)(x.s + 0.5); + int s = x.s + 0.5; x.s = s; } x.tz = 0; x.validJD = 0; computeJD(&x); - t = x.iJD/1000 - 21086676*(i64)10000; + t = x.iJD/1000 - 2440587.5*86400.0; #ifdef HAVE_LOCALTIME_R { struct tm sLocal; localtime_r(&t, &sLocal); y.Y = sLocal.tm_year + 1900; @@ -518,12 +519,12 @@ int rc = 1; int n; double r; char *z, zBuf[30]; z = zBuf; - for(n=0; niJD as the number of ** seconds since 1970. Convert to a real julian day number. */ if( strcmp(z, "unixepoch")==0 && p->validJD ){ - p->iJD = p->iJD/86400 + 21086676*(i64)10000000; + p->iJD = p->iJD/86400.0 + 2440587.5*86400000.0; clearYMD_HMS_TZ(p); rc = 0; } #ifndef SQLITE_OMIT_LOCALTIME else if( strcmp(z, "utc")==0 ){ - sqlite3_int64 c1; + int c1; computeJD(p); c1 = localtimeOffset(p); p->iJD -= c1; clearYMD_HMS_TZ(p); p->iJD += c1 - localtimeOffset(p); @@ -573,11 +574,11 @@ ** Move the date to the same time on the next occurrence of ** weekday N where 0==Sunday, 1==Monday, and so forth. If the ** date is already on the appropriate weekday, this is a no-op. */ if( strncmp(z, "weekday ", 8)==0 && getValue(&z[8],&r)>0 - && (n=(int)r)==r && n>=0 && r<7 ){ + && (n=r)==r && n>=0 && r<7 ){ sqlite3_int64 Z; computeYMD_HMS(p); p->validTZ = 0; p->validJD = 0; computeJD(p); @@ -627,11 +628,10 @@ case '5': case '6': case '7': case '8': case '9': { - double rRounder; n = getValue(z, &r); assert( n>=1 ); if( z[n]==':' ){ /* A modifier of the form (+|-)HH:MM:SS.FFF adds (or subtracts) the ** specified number of hours, minutes, seconds, and fractional seconds @@ -639,11 +639,11 @@ ** omitted. */ const char *z2 = z; DateTime tx; sqlite3_int64 day; - if( !sqlite3Isdigit(*z2) ) z2++; + if( !isdigit(*(u8*)z2) ) z2++; memset(&tx, 0, sizeof(tx)); if( parseHhMmSs(z2, &tx) ) break; computeJD(&tx); tx.iJD -= 43200000; day = tx.iJD/86400000; @@ -654,47 +654,42 @@ p->iJD += tx.iJD; rc = 0; break; } z += n; - while( sqlite3Isspace(*z) ) z++; - n = sqlite3Strlen30(z); + while( isspace(*(u8*)z) ) z++; + n = strlen(z); if( n>10 || n<3 ) break; if( z[n-1]=='s' ){ z[n-1] = 0; n--; } computeJD(p); rc = 0; - rRounder = r<0 ? -0.5 : +0.5; if( n==3 && strcmp(z,"day")==0 ){ - p->iJD += (sqlite3_int64)(r*86400000.0 + rRounder); + p->iJD += r*86400000.0 + 0.5; }else if( n==4 && strcmp(z,"hour")==0 ){ - p->iJD += (sqlite3_int64)(r*(86400000.0/24.0) + rRounder); + p->iJD += r*(86400000.0/24.0) + 0.5; }else if( n==6 && strcmp(z,"minute")==0 ){ - p->iJD += (sqlite3_int64)(r*(86400000.0/(24.0*60.0)) + rRounder); + p->iJD += r*(86400000.0/(24.0*60.0)) + 0.5; }else if( n==6 && strcmp(z,"second")==0 ){ - p->iJD += (sqlite3_int64)(r*(86400000.0/(24.0*60.0*60.0)) + rRounder); + p->iJD += r*(86400000.0/(24.0*60.0*60.0)) + 0.5; }else if( n==5 && strcmp(z,"month")==0 ){ int x, y; computeYMD_HMS(p); - p->M += (int)r; + p->M += r; x = p->M>0 ? (p->M-1)/12 : (p->M-12)/12; p->Y += x; p->M -= x*12; p->validJD = 0; computeJD(p); - y = (int)r; + y = r; if( y!=r ){ - p->iJD += (sqlite3_int64)((r - y)*30.0*86400000.0 + rRounder); + p->iJD += (r - y)*30.0*86400000.0 + 0.5; } }else if( n==4 && strcmp(z,"year")==0 ){ - int y = (int)r; computeYMD_HMS(p); - p->Y += y; + p->Y += r; p->validJD = 0; computeJD(p); - if( y!=r ){ - p->iJD += (sqlite3_int64)((r - y)*365.0*86400000.0 + rRounder); - } }else{ rc = 1; } clearYMD_HMS_TZ(p); break; @@ -727,11 +722,11 @@ memset(p, 0, sizeof(*p)); if( argc==0 ){ setDateTimeToCurrent(context, p); }else if( (eType = sqlite3_value_type(argv[0]))==SQLITE_FLOAT || eType==SQLITE_INTEGER ){ - p->iJD = (sqlite3_int64)(sqlite3_value_double(argv[0])*86400000.0 + 0.5); + p->iJD = sqlite3_value_double(argv[0])*86400000.0 + 0.5; p->validJD = 1; }else{ z = sqlite3_value_text(argv[0]); if( !z || parseDateOrTime(context, (char*)z, p) ){ return 1; @@ -850,11 +845,11 @@ int argc, sqlite3_value **argv ){ DateTime x; u64 n; - size_t i,j; + int i, j; char *z; sqlite3 *db; const char *zFmt = (const char*)sqlite3_value_text(argv[0]); char zBuf[100]; if( zFmt==0 || isDate(context, argc-1, argv+1, &x) ) return; @@ -890,21 +885,17 @@ return; /* ERROR. return a NULL */ } i++; } } - testcase( n==sizeof(zBuf)-1 ); - testcase( n==sizeof(zBuf) ); - testcase( n==(u64)db->aLimit[SQLITE_LIMIT_LENGTH]+1 ); - testcase( n==(u64)db->aLimit[SQLITE_LIMIT_LENGTH] ); if( n(u64)db->aLimit[SQLITE_LIMIT_LENGTH] ){ + }else if( n>db->aLimit[SQLITE_LIMIT_LENGTH] ){ sqlite3_result_error_toobig(context); return; }else{ - z = sqlite3DbMallocRaw(db, (int)n); + z = sqlite3DbMallocRaw(db, n); if( z==0 ){ sqlite3_result_error_nomem(context); return; } } @@ -919,11 +910,11 @@ case 'd': sqlite3_snprintf(3, &z[j],"%02d",x.D); j+=2; break; case 'f': { double s = x.s; if( s>59.999 ) s = 59.999; sqlite3_snprintf(7, &z[j],"%06.3f", s); - j += sqlite3Strlen30(&z[j]); + j += strlen(&z[j]); break; } case 'H': sqlite3_snprintf(3, &z[j],"%02d",x.h); j+=2; break; case 'W': /* Fall thru */ case 'j': { @@ -931,14 +922,14 @@ DateTime y = x; y.validJD = 0; y.M = 1; y.D = 1; computeJD(&y); - nDay = (int)((x.iJD-y.iJD+43200000)/86400000); + nDay = (x.iJD - y.iJD)/86400000.0 + 0.5; if( zFmt[i]=='W' ){ int wd; /* 0=Monday, 1=Tuesday, ... 6=Sunday */ - wd = (int)(((x.iJD+43200000)/86400000)%7); + wd = ((x.iJD+43200000)/86400000) % 7; sqlite3_snprintf(3, &z[j],"%02d",(nDay+7-wd)/7); j += 2; }else{ sqlite3_snprintf(4, &z[j],"%03d",nDay+1); j += 3; @@ -945,30 +936,24 @@ } break; } case 'J': { sqlite3_snprintf(20, &z[j],"%.16g",x.iJD/86400000.0); - j+=sqlite3Strlen30(&z[j]); + j+=strlen(&z[j]); break; } case 'm': sqlite3_snprintf(3, &z[j],"%02d",x.M); j+=2; break; case 'M': sqlite3_snprintf(3, &z[j],"%02d",x.m); j+=2; break; case 's': { sqlite3_snprintf(30,&z[j],"%d", (int)(x.iJD/1000.0 - 210866760000.0)); - j += sqlite3Strlen30(&z[j]); + j += strlen(&z[j]); break; } case 'S': sqlite3_snprintf(3,&z[j],"%02d",(int)x.s); j+=2; break; - case 'w': { - z[j++] = (char)(((x.iJD+129600000)/86400000) % 7) + '0'; - break; - } - case 'Y': { - sqlite3_snprintf(5,&z[j],"%04d",x.Y); j+=sqlite3Strlen30(&z[j]); - break; - } + case 'w': z[j++] = (((x.iJD+129600000)/86400000) % 7) + '0'; break; + case 'Y': sqlite3_snprintf(5,&z[j],"%04d",x.Y); j+=strlen(&z[j]);break; default: z[j++] = '%'; break; } } } z[j] = 0; @@ -981,14 +966,13 @@ ** ** This function returns the same value as time('now'). */ static void ctimeFunc( sqlite3_context *context, - int NotUsed, - sqlite3_value **NotUsed2 + int argc, + sqlite3_value **argv ){ - UNUSED_PARAMETER2(NotUsed, NotUsed2); timeFunc(context, 0, 0); } /* ** current_date() @@ -995,14 +979,13 @@ ** ** This function returns the same value as date('now'). */ static void cdateFunc( sqlite3_context *context, - int NotUsed, - sqlite3_value **NotUsed2 + int argc, + sqlite3_value **argv ){ - UNUSED_PARAMETER2(NotUsed, NotUsed2); dateFunc(context, 0, 0); } /* ** current_timestamp() @@ -1009,14 +992,13 @@ ** ** This function returns the same value as datetime('now'). */ static void ctimestampFunc( sqlite3_context *context, - int NotUsed, - sqlite3_value **NotUsed2 + int argc, + sqlite3_value **argv ){ - UNUSED_PARAMETER2(NotUsed, NotUsed2); datetimeFunc(context, 0, 0); } #endif /* !defined(SQLITE_OMIT_DATETIME_FUNCS) */ #ifdef SQLITE_OMIT_DATETIME_FUNCS @@ -1040,23 +1022,13 @@ char *zFormat = (char *)sqlite3_user_data(context); sqlite3 *db; double rT; char zBuf[20]; - UNUSED_PARAMETER(argc); - UNUSED_PARAMETER(argv); - db = sqlite3_context_db_handle(context); sqlite3OsCurrentTime(db->pVfs, &rT); -#ifndef SQLITE_OMIT_FLOATING_POINT t = 86400.0*(rT - 2440587.5) + 0.5; -#else - /* without floating point support, rT will have - ** already lost fractional day precision. - */ - t = 86400 * (rT - 2440587) - 43200; -#endif #ifdef HAVE_GMTIME_R { struct tm sNow; gmtime_r(&t, &sNow); strftime(zBuf, 20, zFormat, &sNow); Index: src/delete.c ================================================================== --- src/delete.c +++ src/delete.c @@ -10,11 +10,11 @@ ** ************************************************************************* ** This file contains C code routines that are called by the parser ** in order to generate code for DELETE FROM statements. ** -** $Id: delete.c,v 1.191 2008/12/23 23:56:22 drh Exp $ +** $Id: delete.c,v 1.182 2008/10/10 23:48:26 drh Exp $ */ #include "sqliteInt.h" /* ** Look up every table that is named in pSrc. If any table is not found, @@ -74,11 +74,11 @@ ){ Vdbe *v; if( IsVirtual(pTab) ) return; v = sqlite3GetVdbe(p); assert( opcode==OP_OpenWrite || opcode==OP_OpenRead ); - sqlite3TableLock(p, iDb, pTab->tnum, (opcode==OP_OpenWrite)?1:0, pTab->zName); + sqlite3TableLock(p, iDb, pTab->tnum, (opcode==OP_OpenWrite), pTab->zName); sqlite3VdbeAddOp2(v, OP_SetNumColumns, 0, pTab->nCol); sqlite3VdbeAddOp3(v, opcode, iCur, pTab->tnum, iDb); VdbeComment((v, "%s", pTab->zName)); } @@ -104,11 +104,11 @@ SrcList *pFrom; Token viewName; pWhere = sqlite3ExprDup(db, pWhere); viewName.z = (u8*)pView->zName; - viewName.n = (unsigned int)sqlite3Strlen30((const char*)viewName.z); + viewName.n = (unsigned int)strlen((const char*)viewName.z); pFrom = sqlite3SrcListAppendFromTerm(pParse, 0, 0, 0, &viewName, pDup, 0,0); pDup = sqlite3SelectNew(pParse, 0, pFrom, pWhere, 0, 0, 0, 0, 0, 0); } sqlite3SelectDestInit(&dest, SRT_EphemTab, iCur); sqlite3Select(pParse, pDup, &dest); @@ -231,21 +231,20 @@ sqlite3 *db; /* Main database structure */ AuthContext sContext; /* Authorization context */ int oldIdx = -1; /* Cursor for the OLD table of AFTER triggers */ NameContext sNC; /* Name context to resolve expressions in */ int iDb; /* Database number */ - int memCnt = -1; /* Memory cell used for change counting */ - int rcauth; /* Value returned by authorization callback */ + int memCnt = 0; /* Memory cell used for change counting */ #ifndef SQLITE_OMIT_TRIGGER int isView; /* True if attempting to delete from a view */ int triggers_exist = 0; /* True if any triggers exist */ #endif - int iBeginAfterTrigger = 0; /* Address of after trigger program */ - int iEndAfterTrigger = 0; /* Exit of after trigger program */ - int iBeginBeforeTrigger = 0; /* Address of before trigger program */ - int iEndBeforeTrigger = 0; /* Exit of before trigger program */ + int iBeginAfterTrigger; /* Address of after trigger program */ + int iEndAfterTrigger; /* Exit of after trigger program */ + int iBeginBeforeTrigger; /* Address of before trigger program */ + int iEndBeforeTrigger; /* Exit of before trigger program */ u32 old_col_mask = 0; /* Mask of OLD.* columns in use */ sContext.pParse = 0; db = pParse->db; if( pParse->nErr || db->mallocFailed ){ @@ -263,11 +262,11 @@ /* Figure out if we have any triggers and if the table being ** deleted from is a view */ #ifndef SQLITE_OMIT_TRIGGER - triggers_exist = sqlite3TriggersExist(pTab, TK_DELETE, 0); + triggers_exist = sqlite3TriggersExist(pParse, pTab, TK_DELETE, 0); isView = pTab->pSelect!=0; #else # define triggers_exist 0 # define isView 0 #endif @@ -280,16 +279,13 @@ goto delete_from_cleanup; } iDb = sqlite3SchemaToIndex(db, pTab->pSchema); assert( iDbnDb ); zDb = db->aDb[iDb].zName; - rcauth = sqlite3AuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, zDb); - assert( rcauth==SQLITE_OK || rcauth==SQLITE_DENY || rcauth==SQLITE_IGNORE ); - if( rcauth==SQLITE_DENY ){ + if( sqlite3AuthCheck(pParse, SQLITE_DELETE, pTab->zName, 0, zDb) ){ goto delete_from_cleanup; } - assert(!isView || triggers_exist); /* If pTab is really a view, make sure it has been initialized. */ if( sqlite3ViewGetColumnNames(pParse, pTab) ){ goto delete_from_cleanup; @@ -371,38 +367,56 @@ #ifndef SQLITE_OMIT_TRUNCATE_OPTIMIZATION /* Special case: A DELETE without a WHERE clause deletes everything. ** It is easier just to erase the whole table. Note, however, that ** this means that the row change count will be incorrect. */ - if( rcauth==SQLITE_OK && pWhere==0 && !triggers_exist && !IsVirtual(pTab) ){ - assert( !isView ); - sqlite3VdbeAddOp3(v, OP_Clear, pTab->tnum, iDb, memCnt); - if( !pParse->nested ){ - sqlite3VdbeChangeP4(v, -1, pTab->zName, P4_STATIC); - } - for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ - assert( pIdx->pSchema==pTab->pSchema ); - sqlite3VdbeAddOp2(v, OP_Clear, pIdx->tnum, iDb); + if( pWhere==0 && !triggers_exist && !IsVirtual(pTab) ){ + if( db->flags & SQLITE_CountRows ){ + /* If counting rows deleted, just count the total number of + ** entries in the table. */ + int addr2; + if( !isView ){ + sqlite3OpenTable(pParse, iCur, iDb, pTab, OP_OpenRead); + } + sqlite3VdbeAddOp2(v, OP_Rewind, iCur, sqlite3VdbeCurrentAddr(v)+2); + addr2 = sqlite3VdbeAddOp2(v, OP_AddImm, memCnt, 1); + sqlite3VdbeAddOp2(v, OP_Next, iCur, addr2); + sqlite3VdbeAddOp1(v, OP_Close, iCur); + } + if( !isView ){ + sqlite3VdbeAddOp2(v, OP_Clear, pTab->tnum, iDb); + if( !pParse->nested ){ + sqlite3VdbeChangeP4(v, -1, pTab->zName, P4_STATIC); + } + for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){ + assert( pIdx->pSchema==pTab->pSchema ); + sqlite3VdbeAddOp2(v, OP_Clear, pIdx->tnum, iDb); + } } }else #endif /* SQLITE_OMIT_TRUNCATE_OPTIMIZATION */ /* The usual case: There is a WHERE clause so we have to scan through ** the table and pick which records to delete. */ { int iRowid = ++pParse->nMem; /* Used for storing rowid values. */ - int iRowSet = ++pParse->nMem; /* Register for rowset of rows to delete */ + + /* Begin the database scan + */ + pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, 0, 0); + if( pWInfo==0 ) goto delete_from_cleanup; - /* Collect rowids of every row to be deleted. + /* Remember the rowid of every item to be deleted. */ - sqlite3VdbeAddOp2(v, OP_Null, 0, iRowSet); - pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, 0, - WHERE_FILL_ROWSET, iRowSet); - if( pWInfo==0 ) goto delete_from_cleanup; + sqlite3VdbeAddOp2(v, IsVirtual(pTab) ? OP_VRowid : OP_Rowid, iCur, iRowid); + sqlite3VdbeAddOp1(v, OP_FifoWrite, iRowid); if( db->flags & SQLITE_CountRows ){ sqlite3VdbeAddOp2(v, OP_AddImm, memCnt, 1); } + + /* End the database scan loop. + */ sqlite3WhereEnd(pWInfo); /* Open the pseudo-table used to store OLD if there are triggers. */ if( triggers_exist ){ @@ -427,11 +441,11 @@ ** an IGNORE constraint, it jumps back to here. */ if( triggers_exist ){ sqlite3VdbeResolveLabel(v, addr); } - addr = sqlite3VdbeAddOp3(v, OP_RowSetRead, iRowSet, end, iRowid); + addr = sqlite3VdbeAddOp2(v, OP_FifoRead, iRowid, end); if( triggers_exist ){ int iData = ++pParse->nMem; /* For storing row data of OLD table */ /* If the record is no longer present in the table, jump to the @@ -494,11 +508,11 @@ ** invoke the callback function. */ if( db->flags & SQLITE_CountRows && pParse->nested==0 && !pParse->trigStack ){ sqlite3VdbeAddOp2(v, OP_ResultRow, memCnt, 1); sqlite3VdbeSetNumCols(v, 1); - sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "rows deleted", SQLITE_STATIC); + sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "rows deleted", P4_STATIC); } delete_from_cleanup: sqlite3AuthContextPop(&sContext); sqlite3SrcListDelete(db, pTabList); Index: src/expr.c ================================================================== --- src/expr.c +++ src/expr.c @@ -10,13 +10,14 @@ ** ************************************************************************* ** This file contains routines used for analyzing expressions and ** for generating VDBE code that evaluates expressions in SQLite. ** -** $Id: expr.c,v 1.411 2009/02/04 03:59:25 shane Exp $ +** $Id: expr.c,v 1.399 2008/10/11 16:47:36 drh Exp $ */ #include "sqliteInt.h" +#include /* ** Return the 'affinity' of the expression pExpr if any. ** ** If pExpr is a column, a reference to a column via an 'AS' alias, @@ -40,13 +41,11 @@ #ifndef SQLITE_OMIT_CAST if( op==TK_CAST ){ return sqlite3AffinityType(&pExpr->token); } #endif - if( (op==TK_AGG_COLUMN || op==TK_COLUMN || op==TK_REGISTER) - && pExpr->pTab!=0 - ){ + if( (op==TK_COLUMN || op==TK_REGISTER) && pExpr->pTab!=0 ){ /* op==TK_REGISTER && pExpr->pTab!=0 happens when pExpr was originally ** a TK_COLUMN but was previously evaluated and cached in a register */ int j = pExpr->iColumn; if( j<0 ) return SQLITE_AFF_INTEGER; assert( pExpr->pTab && jpTab->nCol ); @@ -88,11 +87,11 @@ while( p ){ int op; pColl = p->pColl; if( pColl ) break; op = p->op; - if( (op==TK_AGG_COLUMN || op==TK_COLUMN || op==TK_REGISTER) && p->pTab!=0 ){ + if( (op==TK_COLUMN || op==TK_REGISTER) && p->pTab!=0 ){ /* op==TK_REGISTER && p->pTab!=0 happens when pExpr was originally ** a TK_COLUMN but was previously evaluated and cached in a register */ const char *zColl; int j = p->iColumn; if( j>=0 ){ @@ -187,11 +186,11 @@ ** Return the P5 value that should be used for a binary comparison ** opcode (OP_Eq, OP_Ge etc.) used to compare pExpr1 and pExpr2. */ static u8 binaryCompareP5(Expr *pExpr1, Expr *pExpr2, int jumpIfNull){ u8 aff = (char)sqlite3ExprAffinity(pExpr2); - aff = (u8)sqlite3CompareAffinity(pExpr1, aff) | (u8)jumpIfNull; + aff = sqlite3CompareAffinity(pExpr1, aff) | jumpIfNull; return aff; } /* ** Return a pointer to the collation sequence that should be used by @@ -269,11 +268,11 @@ p4 = sqlite3BinaryCompareCollSeq(pParse, pLeft, pRight); p5 = binaryCompareP5(pLeft, pRight, jumpIfNull); addr = sqlite3VdbeAddOp4(pParse->pVdbe, opcode, in2, dest, in1, (void*)p4, P4_COLLSEQ); - sqlite3VdbeChangeP5(pParse->pVdbe, (u8)p5); + sqlite3VdbeChangeP5(pParse->pVdbe, p5); if( (p5 & SQLITE_AFF_MASK)!=SQLITE_AFF_NONE ){ sqlite3ExprCacheAffinityChange(pParse, in1, 1); sqlite3ExprCacheAffinityChange(pParse, in2, 1); } return addr; @@ -394,11 +393,11 @@ */ sqlite3ExprDelete(db, pLeft); sqlite3ExprDelete(db, pRight); return 0; } - pNew->op = (u8)op; + pNew->op = op; pNew->pLeft = pLeft; pNew->pRight = pRight; pNew->iAgg = -1; pNew->span.z = (u8*)""; if( pToken ){ @@ -566,12 +565,11 @@ }else{ /* Wildcards of the form ":aaa" or "$aaa". Reuse the same variable ** number as the prior appearance of the same name, or if the name ** has never appeared before, reuse the same variable number */ - int i; - u32 n; + int i, n; n = pToken->n; for(i=0; inVarExpr; i++){ Expr *pE; if( (pE = pParse->apVarExpr[i])!=0 && pE->token.n==n @@ -833,11 +831,11 @@ a = sqlite3DbRealloc(db, pList->a, n*sizeof(pList->a[0])); if( a==0 ){ goto no_mem; } pList->a = a; - pList->nAlloc = sqlite3DbMallocSize(db, a)/sizeof(a[0]); + pList->nAlloc = n; } assert( pList->a!=0 ); if( pExpr || pName ){ struct ExprList_item *pItem = &pList->a[pList->nExpr++]; memset(pItem, 0, sizeof(*pItem)); @@ -917,10 +915,11 @@ case TK_FUNCTION: if( pWalker->u.i==2 ) return 0; /* Fall through */ case TK_ID: case TK_COLUMN: + case TK_DOT: case TK_AGG_FUNCTION: case TK_AGG_COLUMN: #ifndef SQLITE_OMIT_SUBQUERY case TK_SELECT: case TK_EXISTS: @@ -927,20 +926,20 @@ testcase( pExpr->op==TK_SELECT ); testcase( pExpr->op==TK_EXISTS ); #endif testcase( pExpr->op==TK_ID ); testcase( pExpr->op==TK_COLUMN ); + testcase( pExpr->op==TK_DOT ); testcase( pExpr->op==TK_AGG_FUNCTION ); testcase( pExpr->op==TK_AGG_COLUMN ); pWalker->u.i = 0; return WRC_Abort; default: return WRC_Continue; } } -static int selectNodeIsConstant(Walker *pWalker, Select *NotUsed){ - UNUSED_PARAMETER(NotUsed); +static int selectNodeIsConstant(Walker *pWalker, Select *pSelect){ pWalker->u.i = 0; return WRC_Abort; } static int exprIsConst(Expr *p, int initFlag){ Walker w; @@ -1033,10 +1032,16 @@ if( sqlite3StrICmp(z, "ROWID")==0 ) return 1; if( sqlite3StrICmp(z, "OID")==0 ) return 1; return 0; } +#ifdef SQLITE_TEST + int sqlite3_enable_in_opt = 1; +#else + #define sqlite3_enable_in_opt 1 +#endif + /* ** Return true if the IN operator optimization is enabled and ** the SELECT statement p exists and is of the ** simple form: ** @@ -1048,10 +1053,11 @@ #ifndef SQLITE_OMIT_SUBQUERY static int isCandidateForInOpt(Select *p){ SrcList *pSrc; ExprList *pEList; Table *pTab; + if( !sqlite3_enable_in_opt ) return 0; /* IN optimization must be enabled */ if( p==0 ) return 0; /* right-hand side of IN is SELECT */ if( p->pPrior ) return 0; /* Not a compound SELECT */ if( p->selFlags & (SF_Distinct|SF_Aggregate) ){ return 0; /* No DISTINCT keyword and no aggregate functions */ } @@ -1058,12 +1064,12 @@ if( p->pGroupBy ) return 0; /* Has no GROUP BY clause */ if( p->pLimit ) return 0; /* Has no LIMIT clause */ if( p->pOffset ) return 0; if( p->pWhere ) return 0; /* Has no WHERE clause */ pSrc = p->pSrc; - assert( pSrc!=0 ); - if( pSrc->nSrc!=1 ) return 0; /* Single term in FROM clause */ + if( pSrc==0 ) return 0; /* A single table in the FROM clause */ + if( pSrc->nSrc!=1 ) return 0; if( pSrc->a[0].pSelect ) return 0; /* FROM clause is not a subquery */ pTab = pSrc->a[0].pTab; if( pTab==0 ) return 0; if( pTab->pSelect ) return 0; /* FROM clause is not a view */ if( IsVirtual(pTab) ) return 0; /* FROM clause not a virtual table */ @@ -1320,11 +1326,11 @@ SelectDest dest; ExprList *pEList; assert( !isRowid ); sqlite3SelectDestInit(&dest, SRT_Set, pExpr->iTable); - dest.affinity = (u8)affinity; + dest.affinity = (int)affinity; assert( (pExpr->iTable&0x0000FFFF)==pExpr->iTable ); if( sqlite3Select(pParse, pExpr->pSelect, &dest) ){ return; } pEList = pExpr->pSelect->pEList; @@ -1449,15 +1455,14 @@ ** z[n] character is guaranteed to be something that does not look ** like the continuation of the number. */ static void codeReal(Vdbe *v, const char *z, int n, int negateFlag, int iMem){ assert( z || v==0 || sqlite3VdbeDb(v)->mallocFailed ); - assert( !z || !sqlite3Isdigit(z[n]) ); - UNUSED_PARAMETER(n); if( z ){ double value; char *zV; + assert( !isdigit(z[n]) ); sqlite3AtoF(z, &value); if( sqlite3IsNaN(value) ){ sqlite3VdbeAddOp2(v, OP_Null, 0, iMem); }else{ if( negateFlag ) value = -value; @@ -1483,11 +1488,11 @@ if( negFlag ) i = -i; sqlite3VdbeAddOp2(v, OP_Integer, i, iMem); }else if( (z = (char*)pExpr->token.z)!=0 ){ int i; int n = pExpr->token.n; - assert( !sqlite3Isdigit(z[n]) ); + assert( !isdigit(z[n]) ); if( sqlite3GetInt32(z, &i) ){ if( negFlag ) i = -i; sqlite3VdbeAddOp2(v, OP_Integer, i, iMem); }else if( sqlite3FitsIn64Bits(z, negFlag) ){ i64 value; @@ -1646,26 +1651,37 @@ } return 0; } /* -** There is a value in register iReg. +** Theres is a value in register iCurrent. We ultimately want +** the value to be in register iTarget. It might be that +** iCurrent and iTarget are the same register. ** ** We are going to modify the value, so we need to make sure it -** is not a cached register. If iReg is a cached register, -** then clear the corresponding cache line. +** is not a cached register. If iCurrent is a cached register, +** then try to move the value over to iTarget. If iTarget is a +** cached register, then clear the corresponding cache line. +** +** Return the register that the value ends up in. */ -void sqlite3ExprWritableRegister(Parse *pParse, int iReg){ +int sqlite3ExprWritableRegister(Parse *pParse, int iCurrent, int iTarget){ int i; - if( usedAsColumnCache(pParse, iReg, iReg) ){ - for(i=0; inColCache; i++){ - if( pParse->aColCache[i].iReg==iReg ){ - pParse->aColCache[i] = pParse->aColCache[--pParse->nColCache]; - pParse->iColCache = pParse->nColCache; - } + assert( pParse->pVdbe!=0 ); + if( !usedAsColumnCache(pParse, iCurrent, iCurrent) ){ + return iCurrent; + } + if( iCurrent!=iTarget ){ + sqlite3VdbeAddOp2(pParse->pVdbe, OP_SCopy, iCurrent, iTarget); + } + for(i=0; inColCache; i++){ + if( pParse->aColCache[i].iReg==iTarget ){ + pParse->aColCache[i] = pParse->aColCache[--pParse->nColCache]; + pParse->iColCache = pParse->nColCache; } } + return iTarget; } /* ** If the last instruction coded is an ephemeral copy of any of ** the registers in the nReg registers beginning with iReg, then @@ -1700,32 +1716,24 @@ ** ** pParse->aAlias[iAlias-1] records the register number where the value ** of the iAlias-th alias is stored. If zero, that means that the ** alias has not yet been computed. */ -static int codeAlias(Parse *pParse, int iAlias, Expr *pExpr, int target){ +static int codeAlias(Parse *pParse, int iAlias, Expr *pExpr){ sqlite3 *db = pParse->db; int iReg; - if( pParse->nAliasAllocnAlias ){ - pParse->aAlias = sqlite3DbReallocOrFree(db, pParse->aAlias, + if( pParse->aAlias==0 ){ + pParse->aAlias = sqlite3DbMallocZero(db, sizeof(pParse->aAlias[0])*pParse->nAlias ); - testcase( db->mallocFailed && pParse->nAliasAlloc>0 ); if( db->mallocFailed ) return 0; - memset(&pParse->aAlias[pParse->nAliasAlloc], 0, - (pParse->nAlias-pParse->nAliasAlloc)*sizeof(pParse->aAlias[0])); - pParse->nAliasAlloc = pParse->nAlias; } assert( iAlias>0 && iAlias<=pParse->nAlias ); iReg = pParse->aAlias[iAlias-1]; if( iReg==0 ){ - if( pParse->disableColCache ){ - iReg = sqlite3ExprCodeTarget(pParse, pExpr, target); - }else{ - iReg = ++pParse->nMem; - sqlite3ExprCode(pParse, pExpr, iReg); - pParse->aAlias[iAlias-1] = iReg; - } + iReg = ++pParse->nMem; + sqlite3ExprCode(pParse, pExpr, iReg); + pParse->aAlias[iAlias-1] = iReg; } return iReg; } /* @@ -1830,11 +1838,11 @@ case TK_REGISTER: { inReg = pExpr->iTable; break; } case TK_AS: { - inReg = codeAlias(pParse, pExpr->iTable, pExpr->pLeft, target); + inReg = codeAlias(pParse, pExpr->iTable, pExpr->pLeft); break; } #ifndef SQLITE_OMIT_CAST case TK_CAST: { /* Expressions of the form: CAST(pLeft AS token) */ @@ -1850,14 +1858,10 @@ testcase( to_op==OP_ToText ); testcase( to_op==OP_ToBlob ); testcase( to_op==OP_ToNumeric ); testcase( to_op==OP_ToInt ); testcase( to_op==OP_ToReal ); - if( inReg!=target ){ - sqlite3VdbeAddOp2(v, OP_SCopy, inReg, target); - inReg = target; - } sqlite3VdbeAddOp1(v, to_op, inReg); testcase( usedAsColumnCache(pParse, inReg, inReg) ); sqlite3ExprCacheAffinityChange(pParse, inReg, 1); break; } @@ -1930,14 +1934,16 @@ break; } case TK_UMINUS: { Expr *pLeft = pExpr->pLeft; assert( pLeft ); - if( pLeft->op==TK_FLOAT ){ - codeReal(v, (char*)pLeft->token.z, pLeft->token.n, 1, target); - }else if( pLeft->op==TK_INTEGER ){ - codeInteger(v, pLeft, 1, target); + if( pLeft->op==TK_FLOAT || pLeft->op==TK_INTEGER ){ + if( pLeft->op==TK_FLOAT ){ + codeReal(v, (char*)pLeft->token.z, pLeft->token.n, 1, target); + }else{ + codeInteger(v, pLeft, 1, target); + } }else{ regFree1 = r1 = sqlite3GetTempReg(pParse); sqlite3VdbeAddOp2(v, OP_Integer, 0, r1); r2 = sqlite3ExprCodeTemp(pParse, pExpr->pLeft, ®Free2); sqlite3VdbeAddOp3(v, OP_Subtract, r2, r1, target); @@ -1950,14 +1956,15 @@ case TK_NOT: { assert( TK_BITNOT==OP_BitNot ); assert( TK_NOT==OP_Not ); testcase( op==TK_BITNOT ); testcase( op==TK_NOT ); - r1 = sqlite3ExprCodeTemp(pParse, pExpr->pLeft, ®Free1); - testcase( regFree1==0 ); - inReg = target; - sqlite3VdbeAddOp2(v, op, r1, inReg); + inReg = sqlite3ExprCodeTarget(pParse, pExpr->pLeft, target); + testcase( inReg==target ); + testcase( usedAsColumnCache(pParse, inReg, inReg) ); + inReg = sqlite3ExprWritableRegister(pParse, inReg, target); + sqlite3VdbeAddOp1(v, op, inReg); break; } case TK_ISNULL: case TK_NOTNULL: { int addr; @@ -2039,11 +2046,11 @@ if( !pColl ) pColl = db->pDfltColl; sqlite3VdbeAddOp4(v, OP_CollSeq, 0, 0, 0, (char *)pColl, P4_COLLSEQ); } sqlite3VdbeAddOp4(v, OP_Function, constMask, r1, target, (char*)pDef, P4_FUNCDEF); - sqlite3VdbeChangeP5(v, (u8)nExpr); + sqlite3VdbeChangeP5(v, nExpr); if( nExpr ){ sqlite3ReleaseTempRange(pParse, r1, nExpr); } sqlite3ExprCacheAffinityChange(pParse, r1, nExpr); break; @@ -2218,11 +2225,11 @@ ExprList *pEList; /* List of WHEN terms */ struct ExprList_item *aListelem; /* Array of WHEN terms */ Expr opCompare; /* The X==Ei expression */ Expr cacheX; /* Cached expression X */ Expr *pX; /* The X expression */ - Expr *pTest = 0; /* X==Ei (form A) or just Ei (form B) */ + Expr *pTest; /* X==Ei (form A) or just Ei (form B) */ assert(pExpr->pList); assert((pExpr->pList->nExpr % 2) == 0); assert(pExpr->pList->nExpr > 0); pEList = pExpr->pList; @@ -2240,11 +2247,10 @@ pTest = &opCompare; } pParse->disableColCache++; for(i=0; i0 ); n = pList->nExpr; for(pItem=pList->a, i=0; iiAlias ){ - int iReg = codeAlias(pParse, pItem->iAlias, pItem->pExpr, target+i); + int iReg = codeAlias(pParse, pItem->iAlias, pItem->pExpr); Vdbe *v = sqlite3GetVdbe(pParse); - if( iReg!=target+i ){ - sqlite3VdbeAddOp2(v, OP_SCopy, iReg, target+i); - } + sqlite3VdbeAddOp2(v, OP_SCopy, iReg, target+i); }else{ sqlite3ExprCode(pParse, pItem->pExpr, target+i); } if( doHardCopy ){ sqlite3ExprHardCopy(pParse, target, n); @@ -3052,11 +3056,11 @@ } return pParse->aTempReg[--pParse->nTempReg]; } void sqlite3ReleaseTempReg(Parse *pParse, int iReg){ if( iReg && pParse->nTempRegaTempReg) ){ - sqlite3ExprWritableRegister(pParse, iReg); + sqlite3ExprWritableRegister(pParse, iReg, iReg); pParse->aTempReg[pParse->nTempReg++] = iReg; } } /* Index: src/func.c ================================================================== --- src/func.c +++ src/func.c @@ -14,13 +14,14 @@ ** ** There is only one exported symbol in this file - the function ** sqliteRegisterBuildinFunctions() found at the bottom of the file. ** All other code has file scope. ** -** $Id: func.c,v 1.222 2009/02/04 03:59:25 shane Exp $ +** $Id: func.c,v 1.203 2008/09/03 17:11:16 drh Exp $ */ #include "sqliteInt.h" +#include #include #include #include "vdbeInt.h" /* @@ -41,21 +42,20 @@ int i; int mask; /* 0 for min() or 0xffffffff for max() */ int iBest; CollSeq *pColl; - assert( argc>1 ); + if( argc==0 ) return; mask = sqlite3_user_data(context)==0 ? 0 : -1; pColl = sqlite3GetFuncCollSeq(context); assert( pColl ); assert( mask==-1 || mask==0 ); iBest = 0; if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return; for(i=1; i=0 ){ - testcase( mask==0 ); iBest = i; } } sqlite3_result_value(context, argv[iBest]); } @@ -63,21 +63,20 @@ /* ** Return the type of the argument. */ static void typeofFunc( sqlite3_context *context, - int NotUsed, + int argc, sqlite3_value **argv ){ const char *z = 0; - UNUSED_PARAMETER(NotUsed); switch( sqlite3_value_type(argv[0]) ){ + case SQLITE_NULL: z = "null"; break; case SQLITE_INTEGER: z = "integer"; break; case SQLITE_TEXT: z = "text"; break; case SQLITE_FLOAT: z = "real"; break; case SQLITE_BLOB: z = "blob"; break; - default: z = "null"; break; } sqlite3_result_text(context, z, -1, SQLITE_STATIC); } @@ -90,11 +89,10 @@ sqlite3_value **argv ){ int len; assert( argc==1 ); - UNUSED_PARAMETER(argc); switch( sqlite3_value_type(argv[0]) ){ case SQLITE_BLOB: case SQLITE_INTEGER: case SQLITE_FLOAT: { sqlite3_result_int(context, sqlite3_value_bytes(argv[0])); @@ -121,11 +119,10 @@ /* ** Implementation of the abs() function */ static void absFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ assert( argc==1 ); - UNUSED_PARAMETER(argc); switch( sqlite3_value_type(argv[0]) ){ case SQLITE_INTEGER: { i64 iVal = sqlite3_value_int64(argv[0]); if( iVal<0 ){ if( (iVal<<1)==0 ){ @@ -168,18 +165,12 @@ const unsigned char *z; const unsigned char *z2; int len; int p0type; i64 p1, p2; - int negP2 = 0; assert( argc==3 || argc==2 ); - if( sqlite3_value_type(argv[1])==SQLITE_NULL - || (argc==3 && sqlite3_value_type(argv[2])==SQLITE_NULL) - ){ - return; - } p0type = sqlite3_value_type(argv[0]); if( p0type==SQLITE_BLOB ){ len = sqlite3_value_bytes(argv[0]); z = sqlite3_value_blob(argv[0]); if( z==0 ) return; @@ -193,59 +184,43 @@ } } p1 = sqlite3_value_int(argv[1]); if( argc==3 ){ p2 = sqlite3_value_int(argv[2]); - if( p2<0 ){ - p2 = -p2; - negP2 = 1; - } }else{ p2 = sqlite3_context_db_handle(context)->aLimit[SQLITE_LIMIT_LENGTH]; } if( p1<0 ){ p1 += len; if( p1<0 ){ p2 += p1; - if( p2<0 ) p2 = 0; p1 = 0; } }else if( p1>0 ){ p1--; - }else if( p2>0 ){ - p2--; - } - if( negP2 ){ - p1 -= p2; - if( p1<0 ){ - p2 += p1; - p1 = 0; - } - } - assert( p1>=0 && p2>=0 ); + } if( p1+p2>len ){ p2 = len-p1; - if( p2<0 ) p2 = 0; } if( p0type!=SQLITE_BLOB ){ while( *z && p1 ){ SQLITE_SKIP_UTF8(z); p1--; } for(z2=z; *z2 && p2; p2--){ SQLITE_SKIP_UTF8(z2); } - sqlite3_result_text(context, (char*)z, (int)(z2-z), SQLITE_TRANSIENT); + sqlite3_result_text(context, (char*)z, z2-z, SQLITE_TRANSIENT); }else{ - sqlite3_result_blob(context, (char*)&z[p1], (int)p2, SQLITE_TRANSIENT); + if( p2<0 ) p2 = 0; + sqlite3_result_blob(context, (char*)&z[p1], p2, SQLITE_TRANSIENT); } } /* ** Implementation of the round() function */ -#ifndef SQLITE_OMIT_FLOATING_POINT static void roundFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ int n = 0; double r; char zBuf[500]; /* larger than the %f representation of the largest double */ assert( argc==1 || argc==2 ); @@ -259,11 +234,10 @@ r = sqlite3_value_double(argv[0]); sqlite3_snprintf(sizeof(zBuf),zBuf,"%.*f",n,r); sqlite3AtoF(zBuf, &r); sqlite3_result_double(context, r); } -#endif /* ** Allocate nByte bytes of space using sqlite3_malloc(). If the ** allocation fails, call sqlite3_result_error_nomem() to notify ** the database handle that malloc() has failed. @@ -272,11 +246,11 @@ char *z; if( nByte>sqlite3_context_db_handle(context)->aLimit[SQLITE_LIMIT_LENGTH] ){ sqlite3_result_error_toobig(context); z = 0; }else{ - z = sqlite3Malloc((int)nByte); + z = sqlite3Malloc(nByte); if( !z && nByte>0 ){ sqlite3_result_error_nomem(context); } } return z; @@ -287,43 +261,43 @@ */ static void upperFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ char *z1; const char *z2; int i, n; - UNUSED_PARAMETER(argc); + if( argc<1 || SQLITE_NULL==sqlite3_value_type(argv[0]) ) return; z2 = (char*)sqlite3_value_text(argv[0]); n = sqlite3_value_bytes(argv[0]); /* Verify that the call to _bytes() does not invalidate the _text() pointer */ assert( z2==(char*)sqlite3_value_text(argv[0]) ); if( z2 ){ z1 = contextMalloc(context, ((i64)n)+1); if( z1 ){ memcpy(z1, z2, n+1); for(i=0; z1[i]; i++){ - z1[i] = (char)sqlite3Toupper(z1[i]); + z1[i] = toupper(z1[i]); } sqlite3_result_text(context, z1, -1, sqlite3_free); } } } static void lowerFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ - u8 *z1; + char *z1; const char *z2; int i, n; - UNUSED_PARAMETER(argc); + if( argc<1 || SQLITE_NULL==sqlite3_value_type(argv[0]) ) return; z2 = (char*)sqlite3_value_text(argv[0]); n = sqlite3_value_bytes(argv[0]); /* Verify that the call to _bytes() does not invalidate the _text() pointer */ assert( z2==(char*)sqlite3_value_text(argv[0]) ); if( z2 ){ z1 = contextMalloc(context, ((i64)n)+1); if( z1 ){ memcpy(z1, z2, n+1); for(i=0; z1[i]; i++){ - z1[i] = sqlite3Tolower(z1[i]); + z1[i] = tolower(z1[i]); } - sqlite3_result_text(context, (char *)z1, -1, sqlite3_free); + sqlite3_result_text(context, z1, -1, sqlite3_free); } } } /* @@ -348,15 +322,14 @@ /* ** Implementation of random(). Return a random integer. */ static void randomFunc( sqlite3_context *context, - int NotUsed, - sqlite3_value **NotUsed2 + int argc, + sqlite3_value **argv ){ sqlite_int64 r; - UNUSED_PARAMETER2(NotUsed, NotUsed2); sqlite3_randomness(sizeof(r), &r); if( (r<<1)==0 ) r = 0; /* Prevent 0x8000.... as the result so that we */ /* can always do abs() of the result */ sqlite3_result_int64(context, r); } @@ -371,11 +344,10 @@ sqlite3_value **argv ){ int n; unsigned char *p; assert( argc==1 ); - UNUSED_PARAMETER(argc); n = sqlite3_value_int(argv[0]); if( n<1 ){ n = 1; } p = contextMalloc(context, n); @@ -389,43 +361,40 @@ ** Implementation of the last_insert_rowid() SQL function. The return ** value is the same as the sqlite3_last_insert_rowid() API function. */ static void last_insert_rowid( sqlite3_context *context, - int NotUsed, - sqlite3_value **NotUsed2 + int arg, + sqlite3_value **argv ){ sqlite3 *db = sqlite3_context_db_handle(context); - UNUSED_PARAMETER2(NotUsed, NotUsed2); sqlite3_result_int64(context, sqlite3_last_insert_rowid(db)); } /* ** Implementation of the changes() SQL function. The return value is the ** same as the sqlite3_changes() API function. */ static void changes( sqlite3_context *context, - int NotUsed, - sqlite3_value **NotUsed2 + int arg, + sqlite3_value **argv ){ sqlite3 *db = sqlite3_context_db_handle(context); - UNUSED_PARAMETER2(NotUsed, NotUsed2); sqlite3_result_int(context, sqlite3_changes(db)); } /* ** Implementation of the total_changes() SQL function. The return value is ** the same as the sqlite3_total_changes() API function. */ static void total_changes( sqlite3_context *context, - int NotUsed, - sqlite3_value **NotUsed2 + int arg, + sqlite3_value **argv ){ sqlite3 *db = sqlite3_context_db_handle(context); - UNUSED_PARAMETER2(NotUsed, NotUsed2); sqlite3_result_int(context, sqlite3_total_changes(db)); } /* ** A structure defining how to do GLOB-style comparisons. @@ -666,15 +635,14 @@ ** argument if the arguments are different. The result is NULL if the ** arguments are equal to each other. */ static void nullifFunc( sqlite3_context *context, - int NotUsed, + int argc, sqlite3_value **argv ){ CollSeq *pColl = sqlite3GetFuncCollSeq(context); - UNUSED_PARAMETER(NotUsed); if( sqlite3MemCompare(argv[0], argv[1], pColl)!=0 ){ sqlite3_result_value(context, argv[0]); } } @@ -682,14 +650,13 @@ ** Implementation of the VERSION(*) function. The result is the version ** of the SQLite library that is running. */ static void versionFunc( sqlite3_context *context, - int NotUsed, - sqlite3_value **NotUsed2 + int argc, + sqlite3_value **argv ){ - UNUSED_PARAMETER2(NotUsed, NotUsed2); sqlite3_result_text(context, sqlite3_version, -1, SQLITE_STATIC); } /* Array for converting from half-bytes (nybbles) into ASCII hex ** digits. */ @@ -708,13 +675,16 @@ ** the argument. If the argument is NULL, the return value is the string ** "NULL". Otherwise, the argument is enclosed in single quotes with ** single-quote escapes. */ static void quoteFunc(sqlite3_context *context, int argc, sqlite3_value **argv){ - assert( argc==1 ); - UNUSED_PARAMETER(argc); + if( argc<1 ) return; switch( sqlite3_value_type(argv[0]) ){ + case SQLITE_NULL: { + sqlite3_result_text(context, "NULL", 4, SQLITE_STATIC); + break; + } case SQLITE_INTEGER: case SQLITE_FLOAT: { sqlite3_result_value(context, argv[0]); break; } @@ -758,16 +728,10 @@ } z[j++] = '\''; z[j] = 0; sqlite3_result_text(context, z, j, sqlite3_free); } - break; - } - default: { - assert( sqlite3_value_type(argv[0])==SQLITE_NULL ); - sqlite3_result_text(context, "NULL", 4, SQLITE_STATIC); - break; } } } /* @@ -781,11 +745,10 @@ ){ int i, n; const unsigned char *pBlob; char *zHex, *z; assert( argc==1 ); - UNUSED_PARAMETER(argc); pBlob = sqlite3_value_blob(argv[0]); n = sqlite3_value_bytes(argv[0]); assert( pBlob==sqlite3_value_blob(argv[0]) ); /* No encoding change */ z = zHex = contextMalloc(context, ((i64)n)*2 + 1); if( zHex ){ @@ -807,16 +770,15 @@ int argc, sqlite3_value **argv ){ i64 n; assert( argc==1 ); - UNUSED_PARAMETER(argc); n = sqlite3_value_int64(argv[0]); if( n>SQLITE_MAX_LENGTH ){ sqlite3_result_error_toobig(context); }else{ - sqlite3_result_zeroblob(context, (int)n); + sqlite3_result_zeroblob(context, n); } } /* ** The replace() function. Three arguments are all strings: call @@ -839,26 +801,16 @@ i64 nOut; /* Maximum size of zOut */ int loopLimit; /* Last zStr[] that might match zPattern[] */ int i, j; /* Loop counters */ assert( argc==3 ); - UNUSED_PARAMETER(argc); zStr = sqlite3_value_text(argv[0]); if( zStr==0 ) return; nStr = sqlite3_value_bytes(argv[0]); assert( zStr==sqlite3_value_text(argv[0]) ); /* No encoding change */ zPattern = sqlite3_value_text(argv[1]); - if( zPattern==0 ){ - assert( sqlite3_value_type(argv[1])==SQLITE_NULL - || sqlite3_context_db_handle(context)->mallocFailed ); - return; - } - if( zPattern[0]==0 ){ - assert( sqlite3_value_type(argv[1])!=SQLITE_NULL ); - sqlite3_result_value(context, argv[0]); - return; - } + if( zPattern==0 || zPattern[0]==0 ) return; nPattern = sqlite3_value_bytes(argv[1]); assert( zPattern==sqlite3_value_text(argv[1]) ); /* No encoding change */ zRep = sqlite3_value_text(argv[2]); if( zRep==0 ) return; nRep = sqlite3_value_bytes(argv[2]); @@ -914,12 +866,12 @@ const unsigned char *zIn; /* Input string */ const unsigned char *zCharSet; /* Set of characters to trim */ int nIn; /* Number of bytes in input */ int flags; /* 1: trimleft 2: trimright 3: trim */ int i; /* Loop counter */ - unsigned char *aLen = 0; /* Length of each character in zCharSet */ - unsigned char **azChar = 0; /* Individual characters in zCharSet */ + unsigned char *aLen; /* Length of each character in zCharSet */ + unsigned char **azChar; /* Individual characters in zCharSet */ int nChar; /* Number of characters in zCharSet */ if( sqlite3_value_type(argv[0])==SQLITE_NULL ){ return; } @@ -948,19 +900,19 @@ } aLen = (unsigned char*)&azChar[nChar]; for(z=zCharSet, nChar=0; *z; nChar++){ azChar[nChar] = (unsigned char *)z; SQLITE_SKIP_UTF8(z); - aLen[nChar] = (u8)(z - azChar[nChar]); + aLen[nChar] = z - azChar[nChar]; } } } if( nChar>0 ){ flags = SQLITE_PTR_TO_INT(sqlite3_user_data(context)); if( flags & 1 ){ while( nIn>0 ){ - int len = 0; + int len; for(i=0; i=nChar ) break; @@ -968,11 +920,11 @@ nIn -= len; } } if( flags & 2 ){ while( nIn>0 ){ - int len = 0; + int len; for(i=0; i=nChar ) break; @@ -1010,14 +962,14 @@ 1, 2, 6, 2, 3, 0, 1, 0, 2, 0, 2, 0, 0, 0, 0, 0, }; assert( argc==1 ); zIn = (u8*)sqlite3_value_text(argv[0]); if( zIn==0 ) zIn = (u8*)""; - for(i=0; zIn[i] && !sqlite3Isalpha(zIn[i]); i++){} + for(i=0; zIn[i] && !isalpha(zIn[i]); i++){} if( zIn[i] ){ u8 prevcode = iCode[zIn[i]&0x7f]; - zResult[0] = sqlite3Toupper(zIn[i]); + zResult[0] = toupper(zIn[i]); for(j=1; j<4 && zIn[i]; i++){ int code = iCode[zIn[i]&0x7f]; if( code>0 ){ if( code!=prevcode ){ prevcode = code; @@ -1086,24 +1038,23 @@ */ static void sumStep(sqlite3_context *context, int argc, sqlite3_value **argv){ SumCtx *p; int type; assert( argc==1 ); - UNUSED_PARAMETER(argc); p = sqlite3_aggregate_context(context, sizeof(*p)); type = sqlite3_value_numeric_type(argv[0]); if( p && type!=SQLITE_NULL ){ p->cnt++; if( type==SQLITE_INTEGER ){ i64 v = sqlite3_value_int64(argv[0]); p->rSum += v; if( (p->approx|p->overflow)==0 ){ i64 iNewSum = p->iSum + v; - int s1 = (int)(p->iSum >> (sizeof(i64)*8-1)); - int s2 = (int)(v >> (sizeof(i64)*8-1)); - int s3 = (int)(iNewSum >> (sizeof(i64)*8-1)); - p->overflow = ((s1&s2&~s3) | (~s1&~s2&s3))?1:0; + int s1 = p->iSum >> (sizeof(i64)*8-1); + int s2 = v >> (sizeof(i64)*8-1); + int s3 = iNewSum >> (sizeof(i64)*8-1); + p->overflow = (s1&s2&~s3) | (~s1&~s2&s3); p->iSum = iNewSum; } }else{ p->rSum += sqlite3_value_double(argv[0]); p->approx = 1; @@ -1131,12 +1082,11 @@ } } static void totalFinalize(sqlite3_context *context){ SumCtx *p; p = sqlite3_aggregate_context(context, 0); - /* (double)0 In case of SQLITE_OMIT_FLOATING_POINT... */ - sqlite3_result_double(context, p ? p->rSum : (double)0); + sqlite3_result_double(context, p ? p->rSum : 0.0); } /* ** The following structure keeps track of state information for the ** count() aggregate function. @@ -1163,18 +1113,13 @@ } /* ** Routines to implement min() and max() aggregate functions. */ -static void minmaxStep( - sqlite3_context *context, - int NotUsed, - sqlite3_value **argv -){ +static void minmaxStep(sqlite3_context *context, int argc, sqlite3_value **argv){ Mem *pArg = (Mem *)argv[0]; Mem *pBest; - UNUSED_PARAMETER(NotUsed); if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return; pBest = (Mem *)sqlite3_aggregate_context(context, sizeof(*pBest)); if( !pBest ) return; @@ -1219,32 +1164,35 @@ sqlite3_value **argv ){ const char *zVal; StrAccum *pAccum; const char *zSep; - int nVal, nSep; - assert( argc==1 || argc==2 ); - if( sqlite3_value_type(argv[0])==SQLITE_NULL ) return; + int nVal, nSep, i; + if( argc==0 || sqlite3_value_type(argv[0])==SQLITE_NULL ) return; pAccum = (StrAccum*)sqlite3_aggregate_context(context, sizeof(*pAccum)); if( pAccum ){ sqlite3 *db = sqlite3_context_db_handle(context); pAccum->useMalloc = 1; pAccum->mxAlloc = db->aLimit[SQLITE_LIMIT_LENGTH]; if( pAccum->nChar ){ - if( argc==2 ){ - zSep = (char*)sqlite3_value_text(argv[1]); - nSep = sqlite3_value_bytes(argv[1]); + if( argc>1 ){ + zSep = (char*)sqlite3_value_text(argv[argc-1]); + nSep = sqlite3_value_bytes(argv[argc-1]); }else{ zSep = ","; nSep = 1; } sqlite3StrAccumAppend(pAccum, zSep, nSep); } - zVal = (char*)sqlite3_value_text(argv[0]); - nVal = sqlite3_value_bytes(argv[0]); - sqlite3StrAccumAppend(pAccum, zVal, nVal); + i = 0; + do{ + zVal = (char*)sqlite3_value_text(argv[i]); + nVal = sqlite3_value_bytes(argv[i]); + sqlite3StrAccumAppend(pAccum, zVal, nVal); + i++; + }while( imallocFailed ){ int rc = sqlite3_overload_function(db, "MATCH", 2); assert( rc==SQLITE_NOMEM || rc==SQLITE_OK ); if( rc==SQLITE_NOMEM ){ db->mallocFailed = 1; @@ -1282,14 +1233,13 @@ } /* ** Set the LIKEOPT flag on the 2-argument function with the given name. */ -static void setLikeOptFlag(sqlite3 *db, const char *zName, u8 flagVal){ +static void setLikeOptFlag(sqlite3 *db, const char *zName, int flagVal){ FuncDef *pDef; - pDef = sqlite3FindFunction(db, zName, sqlite3Strlen30(zName), - 2, SQLITE_UTF8, 0); + pDef = sqlite3FindFunction(db, zName, strlen(zName), 2, SQLITE_UTF8, 0); if( pDef ){ pDef->flags = flagVal; } } @@ -1379,22 +1329,20 @@ FUNCTION(typeof, 1, 0, 0, typeofFunc ), FUNCTION(length, 1, 0, 0, lengthFunc ), FUNCTION(substr, 2, 0, 0, substrFunc ), FUNCTION(substr, 3, 0, 0, substrFunc ), FUNCTION(abs, 1, 0, 0, absFunc ), -#ifndef SQLITE_OMIT_FLOATING_POINT FUNCTION(round, 1, 0, 0, roundFunc ), FUNCTION(round, 2, 0, 0, roundFunc ), -#endif FUNCTION(upper, 1, 0, 0, upperFunc ), FUNCTION(lower, 1, 0, 0, lowerFunc ), FUNCTION(coalesce, 1, 0, 0, 0 ), FUNCTION(coalesce, -1, 0, 0, ifnullFunc ), FUNCTION(coalesce, 0, 0, 0, 0 ), FUNCTION(hex, 1, 0, 0, hexFunc ), FUNCTION(ifnull, 2, 0, 1, ifnullFunc ), - FUNCTION(random, 0, 0, 0, randomFunc ), + FUNCTION(random, -1, 0, 0, randomFunc ), FUNCTION(randomblob, 1, 0, 0, randomBlob ), FUNCTION(nullif, 2, 0, 1, nullifFunc ), FUNCTION(sqlite_version, 0, 0, 0, versionFunc ), FUNCTION(quote, 1, 0, 0, quoteFunc ), FUNCTION(last_insert_rowid, 0, 0, 0, last_insert_rowid), @@ -1412,12 +1360,11 @@ AGGREGATE(sum, 1, 0, 0, sumStep, sumFinalize ), AGGREGATE(total, 1, 0, 0, sumStep, totalFinalize ), AGGREGATE(avg, 1, 0, 0, sumStep, avgFinalize ), AGGREGATE(count, 0, 0, 0, countStep, countFinalize ), AGGREGATE(count, 1, 0, 0, countStep, countFinalize ), - AGGREGATE(group_concat, 1, 0, 0, groupConcatStep, groupConcatFinalize), - AGGREGATE(group_concat, 2, 0, 0, groupConcatStep, groupConcatFinalize), + AGGREGATE(group_concat, -1, 0, 0, groupConcatStep, groupConcatFinalize), LIKEFUNC(glob, 2, &globInfo, SQLITE_FUNC_LIKE|SQLITE_FUNC_CASE), #ifdef SQLITE_CASE_SENSITIVE_LIKE LIKEFUNC(like, 2, &likeInfoAlt, SQLITE_FUNC_LIKE|SQLITE_FUNC_CASE), LIKEFUNC(like, 3, &likeInfoAlt, SQLITE_FUNC_LIKE|SQLITE_FUNC_CASE), Index: src/global.c ================================================================== --- src/global.c +++ src/global.c @@ -10,11 +10,11 @@ ** ************************************************************************* ** ** This file contains definitions of global variables and contants. ** -** $Id: global.c,v 1.12 2009/02/05 16:31:46 drh Exp $ +** $Id: global.c,v 1.8 2008/09/04 17:17:39 danielk1977 Exp $ */ #include "sqliteInt.h" /* An array to map all upper-case characters into their corresponding @@ -59,76 +59,10 @@ 208,145,146,147,148,149,150,151,152,153,218,219,220,221,222,223, /* Dx */ 224,225,162,163,164,165,166,167,168,169,232,203,204,205,206,207, /* Ex */ 239,240,241,242,243,244,245,246,247,248,249,219,220,221,222,255, /* Fx */ #endif }; - -/* -** The following 256 byte lookup table is used to support SQLites built-in -** equivalents to the following standard library functions: -** -** isspace() 0x01 -** isalpha() 0x02 -** isdigit() 0x04 -** isalnum() 0x06 -** isxdigit() 0x08 -** toupper() 0x20 -** -** Bit 0x20 is set if the mapped character requires translation to upper -** case. i.e. if the character is a lower-case ASCII character. -** If x is a lower-case ASCII character, then its upper-case equivalent -** is (x - 0x20). Therefore toupper() can be implemented as: -** -** (x & ~(map[x]&0x20)) -** -** Standard function tolower() is implemented using the sqlite3UpperToLower[] -** array. tolower() is used more often than toupper() by SQLite. -** -** SQLite's versions are identical to the standard versions assuming a -** locale of "C". They are implemented as macros in sqliteInt.h. -*/ -#ifdef SQLITE_ASCII -const unsigned char sqlite3CtypeMap[256] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 00..07 ........ */ - 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x00, 0x00, /* 08..0f ........ */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 10..17 ........ */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 18..1f ........ */ - 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 20..27 !"#$%&' */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 28..2f ()*+,-./ */ - 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, 0x0c, /* 30..37 01234567 */ - 0x0c, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 38..3f 89:;<=>? */ - - 0x00, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x0a, 0x02, /* 40..47 @ABCDEFG */ - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* 48..4f HIJKLMNO */ - 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, /* 50..57 PQRSTUVW */ - 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, /* 58..5f XYZ[\]^_ */ - 0x00, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x2a, 0x22, /* 60..67 `abcdefg */ - 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, /* 68..6f hijklmno */ - 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, /* 70..77 pqrstuvw */ - 0x22, 0x22, 0x22, 0x00, 0x00, 0x00, 0x00, 0x00, /* 78..7f xyz{|}~. */ - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 80..87 ........ */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 88..8f ........ */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 90..97 ........ */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 98..9f ........ */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* a0..a7 ........ */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* a8..af ........ */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* b0..b7 ........ */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* b8..bf ........ */ - - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* c0..c7 ........ */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* c8..cf ........ */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* d0..d7 ........ */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* d8..df ........ */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* e0..e7 ........ */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* e8..ef ........ */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* f0..f7 ........ */ - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 /* f8..ff ........ */ -}; -#endif - - /* ** The following singleton contains the global configuration for ** the SQLite library. */ @@ -137,54 +71,15 @@ 1, /* bCoreMutex */ SQLITE_THREADSAFE==1, /* bFullMutex */ 0x7ffffffe, /* mxStrlen */ 100, /* szLookaside */ 500, /* nLookaside */ - {0,0,0,0,0,0,0,0}, /* m */ - {0,0,0,0,0,0,0,0,0}, /* mutex */ - {0,0,0,0,0,0,0,0,0,0,0}, /* pcache */ - (void*)0, /* pHeap */ - 0, /* nHeap */ - 0, 0, /* mnHeap, mxHeap */ - (void*)0, /* pScratch */ - 0, /* szScratch */ - 0, /* nScratch */ - (void*)0, /* pPage */ - 0, /* szPage */ - 0, /* nPage */ - 0, /* mxParserStack */ - 0, /* sharedCacheEnabled */ - /* All the rest need to always be zero */ - 0, /* isInit */ - 0, /* inProgress */ - 0, /* isMallocInit */ - 0, /* pInitMutex */ - 0, /* nRefInitMutex */ + /* Other fields all default to zero */ }; /* ** Hash table for global functions - functions common to all ** database connections. After initialization, this table is ** read-only. */ SQLITE_WSD FuncDefHash sqlite3GlobalFunctions; - -/* -** The value of the "pending" byte must be 0x40000000 (1 byte past the -** 1-gibabyte boundary) in a compatible database. SQLite never uses -** the database page that contains the pending byte. It never attempts -** to read or write that page. The pending byte page is set assign -** for use by the VFS layers as space for managing file locks. -** -** During testing, it is often desirable to move the pending byte to -** a different position in the file. This allows code that has to -** deal with the pending byte to run on files that are much smaller -** than 1 GiB. The sqlite3_test_control() interface can be used to -** move the pending byte. -** -** IMPORTANT: Changing the pending byte to any value other than -** 0x40000000 results in an incompatible database file format! -** Changing the pending byte during operating results in undefined -** and dileterious behavior. -*/ -int sqlite3PendingByte = 0x40000000; Index: src/hash.c ================================================================== --- src/hash.c +++ src/hash.c @@ -10,11 +10,11 @@ ** ************************************************************************* ** This is the implementation of generic hash-tables ** used in SQLite. ** -** $Id: hash.c,v 1.33 2009/01/09 01:12:28 drh Exp $ +** $Id: hash.c,v 1.31 2008/10/10 17:41:29 drh Exp $ */ #include "sqliteInt.h" #include /* Turn bulk memory into a hash table object by initializing the @@ -46,11 +46,11 @@ sqlite3_free(pH->ht); pH->ht = 0; pH->htsize = 0; while( elem ){ HashElem *next_elem = elem->next; - if( pH->copyKey ){ + if( pH->copyKey && elem->pKey ){ sqlite3_free(elem->pKey); } sqlite3_free(elem); elem = next_elem; } @@ -61,11 +61,11 @@ ** Hash and comparison functions when the mode is SQLITE_HASH_STRING */ static int strHash(const void *pKey, int nKey){ const char *z = (const char *)pKey; int h = 0; - if( nKey<=0 ) nKey = sqlite3Strlen30(z); + if( nKey<=0 ) nKey = strlen(z); while( nKey > 0 ){ h = (h<<3) ^ h ^ sqlite3UpperToLower[(unsigned char)*z++]; nKey--; } return h & 0x7fffffff; Index: src/insert.c ================================================================== --- src/insert.c +++ src/insert.c @@ -10,11 +10,11 @@ ** ************************************************************************* ** This file contains C code routines that are called by the parser ** to handle INSERT statements in SQLite. ** -** $Id: insert.c,v 1.256 2008/12/10 21:19:57 drh Exp $ +** $Id: insert.c,v 1.249 2008/08/20 16:35:10 drh Exp $ */ #include "sqliteInt.h" /* ** Set P4 of the most recently inserted opcode to a column affinity @@ -386,28 +386,27 @@ int iDb; /* Index of database holding TABLE */ Db *pDb; /* The database containing table being inserted into */ int appendFlag = 0; /* True if the insert is likely to be an append */ /* Register allocations */ - int regFromSelect = 0;/* Base register for data coming from SELECT */ + int regFromSelect; /* Base register for data coming from SELECT */ int regAutoinc = 0; /* Register holding the AUTOINCREMENT counter */ int regRowCount = 0; /* Memory cell used for the row counter */ int regIns; /* Block of regs holding rowid+data being inserted */ int regRowid; /* registers holding insert rowid */ int regData; /* register holding first column to insert */ int regRecord; /* Holds the assemblied row record */ - int regEof = 0; /* Register recording end of SELECT data */ + int regEof; /* Register recording end of SELECT data */ int *aRegIdx = 0; /* One register allocated to each index */ #ifndef SQLITE_OMIT_TRIGGER int isView; /* True if attempting to insert into a view */ int triggers_exist = 0; /* True if there are FOR EACH ROW triggers */ #endif db = pParse->db; - memset(&dest, 0, sizeof(dest)); if( pParse->nErr || db->mallocFailed ){ goto insert_cleanup; } /* Locate the table into which we will be inserting new information. @@ -429,11 +428,11 @@ /* Figure out if we have any triggers and if the table being ** inserted into is a view */ #ifndef SQLITE_OMIT_TRIGGER - triggers_exist = sqlite3TriggersExist(pTab, TK_INSERT, 0); + triggers_exist = sqlite3TriggersExist(pParse, pTab, TK_INSERT, 0); isView = pTab->pSelect!=0; #else # define triggers_exist 0 # define isView 0 #endif @@ -571,28 +570,28 @@ ** if EOF goto M ** insert row from R..R+n into temp table ** goto L ** M: ... */ - int regRec; /* Register to hold packed record */ - int regTempRowid; /* Register to hold temp table ROWID */ - int addrTop; /* Label "L" */ - int addrIf; /* Address of jump to M */ + int regRec; /* Register to hold packed record */ + int regRowid; /* Register to hold temp table ROWID */ + int addrTop; /* Label "L" */ + int addrIf; /* Address of jump to M */ srcTab = pParse->nTab++; regRec = sqlite3GetTempReg(pParse); - regTempRowid = sqlite3GetTempReg(pParse); + regRowid = sqlite3GetTempReg(pParse); sqlite3VdbeAddOp2(v, OP_OpenEphemeral, srcTab, nColumn); addrTop = sqlite3VdbeAddOp1(v, OP_Yield, dest.iParm); addrIf = sqlite3VdbeAddOp1(v, OP_If, regEof); sqlite3VdbeAddOp3(v, OP_MakeRecord, regFromSelect, nColumn, regRec); - sqlite3VdbeAddOp2(v, OP_NewRowid, srcTab, regTempRowid); - sqlite3VdbeAddOp3(v, OP_Insert, srcTab, regRec, regTempRowid); + sqlite3VdbeAddOp2(v, OP_NewRowid, srcTab, regRowid); + sqlite3VdbeAddOp3(v, OP_Insert, srcTab, regRec, regRowid); sqlite3VdbeAddOp2(v, OP_Goto, 0, addrTop); sqlite3VdbeJumpHere(v, addrIf); sqlite3ReleaseTempReg(pParse, regRec); - sqlite3ReleaseTempReg(pParse, regTempRowid); + sqlite3ReleaseTempReg(pParse, regRowid); } }else{ /* This is the case if the data for the INSERT is coming from a VALUES ** clause */ @@ -689,10 +688,11 @@ } /* If this is not a view, open the table and and all indices */ if( !isView ){ int nIdx; + int i; baseCur = pParse->nTab; nIdx = sqlite3OpenTableAndIndices(pParse, pTab, baseCur, OP_OpenWrite); aRegIdx = sqlite3DbMallocRaw(db, sizeof(int)*(nIdx+1)); if( aRegIdx==0 ){ @@ -744,33 +744,33 @@ /* Run the BEFORE and INSTEAD OF triggers, if there are any */ endOfLoop = sqlite3VdbeMakeLabel(v); if( triggers_exist & TRIGGER_BEFORE ){ - int regTrigRowid; + int regRowid; int regCols; int regRec; /* build the NEW.* reference row. Note that if there is an INTEGER ** PRIMARY KEY into which a NULL is being inserted, that NULL will be ** translated into a unique ID for the row. But on a BEFORE trigger, ** we do not know what the unique ID will be (because the insert has ** not happened yet) so we substitute a rowid of -1 */ - regTrigRowid = sqlite3GetTempReg(pParse); + regRowid = sqlite3GetTempReg(pParse); if( keyColumn<0 ){ - sqlite3VdbeAddOp2(v, OP_Integer, -1, regTrigRowid); + sqlite3VdbeAddOp2(v, OP_Integer, -1, regRowid); }else if( useTempTable ){ - sqlite3VdbeAddOp3(v, OP_Column, srcTab, keyColumn, regTrigRowid); + sqlite3VdbeAddOp3(v, OP_Column, srcTab, keyColumn, regRowid); }else{ int j1; assert( pSelect==0 ); /* Otherwise useTempTable is true */ - sqlite3ExprCode(pParse, pList->a[keyColumn].pExpr, regTrigRowid); - j1 = sqlite3VdbeAddOp1(v, OP_NotNull, regTrigRowid); - sqlite3VdbeAddOp2(v, OP_Integer, -1, regTrigRowid); + sqlite3ExprCode(pParse, pList->a[keyColumn].pExpr, regRowid); + j1 = sqlite3VdbeAddOp1(v, OP_NotNull, regRowid); + sqlite3VdbeAddOp2(v, OP_Integer, -1, regRowid); sqlite3VdbeJumpHere(v, j1); - sqlite3VdbeAddOp1(v, OP_MustBeInt, regTrigRowid); + sqlite3VdbeAddOp1(v, OP_MustBeInt, regRowid); } /* Cannot have triggers on a virtual table. If it were possible, ** this block would have to account for hidden column. */ @@ -805,13 +805,13 @@ ** table column affinities. */ if( !isView ){ sqlite3TableAffinityStr(v, pTab); } - sqlite3VdbeAddOp3(v, OP_Insert, newIdx, regRec, regTrigRowid); + sqlite3VdbeAddOp3(v, OP_Insert, newIdx, regRec, regRowid); sqlite3ReleaseTempReg(pParse, regRec); - sqlite3ReleaseTempReg(pParse, regTrigRowid); + sqlite3ReleaseTempReg(pParse, regRowid); sqlite3ReleaseTempRange(pParse, regCols, pTab->nCol); /* Fire BEFORE or INSTEAD OF triggers */ if( sqlite3CodeRowTrigger(pParse, TK_INSERT, 0, TRIGGER_BEFORE, pTab, newIdx, -1, onError, endOfLoop, 0, 0) ){ @@ -933,10 +933,11 @@ pParse, pTab, baseCur, regIns, aRegIdx, + 0, 0, (triggers_exist & TRIGGER_AFTER)!=0 ? newIdx : -1, appendFlag ); } @@ -989,11 +990,11 @@ ** invoke the callback function. */ if( db->flags & SQLITE_CountRows && pParse->nested==0 && !pParse->trigStack ){ sqlite3VdbeAddOp2(v, OP_ResultRow, regRowCount, 1); sqlite3VdbeSetNumCols(v, 1); - sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "rows inserted", SQLITE_STATIC); + sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "rows inserted", P4_STATIC); } insert_cleanup: sqlite3SrcListDelete(db, pTabList); sqlite3ExprListDelete(db, pList); @@ -1092,12 +1093,11 @@ ){ int i; Vdbe *v; int nCol; int onError; - int j1; /* Addresss of jump instruction */ - int j2 = 0, j3; /* Addresses of jump instructions */ + int j1, j2, j3; /* Addresses of jump instructions */ int regData; /* Register containing first data column */ int iCur; Index *pIdx; int seenReplace = 0; int hasTwoRowids = (isUpdate && rowidChng); @@ -1270,30 +1270,30 @@ case OE_Rollback: case OE_Abort: case OE_Fail: { int j, n1, n2; char zErrMsg[200]; - sqlite3_snprintf(ArraySize(zErrMsg), zErrMsg, + sqlite3_snprintf(sizeof(zErrMsg), zErrMsg, pIdx->nColumn>1 ? "columns " : "column "); - n1 = sqlite3Strlen30(zErrMsg); - for(j=0; jnColumn && n1nColumn && n1aCol[pIdx->aiColumn[j]].zName; - n2 = sqlite3Strlen30(zCol); + n2 = strlen(zCol); if( j>0 ){ - sqlite3_snprintf(ArraySize(zErrMsg)-n1, &zErrMsg[n1], ", "); + sqlite3_snprintf(sizeof(zErrMsg)-n1, &zErrMsg[n1], ", "); n1 += 2; } - if( n1+n2>ArraySize(zErrMsg)-30 ){ - sqlite3_snprintf(ArraySize(zErrMsg)-n1, &zErrMsg[n1], "..."); + if( n1+n2>sizeof(zErrMsg)-30 ){ + sqlite3_snprintf(sizeof(zErrMsg)-n1, &zErrMsg[n1], "..."); n1 += 3; break; }else{ - sqlite3_snprintf(ArraySize(zErrMsg)-n1, &zErrMsg[n1], "%s", zCol); + sqlite3_snprintf(sizeof(zErrMsg)-n1, &zErrMsg[n1], "%s", zCol); n1 += n2; } } - sqlite3_snprintf(ArraySize(zErrMsg)-n1, &zErrMsg[n1], + sqlite3_snprintf(sizeof(zErrMsg)-n1, &zErrMsg[n1], pIdx->nColumn>1 ? " are not unique" : " is not unique"); sqlite3VdbeAddOp4(v, OP_Halt, SQLITE_CONSTRAINT, onError, 0, zErrMsg,0); break; } case OE_Ignore: { @@ -1326,19 +1326,20 @@ Parse *pParse, /* The parser context */ Table *pTab, /* the table into which we are inserting */ int baseCur, /* Index of a read/write cursor pointing at pTab */ int regRowid, /* Range of content */ int *aRegIdx, /* Register used by each index. 0 for unused indices */ + int rowidChng, /* True if the record number will change */ int isUpdate, /* True for UPDATE, False for INSERT */ int newIdx, /* Index of NEW table for triggers. -1 if none */ int appendBias /* True if this is likely to be an append */ ){ int i; Vdbe *v; int nIdx; Index *pIdx; - u8 pik_flags; + int pik_flags; int regData; int regRec; v = sqlite3GetVdbe(pParse); assert( v!=0 ); @@ -1382,11 +1383,11 @@ ** Return the number of indices on the table. */ int sqlite3OpenTableAndIndices( Parse *pParse, /* Parsing context */ Table *pTab, /* Table to be opened */ - int baseCur, /* Cursor number assigned to the table */ + int baseCur, /* Cursor number assigned to the table */ int op /* OP_OpenRead or OP_OpenWrite */ ){ int i; int iDb; Index *pIdx; Index: src/journal.c ================================================================== --- src/journal.c +++ src/journal.c @@ -8,11 +8,11 @@ ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** -** @(#) $Id: journal.c,v 1.9 2009/01/20 17:06:27 danielk1977 Exp $ +** @(#) $Id: journal.c,v 1.8 2008/05/01 18:01:47 drh Exp $ */ #ifdef SQLITE_ENABLE_ATOMIC_WRITE /* @@ -26,11 +26,11 @@ ** be used to service read() and write() requests. The actual file ** on disk is not created or populated until either: ** ** 1) The in-memory representation grows too large for the allocated ** buffer, or -** 2) The sqlite3JournalCreate() function is called. +** 2) The xSync() method is called. */ #include "sqliteInt.h" @@ -93,13 +93,12 @@ ){ int rc = SQLITE_OK; JournalFile *p = (JournalFile *)pJfd; if( p->pReal ){ rc = sqlite3OsRead(p->pReal, zBuf, iAmt, iOfst); - }else if( (iAmt+iOfst)>p->iSize ){ - rc = SQLITE_IOERR_SHORT_READ; }else{ + assert( iAmt+iOfst<=p->iSize ); memcpy(zBuf, &p->zBuf[iOfst], iAmt); } return rc; } Index: src/legacy.c ================================================================== --- src/legacy.c +++ src/legacy.c @@ -12,14 +12,15 @@ ** Main file for the SQLite library. The routines in this file ** implement the programmer interface to the library. Routines in ** other files are for internal use by SQLite and should not be ** accessed by users of the library. ** -** $Id: legacy.c,v 1.31 2009/01/20 16:53:40 danielk1977 Exp $ +** $Id: legacy.c,v 1.29 2008/08/02 03:50:39 drh Exp $ */ #include "sqliteInt.h" +#include /* ** Execute SQL code. Return one of the SQLITE_ success/failure ** codes. Also write an error message into memory obtained from ** malloc() and make *pzErrMsg point to that message. @@ -112,11 +113,11 @@ rc = sqlite3_finalize(pStmt); pStmt = 0; if( rc!=SQLITE_SCHEMA ){ nRetry = 0; zSql = zLeftover; - while( sqlite3Isspace(zSql[0]) ) zSql++; + while( isspace((unsigned char)zSql[0]) ) zSql++; } break; } } @@ -128,11 +129,11 @@ if( pStmt ) sqlite3_finalize(pStmt); sqlite3DbFree(db, azCols); rc = sqlite3ApiExit(db, rc); if( rc!=SQLITE_OK && rc==sqlite3_errcode(db) && pzErrMsg ){ - int nErrMsg = 1 + sqlite3Strlen30(sqlite3_errmsg(db)); + int nErrMsg = 1 + strlen(sqlite3_errmsg(db)); *pzErrMsg = sqlite3Malloc(nErrMsg); if( *pzErrMsg ){ memcpy(*pzErrMsg, sqlite3_errmsg(db), nErrMsg); } }else if( pzErrMsg ){ Index: src/loadext.c ================================================================== --- src/loadext.c +++ src/loadext.c @@ -10,19 +10,20 @@ ** ************************************************************************* ** This file contains code used to dynamically load extensions into ** the SQLite library. ** -** $Id: loadext.c,v 1.58 2009/01/20 16:53:40 danielk1977 Exp $ +** $Id: loadext.c,v 1.56 2008/10/12 00:27:53 shane Exp $ */ #ifndef SQLITE_CORE #define SQLITE_CORE 1 /* Disable the API redefinition in sqlite3ext.h */ #endif #include "sqlite3ext.h" #include "sqliteInt.h" #include +#include #ifndef SQLITE_OMIT_LOAD_EXTENSION /* ** Some API routines are omitted when various features are @@ -479,14 +480,14 @@ ** extensions. ** ** This list is shared across threads. The SQLITE_MUTEX_STATIC_MASTER ** mutex must be held while accessing this list. */ -typedef struct sqlite3AutoExtList sqlite3AutoExtList; -static SQLITE_WSD struct sqlite3AutoExtList { - int nExt; /* Number of entries in aExt[] */ - void (**aExt)(void); /* Pointers to the extension init functions */ +typedef struct sqlite3ExtType sqlite3ExtType; +static SQLITE_WSD struct sqlite3ExtType { + int nExt; /* Number of entries in aExt[] */ + void **aExt; /* Pointers to the extension init functions */ } sqlite3Autoext = { 0, 0 }; /* The "wsdAutoext" macro will resolve to the autoextension ** state vector. If writable static data is unsupported on the target, ** we have to locate the state vector at run-time. In the more common @@ -493,11 +494,11 @@ ** case where writable static data is supported, wsdStat can refer directly ** to the "sqlite3Autoext" state vector declared above. */ #ifdef SQLITE_OMIT_WSD # define wsdAutoextInit \ - sqlite3AutoExtList *x = &GLOBAL(sqlite3AutoExtList,sqlite3Autoext) + sqlite3ExtType *x = &GLOBAL(sqlite3ExtType,sqlite3Autoext) # define wsdAutoext x[0] #else # define wsdAutoextInit # define wsdAutoext sqlite3Autoext #endif @@ -505,11 +506,11 @@ /* ** Register a statically linked extension that is automatically ** loaded by every new database connection. */ -int sqlite3_auto_extension(void (*xInit)(void)){ +int sqlite3_auto_extension(void *xInit){ int rc = SQLITE_OK; #ifndef SQLITE_OMIT_AUTOINIT rc = sqlite3_initialize(); if( rc ){ return rc; @@ -525,11 +526,11 @@ for(i=0; i #ifdef SQLITE_ENABLE_FTS3 # include "fts3.h" #endif #ifdef SQLITE_ENABLE_RTREE @@ -29,13 +30,11 @@ #endif /* ** The version of the library */ -#ifndef SQLITE_AMALGAMATION const char sqlite3_version[] = SQLITE_VERSION; -#endif const char *sqlite3_libversion(void){ return sqlite3_version; } int sqlite3_libversion_number(void){ return SQLITE_VERSION_NUMBER; } int sqlite3_threadsafe(void){ return SQLITE_THREADSAFE; } #if !defined(SQLITE_OMIT_TRACE) && defined(SQLITE_ENABLE_IOTRACE) @@ -189,21 +188,19 @@ ** been compiled correctly. It is important to run this code, but ** we don't want to run it too often and soak up CPU cycles for no ** reason. So we run it once during initialization. */ #ifndef NDEBUG -#ifndef SQLITE_OMIT_FLOATING_POINT /* This section of code's only "output" is via assert() statements. */ if ( rc==SQLITE_OK ){ u64 x = (((u64)1)<<63)-1; double y; assert(sizeof(x)==8); assert(sizeof(x)==sizeof(y)); memcpy(&y, &x, 8); assert( sqlite3IsNaN(y) ); } -#endif #endif return rc; } @@ -310,24 +307,10 @@ sqlite3GlobalConfig.szPage = va_arg(ap, int); sqlite3GlobalConfig.nPage = va_arg(ap, int); break; } - case SQLITE_CONFIG_PCACHE: { - /* Specify an alternative malloc implementation */ - sqlite3GlobalConfig.pcache = *va_arg(ap, sqlite3_pcache_methods*); - break; - } - - case SQLITE_CONFIG_GETPCACHE: { - if( sqlite3GlobalConfig.pcache.xInit==0 ){ - sqlite3PCacheSetDefault(); - } - *va_arg(ap, sqlite3_pcache_methods*) = sqlite3GlobalConfig.pcache; - break; - } - #if defined(SQLITE_ENABLE_MEMSYS3) || defined(SQLITE_ENABLE_MEMSYS5) case SQLITE_CONFIG_HEAP: { /* Designate a buffer for heap memory space */ sqlite3GlobalConfig.pHeap = va_arg(ap, void*); sqlite3GlobalConfig.nHeap = va_arg(ap, int); @@ -354,10 +337,18 @@ #endif } break; } #endif + +#if defined(SQLITE_ENABLE_MEMSYS6) + case SQLITE_CONFIG_CHUNKALLOC: { + sqlite3GlobalConfig.nSmall = va_arg(ap, int); + sqlite3GlobalConfig.m = *sqlite3MemGetMemsys6(); + break; + } +#endif case SQLITE_CONFIG_LOOKASIDE: { sqlite3GlobalConfig.szLookaside = va_arg(ap, int); sqlite3GlobalConfig.nLookaside = va_arg(ap, int); break; @@ -386,65 +377,46 @@ static int setupLookaside(sqlite3 *db, void *pBuf, int sz, int cnt){ void *pStart; if( db->lookaside.nOut ){ return SQLITE_BUSY; } - /* Free any existing lookaside buffer for this handle before - ** allocating a new one so we don't have to have space for - ** both at the same time. - */ - if( db->lookaside.bMalloced ){ - sqlite3_free(db->lookaside.pStart); - } - /* The size of a lookaside slot needs to be larger than a pointer - ** to be useful. - */ - if( sz<=(int)sizeof(LookasideSlot*) ) sz = 0; + if( sz<0 ) sz = 0; if( cnt<0 ) cnt = 0; - if( sz==0 || cnt==0 ){ - sz = 0; - pStart = 0; - }else if( pBuf==0 ){ + if( pBuf==0 ){ sz = (sz + 7)&~7; sqlite3BeginBenignMalloc(); pStart = sqlite3Malloc( sz*cnt ); sqlite3EndBenignMalloc(); }else{ sz = sz&~7; pStart = pBuf; } + if( db->lookaside.bMalloced ){ + sqlite3_free(db->lookaside.pStart); + } db->lookaside.pStart = pStart; db->lookaside.pFree = 0; - db->lookaside.sz = (u16)sz; + db->lookaside.sz = sz; + db->lookaside.bMalloced = pBuf==0; if( pStart ){ int i; LookasideSlot *p; - assert( sz > sizeof(LookasideSlot*) ); p = (LookasideSlot*)pStart; for(i=cnt-1; i>=0; i--){ p->pNext = db->lookaside.pFree; db->lookaside.pFree = p; p = (LookasideSlot*)&((u8*)p)[sz]; } db->lookaside.pEnd = p; db->lookaside.bEnabled = 1; - db->lookaside.bMalloced = pBuf==0 ?1:0; }else{ db->lookaside.pEnd = 0; db->lookaside.bEnabled = 0; - db->lookaside.bMalloced = 0; } return SQLITE_OK; } -/* -** Return the mutex associated with a database connection. -*/ -sqlite3_mutex *sqlite3_db_mutex(sqlite3 *db){ - return db->mutex; -} - /* ** Configuration settings for an individual database connection */ int sqlite3_db_config(sqlite3 *db, int op, ...){ va_list ap; @@ -465,10 +437,20 @@ } va_end(ap); return rc; } +/* +** Routine needed to support the testcase() macro. +*/ +#ifdef SQLITE_COVERAGE_TEST +void sqlite3Coverage(int x){ + static int dummy = 0; + dummy += x; +} +#endif + /* ** Return true if the buffer z[0..n-1] contains all spaces. */ static int allSpaces(const char *z, int n){ @@ -518,11 +500,10 @@ int nKey1, const void *pKey1, int nKey2, const void *pKey2 ){ int r = sqlite3StrNICmp( (const char *)pKey1, (const char *)pKey2, (nKey1nTotalChange; } -/* -** Close all open savepoints. This function only manipulates fields of the -** database handle object, it does not close any savepoints that may be open -** at the b-tree/pager level. -*/ -void sqlite3CloseSavepoints(sqlite3 *db){ - while( db->pSavepoint ){ - Savepoint *pTmp = db->pSavepoint; - db->pSavepoint = pTmp->pNext; - sqlite3DbFree(db, pTmp); - } - db->nSavepoint = 0; - db->isTransactionSavepoint = 0; -} - /* ** Close an existing SQLite database */ int sqlite3_close(sqlite3 *db){ HashElem *i; @@ -597,29 +563,16 @@ sqlite3VtabRollback(db); /* If there are any outstanding VMs, return SQLITE_BUSY. */ if( db->pVdbe ){ sqlite3Error(db, SQLITE_BUSY, - "unable to close due to unfinalised statements"); + "Unable to close due to unfinalised statements"); sqlite3_mutex_leave(db->mutex); return SQLITE_BUSY; } assert( sqlite3SafetyCheckSickOrOk(db) ); - for(j=0; jnDb; j++){ - Btree *pBt = db->aDb[j].pBt; - if( pBt && sqlite3BtreeIsInBackup(pBt) ){ - sqlite3Error(db, SQLITE_BUSY, - "unable to close due to unfinished backup operation"); - sqlite3_mutex_leave(db->mutex); - return SQLITE_BUSY; - } - } - - /* Free any outstanding Savepoint structures. */ - sqlite3CloseSavepoints(db); - for(j=0; jnDb; j++){ struct Db *pDb = &db->aDb[j]; if( pDb->pBt ){ sqlite3BtreeClose(pDb->pBt); pDb->pBt = 0; @@ -949,33 +902,33 @@ /* Check if an existing function is being overridden or deleted. If so, ** and there are active VMs, then return SQLITE_BUSY. If a function ** is being overridden/deleted but there are no active VMs, allow the ** operation to continue but invalidate all precompiled statements. */ - p = sqlite3FindFunction(db, zFunctionName, nName, nArg, (u8)enc, 0); + p = sqlite3FindFunction(db, zFunctionName, nName, nArg, enc, 0); if( p && p->iPrefEnc==enc && p->nArg==nArg ){ if( db->activeVdbeCnt ){ sqlite3Error(db, SQLITE_BUSY, - "unable to delete/modify user-function due to active statements"); + "Unable to delete/modify user-function due to active statements"); assert( !db->mallocFailed ); return SQLITE_BUSY; }else{ sqlite3ExpirePreparedStatements(db); } } - p = sqlite3FindFunction(db, zFunctionName, nName, nArg, (u8)enc, 1); + p = sqlite3FindFunction(db, zFunctionName, nName, nArg, enc, 1); assert(p || db->mallocFailed); if( !p ){ return SQLITE_NOMEM; } p->flags = 0; p->xFunc = xFunc; p->xStep = xStep; p->xFinalize = xFinal; p->pUserData = pUserData; - p->nArg = (u16)nArg; + p->nArg = nArg; return SQLITE_OK; } /* ** Create new user functions. @@ -1236,13 +1189,10 @@ return sqlite3ErrStr(SQLITE_NOMEM); } if( !sqlite3SafetyCheckSickOrOk(db) ){ return sqlite3ErrStr(SQLITE_MISUSE); } - if( db->mallocFailed ){ - return sqlite3ErrStr(SQLITE_NOMEM); - } sqlite3_mutex_enter(db->mutex); assert( !db->mallocFailed ); z = (char*)sqlite3_value_text(db->pErr); assert( !db->mallocFailed ); if( z==0 ){ @@ -1314,19 +1264,10 @@ if( !db || db->mallocFailed ){ return SQLITE_NOMEM; } return db->errCode & db->errMask; } -int sqlite3_extended_errcode(sqlite3 *db){ - if( db && !sqlite3SafetyCheckSickOrOk(db) ){ - return SQLITE_MISUSE; - } - if( !db || db->mallocFailed ){ - return SQLITE_NOMEM; - } - return db->errCode; -} /* ** Create a new collating function for database "db". The name is zName ** and the encoding is enc. */ @@ -1363,11 +1304,11 @@ nName = sqlite3Strlen(db, zName); pColl = sqlite3FindCollSeq(db, (u8)enc2, zName, nName, 0); if( pColl && pColl->xCmp ){ if( db->activeVdbeCnt ){ sqlite3Error(db, SQLITE_BUSY, - "unable to delete/modify collation sequence due to active statements"); + "Unable to delete/modify collation sequence due to active statements"); return SQLITE_BUSY; } sqlite3ExpirePreparedStatements(db); /* If collation sequence pColl was created directly by a call to @@ -1394,11 +1335,11 @@ pColl = sqlite3FindCollSeq(db, (u8)enc2, zName, nName, 1); if( pColl ){ pColl->xCmp = xCompare; pColl->pUser = pCtx; pColl->xDel = xDel; - pColl->enc = (u8)(enc2 | (enc & SQLITE_UTF16_ALIGNED)); + pColl->enc = enc2 | (enc & SQLITE_UTF16_ALIGNED); } sqlite3Error(db, SQLITE_OK, 0); return SQLITE_OK; } @@ -2148,29 +2089,10 @@ xBenignBegin = va_arg(ap, void_function); xBenignEnd = va_arg(ap, void_function); sqlite3BenignMallocHooks(xBenignBegin, xBenignEnd); break; } - - /* - ** sqlite3_test_control(PENDING_BYTE, unsigned int X) - ** - ** Set the PENDING byte to the value in the argument, if X>0. - ** Make no changes if X==0. Return the value of the pending byte - ** as it existing before this routine was called. - ** - ** IMPORTANT: Changing the PENDING byte from 0x40000000 results in - ** an incompatible database file format. Changing the PENDING byte - ** while any database connection is open results in undefined and - ** dileterious behavior. - */ - case SQLITE_TESTCTRL_PENDING_BYTE: { - unsigned int newVal = va_arg(ap, unsigned int); - rc = sqlite3PendingByte; - if( newVal ) sqlite3PendingByte = newVal; - break; - } } va_end(ap); #endif /* SQLITE_OMIT_BUILTIN_TEST */ return rc; } Index: src/malloc.c ================================================================== --- src/malloc.c +++ src/malloc.c @@ -10,26 +10,26 @@ ** ************************************************************************* ** ** Memory allocation functions used throughout sqlite. ** -** $Id: malloc.c,v 1.54 2009/01/20 16:53:41 danielk1977 Exp $ +** $Id: malloc.c,v 1.45 2008/10/12 00:27:53 shane Exp $ */ #include "sqliteInt.h" #include +#include /* ** This routine runs when the memory allocator sees that the ** total memory allocation is about to exceed the soft heap ** limit. */ static void softHeapLimitEnforcer( void *NotUsed, - sqlite3_int64 NotUsed2, + sqlite3_int64 inUse, int allocSize ){ - UNUSED_PARAMETER2(NotUsed, NotUsed2); sqlite3_release_memory(allocSize); } /* ** Set the soft heap-size limit for the library. Passing a zero or @@ -47,11 +47,11 @@ if( iLimit>0 ){ sqlite3MemoryAlarm(softHeapLimitEnforcer, 0, iLimit); }else{ sqlite3MemoryAlarm(0, 0, 0); } - overage = (int)(sqlite3_memory_used() - (i64)n); + overage = sqlite3_memory_used() - n; if( overage>0 ){ sqlite3_release_memory(overage); } } @@ -67,11 +67,10 @@ nRet += sqlite3VdbeReleaseMemory(n); #endif nRet += sqlite3PcacheReleaseMemory(n-nRet); return nRet; #else - UNUSED_PARAMETER(n); return SQLITE_OK; #endif } /* @@ -101,11 +100,11 @@ ** sqlite3GlobalConfig.pPage to a block of memory that records ** which pages are available. */ u32 *aScratchFree; u32 *aPageFree; -} mem0 = { 62560955, 0, 0, 0, 0, 0, 0, 0, 0 }; +} mem0 = { 62560955 }; #define mem0 GLOBAL(struct Mem0Global, mem0) /* ** Initialize the memory allocation subsystem. @@ -119,11 +118,11 @@ mem0.mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM); } if( sqlite3GlobalConfig.pScratch && sqlite3GlobalConfig.szScratch>=100 && sqlite3GlobalConfig.nScratch>=0 ){ int i; - sqlite3GlobalConfig.szScratch = (sqlite3GlobalConfig.szScratch - 4) & ~7; + sqlite3GlobalConfig.szScratch -= 4; mem0.aScratchFree = (u32*)&((char*)sqlite3GlobalConfig.pScratch) [sqlite3GlobalConfig.szScratch*sqlite3GlobalConfig.nScratch]; for(i=0; i=512 && sqlite3GlobalConfig.nPage>=1 ){ int i; int overhead; - int sz = sqlite3GlobalConfig.szPage & ~7; + int sz = sqlite3GlobalConfig.szPage; int n = sqlite3GlobalConfig.nPage; overhead = (4*n + sz - 1)/sz; sqlite3GlobalConfig.nPage -= overhead; mem0.aPageFree = (u32*)&((char*)sqlite3GlobalConfig.pPage) [sqlite3GlobalConfig.szPage*sqlite3GlobalConfig.nPage]; @@ -332,11 +331,10 @@ i *= sqlite3GlobalConfig.szScratch; sqlite3StatusAdd(SQLITE_STATUS_SCRATCH_USED, 1); sqlite3StatusSet(SQLITE_STATUS_SCRATCH_SIZE, n); sqlite3_mutex_leave(mem0.mutex); p = (void*)&((char*)sqlite3GlobalConfig.pScratch)[i]; - assert( (((u8*)p - (u8*)0) & 7)==0 ); } } #if SQLITE_THREADSAFE==0 && !defined(NDEBUG) scratchAllocOut = p!=0; #endif @@ -383,15 +381,15 @@ }else{ sqlite3GlobalConfig.m.xFree(p); } }else{ int i; - i = (int)((u8*)p - (u8*)sqlite3GlobalConfig.pScratch); + i = (u8 *)p - (u8 *)sqlite3GlobalConfig.pScratch; i /= sqlite3GlobalConfig.szScratch; assert( i>=0 && ilookaside.sz; }else{ return sqlite3GlobalConfig.m.xSize(p); } } @@ -722,11 +718,11 @@ char *zNew; size_t n; if( z==0 ){ return 0; } - n = (db ? sqlite3Strlen(db, z) : sqlite3Strlen30(z))+1; + n = strlen(z)+1; assert( (n&0x7fffffff)==n ); zNew = sqlite3DbMallocRaw(db, (int)n); if( zNew ){ memcpy(zNew, z, n); } DELETED src/mem0.c Index: src/mem0.c ================================================================== --- src/mem0.c +++ /dev/null @@ -1,61 +0,0 @@ -/* -** 2008 October 28 -** -** 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 contains a no-op memory allocation drivers for use when -** SQLITE_ZERO_MALLOC is defined. The allocation drivers implemented -** here always fail. SQLite will not operate with these drivers. These -** are merely placeholders. Real drivers must be substituted using -** sqlite3_config() before SQLite will operate. -** -** $Id: mem0.c,v 1.1 2008/10/28 18:58:20 drh Exp $ -*/ -#include "sqliteInt.h" - -/* -** This version of the memory allocator is the default. It is -** used when no other memory allocator is specified using compile-time -** macros. -*/ -#ifdef SQLITE_ZERO_MALLOC - -/* -** No-op versions of all memory allocation routines -*/ -static void *sqlite3MemMalloc(int nByte){ return 0; } -static void sqlite3MemFree(void *pPrior){ return; } -static void *sqlite3MemRealloc(void *pPrior, int nByte){ return 0; } -static int sqlite3MemSize(void *pPrior){ return 0; } -static int sqlite3MemRoundup(int n){ return n; } -static int sqlite3MemInit(void *NotUsed){ return SQLITE_OK; } -static void sqlite3MemShutdown(void *NotUsed){ return; } - -/* -** This routine is the only routine in this file with external linkage. -** -** Populate the low-level memory allocation function pointers in -** sqlite3GlobalConfig.m with pointers to the routines in this file. -*/ -void sqlite3MemSetDefault(void){ - static const sqlite3_mem_methods defaultMethods = { - sqlite3MemMalloc, - sqlite3MemFree, - sqlite3MemRealloc, - sqlite3MemSize, - sqlite3MemRoundup, - sqlite3MemInit, - sqlite3MemShutdown, - 0 - }; - sqlite3_config(SQLITE_CONFIG_MALLOC, &defaultMethods); -} - -#endif /* SQLITE_ZERO_MALLOC */ Index: src/mem1.c ================================================================== --- src/mem1.c +++ src/mem1.c @@ -15,11 +15,11 @@ ** to obtain the memory it needs. ** ** This file contains implementations of the low-level memory allocation ** routines specified in the sqlite3_mem_methods object. ** -** $Id: mem1.c,v 1.29 2008/12/10 21:19:57 drh Exp $ +** $Id: mem1.c,v 1.26 2008/09/01 18:34:20 danielk1977 Exp $ */ #include "sqliteInt.h" /* ** This version of the memory allocator is the default. It is @@ -94,11 +94,11 @@ static int sqlite3MemSize(void *pPrior){ sqlite3_int64 *p; if( pPrior==0 ) return 0; p = (sqlite3_int64*)pPrior; p--; - return (int)p[0]; + return p[0]; } /* ** Round up a request size to the next valid allocation size. */ @@ -108,29 +108,21 @@ /* ** Initialize this module. */ static int sqlite3MemInit(void *NotUsed){ - UNUSED_PARAMETER(NotUsed); return SQLITE_OK; } /* ** Deinitialize this module. */ static void sqlite3MemShutdown(void *NotUsed){ - UNUSED_PARAMETER(NotUsed); return; } -/* -** This routine is the only routine in this file with external linkage. -** -** Populate the low-level memory allocation function pointers in -** sqlite3GlobalConfig.m with pointers to the routines in this file. -*/ -void sqlite3MemSetDefault(void){ +const sqlite3_mem_methods *sqlite3MemGetDefault(void){ static const sqlite3_mem_methods defaultMethods = { sqlite3MemMalloc, sqlite3MemFree, sqlite3MemRealloc, sqlite3MemSize, @@ -137,9 +129,19 @@ sqlite3MemRoundup, sqlite3MemInit, sqlite3MemShutdown, 0 }; - sqlite3_config(SQLITE_CONFIG_MALLOC, &defaultMethods); + return &defaultMethods; +} + +/* +** This routine is the only routine in this file with external linkage. +** +** Populate the low-level memory allocation function pointers in +** sqlite3GlobalConfig.m with pointers to the routines in this file. +*/ +void sqlite3MemSetDefault(void){ + sqlite3_config(SQLITE_CONFIG_MALLOC, sqlite3MemGetDefault()); } #endif /* SQLITE_SYSTEM_MALLOC */ Index: src/mem2.c ================================================================== --- src/mem2.c +++ src/mem2.c @@ -17,11 +17,11 @@ ** leaks and memory usage errors. ** ** This file contains implementations of the low-level memory allocation ** routines specified in the sqlite3_mem_methods object. ** -** $Id: mem2.c,v 1.43 2009/02/05 03:00:06 shane Exp $ +** $Id: mem2.c,v 1.39 2008/09/01 18:34:20 danielk1977 Exp $ */ #include "sqliteInt.h" /* ** This version of the memory allocator is used only if the @@ -156,20 +156,18 @@ u8 *pU8; int nReserve; p = (struct MemBlockHdr*)pAllocation; p--; - assert( p->iForeGuard==(int)FOREGUARD ); + assert( p->iForeGuard==FOREGUARD ); nReserve = (p->iSize+7)&~7; pInt = (int*)pAllocation; pU8 = (u8*)pAllocation; - assert( pInt[nReserve/sizeof(int)]==(int)REARGUARD ); - /* This checks any of the "extra" bytes allocated due - ** to rounding up to an 8 byte boundary to ensure - ** they haven't been overwritten. - */ - while( nReserve-- > p->iSize ) assert( pU8[nReserve]==0x65 ); + assert( pInt[nReserve/sizeof(int)]==REARGUARD ); + assert( (nReserve-0)<=p->iSize || pU8[nReserve-1]==0x65 ); + assert( (nReserve-1)<=p->iSize || pU8[nReserve-2]==0x65 ); + assert( (nReserve-2)<=p->iSize || pU8[nReserve-3]==0x65 ); return p; } /* ** Return the number of bytes currently allocated at address p. @@ -185,12 +183,10 @@ /* ** Initialize the memory allocation subsystem. */ static int sqlite3MemInit(void *NotUsed){ - UNUSED_PARAMETER(NotUsed); - assert( (sizeof(struct MemBlockHdr)&7) == 0 ); if( !sqlite3GlobalConfig.bMemstat ){ /* If memory status is enabled, then the malloc.c wrapper will already ** hold the STATIC_MEM mutex when the routines here are invoked. */ mem.mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM); } @@ -199,11 +195,10 @@ /* ** Deinitialize the memory allocation subsystem. */ static void sqlite3MemShutdown(void *NotUsed){ - UNUSED_PARAMETER(NotUsed); mem.mutex = 0; } /* ** Round up a request size to the next valid allocation size. @@ -326,15 +321,12 @@ sqlite3MemFree(pPrior); } return pNew; } -/* -** Populate the low-level memory allocation function pointers in -** sqlite3GlobalConfig.m with pointers to the routines in this file. -*/ -void sqlite3MemSetDefault(void){ + +const sqlite3_mem_methods *sqlite3MemGetDefault(void){ static const sqlite3_mem_methods defaultMethods = { sqlite3MemMalloc, sqlite3MemFree, sqlite3MemRealloc, sqlite3MemSize, @@ -341,11 +333,19 @@ sqlite3MemRoundup, sqlite3MemInit, sqlite3MemShutdown, 0 }; - sqlite3_config(SQLITE_CONFIG_MALLOC, &defaultMethods); + return &defaultMethods; +} + +/* +** Populate the low-level memory allocation function pointers in +** sqlite3GlobalConfig.m with pointers to the routines in this file. +*/ +void sqlite3MemSetDefault(void){ + sqlite3_config(SQLITE_CONFIG_MALLOC, sqlite3MemGetDefault()); } /* ** Set the number of backtrace levels kept for each allocation. ** A value of zero turns off backtracing. The number is always rounded @@ -364,11 +364,11 @@ /* ** Set the title string for subsequent allocations. */ void sqlite3MemdebugSettitle(const char *zTitle){ - unsigned int n = sqlite3Strlen30(zTitle) + 1; + int n = strlen(zTitle) + 1; sqlite3_mutex_enter(mem.mutex); if( n>=sizeof(mem.zTitle) ) n = sizeof(mem.zTitle)-1; memcpy(mem.zTitle, zTitle, n); mem.zTitle[n] = 0; mem.nTitle = (n+7)&~7; Index: src/mem3.c ================================================================== --- src/mem3.c +++ src/mem3.c @@ -21,11 +21,11 @@ ** be changed. ** ** This version of the memory allocation subsystem is included ** in the build only if SQLITE_ENABLE_MEMSYS3 is defined. ** -** $Id: mem3.c,v 1.25 2008/11/19 16:52:44 danielk1977 Exp $ +** $Id: mem3.c,v 1.23 2008/09/02 17:52:52 danielk1977 Exp $ */ #include "sqliteInt.h" /* ** This version of the memory allocator is only built into the library @@ -249,11 +249,11 @@ /* ** Chunk i is a free chunk that has been unlinked. Adjust its ** size parameters for check-out and return a pointer to the ** user portion of the chunk. */ -static void *memsys3Checkout(u32 i, u32 nBlock){ +static void *memsys3Checkout(u32 i, int nBlock){ u32 x; assert( sqlite3_mutex_held(mem3.mutex) ); assert( i>=1 ); assert( mem3.aPool[i-1].u.hdr.size4x/4==nBlock ); assert( mem3.aPool[i+nBlock-1].u.hdr.prevSize==nBlock ); @@ -267,11 +267,11 @@ /* ** Carve a piece off of the end of the mem3.iMaster free chunk. ** Return a pointer to the new allocation. Or, if the master chunk ** is not large enough, return 0. */ -static void *memsys3FromMaster(u32 nBlock){ +static void *memsys3FromMaster(int nBlock){ assert( sqlite3_mutex_held(mem3.mutex) ); assert( mem3.szMaster>=nBlock ); if( nBlock>=mem3.szMaster-1 ){ /* Use the entire master */ void *p = memsys3Checkout(mem3.iMaster, mem3.szMaster); @@ -353,12 +353,12 @@ ** This function assumes that the necessary mutexes, if any, are ** already held by the caller. Hence "Unsafe". */ static void *memsys3MallocUnsafe(int nByte){ u32 i; - u32 nBlock; - u32 toFree; + int nBlock; + int toFree; assert( sqlite3_mutex_held(mem3.mutex) ); assert( sizeof(Mem3Block)==8 ); if( nByte<=12 ){ nBlock = 2; @@ -550,11 +550,10 @@ /* ** Initialize this module. */ static int memsys3Init(void *NotUsed){ - UNUSED_PARAMETER(NotUsed); if( !sqlite3GlobalConfig.pHeap ){ return SQLITE_ERROR; } /* Store a pointer to the memory block in global structure mem3. */ @@ -575,11 +574,10 @@ /* ** Deinitialize this module. */ static void memsys3Shutdown(void *NotUsed){ - UNUSED_PARAMETER(NotUsed); return; } @@ -588,11 +586,11 @@ ** allocations into that log. */ void sqlite3Memsys3Dump(const char *zFilename){ #ifdef SQLITE_DEBUG FILE *out; - u32 i, j; + int i, j; u32 size; if( zFilename==0 || zFilename[0]==0 ){ out = stdout; }else{ out = fopen(zFilename, "w"); @@ -653,12 +651,10 @@ if( out==stdout ){ fflush(stdout); }else{ fclose(out); } -#else - UNUSED_PARAMETER(zFilename); #endif } /* ** This routine is the only routine in this file with external ADDED src/mem4.c Index: src/mem4.c ================================================================== --- /dev/null +++ src/mem4.c @@ -0,0 +1,393 @@ +/* +** 2007 August 14 +** +** 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 contains the C functions that implement a memory +** allocation subsystem for use by SQLite. +** +** $Id: mem4.c,v 1.3 2008/06/18 17:09:10 danielk1977 Exp $ +*/ +#include "sqliteInt.h" + +/* +** This version of the memory allocator attempts to obtain memory +** from mmap() if the size of the allocation is close to the size +** of a virtual memory page. If the size of the allocation is different +** from the virtual memory page size, then ordinary malloc() is used. +** Ordinary malloc is also used if space allocated to mmap() is +** exhausted. +** +** Enable this memory allocation by compiling with -DSQLITE_MMAP_HEAP_SIZE=nnn +** where nnn is the maximum number of bytes of mmap-ed memory you want +** to support. This module may choose to use less memory than requested. +** +*/ +#ifdef SQLITE_MMAP_HEAP_SIZE + +/* +** This is a test version of the memory allocator that attempts to +** use mmap() and madvise() for allocations and frees of approximately +** the virtual memory page size. +*/ +#include +#include +#include +#include + + +/* +** All of the static variables used by this module are collected +** into a single structure named "mem". This is to keep the +** static variables organized and to reduce namespace pollution +** when this module is combined with other in the amalgamation. +*/ +static struct { + /* + ** The alarm callback and its arguments. The mem.mutex lock will + ** be held while the callback is running. Recursive calls into + ** the memory subsystem are allowed, but no new callbacks will be + ** issued. The alarmBusy variable is set to prevent recursive + ** callbacks. + */ + sqlite3_int64 alarmThreshold; + void (*alarmCallback)(void*, sqlite3_int64,int); + void *alarmArg; + int alarmBusy; + + /* + ** Mutex to control access to the memory allocation subsystem. + */ + sqlite3_mutex *mutex; + + /* + ** Current allocation and high-water mark. + */ + sqlite3_int64 nowUsed; + sqlite3_int64 mxUsed; + + /* + ** Current allocation and high-water marks for mmap allocated memory. + */ + sqlite3_int64 nowUsedMMap; + sqlite3_int64 mxUsedMMap; + + /* + ** Size of a single mmap page. Obtained from sysconf(). + */ + int szPage; + int mnPage; + + /* + ** The number of available mmap pages. + */ + int nPage; + + /* + ** Index of the first free page. 0 means no pages have been freed. + */ + int firstFree; + + /* First unused page on the top of the heap. + */ + int firstUnused; + + /* + ** Bulk memory obtained from from mmap(). + */ + char *mmapHeap; /* first byte of the heap */ + +} mem; + + +/* +** Enter the mutex mem.mutex. Allocate it if it is not already allocated. +** The mmap() region is initialized the first time this routine is called. +*/ +static void memsys4Enter(void){ + if( mem.mutex==0 ){ + mem.mutex = sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MEM); + } + sqlite3_mutex_enter(mem.mutex); +} + +/* +** Attempt to free memory to the mmap heap. This only works if +** the pointer p is within the range of memory addresses that +** comprise the mmap heap. Return 1 if the memory was freed +** successfully. Return 0 if the pointer is out of range. +*/ +static int mmapFree(void *p){ + char *z; + int idx, *a; + if( mem.mmapHeap==MAP_FAILED || mem.nPage==0 ){ + return 0; + } + z = (char*)p; + idx = (z - mem.mmapHeap)/mem.szPage; + if( idx<1 || idx>=mem.nPage ){ + return 0; + } + a = (int*)mem.mmapHeap; + a[idx] = a[mem.firstFree]; + mem.firstFree = idx; + mem.nowUsedMMap -= mem.szPage; + madvise(p, mem.szPage, MADV_DONTNEED); + return 1; +} + +/* +** Attempt to allocate nBytes from the mmap heap. Return a pointer +** to the allocated page. Or, return NULL if the allocation fails. +** +** The allocation will fail if nBytes is not the right size. +** Or, the allocation will fail if the mmap heap has been exhausted. +*/ +static void *mmapAlloc(int nBytes){ + int idx = 0; + if( nBytes>mem.szPage || nBytes mem.szPage ){ + mem.nPage = mem.szPage/sizeof(int); + } + mem.mmapHeap = mmap(0, mem.szPage*mem.nPage, PROT_WRITE|PROT_READ, + MAP_ANONYMOUS|MAP_SHARED, -1, 0); + if( mem.mmapHeap==MAP_FAILED ){ + mem.firstUnused = errno; + }else{ + mem.firstUnused = 1; + mem.nowUsedMMap = mem.szPage; + } + } + if( mem.mmapHeap==MAP_FAILED ){ + return 0; + } + if( mem.firstFree ){ + int idx = mem.firstFree; + int *a = (int*)mem.mmapHeap; + mem.firstFree = a[idx]; + }else if( mem.firstUnusedmem.mxUsedMMap ){ + mem.mxUsedMMap = mem.nowUsedMMap; + } + return (void*)&mem.mmapHeap[idx*mem.szPage]; + }else{ + return 0; + } +} + +/* +** Release the mmap-ed memory region if it is currently allocated and +** is not in use. +*/ +static void mmapUnmap(void){ + if( mem.mmapHeap==MAP_FAILED ) return; + if( mem.nPage==0 ) return; + if( mem.nowUsedMMap>mem.szPage ) return; + munmap(mem.mmapHeap, mem.nPage*mem.szPage); + mem.nowUsedMMap = 0; + mem.nPage = 0; +} + + +/* +** Return the amount of memory currently checked out. +*/ +sqlite3_int64 sqlite3_memory_used(void){ + sqlite3_int64 n; + memsys4Enter(); + n = mem.nowUsed + mem.nowUsedMMap; + sqlite3_mutex_leave(mem.mutex); + return n; +} + +/* +** Return the maximum amount of memory that has ever been +** checked out since either the beginning of this process +** or since the most recent reset. +*/ +sqlite3_int64 sqlite3_memory_highwater(int resetFlag){ + sqlite3_int64 n; + memsys4Enter(); + n = mem.mxUsed + mem.mxUsedMMap; + if( resetFlag ){ + mem.mxUsed = mem.nowUsed; + mem.mxUsedMMap = mem.nowUsedMMap; + } + sqlite3_mutex_leave(mem.mutex); + return n; +} + +/* +** Change the alarm callback +*/ +int sqlite3_memory_alarm( + void(*xCallback)(void *pArg, sqlite3_int64 used,int N), + void *pArg, + sqlite3_int64 iThreshold +){ + memsys4Enter(); + mem.alarmCallback = xCallback; + mem.alarmArg = pArg; + mem.alarmThreshold = iThreshold; + sqlite3_mutex_leave(mem.mutex); + return SQLITE_OK; +} + +/* +** Trigger the alarm +*/ +static void sqlite3MemsysAlarm(int nByte){ + void (*xCallback)(void*,sqlite3_int64,int); + sqlite3_int64 nowUsed; + void *pArg; + if( mem.alarmCallback==0 || mem.alarmBusy ) return; + mem.alarmBusy = 1; + xCallback = mem.alarmCallback; + nowUsed = mem.nowUsed; + pArg = mem.alarmArg; + sqlite3_mutex_leave(mem.mutex); + xCallback(pArg, nowUsed, nByte); + sqlite3_mutex_enter(mem.mutex); + mem.alarmBusy = 0; +} + +/* +** Allocate nBytes of memory +*/ +static void *memsys4Malloc(int nBytes){ + sqlite3_int64 *p = 0; + if( mem.alarmCallback!=0 + && mem.nowUsed+mem.nowUsedMMap+nBytes>=mem.alarmThreshold ){ + sqlite3MemsysAlarm(nBytes); + } + if( (p = mmapAlloc(nBytes))==0 ){ + p = malloc(nBytes+8); + if( p==0 ){ + sqlite3MemsysAlarm(nBytes); + p = malloc(nBytes+8); + } + if( p ){ + p[0] = nBytes; + p++; + mem.nowUsed += nBytes; + if( mem.nowUsed>mem.mxUsed ){ + mem.mxUsed = mem.nowUsed; + } + } + } + return (void*)p; +} + +/* +** Return the size of a memory allocation +*/ +static int memsys4Size(void *pPrior){ + char *z = (char*)pPrior; + int idx = mem.nPage ? (z - mem.mmapHeap)/mem.szPage : 0; + int nByte; + if( idx>=1 && idx0 ){ + memsys4Enter(); + p = memsys4Malloc(nBytes); + sqlite3_mutex_leave(mem.mutex); + } + return (void*)p; +} + +/* +** Free memory. +*/ +void sqlite3_free(void *pPrior){ + if( pPrior==0 ){ + return; + } + assert( mem.mutex!=0 ); + sqlite3_mutex_enter(mem.mutex); + memsys4Free(pPrior); + sqlite3_mutex_leave(mem.mutex); +} + + + +/* +** Change the size of an existing memory allocation +*/ +void *sqlite3_realloc(void *pPrior, int nBytes){ + int nOld; + sqlite3_int64 *p; + if( pPrior==0 ){ + return sqlite3_malloc(nBytes); + } + if( nBytes<=0 ){ + sqlite3_free(pPrior); + return 0; + } + nOld = memsys4Size(pPrior); + if( nBytes<=nOld && nBytes>=nOld-128 ){ + return pPrior; + } + assert( mem.mutex!=0 ); + sqlite3_mutex_enter(mem.mutex); + p = memsys4Malloc(nBytes); + if( p ){ + if( nOldmem5.maxRequest ){ + if( nByte>mem5.maxRequest ){ mem5.maxRequest = nByte; } /* Round nByte up to the next valid power of two */ + if( nByte>POW2_MAX ) return 0; for(iFullSz=mem5.nAtom, iLogsize=0; iFullSz0 ); - assert( mem5.currentOut>=(size*mem5.nAtom) ); + assert( mem5.currentOut>=0 ); mem5.currentCount--; mem5.currentOut -= size*mem5.nAtom; assert( mem5.currentOut>0 || mem5.currentCount==0 ); assert( mem5.currentCount>0 || mem5.currentOut==0 ); @@ -377,19 +400,17 @@ int nByte = sqlite3GlobalConfig.nHeap; u8 *zByte = (u8 *)sqlite3GlobalConfig.pHeap; int nMinLog; /* Log of minimum allocation size in bytes*/ int iOffset; - UNUSED_PARAMETER(NotUsed); - if( !zByte ){ return SQLITE_ERROR; } nMinLog = memsys5Log(sqlite3GlobalConfig.mnReq); mem5.nAtom = (1<mem5.nAtom ){ + while( sizeof(Mem5Link)>mem5.nAtom ){ mem5.nAtom = mem5.nAtom << 1; } mem5.nBlock = (nByte / (mem5.nAtom+sizeof(u8))); mem5.zPool = zByte; @@ -415,11 +436,10 @@ /* ** Deinitialize this module. */ static void memsys5Shutdown(void *NotUsed){ - UNUSED_PARAMETER(NotUsed); return; } /* ** Open the file indicated and write a log of all unfreed memory @@ -459,12 +479,10 @@ if( out==stdout ){ fflush(stdout); }else{ fclose(out); } -#else - UNUSED_PARAMETER(zFilename); #endif } /* ** This routine is the only routine in this file with external ADDED src/mem6.c Index: src/mem6.c ================================================================== --- /dev/null +++ src/mem6.c @@ -0,0 +1,498 @@ +/* +** 2008 July 24 +** +** The author disclaims copyright to this source code. In place of +** a legal notice, here is a blessing: +** +** May you do good and not evil. +** May you find forgiveness for yourself and forgive others. +** May you share freely, never taking more than you give. +** +************************************************************************* +** +** This file contains an alternative memory allocation system for SQLite. +** This system is implemented as a wrapper around the system provided +** by the operating system - vanilla malloc(), realloc() and free(). +** +** This system differentiates between requests for "small" allocations +** (by default those of 128 bytes or less) and "large" allocations (all +** others). The 256 byte threshhold is configurable at runtime. +** +** All requests for large allocations are passed through to the +** default system. +** +** Requests for small allocations are met by allocating space within +** one or more larger "chunks" of memory obtained from the default +** memory allocation system. Chunks of memory are usually 64KB or +** larger. The algorithm used to manage space within each chunk is +** the same as that used by mem5.c. +** +** This strategy is designed to prevent the default memory allocation +** system (usually the system malloc) from suffering from heap +** fragmentation. On some systems, heap fragmentation can cause a +** significant real-time slowdown. +** +** $Id: mem6.c,v 1.10 2008/09/02 17:52:52 danielk1977 Exp $ +*/ + +#ifdef SQLITE_ENABLE_MEMSYS6 + +#include "sqliteInt.h" + +/* +** Maximum size of any "small" allocation is ((1<zPool[(idx)*pChunk->nAtom])) + +static SQLITE_WSD struct Mem6Global { + int nMinAlloc; /* Minimum allowed allocation size */ + int nThreshold; /* Allocs larger than this go to malloc() */ + int nLogThreshold; /* log2 of (nThreshold/nMinAlloc) */ + sqlite3_mutex *mutex; + Mem6Chunk *pChunk; /* Singly linked list of all memory chunks */ +} mem6 = { 48642791 }; + +#define mem6 GLOBAL(struct Mem6Global, mem6) + +/* +** Unlink the chunk at pChunk->aPool[i] from list it is currently +** on. It should be found on pChunk->aiFreelist[iLogsize]. +*/ +static void memsys6Unlink(Mem6Chunk *pChunk, int i, int iLogsize){ + int next, prev; + assert( i>=0 && inBlock ); + assert( iLogsize>=0 && iLogsize<=mem6.nLogThreshold ); + assert( (pChunk->aCtrl[i] & CTRL_LOGSIZE)==iLogsize ); + + next = MEM6LINK(i)->next; + prev = MEM6LINK(i)->prev; + if( prev<0 ){ + pChunk->aiFreelist[iLogsize] = next; + }else{ + MEM6LINK(prev)->next = next; + } + if( next>=0 ){ + MEM6LINK(next)->prev = prev; + } +} + +/* +** Link the chunk at mem5.aPool[i] so that is on the iLogsize +** free list. +*/ +static void memsys6Link(Mem6Chunk *pChunk, int i, int iLogsize){ + int x; + assert( i>=0 && inBlock ); + assert( iLogsize>=0 && iLogsize<=mem6.nLogThreshold ); + assert( (pChunk->aCtrl[i] & CTRL_LOGSIZE)==iLogsize ); + + x = MEM6LINK(i)->next = pChunk->aiFreelist[iLogsize]; + MEM6LINK(i)->prev = -1; + if( x>=0 ){ + assert( xnBlock ); + MEM6LINK(x)->prev = i; + } + pChunk->aiFreelist[iLogsize] = i; +} + + +/* +** Find the first entry on the freelist iLogsize. Unlink that +** entry and return its index. +*/ +static int memsys6UnlinkFirst(Mem6Chunk *pChunk, int iLogsize){ + int i; + int iFirst; + + assert( iLogsize>=0 && iLogsize<=mem6.nLogThreshold ); + i = iFirst = pChunk->aiFreelist[iLogsize]; + assert( iFirst>=0 ); + memsys6Unlink(pChunk, iFirst, iLogsize); + return iFirst; +} + +static int roundupLog2(int n){ + static const char LogTable256[256] = { + 0, /* 1 */ + 1, /* 2 */ + 2, 2, /* 3..4 */ + 3, 3, 3, 3, /* 5..8 */ + 4, 4, 4, 4, 4, 4, 4, 4, /* 9..16 */ + 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, /* 17..32 */ + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, /* 33..64 */ + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, /* 65..128 */ + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, + 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, /* 129..256 */ + }; + + assert(n<=(1<<16) && n>0); + if( n<=256 ) return LogTable256[n-1]; + return LogTable256[(n>>8) - ((n&0xFF)?0:1)] + 8; +} + +/* +** Allocate and return a block of (pChunk->nAtom << iLogsize) bytes from chunk +** pChunk. If the allocation request cannot be satisfied, return 0. +*/ +static void *chunkMalloc(Mem6Chunk *pChunk, int iLogsize){ + int i; /* Index of a mem5.aPool[] slot */ + int iBin; /* Index into mem5.aiFreelist[] */ + + /* Make sure mem5.aiFreelist[iLogsize] contains at least one free + ** block. If not, then split a block of the next larger power of + ** two in order to create a new free block of size iLogsize. + */ + for(iBin=iLogsize; pChunk->aiFreelist[iBin]<0 && iBin<=mem6.nLogThreshold; iBin++){} + if( iBin>mem6.nLogThreshold ) return 0; + i = memsys6UnlinkFirst(pChunk, iBin); + while( iBin>iLogsize ){ + int newSize; + iBin--; + newSize = 1 << iBin; + pChunk->aCtrl[i+newSize] = CTRL_FREE | iBin; + memsys6Link(pChunk, i+newSize, iBin); + } + pChunk->aCtrl[i] = iLogsize; + + /* Return a pointer to the allocated memory. */ + pChunk->nCheckedOut++; + return (void*)&pChunk->zPool[i*pChunk->nAtom]; +} + +/* +** Free the allocation pointed to by p, which is guaranteed to be non-zero +** and a part of chunk object pChunk. +*/ +static void chunkFree(Mem6Chunk *pChunk, void *pOld){ + u32 size, iLogsize; + int iBlock; + + /* Set iBlock to the index of the block pointed to by pOld in + ** the array of pChunk->nAtom byte blocks pointed to by pChunk->zPool. + */ + iBlock = ((u8 *)pOld-pChunk->zPool)/pChunk->nAtom; + + /* Check that the pointer pOld points to a valid, non-free block. */ + assert( iBlock>=0 && iBlocknBlock ); + assert( ((u8 *)pOld-pChunk->zPool)%pChunk->nAtom==0 ); + assert( (pChunk->aCtrl[iBlock] & CTRL_FREE)==0 ); + + iLogsize = pChunk->aCtrl[iBlock] & CTRL_LOGSIZE; + size = 1<nBlock ); + + pChunk->aCtrl[iBlock] |= CTRL_FREE; + pChunk->aCtrl[iBlock+size-1] |= CTRL_FREE; + + pChunk->aCtrl[iBlock] = CTRL_FREE | iLogsize; + while( iLogsize>iLogsize) & 1 ){ + iBuddy = iBlock - size; + }else{ + iBuddy = iBlock + size; + } + assert( iBuddy>=0 ); + if( (iBuddy+(1<pChunk->nBlock ) break; + if( pChunk->aCtrl[iBuddy]!=(CTRL_FREE | iLogsize) ) break; + memsys6Unlink(pChunk, iBuddy, iLogsize); + iLogsize++; + if( iBuddyaCtrl[iBuddy] = CTRL_FREE | iLogsize; + pChunk->aCtrl[iBlock] = 0; + iBlock = iBuddy; + }else{ + pChunk->aCtrl[iBlock] = CTRL_FREE | iLogsize; + pChunk->aCtrl[iBuddy] = 0; + } + size *= 2; + } + pChunk->nCheckedOut--; + memsys6Link(pChunk, iBlock, iLogsize); +} + +/* +** Return the actual size of the block pointed to by p, which is guaranteed +** to have been allocated from chunk pChunk. +*/ +static int chunkSize(Mem6Chunk *pChunk, void *p){ + int iSize = 0; + if( p ){ + int i = ((u8 *)p-pChunk->zPool)/pChunk->nAtom; + assert( i>=0 && inBlock ); + iSize = pChunk->nAtom * (1 << (pChunk->aCtrl[i]&CTRL_LOGSIZE)); + } + return iSize; +} + +/* +** Return true if there are currently no outstanding allocations. +*/ +static int chunkIsEmpty(Mem6Chunk *pChunk){ + return (pChunk->nCheckedOut==0); +} + +/* +** Initialize the buffer zChunk, which is nChunk bytes in size, as +** an Mem6Chunk object. Return a copy of the zChunk pointer. +*/ +static Mem6Chunk *chunkInit(u8 *zChunk, int nChunk, int nMinAlloc){ + int ii; + int iOffset; + Mem6Chunk *pChunk = (Mem6Chunk *)zChunk; + + assert( nChunk>sizeof(Mem6Chunk) ); + assert( nMinAlloc>sizeof(Mem6Link) ); + + memset(pChunk, 0, sizeof(Mem6Chunk)); + pChunk->nAtom = nMinAlloc; + pChunk->nBlock = ((nChunk-sizeof(Mem6Chunk)) / (pChunk->nAtom+sizeof(u8))); + + pChunk->zPool = (u8 *)&pChunk[1]; + pChunk->aCtrl = &pChunk->zPool[pChunk->nBlock*pChunk->nAtom]; + + for(ii=0; ii<=mem6.nLogThreshold; ii++){ + pChunk->aiFreelist[ii] = -1; + } + + iOffset = 0; + for(ii=mem6.nLogThreshold; ii>=0; ii--){ + int nAlloc = (1<nBlock ){ + pChunk->aCtrl[iOffset] = ii | CTRL_FREE; + memsys6Link(pChunk, iOffset, ii); + iOffset += nAlloc; + } + } + + return pChunk; +} + + +static void mem6Enter(void){ + sqlite3_mutex_enter(mem6.mutex); +} + +static void mem6Leave(void){ + sqlite3_mutex_leave(mem6.mutex); +} + +/* +** Based on the number and size of the currently allocated chunks, return +** the size of the next chunk to allocate, in bytes. +*/ +static int nextChunkSize(void){ + int iTotal = MIN_CHUNKSIZE; + Mem6Chunk *p; + for(p=mem6.pChunk; p; p=p->pNext){ + iTotal = iTotal*2; + } + return iTotal; +} + +static void freeChunk(Mem6Chunk *pChunk){ + Mem6Chunk **pp = &mem6.pChunk; + for( pp=&mem6.pChunk; *pp!=pChunk; pp = &(*pp)->pNext ); + *pp = (*pp)->pNext; + free(pChunk); +} + +static void *memsys6Malloc(int nByte){ + Mem6Chunk *pChunk; + void *p = 0; + int nTotal = nByte+8; + int iOffset = 0; + + if( nTotal>mem6.nThreshold ){ + p = malloc(nTotal); + }else{ + int iLogsize = 0; + if( nTotal>(1<pNext){ + p = chunkMalloc(pChunk, iLogsize); + if( p ){ + break; + } + } + if( !p ){ + int iSize = nextChunkSize(); + p = malloc(iSize); + if( p ){ + pChunk = chunkInit((u8 *)p, iSize, mem6.nMinAlloc); + pChunk->pNext = mem6.pChunk; + mem6.pChunk = pChunk; + p = chunkMalloc(pChunk, iLogsize); + assert(p); + } + } + iOffset = ((u8*)p - (u8*)pChunk); + mem6Leave(); + } + + if( !p ){ + return 0; + } + ((u32 *)p)[0] = iOffset; + ((u32 *)p)[1] = nByte; + return &((u32 *)p)[2]; +} + +static int memsys6Size(void *pPrior){ + if( pPrior==0 ) return 0; + return ((u32*)pPrior)[-1]; +} + +static void memsys6Free(void *pPrior){ + int iSlot; + void *p = &((u32 *)pPrior)[-2]; + iSlot = ((u32 *)p)[0]; + if( iSlot ){ + Mem6Chunk *pChunk; + mem6Enter(); + pChunk = (Mem6Chunk *)(&((u8 *)p)[-1 * iSlot]); + chunkFree(pChunk, p); + if( chunkIsEmpty(pChunk) ){ + freeChunk(pChunk); + } + mem6Leave(); + }else{ + free(p); + } +} + +static void *memsys6Realloc(void *p, int nByte){ + void *p2; + + if( p && nByte<=memsys6Size(p) ){ + p2 = p; + }else{ + p2 = memsys6Malloc(nByte); + if( p && p2 ){ + memcpy(p2, p, memsys6Size(p)); + memsys6Free(p); + } + } + + return p2; +} + +static int memsys6Roundup(int n){ + if( n>mem6.nThreshold ){ + return n; + }else{ + return (1<endpoint.iOffset ); - - if( p->readpoint.iOffset!=iOfst || iOfst==0 ){ - sqlite3_int64 iOff = 0; - for(pChunk=p->pFirst; - pChunk && (iOff+JOURNAL_CHUNKSIZE)<=iOfst; - pChunk=pChunk->pNext - ){ - iOff += JOURNAL_CHUNKSIZE; - } - }else{ - pChunk = p->readpoint.pChunk; - } - - iChunkOffset = (int)(iOfst%JOURNAL_CHUNKSIZE); - do { - int iSpace = JOURNAL_CHUNKSIZE - iChunkOffset; - int nCopy = MIN(nRead, (JOURNAL_CHUNKSIZE - iChunkOffset)); - memcpy(zOut, &pChunk->zChunk[iChunkOffset], nCopy); - zOut += nCopy; - nRead -= iSpace; - iChunkOffset = 0; - } while( nRead>=0 && (pChunk=pChunk->pNext)!=0 && nRead>0 ); - p->readpoint.iOffset = iOfst+iAmt; - p->readpoint.pChunk = pChunk; - - return SQLITE_OK; -} - -/* -** Write data to the file. -*/ -static int memjrnlWrite( - sqlite3_file *pJfd, /* The journal file into which to write */ - const void *zBuf, /* Take data to be written from here */ - int iAmt, /* Number of bytes to write */ - sqlite_int64 iOfst /* Begin writing at this offset into the file */ -){ - MemJournal *p = (MemJournal *)pJfd; - int nWrite = iAmt; - u8 *zWrite = (u8 *)zBuf; - - /* An in-memory journal file should only ever be appended to. Random - ** access writes are not required by sqlite. - */ - assert(iOfst==p->endpoint.iOffset); - UNUSED_PARAMETER(iOfst); - - while( nWrite>0 ){ - FileChunk *pChunk = p->endpoint.pChunk; - int iChunkOffset = (int)(p->endpoint.iOffset%JOURNAL_CHUNKSIZE); - int iSpace = MIN(nWrite, JOURNAL_CHUNKSIZE - iChunkOffset); - - if( iChunkOffset==0 ){ - /* New chunk is required to extend the file. */ - FileChunk *pNew = sqlite3_malloc(sizeof(FileChunk)); - if( !pNew ){ - return SQLITE_IOERR_NOMEM; - } - pNew->pNext = 0; - if( pChunk ){ - assert( p->pFirst ); - pChunk->pNext = pNew; - }else{ - assert( !p->pFirst ); - p->pFirst = pNew; - } - p->endpoint.pChunk = pNew; - } - - memcpy(&p->endpoint.pChunk->zChunk[iChunkOffset], zWrite, iSpace); - zWrite += iSpace; - nWrite -= iSpace; - p->endpoint.iOffset += iSpace; - } - - return SQLITE_OK; -} - -/* -** Truncate the file. -*/ -static int memjrnlTruncate(sqlite3_file *pJfd, sqlite_int64 size){ - MemJournal *p = (MemJournal *)pJfd; - FileChunk *pChunk; - assert(size==0); - UNUSED_PARAMETER(size); - pChunk = p->pFirst; - while( pChunk ){ - FileChunk *pTmp = pChunk; - pChunk = pChunk->pNext; - sqlite3_free(pTmp); - } - sqlite3MemJournalOpen(pJfd); - return SQLITE_OK; -} - -/* -** Close the file. -*/ -static int memjrnlClose(sqlite3_file *pJfd){ - memjrnlTruncate(pJfd, 0); - return SQLITE_OK; -} - - -/* -** Sync the file. -*/ -static int memjrnlSync(sqlite3_file *NotUsed, int NotUsed2){ - UNUSED_PARAMETER2(NotUsed, NotUsed2); - return SQLITE_OK; -} - -/* -** Query the size of the file in bytes. -*/ -static int memjrnlFileSize(sqlite3_file *pJfd, sqlite_int64 *pSize){ - MemJournal *p = (MemJournal *)pJfd; - *pSize = (sqlite_int64) p->endpoint.iOffset; - return SQLITE_OK; -} - -/* -** Table of methods for MemJournal sqlite3_file object. -*/ -static struct sqlite3_io_methods MemJournalMethods = { - 1, /* iVersion */ - memjrnlClose, /* xClose */ - memjrnlRead, /* xRead */ - memjrnlWrite, /* xWrite */ - memjrnlTruncate, /* xTruncate */ - memjrnlSync, /* xSync */ - memjrnlFileSize, /* xFileSize */ - 0, /* xLock */ - 0, /* xUnlock */ - 0, /* xCheckReservedLock */ - 0, /* xFileControl */ - 0, /* xSectorSize */ - 0 /* xDeviceCharacteristics */ -}; - -/* -** Open a journal file. -*/ -void sqlite3MemJournalOpen(sqlite3_file *pJfd){ - MemJournal *p = (MemJournal *)pJfd; - memset(p, 0, sqlite3MemJournalSize()); - p->pMethod = &MemJournalMethods; -} - -/* -** Return true if the file-handle passed as an argument is -** an in-memory journal -*/ -int sqlite3IsMemJournal(sqlite3_file *pJfd){ - return pJfd->pMethods==&MemJournalMethods; -} - -/* -** Return the number of bytes required to store a MemJournal that uses vfs -** pVfs to create the underlying on-disk files. -*/ -int sqlite3MemJournalSize(void){ - return sizeof(MemJournal); -} Index: src/mutex_noop.c ================================================================== --- src/mutex_noop.c +++ src/mutex_noop.c @@ -23,11 +23,11 @@ ** ** If compiled with SQLITE_DEBUG, then additional logic is inserted ** that does error checking on mutexes to make sure they are being ** called correctly. ** -** $Id: mutex_noop.c,v 1.3 2008/12/05 17:17:08 drh Exp $ +** $Id: mutex_noop.c,v 1.1 2008/10/07 15:25:48 drh Exp $ */ #include "sqliteInt.h" #if defined(SQLITE_MUTEX_NOOP) && !defined(SQLITE_DEBUG) @@ -42,11 +42,11 @@ static int noopMutexEnd(void){ return SQLITE_OK; } static sqlite3_mutex *noopMutexAlloc(int id){ return (sqlite3_mutex*)8; } static void noopMutexFree(sqlite3_mutex *p){ return; } static void noopMutexEnter(sqlite3_mutex *p){ return; } static int noopMutexTry(sqlite3_mutex *p){ return SQLITE_OK; } -static void noopMutexLeave(sqlite3_mutex *p){ return; } +static void debugMutexLeave(sqlite3_mutex *p){ return; } sqlite3_mutex_methods *sqlite3DefaultMutex(void){ static sqlite3_mutex_methods sMutex = { noopMutexInit, noopMutexEnd, @@ -114,11 +114,11 @@ } break; } default: { assert( id-2 >= 0 ); - assert( id-2 < (int)(sizeof(aStatic)/sizeof(aStatic[0])) ); + assert( id-2 < sizeof(aStatic)/sizeof(aStatic[0]) ); pNew = &aStatic[id-2]; pNew->id = id; break; } } Index: src/mutex_os2.c ================================================================== --- src/mutex_os2.c +++ src/mutex_os2.c @@ -9,11 +9,11 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains the C functions that implement mutexes for OS/2 ** -** $Id: mutex_os2.c,v 1.11 2008/11/22 19:50:54 pweilbacher Exp $ +** $Id: mutex_os2.c,v 1.10 2008/06/23 22:13:28 pweilbacher Exp $ */ #include "sqliteInt.h" /* ** The code in this file is only used if SQLITE_MUTEX_OS2 is defined. @@ -120,11 +120,11 @@ ppib->pib_ulpid ); while( !isInit ){ mutex = 0; rc = DosCreateMutexSem( name, &mutex, 0, FALSE); if( rc == NO_ERROR ){ - unsigned int i; + int i; if( !isInit ){ for( i = 0; i < sizeof(staticMutexes)/sizeof(staticMutexes[0]); i++ ){ DosCreateMutexSem( 0, &staticMutexes[i].mutex, 0, FALSE ); } isInit = 1; Index: src/mutex_unix.c ================================================================== --- src/mutex_unix.c +++ src/mutex_unix.c @@ -9,11 +9,11 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains the C functions that implement mutexes for pthreads ** -** $Id: mutex_unix.c,v 1.16 2008/12/08 18:19:18 drh Exp $ +** $Id: mutex_unix.c,v 1.13 2008/07/16 12:33:24 drh Exp $ */ #include "sqliteInt.h" /* ** The code in this file is only used if we are compiling threadsafe @@ -59,11 +59,11 @@ ** On those platforms where pthread_equal() is not atomic, SQLite ** should be compiled without -DSQLITE_DEBUG and with -DNDEBUG to ** make sure no assert() statements are evaluated and hence these ** routines are never called. */ -#if !defined(NDEBUG) || defined(SQLITE_DEBUG) +#ifndef NDEBUG static int pthreadMutexHeld(sqlite3_mutex *p){ return (p->nRef!=0 && pthread_equal(p->owner, pthread_self())); } static int pthreadMutexNotheld(sqlite3_mutex *p){ return p->nRef==0 || pthread_equal(p->owner, pthread_self())==0; @@ -155,11 +155,11 @@ } break; } default: { assert( iType-2 >= 0 ); - assert( iType-2 < ArraySize(staticMutexes) ); + assert( iType-2 < sizeof(staticMutexes)/sizeof(staticMutexes[0]) ); p = &staticMutexes[iType-2]; p->id = iType; break; } } @@ -314,15 +314,12 @@ pthreadMutexTry, pthreadMutexLeave, #ifdef SQLITE_DEBUG pthreadMutexHeld, pthreadMutexNotheld -#else - 0, - 0 #endif }; return &sMutex; } #endif /* SQLITE_MUTEX_PTHREAD */ Index: src/mutex_w32.c ================================================================== --- src/mutex_w32.c +++ src/mutex_w32.c @@ -9,11 +9,11 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains the C functions that implement mutexes for win32 ** -** $Id: mutex_w32.c,v 1.15 2009/01/30 16:09:23 shane Exp $ +** $Id: mutex_w32.c,v 1.11 2008/06/26 10:41:19 danielk1977 Exp $ */ #include "sqliteInt.h" /* ** The code in this file is only used if we are compiling multithreaded @@ -39,18 +39,11 @@ ** the LockFileEx() API. But we can still statically link against that ** API as long as we don't call it win running Win95/98/ME. A call to ** this routine is used to determine if the host is Win95/98/ME or ** WinNT/2K/XP so that we will know whether or not we can safely call ** the LockFileEx() API. -** -** mutexIsNT() is only used for the TryEnterCriticalSection() API call, -** which is only available if your application was compiled with -** _WIN32_WINNT defined to a value >= 0x0400. Currently, the only -** call to TryEnterCriticalSection() is #ifdef'ed out, so #ifdef -** this out as well. */ -#if 0 #if SQLITE_OS_WINCE # define mutexIsNT() (1) #else static int mutexIsNT(void){ static int osType = 0; @@ -61,11 +54,11 @@ osType = sInfo.dwPlatformId==VER_PLATFORM_WIN32_NT ? 2 : 1; } return osType==2; } #endif /* SQLITE_OS_WINCE */ -#endif + #ifdef SQLITE_DEBUG /* ** The sqlite3_mutex_held() and sqlite3_mutex_notheld() routine are ** intended for use only inside assert() statements. @@ -211,12 +204,10 @@ if( mutexIsNT() && TryEnterCriticalSection(&p->mutex) ){ p->owner = GetCurrentThreadId(); p->nRef++; rc = SQLITE_OK; } -#else - UNUSED_PARAMETER(p); #endif return rc; } /* @@ -243,14 +234,11 @@ winMutexTry, winMutexLeave, #ifdef SQLITE_DEBUG winMutexHeld, winMutexNotheld -#else - 0, - 0 #endif }; return &sMutex; } #endif /* SQLITE_MUTEX_W32 */ Index: src/os.c ================================================================== --- src/os.c +++ src/os.c @@ -11,11 +11,11 @@ ****************************************************************************** ** ** This file contains OS interface code that is common to all ** architectures. ** -** $Id: os.c,v 1.125 2008/12/08 18:19:18 drh Exp $ +** $Id: os.c,v 1.124 2008/10/07 15:25:48 drh Exp $ */ #define _SQLITE_OS_C_ 1 #include "sqliteInt.h" #undef _SQLITE_OS_C_ @@ -140,12 +140,12 @@ return pVfs->xDlOpen(pVfs, zPath); } void sqlite3OsDlError(sqlite3_vfs *pVfs, int nByte, char *zBufOut){ pVfs->xDlError(pVfs, nByte, zBufOut); } -void (*sqlite3OsDlSym(sqlite3_vfs *pVfs, void *pHdle, const char *zSym))(void){ - return pVfs->xDlSym(pVfs, pHdle, zSym); +void *sqlite3OsDlSym(sqlite3_vfs *pVfs, void *pHandle, const char *zSymbol){ + return pVfs->xDlSym(pVfs, pHandle, zSymbol); } void sqlite3OsDlClose(sqlite3_vfs *pVfs, void *pHandle){ pVfs->xDlClose(pVfs, pHandle); } #endif /* SQLITE_OMIT_LOAD_EXTENSION */ Index: src/os.h ================================================================== --- src/os.h +++ src/os.h @@ -15,11 +15,11 @@ ** the SQLite library will work on both POSIX and windows systems. ** ** This header file is #include-ed by sqliteInt.h and thus ends up ** being included by every source file. ** -** $Id: os.h,v 1.108 2009/02/05 16:31:46 drh Exp $ +** $Id: os.h,v 1.105 2008/06/26 10:41:19 danielk1977 Exp $ */ #ifndef _SQLITE_OS_H_ #define _SQLITE_OS_H_ /* @@ -193,11 +193,13 @@ ** The following #defines specify the range of bytes used for locking. ** SHARED_SIZE is the number of bytes available in the pool from which ** a random byte is selected for a shared lock. The pool of bytes for ** shared locks begins at SHARED_FIRST. ** -** The same locking strategy and +** These #defines are available in sqlite_aux.h so that adaptors for +** connecting SQLite to other operating systems can use the same byte +** ranges for locking. In particular, the same locking strategy and ** byte ranges are used for Unix. This leaves open the possiblity of having ** clients on win95, winNT, and unix all talking to the same shared file ** and all locking correctly. To do so would require that samba (or whatever ** tool is being used for file sharing) implements locks correctly between ** windows and unix. I'm guessing that isn't likely to happen, but by @@ -217,11 +219,17 @@ ** the incompatibility right away, even running a full regression test. ** The default location of PENDING_BYTE is the first byte past the ** 1GB boundary. ** */ -#define PENDING_BYTE sqlite3PendingByte +#ifndef SQLITE_TEST +#define PENDING_BYTE 0x40000000 /* First byte past the 1GB boundary */ +#else +extern unsigned int sqlite3_pending_byte; +#define PENDING_BYTE sqlite3_pending_byte +#endif + #define RESERVED_BYTE (PENDING_BYTE+1) #define SHARED_FIRST (PENDING_BYTE+2) #define SHARED_SIZE 510 /* @@ -235,11 +243,10 @@ int sqlite3OsFileSize(sqlite3_file*, i64 *pSize); int sqlite3OsLock(sqlite3_file*, int); int sqlite3OsUnlock(sqlite3_file*, int); int sqlite3OsCheckReservedLock(sqlite3_file *id, int *pResOut); int sqlite3OsFileControl(sqlite3_file*,int,void*); -#define SQLITE_FCNTL_DB_UNCHANGED 0xca093fa0 int sqlite3OsSectorSize(sqlite3_file *id); int sqlite3OsDeviceCharacteristics(sqlite3_file *id); /* ** Functions for accessing sqlite3_vfs methods @@ -249,11 +256,11 @@ int sqlite3OsAccess(sqlite3_vfs *, const char *, int, int *pResOut); int sqlite3OsFullPathname(sqlite3_vfs *, const char *, int, char *); #ifndef SQLITE_OMIT_LOAD_EXTENSION void *sqlite3OsDlOpen(sqlite3_vfs *, const char *); void sqlite3OsDlError(sqlite3_vfs *, int, char *); -void (*sqlite3OsDlSym(sqlite3_vfs *, void *, const char *))(void); +void *sqlite3OsDlSym(sqlite3_vfs *, void *, const char *); void sqlite3OsDlClose(sqlite3_vfs *, void *); #endif /* SQLITE_OMIT_LOAD_EXTENSION */ int sqlite3OsRandomness(sqlite3_vfs *, int, char *); int sqlite3OsSleep(sqlite3_vfs *, int); int sqlite3OsCurrentTime(sqlite3_vfs *, double*); Index: src/os_os2.c ================================================================== --- src/os_os2.c +++ src/os_os2.c @@ -10,11 +10,11 @@ ** ****************************************************************************** ** ** This file contains code that is specific to OS/2. ** -** $Id: os_os2.c,v 1.63 2008/12/10 19:26:24 drh Exp $ +** $Id: os_os2.c,v 1.57 2008/10/13 21:46:47 pweilbacher Exp $ */ #include "sqliteInt.h" #if SQLITE_OS_OS2 @@ -122,11 +122,10 @@ return SQLITE_IOERR_READ; } if( got == (ULONG)amt ) return SQLITE_OK; else { - /* Unread portions of the input buffer must be zero-filled */ memset(&((char*)pBuf)[got], 0, amt-got); return SQLITE_IOERR_SHORT_READ; } } @@ -194,19 +193,11 @@ if( flags & SQLITE_SYNC_FULL){ sqlite3_fullsync_count++; } sqlite3_sync_count++; #endif - /* If we compiled with the SQLITE_NO_SYNC flag, then syncing is a - ** no-op - */ -#ifdef SQLITE_NO_SYNC - UNUSED_PARAMETER(pFile); - return SQLITE_OK; -#else return DosResetBuffer( pFile->h ) == NO_ERROR ? SQLITE_OK : SQLITE_IOERR; -#endif } /* ** Determine the current size of a file in bytes */ @@ -692,11 +683,11 @@ } } /* Strip off a trailing slashes or backslashes, otherwise we would get * * multiple (back)slashes which causes DosOpen() to fail. * * Trailing spaces are not allowed, either. */ - j = sqlite3Strlen30(zTempPath); + j = strlen(zTempPath); while( j > 0 && ( zTempPath[j-1] == '\\' || zTempPath[j-1] == '/' || zTempPath[j-1] == ' ' ) ){ j--; } zTempPath[j] = '\0'; @@ -707,11 +698,11 @@ free( zTempPathUTF ); }else{ sqlite3_snprintf( nBuf-30, zBuf, "%s\\"SQLITE_TEMP_FILE_PREFIX, zTempPath ); } - j = sqlite3Strlen30( zBuf ); + j = strlen( zBuf ); sqlite3_randomness( 20, &zBuf[j] ); for( i = 0; i < 20; i++, j++ ){ zBuf[j] = (char)zChars[ ((unsigned char)zBuf[j])%(sizeof(zChars)-1) ]; } zBuf[j] = 0; @@ -965,17 +956,13 @@ /* ** Write up to nBuf bytes of randomness into zBuf. */ static int os2Randomness(sqlite3_vfs *pVfs, int nBuf, char *zBuf ){ + ULONG sizeofULong = sizeof(ULONG); int n = 0; -#if defined(SQLITE_TEST) - n = nBuf; - memset(zBuf, 0, nBuf); -#else - int sizeofULong = sizeof(ULONG); - if( (int)sizeof(DATETIME) <= nBuf - n ){ + if( sizeof(DATETIME) <= nBuf - n ){ DATETIME x; DosGetDateTime(&x); memcpy(&zBuf[n], &x, sizeof(x)); n += sizeof(x); } @@ -1018,11 +1005,10 @@ if( sizeofULong <= nBuf - n ){ memcpy(&zBuf[n], &ulSysInfo[QSV_TOTAVAILMEM - 1], sizeofULong); n += sizeofULong; } } -#endif return n; } /* Index: src/os_unix.c ================================================================== --- src/os_unix.c +++ src/os_unix.c @@ -8,85 +8,38 @@ ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ****************************************************************************** ** -** This file contains the VFS implementation for unix-like operating systems -** include Linux, MacOSX, *BSD, QNX, VxWorks, AIX, HPUX, and others. -** -** There are actually several different VFS implementations in this file. -** The differences are in the way that file locking is done. The default -** implementation uses Posix Advisory Locks. Alternative implementations -** use flock(), dot-files, various proprietary locking schemas, or simply -** skip locking all together. -** -** This source file is organized into divisions where the logic for various -** subfunctions is contained within the appropriate division. PLEASE -** KEEP THE STRUCTURE OF THIS FILE INTACT. New code should be placed -** in the correct division and should be clearly labeled. -** -** The layout of divisions is as follows: -** -** * General-purpose declarations and utility functions. -** * Unique file ID logic used by VxWorks. -** * Various locking primitive implementations (all except proxy locking): -** + for Posix Advisory Locks -** + for no-op locks -** + for dot-file locks -** + for flock() locking -** + for named semaphore locks (VxWorks only) -** + for AFP filesystem locks (MacOSX only) -** * sqlite3_file methods not associated with locking. -** * Definitions of sqlite3_io_methods objects for all locking -** methods plus "finder" functions for each locking method. -** * sqlite3_vfs method implementations. -** * Locking primitives for the proxy uber-locking-method. (MacOSX only) -** * Definitions of sqlite3_vfs objects for all locking methods -** plus implementations of sqlite3_os_init() and sqlite3_os_end(). -** -** $Id: os_unix.c,v 1.241 2009/02/09 17:34:07 drh Exp $ +** This file contains code that is specific to Unix systems. +** +** $Id: os_unix.c,v 1.205 2008/10/14 17:58:38 drh Exp $ */ #include "sqliteInt.h" #if SQLITE_OS_UNIX /* This file is used on unix only */ /* -** There are various methods for file locking used for concurrency -** control: -** -** 1. POSIX locking (the default), -** 2. No locking, -** 3. Dot-file locking, -** 4. flock() locking, -** 5. AFP locking (OSX only), -** 6. Named POSIX semaphores (VXWorks only), -** 7. proxy locking. (OSX only) -** -** Styles 4, 5, and 7 are only available of SQLITE_ENABLE_LOCKING_STYLE -** is defined to 1. The SQLITE_ENABLE_LOCKING_STYLE also enables automatic -** selection of the appropriate locking style based on the filesystem -** where the database is located. +** If SQLITE_ENABLE_LOCKING_STYLE is defined and is non-zero, then several +** alternative locking implementations are provided: +** +** * POSIX locking (the default), +** * No locking, +** * Dot-file locking, +** * flock() locking, +** * AFP locking (OSX only). +** +** SQLITE_ENABLE_LOCKING_STYLE only works on a Mac. It is turned on by +** default on a Mac and disabled on all other posix platforms. */ #if !defined(SQLITE_ENABLE_LOCKING_STYLE) -# if defined(__APPLE__) +# if defined(__DARWIN__) # define SQLITE_ENABLE_LOCKING_STYLE 1 # else # define SQLITE_ENABLE_LOCKING_STYLE 0 # endif #endif -/* -** Define the OS_VXWORKS pre-processor macro to 1 if building on -** vxworks, or 0 otherwise. -*/ -#ifndef OS_VXWORKS -# if defined(__RTP__) || defined(_WRS_KERNEL) -# define OS_VXWORKS 1 -# else -# define OS_VXWORKS 0 -# endif -#endif - /* ** These #defines should enable >2GB file support on Posix if the ** underlying operating system supports it. If the OS lacks ** large file support, these should be no-ops. ** @@ -95,15 +48,10 @@ ** on a recent machine (ex: RedHat 7.2) but you want your code to work ** on an older machine (ex: RedHat 6.0). If you compile on RedHat 7.2 ** without this option, LFS is enable. But LFS does not exist in the kernel ** in RedHat 6.0, so the code won't work. Hence, for maximum binary ** portability you should omit LFS. -** -** The previous paragraph was written in 2005. (This paragraph is written -** on 2008-11-28.) These days, all Linux kernels support large files, so -** you should probably leave LFS enabled. But some embedded platforms might -** lack LFS in which case the SQLITE_DISABLE_LFS macro might still be useful. */ #ifndef SQLITE_DISABLE_LFS # define _LARGE_FILE 1 # ifndef _FILE_OFFSET_BITS # define _FILE_OFFSET_BITS 64 @@ -121,19 +69,13 @@ #include #include #include #if SQLITE_ENABLE_LOCKING_STYLE -# include -# if OS_VXWORKS -# include -# include -# else -# include -# include -# include -# endif +#include +#include +#include #endif /* SQLITE_ENABLE_LOCKING_STYLE */ /* ** If we are to be thread-safe, include the pthreads header and define ** the SQLITE_UNIX_THREADS macro. @@ -148,76 +90,41 @@ */ #ifndef SQLITE_DEFAULT_FILE_PERMISSIONS # define SQLITE_DEFAULT_FILE_PERMISSIONS 0644 #endif -/* - ** Default permissions when creating auto proxy dir - */ -#ifndef SQLITE_DEFAULT_PROXYDIR_PERMISSIONS -# define SQLITE_DEFAULT_PROXYDIR_PERMISSIONS 0755 -#endif - /* ** Maximum supported path-length. */ #define MAX_PATHNAME 512 -/* -** Only set the lastErrno if the error code is a real error and not -** a normal expected return code of SQLITE_BUSY or SQLITE_OK -*/ -#define IS_LOCK_ERROR(x) ((x != SQLITE_OK) && (x != SQLITE_BUSY)) - /* -** The unixFile structure is subclass of sqlite3_file specific to the unix -** VFS implementations. +** The unixFile structure is subclass of sqlite3_file specific for the unix +** protability layer. */ typedef struct unixFile unixFile; struct unixFile { sqlite3_io_methods const *pMethod; /* Always the first entry */ - struct unixOpenCnt *pOpen; /* Info about all open fd's on this inode */ - struct unixLockInfo *pLock; /* Info about locks on this inode */ - int h; /* The file descriptor */ - int dirfd; /* File descriptor for the directory */ - unsigned char locktype; /* The type of lock held on this fd */ - int lastErrno; /* The unix errno from the last I/O error */ - void *lockingContext; /* Locking style specific state */ -#if SQLITE_ENABLE_LOCKING_STYLE - int openFlags; /* The flags specified at open() */ -#endif -#if SQLITE_THREADSAFE && defined(__linux__) - pthread_t tid; /* The thread that "owns" this unixFile */ -#endif -#if OS_VXWORKS - int isDelete; /* Delete on close if true */ - struct vxworksFileId *pId; /* Unique file ID */ -#endif -#ifndef NDEBUG - /* The next group of variables are used to track whether or not the - ** transaction counter in bytes 24-27 of database files are updated - ** whenever any part of the database changes. An assertion fault will - ** occur if a file is updated without also updating the transaction - ** counter. This test is made to avoid new problems similar to the - ** one described by ticket #3584. - */ - unsigned char transCntrChng; /* True if the transaction counter changed */ - unsigned char dbUpdate; /* True if any part of database file changed */ - unsigned char inNormalWrite; /* True if in a normal write operation */ - - /* If true, that means we are dealing with a database file that has - ** a range of locking bytes from PENDING_BYTE through PENDING_BYTE+511 - ** which should never be read or written. Asserts() will verify this */ - unsigned char isLockable; /* True if file might be locked */ -#endif #ifdef SQLITE_TEST /* In test mode, increase the size of this structure a bit so that ** it is larger than the struct CrashFile defined in test6.c. */ char aPadding[32]; #endif + struct openCnt *pOpen; /* Info about all open fd's on this inode */ + struct lockInfo *pLock; /* Info about locks on this inode */ +#if SQLITE_ENABLE_LOCKING_STYLE + void *lockingContext; /* Locking style specific state */ +#endif + int h; /* The file descriptor */ + unsigned char locktype; /* The type of lock held on this fd */ + int dirfd; /* File descriptor for the directory */ +#if SQLITE_THREADSAFE + pthread_t tid; /* The thread that "owns" this unixFile */ +#endif + int lastErrno; /* The unix errno from the last I/O error */ }; /* ** Include code that is common to all os_*.c files */ @@ -258,39 +165,276 @@ #define threadid pthread_self() #else #define threadid 0 #endif +/* +** Set or check the unixFile.tid field. This field is set when an unixFile +** is first opened. All subsequent uses of the unixFile verify that the +** same thread is operating on the unixFile. Some operating systems do +** not allow locks to be overridden by other threads and that restriction +** means that sqlite3* database handles cannot be moved from one thread +** to another. This logic makes sure a user does not try to do that +** by mistake. +** +** Version 3.3.1 (2006-01-15): unixFile can be moved from one thread to +** another as long as we are running on a system that supports threads +** overriding each others locks (which now the most common behavior) +** or if no locks are held. But the unixFile.pLock field needs to be +** recomputed because its key includes the thread-id. See the +** transferOwnership() function below for additional information +*/ +#if SQLITE_THREADSAFE +# define SET_THREADID(X) (X)->tid = pthread_self() +# define CHECK_THREADID(X) (threadsOverrideEachOthersLocks==0 && \ + !pthread_equal((X)->tid, pthread_self())) +#else +# define SET_THREADID(X) +# define CHECK_THREADID(X) 0 +#endif + +/* +** Here is the dirt on POSIX advisory locks: ANSI STD 1003.1 (1996) +** section 6.5.2.2 lines 483 through 490 specify that when a process +** sets or clears a lock, that operation overrides any prior locks set +** by the same process. It does not explicitly say so, but this implies +** that it overrides locks set by the same process using a different +** file descriptor. Consider this test case: +** int fd2 = open("./file2", O_RDWR|O_CREAT, 0644); +** +** Suppose ./file1 and ./file2 are really the same file (because +** one is a hard or symbolic link to the other) then if you set +** an exclusive lock on fd1, then try to get an exclusive lock +** on fd2, it works. I would have expected the second lock to +** fail since there was already a lock on the file due to fd1. +** But not so. Since both locks came from the same process, the +** second overrides the first, even though they were on different +** file descriptors opened on different file names. +** +** Bummer. If you ask me, this is broken. Badly broken. It means +** that we cannot use POSIX locks to synchronize file access among +** competing threads of the same process. POSIX locks will work fine +** to synchronize access for threads in separate processes, but not +** threads within the same process. +** +** To work around the problem, SQLite has to manage file locks internally +** on its own. Whenever a new database is opened, we have to find the +** specific inode of the database file (the inode is determined by the +** st_dev and st_ino fields of the stat structure that fstat() fills in) +** and check for locks already existing on that inode. When locks are +** created or removed, we have to look at our own internal record of the +** locks to see if another thread has previously set a lock on that same +** inode. +** +** The sqlite3_file structure for POSIX is no longer just an integer file +** descriptor. It is now a structure that holds the integer file +** descriptor and a pointer to a structure that describes the internal +** locks on the corresponding inode. There is one locking structure +** per inode, so if the same inode is opened twice, both unixFile structures +** point to the same locking structure. The locking structure keeps +** a reference count (so we will know when to delete it) and a "cnt" +** field that tells us its internal lock status. cnt==0 means the +** file is unlocked. cnt==-1 means the file has an exclusive lock. +** cnt>0 means there are cnt shared locks on the file. +** +** Any attempt to lock or unlock a file first checks the locking +** structure. The fcntl() system call is only invoked to set a +** POSIX lock if the internal lock structure transitions between +** a locked and an unlocked state. +** +** 2004-Jan-11: +** More recent discoveries about POSIX advisory locks. (The more +** I discover, the more I realize the a POSIX advisory locks are +** an abomination.) +** +** If you close a file descriptor that points to a file that has locks, +** all locks on that file that are owned by the current process are +** released. To work around this problem, each unixFile structure contains +** a pointer to an openCnt structure. There is one openCnt structure +** per open inode, which means that multiple unixFile can point to a single +** openCnt. When an attempt is made to close an unixFile, if there are +** other unixFile open on the same inode that are holding locks, the call +** to close() the file descriptor is deferred until all of the locks clear. +** The openCnt structure keeps a list of file descriptors that need to +** be closed and that list is walked (and cleared) when the last lock +** clears. +** +** First, under Linux threads, because each thread has a separate +** process ID, lock operations in one thread do not override locks +** to the same file in other threads. Linux threads behave like +** separate processes in this respect. But, if you close a file +** descriptor in linux threads, all locks are cleared, even locks +** on other threads and even though the other threads have different +** process IDs. Linux threads is inconsistent in this respect. +** (I'm beginning to think that linux threads is an abomination too.) +** The consequence of this all is that the hash table for the lockInfo +** structure has to include the process id as part of its key because +** locks in different threads are treated as distinct. But the +** openCnt structure should not include the process id in its +** key because close() clears lock on all threads, not just the current +** thread. Were it not for this goofiness in linux threads, we could +** combine the lockInfo and openCnt structures into a single structure. +** +** 2004-Jun-28: +** On some versions of linux, threads can override each others locks. +** On others not. Sometimes you can change the behavior on the same +** system by setting the LD_ASSUME_KERNEL environment variable. The +** POSIX standard is silent as to which behavior is correct, as far +** as I can tell, so other versions of unix might show the same +** inconsistency. There is no little doubt in my mind that posix +** advisory locks and linux threads are profoundly broken. +** +** To work around the inconsistencies, we have to test at runtime +** whether or not threads can override each others locks. This test +** is run once, the first time any lock is attempted. A static +** variable is set to record the results of this test for future +** use. +*/ + +/* +** An instance of the following structure serves as the key used +** to locate a particular lockInfo structure given its inode. +** +** If threads cannot override each others locks, then we set the +** lockKey.tid field to the thread ID. If threads can override +** each others locks then tid is always set to zero. tid is omitted +** if we compile without threading support. +*/ +struct lockKey { + dev_t dev; /* Device number */ + ino_t ino; /* Inode number */ +#if SQLITE_THREADSAFE + pthread_t tid; /* Thread ID or zero if threads can override each other */ +#endif +}; + +/* +** An instance of the following structure is allocated for each open +** inode on each thread with a different process ID. (Threads have +** different process IDs on linux, but not on most other unixes.) +** +** A single inode can have multiple file descriptors, so each unixFile +** structure contains a pointer to an instance of this object and this +** object keeps a count of the number of unixFile pointing to it. +*/ +struct lockInfo { + struct lockKey key; /* The lookup key */ + int cnt; /* Number of SHARED locks held */ + int locktype; /* One of SHARED_LOCK, RESERVED_LOCK etc. */ + int nRef; /* Number of pointers to this structure */ + struct lockInfo *pNext, *pPrev; /* List of all lockInfo objects */ +}; + +/* +** An instance of the following structure serves as the key used +** to locate a particular openCnt structure given its inode. This +** is the same as the lockKey except that the thread ID is omitted. +*/ +struct openKey { + dev_t dev; /* Device number */ + ino_t ino; /* Inode number */ +}; + +/* +** An instance of the following structure is allocated for each open +** inode. This structure keeps track of the number of locks on that +** inode. If a close is attempted against an inode that is holding +** locks, the close is deferred until all locks clear by adding the +** file descriptor to be closed to the pending list. +*/ +struct openCnt { + struct openKey key; /* The lookup key */ + int nRef; /* Number of pointers to this structure */ + int nLock; /* Number of outstanding locks */ + int nPending; /* Number of pending close() operations */ + int *aPending; /* Malloced space holding fd's awaiting a close() */ + struct openCnt *pNext, *pPrev; /* List of all openCnt objects */ +}; + +/* +** List of all lockInfo and openCnt objects. This used to be a hash +** table. But the number of objects is rarely more than a dozen and +** never exceeds a few thousand. And lookup is not on a critical +** path oo a simple linked list will suffice. +*/ +static struct lockInfo *lockList = 0; +static struct openCnt *openList = 0; + +/* +** The locking styles are associated with the different file locking +** capabilities supported by different file systems. +** +** POSIX locking style fully supports shared and exclusive byte-range locks +** AFP locking only supports exclusive byte-range locks +** FLOCK only supports a single file-global exclusive lock +** DOTLOCK isn't a true locking style, it refers to the use of a special +** file named the same as the database file with a '.lock' extension, this +** can be used on file systems that do not offer any reliable file locking +** NO locking means that no locking will be attempted, this is only used for +** read-only file systems currently +** UNSUPPORTED means that no locking will be attempted, this is only used for +** file systems that are known to be unsupported +*/ +#define LOCKING_STYLE_POSIX 1 +#define LOCKING_STYLE_NONE 2 +#define LOCKING_STYLE_DOTFILE 3 +#define LOCKING_STYLE_FLOCK 4 +#define LOCKING_STYLE_AFP 5 + +/* +** Only set the lastErrno if the error code is a real error and not +** a normal expected return code of SQLITE_BUSY or SQLITE_OK +*/ +#define IS_LOCK_ERROR(x) ((x != SQLITE_OK) && (x != SQLITE_BUSY)) /* ** Helper functions to obtain and relinquish the global mutex. */ -static void unixEnterMutex(void){ +static void enterMutex(void){ sqlite3_mutex_enter(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER)); } -static void unixLeaveMutex(void){ +static void leaveMutex(void){ sqlite3_mutex_leave(sqlite3MutexAlloc(SQLITE_MUTEX_STATIC_MASTER)); } - -#ifdef SQLITE_DEBUG +#if SQLITE_THREADSAFE /* -** Helper function for printing out trace information from debugging -** binaries. This returns the string represetation of the supplied -** integer lock-type. +** This variable records whether or not threads can override each others +** locks. +** +** 0: No. Threads cannot override each others locks. +** 1: Yes. Threads can override each others locks. +** -1: We don't know yet. +** +** On some systems, we know at compile-time if threads can override each +** others locks. On those systems, the SQLITE_THREAD_OVERRIDE_LOCK macro +** will be set appropriately. On other systems, we have to check at +** runtime. On these latter systems, SQLTIE_THREAD_OVERRIDE_LOCK is +** undefined. +** +** This variable normally has file scope only. But during testing, we make +** it a global so that the test code can change its value in order to verify +** that the right stuff happens in either case. */ -static const char *locktypeName(int locktype){ - switch( locktype ){ - case NO_LOCK: return "NONE"; - case SHARED_LOCK: return "SHARED"; - case RESERVED_LOCK: return "RESERVED"; - case PENDING_LOCK: return "PENDING"; - case EXCLUSIVE_LOCK: return "EXCLUSIVE"; - } - return "ERROR"; -} +#ifndef SQLITE_THREAD_OVERRIDE_LOCK +# define SQLITE_THREAD_OVERRIDE_LOCK -1 +#endif +#ifdef SQLITE_TEST +int threadsOverrideEachOthersLocks = SQLITE_THREAD_OVERRIDE_LOCK; +#else +static int threadsOverrideEachOthersLocks = SQLITE_THREAD_OVERRIDE_LOCK; #endif + +/* +** This structure holds information passed into individual test +** threads by the testThreadLockingBehavior() routine. +*/ +struct threadTestData { + int fd; /* File to be locked */ + struct flock lock; /* The locking operation */ + int result; /* Result of the locking operation */ +}; #ifdef SQLITE_LOCK_TRACE /* ** Print out information about all locking operations. ** @@ -347,11 +491,664 @@ return s; } #define fcntl lockTrace #endif /* SQLITE_LOCK_TRACE */ +/* +** The testThreadLockingBehavior() routine launches two separate +** threads on this routine. This routine attempts to lock a file +** descriptor then returns. The success or failure of that attempt +** allows the testThreadLockingBehavior() procedure to determine +** whether or not threads can override each others locks. +*/ +static void *threadLockingTest(void *pArg){ + struct threadTestData *pData = (struct threadTestData*)pArg; + pData->result = fcntl(pData->fd, F_SETLK, &pData->lock); + return pArg; +} +/* +** This procedure attempts to determine whether or not threads +** can override each others locks then sets the +** threadsOverrideEachOthersLocks variable appropriately. +*/ +static void testThreadLockingBehavior(int fd_orig){ + int fd; + struct threadTestData d[2]; + pthread_t t[2]; + + fd = dup(fd_orig); + if( fd<0 ) return; + memset(d, 0, sizeof(d)); + d[0].fd = fd; + d[0].lock.l_type = F_RDLCK; + d[0].lock.l_len = 1; + d[0].lock.l_start = 0; + d[0].lock.l_whence = SEEK_SET; + d[1] = d[0]; + d[1].lock.l_type = F_WRLCK; + pthread_create(&t[0], 0, threadLockingTest, &d[0]); + pthread_create(&t[1], 0, threadLockingTest, &d[1]); + pthread_join(t[0], 0); + pthread_join(t[1], 0); + close(fd); + threadsOverrideEachOthersLocks = d[0].result==0 && d[1].result==0; +} +#endif /* SQLITE_THREADSAFE */ + +/* +** Release a lockInfo structure previously allocated by findLockInfo(). +*/ +static void releaseLockInfo(struct lockInfo *pLock){ + if( pLock ){ + pLock->nRef--; + if( pLock->nRef==0 ){ + if( pLock->pPrev ){ + assert( pLock->pPrev->pNext==pLock ); + pLock->pPrev->pNext = pLock->pNext; + }else{ + assert( lockList==pLock ); + lockList = pLock->pNext; + } + if( pLock->pNext ){ + assert( pLock->pNext->pPrev==pLock ); + pLock->pNext->pPrev = pLock->pPrev; + } + sqlite3_free(pLock); + } + } +} + +/* +** Release a openCnt structure previously allocated by findLockInfo(). +*/ +static void releaseOpenCnt(struct openCnt *pOpen){ + if( pOpen ){ + pOpen->nRef--; + if( pOpen->nRef==0 ){ + if( pOpen->pPrev ){ + assert( pOpen->pPrev->pNext==pOpen ); + pOpen->pPrev->pNext = pOpen->pNext; + }else{ + assert( openList==pOpen ); + openList = pOpen->pNext; + } + if( pOpen->pNext ){ + assert( pOpen->pNext->pPrev==pOpen ); + pOpen->pNext->pPrev = pOpen->pPrev; + } + sqlite3_free(pOpen->aPending); + sqlite3_free(pOpen); + } + } +} + +#if SQLITE_ENABLE_LOCKING_STYLE +/* +** Tests a byte-range locking query to see if byte range locks are +** supported, if not we fall back to dotlockLockingStyle. +*/ +static int testLockingStyle(int fd){ + struct flock lockInfo; + + /* Test byte-range lock using fcntl(). If the call succeeds, + ** assume that the file-system supports POSIX style locks. + */ + lockInfo.l_len = 1; + lockInfo.l_start = 0; + lockInfo.l_whence = SEEK_SET; + lockInfo.l_type = F_RDLCK; + if( fcntl(fd, F_GETLK, &lockInfo)!=-1 ) { + return LOCKING_STYLE_POSIX; + } + + /* Testing for flock() can give false positives. So if if the above + ** test fails, then we fall back to using dot-file style locking. + */ + return LOCKING_STYLE_DOTFILE; +} +#endif + +/* +** If SQLITE_ENABLE_LOCKING_STYLE is defined, this function Examines the +** f_fstypename entry in the statfs structure as returned by stat() for +** the file system hosting the database file and selects the appropriate +** locking style based on its value. These values and assignments are +** based on Darwin/OSX behavior and have not been thoroughly tested on +** other systems. +** +** If SQLITE_ENABLE_LOCKING_STYLE is not defined, this function always +** returns LOCKING_STYLE_POSIX. +*/ +static int detectLockingStyle( + sqlite3_vfs *pVfs, + const char *filePath, + int fd +){ +#if SQLITE_ENABLE_LOCKING_STYLE + struct Mapping { + const char *zFilesystem; + int eLockingStyle; + } aMap[] = { + { "hfs", LOCKING_STYLE_POSIX }, + { "ufs", LOCKING_STYLE_POSIX }, + { "afpfs", LOCKING_STYLE_AFP }, +#ifdef SQLITE_ENABLE_AFP_LOCKING_SMB + { "smbfs", LOCKING_STYLE_AFP }, +#else + { "smbfs", LOCKING_STYLE_FLOCK }, +#endif + { "msdos", LOCKING_STYLE_DOTFILE }, + { "webdav", LOCKING_STYLE_NONE }, + { 0, 0 } + }; + int i; + struct statfs fsInfo; + + if( !filePath ){ + return LOCKING_STYLE_NONE; + } + if( pVfs->pAppData ){ + return SQLITE_PTR_TO_INT(pVfs->pAppData); + } + + if( statfs(filePath, &fsInfo) != -1 ){ + if( fsInfo.f_flags & MNT_RDONLY ){ + return LOCKING_STYLE_NONE; + } + for(i=0; aMap[i].zFilesystem; i++){ + if( strcmp(fsInfo.f_fstypename, aMap[i].zFilesystem)==0 ){ + return aMap[i].eLockingStyle; + } + } + } + + /* Default case. Handles, amongst others, "nfs". */ + return testLockingStyle(fd); +#endif + return LOCKING_STYLE_POSIX; +} + +/* +** Given a file descriptor, locate lockInfo and openCnt structures that +** describes that file descriptor. Create new ones if necessary. The +** return values might be uninitialized if an error occurs. +** +** Return an appropriate error code. +*/ +static int findLockInfo( + int fd, /* The file descriptor used in the key */ + struct lockInfo **ppLock, /* Return the lockInfo structure here */ + struct openCnt **ppOpen /* Return the openCnt structure here */ +){ + int rc; + struct lockKey key1; + struct openKey key2; + struct stat statbuf; + struct lockInfo *pLock; + struct openCnt *pOpen; + rc = fstat(fd, &statbuf); + if( rc!=0 ){ +#ifdef EOVERFLOW + if( errno==EOVERFLOW ) return SQLITE_NOLFS; +#endif + return SQLITE_IOERR; + } + + /* On OS X on an msdos filesystem, the inode number is reported + ** incorrectly for zero-size files. See ticket #3260. To work + ** around this problem (we consider it a bug in OS X, not SQLite) + ** we always increase the file size to 1 by writing a single byte + ** prior to accessing the inode number. The one byte written is + ** an ASCII 'S' character which also happens to be the first byte + ** in the header of every SQLite database. In this way, if there + ** is a race condition such that another thread has already populated + ** the first page of the database, no damage is done. + */ + if( statbuf.st_size==0 ){ + write(fd, "S", 1); + rc = fstat(fd, &statbuf); + if( rc!=0 ){ + return SQLITE_IOERR; + } + } + + memset(&key1, 0, sizeof(key1)); + key1.dev = statbuf.st_dev; + key1.ino = statbuf.st_ino; +#if SQLITE_THREADSAFE + if( threadsOverrideEachOthersLocks<0 ){ + testThreadLockingBehavior(fd); + } + key1.tid = threadsOverrideEachOthersLocks ? 0 : pthread_self(); +#endif + memset(&key2, 0, sizeof(key2)); + key2.dev = statbuf.st_dev; + key2.ino = statbuf.st_ino; + pLock = lockList; + while( pLock && memcmp(&key1, &pLock->key, sizeof(key1)) ){ + pLock = pLock->pNext; + } + if( pLock==0 ){ + pLock = sqlite3_malloc( sizeof(*pLock) ); + if( pLock==0 ){ + rc = SQLITE_NOMEM; + goto exit_findlockinfo; + } + pLock->key = key1; + pLock->nRef = 1; + pLock->cnt = 0; + pLock->locktype = 0; + pLock->pNext = lockList; + pLock->pPrev = 0; + if( lockList ) lockList->pPrev = pLock; + lockList = pLock; + }else{ + pLock->nRef++; + } + *ppLock = pLock; + if( ppOpen!=0 ){ + pOpen = openList; + while( pOpen && memcmp(&key2, &pOpen->key, sizeof(key2)) ){ + pOpen = pOpen->pNext; + } + if( pOpen==0 ){ + pOpen = sqlite3_malloc( sizeof(*pOpen) ); + if( pOpen==0 ){ + releaseLockInfo(pLock); + rc = SQLITE_NOMEM; + goto exit_findlockinfo; + } + pOpen->key = key2; + pOpen->nRef = 1; + pOpen->nLock = 0; + pOpen->nPending = 0; + pOpen->aPending = 0; + pOpen->pNext = openList; + pOpen->pPrev = 0; + if( openList ) openList->pPrev = pOpen; + openList = pOpen; + }else{ + pOpen->nRef++; + } + *ppOpen = pOpen; + } + +exit_findlockinfo: + return rc; +} + +#ifdef SQLITE_DEBUG +/* +** Helper function for printing out trace information from debugging +** binaries. This returns the string represetation of the supplied +** integer lock-type. +*/ +static const char *locktypeName(int locktype){ + switch( locktype ){ + case NO_LOCK: return "NONE"; + case SHARED_LOCK: return "SHARED"; + case RESERVED_LOCK: return "RESERVED"; + case PENDING_LOCK: return "PENDING"; + case EXCLUSIVE_LOCK: return "EXCLUSIVE"; + } + return "ERROR"; +} +#endif + +/* +** If we are currently in a different thread than the thread that the +** unixFile argument belongs to, then transfer ownership of the unixFile +** over to the current thread. +** +** A unixFile is only owned by a thread on systems where one thread is +** unable to override locks created by a different thread. RedHat9 is +** an example of such a system. +** +** Ownership transfer is only allowed if the unixFile is currently unlocked. +** If the unixFile is locked and an ownership is wrong, then return +** SQLITE_MISUSE. SQLITE_OK is returned if everything works. +*/ +#if SQLITE_THREADSAFE +static int transferOwnership(unixFile *pFile){ + int rc; + pthread_t hSelf; + if( threadsOverrideEachOthersLocks ){ + /* Ownership transfers not needed on this system */ + return SQLITE_OK; + } + hSelf = pthread_self(); + if( pthread_equal(pFile->tid, hSelf) ){ + /* We are still in the same thread */ + OSTRACE1("No-transfer, same thread\n"); + return SQLITE_OK; + } + if( pFile->locktype!=NO_LOCK ){ + /* We cannot change ownership while we are holding a lock! */ + return SQLITE_MISUSE; + } + OSTRACE4("Transfer ownership of %d from %d to %d\n", + pFile->h, pFile->tid, hSelf); + pFile->tid = hSelf; + if (pFile->pLock != NULL) { + releaseLockInfo(pFile->pLock); + rc = findLockInfo(pFile->h, &pFile->pLock, 0); + OSTRACE5("LOCK %d is now %s(%s,%d)\n", pFile->h, + locktypeName(pFile->locktype), + locktypeName(pFile->pLock->locktype), pFile->pLock->cnt); + return rc; + } else { + return SQLITE_OK; + } +} +#else + /* On single-threaded builds, ownership transfer is a no-op */ +# define transferOwnership(X) SQLITE_OK +#endif + +/* +** Seek to the offset passed as the second argument, then read cnt +** bytes into pBuf. Return the number of bytes actually read. +** +** NB: If you define USE_PREAD or USE_PREAD64, then it might also +** be necessary to define _XOPEN_SOURCE to be 500. This varies from +** one system to another. Since SQLite does not define USE_PREAD +** any any form by default, we will not attempt to define _XOPEN_SOURCE. +** See tickets #2741 and #2681. +*/ +static int seekAndRead(unixFile *id, sqlite3_int64 offset, void *pBuf, int cnt){ + int got; + i64 newOffset; + TIMER_START; +#if defined(USE_PREAD) + got = pread(id->h, pBuf, cnt, offset); + SimulateIOError( got = -1 ); +#elif defined(USE_PREAD64) + got = pread64(id->h, pBuf, cnt, offset); + SimulateIOError( got = -1 ); +#else + newOffset = lseek(id->h, offset, SEEK_SET); + SimulateIOError( newOffset-- ); + if( newOffset!=offset ){ + return -1; + } + got = read(id->h, pBuf, cnt); +#endif + TIMER_END; + OSTRACE5("READ %-3d %5d %7lld %llu\n", id->h, got, offset, TIMER_ELAPSED); + return got; +} + +/* +** Read data from a file into a buffer. Return SQLITE_OK if all +** bytes were read successfully and SQLITE_IOERR if anything goes +** wrong. +*/ +static int unixRead( + sqlite3_file *id, + void *pBuf, + int amt, + sqlite3_int64 offset +){ + int got; + assert( id ); + got = seekAndRead((unixFile*)id, offset, pBuf, amt); + if( got==amt ){ + return SQLITE_OK; + }else if( got<0 ){ + return SQLITE_IOERR_READ; + }else{ + memset(&((char*)pBuf)[got], 0, amt-got); + return SQLITE_IOERR_SHORT_READ; + } +} + +/* +** Seek to the offset in id->offset then read cnt bytes into pBuf. +** Return the number of bytes actually read. Update the offset. +*/ +static int seekAndWrite(unixFile *id, i64 offset, const void *pBuf, int cnt){ + int got; + i64 newOffset; + TIMER_START; +#if defined(USE_PREAD) + got = pwrite(id->h, pBuf, cnt, offset); +#elif defined(USE_PREAD64) + got = pwrite64(id->h, pBuf, cnt, offset); +#else + newOffset = lseek(id->h, offset, SEEK_SET); + if( newOffset!=offset ){ + return -1; + } + got = write(id->h, pBuf, cnt); +#endif + TIMER_END; + OSTRACE5("WRITE %-3d %5d %7lld %llu\n", id->h, got, offset, TIMER_ELAPSED); + return got; +} + + +/* +** Write data from a buffer into a file. Return SQLITE_OK on success +** or some other error code on failure. +*/ +static int unixWrite( + sqlite3_file *id, + const void *pBuf, + int amt, + sqlite3_int64 offset +){ + int wrote = 0; + assert( id ); + assert( amt>0 ); + while( amt>0 && (wrote = seekAndWrite((unixFile*)id, offset, pBuf, amt))>0 ){ + amt -= wrote; + offset += wrote; + pBuf = &((char*)pBuf)[wrote]; + } + SimulateIOError(( wrote=(-1), amt=1 )); + SimulateDiskfullError(( wrote=0, amt=1 )); + if( amt>0 ){ + if( wrote<0 ){ + return SQLITE_IOERR_WRITE; + }else{ + return SQLITE_FULL; + } + } + return SQLITE_OK; +} + +#ifdef SQLITE_TEST +/* +** Count the number of fullsyncs and normal syncs. This is used to test +** that syncs and fullsyncs are occuring at the right times. +*/ +int sqlite3_sync_count = 0; +int sqlite3_fullsync_count = 0; +#endif + +/* +** Use the fdatasync() API only if the HAVE_FDATASYNC macro is defined. +** Otherwise use fsync() in its place. +*/ +#ifndef HAVE_FDATASYNC +# define fdatasync fsync +#endif + +/* +** Define HAVE_FULLFSYNC to 0 or 1 depending on whether or not +** the F_FULLFSYNC macro is defined. F_FULLFSYNC is currently +** only available on Mac OS X. But that could change. +*/ +#ifdef F_FULLFSYNC +# define HAVE_FULLFSYNC 1 +#else +# define HAVE_FULLFSYNC 0 +#endif + + +/* +** The fsync() system call does not work as advertised on many +** unix systems. The following procedure is an attempt to make +** it work better. +** +** The SQLITE_NO_SYNC macro disables all fsync()s. This is useful +** for testing when we want to run through the test suite quickly. +** You are strongly advised *not* to deploy with SQLITE_NO_SYNC +** enabled, however, since with SQLITE_NO_SYNC enabled, an OS crash +** or power failure will likely corrupt the database file. +*/ +static int full_fsync(int fd, int fullSync, int dataOnly){ + int rc; + + /* Record the number of times that we do a normal fsync() and + ** FULLSYNC. This is used during testing to verify that this procedure + ** gets called with the correct arguments. + */ +#ifdef SQLITE_TEST + if( fullSync ) sqlite3_fullsync_count++; + sqlite3_sync_count++; +#endif + + /* If we compiled with the SQLITE_NO_SYNC flag, then syncing is a + ** no-op + */ +#ifdef SQLITE_NO_SYNC + rc = SQLITE_OK; +#else + +#if HAVE_FULLFSYNC + if( fullSync ){ + rc = fcntl(fd, F_FULLFSYNC, 0); + }else{ + rc = 1; + } + /* If the FULLFSYNC failed, fall back to attempting an fsync(). + * It shouldn't be possible for fullfsync to fail on the local + * file system (on OSX), so failure indicates that FULLFSYNC + * isn't supported for this file system. So, attempt an fsync + * and (for now) ignore the overhead of a superfluous fcntl call. + * It'd be better to detect fullfsync support once and avoid + * the fcntl call every time sync is called. + */ + if( rc ) rc = fsync(fd); + +#else + if( dataOnly ){ + rc = fdatasync(fd); + }else{ + rc = fsync(fd); + } +#endif /* HAVE_FULLFSYNC */ +#endif /* defined(SQLITE_NO_SYNC) */ + + return rc; +} + +/* +** Make sure all writes to a particular file are committed to disk. +** +** If dataOnly==0 then both the file itself and its metadata (file +** size, access time, etc) are synced. If dataOnly!=0 then only the +** file data is synced. +** +** Under Unix, also make sure that the directory entry for the file +** has been created by fsync-ing the directory that contains the file. +** If we do not do this and we encounter a power failure, the directory +** entry for the journal might not exist after we reboot. The next +** SQLite to access the file will not know that the journal exists (because +** the directory entry for the journal was never created) and the transaction +** will not roll back - possibly leading to database corruption. +*/ +static int unixSync(sqlite3_file *id, int flags){ + int rc; + unixFile *pFile = (unixFile*)id; + + int isDataOnly = (flags&SQLITE_SYNC_DATAONLY); + int isFullsync = (flags&0x0F)==SQLITE_SYNC_FULL; + + /* Check that one of SQLITE_SYNC_NORMAL or FULL was passed */ + assert((flags&0x0F)==SQLITE_SYNC_NORMAL + || (flags&0x0F)==SQLITE_SYNC_FULL + ); + + /* Unix cannot, but some systems may return SQLITE_FULL from here. This + ** line is to test that doing so does not cause any problems. + */ + SimulateDiskfullError( return SQLITE_FULL ); + + assert( pFile ); + OSTRACE2("SYNC %-3d\n", pFile->h); + rc = full_fsync(pFile->h, isFullsync, isDataOnly); + SimulateIOError( rc=1 ); + if( rc ){ + return SQLITE_IOERR_FSYNC; + } + if( pFile->dirfd>=0 ){ + OSTRACE4("DIRSYNC %-3d (have_fullfsync=%d fullsync=%d)\n", pFile->dirfd, + HAVE_FULLFSYNC, isFullsync); +#ifndef SQLITE_DISABLE_DIRSYNC + /* The directory sync is only attempted if full_fsync is + ** turned off or unavailable. If a full_fsync occurred above, + ** then the directory sync is superfluous. + */ + if( (!HAVE_FULLFSYNC || !isFullsync) && full_fsync(pFile->dirfd,0,0) ){ + /* + ** We have received multiple reports of fsync() returning + ** errors when applied to directories on certain file systems. + ** A failed directory sync is not a big deal. So it seems + ** better to ignore the error. Ticket #1657 + */ + /* return SQLITE_IOERR; */ + } +#endif + close(pFile->dirfd); /* Only need to sync once, so close the directory */ + pFile->dirfd = -1; /* when we are done. */ + } + return SQLITE_OK; +} + +/* +** Truncate an open file to a specified size +*/ +static int unixTruncate(sqlite3_file *id, i64 nByte){ + int rc; + assert( id ); + SimulateIOError( return SQLITE_IOERR_TRUNCATE ); + rc = ftruncate(((unixFile*)id)->h, (off_t)nByte); + if( rc ){ + return SQLITE_IOERR_TRUNCATE; + }else{ + return SQLITE_OK; + } +} + +/* +** Determine the current size of a file in bytes +*/ +static int unixFileSize(sqlite3_file *id, i64 *pSize){ + int rc; + struct stat buf; + assert( id ); + rc = fstat(((unixFile*)id)->h, &buf); + SimulateIOError( rc=1 ); + if( rc!=0 ){ + return SQLITE_IOERR_FSTAT; + } + *pSize = buf.st_size; + + /* When opening a zero-size database, the findLockInfo() procedure + ** writes a single byte into that file in order to work around a bug + ** in the OS-X msdos filesystem. In order to avoid problems with upper + ** layers, we need to report this file size as zero even though it is + ** really 1. Ticket #3260. + */ + if( *pSize==1 ) *pSize = 0; + + + return SQLITE_OK; +} /* ** This routine translates a standard POSIX errno code into something ** useful to the clients of the sqlite3 functions. Specifically, it is ** intended to translate a variety of "try again" errors into SQLITE_BUSY @@ -414,667 +1211,10 @@ default: return sqliteIOErr; } } - - -/****************************************************************************** -****************** Begin Unique File ID Utility Used By VxWorks *************** -** -** On most versions of unix, we can get a unique ID for a file by concatenating -** the device number and the inode number. But this does not work on VxWorks. -** On VxWorks, a unique file id must be based on the canonical filename. -** -** A pointer to an instance of the following structure can be used as a -** unique file ID in VxWorks. Each instance of this structure contains -** a copy of the canonical filename. There is also a reference count. -** The structure is reclaimed when the number of pointers to it drops to -** zero. -** -** There are never very many files open at one time and lookups are not -** a performance-critical path, so it is sufficient to put these -** structures on a linked list. -*/ -struct vxworksFileId { - struct vxworksFileId *pNext; /* Next in a list of them all */ - int nRef; /* Number of references to this one */ - int nName; /* Length of the zCanonicalName[] string */ - char *zCanonicalName; /* Canonical filename */ -}; - -#if OS_VXWORKS -/* -** All unique filenames are held on a linked list headed by this -** variable: -*/ -static struct vxworksFileId *vxworksFileList = 0; - -/* -** Simplify a filename into its canonical form -** by making the following changes: -** -** * removing any trailing and duplicate / -** * convert /./ into just / -** * convert /A/../ where A is any simple name into just / -** -** Changes are made in-place. Return the new name length. -** -** The original filename is in z[0..n-1]. Return the number of -** characters in the simplified name. -*/ -static int vxworksSimplifyName(char *z, int n){ - int i, j; - while( n>1 && z[n-1]=='/' ){ n--; } - for(i=j=0; i0 && z[j-1]!='/' ){ j--; } - if( j>0 ){ j--; } - i += 2; - continue; - } - } - z[j++] = z[i]; - } - z[j] = 0; - return j; -} - -/* -** Find a unique file ID for the given absolute pathname. Return -** a pointer to the vxworksFileId object. This pointer is the unique -** file ID. -** -** The nRef field of the vxworksFileId object is incremented before -** the object is returned. A new vxworksFileId object is created -** and added to the global list if necessary. -** -** If a memory allocation error occurs, return NULL. -*/ -static struct vxworksFileId *vxworksFindFileId(const char *zAbsoluteName){ - struct vxworksFileId *pNew; /* search key and new file ID */ - struct vxworksFileId *pCandidate; /* For looping over existing file IDs */ - int n; /* Length of zAbsoluteName string */ - - assert( zAbsoluteName[0]=='/' ); - n = (int)strlen(zAbsoluteName); - pNew = sqlite3_malloc( sizeof(*pNew) + (n+1) ); - if( pNew==0 ) return 0; - pNew->zCanonicalName = (char*)&pNew[1]; - memcpy(pNew->zCanonicalName, zAbsoluteName, n+1); - n = vxworksSimplifyName(pNew->zCanonicalName, n); - - /* Search for an existing entry that matching the canonical name. - ** If found, increment the reference count and return a pointer to - ** the existing file ID. - */ - unixEnterMutex(); - for(pCandidate=vxworksFileList; pCandidate; pCandidate=pCandidate->pNext){ - if( pCandidate->nName==n - && memcmp(pCandidate->zCanonicalName, pNew->zCanonicalName, n)==0 - ){ - sqlite3_free(pNew); - pCandidate->nRef++; - unixLeaveMutex(); - return pCandidate; - } - } - - /* No match was found. We will make a new file ID */ - pNew->nRef = 1; - pNew->nName = n; - pNew->pNext = vxworksFileList; - vxworksFileList = pNew; - unixLeaveMutex(); - return pNew; -} - -/* -** Decrement the reference count on a vxworksFileId object. Free -** the object when the reference count reaches zero. -*/ -static void vxworksReleaseFileId(struct vxworksFileId *pId){ - unixEnterMutex(); - assert( pId->nRef>0 ); - pId->nRef--; - if( pId->nRef==0 ){ - struct vxworksFileId **pp; - for(pp=&vxworksFileList; *pp && *pp!=pId; pp = &((*pp)->pNext)){} - assert( *pp==pId ); - *pp = pId->pNext; - sqlite3_free(pId); - } - unixLeaveMutex(); -} -#endif /* OS_VXWORKS */ -/*************** End of Unique File ID Utility Used By VxWorks **************** -******************************************************************************/ - - -/****************************************************************************** -*************************** Posix Advisory Locking **************************** -** -** POSIX advisory locks are broken by design. ANSI STD 1003.1 (1996) -** section 6.5.2.2 lines 483 through 490 specify that when a process -** sets or clears a lock, that operation overrides any prior locks set -** by the same process. It does not explicitly say so, but this implies -** that it overrides locks set by the same process using a different -** file descriptor. Consider this test case: -** -** int fd1 = open("./file1", O_RDWR|O_CREAT, 0644); -** int fd2 = open("./file2", O_RDWR|O_CREAT, 0644); -** -** Suppose ./file1 and ./file2 are really the same file (because -** one is a hard or symbolic link to the other) then if you set -** an exclusive lock on fd1, then try to get an exclusive lock -** on fd2, it works. I would have expected the second lock to -** fail since there was already a lock on the file due to fd1. -** But not so. Since both locks came from the same process, the -** second overrides the first, even though they were on different -** file descriptors opened on different file names. -** -** This means that we cannot use POSIX locks to synchronize file access -** among competing threads of the same process. POSIX locks will work fine -** to synchronize access for threads in separate processes, but not -** threads within the same process. -** -** To work around the problem, SQLite has to manage file locks internally -** on its own. Whenever a new database is opened, we have to find the -** specific inode of the database file (the inode is determined by the -** st_dev and st_ino fields of the stat structure that fstat() fills in) -** and check for locks already existing on that inode. When locks are -** created or removed, we have to look at our own internal record of the -** locks to see if another thread has previously set a lock on that same -** inode. -** -** (Aside: The use of inode numbers as unique IDs does not work on VxWorks. -** For VxWorks, we have to use the alternative unique ID system based on -** canonical filename and implemented in the previous division.) -** -** The sqlite3_file structure for POSIX is no longer just an integer file -** descriptor. It is now a structure that holds the integer file -** descriptor and a pointer to a structure that describes the internal -** locks on the corresponding inode. There is one locking structure -** per inode, so if the same inode is opened twice, both unixFile structures -** point to the same locking structure. The locking structure keeps -** a reference count (so we will know when to delete it) and a "cnt" -** field that tells us its internal lock status. cnt==0 means the -** file is unlocked. cnt==-1 means the file has an exclusive lock. -** cnt>0 means there are cnt shared locks on the file. -** -** Any attempt to lock or unlock a file first checks the locking -** structure. The fcntl() system call is only invoked to set a -** POSIX lock if the internal lock structure transitions between -** a locked and an unlocked state. -** -** But wait: there are yet more problems with POSIX advisory locks. -** -** If you close a file descriptor that points to a file that has locks, -** all locks on that file that are owned by the current process are -** released. To work around this problem, each unixFile structure contains -** a pointer to an unixOpenCnt structure. There is one unixOpenCnt structure -** per open inode, which means that multiple unixFile can point to a single -** unixOpenCnt. When an attempt is made to close an unixFile, if there are -** other unixFile open on the same inode that are holding locks, the call -** to close() the file descriptor is deferred until all of the locks clear. -** The unixOpenCnt structure keeps a list of file descriptors that need to -** be closed and that list is walked (and cleared) when the last lock -** clears. -** -** Yet another problem: LinuxThreads do not play well with posix locks. -** -** Many older versions of linux use the LinuxThreads library which is -** not posix compliant. Under LinuxThreads, a lock created by thread -** A cannot be modified or overridden by a different thread B. -** Only thread A can modify the lock. Locking behavior is correct -** if the appliation uses the newer Native Posix Thread Library (NPTL) -** on linux - with NPTL a lock created by thread A can override locks -** in thread B. But there is no way to know at compile-time which -** threading library is being used. So there is no way to know at -** compile-time whether or not thread A can override locks on thread B. -** We have to do a run-time check to discover the behavior of the -** current process. -** -** On systems where thread A is unable to modify locks created by -** thread B, we have to keep track of which thread created each -** lock. Hence there is an extra field in the key to the unixLockInfo -** structure to record this information. And on those systems it -** is illegal to begin a transaction in one thread and finish it -** in another. For this latter restriction, there is no work-around. -** It is a limitation of LinuxThreads. -*/ - -/* -** Set or check the unixFile.tid field. This field is set when an unixFile -** is first opened. All subsequent uses of the unixFile verify that the -** same thread is operating on the unixFile. Some operating systems do -** not allow locks to be overridden by other threads and that restriction -** means that sqlite3* database handles cannot be moved from one thread -** to another while locks are held. -** -** Version 3.3.1 (2006-01-15): unixFile can be moved from one thread to -** another as long as we are running on a system that supports threads -** overriding each others locks (which is now the most common behavior) -** or if no locks are held. But the unixFile.pLock field needs to be -** recomputed because its key includes the thread-id. See the -** transferOwnership() function below for additional information -*/ -#if SQLITE_THREADSAFE && defined(__linux__) -# define SET_THREADID(X) (X)->tid = pthread_self() -# define CHECK_THREADID(X) (threadsOverrideEachOthersLocks==0 && \ - !pthread_equal((X)->tid, pthread_self())) -#else -# define SET_THREADID(X) -# define CHECK_THREADID(X) 0 -#endif - -/* -** An instance of the following structure serves as the key used -** to locate a particular unixOpenCnt structure given its inode. This -** is the same as the unixLockKey except that the thread ID is omitted. -*/ -struct unixFileId { - dev_t dev; /* Device number */ -#if OS_VXWORKS - struct vxworksFileId *pId; /* Unique file ID for vxworks. */ -#else - ino_t ino; /* Inode number */ -#endif -}; - -/* -** An instance of the following structure serves as the key used -** to locate a particular unixLockInfo structure given its inode. -** -** If threads cannot override each others locks (LinuxThreads), then we -** set the unixLockKey.tid field to the thread ID. If threads can override -** each others locks (Posix and NPTL) then tid is always set to zero. -** tid is omitted if we compile without threading support or on an OS -** other than linux. -*/ -struct unixLockKey { - struct unixFileId fid; /* Unique identifier for the file */ -#if SQLITE_THREADSAFE && defined(__linux__) - pthread_t tid; /* Thread ID of lock owner. Zero if not using LinuxThreads */ -#endif -}; - -/* -** An instance of the following structure is allocated for each open -** inode. Or, on LinuxThreads, there is one of these structures for -** each inode opened by each thread. -** -** A single inode can have multiple file descriptors, so each unixFile -** structure contains a pointer to an instance of this object and this -** object keeps a count of the number of unixFile pointing to it. -*/ -struct unixLockInfo { - struct unixLockKey lockKey; /* The lookup key */ - int cnt; /* Number of SHARED locks held */ - int locktype; /* One of SHARED_LOCK, RESERVED_LOCK etc. */ - int nRef; /* Number of pointers to this structure */ - struct unixLockInfo *pNext; /* List of all unixLockInfo objects */ - struct unixLockInfo *pPrev; /* .... doubly linked */ -}; - -/* -** An instance of the following structure is allocated for each open -** inode. This structure keeps track of the number of locks on that -** inode. If a close is attempted against an inode that is holding -** locks, the close is deferred until all locks clear by adding the -** file descriptor to be closed to the pending list. -** -** TODO: Consider changing this so that there is only a single file -** descriptor for each open file, even when it is opened multiple times. -** The close() system call would only occur when the last database -** using the file closes. -*/ -struct unixOpenCnt { - struct unixFileId fileId; /* The lookup key */ - int nRef; /* Number of pointers to this structure */ - int nLock; /* Number of outstanding locks */ - int nPending; /* Number of pending close() operations */ - int *aPending; /* Malloced space holding fd's awaiting a close() */ -#if OS_VXWORKS - sem_t *pSem; /* Named POSIX semaphore */ - char aSemName[MAX_PATHNAME+1]; /* Name of that semaphore */ -#endif - struct unixOpenCnt *pNext, *pPrev; /* List of all unixOpenCnt objects */ -}; - -/* -** Lists of all unixLockInfo and unixOpenCnt objects. These used to be hash -** tables. But the number of objects is rarely more than a dozen and -** never exceeds a few thousand. And lookup is not on a critical -** path so a simple linked list will suffice. -*/ -static struct unixLockInfo *lockList = 0; -static struct unixOpenCnt *openList = 0; - -/* -** This variable remembers whether or not threads can override each others -** locks. -** -** 0: No. Threads cannot override each others locks. (LinuxThreads) -** 1: Yes. Threads can override each others locks. (Posix & NLPT) -** -1: We don't know yet. -** -** On some systems, we know at compile-time if threads can override each -** others locks. On those systems, the SQLITE_THREAD_OVERRIDE_LOCK macro -** will be set appropriately. On other systems, we have to check at -** runtime. On these latter systems, SQLTIE_THREAD_OVERRIDE_LOCK is -** undefined. -** -** This variable normally has file scope only. But during testing, we make -** it a global so that the test code can change its value in order to verify -** that the right stuff happens in either case. -*/ -#if SQLITE_THREADSAFE && defined(__linux__) -# ifndef SQLITE_THREAD_OVERRIDE_LOCK -# define SQLITE_THREAD_OVERRIDE_LOCK -1 -# endif -# ifdef SQLITE_TEST -int threadsOverrideEachOthersLocks = SQLITE_THREAD_OVERRIDE_LOCK; -# else -static int threadsOverrideEachOthersLocks = SQLITE_THREAD_OVERRIDE_LOCK; -# endif -#endif - -/* -** This structure holds information passed into individual test -** threads by the testThreadLockingBehavior() routine. -*/ -struct threadTestData { - int fd; /* File to be locked */ - struct flock lock; /* The locking operation */ - int result; /* Result of the locking operation */ -}; - -#if SQLITE_THREADSAFE && defined(__linux__) -/* -** This function is used as the main routine for a thread launched by -** testThreadLockingBehavior(). It tests whether the shared-lock obtained -** by the main thread in testThreadLockingBehavior() conflicts with a -** hypothetical write-lock obtained by this thread on the same file. -** -** The write-lock is not actually acquired, as this is not possible if -** the file is open in read-only mode (see ticket #3472). -*/ -static void *threadLockingTest(void *pArg){ - struct threadTestData *pData = (struct threadTestData*)pArg; - pData->result = fcntl(pData->fd, F_GETLK, &pData->lock); - return pArg; -} -#endif /* SQLITE_THREADSAFE && defined(__linux__) */ - - -#if SQLITE_THREADSAFE && defined(__linux__) -/* -** This procedure attempts to determine whether or not threads -** can override each others locks then sets the -** threadsOverrideEachOthersLocks variable appropriately. -*/ -static void testThreadLockingBehavior(int fd_orig){ - int fd; - int rc; - struct threadTestData d; - struct flock l; - pthread_t t; - - fd = dup(fd_orig); - if( fd<0 ) return; - memset(&l, 0, sizeof(l)); - l.l_type = F_RDLCK; - l.l_len = 1; - l.l_start = 0; - l.l_whence = SEEK_SET; - rc = fcntl(fd_orig, F_SETLK, &l); - if( rc!=0 ) return; - memset(&d, 0, sizeof(d)); - d.fd = fd; - d.lock = l; - d.lock.l_type = F_WRLCK; - pthread_create(&t, 0, threadLockingTest, &d); - pthread_join(t, 0); - close(fd); - if( d.result!=0 ) return; - threadsOverrideEachOthersLocks = (d.lock.l_type==F_UNLCK); -} -#endif /* SQLITE_THERADSAFE && defined(__linux__) */ - -/* -** Release a unixLockInfo structure previously allocated by findLockInfo(). -*/ -static void releaseLockInfo(struct unixLockInfo *pLock){ - if( pLock ){ - pLock->nRef--; - if( pLock->nRef==0 ){ - if( pLock->pPrev ){ - assert( pLock->pPrev->pNext==pLock ); - pLock->pPrev->pNext = pLock->pNext; - }else{ - assert( lockList==pLock ); - lockList = pLock->pNext; - } - if( pLock->pNext ){ - assert( pLock->pNext->pPrev==pLock ); - pLock->pNext->pPrev = pLock->pPrev; - } - sqlite3_free(pLock); - } - } -} - -/* -** Release a unixOpenCnt structure previously allocated by findLockInfo(). -*/ -static void releaseOpenCnt(struct unixOpenCnt *pOpen){ - if( pOpen ){ - pOpen->nRef--; - if( pOpen->nRef==0 ){ - if( pOpen->pPrev ){ - assert( pOpen->pPrev->pNext==pOpen ); - pOpen->pPrev->pNext = pOpen->pNext; - }else{ - assert( openList==pOpen ); - openList = pOpen->pNext; - } - if( pOpen->pNext ){ - assert( pOpen->pNext->pPrev==pOpen ); - pOpen->pNext->pPrev = pOpen->pPrev; - } - sqlite3_free(pOpen->aPending); - sqlite3_free(pOpen); - } - } -} - -/* -** Given a file descriptor, locate unixLockInfo and unixOpenCnt structures that -** describes that file descriptor. Create new ones if necessary. The -** return values might be uninitialized if an error occurs. -** -** Return an appropriate error code. -*/ -static int findLockInfo( - unixFile *pFile, /* Unix file with file desc used in the key */ - struct unixLockInfo **ppLock, /* Return the unixLockInfo structure here */ - struct unixOpenCnt **ppOpen /* Return the unixOpenCnt structure here */ -){ - int rc; /* System call return code */ - int fd; /* The file descriptor for pFile */ - struct unixLockKey lockKey; /* Lookup key for the unixLockInfo structure */ - struct unixFileId fileId; /* Lookup key for the unixOpenCnt struct */ - struct stat statbuf; /* Low-level file information */ - struct unixLockInfo *pLock; /* Candidate unixLockInfo object */ - struct unixOpenCnt *pOpen; /* Candidate unixOpenCnt object */ - - /* Get low-level information about the file that we can used to - ** create a unique name for the file. - */ - fd = pFile->h; - rc = fstat(fd, &statbuf); - if( rc!=0 ){ - pFile->lastErrno = errno; -#ifdef EOVERFLOW - if( pFile->lastErrno==EOVERFLOW ) return SQLITE_NOLFS; -#endif - return SQLITE_IOERR; - } - -#ifdef __APPLE__ - /* On OS X on an msdos filesystem, the inode number is reported - ** incorrectly for zero-size files. See ticket #3260. To work - ** around this problem (we consider it a bug in OS X, not SQLite) - ** we always increase the file size to 1 by writing a single byte - ** prior to accessing the inode number. The one byte written is - ** an ASCII 'S' character which also happens to be the first byte - ** in the header of every SQLite database. In this way, if there - ** is a race condition such that another thread has already populated - ** the first page of the database, no damage is done. - */ - if( statbuf.st_size==0 ){ - rc = write(fd, "S", 1); - if( rc!=1 ){ - return SQLITE_IOERR; - } - rc = fstat(fd, &statbuf); - if( rc!=0 ){ - pFile->lastErrno = errno; - return SQLITE_IOERR; - } - } -#endif - - memset(&lockKey, 0, sizeof(lockKey)); - lockKey.fid.dev = statbuf.st_dev; -#if OS_VXWORKS - lockKey.fid.pId = pFile->pId; -#else - lockKey.fid.ino = statbuf.st_ino; -#endif -#if SQLITE_THREADSAFE && defined(__linux__) - if( threadsOverrideEachOthersLocks<0 ){ - testThreadLockingBehavior(fd); - } - lockKey.tid = threadsOverrideEachOthersLocks ? 0 : pthread_self(); -#endif - fileId = lockKey.fid; - if( ppLock!=0 ){ - pLock = lockList; - while( pLock && memcmp(&lockKey, &pLock->lockKey, sizeof(lockKey)) ){ - pLock = pLock->pNext; - } - if( pLock==0 ){ - pLock = sqlite3_malloc( sizeof(*pLock) ); - if( pLock==0 ){ - rc = SQLITE_NOMEM; - goto exit_findlockinfo; - } - pLock->lockKey = lockKey; - pLock->nRef = 1; - pLock->cnt = 0; - pLock->locktype = 0; - pLock->pNext = lockList; - pLock->pPrev = 0; - if( lockList ) lockList->pPrev = pLock; - lockList = pLock; - }else{ - pLock->nRef++; - } - *ppLock = pLock; - } - if( ppOpen!=0 ){ - pOpen = openList; - while( pOpen && memcmp(&fileId, &pOpen->fileId, sizeof(fileId)) ){ - pOpen = pOpen->pNext; - } - if( pOpen==0 ){ - pOpen = sqlite3_malloc( sizeof(*pOpen) ); - if( pOpen==0 ){ - releaseLockInfo(pLock); - rc = SQLITE_NOMEM; - goto exit_findlockinfo; - } - pOpen->fileId = fileId; - pOpen->nRef = 1; - pOpen->nLock = 0; - pOpen->nPending = 0; - pOpen->aPending = 0; - pOpen->pNext = openList; - pOpen->pPrev = 0; - if( openList ) openList->pPrev = pOpen; - openList = pOpen; -#if OS_VXWORKS - pOpen->pSem = NULL; - pOpen->aSemName[0] = '\0'; -#endif - }else{ - pOpen->nRef++; - } - *ppOpen = pOpen; - } - -exit_findlockinfo: - return rc; -} - -/* -** If we are currently in a different thread than the thread that the -** unixFile argument belongs to, then transfer ownership of the unixFile -** over to the current thread. -** -** A unixFile is only owned by a thread on systems that use LinuxThreads. -** -** Ownership transfer is only allowed if the unixFile is currently unlocked. -** If the unixFile is locked and an ownership is wrong, then return -** SQLITE_MISUSE. SQLITE_OK is returned if everything works. -*/ -#if SQLITE_THREADSAFE && defined(__linux__) -static int transferOwnership(unixFile *pFile){ - int rc; - pthread_t hSelf; - if( threadsOverrideEachOthersLocks ){ - /* Ownership transfers not needed on this system */ - return SQLITE_OK; - } - hSelf = pthread_self(); - if( pthread_equal(pFile->tid, hSelf) ){ - /* We are still in the same thread */ - OSTRACE1("No-transfer, same thread\n"); - return SQLITE_OK; - } - if( pFile->locktype!=NO_LOCK ){ - /* We cannot change ownership while we are holding a lock! */ - return SQLITE_MISUSE; - } - OSTRACE4("Transfer ownership of %d from %d to %d\n", - pFile->h, pFile->tid, hSelf); - pFile->tid = hSelf; - if (pFile->pLock != NULL) { - releaseLockInfo(pFile->pLock); - rc = findLockInfo(pFile, &pFile->pLock, 0); - OSTRACE5("LOCK %d is now %s(%s,%d)\n", pFile->h, - locktypeName(pFile->locktype), - locktypeName(pFile->pLock->locktype), pFile->pLock->cnt); - return rc; - } else { - return SQLITE_OK; - } -} -#else /* if not SQLITE_THREADSAFE */ - /* On single-threaded builds, ownership transfer is a no-op */ -# define transferOwnership(X) SQLITE_OK -#endif /* SQLITE_THREADSAFE */ - - /* ** This routine checks if there is a RESERVED lock held on the specified ** file by this or any other process. If such a lock is held, set *pResOut ** to a non-zero value otherwise *pResOut is set to zero. The return value ** is set to SQLITE_OK unless an I/O error occurs during lock checking. @@ -1085,20 +1225,19 @@ unixFile *pFile = (unixFile*)id; SimulateIOError( return SQLITE_IOERR_CHECKRESERVEDLOCK; ); assert( pFile ); - unixEnterMutex(); /* Because pFile->pLock is shared across threads */ + enterMutex(); /* Because pFile->pLock is shared across threads */ /* Check if a thread in this process holds such a lock */ if( pFile->pLock->locktype>SHARED_LOCK ){ reserved = 1; } /* Otherwise see if some other process holds it. */ -#ifndef __DJGPP__ if( !reserved ){ struct flock lock; lock.l_whence = SEEK_SET; lock.l_start = RESERVED_BYTE; lock.l_len = 1; @@ -1109,13 +1248,12 @@ pFile->lastErrno = tErrno; } else if( lock.l_type!=F_UNLCK ){ reserved = 1; } } -#endif - unixLeaveMutex(); + leaveMutex(); OSTRACE4("TEST WR-LOCK %d %d %d\n", pFile->h, rc, reserved); *pResOut = reserved; return rc; } @@ -1183,11 +1321,11 @@ ** locking a random byte from a range, concurrent SHARED locks may exist ** even if the locking primitive used is always a write-lock. */ int rc = SQLITE_OK; unixFile *pFile = (unixFile*)id; - struct unixLockInfo *pLock = pFile->pLock; + struct lockInfo *pLock = pFile->pLock; struct flock lock; int s; assert( pFile ); OSTRACE7("LOCK %d %s was %s(%s,%d) pid=%d\n", pFile->h, @@ -1194,11 +1332,11 @@ locktypeName(locktype), locktypeName(pFile->locktype), locktypeName(pLock->locktype), pLock->cnt , getpid()); /* If there is already a lock of this type or more restrictive on the ** unixFile, do nothing. Don't use the end_lock: exit path, as - ** unixEnterMutex() hasn't been called yet. + ** enterMutex() hasn't been called yet. */ if( pFile->locktype>=locktype ){ OSTRACE3("LOCK %d %s ok (already held)\n", pFile->h, locktypeName(locktype)); return SQLITE_OK; @@ -1210,17 +1348,17 @@ assert( locktype!=PENDING_LOCK ); assert( locktype!=RESERVED_LOCK || pFile->locktype==SHARED_LOCK ); /* This mutex is needed because pFile->pLock is shared across threads */ - unixEnterMutex(); + enterMutex(); /* Make sure the current thread owns the pFile. */ rc = transferOwnership(pFile); if( rc!=SQLITE_OK ){ - unixLeaveMutex(); + leaveMutex(); return rc; } pLock = pFile->pLock; /* If some thread using this PID has a lock via a different unixFile* @@ -1342,38 +1480,20 @@ pFile->lastErrno = tErrno; } } } - -#ifndef NDEBUG - /* Set up the transaction-counter change checking flags when - ** transitioning from a SHARED to a RESERVED lock. The change - ** from SHARED to RESERVED marks the beginning of a normal - ** write operation (not a hot journal rollback). - */ - if( rc==SQLITE_OK - && pFile->locktype<=SHARED_LOCK - && locktype==RESERVED_LOCK - ){ - pFile->transCntrChng = 0; - pFile->dbUpdate = 0; - pFile->inNormalWrite = 1; - } -#endif - - if( rc==SQLITE_OK ){ pFile->locktype = locktype; pLock->locktype = locktype; }else if( locktype==EXCLUSIVE_LOCK ){ pFile->locktype = PENDING_LOCK; pLock->locktype = PENDING_LOCK; } end_lock: - unixLeaveMutex(); + leaveMutex(); OSTRACE4("LOCK %d %s %s\n", pFile->h, locktypeName(locktype), rc==SQLITE_OK ? "ok" : "failed"); return rc; } @@ -1383,11 +1503,11 @@ ** ** If the locking level of the file descriptor is already at or below ** the requested locking level, this routine is a no-op. */ static int unixUnlock(sqlite3_file *id, int locktype){ - struct unixLockInfo *pLock; + struct lockInfo *pLock; struct flock lock; int rc = SQLITE_OK; unixFile *pFile = (unixFile*)id; int h; @@ -1400,36 +1520,19 @@ return SQLITE_OK; } if( CHECK_THREADID(pFile) ){ return SQLITE_MISUSE; } - unixEnterMutex(); + enterMutex(); h = pFile->h; pLock = pFile->pLock; assert( pLock->cnt!=0 ); if( pFile->locktype>SHARED_LOCK ){ assert( pLock->locktype==pFile->locktype ); SimulateIOErrorBenign(1); SimulateIOError( h=(-1) ) SimulateIOErrorBenign(0); - -#ifndef NDEBUG - /* When reducing a lock such that other processes can start - ** reading the database file again, make sure that the - ** transaction counter was updated if any part of the database - ** file changed. If the transaction counter is not updated, - ** other connections to the same file might not realize that - ** the file has changed and hence might not know to flush their - ** cache. The use of a stale cache can lead to database corruption. - */ - assert( pFile->inNormalWrite==0 - || pFile->dbUpdate==0 - || pFile->transCntrChng==1 ); - pFile->inNormalWrite = 0; -#endif - - if( locktype==SHARED_LOCK ){ lock.l_type = F_RDLCK; lock.l_whence = SEEK_SET; lock.l_start = SHARED_FIRST; lock.l_len = SHARED_SIZE; @@ -1437,11 +1540,11 @@ int tErrno = errno; rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_RDLOCK); if( IS_LOCK_ERROR(rc) ){ pFile->lastErrno = tErrno; } - goto end_unlock; + goto end_unlock; } } lock.l_type = F_UNLCK; lock.l_whence = SEEK_SET; lock.l_start = PENDING_BYTE; @@ -1456,11 +1559,11 @@ } goto end_unlock; } } if( locktype==NO_LOCK ){ - struct unixOpenCnt *pOpen; + struct openCnt *pOpen; /* Decrement the shared lock counter. Release the lock using an ** OS call only when all threads in this same process have released ** the lock. */ @@ -1494,74 +1597,40 @@ pOpen->nLock--; assert( pOpen->nLock>=0 ); if( pOpen->nLock==0 && pOpen->nPending>0 ){ int i; for(i=0; inPending; i++){ - /* close pending fds, but if closing fails don't free the array - ** assign -1 to the successfully closed descriptors and record the - ** error. The next attempt to unlock will try again. */ - if( pOpen->aPending[i] < 0 ) continue; - if( close(pOpen->aPending[i]) ){ - pFile->lastErrno = errno; - rc = SQLITE_IOERR_CLOSE; - }else{ - pOpen->aPending[i] = -1; - } - } - if( rc==SQLITE_OK ){ - sqlite3_free(pOpen->aPending); - pOpen->nPending = 0; - pOpen->aPending = 0; - } + close(pOpen->aPending[i]); + } + sqlite3_free(pOpen->aPending); + pOpen->nPending = 0; + pOpen->aPending = 0; } } } end_unlock: - unixLeaveMutex(); + leaveMutex(); if( rc==SQLITE_OK ) pFile->locktype = locktype; return rc; } /* ** This function performs the parts of the "close file" operation ** common to all locking schemes. It closes the directory and file ** handles, if they are valid, and sets all fields of the unixFile ** structure to 0. -** -** It is *not* necessary to hold the mutex when this routine is called, -** even on VxWorks. A mutex will be acquired on VxWorks by the -** vxworksReleaseFileId() routine. */ static int closeUnixFile(sqlite3_file *id){ unixFile *pFile = (unixFile*)id; if( pFile ){ if( pFile->dirfd>=0 ){ - int err = close(pFile->dirfd); - if( err ){ - pFile->lastErrno = errno; - return SQLITE_IOERR_DIR_CLOSE; - }else{ - pFile->dirfd=-1; - } + close(pFile->dirfd); } if( pFile->h>=0 ){ - int err = close(pFile->h); - if( err ){ - pFile->lastErrno = errno; - return SQLITE_IOERR_CLOSE; - } - } -#if OS_VXWORKS - if( pFile->pId ){ - if( pFile->isDelete ){ - unlink(pFile->pId->zCanonicalName); - } - vxworksReleaseFileId(pFile->pId); - pFile->pId = 0; - } -#endif + close(pFile->h); + } OSTRACE2("CLOSE %-3d\n", pFile->h); OpenCounter(-1); memset(pFile, 0, sizeof(unixFile)); } return SQLITE_OK; @@ -1569,23 +1638,22 @@ /* ** Close a file. */ static int unixClose(sqlite3_file *id){ - int rc = SQLITE_OK; if( id ){ unixFile *pFile = (unixFile *)id; unixUnlock(id, NO_LOCK); - unixEnterMutex(); + enterMutex(); if( pFile->pOpen && pFile->pOpen->nLock ){ /* If there are outstanding locks, do not actually close the file just ** yet because that would clear those locks. Instead, add the file ** descriptor to pOpen->aPending. It will be automatically closed when ** the last lock is cleared. */ int *aNew; - struct unixOpenCnt *pOpen = pFile->pOpen; + struct openCnt *pOpen = pFile->pOpen; aNew = sqlite3_realloc(pOpen->aPending, (pOpen->nPending+1)*sizeof(int) ); if( aNew==0 ){ /* If a malloc fails, just leak the file descriptor */ }else{ pOpen->aPending = aNew; @@ -1594,279 +1662,343 @@ pFile->h = -1; } } releaseLockInfo(pFile->pLock); releaseOpenCnt(pFile->pOpen); - rc = closeUnixFile(id); - unixLeaveMutex(); - } - return rc; -} - -/************** End of the posix advisory lock implementation ***************** -******************************************************************************/ - -/****************************************************************************** -****************************** No-op Locking ********************************** -** -** Of the various locking implementations available, this is by far the -** simplest: locking is ignored. No attempt is made to lock the database -** file for reading or writing. -** -** This locking mode is appropriate for use on read-only databases -** (ex: databases that are burned into CD-ROM, for example.) It can -** also be used if the application employs some external mechanism to -** prevent simultaneous access of the same database by two or more -** database connections. But there is a serious risk of database -** corruption if this locking mode is used in situations where multiple -** database connections are accessing the same database file at the same -** time and one or more of those connections are writing. -*/ - -static int nolockCheckReservedLock(sqlite3_file *NotUsed, int *pResOut){ - UNUSED_PARAMETER(NotUsed); - *pResOut = 0; - return SQLITE_OK; -} -static int nolockLock(sqlite3_file *NotUsed, int NotUsed2){ - UNUSED_PARAMETER2(NotUsed, NotUsed2); - return SQLITE_OK; -} -static int nolockUnlock(sqlite3_file *NotUsed, int NotUsed2){ - UNUSED_PARAMETER2(NotUsed, NotUsed2); - return SQLITE_OK; -} - -/* -** Close the file. -*/ -static int nolockClose(sqlite3_file *id) { - return closeUnixFile(id); -} - -/******************* End of the no-op lock implementation ********************* -******************************************************************************/ - -/****************************************************************************** -************************* Begin dot-file Locking ****************************** -** -** The dotfile locking implementation uses the existing of separate lock -** files in order to control access to the database. This works on just -** about every filesystem imaginable. But there are serious downsides: -** -** (1) There is zero concurrency. A single reader blocks all other -** connections from reading or writing the database. -** -** (2) An application crash or power loss can leave stale lock files -** sitting around that need to be cleared manually. -** -** Nevertheless, a dotlock is an appropriate locking mode for use if no -** other locking strategy is available. -** -** Dotfile locking works by creating a file in the same directory as the -** database and with the same name but with a ".lock" extension added. -** The existance of a lock file implies an EXCLUSIVE lock. All other lock -** types (SHARED, RESERVED, PENDING) are mapped into EXCLUSIVE. -*/ - -/* -** The file suffix added to the data base filename in order to create the -** lock file. -*/ -#define DOTLOCK_SUFFIX ".lock" - -/* -** This routine checks if there is a RESERVED lock held on the specified -** file by this or any other process. If such a lock is held, set *pResOut -** to a non-zero value otherwise *pResOut is set to zero. The return value -** is set to SQLITE_OK unless an I/O error occurs during lock checking. -** -** In dotfile locking, either a lock exists or it does not. So in this -** variation of CheckReservedLock(), *pResOut is set to true if any lock -** is held on the file and false if the file is unlocked. -*/ -static int dotlockCheckReservedLock(sqlite3_file *id, int *pResOut) { + closeUnixFile(id); + leaveMutex(); + } + return SQLITE_OK; +} + + +#if SQLITE_ENABLE_LOCKING_STYLE +#pragma mark AFP Support + +/* + ** The afpLockingContext structure contains all afp lock specific state + */ +typedef struct afpLockingContext afpLockingContext; +struct afpLockingContext { + unsigned long long sharedLockByte; + const char *filePath; +}; + +struct ByteRangeLockPB2 +{ + unsigned long long offset; /* offset to first byte to lock */ + unsigned long long length; /* nbr of bytes to lock */ + unsigned long long retRangeStart; /* nbr of 1st byte locked if successful */ + unsigned char unLockFlag; /* 1 = unlock, 0 = lock */ + unsigned char startEndFlag; /* 1=rel to end of fork, 0=rel to start */ + int fd; /* file desc to assoc this lock with */ +}; + +#define afpfsByteRangeLock2FSCTL _IOWR('z', 23, struct ByteRangeLockPB2) + +/* + ** Return SQLITE_OK on success, SQLITE_BUSY on failure. + */ +static int _AFPFSSetLock( + const char *path, + unixFile *pFile, + unsigned long long offset, + unsigned long long length, + int setLockFlag +){ + struct ByteRangeLockPB2 pb; + int err; + + pb.unLockFlag = setLockFlag ? 0 : 1; + pb.startEndFlag = 0; + pb.offset = offset; + pb.length = length; + pb.fd = pFile->h; + OSTRACE5("AFPLOCK setting lock %s for %d in range %llx:%llx\n", + (setLockFlag?"ON":"OFF"), pFile->h, offset, length); + err = fsctl(path, afpfsByteRangeLock2FSCTL, &pb, 0); + if ( err==-1 ) { + int rc; + int tErrno = errno; + OSTRACE4("AFPLOCK failed to fsctl() '%s' %d %s\n", path, tErrno, strerror(tErrno)); + rc = sqliteErrorFromPosixError(tErrno, setLockFlag ? SQLITE_IOERR_LOCK : SQLITE_IOERR_UNLOCK); /* error */ + if( IS_LOCK_ERROR(rc) ){ + pFile->lastErrno = tErrno; + } + return rc; + } else { + return SQLITE_OK; + } +} + +/* AFP-style reserved lock checking following the behavior of +** unixCheckReservedLock, see the unixCheckReservedLock function comments */ +static int afpCheckReservedLock(sqlite3_file *id, int *pResOut){ int rc = SQLITE_OK; int reserved = 0; unixFile *pFile = (unixFile*)id; - + SimulateIOError( return SQLITE_IOERR_CHECKRESERVEDLOCK; ); assert( pFile ); - + afpLockingContext *context = (afpLockingContext *) pFile->lockingContext; + /* Check if a thread in this process holds such a lock */ if( pFile->locktype>SHARED_LOCK ){ - /* Either this connection or some other connection in the same process - ** holds a lock on the file. No need to check further. */ reserved = 1; - }else{ - /* The lock is held if and only if the lockfile exists */ - const char *zLockFile = (const char*)pFile->lockingContext; - reserved = access(zLockFile, 0)==0; + } + + /* Otherwise see if some other process holds it. + */ + if( !reserved ){ + /* lock the RESERVED byte */ + int lrc = _AFPFSSetLock(context->filePath, pFile, RESERVED_BYTE, 1,1); + if( SQLITE_OK==lrc ){ + /* if we succeeded in taking the reserved lock, unlock it to restore + ** the original state */ + lrc = _AFPFSSetLock(context->filePath, pFile, RESERVED_BYTE, 1, 0); + } else { + /* if we failed to get the lock then someone else must have it */ + reserved = 1; + } + if( IS_LOCK_ERROR(lrc) ){ + rc=lrc; + } } + OSTRACE4("TEST WR-LOCK %d %d %d\n", pFile->h, rc, reserved); + *pResOut = reserved; return rc; } -/* -** Lock the file with the lock specified by parameter locktype - one -** of the following: -** -** (1) SHARED_LOCK -** (2) RESERVED_LOCK -** (3) PENDING_LOCK -** (4) EXCLUSIVE_LOCK -** -** Sometimes when requesting one lock state, additional lock states -** are inserted in between. The locking might fail on one of the later -** transitions leaving the lock state different from what it started but -** still short of its goal. The following chart shows the allowed -** transitions and the inserted intermediate states: -** -** UNLOCKED -> SHARED -** SHARED -> RESERVED -** SHARED -> (PENDING) -> EXCLUSIVE -** RESERVED -> (PENDING) -> EXCLUSIVE -** PENDING -> EXCLUSIVE -** -** This routine will only increase a lock. Use the sqlite3OsUnlock() -** routine to lower a locking level. -** -** With dotfile locking, we really only support state (4): EXCLUSIVE. -** But we track the other locking levels internally. -*/ -static int dotlockLock(sqlite3_file *id, int locktype) { +/* AFP-style locking following the behavior of unixLock, see the unixLock +** function comments for details of lock management. */ +static int afpLock(sqlite3_file *id, int locktype){ + int rc = SQLITE_OK; unixFile *pFile = (unixFile*)id; - int fd; - char *zLockFile = (char *)pFile->lockingContext; - int rc = SQLITE_OK; + afpLockingContext *context = (afpLockingContext *) pFile->lockingContext; + + assert( pFile ); + OSTRACE5("LOCK %d %s was %s pid=%d\n", pFile->h, + locktypeName(locktype), locktypeName(pFile->locktype), getpid()); - - /* If we have any lock, then the lock file already exists. All we have - ** to do is adjust our internal record of the lock level. + /* If there is already a lock of this type or more restrictive on the + ** unixFile, do nothing. Don't use the afp_end_lock: exit path, as + ** enterMutex() hasn't been called yet. */ - if( pFile->locktype > NO_LOCK ){ - pFile->locktype = locktype; -#if !OS_VXWORKS - /* Always update the timestamp on the old file */ - utimes(zLockFile, NULL); -#endif + if( pFile->locktype>=locktype ){ + OSTRACE3("LOCK %d %s ok (already held)\n", pFile->h, + locktypeName(locktype)); return SQLITE_OK; } - - /* grab an exclusive lock */ - fd = open(zLockFile,O_RDONLY|O_CREAT|O_EXCL,0600); - if( fd<0 ){ - /* failed to open/create the file, someone else may have stolen the lock */ - int tErrno = errno; - if( EEXIST == tErrno ){ - rc = SQLITE_BUSY; + + /* Make sure the locking sequence is correct + */ + assert( pFile->locktype!=NO_LOCK || locktype==SHARED_LOCK ); + assert( locktype!=PENDING_LOCK ); + assert( locktype!=RESERVED_LOCK || pFile->locktype==SHARED_LOCK ); + + /* This mutex is needed because pFile->pLock is shared across threads + */ + enterMutex(); + + /* Make sure the current thread owns the pFile. + */ + rc = transferOwnership(pFile); + if( rc!=SQLITE_OK ){ + leaveMutex(); + return rc; + } + + /* A PENDING lock is needed before acquiring a SHARED lock and before + ** acquiring an EXCLUSIVE lock. For the SHARED lock, the PENDING will + ** be released. + */ + if( locktype==SHARED_LOCK + || (locktype==EXCLUSIVE_LOCK && pFile->locktypefilePath, pFile, PENDING_BYTE, 1, 1); + if (failed) { + rc = failed; + goto afp_end_lock; + } + } + + /* If control gets to this point, then actually go ahead and make + ** operating system calls for the specified lock. + */ + if( locktype==SHARED_LOCK ){ + int lk, lrc1, lrc2, lrc1Errno; + + /* Now get the read-lock SHARED_LOCK */ + /* note that the quality of the randomness doesn't matter that much */ + lk = random(); + context->sharedLockByte = (lk & 0x7fffffff)%(SHARED_SIZE - 1); + lrc1 = _AFPFSSetLock(context->filePath, pFile, + SHARED_FIRST+context->sharedLockByte, 1, 1); + if( IS_LOCK_ERROR(lrc1) ){ + lrc1Errno = pFile->lastErrno; + } + /* Drop the temporary PENDING lock */ + lrc2 = _AFPFSSetLock(context->filePath, pFile, PENDING_BYTE, 1, 0); + + if( IS_LOCK_ERROR(lrc1) ) { + pFile->lastErrno = lrc1Errno; + rc = lrc1; + goto afp_end_lock; + } else if( IS_LOCK_ERROR(lrc2) ){ + rc = lrc2; + goto afp_end_lock; + } else if( lrc1 != SQLITE_OK ) { + rc = lrc1; } else { - rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_LOCK); - if( IS_LOCK_ERROR(rc) ){ - pFile->lastErrno = tErrno; + pFile->locktype = SHARED_LOCK; + } + }else{ + /* The request was for a RESERVED or EXCLUSIVE lock. It is + ** assumed that there is a SHARED or greater lock on the file + ** already. + */ + int failed = 0; + assert( 0!=pFile->locktype ); + if (locktype >= RESERVED_LOCK && pFile->locktype < RESERVED_LOCK) { + /* Acquire a RESERVED lock */ + failed = _AFPFSSetLock(context->filePath, pFile, RESERVED_BYTE, 1,1); + } + if (!failed && locktype == EXCLUSIVE_LOCK) { + /* Acquire an EXCLUSIVE lock */ + + /* Remove the shared lock before trying the range. we'll need to + ** reestablish the shared lock if we can't get the afpUnlock + */ + if (!(failed = _AFPFSSetLock(context->filePath, pFile, SHARED_FIRST + + context->sharedLockByte, 1, 0))) { + /* now attemmpt to get the exclusive lock range */ + failed = _AFPFSSetLock(context->filePath, pFile, SHARED_FIRST, + SHARED_SIZE, 1); + if (failed && (failed = _AFPFSSetLock(context->filePath, pFile, + SHARED_FIRST + context->sharedLockByte, 1, 1))) { + rc = failed; + } + } else { + rc = failed; } } - return rc; - } - if( close(fd) ){ - pFile->lastErrno = errno; - rc = SQLITE_IOERR_CLOSE; + if( failed ){ + rc = failed; + } + } + + if( rc==SQLITE_OK ){ + pFile->locktype = locktype; + }else if( locktype==EXCLUSIVE_LOCK ){ + pFile->locktype = PENDING_LOCK; } - /* got it, set the type and return ok */ - pFile->locktype = locktype; +afp_end_lock: + leaveMutex(); + OSTRACE4("LOCK %d %s %s\n", pFile->h, locktypeName(locktype), + rc==SQLITE_OK ? "ok" : "failed"); return rc; } /* ** Lower the locking level on file descriptor pFile to locktype. locktype ** must be either NO_LOCK or SHARED_LOCK. ** ** If the locking level of the file descriptor is already at or below ** the requested locking level, this routine is a no-op. -** -** When the locking level reaches NO_LOCK, delete the lock file. */ -static int dotlockUnlock(sqlite3_file *id, int locktype) { +static int afpUnlock(sqlite3_file *id, int locktype) { + int rc = SQLITE_OK; unixFile *pFile = (unixFile*)id; - char *zLockFile = (char *)pFile->lockingContext; + afpLockingContext *context = (afpLockingContext *) pFile->lockingContext; assert( pFile ); OSTRACE5("UNLOCK %d %d was %d pid=%d\n", pFile->h, locktype, - pFile->locktype, getpid()); + pFile->locktype, getpid()); + assert( locktype<=SHARED_LOCK ); - - /* no-op if possible */ - if( pFile->locktype==locktype ){ - return SQLITE_OK; - } - - /* To downgrade to shared, simply update our internal notion of the - ** lock state. No need to mess with the file on disk. - */ - if( locktype==SHARED_LOCK ){ - pFile->locktype = SHARED_LOCK; - return SQLITE_OK; - } - - /* To fully unlock the database, delete the lock file */ - assert( locktype==NO_LOCK ); - if( unlink(zLockFile) ){ - int rc, tErrno = errno; - if( ENOENT != tErrno ){ - rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_UNLOCK); - } - if( IS_LOCK_ERROR(rc) ){ - pFile->lastErrno = tErrno; - } - return rc; - } - pFile->locktype = NO_LOCK; - return SQLITE_OK; -} - -/* -** Close a file. Make sure the lock has been released before closing. -*/ -static int dotlockClose(sqlite3_file *id) { - int rc; + if( pFile->locktype<=locktype ){ + return SQLITE_OK; + } + if( CHECK_THREADID(pFile) ){ + return SQLITE_MISUSE; + } + enterMutex(); + int failed = SQLITE_OK; + if( pFile->locktype>SHARED_LOCK ){ + if( locktype==SHARED_LOCK ){ + + /* unlock the exclusive range - then re-establish the shared lock */ + if (pFile->locktype==EXCLUSIVE_LOCK) { + failed = _AFPFSSetLock(context->filePath, pFile, SHARED_FIRST, + SHARED_SIZE, 0); + if (!failed) { + /* successfully removed the exclusive lock */ + if ((failed = _AFPFSSetLock(context->filePath, pFile, SHARED_FIRST+ + context->sharedLockByte, 1, 1))) { + /* failed to re-establish our shared lock */ + rc = failed; + } + } else { + rc = failed; + } + } + } + if (rc == SQLITE_OK && pFile->locktype>=PENDING_LOCK) { + if ((failed = _AFPFSSetLock(context->filePath, pFile, + PENDING_BYTE, 1, 0))){ + /* failed to release the pending lock */ + rc = failed; + } + } + if (rc == SQLITE_OK && pFile->locktype>=RESERVED_LOCK) { + if ((failed = _AFPFSSetLock(context->filePath, pFile, + RESERVED_BYTE, 1, 0))) { + /* failed to release the reserved lock */ + rc = failed; + } + } + } + if( locktype==NO_LOCK ){ + int failed = _AFPFSSetLock(context->filePath, pFile, + SHARED_FIRST + context->sharedLockByte, 1, 0); + if (failed) { + rc = failed; + } + } + if (rc == SQLITE_OK) + pFile->locktype = locktype; + leaveMutex(); + return rc; +} + +/* +** Close a file & cleanup AFP specific locking context +*/ +static int afpClose(sqlite3_file *id) { if( id ){ unixFile *pFile = (unixFile*)id; - dotlockUnlock(id, NO_LOCK); + afpUnlock(id, NO_LOCK); sqlite3_free(pFile->lockingContext); } - rc = closeUnixFile(id); - return rc; -} -/****************** End of the dot-file lock implementation ******************* -******************************************************************************/ - -/****************************************************************************** -************************** Begin flock Locking ******************************** -** -** Use the flock() system call to do file locking. -** -** flock() locking is like dot-file locking in that the various -** fine-grain locking levels supported by SQLite are collapsed into -** a single exclusive lock. In other words, SHARED, RESERVED, and -** PENDING locks are the same thing as an EXCLUSIVE lock. SQLite -** still works when you do this, but concurrency is reduced since -** only a single process can be reading the database at a time. -** -** Omit this section if SQLITE_ENABLE_LOCKING_STYLE is turned off or if -** compiling for VXWORKS. -*/ -#if SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORKS + return closeUnixFile(id); +} + + +#pragma mark flock() style locking /* -** This routine checks if there is a RESERVED lock held on the specified -** file by this or any other process. If such a lock is held, set *pResOut -** to a non-zero value otherwise *pResOut is set to zero. The return value -** is set to SQLITE_OK unless an I/O error occurs during lock checking. +** The flockLockingContext is not used */ +typedef void flockLockingContext; + +/* flock-style reserved lock checking following the behavior of + ** unixCheckReservedLock, see the unixCheckReservedLock function comments */ static int flockCheckReservedLock(sqlite3_file *id, int *pResOut){ int rc = SQLITE_OK; int reserved = 0; unixFile *pFile = (unixFile*)id; @@ -1906,49 +2038,14 @@ } } } OSTRACE4("TEST WR-LOCK %d %d %d\n", pFile->h, rc, reserved); -#ifdef SQLITE_IGNORE_FLOCK_LOCK_ERRORS - if( (rc & SQLITE_IOERR) == SQLITE_IOERR ){ - rc = SQLITE_OK; - reserved=1; - } -#endif /* SQLITE_IGNORE_FLOCK_LOCK_ERRORS */ *pResOut = reserved; return rc; } -/* -** Lock the file with the lock specified by parameter locktype - one -** of the following: -** -** (1) SHARED_LOCK -** (2) RESERVED_LOCK -** (3) PENDING_LOCK -** (4) EXCLUSIVE_LOCK -** -** Sometimes when requesting one lock state, additional lock states -** are inserted in between. The locking might fail on one of the later -** transitions leaving the lock state different from what it started but -** still short of its goal. The following chart shows the allowed -** transitions and the inserted intermediate states: -** -** UNLOCKED -> SHARED -** SHARED -> RESERVED -** SHARED -> (PENDING) -> EXCLUSIVE -** RESERVED -> (PENDING) -> EXCLUSIVE -** PENDING -> EXCLUSIVE -** -** flock() only really support EXCLUSIVE locks. We track intermediate -** lock states in the sqlite3_file structure, but all locks SHARED or -** above are really EXCLUSIVE locks and exclude all other processes from -** access the file. -** -** This routine will only increase a lock. Use the sqlite3OsUnlock() -** routine to lower a locking level. -*/ static int flockLock(sqlite3_file *id, int locktype) { int rc = SQLITE_OK; unixFile *pFile = (unixFile*)id; assert( pFile ); @@ -1973,26 +2070,13 @@ /* got it, set the type and return ok */ pFile->locktype = locktype; } OSTRACE4("LOCK %d %s %s\n", pFile->h, locktypeName(locktype), rc==SQLITE_OK ? "ok" : "failed"); -#ifdef SQLITE_IGNORE_FLOCK_LOCK_ERRORS - if( (rc & SQLITE_IOERR) == SQLITE_IOERR ){ - rc = SQLITE_BUSY; - } -#endif /* SQLITE_IGNORE_FLOCK_LOCK_ERRORS */ return rc; } - -/* -** Lower the locking level on file descriptor pFile to locktype. locktype -** must be either NO_LOCK or SHARED_LOCK. -** -** If the locking level of the file descriptor is already at or below -** the requested locking level, this routine is a no-op. -*/ static int flockUnlock(sqlite3_file *id, int locktype) { unixFile *pFile = (unixFile*)id; assert( pFile ); OSTRACE5("UNLOCK %d %d was %d pid=%d\n", pFile->h, locktype, @@ -2016,16 +2100,10 @@ int r, tErrno = errno; r = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_UNLOCK); if( IS_LOCK_ERROR(r) ){ pFile->lastErrno = tErrno; } -#ifdef SQLITE_IGNORE_FLOCK_LOCK_ERRORS - if( (r & SQLITE_IOERR) == SQLITE_IOERR ){ - r = SQLITE_BUSY; - } -#endif /* SQLITE_IGNORE_FLOCK_LOCK_ERRORS */ - return r; } else { pFile->locktype = NO_LOCK; return SQLITE_OK; } @@ -2039,34 +2117,15 @@ flockUnlock(id, NO_LOCK); } return closeUnixFile(id); } -#endif /* SQLITE_ENABLE_LOCKING_STYLE && !OS_VXWORK */ - -/******************* End of the flock lock implementation ********************* -******************************************************************************/ - -/****************************************************************************** -************************ Begin Named Semaphore Locking ************************ -** -** Named semaphore locking is only supported on VxWorks. -** -** Semaphore locking is like dot-lock and flock in that it really only -** supports EXCLUSIVE locking. Only a single process can read or write -** the database file at a time. This reduces potential concurrency, but -** makes the lock implementation much easier. -*/ -#if OS_VXWORKS - -/* -** This routine checks if there is a RESERVED lock held on the specified -** file by this or any other process. If such a lock is held, set *pResOut -** to a non-zero value otherwise *pResOut is set to zero. The return value -** is set to SQLITE_OK unless an I/O error occurs during lock checking. -*/ -static int semCheckReservedLock(sqlite3_file *id, int *pResOut) { +#pragma mark Old-School .lock file based locking + +/* Dotlock-style reserved lock checking following the behavior of +** unixCheckReservedLock, see the unixCheckReservedLock function comments */ +static int dotlockCheckReservedLock(sqlite3_file *id, int *pResOut) { int rc = SQLITE_OK; int reserved = 0; unixFile *pFile = (unixFile*)id; SimulateIOError( return SQLITE_IOERR_CHECKRESERVEDLOCK; ); @@ -2078,102 +2137,84 @@ reserved = 1; } /* Otherwise see if some other process holds it. */ if( !reserved ){ - sem_t *pSem = pFile->pOpen->pSem; + char *zLockFile = (char *)pFile->lockingContext; struct stat statBuf; - - if( sem_trywait(pSem)==-1 ){ - int tErrno = errno; - if( EAGAIN != tErrno ){ + + if( lstat(zLockFile, &statBuf)==0 ){ + /* file exists, someone else has the lock */ + reserved = 1; + }else{ + /* file does not exist, we could have it if we want it */ + int tErrno = errno; + if( ENOENT != tErrno ){ rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_CHECKRESERVEDLOCK); pFile->lastErrno = tErrno; - } else { - /* someone else has the lock when we are in NO_LOCK */ - reserved = (pFile->locktype < SHARED_LOCK); } - }else{ - /* we could have it if we want it */ - sem_post(pSem); } } OSTRACE4("TEST WR-LOCK %d %d %d\n", pFile->h, rc, reserved); *pResOut = reserved; return rc; } -/* -** Lock the file with the lock specified by parameter locktype - one -** of the following: -** -** (1) SHARED_LOCK -** (2) RESERVED_LOCK -** (3) PENDING_LOCK -** (4) EXCLUSIVE_LOCK -** -** Sometimes when requesting one lock state, additional lock states -** are inserted in between. The locking might fail on one of the later -** transitions leaving the lock state different from what it started but -** still short of its goal. The following chart shows the allowed -** transitions and the inserted intermediate states: -** -** UNLOCKED -> SHARED -** SHARED -> RESERVED -** SHARED -> (PENDING) -> EXCLUSIVE -** RESERVED -> (PENDING) -> EXCLUSIVE -** PENDING -> EXCLUSIVE -** -** Semaphore locks only really support EXCLUSIVE locks. We track intermediate -** lock states in the sqlite3_file structure, but all locks SHARED or -** above are really EXCLUSIVE locks and exclude all other processes from -** access the file. -** -** This routine will only increase a lock. Use the sqlite3OsUnlock() -** routine to lower a locking level. -*/ -static int semLock(sqlite3_file *id, int locktype) { +static int dotlockLock(sqlite3_file *id, int locktype) { unixFile *pFile = (unixFile*)id; int fd; - sem_t *pSem = pFile->pOpen->pSem; - int rc = SQLITE_OK; + char *zLockFile = (char *)pFile->lockingContext; + int rc=SQLITE_OK; /* if we already have a lock, it is exclusive. ** Just adjust level and punt on outta here. */ if (pFile->locktype > NO_LOCK) { pFile->locktype = locktype; + + /* Always update the timestamp on the old file */ + utimes(zLockFile, NULL); rc = SQLITE_OK; - goto sem_end_lock; + goto dotlock_end_lock; + } + + /* check to see if lock file already exists */ + struct stat statBuf; + if (lstat(zLockFile,&statBuf) == 0){ + rc = SQLITE_BUSY; /* it does, busy */ + goto dotlock_end_lock; } - /* lock semaphore now but bail out when already locked. */ - if( sem_trywait(pSem)==-1 ){ - rc = SQLITE_BUSY; - goto sem_end_lock; - } - + /* grab an exclusive lock */ + fd = open(zLockFile,O_RDONLY|O_CREAT|O_EXCL,0600); + if( fd<0 ){ + /* failed to open/create the file, someone else may have stolen the lock */ + int tErrno = errno; + if( EEXIST == tErrno ){ + rc = SQLITE_BUSY; + } else { + rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_LOCK); + if( IS_LOCK_ERROR(rc) ){ + pFile->lastErrno = tErrno; + } + } + goto dotlock_end_lock; + } + close(fd); + /* got it, set the type and return ok */ pFile->locktype = locktype; - sem_end_lock: + dotlock_end_lock: return rc; } -/* -** Lower the locking level on file descriptor pFile to locktype. locktype -** must be either NO_LOCK or SHARED_LOCK. -** -** If the locking level of the file descriptor is already at or below -** the requested locking level, this routine is a no-op. -*/ -static int semUnlock(sqlite3_file *id, int locktype) { +static int dotlockUnlock(sqlite3_file *id, int locktype) { unixFile *pFile = (unixFile*)id; - sem_t *pSem = pFile->pOpen->pSem; + char *zLockFile = (char *)pFile->lockingContext; assert( pFile ); - assert( pSem ); OSTRACE5("UNLOCK %d %d was %d pid=%d\n", pFile->h, locktype, pFile->locktype, getpid()); assert( locktype<=SHARED_LOCK ); /* no-op if possible */ @@ -2185,14 +2226,16 @@ if (locktype==SHARED_LOCK) { pFile->locktype = locktype; return SQLITE_OK; } - /* no, really unlock. */ - if ( sem_post(pSem)==-1 ) { + /* no, really, unlock. */ + if (unlink(zLockFile) ) { int rc, tErrno = errno; - rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_UNLOCK); + if( ENOENT != tErrno ){ + rc = sqliteErrorFromPosixError(tErrno, SQLITE_IOERR_UNLOCK); + } if( IS_LOCK_ERROR(rc) ){ pFile->lastErrno = tErrno; } return rc; } @@ -2201,848 +2244,46 @@ } /* ** Close a file. */ -static int semClose(sqlite3_file *id) { - if( id ){ - unixFile *pFile = (unixFile*)id; - semUnlock(id, NO_LOCK); - assert( pFile ); - unixEnterMutex(); - releaseLockInfo(pFile->pLock); - releaseOpenCnt(pFile->pOpen); - closeUnixFile(id); - unixLeaveMutex(); - } - return SQLITE_OK; -} - -#endif /* OS_VXWORKS */ -/* -** Named semaphore locking is only available on VxWorks. -** -*************** End of the named semaphore lock implementation **************** -******************************************************************************/ - - -/****************************************************************************** -*************************** Begin AFP Locking ********************************* -** -** AFP is the Apple Filing Protocol. AFP is a network filesystem found -** on Apple Macintosh computers - both OS9 and OSX. -** -** Third-party implementations of AFP are available. But this code here -** only works on OSX. -*/ - -#if defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE -/* -** The afpLockingContext structure contains all afp lock specific state -*/ -typedef struct afpLockingContext afpLockingContext; -struct afpLockingContext { - unsigned long long sharedByte; - const char *dbPath; /* Name of the open file */ -}; - -struct ByteRangeLockPB2 -{ - unsigned long long offset; /* offset to first byte to lock */ - unsigned long long length; /* nbr of bytes to lock */ - unsigned long long retRangeStart; /* nbr of 1st byte locked if successful */ - unsigned char unLockFlag; /* 1 = unlock, 0 = lock */ - unsigned char startEndFlag; /* 1=rel to end of fork, 0=rel to start */ - int fd; /* file desc to assoc this lock with */ -}; - -#define afpfsByteRangeLock2FSCTL _IOWR('z', 23, struct ByteRangeLockPB2) - -/* -** This is a utility for setting or clearing a bit-range lock on an -** AFP filesystem. -** -** Return SQLITE_OK on success, SQLITE_BUSY on failure. -*/ -static int afpSetLock( - const char *path, /* Name of the file to be locked or unlocked */ - unixFile *pFile, /* Open file descriptor on path */ - unsigned long long offset, /* First byte to be locked */ - unsigned long long length, /* Number of bytes to lock */ - int setLockFlag /* True to set lock. False to clear lock */ -){ - struct ByteRangeLockPB2 pb; - int err; - - pb.unLockFlag = setLockFlag ? 0 : 1; - pb.startEndFlag = 0; - pb.offset = offset; - pb.length = length; - pb.fd = pFile->h; - - OSTRACE6("AFPSETLOCK [%s] for %d%s in range %llx:%llx\n", - (setLockFlag?"ON":"OFF"), pFile->h, (pb.fd==-1?"[testval-1]":""), - offset, length); - err = fsctl(path, afpfsByteRangeLock2FSCTL, &pb, 0); - if ( err==-1 ) { - int rc; - int tErrno = errno; - OSTRACE4("AFPSETLOCK failed to fsctl() '%s' %d %s\n", - path, tErrno, strerror(tErrno)); -#ifdef SQLITE_IGNORE_AFP_LOCK_ERRORS - rc = SQLITE_BUSY; -#else - rc = sqliteErrorFromPosixError(tErrno, - setLockFlag ? SQLITE_IOERR_LOCK : SQLITE_IOERR_UNLOCK); -#endif /* SQLITE_IGNORE_AFP_LOCK_ERRORS */ - if( IS_LOCK_ERROR(rc) ){ - pFile->lastErrno = tErrno; - } - return rc; - } else { - return SQLITE_OK; - } -} - -/* -** This routine checks if there is a RESERVED lock held on the specified -** file by this or any other process. If such a lock is held, set *pResOut -** to a non-zero value otherwise *pResOut is set to zero. The return value -** is set to SQLITE_OK unless an I/O error occurs during lock checking. -*/ -static int afpCheckReservedLock(sqlite3_file *id, int *pResOut){ - int rc = SQLITE_OK; - int reserved = 0; - unixFile *pFile = (unixFile*)id; - - SimulateIOError( return SQLITE_IOERR_CHECKRESERVEDLOCK; ); - - assert( pFile ); - afpLockingContext *context = (afpLockingContext *) pFile->lockingContext; - - /* Check if a thread in this process holds such a lock */ - if( pFile->locktype>SHARED_LOCK ){ - reserved = 1; - } - - /* Otherwise see if some other process holds it. - */ - if( !reserved ){ - /* lock the RESERVED byte */ - int lrc = afpSetLock(context->dbPath, pFile, RESERVED_BYTE, 1,1); - if( SQLITE_OK==lrc ){ - /* if we succeeded in taking the reserved lock, unlock it to restore - ** the original state */ - lrc = afpSetLock(context->dbPath, pFile, RESERVED_BYTE, 1, 0); - } else { - /* if we failed to get the lock then someone else must have it */ - reserved = 1; - } - if( IS_LOCK_ERROR(lrc) ){ - rc=lrc; - } - } - - OSTRACE4("TEST WR-LOCK %d %d %d\n", pFile->h, rc, reserved); - - *pResOut = reserved; - return rc; -} - -/* -** Lock the file with the lock specified by parameter locktype - one -** of the following: -** -** (1) SHARED_LOCK -** (2) RESERVED_LOCK -** (3) PENDING_LOCK -** (4) EXCLUSIVE_LOCK -** -** Sometimes when requesting one lock state, additional lock states -** are inserted in between. The locking might fail on one of the later -** transitions leaving the lock state different from what it started but -** still short of its goal. The following chart shows the allowed -** transitions and the inserted intermediate states: -** -** UNLOCKED -> SHARED -** SHARED -> RESERVED -** SHARED -> (PENDING) -> EXCLUSIVE -** RESERVED -> (PENDING) -> EXCLUSIVE -** PENDING -> EXCLUSIVE -** -** This routine will only increase a lock. Use the sqlite3OsUnlock() -** routine to lower a locking level. -*/ -static int afpLock(sqlite3_file *id, int locktype){ - int rc = SQLITE_OK; - unixFile *pFile = (unixFile*)id; - afpLockingContext *context = (afpLockingContext *) pFile->lockingContext; - - assert( pFile ); - OSTRACE5("LOCK %d %s was %s pid=%d\n", pFile->h, - locktypeName(locktype), locktypeName(pFile->locktype), getpid()); - - /* If there is already a lock of this type or more restrictive on the - ** unixFile, do nothing. Don't use the afp_end_lock: exit path, as - ** unixEnterMutex() hasn't been called yet. - */ - if( pFile->locktype>=locktype ){ - OSTRACE3("LOCK %d %s ok (already held)\n", pFile->h, - locktypeName(locktype)); - return SQLITE_OK; - } - - /* Make sure the locking sequence is correct - */ - assert( pFile->locktype!=NO_LOCK || locktype==SHARED_LOCK ); - assert( locktype!=PENDING_LOCK ); - assert( locktype!=RESERVED_LOCK || pFile->locktype==SHARED_LOCK ); - - /* This mutex is needed because pFile->pLock is shared across threads - */ - unixEnterMutex(); - - /* Make sure the current thread owns the pFile. - */ - rc = transferOwnership(pFile); - if( rc!=SQLITE_OK ){ - unixLeaveMutex(); - return rc; - } - - /* A PENDING lock is needed before acquiring a SHARED lock and before - ** acquiring an EXCLUSIVE lock. For the SHARED lock, the PENDING will - ** be released. - */ - if( locktype==SHARED_LOCK - || (locktype==EXCLUSIVE_LOCK && pFile->locktypedbPath, pFile, PENDING_BYTE, 1, 1); - if (failed) { - rc = failed; - goto afp_end_lock; - } - } - - /* If control gets to this point, then actually go ahead and make - ** operating system calls for the specified lock. - */ - if( locktype==SHARED_LOCK ){ - int lk, lrc1, lrc2, lrc1Errno; - - /* Now get the read-lock SHARED_LOCK */ - /* note that the quality of the randomness doesn't matter that much */ - lk = random(); - context->sharedByte = (lk & 0x7fffffff)%(SHARED_SIZE - 1); - lrc1 = afpSetLock(context->dbPath, pFile, - SHARED_FIRST+context->sharedByte, 1, 1); - if( IS_LOCK_ERROR(lrc1) ){ - lrc1Errno = pFile->lastErrno; - } - /* Drop the temporary PENDING lock */ - lrc2 = afpSetLock(context->dbPath, pFile, PENDING_BYTE, 1, 0); - - if( IS_LOCK_ERROR(lrc1) ) { - pFile->lastErrno = lrc1Errno; - rc = lrc1; - goto afp_end_lock; - } else if( IS_LOCK_ERROR(lrc2) ){ - rc = lrc2; - goto afp_end_lock; - } else if( lrc1 != SQLITE_OK ) { - rc = lrc1; - } else { - pFile->locktype = SHARED_LOCK; - pFile->pOpen->nLock++; - } - }else{ - /* The request was for a RESERVED or EXCLUSIVE lock. It is - ** assumed that there is a SHARED or greater lock on the file - ** already. - */ - int failed = 0; - assert( 0!=pFile->locktype ); - if (locktype >= RESERVED_LOCK && pFile->locktype < RESERVED_LOCK) { - /* Acquire a RESERVED lock */ - failed = afpSetLock(context->dbPath, pFile, RESERVED_BYTE, 1,1); - } - if (!failed && locktype == EXCLUSIVE_LOCK) { - /* Acquire an EXCLUSIVE lock */ - - /* Remove the shared lock before trying the range. we'll need to - ** reestablish the shared lock if we can't get the afpUnlock - */ - if( !(failed = afpSetLock(context->dbPath, pFile, SHARED_FIRST + - context->sharedByte, 1, 0)) ){ - int failed2 = SQLITE_OK; - /* now attemmpt to get the exclusive lock range */ - failed = afpSetLock(context->dbPath, pFile, SHARED_FIRST, - SHARED_SIZE, 1); - if( failed && (failed2 = afpSetLock(context->dbPath, pFile, - SHARED_FIRST + context->sharedByte, 1, 1)) ){ - /* Can't reestablish the shared lock. Sqlite can't deal, this is - ** a critical I/O error - */ - rc = ((failed & SQLITE_IOERR) == SQLITE_IOERR) ? failed2 : - SQLITE_IOERR_LOCK; - goto afp_end_lock; - } - }else{ - rc = failed; - } - } - if( failed ){ - rc = failed; - } - } - - if( rc==SQLITE_OK ){ - pFile->locktype = locktype; - }else if( locktype==EXCLUSIVE_LOCK ){ - pFile->locktype = PENDING_LOCK; - } - -afp_end_lock: - unixLeaveMutex(); - OSTRACE4("LOCK %d %s %s\n", pFile->h, locktypeName(locktype), - rc==SQLITE_OK ? "ok" : "failed"); - return rc; -} - -/* -** Lower the locking level on file descriptor pFile to locktype. locktype -** must be either NO_LOCK or SHARED_LOCK. -** -** If the locking level of the file descriptor is already at or below -** the requested locking level, this routine is a no-op. -*/ -static int afpUnlock(sqlite3_file *id, int locktype) { - int rc = SQLITE_OK; - unixFile *pFile = (unixFile*)id; - afpLockingContext *pCtx = (afpLockingContext *) pFile->lockingContext; - - assert( pFile ); - OSTRACE5("UNLOCK %d %d was %d pid=%d\n", pFile->h, locktype, - pFile->locktype, getpid()); - - assert( locktype<=SHARED_LOCK ); - if( pFile->locktype<=locktype ){ - return SQLITE_OK; - } - if( CHECK_THREADID(pFile) ){ - return SQLITE_MISUSE; - } - unixEnterMutex(); - if( pFile->locktype>SHARED_LOCK ){ - - if( pFile->locktype==EXCLUSIVE_LOCK ){ - rc = afpSetLock(pCtx->dbPath, pFile, SHARED_FIRST, SHARED_SIZE, 0); - if( rc==SQLITE_OK && locktype==SHARED_LOCK ){ - /* only re-establish the shared lock if necessary */ - int sharedLockByte = SHARED_FIRST+pCtx->sharedByte; - rc = afpSetLock(pCtx->dbPath, pFile, sharedLockByte, 1, 1); - } - } - if( rc==SQLITE_OK && pFile->locktype>=PENDING_LOCK ){ - rc = afpSetLock(pCtx->dbPath, pFile, PENDING_BYTE, 1, 0); - } - if( rc==SQLITE_OK && pFile->locktype>=RESERVED_LOCK ){ - rc = afpSetLock(pCtx->dbPath, pFile, RESERVED_BYTE, 1, 0); - } - }else if( locktype==NO_LOCK ){ - /* clear the shared lock */ - int sharedLockByte = SHARED_FIRST+pCtx->sharedByte; - rc = afpSetLock(pCtx->dbPath, pFile, sharedLockByte, 1, 0); - } - - if( rc==SQLITE_OK ){ - if( locktype==NO_LOCK ){ - struct unixOpenCnt *pOpen = pFile->pOpen; - pOpen->nLock--; - assert( pOpen->nLock>=0 ); - if( pOpen->nLock==0 && pOpen->nPending>0 ){ - int i; - for(i=0; inPending; i++){ - if( pOpen->aPending[i] < 0 ) continue; - if( close(pOpen->aPending[i]) ){ - pFile->lastErrno = errno; - rc = SQLITE_IOERR_CLOSE; - }else{ - pOpen->aPending[i] = -1; - } - } - if( rc==SQLITE_OK ){ - sqlite3_free(pOpen->aPending); - pOpen->nPending = 0; - pOpen->aPending = 0; - } - } - } - } - unixLeaveMutex(); - if( rc==SQLITE_OK ) pFile->locktype = locktype; - return rc; -} - -/* -** Close a file & cleanup AFP specific locking context -*/ -static int afpClose(sqlite3_file *id) { - if( id ){ - unixFile *pFile = (unixFile*)id; - afpUnlock(id, NO_LOCK); - unixEnterMutex(); - if( pFile->pOpen && pFile->pOpen->nLock ){ - /* If there are outstanding locks, do not actually close the file just - ** yet because that would clear those locks. Instead, add the file - ** descriptor to pOpen->aPending. It will be automatically closed when - ** the last lock is cleared. - */ - int *aNew; - struct unixOpenCnt *pOpen = pFile->pOpen; - aNew = sqlite3_realloc(pOpen->aPending, (pOpen->nPending+1)*sizeof(int) ); - if( aNew==0 ){ - /* If a malloc fails, just leak the file descriptor */ - }else{ - pOpen->aPending = aNew; - pOpen->aPending[pOpen->nPending] = pFile->h; - pOpen->nPending++; - pFile->h = -1; - } - } - releaseOpenCnt(pFile->pOpen); - sqlite3_free(pFile->lockingContext); - closeUnixFile(id); - unixLeaveMutex(); - } - return SQLITE_OK; -} - -#endif /* defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE */ -/* -** The code above is the AFP lock implementation. The code is specific -** to MacOSX and does not work on other unix platforms. No alternative -** is available. If you don't compile for a mac, then the "unix-afp" -** VFS is not available. -** -********************* End of the AFP lock implementation ********************** -******************************************************************************/ - - -/****************************************************************************** -**************** Non-locking sqlite3_file methods ***************************** -** -** The next division contains implementations for all methods of the -** sqlite3_file object other than the locking methods. The locking -** methods were defined in divisions above (one locking method per -** division). Those methods that are common to all locking modes -** are gather together into this division. -*/ - -/* -** Seek to the offset passed as the second argument, then read cnt -** bytes into pBuf. Return the number of bytes actually read. -** -** NB: If you define USE_PREAD or USE_PREAD64, then it might also -** be necessary to define _XOPEN_SOURCE to be 500. This varies from -** one system to another. Since SQLite does not define USE_PREAD -** any any form by default, we will not attempt to define _XOPEN_SOURCE. -** See tickets #2741 and #2681. -** -** To avoid stomping the errno value on a failed read the lastErrno value -** is set before returning. -*/ -static int seekAndRead(unixFile *id, sqlite3_int64 offset, void *pBuf, int cnt){ - int got; - i64 newOffset; - TIMER_START; -#if defined(USE_PREAD) - got = pread(id->h, pBuf, cnt, offset); - SimulateIOError( got = -1 ); -#elif defined(USE_PREAD64) - got = pread64(id->h, pBuf, cnt, offset); - SimulateIOError( got = -1 ); -#else - newOffset = lseek(id->h, offset, SEEK_SET); - SimulateIOError( newOffset-- ); - if( newOffset!=offset ){ - if( newOffset == -1 ){ - ((unixFile*)id)->lastErrno = errno; - }else{ - ((unixFile*)id)->lastErrno = 0; - } - return -1; - } - got = read(id->h, pBuf, cnt); -#endif - TIMER_END; - if( got<0 ){ - ((unixFile*)id)->lastErrno = errno; - } - OSTRACE5("READ %-3d %5d %7lld %llu\n", id->h, got, offset, TIMER_ELAPSED); - return got; -} - -/* -** Read data from a file into a buffer. Return SQLITE_OK if all -** bytes were read successfully and SQLITE_IOERR if anything goes -** wrong. -*/ -static int unixRead( - sqlite3_file *id, - void *pBuf, - int amt, - sqlite3_int64 offset -){ - int got; - assert( id ); - - /* Never read or write any of the bytes in the locking range */ - assert( ((unixFile*)id)->isLockable==0 - || offset>=PENDING_BYTE+512 - || offset+amt<=PENDING_BYTE ); - - got = seekAndRead((unixFile*)id, offset, pBuf, amt); - if( got==amt ){ - return SQLITE_OK; - }else if( got<0 ){ - /* lastErrno set by seekAndRead */ - return SQLITE_IOERR_READ; - }else{ - ((unixFile*)id)->lastErrno = 0; /* not a system error */ - /* Unread parts of the buffer must be zero-filled */ - memset(&((char*)pBuf)[got], 0, amt-got); - return SQLITE_IOERR_SHORT_READ; - } -} - -/* -** Seek to the offset in id->offset then read cnt bytes into pBuf. -** Return the number of bytes actually read. Update the offset. -** -** To avoid stomping the errno value on a failed write the lastErrno value -** is set before returning. -*/ -static int seekAndWrite(unixFile *id, i64 offset, const void *pBuf, int cnt){ - int got; - i64 newOffset; - TIMER_START; -#if defined(USE_PREAD) - got = pwrite(id->h, pBuf, cnt, offset); -#elif defined(USE_PREAD64) - got = pwrite64(id->h, pBuf, cnt, offset); -#else - newOffset = lseek(id->h, offset, SEEK_SET); - if( newOffset!=offset ){ - if( newOffset == -1 ){ - ((unixFile*)id)->lastErrno = errno; - }else{ - ((unixFile*)id)->lastErrno = 0; - } - return -1; - } - got = write(id->h, pBuf, cnt); -#endif - TIMER_END; - if( got<0 ){ - ((unixFile*)id)->lastErrno = errno; - } - - OSTRACE5("WRITE %-3d %5d %7lld %llu\n", id->h, got, offset, TIMER_ELAPSED); - return got; -} - - -/* -** Write data from a buffer into a file. Return SQLITE_OK on success -** or some other error code on failure. -*/ -static int unixWrite( - sqlite3_file *id, - const void *pBuf, - int amt, - sqlite3_int64 offset -){ - int wrote = 0; - assert( id ); - assert( amt>0 ); - - /* Never read or write any of the bytes in the locking range */ - assert( ((unixFile*)id)->isLockable==0 - || offset>=PENDING_BYTE+512 - || offset+amt<=PENDING_BYTE ); - -#ifndef NDEBUG - /* If we are doing a normal write to a database file (as opposed to - ** doing a hot-journal rollback or a write to some file other than a - ** normal database file) then record the fact that the database - ** has changed. If the transaction counter is modified, record that - ** fact too. - */ - if( ((unixFile*)id)->inNormalWrite ){ - unixFile *pFile = (unixFile*)id; - pFile->dbUpdate = 1; /* The database has been modified */ - if( offset<=24 && offset+amt>=27 ){ - int rc; - char oldCntr[4]; - SimulateIOErrorBenign(1); - rc = seekAndRead(pFile, 24, oldCntr, 4); - SimulateIOErrorBenign(0); - if( rc!=4 || memcmp(oldCntr, &((char*)pBuf)[24-offset], 4)!=0 ){ - pFile->transCntrChng = 1; /* The transaction counter has changed */ - } - } - } -#endif - - while( amt>0 && (wrote = seekAndWrite((unixFile*)id, offset, pBuf, amt))>0 ){ - amt -= wrote; - offset += wrote; - pBuf = &((char*)pBuf)[wrote]; - } - SimulateIOError(( wrote=(-1), amt=1 )); - SimulateDiskfullError(( wrote=0, amt=1 )); - if( amt>0 ){ - if( wrote<0 ){ - /* lastErrno set by seekAndWrite */ - return SQLITE_IOERR_WRITE; - }else{ - ((unixFile*)id)->lastErrno = 0; /* not a system error */ - return SQLITE_FULL; - } - } - return SQLITE_OK; -} - -#ifdef SQLITE_TEST -/* -** Count the number of fullsyncs and normal syncs. This is used to test -** that syncs and fullsyncs are occurring at the right times. -*/ -int sqlite3_sync_count = 0; -int sqlite3_fullsync_count = 0; -#endif - -/* -** Use the fdatasync() API only if the HAVE_FDATASYNC macro is defined. -** Otherwise use fsync() in its place. -*/ -#ifndef HAVE_FDATASYNC -# define fdatasync fsync -#endif - -/* -** Define HAVE_FULLFSYNC to 0 or 1 depending on whether or not -** the F_FULLFSYNC macro is defined. F_FULLFSYNC is currently -** only available on Mac OS X. But that could change. -*/ -#ifdef F_FULLFSYNC -# define HAVE_FULLFSYNC 1 -#else -# define HAVE_FULLFSYNC 0 -#endif - - -/* -** The fsync() system call does not work as advertised on many -** unix systems. The following procedure is an attempt to make -** it work better. -** -** The SQLITE_NO_SYNC macro disables all fsync()s. This is useful -** for testing when we want to run through the test suite quickly. -** You are strongly advised *not* to deploy with SQLITE_NO_SYNC -** enabled, however, since with SQLITE_NO_SYNC enabled, an OS crash -** or power failure will likely corrupt the database file. -*/ -static int full_fsync(int fd, int fullSync, int dataOnly){ - int rc; - - /* The following "ifdef/elif/else/" block has the same structure as - ** the one below. It is replicated here solely to avoid cluttering - ** up the real code with the UNUSED_PARAMETER() macros. - */ -#ifdef SQLITE_NO_SYNC - UNUSED_PARAMETER(fd); - UNUSED_PARAMETER(fullSync); - UNUSED_PARAMETER(dataOnly); -#elif HAVE_FULLFSYNC - UNUSED_PARAMETER(dataOnly); -#else - UNUSED_PARAMETER(fullSync); -#endif - - /* Record the number of times that we do a normal fsync() and - ** FULLSYNC. This is used during testing to verify that this procedure - ** gets called with the correct arguments. - */ -#ifdef SQLITE_TEST - if( fullSync ) sqlite3_fullsync_count++; - sqlite3_sync_count++; -#endif - - /* If we compiled with the SQLITE_NO_SYNC flag, then syncing is a - ** no-op - */ -#ifdef SQLITE_NO_SYNC - rc = SQLITE_OK; -#elif HAVE_FULLFSYNC - if( fullSync ){ - rc = fcntl(fd, F_FULLFSYNC, 0); - }else{ - rc = 1; - } - /* If the FULLFSYNC failed, fall back to attempting an fsync(). - ** It shouldn't be possible for fullfsync to fail on the local - ** file system (on OSX), so failure indicates that FULLFSYNC - ** isn't supported for this file system. So, attempt an fsync - ** and (for now) ignore the overhead of a superfluous fcntl call. - ** It'd be better to detect fullfsync support once and avoid - ** the fcntl call every time sync is called. - */ - if( rc ) rc = fsync(fd); - -#else - if( dataOnly ){ - rc = fdatasync(fd); -#if OS_VXWORKS - if( rc==-1 && errno==ENOTSUP ){ - rc = fsync(fd); - } -#endif - }else{ - rc = fsync(fd); - } -#endif /* ifdef SQLITE_NO_SYNC elif HAVE_FULLFSYNC */ - - if( OS_VXWORKS && rc!= -1 ){ - rc = 0; - } - return rc; -} - -/* -** Make sure all writes to a particular file are committed to disk. -** -** If dataOnly==0 then both the file itself and its metadata (file -** size, access time, etc) are synced. If dataOnly!=0 then only the -** file data is synced. -** -** Under Unix, also make sure that the directory entry for the file -** has been created by fsync-ing the directory that contains the file. -** If we do not do this and we encounter a power failure, the directory -** entry for the journal might not exist after we reboot. The next -** SQLite to access the file will not know that the journal exists (because -** the directory entry for the journal was never created) and the transaction -** will not roll back - possibly leading to database corruption. -*/ -static int unixSync(sqlite3_file *id, int flags){ - int rc; - unixFile *pFile = (unixFile*)id; - - int isDataOnly = (flags&SQLITE_SYNC_DATAONLY); - int isFullsync = (flags&0x0F)==SQLITE_SYNC_FULL; - - /* Check that one of SQLITE_SYNC_NORMAL or FULL was passed */ - assert((flags&0x0F)==SQLITE_SYNC_NORMAL - || (flags&0x0F)==SQLITE_SYNC_FULL - ); - - /* Unix cannot, but some systems may return SQLITE_FULL from here. This - ** line is to test that doing so does not cause any problems. - */ - SimulateDiskfullError( return SQLITE_FULL ); - - assert( pFile ); - OSTRACE2("SYNC %-3d\n", pFile->h); - rc = full_fsync(pFile->h, isFullsync, isDataOnly); - SimulateIOError( rc=1 ); - if( rc ){ - pFile->lastErrno = errno; - return SQLITE_IOERR_FSYNC; - } - if( pFile->dirfd>=0 ){ - int err; - OSTRACE4("DIRSYNC %-3d (have_fullfsync=%d fullsync=%d)\n", pFile->dirfd, - HAVE_FULLFSYNC, isFullsync); -#ifndef SQLITE_DISABLE_DIRSYNC - /* The directory sync is only attempted if full_fsync is - ** turned off or unavailable. If a full_fsync occurred above, - ** then the directory sync is superfluous. - */ - if( (!HAVE_FULLFSYNC || !isFullsync) && full_fsync(pFile->dirfd,0,0) ){ - /* - ** We have received multiple reports of fsync() returning - ** errors when applied to directories on certain file systems. - ** A failed directory sync is not a big deal. So it seems - ** better to ignore the error. Ticket #1657 - */ - /* pFile->lastErrno = errno; */ - /* return SQLITE_IOERR; */ - } -#endif - err = close(pFile->dirfd); /* Only need to sync once, so close the */ - if( err==0 ){ /* directory when we are done */ - pFile->dirfd = -1; - }else{ - pFile->lastErrno = errno; - rc = SQLITE_IOERR_DIR_CLOSE; - } - } - return rc; -} - -/* -** Truncate an open file to a specified size -*/ -static int unixTruncate(sqlite3_file *id, i64 nByte){ - int rc; - assert( id ); - SimulateIOError( return SQLITE_IOERR_TRUNCATE ); - rc = ftruncate(((unixFile*)id)->h, (off_t)nByte); - if( rc ){ - ((unixFile*)id)->lastErrno = errno; - return SQLITE_IOERR_TRUNCATE; - }else{ - return SQLITE_OK; - } -} - -/* -** Determine the current size of a file in bytes -*/ -static int unixFileSize(sqlite3_file *id, i64 *pSize){ - int rc; - struct stat buf; - assert( id ); - rc = fstat(((unixFile*)id)->h, &buf); - SimulateIOError( rc=1 ); - if( rc!=0 ){ - ((unixFile*)id)->lastErrno = errno; - return SQLITE_IOERR_FSTAT; - } - *pSize = buf.st_size; - - /* When opening a zero-size database, the findLockInfo() procedure - ** writes a single byte into that file in order to work around a bug - ** in the OS-X msdos filesystem. In order to avoid problems with upper - ** layers, we need to report this file size as zero even though it is - ** really 1. Ticket #3260. - */ - if( *pSize==1 ) *pSize = 0; - - - return SQLITE_OK; -} - -#if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__) -/* -** Handler for proxy-locking file-control verbs. Defined below in the -** proxying locking division. -*/ -static int proxyFileControl(sqlite3_file*,int,void*); -#endif +static int dotlockClose(sqlite3_file *id) { + if( id ){ + unixFile *pFile = (unixFile*)id; + dotlockUnlock(id, NO_LOCK); + sqlite3_free(pFile->lockingContext); + } + return closeUnixFile(id); +} + + +#endif /* SQLITE_ENABLE_LOCKING_STYLE */ + +/* +** The nolockLockingContext is void +*/ +typedef void nolockLockingContext; + +static int nolockCheckReservedLock(sqlite3_file *id, int *pResOut) { + *pResOut = 0; + return SQLITE_OK; +} + +static int nolockLock(sqlite3_file *id, int locktype) { + return SQLITE_OK; +} + +static int nolockUnlock(sqlite3_file *id, int locktype) { + return SQLITE_OK; +} + +/* +** Close a file. +*/ +static int nolockClose(sqlite3_file *id) { + return closeUnixFile(id); +} /* ** Information and control of an open file handle. */ @@ -3050,31 +2291,10 @@ switch( op ){ case SQLITE_FCNTL_LOCKSTATE: { *(int*)pArg = ((unixFile*)id)->locktype; return SQLITE_OK; } - case SQLITE_LAST_ERRNO: { - *(int*)pArg = ((unixFile*)id)->lastErrno; - return SQLITE_OK; - } -#ifndef NDEBUG - /* The pager calls this method to signal that it has done - ** a rollback and that the database is therefore unchanged and - ** it hence it is OK for the transaction change counter to be - ** unchanged. - */ - case SQLITE_FCNTL_DB_UNCHANGED: { - ((unixFile*)id)->dbUpdate = 0; - return SQLITE_OK; - } -#endif -#if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__) - case SQLITE_SET_LOCKPROXYFILE: - case SQLITE_GET_LOCKPROXYFILE: { - return proxyFileControl(id,op,pArg); - } -#endif /* SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__) */ } return SQLITE_ERROR; } /* @@ -3085,386 +2305,150 @@ ** SQLite code assumes this function cannot fail. It also assumes that ** if two files are created in the same file-system directory (i.e. ** a database and its journal file) that the sector size will be the ** same for both. */ -static int unixSectorSize(sqlite3_file *NotUsed){ - UNUSED_PARAMETER(NotUsed); +static int unixSectorSize(sqlite3_file *id){ return SQLITE_DEFAULT_SECTOR_SIZE; } /* -** Return the device characteristics for the file. This is always 0 for unix. +** Return the device characteristics for the file. This is always 0. */ -static int unixDeviceCharacteristics(sqlite3_file *NotUsed){ - UNUSED_PARAMETER(NotUsed); +static int unixDeviceCharacteristics(sqlite3_file *id){ return 0; } -/* -** Here ends the implementation of all sqlite3_file methods. -** -********************** End sqlite3_file Methods ******************************* -******************************************************************************/ - -/* -** This division contains definitions of sqlite3_io_methods objects that -** implement various file locking strategies. It also contains definitions -** of "finder" functions. A finder-function is used to locate the appropriate -** sqlite3_io_methods object for a particular database file. The pAppData -** field of the sqlite3_vfs VFS objects are initialized to be pointers to -** the correct finder-function for that VFS. -** -** Most finder functions return a pointer to a fixed sqlite3_io_methods -** object. The only interesting finder-function is autolockIoFinder, which -** looks at the filesystem type and tries to guess the best locking -** strategy from that. -** -** For finder-funtion F, two objects are created: -** -** (1) The real finder-function named "FImpt()". -** -** (2) A constant pointer to this functio named just "F". -** -** -** A pointer to the F pointer is used as the pAppData value for VFS -** objects. We have to do this instead of letting pAppData point -** directly at the finder-function since C90 rules prevent a void* -** from be cast into a function pointer. -** -** -** Each instance of this macro generates two objects: -** -** * A constant sqlite3_io_methods object call METHOD that has locking -** methods CLOSE, LOCK, UNLOCK, CKRESLOCK. -** -** * An I/O method finder function called FINDER that returns a pointer -** to the METHOD object in the previous bullet. -*/ -#define IOMETHODS(FINDER, METHOD, CLOSE, LOCK, UNLOCK, CKLOCK) \ -static const sqlite3_io_methods METHOD = { \ - 1, /* iVersion */ \ - CLOSE, /* xClose */ \ - unixRead, /* xRead */ \ - unixWrite, /* xWrite */ \ - unixTruncate, /* xTruncate */ \ - unixSync, /* xSync */ \ - unixFileSize, /* xFileSize */ \ - LOCK, /* xLock */ \ - UNLOCK, /* xUnlock */ \ - CKLOCK, /* xCheckReservedLock */ \ - unixFileControl, /* xFileControl */ \ - unixSectorSize, /* xSectorSize */ \ - unixDeviceCharacteristics /* xDeviceCapabilities */ \ -}; \ -static const sqlite3_io_methods *FINDER##Impl(const char *z, int h){ \ - UNUSED_PARAMETER(z); UNUSED_PARAMETER(h); \ - return &METHOD; \ -} \ -static const sqlite3_io_methods *(*const FINDER)(const char*,int) \ - = FINDER##Impl; - -/* -** Here are all of the sqlite3_io_methods objects for each of the -** locking strategies. Functions that return pointers to these methods -** are also created. -*/ -IOMETHODS( - posixIoFinder, /* Finder function name */ - posixIoMethods, /* sqlite3_io_methods object name */ - unixClose, /* xClose method */ - unixLock, /* xLock method */ - unixUnlock, /* xUnlock method */ - unixCheckReservedLock /* xCheckReservedLock method */ -) -IOMETHODS( - nolockIoFinder, /* Finder function name */ - nolockIoMethods, /* sqlite3_io_methods object name */ - nolockClose, /* xClose method */ - nolockLock, /* xLock method */ - nolockUnlock, /* xUnlock method */ - nolockCheckReservedLock /* xCheckReservedLock method */ -) -IOMETHODS( - dotlockIoFinder, /* Finder function name */ - dotlockIoMethods, /* sqlite3_io_methods object name */ - dotlockClose, /* xClose method */ - dotlockLock, /* xLock method */ - dotlockUnlock, /* xUnlock method */ - dotlockCheckReservedLock /* xCheckReservedLock method */ -) - -#if SQLITE_ENABLE_LOCKING_STYLE -IOMETHODS( - flockIoFinder, /* Finder function name */ - flockIoMethods, /* sqlite3_io_methods object name */ - flockClose, /* xClose method */ - flockLock, /* xLock method */ - flockUnlock, /* xUnlock method */ - flockCheckReservedLock /* xCheckReservedLock method */ -) -#endif - -#if OS_VXWORKS -IOMETHODS( - semIoFinder, /* Finder function name */ - semIoMethods, /* sqlite3_io_methods object name */ - semClose, /* xClose method */ - semLock, /* xLock method */ - semUnlock, /* xUnlock method */ - semCheckReservedLock /* xCheckReservedLock method */ -) -#endif - -#if defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE -IOMETHODS( - afpIoFinder, /* Finder function name */ - afpIoMethods, /* sqlite3_io_methods object name */ - afpClose, /* xClose method */ - afpLock, /* xLock method */ - afpUnlock, /* xUnlock method */ - afpCheckReservedLock /* xCheckReservedLock method */ -) -#endif - -/* -** The proxy locking method is a "super-method" in the sense that it -** opens secondary file descriptors for the conch and lock files and -** it uses proxy, dot-file, AFP, and flock() locking methods on those -** secondary files. For this reason, the division that implements -** proxy locking is located much further down in the file. But we need -** to go ahead and define the sqlite3_io_methods and finder function -** for proxy locking here. So we forward declare the I/O methods. -*/ -#if defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE -static int proxyClose(sqlite3_file*); -static int proxyLock(sqlite3_file*, int); -static int proxyUnlock(sqlite3_file*, int); -static int proxyCheckReservedLock(sqlite3_file*, int*); -IOMETHODS( - proxyIoFinder, /* Finder function name */ - proxyIoMethods, /* sqlite3_io_methods object name */ - proxyClose, /* xClose method */ - proxyLock, /* xLock method */ - proxyUnlock, /* xUnlock method */ - proxyCheckReservedLock /* xCheckReservedLock method */ -) -#endif - - -#if defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE -/* -** This "finder" function attempts to determine the best locking strategy -** for the database file "filePath". It then returns the sqlite3_io_methods -** object that implements that strategy. -** -** This is for MacOSX only. -*/ -static const sqlite3_io_methods *autolockIoFinderImpl( - const char *filePath, /* name of the database file */ - int fd /* file descriptor open on the database file */ -){ - static const struct Mapping { - const char *zFilesystem; /* Filesystem type name */ - const sqlite3_io_methods *pMethods; /* Appropriate locking method */ - } aMap[] = { - { "hfs", &posixIoMethods }, - { "ufs", &posixIoMethods }, - { "afpfs", &afpIoMethods }, -#ifdef SQLITE_ENABLE_AFP_LOCKING_SMB - { "smbfs", &afpIoMethods }, -#else - { "smbfs", &flockIoMethods }, -#endif - { "webdav", &nolockIoMethods }, - { 0, 0 } - }; - int i; - struct statfs fsInfo; - struct flock lockInfo; - - if( !filePath ){ - /* If filePath==NULL that means we are dealing with a transient file - ** that does not need to be locked. */ - return &nolockIoMethods; - } - if( statfs(filePath, &fsInfo) != -1 ){ - if( fsInfo.f_flags & MNT_RDONLY ){ - return &nolockIoMethods; - } - for(i=0; aMap[i].zFilesystem; i++){ - if( strcmp(fsInfo.f_fstypename, aMap[i].zFilesystem)==0 ){ - return aMap[i].pMethods; - } - } - } - - /* Default case. Handles, amongst others, "nfs". - ** Test byte-range lock using fcntl(). If the call succeeds, - ** assume that the file-system supports POSIX style locks. - */ - lockInfo.l_len = 1; - lockInfo.l_start = 0; - lockInfo.l_whence = SEEK_SET; - lockInfo.l_type = F_RDLCK; - if( fcntl(fd, F_GETLK, &lockInfo)!=-1 ) { - return &posixIoMethods; - }else{ - return &dotlockIoMethods; - } -} -static const sqlite3_io_methods *(*const autolockIoFinder)(const char*,int) - = autolockIoFinderImpl; - -#endif /* defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE */ - -/* -** An abstract type for a pointer to a IO method finder function: -*/ -typedef const sqlite3_io_methods *(*finder_type)(const char*,int); - - -/**************************************************************************** -**************************** sqlite3_vfs methods **************************** -** -** This division contains the implementation of methods on the -** sqlite3_vfs object. -*/ - /* ** Initialize the contents of the unixFile structure pointed to by pId. +** +** When locking extensions are enabled, the filepath and locking style +** are needed to determine the unixFile pMethod to use for locking operations. +** The locking-style specific lockingContext data structure is created +** and assigned here also. */ static int fillInUnixFile( sqlite3_vfs *pVfs, /* Pointer to vfs object */ int h, /* Open file descriptor of file being opened */ int dirfd, /* Directory file descriptor */ sqlite3_file *pId, /* Write to the unixFile structure here */ const char *zFilename, /* Name of the file being opened */ - int noLock, /* Omit locking if true */ - int isDelete /* Delete on close if true */ + int noLock /* Omit locking if true */ ){ - const sqlite3_io_methods *pLockingStyle; + int eLockingStyle; unixFile *pNew = (unixFile *)pId; int rc = SQLITE_OK; + /* Macro to define the static contents of an sqlite3_io_methods + ** structure for a unix backend file. Different locking methods + ** require different functions for the xClose, xLock, xUnlock and + ** xCheckReservedLock methods. + */ + #define IOMETHODS(xClose, xLock, xUnlock, xCheckReservedLock) { \ + 1, /* iVersion */ \ + xClose, /* xClose */ \ + unixRead, /* xRead */ \ + unixWrite, /* xWrite */ \ + unixTruncate, /* xTruncate */ \ + unixSync, /* xSync */ \ + unixFileSize, /* xFileSize */ \ + xLock, /* xLock */ \ + xUnlock, /* xUnlock */ \ + xCheckReservedLock, /* xCheckReservedLock */ \ + unixFileControl, /* xFileControl */ \ + unixSectorSize, /* xSectorSize */ \ + unixDeviceCharacteristics /* xDeviceCapabilities */ \ + } + static sqlite3_io_methods aIoMethod[] = { + IOMETHODS(unixClose, unixLock, unixUnlock, unixCheckReservedLock) + ,IOMETHODS(nolockClose, nolockLock, nolockUnlock, nolockCheckReservedLock) +#if SQLITE_ENABLE_LOCKING_STYLE + ,IOMETHODS(dotlockClose, dotlockLock, dotlockUnlock,dotlockCheckReservedLock) + ,IOMETHODS(flockClose, flockLock, flockUnlock, flockCheckReservedLock) + ,IOMETHODS(afpClose, afpLock, afpUnlock, afpCheckReservedLock) +#endif + }; + /* The order of the IOMETHODS macros above is important. It must be the + ** same order as the LOCKING_STYLE numbers + */ + assert(LOCKING_STYLE_POSIX==1); + assert(LOCKING_STYLE_NONE==2); + assert(LOCKING_STYLE_DOTFILE==3); + assert(LOCKING_STYLE_FLOCK==4); + assert(LOCKING_STYLE_AFP==5); + assert( pNew->pLock==NULL ); assert( pNew->pOpen==NULL ); - /* Parameter isDelete is only used on vxworks. - ** Express this explicitly here to prevent compiler warnings - ** about unused parameters. - */ -#if !OS_VXWORKS - UNUSED_PARAMETER(isDelete); -#endif - OSTRACE3("OPEN %-3d %s\n", h, zFilename); pNew->h = h; pNew->dirfd = dirfd; SET_THREADID(pNew); -#if OS_VXWORKS - pNew->pId = vxworksFindFileId(zFilename); - if( pNew->pId==0 ){ - noLock = 1; - rc = SQLITE_NOMEM; - } -#endif - if( noLock ){ - pLockingStyle = &nolockIoMethods; + eLockingStyle = LOCKING_STYLE_NONE; }else{ - pLockingStyle = (**(finder_type*)pVfs->pAppData)(zFilename, h); + eLockingStyle = detectLockingStyle(pVfs, zFilename, h); + } + + switch( eLockingStyle ){ + + case LOCKING_STYLE_POSIX: { + enterMutex(); + rc = findLockInfo(h, &pNew->pLock, &pNew->pOpen); + leaveMutex(); + break; + } + #if SQLITE_ENABLE_LOCKING_STYLE - /* Cache zFilename in the locking context (AFP and dotlock override) for - ** proxyLock activation is possible (remote proxy is based on db name) - ** zFilename remains valid until file is closed, to support */ - pNew->lockingContext = (void*)zFilename; -#endif - } - - if( pLockingStyle == &posixIoMethods ){ - unixEnterMutex(); - rc = findLockInfo(pNew, &pNew->pLock, &pNew->pOpen); - unixLeaveMutex(); - } - -#if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__) - else if( pLockingStyle == &afpIoMethods ){ - /* AFP locking uses the file path so it needs to be included in - ** the afpLockingContext. - */ - afpLockingContext *pCtx; - pNew->lockingContext = pCtx = sqlite3_malloc( sizeof(*pCtx) ); - if( pCtx==0 ){ - rc = SQLITE_NOMEM; - }else{ - /* NB: zFilename exists and remains valid until the file is closed - ** according to requirement F11141. So we do not need to make a - ** copy of the filename. */ - pCtx->dbPath = zFilename; - srandomdev(); - unixEnterMutex(); - rc = findLockInfo(pNew, NULL, &pNew->pOpen); - unixLeaveMutex(); - } - } -#endif - - else if( pLockingStyle == &dotlockIoMethods ){ - /* Dotfile locking uses the file path so it needs to be included in - ** the dotlockLockingContext - */ - char *zLockFile; - int nFilename; - nFilename = (int)strlen(zFilename) + 6; - zLockFile = (char *)sqlite3_malloc(nFilename); - if( zLockFile==0 ){ - rc = SQLITE_NOMEM; - }else{ - sqlite3_snprintf(nFilename, zLockFile, "%s" DOTLOCK_SUFFIX, zFilename); - } - pNew->lockingContext = zLockFile; - } - -#if OS_VXWORKS - else if( pLockingStyle == &semIoMethods ){ - /* Named semaphore locking uses the file path so it needs to be - ** included in the semLockingContext - */ - unixEnterMutex(); - rc = findLockInfo(pNew, &pNew->pLock, &pNew->pOpen); - if( (rc==SQLITE_OK) && (pNew->pOpen->pSem==NULL) ){ - char *zSemName = pNew->pOpen->aSemName; - int n; - sqlite3_snprintf(MAX_PATHNAME, zSemName, "%s.sem", - pNew->pId->zCanonicalName); - for( n=0; zSemName[n]; n++ ) - if( zSemName[n]=='/' ) zSemName[n] = '_'; - pNew->pOpen->pSem = sem_open(zSemName, O_CREAT, 0666, 1); - if( pNew->pOpen->pSem == SEM_FAILED ){ - rc = SQLITE_NOMEM; - pNew->pOpen->aSemName[0] = '\0'; - } - } - unixLeaveMutex(); - } -#endif + case LOCKING_STYLE_AFP: { + /* AFP locking uses the file path so it needs to be included in + ** the afpLockingContext. + */ + afpLockingContext *pCtx; + pNew->lockingContext = pCtx = sqlite3_malloc( sizeof(*pCtx) ); + if( pCtx==0 ){ + rc = SQLITE_NOMEM; + }else{ + /* NB: zFilename exists and remains valid until the file is closed + ** according to requirement F11141. So we do not need to make a + ** copy of the filename. */ + pCtx->filePath = zFilename; + srandomdev(); + } + break; + } + + case LOCKING_STYLE_DOTFILE: { + /* Dotfile locking uses the file path so it needs to be included in + ** the dotlockLockingContext + */ + char *zLockFile; + int nFilename; + nFilename = strlen(zFilename) + 6; + zLockFile = (char *)sqlite3_malloc(nFilename); + if( zLockFile==0 ){ + rc = SQLITE_NOMEM; + }else{ + sqlite3_snprintf(nFilename, zLockFile, "%s.lock", zFilename); + } + pNew->lockingContext = zLockFile; + break; + } + + case LOCKING_STYLE_FLOCK: + case LOCKING_STYLE_NONE: + break; +#endif + } pNew->lastErrno = 0; -#if OS_VXWORKS - if( rc!=SQLITE_OK ){ - unlink(zFilename); - isDelete = 0; - } - pNew->isDelete = isDelete; -#endif - if( rc!=SQLITE_OK ){ - if( dirfd>=0 ) close(dirfd); /* silent leak if fail, already in error */ + if( rc!=SQLITE_OK ){ + if( dirfd>=0 ) close(dirfd); close(h); }else{ - pNew->pMethod = pLockingStyle; + pNew->pMethod = &aIoMethod[eLockingStyle-1]; OpenCounter(+1); } return rc; } @@ -3482,11 +2466,11 @@ int ii; int fd = -1; char zDirname[MAX_PATHNAME+1]; sqlite3_snprintf(MAX_PATHNAME, zDirname, "%s", zFilename); - for(ii=(int)strlen(zDirname); ii>1 && zDirname[ii]!='/'; ii--); + for(ii=strlen(zDirname); ii>=0 && zDirname[ii]!='/'; ii--); if( ii>0 ){ zDirname[ii] = '\0'; fd = open(zDirname, O_RDONLY|O_BINARY, 0); if( fd>=0 ){ #ifdef FD_CLOEXEC @@ -3505,21 +2489,20 @@ ** pVfs->mxPathname bytes. */ static int getTempname(int nBuf, char *zBuf){ static const char *azDirs[] = { 0, - 0, "/var/tmp", "/usr/tmp", "/tmp", ".", }; static const unsigned char zChars[] = "abcdefghijklmnopqrstuvwxyz" "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "0123456789"; - unsigned int i, j; + int i, j; struct stat buf; const char *zDir = "."; /* It's odd to simulate an io-error here, but really this is just ** using the io-error infrastructure to test that SQLite handles this @@ -3526,14 +2509,10 @@ ** function failing. */ SimulateIOError( return SQLITE_IOERR ); azDirs[0] = sqlite3_temp_directory; - if (NULL == azDirs[1]) { - azDirs[1] = getenv("TMPDIR"); - } - for(i=0; i= (size_t)nBuf ){ + if( (strlen(zDir) + strlen(SQLITE_TEMP_FILE_PREFIX) + 17) >= nBuf ){ return SQLITE_ERROR; } do{ sqlite3_snprintf(nBuf-17, zBuf, "%s/"SQLITE_TEMP_FILE_PREFIX, zDir); - j = (int)strlen(zBuf); + j = strlen(zBuf); sqlite3_randomness(15, &zBuf[j]); for(i=0; i<15; i++, j++){ zBuf[j] = (char)zChars[ ((unsigned char)zBuf[j])%(sizeof(zChars)-1) ]; } zBuf[j] = 0; }while( access(zBuf,0)==0 ); return SQLITE_OK; } -#if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__) -/* -** Routine to transform a unixFile into a proxy-locking unixFile. -** Implementation in the proxy-lock division, but used by unixOpen() -** if SQLITE_PREFER_PROXY_LOCKING is defined. -*/ -static int proxyTransformUnixFile(unixFile*, const char*); -#endif - /* ** Open the file zPath. ** ** Previously, the SQLite OS layer used three functions in place of this @@ -3591,22 +2561,21 @@ ** file handle closed. To achieve the same effect using this new ** interface, add the DELETEONCLOSE flag to those specified above for ** OpenExclusive(). */ static int unixOpen( - sqlite3_vfs *pVfs, /* The VFS for which this is the xOpen method */ - const char *zPath, /* Pathname of file to be opened */ - sqlite3_file *pFile, /* The file descriptor to be filled in */ - int flags, /* Input flags to control the opening */ - int *pOutFlags /* Output flags returned to SQLite core */ + sqlite3_vfs *pVfs, + const char *zPath, + sqlite3_file *pFile, + int flags, + int *pOutFlags ){ int fd = 0; /* File descriptor returned by open() */ int dirfd = -1; /* Directory file descriptor */ - int openFlags = 0; /* Flags to pass to open() */ + int oflags = 0; /* Flags to pass to open() */ int eType = flags&0xFFFFFF00; /* Type of file to open */ int noLock; /* True to omit locking primitives */ - int rc = SQLITE_OK; int isExclusive = (flags & SQLITE_OPEN_EXCLUSIVE); int isDelete = (flags & SQLITE_OPEN_DELETEONCLOSE); int isCreate = (flags & SQLITE_OPEN_CREATE); int isReadonly = (flags & SQLITE_OPEN_READONLY); @@ -3653,26 +2622,26 @@ ); memset(pFile, 0, sizeof(unixFile)); if( !zName ){ + int rc; assert(isDelete && !isOpenDirectory); rc = getTempname(MAX_PATHNAME+1, zTmpname); if( rc!=SQLITE_OK ){ return rc; } zName = zTmpname; } - if( isReadonly ) openFlags |= O_RDONLY; - if( isReadWrite ) openFlags |= O_RDWR; - if( isCreate ) openFlags |= O_CREAT; - if( isExclusive ) openFlags |= (O_EXCL|O_NOFOLLOW); - openFlags |= (O_LARGEFILE|O_BINARY); - - fd = open(zName, openFlags, isDelete?0600:SQLITE_DEFAULT_FILE_PERMISSIONS); - OSTRACE4("OPENX %-3d %s 0%o\n", fd, zName, openFlags); + if( isReadonly ) oflags |= O_RDONLY; + if( isReadWrite ) oflags |= O_RDWR; + if( isCreate ) oflags |= O_CREAT; + if( isExclusive ) oflags |= (O_EXCL|O_NOFOLLOW); + oflags |= (O_LARGEFILE|O_BINARY); + + fd = open(zName, oflags, isDelete?0600:SQLITE_DEFAULT_FILE_PERMISSIONS); if( fd<0 && errno!=EISDIR && isReadWrite && !isExclusive ){ /* Failed to open the file for read/write access. Try read-only. */ flags &= ~(SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE); flags |= SQLITE_OPEN_READONLY; return unixOpen(pVfs, zPath, pFile, flags, pOutFlags); @@ -3679,112 +2648,51 @@ } if( fd<0 ){ return SQLITE_CANTOPEN; } if( isDelete ){ -#if OS_VXWORKS - zPath = zName; -#else unlink(zName); -#endif } -#if SQLITE_ENABLE_LOCKING_STYLE - else{ - ((unixFile*)pFile)->openFlags = openFlags; - } -#endif if( pOutFlags ){ *pOutFlags = flags; } -#ifndef NDEBUG - if( (flags & SQLITE_OPEN_MAIN_DB)!=0 ){ - ((unixFile*)pFile)->isLockable = 1; - } -#endif - assert(fd!=0); if( isOpenDirectory ){ - rc = openDirectory(zPath, &dirfd); + int rc = openDirectory(zPath, &dirfd); if( rc!=SQLITE_OK ){ - close(fd); /* silently leak if fail, already in error */ + close(fd); return rc; } } #ifdef FD_CLOEXEC fcntl(fd, F_SETFD, fcntl(fd, F_GETFD, 0) | FD_CLOEXEC); #endif noLock = eType!=SQLITE_OPEN_MAIN_DB; - -#if SQLITE_PREFER_PROXY_LOCKING - if( zPath!=NULL && !noLock ){ - char *envforce = getenv("SQLITE_FORCE_PROXY_LOCKING"); - int useProxy = 0; - - /* SQLITE_FORCE_PROXY_LOCKING==1 means force always use proxy, - ** 0 means never use proxy, NULL means use proxy for non-local files only - */ - if( envforce!=NULL ){ - useProxy = atoi(envforce)>0; - }else{ - struct statfs fsInfo; - - if( statfs(zPath, &fsInfo) == -1 ){ - ((unixFile*)pFile)->lastErrno = errno; - if( dirfd>=0 ) close(dirfd); /* silently leak if fail, in error */ - close(fd); /* silently leak if fail, in error */ - return SQLITE_IOERR_ACCESS; - } - useProxy = !(fsInfo.f_flags&MNT_LOCAL); - } - if( useProxy ){ - rc = fillInUnixFile(pVfs, fd, dirfd, pFile, zPath, noLock, isDelete); - if( rc==SQLITE_OK ){ - rc = proxyTransformUnixFile((unixFile*)pFile, ":auto:"); - } - return rc; - } - } -#endif - - return fillInUnixFile(pVfs, fd, dirfd, pFile, zPath, noLock, isDelete); + return fillInUnixFile(pVfs, fd, dirfd, pFile, zPath, noLock); } /* ** Delete the file at zPath. If the dirSync argument is true, fsync() ** the directory after deleting the file. */ -static int unixDelete( - sqlite3_vfs *NotUsed, /* VFS containing this as the xDelete method */ - const char *zPath, /* Name of file to be deleted */ - int dirSync /* If true, fsync() directory after deleting file */ -){ +static int unixDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){ int rc = SQLITE_OK; - UNUSED_PARAMETER(NotUsed); SimulateIOError(return SQLITE_IOERR_DELETE); unlink(zPath); -#ifndef SQLITE_DISABLE_DIRSYNC if( dirSync ){ int fd; rc = openDirectory(zPath, &fd); if( rc==SQLITE_OK ){ -#if OS_VXWORKS - if( fsync(fd)==-1 ) -#else - if( fsync(fd) ) -#endif - { + if( fsync(fd) ){ rc = SQLITE_IOERR_DIR_FSYNC; } - if( close(fd)&&!rc ){ - rc = SQLITE_IOERR_DIR_CLOSE; - } + close(fd); } } -#endif return rc; } /* ** Test the existance of or access permissions of file zPath. The @@ -3795,17 +2703,16 @@ ** SQLITE_ACCESS_READONLY: Return 1 if the file is readable. ** ** Otherwise return 0. */ static int unixAccess( - sqlite3_vfs *NotUsed, /* The VFS containing this xAccess method */ - const char *zPath, /* Path of the file to examine */ - int flags, /* What do we want to learn about the zPath file? */ - int *pResOut /* Write result boolean here */ + sqlite3_vfs *pVfs, + const char *zPath, + int flags, + int *pResOut ){ int amode = 0; - UNUSED_PARAMETER(NotUsed); SimulateIOError( return SQLITE_IOERR_ACCESS; ); switch( flags ){ case SQLITE_ACCESS_EXISTS: amode = F_OK; break; @@ -3841,40 +2748,63 @@ ){ /* It's odd to simulate an io-error here, but really this is just ** using the io-error infrastructure to test that SQLite handles this ** function failing. This function could fail if, for example, the - ** current working directory has been unlinked. + ** current working directly has been unlinked. */ SimulateIOError( return SQLITE_ERROR ); assert( pVfs->mxPathname==MAX_PATHNAME ); - UNUSED_PARAMETER(pVfs); - zOut[nOut-1] = '\0'; if( zPath[0]=='/' ){ sqlite3_snprintf(nOut, zOut, "%s", zPath); }else{ int nCwd; if( getcwd(zOut, nOut-1)==0 ){ return SQLITE_CANTOPEN; } - nCwd = (int)strlen(zOut); + nCwd = strlen(zOut); sqlite3_snprintf(nOut-nCwd, &zOut[nCwd], "/%s", zPath); } return SQLITE_OK; + +#if 0 + /* + ** Remove "/./" path elements and convert "/A/./" path elements + ** to just "/". + */ + if( zFull ){ + int i, j; + for(i=j=0; zFull[i]; i++){ + if( zFull[i]=='/' ){ + if( zFull[i+1]=='/' ) continue; + if( zFull[i+1]=='.' && zFull[i+2]=='/' ){ + i += 1; + continue; + } + if( zFull[i+1]=='.' && zFull[i+2]=='.' && zFull[i+3]=='/' ){ + while( j>0 && zFull[j-1]!='/' ){ j--; } + i += 3; + continue; + } + } + zFull[j++] = zFull[i]; + } + zFull[j] = 0; + } +#endif } #ifndef SQLITE_OMIT_LOAD_EXTENSION /* ** Interfaces for opening a shared library, finding entry points ** within the shared library, and closing the shared library. */ #include -static void *unixDlOpen(sqlite3_vfs *NotUsed, const char *zFilename){ - UNUSED_PARAMETER(NotUsed); +static void *unixDlOpen(sqlite3_vfs *pVfs, const char *zFilename){ return dlopen(zFilename, RTLD_NOW | RTLD_GLOBAL); } /* ** SQLite calls this function immediately after a call to unixDlSym() or @@ -3881,45 +2811,23 @@ ** unixDlOpen() fails (returns a null pointer). If a more detailed error ** message is available, it is written to zBufOut. If no error message ** is available, zBufOut is left unmodified and SQLite uses a default ** error message. */ -static void unixDlError(sqlite3_vfs *NotUsed, int nBuf, char *zBufOut){ +static void unixDlError(sqlite3_vfs *pVfs, int nBuf, char *zBufOut){ char *zErr; - UNUSED_PARAMETER(NotUsed); - unixEnterMutex(); + enterMutex(); zErr = dlerror(); if( zErr ){ sqlite3_snprintf(nBuf, zBufOut, "%s", zErr); } - unixLeaveMutex(); -} -static void (*unixDlSym(sqlite3_vfs *NotUsed, void *p, const char*zSym))(void){ - /* - ** GCC with -pedantic-errors says that C90 does not allow a void* to be - ** cast into a pointer to a function. And yet the library dlsym() routine - ** returns a void* which is really a pointer to a function. So how do we - ** use dlsym() with -pedantic-errors? - ** - ** Variable x below is defined to be a pointer to a function taking - ** parameters void* and const char* and returning a pointer to a function. - ** We initialize x by assigning it a pointer to the dlsym() function. - ** (That assignment requires a cast.) Then we call the function that - ** x points to. - ** - ** This work-around is unlikely to work correctly on any system where - ** you really cannot cast a function pointer into void*. But then, on the - ** other hand, dlsym() will not work on such a system either, so we have - ** not really lost anything. - */ - void (*(*x)(void*,const char*))(void); - UNUSED_PARAMETER(NotUsed); - x = (void(*(*)(void*,const char*))(void))dlsym; - return (*x)(p, zSym); -} -static void unixDlClose(sqlite3_vfs *NotUsed, void *pHandle){ - UNUSED_PARAMETER(NotUsed); + leaveMutex(); +} +static void *unixDlSym(sqlite3_vfs *pVfs, void *pHandle, const char *zSymbol){ + return dlsym(pHandle, zSymbol); +} +static void unixDlClose(sqlite3_vfs *pVfs, void *pHandle){ dlclose(pHandle); } #else /* if SQLITE_OMIT_LOAD_EXTENSION is defined: */ #define unixDlOpen 0 #define unixDlError 0 @@ -3928,13 +2836,13 @@ #endif /* ** Write nBuf bytes of random data to the supplied buffer zBuf. */ -static int unixRandomness(sqlite3_vfs *NotUsed, int nBuf, char *zBuf){ - UNUSED_PARAMETER(NotUsed); - assert((size_t)nBuf>=(sizeof(time_t)+sizeof(int))); +static int unixRandomness(sqlite3_vfs *pVfs, int nBuf, char *zBuf){ + + assert(nBuf>=(sizeof(time_t)+sizeof(int))); /* We have to initialize zBuf to prevent valgrind from reporting ** errors. The reports issued by valgrind are incorrect - we would ** prefer that the randomness be increased by making use of the ** uninitialized space in zBuf - but valgrind errors tend to worry @@ -3955,11 +2863,11 @@ time_t t; time(&t); memcpy(zBuf, &t, sizeof(t)); pid = getpid(); memcpy(&zBuf[sizeof(t)], &pid, sizeof(pid)); - assert( sizeof(t)+sizeof(pid)<=(size_t)nBuf ); + assert( sizeof(t)+sizeof(pid)<=nBuf ); nBuf = sizeof(t) + sizeof(pid); }else{ nBuf = read(fd, zBuf, nBuf); close(fd); } @@ -3975,1056 +2883,72 @@ ** The return value is the number of microseconds of sleep actually ** requested from the underlying operating system, a number which ** might be greater than or equal to the argument, but not less ** than the argument. */ -static int unixSleep(sqlite3_vfs *NotUsed, int microseconds){ -#if OS_VXWORKS - struct timespec sp; - - sp.tv_sec = microseconds / 1000000; - sp.tv_nsec = (microseconds % 1000000) * 1000; - nanosleep(&sp, NULL); - return microseconds; -#elif defined(HAVE_USLEEP) && HAVE_USLEEP +static int unixSleep(sqlite3_vfs *pVfs, int microseconds){ +#if defined(HAVE_USLEEP) && HAVE_USLEEP usleep(microseconds); return microseconds; #else int seconds = (microseconds+999999)/1000000; sleep(seconds); return seconds*1000000; #endif - UNUSED_PARAMETER(NotUsed); } /* -** The following variable, if set to a non-zero value, is interpreted as -** the number of seconds since 1970 and is used to set the result of -** sqlite3OsCurrentTime() during testing. +** The following variable, if set to a non-zero value, becomes the result +** returned from sqlite3OsCurrentTime(). This is used for testing. */ #ifdef SQLITE_TEST -int sqlite3_current_time = 0; /* Fake system time in seconds since 1970. */ +int sqlite3_current_time = 0; #endif /* ** Find the current time (in Universal Coordinated Time). Write the ** current time and date as a Julian Day number into *prNow and ** return 0. Return 1 if the time and date cannot be found. */ -static int unixCurrentTime(sqlite3_vfs *NotUsed, double *prNow){ -#if defined(NO_GETTOD) +static int unixCurrentTime(sqlite3_vfs *pVfs, double *prNow){ +#ifdef NO_GETTOD time_t t; time(&t); *prNow = t/86400.0 + 2440587.5; -#elif OS_VXWORKS - struct timespec sNow; - clock_gettime(CLOCK_REALTIME, &sNow); - *prNow = 2440587.5 + sNow.tv_sec/86400.0 + sNow.tv_nsec/86400000000000.0; #else struct timeval sNow; gettimeofday(&sNow, 0); *prNow = 2440587.5 + sNow.tv_sec/86400.0 + sNow.tv_usec/86400000000.0; #endif - #ifdef SQLITE_TEST if( sqlite3_current_time ){ *prNow = sqlite3_current_time/86400.0 + 2440587.5; } #endif - UNUSED_PARAMETER(NotUsed); - return 0; -} - -/* -** We added the xGetLastError() method with the intention of providing -** better low-level error messages when operating-system problems come up -** during SQLite operation. But so far, none of that has been implemented -** in the core. So this routine is never called. For now, it is merely -** a place-holder. -*/ -static int unixGetLastError(sqlite3_vfs *NotUsed, int NotUsed2, char *NotUsed3){ - UNUSED_PARAMETER(NotUsed); - UNUSED_PARAMETER(NotUsed2); - UNUSED_PARAMETER(NotUsed3); - return 0; -} - -/* -************************ End of sqlite3_vfs methods *************************** -******************************************************************************/ - -/****************************************************************************** -************************** Begin Proxy Locking ******************************** -** -** Proxy locking is a "uber-locking-method" in this sense: It uses the -** other locking methods on secondary lock files. Proxy locking is a -** meta-layer over top of the primitive locking implemented above. For -** this reason, the division that implements of proxy locking is deferred -** until late in the file (here) after all of the other I/O methods have -** been defined - so that the primitive locking methods are available -** as services to help with the implementation of proxy locking. -** -**** -** -** The default locking schemes in SQLite use byte-range locks on the -** database file to coordinate safe, concurrent access by multiple readers -** and writers [http://sqlite.org/lockingv3.html]. The five file locking -** states (UNLOCKED, PENDING, SHARED, RESERVED, EXCLUSIVE) are implemented -** as POSIX read & write locks over fixed set of locations (via fsctl), -** on AFP and SMB only exclusive byte-range locks are available via fsctl -** with _IOWR('z', 23, struct ByteRangeLockPB2) to track the same 5 states. -** To simulate a F_RDLCK on the shared range, on AFP a randomly selected -** address in the shared range is taken for a SHARED lock, the entire -** shared range is taken for an EXCLUSIVE lock): -** -** PENDING_BYTE 0x40000000 -** RESERVED_BYTE 0x40000001 -** SHARED_RANGE 0x40000002 -> 0x40000200 -** -** This works well on the local file system, but shows a nearly 100x -** slowdown in read performance on AFP because the AFP client disables -** the read cache when byte-range locks are present. Enabling the read -** cache exposes a cache coherency problem that is present on all OS X -** supported network file systems. NFS and AFP both observe the -** close-to-open semantics for ensuring cache coherency -** [http://nfs.sourceforge.net/#faq_a8], which does not effectively -** address the requirements for concurrent database access by multiple -** readers and writers -** [http://www.nabble.com/SQLite-on-NFS-cache-coherency-td15655701.html]. -** -** To address the performance and cache coherency issues, proxy file locking -** changes the way database access is controlled by limiting access to a -** single host at a time and moving file locks off of the database file -** and onto a proxy file on the local file system. -** -** -** Using proxy locks -** ----------------- -** -** C APIs -** -** sqlite3_file_control(db, dbname, SQLITE_SET_LOCKPROXYFILE, -** | ":auto:"); -** sqlite3_file_control(db, dbname, SQLITE_GET_LOCKPROXYFILE, &); -** -** -** SQL pragmas -** -** PRAGMA [database.]lock_proxy_file= | :auto: -** PRAGMA [database.]lock_proxy_file -** -** Specifying ":auto:" means that if there is a conch file with a matching -** host ID in it, the proxy path in the conch file will be used, otherwise -** a proxy path based on the user's temp dir -** (via confstr(_CS_DARWIN_USER_TEMP_DIR,...)) will be used and the -** actual proxy file name is generated from the name and path of the -** database file. For example: -** -** For database path "/Users/me/foo.db" -** The lock path will be "/sqliteplocks/_Users_me_foo.db:auto:") -** -** Once a lock proxy is configured for a database connection, it can not -** be removed, however it may be switched to a different proxy path via -** the above APIs (assuming the conch file is not being held by another -** connection or process). -** -** -** How proxy locking works -** ----------------------- -** -** Proxy file locking relies primarily on two new supporting files: -** -** * conch file to limit access to the database file to a single host -** at a time -** -** * proxy file to act as a proxy for the advisory locks normally -** taken on the database -** -** The conch file - to use a proxy file, sqlite must first "hold the conch" -** by taking an sqlite-style shared lock on the conch file, reading the -** contents and comparing the host's unique host ID (see below) and lock -** proxy path against the values stored in the conch. The conch file is -** stored in the same directory as the database file and the file name -** is patterned after the database file name as ".-conch". -** If the conch file does not exist, or it's contents do not match the -** host ID and/or proxy path, then the lock is escalated to an exclusive -** lock and the conch file contents is updated with the host ID and proxy -** path and the lock is downgraded to a shared lock again. If the conch -** is held by another process (with a shared lock), the exclusive lock -** will fail and SQLITE_BUSY is returned. -** -** The proxy file - a single-byte file used for all advisory file locks -** normally taken on the database file. This allows for safe sharing -** of the database file for multiple readers and writers on the same -** host (the conch ensures that they all use the same local lock file). -** -** There is a third file - the host ID file - used as a persistent record -** of a unique identifier for the host, a 128-byte unique host id file -** in the path defined by the HOSTIDPATH macro (default value is -** /Library/Caches/.com.apple.sqliteConchHostId). -** -** Requesting the lock proxy does not immediately take the conch, it is -** only taken when the first request to lock database file is made. -** This matches the semantics of the traditional locking behavior, where -** opening a connection to a database file does not take a lock on it. -** The shared lock and an open file descriptor are maintained until -** the connection to the database is closed. -** -** The proxy file and the lock file are never deleted so they only need -** to be created the first time they are used. -** -** Configuration options -** --------------------- -** -** SQLITE_PREFER_PROXY_LOCKING -** -** Database files accessed on non-local file systems are -** automatically configured for proxy locking, lock files are -** named automatically using the same logic as -** PRAGMA lock_proxy_file=":auto:" -** -** SQLITE_PROXY_DEBUG -** -** Enables the logging of error messages during host id file -** retrieval and creation -** -** HOSTIDPATH -** -** Overrides the default host ID file path location -** -** LOCKPROXYDIR -** -** Overrides the default directory used for lock proxy files that -** are named automatically via the ":auto:" setting -** -** SQLITE_DEFAULT_PROXYDIR_PERMISSIONS -** -** Permissions to use when creating a directory for storing the -** lock proxy files, only used when LOCKPROXYDIR is not set. -** -** -** As mentioned above, when compiled with SQLITE_PREFER_PROXY_LOCKING, -** setting the environment variable SQLITE_FORCE_PROXY_LOCKING to 1 will -** force proxy locking to be used for every database file opened, and 0 -** will force automatic proxy locking to be disabled for all database -** files (explicity calling the SQLITE_SET_LOCKPROXYFILE pragma or -** sqlite_file_control API is not affected by SQLITE_FORCE_PROXY_LOCKING). -*/ - -/* -** Proxy locking is only available on MacOSX -*/ -#if defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE - -#ifdef SQLITE_TEST -/* simulate multiple hosts by creating unique hostid file paths */ -int sqlite3_hostid_num = 0; -#endif - -/* -** The proxyLockingContext has the path and file structures for the remote -** and local proxy files in it -*/ -typedef struct proxyLockingContext proxyLockingContext; -struct proxyLockingContext { - unixFile *conchFile; /* Open conch file */ - char *conchFilePath; /* Name of the conch file */ - unixFile *lockProxy; /* Open proxy lock file */ - char *lockProxyPath; /* Name of the proxy lock file */ - char *dbPath; /* Name of the open file */ - int conchHeld; /* True if the conch is currently held */ - void *oldLockingContext; /* Original lockingcontext to restore on close */ - sqlite3_io_methods const *pOldMethod; /* Original I/O methods for close */ -}; - -/* HOSTIDLEN and CONCHLEN both include space for the string -** terminating nul -*/ -#define HOSTIDLEN 128 -#define CONCHLEN (MAXPATHLEN+HOSTIDLEN+1) -#ifndef HOSTIDPATH -# define HOSTIDPATH "/Library/Caches/.com.apple.sqliteConchHostId" -#endif - -/* basically a copy of unixRandomness with different -** test behavior built in */ -static int proxyGenerateHostID(char *pHostID){ - int pid, fd, len; - unsigned char *key = (unsigned char *)pHostID; - - memset(key, 0, HOSTIDLEN); - len = 0; - fd = open("/dev/urandom", O_RDONLY); - if( fd>=0 ){ - len = read(fd, key, HOSTIDLEN); - close(fd); /* silently leak the fd if it fails */ - } - if( len < HOSTIDLEN ){ - time_t t; - time(&t); - memcpy(key, &t, sizeof(t)); - pid = getpid(); - memcpy(&key[sizeof(t)], &pid, sizeof(pid)); - } - -#ifdef MAKE_PRETTY_HOSTID - { - int i; - /* filter the bytes into printable ascii characters and NUL terminate */ - key[(HOSTIDLEN-1)] = 0x00; - for( i=0; i<(HOSTIDLEN-1); i++ ){ - unsigned char pa = key[i]&0x7F; - if( pa<0x20 ){ - key[i] = (key[i]&0x80 == 0x80) ? pa+0x40 : pa+0x20; - }else if( pa==0x7F ){ - key[i] = (key[i]&0x80 == 0x80) ? pa=0x20 : pa+0x7E; - } - } - } -#endif - return SQLITE_OK; -} - -/* writes the host id path to path, path should be an pre-allocated buffer -** with enough space for a path -*/ -static void proxyGetHostIDPath(char *path, size_t len){ - strlcpy(path, HOSTIDPATH, len); -#ifdef SQLITE_TEST - if( sqlite3_hostid_num>0 ){ - char suffix[2] = "1"; - suffix[0] = suffix[0] + sqlite3_hostid_num; - strlcat(path, suffix, len); - } -#endif - OSTRACE3("GETHOSTIDPATH %s pid=%d\n", path, getpid()); -} - -/* get the host ID from a sqlite hostid file stored in the -** user-specific tmp directory, create the ID if it's not there already -*/ -static int proxyGetHostID(char *pHostID, int *pError){ - int fd; - char path[MAXPATHLEN]; - size_t len; - int rc=SQLITE_OK; - - proxyGetHostIDPath(path, MAXPATHLEN); - /* try to create the host ID file, if it already exists read the contents */ - fd = open(path, O_CREAT|O_WRONLY|O_EXCL, 0644); - if( fd<0 ){ - int err=errno; - - if( err!=EEXIST ){ -#ifdef SQLITE_PROXY_DEBUG /* set the sqlite error message instead */ - fprintf(stderr, "sqlite error creating host ID file %s: %s\n", - path, strerror(err)); -#endif - return SQLITE_PERM; - } - /* couldn't create the file, read it instead */ - fd = open(path, O_RDONLY|O_EXCL); - if( fd<0 ){ -#ifdef SQLITE_PROXY_DEBUG /* set the sqlite error message instead */ - int err = errno; - fprintf(stderr, "sqlite error opening host ID file %s: %s\n", - path, strerror(err)); -#endif - return SQLITE_PERM; - } - len = pread(fd, pHostID, HOSTIDLEN, 0); - if( len<0 ){ - *pError = errno; - rc = SQLITE_IOERR_READ; - }else if( lenlockingContext; - - if( pCtx->conchHeld>0 ){ - return SQLITE_OK; - }else{ - unixFile *conchFile = pCtx->conchFile; - char testValue[CONCHLEN]; - char conchValue[CONCHLEN]; - char lockPath[MAXPATHLEN]; - char *tLockPath = NULL; - int rc = SQLITE_OK; - int readRc = SQLITE_OK; - int syncPerms = 0; - - OSTRACE4("TAKECONCH %d for %s pid=%d\n", conchFile->h, - (pCtx->lockProxyPath ? pCtx->lockProxyPath : ":auto:"), getpid()); - - rc = conchFile->pMethod->xLock((sqlite3_file*)conchFile, SHARED_LOCK); - if( rc==SQLITE_OK ){ - int pError = 0; - memset(testValue, 0, CONCHLEN); /* conch is fixed size */ - rc = proxyGetHostID(testValue, &pError); - if( (rc&0xff)==SQLITE_IOERR ){ - pFile->lastErrno = pError; - } - if( pCtx->lockProxyPath ){ - strlcpy(&testValue[HOSTIDLEN], pCtx->lockProxyPath, MAXPATHLEN); - } - } - if( rc!=SQLITE_OK ){ - goto end_takeconch; - } - - readRc = unixRead((sqlite3_file *)conchFile, conchValue, CONCHLEN, 0); - if( readRc!=SQLITE_IOERR_SHORT_READ ){ - if( readRc!=SQLITE_OK ){ - if( (rc&0xff)==SQLITE_IOERR ){ - pFile->lastErrno = conchFile->lastErrno; - } - rc = readRc; - goto end_takeconch; - } - /* if the conch has data compare the contents */ - if( !pCtx->lockProxyPath ){ - /* for auto-named local lock file, just check the host ID and we'll - ** use the local lock file path that's already in there */ - if( !memcmp(testValue, conchValue, HOSTIDLEN) ){ - tLockPath = (char *)&conchValue[HOSTIDLEN]; - goto end_takeconch; - } - }else{ - /* we've got the conch if conchValue matches our path and host ID */ - if( !memcmp(testValue, conchValue, CONCHLEN) ){ - goto end_takeconch; - } - } - }else{ - /* a short read means we're "creating" the conch (even though it could - ** have been user-intervention), if we acquire the exclusive lock, - ** we'll try to match the current on-disk permissions of the database - */ - syncPerms = 1; - } - - /* either conch was emtpy or didn't match */ - if( !pCtx->lockProxyPath ){ - proxyGetLockPath(pCtx->dbPath, lockPath, MAXPATHLEN); - tLockPath = lockPath; - strlcpy(&testValue[HOSTIDLEN], lockPath, MAXPATHLEN); - } - - /* update conch with host and path (this will fail if other process - ** has a shared lock already) */ - rc = conchFile->pMethod->xLock((sqlite3_file*)conchFile, EXCLUSIVE_LOCK); - if( rc==SQLITE_OK ){ - rc = unixWrite((sqlite3_file *)conchFile, testValue, CONCHLEN, 0); - if( rc==SQLITE_OK && syncPerms ){ - struct stat buf; - int err = fstat(pFile->h, &buf); - if( err==0 ){ - /* try to match the database file permissions, ignore failure */ -#ifndef SQLITE_PROXY_DEBUG - fchmod(conchFile->h, buf.st_mode); -#else - if( fchmod(conchFile->h, buf.st_mode)!=0 ){ - int code = errno; - fprintf(stderr, "fchmod %o FAILED with %d %s\n", - buf.st_mode, code, strerror(code)); - } else { - fprintf(stderr, "fchmod %o SUCCEDED\n",buf.st_mode); - } - }else{ - int code = errno; - fprintf(stderr, "STAT FAILED[%d] with %d %s\n", - err, code, strerror(code)); -#endif - } - } - } - conchFile->pMethod->xUnlock((sqlite3_file*)conchFile, SHARED_LOCK); - -end_takeconch: - OSTRACE2("TRANSPROXY: CLOSE %d\n", pFile->h); - if( rc==SQLITE_OK && pFile->openFlags ){ - if( pFile->h>=0 ){ -#ifdef STRICT_CLOSE_ERROR - if( close(pFile->h) ){ - pFile->lastErrno = errno; - return SQLITE_IOERR_CLOSE; - } -#else - close(pFile->h); /* silently leak fd if fail */ -#endif - } - pFile->h = -1; - int fd = open(pCtx->dbPath, pFile->openFlags, - SQLITE_DEFAULT_FILE_PERMISSIONS); - OSTRACE2("TRANSPROXY: OPEN %d\n", fd); - if( fd>=0 ){ - pFile->h = fd; - }else{ - rc=SQLITE_CANTOPEN; /* SQLITE_BUSY? proxyTakeConch called - during locking */ - } - } - if( rc==SQLITE_OK && !pCtx->lockProxy ){ - char *path = tLockPath ? tLockPath : pCtx->lockProxyPath; - /* ACS: Need to make a copy of path sometimes */ - rc = proxyCreateUnixFile(path, &pCtx->lockProxy); - } - if( rc==SQLITE_OK ){ - pCtx->conchHeld = 1; - - if( tLockPath ){ - pCtx->lockProxyPath = sqlite3DbStrDup(0, tLockPath); - if( pCtx->lockProxy->pMethod == &afpIoMethods ){ - ((afpLockingContext *)pCtx->lockProxy->lockingContext)->dbPath = - pCtx->lockProxyPath; - } - } - } else { - conchFile->pMethod->xUnlock((sqlite3_file*)conchFile, NO_LOCK); - } - OSTRACE3("TAKECONCH %d %s\n", conchFile->h, rc==SQLITE_OK?"ok":"failed"); - return rc; - } -} - -/* -** If pFile holds a lock on a conch file, then release that lock. -*/ -static int proxyReleaseConch(unixFile *pFile){ - int rc; /* Subroutine return code */ - proxyLockingContext *pCtx; /* The locking context for the proxy lock */ - unixFile *conchFile; /* Name of the conch file */ - - pCtx = (proxyLockingContext *)pFile->lockingContext; - conchFile = pCtx->conchFile; - OSTRACE4("RELEASECONCH %d for %s pid=%d\n", conchFile->h, - (pCtx->lockProxyPath ? pCtx->lockProxyPath : ":auto:"), - getpid()); - pCtx->conchHeld = 0; - rc = conchFile->pMethod->xUnlock((sqlite3_file*)conchFile, NO_LOCK); - OSTRACE3("RELEASECONCH %d %s\n", conchFile->h, - (rc==SQLITE_OK ? "ok" : "failed")); - return rc; -} - -/* -** Given the name of a database file, compute the name of its conch file. -** Store the conch filename in memory obtained from sqlite3_malloc(). -** Make *pConchPath point to the new name. Return SQLITE_OK on success -** or SQLITE_NOMEM if unable to obtain memory. -** -** The caller is responsible for ensuring that the allocated memory -** space is eventually freed. -** -** *pConchPath is set to NULL if a memory allocation error occurs. -*/ -static int proxyCreateConchPathname(char *dbPath, char **pConchPath){ - int i; /* Loop counter */ - int len = (int)strlen(dbPath); /* Length of database filename - dbPath */ - char *conchPath; /* buffer in which to construct conch name */ - - /* Allocate space for the conch filename and initialize the name to - ** the name of the original database file. */ - *pConchPath = conchPath = (char *)sqlite3_malloc(len + 8); - if( conchPath==0 ){ - return SQLITE_NOMEM; - } - memcpy(conchPath, dbPath, len+1); - - /* now insert a "." before the last / character */ - for( i=(len-1); i>=0; i-- ){ - if( conchPath[i]=='/' ){ - i++; - break; - } - } - conchPath[i]='.'; - while ( ilockingContext; - char *oldPath = pCtx->lockProxyPath; - int rc = SQLITE_OK; - - if( pFile->locktype!=NO_LOCK ){ - return SQLITE_BUSY; - } - - /* nothing to do if the path is NULL, :auto: or matches the existing path */ - if( !path || path[0]=='\0' || !strcmp(path, ":auto:") || - (oldPath && !strncmp(oldPath, path, MAXPATHLEN)) ){ - return SQLITE_OK; - }else{ - unixFile *lockProxy = pCtx->lockProxy; - pCtx->lockProxy=NULL; - pCtx->conchHeld = 0; - if( lockProxy!=NULL ){ - rc=lockProxy->pMethod->xClose((sqlite3_file *)lockProxy); - if( rc ) return rc; - sqlite3_free(lockProxy); - } - sqlite3_free(oldPath); - pCtx->lockProxyPath = sqlite3DbStrDup(0, path); - } - - return rc; -} - -/* -** pFile is a file that has been opened by a prior xOpen call. dbPath -** is a string buffer at least MAXPATHLEN+1 characters in size. -** -** This routine find the filename associated with pFile and writes it -** int dbPath. -*/ -static int proxyGetDbPathForUnixFile(unixFile *pFile, char *dbPath){ -#if defined(__APPLE__) - if( pFile->pMethod == &afpIoMethods ){ - /* afp style keeps a reference to the db path in the filePath field - ** of the struct */ - assert( (int)strlen((char*)pFile->lockingContext)<=MAXPATHLEN ); - strcpy(dbPath, ((afpLockingContext *)pFile->lockingContext)->dbPath); - }else -#endif - if( pFile->pMethod == &dotlockIoMethods ){ - /* dot lock style uses the locking context to store the dot lock - ** file path */ - int len = strlen((char *)pFile->lockingContext) - strlen(DOTLOCK_SUFFIX); - memcpy(dbPath, (char *)pFile->lockingContext, len + 1); - }else{ - /* all other styles use the locking context to store the db file path */ - assert( strlen((char*)pFile->lockingContext)<=MAXPATHLEN ); - strcpy(dbPath, (char *)pFile->lockingContext); - } - return SQLITE_OK; -} - -/* -** Takes an already filled in unix file and alters it so all file locking -** will be performed on the local proxy lock file. The following fields -** are preserved in the locking context so that they can be restored and -** the unix structure properly cleaned up at close time: -** ->lockingContext -** ->pMethod -*/ -static int proxyTransformUnixFile(unixFile *pFile, const char *path) { - proxyLockingContext *pCtx; - char dbPath[MAXPATHLEN+1]; /* Name of the database file */ - char *lockPath=NULL; - int rc = SQLITE_OK; - - if( pFile->locktype!=NO_LOCK ){ - return SQLITE_BUSY; - } - proxyGetDbPathForUnixFile(pFile, dbPath); - if( !path || path[0]=='\0' || !strcmp(path, ":auto:") ){ - lockPath=NULL; - }else{ - lockPath=(char *)path; - } - - OSTRACE4("TRANSPROXY %d for %s pid=%d\n", pFile->h, - (lockPath ? lockPath : ":auto:"), getpid()); - - pCtx = sqlite3_malloc( sizeof(*pCtx) ); - if( pCtx==0 ){ - return SQLITE_NOMEM; - } - memset(pCtx, 0, sizeof(*pCtx)); - - rc = proxyCreateConchPathname(dbPath, &pCtx->conchFilePath); - if( rc==SQLITE_OK ){ - rc = proxyCreateUnixFile(pCtx->conchFilePath, &pCtx->conchFile); - } - if( rc==SQLITE_OK && lockPath ){ - pCtx->lockProxyPath = sqlite3DbStrDup(0, lockPath); - } - - if( rc==SQLITE_OK ){ - /* all memory is allocated, proxys are created and assigned, - ** switch the locking context and pMethod then return. - */ - pCtx->dbPath = sqlite3DbStrDup(0, dbPath); - pCtx->oldLockingContext = pFile->lockingContext; - pFile->lockingContext = pCtx; - pCtx->pOldMethod = pFile->pMethod; - pFile->pMethod = &proxyIoMethods; - }else{ - if( pCtx->conchFile ){ - rc = pCtx->conchFile->pMethod->xClose((sqlite3_file *)pCtx->conchFile); - if( rc ) return rc; - sqlite3_free(pCtx->conchFile); - } - sqlite3_free(pCtx->conchFilePath); - sqlite3_free(pCtx); - } - OSTRACE3("TRANSPROXY %d %s\n", pFile->h, - (rc==SQLITE_OK ? "ok" : "failed")); - return rc; -} - - -/* -** This routine handles sqlite3_file_control() calls that are specific -** to proxy locking. -*/ -static int proxyFileControl(sqlite3_file *id, int op, void *pArg){ - switch( op ){ - case SQLITE_GET_LOCKPROXYFILE: { - unixFile *pFile = (unixFile*)id; - if( pFile->pMethod == &proxyIoMethods ){ - proxyLockingContext *pCtx = (proxyLockingContext*)pFile->lockingContext; - proxyTakeConch(pFile); - if( pCtx->lockProxyPath ){ - *(const char **)pArg = pCtx->lockProxyPath; - }else{ - *(const char **)pArg = ":auto: (not held)"; - } - } else { - *(const char **)pArg = NULL; - } - return SQLITE_OK; - } - case SQLITE_SET_LOCKPROXYFILE: { - unixFile *pFile = (unixFile*)id; - int rc = SQLITE_OK; - int isProxyStyle = (pFile->pMethod == &proxyIoMethods); - if( pArg==NULL || (const char *)pArg==0 ){ - if( isProxyStyle ){ - /* turn off proxy locking - not supported */ - rc = SQLITE_ERROR /*SQLITE_PROTOCOL? SQLITE_MISUSE?*/; - }else{ - /* turn off proxy locking - already off - NOOP */ - rc = SQLITE_OK; - } - }else{ - const char *proxyPath = (const char *)pArg; - if( isProxyStyle ){ - proxyLockingContext *pCtx = - (proxyLockingContext*)pFile->lockingContext; - if( !strcmp(pArg, ":auto:") - || (pCtx->lockProxyPath && - !strncmp(pCtx->lockProxyPath, proxyPath, MAXPATHLEN)) - ){ - rc = SQLITE_OK; - }else{ - rc = switchLockProxyPath(pFile, proxyPath); - } - }else{ - /* turn on proxy file locking */ - rc = proxyTransformUnixFile(pFile, proxyPath); - } - } - return rc; - } - default: { - assert( 0 ); /* The call assures that only valid opcodes are sent */ - } - } - /*NOTREACHED*/ - return SQLITE_ERROR; -} - -/* -** Within this division (the proxying locking implementation) the procedures -** above this point are all utilities. The lock-related methods of the -** proxy-locking sqlite3_io_method object follow. -*/ - - -/* -** This routine checks if there is a RESERVED lock held on the specified -** file by this or any other process. If such a lock is held, set *pResOut -** to a non-zero value otherwise *pResOut is set to zero. The return value -** is set to SQLITE_OK unless an I/O error occurs during lock checking. -*/ -static int proxyCheckReservedLock(sqlite3_file *id, int *pResOut) { - unixFile *pFile = (unixFile*)id; - int rc = proxyTakeConch(pFile); - if( rc==SQLITE_OK ){ - proxyLockingContext *pCtx = (proxyLockingContext *)pFile->lockingContext; - unixFile *proxy = pCtx->lockProxy; - return proxy->pMethod->xCheckReservedLock((sqlite3_file*)proxy, pResOut); - } - return rc; -} - -/* -** Lock the file with the lock specified by parameter locktype - one -** of the following: -** -** (1) SHARED_LOCK -** (2) RESERVED_LOCK -** (3) PENDING_LOCK -** (4) EXCLUSIVE_LOCK -** -** Sometimes when requesting one lock state, additional lock states -** are inserted in between. The locking might fail on one of the later -** transitions leaving the lock state different from what it started but -** still short of its goal. The following chart shows the allowed -** transitions and the inserted intermediate states: -** -** UNLOCKED -> SHARED -** SHARED -> RESERVED -** SHARED -> (PENDING) -> EXCLUSIVE -** RESERVED -> (PENDING) -> EXCLUSIVE -** PENDING -> EXCLUSIVE -** -** This routine will only increase a lock. Use the sqlite3OsUnlock() -** routine to lower a locking level. -*/ -static int proxyLock(sqlite3_file *id, int locktype) { - unixFile *pFile = (unixFile*)id; - int rc = proxyTakeConch(pFile); - if( rc==SQLITE_OK ){ - proxyLockingContext *pCtx = (proxyLockingContext *)pFile->lockingContext; - unixFile *proxy = pCtx->lockProxy; - rc = proxy->pMethod->xLock((sqlite3_file*)proxy, locktype); - pFile->locktype = proxy->locktype; - } - return rc; -} - - -/* -** Lower the locking level on file descriptor pFile to locktype. locktype -** must be either NO_LOCK or SHARED_LOCK. -** -** If the locking level of the file descriptor is already at or below -** the requested locking level, this routine is a no-op. -*/ -static int proxyUnlock(sqlite3_file *id, int locktype) { - unixFile *pFile = (unixFile*)id; - int rc = proxyTakeConch(pFile); - if( rc==SQLITE_OK ){ - proxyLockingContext *pCtx = (proxyLockingContext *)pFile->lockingContext; - unixFile *proxy = pCtx->lockProxy; - rc = proxy->pMethod->xUnlock((sqlite3_file*)proxy, locktype); - pFile->locktype = proxy->locktype; - } - return rc; -} - -/* -** Close a file that uses proxy locks. -*/ -static int proxyClose(sqlite3_file *id) { - if( id ){ - unixFile *pFile = (unixFile*)id; - proxyLockingContext *pCtx = (proxyLockingContext *)pFile->lockingContext; - unixFile *lockProxy = pCtx->lockProxy; - unixFile *conchFile = pCtx->conchFile; - int rc = SQLITE_OK; - - if( lockProxy ){ - rc = lockProxy->pMethod->xUnlock((sqlite3_file*)lockProxy, NO_LOCK); - if( rc ) return rc; - rc = lockProxy->pMethod->xClose((sqlite3_file*)lockProxy); - if( rc ) return rc; - sqlite3_free(lockProxy); - pCtx->lockProxy = 0; - } - if( conchFile ){ - if( pCtx->conchHeld ){ - rc = proxyReleaseConch(pFile); - if( rc ) return rc; - } - rc = conchFile->pMethod->xClose((sqlite3_file*)conchFile); - if( rc ) return rc; - sqlite3_free(conchFile); - } - sqlite3_free(pCtx->lockProxyPath); - sqlite3_free(pCtx->conchFilePath); - sqlite3_free(pCtx->dbPath); - /* restore the original locking context and pMethod then close it */ - pFile->lockingContext = pCtx->oldLockingContext; - pFile->pMethod = pCtx->pOldMethod; - sqlite3_free(pCtx); - return pFile->pMethod->xClose(id); - } - return SQLITE_OK; -} - - - -#endif /* defined(__APPLE__) && SQLITE_ENABLE_LOCKING_STYLE */ -/* -** The proxy locking style is intended for use with AFP filesystems. -** And since AFP is only supported on MacOSX, the proxy locking is also -** restricted to MacOSX. -** -** -******************* End of the proxy lock implementation ********************** -******************************************************************************/ - -/* -** Initialize the operating system interface. -** -** This routine registers all VFS implementations for unix-like operating -** systems. This routine, and the sqlite3_os_end() routine that follows, -** should be the only routines in this file that are visible from other -** files. -** -** This routine is called once during SQLite initialization and by a -** single thread. The memory allocation and mutex subsystems have not -** necessarily been initialized when this routine is called, and so they -** should not be used. -*/ -int sqlite3_os_init(void){ - /* - ** The following macro defines an initializer for an sqlite3_vfs object. - ** The name of the VFS is NAME. The pAppData is a pointer to a pointer - ** to the "finder" function. (pAppData is a pointer to a pointer because - ** silly C90 rules prohibit a void* from being cast to a function pointer - ** and so we have to go through the intermediate pointer to avoid problems - ** when compiling with -pedantic-errors on GCC.) - ** - ** The FINDER parameter to this macro is the name of the pointer to the - ** finder-function. The finder-function returns a pointer to the - ** sqlite_io_methods object that implements the desired locking - ** behaviors. See the division above that contains the IOMETHODS - ** macro for addition information on finder-functions. - ** - ** Most finders simply return a pointer to a fixed sqlite3_io_methods - ** object. But the "autolockIoFinder" available on MacOSX does a little - ** more than that; it looks at the filesystem type that hosts the - ** database file and tries to choose an locking method appropriate for - ** that filesystem time. - */ - #define UNIXVFS(VFSNAME, FINDER) { \ - 1, /* iVersion */ \ - sizeof(unixFile), /* szOsFile */ \ - MAX_PATHNAME, /* mxPathname */ \ - 0, /* pNext */ \ - VFSNAME, /* zName */ \ - (void*)&FINDER, /* pAppData */ \ + return 0; +} + +static int unixGetLastError(sqlite3_vfs *pVfs, int nBuf, char *zBuf){ + return 0; +} + +/* +** Initialize the operating system interface. +*/ +int sqlite3_os_init(void){ + /* Macro to define the static contents of an sqlite3_vfs structure for + ** the unix backend. The two parameters are the values to use for + ** the sqlite3_vfs.zName and sqlite3_vfs.pAppData fields, respectively. + ** + */ + #define UNIXVFS(zVfsName, pVfsAppData) { \ + 1, /* iVersion */ \ + sizeof(unixFile), /* szOsFile */ \ + MAX_PATHNAME, /* mxPathname */ \ + 0, /* pNext */ \ + zVfsName, /* zName */ \ + (void *)pVfsAppData, /* pAppData */ \ unixOpen, /* xOpen */ \ unixDelete, /* xDelete */ \ unixAccess, /* xAccess */ \ unixFullPathname, /* xFullPathname */ \ unixDlOpen, /* xDlOpen */ \ @@ -5035,53 +2959,31 @@ unixSleep, /* xSleep */ \ unixCurrentTime, /* xCurrentTime */ \ unixGetLastError /* xGetLastError */ \ } - /* - ** All default VFSes for unix are contained in the following array. - ** - ** Note that the sqlite3_vfs.pNext field of the VFS object is modified - ** by the SQLite core when the VFS is registered. So the following - ** array cannot be const. - */ - static sqlite3_vfs aVfs[] = { -#if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__) - UNIXVFS("unix", autolockIoFinder ), -#else - UNIXVFS("unix", posixIoFinder ), -#endif - UNIXVFS("unix-none", nolockIoFinder ), - UNIXVFS("unix-dotfile", dotlockIoFinder ), -#if OS_VXWORKS - UNIXVFS("unix-namedsem", semIoFinder ), -#endif -#if SQLITE_ENABLE_LOCKING_STYLE - UNIXVFS("unix-posix", posixIoFinder ), - UNIXVFS("unix-flock", flockIoFinder ), -#endif -#if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__) - UNIXVFS("unix-afp", afpIoFinder ), - UNIXVFS("unix-proxy", proxyIoFinder ), -#endif - }; - unsigned int i; /* Loop counter */ - - /* Register all VFSes defined in the aVfs[] array */ - for(i=0; i<(sizeof(aVfs)/sizeof(sqlite3_vfs)); i++){ - sqlite3_vfs_register(&aVfs[i], i==0); - } + static sqlite3_vfs unixVfs = UNIXVFS("unix", 0); +#if SQLITE_ENABLE_LOCKING_STYLE + int i; + static sqlite3_vfs aVfs[] = { + UNIXVFS("unix-posix", LOCKING_STYLE_POSIX), + UNIXVFS("unix-afp", LOCKING_STYLE_AFP), + UNIXVFS("unix-flock", LOCKING_STYLE_FLOCK), + UNIXVFS("unix-dotfile", LOCKING_STYLE_DOTFILE), + UNIXVFS("unix-none", LOCKING_STYLE_NONE) + }; + for(i=0; i<(sizeof(aVfs)/sizeof(sqlite3_vfs)); i++){ + sqlite3_vfs_register(&aVfs[i], 0); + } +#endif + sqlite3_vfs_register(&unixVfs, 1); return SQLITE_OK; } /* -** Shutdown the operating system interface. -** -** Some operating systems might need to do some cleanup in this routine, -** to release dynamically allocated objects. But not on unix. -** This routine is a no-op for unix. +** Shutdown the operating system interface. This is a no-op for unix. */ int sqlite3_os_end(void){ return SQLITE_OK; } #endif /* SQLITE_OS_UNIX */ Index: src/os_win.c ================================================================== --- src/os_win.c +++ src/os_win.c @@ -10,11 +10,11 @@ ** ****************************************************************************** ** ** This file contains code that is specific to windows. ** -** $Id: os_win.c,v 1.148 2009/02/05 03:16:21 shane Exp $ +** $Id: os_win.c,v 1.135 2008/10/12 02:27:39 shane Exp $ */ #include "sqliteInt.h" #if SQLITE_OS_WIN /* This file is used for windows only */ @@ -71,11 +71,11 @@ /* ** Determine if we are dealing with WindowsCE - which has a much ** reduced API. */ -#if SQLITE_OS_WINCE +#if defined(SQLITE_OS_WINCE) # define AreFileApisANSI() 1 #endif /* ** WinCE lacks native support for file locking so we have to fake it @@ -98,11 +98,10 @@ struct winFile { const sqlite3_io_methods *pMethod;/* Must be first */ HANDLE h; /* Handle for accessing the file */ unsigned char locktype; /* Type of lock currently held on this file */ short sharedLockByte; /* Randomly chosen byte used as a shared lock */ - DWORD lastErrno; /* The Windows errno from the last I/O error */ #if SQLITE_OS_WINCE WCHAR *zDeleteOnClose; /* Name of file to delete when closing */ HANDLE hMutex; /* Mutex used to control access to shared lock */ HANDLE hShared; /* Shared memory segment used for locking */ winceLock local; /* Locks obtained by this instance of winFile */ @@ -251,11 +250,11 @@ /* ** Convert multibyte character string to UTF-8. Space to hold the ** returned string is obtained from malloc(). */ -char *sqlite3_win32_mbcs_to_utf8(const char *zFilename){ +static char *mbcsToUtf8(const char *zFilename){ char *zFilenameUtf8; WCHAR *zTmpWide; zTmpWide = mbcsToUnicode(zFilename); if( zTmpWide==0 ){ @@ -357,11 +356,10 @@ } /* Create/open the named mutex */ pFile->hMutex = CreateMutexW(NULL, FALSE, zName); if (!pFile->hMutex){ - pFile->lastErrno = GetLastError(); free(zName); return FALSE; } /* Acquire the mutex before continuing */ @@ -388,11 +386,10 @@ if (pFile->hShared){ pFile->shared = (winceLock*)MapViewOfFile(pFile->hShared, FILE_MAP_READ|FILE_MAP_WRITE, 0, 0, sizeof(winceLock)); /* If mapping failed, close the shared memory handle and erase it */ if (!pFile->shared){ - pFile->lastErrno = GetLastError(); CloseHandle(pFile->hShared); pFile->hShared = NULL; } } @@ -649,32 +646,28 @@ sqlite3_file *id, /* File to read from */ void *pBuf, /* Write content into this buffer */ int amt, /* Number of bytes to read */ sqlite3_int64 offset /* Begin reading at this offset */ ){ - LONG upperBits = (LONG)((offset>>32) & 0x7fffffff); - LONG lowerBits = (LONG)(offset & 0xffffffff); + LONG upperBits = (offset>>32) & 0x7fffffff; + LONG lowerBits = offset & 0xffffffff; DWORD rc; DWORD got; winFile *pFile = (winFile*)id; - DWORD error; assert( id!=0 ); SimulateIOError(return SQLITE_IOERR_READ); OSTRACE3("READ %d lock=%d\n", pFile->h, pFile->locktype); rc = SetFilePointer(pFile->h, lowerBits, &upperBits, FILE_BEGIN); - if( rc==INVALID_SET_FILE_POINTER && (error=GetLastError())!=NO_ERROR ){ - pFile->lastErrno = error; + if( rc==INVALID_SET_FILE_POINTER && GetLastError()!=NO_ERROR ){ return SQLITE_FULL; } if( !ReadFile(pFile->h, pBuf, amt, &got, 0) ){ - pFile->lastErrno = GetLastError(); return SQLITE_IOERR_READ; } if( got==(DWORD)amt ){ return SQLITE_OK; }else{ - /* Unread parts of the buffer must be zero-filled */ memset(&((char*)pBuf)[got], 0, amt-got); return SQLITE_IOERR_SHORT_READ; } } @@ -686,23 +679,21 @@ sqlite3_file *id, /* File to write into */ const void *pBuf, /* The bytes to be written */ int amt, /* Number of bytes to write */ sqlite3_int64 offset /* Offset into the file to begin writing at */ ){ - LONG upperBits = (LONG)((offset>>32) & 0x7fffffff); - LONG lowerBits = (LONG)(offset & 0xffffffff); + LONG upperBits = (offset>>32) & 0x7fffffff; + LONG lowerBits = offset & 0xffffffff; DWORD rc; - DWORD wrote = 0; + DWORD wrote; winFile *pFile = (winFile*)id; - DWORD error; assert( id!=0 ); SimulateIOError(return SQLITE_IOERR_WRITE); SimulateDiskfullError(return SQLITE_FULL); OSTRACE3("WRITE %d lock=%d\n", pFile->h, pFile->locktype); rc = SetFilePointer(pFile->h, lowerBits, &upperBits, FILE_BEGIN); - if( rc==INVALID_SET_FILE_POINTER && (error=GetLastError())!=NO_ERROR ){ - pFile->lastErrno = error; + if( rc==INVALID_SET_FILE_POINTER && GetLastError()!=NO_ERROR ){ return SQLITE_FULL; } assert( amt>0 ); while( amt>0 @@ -711,11 +702,10 @@ ){ amt -= wrote; pBuf = &((char*)pBuf)[wrote]; } if( !rc || amt>(int)wrote ){ - pFile->lastErrno = GetLastError(); return SQLITE_FULL; } return SQLITE_OK; } @@ -722,28 +712,22 @@ /* ** Truncate an open file to a specified size */ static int winTruncate(sqlite3_file *id, sqlite3_int64 nByte){ DWORD rc; - LONG upperBits = (LONG)((nByte>>32) & 0x7fffffff); - LONG lowerBits = (LONG)(nByte & 0xffffffff); + LONG upperBits = (nByte>>32) & 0x7fffffff; + LONG lowerBits = nByte & 0xffffffff; winFile *pFile = (winFile*)id; - DWORD error = NO_ERROR; OSTRACE3("TRUNCATE %d %lld\n", pFile->h, nByte); SimulateIOError(return SQLITE_IOERR_TRUNCATE); rc = SetFilePointer(pFile->h, lowerBits, &upperBits, FILE_BEGIN); - if( INVALID_SET_FILE_POINTER == rc ){ - error = GetLastError(); - } - if( error == NO_ERROR ){ + if( INVALID_SET_FILE_POINTER != rc ){ /* SetEndOfFile will fail if nByte is negative */ if( SetEndOfFile(pFile->h) ){ return SQLITE_OK; } - error = GetLastError(); } - pFile->lastErrno = error; return SQLITE_IOERR_TRUNCATE; } #ifdef SQLITE_TEST /* @@ -756,54 +740,33 @@ /* ** Make sure all writes to a particular file are committed to disk. */ static int winSync(sqlite3_file *id, int flags){ -#ifndef SQLITE_NO_SYNC winFile *pFile = (winFile*)id; OSTRACE3("SYNC %d lock=%d\n", pFile->h, pFile->locktype); -#else - UNUSED_PARAMETER(id); -#endif -#ifndef SQLITE_TEST - UNUSED_PARAMETER(flags); -#else +#ifdef SQLITE_TEST if( flags & SQLITE_SYNC_FULL ){ sqlite3_fullsync_count++; } sqlite3_sync_count++; #endif - /* If we compiled with the SQLITE_NO_SYNC flag, then syncing is a - ** no-op - */ -#ifdef SQLITE_NO_SYNC - return SQLITE_OK; -#else if( FlushFileBuffers(pFile->h) ){ return SQLITE_OK; }else{ - pFile->lastErrno = GetLastError(); return SQLITE_IOERR; } -#endif } /* ** Determine the current size of a file in bytes */ static int winFileSize(sqlite3_file *id, sqlite3_int64 *pSize){ winFile *pFile = (winFile*)id; DWORD upperBits, lowerBits; - DWORD error; SimulateIOError(return SQLITE_IOERR_FSTAT); lowerBits = GetFileSize(pFile->h, &upperBits); - if( (lowerBits == INVALID_FILE_SIZE) - && ((error = GetLastError()) != NO_ERROR) ) - { - pFile->lastErrno = error; - return SQLITE_IOERR_FSTAT; - } *pSize = (((sqlite3_int64)upperBits)<<32) + lowerBits; return SQLITE_OK; } /* @@ -825,22 +788,15 @@ ovlp.Offset = SHARED_FIRST; ovlp.OffsetHigh = 0; ovlp.hEvent = 0; res = LockFileEx(pFile->h, LOCKFILE_FAIL_IMMEDIATELY, 0, SHARED_SIZE, 0, &ovlp); -/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed. -*/ -#if SQLITE_OS_WINCE==0 }else{ int lk; sqlite3_randomness(sizeof(lk), &lk); - pFile->sharedLockByte = (short)((lk & 0x7fffffff)%(SHARED_SIZE - 1)); + pFile->sharedLockByte = (lk & 0x7fffffff)%(SHARED_SIZE - 1); res = LockFile(pFile->h, SHARED_FIRST+pFile->sharedLockByte, 0, 1, 0); -#endif - } - if( res == 0 ){ - pFile->lastErrno = GetLastError(); } return res; } /* @@ -848,19 +804,12 @@ */ static int unlockReadLock(winFile *pFile){ int res; if( isNT() ){ res = UnlockFile(pFile->h, SHARED_FIRST, 0, SHARED_SIZE, 0); -/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed. -*/ -#if SQLITE_OS_WINCE==0 }else{ res = UnlockFile(pFile->h, SHARED_FIRST + pFile->sharedLockByte, 0, 1, 0); -#endif - } - if( res == 0 ){ - pFile->lastErrno = GetLastError(); } return res; } /* @@ -893,11 +842,10 @@ int rc = SQLITE_OK; /* Return code from subroutines */ int res = 1; /* Result of a windows lock call */ int newLocktype; /* Set pFile->locktype to this value before exiting */ int gotPendingLock = 0;/* True if we acquired a PENDING lock this time */ winFile *pFile = (winFile*)id; - DWORD error = NO_ERROR; assert( pFile!=0 ); OSTRACE5("LOCK %d %d was %d(%d)\n", pFile->h, locktype, pFile->locktype, pFile->sharedLockByte); @@ -918,13 +866,12 @@ /* Lock the PENDING_LOCK byte if we need to acquire a PENDING lock or ** a SHARED lock. If we are acquiring a SHARED lock, the acquisition of ** the PENDING_LOCK byte is temporary. */ newLocktype = pFile->locktype; - if( (pFile->locktype==NO_LOCK) - || ( (locktype==EXCLUSIVE_LOCK) - && (pFile->locktype==RESERVED_LOCK)) + if( pFile->locktype==NO_LOCK + || (locktype==EXCLUSIVE_LOCK && pFile->locktype==RESERVED_LOCK) ){ int cnt = 3; while( cnt-->0 && (res = LockFile(pFile->h, PENDING_BYTE, 0, 1, 0))==0 ){ /* Try 3 times to get the pending lock. The pending lock might be ** held by another reader process who will release it momentarily. @@ -931,24 +878,19 @@ */ OSTRACE2("could not get a PENDING lock. cnt=%d\n", cnt); Sleep(1); } gotPendingLock = res; - if( !res ){ - error = GetLastError(); - } } /* Acquire a shared lock */ if( locktype==SHARED_LOCK && res ){ assert( pFile->locktype==NO_LOCK ); res = getReadLock(pFile); if( res ){ newLocktype = SHARED_LOCK; - }else{ - error = GetLastError(); } } /* Acquire a RESERVED lock */ @@ -955,12 +897,10 @@ if( locktype==RESERVED_LOCK && res ){ assert( pFile->locktype==SHARED_LOCK ); res = LockFile(pFile->h, RESERVED_BYTE, 0, 1, 0); if( res ){ newLocktype = RESERVED_LOCK; - }else{ - error = GetLastError(); } } /* Acquire a PENDING lock */ @@ -977,12 +917,11 @@ OSTRACE2("unreadlock = %d\n", res); res = LockFile(pFile->h, SHARED_FIRST, 0, SHARED_SIZE, 0); if( res ){ newLocktype = EXCLUSIVE_LOCK; }else{ - error = GetLastError(); - OSTRACE2("error-code = %d\n", error); + OSTRACE2("error-code = %d\n", GetLastError()); getReadLock(pFile); } } /* If we are holding a PENDING lock that ought to be released, then @@ -998,14 +937,13 @@ if( res ){ rc = SQLITE_OK; }else{ OSTRACE4("LOCK FAILED %d trying for %d but got %d\n", pFile->h, locktype, newLocktype); - pFile->lastErrno = error; rc = SQLITE_BUSY; } - pFile->locktype = (u8)newLocktype; + pFile->locktype = newLocktype; return rc; } /* ** This routine checks if there is a RESERVED lock held on the specified @@ -1066,11 +1004,11 @@ unlockReadLock(pFile); } if( type>=PENDING_LOCK ){ UnlockFile(pFile->h, PENDING_BYTE, 0, 1, 0); } - pFile->locktype = (u8)locktype; + pFile->locktype = locktype; return rc; } /* ** Control and query of the open file handle. @@ -1079,14 +1017,10 @@ switch( op ){ case SQLITE_FCNTL_LOCKSTATE: { *(int*)pArg = ((winFile*)id)->locktype; return SQLITE_OK; } - case SQLITE_LAST_ERRNO: { - *(int*)pArg = (int)((winFile*)id)->lastErrno; - return SQLITE_OK; - } } return SQLITE_ERROR; } /* @@ -1098,19 +1032,17 @@ ** if two files are created in the same file-system directory (i.e. ** a database and its journal file) that the sector size will be the ** same for both. */ static int winSectorSize(sqlite3_file *id){ - UNUSED_PARAMETER(id); return SQLITE_DEFAULT_SECTOR_SIZE; } /* ** Return a vector of device characteristics. */ static int winDeviceCharacteristics(sqlite3_file *id){ - UNUSED_PARAMETER(id); return 0; } /* ** This vector defines all the methods that can operate on an @@ -1146,16 +1078,12 @@ */ static void *convertUtf8Filename(const char *zFilename){ void *zConverted = 0; if( isNT() ){ zConverted = utf8ToUnicode(zFilename); -/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed. -*/ -#if SQLITE_OS_WINCE==0 }else{ zConverted = utf8ToMbcs(zFilename); -#endif } /* caller will handle out of memory */ return zConverted; } @@ -1181,33 +1109,27 @@ sqlite3_snprintf(MAX_PATH-30, zTempPath, "%s", zMulti); free(zMulti); }else{ return SQLITE_NOMEM; } -/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed. -** Since the ASCII version of these Windows API do not exist for WINCE, -** it's important to not reference them for WINCE builds. -*/ -#if SQLITE_OS_WINCE==0 }else{ char *zUtf8; char zMbcsPath[MAX_PATH]; GetTempPathA(MAX_PATH-30, zMbcsPath); - zUtf8 = sqlite3_win32_mbcs_to_utf8(zMbcsPath); + zUtf8 = mbcsToUtf8(zMbcsPath); if( zUtf8 ){ sqlite3_snprintf(MAX_PATH-30, zTempPath, "%s", zUtf8); free(zUtf8); }else{ return SQLITE_NOMEM; } -#endif } - for(i=sqlite3Strlen30(zTempPath); i>0 && zTempPath[i-1]=='\\'; i--){} + for(i=strlen(zTempPath); i>0 && zTempPath[i-1]=='\\'; i--){} zTempPath[i] = 0; sqlite3_snprintf(nBuf-30, zBuf, "%s\\"SQLITE_TEMP_FILE_PREFIX, zTempPath); - j = sqlite3Strlen30(zBuf); + j = strlen(zBuf); sqlite3_randomness(20, &zBuf[j]); for(i=0; i<20; i++, j++){ zBuf[j] = (char)zChars[ ((unsigned char)zBuf[j])%(sizeof(zChars)-1) ]; } zBuf[j] = 0; @@ -1267,12 +1189,10 @@ winFile *pFile = (winFile*)id; void *zConverted; /* Filename in OS encoding */ const char *zUtf8Name = zName; /* Filename in UTF-8 encoding */ char zTmpname[MAX_PATH+1]; /* Buffer used to create temp filename */ - UNUSED_PARAMETER(pVfs); - /* If the second argument to this function is NULL, generate a ** temporary file name to use */ if( !zUtf8Name ){ int rc = getTempname(MAX_PATH+1, zTmpname); @@ -1327,25 +1247,19 @@ NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL ); -/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed. -** Since the ASCII version of these Windows API do not exist for WINCE, -** it's important to not reference them for WINCE builds. -*/ -#if SQLITE_OS_WINCE==0 }else{ h = CreateFileA((char*)zConverted, dwDesiredAccess, dwShareMode, NULL, dwCreationDisposition, dwFlagsAndAttributes, NULL ); -#endif } if( h==INVALID_HANDLE_VALUE ){ free(zConverted); if( flags & SQLITE_OPEN_READWRITE ){ return winOpen(0, zName, id, @@ -1362,11 +1276,10 @@ } } memset(pFile, 0, sizeof(*pFile)); pFile->pMethod = &winIoMethod; pFile->h = h; - pFile->lastErrno = NO_ERROR; #if SQLITE_OS_WINCE if( (flags & (SQLITE_OPEN_READWRITE|SQLITE_OPEN_MAIN_DB)) == (SQLITE_OPEN_READWRITE|SQLITE_OPEN_MAIN_DB) && !winceCreateLock(zName, pFile) ){ @@ -1403,14 +1316,12 @@ const char *zFilename, /* Name of file to delete */ int syncDir /* Not used on win32 */ ){ int cnt = 0; DWORD rc; - DWORD error = 0; + DWORD error; void *zConverted = convertUtf8Filename(zFilename); - UNUSED_PARAMETER(pVfs); - UNUSED_PARAMETER(syncDir); if( zConverted==0 ){ return SQLITE_NOMEM; } SimulateIOError(return SQLITE_IOERR_DELETE); if( isNT() ){ @@ -1418,23 +1329,17 @@ DeleteFileW(zConverted); }while( ( ((rc = GetFileAttributesW(zConverted)) != INVALID_FILE_ATTRIBUTES) || ((error = GetLastError()) == ERROR_ACCESS_DENIED)) && (++cnt < MX_DELETION_ATTEMPTS) && (Sleep(100), 1) ); -/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed. -** Since the ASCII version of these Windows API do not exist for WINCE, -** it's important to not reference them for WINCE builds. -*/ -#if SQLITE_OS_WINCE==0 }else{ do{ DeleteFileA(zConverted); }while( ( ((rc = GetFileAttributesA(zConverted)) != INVALID_FILE_ATTRIBUTES) || ((error = GetLastError()) == ERROR_ACCESS_DENIED)) && (++cnt < MX_DELETION_ATTEMPTS) && (Sleep(100), 1) ); -#endif } free(zConverted); OSTRACE2("DELETE \"%s\"\n", zFilename); return ( (rc == INVALID_FILE_ATTRIBUTES) && (error == ERROR_FILE_NOT_FOUND)) ? SQLITE_OK : SQLITE_IOERR_DELETE; @@ -1448,26 +1353,19 @@ const char *zFilename, /* Name of file to check */ int flags, /* Type of test to make on this file */ int *pResOut /* OUT: Result */ ){ DWORD attr; - int rc = 0; + int rc; void *zConverted = convertUtf8Filename(zFilename); - UNUSED_PARAMETER(pVfs); if( zConverted==0 ){ return SQLITE_NOMEM; } if( isNT() ){ attr = GetFileAttributesW((WCHAR*)zConverted); -/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed. -** Since the ASCII version of these Windows API do not exist for WINCE, -** it's important to not reference them for WINCE builds. -*/ -#if SQLITE_OS_WINCE==0 }else{ attr = GetFileAttributesA((char*)zConverted); -#endif } free(zConverted); switch( flags ){ case SQLITE_ACCESS_READ: case SQLITE_ACCESS_EXISTS: @@ -1493,29 +1391,26 @@ sqlite3_vfs *pVfs, /* Pointer to vfs object */ const char *zRelative, /* Possibly relative input path */ int nFull, /* Size of output buffer in bytes */ char *zFull /* Output buffer */ ){ - + #if defined(__CYGWIN__) - UNUSED_PARAMETER(nFull); cygwin_conv_to_full_win32_path(zRelative, zFull); return SQLITE_OK; #endif #if SQLITE_OS_WINCE - UNUSED_PARAMETER(nFull); /* WinCE has no concept of a relative pathname, or so I am told. */ sqlite3_snprintf(pVfs->mxPathname, zFull, "%s", zRelative); return SQLITE_OK; #endif #if !SQLITE_OS_WINCE && !defined(__CYGWIN__) int nByte; void *zConverted; char *zOut; - UNUSED_PARAMETER(nFull); zConverted = convertUtf8Filename(zRelative); if( isNT() ){ WCHAR *zTemp; nByte = GetFullPathNameW((WCHAR*)zConverted, 0, 0, 0) + 3; zTemp = malloc( nByte*sizeof(zTemp[0]) ); @@ -1525,15 +1420,10 @@ } GetFullPathNameW((WCHAR*)zConverted, nByte, zTemp, 0); free(zConverted); zOut = unicodeToUtf8(zTemp); free(zTemp); -/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed. -** Since the ASCII version of these Windows API do not exist for WINCE, -** it's important to not reference them for WINCE builds. -*/ -#if SQLITE_OS_WINCE==0 }else{ char *zTemp; nByte = GetFullPathNameA((char*)zConverted, 0, 0, 0) + 3; zTemp = malloc( nByte*sizeof(zTemp[0]) ); if( zTemp==0 ){ @@ -1540,13 +1430,12 @@ free(zConverted); return SQLITE_NOMEM; } GetFullPathNameA((char*)zConverted, nByte, zTemp, 0); free(zConverted); - zOut = sqlite3_win32_mbcs_to_utf8(zTemp); + zOut = mbcsToUtf8(zTemp); free(zTemp); -#endif } if( zOut ){ sqlite3_snprintf(pVfs->mxPathname, zFull, "%s", zOut); free(zOut); return SQLITE_OK; @@ -1566,45 +1455,35 @@ ** within the shared library, and closing the shared library. */ static void *winDlOpen(sqlite3_vfs *pVfs, const char *zFilename){ HANDLE h; void *zConverted = convertUtf8Filename(zFilename); - UNUSED_PARAMETER(pVfs); if( zConverted==0 ){ return 0; } if( isNT() ){ h = LoadLibraryW((WCHAR*)zConverted); -/* isNT() is 1 if SQLITE_OS_WINCE==1, so this else is never executed. -** Since the ASCII version of these Windows API do not exist for WINCE, -** it's important to not reference them for WINCE builds. -*/ -#if SQLITE_OS_WINCE==0 }else{ h = LoadLibraryA((char*)zConverted); -#endif } free(zConverted); return (void*)h; } static void winDlError(sqlite3_vfs *pVfs, int nBuf, char *zBufOut){ - UNUSED_PARAMETER(pVfs); getLastErrorMsg(nBuf, zBufOut); } -void (*winDlSym(sqlite3_vfs *pVfs, void *pHandle, const char *zSymbol))(void){ - UNUSED_PARAMETER(pVfs); +void *winDlSym(sqlite3_vfs *pVfs, void *pHandle, const char *zSymbol){ #if SQLITE_OS_WINCE /* The GetProcAddressA() routine is only available on wince. */ - return (void(*)(void))GetProcAddressA((HANDLE)pHandle, zSymbol); + return GetProcAddressA((HANDLE)pHandle, zSymbol); #else /* All other windows platforms expect GetProcAddress() to take ** an Ansi string regardless of the _UNICODE setting */ - return (void(*)(void))GetProcAddress((HANDLE)pHandle, zSymbol); + return GetProcAddress((HANDLE)pHandle, zSymbol); #endif } void winDlClose(sqlite3_vfs *pVfs, void *pHandle){ - UNUSED_PARAMETER(pVfs); FreeLibrary((HANDLE)pHandle); } #else /* if SQLITE_OMIT_LOAD_EXTENSION is defined: */ #define winDlOpen 0 #define winDlError 0 @@ -1616,15 +1495,10 @@ /* ** Write up to nBuf bytes of randomness into zBuf. */ static int winRandomness(sqlite3_vfs *pVfs, int nBuf, char *zBuf){ int n = 0; - UNUSED_PARAMETER(pVfs); -#if defined(SQLITE_TEST) - n = nBuf; - memset(zBuf, 0, nBuf); -#else if( sizeof(SYSTEMTIME)<=nBuf-n ){ SYSTEMTIME x; GetSystemTime(&x); memcpy(&zBuf[n], &x, sizeof(x)); n += sizeof(x); @@ -1643,21 +1517,19 @@ LARGE_INTEGER i; QueryPerformanceCounter(&i); memcpy(&zBuf[n], &i, sizeof(i)); n += sizeof(i); } -#endif return n; } /* ** Sleep for a little while. Return the amount of time slept. */ static int winSleep(sqlite3_vfs *pVfs, int microsec){ Sleep((microsec+999)/1000); - UNUSED_PARAMETER(pVfs); return ((microsec+999)/1000)*1000; } /* ** The following variable, if set to a non-zero value, becomes the result @@ -1675,11 +1547,11 @@ int winCurrentTime(sqlite3_vfs *pVfs, double *prNow){ FILETIME ft; /* FILETIME structure is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601 (= JD 2305813.5). */ - sqlite3_int64 timeW, timeF; + double now; #if SQLITE_OS_WINCE SYSTEMTIME time; GetSystemTime(&time); /* if SystemTimeToFileTime() fails, it returns zero. */ if (!SystemTimeToFileTime(&time,&ft)){ @@ -1686,33 +1558,15 @@ return 1; } #else GetSystemTimeAsFileTime( &ft ); #endif - UNUSED_PARAMETER(pVfs); -#if defined(_MSC_VER) - timeW = (((sqlite3_int64)ft.dwHighDateTime)*4294967296) + ft.dwLowDateTime; - timeF = timeW % 864000000000; /* fractional days (100-nanoseconds) */ - timeW = timeW / 864000000000; /* whole days */ - timeW = timeW + 2305813; /* add whole days (from 2305813.5) */ - timeF = timeF + 432000000000; /* add half a day (from 2305813.5) */ - timeW = timeW + (timeF / 864000000000); /* add whole day if half day made one */ - timeF = timeF % 864000000000; /* compute new fractional days */ - *prNow = (double)timeW + ((double)timeF / (double)864000000000); -#else - timeW = (((sqlite3_int64)ft.dwHighDateTime)*4294967296LL) + ft.dwLowDateTime; - timeF = timeW % 864000000000LL; /* fractional days (100-nanoseconds) */ - timeW = timeW / 864000000000LL; /* whole days */ - timeW = timeW + 2305813; /* add whole days (from 2305813.5) */ - timeF = timeF + 432000000000LL; /* add half a day (from 2305813.5) */ - timeW = timeW + (timeF / 864000000000LL); /* add whole day if half day made one */ - timeF = timeF % 864000000000LL; /* compute new fractional days */ - *prNow = (double)timeW + ((double)timeF / (double)864000000000LL); -#endif + now = ((double)ft.dwHighDateTime) * 4294967296.0; + *prNow = (now + ft.dwLowDateTime)/864000000000.0 + 2305813.5; #ifdef SQLITE_TEST if( sqlite3_current_time ){ - *prNow = ((double)sqlite3_current_time + (double)43200) / (double)86400 + (double)2440587; + *prNow = sqlite3_current_time/86400.0 + 2440587.5; } #endif return 0; } @@ -1745,11 +1599,10 @@ ** However if an error message is supplied, it will be incorporated ** by sqlite into the error message available to the user using ** sqlite3_errmsg(), possibly making IO errors easier to debug. */ static int winGetLastError(sqlite3_vfs *pVfs, int nBuf, char *zBuf){ - UNUSED_PARAMETER(pVfs); return getLastErrorMsg(nBuf, zBuf); } /* ** Initialize and deinitialize the operating system interface. Index: src/pager.c ================================================================== --- src/pager.c +++ src/pager.c @@ -16,28 +16,35 @@ ** is separate from the database file. The pager also implements file ** locking to prevent two processes from writing the same database ** file simultaneously, or one process from reading the database while ** another is writing. ** -** @(#) $Id: pager.c,v 1.566 2009/02/04 19:16:23 drh Exp $ +** @(#) $Id: pager.c,v 1.497 2008/10/07 11:51:20 danielk1977 Exp $ */ #ifndef SQLITE_OMIT_DISKIO #include "sqliteInt.h" /* ** Macros for troubleshooting. Normally turned off */ #if 0 -int sqlite3PagerTrace=1; /* True to enable tracing */ #define sqlite3DebugPrintf printf -#define PAGERTRACE(X) if( sqlite3PagerTrace ){ sqlite3DebugPrintf X; } +#define PAGERTRACE1(X) sqlite3DebugPrintf(X) +#define PAGERTRACE2(X,Y) sqlite3DebugPrintf(X,Y) +#define PAGERTRACE3(X,Y,Z) sqlite3DebugPrintf(X,Y,Z) +#define PAGERTRACE4(X,Y,Z,W) sqlite3DebugPrintf(X,Y,Z,W) +#define PAGERTRACE5(X,Y,Z,W,V) sqlite3DebugPrintf(X,Y,Z,W,V) #else -#define PAGERTRACE(X) +#define PAGERTRACE1(X) +#define PAGERTRACE2(X,Y) +#define PAGERTRACE3(X,Y,Z) +#define PAGERTRACE4(X,Y,Z,W) +#define PAGERTRACE5(X,Y,Z,W,V) #endif /* -** The following two macros are used within the PAGERTRACE() macros above +** The following two macros are used within the PAGERTRACEX() macros above ** to print out file-descriptors. ** ** PAGERID() takes a pointer to a Pager struct as its argument. The ** associated file-descriptor is returned. FILEHANDLEID() takes an sqlite3_file ** struct as its argument. @@ -97,10 +104,27 @@ #define PAGER_SHARED 1 /* same as SHARED_LOCK */ #define PAGER_RESERVED 2 /* same as RESERVED_LOCK */ #define PAGER_EXCLUSIVE 4 /* same as EXCLUSIVE_LOCK */ #define PAGER_SYNCED 5 +/* +** If the SQLITE_BUSY_RESERVED_LOCK macro is set to true at compile-time, +** then failed attempts to get a reserved lock will invoke the busy callback. +** This is off by default. To see why, consider the following scenario: +** +** Suppose thread A already has a shared lock and wants a reserved lock. +** Thread B already has a reserved lock and wants an exclusive lock. If +** both threads are using their busy callbacks, it might be a long time +** be for one of the threads give up and allows the other to proceed. +** But if the thread trying to get the reserved lock gives up quickly +** (if it never invokes its busy callback) then the contention will be +** resolved quickly. +*/ +#ifndef SQLITE_BUSY_RESERVED_LOCK +# define SQLITE_BUSY_RESERVED_LOCK 0 +#endif + /* ** This macro rounds values up so that if the value is an address it ** is guaranteed to be an address that is aligned to an 8-byte boundary. */ #define FORCE_ALIGNMENT(X) (((X)+7)&~7) @@ -114,188 +138,74 @@ #else # define CODEC1(P,D,N,X) /* NO-OP */ # define CODEC2(P,D,N,X) ((char*)D) #endif -/* -** The maximum allowed sector size. 16MB. If the xSectorsize() method -** returns a value larger than this, then MAX_SECTOR_SIZE is used instead. -** This could conceivably cause corruption following a power failure on -** such a system. This is currently an undocumented limit. -*/ -#define MAX_SECTOR_SIZE 0x0100000 - -/* -** An instance of the following structure is allocated for each active -** savepoint and statement transaction in the system. All such structures -** are stored in the Pager.aSavepoint[] array, which is allocated and -** resized using sqlite3Realloc(). -** -** When a savepoint is created, the PagerSavepoint.iHdrOffset field is -** set to 0. If a journal-header is written into the main journal while -** the savepoint is active, then iHdrOffset is set to the byte offset -** immediately following the last journal record written into the main -** journal before the journal-header. This is required during savepoint -** rollback (see pagerPlaybackSavepoint()). -*/ -typedef struct PagerSavepoint PagerSavepoint; -struct PagerSavepoint { - i64 iOffset; /* Starting offset in main journal */ - i64 iHdrOffset; /* See above */ - Bitvec *pInSavepoint; /* Set of pages in this savepoint */ - Pgno nOrig; /* Original number of pages in file */ - Pgno iSubRec; /* Index of first record in sub-journal */ -}; - /* ** A open page cache is an instance of the following structure. ** -** errCode -** -** Pager.errCode may be set to SQLITE_IOERR, SQLITE_CORRUPT, or -** or SQLITE_FULL. Once one of the first three errors occurs, it persists -** and is returned as the result of every major pager API call. The -** SQLITE_FULL return code is slightly different. It persists only until the -** next successful rollback is performed on the pager cache. Also, -** SQLITE_FULL does not affect the sqlite3PagerGet() and sqlite3PagerLookup() -** APIs, they may still be used successfully. -** -** dbSizeValid, dbSize, dbOrigSize, dbFileSize -** -** Managing the size of the database file in pages is a little complicated. -** The variable Pager.dbSize contains the number of pages that the database -** image currently contains. As the database image grows or shrinks this -** variable is updated. The variable Pager.dbFileSize contains the number -** of pages in the database file. This may be different from Pager.dbSize -** if some pages have been appended to the database image but not yet written -** out from the cache to the actual file on disk. Or if the image has been -** truncated by an incremental-vacuum operation. The Pager.dbOrigSize variable -** contains the number of pages in the database image when the current -** transaction was opened. The contents of all three of these variables is -** only guaranteed to be correct if the boolean Pager.dbSizeValid is true. -** -** TODO: Under what conditions is dbSizeValid set? Cleared? -** -** changeCountDone -** -** This boolean variable is used to make sure that the change-counter -** (the 4-byte header field at byte offset 24 of the database file) is -** not updated more often than necessary. -** -** It is set to true when the change-counter field is updated, which -** can only happen if an exclusive lock is held on the database file. -** It is cleared (set to false) whenever an exclusive lock is -** relinquished on the database file. Each time a transaction is committed, -** The changeCountDone flag is inspected. If it is true, the work of -** updating the change-counter is omitted for the current transaction. -** -** This mechanism means that when running in exclusive mode, a connection -** need only update the change-counter once, for the first transaction -** committed. -** -** dbModified -** -** The dbModified flag is set whenever a database page is dirtied. -** It is cleared at the end of each transaction. -** -** It is used when committing or otherwise ending a transaction. If -** the dbModified flag is clear then less work has to be done. -** -** journalStarted -** -** This flag is set whenever the the main journal is synced. -** -** The point of this flag is that it must be set after the -** first journal header in a journal file has been synced to disk. -** After this has happened, new pages appended to the database -** do not need the PGHDR_NEED_SYNC flag set, as they do not need -** to wait for a journal sync before they can be written out to -** the database file (see function pager_write()). -** -** setMaster -** -** This variable is used to ensure that the master journal file name -** (if any) is only written into the journal file once. -** -** When committing a transaction, the master journal file name (if any) -** may be written into the journal file while the pager is still in -** PAGER_RESERVED state (see CommitPhaseOne() for the action). It -** then attempts to upgrade to an exclusive lock. If this attempt -** fails, then SQLITE_BUSY may be returned to the user and the user -** may attempt to commit the transaction again later (calling -** CommitPhaseOne() again). This flag is used to ensure that the -** master journal name is only written to the journal file the first -** time CommitPhaseOne() is called. -** -** doNotSync -** -** This variable is set and cleared by sqlite3PagerWrite(). -** -** needSync -** -** TODO: It might be easier to set this variable in writeJournalHdr() -** and writeMasterJournal() only. Change its meaning to "unsynced data -** has been written to the journal". +** Pager.errCode may be set to SQLITE_IOERR, SQLITE_CORRUPT, or +** or SQLITE_FULL. Once one of the first three errors occurs, it persists +** and is returned as the result of every major pager API call. The +** SQLITE_FULL return code is slightly different. It persists only until the +** next successful rollback is performed on the pager cache. Also, +** SQLITE_FULL does not affect the sqlite3PagerGet() and sqlite3PagerLookup() +** APIs, they may still be used successfully. */ struct Pager { sqlite3_vfs *pVfs; /* OS functions to use for IO */ - u8 exclusiveMode; /* Boolean. True if locking_mode==EXCLUSIVE */ - u8 journalMode; /* On of the PAGER_JOURNALMODE_* values */ + u8 journalOpen; /* True if journal file descriptors is valid */ + u8 journalStarted; /* True if header of journal is synced */ u8 useJournal; /* Use a rollback journal on this file */ u8 noReadlock; /* Do not bother to obtain readlocks */ + u8 stmtOpen; /* True if the statement subjournal is open */ + u8 stmtInUse; /* True we are in a statement subtransaction */ + u8 stmtAutoopen; /* Open stmt journal when main journal is opened*/ u8 noSync; /* Do not sync the journal if true */ u8 fullSync; /* Do extra syncs of the journal for robustness */ u8 sync_flags; /* One of SYNC_NORMAL or SYNC_FULL */ + u8 state; /* PAGER_UNLOCK, _SHARED, _RESERVED, etc. */ u8 tempFile; /* zFilename is a temporary file */ u8 readOnly; /* True for a read-only database */ - u8 memDb; /* True to inhibit all file I/O */ - - /* The following block contains those class members that are dynamically - ** modified during normal operations. The other variables in this structure - ** are either constant throughout the lifetime of the pager, or else - ** used to store configuration parameters that affect the way the pager - ** operates. - ** - ** The 'state' variable is described in more detail along with the - ** descriptions of the values it may take - PAGER_UNLOCK etc. Many of the - ** other variables in this block are described in the comment directly - ** above this class definition. - */ - u8 state; /* PAGER_UNLOCK, _SHARED, _RESERVED, etc. */ - u8 dbModified; /* True if there are any changes to the Db */ u8 needSync; /* True if an fsync() is needed on the journal */ - u8 journalStarted; /* True if header of journal is synced */ - u8 changeCountDone; /* Set after incrementing the change-counter */ + u8 dirtyCache; /* True if cached pages have changed */ + u8 alwaysRollback; /* Disable DontRollback() for all pages */ + u8 memDb; /* True to inhibit all file I/O */ u8 setMaster; /* True if a m-j name has been written to jrnl */ u8 doNotSync; /* Boolean. While true, do not spill the cache */ - u8 dbSizeValid; /* Set when dbSize is correct */ - Pgno dbSize; /* Number of pages in the database */ - Pgno dbOrigSize; /* dbSize before the current transaction */ - Pgno dbFileSize; /* Number of pages in the database file */ + u8 exclusiveMode; /* Boolean. True if locking_mode==EXCLUSIVE */ + u8 journalMode; /* On of the PAGER_JOURNALMODE_* values */ + u8 dbModified; /* True if there are any changes to the Db */ + u8 changeCountDone; /* Set after incrementing the change-counter */ + u32 vfsFlags; /* Flags for sqlite3_vfs.xOpen() */ int errCode; /* One of several kinds of errors */ - int nRec; /* Pages journalled since last j-header written */ + int dbSize; /* Number of pages in the file */ + int origDbSize; /* dbSize before the current change */ + int stmtSize; /* Size of database (in pages) at stmt_begin() */ + int nRec; /* Number of pages written to the journal */ u32 cksumInit; /* Quasi-random value added to every checksum */ - u32 nSubRec; /* Number of records written to sub-journal */ + int stmtNRec; /* Number of records in stmt subjournal */ + int nExtra; /* Add this many bytes to each in-memory page */ + int pageSize; /* Number of bytes in a page */ + int nPage; /* Total number of in-memory pages */ + int mxPage; /* Maximum number of pages to hold in cache */ + Pgno mxPgno; /* Maximum allowed size of the database */ Bitvec *pInJournal; /* One bit for each page in the database file */ - sqlite3_file *fd; /* File descriptor for database */ - sqlite3_file *jfd; /* File descriptor for main journal */ - sqlite3_file *sjfd; /* File descriptor for sub-journal */ - i64 journalOff; /* Current write offset in the journal file */ - i64 journalHdr; /* Byte offset to previous journal header */ - PagerSavepoint *aSavepoint; /* Array of active savepoints */ - int nSavepoint; /* Number of elements in aSavepoint[] */ - char dbFileVers[16]; /* Changes whenever database file changes */ - u32 sectorSize; /* Assumed sector size during rollback */ - - int nExtra; /* Add this many bytes to each in-memory page */ - u32 vfsFlags; /* Flags for sqlite3_vfs.xOpen() */ - int pageSize; /* Number of bytes in a page */ - Pgno mxPgno; /* Maximum allowed size of the database */ + Bitvec *pInStmt; /* One bit for each page in the database */ + Bitvec *pAlwaysRollback; /* One bit for each page marked always-rollback */ char *zFilename; /* Name of the database file */ char *zJournal; /* Name of the journal file */ - int (*xBusyHandler)(void*); /* Function to call when busy */ - void *pBusyHandlerArg; /* Context argument for xBusyHandler */ + char *zDirectory; /* Directory hold database and journal files */ + sqlite3_file *fd, *jfd; /* File descriptors for database and journal */ + sqlite3_file *stfd; /* File descriptor for the statement subjournal*/ + BusyHandler *pBusyHandler; /* Pointer to sqlite.busyHandler */ + i64 journalOff; /* Current byte offset in the journal file */ + i64 journalHdr; /* Byte offset to previous journal header */ + i64 stmtHdrOff; /* First journal header written this statement */ + i64 stmtCksum; /* cksumInit when statement was started */ + i64 stmtJSize; /* Size of journal at stmt_begin() */ + int sectorSize; /* Assumed sector size during rollback */ #ifdef SQLITE_TEST int nHit, nMiss; /* Cache hits and missing */ int nRead, nWrite; /* Database pages read/written */ #endif void (*xReiniter)(DbPage*); /* Call this routine when reloading pages */ @@ -302,13 +212,13 @@ #ifdef SQLITE_HAS_CODEC void *(*xCodec)(void*,void*,Pgno,int); /* Routine for en/decoding data */ void *pCodecArg; /* First argument to xCodec() */ #endif char *pTmpSpace; /* Pager.pageSize bytes of space for tmp use */ + char dbFileVers[16]; /* Changes whenever database file changes */ i64 journalSizeLimit; /* Size limit for persistent journal files */ PCache *pPCache; /* Pointer to page cache object */ - sqlite3_backup *pBackup; /* Pointer to list of ongoing backup processes */ }; /* ** The following global variables hold counters used for ** testing purposes only. These variables do not exist in @@ -328,11 +238,11 @@ /* ** Journal files begin with the following magic string. The data ** was obtained from /dev/random. It is used only as a sanity check. ** ** Since version 2.8.0, the journal format contains additional sanity -** checking information. If the power fails while the journal is being +** checking information. If the power fails while the journal is begin ** written, semi-random garbage data might appear in the journal ** file after power is restored. If an attempt is then made ** to roll the journal back, the database could be corrupted. The additional ** sanity checking data is an attempt to discover the garbage in the ** journal and ignore it. @@ -351,18 +261,19 @@ static const unsigned char aJournalMagic[] = { 0xd9, 0xd5, 0x05, 0xf9, 0x20, 0xa1, 0x63, 0xd7, }; /* -** The size of the of each page record in the journal is given by -** the following macro. +** The size of the header and of each page in the journal is determined +** by the following macros. */ #define JOURNAL_PG_SZ(pPager) ((pPager->pageSize) + 8) /* -** The journal header size for this pager. This is usually the same -** size as a single disk sector. See also setSectorSize(). +** The journal header size for this pager. In the future, this could be +** set to some value read from the disk controller. The important +** characteristic is that it is the same size as a disk sector. */ #define JOURNAL_HDR_SZ(pPager) (pPager->sectorSize) /* ** The macro MEMDB is true if we are dealing with an in-memory database. @@ -374,60 +285,37 @@ # define MEMDB 0 #else # define MEMDB pPager->memDb #endif +/* +** Page number PAGER_MJ_PGNO is never used in an SQLite database (it is +** reserved for working around a windows/posix incompatibility). It is +** used in the journal to signify that the remainder of the journal file +** is devoted to storing a master journal name - there are no more pages to +** roll back. See comments for function writeMasterJournal() for details. +*/ +/* #define PAGER_MJ_PGNO(x) (PENDING_BYTE/((x)->pageSize)) */ +#define PAGER_MJ_PGNO(x) ((PENDING_BYTE/((x)->pageSize))+1) + /* ** The maximum legal page number is (2^31 - 1). */ #define PAGER_MAX_PGNO 2147483647 -#ifndef NDEBUG -/* -** Usage: -** -** assert( assert_pager_state(pPager) ); -*/ -static int assert_pager_state(Pager *pPager){ - - /* A temp-file is always in PAGER_EXCLUSIVE or PAGER_SYNCED state. */ - assert( pPager->tempFile==0 || pPager->state>=PAGER_EXCLUSIVE ); - - /* The changeCountDone flag is always set for temp-files */ - assert( pPager->tempFile==0 || pPager->changeCountDone ); - - return 1; -} -#endif - -/* -** Return true if it is necessary to write page *pPg into the sub-journal. -** A page needs to be written into the sub-journal if there exists one -** or more open savepoints for which: -** -** * The page-number is less than or equal to PagerSavepoint.nOrig, and -** * The bit corresponding to the page-number is not set in -** PagerSavepoint.pInSavepoint. -*/ -static int subjRequiresPage(PgHdr *pPg){ - Pgno pgno = pPg->pgno; +/* +** Return true if page *pPg has already been written to the statement +** journal (or statement snapshot has been created, if *pPg is part +** of an in-memory database). +*/ +static int pageInStatement(PgHdr *pPg){ Pager *pPager = pPg->pPager; - int i; - for(i=0; inSavepoint; i++){ - PagerSavepoint *p = &pPager->aSavepoint[i]; - if( p->nOrig>=pgno && 0==sqlite3BitvecTest(p->pInSavepoint, pgno) ){ - return 1; - } - } - return 0; -} - -/* -** Return true if the page is already in the journal file. -*/ -static int pageInJournal(PgHdr *pPg){ - return sqlite3BitvecTest(pPg->pPager->pInJournal, pPg->pgno); + if( MEMDB ){ + return pPg->apSave[1]!=0; + }else{ + return sqlite3BitvecTest(pPager->pInStmt, pPg->pgno); + } } /* ** Read a 32-bit integer from the given file descriptor. Store the integer ** that is read in *pRes. Return SQLITE_OK if everything worked, or an @@ -457,29 +345,15 @@ char ac[4]; put32bits(ac, val); return sqlite3OsWrite(fd, ac, 4, offset); } -/* -** The argument to this macro is a file descriptor (type sqlite3_file*). -** Return 0 if it is not open, or non-zero (but not 1) if it is. -** -** This is so that expressions can be written as: -** -** if( isOpen(pPager->jfd) ){ ... -** -** instead of -** -** if( pPager->jfd->pMethods ){ ... -*/ -#define isOpen(pFd) ((pFd)->pMethods) - /* ** If file pFd is open, call sqlite3OsUnlock() on it. */ static int osUnlock(sqlite3_file *pFd, int eLock){ - if( !isOpen(pFd) ){ + if( !pFd->pMethods ){ return SQLITE_OK; } return sqlite3OsUnlock(pFd, eLock); } @@ -490,41 +364,81 @@ ** (a) the value returned by OsDeviceCharacteristics() indicates that ** a database page may be written atomically, and ** (b) the value returned by OsSectorSize() is less than or equal ** to the page size. ** -** The optimization is also always enabled for temporary files. It is -** an error to call this function if pPager is opened on an in-memory -** database. -** ** If the optimization cannot be used, 0 is returned. If it can be used, ** then the value returned is the size of the journal file when it ** contains rollback data for exactly one page. */ #ifdef SQLITE_ENABLE_ATOMIC_WRITE static int jrnlBufferSize(Pager *pPager){ - assert( !MEMDB ); - if( !pPager->tempFile ){ - int dc; /* Device characteristics */ - int nSector; /* Sector size */ - int szPage; /* Page size */ - - assert( isOpen(pPager->fd) ); - dc = sqlite3OsDeviceCharacteristics(pPager->fd); - nSector = pPager->sectorSize; + int dc; /* Device characteristics */ + int nSector; /* Sector size */ + int szPage; /* Page size */ + sqlite3_file *fd = pPager->fd; + + if( fd->pMethods ){ + dc = sqlite3OsDeviceCharacteristics(fd); + nSector = sqlite3OsSectorSize(fd); szPage = pPager->pageSize; - - assert(SQLITE_IOCAP_ATOMIC512==(512>>8)); - assert(SQLITE_IOCAP_ATOMIC64K==(65536>>8)); - if( 0==(dc&(SQLITE_IOCAP_ATOMIC|(szPage>>8)) || nSector>szPage) ){ - return 0; - } } - return JOURNAL_HDR_SZ(pPager) + JOURNAL_PG_SZ(pPager); + assert(SQLITE_IOCAP_ATOMIC512==(512>>8)); + assert(SQLITE_IOCAP_ATOMIC64K==(65536>>8)); + + if( !fd->pMethods || + (dc & (SQLITE_IOCAP_ATOMIC|(szPage>>8)) && nSector<=szPage) ){ + return JOURNAL_HDR_SZ(pPager) + JOURNAL_PG_SZ(pPager); + } + return 0; } #endif + +/* +** This function should be called when an error occurs within the pager +** code. The first argument is a pointer to the pager structure, the +** second the error-code about to be returned by a pager API function. +** The value returned is a copy of the second argument to this function. +** +** If the second argument is SQLITE_IOERR, SQLITE_CORRUPT, or SQLITE_FULL +** the error becomes persistent. Until the persisten error is cleared, +** subsequent API calls on this Pager will immediately return the same +** error code. +** +** A persistent error indicates that the contents of the pager-cache +** cannot be trusted. This state can be cleared by completely discarding +** the contents of the pager-cache. If a transaction was active when +** the persistent error occured, then the rollback journal may need +** to be replayed. +*/ +static void pager_unlock(Pager *pPager); +static int pager_error(Pager *pPager, int rc){ + int rc2 = rc & 0xff; + assert( + pPager->errCode==SQLITE_FULL || + pPager->errCode==SQLITE_OK || + (pPager->errCode & 0xff)==SQLITE_IOERR + ); + if( + rc2==SQLITE_FULL || + rc2==SQLITE_IOERR || + rc2==SQLITE_CORRUPT + ){ + pPager->errCode = rc; + if( pPager->state==PAGER_UNLOCK + && sqlite3PcacheRefCount(pPager->pPCache)==0 + ){ + /* If the pager is already unlocked, call pager_unlock() now to + ** clear the error state and ensure that the pager-cache is + ** completely empty. + */ + pager_unlock(pPager); + } + } + return rc; +} /* ** If SQLITE_CHECK_PAGES is defined then we do some sanity checking ** on the cache using a hash function. This is used for testing ** and debugging only. @@ -542,11 +456,11 @@ return hash; } static u32 pager_pagehash(PgHdr *pPage){ return pager_datahash(pPage->pPager->pageSize, (unsigned char *)pPage->pData); } -static void pager_set_pagehash(PgHdr *pPage){ +static u32 pager_set_pagehash(PgHdr *pPage){ pPage->pageHash = pager_pagehash(pPage); } /* ** The CHECK_PAGE macro takes a PgHdr* as an argument. If SQLITE_CHECK_PAGES @@ -554,11 +468,11 @@ ** that the page is either dirty or still matches the calculated page-hash. */ #define CHECK_PAGE(x) checkPage(x) static void checkPage(PgHdr *pPg){ Pager *pPager = pPg->pPager; - assert( !pPg->pageHash || pPager->errCode + assert( !pPg->pageHash || pPager->errCode || MEMDB || (pPg->flags&PGHDR_DIRTY) || pPg->pageHash==pager_pagehash(pPg) ); } #else #define pager_datahash(X,Y) 0 @@ -566,130 +480,114 @@ #define CHECK_PAGE(x) #endif /* SQLITE_CHECK_PAGES */ /* ** When this is called the journal file for pager pPager must be open. -** This function attempts to read a master journal file name from the -** end of the file and, if successful, copies it into memory supplied -** by the caller. See comments above writeMasterJournal() for the format -** used to store a master journal file name at the end of a journal file. +** The master journal file name is read from the end of the file and +** written into memory supplied by the caller. ** ** zMaster must point to a buffer of at least nMaster bytes allocated by ** the caller. This should be sqlite3_vfs.mxPathname+1 (to ensure there is ** enough space to write the master journal name). If the master journal ** name in the journal is longer than nMaster bytes (including a ** nul-terminator), then this is handled as if no master journal name ** were present in the journal. ** -** If a master journal file name is present at the end of the journal -** file, then it is copied into the buffer pointed to by zMaster. A -** nul-terminator byte is appended to the buffer following the master -** journal file name. -** -** If it is determined that no master journal file name is present -** zMaster[0] is set to 0 and SQLITE_OK returned. -** -** If an error occurs while reading from the journal file, an SQLite -** error code is returned. +** If no master journal file name is present zMaster[0] is set to 0 and +** SQLITE_OK returned. */ -static int readMasterJournal(sqlite3_file *pJrnl, char *zMaster, u32 nMaster){ - int rc; /* Return code */ - u32 len; /* Length in bytes of master journal name */ - i64 szJ; /* Total size in bytes of journal file pJrnl */ - u32 cksum; /* MJ checksum value read from journal */ - u32 u; /* Unsigned loop counter */ - unsigned char aMagic[8]; /* A buffer to hold the magic header */ +static int readMasterJournal(sqlite3_file *pJrnl, char *zMaster, int nMaster){ + int rc; + u32 len; + i64 szJ; + u32 cksum; + u32 u; /* Unsigned loop counter */ + unsigned char aMagic[8]; /* A buffer to hold the magic header */ + zMaster[0] = '\0'; - if( SQLITE_OK!=(rc = sqlite3OsFileSize(pJrnl, &szJ)) - || szJ<16 - || SQLITE_OK!=(rc = read32bits(pJrnl, szJ-16, &len)) - || len>=nMaster - || SQLITE_OK!=(rc = read32bits(pJrnl, szJ-12, &cksum)) - || SQLITE_OK!=(rc = sqlite3OsRead(pJrnl, aMagic, 8, szJ-8)) - || memcmp(aMagic, aJournalMagic, 8) - || SQLITE_OK!=(rc = sqlite3OsRead(pJrnl, zMaster, len, szJ-16-len)) - ){ + rc = sqlite3OsFileSize(pJrnl, &szJ); + if( rc!=SQLITE_OK || szJ<16 ) return rc; + + rc = read32bits(pJrnl, szJ-16, &len); + if( rc!=SQLITE_OK ) return rc; + + if( len>=nMaster ){ + return SQLITE_OK; + } + + rc = read32bits(pJrnl, szJ-12, &cksum); + if( rc!=SQLITE_OK ) return rc; + + rc = sqlite3OsRead(pJrnl, aMagic, 8, szJ-8); + if( rc!=SQLITE_OK || memcmp(aMagic, aJournalMagic, 8) ) return rc; + + rc = sqlite3OsRead(pJrnl, zMaster, len, szJ-16-len); + if( rc!=SQLITE_OK ){ return rc; } + zMaster[len] = '\0'; /* See if the checksum matches the master journal name */ for(u=0; ujournalOff, assuming a sector -** size of pPager->sectorSize bytes. +** Seek the journal file descriptor to the next sector boundary where a +** journal header may be read or written. Pager.journalOff is updated with +** the new seek offset. ** ** i.e for a sector size of 512: ** -** Pager.journalOff Return value -** --------------------------------------- -** 0 0 -** 512 512 -** 100 512 -** 2000 2048 +** Input Offset Output Offset +** --------------------------------------- +** 0 0 +** 512 512 +** 100 512 +** 2000 2048 ** */ -static i64 journalHdrOffset(Pager *pPager){ +static void seekJournalHdr(Pager *pPager){ i64 offset = 0; i64 c = pPager->journalOff; if( c ){ offset = ((c-1)/JOURNAL_HDR_SZ(pPager) + 1) * JOURNAL_HDR_SZ(pPager); } assert( offset%JOURNAL_HDR_SZ(pPager)==0 ); assert( offset>=c ); assert( (offset-c)journalOff = offset; } /* -** The journal file must be open when this function is called. -** -** This function is a no-op if the journal file has not been written to -** within the current transaction (i.e. if Pager.journalOff==0). -** -** If doTruncate is non-zero or the Pager.journalSizeLimit variable is -** set to 0, then truncate the journal file to zero bytes in size. Otherwise, -** zero the 28-byte header at the start of the journal file. In either case, -** if the pager is not in no-sync mode, sync the journal file immediately -** after writing or truncating it. -** -** If Pager.journalSizeLimit is set to a positive, non-zero value, and -** following the truncation or zeroing described above the size of the -** journal file in bytes is larger than this value, then truncate the -** journal file to Pager.journalSizeLimit bytes. The journal file does -** not need to be synced following this operation. -** -** If an IO error occurs, abandon processing and return the IO error code. -** Otherwise, return SQLITE_OK. +** Write zeros over the header of the journal file. This has the +** effect of invalidating the journal file and committing the +** transaction. */ static int zeroJournalHdr(Pager *pPager, int doTruncate){ - int rc = SQLITE_OK; /* Return code */ - assert( isOpen(pPager->jfd) ); + int rc = SQLITE_OK; + static const char zeroHdr[28] = {0}; + if( pPager->journalOff ){ - const i64 iLimit = pPager->journalSizeLimit; /* Local cache of jsl */ + i64 iLimit = pPager->journalSizeLimit; IOTRACE(("JZEROHDR %p\n", pPager)) if( doTruncate || iLimit==0 ){ rc = sqlite3OsTruncate(pPager->jfd, 0); }else{ - static const char zeroHdr[28] = {0}; rc = sqlite3OsWrite(pPager->jfd, zeroHdr, sizeof(zeroHdr), 0); } if( rc==SQLITE_OK && !pPager->noSync ){ rc = sqlite3OsSync(pPager->jfd, SQLITE_SYNC_DATAONLY|pPager->sync_flags); } @@ -725,33 +623,26 @@ ** - 4 bytes: Database page size. ** ** Followed by (JOURNAL_HDR_SZ - 28) bytes of unused space. */ static int writeJournalHdr(Pager *pPager){ - int rc = SQLITE_OK; /* Return code */ - char *zHeader = pPager->pTmpSpace; /* Temporary space used to build header */ - u32 nHeader = pPager->pageSize; /* Size of buffer pointed to by zHeader */ - u32 nWrite; /* Bytes of header sector written */ - int ii; /* Loop counter */ - - assert( isOpen(pPager->jfd) ); /* Journal file must be open. */ + int rc = SQLITE_OK; + char *zHeader = pPager->pTmpSpace; + int nHeader = pPager->pageSize; + int nWrite; if( nHeader>JOURNAL_HDR_SZ(pPager) ){ nHeader = JOURNAL_HDR_SZ(pPager); } - /* If there are active savepoints and any of them were created - ** since the most recent journal header was written, update the - ** PagerSavepoint.iHdrOffset fields now. - */ - for(ii=0; iinSavepoint; ii++){ - if( pPager->aSavepoint[ii].iHdrOffset==0 ){ - pPager->aSavepoint[ii].iHdrOffset = pPager->journalOff; - } + if( pPager->stmtHdrOff==0 ){ + pPager->stmtHdrOff = pPager->journalOff; } - pPager->journalHdr = pPager->journalOff = journalHdrOffset(pPager); + seekJournalHdr(pPager); + pPager->journalHdr = pPager->journalOff; + memcpy(zHeader, aJournalMagic, sizeof(aJournalMagic)); /* ** Write the nRec Field - the number of page records that follow this ** journal header. Normally, zero is written to this value at this time. @@ -770,12 +661,12 @@ ** power failure in this case anyway. ** ** * When the SQLITE_IOCAP_SAFE_APPEND flag is set. This guarantees ** that garbage data is never appended to the journal file. */ - assert( isOpen(pPager->fd) || pPager->noSync ); - if( (pPager->noSync) || (pPager->journalMode==PAGER_JOURNALMODE_MEMORY) + assert(pPager->fd->pMethods||pPager->noSync); + if( (pPager->noSync) || (sqlite3OsDeviceCharacteristics(pPager->fd)&SQLITE_IOCAP_SAFE_APPEND) ){ put32bits(&zHeader[sizeof(aJournalMagic)], 0xffffffff); }else{ put32bits(&zHeader[sizeof(aJournalMagic)], 0); @@ -783,42 +674,18 @@ /* The random check-hash initialiser */ sqlite3_randomness(sizeof(pPager->cksumInit), &pPager->cksumInit); put32bits(&zHeader[sizeof(aJournalMagic)+4], pPager->cksumInit); /* The initial database size */ - put32bits(&zHeader[sizeof(aJournalMagic)+8], pPager->dbOrigSize); + put32bits(&zHeader[sizeof(aJournalMagic)+8], pPager->dbSize); /* The assumed sector size for this process */ put32bits(&zHeader[sizeof(aJournalMagic)+12], pPager->sectorSize); - - /* The page size */ - put32bits(&zHeader[sizeof(aJournalMagic)+16], pPager->pageSize); - - /* Initializing the tail of the buffer is not necessary. Everything - ** works find if the following memset() is omitted. But initializing - ** the memory prevents valgrind from complaining, so we are willing to - ** take the performance hit. - */ - memset(&zHeader[sizeof(aJournalMagic)+20], 0, - nHeader-(sizeof(aJournalMagic)+20)); - - /* In theory, it is only necessary to write the 28 bytes that the - ** journal header consumes to the journal file here. Then increment the - ** Pager.journalOff variable by JOURNAL_HDR_SZ so that the next - ** record is written to the following sector (leaving a gap in the file - ** that will be implicitly filled in by the OS). - ** - ** However it has been discovered that on some systems this pattern can - ** be significantly slower than contiguously writing data to the file, - ** even if that means explicitly writing data to the block of - ** (JOURNAL_HDR_SZ - 28) bytes that will not be used. So that is what - ** is done. - ** - ** The loop is required here in case the sector-size is larger than the - ** database page size. Since the zHeader buffer is only Pager.pageSize - ** bytes in size, more than one call to sqlite3OsWrite() may be required - ** to populate the entire journal header sector. - */ + if( pPager->journalHdr==0 ){ + /* The page size */ + put32bits(&zHeader[sizeof(aJournalMagic)+16], pPager->pageSize); + } + for(nWrite=0; rc==SQLITE_OK&&nWritejournalHdr, nHeader)) rc = sqlite3OsWrite(pPager->jfd, zHeader, nHeader, pPager->journalOff); pPager->journalOff += nHeader; } @@ -827,119 +694,79 @@ } /* ** The journal file must be open when this is called. A journal header file ** (JOURNAL_HDR_SZ bytes) is read from the current location in the journal -** file. The current location in the journal file is given by -** pPager->journalOff. See comments above function writeJournalHdr() for -** a description of the journal header format. +** file. See comments above function writeJournalHdr() for a description of +** the journal header format. ** -** If the header is read successfully, *pNRec is set to the number of -** page records following this header and *pDbSize is set to the size of the +** If the header is read successfully, *nRec is set to the number of +** page records following this header and *dbSize is set to the size of the ** database before the transaction began, in pages. Also, pPager->cksumInit ** is set to the value read from the journal header. SQLITE_OK is returned ** in this case. ** ** If the journal header file appears to be corrupted, SQLITE_DONE is -** returned and *pNRec and *PDbSize are undefined. If JOURNAL_HDR_SZ bytes +** returned and *nRec and *dbSize are not set. If JOURNAL_HDR_SZ bytes ** cannot be read from the journal file an error code is returned. */ static int readJournalHdr( - Pager *pPager, /* Pager object */ - i64 journalSize, /* Size of the open journal file in bytes */ - u32 *pNRec, /* OUT: Value read from the nRec field */ - u32 *pDbSize /* OUT: Value of original database size field */ + Pager *pPager, + i64 journalSize, + u32 *pNRec, + u32 *pDbSize ){ - int rc; /* Return code */ - unsigned char aMagic[8]; /* A buffer to hold the magic header */ - i64 iHdrOff; /* Offset of journal header being read */ - - assert( isOpen(pPager->jfd) ); /* Journal file must be open. */ - - /* Advance Pager.journalOff to the start of the next sector. If the - ** journal file is too small for there to be a header stored at this - ** point, return SQLITE_DONE. - */ - pPager->journalOff = journalHdrOffset(pPager); + int rc; + unsigned char aMagic[8]; /* A buffer to hold the magic header */ + i64 jrnlOff; + int iPageSize; + + seekJournalHdr(pPager); if( pPager->journalOff+JOURNAL_HDR_SZ(pPager) > journalSize ){ return SQLITE_DONE; } - iHdrOff = pPager->journalOff; - - /* Read in the first 8 bytes of the journal header. If they do not match - ** the magic string found at the start of each journal header, return - ** SQLITE_DONE. If an IO error occurs, return an error code. Otherwise, - ** proceed. - */ - rc = sqlite3OsRead(pPager->jfd, aMagic, sizeof(aMagic), iHdrOff); - if( rc ){ - return rc; - } + jrnlOff = pPager->journalOff; + + rc = sqlite3OsRead(pPager->jfd, aMagic, sizeof(aMagic), jrnlOff); + if( rc ) return rc; + jrnlOff += sizeof(aMagic); + if( memcmp(aMagic, aJournalMagic, sizeof(aMagic))!=0 ){ return SQLITE_DONE; } - /* Read the first three 32-bit fields of the journal header: The nRec - ** field, the checksum-initializer and the database size at the start - ** of the transaction. Return an error code if anything goes wrong. - */ - if( SQLITE_OK!=(rc = read32bits(pPager->jfd, iHdrOff+8, pNRec)) - || SQLITE_OK!=(rc = read32bits(pPager->jfd, iHdrOff+12, &pPager->cksumInit)) - || SQLITE_OK!=(rc = read32bits(pPager->jfd, iHdrOff+16, pDbSize)) - ){ - return rc; - } - - if( pPager->journalOff==0 ){ - u32 iPageSize; /* Page-size field of journal header */ - u32 iSectorSize; /* Sector-size field of journal header */ - u16 iPageSize16; /* Copy of iPageSize in 16-bit variable */ - - /* Read the page-size and sector-size journal header fields. */ - if( SQLITE_OK!=(rc = read32bits(pPager->jfd, iHdrOff+20, &iSectorSize)) - || SQLITE_OK!=(rc = read32bits(pPager->jfd, iHdrOff+24, &iPageSize)) - ){ - return rc; - } - - /* Check that the values read from the page-size and sector-size fields - ** are within range. To be 'in range', both values need to be a power - ** of two greater than or equal to 512, and not greater than their - ** respective compile time maximum limits. - */ - if( iPageSize<512 || iSectorSize<512 - || iPageSize>SQLITE_MAX_PAGE_SIZE || iSectorSize>MAX_SECTOR_SIZE - || ((iPageSize-1)&iPageSize)!=0 || ((iSectorSize-1)&iSectorSize)!=0 - ){ - /* If the either the page-size or sector-size in the journal-header is - ** invalid, then the process that wrote the journal-header must have - ** crashed before the header was synced. In this case stop reading - ** the journal file here. - */ - return SQLITE_DONE; - } - - /* Update the page-size to match the value read from the journal. - ** Use a testcase() macro to make sure that malloc failure within - ** PagerSetPagesize() is tested. - */ - iPageSize16 = (u16)iPageSize; - rc = sqlite3PagerSetPagesize(pPager, &iPageSize16); - testcase( rc!=SQLITE_OK ); - assert( rc!=SQLITE_OK || iPageSize16==(u16)iPageSize ); - - /* Update the assumed sector-size to match the value used by - ** the process that created this journal. If this journal was - ** created by a process other than this one, then this routine - ** is being called from within pager_playback(). The local value - ** of Pager.sectorSize is restored at the end of that routine. - */ - pPager->sectorSize = iSectorSize; - } + rc = read32bits(pPager->jfd, jrnlOff, pNRec); + if( rc ) return rc; + + rc = read32bits(pPager->jfd, jrnlOff+4, &pPager->cksumInit); + if( rc ) return rc; + + rc = read32bits(pPager->jfd, jrnlOff+8, pDbSize); + if( rc ) return rc; + + rc = read32bits(pPager->jfd, jrnlOff+16, (u32 *)&iPageSize); + if( rc==SQLITE_OK + && iPageSize>=512 + && iPageSize<=SQLITE_MAX_PAGE_SIZE + && ((iPageSize-1)&iPageSize)==0 + ){ + u16 pagesize = iPageSize; + rc = sqlite3PagerSetPagesize(pPager, &pagesize); + } + if( rc ) return rc; + + /* Update the assumed sector-size to match the value used by + ** the process that created this journal. If this journal was + ** created by a process other than this one, then this routine + ** is being called from within pager_playback(). The local value + ** of Pager.sectorSize is restored at the end of that routine. + */ + rc = read32bits(pPager->jfd, jrnlOff+12, (u32 *)&pPager->sectorSize); + if( rc ) return rc; pPager->journalOff += JOURNAL_HDR_SZ(pPager); - return rc; + return SQLITE_OK; } /* ** Write the supplied master journal name into the journal file for pager @@ -946,64 +773,62 @@ ** pPager at the current location. The master journal name must be the last ** thing written to a journal file. If the pager is in full-sync mode, the ** journal file descriptor is advanced to the next sector boundary before ** anything is written. The format is: ** -** + 4 bytes: PAGER_MJ_PGNO. -** + N bytes: Master journal filename in utf-8. -** + 4 bytes: N (length of master journal name in bytes, no nul-terminator). -** + 4 bytes: Master journal name checksum. -** + 8 bytes: aJournalMagic[]. +** + 4 bytes: PAGER_MJ_PGNO. +** + N bytes: length of master journal name. +** + 4 bytes: N +** + 4 bytes: Master journal name checksum. +** + 8 bytes: aJournalMagic[]. ** ** The master journal page checksum is the sum of the bytes in the master -** journal name, where each byte is interpreted as a signed 8-bit integer. +** journal name. ** ** If zMaster is a NULL pointer (occurs for a single database transaction), ** this call is a no-op. */ static int writeMasterJournal(Pager *pPager, const char *zMaster){ - int rc; /* Return code */ - int nMaster; /* Length of string zMaster */ - i64 iHdrOff; /* Offset of header in journal file */ - i64 jrnlSize; /* Size of journal file on disk */ - u32 cksum = 0; /* Checksum of string zMaster */ - - if( !zMaster || pPager->setMaster - || pPager->journalMode==PAGER_JOURNALMODE_MEMORY - || pPager->journalMode==PAGER_JOURNALMODE_OFF - ){ - return SQLITE_OK; - } + int rc; + int len; + int i; + i64 jrnlOff; + i64 jrnlSize; + u32 cksum = 0; + char zBuf[sizeof(aJournalMagic)+2*4]; + + if( !zMaster || pPager->setMaster) return SQLITE_OK; pPager->setMaster = 1; - assert( isOpen(pPager->jfd) ); - /* Calculate the length in bytes and the checksum of zMaster */ - for(nMaster=0; zMaster[nMaster]; nMaster++){ - cksum += zMaster[nMaster]; + len = strlen(zMaster); + for(i=0; ifullSync ){ - pPager->journalOff = journalHdrOffset(pPager); - } - iHdrOff = pPager->journalOff; - - /* Write the master journal data to the end of the journal file. If - ** an error occurs, return the error code to the caller. - */ - if( (0 != (rc = write32bits(pPager->jfd, iHdrOff, PAGER_MJ_PGNO(pPager)))) - || (0 != (rc = sqlite3OsWrite(pPager->jfd, zMaster, nMaster, iHdrOff+4))) - || (0 != (rc = write32bits(pPager->jfd, iHdrOff+4+nMaster, nMaster))) - || (0 != (rc = write32bits(pPager->jfd, iHdrOff+4+nMaster+4, cksum))) - || (0 != (rc = sqlite3OsWrite(pPager->jfd, aJournalMagic, 8, iHdrOff+4+nMaster+8))) - ){ - return rc; - } - pPager->journalOff += (nMaster+20); + seekJournalHdr(pPager); + } + jrnlOff = pPager->journalOff; + pPager->journalOff += (len+20); + + rc = write32bits(pPager->jfd, jrnlOff, PAGER_MJ_PGNO(pPager)); + if( rc!=SQLITE_OK ) return rc; + jrnlOff += 4; + + rc = sqlite3OsWrite(pPager->jfd, zMaster, len, jrnlOff); + if( rc!=SQLITE_OK ) return rc; + jrnlOff += len; + + put32bits(zBuf, len); + put32bits(&zBuf[4], cksum); + memcpy(&zBuf[8], aJournalMagic, sizeof(aJournalMagic)); + rc = sqlite3OsWrite(pPager->jfd, zBuf, 8+sizeof(aJournalMagic), jrnlOff); + jrnlOff += 8+sizeof(aJournalMagic); pPager->needSync = !pPager->noSync; /* If the pager is in peristent-journal mode, then the physical ** journal-file may extend past the end of the master-journal name ** and 8 bytes of magic data just written to the file. This is @@ -1012,293 +837,144 @@ ** whether or not the journal is hot. ** ** Easiest thing to do in this scenario is to truncate the journal ** file to the required size. */ - if( SQLITE_OK==(rc = sqlite3OsFileSize(pPager->jfd, &jrnlSize)) - && jrnlSize>pPager->journalOff + if( (rc==SQLITE_OK) + && (rc = sqlite3OsFileSize(pPager->jfd, &jrnlSize))==SQLITE_OK + && jrnlSize>jrnlOff ){ - rc = sqlite3OsTruncate(pPager->jfd, pPager->journalOff); + rc = sqlite3OsTruncate(pPager->jfd, jrnlOff); } return rc; } /* -** Find a page in the hash table given its page number. Return -** a pointer to the page or NULL if the requested page is not -** already in memory. +** Find a page in the hash table given its page number. Return +** a pointer to the page or NULL if not found. */ static PgHdr *pager_lookup(Pager *pPager, Pgno pgno){ - PgHdr *p; /* Return value */ - - /* It is not possible for a call to PcacheFetch() with createFlag==0 to - ** fail, since no attempt to allocate dynamic memory will be made. - */ - (void)sqlite3PcacheFetch(pPager->pPCache, pgno, 0, &p); + PgHdr *p; + sqlite3PcacheFetch(pPager->pPCache, pgno, 0, &p); return p; } /* -** Unless the pager is in error-state, discard all in-memory pages. If -** the pager is in error-state, then this call is a no-op. -** -** TODO: Why can we not reset the pager while in error state? +** Clear the in-memory cache. This routine +** sets the state of the pager back to what it was when it was first +** opened. Any outstanding pages are invalidated and subsequent attempts +** to access those pages will likely result in a coredump. */ static void pager_reset(Pager *pPager){ - if( SQLITE_OK==pPager->errCode ){ - sqlite3BackupRestart(pPager->pBackup); - sqlite3PcacheClear(pPager->pPCache); - } -} - -/* -** Free all structures in the Pager.aSavepoint[] array and set both -** Pager.aSavepoint and Pager.nSavepoint to zero. Close the sub-journal -** if it is open and the pager is not in exclusive mode. -*/ -static void releaseAllSavepoints(Pager *pPager){ - int ii; /* Iterator for looping through Pager.aSavepoint */ - for(ii=0; iinSavepoint; ii++){ - sqlite3BitvecDestroy(pPager->aSavepoint[ii].pInSavepoint); - } - if( !pPager->exclusiveMode ){ - sqlite3OsClose(pPager->sjfd); - } - sqlite3_free(pPager->aSavepoint); - pPager->aSavepoint = 0; - pPager->nSavepoint = 0; - pPager->nSubRec = 0; -} - -/* -** Set the bit number pgno in the PagerSavepoint.pInSavepoint -** bitvecs of all open savepoints. Return SQLITE_OK if successful -** or SQLITE_NOMEM if a malloc failure occurs. -*/ -static int addToSavepointBitvecs(Pager *pPager, Pgno pgno){ - int ii; /* Loop counter */ - int rc = SQLITE_OK; /* Result code */ - - for(ii=0; iinSavepoint; ii++){ - PagerSavepoint *p = &pPager->aSavepoint[ii]; - if( pgno<=p->nOrig ){ - rc |= sqlite3BitvecSet(p->pInSavepoint, pgno); - testcase( rc==SQLITE_NOMEM ); - assert( rc==SQLITE_OK || rc==SQLITE_NOMEM ); - } - } - return rc; -} - -/* -** Unlock the database file. This function is a no-op if the pager -** is in exclusive mode. + if( pPager->errCode ) return; + sqlite3PcacheClear(pPager->pPCache); +} + +/* +** Unlock the database file. ** ** If the pager is currently in error state, discard the contents of ** the cache and reset the Pager structure internal state. If there is ** an open journal-file, then the next time a shared-lock is obtained ** on the pager file (by this or any other process), it will be ** treated as a hot-journal and rolled back. */ static void pager_unlock(Pager *pPager){ if( !pPager->exclusiveMode ){ - int rc; /* Return code */ - - /* Always close the journal file when dropping the database lock. - ** Otherwise, another connection with journal_mode=delete might - ** delete the file out from under us. - */ - sqlite3OsClose(pPager->jfd); - sqlite3BitvecDestroy(pPager->pInJournal); - pPager->pInJournal = 0; - releaseAllSavepoints(pPager); - - /* If the file is unlocked, somebody else might change it. The - ** values stored in Pager.dbSize etc. might become invalid if - ** this happens. TODO: Really, this doesn't need to be cleared - ** until the change-counter check fails in pagerSharedLock(). - */ - pPager->dbSizeValid = 0; - - rc = osUnlock(pPager->fd, NO_LOCK); - if( rc ){ - pPager->errCode = rc; - } - IOTRACE(("UNLOCK %p\n", pPager)) - - /* If Pager.errCode is set, the contents of the pager cache cannot be - ** trusted. Now that the pager file is unlocked, the contents of the - ** cache can be discarded and the error code safely cleared. - */ - if( pPager->errCode ){ - if( rc==SQLITE_OK ){ - pPager->errCode = SQLITE_OK; - } - pager_reset(pPager); - } - - pPager->changeCountDone = 0; - pPager->state = PAGER_UNLOCK; - } -} - -/* -** This function should be called when an IOERR, CORRUPT or FULL error -** may have occured. The first argument is a pointer to the pager -** structure, the second the error-code about to be returned by a pager -** API function. The value returned is a copy of the second argument -** to this function. -** -** If the second argument is SQLITE_IOERR, SQLITE_CORRUPT, or SQLITE_FULL -** the error becomes persistent. Until the persisten error is cleared, -** subsequent API calls on this Pager will immediately return the same -** error code. -** -** A persistent error indicates that the contents of the pager-cache -** cannot be trusted. This state can be cleared by completely discarding -** the contents of the pager-cache. If a transaction was active when -** the persistent error occured, then the rollback journal may need -** to be replayed to restore the contents of the database file (as if -** it were a hot-journal). -*/ -static int pager_error(Pager *pPager, int rc){ - int rc2 = rc & 0xff; - assert( - pPager->errCode==SQLITE_FULL || - pPager->errCode==SQLITE_OK || - (pPager->errCode & 0xff)==SQLITE_IOERR - ); - if( - rc2==SQLITE_FULL || - rc2==SQLITE_IOERR || - rc2==SQLITE_CORRUPT - ){ - pPager->errCode = rc; - if( pPager->state==PAGER_UNLOCK - && sqlite3PcacheRefCount(pPager->pPCache)==0 - ){ - /* If the pager is already unlocked, call pager_unlock() now to - ** clear the error state and ensure that the pager-cache is - ** completely empty. - */ - pager_unlock(pPager); - } - } - return rc; + if( !MEMDB ){ + int rc = osUnlock(pPager->fd, NO_LOCK); + if( rc ) pPager->errCode = rc; + pPager->dbSize = -1; + IOTRACE(("UNLOCK %p\n", pPager)) + + /* Always close the journal file when dropping the database lock. + ** Otherwise, another connection with journal_mode=delete might + ** delete the file out from under us. + */ + if( pPager->journalOpen ){ + sqlite3OsClose(pPager->jfd); + pPager->journalOpen = 0; + sqlite3BitvecDestroy(pPager->pInJournal); + pPager->pInJournal = 0; + sqlite3BitvecDestroy(pPager->pAlwaysRollback); + pPager->pAlwaysRollback = 0; + } + + /* If Pager.errCode is set, the contents of the pager cache cannot be + ** trusted. Now that the pager file is unlocked, the contents of the + ** cache can be discarded and the error code safely cleared. + */ + if( pPager->errCode ){ + if( rc==SQLITE_OK ) pPager->errCode = SQLITE_OK; + pager_reset(pPager); + if( pPager->stmtOpen ){ + sqlite3OsClose(pPager->stfd); + sqlite3BitvecDestroy(pPager->pInStmt); + pPager->pInStmt = 0; + } + pPager->stmtOpen = 0; + pPager->stmtInUse = 0; + pPager->journalOff = 0; + pPager->journalStarted = 0; + pPager->stmtAutoopen = 0; + pPager->origDbSize = 0; + } + } + + if( !MEMDB || pPager->errCode==SQLITE_OK ){ + pPager->state = PAGER_UNLOCK; + pPager->changeCountDone = 0; + } + } } /* ** Execute a rollback if a transaction is active and unlock the -** database file. -** -** If the pager has already entered the error state, do not attempt -** the rollback at this time. Instead, pager_unlock() is called. The -** call to pager_unlock() will discard all in-memory pages, unlock -** the database file and clear the error state. If this means that -** there is a hot-journal left in the file-system, the next connection -** to obtain a shared lock on the pager (which may be this one) will -** roll it back. -** -** If the pager has not already entered the error state, but an IO or -** malloc error occurs during a rollback, then this will itself cause -** the pager to enter the error state. Which will be cleared by the -** call to pager_unlock(), as described above. +** database file. If the pager has already entered the error state, +** do not attempt the rollback. */ -static void pagerUnlockAndRollback(Pager *pPager){ - if( pPager->errCode==SQLITE_OK && pPager->state>=PAGER_RESERVED ){ +static void pagerUnlockAndRollback(Pager *p){ + if( p->errCode==SQLITE_OK && p->state>=PAGER_RESERVED ){ sqlite3BeginBenignMalloc(); - sqlite3PagerRollback(pPager); + sqlite3PagerRollback(p); sqlite3EndBenignMalloc(); } - pager_unlock(pPager); + pager_unlock(p); } /* -** This routine ends a transaction. A transaction is usually ended by -** either a COMMIT or a ROLLBACK operation. This routine may be called -** after rollback of a hot-journal, or if an error occurs while opening -** the journal file or writing the very first journal-header of a -** database transaction. -** -** If the pager is in PAGER_SHARED or PAGER_UNLOCK state when this -** routine is called, it is a no-op (returns SQLITE_OK). -** -** Otherwise, any active savepoints are released. -** -** If the journal file is open, then it is "finalized". Once a journal -** file has been finalized it is not possible to use it to roll back a -** transaction. Nor will it be considered to be a hot-journal by this -** or any other database connection. Exactly how a journal is finalized -** depends on whether or not the pager is running in exclusive mode and -** the current journal-mode (Pager.journalMode value), as follows: -** -** journalMode==MEMORY -** Journal file descriptor is simply closed. This destroys an -** in-memory journal. -** -** journalMode==TRUNCATE -** Journal file is truncated to zero bytes in size. -** -** journalMode==PERSIST -** The first 28 bytes of the journal file are zeroed. This invalidates -** the first journal header in the file, and hence the entire journal -** file. An invalid journal file cannot be rolled back. -** -** journalMode==DELETE -** The journal file is closed and deleted using sqlite3OsDelete(). -** -** If the pager is running in exclusive mode, this method of finalizing -** the journal file is never used. Instead, if the journalMode is -** DELETE and the pager is in exclusive mode, the method described under -** journalMode==PERSIST is used instead. -** -** After the journal is finalized, if running in non-exclusive mode, the -** pager moves to PAGER_SHARED state (and downgrades the lock on the -** database file accordingly). -** -** If the pager is running in exclusive mode and is in PAGER_SYNCED state, -** it moves to PAGER_EXCLUSIVE. No locks are downgraded when running in -** exclusive mode. -** -** SQLITE_OK is returned if no error occurs. If an error occurs during -** any of the IO operations to finalize the journal file or unlock the -** database then the IO error code is returned to the user. If the -** operation to finalize the journal file fails, then the code still -** tries to unlock the database file if not in exclusive mode. If the -** unlock operation fails as well, then the first error code related -** to the first error encountered (the journal finalization one) is -** returned. +** This routine ends a transaction. A transaction is ended by either +** a COMMIT or a ROLLBACK. +** +** When this routine is called, the pager has the journal file open and +** a RESERVED or EXCLUSIVE lock on the database. This routine will release +** the database lock and acquires a SHARED lock in its place if that is +** the appropriate thing to do. Release locks usually is appropriate, +** unless we are in exclusive access mode or unless this is a +** COMMIT AND BEGIN or ROLLBACK AND BEGIN operation. +** +** The journal file is either deleted or truncated. +** +** TODO: Consider keeping the journal file open for temporary databases. +** This might give a performance improvement on windows where opening +** a file is an expensive operation. */ static int pager_end_transaction(Pager *pPager, int hasMaster){ - int rc = SQLITE_OK; /* Error code from journal finalization operation */ - int rc2 = SQLITE_OK; /* Error code from db file unlock operation */ - + int rc = SQLITE_OK; + int rc2 = SQLITE_OK; + assert( !MEMDB ); if( pPager->statejfd) || pPager->pInJournal==0 ); - if( isOpen(pPager->jfd) ){ - - /* TODO: There's a problem here if a journal-file was opened in MEMORY - ** mode and then the journal-mode is changed to TRUNCATE or PERSIST - ** during the transaction. This code should be changed to assume - ** that the journal mode has not changed since the transaction was - ** started. And the sqlite3PagerJournalMode() function should be - ** changed to make sure that this is the case too. - */ - - /* Finalize the journal file. */ - if( pPager->journalMode==PAGER_JOURNALMODE_MEMORY ){ - int isMemoryJournal = sqlite3IsMemJournal(pPager->jfd); - sqlite3OsClose(pPager->jfd); - if( !isMemoryJournal ){ - rc = sqlite3OsDelete(pPager->pVfs, pPager->zJournal, 0); - } - }else if( pPager->journalMode==PAGER_JOURNALMODE_TRUNCATE ){ - rc = sqlite3OsTruncate(pPager->jfd, 0); + sqlite3PagerStmtCommit(pPager); + if( pPager->stmtOpen && !pPager->exclusiveMode ){ + sqlite3OsClose(pPager->stfd); + pPager->stmtOpen = 0; + } + if( pPager->journalOpen ){ + if( pPager->journalMode==PAGER_JOURNALMODE_TRUNCATE + && (rc = sqlite3OsTruncate(pPager->jfd, 0))==SQLITE_OK ){ pPager->journalOff = 0; pPager->journalStarted = 0; }else if( pPager->exclusiveMode || pPager->journalMode==PAGER_JOURNALMODE_PERSIST ){ @@ -1307,170 +983,133 @@ pPager->journalOff = 0; pPager->journalStarted = 0; }else{ assert( pPager->journalMode==PAGER_JOURNALMODE_DELETE || rc ); sqlite3OsClose(pPager->jfd); + pPager->journalOpen = 0; if( rc==SQLITE_OK && !pPager->tempFile ){ rc = sqlite3OsDelete(pPager->pVfs, pPager->zJournal, 0); } } - -#ifdef SQLITE_CHECK_PAGES - sqlite3PcacheIterateDirty(pPager->pPCache, pager_set_pagehash); -#endif - - sqlite3PcacheCleanAll(pPager->pPCache); sqlite3BitvecDestroy(pPager->pInJournal); pPager->pInJournal = 0; + sqlite3BitvecDestroy(pPager->pAlwaysRollback); + pPager->pAlwaysRollback = 0; + sqlite3PcacheCleanAll(pPager->pPCache); +#ifdef SQLITE_CHECK_PAGES + sqlite3PcacheIterate(pPager->pPCache, pager_set_pagehash); +#endif + sqlite3PcacheClearFlags(pPager->pPCache, + PGHDR_IN_JOURNAL | PGHDR_NEED_SYNC + ); + pPager->dirtyCache = 0; pPager->nRec = 0; + }else{ + assert( pPager->pInJournal==0 ); } if( !pPager->exclusiveMode ){ rc2 = osUnlock(pPager->fd, SHARED_LOCK); pPager->state = PAGER_SHARED; - pPager->changeCountDone = 0; }else if( pPager->state==PAGER_SYNCED ){ pPager->state = PAGER_EXCLUSIVE; } + pPager->origDbSize = 0; pPager->setMaster = 0; pPager->needSync = 0; + /* lruListSetFirstSynced(pPager); */ + pPager->dbSize = -1; pPager->dbModified = 0; - /* TODO: Is this optimal? Why is the db size invalidated here - ** when the database file is not unlocked? */ - pPager->dbOrigSize = 0; - sqlite3PcacheTruncate(pPager->pPCache, pPager->dbSize); - if( !MEMDB ){ - pPager->dbSizeValid = 0; - } - return (rc==SQLITE_OK?rc2:rc); } /* -** Parameter aData must point to a buffer of pPager->pageSize bytes -** of data. Compute and return a checksum based ont the contents of the -** page of data and the current value of pPager->cksumInit. -** -** This is not a real checksum. It is really just the sum of the -** random initial value (pPager->cksumInit) and every 200th byte -** of the page data, starting with byte offset (pPager->pageSize%200). -** Each byte is interpreted as an 8-bit unsigned integer. -** -** Changing the formula used to compute this checksum results in an -** incompatible journal file format. -** -** If journal corruption occurs due to a power failure, the most likely -** scenario is that one end or the other of the record will be changed. -** It is much less likely that the two ends of the journal record will be +** Compute and return a checksum for the page of data. +** +** This is not a real checksum. It is really just the sum of the +** random initial value and the page number. We experimented with +** a checksum of the entire data, but that was found to be too slow. +** +** Note that the page number is stored at the beginning of data and +** the checksum is stored at the end. This is important. If journal +** corruption occurs due to a power failure, the most likely scenario +** is that one end or the other of the record will be changed. It is +** much less likely that the two ends of the journal record will be ** correct and the middle be corrupt. Thus, this "checksum" scheme, ** though fast and simple, catches the mostly likely kind of corruption. +** +** FIX ME: Consider adding every 200th (or so) byte of the data to the +** checksum. That way if a single page spans 3 or more disk sectors and +** only the middle sector is corrupt, we will still have a reasonable +** chance of failing the checksum and thus detecting the problem. */ static u32 pager_cksum(Pager *pPager, const u8 *aData){ - u32 cksum = pPager->cksumInit; /* Checksum value to return */ - int i = pPager->pageSize-200; /* Loop counter */ + u32 cksum = pPager->cksumInit; + int i = pPager->pageSize-200; while( i>0 ){ cksum += aData[i]; i -= 200; } return cksum; } +/* Forward declaration */ +static void makeClean(PgHdr*); + /* -** Read a single page from either the journal file (if isMainJrnl==1) or -** from the sub-journal (if isMainJrnl==0) and playback that page. -** The page begins at offset *pOffset into the file. The *pOffset -** value is increased to the start of the next page in the journal. +** Read a single page from the journal file opened on file descriptor +** jfd. Playback this one page. ** ** The isMainJrnl flag is true if this is the main rollback journal and ** false for the statement journal. The main rollback journal uses ** checksums - the statement journal does not. -** -** If the page number of the page record read from the (sub-)journal file -** is greater than the current value of Pager.dbSize, then playback is -** skipped and SQLITE_OK is returned. -** -** If pDone is not NULL, then it is a record of pages that have already -** been played back. If the page at *pOffset has already been played back -** (if the corresponding pDone bit is set) then skip the playback. -** Make sure the pDone bit corresponding to the *pOffset page is set -** prior to returning. -** -** If the page record is successfully read from the (sub-)journal file -** and played back, then SQLITE_OK is returned. If an IO error occurs -** while reading the record from the (sub-)journal file or while writing -** to the database file, then the IO error code is returned. If data -** is successfully read from the (sub-)journal file but appears to be -** corrupted, SQLITE_DONE is returned. Data is considered corrupted in -** two circumstances: -** -** * If the record page-number is illegal (0 or PAGER_MJ_PGNO), or -** * If the record is being rolled back from the main journal file -** and the checksum field does not match the record content. -** -** Neither of these two scenarios are possible during a savepoint rollback. -** -** If this is a savepoint rollback, then memory may have to be dynamically -** allocated by this function. If this is the case and an allocation fails, -** SQLITE_NOMEM is returned. */ static int pager_playback_one_page( - Pager *pPager, /* The pager being played back */ - int isMainJrnl, /* 1 -> main journal. 0 -> sub-journal. */ - i64 *pOffset, /* Offset of record to playback */ - int isSavepnt, /* True for a savepoint rollback */ - Bitvec *pDone /* Bitvec of pages already played back */ + Pager *pPager, /* The pager being played back */ + sqlite3_file *jfd, /* The file that is the journal being rolled back */ + i64 offset, /* Offset of the page within the journal */ + int isMainJrnl /* True for main rollback journal. False for Stmt jrnl */ ){ int rc; PgHdr *pPg; /* An existing page in the cache */ Pgno pgno; /* The page number of a page in journal */ u32 cksum; /* Checksum used for sanity checking */ - u8 *aData; /* Temporary storage for the page */ - sqlite3_file *jfd; /* The file descriptor for the journal file */ - - assert( (isMainJrnl&~1)==0 ); /* isMainJrnl is 0 or 1 */ - assert( (isSavepnt&~1)==0 ); /* isSavepnt is 0 or 1 */ - assert( isMainJrnl || pDone ); /* pDone always used on sub-journals */ - assert( isSavepnt || pDone==0 ); /* pDone never used on non-savepoint */ - - aData = (u8*)pPager->pTmpSpace; - assert( aData ); /* Temp storage must have already been allocated */ - - /* Read the page number and page data from the journal or sub-journal - ** file. Return an error code to the caller if an IO error occurs. - */ - jfd = isMainJrnl ? pPager->jfd : pPager->sjfd; - rc = read32bits(jfd, *pOffset, &pgno); - if( rc!=SQLITE_OK ) return rc; - rc = sqlite3OsRead(jfd, aData, pPager->pageSize, (*pOffset)+4); - if( rc!=SQLITE_OK ) return rc; - *pOffset += pPager->pageSize + 4 + isMainJrnl*4; + u8 *aData = (u8 *)pPager->pTmpSpace; /* Temp storage for a page */ + + /* isMainJrnl should be true for the main journal and false for + ** statement journals. Verify that this is always the case + */ + assert( jfd == (isMainJrnl ? pPager->jfd : pPager->stfd) ); + assert( aData ); + + rc = read32bits(jfd, offset, &pgno); + if( rc!=SQLITE_OK ) return rc; + rc = sqlite3OsRead(jfd, aData, pPager->pageSize, offset+4); + if( rc!=SQLITE_OK ) return rc; + pPager->journalOff += pPager->pageSize + 4; /* Sanity checking on the page. This is more important that I originally ** thought. If a power failure occurs while the journal is being written, ** it could cause invalid data to be written into the journal. We need to ** detect this invalid data (with high probability) and ignore it. */ if( pgno==0 || pgno==PAGER_MJ_PGNO(pPager) ){ - assert( !isSavepnt ); return SQLITE_DONE; } - if( pgno>(Pgno)pPager->dbSize || sqlite3BitvecTest(pDone, pgno) ){ + if( pgno>(unsigned)pPager->dbSize ){ return SQLITE_OK; } if( isMainJrnl ){ - rc = read32bits(jfd, (*pOffset)-4, &cksum); + rc = read32bits(jfd, offset+pPager->pageSize+4, &cksum); if( rc ) return rc; - if( !isSavepnt && pager_cksum(pPager, aData)!=cksum ){ + pPager->journalOff += 4; + if( pager_cksum(pPager, aData)!=cksum ){ return SQLITE_DONE; } } - if( pDone && (rc = sqlite3BitvecSet(pDone, pgno))!=SQLITE_OK ){ - return rc; - } - assert( pPager->state==PAGER_RESERVED || pPager->state>=PAGER_EXCLUSIVE ); /* If the pager is in RESERVED state, then there must be a copy of this ** page in the pager cache. In this case just update the pager cache, ** not the database file. The page is left marked dirty in this case. @@ -1502,47 +1141,18 @@ ** 2008-04-14: When attempting to vacuum a corrupt database file, it ** is possible to fail a statement on a database that does not yet exist. ** Do not attempt to write if database file has never been opened. */ pPg = pager_lookup(pPager, pgno); - PAGERTRACE(("PLAYBACK %d page %d hash(%08x) %s\n", - PAGERID(pPager), pgno, pager_datahash(pPager->pageSize, aData), - (isMainJrnl?"main-journal":"sub-journal") - )); + PAGERTRACE4("PLAYBACK %d page %d hash(%08x)\n", + PAGERID(pPager), pgno, pager_datahash(pPager->pageSize, aData)); if( (pPager->state>=PAGER_EXCLUSIVE) && (pPg==0 || 0==(pPg->flags&PGHDR_NEED_SYNC)) - && isOpen(pPager->fd) + && (pPager->fd->pMethods) ){ i64 ofst = (pgno-1)*(i64)pPager->pageSize; rc = sqlite3OsWrite(pPager->fd, aData, pPager->pageSize, ofst); - if( pgno>pPager->dbFileSize ){ - pPager->dbFileSize = pgno; - } - sqlite3BackupUpdate(pPager->pBackup, pgno, aData); - }else if( !isMainJrnl && pPg==0 ){ - /* If this is a rollback of a savepoint and data was not written to - ** the database and the page is not in-memory, there is a potential - ** problem. When the page is next fetched by the b-tree layer, it - ** will be read from the database file, which may or may not be - ** current. - ** - ** There are a couple of different ways this can happen. All are quite - ** obscure. When running in synchronous mode, this can only happen - ** if the page is on the free-list at the start of the transaction, then - ** populated, then moved using sqlite3PagerMovepage(). - ** - ** The solution is to add an in-memory page to the cache containing - ** the data just read from the sub-journal. Mark the page as dirty - ** and if the pager requires a journal-sync, then mark the page as - ** requiring a journal-sync before it is written. - */ - assert( isSavepnt ); - if( (rc = sqlite3PagerAcquire(pPager, pgno, &pPg, 1))!=SQLITE_OK ){ - return rc; - } - pPg->flags &= ~PGHDR_NEED_READ; - sqlite3PcacheMakeDirty(pPg); } if( pPg ){ /* No page should ever be explicitly rolled back that is in use, except ** for page 1 which is held in use in order to keep the lock on the ** database active. However such a page may be rolled back as a result @@ -1553,31 +1163,11 @@ pData = pPg->pData; memcpy(pData, aData, pPager->pageSize); if( pPager->xReiniter ){ pPager->xReiniter(pPg); } - if( isMainJrnl && (!isSavepnt || *pOffset<=pPager->journalHdr) ){ - /* If the contents of this page were just restored from the main - ** journal file, then its content must be as they were when the - ** transaction was first opened. In this case we can mark the page - ** as clean, since there will be no need to write it out to the. - ** - ** There is one exception to this rule. If the page is being rolled - ** back as part of a savepoint (or statement) rollback from an - ** unsynced portion of the main journal file, then it is not safe - ** to mark the page as clean. This is because marking the page as - ** clean will clear the PGHDR_NEED_SYNC flag. Since the page is - ** already in the journal file (recorded in Pager.pInJournal) and - ** the PGHDR_NEED_SYNC flag is cleared, if the page is written to - ** again within this transaction, it will be marked as dirty but - ** the PGHDR_NEED_SYNC flag will not be set. It could then potentially - ** be written out into the database file before its journal file - ** segment is synced. If a crash occurs during or following this, - ** database corruption may ensue. - */ - sqlite3PcacheMakeClean(pPg); - } + if( isMainJrnl ) makeClean(pPg); #ifdef SQLITE_CHECK_PAGES pPg->pageHash = pager_pagehash(pPg); #endif /* If this was page 1, then restore the value of Pager.dbFileVers. ** Do this before any decoding. */ @@ -1590,132 +1180,66 @@ sqlite3PcacheRelease(pPg); } return rc; } -#if !defined(NDEBUG) || defined(SQLITE_COVERAGE_TEST) -/* -** This routine looks ahead into the main journal file and determines -** whether or not the next record (the record that begins at file -** offset pPager->journalOff) is a well-formed page record consisting -** of a valid page number, pPage->pageSize bytes of content, followed -** by a valid checksum. -** -** The pager never needs to know this in order to do its job. This -** routine is only used from with assert() and testcase() macros. -*/ -static int pagerNextJournalPageIsValid(Pager *pPager){ - Pgno pgno; /* The page number of the page */ - u32 cksum; /* The page checksum */ - int rc; /* Return code from read operations */ - sqlite3_file *fd; /* The file descriptor from which we are reading */ - u8 *aData; /* Content of the page */ - - /* Read the page number header */ - fd = pPager->jfd; - rc = read32bits(fd, pPager->journalOff, &pgno); - if( rc!=SQLITE_OK ){ return 0; } /*NO_TEST*/ - if( pgno==0 || pgno==PAGER_MJ_PGNO(pPager) ){ return 0; } /*NO_TEST*/ - if( pgno>(Pgno)pPager->dbSize ){ return 0; } /*NO_TEST*/ - - /* Read the checksum */ - rc = read32bits(fd, pPager->journalOff+pPager->pageSize+4, &cksum); - if( rc!=SQLITE_OK ){ return 0; } /*NO_TEST*/ - - /* Read the data and verify the checksum */ - aData = (u8*)pPager->pTmpSpace; - rc = sqlite3OsRead(fd, aData, pPager->pageSize, pPager->journalOff+4); - if( rc!=SQLITE_OK ){ return 0; } /*NO_TEST*/ - if( pager_cksum(pPager, aData)!=cksum ){ return 0; } /*NO_TEST*/ - - /* Reach this point only if the page is valid */ - return 1; -} -#endif /* !defined(NDEBUG) || defined(SQLITE_COVERAGE_TEST) */ - /* ** Parameter zMaster is the name of a master journal file. A single journal ** file that referred to the master journal file has just been rolled back. ** This routine checks if it is possible to delete the master journal file, ** and does so if it is. ** ** Argument zMaster may point to Pager.pTmpSpace. So that buffer is not ** available for use within this function. ** -** When a master journal file is created, it is populated with the names -** of all of its child journals, one after another, formatted as utf-8 -** encoded text. The end of each child journal file is marked with a -** nul-terminator byte (0x00). i.e. the entire contents of a master journal -** file for a transaction involving two databases might be: -** -** "/home/bill/a.db-journal\x00/home/bill/b.db-journal\x00" -** -** A master journal file may only be deleted once all of its child -** journals have been rolled back. -** -** This function reads the contents of the master-journal file into -** memory and loops through each of the child journal names. For -** each child journal, it checks if: -** -** * if the child journal exists, and if so -** * if the child journal contains a reference to master journal -** file zMaster -** -** If a child journal can be found that matches both of the criteria -** above, this function returns without doing anything. Otherwise, if -** no such child journal can be found, file zMaster is deleted from -** the file-system using sqlite3OsDelete(). -** -** If an IO error within this function, an error code is returned. This -** function allocates memory by calling sqlite3Malloc(). If an allocation -** fails, SQLITE_NOMEM is returned. Otherwise, if no IO or malloc errors -** occur, SQLITE_OK is returned. -** -** TODO: This function allocates a single block of memory to load -** the entire contents of the master journal file. This could be -** a couple of kilobytes or so - potentially larger than the page -** size. +** +** The master journal file contains the names of all child journals. +** To tell if a master journal can be deleted, check to each of the +** children. If all children are either missing or do not refer to +** a different master journal, then this master journal can be deleted. */ static int pager_delmaster(Pager *pPager, const char *zMaster){ sqlite3_vfs *pVfs = pPager->pVfs; - int rc; /* Return code */ - sqlite3_file *pMaster; /* Malloc'd master-journal file descriptor */ - sqlite3_file *pJournal; /* Malloc'd child-journal file descriptor */ + int rc; + int master_open = 0; + sqlite3_file *pMaster; + sqlite3_file *pJournal; char *zMasterJournal = 0; /* Contents of master journal file */ i64 nMasterJournal; /* Size of master journal file */ - /* Allocate space for both the pJournal and pMaster file descriptors. - ** If successful, open the master journal file for reading. + /* Open the master journal file exclusively in case some other process + ** is running this routine also. Not that it makes too much difference. */ - pMaster = (sqlite3_file *)sqlite3MallocZero(pVfs->szOsFile * 2); + pMaster = (sqlite3_file *)sqlite3Malloc(pVfs->szOsFile * 2); pJournal = (sqlite3_file *)(((u8 *)pMaster) + pVfs->szOsFile); if( !pMaster ){ rc = SQLITE_NOMEM; }else{ - const int flags = (SQLITE_OPEN_READONLY|SQLITE_OPEN_MASTER_JOURNAL); + int flags = (SQLITE_OPEN_READONLY|SQLITE_OPEN_MASTER_JOURNAL); rc = sqlite3OsOpen(pVfs, zMaster, pMaster, flags, 0); } if( rc!=SQLITE_OK ) goto delmaster_out; + master_open = 1; rc = sqlite3OsFileSize(pMaster, &nMasterJournal); if( rc!=SQLITE_OK ) goto delmaster_out; if( nMasterJournal>0 ){ char *zJournal; char *zMasterPtr = 0; - int nMasterPtr = pVfs->mxPathname+1; + int nMasterPtr = pPager->pVfs->mxPathname+1; /* Load the entire master journal file into space obtained from ** sqlite3_malloc() and pointed to by zMasterJournal. */ - zMasterJournal = (char *)sqlite3Malloc((int)nMasterJournal + nMasterPtr); + zMasterJournal = (char *)sqlite3Malloc(nMasterJournal + nMasterPtr); if( !zMasterJournal ){ rc = SQLITE_NOMEM; goto delmaster_out; } zMasterPtr = &zMasterJournal[nMasterJournal]; - rc = sqlite3OsRead(pMaster, zMasterJournal, (int)nMasterJournal, 0); + rc = sqlite3OsRead(pMaster, zMasterJournal, nMasterJournal, 0); if( rc!=SQLITE_OK ) goto delmaster_out; zJournal = zMasterJournal; while( (zJournal-zMasterJournal)pageSize bytes). If the file -** on disk is currently larger than nPage pages, then use the VFS -** xTruncate() method to truncate it. -** -** Or, it might might be the case that the file on disk is smaller than -** nPage pages. Some operating system implementations can get confused if -** you try to truncate a file to some size that is larger than it -** currently is, so detect this case and write a single zero byte to -** the end of the new file instead. -** -** If successful, return SQLITE_OK. If an IO error occurs while modifying -** the database file, return the error code to the caller. -*/ -static int pager_truncate(Pager *pPager, Pgno nPage){ +** Truncate the main file of the given pager to the number of pages +** indicated. Also truncate the cached representation of the file. +** +** Might might be the case that the file on disk is smaller than nPage. +** This can happen, for example, if we are in the middle of a transaction +** which has extended the file size and the new pages are still all held +** in cache, then an INSERT or UPDATE does a statement rollback. Some +** operating system implementations can get confused if you try to +** truncate a file to some size that is larger than it currently is, +** so detect this case and write a single zero byte to the end of the new +** file instead. +*/ +static int pager_truncate(Pager *pPager, int nPage){ int rc = SQLITE_OK; - if( pPager->state>=PAGER_EXCLUSIVE && isOpen(pPager->fd) ){ + if( pPager->state>=PAGER_EXCLUSIVE && pPager->fd->pMethods ){ i64 currentSize, newSize; - /* TODO: Is it safe to use Pager.dbFileSize here? */ rc = sqlite3OsFileSize(pPager->fd, ¤tSize); newSize = pPager->pageSize*(i64)nPage; if( rc==SQLITE_OK && currentSize!=newSize ){ if( currentSize>newSize ){ rc = sqlite3OsTruncate(pPager->fd, newSize); }else{ rc = sqlite3OsWrite(pPager->fd, "", 1, newSize-1); } - if( rc==SQLITE_OK ){ - pPager->dbFileSize = nPage; - } } } + if( rc==SQLITE_OK ){ + pPager->dbSize = nPage; + pager_truncate_cache(pPager); + } return rc; } /* -** Set the value of the Pager.sectorSize variable for the given -** pager based on the value returned by the xSectorSize method -** of the open database file. The sector size will be used used -** to determine the size and alignment of journal header and -** master journal pointers within created journal files. -** -** For temporary files the effective sector size is always 512 bytes. -** -** Otherwise, for non-temporary files, the effective sector size is -** the value returned by the xSectorSize() method rounded up to 512 if -** it is less than 512, or rounded down to MAX_SECTOR_SIZE if it -** is greater than MAX_SECTOR_SIZE. +** Set the sectorSize for the given pager. +** +** The sector size is at least as big as the sector size reported +** by sqlite3OsSectorSize(). The minimum sector size is 512. */ static void setSectorSize(Pager *pPager){ - assert( isOpen(pPager->fd) || pPager->tempFile ); - + assert(pPager->fd->pMethods||pPager->tempFile); if( !pPager->tempFile ){ /* Sector size doesn't matter for temporary files. Also, the file - ** may not have been opened yet, in which case the OsSectorSize() + ** may not have been opened yet, in whcih case the OsSectorSize() ** call will segfault. */ pPager->sectorSize = sqlite3OsSectorSize(pPager->fd); } if( pPager->sectorSize<512 ){ pPager->sectorSize = 512; } - if( pPager->sectorSize>MAX_SECTOR_SIZE ){ - assert( MAX_SECTOR_SIZE>=512 ); - pPager->sectorSize = MAX_SECTOR_SIZE; - } } /* ** Playback the journal and thus restore the database file to ** the state it was in before we started making changes. @@ -1893,17 +1398,10 @@ ** is then deleted and SQLITE_OK returned, just as if no corruption had ** been encountered. ** ** If an I/O or malloc() error occurs, the journal-file is not deleted ** and an error code is returned. -** -** The isHot parameter indicates that we are trying to rollback a journal -** that might be a hot journal. Or, it could be that the journal is -** preserved because of JOURNALMODE_PERSIST or JOURNALMODE_TRUNCATE. -** If the journal really is hot, reset the pager cache prior rolling -** back any content. If the journal is merely persistent, no reset is -** needed. */ static int pager_playback(Pager *pPager, int isHot){ sqlite3_vfs *pVfs = pPager->pVfs; i64 szJ; /* Size of the journal file in bytes */ u32 nRec; /* Number of Records in the journal */ @@ -1910,31 +1408,24 @@ u32 u; /* Unsigned loop counter */ Pgno mxPg = 0; /* Size of the original file in pages */ int rc; /* Result code of a subroutine */ int res = 1; /* Value returned by sqlite3OsAccess() */ char *zMaster = 0; /* Name of master journal file if any */ - int needPagerReset; /* True to reset page prior to first page rollback */ /* Figure out how many records are in the journal. Abort early if ** the journal is empty. */ - assert( isOpen(pPager->jfd) ); + assert( pPager->journalOpen ); rc = sqlite3OsFileSize(pPager->jfd, &szJ); if( rc!=SQLITE_OK || szJ==0 ){ goto end_playback; } /* Read the master journal name from the journal, if it is present. ** If a master journal file name is specified, but the file is not ** present on disk, then the journal is not hot and does not need to be ** played back. - ** - ** TODO: Technically the following is an error because it assumes that - ** buffer Pager.pTmpSpace is (mxPathname+1) bytes or larger. i.e. that - ** (pPager->pageSize >= pPager->pVfs->mxPathname+1). Using os_unix.c, - ** mxPathname is 512, which is the same as the minimum allowable value - ** for pageSize. */ zMaster = pPager->pTmpSpace; rc = readMasterJournal(pPager->jfd, zMaster, pPager->pVfs->mxPathname+1); if( rc==SQLITE_OK && zMaster[0] ){ rc = sqlite3OsAccess(pVfs, zMaster, SQLITE_ACCESS_EXISTS, &res); @@ -1942,16 +1433,13 @@ zMaster = 0; if( rc!=SQLITE_OK || !res ){ goto end_playback; } pPager->journalOff = 0; - needPagerReset = isHot; - /* This loop terminates either when a readJournalHdr() or - ** pager_playback_one_page() call returns SQLITE_DONE or an IO error - ** occurs. - */ + /* This loop terminates either when the readJournalHdr() call returns + ** SQLITE_DONE or an IO error occurs. */ while( 1 ){ /* Read the next journal header from the journal file. If there are ** not enough bytes left in the journal file for a complete header, or ** it is corrupted, then a process must of failed while writing it. @@ -1970,35 +1458,24 @@ ** file consists of pages, there are no more journal headers. Compute ** the value of nRec based on this assumption. */ if( nRec==0xffffffff ){ assert( pPager->journalOff==JOURNAL_HDR_SZ(pPager) ); - nRec = (int)((szJ - JOURNAL_HDR_SZ(pPager))/JOURNAL_PG_SZ(pPager)); + nRec = (szJ - JOURNAL_HDR_SZ(pPager))/JOURNAL_PG_SZ(pPager); } /* If nRec is 0 and this rollback is of a transaction created by this ** process and if this is the final header in the journal, then it means ** that this part of the journal was being filled but has not yet been ** synced to disk. Compute the number of pages based on the remaining ** size of the file. ** ** The third term of the test was added to fix ticket #2565. - ** When rolling back a hot journal, nRec==0 always means that the next - ** chunk of the journal contains zero pages to be rolled back. But - ** when doing a ROLLBACK and the nRec==0 chunk is the last chunk in - ** the journal, it means that the journal might contain additional - ** pages that need to be rolled back and that the number of pages - ** should be computed based on the journal file size. */ - testcase( nRec==0 && !isHot - && pPager->journalHdr+JOURNAL_HDR_SZ(pPager)!=pPager->journalOff - && ((szJ - pPager->journalOff) / JOURNAL_PG_SZ(pPager))>0 - && pagerNextJournalPageIsValid(pPager) - ); if( nRec==0 && !isHot && pPager->journalHdr+JOURNAL_HDR_SZ(pPager)==pPager->journalOff ){ - nRec = (int)((szJ - pPager->journalOff) / JOURNAL_PG_SZ(pPager)); + nRec = (szJ - pPager->journalOff) / JOURNAL_PG_SZ(pPager); } /* If this is the first header read from the journal, truncate the ** database file back to its original size. */ @@ -2005,22 +1482,16 @@ if( pPager->journalOff==JOURNAL_HDR_SZ(pPager) ){ rc = pager_truncate(pPager, mxPg); if( rc!=SQLITE_OK ){ goto end_playback; } - pPager->dbSize = mxPg; } - /* Copy original pages out of the journal and back into the - ** database file and/or page cache. + /* Copy original pages out of the journal and back into the database file. */ for(u=0; ujournalOff, 0, 0); + rc = pager_playback_one_page(pPager, pPager->jfd, pPager->journalOff, 1); if( rc!=SQLITE_OK ){ if( rc==SQLITE_DONE ){ rc = SQLITE_OK; pPager->journalOff = szJ; break; @@ -2037,46 +1508,22 @@ } /*NOTREACHED*/ assert( 0 ); end_playback: - /* Following a rollback, the database file should be back in its original - ** state prior to the start of the transaction, so invoke the - ** SQLITE_FCNTL_DB_UNCHANGED file-control method to disable the - ** assertion that the transaction counter was modified. - */ - assert( - pPager->fd->pMethods==0 || - sqlite3OsFileControl(pPager->fd,SQLITE_FCNTL_DB_UNCHANGED,0)>=SQLITE_OK - ); - - /* If this playback is happening automatically as a result of an IO or - ** malloc error that occured after the change-counter was updated but - ** before the transaction was committed, then the change-counter - ** modification may just have been reverted. If this happens in exclusive - ** mode, then subsequent transactions performed by the connection will not - ** update the change-counter at all. This may lead to cache inconsistency - ** problems for other processes at some point in the future. So, just - ** in case this has happened, clear the changeCountDone flag now. - */ - pPager->changeCountDone = pPager->tempFile; - if( rc==SQLITE_OK ){ zMaster = pPager->pTmpSpace; rc = readMasterJournal(pPager->jfd, zMaster, pPager->pVfs->mxPathname+1); - testcase( rc!=SQLITE_OK ); } if( rc==SQLITE_OK ){ rc = pager_end_transaction(pPager, zMaster[0]!='\0'); - testcase( rc!=SQLITE_OK ); } if( rc==SQLITE_OK && zMaster[0] && res ){ /* If there was a master journal and this routine will return success, ** see if it is possible to delete the master journal. */ rc = pager_delmaster(pPager, zMaster); - testcase( rc!=SQLITE_OK ); } /* The Pager.sectorSize variable may have been updated while rolling ** back a journal created by a process with a different sector size ** value. Reset it to the correct value for this process. @@ -2084,142 +1531,105 @@ setSectorSize(pPager); return rc; } /* -** Playback savepoint pSavepoint. Or, if pSavepoint==NULL, then playback -** the entire master journal file. The case pSavepoint==NULL occurs when -** a ROLLBACK TO command is invoked on a SAVEPOINT that is a transaction -** savepoint. -** -** When pSavepoint is not NULL (meaning a non-transaction savepoint is -** being rolled back), then the rollback consists of up to three stages, -** performed in the order specified: -** -** * Pages are played back from the main journal starting at byte -** offset PagerSavepoint.iOffset and continuing to -** PagerSavepoint.iHdrOffset, or to the end of the main journal -** file if PagerSavepoint.iHdrOffset is zero. -** -** * If PagerSavepoint.iHdrOffset is not zero, then pages are played -** back starting from the journal header immediately following -** PagerSavepoint.iHdrOffset to the end of the main journal file. -** -** * Pages are then played back from the sub-journal file, starting -** with the PagerSavepoint.iSubRec and continuing to the end of -** the journal file. -** -** Throughout the rollback process, each time a page is rolled back, the -** corresponding bit is set in a bitvec structure (variable pDone in the -** implementation below). This is used to ensure that a page is only -** rolled back the first time it is encountered in either journal. -** -** If pSavepoint is NULL, then pages are only played back from the main -** journal file. There is no need for a bitvec in this case. -** -** In either case, before playback commences the Pager.dbSize variable -** is reset to the value that it held at the start of the savepoint -** (or transaction). No page with a page-number greater than this value -** is played back. If one is encountered it is simply skipped. -*/ -static int pagerPlaybackSavepoint(Pager *pPager, PagerSavepoint *pSavepoint){ - i64 szJ; /* Effective size of the main journal */ - i64 iHdrOff; /* End of first segment of main-journal records */ - int rc = SQLITE_OK; /* Return code */ - Bitvec *pDone = 0; /* Bitvec to ensure pages played back only once */ - +** Playback the statement journal. +** +** This is similar to playing back the transaction journal but with +** a few extra twists. +** +** (1) The number of pages in the database file at the start of +** the statement is stored in pPager->stmtSize, not in the +** journal file itself. +** +** (2) In addition to playing back the statement journal, also +** playback all pages of the transaction journal beginning +** at offset pPager->stmtJSize. +*/ +static int pager_stmt_playback(Pager *pPager){ + i64 szJ; /* Size of the full journal */ + i64 hdrOff; + int nRec; /* Number of Records */ + int i; /* Loop counter */ + int rc; + + szJ = pPager->journalOff; + + /* Set hdrOff to be the offset just after the end of the last journal + ** page written before the first journal-header for this statement + ** transaction was written, or the end of the file if no journal + ** header was written. + */ + hdrOff = pPager->stmtHdrOff; + assert( pPager->fullSync || !hdrOff ); + if( !hdrOff ){ + hdrOff = szJ; + } + + /* Truncate the database back to its original size. + */ + rc = pager_truncate(pPager, pPager->stmtSize); assert( pPager->state>=PAGER_SHARED ); - /* Allocate a bitvec to use to store the set of pages rolled back */ - if( pSavepoint ){ - pDone = sqlite3BitvecCreate(pSavepoint->nOrig); - if( !pDone ){ - return SQLITE_NOMEM; - } - } - - /* Set the database size back to the value it was before the savepoint - ** being reverted was opened. - */ - pPager->dbSize = pSavepoint ? pSavepoint->nOrig : pPager->dbOrigSize; - - /* Use pPager->journalOff as the effective size of the main rollback - ** journal. The actual file might be larger than this in - ** PAGER_JOURNALMODE_TRUNCATE or PAGER_JOURNALMODE_PERSIST. But anything - ** past pPager->journalOff is off-limits to us. - */ - szJ = pPager->journalOff; - - /* Begin by rolling back records from the main journal starting at - ** PagerSavepoint.iOffset and continuing to the next journal header. - ** There might be records in the main journal that have a page number - ** greater than the current database size (pPager->dbSize) but those - ** will be skipped automatically. Pages are added to pDone as they - ** are played back. - */ - if( pSavepoint ){ - iHdrOff = pSavepoint->iHdrOffset ? pSavepoint->iHdrOffset : szJ; - pPager->journalOff = pSavepoint->iOffset; - while( rc==SQLITE_OK && pPager->journalOffjournalOff, 1, pDone); - } + /* Figure out how many records are in the statement journal. + */ + assert( pPager->stmtInUse && pPager->journalOpen ); + nRec = pPager->stmtNRec; + + /* Copy original pages out of the statement journal and back into the + ** database file. Note that the statement journal omits checksums from + ** each record since power-failure recovery is not important to statement + ** journals. + */ + for(i=0; ipageSize); + rc = pager_playback_one_page(pPager, pPager->stfd, offset, 0); + assert( rc!=SQLITE_DONE ); + if( rc!=SQLITE_OK ) goto end_stmt_playback; + } + + /* Now roll some pages back from the transaction journal. Pager.stmtJSize + ** was the size of the journal file when this statement was started, so + ** everything after that needs to be rolled back, either into the + ** database, the memory cache, or both. + ** + ** If it is not zero, then Pager.stmtHdrOff is the offset to the start + ** of the first journal header written during this statement transaction. + */ + pPager->journalOff = pPager->stmtJSize; + pPager->cksumInit = pPager->stmtCksum; + while( pPager->journalOff < hdrOff ){ + rc = pager_playback_one_page(pPager, pPager->jfd, pPager->journalOff, 1); assert( rc!=SQLITE_DONE ); - }else{ - pPager->journalOff = 0; + if( rc!=SQLITE_OK ) goto end_stmt_playback; } - /* Continue rolling back records out of the main journal starting at - ** the first journal header seen and continuing until the effective end - ** of the main journal file. Continue to skip out-of-range pages and - ** continue adding pages rolled back to pDone. - */ - while( rc==SQLITE_OK && pPager->journalOffjournalOff < szJ ){ + u32 nJRec; /* Number of Journal Records */ u32 dummy; rc = readJournalHdr(pPager, szJ, &nJRec, &dummy); - assert( rc!=SQLITE_DONE ); - - /* - ** The "pPager->journalHdr+JOURNAL_HDR_SZ(pPager)==pPager->journalOff" - ** test is related to ticket #2565. See the discussion in the - ** pager_playback() function for additional information. - */ - assert( !(nJRec==0 - && pPager->journalHdr+JOURNAL_HDR_SZ(pPager)!=pPager->journalOff - && ((szJ - pPager->journalOff) / JOURNAL_PG_SZ(pPager))>0 - && pagerNextJournalPageIsValid(pPager)) - ); - if( nJRec==0 - && pPager->journalHdr+JOURNAL_HDR_SZ(pPager)==pPager->journalOff - ){ - nJRec = (u32)((szJ - pPager->journalOff)/JOURNAL_PG_SZ(pPager)); - } - for(ii=0; rc==SQLITE_OK && iijournalOffjournalOff, 1, pDone); - } - assert( rc!=SQLITE_DONE ); - } - assert( rc!=SQLITE_OK || pPager->journalOff==szJ ); - - /* Finally, rollback pages from the sub-journal. Page that were - ** previously rolled back out of the main journal (and are hence in pDone) - ** will be skipped. Out-of-range pages are also skipped. - */ - if( pSavepoint ){ - u32 ii; /* Loop counter */ - i64 offset = pSavepoint->iSubRec*(4+pPager->pageSize); - for(ii=pSavepoint->iSubRec; rc==SQLITE_OK && iinSubRec; ii++){ - assert( offset==ii*(4+pPager->pageSize) ); - rc = pager_playback_one_page(pPager, 0, &offset, 1, pDone); - } - assert( rc!=SQLITE_DONE ); - } - - sqlite3BitvecDestroy(pDone); - if( rc==SQLITE_OK ){ + if( rc!=SQLITE_OK ){ + assert( rc!=SQLITE_DONE ); + goto end_stmt_playback; + } + if( nJRec==0 ){ + nJRec = (szJ - pPager->journalOff) / (pPager->pageSize+8); + } + for(i=nJRec-1; i>=0 && pPager->journalOff < szJ; i--){ + rc = pager_playback_one_page(pPager, pPager->jfd, pPager->journalOff, 1); + assert( rc!=SQLITE_DONE ); + if( rc!=SQLITE_OK ) goto end_stmt_playback; + } + } + + pPager->journalOff = szJ; + +end_stmt_playback: + if( rc==SQLITE_OK) { pPager->journalOff = szJ; + /* pager_reload_cache(pPager); */ } return rc; } /* @@ -2255,12 +1665,12 @@ ** Numeric values associated with these states are OFF==1, NORMAL=2, ** and FULL=3. */ #ifndef SQLITE_OMIT_PAGER_PRAGMAS void sqlite3PagerSetSafetyLevel(Pager *pPager, int level, int bFullFsync){ - pPager->noSync = (level==1 || pPager->tempFile) ?1:0; - pPager->fullSync = (level==3 && !pPager->tempFile) ?1:0; + pPager->noSync = level==1 || pPager->tempFile || MEMDB; + pPager->fullSync = level==3 && !pPager->tempFile; pPager->sync_flags = (bFullFsync?SQLITE_SYNC_FULL:SQLITE_SYNC_NORMAL); if( pPager->noSync ) pPager->needSync = 0; } #endif @@ -2272,112 +1682,278 @@ #ifdef SQLITE_TEST int sqlite3_opentemp_count = 0; #endif /* -** Open a temporary file. -** -** Write the file descriptor into *pFile. Return SQLITE_OK on success -** or some other error code if we fail. The OS will automatically -** delete the temporary file when it is closed. -** -** The flags passed to the VFS layer xOpen() call are those specified -** by parameter vfsFlags ORed with the following: -** -** SQLITE_OPEN_READWRITE -** SQLITE_OPEN_CREATE -** SQLITE_OPEN_EXCLUSIVE -** SQLITE_OPEN_DELETEONCLOSE -*/ -static int pagerOpentemp( +** Open a temporary file. +** +** Write the file descriptor into *fd. Return SQLITE_OK on success or some +** other error code if we fail. The OS will automatically delete the temporary +** file when it is closed. +*/ +static int sqlite3PagerOpentemp( Pager *pPager, /* The pager object */ sqlite3_file *pFile, /* Write the file descriptor here */ int vfsFlags /* Flags passed through to the VFS */ ){ - int rc; /* Return code */ + int rc; #ifdef SQLITE_TEST sqlite3_opentemp_count++; /* Used for testing and analysis only */ #endif vfsFlags |= SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_EXCLUSIVE | SQLITE_OPEN_DELETEONCLOSE; rc = sqlite3OsOpen(pPager->pVfs, 0, pFile, vfsFlags, 0); - assert( rc!=SQLITE_OK || isOpen(pFile) ); + assert( rc!=SQLITE_OK || pFile->pMethods ); return rc; } + +static int pagerStress(void *,PgHdr *); + +/* +** Create a new page cache and put a pointer to the page cache in *ppPager. +** The file to be cached need not exist. The file is not locked until +** the first call to sqlite3PagerGet() and is only held open until the +** last page is released using sqlite3PagerUnref(). +** +** If zFilename is NULL then a randomly-named temporary file is created +** and used as the file to be cached. The file will be deleted +** automatically when it is closed. +** +** If zFilename is ":memory:" then all information is held in cache. +** It is never written to disk. This can be used to implement an +** in-memory database. +*/ +int sqlite3PagerOpen( + sqlite3_vfs *pVfs, /* The virtual file system to use */ + Pager **ppPager, /* Return the Pager structure here */ + const char *zFilename, /* Name of the database file to open */ + int nExtra, /* Extra bytes append to each in-memory page */ + int flags, /* flags controlling this file */ + int vfsFlags /* flags passed through to sqlite3_vfs.xOpen() */ +){ + u8 *pPtr; + Pager *pPager = 0; + int rc = SQLITE_OK; + int i; + int tempFile = 0; + int memDb = 0; + int readOnly = 0; + int useJournal = (flags & PAGER_OMIT_JOURNAL)==0; + int noReadlock = (flags & PAGER_NO_READLOCK)!=0; + int journalFileSize = sqlite3JournalSize(pVfs); + int pcacheSize = sqlite3PcacheSize(); + int szPageDflt = SQLITE_DEFAULT_PAGE_SIZE; + char *zPathname = 0; + int nPathname = 0; + + /* The default return is a NULL pointer */ + *ppPager = 0; + + /* Compute and store the full pathname in an allocated buffer pointed + ** to by zPathname, length nPathname. Or, if this is a temporary file, + ** leave both nPathname and zPathname set to 0. + */ + if( zFilename && zFilename[0] ){ + nPathname = pVfs->mxPathname+1; + zPathname = sqlite3Malloc(nPathname*2); + if( zPathname==0 ){ + return SQLITE_NOMEM; + } +#ifndef SQLITE_OMIT_MEMORYDB + if( strcmp(zFilename,":memory:")==0 ){ + memDb = 1; + zPathname[0] = 0; + useJournal = 0; + }else +#endif + { + rc = sqlite3OsFullPathname(pVfs, zFilename, nPathname, zPathname); + } + if( rc!=SQLITE_OK ){ + sqlite3_free(zPathname); + return rc; + } + nPathname = strlen(zPathname); + } + + /* Allocate memory for the pager structure */ + pPager = sqlite3MallocZero( + sizeof(*pPager) + /* Pager structure */ + pcacheSize + /* PCache object */ + journalFileSize + /* The journal file structure */ + pVfs->szOsFile * 3 + /* The main db and two journal files */ + 3*nPathname + 40 /* zFilename, zDirectory, zJournal */ + ); + if( !pPager ){ + sqlite3_free(zPathname); + return SQLITE_NOMEM; + } + pPager->pPCache = (PCache *)&pPager[1]; + pPtr = ((u8 *)&pPager[1]) + pcacheSize; + pPager->vfsFlags = vfsFlags; + pPager->fd = (sqlite3_file*)&pPtr[pVfs->szOsFile*0]; + pPager->stfd = (sqlite3_file*)&pPtr[pVfs->szOsFile*1]; + pPager->jfd = (sqlite3_file*)&pPtr[pVfs->szOsFile*2]; + pPager->zFilename = (char*)&pPtr[pVfs->szOsFile*2+journalFileSize]; + pPager->zDirectory = &pPager->zFilename[nPathname+1]; + pPager->zJournal = &pPager->zDirectory[nPathname+1]; + pPager->pVfs = pVfs; + if( zPathname ){ + memcpy(pPager->zFilename, zPathname, nPathname+1); + sqlite3_free(zPathname); + } + + /* Open the pager file. + */ + if( zFilename && zFilename[0] && !memDb ){ + if( nPathname>(pVfs->mxPathname - sizeof("-journal")) ){ + rc = SQLITE_CANTOPEN; + }else{ + int fout = 0; + rc = sqlite3OsOpen(pVfs, pPager->zFilename, pPager->fd, + pPager->vfsFlags, &fout); + readOnly = (fout&SQLITE_OPEN_READONLY); + + /* If the file was successfully opened for read/write access, + ** choose a default page size in case we have to create the + ** database file. The default page size is the maximum of: + ** + ** + SQLITE_DEFAULT_PAGE_SIZE, + ** + The value returned by sqlite3OsSectorSize() + ** + The largest page size that can be written atomically. + */ + if( rc==SQLITE_OK && !readOnly ){ + int iSectorSize = sqlite3OsSectorSize(pPager->fd); + if( szPageDfltfd); + int ii; + assert(SQLITE_IOCAP_ATOMIC512==(512>>8)); + assert(SQLITE_IOCAP_ATOMIC64K==(65536>>8)); + assert(SQLITE_MAX_DEFAULT_PAGE_SIZE<=65536); + for(ii=szPageDflt; ii<=SQLITE_MAX_DEFAULT_PAGE_SIZE; ii=ii*2){ + if( iDc&(SQLITE_IOCAP_ATOMIC|(ii>>8)) ) szPageDflt = ii; + } + } +#endif + if( szPageDflt>SQLITE_MAX_DEFAULT_PAGE_SIZE ){ + szPageDflt = SQLITE_MAX_DEFAULT_PAGE_SIZE; + } + } + } + }else if( !memDb ){ + /* If a temporary file is requested, it is not opened immediately. + ** In this case we accept the default page size and delay actually + ** opening the file until the first call to OsWrite(). + */ + tempFile = 1; + pPager->state = PAGER_EXCLUSIVE; + } + + if( pPager && rc==SQLITE_OK ){ + pPager->pTmpSpace = sqlite3PageMalloc(szPageDflt); + } + + /* If an error occured in either of the blocks above. + ** Free the Pager structure and close the file. + ** Since the pager is not allocated there is no need to set + ** any Pager.errMask variables. + */ + if( !pPager || !pPager->pTmpSpace ){ + sqlite3OsClose(pPager->fd); + sqlite3_free(pPager); + return ((rc==SQLITE_OK)?SQLITE_NOMEM:rc); + } + nExtra = FORCE_ALIGNMENT(nExtra); + sqlite3PcacheOpen(szPageDflt, nExtra, !memDb, + !memDb?pagerStress:0, (void *)pPager, pPager->pPCache); + + PAGERTRACE3("OPEN %d %s\n", FILEHANDLEID(pPager->fd), pPager->zFilename); + IOTRACE(("OPEN %p %s\n", pPager, pPager->zFilename)) + + /* Fill in Pager.zDirectory[] */ + memcpy(pPager->zDirectory, pPager->zFilename, nPathname+1); + for(i=strlen(pPager->zDirectory); i>0 && pPager->zDirectory[i-1]!='/'; i--){} + if( i>0 ) pPager->zDirectory[i-1] = 0; + + /* Fill in Pager.zJournal[] */ + if( zPathname ){ + memcpy(pPager->zJournal, pPager->zFilename, nPathname); + memcpy(&pPager->zJournal[nPathname], "-journal", 9); + }else{ + pPager->zJournal = 0; + } + + /* pPager->journalOpen = 0; */ + pPager->useJournal = useJournal; + pPager->noReadlock = noReadlock && readOnly; + /* pPager->stmtOpen = 0; */ + /* pPager->stmtInUse = 0; */ + /* pPager->nRef = 0; */ + pPager->dbSize = memDb-1; + pPager->pageSize = szPageDflt; + /* pPager->stmtSize = 0; */ + /* pPager->stmtJSize = 0; */ + /* pPager->nPage = 0; */ + pPager->mxPage = 100; + pPager->mxPgno = SQLITE_MAX_PAGE_COUNT; + /* pPager->state = PAGER_UNLOCK; */ + assert( pPager->state == (tempFile ? PAGER_EXCLUSIVE : PAGER_UNLOCK) ); + /* pPager->errMask = 0; */ + pPager->tempFile = tempFile; + assert( tempFile==PAGER_LOCKINGMODE_NORMAL + || tempFile==PAGER_LOCKINGMODE_EXCLUSIVE ); + assert( PAGER_LOCKINGMODE_EXCLUSIVE==1 ); + pPager->exclusiveMode = tempFile; + pPager->memDb = memDb; + pPager->readOnly = readOnly; + /* pPager->needSync = 0; */ + pPager->noSync = pPager->tempFile || !useJournal; + pPager->fullSync = (pPager->noSync?0:1); + pPager->sync_flags = SQLITE_SYNC_NORMAL; + /* pPager->pFirst = 0; */ + /* pPager->pFirstSynced = 0; */ + /* pPager->pLast = 0; */ + pPager->nExtra = nExtra; + pPager->journalSizeLimit = SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT; + assert(pPager->fd->pMethods||memDb||tempFile); + if( !memDb ){ + setSectorSize(pPager); + } + /* pPager->pBusyHandler = 0; */ + /* memset(pPager->aHash, 0, sizeof(pPager->aHash)); */ + *ppPager = pPager; + return SQLITE_OK; +} /* ** Set the busy handler function. -** -** The pager invokes the busy-handler if sqlite3OsLock() returns -** SQLITE_BUSY when trying to upgrade from no-lock to a SHARED lock, -** or when trying to upgrade from a RESERVED lock to an EXCLUSIVE -** lock. It does *not* invoke the busy handler when upgrading from -** SHARED to RESERVED, or when upgrading from SHARED to EXCLUSIVE -** (which occurs during hot-journal rollback). Summary: -** -** Transition | Invokes xBusyHandler -** -------------------------------------------------------- -** NO_LOCK -> SHARED_LOCK | Yes -** SHARED_LOCK -> RESERVED_LOCK | No -** SHARED_LOCK -> EXCLUSIVE_LOCK | No -** RESERVED_LOCK -> EXCLUSIVE_LOCK | Yes -** -** If the busy-handler callback returns non-zero, the lock is -** retried. If it returns zero, then the SQLITE_BUSY error is -** returned to the caller of the pager API function. */ -void sqlite3PagerSetBusyhandler( - Pager *pPager, /* Pager object */ - int (*xBusyHandler)(void *), /* Pointer to busy-handler function */ - void *pBusyHandlerArg /* Argument to pass to xBusyHandler */ -){ - pPager->xBusyHandler = xBusyHandler; - pPager->pBusyHandlerArg = pBusyHandlerArg; +void sqlite3PagerSetBusyhandler(Pager *pPager, BusyHandler *pBusyHandler){ + pPager->pBusyHandler = pBusyHandler; } /* -** Set the reinitializer for this pager. If not NULL, the reinitializer -** is called when the content of a page in cache is modified (restored) -** as part of a transaction or savepoint rollback. The callback gives -** higher-level code an opportunity to restore the EXTRA section to -** agree with the restored page data. +** Set the reinitializer for this pager. If not NULL, the reinitializer +** is called when the content of a page in cache is restored to its original +** value as a result of a rollback. The callback gives higher-level code +** an opportunity to restore the EXTRA section to agree with the restored +** page data. */ void sqlite3PagerSetReiniter(Pager *pPager, void (*xReinit)(DbPage*)){ pPager->xReiniter = xReinit; } /* -** Change the page size used by the Pager object. The new page size -** is passed in *pPageSize. -** -** If the pager is in the error state when this function is called, it -** is a no-op. The value returned is the error state error code (i.e. -** one of SQLITE_IOERR, SQLITE_CORRUPT or SQLITE_FULL). -** -** Otherwise, if all of the following are true: -** -** * the new page size (value of *pPageSize) is valid (a power -** of two between 512 and SQLITE_MAX_PAGE_SIZE, inclusive), and -** -** * there are no outstanding page references, and -** -** * the database is either not an in-memory database or it is -** an in-memory database that currently consists of zero pages. -** -** then the pager object page size is set to *pPageSize. -** -** If the page size is changed, then this function uses sqlite3PagerMalloc() -** to obtain a new Pager.pTmpSpace buffer. If this allocation attempt -** fails, SQLITE_NOMEM is returned and the page size remains unchanged. -** In all other cases, SQLITE_OK is returned. -** -** If the page size is not changed, either because one of the enumerated -** conditions above is not true, the pager was in error state when this -** function was called, or because the memory allocation attempt failed, -** then *pPageSize is set to the old, retained page size before returning. +** Set the page size to *pPageSize. If the suggest new page size is +** inappropriate, then an alternative page size is set to that +** value before returning. */ int sqlite3PagerSetPagesize(Pager *pPager, u16 *pPageSize){ int rc = pPager->errCode; if( rc==SQLITE_OK ){ u16 pageSize = *pPageSize; @@ -2390,16 +1966,17 @@ if( !pNew ){ rc = SQLITE_NOMEM; }else{ pager_reset(pPager); pPager->pageSize = pageSize; + if( !pPager->memDb ) setSectorSize(pPager); sqlite3PageFree(pPager->pTmpSpace); pPager->pTmpSpace = pNew; sqlite3PcacheSetPageSize(pPager->pPCache, pageSize); } } - *pPageSize = (u16)pPager->pageSize; + *pPageSize = pPager->pageSize; } return rc; } /* @@ -2455,25 +2032,21 @@ /* ** Read the first N bytes from the beginning of the file into memory ** that pDest points to. ** -** If the pager was opened on a transient file (zFilename==""), or -** opened on a file less than N bytes in size, the output buffer is -** zeroed and SQLITE_OK returned. The rationale for this is that this -** function is used to read database headers, and a new transient or -** zero sized database has a header than consists entirely of zeroes. -** -** If any IO error apart from SQLITE_IOERR_SHORT_READ is encountered, -** the error code is returned to the caller and the contents of the -** output buffer undefined. +** No error checking is done. The rational for this is that this function +** may be called even if the file does not exist or contain a header. In +** these cases sqlite3OsRead() will return an error, to which the correct +** response is to zero the memory at pDest and continue. A real IO error +** will presumably recur and be picked up later (Todo: Think about this). */ int sqlite3PagerReadFileheader(Pager *pPager, int N, unsigned char *pDest){ int rc = SQLITE_OK; memset(pDest, 0, N); - assert( isOpen(pPager->fd) || pPager->tempFile ); - if( isOpen(pPager->fd) ){ + assert(MEMDB||pPager->fd->pMethods||pPager->tempFile); + if( pPager->fd->pMethods ){ IOTRACE(("DBHDR %p 0 %d\n", pPager, N)) rc = sqlite3OsRead(pPager->fd, pDest, N, 0); if( rc==SQLITE_IOERR_SHORT_READ ){ rc = SQLITE_OK; } @@ -2480,132 +2053,139 @@ } return rc; } /* -** Return the total number of pages in the database file associated -** with pPager. Normally, this is calculated as (/). -** However, if the file is between 1 and bytes in size, then -** this is considered a 1 page file. -** -** If the pager is in error state when this function is called, then the -** error state error code is returned and *pnPage left unchanged. Or, -** if the file system has to be queried for the size of the file and -** the query attempt returns an IO error, the IO error code is returned -** and *pnPage is left unchanged. -** -** Otherwise, if everything is successful, then SQLITE_OK is returned -** and *pnPage is set to the number of pages in the database. +** Return the total number of pages in the disk file associated with +** pPager. +** +** If the PENDING_BYTE lies on the page directly after the end of the +** file, then consider this page part of the file too. For example, if +** PENDING_BYTE is byte 4096 (the first byte of page 5) and the size of the +** file is 4096 bytes, 5 is returned instead of 4. */ int sqlite3PagerPagecount(Pager *pPager, int *pnPage){ - Pgno nPage; /* Value to return via *pnPage */ - - /* If the pager is already in the error state, return the error code. */ + i64 n = 0; + int rc; + assert( pPager!=0 ); if( pPager->errCode ){ - return pPager->errCode; - } - - /* Determine the number of pages in the file. Store this in nPage. */ - if( pPager->dbSizeValid ){ - nPage = pPager->dbSize; - }else{ - int rc; /* Error returned by OsFileSize() */ - i64 n = 0; /* File size in bytes returned by OsFileSize() */ - - assert( isOpen(pPager->fd) || pPager->tempFile ); - if( isOpen(pPager->fd) && (0 != (rc = sqlite3OsFileSize(pPager->fd, &n))) ){ + rc = pPager->errCode; + return rc; + } + if( pPager->dbSize>=0 ){ + n = pPager->dbSize; + } else { + assert(pPager->fd->pMethods||pPager->tempFile); + if( (pPager->fd->pMethods) + && (rc = sqlite3OsFileSize(pPager->fd, &n))!=SQLITE_OK ){ pager_error(pPager, rc); return rc; } if( n>0 && npageSize ){ - nPage = 1; + n = 1; }else{ - nPage = (Pgno)(n / pPager->pageSize); + n /= pPager->pageSize; } if( pPager->state!=PAGER_UNLOCK ){ - pPager->dbSize = nPage; - pPager->dbFileSize = nPage; - pPager->dbSizeValid = 1; - } - } - - /* If the current number of pages in the file is greater than the - ** configured maximum pager number, increase the allowed limit so - ** that the file can be read. - */ - if( nPage>pPager->mxPgno ){ - pPager->mxPgno = (Pgno)nPage; - } - - /* Set the output variable and return SQLITE_OK */ + pPager->dbSize = n; + } + } + if( n==(PENDING_BYTE/pPager->pageSize) ){ + n++; + } + if( n>pPager->mxPgno ){ + pPager->mxPgno = n; + } if( pnPage ){ - *pnPage = nPage; + *pnPage = n; } return SQLITE_OK; } +/* +** Forward declaration +*/ +static int syncJournal(Pager*); + +/* +** This routine is used to truncate the cache when a database +** is truncated. Drop from the cache all pages whose pgno is +** larger than pPager->dbSize and is unreferenced. +** +** Referenced pages larger than pPager->dbSize are zeroed. +** +** Actually, at the point this routine is called, it would be +** an error to have a referenced page. But rather than delete +** that page and guarantee a subsequent segfault, it seems better +** to zero it and hope that we error out sanely. +*/ +static void pager_truncate_cache(Pager *pPager){ + sqlite3PcacheTruncate(pPager->pPCache, pPager->dbSize); +} /* -** Try to obtain a lock of type locktype on the database file. If -** a similar or greater lock is already held, this function is a no-op -** (returning SQLITE_OK immediately). -** -** Otherwise, attempt to obtain the lock using sqlite3OsLock(). Invoke -** the busy callback if the lock is currently not available. Repeat -** until the busy callback returns false or until the attempt to -** obtain the lock succeeds. +** Try to obtain a lock on a file. Invoke the busy callback if the lock +** is currently not available. Repeat until the busy callback returns +** false or until the lock succeeds. ** ** Return SQLITE_OK on success and an error code if we cannot obtain -** the lock. If the lock is obtained successfully, set the Pager.state -** variable to locktype before returning. +** the lock. */ static int pager_wait_on_lock(Pager *pPager, int locktype){ - int rc; /* Return code */ + int rc; /* The OS lock values must be the same as the Pager lock values */ assert( PAGER_SHARED==SHARED_LOCK ); assert( PAGER_RESERVED==RESERVED_LOCK ); assert( PAGER_EXCLUSIVE==EXCLUSIVE_LOCK ); /* If the file is currently unlocked then the size must be unknown */ - assert( pPager->state>=PAGER_SHARED || pPager->dbSizeValid==0 ); - - /* Check that this is either a no-op (because the requested lock is - ** already held, or one of the transistions that the busy-handler - ** may be invoked during, according to the comment above - ** sqlite3PagerSetBusyhandler(). - */ - assert( (pPager->state>=locktype) - || (pPager->state==PAGER_UNLOCK && locktype==PAGER_SHARED) - || (pPager->state==PAGER_RESERVED && locktype==PAGER_EXCLUSIVE) - ); + assert( pPager->state>=PAGER_SHARED || pPager->dbSize<0 || MEMDB ); if( pPager->state>=locktype ){ rc = SQLITE_OK; }else{ + if( pPager->pBusyHandler ) pPager->pBusyHandler->nBusy = 0; do { rc = sqlite3OsLock(pPager->fd, locktype); - }while( rc==SQLITE_BUSY && pPager->xBusyHandler(pPager->pBusyHandlerArg) ); + }while( rc==SQLITE_BUSY && sqlite3InvokeBusyHandler(pPager->pBusyHandler) ); if( rc==SQLITE_OK ){ - pPager->state = (u8)locktype; + pPager->state = locktype; IOTRACE(("LOCK %p %d\n", pPager, locktype)) } } return rc; } /* -** Truncate the in-memory database file image to nPage pages. This -** function does not actually modify the database file on disk. It -** just sets the internal state of the pager object so that the -** truncation will be done when the current transaction is committed. +** Truncate the file to the number of pages specified. */ -void sqlite3PagerTruncateImage(Pager *pPager, Pgno nPage){ - assert( pPager->dbSizeValid ); - assert( pPager->dbSize>=nPage ); - assert( pPager->state>=PAGER_RESERVED ); - pPager->dbSize = nPage; +int sqlite3PagerTruncate(Pager *pPager, Pgno nPage){ + int rc = SQLITE_OK; + assert( pPager->state>=PAGER_SHARED || MEMDB ); + + + sqlite3PagerPagecount(pPager, 0); + if( pPager->errCode ){ + rc = pPager->errCode; + }else if( nPage<(unsigned)pPager->dbSize ){ + if( MEMDB ){ + pPager->dbSize = nPage; + pager_truncate_cache(pPager); + }else{ + rc = syncJournal(pPager); + if( rc==SQLITE_OK ){ + /* Get an exclusive lock on the database before truncating. */ + rc = pager_wait_on_lock(pPager, EXCLUSIVE_LOCK); + } + if( rc==SQLITE_OK ){ + rc = pager_truncate(pPager, nPage); + } + } + } + + return rc; } /* ** Shutdown the page cache. Free all memory and close all files. ** @@ -2619,144 +2199,97 @@ ** is made to roll it back. If an error occurs during the rollback ** a hot journal may be left in the filesystem but no error is returned ** to the caller. */ int sqlite3PagerClose(Pager *pPager){ + disable_simulated_io_errors(); sqlite3BeginBenignMalloc(); pPager->errCode = 0; pPager->exclusiveMode = 0; pager_reset(pPager); - if( MEMDB ){ - pager_unlock(pPager); - }else{ - /* Set Pager.journalHdr to -1 for the benefit of the pager_playback() - ** call which may be made from within pagerUnlockAndRollback(). If it - ** is not -1, then the unsynced portion of an open journal file may - ** be played back into the database. If a power failure occurs while - ** this is happening, the database may become corrupt. - */ - pPager->journalHdr = -1; - pagerUnlockAndRollback(pPager); - } + pagerUnlockAndRollback(pPager); + enable_simulated_io_errors(); sqlite3EndBenignMalloc(); - enable_simulated_io_errors(); - PAGERTRACE(("CLOSE %d\n", PAGERID(pPager))); + PAGERTRACE2("CLOSE %d\n", PAGERID(pPager)); IOTRACE(("CLOSE %p\n", pPager)) + if( pPager->journalOpen ){ + sqlite3OsClose(pPager->jfd); + } + sqlite3BitvecDestroy(pPager->pInJournal); + sqlite3BitvecDestroy(pPager->pAlwaysRollback); + if( pPager->stmtOpen ){ + sqlite3OsClose(pPager->stfd); + } sqlite3OsClose(pPager->fd); + /* Temp files are automatically deleted by the OS + ** if( pPager->tempFile ){ + ** sqlite3OsDelete(pPager->zFilename); + ** } + */ + sqlite3PageFree(pPager->pTmpSpace); sqlite3PcacheClose(pPager->pPCache); - - assert( !pPager->aSavepoint && !pPager->pInJournal ); - assert( !isOpen(pPager->jfd) && !isOpen(pPager->sjfd) ); - sqlite3_free(pPager); return SQLITE_OK; } #if !defined(NDEBUG) || defined(SQLITE_TEST) /* -** Return the page number for page pPg. +** Return the page number for the given page data. */ -Pgno sqlite3PagerPagenumber(DbPage *pPg){ - return pPg->pgno; +Pgno sqlite3PagerPagenumber(DbPage *p){ + return p->pgno; } #endif /* -** Increment the reference count for page pPg. +** Increment the reference count for a page. The input pointer is +** a reference to the page data. */ -void sqlite3PagerRef(DbPage *pPg){ +int sqlite3PagerRef(DbPage *pPg){ sqlite3PcacheRef(pPg); + return SQLITE_OK; } /* -** Sync the journal. In other words, make sure all the pages that have +** Sync the journal. In other words, make sure all the pages that have ** been written to the journal have actually reached the surface of the -** disk and can be restored in the event of a hot-journal rollback. -** -** If the Pager.needSync flag is not set, then this function is a -** no-op. Otherwise, the actions required depend on the journal-mode -** and the device characteristics of the the file-system, as follows: -** -** * If the journal file is an in-memory journal file, no action need -** be taken. -** -** * Otherwise, if the device does not support the SAFE_APPEND property, -** then the nRec field of the most recently written journal header -** is updated to contain the number of journal records that have -** been written following it. If the pager is operating in full-sync -** mode, then the journal file is synced before this field is updated. -** -** * If the device does not support the SEQUENTIAL property, then -** journal file is synced. -** -** Or, in pseudo-code: -** -** if( NOT ){ -** if( NOT SAFE_APPEND ){ -** if( ) xSync(); -** -** } -** if( NOT SEQUENTIAL ) xSync(); -** } -** -** The Pager.needSync flag is never be set for temporary files, or any -** file operating in no-sync mode (Pager.noSync set to non-zero). -** -** If successful, this routine clears the PGHDR_NEED_SYNC flag of every -** page currently held in memory before returning SQLITE_OK. If an IO -** error is encountered, then the IO error code is returned to the caller. +** disk. It is not safe to modify the original database file until after +** the journal has been synced. If the original database is modified before +** the journal is synced and a power failure occurs, the unsynced journal +** data would be lost and we would be unable to completely rollback the +** database changes. Database corruption would occur. +** +** This routine also updates the nRec field in the header of the journal. +** (See comments on the pager_playback() routine for additional information.) +** If the sync mode is FULL, two syncs will occur. First the whole journal +** is synced, then the nRec field is updated, then a second sync occurs. +** +** For temporary databases, we do not care if we are able to rollback +** after a power failure, so no sync occurs. +** +** If the IOCAP_SEQUENTIAL flag is set for the persistent media on which +** the database is stored, then OsSync() is never called on the journal +** file. In this case all that is required is to update the nRec field in +** the journal header. +** +** This routine clears the needSync field of every page current held in +** memory. */ static int syncJournal(Pager *pPager){ + int rc = SQLITE_OK; + + /* Sync the journal before modifying the main database + ** (assuming there is a journal and it needs to be synced.) + */ if( pPager->needSync ){ - assert( !pPager->tempFile ); - if( pPager->journalMode!=PAGER_JOURNALMODE_MEMORY ){ - int rc; /* Return code */ - const int iDc = sqlite3OsDeviceCharacteristics(pPager->fd); - assert( isOpen(pPager->jfd) ); + if( !pPager->tempFile ){ + int iDc = sqlite3OsDeviceCharacteristics(pPager->fd); + assert( pPager->journalOpen ); if( 0==(iDc&SQLITE_IOCAP_SAFE_APPEND) ){ - /* Variable iNRecOffset is set to the offset in the journal file - ** of the nRec field of the most recently written journal header. - ** This field will be updated following the xSync() operation - ** on the journal file. */ - i64 iNRecOffset = pPager->journalHdr + sizeof(aJournalMagic); - - /* This block deals with an obscure problem. If the last connection - ** that wrote to this database was operating in persistent-journal - ** mode, then the journal file may at this point actually be larger - ** than Pager.journalOff bytes. If the next thing in the journal - ** file happens to be a journal-header (written as part of the - ** previous connections transaction), and a crash or power-failure - ** occurs after nRec is updated but before this connection writes - ** anything else to the journal file (or commits/rolls back its - ** transaction), then SQLite may become confused when doing the - ** hot-journal rollback following recovery. It may roll back all - ** of this connections data, then proceed to rolling back the old, - ** out-of-date data that follows it. Database corruption. - ** - ** To work around this, if the journal file does appear to contain - ** a valid header following Pager.journalOff, then write a 0x00 - ** byte to the start of it to prevent it from being recognized. - ** - ** Variable iNextHdrOffset is set to the offset at which this - ** problematic header will occur, if it exists. aMagic is used - ** as a temporary buffer to inspect the first couple of bytes of - ** the potential journal header. - */ - i64 iNextHdrOffset = journalHdrOffset(pPager); - u8 aMagic[8]; - rc = sqlite3OsRead(pPager->jfd, aMagic, 8, iNextHdrOffset); - if( rc==SQLITE_OK && 0==memcmp(aMagic, aJournalMagic, 8) ){ - static const u8 zerobyte = 0; - rc = sqlite3OsWrite(pPager->jfd, &zerobyte, 1, iNextHdrOffset); - } - if( rc!=SQLITE_OK && rc!=SQLITE_IOERR_SHORT_READ ){ - return rc; - } - /* Write the nRec value into the journal file header. If in ** full-synchronous mode, sync the journal first. This ensures that ** all data has really hit the disk before nRec is updated to mark ** it as a candidate for rollback. ** @@ -2764,83 +2297,70 @@ ** SAFE_APPEND property. Because in this case it is not possible ** for garbage data to be appended to the file, the nRec field ** is populated with 0xFFFFFFFF when the journal header is written ** and never needs to be updated. */ + i64 jrnlOff; if( pPager->fullSync && 0==(iDc&SQLITE_IOCAP_SEQUENTIAL) ){ - PAGERTRACE(("SYNC journal of %d\n", PAGERID(pPager))); + PAGERTRACE2("SYNC journal of %d\n", PAGERID(pPager)); IOTRACE(("JSYNC %p\n", pPager)) rc = sqlite3OsSync(pPager->jfd, pPager->sync_flags); - if( rc!=SQLITE_OK ) return rc; + if( rc!=0 ) return rc; } - IOTRACE(("JHDR %p %lld %d\n", pPager, iNRecOffset, 4)); - rc = write32bits(pPager->jfd, iNRecOffset, pPager->nRec); - if( rc!=SQLITE_OK ) return rc; + + jrnlOff = pPager->journalHdr + sizeof(aJournalMagic); + IOTRACE(("JHDR %p %lld %d\n", pPager, jrnlOff, 4)); + rc = write32bits(pPager->jfd, jrnlOff, pPager->nRec); + if( rc ) return rc; } if( 0==(iDc&SQLITE_IOCAP_SEQUENTIAL) ){ - PAGERTRACE(("SYNC journal of %d\n", PAGERID(pPager))); + PAGERTRACE2("SYNC journal of %d\n", PAGERID(pPager)); IOTRACE(("JSYNC %p\n", pPager)) rc = sqlite3OsSync(pPager->jfd, pPager->sync_flags| (pPager->sync_flags==SQLITE_SYNC_FULL?SQLITE_SYNC_DATAONLY:0) ); - if( rc!=SQLITE_OK ) return rc; + if( rc!=0 ) return rc; } + pPager->journalStarted = 1; } - - /* The journal file was just successfully synced. Set Pager.needSync - ** to zero and clear the PGHDR_NEED_SYNC flag on all pagess. - */ pPager->needSync = 0; - pPager->journalStarted = 1; - sqlite3PcacheClearSyncFlags(pPager->pPCache); + + /* Erase the needSync flag from every page. + */ + sqlite3PcacheClearFlags(pPager->pPCache, PGHDR_NEED_SYNC); + } + +#ifndef NDEBUG + /* If the Pager.needSync flag is clear then the PgHdr.needSync + ** flag must also be clear for all pages. Verify that this + ** invariant is true. + */ + else{ + sqlite3PcacheAssertFlags(pPager->pPCache, 0, PGHDR_NEED_SYNC); } +#endif - return SQLITE_OK; + return rc; } /* -** The argument is the first in a linked list of dirty pages connected -** by the PgHdr.pDirty pointer. This function writes each one of the -** in-memory pages in the list to the database file. The argument may -** be NULL, representing an empty list. In this case this function is -** a no-op. -** -** The pager must hold at least a RESERVED lock when this function -** is called. Before writing anything to the database file, this lock -** is upgraded to an EXCLUSIVE lock. If the lock cannot be obtained, -** SQLITE_BUSY is returned and no data is written to the database file. -** -** If the pager is a temp-file pager and the actual file-system file -** is not yet open, it is created and opened before any data is -** written out. -** -** Once the lock has been upgraded and, if necessary, the file opened, -** the pages are written out to the database file in list order. Writing -** a page is skipped if it meets either of the following criteria: -** -** * The page number is greater than Pager.dbSize, or -** * The PGHDR_DONT_WRITE flag is set on the page. -** -** If writing out a page causes the database file to grow, Pager.dbFileSize -** is updated accordingly. If page 1 is written out, then the value cached -** in Pager.dbFileVers[] is updated to match the new value stored in -** the database file. -** -** If everything is successful, SQLITE_OK is returned. If an IO error -** occurs, an IO error code is returned. Or, if the EXCLUSIVE lock cannot -** be obtained, SQLITE_BUSY is returned. +** Given a list of pages (connected by the PgHdr.pDirty pointer) write +** every one of those pages out to the database file. No calls are made +** to the page-cache to mark the pages as clean. It is the responsibility +** of the caller to use PcacheCleanAll() or PcacheMakeClean() to mark +** the pages as clean. */ static int pager_write_pagelist(PgHdr *pList){ - Pager *pPager; /* Pager object */ - int rc; /* Return code */ + Pager *pPager; + int rc; if( pList==0 ) return SQLITE_OK; pPager = pList->pPager; /* At this point there may be either a RESERVED or EXCLUSIVE lock on the ** database file. If there is already an EXCLUSIVE lock, the following - ** call is a no-op. + ** calls to sqlite3OsLock() are no-ops. ** ** Moving the lock from RESERVED to EXCLUSIVE actually involves going ** through an intermediate state PENDING. A PENDING lock prevents new ** readers from attaching to the database but is unsufficient for us to ** write. The idea of a PENDING lock is to prevent new readers from @@ -2850,627 +2370,194 @@ ** is unchanged and we can rollback without having to playback the ** journal into the original database file. Once we transition to ** EXCLUSIVE, it means the database file has been changed and any rollback ** will require a journal playback. */ - assert( pPager->state>=PAGER_RESERVED ); rc = pager_wait_on_lock(pPager, EXCLUSIVE_LOCK); - - /* If the file is a temp-file has not yet been opened, open it now. It - ** is not possible for rc to be other than SQLITE_OK if this branch - ** is taken, as pager_wait_on_lock() is a no-op for temp-files. - */ - if( !isOpen(pPager->fd) ){ - assert( pPager->tempFile && rc==SQLITE_OK ); - rc = pagerOpentemp(pPager, pPager->fd, pPager->vfsFlags); + if( rc!=SQLITE_OK ){ + return rc; } - while( rc==SQLITE_OK && pList ){ - Pgno pgno = pList->pgno; + while( pList ){ + + /* If the file has not yet been opened, open it now. */ + if( !pPager->fd->pMethods ){ + assert(pPager->tempFile); + rc = sqlite3PagerOpentemp(pPager, pPager->fd, pPager->vfsFlags); + if( rc ) return rc; + } /* If there are dirty pages in the page cache with page numbers greater - ** than Pager.dbSize, this means sqlite3PagerTruncateImage() was called to + ** than Pager.dbSize, this means sqlite3PagerTruncate() was called to ** make the file smaller (presumably by auto-vacuum code). Do not write ** any such pages to the file. - ** - ** Also, do not write out any page that has the PGHDR_DONT_WRITE flag - ** set (set by sqlite3PagerDontWrite()). */ - if( pgno<=pPager->dbSize && 0==(pList->flags&PGHDR_DONT_WRITE) ){ - i64 offset = (pgno-1)*(i64)pPager->pageSize; /* Offset to write */ - char *pData = CODEC2(pPager, pList->pData, pgno, 6); /* Data to write */ - - /* Write out the page data. */ + if( pList->pgno<=pPager->dbSize && 0==(pList->flags&PGHDR_DONT_WRITE) ){ + i64 offset = (pList->pgno-1)*(i64)pPager->pageSize; + char *pData = CODEC2(pPager, pList->pData, pList->pgno, 6); + PAGERTRACE4("STORE %d page %d hash(%08x)\n", + PAGERID(pPager), pList->pgno, pager_pagehash(pList)); + IOTRACE(("PGOUT %p %d\n", pPager, pList->pgno)); rc = sqlite3OsWrite(pPager->fd, pData, pPager->pageSize, offset); - - /* If page 1 was just written, update Pager.dbFileVers to match - ** the value now stored in the database file. If writing this - ** page caused the database file to grow, update dbFileSize. - */ - if( pgno==1 ){ + PAGER_INCR(sqlite3_pager_writedb_count); + PAGER_INCR(pPager->nWrite); + if( pList->pgno==1 ){ memcpy(&pPager->dbFileVers, &pData[24], sizeof(pPager->dbFileVers)); } - if( pgno>pPager->dbFileSize ){ - pPager->dbFileSize = pgno; - } - - /* Update any backup objects copying the contents of this pager. */ - sqlite3BackupUpdate(pPager->pBackup, pgno, (u8 *)pData); - - PAGERTRACE(("STORE %d page %d hash(%08x)\n", - PAGERID(pPager), pgno, pager_pagehash(pList))); - IOTRACE(("PGOUT %p %d\n", pPager, pgno)); - PAGER_INCR(sqlite3_pager_writedb_count); - PAGER_INCR(pPager->nWrite); - }else{ - PAGERTRACE(("NOSTORE %d page %d\n", PAGERID(pPager), pgno)); - } + } +#ifndef NDEBUG + else{ + PAGERTRACE3("NOSTORE %d page %d\n", PAGERID(pPager), pList->pgno); + } +#endif + if( rc ) return rc; #ifdef SQLITE_CHECK_PAGES pList->pageHash = pager_pagehash(pList); #endif pList = pList->pDirty; } - return rc; -} - -/* -** Append a record of the current state of page pPg to the sub-journal. -** It is the callers responsibility to use subjRequiresPage() to check -** that it is really required before calling this function. -** -** If successful, set the bit corresponding to pPg->pgno in the bitvecs -** for all open savepoints before returning. -** -** This function returns SQLITE_OK if everything is successful, an IO -** error code if the attempt to write to the sub-journal fails, or -** SQLITE_NOMEM if a malloc fails while setting a bit in a savepoint -** bitvec. -*/ -static int subjournalPage(PgHdr *pPg){ - int rc = SQLITE_OK; - Pager *pPager = pPg->pPager; - if( isOpen(pPager->sjfd) ){ - void *pData = pPg->pData; - i64 offset = pPager->nSubRec*(4+pPager->pageSize); - char *pData2 = CODEC2(pPager, pData, pPg->pgno, 7); - - PAGERTRACE(("STMT-JOURNAL %d page %d\n", PAGERID(pPager), pPg->pgno)); - - assert( pageInJournal(pPg) || pPg->pgno>pPager->dbOrigSize ); - rc = write32bits(pPager->sjfd, offset, pPg->pgno); - if( rc==SQLITE_OK ){ - rc = sqlite3OsWrite(pPager->sjfd, pData2, pPager->pageSize, offset+4); - } - } - if( rc==SQLITE_OK ){ - pPager->nSubRec++; - assert( pPager->nSavepoint>0 ); - rc = addToSavepointBitvecs(pPager, pPg->pgno); - testcase( rc!=SQLITE_OK ); - } - return rc; -} - + return SQLITE_OK; +} /* ** This function is called by the pcache layer when it has reached some -** soft memory limit. The first argument is a pointer to a Pager object -** (cast as a void*). The pager is always 'purgeable' (not an in-memory -** database). The second argument is a reference to a page that is -** currently dirty but has no outstanding references. The page -** is always associated with the Pager object passed as the first -** argument. -** -** The job of this function is to make pPg clean by writing its contents -** out to the database file, if possible. This may involve syncing the -** journal file. -** -** If successful, sqlite3PcacheMakeClean() is called on the page and -** SQLITE_OK returned. If an IO error occurs while trying to make the -** page clean, the IO error code is returned. If the page cannot be -** made clean for some other reason, but no error occurs, then SQLITE_OK -** is returned by sqlite3PcacheMakeClean() is not called. +** soft memory limit. The argument is a pointer to a purgeable Pager +** object. This function attempts to make a single dirty page that has no +** outstanding references (if one exists) clean so that it can be recycled +** by the pcache layer. */ static int pagerStress(void *p, PgHdr *pPg){ Pager *pPager = (Pager *)p; int rc = SQLITE_OK; - assert( pPg->pPager==pPager ); - assert( pPg->flags&PGHDR_DIRTY ); - - /* The doNotSync flag is set by the sqlite3PagerWrite() function while it - ** is journalling a set of two or more database pages that are stored - ** on the same disk sector. Syncing the journal is not allowed while - ** this is happening as it is important that all members of such a - ** set of pages are synced to disk together. So, if the page this function - ** is trying to make clean will require a journal sync and the doNotSync - ** flag is set, return without doing anything. The pcache layer will - ** just have to go ahead and allocate a new page buffer instead of - ** reusing pPg. - ** - ** Similarly, if the pager has already entered the error state, do not - ** try to write the contents of pPg to disk. - */ - if( pPager->errCode || (pPager->doNotSync && pPg->flags&PGHDR_NEED_SYNC) ){ - return SQLITE_OK; - } - - /* Sync the journal file if required. */ - if( pPg->flags&PGHDR_NEED_SYNC ){ - rc = syncJournal(pPager); - if( rc==SQLITE_OK && pPager->fullSync && - !(pPager->journalMode==PAGER_JOURNALMODE_MEMORY) && - !(sqlite3OsDeviceCharacteristics(pPager->fd)&SQLITE_IOCAP_SAFE_APPEND) - ){ - pPager->nRec = 0; - rc = writeJournalHdr(pPager); - } - } - - /* If the page number of this page is larger than the current size of - ** the database image, it may need to be written to the sub-journal. - ** This is because the call to pager_write_pagelist() below will not - ** actually write data to the file in this case. - ** - ** Consider the following sequence of events: - ** - ** BEGIN; - ** - ** - ** SAVEPOINT sp; - ** - ** pagerStress(page X) - ** ROLLBACK TO sp; - ** - ** If (X>Y), then when pagerStress is called page X will not be written - ** out to the database file, but will be dropped from the cache. Then, - ** following the "ROLLBACK TO sp" statement, reading page X will read - ** data from the database file. This will be the copy of page X as it - ** was when the transaction started, not as it was when "SAVEPOINT sp" - ** was executed. - ** - ** The solution is to write the current data for page X into the - ** sub-journal file now (if it is not already there), so that it will - ** be restored to its current value when the "ROLLBACK TO sp" is - ** executed. - */ - if( rc==SQLITE_OK && pPg->pgno>pPager->dbSize && subjRequiresPage(pPg) ){ - rc = subjournalPage(pPg); - } - - /* Write the contents of the page out to the database file. */ - if( rc==SQLITE_OK ){ - pPg->pDirty = 0; - rc = pager_write_pagelist(pPg); - } - - /* Mark the page as clean. */ - if( rc==SQLITE_OK ){ - PAGERTRACE(("STRESS %d page %d\n", PAGERID(pPager), pPg->pgno)); - sqlite3PcacheMakeClean(pPg); - } - - return pager_error(pPager, rc); -} - - -/* -** Allocate and initialize a new Pager object and put a pointer to it -** in *ppPager. The pager should eventually be freed by passing it -** to sqlite3PagerClose(). -** -** The zFilename argument is the path to the database file to open. -** If zFilename is NULL then a randomly-named temporary file is created -** and used as the file to be cached. Temporary files are be deleted -** automatically when they are closed. If zFilename is ":memory:" then -** all information is held in cache. It is never written to disk. -** This can be used to implement an in-memory database. -** -** The nExtra parameter specifies the number of bytes of space allocated -** along with each page reference. This space is available to the user -** via the sqlite3PagerGetExtra() API. -** -** The flags argument is used to specify properties that affect the -** operation of the pager. It should be passed some bitwise combination -** of the PAGER_OMIT_JOURNAL and PAGER_NO_READLOCK flags. -** -** The vfsFlags parameter is a bitmask to pass to the flags parameter -** of the xOpen() method of the supplied VFS when opening files. -** -** If the pager object is allocated and the specified file opened -** successfully, SQLITE_OK is returned and *ppPager set to point to -** the new pager object. If an error occurs, *ppPager is set to NULL -** and error code returned. This function may return SQLITE_NOMEM -** (sqlite3Malloc() is used to allocate memory), SQLITE_CANTOPEN or -** various SQLITE_IO_XXX errors. -*/ -int sqlite3PagerOpen( - sqlite3_vfs *pVfs, /* The virtual file system to use */ - Pager **ppPager, /* OUT: Return the Pager structure here */ - const char *zFilename, /* Name of the database file to open */ - int nExtra, /* Extra bytes append to each in-memory page */ - int flags, /* flags controlling this file */ - int vfsFlags /* flags passed through to sqlite3_vfs.xOpen() */ -){ - u8 *pPtr; - Pager *pPager = 0; /* Pager object to allocate and return */ - int rc = SQLITE_OK; /* Return code */ - int tempFile = 0; /* True for temp files (incl. in-memory files) */ - int memDb = 0; /* True if this is an in-memory file */ - int readOnly = 0; /* True if this is a read-only file */ - int journalFileSize; /* Bytes to allocate for each journal fd */ - char *zPathname = 0; /* Full path to database file */ - int nPathname = 0; /* Number of bytes in zPathname */ - int useJournal = (flags & PAGER_OMIT_JOURNAL)==0; /* False to omit journal */ - int noReadlock = (flags & PAGER_NO_READLOCK)!=0; /* True to omit read-lock */ - int pcacheSize = sqlite3PcacheSize(); /* Bytes to allocate for PCache */ - u16 szPageDflt = SQLITE_DEFAULT_PAGE_SIZE; /* Default page size */ - - /* Figure out how much space is required for each journal file-handle - ** (there are two of them, the main journal and the sub-journal). This - ** is the maximum space required for an in-memory journal file handle - ** and a regular journal file-handle. Note that a "regular journal-handle" - ** may be a wrapper capable of caching the first portion of the journal - ** file in memory to implement the atomic-write optimization (see - ** source file journal.c). - */ - if( sqlite3JournalSize(pVfs)>sqlite3MemJournalSize() ){ - journalFileSize = sqlite3JournalSize(pVfs); - }else{ - journalFileSize = sqlite3MemJournalSize(); - } - - /* Set the output variable to NULL in case an error occurs. */ - *ppPager = 0; - - /* Compute and store the full pathname in an allocated buffer pointed - ** to by zPathname, length nPathname. Or, if this is a temporary file, - ** leave both nPathname and zPathname set to 0. - */ - if( zFilename && zFilename[0] ){ - nPathname = pVfs->mxPathname+1; - zPathname = sqlite3Malloc(nPathname*2); - if( zPathname==0 ){ - return SQLITE_NOMEM; - } -#ifndef SQLITE_OMIT_MEMORYDB - if( strcmp(zFilename,":memory:")==0 ){ - memDb = 1; - zPathname[0] = 0; - }else -#endif - { - rc = sqlite3OsFullPathname(pVfs, zFilename, nPathname, zPathname); - } - - nPathname = sqlite3Strlen30(zPathname); - if( rc==SQLITE_OK && nPathname+8>pVfs->mxPathname ){ - /* This branch is taken when the journal path required by - ** the database being opened will be more than pVfs->mxPathname - ** bytes in length. This means the database cannot be opened, - ** as it will not be possible to open the journal file or even - ** check for a hot-journal before reading. - */ - rc = SQLITE_CANTOPEN; - } - if( rc!=SQLITE_OK ){ - sqlite3_free(zPathname); - return rc; - } - } - - /* Allocate memory for the Pager structure, PCache object, the - ** three file descriptors, the database file name and the journal - ** file name. The layout in memory is as follows: - ** - ** Pager object (sizeof(Pager) bytes) - ** PCache object (sqlite3PcacheSize() bytes) - ** Database file handle (pVfs->szOsFile bytes) - ** Sub-journal file handle (journalFileSize bytes) - ** Main journal file handle (journalFileSize bytes) - ** Database file name (nPathname+1 bytes) - ** Journal file name (nPathname+8+1 bytes) - */ - pPtr = (u8 *)sqlite3MallocZero( - sizeof(*pPager) + /* Pager structure */ - pcacheSize + /* PCache object */ - pVfs->szOsFile + /* The main db file */ - journalFileSize * 2 + /* The two journal files */ - nPathname + 1 + /* zFilename */ - nPathname + 8 + 1 /* zJournal */ - ); - if( !pPtr ){ - sqlite3_free(zPathname); - return SQLITE_NOMEM; - } - pPager = (Pager*)(pPtr); - pPager->pPCache = (PCache*)(pPtr += sizeof(*pPager)); - pPager->fd = (sqlite3_file*)(pPtr += pcacheSize); - pPager->sjfd = (sqlite3_file*)(pPtr += pVfs->szOsFile); - pPager->jfd = (sqlite3_file*)(pPtr += journalFileSize); - pPager->zFilename = (char*)(pPtr += journalFileSize); - - /* Fill in the Pager.zFilename and Pager.zJournal buffers, if required. */ - if( zPathname ){ - pPager->zJournal = (char*)(pPtr += nPathname + 1); - memcpy(pPager->zFilename, zPathname, nPathname); - memcpy(pPager->zJournal, zPathname, nPathname); - memcpy(&pPager->zJournal[nPathname], "-journal", 8); - sqlite3_free(zPathname); - } - pPager->pVfs = pVfs; - pPager->vfsFlags = vfsFlags; - - /* Open the pager file. - */ - if( zFilename && zFilename[0] && !memDb ){ - int fout = 0; /* VFS flags returned by xOpen() */ - rc = sqlite3OsOpen(pVfs, pPager->zFilename, pPager->fd, vfsFlags, &fout); - readOnly = (fout&SQLITE_OPEN_READONLY); - - /* If the file was successfully opened for read/write access, - ** choose a default page size in case we have to create the - ** database file. The default page size is the maximum of: - ** - ** + SQLITE_DEFAULT_PAGE_SIZE, - ** + The value returned by sqlite3OsSectorSize() - ** + The largest page size that can be written atomically. - */ - if( rc==SQLITE_OK && !readOnly ){ - setSectorSize(pPager); - assert(SQLITE_DEFAULT_PAGE_SIZE<=SQLITE_MAX_DEFAULT_PAGE_SIZE); - if( szPageDfltsectorSize ){ - if( pPager->sectorSize>SQLITE_MAX_DEFAULT_PAGE_SIZE ){ - szPageDflt = SQLITE_MAX_DEFAULT_PAGE_SIZE; - }else{ - szPageDflt = (u16)pPager->sectorSize; - } - } -#ifdef SQLITE_ENABLE_ATOMIC_WRITE - { - int iDc = sqlite3OsDeviceCharacteristics(pPager->fd); - int ii; - assert(SQLITE_IOCAP_ATOMIC512==(512>>8)); - assert(SQLITE_IOCAP_ATOMIC64K==(65536>>8)); - assert(SQLITE_MAX_DEFAULT_PAGE_SIZE<=65536); - for(ii=szPageDflt; ii<=SQLITE_MAX_DEFAULT_PAGE_SIZE; ii=ii*2){ - if( iDc&(SQLITE_IOCAP_ATOMIC|(ii>>8)) ){ - szPageDflt = ii; - } - } - } -#endif - } - }else{ - /* If a temporary file is requested, it is not opened immediately. - ** In this case we accept the default page size and delay actually - ** opening the file until the first call to OsWrite(). - ** - ** This branch is also run for an in-memory database. An in-memory - ** database is the same as a temp-file that is never written out to - ** disk and uses an in-memory rollback journal. - */ - tempFile = 1; - pPager->state = PAGER_EXCLUSIVE; - } - - /* The following call to PagerSetPagesize() serves to set the value of - ** Pager.pageSize and to allocate the Pager.pTmpSpace buffer. - */ - if( rc==SQLITE_OK ){ - assert( pPager->memDb==0 ); - rc = sqlite3PagerSetPagesize(pPager, &szPageDflt); - testcase( rc!=SQLITE_OK ); - } - - /* If an error occured in either of the blocks above, free the - ** Pager structure and close the file. - */ - if( rc!=SQLITE_OK ){ - assert( !pPager->pTmpSpace ); - sqlite3OsClose(pPager->fd); - sqlite3_free(pPager); - return rc; - } - - /* Initialize the PCache object. */ - nExtra = FORCE_ALIGNMENT(nExtra); - sqlite3PcacheOpen(szPageDflt, nExtra, !memDb, - !memDb?pagerStress:0, (void *)pPager, pPager->pPCache); - - PAGERTRACE(("OPEN %d %s\n", FILEHANDLEID(pPager->fd), pPager->zFilename)); - IOTRACE(("OPEN %p %s\n", pPager, pPager->zFilename)) - - pPager->useJournal = (u8)useJournal; - pPager->noReadlock = (noReadlock && readOnly) ?1:0; - /* pPager->stmtOpen = 0; */ - /* pPager->stmtInUse = 0; */ - /* pPager->nRef = 0; */ - pPager->dbSizeValid = (u8)memDb; - /* pPager->stmtSize = 0; */ - /* pPager->stmtJSize = 0; */ - /* pPager->nPage = 0; */ - pPager->mxPgno = SQLITE_MAX_PAGE_COUNT; - /* pPager->state = PAGER_UNLOCK; */ - assert( pPager->state == (tempFile ? PAGER_EXCLUSIVE : PAGER_UNLOCK) ); - /* pPager->errMask = 0; */ - pPager->tempFile = (u8)tempFile; - assert( tempFile==PAGER_LOCKINGMODE_NORMAL - || tempFile==PAGER_LOCKINGMODE_EXCLUSIVE ); - assert( PAGER_LOCKINGMODE_EXCLUSIVE==1 ); - pPager->exclusiveMode = (u8)tempFile; - pPager->changeCountDone = pPager->tempFile; - pPager->memDb = (u8)memDb; - pPager->readOnly = (u8)readOnly; - /* pPager->needSync = 0; */ - pPager->noSync = (pPager->tempFile || !useJournal) ?1:0; - pPager->fullSync = pPager->noSync ?0:1; - pPager->sync_flags = SQLITE_SYNC_NORMAL; - /* pPager->pFirst = 0; */ - /* pPager->pFirstSynced = 0; */ - /* pPager->pLast = 0; */ - pPager->nExtra = nExtra; - pPager->journalSizeLimit = SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT; - assert( isOpen(pPager->fd) || tempFile ); - setSectorSize(pPager); - if( memDb ){ - pPager->journalMode = PAGER_JOURNALMODE_MEMORY; - } - /* pPager->xBusyHandler = 0; */ - /* pPager->pBusyHandlerArg = 0; */ - /* memset(pPager->aHash, 0, sizeof(pPager->aHash)); */ - *ppPager = pPager; - return SQLITE_OK; -} - - - -/* -** This function is called after transitioning from PAGER_UNLOCK to -** PAGER_SHARED state. It tests if there is a hot journal present in -** the file-system for the given pager. A hot journal is one that -** needs to be played back. According to this function, a hot-journal -** file exists if the following three criteria are met: -** -** * The journal file exists in the file system, and -** * No process holds a RESERVED or greater lock on the database file, and -** * The database file itself is greater than 0 bytes in size. -** -** If the current size of the database file is 0 but a journal file -** exists, that is probably an old journal left over from a prior -** database with the same name. In this case the journal file is -** just deleted using OsDelete, *pExists is set to 0 and SQLITE_OK -** is returned. + if( pPager->doNotSync ){ + return SQLITE_OK; + } + + assert( pPg->flags&PGHDR_DIRTY ); + if( pPager->errCode==SQLITE_OK ){ + if( pPg->flags&PGHDR_NEED_SYNC ){ + rc = syncJournal(pPager); + if( rc==SQLITE_OK && pPager->fullSync && + !(sqlite3OsDeviceCharacteristics(pPager->fd)&SQLITE_IOCAP_SAFE_APPEND) + ){ + pPager->nRec = 0; + rc = writeJournalHdr(pPager); + } + } + if( rc==SQLITE_OK ){ + pPg->pDirty = 0; + rc = pager_write_pagelist(pPg); + } + if( rc!=SQLITE_OK ){ + pager_error(pPager, rc); + } + } + + if( rc==SQLITE_OK ){ + sqlite3PcacheMakeClean(pPg); + } + return rc; +} + + +/* +** Return 1 if there is a hot journal on the given pager. +** A hot journal is one that needs to be played back. +** +** If the current size of the database file is 0 but a journal file +** exists, that is probably an old journal left over from a prior +** database with the same name. Just delete the journal. +** +** Return negative if unable to determine the status of the journal. ** ** This routine does not open the journal file to examine its ** content. Hence, the journal might contain the name of a master ** journal file that has been deleted, and hence not be hot. Or ** the header of the journal might be zeroed out. This routine ** does not discover these cases of a non-hot journal - if the ** journal file exists and is not empty this routine assumes it ** is hot. The pager_playback() routine will discover that the ** journal file is not really hot and will no-op. -** -** If a hot-journal file is found to exist, *pExists is set to 1 and -** SQLITE_OK returned. If no hot-journal file is present, *pExists is -** set to 0 and SQLITE_OK returned. If an IO error occurs while trying -** to determine whether or not a hot-journal file exists, the IO error -** code is returned and the value of *pExists is undefined. */ static int hasHotJournal(Pager *pPager, int *pExists){ - sqlite3_vfs * const pVfs = pPager->pVfs; - int rc; /* Return code */ - int exists = 0; /* True if a journal file is present */ - int locked = 0; /* True if some process holds a RESERVED lock */ - + sqlite3_vfs *pVfs = pPager->pVfs; + int rc = SQLITE_OK; + int exists; + int locked; assert( pPager!=0 ); assert( pPager->useJournal ); - assert( isOpen(pPager->fd) ); - + assert( pPager->fd->pMethods ); *pExists = 0; rc = sqlite3OsAccess(pVfs, pPager->zJournal, SQLITE_ACCESS_EXISTS, &exists); if( rc==SQLITE_OK && exists ){ rc = sqlite3OsCheckReservedLock(pPager->fd, &locked); - if( rc==SQLITE_OK && !locked ){ - int nPage; - rc = sqlite3PagerPagecount(pPager, &nPage); - if( rc==SQLITE_OK ){ - if( nPage==0 ){ - sqlite3OsDelete(pVfs, pPager->zJournal, 0); - }else{ - *pExists = 1; - } + } + if( rc==SQLITE_OK && exists && !locked ){ + int nPage; + rc = sqlite3PagerPagecount(pPager, &nPage); + if( rc==SQLITE_OK ){ + if( nPage==0 ){ + sqlite3OsDelete(pVfs, pPager->zJournal, 0); + }else{ + *pExists = 1; } } } return rc; } /* -** Read the content for page pPg out of the database file and into -** pPg->pData. A shared lock or greater must be held on the database -** file before this function is called. -** -** If page 1 is read, then the value of Pager.dbFileVers[] is set to -** the value read from the database file. -** -** If an IO error occurs, then the IO error is returned to the caller. -** Otherwise, SQLITE_OK is returned. +** Read the content of page pPg out of the database file. */ -static int readDbPage(PgHdr *pPg){ - Pager *pPager = pPg->pPager; /* Pager object associated with page pPg */ - Pgno pgno = pPg->pgno; /* Page number to read */ - int rc; /* Return code */ - i64 iOffset; /* Byte offset of file to read from */ - - assert( pPager->state>=PAGER_SHARED && !MEMDB ); - - if( !isOpen(pPager->fd) ){ - assert( pPager->tempFile ); +static int readDbPage(Pager *pPager, PgHdr *pPg, Pgno pgno){ + int rc; + i64 offset; + assert( MEMDB==0 ); + assert(pPager->fd->pMethods||pPager->tempFile); + if( !pPager->fd->pMethods ){ return SQLITE_IOERR_SHORT_READ; } - iOffset = (pgno-1)*(i64)pPager->pageSize; - rc = sqlite3OsRead(pPager->fd, pPg->pData, pPager->pageSize, iOffset); - if( pgno==1 ){ - u8 *dbFileVers = &((u8*)pPg->pData)[24]; - memcpy(&pPager->dbFileVers, dbFileVers, sizeof(pPager->dbFileVers)); - } - CODEC1(pPager, pPg->pData, pgno, 3); - + offset = (pgno-1)*(i64)pPager->pageSize; + rc = sqlite3OsRead(pPager->fd, pPg->pData, pPager->pageSize, offset); PAGER_INCR(sqlite3_pager_readdb_count); PAGER_INCR(pPager->nRead); IOTRACE(("PGIN %p %d\n", pPager, pgno)); - PAGERTRACE(("FETCH %d page %d hash(%08x)\n", - PAGERID(pPager), pgno, pager_pagehash(pPg))); - + if( pgno==1 ){ + memcpy(&pPager->dbFileVers, &((u8*)pPg->pData)[24], + sizeof(pPager->dbFileVers)); + } + CODEC1(pPager, pPg->pData, pPg->pgno, 3); + PAGERTRACE4("FETCH %d page %d hash(%08x)\n", + PAGERID(pPager), pPg->pgno, pager_pagehash(pPg)); return rc; } -/* -** This function is called whenever the upper layer requests a database -** page is requested, before the cache is checked for a suitable page -** or any data is read from the database. It performs the following -** two functions: -** -** 1) If the pager is currently in PAGER_UNLOCK state (no lock held -** on the database file), then an attempt is made to obtain a -** SHARED lock on the database file. Immediately after obtaining -** the SHARED lock, the file-system is checked for a hot-journal, -** which is played back if present. Following any hot-journal -** rollback, the contents of the cache are validated by checking -** the 'change-counter' field of the database file header and -** discarded if they are found to be invalid. -** -** 2) If the pager is running in exclusive-mode, and there are currently -** no outstanding references to any pages, and is in the error state, -** then an attempt is made to clear the error state by discarding -** the contents of the page cache and rolling back any open journal -** file. -** -** If the operation described by (2) above is not attempted, and if the -** pager is in an error state other than SQLITE_FULL when this is called, -** the error state error code is returned. It is permitted to read the -** database when in SQLITE_FULL error state. -** -** Otherwise, if everything is successful, SQLITE_OK is returned. If an -** IO error occurs while locking the database, checking for a hot-journal -** file or rolling back a journal file, the IO error code is returned. + +/* +** This function is called to obtain the shared lock required before +** data may be read from the pager cache. If the shared lock has already +** been obtained, this function is a no-op. +** +** Immediately after obtaining the shared lock (if required), this function +** checks for a hot-journal file. If one is found, an emergency rollback +** is performed immediately. */ static int pagerSharedLock(Pager *pPager){ - int rc = SQLITE_OK; /* Return code */ - int isErrorReset = 0; /* True if recovering from error state */ + int rc = SQLITE_OK; + int isErrorReset = 0; /* If this database is opened for exclusive access, has no outstanding - ** page references and is in an error-state, this is a chance to clear + ** page references and is in an error-state, now is the chance to clear ** the error. Discard the contents of the pager-cache and treat any ** open journal file as a hot-journal. */ if( !MEMDB && pPager->exclusiveMode && sqlite3PcacheRefCount(pPager->pPCache)==0 && pPager->errCode ){ - if( isOpen(pPager->jfd) ){ + if( pPager->journalOpen ){ isErrorReset = 1; } pPager->errCode = SQLITE_OK; pager_reset(pPager); } @@ -3482,149 +2569,151 @@ if( pPager->errCode && pPager->errCode!=SQLITE_FULL ){ return pPager->errCode; } if( pPager->state==PAGER_UNLOCK || isErrorReset ){ - sqlite3_vfs * const pVfs = pPager->pVfs; - int isHotJournal = 0; - assert( !MEMDB ); - assert( sqlite3PcacheRefCount(pPager->pPCache)==0 ); - if( !pPager->noReadlock ){ - rc = pager_wait_on_lock(pPager, SHARED_LOCK); - if( rc!=SQLITE_OK ){ - assert( pPager->state==PAGER_UNLOCK ); - return pager_error(pPager, rc); - } - }else if( pPager->state==PAGER_UNLOCK ){ - pPager->state = PAGER_SHARED; - } - assert( pPager->state>=SHARED_LOCK ); - - /* If a journal file exists, and there is no RESERVED lock on the - ** database file, then it either needs to be played back or deleted. - */ - if( !isErrorReset ){ - rc = hasHotJournal(pPager, &isHotJournal); - if( rc!=SQLITE_OK ){ - goto failed; - } - } - if( isErrorReset || isHotJournal ){ - /* Get an EXCLUSIVE lock on the database file. At this point it is - ** important that a RESERVED lock is not obtained on the way to the - ** EXCLUSIVE lock. If it were, another process might open the - ** database file, detect the RESERVED lock, and conclude that the - ** database is safe to read while this process is still rolling the - ** hot-journal back. - ** - ** Because the intermediate RESERVED lock is not requested, any - ** other process attempting to access the database file will get to - ** this point in the code and fail to obtain its own EXCLUSIVE lock - ** on the database file. - */ - if( pPager->statefd, EXCLUSIVE_LOCK); - if( rc!=SQLITE_OK ){ - rc = pager_error(pPager, rc); - goto failed; - } - pPager->state = PAGER_EXCLUSIVE; - } - - /* Open the journal for read/write access. This is because in - ** exclusive-access mode the file descriptor will be kept open and - ** possibly used for a transaction later on. On some systems, the - ** OsTruncate() call used in exclusive-access mode also requires - ** a read/write file handle. - */ - if( !isOpen(pPager->jfd) ){ - int res; - rc = sqlite3OsAccess(pVfs,pPager->zJournal,SQLITE_ACCESS_EXISTS,&res); - if( rc==SQLITE_OK ){ - if( res ){ - int fout = 0; - int f = SQLITE_OPEN_READWRITE|SQLITE_OPEN_MAIN_JOURNAL; - assert( !pPager->tempFile ); - rc = sqlite3OsOpen(pVfs, pPager->zJournal, pPager->jfd, f, &fout); - assert( rc!=SQLITE_OK || isOpen(pPager->jfd) ); - if( rc==SQLITE_OK && fout&SQLITE_OPEN_READONLY ){ - rc = SQLITE_CANTOPEN; - sqlite3OsClose(pPager->jfd); - } - }else{ - /* If the journal does not exist, that means some other process - ** has already rolled it back */ - rc = SQLITE_BUSY; - } - } - } - if( rc!=SQLITE_OK ){ - goto failed; - } - - /* TODO: Why are these cleared here? Is it necessary? */ - pPager->journalStarted = 0; - pPager->journalOff = 0; - pPager->setMaster = 0; - pPager->journalHdr = 0; - - /* Playback and delete the journal. Drop the database write - ** lock and reacquire the read lock. Purge the cache before - ** playing back the hot-journal so that we don't end up with - ** an inconsistent cache. - */ - rc = pager_playback(pPager, 1); - if( rc!=SQLITE_OK ){ - rc = pager_error(pPager, rc); - goto failed; - } - assert( (pPager->state==PAGER_SHARED) - || (pPager->exclusiveMode && pPager->state>PAGER_SHARED) - ); - } - - if( sqlite3PcachePagecount(pPager->pPCache)>0 ){ - /* The shared-lock has just been acquired on the database file - ** and there are already pages in the cache (from a previous - ** read or write transaction). Check to see if the database - ** has been modified. If the database has changed, flush the - ** cache. - ** - ** Database changes is detected by looking at 15 bytes beginning - ** at offset 24 into the file. The first 4 of these 16 bytes are - ** a 32-bit counter that is incremented with each change. The - ** other bytes change randomly with each file change when - ** a codec is in use. - ** - ** There is a vanishingly small chance that a change will not be - ** detected. The chance of an undetected change is so small that - ** it can be neglected. - */ - char dbFileVers[sizeof(pPager->dbFileVers)]; - sqlite3PagerPagecount(pPager, 0); - - if( pPager->errCode ){ - rc = pPager->errCode; - goto failed; - } - - assert( pPager->dbSizeValid ); - if( pPager->dbSize>0 ){ - IOTRACE(("CKVERS %p %d\n", pPager, sizeof(dbFileVers))); - rc = sqlite3OsRead(pPager->fd, &dbFileVers, sizeof(dbFileVers), 24); - if( rc!=SQLITE_OK ){ - goto failed; - } - }else{ - memset(dbFileVers, 0, sizeof(dbFileVers)); - } - - if( memcmp(pPager->dbFileVers, dbFileVers, sizeof(dbFileVers))!=0 ){ - pager_reset(pPager); - } - } - assert( pPager->exclusiveMode || pPager->state==PAGER_SHARED ); + sqlite3_vfs *pVfs = pPager->pVfs; + if( !MEMDB ){ + int isHotJournal; + assert( sqlite3PcacheRefCount(pPager->pPCache)==0 ); + if( !pPager->noReadlock ){ + rc = pager_wait_on_lock(pPager, SHARED_LOCK); + if( rc!=SQLITE_OK ){ + assert( pPager->state==PAGER_UNLOCK ); + return pager_error(pPager, rc); + } + assert( pPager->state>=SHARED_LOCK ); + } + + /* If a journal file exists, and there is no RESERVED lock on the + ** database file, then it either needs to be played back or deleted. + */ + if( !isErrorReset ){ + rc = hasHotJournal(pPager, &isHotJournal); + if( rc!=SQLITE_OK ){ + goto failed; + } + } + if( isErrorReset || isHotJournal ){ + /* Get an EXCLUSIVE lock on the database file. At this point it is + ** important that a RESERVED lock is not obtained on the way to the + ** EXCLUSIVE lock. If it were, another process might open the + ** database file, detect the RESERVED lock, and conclude that the + ** database is safe to read while this process is still rolling it + ** back. + ** + ** Because the intermediate RESERVED lock is not requested, the + ** second process will get to this point in the code and fail to + ** obtain its own EXCLUSIVE lock on the database file. + */ + if( pPager->statefd, EXCLUSIVE_LOCK); + if( rc!=SQLITE_OK ){ + rc = pager_error(pPager, rc); + goto failed; + } + pPager->state = PAGER_EXCLUSIVE; + } + + /* Open the journal for read/write access. This is because in + ** exclusive-access mode the file descriptor will be kept open and + ** possibly used for a transaction later on. On some systems, the + ** OsTruncate() call used in exclusive-access mode also requires + ** a read/write file handle. + */ + if( !isErrorReset && pPager->journalOpen==0 ){ + int res; + rc = sqlite3OsAccess(pVfs,pPager->zJournal,SQLITE_ACCESS_EXISTS,&res); + if( rc==SQLITE_OK ){ + if( res ){ + int fout = 0; + int f = SQLITE_OPEN_READWRITE|SQLITE_OPEN_MAIN_JOURNAL; + assert( !pPager->tempFile ); + rc = sqlite3OsOpen(pVfs, pPager->zJournal, pPager->jfd, f, &fout); + assert( rc!=SQLITE_OK || pPager->jfd->pMethods ); + if( fout&SQLITE_OPEN_READONLY ){ + rc = SQLITE_BUSY; + sqlite3OsClose(pPager->jfd); + } + }else{ + /* If the journal does not exist, that means some other process + ** has already rolled it back */ + rc = SQLITE_BUSY; + } + } + } + if( rc!=SQLITE_OK ){ + if( rc!=SQLITE_NOMEM && rc!=SQLITE_IOERR_UNLOCK + && rc!=SQLITE_IOERR_NOMEM + ){ + rc = SQLITE_BUSY; + } + goto failed; + } + pPager->journalOpen = 1; + pPager->journalStarted = 0; + pPager->journalOff = 0; + pPager->setMaster = 0; + pPager->journalHdr = 0; + + /* Playback and delete the journal. Drop the database write + ** lock and reacquire the read lock. + */ + rc = pager_playback(pPager, 1); + if( rc!=SQLITE_OK ){ + rc = pager_error(pPager, rc); + goto failed; + } + assert(pPager->state==PAGER_SHARED || + (pPager->exclusiveMode && pPager->state>PAGER_SHARED) + ); + } + + if( sqlite3PcachePagecount(pPager->pPCache)>0 ){ + /* The shared-lock has just been acquired on the database file + ** and there are already pages in the cache (from a previous + ** read or write transaction). Check to see if the database + ** has been modified. If the database has changed, flush the + ** cache. + ** + ** Database changes is detected by looking at 15 bytes beginning + ** at offset 24 into the file. The first 4 of these 16 bytes are + ** a 32-bit counter that is incremented with each change. The + ** other bytes change randomly with each file change when + ** a codec is in use. + ** + ** There is a vanishingly small chance that a change will not be + ** detected. The chance of an undetected change is so small that + ** it can be neglected. + */ + char dbFileVers[sizeof(pPager->dbFileVers)]; + sqlite3PagerPagecount(pPager, 0); + + if( pPager->errCode ){ + rc = pPager->errCode; + goto failed; + } + + if( pPager->dbSize>0 ){ + IOTRACE(("CKVERS %p %d\n", pPager, sizeof(dbFileVers))); + rc = sqlite3OsRead(pPager->fd, &dbFileVers, sizeof(dbFileVers), 24); + if( rc!=SQLITE_OK ){ + goto failed; + } + }else{ + memset(dbFileVers, 0, sizeof(dbFileVers)); + } + + if( memcmp(pPager->dbFileVers, dbFileVers, sizeof(dbFileVers))!=0 ){ + pager_reset(pPager); + } + } + } + assert( pPager->exclusiveMode || pPager->state<=PAGER_SHARED ); + if( pPager->state==PAGER_UNLOCK ){ + pPager->state = PAGER_SHARED; + } } failed: if( rc!=SQLITE_OK ){ /* pager_unlock() is a no-op for exclusive mode and in-memory databases. */ @@ -3632,15 +2721,36 @@ } return rc; } /* -** If the reference count has reached zero, rollback any active -** transaction and unlock the pager. +** Make sure we have the content for a page. If the page was +** previously acquired with noContent==1, then the content was +** just initialized to zeros instead of being read from disk. +** But now we need the real data off of disk. So make sure we +** have it. Read it in if we do not have it already. +*/ +static int pager_get_content(PgHdr *pPg){ + if( pPg->flags&PGHDR_NEED_READ ){ + int rc = readDbPage(pPg->pPager, pPg, pPg->pgno); + if( rc==SQLITE_OK ){ + pPg->flags &= ~PGHDR_NEED_READ; + }else{ + return rc; + } + } + return SQLITE_OK; +} + +/* +** If the reference count has reached zero, and the pager is not in the +** middle of a write transaction or opened in exclusive mode, unlock it. */ static void pagerUnlockIfUnused(Pager *pPager){ - if( sqlite3PcacheRefCount(pPager->pPCache)==0 ){ + if( (sqlite3PcacheRefCount(pPager->pPCache)==0) + && (!pPager->exclusiveMode || pPager->journalOff>0) + ){ pagerUnlockAndRollback(pPager); } } /* @@ -3654,52 +2764,20 @@ sqlite3PcacheDrop(pPg); pagerUnlockIfUnused(pPager); } /* -** Acquire a reference to page number pgno in pager pPager (a page -** reference has type DbPage*). If the requested reference is -** successfully obtained, it is copied to *ppPage and SQLITE_OK returned. -** -** This function calls pagerSharedLock() to obtain a SHARED lock on -** the database file if such a lock or greater is not already held. -** This may cause hot-journal rollback or a cache purge. See comments -** above function pagerSharedLock() for details. -** -** If the requested page is already in the cache, it is returned. -** Otherwise, a new page object is allocated and populated with data -** read from the database file. In some cases, the pcache module may -** choose not to allocate a new page object and may reuse an existing -** object with no outstanding references. -** -** The extra data appended to a page is always initialized to zeros the -** first time a page is loaded into memory. If the page requested is -** already in the cache when this function is called, then the extra -** data is left as it was when the page object was last used. -** -** If the database image is smaller than the requested page or if a -** non-zero value is passed as the noContent parameter and the -** requested page is not already stored in the cache, then no -** actual disk read occurs. In this case the memory image of the -** page is initialized to all zeros. -** -** If noContent is true, it means that we do not care about the contents -** of the page. This occurs in two seperate scenarios: -** -** a) When reading a free-list leaf page from the database, and -** -** b) When a savepoint is being rolled back and we need to load -** a new page into the cache to populate with the data read -** from the savepoint journal. -** -** If noContent is true, then the data returned is zeroed instead of -** being read from the database. Additionally, the bits corresponding -** to pgno in Pager.pInJournal (bitvec of pages already written to the -** journal file) and the PagerSavepoint.pInSavepoint bitvecs of any open -** savepoints are set. This means if the page is made writable at any -** point in the future, using a call to sqlite3PagerWrite(), its contents -** will not be journaled. This saves IO. +** Acquire a page. +** +** A read lock on the disk file is obtained when the first page is acquired. +** This read lock is dropped when the last page is released. +** +** This routine works for any page number greater than 0. If the database +** file is smaller than the requested page, then no actual disk +** read occurs and the memory image of the page is initialized to +** all zeros. The extra data appended to a page is always initialized +** to zeros the first time a page is loaded into memory. ** ** The acquisition might fail for several reasons. In all cases, ** an appropriate error code is returned and *ppPage is set to NULL. ** ** See also sqlite3PagerLookup(). Both this routine and Lookup() attempt @@ -3707,10 +2785,19 @@ ** in memory, this routine goes to disk to read it in whereas Lookup() ** just returns 0. This routine acquires a read-lock the first time it ** has to go to disk, and could also playback an old journal if necessary. ** Since Lookup() never goes to disk, it never has to deal with locks ** or journal files. +** +** If noContent is false, the page contents are actually read from disk. +** If noContent is true, it means that we do not care about the contents +** of the page at this time, so do not do a disk read. Just fill in the +** page content with zeros. But mark the fact that we have not read the +** content by setting the PgHdr.needRead flag. Later on, if +** sqlite3PagerWrite() is called on this page or if this routine is +** called again with noContent==0, that means that the content is needed +** and the disk read should occur at that point. */ int sqlite3PagerAcquire( Pager *pPager, /* The pager open on the database file */ Pgno pgno, /* Page number to fetch */ DbPage **ppPage, /* Write a pointer to the page here */ @@ -3717,14 +2804,13 @@ int noContent /* Do not bother reading content from disk if true */ ){ PgHdr *pPg = 0; int rc; - assert( assert_pager_state(pPager) ); assert( pPager->state==PAGER_UNLOCK || sqlite3PcacheRefCount(pPager->pPCache)>0 - || pgno==1 + || pgno==1 ); /* The maximum page number is 2^31. Return SQLITE_CORRUPT if a page ** number greater than this, or zero, is requested. */ @@ -3749,19 +2835,22 @@ rc = sqlite3PcacheFetch(pPager->pPCache, pgno, 1, &pPg); if( rc!=SQLITE_OK ){ return rc; } - assert( pPg->pgno==pgno ); - assert( pPg->pPager==pPager || pPg->pPager==0 ); if( pPg->pPager==0 ){ /* The pager cache has created a new page. Its content needs to ** be initialized. */ int nMax; PAGER_INCR(pPager->nMiss); pPg->pPager = pPager; + if( sqlite3BitvecTest(pPager->pInJournal, pgno) ){ + assert( !MEMDB ); + pPg->flags |= PGHDR_IN_JOURNAL; + } + memset(pPg->pExtra, 0, pPager->nExtra); rc = sqlite3PagerPagecount(pPager, &nMax); if( rc!=SQLITE_OK ){ sqlite3PagerUnref(pPg); return rc; @@ -3770,55 +2859,47 @@ if( nMax<(int)pgno || MEMDB || noContent ){ if( pgno>pPager->mxPgno ){ sqlite3PagerUnref(pPg); return SQLITE_FULL; } + memset(pPg->pData, 0, pPager->pageSize); if( noContent ){ - /* Failure to set the bits in the InJournal bit-vectors is benign. - ** It merely means that we might do some extra work to journal a - ** page that does not need to be journaled. Nevertheless, be sure - ** to test the case where a malloc error occurs while trying to set - ** a bit in a bit vector. - */ - sqlite3BeginBenignMalloc(); - if( pgno<=pPager->dbOrigSize ){ - TESTONLY( rc = ) sqlite3BitvecSet(pPager->pInJournal, pgno); - testcase( rc==SQLITE_NOMEM ); - } - TESTONLY( rc = ) addToSavepointBitvecs(pPager, pgno); - testcase( rc==SQLITE_NOMEM ); - sqlite3EndBenignMalloc(); - }else{ - memset(pPg->pData, 0, pPager->pageSize); + pPg->flags |= PGHDR_NEED_READ; } IOTRACE(("ZERO %p %d\n", pPager, pgno)); }else{ - assert( pPg->pPager==pPager ); - rc = readDbPage(pPg); + rc = readDbPage(pPager, pPg, pgno); if( rc!=SQLITE_OK && rc!=SQLITE_IOERR_SHORT_READ ){ + /* sqlite3PagerUnref(pPg); */ pagerDropPage(pPg); return rc; } } #ifdef SQLITE_CHECK_PAGES pPg->pageHash = pager_pagehash(pPg); #endif }else{ /* The requested page is in the page cache. */ + assert(sqlite3PcacheRefCount(pPager->pPCache)>0 || pgno==1); PAGER_INCR(pPager->nHit); + if( !noContent ){ + rc = pager_get_content(pPg); + if( rc ){ + sqlite3PagerUnref(pPg); + return rc; + } + } } *ppPage = pPg; return SQLITE_OK; } /* ** Acquire a page if it is already in the in-memory cache. Do ** not read the page from disk. Return a pointer to the page, -** or 0 if the page is not in cache. Also, return 0 if the -** pager is in PAGER_UNLOCK state when this function is called, -** or if the pager is in an error state other than SQLITE_FULL. +** or 0 if the page is not in cache. ** ** See also sqlite3PagerGet(). The difference between this routine ** and sqlite3PagerGet() is that _get() will go to the disk and read ** in the page if the page is not already in cache. This routine ** returns NULL if the page is not in cache or if a disk I/O error @@ -3837,209 +2918,214 @@ return pPg; } /* -** Release a page reference. +** Release a page. ** ** If the number of references to the page drop to zero, then the ** page is added to the LRU list. When all references to all pages ** are released, a rollback occurs and the lock on the database is ** removed. */ -void sqlite3PagerUnref(DbPage *pPg){ +int sqlite3PagerUnref(DbPage *pPg){ if( pPg ){ Pager *pPager = pPg->pPager; sqlite3PcacheRelease(pPg); pagerUnlockIfUnused(pPager); } -} - -/* -** If the main journal file has already been opened, ensure that the -** sub-journal file is open too. If the main journal is not open, -** this function is a no-op. -** -** SQLITE_OK is returned if everything goes according to plan. -** An SQLITE_IOERR_XXX error code is returned if a call to -** sqlite3OsOpen() fails. -*/ -static int openSubJournal(Pager *pPager){ - int rc = SQLITE_OK; - if( isOpen(pPager->jfd) && !isOpen(pPager->sjfd) ){ - if( pPager->journalMode==PAGER_JOURNALMODE_MEMORY ){ - sqlite3MemJournalOpen(pPager->sjfd); - }else{ - rc = pagerOpentemp(pPager, pPager->sjfd, SQLITE_OPEN_SUBJOURNAL); - } - } - return rc; -} - -/* -** This function is called at the start of every write transaction. -** There must already be a RESERVED or EXCLUSIVE lock on the database -** file when this routine is called. -** -** Open the journal file for pager pPager and write a journal header -** to the start of it. If there are active savepoints, open the sub-journal -** as well. This function is only used when the journal file is being -** opened to write a rollback log for a transaction. It is not used -** when opening a hot journal file to roll it back. -** -** If the journal file is already open (as it may be in exclusive mode), -** then this function just writes a journal header to the start of the -** already open file. -** -** Whether or not the journal file is opened by this function, the -** Pager.pInJournal bitvec structure is allocated. -** -** Return SQLITE_OK if everything is successful. Otherwise, return -** SQLITE_NOMEM if the attempt to allocate Pager.pInJournal fails, or -** an IO error code if opening or writing the journal file fails. + return SQLITE_OK; +} + +/* +** Create a journal file for pPager. There should already be a RESERVED +** or EXCLUSIVE lock on the database file when this routine is called. +** +** Return SQLITE_OK if everything. Return an error code and release the +** write lock if anything goes wrong. */ static int pager_open_journal(Pager *pPager){ - int rc = SQLITE_OK; /* Return code */ - sqlite3_vfs * const pVfs = pPager->pVfs; /* Local cache of vfs pointer */ + sqlite3_vfs *pVfs = pPager->pVfs; + int flags = (SQLITE_OPEN_READWRITE|SQLITE_OPEN_EXCLUSIVE|SQLITE_OPEN_CREATE); + int rc; + assert( !MEMDB ); assert( pPager->state>=PAGER_RESERVED ); assert( pPager->useJournal ); assert( pPager->pInJournal==0 ); - - /* If already in the error state, this function is a no-op. */ - if( pPager->errCode ){ - return pPager->errCode; - } - - /* TODO: Is it really possible to get here with dbSizeValid==0? If not, - ** the call to PagerPagecount() can be removed. - */ - testcase( pPager->dbSizeValid==0 ); sqlite3PagerPagecount(pPager, 0); - pPager->pInJournal = sqlite3BitvecCreate(pPager->dbSize); if( pPager->pInJournal==0 ){ - return SQLITE_NOMEM; + rc = SQLITE_NOMEM; + goto failed_to_open_journal; } - /* Open the journal file if it is not already open. */ - if( !isOpen(pPager->jfd) ){ - if( pPager->journalMode==PAGER_JOURNALMODE_MEMORY ){ - sqlite3MemJournalOpen(pPager->jfd); + if( pPager->journalOpen==0 ){ + if( pPager->tempFile ){ + flags |= (SQLITE_OPEN_DELETEONCLOSE|SQLITE_OPEN_TEMP_JOURNAL); }else{ - const int flags = /* VFS flags to open journal file */ - SQLITE_OPEN_READWRITE|SQLITE_OPEN_EXCLUSIVE|SQLITE_OPEN_CREATE| - (pPager->tempFile ? - (SQLITE_OPEN_DELETEONCLOSE|SQLITE_OPEN_TEMP_JOURNAL): - (SQLITE_OPEN_MAIN_JOURNAL) - ); + flags |= (SQLITE_OPEN_MAIN_JOURNAL); + } #ifdef SQLITE_ENABLE_ATOMIC_WRITE - rc = sqlite3JournalOpen( - pVfs, pPager->zJournal, pPager->jfd, flags, jrnlBufferSize(pPager) - ); + rc = sqlite3JournalOpen( + pVfs, pPager->zJournal, pPager->jfd, flags, jrnlBufferSize(pPager) + ); #else - rc = sqlite3OsOpen(pVfs, pPager->zJournal, pPager->jfd, flags, 0); + rc = sqlite3OsOpen(pVfs, pPager->zJournal, pPager->jfd, flags, 0); #endif - } - assert( rc!=SQLITE_OK || isOpen(pPager->jfd) ); - } - - - /* Write the first journal header to the journal file and open - ** the sub-journal if necessary. - */ - if( rc==SQLITE_OK ){ - /* TODO: Check if all of these are really required. */ - pPager->dbOrigSize = pPager->dbSize; - pPager->journalStarted = 0; - pPager->needSync = 0; - pPager->nRec = 0; + assert( rc!=SQLITE_OK || pPager->jfd->pMethods ); pPager->journalOff = 0; pPager->setMaster = 0; pPager->journalHdr = 0; - rc = writeJournalHdr(pPager); - } - if( rc==SQLITE_OK && pPager->nSavepoint ){ - rc = openSubJournal(pPager); - } - - if( rc!=SQLITE_OK ){ - sqlite3BitvecDestroy(pPager->pInJournal); - pPager->pInJournal = 0; - } + if( rc!=SQLITE_OK ){ + if( rc==SQLITE_NOMEM ){ + sqlite3OsDelete(pVfs, pPager->zJournal, 0); + } + goto failed_to_open_journal; + } + } + pPager->journalOpen = 1; + pPager->journalStarted = 0; + pPager->needSync = 0; + pPager->nRec = 0; + if( pPager->errCode ){ + rc = pPager->errCode; + goto failed_to_open_journal; + } + pPager->origDbSize = pPager->dbSize; + + rc = writeJournalHdr(pPager); + + if( pPager->stmtAutoopen && rc==SQLITE_OK ){ + rc = sqlite3PagerStmtBegin(pPager); + } + if( rc!=SQLITE_OK && rc!=SQLITE_NOMEM && rc!=SQLITE_IOERR_NOMEM ){ + rc = pager_end_transaction(pPager, 0); + if( rc==SQLITE_OK ){ + rc = SQLITE_FULL; + } + } + return rc; + +failed_to_open_journal: + sqlite3BitvecDestroy(pPager->pInJournal); + pPager->pInJournal = 0; return rc; } /* -** Begin a write-transaction on the specified pager object. If a -** write-transaction has already been opened, this function is a no-op. -** -** If the exFlag argument is false, then acquire at least a RESERVED -** lock on the database file. If exFlag is true, then acquire at least -** an EXCLUSIVE lock. If such a lock is already held, no locking -** functions need be called. -** -** If this is not a temporary or in-memory file and, the journal file is -** opened if it has not been already. For a temporary file, the opening -** of the journal file is deferred until there is an actual need to -** write to the journal. TODO: Why handle temporary files differently? -** -** If the journal file is opened (or if it is already open), then a -** journal-header is written to the start of it. -*/ -int sqlite3PagerBegin(Pager *pPager, int exFlag){ +** Acquire a write-lock on the database. The lock is removed when +** the any of the following happen: +** +** * sqlite3PagerCommitPhaseTwo() is called. +** * sqlite3PagerRollback() is called. +** * sqlite3PagerClose() is called. +** * sqlite3PagerUnref() is called to on every outstanding page. +** +** The first parameter to this routine is a pointer to any open page of the +** database file. Nothing changes about the page - it is used merely to +** acquire a pointer to the Pager structure and as proof that there is +** already a read-lock on the database. +** +** The second parameter indicates how much space in bytes to reserve for a +** master journal file-name at the start of the journal when it is created. +** +** A journal file is opened if this is not a temporary file. For temporary +** files, the opening of the journal file is deferred until there is an +** actual need to write to the journal. +** +** If the database is already reserved for writing, this routine is a no-op. +** +** If exFlag is true, go ahead and get an EXCLUSIVE lock on the file +** immediately instead of waiting until we try to flush the cache. The +** exFlag is ignored if a transaction is already active. +*/ +int sqlite3PagerBegin(DbPage *pPg, int exFlag){ + Pager *pPager = pPg->pPager; int rc = SQLITE_OK; + assert( pPg->nRef>0 ); assert( pPager->state!=PAGER_UNLOCK ); if( pPager->state==PAGER_SHARED ){ assert( pPager->pInJournal==0 ); - assert( !MEMDB && !pPager->tempFile ); - - /* Obtain a RESERVED lock on the database file. If the exFlag parameter - ** is true, then immediately upgrade this to an EXCLUSIVE lock. The - ** busy-handler callback can be used when upgrading to the EXCLUSIVE - ** lock, but not when obtaining the RESERVED lock. - */ - rc = sqlite3OsLock(pPager->fd, RESERVED_LOCK); - if( rc==SQLITE_OK ){ - pPager->state = PAGER_RESERVED; - if( exFlag ){ - rc = pager_wait_on_lock(pPager, EXCLUSIVE_LOCK); - } - } - - /* If the required locks were successfully obtained, open the journal - ** file and write the first journal-header to it. - */ - if( rc==SQLITE_OK && pPager->useJournal - && pPager->journalMode!=PAGER_JOURNALMODE_OFF - ){ - rc = pager_open_journal(pPager); - } - }else if( isOpen(pPager->jfd) && pPager->journalOff==0 ){ + sqlite3PcacheAssertFlags(pPager->pPCache, 0, PGHDR_IN_JOURNAL); + if( MEMDB ){ + pPager->state = PAGER_EXCLUSIVE; + pPager->origDbSize = pPager->dbSize; + }else{ + rc = sqlite3OsLock(pPager->fd, RESERVED_LOCK); + if( rc==SQLITE_OK ){ + pPager->state = PAGER_RESERVED; + if( exFlag ){ + rc = pager_wait_on_lock(pPager, EXCLUSIVE_LOCK); + } + } + if( rc!=SQLITE_OK ){ + return rc; + } + pPager->dirtyCache = 0; + PAGERTRACE2("TRANSACTION %d\n", PAGERID(pPager)); + if( pPager->useJournal && !pPager->tempFile + && pPager->journalMode!=PAGER_JOURNALMODE_OFF ){ + rc = pager_open_journal(pPager); + } + } + }else if( pPager->journalOpen && pPager->journalOff==0 ){ /* This happens when the pager was in exclusive-access mode the last ** time a (read or write) transaction was successfully concluded ** by this connection. Instead of deleting the journal file it was ** kept open and either was truncated to 0 bytes or its header was ** overwritten with zeros. */ assert( pPager->nRec==0 ); - assert( pPager->dbOrigSize==0 ); + assert( pPager->origDbSize==0 ); assert( pPager->pInJournal==0 ); - rc = pager_open_journal(pPager); + sqlite3PagerPagecount(pPager, 0); + pPager->pInJournal = sqlite3BitvecCreate( pPager->dbSize ); + if( !pPager->pInJournal ){ + rc = SQLITE_NOMEM; + }else{ + pPager->origDbSize = pPager->dbSize; + rc = writeJournalHdr(pPager); + } } - - PAGERTRACE(("TRANSACTION %d\n", PAGERID(pPager))); - assert( !isOpen(pPager->jfd) || pPager->journalOff>0 || rc!=SQLITE_OK ); + assert( !pPager->journalOpen || pPager->journalOff>0 || rc!=SQLITE_OK ); return rc; } /* -** Mark a single data page as writeable. The page is written into the -** main journal or sub-journal as required. If the page is written into -** one of the journals, the corresponding bit is set in the -** Pager.pInJournal bitvec and the PagerSavepoint.pInSavepoint bitvecs -** of any open savepoints as appropriate. +** Make a page dirty. Set its dirty flag and add it to the dirty +** page list. +*/ +static void makeDirty(PgHdr *pPg){ + sqlite3PcacheMakeDirty(pPg); +} + +/* +** Make a page clean. Clear its dirty bit and remove it from the +** dirty page list. +*/ +static void makeClean(PgHdr *pPg){ + sqlite3PcacheMakeClean(pPg); +} + + +/* +** Mark a data page as writeable. The page is written into the journal +** if it is not there already. This routine must be called before making +** changes to a page. +** +** The first time this routine is called, the pager creates a new +** journal and acquires a RESERVED lock on the database. If the RESERVED +** lock could not be acquired, this routine returns SQLITE_BUSY. The +** calling routine must check for that return value and be careful not to +** change any page data until this routine returns SQLITE_OK. +** +** If the journal file could not be written because the disk is full, +** then this routine returns SQLITE_FULL and does an immediate rollback. +** All subsequent write attempts also return SQLITE_FULL until there +** is a call to sqlite3PagerCommit() or sqlite3PagerRollback() to +** reset. */ static int pager_write(PgHdr *pPg){ void *pData = pPg->pData; Pager *pPager = pPg->pPager; int rc = SQLITE_OK; @@ -4054,16 +3140,32 @@ } assert( !pPager->setMaster ); CHECK_PAGE(pPg); + + /* If this page was previously acquired with noContent==1, that means + ** we didn't really read in the content of the page. This can happen + ** (for example) when the page is being moved to the freelist. But + ** now we are (perhaps) moving the page off of the freelist for + ** reuse and we need to know its original content so that content + ** can be stored in the rollback journal. So do the read at this + ** time. + */ + rc = pager_get_content(pPg); + if( rc ){ + return rc; + } /* Mark the page as dirty. If the page has already been written ** to the journal then we can return right away. */ - sqlite3PcacheMakeDirty(pPg); - if( pageInJournal(pPg) && !subjRequiresPage(pPg) ){ + makeDirty(pPg); + if( (pPg->flags&PGHDR_IN_JOURNAL) + && (pageInStatement(pPg) || pPager->stmtInUse==0) + ){ + pPager->dirtyCache = 1; pPager->dbModified = 1; }else{ /* If we get this far, it means that the page needs to be ** written to the transaction journal or the ckeckpoint journal @@ -4071,148 +3173,167 @@ ** ** First check to see that the transaction journal exists and ** create it if it does not. */ assert( pPager->state!=PAGER_UNLOCK ); - rc = sqlite3PagerBegin(pPager, 0); + rc = sqlite3PagerBegin(pPg, 0); if( rc!=SQLITE_OK ){ return rc; } assert( pPager->state>=PAGER_RESERVED ); - if( !isOpen(pPager->jfd) && pPager->useJournal + if( !pPager->journalOpen && pPager->useJournal && pPager->journalMode!=PAGER_JOURNALMODE_OFF ){ rc = pager_open_journal(pPager); if( rc!=SQLITE_OK ) return rc; } + pPager->dirtyCache = 1; pPager->dbModified = 1; /* The transaction journal now exists and we have a RESERVED or an ** EXCLUSIVE lock on the main database file. Write the current page to ** the transaction journal if it is not there already. */ - if( !pageInJournal(pPg) && isOpen(pPager->jfd) ){ - if( pPg->pgno<=pPager->dbOrigSize ){ - u32 cksum; - char *pData2; - - /* We should never write to the journal file the page that - ** contains the database locks. The following assert verifies - ** that we do not. */ - assert( pPg->pgno!=PAGER_MJ_PGNO(pPager) ); - pData2 = CODEC2(pPager, pData, pPg->pgno, 7); - cksum = pager_cksum(pPager, (u8*)pData2); - rc = write32bits(pPager->jfd, pPager->journalOff, pPg->pgno); - if( rc==SQLITE_OK ){ - rc = sqlite3OsWrite(pPager->jfd, pData2, pPager->pageSize, - pPager->journalOff + 4); - pPager->journalOff += pPager->pageSize+4; - } - if( rc==SQLITE_OK ){ - rc = write32bits(pPager->jfd, pPager->journalOff, cksum); - pPager->journalOff += 4; - } - IOTRACE(("JOUT %p %d %lld %d\n", pPager, pPg->pgno, - pPager->journalOff, pPager->pageSize)); - PAGER_INCR(sqlite3_pager_writej_count); - PAGERTRACE(("JOURNAL %d page %d needSync=%d hash(%08x)\n", - PAGERID(pPager), pPg->pgno, - ((pPg->flags&PGHDR_NEED_SYNC)?1:0), pager_pagehash(pPg))); - - /* Even if an IO or diskfull error occurred while journalling the - ** page in the block above, set the need-sync flag for the page. - ** Otherwise, when the transaction is rolled back, the logic in - ** playback_one_page() will think that the page needs to be restored - ** in the database file. And if an IO error occurs while doing so, - ** then corruption may follow. - */ - if( !pPager->noSync ){ - pPg->flags |= PGHDR_NEED_SYNC; - pPager->needSync = 1; - } - - /* An error has occured writing to the journal file. The - ** transaction will be rolled back by the layer above. - */ - if( rc!=SQLITE_OK ){ - return rc; - } - - pPager->nRec++; - assert( pPager->pInJournal!=0 ); - rc = sqlite3BitvecSet(pPager->pInJournal, pPg->pgno); - testcase( rc==SQLITE_NOMEM ); - assert( rc==SQLITE_OK || rc==SQLITE_NOMEM ); - rc |= addToSavepointBitvecs(pPager, pPg->pgno); - if( rc!=SQLITE_OK ){ - assert( rc==SQLITE_NOMEM ); - return rc; + if( !(pPg->flags&PGHDR_IN_JOURNAL) && (pPager->journalOpen || MEMDB) ){ + if( (int)pPg->pgno <= pPager->origDbSize ){ + if( MEMDB ){ + PAGERTRACE3("JOURNAL %d page %d\n", PAGERID(pPager), pPg->pgno); + rc = sqlite3PcachePreserve(pPg, 0); + if( rc!=SQLITE_OK ){ + return rc; + } + }else{ + u32 cksum; + char *pData2; + + /* We should never write to the journal file the page that + ** contains the database locks. The following assert verifies + ** that we do not. */ + assert( pPg->pgno!=PAGER_MJ_PGNO(pPager) ); + pData2 = CODEC2(pPager, pData, pPg->pgno, 7); + cksum = pager_cksum(pPager, (u8*)pData2); + rc = write32bits(pPager->jfd, pPager->journalOff, pPg->pgno); + if( rc==SQLITE_OK ){ + rc = sqlite3OsWrite(pPager->jfd, pData2, pPager->pageSize, + pPager->journalOff + 4); + pPager->journalOff += pPager->pageSize+4; + } + if( rc==SQLITE_OK ){ + rc = write32bits(pPager->jfd, pPager->journalOff, cksum); + pPager->journalOff += 4; + } + IOTRACE(("JOUT %p %d %lld %d\n", pPager, pPg->pgno, + pPager->journalOff, pPager->pageSize)); + PAGER_INCR(sqlite3_pager_writej_count); + PAGERTRACE5("JOURNAL %d page %d needSync=%d hash(%08x)\n", + PAGERID(pPager), pPg->pgno, + ((pPg->flags&PGHDR_NEED_SYNC)?1:0), pager_pagehash(pPg)); + + /* An error has occured writing to the journal file. The + ** transaction will be rolled back by the layer above. + */ + if( rc!=SQLITE_OK ){ + return rc; + } + + pPager->nRec++; + assert( pPager->pInJournal!=0 ); + sqlite3BitvecSet(pPager->pInJournal, pPg->pgno); + if( !pPager->noSync ){ + pPg->flags |= PGHDR_NEED_SYNC; + } + if( pPager->stmtInUse ){ + sqlite3BitvecSet(pPager->pInStmt, pPg->pgno); + } } }else{ if( !pPager->journalStarted && !pPager->noSync ){ pPg->flags |= PGHDR_NEED_SYNC; - pPager->needSync = 1; } - PAGERTRACE(("APPEND %d page %d needSync=%d\n", + PAGERTRACE4("APPEND %d page %d needSync=%d\n", PAGERID(pPager), pPg->pgno, - ((pPg->flags&PGHDR_NEED_SYNC)?1:0))); + ((pPg->flags&PGHDR_NEED_SYNC)?1:0)); + } + if( pPg->flags&PGHDR_NEED_SYNC ){ + pPager->needSync = 1; } + pPg->flags |= PGHDR_IN_JOURNAL; } /* If the statement journal is open and the page is not in it, ** then write the current page to the statement journal. Note that ** the statement journal format differs from the standard journal format ** in that it omits the checksums and the header. */ - if( subjRequiresPage(pPg) ){ - rc = subjournalPage(pPg); + if( pPager->stmtInUse + && !pageInStatement(pPg) + && (int)pPg->pgno<=pPager->stmtSize + ){ + assert( (pPg->flags&PGHDR_IN_JOURNAL) + || (int)pPg->pgno>pPager->origDbSize ); + if( MEMDB ){ + rc = sqlite3PcachePreserve(pPg, 1); + if( rc!=SQLITE_OK ){ + return rc; + } + PAGERTRACE3("STMT-JOURNAL %d page %d\n", PAGERID(pPager), pPg->pgno); + }else{ + i64 offset = pPager->stmtNRec*(4+pPager->pageSize); + char *pData2 = CODEC2(pPager, pData, pPg->pgno, 7); + rc = write32bits(pPager->stfd, offset, pPg->pgno); + if( rc==SQLITE_OK ){ + rc = sqlite3OsWrite(pPager->stfd, pData2, pPager->pageSize, offset+4); + } + PAGERTRACE3("STMT-JOURNAL %d page %d\n", PAGERID(pPager), pPg->pgno); + if( rc!=SQLITE_OK ){ + return rc; + } + pPager->stmtNRec++; + assert( pPager->pInStmt!=0 ); + sqlite3BitvecSet(pPager->pInStmt, pPg->pgno); + } } } /* Update the database size and return. */ assert( pPager->state>=PAGER_SHARED ); - if( pPager->dbSizepgno ){ + if( pPager->dbSize<(int)pPg->pgno ){ pPager->dbSize = pPg->pgno; - if( pPager->dbSize==(PAGER_MJ_PGNO(pPager)-1) ){ + if( !MEMDB && pPager->dbSize==PENDING_BYTE/pPager->pageSize ){ pPager->dbSize++; } } return rc; } /* -** Mark a data page as writeable. This routine must be called before -** making changes to a page. The caller must check the return value -** of this function and be careful not to change any page data unless -** this routine returns SQLITE_OK. +** This function is used to mark a data-page as writable. It uses +** pager_write() to open a journal file (if it is not already open) +** and write the page *pData to the journal. ** ** The difference between this function and pager_write() is that this ** function also deals with the special case where 2 or more pages ** fit on a single disk sector. In this case all co-resident pages ** must have been written to the journal file before returning. -** -** If an error occurs, SQLITE_NOMEM or an IO error code is returned -** as appropriate. Otherwise, SQLITE_OK. */ int sqlite3PagerWrite(DbPage *pDbPage){ int rc = SQLITE_OK; PgHdr *pPg = pDbPage; Pager *pPager = pPg->pPager; Pgno nPagePerSector = (pPager->sectorSize/pPager->pageSize); - if( nPagePerSector>1 ){ + if( !MEMDB && nPagePerSector>1 ){ Pgno nPageCount; /* Total number of pages in database file */ Pgno pg1; /* First page of the sector pPg is located on. */ int nPage; /* Number of pages starting at pg1 to journal */ - int ii; /* Loop counter */ - int needSync = 0; /* True if any page has PGHDR_NEED_SYNC */ + int ii; + int needSync = 0; /* Set the doNotSync flag to 1. This is because we cannot allow a journal ** header to be written between the pages journaled by this function. */ - assert( !MEMDB ); assert( pPager->doNotSync==0 ); pPager->doNotSync = 1; /* This trick assumes that both the page-size and sector-size are ** an integer power of 2. It sets variable pg1 to the identifier @@ -4240,11 +3361,10 @@ rc = sqlite3PagerGet(pPager, pg, &pPage); if( rc==SQLITE_OK ){ rc = pager_write(pPage); if( pPage->flags&PGHDR_NEED_SYNC ){ needSync = 1; - assert(pPager->needSync); } sqlite3PagerUnref(pPage); } } }else if( (pPage = pager_lookup(pPager, pg))!=0 ){ @@ -4253,24 +3373,22 @@ } sqlite3PagerUnref(pPage); } } - /* If the PGHDR_NEED_SYNC flag is set for any of the nPage pages + /* If the PgHdr.needSync flag is set for any of the nPage pages ** starting at pg1, then it needs to be set for all of them. Because ** writing to any of these nPage pages may damage the others, the ** journal file must contain sync()ed copies of all of them ** before any of them can be written out to the database file. */ if( needSync ){ assert( !MEMDB && pPager->noSync==0 ); for(ii=0; iiflags |= PGHDR_NEED_SYNC; - sqlite3PagerUnref(pPage); - } + if( pPage ) pPage->flags |= PGHDR_NEED_SYNC; + sqlite3PagerUnref(pPage); } assert(pPager->needSync); } assert( pPager->doNotSync==1 ); @@ -4293,123 +3411,180 @@ #endif /* ** A call to this routine tells the pager that it is not necessary to ** write the information on page pPg back to the disk, even though -** that page might be marked as dirty. This happens, for example, when -** the page has been added as a leaf of the freelist and so its -** content no longer matters. -** -** The overlying software layer calls this routine when all of the data -** on the given page is unused. The pager marks the page as clean so -** that it does not get written to disk. -** -** Tests show that this optimization can quadruple the speed of large -** DELETE operations. -*/ -void sqlite3PagerDontWrite(PgHdr *pPg){ - Pager *pPager = pPg->pPager; - if( (pPg->flags&PGHDR_DIRTY) && pPager->nSavepoint==0 ){ - PAGERTRACE(("DONT_WRITE page %d of %d\n", pPg->pgno, PAGERID(pPager))); - IOTRACE(("CLEAN %p %d\n", pPager, pPg->pgno)) - pPg->flags |= PGHDR_DONT_WRITE; -#ifdef SQLITE_CHECK_PAGES - pPg->pageHash = pager_pagehash(pPg); -#endif - } -} - -/* -** This routine is called to increment the value of the database file -** change-counter, stored as a 4-byte big-endian integer starting at -** byte offset 24 of the pager file. -** -** If the isDirect flag is zero, then this is done by calling -** sqlite3PagerWrite() on page 1, then modifying the contents of the -** page data. In this case the file will be updated when the current -** transaction is committed. -** -** The isDirect flag may only be non-zero if the library was compiled -** with the SQLITE_ENABLE_ATOMIC_WRITE macro defined. In this case, -** if isDirect is non-zero, then the database file is updated directly -** by writing an updated version of page 1 using a call to the -** sqlite3OsWrite() function. -*/ -static int pager_incr_changecounter(Pager *pPager, int isDirectMode){ - int rc = SQLITE_OK; - - /* Declare and initialize constant integer 'isDirect'. If the - ** atomic-write optimization is enabled in this build, then isDirect - ** is initialized to the value passed as the isDirectMode parameter - ** to this function. Otherwise, it is always set to zero. - ** - ** The idea is that if the atomic-write optimization is not - ** enabled at compile time, the compiler can omit the tests of - ** 'isDirect' below, as well as the block enclosed in the - ** "if( isDirect )" condition. - */ -#ifndef SQLITE_ENABLE_ATOMIC_WRITE - const int isDirect = 0; - assert( isDirectMode==0 ); - UNUSED_PARAMETER(isDirectMode); -#else - const int isDirect = isDirectMode; -#endif - - assert( pPager->state>=PAGER_RESERVED ); - if( !pPager->changeCountDone && pPager->dbSize>0 ){ - PgHdr *pPgHdr; /* Reference to page 1 */ - u32 change_counter; /* Initial value of change-counter field */ - - assert( !pPager->tempFile && isOpen(pPager->fd) ); - - /* Open page 1 of the file for writing. */ - rc = sqlite3PagerGet(pPager, 1, &pPgHdr); - assert( pPgHdr==0 || rc==SQLITE_OK ); - - /* If page one was fetched successfully, and this function is not - ** operating in direct-mode, make page 1 writable. - */ - if( rc==SQLITE_OK && !isDirect ){ - rc = sqlite3PagerWrite(pPgHdr); - } - - if( rc==SQLITE_OK ){ - /* Increment the value just read and write it back to byte 24. */ - change_counter = sqlite3Get4byte((u8*)pPager->dbFileVers); - change_counter++; - put32bits(((char*)pPgHdr->pData)+24, change_counter); - - /* If running in direct mode, write the contents of page 1 to the file. */ - if( isDirect ){ - const void *zBuf = pPgHdr->pData; - assert( pPager->dbFileSize>0 ); - rc = sqlite3OsWrite(pPager->fd, zBuf, pPager->pageSize, 0); - } - - /* If everything worked, set the changeCountDone flag. */ - if( rc==SQLITE_OK ){ - pPager->changeCountDone = 1; - } - } - - /* Release the page reference. */ - sqlite3PagerUnref(pPgHdr); - } - return rc; -} - -/* -** Sync the pager file to disk. This is a no-op for in-memory files -** or pages with the Pager.noSync flag set. -** -** If successful, or called on a pager for which it is a no-op, this -** function returns SQLITE_OK. Otherwise, an IO error code is returned. -*/ -int sqlite3PagerSync(Pager *pPager){ - int rc; /* Return code */ - if( MEMDB || pPager->noSync ){ +** that page might be marked as dirty. +** +** The overlying software layer calls this routine when all of the data +** on the given page is unused. The pager marks the page as clean so +** that it does not get written to disk. +** +** Tests show that this optimization, together with the +** sqlite3PagerDontRollback() below, more than double the speed +** of large INSERT operations and quadruple the speed of large DELETEs. +** +** When this routine is called, set the alwaysRollback flag to true. +** Subsequent calls to sqlite3PagerDontRollback() for the same page +** will thereafter be ignored. This is necessary to avoid a problem +** where a page with data is added to the freelist during one part of +** a transaction then removed from the freelist during a later part +** of the same transaction and reused for some other purpose. When it +** is first added to the freelist, this routine is called. When reused, +** the sqlite3PagerDontRollback() routine is called. But because the +** page contains critical data, we still need to be sure it gets +** rolled back in spite of the sqlite3PagerDontRollback() call. +*/ +int sqlite3PagerDontWrite(DbPage *pDbPage){ + PgHdr *pPg = pDbPage; + Pager *pPager = pPg->pPager; + int rc; + + if( MEMDB || pPg->pgno>pPager->origDbSize ){ + return SQLITE_OK; + } + if( pPager->pAlwaysRollback==0 ){ + assert( pPager->pInJournal ); + pPager->pAlwaysRollback = sqlite3BitvecCreate(pPager->origDbSize); + if( !pPager->pAlwaysRollback ){ + return SQLITE_NOMEM; + } + } + rc = sqlite3BitvecSet(pPager->pAlwaysRollback, pPg->pgno); + + if( rc==SQLITE_OK && (pPg->flags&PGHDR_DIRTY) && !pPager->stmtInUse ){ + assert( pPager->state>=PAGER_SHARED ); + if( pPager->dbSize==(int)pPg->pgno && pPager->origDbSizedbSize ){ + /* If this pages is the last page in the file and the file has grown + ** during the current transaction, then do NOT mark the page as clean. + ** When the database file grows, we must make sure that the last page + ** gets written at least once so that the disk file will be the correct + ** size. If you do not write this page and the size of the file + ** on the disk ends up being too small, that can lead to database + ** corruption during the next transaction. + */ + }else{ + PAGERTRACE3("DONT_WRITE page %d of %d\n", pPg->pgno, PAGERID(pPager)); + IOTRACE(("CLEAN %p %d\n", pPager, pPg->pgno)) + pPg->flags |= PGHDR_DONT_WRITE; +#ifdef SQLITE_CHECK_PAGES + pPg->pageHash = pager_pagehash(pPg); +#endif + } + } + return rc; +} + +/* +** A call to this routine tells the pager that if a rollback occurs, +** it is not necessary to restore the data on the given page. This +** means that the pager does not have to record the given page in the +** rollback journal. +** +** If we have not yet actually read the content of this page (if +** the PgHdr.needRead flag is set) then this routine acts as a promise +** that we will never need to read the page content in the future. +** so the needRead flag can be cleared at this point. +*/ +void sqlite3PagerDontRollback(DbPage *pPg){ + Pager *pPager = pPg->pPager; + + assert( pPager->state>=PAGER_RESERVED ); + + /* If the journal file is not open, or DontWrite() has been called on + ** this page (DontWrite() sets the alwaysRollback flag), then this + ** function is a no-op. + */ + if( pPager->journalOpen==0 + || sqlite3BitvecTest(pPager->pAlwaysRollback, pPg->pgno) + || pPg->pgno>pPager->origDbSize + ){ + return; + } + assert( !MEMDB ); /* For a memdb, pPager->journalOpen is always 0 */ + +#ifdef SQLITE_SECURE_DELETE + if( (pPg->flags & PGHDR_IN_JOURNAL)!=0 || (int)pPg->pgno>pPager->origDbSize ){ + return; + } +#endif + + /* If SECURE_DELETE is disabled, then there is no way that this + ** routine can be called on a page for which sqlite3PagerDontWrite() + ** has not been previously called during the same transaction. + ** And if DontWrite() has previously been called, the following + ** conditions must be met. + ** + ** (Later:) Not true. If the database is corrupted by having duplicate + ** pages on the freelist (ex: corrupt9.test) then the following is not + ** necessarily true: + */ + /* assert( !pPg->inJournal && (int)pPg->pgno <= pPager->origDbSize ); */ + + assert( pPager->pInJournal!=0 ); + sqlite3BitvecSet(pPager->pInJournal, pPg->pgno); + pPg->flags |= PGHDR_IN_JOURNAL; + pPg->flags &= ~PGHDR_NEED_READ; + if( pPager->stmtInUse ){ + assert( pPager->stmtSize >= pPager->origDbSize ); + sqlite3BitvecSet(pPager->pInStmt, pPg->pgno); + } + PAGERTRACE3("DONT_ROLLBACK page %d of %d\n", pPg->pgno, PAGERID(pPager)); + IOTRACE(("GARBAGE %p %d\n", pPager, pPg->pgno)) +} + + +/* +** This routine is called to increment the database file change-counter, +** stored at byte 24 of the pager file. +*/ +static int pager_incr_changecounter(Pager *pPager, int isDirect){ + PgHdr *pPgHdr; + u32 change_counter; + int rc = SQLITE_OK; + +#ifndef SQLITE_ENABLE_ATOMIC_WRITE + assert( isDirect==0 ); /* isDirect is only true for atomic writes */ +#endif + if( !pPager->changeCountDone ){ + /* Open page 1 of the file for writing. */ + rc = sqlite3PagerGet(pPager, 1, &pPgHdr); + if( rc!=SQLITE_OK ) return rc; + + if( !isDirect ){ + rc = sqlite3PagerWrite(pPgHdr); + if( rc!=SQLITE_OK ){ + sqlite3PagerUnref(pPgHdr); + return rc; + } + } + + /* Increment the value just read and write it back to byte 24. */ + change_counter = sqlite3Get4byte((u8*)pPager->dbFileVers); + change_counter++; + put32bits(((char*)pPgHdr->pData)+24, change_counter); + +#ifdef SQLITE_ENABLE_ATOMIC_WRITE + if( isDirect && pPager->fd->pMethods ){ + const void *zBuf = pPgHdr->pData; + rc = sqlite3OsWrite(pPager->fd, zBuf, pPager->pageSize, 0); + } +#endif + + /* Release the page reference. */ + sqlite3PagerUnref(pPgHdr); + pPager->changeCountDone = 1; + } + return rc; +} + +/* +** Sync the pager file to disk. +*/ +int sqlite3PagerSync(Pager *pPager){ + int rc; + if( MEMDB ){ rc = SQLITE_OK; }else{ rc = sqlite3OsSync(pPager->fd, pPager->sync_flags); } return rc; @@ -4419,288 +3594,244 @@ ** Sync the database file for the pager pPager. zMaster points to the name ** of a master journal file that should be written into the individual ** journal file. zMaster may be NULL, which is interpreted as no master ** journal (a single database transaction). ** -** This routine ensures that: -** -** * The database file change-counter is updated, -** * the journal is synced (unless the atomic-write optimization is used), -** * all dirty pages are written to the database file, -** * the database file is truncated (if required), and -** * the database file synced. -** -** The only thing that remains to commit the transaction is to finalize -** (delete, truncate or zero the first part of) the journal file (or -** delete the master journal file if specified). +** This routine ensures that the journal is synced, all dirty pages written +** to the database file and the database file synced. The only thing that +** remains to commit the transaction is to delete the journal file (or +** master journal file if specified). ** ** Note that if zMaster==NULL, this does not overwrite a previous value ** passed to an sqlite3PagerCommitPhaseOne() call. +** +** If parameter nTrunc is non-zero, then the pager file is truncated to +** nTrunc pages (this is used by auto-vacuum databases). ** ** If the final parameter - noSync - is true, then the database file itself ** is not synced. The caller must call sqlite3PagerSync() directly to ** sync the database file before calling CommitPhaseTwo() to delete the ** journal file in this case. */ int sqlite3PagerCommitPhaseOne( - Pager *pPager, /* Pager object */ - const char *zMaster, /* If not NULL, the master journal name */ - int noSync /* True to omit the xSync on the db file */ + Pager *pPager, + const char *zMaster, + Pgno nTrunc, + int noSync ){ - int rc = SQLITE_OK; /* Return code */ + int rc = SQLITE_OK; if( pPager->errCode ){ return pPager->errCode; } - PAGERTRACE(("DATABASE SYNC: File=%s zMaster=%s nSize=%d\n", - pPager->zFilename, zMaster, pPager->dbSize)); + /* If no changes have been made, we can leave the transaction early. + */ + if( pPager->dbModified==0 && + (pPager->journalMode!=PAGER_JOURNALMODE_DELETE || + pPager->exclusiveMode!=0) ){ + assert( pPager->dirtyCache==0 || pPager->journalOpen==0 ); + return SQLITE_OK; + } + + PAGERTRACE4("DATABASE SYNC: File=%s zMaster=%s nTrunc=%d\n", + pPager->zFilename, zMaster, nTrunc); /* If this is an in-memory db, or no pages have been written to, or this ** function has already been called, it is a no-op. */ - if( MEMDB && pPager->dbModified ){ - sqlite3BackupRestart(pPager->pBackup); - }else if( pPager->state!=PAGER_SYNCED && pPager->dbModified ){ - - /* The following block updates the change-counter. Exactly how it - ** does this depends on whether or not the atomic-update optimization - ** was enabled at compile time, and if this transaction meets the - ** runtime criteria to use the operation: - ** - ** * The file-system supports the atomic-write property for - ** blocks of size page-size, and - ** * This commit is not part of a multi-file transaction, and - ** * Exactly one page has been modified and store in the journal file. - ** - ** If the optimization was not enabled at compile time, then the - ** pager_incr_changecounter() function is called to update the change - ** counter in 'indirect-mode'. If the optimization is compiled in but - ** is not applicable to this transaction, call sqlite3JournalCreate() - ** to make sure the journal file has actually been created, then call - ** pager_incr_changecounter() to update the change-counter in indirect - ** mode. - ** - ** Otherwise, if the optimization is both enabled and applicable, - ** then call pager_incr_changecounter() to update the change-counter - ** in 'direct' mode. In this case the journal file will never be - ** created for this transaction. - */ -#ifdef SQLITE_ENABLE_ATOMIC_WRITE - PgHdr *pPg; - assert( isOpen(pPager->jfd) || pPager->journalMode==PAGER_JOURNALMODE_OFF ); - if( !zMaster && isOpen(pPager->jfd) - && pPager->journalOff==jrnlBufferSize(pPager) - && pPager->dbSize>=pPager->dbFileSize - && (0==(pPg = sqlite3PcacheDirtyList(pPager->pPCache)) || 0==pPg->pDirty) - ){ - /* Update the db file change counter via the direct-write method. The - ** following call will modify the in-memory representation of page 1 - ** to include the updated change counter and then write page 1 - ** directly to the database file. Because of the atomic-write - ** property of the host file-system, this is safe. - */ - rc = pager_incr_changecounter(pPager, 1); - }else{ - rc = sqlite3JournalCreate(pPager->jfd); - if( rc==SQLITE_OK ){ - rc = pager_incr_changecounter(pPager, 0); - } - } -#else - rc = pager_incr_changecounter(pPager, 0); -#endif - if( rc!=SQLITE_OK ) goto commit_phase_one_exit; - - /* If this transaction has made the database smaller, then all pages - ** being discarded by the truncation must be written to the journal - ** file. This can only happen in auto-vacuum mode. - ** - ** Before reading the pages with page numbers larger than the - ** current value of Pager.dbSize, set dbSize back to the value - ** that it took at the start of the transaction. Otherwise, the - ** calls to sqlite3PagerGet() return zeroed pages instead of - ** reading data from the database file. - */ -#ifndef SQLITE_OMIT_AUTOVACUUM - if( pPager->dbSizedbOrigSize - && pPager->journalMode!=PAGER_JOURNALMODE_OFF - ){ - Pgno i; /* Iterator variable */ - const Pgno iSkip = PAGER_MJ_PGNO(pPager); /* Pending lock page */ - const Pgno dbSize = pPager->dbSize; /* Database image size */ - pPager->dbSize = pPager->dbOrigSize; - for( i=dbSize+1; i<=pPager->dbOrigSize; i++ ){ - if( !sqlite3BitvecTest(pPager->pInJournal, i) && i!=iSkip ){ - PgHdr *pPage; /* Page to journal */ - rc = sqlite3PagerGet(pPager, i, &pPage); - if( rc!=SQLITE_OK ) goto commit_phase_one_exit; - rc = sqlite3PagerWrite(pPage); - sqlite3PagerUnref(pPage); - if( rc!=SQLITE_OK ) goto commit_phase_one_exit; - } - } - pPager->dbSize = dbSize; - } -#endif - - /* Write the master journal name into the journal file. If a master - ** journal file name has already been written to the journal file, - ** or if zMaster is NULL (no master journal), then this call is a no-op. - */ - rc = writeMasterJournal(pPager, zMaster); - if( rc!=SQLITE_OK ) goto commit_phase_one_exit; - - /* Sync the journal file. If the atomic-update optimization is being - ** used, this call will not create the journal file or perform any - ** real IO. - */ - rc = syncJournal(pPager); - if( rc!=SQLITE_OK ) goto commit_phase_one_exit; - - /* Write all dirty pages to the database file. */ - rc = pager_write_pagelist(sqlite3PcacheDirtyList(pPager->pPCache)); - if( rc!=SQLITE_OK ){ - assert( rc!=SQLITE_IOERR_BLOCKED ); - goto commit_phase_one_exit; - } - sqlite3PcacheCleanAll(pPager->pPCache); - - /* If the file on disk is not the same size as the database image, - ** then use pager_truncate to grow or shrink the file here. - */ - if( pPager->dbSize!=pPager->dbFileSize ){ - Pgno nNew = pPager->dbSize - (pPager->dbSize==PAGER_MJ_PGNO(pPager)); - assert( pPager->state>=PAGER_EXCLUSIVE ); - rc = pager_truncate(pPager, nNew); - if( rc!=SQLITE_OK ) goto commit_phase_one_exit; - } - - /* Finally, sync the database file. */ + if( pPager->state!=PAGER_SYNCED && !MEMDB && pPager->dirtyCache ){ + PgHdr *pPg; + +#ifdef SQLITE_ENABLE_ATOMIC_WRITE + /* The atomic-write optimization can be used if all of the + ** following are true: + ** + ** + The file-system supports the atomic-write property for + ** blocks of size page-size, and + ** + This commit is not part of a multi-file transaction, and + ** + Exactly one page has been modified and store in the journal file. + ** + ** If the optimization can be used, then the journal file will never + ** be created for this transaction. + */ + int useAtomicWrite; + pPg = sqlite3PcacheDirtyList(pPager->pPCache); + useAtomicWrite = ( + !zMaster && + pPager->journalOpen && + pPager->journalOff==jrnlBufferSize(pPager) && + nTrunc==0 && + (pPg==0 || pPg->pDirty==0) + ); + assert( pPager->journalOpen || pPager->journalMode==PAGER_JOURNALMODE_OFF ); + if( useAtomicWrite ){ + /* Update the nRec field in the journal file. */ + int offset = pPager->journalHdr + sizeof(aJournalMagic); + assert(pPager->nRec==1); + rc = write32bits(pPager->jfd, offset, pPager->nRec); + + /* Update the db file change counter. The following call will modify + ** the in-memory representation of page 1 to include the updated + ** change counter and then write page 1 directly to the database + ** file. Because of the atomic-write property of the host file-system, + ** this is safe. + */ + if( rc==SQLITE_OK ){ + rc = pager_incr_changecounter(pPager, 1); + } + }else{ + rc = sqlite3JournalCreate(pPager->jfd); + } + + if( !useAtomicWrite && rc==SQLITE_OK ) +#endif + + /* If a master journal file name has already been written to the + ** journal file, then no sync is required. This happens when it is + ** written, then the process fails to upgrade from a RESERVED to an + ** EXCLUSIVE lock. The next time the process tries to commit the + ** transaction the m-j name will have already been written. + */ + if( !pPager->setMaster ){ + rc = pager_incr_changecounter(pPager, 0); + if( rc!=SQLITE_OK ) goto sync_exit; + if( pPager->journalMode!=PAGER_JOURNALMODE_OFF ){ +#ifndef SQLITE_OMIT_AUTOVACUUM + if( nTrunc!=0 ){ + /* If this transaction has made the database smaller, then all pages + ** being discarded by the truncation must be written to the journal + ** file. + */ + Pgno i; + int iSkip = PAGER_MJ_PGNO(pPager); + for( i=nTrunc+1; i<=pPager->origDbSize; i++ ){ + if( !sqlite3BitvecTest(pPager->pInJournal, i) && i!=iSkip ){ + rc = sqlite3PagerGet(pPager, i, &pPg); + if( rc!=SQLITE_OK ) goto sync_exit; + rc = sqlite3PagerWrite(pPg); + sqlite3PagerUnref(pPg); + if( rc!=SQLITE_OK ) goto sync_exit; + } + } + } +#endif + rc = writeMasterJournal(pPager, zMaster); + if( rc!=SQLITE_OK ) goto sync_exit; + rc = syncJournal(pPager); + } + } + if( rc!=SQLITE_OK ) goto sync_exit; + +#ifndef SQLITE_OMIT_AUTOVACUUM + if( nTrunc!=0 ){ + rc = sqlite3PagerTruncate(pPager, nTrunc); + if( rc!=SQLITE_OK ) goto sync_exit; + } +#endif + + /* Write all dirty pages to the database file */ + pPg = sqlite3PcacheDirtyList(pPager->pPCache); + rc = pager_write_pagelist(pPg); + if( rc!=SQLITE_OK ){ + assert( rc!=SQLITE_IOERR_BLOCKED ); + /* The error might have left the dirty list all fouled up here, + ** but that does not matter because if the if the dirty list did + ** get corrupted, then the transaction will roll back and + ** discard the dirty list. There is an assert in + ** pager_get_all_dirty_pages() that verifies that no attempt + ** is made to use an invalid dirty list. + */ + goto sync_exit; + } + sqlite3PcacheCleanAll(pPager->pPCache); + + /* Sync the database file. */ if( !pPager->noSync && !noSync ){ rc = sqlite3OsSync(pPager->fd, pPager->sync_flags); } IOTRACE(("DBSYNC %p\n", pPager)) pPager->state = PAGER_SYNCED; + }else if( MEMDB && nTrunc!=0 ){ + rc = sqlite3PagerTruncate(pPager, nTrunc); } -commit_phase_one_exit: +sync_exit: if( rc==SQLITE_IOERR_BLOCKED ){ /* pager_incr_changecounter() may attempt to obtain an exclusive - ** lock to spill the cache and return IOERR_BLOCKED. But since - ** there is no chance the cache is inconsistent, it is - ** better to return SQLITE_BUSY. - **/ + * lock to spill the cache and return IOERR_BLOCKED. But since + * there is no chance the cache is inconsistent, it is + * better to return SQLITE_BUSY. + */ rc = SQLITE_BUSY; } return rc; } /* -** When this function is called, the database file has been completely -** updated to reflect the changes made by the current transaction and -** synced to disk. The journal file still exists in the file-system -** though, and if a failure occurs at this point it will eventually -** be used as a hot-journal and the current transaction rolled back. -** -** This function finalizes the journal file, either by deleting, -** truncating or partially zeroing it, so that it cannot be used -** for hot-journal rollback. Once this is done the transaction is -** irrevocably committed. -** -** If an error occurs, an IO error code is returned and the pager -** moves into the error state. Otherwise, SQLITE_OK is returned. +** Commit all changes to the database and release the write lock. +** +** If the commit fails for any reason, a rollback attempt is made +** and an error code is returned. If the commit worked, SQLITE_OK +** is returned. */ int sqlite3PagerCommitPhaseTwo(Pager *pPager){ - int rc = SQLITE_OK; /* Return code */ + int rc = SQLITE_OK; - /* Do not proceed if the pager is already in the error state. */ if( pPager->errCode ){ return pPager->errCode; } - - /* This function should not be called if the pager is not in at least - ** PAGER_RESERVED state. And indeed SQLite never does this. But it is - ** nice to have this defensive block here anyway. - */ - if( NEVER(pPager->statestatedbModified==0 && pPager->exclusiveMode - && pPager->journalMode==PAGER_JOURNALMODE_PERSIST - ){ - assert( pPager->journalOff==JOURNAL_HDR_SZ(pPager) ); + if( pPager->dbModified==0 && + (pPager->journalMode!=PAGER_JOURNALMODE_DELETE || + pPager->exclusiveMode!=0) ){ + assert( pPager->dirtyCache==0 || pPager->journalOpen==0 ); return SQLITE_OK; } - - PAGERTRACE(("COMMIT %d\n", PAGERID(pPager))); - assert( pPager->state==PAGER_SYNCED || MEMDB || !pPager->dbModified ); - rc = pager_end_transaction(pPager, pPager->setMaster); - return pager_error(pPager, rc); -} - -/* -** Rollback all changes. The database falls back to PAGER_SHARED mode. -** -** This function performs two tasks: -** -** 1) It rolls back the journal file, restoring all database file and -** in-memory cache pages to the state they were in when the transaction -** was opened, and -** 2) It finalizes the journal file, so that it is not used for hot -** rollback at any point in the future. -** -** subject to the following qualifications: -** -** * If the journal file is not yet open when this function is called, -** then only (2) is performed. In this case there is no journal file -** to roll back. -** -** * If in an error state other than SQLITE_FULL, then task (1) is -** performed. If successful, task (2). Regardless of the outcome -** of either, the error state error code is returned to the caller -** (i.e. either SQLITE_IOERR or SQLITE_CORRUPT). -** -** * If the pager is in PAGER_RESERVED state, then attempt (1). Whether -** or not (1) is succussful, also attempt (2). If successful, return -** SQLITE_OK. Otherwise, enter the error state and return the first -** error code encountered. -** -** In this case there is no chance that the database was written to. -** So is safe to finalize the journal file even if the playback -** (operation 1) failed. However the pager must enter the error state -** as the contents of the in-memory cache are now suspect. -** -** * Finally, if in PAGER_EXCLUSIVE state, then attempt (1). Only -** attempt (2) if (1) is successful. Return SQLITE_OK if successful, -** otherwise enter the error state and return the error code from the -** failing operation. -** -** In this case the database file may have been written to. So if the -** playback operation did not succeed it would not be safe to finalize -** the journal file. It needs to be left in the file-system so that -** some other process can use it to restore the database state (by -** hot-journal rollback). + PAGERTRACE2("COMMIT %d\n", PAGERID(pPager)); + if( MEMDB ){ + sqlite3PcacheCommit(pPager->pPCache, 0); + sqlite3PcacheCleanAll(pPager->pPCache); + sqlite3PcacheAssertFlags(pPager->pPCache, 0, PGHDR_IN_JOURNAL); + pPager->state = PAGER_SHARED; + }else{ + assert( pPager->state==PAGER_SYNCED || !pPager->dirtyCache ); + rc = pager_end_transaction(pPager, pPager->setMaster); + rc = pager_error(pPager, rc); + } + return rc; +} + +/* +** Rollback all changes. The database falls back to PAGER_SHARED mode. +** All in-memory cache pages revert to their original data contents. +** The journal is deleted. +** +** This routine cannot fail unless some other process is not following +** the correct locking protocol or unless some other +** process is writing trash into the journal file (SQLITE_CORRUPT) or +** unless a prior malloc() failed (SQLITE_NOMEM). Appropriate error +** codes are returned for all these occasions. Otherwise, +** SQLITE_OK is returned. */ int sqlite3PagerRollback(Pager *pPager){ - int rc = SQLITE_OK; /* Return code */ - PAGERTRACE(("ROLLBACK %d\n", PAGERID(pPager))); - if( !pPager->dbModified || !isOpen(pPager->jfd) ){ + int rc = SQLITE_OK; + PAGERTRACE2("ROLLBACK %d\n", PAGERID(pPager)); + if( MEMDB ){ + sqlite3PcacheRollback(pPager->pPCache, 1, pPager->xReiniter); + sqlite3PcacheRollback(pPager->pPCache, 0, pPager->xReiniter); + sqlite3PcacheCleanAll(pPager->pPCache); + sqlite3PcacheAssertFlags(pPager->pPCache, 0, PGHDR_IN_JOURNAL); + pPager->dbSize = pPager->origDbSize; + pager_truncate_cache(pPager); + pPager->stmtInUse = 0; + pPager->state = PAGER_SHARED; + }else if( !pPager->dirtyCache || !pPager->journalOpen ){ rc = pager_end_transaction(pPager, pPager->setMaster); }else if( pPager->errCode && pPager->errCode!=SQLITE_FULL ){ if( pPager->state>=PAGER_EXCLUSIVE ){ pager_playback(pPager, 0); } @@ -4715,13 +3846,11 @@ } }else{ rc = pager_playback(pPager, 0); } - if( !MEMDB ){ - pPager->dbSizeValid = 0; - } + pPager->dbSize = -1; /* If an error occurs during a ROLLBACK, we can no longer trust the pager ** cache. So call pager_error() on the way out to make any error ** persistent. */ @@ -4732,11 +3861,11 @@ /* ** Return TRUE if the database file is opened read-only. Return FALSE ** if the database is (in theory) writable. */ -u8 sqlite3PagerIsreadonly(Pager *pPager){ +int sqlite3PagerIsreadonly(Pager *pPager){ return pPager->readOnly; } /* ** Return the number of references to the pager. @@ -4759,158 +3888,121 @@ int *sqlite3PagerStats(Pager *pPager){ static int a[11]; a[0] = sqlite3PcacheRefCount(pPager->pPCache); a[1] = sqlite3PcachePagecount(pPager->pPCache); a[2] = sqlite3PcacheGetCachesize(pPager->pPCache); - a[3] = pPager->dbSizeValid ? (int) pPager->dbSize : -1; + a[3] = pPager->dbSize; a[4] = pPager->state; a[5] = pPager->errCode; a[6] = pPager->nHit; a[7] = pPager->nMiss; a[8] = 0; /* Used to be pPager->nOvfl */ a[9] = pPager->nRead; a[10] = pPager->nWrite; return a; } -#endif - -/* -** Return true if this is an in-memory pager. -*/ int sqlite3PagerIsMemdb(Pager *pPager){ return MEMDB; } - -/* -** Check that there are at least nSavepoint savepoints open. If there are -** currently less than nSavepoints open, then open one or more savepoints -** to make up the difference. If the number of savepoints is already -** equal to nSavepoint, then this function is a no-op. -** -** If a memory allocation fails, SQLITE_NOMEM is returned. If an error -** occurs while opening the sub-journal file, then an IO error code is -** returned. Otherwise, SQLITE_OK. -*/ -int sqlite3PagerOpenSavepoint(Pager *pPager, int nSavepoint){ - int rc = SQLITE_OK; /* Return code */ - int nCurrent = pPager->nSavepoint; /* Current number of savepoints */ - - if( nSavepoint>nCurrent && pPager->useJournal ){ - int ii; /* Iterator variable */ - PagerSavepoint *aNew; /* New Pager.aSavepoint array */ - - /* Either there is no active journal or the sub-journal is open or - ** the journal is always stored in memory */ - assert( pPager->nSavepoint==0 || isOpen(pPager->sjfd) || - pPager->journalMode==PAGER_JOURNALMODE_MEMORY ); - - /* Grow the Pager.aSavepoint array using realloc(). Return SQLITE_NOMEM - ** if the allocation fails. Otherwise, zero the new portion in case a - ** malloc failure occurs while populating it in the for(...) loop below. - */ - aNew = (PagerSavepoint *)sqlite3Realloc( - pPager->aSavepoint, sizeof(PagerSavepoint)*nSavepoint - ); - if( !aNew ){ - return SQLITE_NOMEM; - } - memset(&aNew[nCurrent], 0, (nSavepoint-nCurrent) * sizeof(PagerSavepoint)); - pPager->aSavepoint = aNew; - pPager->nSavepoint = nSavepoint; - - /* Populate the PagerSavepoint structures just allocated. */ - for(ii=nCurrent; iidbSizeValid ); - aNew[ii].nOrig = pPager->dbSize; - if( isOpen(pPager->jfd) && pPager->journalOff>0 ){ - aNew[ii].iOffset = pPager->journalOff; - }else{ - aNew[ii].iOffset = JOURNAL_HDR_SZ(pPager); - } - aNew[ii].iSubRec = pPager->nSubRec; - aNew[ii].pInSavepoint = sqlite3BitvecCreate(pPager->dbSize); - if( !aNew[ii].pInSavepoint ){ - return SQLITE_NOMEM; - } - } - - /* Open the sub-journal, if it is not already opened. */ - rc = openSubJournal(pPager); - } - +#endif + +/* +** Set the statement rollback point. +** +** This routine should be called with the transaction journal already +** open. A new statement journal is created that can be used to rollback +** changes of a single SQL command within a larger transaction. +*/ +static int pagerStmtBegin(Pager *pPager){ + int rc; + assert( !pPager->stmtInUse ); + assert( pPager->state>=PAGER_SHARED ); + assert( pPager->dbSize>=0 ); + PAGERTRACE2("STMT-BEGIN %d\n", PAGERID(pPager)); + if( MEMDB ){ + pPager->stmtInUse = 1; + pPager->stmtSize = pPager->dbSize; + return SQLITE_OK; + } + if( !pPager->journalOpen ){ + pPager->stmtAutoopen = 1; + return SQLITE_OK; + } + assert( pPager->journalOpen ); + assert( pPager->pInStmt==0 ); + pPager->pInStmt = sqlite3BitvecCreate(pPager->dbSize); + if( pPager->pInStmt==0 ){ + /* sqlite3OsLock(pPager->fd, SHARED_LOCK); */ + return SQLITE_NOMEM; + } + pPager->stmtJSize = pPager->journalOff; + pPager->stmtSize = pPager->dbSize; + pPager->stmtHdrOff = 0; + pPager->stmtCksum = pPager->cksumInit; + if( !pPager->stmtOpen ){ + rc = sqlite3PagerOpentemp(pPager, pPager->stfd, SQLITE_OPEN_SUBJOURNAL); + if( rc ){ + goto stmt_begin_failed; + } + pPager->stmtOpen = 1; + pPager->stmtNRec = 0; + } + pPager->stmtInUse = 1; + return SQLITE_OK; + +stmt_begin_failed: + if( pPager->pInStmt ){ + sqlite3BitvecDestroy(pPager->pInStmt); + pPager->pInStmt = 0; + } + return rc; +} +int sqlite3PagerStmtBegin(Pager *pPager){ + int rc; + rc = pagerStmtBegin(pPager); return rc; } /* -** This function is called to rollback or release (commit) a savepoint. -** The savepoint to release or rollback need not be the most recently -** created savepoint. -** -** Parameter op is always either SAVEPOINT_ROLLBACK or SAVEPOINT_RELEASE. -** If it is SAVEPOINT_RELEASE, then release and destroy the savepoint with -** index iSavepoint. If it is SAVEPOINT_ROLLBACK, then rollback all changes -** that have occured since the specified savepoint was created. -** -** The savepoint to rollback or release is identified by parameter -** iSavepoint. A value of 0 means to operate on the outermost savepoint -** (the first created). A value of (Pager.nSavepoint-1) means operate -** on the most recently created savepoint. If iSavepoint is greater than -** (Pager.nSavepoint-1), then this function is a no-op. -** -** If a negative value is passed to this function, then the current -** transaction is rolled back. This is different to calling -** sqlite3PagerRollback() because this function does not terminate -** the transaction or unlock the database, it just restores the -** contents of the database to its original state. -** -** In any case, all savepoints with an index greater than iSavepoint -** are destroyed. If this is a release operation (op==SAVEPOINT_RELEASE), -** then savepoint iSavepoint is also destroyed. -** -** This function may return SQLITE_NOMEM if a memory allocation fails, -** or an IO error code if an IO error occurs while rolling back a -** savepoint. If no errors occur, SQLITE_OK is returned. -*/ -int sqlite3PagerSavepoint(Pager *pPager, int op, int iSavepoint){ - int rc = SQLITE_OK; - - assert( op==SAVEPOINT_RELEASE || op==SAVEPOINT_ROLLBACK ); - assert( iSavepoint>=0 || op==SAVEPOINT_ROLLBACK ); - - if( iSavepointnSavepoint ){ - int ii; /* Iterator variable */ - int nNew; /* Number of remaining savepoints after this op. */ - - /* Figure out how many savepoints will still be active after this - ** operation. Store this value in nNew. Then free resources associated - ** with any savepoints that are destroyed by this operation. - */ - nNew = iSavepoint + (op==SAVEPOINT_ROLLBACK); - for(ii=nNew; iinSavepoint; ii++){ - sqlite3BitvecDestroy(pPager->aSavepoint[ii].pInSavepoint); - } - pPager->nSavepoint = nNew; - - /* If this is a rollback operation, playback the specified savepoint. - ** If this is a temp-file, it is possible that the journal file has - ** not yet been opened. In this case there have been no changes to - ** the database file, so the playback operation can be skipped. - */ - if( op==SAVEPOINT_ROLLBACK && isOpen(pPager->jfd) ){ - PagerSavepoint *pSavepoint = (nNew==0)?0:&pPager->aSavepoint[nNew-1]; - rc = pagerPlaybackSavepoint(pPager, pSavepoint); - assert(rc!=SQLITE_DONE); - } - - /* If this is a release of the outermost savepoint, truncate - ** the sub-journal to zero bytes in size. */ - if( nNew==0 && op==SAVEPOINT_RELEASE && isOpen(pPager->sjfd) ){ - assert( rc==SQLITE_OK ); - rc = sqlite3OsTruncate(pPager->sjfd, 0); - pPager->nSubRec = 0; - } - } +** Commit a statement. +*/ +int sqlite3PagerStmtCommit(Pager *pPager){ + if( pPager->stmtInUse ){ + PAGERTRACE2("STMT-COMMIT %d\n", PAGERID(pPager)); + if( !MEMDB ){ + sqlite3BitvecDestroy(pPager->pInStmt); + pPager->pInStmt = 0; + }else{ + sqlite3PcacheCommit(pPager->pPCache, 1); + } + pPager->stmtNRec = 0; + pPager->stmtInUse = 0; + } + pPager->stmtAutoopen = 0; + return SQLITE_OK; +} + +/* +** Rollback a statement. +*/ +int sqlite3PagerStmtRollback(Pager *pPager){ + int rc; + if( pPager->stmtInUse ){ + PAGERTRACE2("STMT-ROLLBACK %d\n", PAGERID(pPager)); + if( MEMDB ){ + sqlite3PcacheRollback(pPager->pPCache, 1, pPager->xReiniter); + pPager->dbSize = pPager->stmtSize; + pager_truncate_cache(pPager); + rc = SQLITE_OK; + }else{ + rc = pager_stmt_playback(pPager); + } + sqlite3PagerStmtCommit(pPager); + }else{ + rc = SQLITE_OK; + } + pPager->stmtAutoopen = 0; return rc; } /* ** Return the full pathname of the database file. @@ -4932,10 +4024,17 @@ ** not yet been opened. */ sqlite3_file *sqlite3PagerFile(Pager *pPager){ return pPager->fd; } + +/* +** Return the directory of the database file. +*/ +const char *sqlite3PagerDirname(Pager *pPager){ + return pPager->zDirectory; +} /* ** Return the full pathname of the journal file. */ const char *sqlite3PagerJournalname(Pager *pPager){ @@ -4984,49 +4083,22 @@ ** ** If the fourth argument, isCommit, is non-zero, then this page is being ** moved as part of a database reorganization just before the transaction ** is being committed. In this case, it is guaranteed that the database page ** pPg refers to will not be written to again within this transaction. -** -** This function may return SQLITE_NOMEM or an IO error code if an error -** occurs. Otherwise, it returns SQLITE_OK. */ int sqlite3PagerMovepage(Pager *pPager, DbPage *pPg, Pgno pgno, int isCommit){ - PgHdr *pPgOld; /* The page being overwritten. */ - Pgno needSyncPgno = 0; /* Old value of pPg->pgno, if sync is required */ - int rc; /* Return code */ + PgHdr *pPgOld; /* The page being overwritten. */ + Pgno needSyncPgno = 0; assert( pPg->nRef>0 ); - /* If the page being moved is dirty and has not been saved by the latest - ** savepoint, then save the current contents of the page into the - ** sub-journal now. This is required to handle the following scenario: - ** - ** BEGIN; - ** - ** SAVEPOINT one; - ** - ** ROLLBACK TO one; - ** - ** If page X were not written to the sub-journal here, it would not - ** be possible to restore its contents when the "ROLLBACK TO one" - ** statement were is processed. - ** - ** subjournalPage() may need to allocate space to store pPg->pgno into - ** one or more savepoint bitvecs. This is the reason this function - ** may return SQLITE_NOMEM. - */ - if( pPg->flags&PGHDR_DIRTY - && subjRequiresPage(pPg) - && SQLITE_OK!=(rc = subjournalPage(pPg)) - ){ - return rc; - } - - PAGERTRACE(("MOVE %d page %d (needSync=%d) moves to %d\n", - PAGERID(pPager), pPg->pgno, (pPg->flags&PGHDR_NEED_SYNC)?1:0, pgno)); + PAGERTRACE5("MOVE %d page %d (needSync=%d) moves to %d\n", + PAGERID(pPager), pPg->pgno, (pPg->flags&PGHDR_NEED_SYNC)?1:0, pgno); IOTRACE(("MOVE %p %d %d\n", pPager, pPg->pgno, pgno)) + + pager_get_content(pPg); /* If the journal needs to be sync()ed before page pPg->pgno can ** be written to, store pPg->pgno in local variable needSyncPgno. ** ** If the isCommit flag is set, there is no need to remember that @@ -5033,33 +4105,39 @@ ** the journal needs to be sync()ed before database page pPg->pgno ** can be written to. The caller has already promised not to write to it. */ if( (pPg->flags&PGHDR_NEED_SYNC) && !isCommit ){ needSyncPgno = pPg->pgno; - assert( pageInJournal(pPg) || pPg->pgno>pPager->dbOrigSize ); + assert( (pPg->flags&PGHDR_IN_JOURNAL) || (int)pgno>pPager->origDbSize ); assert( pPg->flags&PGHDR_DIRTY ); assert( pPager->needSync ); } /* If the cache contains a page with page-number pgno, remove it ** from its hash chain. Also, if the PgHdr.needSync was set for ** page pgno before the 'move' operation, it needs to be retained ** for the page moved there. */ - pPg->flags &= ~PGHDR_NEED_SYNC; + pPg->flags &= ~(PGHDR_NEED_SYNC|PGHDR_IN_JOURNAL); pPgOld = pager_lookup(pPager, pgno); assert( !pPgOld || pPgOld->nRef==1 ); if( pPgOld ){ pPg->flags |= (pPgOld->flags&PGHDR_NEED_SYNC); } + if( sqlite3BitvecTest(pPager->pInJournal, pgno) ){ + assert( !MEMDB ); + pPg->flags |= PGHDR_IN_JOURNAL; + } sqlite3PcacheMove(pPg, pgno); if( pPgOld ){ - sqlite3PcacheDrop(pPgOld); + sqlite3PcacheMove(pPgOld, 0); + sqlite3PcacheRelease(pPgOld); } - sqlite3PcacheMakeDirty(pPg); + makeDirty(pPg); + pPager->dirtyCache = 1; pPager->dbModified = 1; if( needSyncPgno ){ /* If needSyncPgno is non-zero, then the journal file needs to be ** sync()ed before any data is written to database file page needSyncPgno. @@ -5076,23 +4154,25 @@ ** the journal file twice, but that is not a problem. ** ** The sqlite3PagerGet() call may cause the journal to sync. So make ** sure the Pager.needSync flag is set too. */ + int rc; PgHdr *pPgHdr; assert( pPager->needSync ); rc = sqlite3PagerGet(pPager, needSyncPgno, &pPgHdr); if( rc!=SQLITE_OK ){ - if( pPager->pInJournal && needSyncPgno<=pPager->dbOrigSize ){ + if( pPager->pInJournal && (int)needSyncPgno<=pPager->origDbSize ){ sqlite3BitvecClear(pPager->pInJournal, needSyncPgno); } return rc; } pPager->needSync = 1; assert( pPager->noSync==0 && !MEMDB ); pPgHdr->flags |= PGHDR_NEED_SYNC; - sqlite3PcacheMakeDirty(pPgHdr); + pPgHdr->flags |= PGHDR_IN_JOURNAL; + makeDirty(pPgHdr); sqlite3PagerUnref(pPgHdr); } return SQLITE_OK; } @@ -5130,11 +4210,11 @@ || eMode==PAGER_LOCKINGMODE_NORMAL || eMode==PAGER_LOCKINGMODE_EXCLUSIVE ); assert( PAGER_LOCKINGMODE_QUERY<0 ); assert( PAGER_LOCKINGMODE_NORMAL>=0 && PAGER_LOCKINGMODE_EXCLUSIVE>=0 ); if( eMode>=0 && !pPager->tempFile ){ - pPager->exclusiveMode = (u8)eMode; + pPager->exclusiveMode = eMode; } return (int)pPager->exclusiveMode; } /* @@ -5143,31 +4223,28 @@ ** PAGER_JOURNALMODE_QUERY ** PAGER_JOURNALMODE_DELETE ** PAGER_JOURNALMODE_TRUNCATE ** PAGER_JOURNALMODE_PERSIST ** PAGER_JOURNALMODE_OFF -** PAGER_JOURNALMODE_MEMORY ** ** If the parameter is not _QUERY, then the journal-mode is set to the ** value specified. ** -** The returned indicate the current (possibly updated) journal-mode. +** The returned indicate the current (possibly updated) +** journal-mode. */ int sqlite3PagerJournalMode(Pager *pPager, int eMode){ - if( !MEMDB ){ - assert( eMode==PAGER_JOURNALMODE_QUERY - || eMode==PAGER_JOURNALMODE_DELETE - || eMode==PAGER_JOURNALMODE_TRUNCATE - || eMode==PAGER_JOURNALMODE_PERSIST - || eMode==PAGER_JOURNALMODE_OFF - || eMode==PAGER_JOURNALMODE_MEMORY ); - assert( PAGER_JOURNALMODE_QUERY<0 ); - if( eMode>=0 ){ - pPager->journalMode = (u8)eMode; - }else{ - assert( eMode==PAGER_JOURNALMODE_QUERY ); - } + assert( eMode==PAGER_JOURNALMODE_QUERY + || eMode==PAGER_JOURNALMODE_DELETE + || eMode==PAGER_JOURNALMODE_TRUNCATE + || eMode==PAGER_JOURNALMODE_PERSIST + || eMode==PAGER_JOURNALMODE_OFF ); + assert( PAGER_JOURNALMODE_QUERY<0 ); + if( eMode>=0 ){ + pPager->journalMode = eMode; + }else{ + assert( eMode==PAGER_JOURNALMODE_QUERY ); } return (int)pPager->journalMode; } /* @@ -5178,16 +4255,6 @@ pPager->journalSizeLimit = iLimit; } return pPager->journalSizeLimit; } -/* -** Return a pointer to the pPager->pBackup variable. The backup module -** in backup.c maintains the content of this variable. This module -** uses it opaquely as an argument to sqlite3BackupRestart() and -** sqlite3BackupUpdate() only. -*/ -sqlite3_backup **sqlite3PagerBackupPtr(Pager *pPager){ - return &pPager->pBackup; -} - #endif /* SQLITE_OMIT_DISKIO */ Index: src/pager.h ================================================================== --- src/pager.h +++ src/pager.h @@ -11,20 +11,19 @@ ************************************************************************* ** This header file defines the interface that the sqlite page cache ** subsystem. The page cache subsystem reads and writes a file a page ** at a time and provides a journal for rollback. ** -** @(#) $Id: pager.h,v 1.100 2009/02/03 16:51:25 danielk1977 Exp $ +** @(#) $Id: pager.h,v 1.85 2008/09/29 11:49:48 danielk1977 Exp $ */ #ifndef _PAGER_H_ #define _PAGER_H_ /* -** Default maximum size for persistent journal files. A negative -** value means no limit. This value may be overridden using the -** sqlite3PagerJournalSizeLimit() API. See also "PRAGMA journal_size_limit". +** If defined as non-zero, auto-vacuum is enabled by default. Otherwise +** it must be turned on for each database using "PRAGMA auto_vacuum = 1". */ #ifndef SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT #define SQLITE_DEFAULT_JOURNAL_SIZE_LIMIT -1 #endif @@ -42,24 +41,14 @@ /* ** Handle type for pages. */ typedef struct PgHdr DbPage; -/* -** Page number PAGER_MJ_PGNO is never used in an SQLite database (it is -** reserved for working around a windows/posix incompatibility). It is -** used in the journal to signify that the remainder of the journal file -** is devoted to storing a master journal name - there are no more pages to -** roll back. See comments for function writeMasterJournal() in pager.c -** for details. -*/ -#define PAGER_MJ_PGNO(x) ((Pgno)((PENDING_BYTE/((x)->pageSize))+1)) - /* ** Allowed values for the flags parameter to sqlite3PagerOpen(). ** -** NOTE: These values must match the corresponding BTREE_ values in btree.h. +** NOTE: This values must match the corresponding BTREE_ values in btree.h. */ #define PAGER_OMIT_JOURNAL 0x0001 /* Do not use a rollback journal */ #define PAGER_NO_READLOCK 0x0002 /* Omit readlocks on readonly files */ /* @@ -75,90 +64,78 @@ #define PAGER_JOURNALMODE_QUERY -1 #define PAGER_JOURNALMODE_DELETE 0 /* Commit by deleting journal file */ #define PAGER_JOURNALMODE_PERSIST 1 /* Commit by zeroing journal header */ #define PAGER_JOURNALMODE_OFF 2 /* Journal omitted. */ #define PAGER_JOURNALMODE_TRUNCATE 3 /* Commit by truncating journal */ -#define PAGER_JOURNALMODE_MEMORY 4 /* In-memory journal file */ /* -** The remainder of this file contains the declarations of the functions -** that make up the Pager sub-system API. See source code comments for -** a detailed description of each routine. +** See source code comments for a detailed description of the following +** routines: */ - -/* Open and close a Pager connection. */ int sqlite3PagerOpen(sqlite3_vfs *, Pager **ppPager, const char*, int,int,int); -int sqlite3PagerClose(Pager *pPager); -int sqlite3PagerReadFileheader(Pager*, int, unsigned char*); - -/* Functions used to configure a Pager object. */ -void sqlite3PagerSetBusyhandler(Pager*, int(*)(void *), void *); +void sqlite3PagerSetBusyhandler(Pager*, BusyHandler *pBusyHandler); void sqlite3PagerSetReiniter(Pager*, void(*)(DbPage*)); int sqlite3PagerSetPagesize(Pager*, u16*); int sqlite3PagerMaxPageCount(Pager*, int); +int sqlite3PagerReadFileheader(Pager*, int, unsigned char*); void sqlite3PagerSetCachesize(Pager*, int); -void sqlite3PagerSetSafetyLevel(Pager*,int,int); -int sqlite3PagerLockingMode(Pager *, int); -int sqlite3PagerJournalMode(Pager *, int); -i64 sqlite3PagerJournalSizeLimit(Pager *, i64); -sqlite3_backup **sqlite3PagerBackupPtr(Pager*); - -/* Functions used to obtain and release page references. */ +int sqlite3PagerClose(Pager *pPager); int sqlite3PagerAcquire(Pager *pPager, Pgno pgno, DbPage **ppPage, int clrFlag); #define sqlite3PagerGet(A,B,C) sqlite3PagerAcquire(A,B,C,0) DbPage *sqlite3PagerLookup(Pager *pPager, Pgno pgno); -void sqlite3PagerRef(DbPage*); -void sqlite3PagerUnref(DbPage*); - -/* Operations on page references. */ +int sqlite3PagerPageRefcount(DbPage*); +int sqlite3PagerRef(DbPage*); +int sqlite3PagerUnref(DbPage*); int sqlite3PagerWrite(DbPage*); -void sqlite3PagerDontWrite(DbPage*); -int sqlite3PagerMovepage(Pager*,DbPage*,Pgno,int); -int sqlite3PagerPageRefcount(DbPage*); -void *sqlite3PagerGetData(DbPage *); -void *sqlite3PagerGetExtra(DbPage *); - -/* Functions used to manage pager transactions and savepoints. */ int sqlite3PagerPagecount(Pager*, int*); -int sqlite3PagerBegin(Pager*, int exFlag); -int sqlite3PagerCommitPhaseOne(Pager*,const char *zMaster, int); -int sqlite3PagerSync(Pager *pPager); +int sqlite3PagerTruncate(Pager*,Pgno); +int sqlite3PagerBegin(DbPage*, int exFlag); +int sqlite3PagerCommitPhaseOne(Pager*,const char *zMaster, Pgno, int); int sqlite3PagerCommitPhaseTwo(Pager*); int sqlite3PagerRollback(Pager*); -int sqlite3PagerOpenSavepoint(Pager *pPager, int n); -int sqlite3PagerSavepoint(Pager *pPager, int op, int iSavepoint); - -/* Functions used to query pager state and configuration. */ -u8 sqlite3PagerIsreadonly(Pager*); +int sqlite3PagerIsreadonly(Pager*); +int sqlite3PagerStmtBegin(Pager*); +int sqlite3PagerStmtCommit(Pager*); +int sqlite3PagerStmtRollback(Pager*); +void sqlite3PagerDontRollback(DbPage*); +int sqlite3PagerDontWrite(DbPage*); int sqlite3PagerRefcount(Pager*); +void sqlite3PagerSetSafetyLevel(Pager*,int,int); const char *sqlite3PagerFilename(Pager*); const sqlite3_vfs *sqlite3PagerVfs(Pager*); sqlite3_file *sqlite3PagerFile(Pager*); +const char *sqlite3PagerDirname(Pager*); const char *sqlite3PagerJournalname(Pager*); int sqlite3PagerNosync(Pager*); +int sqlite3PagerMovepage(Pager*,DbPage*,Pgno,int); +void *sqlite3PagerGetData(DbPage *); +void *sqlite3PagerGetExtra(DbPage *); +int sqlite3PagerLockingMode(Pager *, int); +int sqlite3PagerJournalMode(Pager *, int); +i64 sqlite3PagerJournalSizeLimit(Pager *, i64); void *sqlite3PagerTempSpace(Pager*); -int sqlite3PagerIsMemdb(Pager*); +int sqlite3PagerSync(Pager *pPager); -/* Functions used to truncate the database file. */ -void sqlite3PagerTruncateImage(Pager*,Pgno); - -/* Used by encryption extensions. */ #ifdef SQLITE_HAS_CODEC void sqlite3PagerSetCodec(Pager*,void*(*)(void*,void*,Pgno,int),void*); #endif -/* Functions to support testing and debugging. */ #if !defined(NDEBUG) || defined(SQLITE_TEST) Pgno sqlite3PagerPagenumber(DbPage*); int sqlite3PagerIswriteable(DbPage*); #endif + #ifdef SQLITE_TEST int *sqlite3PagerStats(Pager*); void sqlite3PagerRefdump(Pager*); - void disable_simulated_io_errors(void); - void enable_simulated_io_errors(void); + int sqlite3PagerIsMemdb(Pager*); +#endif + +#ifdef SQLITE_TEST +void disable_simulated_io_errors(void); +void enable_simulated_io_errors(void); #else # define disable_simulated_io_errors() # define enable_simulated_io_errors() #endif #endif /* _PAGER_H_ */ Index: src/parse.y ================================================================== --- src/parse.y +++ src/parse.y @@ -12,11 +12,11 @@ ** This file contains SQLite's grammar for SQL. Process this file ** using the lemon parser generator to generate C code that runs ** the parser. Lemon will also generate a header file containing ** numeric codes for all of the tokens. ** -** @(#) $Id: parse.y,v 1.268 2009/01/29 19:27:47 drh Exp $ +** @(#) $Id: parse.y,v 1.261 2008/10/11 17:35:16 drh Exp $ */ // All token codes are small integers with #defines that begin with "TK_" %token_prefix TK_ @@ -30,17 +30,15 @@ %extra_argument {Parse *pParse} // This code runs whenever there is a syntax error // %syntax_error { - UNUSED_PARAMETER(yymajor); /* Silence some compiler warnings */ assert( TOKEN.z[0] ); /* The tokenizer always gives us a token */ sqlite3ErrorMsg(pParse, "near \"%T\": syntax error", &TOKEN); pParse->parseError = 1; } %stack_overflow { - UNUSED_PARAMETER(yypMinor); /* Silence some compiler warnings */ sqlite3ErrorMsg(pParse, "parser stack overflow"); pParse->parseError = 1; } // The name of the generated procedure that implements the parser @@ -116,22 +114,10 @@ transtype(A) ::= EXCLUSIVE(X). {A = @X;} cmd ::= COMMIT trans_opt. {sqlite3CommitTransaction(pParse);} cmd ::= END trans_opt. {sqlite3CommitTransaction(pParse);} cmd ::= ROLLBACK trans_opt. {sqlite3RollbackTransaction(pParse);} -savepoint_opt ::= SAVEPOINT. -savepoint_opt ::= . -cmd ::= SAVEPOINT nm(X). { - sqlite3Savepoint(pParse, SAVEPOINT_BEGIN, &X); -} -cmd ::= RELEASE savepoint_opt nm(X). { - sqlite3Savepoint(pParse, SAVEPOINT_RELEASE, &X); -} -cmd ::= ROLLBACK trans_opt TO savepoint_opt nm(X). { - sqlite3Savepoint(pParse, SAVEPOINT_ROLLBACK, &X); -} - ///////////////////// The CREATE TABLE statement //////////////////////////// // cmd ::= create_table create_table_args. create_table ::= CREATE temp(T) TABLE ifnotexists(E) nm(Y) dbnm(Z). { sqlite3StartTable(pParse,&Y,&Z,T,0,0,E); @@ -159,11 +145,11 @@ // datatype, and other keywords such as PRIMARY KEY, UNIQUE, REFERENCES, // NOT NULL and so forth. // column(A) ::= columnid(X) type carglist. { A.z = X.z; - A.n = (int)(pParse->sLastToken.z-X.z) + pParse->sLastToken.n; + A.n = (pParse->sLastToken.z-X.z) + pParse->sLastToken.n; } columnid(A) ::= nm(X). { sqlite3AddColumn(pParse,&X); A = X; } @@ -178,15 +164,15 @@ // The following directive causes tokens ABORT, AFTER, ASC, etc. to // fallback to ID if they will not parse as their original value. // This obviates the need for the "id" nonterminal. // %fallback ID - ABORT AFTER ANALYZE ASC ATTACH BEFORE BEGIN BY CASCADE CAST COLUMNKW CONFLICT + ABORT AFTER ANALYZE ASC ATTACH BEFORE BEGIN CASCADE CAST CONFLICT DATABASE DEFERRED DESC DETACH EACH END EXCLUSIVE EXPLAIN FAIL FOR IGNORE IMMEDIATE INITIALLY INSTEAD LIKE_KW MATCH PLAN - QUERY KEY OF OFFSET PRAGMA RAISE RELEASE REPLACE RESTRICT ROW ROLLBACK - SAVEPOINT TEMP TRIGGER VACUUM VIEW VIRTUAL + QUERY KEY OF OFFSET PRAGMA RAISE REPLACE RESTRICT ROW + TEMP TRIGGER VACUUM VIEW VIRTUAL %ifdef SQLITE_OMIT_COMPOUND_SELECT EXCEPT INTERSECT UNION %endif SQLITE_OMIT_COMPOUND_SELECT REINDEX RENAME CTIME_KW IF . @@ -236,19 +222,19 @@ type ::= . type ::= typetoken(X). {sqlite3AddColumnType(pParse,&X);} typetoken(A) ::= typename(X). {A = X;} typetoken(A) ::= typename(X) LP signed RP(Y). { A.z = X.z; - A.n = (int)(&Y.z[Y.n] - X.z); + A.n = &Y.z[Y.n] - X.z; } typetoken(A) ::= typename(X) LP signed COMMA signed RP(Y). { A.z = X.z; - A.n = (int)(&Y.z[Y.n] - X.z); + A.n = &Y.z[Y.n] - X.z; } %type typename {Token} typename(A) ::= ids(X). {A = X;} -typename(A) ::= typename(X) ids(Y). {A.z=X.z; A.n=Y.n+(int)(Y.z-X.z);} +typename(A) ::= typename(X) ids(Y). {A.z=X.z; A.n=Y.n+(Y.z-X.z);} signed ::= plus_num. signed ::= minus_num. // "carglist" is a list of additional constraints that come after the // column name and column type in a CREATE TABLE statement. @@ -258,13 +244,12 @@ carg ::= CONSTRAINT nm ccons. carg ::= ccons. ccons ::= DEFAULT term(X). {sqlite3AddDefaultValue(pParse,X);} ccons ::= DEFAULT LP expr(X) RP. {sqlite3AddDefaultValue(pParse,X);} ccons ::= DEFAULT PLUS term(X). {sqlite3AddDefaultValue(pParse,X);} -ccons ::= DEFAULT MINUS(A) term(X). { +ccons ::= DEFAULT MINUS term(X). { Expr *p = sqlite3PExpr(pParse, TK_UMINUS, X, 0, 0); - sqlite3ExprSpan(p,&A,&X->span); sqlite3AddDefaultValue(pParse,p); } ccons ::= DEFAULT id(X). { Expr *p = sqlite3PExpr(pParse, TK_STRING, 0, 0, &X); sqlite3AddDefaultValue(pParse,p); @@ -387,11 +372,11 @@ select(A) ::= oneselect(X). {A = X;} %ifndef SQLITE_OMIT_COMPOUND_SELECT select(A) ::= select(X) multiselect_op(Y) oneselect(Z). { if( Z ){ - Z->op = (u8)Y; + Z->op = Y; Z->pPrior = X; }else{ sqlite3SelectDelete(pParse->db, X); } A = Z; @@ -456,55 +441,44 @@ %destructor from {sqlite3SrcListDelete(pParse->db, $$);} // A complete FROM clause. // from(A) ::= . {A = sqlite3DbMallocZero(pParse->db, sizeof(*A));} -from(A) ::= FROM seltablist(X). { +from(A) ::= FROM seltablist(X). { A = X; sqlite3SrcListShiftJoinType(A); } // "seltablist" is a "Select Table List" - the content of the FROM clause // in a SELECT statement. "stl_prefix" is a prefix of this list. // stl_prefix(A) ::= seltablist(X) joinop(Y). { A = X; - if( A && A->nSrc>0 ) A->a[A->nSrc-1].jointype = (u8)Y; + if( A && A->nSrc>0 ) A->a[A->nSrc-1].jointype = Y; } stl_prefix(A) ::= . {A = 0;} seltablist(A) ::= stl_prefix(X) nm(Y) dbnm(D) as(Z) indexed_opt(I) on_opt(N) using_opt(U). { A = sqlite3SrcListAppendFromTerm(pParse,X,&Y,&D,&Z,0,N,U); sqlite3SrcListIndexedBy(pParse, A, &I); } %ifndef SQLITE_OMIT_SUBQUERY - seltablist(A) ::= stl_prefix(X) LP select(S) RP + seltablist(A) ::= stl_prefix(X) LP seltablist_paren(S) RP as(Z) on_opt(N) using_opt(U). { A = sqlite3SrcListAppendFromTerm(pParse,X,0,0,&Z,S,N,U); } - seltablist(A) ::= stl_prefix(X) LP seltablist(F) RP - as(Z) on_opt(N) using_opt(U). { - if( X==0 && Z.n==0 && N==0 && U==0 ){ - A = F; - }else{ - Select *pSubquery; - sqlite3SrcListShiftJoinType(F); - pSubquery = sqlite3SelectNew(pParse,0,F,0,0,0,0,0,0,0); - A = sqlite3SrcListAppendFromTerm(pParse,X,0,0,&Z,pSubquery,N,U); - } - } // A seltablist_paren nonterminal represents anything in a FROM that // is contained inside parentheses. This can be either a subquery or // a grouping of table and subqueries. // -// %type seltablist_paren {Select*} -// %destructor seltablist_paren {sqlite3SelectDelete(pParse->db, $$);} -// seltablist_paren(A) ::= select(S). {A = S;} -// seltablist_paren(A) ::= seltablist(F). { -// sqlite3SrcListShiftJoinType(F); -// A = sqlite3SelectNew(pParse,0,F,0,0,0,0,0,0,0); -// } + %type seltablist_paren {Select*} + %destructor seltablist_paren {sqlite3SelectDelete(pParse->db, $$);} + seltablist_paren(A) ::= select(S). {A = S;} + seltablist_paren(A) ::= seltablist(F). { + sqlite3SrcListShiftJoinType(F); + A = sqlite3SelectNew(pParse,0,F,0,0,0,0,0,0,0); + } %endif SQLITE_OMIT_SUBQUERY %type dbnm {Token} dbnm(A) ::= . {A.z=0; A.n=0;} dbnm(A) ::= DOT nm(X). {A = X;} @@ -556,15 +530,15 @@ orderby_opt(A) ::= . {A = 0;} orderby_opt(A) ::= ORDER BY sortlist(X). {A = X;} sortlist(A) ::= sortlist(X) COMMA sortitem(Y) sortorder(Z). { A = sqlite3ExprListAppend(pParse,X,Y,0); - if( A ) A->a[A->nExpr-1].sortOrder = (u8)Z; + if( A ) A->a[A->nExpr-1].sortOrder = Z; } sortlist(A) ::= sortitem(Y) sortorder(Z). { A = sqlite3ExprListAppend(pParse,0,Y,0); - if( A && A->a ) A->a[0].sortOrder = (u8)Z; + if( A && A->a ) A->a[0].sortOrder = Z; } sortitem(A) ::= expr(X). {A = X;} %type sortorder {int} @@ -960,21 +934,21 @@ p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0); sqlite3ExprSetColl(pParse, p, &C); } A = sqlite3ExprListAppend(pParse,X, p, &Y); sqlite3ExprListCheckLength(pParse, A, "index"); - if( A ) A->a[A->nExpr-1].sortOrder = (u8)Z; + if( A ) A->a[A->nExpr-1].sortOrder = Z; } idxlist(A) ::= nm(Y) collate(C) sortorder(Z). { Expr *p = 0; if( C.n>0 ){ p = sqlite3PExpr(pParse, TK_COLUMN, 0, 0, 0); sqlite3ExprSetColl(pParse, p, &C); } A = sqlite3ExprListAppend(pParse,0, p, &Y); sqlite3ExprListCheckLength(pParse, A, "index"); - if( A ) A->a[A->nExpr-1].sortOrder = (u8)Z; + if( A ) A->a[A->nExpr-1].sortOrder = Z; } %type collate {Token} collate(C) ::= . {C.z = 0; C.n = 0;} collate(C) ::= COLLATE ids(X). {C = X;} @@ -1020,11 +994,11 @@ %ifndef SQLITE_OMIT_TRIGGER cmd ::= CREATE trigger_decl(A) BEGIN trigger_cmd_list(S) END(Z). { Token all; all.z = A.z; - all.n = (int)(Z.z - A.z) + Z.n; + all.n = (Z.z - A.z) + Z.n; sqlite3FinishTrigger(pParse, S, &all); } trigger_decl(A) ::= temp(T) TRIGGER ifnotexists(NOERR) nm(B) dbnm(Z) trigger_time(C) trigger_event(D) Index: src/pcache.c ================================================================== --- src/pcache.c +++ src/pcache.c @@ -9,31 +9,108 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file implements that page cache. ** -** @(#) $Id: pcache.c,v 1.43 2009/01/23 16:45:01 danielk1977 Exp $ +** @(#) $Id: pcache.c,v 1.33 2008/09/29 11:49:48 danielk1977 Exp $ */ #include "sqliteInt.h" /* ** A complete page cache is an instance of this structure. +** +** A cache may only be deleted by its owner and while holding the +** SQLITE_MUTEX_STATUS_LRU mutex. */ struct PCache { + /********************************************************************* + ** The first group of elements may be read or written at any time by + ** the cache owner without holding the mutex. No thread other than the + ** cache owner is permitted to access these elements at any time. + */ PgHdr *pDirty, *pDirtyTail; /* List of dirty pages in LRU order */ PgHdr *pSynced; /* Last synced page in dirty page list */ - int nRef; /* Number of referenced pages */ + int nRef; /* Number of pinned pages */ + int nPinned; /* Number of pinned and/or dirty pages */ int nMax; /* Configured cache size */ + int nMin; /* Configured minimum cache size */ + /********************************************************************** + ** The next group of elements are fixed when the cache is created and + ** may not be changed afterwards. These elements can read at any time by + ** the cache owner or by any thread holding the the mutex. Non-owner + ** threads must hold the mutex when reading these elements to prevent + ** the entire PCache object from being deleted during the read. + */ int szPage; /* Size of every page in this cache */ int szExtra; /* Size of extra space for each page */ int bPurgeable; /* True if pages are on backing store */ int (*xStress)(void*,PgHdr*); /* Call to try make a page clean */ void *pStress; /* Argument to xStress */ - sqlite3_pcache *pCache; /* Pluggable cache module */ - PgHdr *pPage1; /* Reference to page 1 */ + /********************************************************************** + ** The final group of elements can only be accessed while holding the + ** mutex. Both the cache owner and any other thread must hold the mutex + ** to read or write any of these elements. + */ + int nPage; /* Total number of pages in apHash */ + int nHash; /* Number of slots in apHash[] */ + PgHdr **apHash; /* Hash table for fast lookup by pgno */ + PgHdr *pClean; /* List of clean pages in use */ +}; + +/* +** Free slots in the page block allocator +*/ +typedef struct PgFreeslot PgFreeslot; +struct PgFreeslot { + PgFreeslot *pNext; /* Next free slot */ }; +/* +** Global data for the page cache. +*/ +static SQLITE_WSD struct PCacheGlobal { + int isInit; /* True when initialized */ + sqlite3_mutex *mutex; /* static mutex MUTEX_STATIC_LRU */ + + int nMaxPage; /* Sum of nMaxPage for purgeable caches */ + int nMinPage; /* Sum of nMinPage for purgeable caches */ + int nCurrentPage; /* Number of purgeable pages allocated */ + PgHdr *pLruHead, *pLruTail; /* LRU list of unused clean pgs */ + + /* Variables related to SQLITE_CONFIG_PAGECACHE settings. */ + int szSlot; /* Size of each free slot */ + void *pStart, *pEnd; /* Bounds of pagecache malloc range */ + PgFreeslot *pFree; /* Free page blocks */ +} pcache = {0}; + +/* +** All code in this file should access the global pcache structure via the +** alias "pcache_g". This ensures that the WSD emulation is used when +** compiling for systems that do not support real WSD. +*/ +#define pcache_g (GLOBAL(struct PCacheGlobal, pcache)) + +/* +** All global variables used by this module (all of which are grouped +** together in global structure "pcache" above) are protected by the static +** SQLITE_MUTEX_STATIC_LRU mutex. A pointer to this mutex is stored in +** variable "pcache.mutex". +** +** Some elements of the PCache and PgHdr structures are protected by the +** SQLITE_MUTEX_STATUS_LRU mutex and other are not. The protected +** elements are grouped at the end of the structures and are clearly +** marked. +** +** Use the following macros must surround all access (read or write) +** of protected elements. The mutex is not recursive and may not be +** entered more than once. The pcacheMutexHeld() macro should only be +** used within an assert() to verify that the mutex is being held. +*/ +#define pcacheEnterMutex() sqlite3_mutex_enter(pcache_g.mutex) +#define pcacheExitMutex() sqlite3_mutex_leave(pcache_g.mutex) +#define pcacheMutexHeld() sqlite3_mutex_held(pcache_g.mutex) + /* ** Some of the assert() macros in this code are too expensive to run ** even during normal debugging. Use them only rarely on long-running ** tests. Enable the expensive asserts using the ** -DSQLITE_ENABLE_EXPENSIVE_ASSERT=1 compile-time option. @@ -43,10 +120,52 @@ #else # define expensive_assert(X) #endif /********************************** Linked List Management ********************/ + +#if !defined(NDEBUG) && defined(SQLITE_ENABLE_EXPENSIVE_ASSERT) +/* +** This routine verifies that the number of entries in the hash table +** is pCache->nPage. This routine is used within assert() statements +** only and is therefore disabled during production builds. +*/ +static int pcacheCheckHashCount(PCache *pCache){ + int i; + int nPage = 0; + for(i=0; inHash; i++){ + PgHdr *p; + for(p=pCache->apHash[i]; p; p=p->pNextHash){ + nPage++; + } + } + assert( nPage==pCache->nPage ); + return 1; +} +#endif /* !NDEBUG && SQLITE_ENABLE_EXPENSIVE_ASSERT */ + + +#if !defined(NDEBUG) && defined(SQLITE_ENABLE_EXPENSIVE_ASSERT) +/* +** Based on the current value of PCache.nRef and the contents of the +** PCache.pDirty list, return the expected value of the PCache.nPinned +** counter. This is only used in debugging builds, as follows: +** +** expensive_assert( pCache->nPinned==pcachePinnedCount(pCache) ); +*/ +static int pcachePinnedCount(PCache *pCache){ + PgHdr *p; + int nPinned = pCache->nRef; + for(p=pCache->pDirty; p; p=p->pNext){ + if( p->nRef==0 ){ + nPinned++; + } + } + return nPinned; +} +#endif /* !NDEBUG && SQLITE_ENABLE_EXPENSIVE_ASSERT */ + #if !defined(NDEBUG) && defined(SQLITE_ENABLE_EXPENSIVE_ASSERT) /* ** Check that the pCache->pSynced variable is set correctly. If it ** is not, either fail an assert or return zero. Otherwise, return @@ -53,147 +172,507 @@ ** non-zero. This is only used in debugging builds, as follows: ** ** expensive_assert( pcacheCheckSynced(pCache) ); */ static int pcacheCheckSynced(PCache *pCache){ - PgHdr *p; - for(p=pCache->pDirtyTail; p!=pCache->pSynced; p=p->pDirtyPrev){ + PgHdr *p = pCache->pDirtyTail; + for(p=pCache->pDirtyTail; p!=pCache->pSynced; p=p->pPrev){ assert( p->nRef || (p->flags&PGHDR_NEED_SYNC) ); } return (p==0 || p->nRef || (p->flags&PGHDR_NEED_SYNC)==0); } #endif /* !NDEBUG && SQLITE_ENABLE_EXPENSIVE_ASSERT */ -/* -** Remove page pPage from the list of dirty pages. -*/ -static void pcacheRemoveFromDirtyList(PgHdr *pPage){ - PCache *p = pPage->pCache; - - assert( pPage->pDirtyNext || pPage==p->pDirtyTail ); - assert( pPage->pDirtyPrev || pPage==p->pDirty ); - - /* Update the PCache1.pSynced variable if necessary. */ - if( p->pSynced==pPage ){ - PgHdr *pSynced = pPage->pDirtyPrev; - while( pSynced && (pSynced->flags&PGHDR_NEED_SYNC) ){ - pSynced = pSynced->pDirtyPrev; - } - p->pSynced = pSynced; - } - - if( pPage->pDirtyNext ){ - pPage->pDirtyNext->pDirtyPrev = pPage->pDirtyPrev; - }else{ - assert( pPage==p->pDirtyTail ); - p->pDirtyTail = pPage->pDirtyPrev; - } - if( pPage->pDirtyPrev ){ - pPage->pDirtyPrev->pDirtyNext = pPage->pDirtyNext; - }else{ - assert( pPage==p->pDirty ); - p->pDirty = pPage->pDirtyNext; - } - pPage->pDirtyNext = 0; - pPage->pDirtyPrev = 0; - - expensive_assert( pcacheCheckSynced(p) ); -} - -/* -** Add page pPage to the head of the dirty list (PCache1.pDirty is set to -** pPage). -*/ -static void pcacheAddToDirtyList(PgHdr *pPage){ - PCache *p = pPage->pCache; - - assert( pPage->pDirtyNext==0 && pPage->pDirtyPrev==0 && p->pDirty!=pPage ); - - pPage->pDirtyNext = p->pDirty; - if( pPage->pDirtyNext ){ - assert( pPage->pDirtyNext->pDirtyPrev==0 ); - pPage->pDirtyNext->pDirtyPrev = pPage; - } - p->pDirty = pPage; - if( !p->pDirtyTail ){ - p->pDirtyTail = pPage; - } - if( !p->pSynced && 0==(pPage->flags&PGHDR_NEED_SYNC) ){ - p->pSynced = pPage; - } - expensive_assert( pcacheCheckSynced(p) ); -} - -/* -** Wrapper around the pluggable caches xUnpin method. If the cache is -** being used for an in-memory database, this function is a no-op. -*/ -static void pcacheUnpin(PgHdr *p){ - PCache *pCache = p->pCache; - if( pCache->bPurgeable ){ - if( p->pgno==1 ){ - pCache->pPage1 = 0; - } - sqlite3GlobalConfig.pcache.xUnpin(pCache->pCache, p, 0); - } + + +/* +** Remove a page from its hash table (PCache.apHash[]). +*/ +static void pcacheRemoveFromHash(PgHdr *pPage){ + assert( pcacheMutexHeld() ); + if( pPage->pPrevHash ){ + pPage->pPrevHash->pNextHash = pPage->pNextHash; + }else{ + PCache *pCache = pPage->pCache; + u32 h = pPage->pgno % pCache->nHash; + assert( pCache->apHash[h]==pPage ); + pCache->apHash[h] = pPage->pNextHash; + } + if( pPage->pNextHash ){ + pPage->pNextHash->pPrevHash = pPage->pPrevHash; + } + pPage->pCache->nPage--; + expensive_assert( pcacheCheckHashCount(pPage->pCache) ); +} + +/* +** Insert a page into the hash table +** +** The mutex must be held by the caller. +*/ +static void pcacheAddToHash(PgHdr *pPage){ + PCache *pCache = pPage->pCache; + u32 h = pPage->pgno % pCache->nHash; + assert( pcacheMutexHeld() ); + pPage->pNextHash = pCache->apHash[h]; + pPage->pPrevHash = 0; + if( pCache->apHash[h] ){ + pCache->apHash[h]->pPrevHash = pPage; + } + pCache->apHash[h] = pPage; + pCache->nPage++; + expensive_assert( pcacheCheckHashCount(pCache) ); +} + +/* +** Attempt to increase the size the hash table to contain +** at least nHash buckets. +*/ +static int pcacheResizeHash(PCache *pCache, int nHash){ + PgHdr *p; + PgHdr **pNew; + assert( pcacheMutexHeld() ); +#ifdef SQLITE_MALLOC_SOFT_LIMIT + if( nHash*sizeof(PgHdr*)>SQLITE_MALLOC_SOFT_LIMIT ){ + nHash = SQLITE_MALLOC_SOFT_LIMIT/sizeof(PgHdr *); + } +#endif + pcacheExitMutex(); + pNew = (PgHdr **)sqlite3Malloc(sizeof(PgHdr*)*nHash); + pcacheEnterMutex(); + if( !pNew ){ + return SQLITE_NOMEM; + } + memset(pNew, 0, sizeof(PgHdr *)*nHash); + sqlite3_free(pCache->apHash); + pCache->apHash = pNew; + pCache->nHash = nHash; + pCache->nPage = 0; + + for(p=pCache->pClean; p; p=p->pNext){ + pcacheAddToHash(p); + } + for(p=pCache->pDirty; p; p=p->pNext){ + pcacheAddToHash(p); + } + return SQLITE_OK; +} + +/* +** Remove a page from a linked list that is headed by *ppHead. +** *ppHead is either PCache.pClean or PCache.pDirty. +*/ +static void pcacheRemoveFromList(PgHdr **ppHead, PgHdr *pPage){ + int isDirtyList = (ppHead==&pPage->pCache->pDirty); + assert( ppHead==&pPage->pCache->pClean || ppHead==&pPage->pCache->pDirty ); + assert( pcacheMutexHeld() || ppHead!=&pPage->pCache->pClean ); + + if( pPage->pPrev ){ + pPage->pPrev->pNext = pPage->pNext; + }else{ + assert( *ppHead==pPage ); + *ppHead = pPage->pNext; + } + if( pPage->pNext ){ + pPage->pNext->pPrev = pPage->pPrev; + } + + if( isDirtyList ){ + PCache *pCache = pPage->pCache; + assert( pPage->pNext || pCache->pDirtyTail==pPage ); + if( !pPage->pNext ){ + pCache->pDirtyTail = pPage->pPrev; + } + if( pCache->pSynced==pPage ){ + PgHdr *pSynced = pPage->pPrev; + while( pSynced && (pSynced->flags&PGHDR_NEED_SYNC) ){ + pSynced = pSynced->pPrev; + } + pCache->pSynced = pSynced; + } + } +} + +/* +** Add a page from a linked list that is headed by *ppHead. +** *ppHead is either PCache.pClean or PCache.pDirty. +*/ +static void pcacheAddToList(PgHdr **ppHead, PgHdr *pPage){ + int isDirtyList = (ppHead==&pPage->pCache->pDirty); + assert( ppHead==&pPage->pCache->pClean || ppHead==&pPage->pCache->pDirty ); + + if( (*ppHead) ){ + (*ppHead)->pPrev = pPage; + } + pPage->pNext = *ppHead; + pPage->pPrev = 0; + *ppHead = pPage; + + if( isDirtyList ){ + PCache *pCache = pPage->pCache; + if( !pCache->pDirtyTail ){ + assert( pPage->pNext==0 ); + pCache->pDirtyTail = pPage; + } + if( !pCache->pSynced && 0==(pPage->flags&PGHDR_NEED_SYNC) ){ + pCache->pSynced = pPage; + } + } +} + +/* +** Remove a page from the global LRU list +*/ +static void pcacheRemoveFromLruList(PgHdr *pPage){ + assert( sqlite3_mutex_held(pcache_g.mutex) ); + assert( (pPage->flags&PGHDR_DIRTY)==0 ); + if( pPage->pCache->bPurgeable==0 ) return; + if( pPage->pNextLru ){ + assert( pcache_g.pLruTail!=pPage ); + pPage->pNextLru->pPrevLru = pPage->pPrevLru; + }else{ + assert( pcache_g.pLruTail==pPage ); + pcache_g.pLruTail = pPage->pPrevLru; + } + if( pPage->pPrevLru ){ + assert( pcache_g.pLruHead!=pPage ); + pPage->pPrevLru->pNextLru = pPage->pNextLru; + }else{ + assert( pcache_g.pLruHead==pPage ); + pcache_g.pLruHead = pPage->pNextLru; + } +} + +/* +** Add a page to the global LRU list. The page is normally added +** to the front of the list so that it will be the last page recycled. +** However, if the PGHDR_REUSE_UNLIKELY bit is set, the page is added +** to the end of the LRU list so that it will be the next to be recycled. +*/ +static void pcacheAddToLruList(PgHdr *pPage){ + assert( sqlite3_mutex_held(pcache_g.mutex) ); + assert( (pPage->flags&PGHDR_DIRTY)==0 ); + if( pPage->pCache->bPurgeable==0 ) return; + if( pcache_g.pLruTail && (pPage->flags & PGHDR_REUSE_UNLIKELY)!=0 ){ + /* If reuse is unlikely. Put the page at the end of the LRU list + ** where it will be recycled sooner rather than later. + */ + assert( pcache_g.pLruHead ); + pPage->pNextLru = 0; + pPage->pPrevLru = pcache_g.pLruTail; + pcache_g.pLruTail->pNextLru = pPage; + pcache_g.pLruTail = pPage; + pPage->flags &= ~PGHDR_REUSE_UNLIKELY; + }else{ + /* If reuse is possible. the page goes at the beginning of the LRU + ** list so that it will be the last to be recycled. + */ + if( pcache_g.pLruHead ){ + pcache_g.pLruHead->pPrevLru = pPage; + } + pPage->pNextLru = pcache_g.pLruHead; + pcache_g.pLruHead = pPage; + pPage->pPrevLru = 0; + if( pcache_g.pLruTail==0 ){ + pcache_g.pLruTail = pPage; + } + } +} + +/*********************************************** Memory Allocation *********** +** +** Initialize the page cache memory pool. +** +** This must be called at start-time when no page cache lines are +** checked out. This function is not threadsafe. +*/ +void sqlite3PCacheBufferSetup(void *pBuf, int sz, int n){ + PgFreeslot *p; + sz &= ~7; + pcache_g.szSlot = sz; + pcache_g.pStart = pBuf; + pcache_g.pFree = 0; + while( n-- ){ + p = (PgFreeslot*)pBuf; + p->pNext = pcache_g.pFree; + pcache_g.pFree = p; + pBuf = (void*)&((char*)pBuf)[sz]; + } + pcache_g.pEnd = pBuf; +} + +/* +** Allocate a page cache line. Look in the page cache memory pool first +** and use an element from it first if available. If nothing is available +** in the page cache memory pool, go to the general purpose memory allocator. +*/ +static void *pcacheMalloc(int sz, PCache *pCache){ + assert( sqlite3_mutex_held(pcache_g.mutex) ); + if( sz<=pcache_g.szSlot && pcache_g.pFree ){ + PgFreeslot *p = pcache_g.pFree; + pcache_g.pFree = p->pNext; + sqlite3StatusSet(SQLITE_STATUS_PAGECACHE_SIZE, sz); + sqlite3StatusAdd(SQLITE_STATUS_PAGECACHE_USED, 1); + return (void*)p; + }else{ + void *p; + + /* Allocate a new buffer using sqlite3Malloc. Before doing so, exit the + ** global pcache mutex and unlock the pager-cache object pCache. This is + ** so that if the attempt to allocate a new buffer causes the the + ** configured soft-heap-limit to be breached, it will be possible to + ** reclaim memory from this pager-cache. + */ + pcacheExitMutex(); + p = sqlite3Malloc(sz); + pcacheEnterMutex(); + + if( p ){ + sz = sqlite3MallocSize(p); + sqlite3StatusAdd(SQLITE_STATUS_PAGECACHE_OVERFLOW, sz); + } + return p; + } +} +void *sqlite3PageMalloc(int sz){ + void *p; + pcacheEnterMutex(); + p = pcacheMalloc(sz, 0); + pcacheExitMutex(); + return p; +} + +/* +** Release a pager memory allocation +*/ +static void pcacheFree(void *p){ + assert( sqlite3_mutex_held(pcache_g.mutex) ); + if( p==0 ) return; + if( p>=pcache_g.pStart && ppNext = pcache_g.pFree; + pcache_g.pFree = pSlot; + }else{ + int iSize = sqlite3MallocSize(p); + sqlite3StatusAdd(SQLITE_STATUS_PAGECACHE_OVERFLOW, -iSize); + sqlite3_free(p); + } +} +void sqlite3PageFree(void *p){ + pcacheEnterMutex(); + pcacheFree(p); + pcacheExitMutex(); +} + +/* +** Allocate a new page. +*/ +static PgHdr *pcachePageAlloc(PCache *pCache){ + PgHdr *p; + int sz = sizeof(*p) + pCache->szPage + pCache->szExtra; + assert( sqlite3_mutex_held(pcache_g.mutex) ); + p = pcacheMalloc(sz, pCache); + if( p==0 ) return 0; + memset(p, 0, sizeof(PgHdr)); + p->pData = (void*)&p[1]; + p->pExtra = (void*)&((char*)p->pData)[pCache->szPage]; + if( pCache->bPurgeable ){ + pcache_g.nCurrentPage++; + } + return p; +} + +/* +** Deallocate a page +*/ +static void pcachePageFree(PgHdr *p){ + assert( sqlite3_mutex_held(pcache_g.mutex) ); + if( p->pCache->bPurgeable ){ + pcache_g.nCurrentPage--; + } + pcacheFree(p->apSave[0]); + pcacheFree(p->apSave[1]); + pcacheFree(p); +} + +#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT +/* +** Return the number of bytes that will be returned to the heap when +** the argument is passed to pcachePageFree(). +*/ +static int pcachePageSize(PgHdr *p){ + assert( sqlite3_mutex_held(pcache_g.mutex) ); + assert( !pcache_g.pStart ); + assert( p->apSave[0]==0 ); + assert( p->apSave[1]==0 ); + assert( p && p->pCache ); + return sqlite3MallocSize(p); +} +#endif + +/* +** Attempt to 'recycle' a page from the global LRU list. Only clean, +** unreferenced pages from purgeable caches are eligible for recycling. +** +** This function removes page pcache.pLruTail from the global LRU list, +** and from the hash-table and PCache.pClean list of the owner pcache. +** There should be no other references to the page. +** +** A pointer to the recycled page is returned, or NULL if no page is +** eligible for recycling. +*/ +static PgHdr *pcacheRecyclePage(void){ + PgHdr *p = 0; + assert( sqlite3_mutex_held(pcache_g.mutex) ); + + if( (p=pcache_g.pLruTail) ){ + assert( (p->flags&PGHDR_DIRTY)==0 ); + pcacheRemoveFromLruList(p); + pcacheRemoveFromHash(p); + pcacheRemoveFromList(&p->pCache->pClean, p); + } + + return p; +} + +/* +** Obtain space for a page. Try to recycle an old page if the limit on the +** number of pages has been reached. If the limit has not been reached or +** there are no pages eligible for recycling, allocate a new page. +** +** Return a pointer to the new page, or NULL if an OOM condition occurs. +*/ +static int pcacheRecycleOrAlloc(PCache *pCache, PgHdr **ppPage){ + PgHdr *p = 0; + + int szPage = pCache->szPage; + int szExtra = pCache->szExtra; + + assert( pcache_g.isInit ); + assert( sqlite3_mutex_held(pcache_g.mutex) ); + + *ppPage = 0; + + /* If we have reached either the global or the local limit for + ** pinned+dirty pages, and there is at least one dirty page, + ** invoke the xStress callback to cause a page to become clean. + */ + expensive_assert( pCache->nPinned==pcachePinnedCount(pCache) ); + expensive_assert( pcacheCheckSynced(pCache) ); + if( pCache->xStress + && pCache->pDirty + && (pCache->nPinned>=(pcache_g.nMaxPage+pCache->nMin-pcache_g.nMinPage) + || pCache->nPinned>=pCache->nMax) + ){ + PgHdr *pPg; + assert(pCache->pDirtyTail); + + for(pPg=pCache->pSynced; + pPg && (pPg->nRef || (pPg->flags&PGHDR_NEED_SYNC)); + pPg=pPg->pPrev + ); + if( !pPg ){ + for(pPg=pCache->pDirtyTail; pPg && pPg->nRef; pPg=pPg->pPrev); + } + if( pPg ){ + int rc; + pcacheExitMutex(); + rc = pCache->xStress(pCache->pStress, pPg); + pcacheEnterMutex(); + if( rc!=SQLITE_OK && rc!=SQLITE_BUSY ){ + return rc; + } + } + } + + /* If either the local or the global page limit has been reached, + ** try to recycle a page. + */ + if( pCache->bPurgeable && (pCache->nPage>=pCache->nMax-1 || + pcache_g.nCurrentPage>=pcache_g.nMaxPage) ){ + p = pcacheRecyclePage(); + } + + /* If a page has been recycled but it is the wrong size, free it. */ + if( p && (p->pCache->szPage!=szPage || p->pCache->szPage!=szExtra) ){ + pcachePageFree(p); + p = 0; + } + + if( !p ){ + p = pcachePageAlloc(pCache); + } + + *ppPage = p; + return (p?SQLITE_OK:SQLITE_NOMEM); } /*************************************************** General Interfaces ****** ** ** Initialize and shutdown the page cache subsystem. Neither of these ** functions are threadsafe. */ int sqlite3PcacheInitialize(void){ - if( sqlite3GlobalConfig.pcache.xInit==0 ){ - sqlite3PCacheSetDefault(); + assert( pcache_g.isInit==0 ); + memset(&pcache_g, 0, sizeof(pcache)); + if( sqlite3GlobalConfig.bCoreMutex ){ + /* No need to check the return value of sqlite3_mutex_alloc(). + ** Allocating a static mutex cannot fail. + */ + pcache_g.mutex = sqlite3_mutex_alloc(SQLITE_MUTEX_STATIC_LRU); } - return sqlite3GlobalConfig.pcache.xInit(sqlite3GlobalConfig.pcache.pArg); + pcache_g.isInit = 1; + return SQLITE_OK; } void sqlite3PcacheShutdown(void){ - if( sqlite3GlobalConfig.pcache.xShutdown ){ - sqlite3GlobalConfig.pcache.xShutdown(sqlite3GlobalConfig.pcache.pArg); - } + memset(&pcache_g, 0, sizeof(pcache)); } /* ** Return the size in bytes of a PCache object. */ int sqlite3PcacheSize(void){ return sizeof(PCache); } /* -** Create a new PCache object. Storage space to hold the object -** has already been allocated and is passed in as the p pointer. -** The caller discovers how much space needs to be allocated by -** calling sqlite3PcacheSize(). +** Create a new PCache object. Storage space to hold the object +** has already been allocated and is passed in as the p pointer. */ void sqlite3PcacheOpen( int szPage, /* Size of every page */ int szExtra, /* Extra space associated with each page */ int bPurgeable, /* True if pages are on backing store */ int (*xStress)(void*,PgHdr*),/* Call to try to make pages clean */ void *pStress, /* Argument to xStress */ PCache *p /* Preallocated space for the PCache */ ){ + assert( pcache_g.isInit ); memset(p, 0, sizeof(PCache)); p->szPage = szPage; p->szExtra = szExtra; p->bPurgeable = bPurgeable; p->xStress = xStress; p->pStress = pStress; p->nMax = 100; + p->nMin = 10; + + pcacheEnterMutex(); + if( bPurgeable ){ + pcache_g.nMaxPage += p->nMax; + pcache_g.nMinPage += p->nMin; + } + + pcacheExitMutex(); } /* -** Change the page size for PCache object. The caller must ensure that there -** are no outstanding page references when this function is called. +** Change the page size for PCache object. This can only happen +** when the cache is empty. */ void sqlite3PcacheSetPageSize(PCache *pCache, int szPage){ - assert( pCache->nRef==0 && pCache->pDirty==0 ); - if( pCache->pCache ){ - sqlite3GlobalConfig.pcache.xDestroy(pCache->pCache); - pCache->pCache = 0; - } + assert(pCache->nPage==0); pCache->szPage = szPage; } /* ** Try to obtain a page from the cache. @@ -202,113 +681,96 @@ PCache *pCache, /* Obtain the page from this cache */ Pgno pgno, /* Page number to obtain */ int createFlag, /* If true, create page if it does not exist already */ PgHdr **ppPage /* Write the page here */ ){ - PgHdr *pPage = 0; - int eCreate; - - assert( pCache!=0 ); - assert( pgno>0 ); - - /* If the pluggable cache (sqlite3_pcache*) has not been allocated, - ** allocate it now. - */ - if( !pCache->pCache && createFlag ){ - sqlite3_pcache *p; - int nByte; - nByte = pCache->szPage + pCache->szExtra + sizeof(PgHdr); - p = sqlite3GlobalConfig.pcache.xCreate(nByte, pCache->bPurgeable); - if( !p ){ - return SQLITE_NOMEM; - } - sqlite3GlobalConfig.pcache.xCachesize(p, pCache->nMax); - pCache->pCache = p; - } - - eCreate = createFlag ? 1 : 0; - if( eCreate && (!pCache->bPurgeable || !pCache->pDirty) ){ - eCreate = 2; - } - if( pCache->pCache ){ - pPage = sqlite3GlobalConfig.pcache.xFetch(pCache->pCache, pgno, eCreate); - } - - if( !pPage && eCreate==1 ){ - PgHdr *pPg; - - /* Find a dirty page to write-out and recycle. First try to find a - ** page that does not require a journal-sync (one with PGHDR_NEED_SYNC - ** cleared), but if that is not possible settle for any other - ** unreferenced dirty page. - */ - expensive_assert( pcacheCheckSynced(pCache) ); - for(pPg=pCache->pSynced; - pPg && (pPg->nRef || (pPg->flags&PGHDR_NEED_SYNC)); - pPg=pPg->pDirtyPrev - ); - if( !pPg ){ - for(pPg=pCache->pDirtyTail; pPg && pPg->nRef; pPg=pPg->pDirtyPrev); - } - if( pPg ){ - int rc; - rc = pCache->xStress(pCache->pStress, pPg); - if( rc!=SQLITE_OK && rc!=SQLITE_BUSY ){ - return rc; - } - } - - pPage = sqlite3GlobalConfig.pcache.xFetch(pCache->pCache, pgno, 2); - } - - if( pPage ){ - if( !pPage->pData ){ - memset(pPage, 0, sizeof(PgHdr) + pCache->szExtra); - pPage->pExtra = (void*)&pPage[1]; - pPage->pData = (void *)&((char *)pPage)[sizeof(PgHdr) + pCache->szExtra]; - pPage->pCache = pCache; - pPage->pgno = pgno; - } - assert( pPage->pCache==pCache ); - assert( pPage->pgno==pgno ); - assert( pPage->pExtra==(void *)&pPage[1] ); - - if( 0==pPage->nRef ){ - pCache->nRef++; - } - pPage->nRef++; - if( pgno==1 ){ - pCache->pPage1 = pPage; - } - } - *ppPage = pPage; - return (pPage==0 && eCreate) ? SQLITE_NOMEM : SQLITE_OK; -} - -/* -** Decrement the reference count on a page. If the page is clean and the -** reference count drops to 0, then it is made elible for recycling. + int rc = SQLITE_OK; + PgHdr *pPage = 0; + + assert( pcache_g.isInit ); + assert( pCache!=0 ); + assert( pgno>0 ); + expensive_assert( pCache->nPinned==pcachePinnedCount(pCache) ); + + pcacheEnterMutex(); + + /* Search the hash table for the requested page. Exit early if it is found. */ + if( pCache->apHash ){ + u32 h = pgno % pCache->nHash; + for(pPage=pCache->apHash[h]; pPage; pPage=pPage->pNextHash){ + if( pPage->pgno==pgno ){ + if( pPage->nRef==0 ){ + if( 0==(pPage->flags&PGHDR_DIRTY) ){ + pcacheRemoveFromLruList(pPage); + pCache->nPinned++; + } + pCache->nRef++; + } + pPage->nRef++; + break; + } + } + } + + if( !pPage && createFlag ){ + if( pCache->nHash<=pCache->nPage ){ + rc = pcacheResizeHash(pCache, pCache->nHash<256 ? 256 : pCache->nHash*2); + } + if( rc==SQLITE_OK ){ + rc = pcacheRecycleOrAlloc(pCache, &pPage); + } + if( rc==SQLITE_OK ){ + pPage->pPager = 0; + pPage->flags = 0; + pPage->pDirty = 0; + pPage->pgno = pgno; + pPage->pCache = pCache; + pPage->nRef = 1; + pCache->nRef++; + pCache->nPinned++; + pcacheAddToList(&pCache->pClean, pPage); + pcacheAddToHash(pPage); + } + } + + pcacheExitMutex(); + + *ppPage = pPage; + expensive_assert( pCache->nPinned==pcachePinnedCount(pCache) ); + assert( pPage || !createFlag || rc!=SQLITE_OK ); + return rc; +} + +/* +** Dereference a page. When the reference count reaches zero, +** move the page to the LRU list if it is clean. */ void sqlite3PcacheRelease(PgHdr *p){ assert( p->nRef>0 ); p->nRef--; if( p->nRef==0 ){ PCache *pCache = p->pCache; pCache->nRef--; if( (p->flags&PGHDR_DIRTY)==0 ){ - pcacheUnpin(p); + pCache->nPinned--; + pcacheEnterMutex(); + if( pcache_g.nCurrentPage>pcache_g.nMaxPage ){ + pcacheRemoveFromList(&pCache->pClean, p); + pcacheRemoveFromHash(p); + pcachePageFree(p); + }else{ + pcacheAddToLruList(p); + } + pcacheExitMutex(); }else{ - /* Move the page to the head of the dirty list. */ - pcacheRemoveFromDirtyList(p); - pcacheAddToDirtyList(p); + /* Move the page to the head of the caches dirty list. */ + pcacheRemoveFromList(&pCache->pDirty, p); + pcacheAddToList(&pCache->pDirty, p); } } } -/* -** Increase the reference count of a supplied page by 1. -*/ void sqlite3PcacheRef(PgHdr *p){ assert(p->nRef>0); p->nRef++; } @@ -318,133 +780,296 @@ ** page pointed to by p is invalid. */ void sqlite3PcacheDrop(PgHdr *p){ PCache *pCache; assert( p->nRef==1 ); - if( p->flags&PGHDR_DIRTY ){ - pcacheRemoveFromDirtyList(p); - } + assert( 0==(p->flags&PGHDR_DIRTY) ); pCache = p->pCache; pCache->nRef--; - if( p->pgno==1 ){ - pCache->pPage1 = 0; - } - sqlite3GlobalConfig.pcache.xUnpin(pCache->pCache, p, 1); + pCache->nPinned--; + pcacheEnterMutex(); + pcacheRemoveFromList(&pCache->pClean, p); + pcacheRemoveFromHash(p); + pcachePageFree(p); + pcacheExitMutex(); } /* -** Make sure the page is marked as dirty. If it isn't dirty already, +** Make sure the page is marked as dirty. If it isn't dirty already, ** make it so. */ void sqlite3PcacheMakeDirty(PgHdr *p){ PCache *pCache; p->flags &= ~PGHDR_DONT_WRITE; + if( p->flags & PGHDR_DIRTY ) return; + assert( (p->flags & PGHDR_DIRTY)==0 ); assert( p->nRef>0 ); - if( 0==(p->flags & PGHDR_DIRTY) ){ - pCache = p->pCache; - p->flags |= PGHDR_DIRTY; - pcacheAddToDirtyList( p); + pCache = p->pCache; + pcacheEnterMutex(); + pcacheRemoveFromList(&pCache->pClean, p); + pcacheAddToList(&pCache->pDirty, p); + pcacheExitMutex(); + p->flags |= PGHDR_DIRTY; +} + +static void pcacheMakeClean(PgHdr *p){ + PCache *pCache = p->pCache; + assert( p->apSave[0]==0 && p->apSave[1]==0 ); + assert( p->flags & PGHDR_DIRTY ); + pcacheRemoveFromList(&pCache->pDirty, p); + pcacheAddToList(&pCache->pClean, p); + p->flags &= ~PGHDR_DIRTY; + if( p->nRef==0 ){ + pcacheAddToLruList(p); + pCache->nPinned--; } + expensive_assert( pCache->nPinned==pcachePinnedCount(pCache) ); } /* -** Make sure the page is marked as clean. If it isn't clean already, +** Make sure the page is marked as clean. If it isn't clean already, ** make it so. */ void sqlite3PcacheMakeClean(PgHdr *p){ if( (p->flags & PGHDR_DIRTY) ){ - pcacheRemoveFromDirtyList(p); - p->flags &= ~(PGHDR_DIRTY|PGHDR_NEED_SYNC); - if( p->nRef==0 ){ - pcacheUnpin(p); - } + pcacheEnterMutex(); + pcacheMakeClean(p); + pcacheExitMutex(); } } /* ** Make every page in the cache clean. */ void sqlite3PcacheCleanAll(PCache *pCache){ PgHdr *p; + pcacheEnterMutex(); while( (p = pCache->pDirty)!=0 ){ - sqlite3PcacheMakeClean(p); - } -} - -/* -** Clear the PGHDR_NEED_SYNC flag from all dirty pages. -*/ -void sqlite3PcacheClearSyncFlags(PCache *pCache){ - PgHdr *p; - for(p=pCache->pDirty; p; p=p->pDirtyNext){ - p->flags &= ~PGHDR_NEED_SYNC; - } - pCache->pSynced = pCache->pDirtyTail; + assert( p->apSave[0]==0 && p->apSave[1]==0 ); + pcacheRemoveFromList(&pCache->pDirty, p); + p->flags &= ~PGHDR_DIRTY; + pcacheAddToList(&pCache->pClean, p); + if( p->nRef==0 ){ + pcacheAddToLruList(p); + pCache->nPinned--; + } + } + sqlite3PcacheAssertFlags(pCache, 0, PGHDR_DIRTY); + expensive_assert( pCache->nPinned==pcachePinnedCount(pCache) ); + pcacheExitMutex(); } /* -** Change the page number of page p to newPgno. +** Change the page number of page p to newPgno. If newPgno is 0, then the +** page object is added to the clean-list and the PGHDR_REUSE_UNLIKELY +** flag set. */ void sqlite3PcacheMove(PgHdr *p, Pgno newPgno){ - PCache *pCache = p->pCache; assert( p->nRef>0 ); - assert( newPgno>0 ); - sqlite3GlobalConfig.pcache.xRekey(pCache->pCache, p, p->pgno, newPgno); + pcacheEnterMutex(); + pcacheRemoveFromHash(p); p->pgno = newPgno; - if( (p->flags&PGHDR_DIRTY) && (p->flags&PGHDR_NEED_SYNC) ){ - pcacheRemoveFromDirtyList(p); - pcacheAddToDirtyList(p); + if( newPgno==0 ){ + pcacheFree(p->apSave[0]); + pcacheFree(p->apSave[1]); + p->apSave[0] = 0; + p->apSave[1] = 0; + if( (p->flags & PGHDR_DIRTY) ){ + pcacheMakeClean(p); + } + p->flags = PGHDR_REUSE_UNLIKELY; + } + pcacheAddToHash(p); + pcacheExitMutex(); +} + +/* +** Remove all content from a page cache +*/ +static void pcacheClear(PCache *pCache){ + PgHdr *p, *pNext; + assert( sqlite3_mutex_held(pcache_g.mutex) ); + for(p=pCache->pClean; p; p=pNext){ + pNext = p->pNext; + pcacheRemoveFromLruList(p); + pcachePageFree(p); + } + for(p=pCache->pDirty; p; p=pNext){ + pNext = p->pNext; + pcachePageFree(p); } + pCache->pClean = 0; + pCache->pDirty = 0; + pCache->pDirtyTail = 0; + pCache->nPage = 0; + pCache->nPinned = 0; + memset(pCache->apHash, 0, pCache->nHash*sizeof(pCache->apHash[0])); } + /* -** Drop every cache entry whose page number is greater than "pgno". The -** caller must ensure that there are no outstanding references to any pages -** other than page 1 with a page number greater than pgno. -** -** If there is a reference to page 1 and the pgno parameter passed to this -** function is 0, then the data area associated with page 1 is zeroed, but -** the page object is not dropped. +** Drop every cache entry whose page number is greater than "pgno". */ void sqlite3PcacheTruncate(PCache *pCache, Pgno pgno){ - if( pCache->pCache ){ - PgHdr *p; - PgHdr *pNext; - for(p=pCache->pDirty; p; p=pNext){ - pNext = p->pDirtyNext; - if( p->pgno>pgno ){ - assert( p->flags&PGHDR_DIRTY ); - sqlite3PcacheMakeClean(p); - } - } - if( pgno==0 && pCache->pPage1 ){ - memset(pCache->pPage1->pData, 0, pCache->szPage); - pgno = 1; - } - sqlite3GlobalConfig.pcache.xTruncate(pCache->pCache, pgno+1); + PgHdr *p, *pNext; + PgHdr *pDirty = pCache->pDirty; + pcacheEnterMutex(); + for(p=pCache->pClean; p||pDirty; p=pNext){ + if( !p ){ + p = pDirty; + pDirty = 0; + } + pNext = p->pNext; + if( p->pgno>pgno ){ + if( p->nRef==0 ){ + pcacheRemoveFromHash(p); + if( p->flags&PGHDR_DIRTY ){ + pcacheRemoveFromList(&pCache->pDirty, p); + pCache->nPinned--; + }else{ + pcacheRemoveFromList(&pCache->pClean, p); + pcacheRemoveFromLruList(p); + } + pcachePageFree(p); + }else{ + /* If there are references to the page, it cannot be freed. In this + ** case, zero the page content instead. + */ + memset(p->pData, 0, pCache->szPage); + } + } + } + pcacheExitMutex(); +} + +/* +** If there are currently more than pcache.nMaxPage pages allocated, try +** to recycle pages to reduce the number allocated to pcache.nMaxPage. +*/ +static void pcacheEnforceMaxPage(void){ + PgHdr *p; + assert( sqlite3_mutex_held(pcache_g.mutex) ); + while( pcache_g.nCurrentPage>pcache_g.nMaxPage && (p = pcacheRecyclePage()) ){ + pcachePageFree(p); } } /* ** Close a cache. */ void sqlite3PcacheClose(PCache *pCache){ - if( pCache->pCache ){ - sqlite3GlobalConfig.pcache.xDestroy(pCache->pCache); + pcacheEnterMutex(); + + /* Free all the pages used by this pager and remove them from the LRU list. */ + pcacheClear(pCache); + if( pCache->bPurgeable ){ + pcache_g.nMaxPage -= pCache->nMax; + pcache_g.nMinPage -= pCache->nMin; + pcacheEnforceMaxPage(); + } + sqlite3_free(pCache->apHash); + pcacheExitMutex(); +} + +/* +** Preserve the content of the page. It is assumed that the content +** has not been preserved already. +** +** If idJournal==0 then this is for the overall transaction. +** If idJournal==1 then this is for the statement journal. +** +** This routine is used for in-memory databases only. +** +** Return SQLITE_OK or SQLITE_NOMEM if a memory allocation fails. +*/ +int sqlite3PcachePreserve(PgHdr *p, int idJournal){ + void *x; + int sz; + assert( p->pCache->bPurgeable==0 ); + assert( p->apSave[idJournal]==0 ); + sz = p->pCache->szPage; + p->apSave[idJournal] = x = sqlite3PageMalloc( sz ); + if( x==0 ) return SQLITE_NOMEM; + memcpy(x, p->pData, sz); + return SQLITE_OK; +} + +/* +** Commit a change previously preserved. +*/ +void sqlite3PcacheCommit(PCache *pCache, int idJournal){ + PgHdr *p; + int mask = idJournal==0 ? ~PGHDR_IN_JOURNAL : 0xffffff; + pcacheEnterMutex(); /* Mutex is required to call pcacheFree() */ + for(p=pCache->pDirty; p; p=p->pNext){ + if( p->apSave[idJournal] ){ + pcacheFree(p->apSave[idJournal]); + p->apSave[idJournal] = 0; + } + p->flags &= mask; + } + pcacheExitMutex(); +} + +/* +** Rollback a change previously preserved. +*/ +void sqlite3PcacheRollback( + PCache *pCache, /* Pager cache */ + int idJournal, /* Which copy to rollback to */ + void (*xReiniter)(PgHdr*) /* Called on each rolled back page */ +){ + PgHdr *p; + int sz; + int mask = idJournal==0 ? ~PGHDR_IN_JOURNAL : 0xffffff; + pcacheEnterMutex(); /* Mutex is required to call pcacheFree() */ + sz = pCache->szPage; + for(p=pCache->pDirty; p; p=p->pNext){ + if( p->apSave[idJournal] ){ + memcpy(p->pData, p->apSave[idJournal], sz); + pcacheFree(p->apSave[idJournal]); + p->apSave[idJournal] = 0; + if( xReiniter ){ + xReiniter(p); + } + } + p->flags &= mask; + } + pcacheExitMutex(); +} + +#ifndef NDEBUG +/* +** Assert flags settings on all pages. Debugging only. +*/ +void sqlite3PcacheAssertFlags(PCache *pCache, int trueMask, int falseMask){ + PgHdr *p; + for(p=pCache->pDirty; p; p=p->pNext){ + assert( (p->flags&trueMask)==trueMask ); + assert( (p->flags&falseMask)==0 ); + } + for(p=pCache->pClean; p; p=p->pNext){ + assert( (p->flags&trueMask)==trueMask ); + assert( (p->flags&falseMask)==0 ); } } +#endif /* ** Discard the contents of the cache. */ -void sqlite3PcacheClear(PCache *pCache){ - sqlite3PcacheTruncate(pCache, 0); +int sqlite3PcacheClear(PCache *pCache){ + assert(pCache->nRef==0); + pcacheEnterMutex(); + pcacheClear(pCache); + pcacheExitMutex(); + return SQLITE_OK; } /* ** Merge two lists of pages connected by pDirty and in pgno order. -** Do not both fixing the pDirtyPrev pointers. +** Do not both fixing the pPrevDirty pointers. */ static PgHdr *pcacheMergeDirtyList(PgHdr *pA, PgHdr *pB){ PgHdr result, *pTail; pTail = &result; while( pA && pB ){ @@ -468,11 +1093,11 @@ return result.pDirty; } /* ** Sort the list of pages in accending order by pgno. Pages are -** connected by pDirty pointers. The pDirtyPrev pointers are +** connected by pDirty pointers. The pPrevDirty pointers are ** corrupted by this sort. */ #define N_SORT_BUCKET_ALLOC 25 #define N_SORT_BUCKET 25 #ifdef SQLITE_TEST @@ -517,68 +1142,142 @@ /* ** Return a list of all dirty pages in the cache, sorted by page number. */ PgHdr *sqlite3PcacheDirtyList(PCache *pCache){ PgHdr *p; - for(p=pCache->pDirty; p; p=p->pDirtyNext){ - p->pDirty = p->pDirtyNext; + for(p=pCache->pDirty; p; p=p->pNext){ + p->pDirty = p->pNext; } return pcacheSortDirtyList(pCache->pDirty); } /* -** Return the total number of referenced pages held by the cache. +** Return the total number of outstanding page references. */ int sqlite3PcacheRefCount(PCache *pCache){ return pCache->nRef; } -/* -** Return the number of references to the page supplied as an argument. -*/ int sqlite3PcachePageRefcount(PgHdr *p){ return p->nRef; } /* ** Return the total number of pages in the cache. */ int sqlite3PcachePagecount(PCache *pCache){ - int nPage = 0; - if( pCache->pCache ){ - nPage = sqlite3GlobalConfig.pcache.xPagecount(pCache->pCache); + assert( pCache->nPage>=0 ); + return pCache->nPage; +} + +#ifdef SQLITE_CHECK_PAGES +/* +** This function is used by the pager.c module to iterate through all +** pages in the cache. At present, this is only required if the +** SQLITE_CHECK_PAGES macro (used for debugging) is specified. +*/ +void sqlite3PcacheIterate(PCache *pCache, void (*xIter)(PgHdr *)){ + PgHdr *p; + for(p=pCache->pClean; p; p=p->pNext){ + xIter(p); + } + for(p=pCache->pDirty; p; p=p->pNext){ + xIter(p); + } +} +#endif + +/* +** Set flags on all pages in the page cache +*/ +void sqlite3PcacheClearFlags(PCache *pCache, int mask){ + PgHdr *p; + + /* Obtain the global mutex before modifying any PgHdr.flags variables + ** or traversing the LRU list. + */ + pcacheEnterMutex(); + + mask = ~mask; + for(p=pCache->pDirty; p; p=p->pNext){ + p->flags &= mask; + } + for(p=pCache->pClean; p; p=p->pNext){ + p->flags &= mask; + } + + if( 0==(mask&PGHDR_NEED_SYNC) ){ + pCache->pSynced = pCache->pDirtyTail; + assert( !pCache->pSynced || (pCache->pSynced->flags&PGHDR_NEED_SYNC)==0 ); } - return nPage; + + pcacheExitMutex(); } -#ifdef SQLITE_TEST /* -** Get the suggested cache-size value. +** Set the suggested cache-size value. */ int sqlite3PcacheGetCachesize(PCache *pCache){ return pCache->nMax; } -#endif /* ** Set the suggested cache-size value. */ void sqlite3PcacheSetCachesize(PCache *pCache, int mxPage){ - pCache->nMax = mxPage; - if( pCache->pCache ){ - sqlite3GlobalConfig.pcache.xCachesize(pCache->pCache, mxPage); + if( mxPage<10 ){ + mxPage = 10; + } + if( pCache->bPurgeable ){ + pcacheEnterMutex(); + pcache_g.nMaxPage -= pCache->nMax; + pcache_g.nMaxPage += mxPage; + pcacheEnforceMaxPage(); + pcacheExitMutex(); } + pCache->nMax = mxPage; } -#ifdef SQLITE_CHECK_PAGES +#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT /* -** For all dirty pages currently in the cache, invoke the specified -** callback. This is only used if the SQLITE_CHECK_PAGES macro is -** defined. +** This function is called to free superfluous dynamically allocated memory +** held by the pager system. Memory in use by any SQLite pager allocated +** by the current thread may be sqlite3_free()ed. +** +** nReq is the number of bytes of memory required. Once this much has +** been released, the function returns. The return value is the total number +** of bytes of memory released. */ -void sqlite3PcacheIterateDirty(PCache *pCache, void (*xIter)(PgHdr *)){ - PgHdr *pDirty; - for(pDirty=pCache->pDirty; pDirty; pDirty=pDirty->pDirtyNext){ - xIter(pDirty); +int sqlite3PcacheReleaseMemory(int nReq){ + int nFree = 0; + if( pcache_g.pStart==0 ){ + PgHdr *p; + pcacheEnterMutex(); + while( (nReq<0 || nFreepNextLru){ + nRecyclable++; } + + *pnCurrent = pcache_g.nCurrentPage; + *pnMax = pcache_g.nMaxPage; + *pnMin = pcache_g.nMinPage; + *pnRecyclable = nRecyclable; } #endif Index: src/pcache.h ================================================================== --- src/pcache.h +++ src/pcache.h @@ -10,11 +10,11 @@ ** ************************************************************************* ** This header file defines the interface that the sqlite page cache ** subsystem. ** -** @(#) $Id: pcache.h,v 1.19 2009/01/20 17:06:27 danielk1977 Exp $ +** @(#) $Id: pcache.h,v 1.13 2008/10/11 17:42:29 drh Exp $ */ #ifndef _PCACHE_H_ typedef struct PgHdr PgHdr; @@ -32,23 +32,29 @@ Pager *pPager; /* The pager this page is part of */ #ifdef SQLITE_CHECK_PAGES u32 pageHash; /* Hash of page content */ #endif u16 flags; /* PGHDR flags defined below */ - /********************************************************************** ** Elements above are public. All that follows is private to pcache.c ** and should not be accessed by other modules. */ i16 nRef; /* Number of users of this page */ PCache *pCache; /* Cache that owns this page */ - - PgHdr *pDirtyNext; /* Next element in list of dirty pages */ - PgHdr *pDirtyPrev; /* Previous element in list of dirty pages */ + void *apSave[2]; /* Journal entries for in-memory databases */ + /********************************************************************** + ** Elements above are accessible at any time by the owner of the cache + ** without the need for a mutex. The elements that follow can only be + ** accessed while holding the SQLITE_MUTEX_STATIC_LRU mutex. + */ + PgHdr *pNextHash, *pPrevHash; /* Hash collision chain for PgHdr.pgno */ + PgHdr *pNext, *pPrev; /* List of clean or dirty pages */ + PgHdr *pNextLru, *pPrevLru; /* Part of global LRU list */ }; /* Bit values for PgHdr.flags */ +#define PGHDR_IN_JOURNAL 0x001 /* Page is in rollback journal */ #define PGHDR_DIRTY 0x002 /* Page has changed */ #define PGHDR_NEED_SYNC 0x004 /* Fsync the rollback journal before ** writing this page to the database */ #define PGHDR_NEED_READ 0x008 /* Content is unread */ #define PGHDR_REUSE_UNLIKELY 0x010 /* A hint that reuse is unlikely */ @@ -60,10 +66,12 @@ /* Page cache buffer management: ** These routines implement SQLITE_CONFIG_PAGECACHE. */ void sqlite3PCacheBufferSetup(void *, int sz, int n); +void *sqlite3PCacheMalloc(int sz); +void sqlite3PCacheFree(void*); /* Create a new pager cache. ** Under memory stress, invoke xStress to try to make pages clean. ** Only clean and unpinned pages can be reclaimed. */ @@ -98,22 +106,37 @@ /* Change a page number. Used by incr-vacuum. */ void sqlite3PcacheMove(PgHdr*, Pgno); /* Remove all pages with pgno>x. Reset the cache if x==0 */ void sqlite3PcacheTruncate(PCache*, Pgno x); + +/* Routines used to implement transactions on memory-only databases. */ +int sqlite3PcachePreserve(PgHdr*, int); /* Preserve current page content */ +void sqlite3PcacheCommit(PCache*, int); /* Drop preserved copy */ +void sqlite3PcacheRollback(PCache*, int, void (*xReiniter)(PgHdr*)); /* Get a list of all dirty pages in the cache, sorted by page number */ PgHdr *sqlite3PcacheDirtyList(PCache*); /* Reset and close the cache object */ void sqlite3PcacheClose(PCache*); /* Clear flags from pages of the page cache */ -void sqlite3PcacheClearSyncFlags(PCache *); +void sqlite3PcacheClearFlags(PCache*, int mask); + +/* Assert flags settings on all pages. Debugging only */ +#ifndef NDEBUG + void sqlite3PcacheAssertFlags(PCache*, int trueMask, int falseMask); +#else +# define sqlite3PcacheAssertFlags(A,B,C) +#endif + +/* Return true if the number of dirty pages is 0 or 1 */ +int sqlite3PcacheZeroOrOneDirtyPages(PCache*); /* Discard the contents of the cache */ -void sqlite3PcacheClear(PCache*); +int sqlite3PcacheClear(PCache*); /* Return the total number of outstanding page references */ int sqlite3PcacheRefCount(PCache*); /* Increment the reference count of an existing page */ @@ -123,27 +146,25 @@ /* Return the total number of pages stored in the cache */ int sqlite3PcachePagecount(PCache*); #ifdef SQLITE_CHECK_PAGES -/* Iterate through all dirty pages currently stored in the cache. This -** interface is only available if SQLITE_CHECK_PAGES is defined when the -** library is built. +/* Iterate through all pages currently stored in the cache. This interface +** is only available if SQLITE_CHECK_PAGES is defined when the library is +** built. */ -void sqlite3PcacheIterateDirty(PCache *pCache, void (*xIter)(PgHdr *)); +void sqlite3PcacheIterate(PCache *pCache, void (*xIter)(PgHdr *)); #endif /* Set and get the suggested cache-size for the specified pager-cache. ** ** If no global maximum is configured, then the system attempts to limit ** the total number of pages cached by purgeable pager-caches to the sum ** of the suggested cache-sizes. */ -void sqlite3PcacheSetCachesize(PCache *, int); -#ifdef SQLITE_TEST int sqlite3PcacheGetCachesize(PCache *); -#endif +void sqlite3PcacheSetCachesize(PCache *, int); #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT /* Try to return memory used by the pcache module to the main memory heap */ int sqlite3PcacheReleaseMemory(int); #endif @@ -150,8 +171,6 @@ #ifdef SQLITE_TEST void sqlite3PcacheStats(int*,int*,int*,int*); #endif -void sqlite3PCacheSetDefault(void); - #endif /* _PCACHE_H_ */ DELETED src/pcache1.c Index: src/pcache1.c ================================================================== --- src/pcache1.c +++ /dev/null @@ -1,752 +0,0 @@ -/* -** 2008 November 05 -** -** 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 the default page cache implementation (the -** sqlite3_pcache interface). It also contains part of the implementation -** of the SQLITE_CONFIG_PAGECACHE and sqlite3_release_memory() features. -** If the default page cache implementation is overriden, then neither of -** these two features are available. -** -** @(#) $Id: pcache1.c,v 1.8 2009/01/23 16:45:01 danielk1977 Exp $ -*/ - -#include "sqliteInt.h" - -typedef struct PCache1 PCache1; -typedef struct PgHdr1 PgHdr1; -typedef struct PgFreeslot PgFreeslot; - -/* Pointers to structures of this type are cast and returned as -** opaque sqlite3_pcache* handles -*/ -struct PCache1 { - /* Cache configuration parameters. Page size (szPage) and the purgeable - ** flag (bPurgeable) are set when the cache is created. nMax may be - ** modified at any time by a call to the pcache1CacheSize() method. - ** The global mutex must be held when accessing nMax. - */ - int szPage; /* Size of allocated pages in bytes */ - int bPurgeable; /* True if cache is purgeable */ - unsigned int nMin; /* Minimum number of pages reserved */ - unsigned int nMax; /* Configured "cache_size" value */ - - /* Hash table of all pages. The following variables may only be accessed - ** when the accessor is holding the global mutex (see pcache1EnterMutex() - ** and pcache1LeaveMutex()). - */ - unsigned int nRecyclable; /* Number of pages in the LRU list */ - unsigned int nPage; /* Total number of pages in apHash */ - unsigned int nHash; /* Number of slots in apHash[] */ - PgHdr1 **apHash; /* Hash table for fast lookup by key */ - - unsigned int iMaxKey; /* Largest key seen since xTruncate() */ -}; - -/* -** Each cache entry is represented by an instance of the following -** structure. A buffer of PgHdr1.pCache->szPage bytes is allocated -** directly after the structure in memory (see the PGHDR1_TO_PAGE() -** macro below). -*/ -struct PgHdr1 { - unsigned int iKey; /* Key value (page number) */ - PgHdr1 *pNext; /* Next in hash table chain */ - PCache1 *pCache; /* Cache that currently owns this page */ - PgHdr1 *pLruNext; /* Next in LRU list of unpinned pages */ - PgHdr1 *pLruPrev; /* Previous in LRU list of unpinned pages */ -}; - -/* -** Free slots in the allocator used to divide up the buffer provided using -** the SQLITE_CONFIG_PAGECACHE mechanism. -*/ -struct PgFreeslot { - PgFreeslot *pNext; /* Next free slot */ -}; - -/* -** Global data used by this cache. -*/ -static SQLITE_WSD struct PCacheGlobal { - sqlite3_mutex *mutex; /* static mutex MUTEX_STATIC_LRU */ - - int nMaxPage; /* Sum of nMaxPage for purgeable caches */ - int nMinPage; /* Sum of nMinPage for purgeable caches */ - int nCurrentPage; /* Number of purgeable pages allocated */ - PgHdr1 *pLruHead, *pLruTail; /* LRU list of unpinned pages */ - - /* Variables related to SQLITE_CONFIG_PAGECACHE settings. */ - int szSlot; /* Size of each free slot */ - void *pStart, *pEnd; /* Bounds of pagecache malloc range */ - PgFreeslot *pFree; /* Free page blocks */ -} pcache1_g; - -/* -** All code in this file should access the global structure above via the -** alias "pcache1". This ensures that the WSD emulation is used when -** compiling for systems that do not support real WSD. -*/ -#define pcache1 (GLOBAL(struct PCacheGlobal, pcache1_g)) - -/* -** When a PgHdr1 structure is allocated, the associated PCache1.szPage -** bytes of data are located directly after it in memory (i.e. the total -** size of the allocation is sizeof(PgHdr1)+PCache1.szPage byte). The -** PGHDR1_TO_PAGE() macro takes a pointer to a PgHdr1 structure as -** an argument and returns a pointer to the associated block of szPage -** bytes. The PAGE_TO_PGHDR1() macro does the opposite: its argument is -** a pointer to a block of szPage bytes of data and the return value is -** a pointer to the associated PgHdr1 structure. -** -** assert( PGHDR1_TO_PAGE(PAGE_TO_PGHDR1(X))==X ); -*/ -#define PGHDR1_TO_PAGE(p) (void *)(&((unsigned char *)p)[sizeof(PgHdr1)]) -#define PAGE_TO_PGHDR1(p) (PgHdr1 *)(&((unsigned char *)p)[-1*(int)sizeof(PgHdr1)]) - -/* -** Macros to enter and leave the global LRU mutex. -*/ -#define pcache1EnterMutex() sqlite3_mutex_enter(pcache1.mutex) -#define pcache1LeaveMutex() sqlite3_mutex_leave(pcache1.mutex) - -/******************************************************************************/ -/******** Page Allocation/SQLITE_CONFIG_PCACHE Related Functions **************/ - -/* -** This function is called during initialization if a static buffer is -** supplied to use for the page-cache by passing the SQLITE_CONFIG_PAGECACHE -** verb to sqlite3_config(). Parameter pBuf points to an allocation large -** enough to contain 'n' buffers of 'sz' bytes each. -*/ -void sqlite3PCacheBufferSetup(void *pBuf, int sz, int n){ - PgFreeslot *p; - sz &= ~7; - pcache1.szSlot = sz; - pcache1.pStart = pBuf; - pcache1.pFree = 0; - while( n-- ){ - p = (PgFreeslot*)pBuf; - p->pNext = pcache1.pFree; - pcache1.pFree = p; - pBuf = (void*)&((char*)pBuf)[sz]; - } - pcache1.pEnd = pBuf; -} - -/* -** Malloc function used within this file to allocate space from the buffer -** configured using sqlite3_config(SQLITE_CONFIG_PAGECACHE) option. If no -** such buffer exists or there is no space left in it, this function falls -** back to sqlite3Malloc(). -*/ -static void *pcache1Alloc(int nByte){ - void *p; - assert( sqlite3_mutex_held(pcache1.mutex) ); - if( nByte<=pcache1.szSlot && pcache1.pFree ){ - p = (PgHdr1 *)pcache1.pFree; - pcache1.pFree = pcache1.pFree->pNext; - sqlite3StatusSet(SQLITE_STATUS_PAGECACHE_SIZE, nByte); - sqlite3StatusAdd(SQLITE_STATUS_PAGECACHE_USED, 1); - }else{ - - /* Allocate a new buffer using sqlite3Malloc. Before doing so, exit the - ** global pcache mutex and unlock the pager-cache object pCache. This is - ** so that if the attempt to allocate a new buffer causes the the - ** configured soft-heap-limit to be breached, it will be possible to - ** reclaim memory from this pager-cache. - */ - pcache1LeaveMutex(); - p = sqlite3Malloc(nByte); - pcache1EnterMutex(); - if( p ){ - int sz = sqlite3MallocSize(p); - sqlite3StatusAdd(SQLITE_STATUS_PAGECACHE_OVERFLOW, sz); - } - } - return p; -} - -/* -** Free an allocated buffer obtained from pcache1Alloc(). -*/ -static void pcache1Free(void *p){ - assert( sqlite3_mutex_held(pcache1.mutex) ); - if( p==0 ) return; - if( p>=pcache1.pStart && ppNext = pcache1.pFree; - pcache1.pFree = pSlot; - }else{ - int iSize = sqlite3MallocSize(p); - sqlite3StatusAdd(SQLITE_STATUS_PAGECACHE_OVERFLOW, -iSize); - sqlite3_free(p); - } -} - -/* -** Allocate a new page object initially associated with cache pCache. -*/ -static PgHdr1 *pcache1AllocPage(PCache1 *pCache){ - int nByte = sizeof(PgHdr1) + pCache->szPage; - PgHdr1 *p = (PgHdr1 *)pcache1Alloc(nByte); - if( p ){ - if( pCache->bPurgeable ){ - pcache1.nCurrentPage++; - } - } - return p; -} - -/* -** Free a page object allocated by pcache1AllocPage(). -*/ -static void pcache1FreePage(PgHdr1 *p){ - if( p ){ - if( p->pCache->bPurgeable ){ - pcache1.nCurrentPage--; - } - pcache1Free(p); - } -} - -/* -** Malloc function used by SQLite to obtain space from the buffer configured -** using sqlite3_config(SQLITE_CONFIG_PAGECACHE) option. If no such buffer -** exists, this function falls back to sqlite3Malloc(). -*/ -void *sqlite3PageMalloc(int sz){ - void *p; - pcache1EnterMutex(); - p = pcache1Alloc(sz); - pcache1LeaveMutex(); - return p; -} - -/* -** Free an allocated buffer obtained from sqlite3PageMalloc(). -*/ -void sqlite3PageFree(void *p){ - pcache1EnterMutex(); - pcache1Free(p); - pcache1LeaveMutex(); -} - -/******************************************************************************/ -/******** General Implementation Functions ************************************/ - -/* -** This function is used to resize the hash table used by the cache passed -** as the first argument. -** -** The global mutex must be held when this function is called. -*/ -static int pcache1ResizeHash(PCache1 *p){ - PgHdr1 **apNew; - unsigned int nNew; - unsigned int i; - - assert( sqlite3_mutex_held(pcache1.mutex) ); - - nNew = p->nHash*2; - if( nNew<256 ){ - nNew = 256; - } - - pcache1LeaveMutex(); - if( p->nHash ){ sqlite3BeginBenignMalloc(); } - apNew = (PgHdr1 **)sqlite3_malloc(sizeof(PgHdr1 *)*nNew); - if( p->nHash ){ sqlite3EndBenignMalloc(); } - pcache1EnterMutex(); - if( apNew ){ - memset(apNew, 0, sizeof(PgHdr1 *)*nNew); - for(i=0; inHash; i++){ - PgHdr1 *pPage; - PgHdr1 *pNext = p->apHash[i]; - while( (pPage = pNext)!=0 ){ - unsigned int h = pPage->iKey % nNew; - pNext = pPage->pNext; - pPage->pNext = apNew[h]; - apNew[h] = pPage; - } - } - sqlite3_free(p->apHash); - p->apHash = apNew; - p->nHash = nNew; - } - - return (p->apHash ? SQLITE_OK : SQLITE_NOMEM); -} - -/* -** This function is used internally to remove the page pPage from the -** global LRU list, if is part of it. If pPage is not part of the global -** LRU list, then this function is a no-op. -** -** The global mutex must be held when this function is called. -*/ -static void pcache1PinPage(PgHdr1 *pPage){ - assert( sqlite3_mutex_held(pcache1.mutex) ); - if( pPage && (pPage->pLruNext || pPage==pcache1.pLruTail) ){ - if( pPage->pLruPrev ){ - pPage->pLruPrev->pLruNext = pPage->pLruNext; - } - if( pPage->pLruNext ){ - pPage->pLruNext->pLruPrev = pPage->pLruPrev; - } - if( pcache1.pLruHead==pPage ){ - pcache1.pLruHead = pPage->pLruNext; - } - if( pcache1.pLruTail==pPage ){ - pcache1.pLruTail = pPage->pLruPrev; - } - pPage->pLruNext = 0; - pPage->pLruPrev = 0; - pPage->pCache->nRecyclable--; - } -} - - -/* -** Remove the page supplied as an argument from the hash table -** (PCache1.apHash structure) that it is currently stored in. -** -** The global mutex must be held when this function is called. -*/ -static void pcache1RemoveFromHash(PgHdr1 *pPage){ - unsigned int h; - PCache1 *pCache = pPage->pCache; - PgHdr1 **pp; - - h = pPage->iKey % pCache->nHash; - for(pp=&pCache->apHash[h]; (*pp)!=pPage; pp=&(*pp)->pNext); - *pp = (*pp)->pNext; - - pCache->nPage--; -} - -/* -** If there are currently more than pcache.nMaxPage pages allocated, try -** to recycle pages to reduce the number allocated to pcache.nMaxPage. -*/ -static void pcache1EnforceMaxPage(void){ - assert( sqlite3_mutex_held(pcache1.mutex) ); - while( pcache1.nCurrentPage>pcache1.nMaxPage && pcache1.pLruTail ){ - PgHdr1 *p = pcache1.pLruTail; - pcache1PinPage(p); - pcache1RemoveFromHash(p); - pcache1FreePage(p); - } -} - -/* -** Discard all pages from cache pCache with a page number (key value) -** greater than or equal to iLimit. Any pinned pages that meet this -** criteria are unpinned before they are discarded. -** -** The global mutex must be held when this function is called. -*/ -static void pcache1TruncateUnsafe( - PCache1 *pCache, - unsigned int iLimit -){ - unsigned int h; - assert( sqlite3_mutex_held(pcache1.mutex) ); - for(h=0; hnHash; h++){ - PgHdr1 **pp = &pCache->apHash[h]; - PgHdr1 *pPage; - while( (pPage = *pp)!=0 ){ - if( pPage->iKey>=iLimit ){ - pcache1PinPage(pPage); - *pp = pPage->pNext; - pcache1FreePage(pPage); - }else{ - pp = &pPage->pNext; - } - } - } -} - -/******************************************************************************/ -/******** sqlite3_pcache Methods **********************************************/ - -/* -** Implementation of the sqlite3_pcache.xInit method. -*/ -static int pcache1Init(void *NotUsed){ - UNUSED_PARAMETER(NotUsed); - memset(&pcache1, 0, sizeof(pcache1)); - if( sqlite3GlobalConfig.bCoreMutex ){ - pcache1.mutex = sqlite3_mutex_alloc(SQLITE_MUTEX_STATIC_LRU); - } - return SQLITE_OK; -} - -/* -** Implementation of the sqlite3_pcache.xShutdown method. -*/ -static void pcache1Shutdown(void *NotUsed){ - UNUSED_PARAMETER(NotUsed); - /* no-op */ -} - -/* -** Implementation of the sqlite3_pcache.xCreate method. -** -** Allocate a new cache. -*/ -static sqlite3_pcache *pcache1Create(int szPage, int bPurgeable){ - PCache1 *pCache; - - pCache = (PCache1 *)sqlite3_malloc(sizeof(PCache1)); - if( pCache ){ - memset(pCache, 0, sizeof(PCache1)); - pCache->szPage = szPage; - pCache->bPurgeable = (bPurgeable ? 1 : 0); - if( bPurgeable ){ - pCache->nMin = 10; - pcache1EnterMutex(); - pcache1.nMinPage += pCache->nMin; - pcache1LeaveMutex(); - } - } - return (sqlite3_pcache *)pCache; -} - -/* -** Implementation of the sqlite3_pcache.xCachesize method. -** -** Configure the cache_size limit for a cache. -*/ -static void pcache1Cachesize(sqlite3_pcache *p, int nMax){ - PCache1 *pCache = (PCache1 *)p; - if( pCache->bPurgeable ){ - pcache1EnterMutex(); - pcache1.nMaxPage += (nMax - pCache->nMax); - pCache->nMax = nMax; - pcache1EnforceMaxPage(); - pcache1LeaveMutex(); - } -} - -/* -** Implementation of the sqlite3_pcache.xPagecount method. -*/ -static int pcache1Pagecount(sqlite3_pcache *p){ - int n; - pcache1EnterMutex(); - n = ((PCache1 *)p)->nPage; - pcache1LeaveMutex(); - return n; -} - -/* -** Implementation of the sqlite3_pcache.xFetch method. -** -** Fetch a page by key value. -** -** Whether or not a new page may be allocated by this function depends on -** the value of the createFlag argument. -** -** There are three different approaches to obtaining space for a page, -** depending on the value of parameter createFlag (which may be 0, 1 or 2). -** -** 1. Regardless of the value of createFlag, the cache is searched for a -** copy of the requested page. If one is found, it is returned. -** -** 2. If createFlag==0 and the page is not already in the cache, NULL is -** returned. -** -** 3. If createFlag is 1, the cache is marked as purgeable and the page is -** not already in the cache, and if either of the following are true, -** return NULL: -** -** (a) the number of pages pinned by the cache is greater than -** PCache1.nMax, or -** (b) the number of pages pinned by the cache is greater than -** the sum of nMax for all purgeable caches, less the sum of -** nMin for all other purgeable caches. -** -** 4. If none of the first three conditions apply and the cache is marked -** as purgeable, and if one of the following is true: -** -** (a) The number of pages allocated for the cache is already -** PCache1.nMax, or -** -** (b) The number of pages allocated for all purgeable caches is -** already equal to or greater than the sum of nMax for all -** purgeable caches, -** -** then attempt to recycle a page from the LRU list. If it is the right -** size, return the recycled buffer. Otherwise, free the buffer and -** proceed to step 5. -** -** 5. Otherwise, allocate and return a new page buffer. -*/ -static void *pcache1Fetch(sqlite3_pcache *p, unsigned int iKey, int createFlag){ - unsigned int nPinned; - PCache1 *pCache = (PCache1 *)p; - PgHdr1 *pPage = 0; - - pcache1EnterMutex(); - if( createFlag==1 ) sqlite3BeginBenignMalloc(); - - /* Search the hash table for an existing entry. */ - if( pCache->nHash>0 ){ - unsigned int h = iKey % pCache->nHash; - for(pPage=pCache->apHash[h]; pPage&&pPage->iKey!=iKey; pPage=pPage->pNext); - } - - if( pPage || createFlag==0 ){ - pcache1PinPage(pPage); - goto fetch_out; - } - - /* Step 3 of header comment. */ - nPinned = pCache->nPage - pCache->nRecyclable; - if( createFlag==1 && pCache->bPurgeable && ( - nPinned>=(pcache1.nMaxPage+pCache->nMin-pcache1.nMinPage) - || nPinned>=(pCache->nMax) - )){ - goto fetch_out; - } - - if( pCache->nPage>=pCache->nHash && pcache1ResizeHash(pCache) ){ - goto fetch_out; - } - - /* Step 4. Try to recycle a page buffer if appropriate. */ - if( pCache->bPurgeable && pcache1.pLruTail && ( - pCache->nPage>=pCache->nMax-1 || pcache1.nCurrentPage>=pcache1.nMaxPage - )){ - pPage = pcache1.pLruTail; - pcache1RemoveFromHash(pPage); - pcache1PinPage(pPage); - if( pPage->pCache->szPage!=pCache->szPage ){ - pcache1FreePage(pPage); - pPage = 0; - }else{ - pcache1.nCurrentPage -= (pPage->pCache->bPurgeable - pCache->bPurgeable); - } - } - - /* Step 5. If a usable page buffer has still not been found, - ** attempt to allocate a new one. - */ - if( !pPage ){ - pPage = pcache1AllocPage(pCache); - } - - if( pPage ){ - unsigned int h = iKey % pCache->nHash; - *(void **)(PGHDR1_TO_PAGE(pPage)) = 0; - pCache->nPage++; - pPage->iKey = iKey; - pPage->pNext = pCache->apHash[h]; - pPage->pCache = pCache; - pPage->pLruPrev = 0; - pPage->pLruNext = 0; - pCache->apHash[h] = pPage; - } - -fetch_out: - if( pPage && iKey>pCache->iMaxKey ){ - pCache->iMaxKey = iKey; - } - if( createFlag==1 ) sqlite3EndBenignMalloc(); - pcache1LeaveMutex(); - return (pPage ? PGHDR1_TO_PAGE(pPage) : 0); -} - - -/* -** Implementation of the sqlite3_pcache.xUnpin method. -** -** Mark a page as unpinned (eligible for asynchronous recycling). -*/ -static void pcache1Unpin(sqlite3_pcache *p, void *pPg, int reuseUnlikely){ - PCache1 *pCache = (PCache1 *)p; - PgHdr1 *pPage = PAGE_TO_PGHDR1(pPg); - - pcache1EnterMutex(); - - /* It is an error to call this function if the page is already - ** part of the global LRU list. - */ - assert( pPage->pLruPrev==0 && pPage->pLruNext==0 ); - assert( pcache1.pLruHead!=pPage && pcache1.pLruTail!=pPage ); - - if( reuseUnlikely || pcache1.nCurrentPage>pcache1.nMaxPage ){ - pcache1RemoveFromHash(pPage); - pcache1FreePage(pPage); - }else{ - /* Add the page to the global LRU list. Normally, the page is added to - ** the head of the list (last page to be recycled). However, if the - ** reuseUnlikely flag passed to this function is true, the page is added - ** to the tail of the list (first page to be recycled). - */ - if( pcache1.pLruHead ){ - pcache1.pLruHead->pLruPrev = pPage; - pPage->pLruNext = pcache1.pLruHead; - pcache1.pLruHead = pPage; - }else{ - pcache1.pLruTail = pPage; - pcache1.pLruHead = pPage; - } - pCache->nRecyclable++; - } - - pcache1LeaveMutex(); -} - -/* -** Implementation of the sqlite3_pcache.xRekey method. -*/ -static void pcache1Rekey( - sqlite3_pcache *p, - void *pPg, - unsigned int iOld, - unsigned int iNew -){ - PCache1 *pCache = (PCache1 *)p; - PgHdr1 *pPage = PAGE_TO_PGHDR1(pPg); - PgHdr1 **pp; - unsigned int h; - assert( pPage->iKey==iOld ); - - pcache1EnterMutex(); - - h = iOld%pCache->nHash; - pp = &pCache->apHash[h]; - while( (*pp)!=pPage ){ - pp = &(*pp)->pNext; - } - *pp = pPage->pNext; - - h = iNew%pCache->nHash; - pPage->iKey = iNew; - pPage->pNext = pCache->apHash[h]; - pCache->apHash[h] = pPage; - - if( iNew>pCache->iMaxKey ){ - pCache->iMaxKey = iNew; - } - - pcache1LeaveMutex(); -} - -/* -** Implementation of the sqlite3_pcache.xTruncate method. -** -** Discard all unpinned pages in the cache with a page number equal to -** or greater than parameter iLimit. Any pinned pages with a page number -** equal to or greater than iLimit are implicitly unpinned. -*/ -static void pcache1Truncate(sqlite3_pcache *p, unsigned int iLimit){ - PCache1 *pCache = (PCache1 *)p; - pcache1EnterMutex(); - if( iLimit<=pCache->iMaxKey ){ - pcache1TruncateUnsafe(pCache, iLimit); - pCache->iMaxKey = iLimit-1; - } - pcache1LeaveMutex(); -} - -/* -** Implementation of the sqlite3_pcache.xDestroy method. -** -** Destroy a cache allocated using pcache1Create(). -*/ -static void pcache1Destroy(sqlite3_pcache *p){ - PCache1 *pCache = (PCache1 *)p; - pcache1EnterMutex(); - pcache1TruncateUnsafe(pCache, 0); - pcache1.nMaxPage -= pCache->nMax; - pcache1.nMinPage -= pCache->nMin; - pcache1EnforceMaxPage(); - pcache1LeaveMutex(); - sqlite3_free(pCache->apHash); - sqlite3_free(pCache); -} - -/* -** This function is called during initialization (sqlite3_initialize()) to -** install the default pluggable cache module, assuming the user has not -** already provided an alternative. -*/ -void sqlite3PCacheSetDefault(void){ - static sqlite3_pcache_methods defaultMethods = { - 0, /* pArg */ - pcache1Init, /* xInit */ - pcache1Shutdown, /* xShutdown */ - pcache1Create, /* xCreate */ - pcache1Cachesize, /* xCachesize */ - pcache1Pagecount, /* xPagecount */ - pcache1Fetch, /* xFetch */ - pcache1Unpin, /* xUnpin */ - pcache1Rekey, /* xRekey */ - pcache1Truncate, /* xTruncate */ - pcache1Destroy /* xDestroy */ - }; - sqlite3_config(SQLITE_CONFIG_PCACHE, &defaultMethods); -} - -#ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT -/* -** This function is called to free superfluous dynamically allocated memory -** held by the pager system. Memory in use by any SQLite pager allocated -** by the current thread may be sqlite3_free()ed. -** -** nReq is the number of bytes of memory required. Once this much has -** been released, the function returns. The return value is the total number -** of bytes of memory released. -*/ -int sqlite3PcacheReleaseMemory(int nReq){ - int nFree = 0; - if( pcache1.pStart==0 ){ - PgHdr1 *p; - pcache1EnterMutex(); - while( (nReq<0 || nFreepLruNext){ - nRecyclable++; - } - *pnCurrent = pcache1.nCurrentPage; - *pnMax = pcache1.nMaxPage; - *pnMin = pcache1.nMinPage; - *pnRecyclable = nRecyclable; -} -#endif Index: src/pragma.c ================================================================== --- src/pragma.c +++ src/pragma.c @@ -9,13 +9,14 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains code used to implement the PRAGMA command. ** -** $Id: pragma.c,v 1.202 2009/01/20 16:53:41 danielk1977 Exp $ +** $Id: pragma.c,v 1.189 2008/10/10 17:47:21 danielk1977 Exp $ */ #include "sqliteInt.h" +#include /* Ignore this whole file if pragmas are disabled */ #if !defined(SQLITE_OMIT_PRAGMA) && !defined(SQLITE_OMIT_PARSER) @@ -27,22 +28,22 @@ ** Note that the values returned are one less that the values that ** should be passed into sqlite3BtreeSetSafetyLevel(). The is done ** to support legacy SQL code. The safety level used to be boolean ** and older scripts may have used numbers 0 for OFF and 1 for ON. */ -static u8 getSafetyLevel(const char *z){ +static int getSafetyLevel(const char *z){ /* 123456789 123456789 */ static const char zText[] = "onoffalseyestruefull"; static const u8 iOffset[] = {0, 1, 2, 4, 9, 12, 16}; static const u8 iLength[] = {2, 2, 3, 5, 3, 4, 4}; static const u8 iValue[] = {1, 0, 0, 0, 1, 1, 2}; int i, n; - if( sqlite3Isdigit(*z) ){ - return (u8)atoi(z); + if( isdigit(*z) ){ + return atoi(z); } - n = sqlite3Strlen30(z); - for(i=0; i=0&&i<=2)?i:0); + return ((i>=0&&i<=2)?i:0); } #endif /* ifndef SQLITE_OMIT_AUTOVACUUM */ #ifndef SQLITE_OMIT_PAGER_PRAGMAS /* @@ -134,11 +135,11 @@ sqlite3 *db = pParse->db; if( db->temp_store==ts ) return SQLITE_OK; if( invalidateTempStorage( pParse ) != SQLITE_OK ){ return SQLITE_ERROR; } - db->temp_store = (u8)ts; + db->temp_store = ts; return SQLITE_OK; } #endif /* SQLITE_PAGER_PRAGMAS */ /* @@ -148,11 +149,11 @@ Vdbe *v = sqlite3GetVdbe(pParse); int mem = ++pParse->nMem; sqlite3VdbeAddOp2(v, OP_Integer, value, mem); if( pParse->explain==0 ){ sqlite3VdbeSetNumCols(v, 1); - sqlite3VdbeSetColName(v, 0, COLNAME_NAME, zLabel, SQLITE_STATIC); + sqlite3VdbeSetColName(v, 0, COLNAME_NAME, zLabel, P4_STATIC); } sqlite3VdbeAddOp2(v, OP_ResultRow, mem, 1); } #ifndef SQLITE_OMIT_FLAG_PRAGMAS @@ -188,17 +189,16 @@ ** flag if there are any active statements. */ { "read_uncommitted", SQLITE_ReadUncommitted }, }; int i; const struct sPragmaType *p; - for(i=0, p=aPragma; izName)==0 ){ sqlite3 *db = pParse->db; Vdbe *v; v = sqlite3GetVdbe(pParse); - assert( v!=0 ); /* Already allocated by sqlite3Pragma() */ - if( ALWAYS(v) ){ + if( v ){ if( zRight==0 ){ returnSingleInt(pParse, p->zName, (db->flags & p->mask)!=0 ); }else{ if( getBoolean(zRight) ){ db->flags |= p->mask; @@ -219,23 +219,18 @@ } return 0; } #endif /* SQLITE_OMIT_FLAG_PRAGMAS */ -/* -** Return a human-readable name for a constraint resolution action. -*/ static const char *actionName(u8 action){ - const char *zName; switch( action ){ - case OE_SetNull: zName = "SET NULL"; break; - case OE_SetDflt: zName = "SET DEFAULT"; break; - case OE_Cascade: zName = "CASCADE"; break; - default: zName = "RESTRICT"; - assert( action==OE_Restrict ); break; + case OE_SetNull: return "SET NULL"; + case OE_SetDflt: return "SET DEFAULT"; + case OE_Restrict: return "RESTRICT"; + case OE_Cascade: return "CASCADE"; } - return zName; + return ""; } /* ** Process a pragma statement. ** @@ -288,12 +283,11 @@ zRight = sqlite3MPrintf(db, "-%T", pValue); }else{ zRight = sqlite3NameFromToken(db, pValue); } - assert( pId2 ); - zDb = pId2->n>0 ? pDb->zName : 0; + zDb = ((pId2 && pId2->n>0)?pDb->zName:0); if( sqlite3AuthCheck(pParse, SQLITE_PRAGMA, zLeft, zRight, zDb) ){ goto pragma_out; } #ifndef SQLITE_OMIT_PAGER_PRAGMAS @@ -326,11 +320,11 @@ int addr; if( sqlite3ReadSchema(pParse) ) goto pragma_out; sqlite3VdbeUsesBtree(v, iDb); if( !zRight ){ sqlite3VdbeSetNumCols(v, 1); - sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "cache_size", SQLITE_STATIC); + sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "cache_size", P4_STATIC); pParse->nMem += 2; addr = sqlite3VdbeAddOpList(v, ArraySize(getCacheSize), getCacheSize); sqlite3VdbeChangeP1(v, addr, iDb); sqlite3VdbeChangeP1(v, addr+5, SQLITE_DEFAULT_CACHE_SIZE); }else{ @@ -357,13 +351,12 @@ ** database page size value. The value can only be set if ** the database has not yet been created. */ if( sqlite3StrICmp(zLeft,"page_size")==0 ){ Btree *pBt = pDb->pBt; - assert( pBt!=0 ); if( !zRight ){ - int size = ALWAYS(pBt) ? sqlite3BtreeGetPageSize(pBt) : 0; + int size = pBt ? sqlite3BtreeGetPageSize(pBt) : 0; returnSingleInt(pParse, "page_size", size); }else{ /* Malloc may fail when setting the page-size, as there is an internal ** buffer that the pager module resizes using sqlite3_realloc(). */ @@ -384,15 +377,14 @@ ** forms return the current setting. */ if( sqlite3StrICmp(zLeft,"max_page_count")==0 ){ Btree *pBt = pDb->pBt; int newMax = 0; - assert( pBt!=0 ); if( zRight ){ newMax = atoi(zRight); } - if( ALWAYS(pBt) ){ + if( pBt ){ newMax = sqlite3BtreeMaxPageCount(pBt, newMax); } returnSingleInt(pParse, "max_page_count", newMax); }else @@ -400,18 +392,20 @@ ** PRAGMA [database.]page_count ** ** Return the number of pages in the specified database. */ if( sqlite3StrICmp(zLeft,"page_count")==0 ){ + Vdbe *v; int iReg; - if( sqlite3ReadSchema(pParse) ) goto pragma_out; + v = sqlite3GetVdbe(pParse); + if( !v || sqlite3ReadSchema(pParse) ) goto pragma_out; sqlite3CodeVerifySchema(pParse, iDb); iReg = ++pParse->nMem; sqlite3VdbeAddOp2(v, OP_Pagecount, iDb, iReg); sqlite3VdbeAddOp2(v, OP_ResultRow, iReg, 1); sqlite3VdbeSetNumCols(v, 1); - sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "page_count", SQLITE_STATIC); + sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "page_count", P4_STATIC); }else /* ** PRAGMA [database.]locking_mode ** PRAGMA [database.]locking_mode = (normal|exclusive) @@ -441,11 +435,11 @@ assert(pDb==&db->aDb[0]); for(ii=2; iinDb; ii++){ pPager = sqlite3BtreePager(db->aDb[ii].pBt); sqlite3PagerLockingMode(pPager, eMode); } - db->dfltLockMode = (u8)eMode; + db->dfltLockMode = eMode; } pPager = sqlite3BtreePager(pDb->pBt); eMode = sqlite3PagerLockingMode(pPager, eMode); } @@ -452,29 +446,27 @@ assert(eMode==PAGER_LOCKINGMODE_NORMAL||eMode==PAGER_LOCKINGMODE_EXCLUSIVE); if( eMode==PAGER_LOCKINGMODE_EXCLUSIVE ){ zRet = "exclusive"; } sqlite3VdbeSetNumCols(v, 1); - sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "locking_mode", SQLITE_STATIC); + sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "locking_mode", P4_STATIC); sqlite3VdbeAddOp4(v, OP_String8, 0, 1, 0, zRet, 0); sqlite3VdbeAddOp2(v, OP_ResultRow, 1, 1); }else /* ** PRAGMA [database.]journal_mode - ** PRAGMA [database.]journal_mode = (delete|persist|off|truncate|memory) + ** PRAGMA [database.]journal_mode = (delete|persist|off) */ if( sqlite3StrICmp(zLeft,"journal_mode")==0 ){ int eMode; - static char * const azModeName[] = { - "delete", "persist", "off", "truncate", "memory" - }; + static char * const azModeName[] = {"delete", "persist", "off", "truncate"}; if( zRight==0 ){ eMode = PAGER_JOURNALMODE_QUERY; }else{ - int n = sqlite3Strlen30(zRight); + int n = strlen(zRight); eMode = sizeof(azModeName)/sizeof(azModeName[0]) - 1; while( eMode>=0 && sqlite3StrNICmp(zRight, azModeName[eMode], n)!=0 ){ eMode--; } } @@ -501,32 +493,31 @@ if( db->aDb[ii].pBt ){ pPager = sqlite3BtreePager(db->aDb[ii].pBt); sqlite3PagerJournalMode(pPager, eMode); } } - db->dfltJournalMode = (u8)eMode; + db->dfltJournalMode = eMode; } pPager = sqlite3BtreePager(pDb->pBt); eMode = sqlite3PagerJournalMode(pPager, eMode); } assert( eMode==PAGER_JOURNALMODE_DELETE || eMode==PAGER_JOURNALMODE_TRUNCATE || eMode==PAGER_JOURNALMODE_PERSIST - || eMode==PAGER_JOURNALMODE_OFF - || eMode==PAGER_JOURNALMODE_MEMORY ); + || eMode==PAGER_JOURNALMODE_OFF ); sqlite3VdbeSetNumCols(v, 1); - sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "journal_mode", SQLITE_STATIC); + sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "journal_mode", P4_STATIC); sqlite3VdbeAddOp4(v, OP_String8, 0, 1, 0, azModeName[eMode], P4_STATIC); sqlite3VdbeAddOp2(v, OP_ResultRow, 1, 1); }else /* ** PRAGMA [database.]journal_size_limit ** PRAGMA [database.]journal_size_limit=N ** - ** Get or set the size limit on rollback journal files. + ** Get or set the (boolean) value of the database 'auto-vacuum' parameter. */ if( sqlite3StrICmp(zLeft,"journal_size_limit")==0 ){ Pager *pPager = sqlite3BtreePager(pDb->pBt); i64 iLimit = -2; if( zRight ){ @@ -544,33 +535,26 @@ /* ** PRAGMA [database.]auto_vacuum ** PRAGMA [database.]auto_vacuum=N ** - ** Get or set the value of the database 'auto-vacuum' parameter. - ** The value is one of: 0 NONE 1 FULL 2 INCREMENTAL + ** Get or set the (boolean) value of the database 'auto-vacuum' parameter. */ #ifndef SQLITE_OMIT_AUTOVACUUM if( sqlite3StrICmp(zLeft,"auto_vacuum")==0 ){ Btree *pBt = pDb->pBt; - assert( pBt!=0 ); if( sqlite3ReadSchema(pParse) ){ goto pragma_out; } if( !zRight ){ - int auto_vacuum; - if( ALWAYS(pBt) ){ - auto_vacuum = sqlite3BtreeGetAutoVacuum(pBt); - }else{ - auto_vacuum = SQLITE_DEFAULT_AUTOVACUUM; - } + int auto_vacuum = + pBt ? sqlite3BtreeGetAutoVacuum(pBt) : SQLITE_DEFAULT_AUTOVACUUM; returnSingleInt(pParse, "auto_vacuum", auto_vacuum); }else{ int eAuto = getAutoVacuum(zRight); - assert( eAuto>=0 && eAuto<=2 ); - db->nextAutovac = (u8)eAuto; - if( ALWAYS(eAuto>=0) ){ + db->nextAutovac = eAuto; + if( eAuto>=0 ){ /* Call SetAutoVacuum() to set initialize the internal auto and ** incr-vacuum flags. This is required in case this connection ** creates the database file. It is important that it is created ** as an auto-vacuum capable db. */ @@ -686,11 +670,11 @@ if( sqlite3StrICmp(zLeft, "temp_store_directory")==0 ){ if( !zRight ){ if( sqlite3_temp_directory ){ sqlite3VdbeSetNumCols(v, 1); sqlite3VdbeSetColName(v, 0, COLNAME_NAME, - "temp_store_directory", SQLITE_STATIC); + "temp_store_directory", P4_STATIC); sqlite3VdbeAddOp4(v, OP_String8, 0, 1, 0, sqlite3_temp_directory, 0); sqlite3VdbeAddOp2(v, OP_ResultRow, 1, 1); } }else{ #ifndef SQLITE_OMIT_WSD @@ -717,60 +701,10 @@ } #endif /* SQLITE_OMIT_WSD */ } }else -#if !defined(SQLITE_ENABLE_LOCKING_STYLE) -# if defined(__APPLE__) -# define SQLITE_ENABLE_LOCKING_STYLE 1 -# else -# define SQLITE_ENABLE_LOCKING_STYLE 0 -# endif -#endif -#if SQLITE_ENABLE_LOCKING_STYLE - /* - ** PRAGMA [database.]lock_proxy_file - ** PRAGMA [database.]lock_proxy_file = ":auto:"|"lock_file_path" - ** - ** Return or set the value of the lock_proxy_file flag. Changing - ** the value sets a specific file to be used for database access locks. - ** - */ - if( sqlite3StrICmp(zLeft, "lock_proxy_file")==0 ){ - if( !zRight ){ - Pager *pPager = sqlite3BtreePager(pDb->pBt); - char *proxy_file_path = NULL; - sqlite3_file *pFile = sqlite3PagerFile(pPager); - sqlite3OsFileControl(pFile, SQLITE_GET_LOCKPROXYFILE, - &proxy_file_path); - - if( proxy_file_path ){ - sqlite3VdbeSetNumCols(v, 1); - sqlite3VdbeSetColName(v, 0, COLNAME_NAME, - "lock_proxy_file", SQLITE_STATIC); - sqlite3VdbeAddOp4(v, OP_String8, 0, 1, 0, proxy_file_path, 0); - sqlite3VdbeAddOp2(v, OP_ResultRow, 1, 1); - } - }else{ - Pager *pPager = sqlite3BtreePager(pDb->pBt); - sqlite3_file *pFile = sqlite3PagerFile(pPager); - int res; - if( zRight[0] ){ - res=sqlite3OsFileControl(pFile, SQLITE_SET_LOCKPROXYFILE, - zRight); - } else { - res=sqlite3OsFileControl(pFile, SQLITE_SET_LOCKPROXYFILE, - NULL); - } - if( res!=SQLITE_OK ){ - sqlite3ErrorMsg(pParse, "failed to set lock proxy file"); - goto pragma_out; - } - } - }else -#endif /* SQLITE_ENABLE_LOCKING_STYLE */ - /* ** PRAGMA [database.]synchronous ** PRAGMA [database.]synchronous=OFF|ON|NORMAL|FULL ** ** Return or set the local value of the synchronous flag. Changing @@ -821,16 +755,16 @@ int i; int nHidden = 0; Column *pCol; sqlite3VdbeSetNumCols(v, 6); pParse->nMem = 6; - sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "cid", SQLITE_STATIC); - sqlite3VdbeSetColName(v, 1, COLNAME_NAME, "name", SQLITE_STATIC); - sqlite3VdbeSetColName(v, 2, COLNAME_NAME, "type", SQLITE_STATIC); - sqlite3VdbeSetColName(v, 3, COLNAME_NAME, "notnull", SQLITE_STATIC); - sqlite3VdbeSetColName(v, 4, COLNAME_NAME, "dflt_value", SQLITE_STATIC); - sqlite3VdbeSetColName(v, 5, COLNAME_NAME, "pk", SQLITE_STATIC); + sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "cid", P4_STATIC); + sqlite3VdbeSetColName(v, 1, COLNAME_NAME, "name", P4_STATIC); + sqlite3VdbeSetColName(v, 2, COLNAME_NAME, "type", P4_STATIC); + sqlite3VdbeSetColName(v, 3, COLNAME_NAME, "notnull", P4_STATIC); + sqlite3VdbeSetColName(v, 4, COLNAME_NAME, "dflt_value", P4_STATIC); + sqlite3VdbeSetColName(v, 5, COLNAME_NAME, "pk", P4_STATIC); sqlite3ViewGetColumnNames(pParse, pTab); for(i=0, pCol=pTab->aCol; inCol; i++, pCol++){ const Token *pDflt; if( IsHiddenColumn(pCol) ){ nHidden++; @@ -838,14 +772,12 @@ } sqlite3VdbeAddOp2(v, OP_Integer, i-nHidden, 1); sqlite3VdbeAddOp4(v, OP_String8, 0, 2, 0, pCol->zName, 0); sqlite3VdbeAddOp4(v, OP_String8, 0, 3, 0, pCol->zType ? pCol->zType : "", 0); - sqlite3VdbeAddOp2(v, OP_Integer, (pCol->notNull ? 1 : 0), 4); - if( pCol->pDflt ){ - pDflt = &pCol->pDflt->span; - assert( pDflt->z ); + sqlite3VdbeAddOp2(v, OP_Integer, pCol->notNull, 4); + if( pCol->pDflt && (pDflt = &pCol->pDflt->span)->z ){ sqlite3VdbeAddOp4(v, OP_String8, 0, 5, 0, (char*)pDflt->z, pDflt->n); }else{ sqlite3VdbeAddOp2(v, OP_Null, 0, 5); } sqlite3VdbeAddOp2(v, OP_Integer, pCol->isPrimKey, 6); @@ -862,13 +794,13 @@ if( pIdx ){ int i; pTab = pIdx->pTable; sqlite3VdbeSetNumCols(v, 3); pParse->nMem = 3; - sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "seqno", SQLITE_STATIC); - sqlite3VdbeSetColName(v, 1, COLNAME_NAME, "cid", SQLITE_STATIC); - sqlite3VdbeSetColName(v, 2, COLNAME_NAME, "name", SQLITE_STATIC); + sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "seqno", P4_STATIC); + sqlite3VdbeSetColName(v, 1, COLNAME_NAME, "cid", P4_STATIC); + sqlite3VdbeSetColName(v, 2, COLNAME_NAME, "name", P4_STATIC); for(i=0; inColumn; i++){ int cnum = pIdx->aiColumn[i]; sqlite3VdbeAddOp2(v, OP_Integer, i, 1); sqlite3VdbeAddOp2(v, OP_Integer, cnum, 2); assert( pTab->nCol>cnum ); @@ -888,13 +820,13 @@ pIdx = pTab->pIndex; if( pIdx ){ int i = 0; sqlite3VdbeSetNumCols(v, 3); pParse->nMem = 3; - sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "seq", SQLITE_STATIC); - sqlite3VdbeSetColName(v, 1, COLNAME_NAME, "name", SQLITE_STATIC); - sqlite3VdbeSetColName(v, 2, COLNAME_NAME, "unique", SQLITE_STATIC); + sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "seq", P4_STATIC); + sqlite3VdbeSetColName(v, 1, COLNAME_NAME, "name", P4_STATIC); + sqlite3VdbeSetColName(v, 2, COLNAME_NAME, "unique", P4_STATIC); while(pIdx){ sqlite3VdbeAddOp2(v, OP_Integer, i, 1); sqlite3VdbeAddOp4(v, OP_String8, 0, 2, 0, pIdx->zName, 0); sqlite3VdbeAddOp2(v, OP_Integer, pIdx->onError!=OE_None, 3); sqlite3VdbeAddOp2(v, OP_ResultRow, 1, 3); @@ -908,13 +840,13 @@ if( sqlite3StrICmp(zLeft, "database_list")==0 ){ int i; if( sqlite3ReadSchema(pParse) ) goto pragma_out; sqlite3VdbeSetNumCols(v, 3); pParse->nMem = 3; - sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "seq", SQLITE_STATIC); - sqlite3VdbeSetColName(v, 1, COLNAME_NAME, "name", SQLITE_STATIC); - sqlite3VdbeSetColName(v, 2, COLNAME_NAME, "file", SQLITE_STATIC); + sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "seq", P4_STATIC); + sqlite3VdbeSetColName(v, 1, COLNAME_NAME, "name", P4_STATIC); + sqlite3VdbeSetColName(v, 2, COLNAME_NAME, "file", P4_STATIC); for(i=0; inDb; i++){ if( db->aDb[i].pBt==0 ) continue; assert( db->aDb[i].zName!=0 ); sqlite3VdbeAddOp2(v, OP_Integer, i, 1); sqlite3VdbeAddOp4(v, OP_String8, 0, 2, 0, db->aDb[i].zName, 0); @@ -927,12 +859,12 @@ if( sqlite3StrICmp(zLeft, "collation_list")==0 ){ int i = 0; HashElem *p; sqlite3VdbeSetNumCols(v, 2); pParse->nMem = 2; - sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "seq", SQLITE_STATIC); - sqlite3VdbeSetColName(v, 1, COLNAME_NAME, "name", SQLITE_STATIC); + sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "seq", P4_STATIC); + sqlite3VdbeSetColName(v, 1, COLNAME_NAME, "name", P4_STATIC); for(p=sqliteHashFirst(&db->aCollSeq); p; p=sqliteHashNext(p)){ CollSeq *pColl = (CollSeq *)sqliteHashData(p); sqlite3VdbeAddOp2(v, OP_Integer, i++, 1); sqlite3VdbeAddOp4(v, OP_String8, 0, 2, 0, pColl->zName, 0); sqlite3VdbeAddOp2(v, OP_ResultRow, 1, 2); @@ -951,18 +883,18 @@ pFK = pTab->pFKey; if( pFK ){ int i = 0; sqlite3VdbeSetNumCols(v, 8); pParse->nMem = 8; - sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "id", SQLITE_STATIC); - sqlite3VdbeSetColName(v, 1, COLNAME_NAME, "seq", SQLITE_STATIC); - sqlite3VdbeSetColName(v, 2, COLNAME_NAME, "table", SQLITE_STATIC); - sqlite3VdbeSetColName(v, 3, COLNAME_NAME, "from", SQLITE_STATIC); - sqlite3VdbeSetColName(v, 4, COLNAME_NAME, "to", SQLITE_STATIC); - sqlite3VdbeSetColName(v, 5, COLNAME_NAME, "on_update", SQLITE_STATIC); - sqlite3VdbeSetColName(v, 6, COLNAME_NAME, "on_delete", SQLITE_STATIC); - sqlite3VdbeSetColName(v, 7, COLNAME_NAME, "match", SQLITE_STATIC); + sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "id", P4_STATIC); + sqlite3VdbeSetColName(v, 1, COLNAME_NAME, "seq", P4_STATIC); + sqlite3VdbeSetColName(v, 2, COLNAME_NAME, "table", P4_STATIC); + sqlite3VdbeSetColName(v, 3, COLNAME_NAME, "from", P4_STATIC); + sqlite3VdbeSetColName(v, 4, COLNAME_NAME, "to", P4_STATIC); + sqlite3VdbeSetColName(v, 5, COLNAME_NAME, "on_update", P4_STATIC); + sqlite3VdbeSetColName(v, 6, COLNAME_NAME, "on_delete", P4_STATIC); + sqlite3VdbeSetColName(v, 7, COLNAME_NAME, "match", P4_STATIC); while(pFK){ int j; for(j=0; jnCol; j++){ char *zCol = pFK->aCol[j].zCol; char *zOnUpdate = (char *)actionName(pFK->updateConf); @@ -1036,11 +968,11 @@ /* Initialize the VDBE program */ if( sqlite3ReadSchema(pParse) ) goto pragma_out; pParse->nMem = 6; sqlite3VdbeSetNumCols(v, 1); - sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "integrity_check", SQLITE_STATIC); + sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "integrity_check", P4_STATIC); /* Set the maximum error count */ mxErr = SQLITE_INTEGRITY_CHECK_ERROR_MAX; if( zRight ){ mxErr = atoi(zRight); @@ -1086,11 +1018,11 @@ pParse->nMem = cnt+4; } /* Do the b-tree integrity checks */ sqlite3VdbeAddOp3(v, OP_IntegrityCk, 2, cnt, 1); - sqlite3VdbeChangeP5(v, (u8)i); + sqlite3VdbeChangeP5(v, i); addr = sqlite3VdbeAddOp1(v, OP_IsNull, 2); sqlite3VdbeAddOp4(v, OP_String8, 0, 3, 0, sqlite3MPrintf(db, "*** in database %s ***\n", db->aDb[i].zName), P4_DYNAMIC); sqlite3VdbeAddOp3(v, OP_Move, 2, 4, 1); @@ -1201,30 +1133,32 @@ if( sqlite3StrICmp(zLeft, "encoding")==0 ){ static const struct EncName { char *zName; u8 enc; } encnames[] = { + { "UTF-8", SQLITE_UTF8 }, { "UTF8", SQLITE_UTF8 }, - { "UTF-8", SQLITE_UTF8 }, /* Must be element [1] */ - { "UTF-16le", SQLITE_UTF16LE }, /* Must be element [2] */ - { "UTF-16be", SQLITE_UTF16BE }, /* Must be element [3] */ + { "UTF-16le", SQLITE_UTF16LE }, { "UTF16le", SQLITE_UTF16LE }, + { "UTF-16be", SQLITE_UTF16BE }, { "UTF16be", SQLITE_UTF16BE }, { "UTF-16", 0 }, /* SQLITE_UTF16NATIVE */ { "UTF16", 0 }, /* SQLITE_UTF16NATIVE */ { 0, 0 } }; const struct EncName *pEnc; if( !zRight ){ /* "PRAGMA encoding" */ if( sqlite3ReadSchema(pParse) ) goto pragma_out; sqlite3VdbeSetNumCols(v, 1); - sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "encoding", SQLITE_STATIC); + sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "encoding", P4_STATIC); sqlite3VdbeAddOp2(v, OP_String8, 0, 1); - assert( encnames[SQLITE_UTF8].enc==SQLITE_UTF8 ); - assert( encnames[SQLITE_UTF16LE].enc==SQLITE_UTF16LE ); - assert( encnames[SQLITE_UTF16BE].enc==SQLITE_UTF16BE ); - sqlite3VdbeChangeP4(v, -1, encnames[ENC(pParse->db)].zName, P4_STATIC); + for(pEnc=&encnames[0]; pEnc->zName; pEnc++){ + if( pEnc->enc==ENC(pParse->db) ){ + sqlite3VdbeChangeP4(v, -1, pEnc->zName, P4_STATIC); + break; + } + } sqlite3VdbeAddOp2(v, OP_ResultRow, 1, 1); }else{ /* "PRAGMA encoding = XXX" */ /* Only change the value of sqlite.enc if the database handle is not ** initialized. If the main database exists, the new sqlite.enc value ** will be overwritten when the schema is next loaded. If it does not @@ -1314,11 +1248,11 @@ }; int addr = sqlite3VdbeAddOpList(v, ArraySize(readCookie), readCookie); sqlite3VdbeChangeP1(v, addr, iDb); sqlite3VdbeChangeP3(v, addr, iCookie); sqlite3VdbeSetNumCols(v, 1); - sqlite3VdbeSetColName(v, 0, COLNAME_NAME, zLeft, SQLITE_TRANSIENT); + sqlite3VdbeSetColName(v, 0, COLNAME_NAME, zLeft, P4_TRANSIENT); } }else #endif /* SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS */ #if defined(SQLITE_DEBUG) || defined(SQLITE_TEST) @@ -1328,14 +1262,15 @@ if( sqlite3StrICmp(zLeft, "lock_status")==0 ){ static const char *const azLockName[] = { "unlocked", "shared", "reserved", "pending", "exclusive" }; int i; + Vdbe *v = sqlite3GetVdbe(pParse); sqlite3VdbeSetNumCols(v, 2); pParse->nMem = 2; - sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "database", SQLITE_STATIC); - sqlite3VdbeSetColName(v, 1, COLNAME_NAME, "status", SQLITE_STATIC); + sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "database", P4_STATIC); + sqlite3VdbeSetColName(v, 1, COLNAME_NAME, "status", P4_STATIC); for(i=0; inDb; i++){ Btree *pBt; Pager *pPager; const char *zState = "unknown"; int j; @@ -1365,30 +1300,12 @@ sqlite3CreateStatementsTable(pParse); }else #endif #if SQLITE_HAS_CODEC - if( sqlite3StrICmp(zLeft, "key")==0 && zRight ){ - sqlite3_key(db, zRight, sqlite3Strlen30(zRight)); - }else - if( sqlite3StrICmp(zLeft, "rekey")==0 && zRight ){ - sqlite3_rekey(db, zRight, sqlite3Strlen30(zRight)); - }else - if( zRight && (sqlite3StrICmp(zLeft, "hexkey")==0 || - sqlite3StrICmp(zLeft, "hexrekey")==0) ){ - int i, h1, h2; - char zKey[40]; - for(i=0; (h1 = zRight[i])!=0 && (h2 = zRight[i+1])!=0; i+=2){ - h1 += 9*(1&(h1>>6)); - h2 += 9*(1&(h2>>6)); - zKey[i/2] = (h2 & 0x0f) | ((h1 & 0xf)<<4); - } - if( (zLeft[3] & 0xf)==0xb ){ - sqlite3_key(db, zKey, i/2); - }else{ - sqlite3_rekey(db, zKey, i/2); - } + if( sqlite3StrICmp(zLeft, "key")==0 ){ + sqlite3_key(db, zRight, strlen(zRight)); }else #endif #if SQLITE_HAS_CODEC || defined(SQLITE_ENABLE_CEROD) if( sqlite3StrICmp(zLeft, "activate_extensions")==0 ){ #if SQLITE_HAS_CODEC @@ -1401,33 +1318,34 @@ if( sqlite3StrNICmp(zRight, "cerod-", 6)==0 ){ extern void sqlite3_activate_cerod(const char*); sqlite3_activate_cerod(&zRight[6]); } #endif - }else -#endif - - - {/* Empty ELSE clause */} - - /* Code an OP_Expire at the end of each PRAGMA program to cause - ** the VDBE implementing the pragma to expire. Most (all?) pragmas - ** are only valid for a single execution. - */ - sqlite3VdbeAddOp2(v, OP_Expire, 1, 0); - - /* - ** Reset the safety level, in case the fullfsync flag or synchronous - ** setting changed. - */ -#ifndef SQLITE_OMIT_PAGER_PRAGMAS - if( db->autoCommit ){ - sqlite3BtreeSetSafetyLevel(pDb->pBt, pDb->safety_level, - (db->flags&SQLITE_FullFSync)!=0); - } -#endif + } +#endif + + {} + + if( v ){ + /* Code an OP_Expire at the end of each PRAGMA program to cause + ** the VDBE implementing the pragma to expire. Most (all?) pragmas + ** are only valid for a single execution. + */ + sqlite3VdbeAddOp2(v, OP_Expire, 1, 0); + + /* + ** Reset the safety level, in case the fullfsync flag or synchronous + ** setting changed. + */ +#ifndef SQLITE_OMIT_PAGER_PRAGMAS + if( db->autoCommit ){ + sqlite3BtreeSetSafetyLevel(pDb->pBt, pDb->safety_level, + (db->flags&SQLITE_FullFSync)!=0); + } +#endif + } pragma_out: sqlite3DbFree(db, zLeft); sqlite3DbFree(db, zRight); } #endif /* SQLITE_OMIT_PRAGMA || SQLITE_OMIT_PARSER */ Index: src/prepare.c ================================================================== --- src/prepare.c +++ src/prepare.c @@ -11,13 +11,14 @@ ************************************************************************* ** This file contains the implementation of the sqlite3_prepare() ** interface, and routines that contribute to loading the database schema ** from disk. ** -** $Id: prepare.c,v 1.105 2009/01/20 16:53:41 danielk1977 Exp $ +** $Id: prepare.c,v 1.97 2008/09/08 09:06:19 danielk1977 Exp $ */ #include "sqliteInt.h" +#include /* ** Fill the InitData structure with an error message that indicates ** that the database is corrupt. */ @@ -49,24 +50,23 @@ ** argv[0] = name of thing being created ** argv[1] = root page number for table or index. 0 for trigger or view. ** argv[2] = SQL text for the CREATE statement. ** */ -int sqlite3InitCallback(void *pInit, int argc, char **argv, char **NotUsed){ +int sqlite3InitCallback(void *pInit, int argc, char **argv, char **azColName){ InitData *pData = (InitData*)pInit; sqlite3 *db = pData->db; int iDb = pData->iDb; - assert( argc==3 ); - UNUSED_PARAMETER2(NotUsed, argc); assert( sqlite3_mutex_held(db->mutex) ); DbClearProperty(db, iDb, DB_Empty); if( db->mallocFailed ){ corruptSchema(pData, argv[0], 0); return SQLITE_NOMEM; } + assert( argc==3 ); assert( iDb>=0 && iDbnDb ); if( argv==0 ) return 0; /* Might happen if EMPTY_RESULT_CALLBACKS are on */ if( argv[1]==0 ){ corruptSchema(pData, argv[0], 0); }else if( argv[2] && argv[2][0] ){ @@ -242,11 +242,11 @@ ** Note: The #defined SQLITE_UTF* symbols in sqliteInt.h correspond to ** the possible values of meta[4]. */ if( rc==SQLITE_OK ){ int i; - for(i=0; ipBt, i+1, (u32 *)&meta[i]); if( rc ){ sqlite3SetString(pzErrMsg, db, "%s", sqlite3ErrStr(rc)); goto initone_error_out; } @@ -292,11 +292,11 @@ ** file_format==1 Version 3.0.0. ** file_format==2 Version 3.1.3. // ALTER TABLE ADD COLUMN ** file_format==3 Version 3.1.4. // ditto but with non-NULL defaults ** file_format==4 Version 3.3.0. // DESC indices. Boolean constants */ - pDb->pSchema->file_format = (u8)meta[1]; + pDb->pSchema->file_format = meta[1]; if( pDb->pSchema->file_format==0 ){ pDb->pSchema->file_format = 1; } if( pDb->pSchema->file_format>SQLITE_MAX_FILE_FORMAT ){ sqlite3SetString(pzErrMsg, db, "unsupported file format"); @@ -498,22 +498,22 @@ ** expr.c is trying to resolve a reference to a transient table (i.e. one ** created by a sub-select). In this case the return value of this ** function should never be used. ** ** We return -1000000 instead of the more usual -1 simply because using - ** -1000000 as the incorrect index into db->aDb[] is much + ** -1000000 as incorrectly using -1000000 index into db->aDb[] is much ** more likely to cause a segfault than -1 (of course there are assert() ** statements too, but it never hurts to play the odds). */ assert( sqlite3_mutex_held(db->mutex) ); if( pSchema ){ - for(i=0; ALWAYS(inDb); i++){ + for(i=0; inDb; i++){ if( db->aDb[i].pSchema==pSchema ){ break; } } - assert( i>=0 && inDb ); + assert( i>=0 &&i>=0 && inDb ); } return i; } /* @@ -544,10 +544,11 @@ ** compilation. Instead return SQLITE_LOCKED immediately. */ for(i=0; inDb; i++) { Btree *pBt = db->aDb[i].pBt; if( pBt ){ + int rc; rc = sqlite3BtreeSchemaLocked(pBt); if( rc ){ const char *zDb = db->aDb[i].zName; sqlite3Error(db, SQLITE_LOCKED, "database schema is locked: %s", zDb); (void)sqlite3SafetyOff(db); @@ -598,33 +599,33 @@ #ifndef SQLITE_OMIT_EXPLAIN if( rc==SQLITE_OK && sParse.pVdbe && sParse.explain ){ if( sParse.explain==2 ){ sqlite3VdbeSetNumCols(sParse.pVdbe, 3); - sqlite3VdbeSetColName(sParse.pVdbe, 0, COLNAME_NAME, "order", SQLITE_STATIC); - sqlite3VdbeSetColName(sParse.pVdbe, 1, COLNAME_NAME, "from", SQLITE_STATIC); - sqlite3VdbeSetColName(sParse.pVdbe, 2, COLNAME_NAME, "detail", SQLITE_STATIC); + sqlite3VdbeSetColName(sParse.pVdbe, 0, COLNAME_NAME, "order", P4_STATIC); + sqlite3VdbeSetColName(sParse.pVdbe, 1, COLNAME_NAME, "from", P4_STATIC); + sqlite3VdbeSetColName(sParse.pVdbe, 2, COLNAME_NAME, "detail", P4_STATIC); }else{ sqlite3VdbeSetNumCols(sParse.pVdbe, 8); - sqlite3VdbeSetColName(sParse.pVdbe, 0, COLNAME_NAME, "addr", SQLITE_STATIC); - sqlite3VdbeSetColName(sParse.pVdbe, 1, COLNAME_NAME, "opcode", SQLITE_STATIC); - sqlite3VdbeSetColName(sParse.pVdbe, 2, COLNAME_NAME, "p1", SQLITE_STATIC); - sqlite3VdbeSetColName(sParse.pVdbe, 3, COLNAME_NAME, "p2", SQLITE_STATIC); - sqlite3VdbeSetColName(sParse.pVdbe, 4, COLNAME_NAME, "p3", SQLITE_STATIC); - sqlite3VdbeSetColName(sParse.pVdbe, 5, COLNAME_NAME, "p4", SQLITE_STATIC); - sqlite3VdbeSetColName(sParse.pVdbe, 6, COLNAME_NAME, "p5", SQLITE_STATIC); - sqlite3VdbeSetColName(sParse.pVdbe, 7, COLNAME_NAME, "comment", SQLITE_STATIC); + sqlite3VdbeSetColName(sParse.pVdbe, 0, COLNAME_NAME, "addr", P4_STATIC); + sqlite3VdbeSetColName(sParse.pVdbe, 1, COLNAME_NAME, "opcode", P4_STATIC); + sqlite3VdbeSetColName(sParse.pVdbe, 2, COLNAME_NAME, "p1", P4_STATIC); + sqlite3VdbeSetColName(sParse.pVdbe, 3, COLNAME_NAME, "p2", P4_STATIC); + sqlite3VdbeSetColName(sParse.pVdbe, 4, COLNAME_NAME, "p3", P4_STATIC); + sqlite3VdbeSetColName(sParse.pVdbe, 5, COLNAME_NAME, "p4", P4_STATIC); + sqlite3VdbeSetColName(sParse.pVdbe, 6, COLNAME_NAME, "p5", P4_STATIC); + sqlite3VdbeSetColName(sParse.pVdbe, 7, COLNAME_NAME, "comment",P4_STATIC); } } #endif if( sqlite3SafetyOff(db) ){ rc = SQLITE_MISUSE; } if( saveSqlFlag ){ - sqlite3VdbeSetSql(sParse.pVdbe, zSql, (int)(sParse.zTail - zSql)); + sqlite3VdbeSetSql(sParse.pVdbe, zSql, sParse.zTail - zSql); } if( rc!=SQLITE_OK || db->mallocFailed ){ sqlite3_finalize((sqlite3_stmt*)sParse.pVdbe); assert(!(*ppStmt)); }else{ @@ -763,11 +764,11 @@ /* If sqlite3_prepare returns a tail pointer, we calculate the ** equivalent pointer into the UTF-16 string by counting the unicode ** characters between zSql8 and zTail8, and then returning a pointer ** the same number of characters into the UTF-16 string. */ - int chars_parsed = sqlite3Utf8CharLen(zSql8, (int)(zTail8-zSql8)); + int chars_parsed = sqlite3Utf8CharLen(zSql8, zTail8-zSql8); *pzTail = (u8 *)zSql + sqlite3Utf16ByteLen(zSql, chars_parsed); } sqlite3DbFree(db, zSql8); rc = sqlite3ApiExit(db, rc); sqlite3_mutex_leave(db->mutex); Index: src/printf.c ================================================================== --- src/printf.c +++ src/printf.c @@ -3,11 +3,11 @@ ** the public domain. The original comments are included here for ** completeness. They are very out-of-date but might be useful as ** an historical reference. Most of the "enhancements" have been backed ** out so that the functionality is now the same as standard printf(). ** -** $Id: printf.c,v 1.99 2008/12/10 19:26:24 drh Exp $ +** $Id: printf.c,v 1.94 2008/08/22 14:08:36 drh Exp $ ** ************************************************************************** ** ** The following modules is an enhanced replacement for the "printf" subroutines ** found in the standard C library. The following enhancements are @@ -135,10 +135,11 @@ { 'p', 16, 0, etPOINTER, 0, 1 }, { 'T', 0, 2, etTOKEN, 0, 0 }, { 'S', 0, 2, etSRCLIST, 0, 0 }, { 'r', 10, 3, etORDINAL, 0, 0 }, }; +#define etNINFO (sizeof(fmtinfo)/sizeof(fmtinfo[0])) /* ** If SQLITE_OMIT_FLOATING_POINT is defined, then none of the floating point ** conversions will work. */ @@ -154,28 +155,28 @@ ** ** The counter *cnt is incremented each time. After counter exceeds ** 16 (the number of significant digits in a 64-bit float) '0' is ** always returned. */ -static char et_getdigit(LONGDOUBLE_TYPE *val, int *cnt){ +static int et_getdigit(LONGDOUBLE_TYPE *val, int *cnt){ int digit; LONGDOUBLE_TYPE d; if( (*cnt)++ >= 16 ) return '0'; digit = (int)*val; d = digit; digit += '0'; *val = (*val - d)*10.0; - return (char)digit; + return digit; } #endif /* SQLITE_OMIT_FLOATING_POINT */ /* ** Append N space characters to the given string buffer. */ static void appendSpace(StrAccum *pAccum, int N){ static const char zSpaces[] = " "; - while( N>=(int)sizeof(zSpaces)-1 ){ + while( N>=sizeof(zSpaces)-1 ){ sqlite3StrAccumAppend(pAccum, zSpaces, sizeof(zSpaces)-1); N -= sizeof(zSpaces)-1; } if( N>0 ){ sqlite3StrAccumAppend(pAccum, zSpaces, N); @@ -243,11 +244,11 @@ sqlite_uint64 longvalue; /* Value for integer types */ LONGDOUBLE_TYPE realvalue; /* Value for real types */ const et_info *infop; /* Pointer to the appropriate info structure */ char buf[etBUFSIZE]; /* Conversion buffer */ char prefix; /* Prefix character. "+" or "-" or " " or '\0'. */ - etByte xtype = 0; /* Conversion paradigm */ + etByte xtype; /* Conversion paradigm */ char *zExtra; /* Extra memory used for etTCLESCAPE conversions */ #ifndef SQLITE_OMIT_FLOATING_POINT int exp, e2; /* exponent of real numbers */ double rounder; /* Used for rounding floating point values */ etByte flag_dp; /* True if decimal point should be shown */ @@ -334,11 +335,11 @@ }else{ flag_long = flag_longlong = 0; } /* Fetch the info entry for the field */ infop = 0; - for(idx=0; idxflags & FLAG_INTERN)==0 ){ xtype = infop->type; }else{ @@ -411,11 +412,11 @@ precision = width-(prefix!=0); } bufpt = &buf[etBUFSIZE-1]; if( xtype==etORDINAL ){ static const char zOrd[] = "thstndrd"; - int x = (int)(longvalue % 10); + int x = longvalue % 10; if( x>=4 || (longvalue/10)%10==1 ){ x = 0; } buf[etBUFSIZE-3] = zOrd[x*2]; buf[etBUFSIZE-2] = zOrd[x*2+1]; @@ -429,11 +430,11 @@ do{ /* Convert to ascii */ *(--bufpt) = cset[longvalue%base]; longvalue = longvalue/base; }while( longvalue>0 ); } - length = (int)(&buf[etBUFSIZE-1]-bufpt); + length = &buf[etBUFSIZE-1]-bufpt; for(idx=precision-length; idx>0; idx--){ *(--bufpt) = '0'; /* Zero pad */ } if( prefix ) *(--bufpt) = prefix; /* Add sign */ if( flag_alternateform && infop->prefix ){ /* Add "0" or "0x" */ @@ -440,11 +441,11 @@ const char *pre; char x; pre = &aPrefix[infop->prefix]; for(; (x=(*pre))!=0; pre++) *(--bufpt) = x; } - length = (int)(&buf[etBUFSIZE-1]-bufpt); + length = &buf[etBUFSIZE-1]-bufpt; break; case etFLOAT: case etEXP: case etGENERIC: realvalue = va_arg(ap,double); @@ -468,11 +469,11 @@ for(idx=precision, rounder=0.5; idx>0; idx--, rounder*=0.1){} #endif if( xtype==etFLOAT ) realvalue += rounder; /* Normalize realvalue to within 10.0 > realvalue >= 1.0 */ exp = 0; - if( sqlite3IsNaN((double)realvalue) ){ + if( sqlite3IsNaN(realvalue) ){ bufpt = "NaN"; length = 3; break; } if( realvalue>0.0 ){ @@ -487,11 +488,11 @@ }else if( prefix=='+' ){ bufpt = "+Inf"; }else{ bufpt = "Inf"; } - length = sqlite3Strlen30(bufpt); + length = strlen(bufpt); break; } } bufpt = buf; /* @@ -518,11 +519,11 @@ e2 = 0; }else{ e2 = exp; } nsd = 0; - flag_dp = (precision>0 ?1:0) | flag_alternateform | flag_altform2; + flag_dp = (precision>0) | flag_alternateform | flag_altform2; /* The sign in front of the number */ if( prefix ){ *(bufpt++) = prefix; } /* Digits prior to the decimal point */ @@ -566,22 +567,22 @@ *(bufpt++) = '-'; exp = -exp; }else{ *(bufpt++) = '+'; } if( exp>=100 ){ - *(bufpt++) = (char)((exp/100)+'0'); /* 100's digit */ + *(bufpt++) = (exp/100)+'0'; /* 100's digit */ exp %= 100; } - *(bufpt++) = (char)(exp/10+'0'); /* 10's digit */ - *(bufpt++) = (char)(exp%10+'0'); /* 1's digit */ + *(bufpt++) = exp/10+'0'; /* 10's digit */ + *(bufpt++) = exp%10+'0'; /* 1's digit */ } *bufpt = 0; /* The converted number is in buf[] and zero terminated. Output it. ** Note that the number is in the usual order, not reversed as with ** integer conversions. */ - length = (int)(bufpt-buf); + length = bufpt-buf; bufpt = buf; /* Special case: Add leading zeros if the flag_zeropad flag is ** set and we are not left justified */ if( flag_zeropad && !flag_leftjustify && length < width){ @@ -604,14 +605,13 @@ buf[0] = '%'; bufpt = buf; length = 1; break; case etCHARX: - c = va_arg(ap,int); - buf[0] = (char)c; + c = buf[0] = va_arg(ap,int); if( precision>=0 ){ - for(idx=1; idx=0 ){ for(length=0; lengthetBUFSIZE ){ bufpt = zExtra = sqlite3Malloc( n ); - if( bufpt==0 ){ - pAccum->mallocFailed = 1; - return; - } + if( bufpt==0 ) return; }else{ bufpt = buf; } j = 0; if( needQuote ) bufpt[j++] = q; @@ -723,13 +719,13 @@ void sqlite3StrAccumAppend(StrAccum *p, const char *z, int N){ if( p->tooBig | p->mallocFailed ){ return; } if( N<0 ){ - N = sqlite3Strlen30(z); + N = strlen(z); } - if( N==0 || z==0 ){ + if( N==0 ){ return; } if( p->nChar+N >= p->nAlloc ){ char *zNew; if( !p->useMalloc ){ @@ -744,11 +740,11 @@ if( szNew > p->mxAlloc ){ sqlite3StrAccumReset(p); p->tooBig = 1; return; }else{ - p->nAlloc = (int)szNew; + p->nAlloc = szNew; } zNew = sqlite3DbMallocRaw(p->db, p->nAlloc ); if( zNew ){ memcpy(zNew, p->zText, p->nChar); sqlite3StrAccumReset(p); Index: src/random.c ================================================================== --- src/random.c +++ src/random.c @@ -13,11 +13,11 @@ ** generator (PRNG) for SQLite. ** ** Random numbers are used by some of the database backends in order ** to generate random integer keys for tables or random filenames. ** -** $Id: random.c,v 1.29 2008/12/10 19:26:24 drh Exp $ +** $Id: random.c,v 1.27 2008/10/07 15:25:48 drh Exp $ */ #include "sqliteInt.h" /* All threads share a single random number generator. @@ -25,11 +25,11 @@ */ static SQLITE_WSD struct sqlite3PrngType { unsigned char isInit; /* True if initialized */ unsigned char i, j; /* State variables */ unsigned char s[256]; /* State variables */ -} sqlite3Prng; +} sqlite3Prng = { 0, }; /* ** Get a single 8-bit random value from the RC4 PRNG. The Mutex ** must be held while executing this routine. ** @@ -43,11 +43,11 @@ ** on RC4, which we know works very well. ** ** (Later): Actually, OP_NewRowid does not depend on a good source of ** randomness any more. But we will leave this code in all the same. */ -static u8 randomByte(void){ +static int randomByte(void){ unsigned char t; /* The "wsdPrng" macro will resolve to the pseudo-random number generator ** state vector. If writable static data is unsupported on the target, @@ -77,11 +77,11 @@ char k[256]; wsdPrng.j = 0; wsdPrng.i = 0; sqlite3OsRandomness(sqlite3_vfs_find(0), 256, k); for(i=0; i<256; i++){ - wsdPrng.s[i] = (u8)i; + wsdPrng.s[i] = i; } for(i=0; i<256; i++){ wsdPrng.j += wsdPrng.s[i] + k[i]; t = wsdPrng.s[wsdPrng.j]; wsdPrng.s[wsdPrng.j] = wsdPrng.s[i]; @@ -124,11 +124,11 @@ ** those tasks. ** ** The sqlite3_test_control() interface calls these routines to ** control the PRNG. */ -static SQLITE_WSD struct sqlite3PrngType sqlite3SavedPrng; +static SQLITE_WSD struct sqlite3PrngType sqlite3SavedPrng = { 0, }; void sqlite3PrngSaveState(void){ memcpy( &GLOBAL(struct sqlite3PrngType, sqlite3SavedPrng), &GLOBAL(struct sqlite3PrngType, sqlite3Prng), sizeof(sqlite3Prng) Index: src/resolve.c ================================================================== --- src/resolve.c +++ src/resolve.c @@ -12,11 +12,11 @@ ** ** This file contains routines used for walking the parser tree and ** resolve all identifiers by associating them with a particular ** table and column. ** -** $Id: resolve.c,v 1.15 2008/12/10 19:26:24 drh Exp $ +** $Id: resolve.c,v 1.9 2008/10/11 16:47:36 drh Exp $ */ #include "sqliteInt.h" #include #include @@ -67,11 +67,11 @@ if( pDup==0 ) return; if( pDup->op!=TK_COLUMN && zType[0]!='G' ){ pDup = sqlite3PExpr(pParse, TK_AS, pDup, 0, 0); if( pDup==0 ) return; if( pEList->a[iCol].iAlias==0 ){ - pEList->a[iCol].iAlias = (u16)(++pParse->nAlias); + pEList->a[iCol].iAlias = ++pParse->nAlias; } pDup->iTable = pEList->a[iCol].iAlias; } if( pExpr->flags & EP_ExpCollate ){ pDup->pColl = pExpr->pColl; @@ -217,11 +217,11 @@ ** it is a new.* or old.* trigger argument reference */ if( zDb==0 && zTab!=0 && cnt==0 && pParse->trigStack!=0 ){ TriggerStack *pTriggerStack = pParse->trigStack; Table *pTab = 0; - u32 *piColMask = 0; + u32 *piColMask; if( pTriggerStack->newIdx != -1 && sqlite3StrICmp("new", zTab) == 0 ){ pExpr->iTable = pTriggerStack->newIdx; assert( pTriggerStack->pTab ); pTab = pTriggerStack->pTab; piColMask = &(pTriggerStack->newColMask); @@ -318,11 +318,10 @@ ** fields are not changed in any context. */ if( cnt==0 && zTab==0 && pColumnToken->z[0]=='"' ){ sqlite3DbFree(db, zCol); pExpr->op = TK_STRING; - pExpr->pTab = 0; return 0; } /* ** cnt==0 means there was not match. cnt>1 means there were two or @@ -347,13 +346,13 @@ ** column number is greater than the number of bits in the bitmask ** then set the high-order bit of the bitmask. */ if( pExpr->iColumn>=0 && pMatch!=0 ){ int n = pExpr->iColumn; - testcase( n==BMS-1 ); - if( n>=BMS ){ - n = BMS-1; + testcase( n==sizeof(Bitmask)*8-1 ); + if( n>=sizeof(Bitmask)*8 ){ + n = sizeof(Bitmask)*8-1; } assert( pMatch->iCursor==pExpr->iTable ); pMatch->colUsed |= ((Bitmask)1)<db); /* The database encoding */ + int enc = ENC(pParse->db); /* The database encoding */ zId = (char*)pExpr->token.z; nId = pExpr->token.n; pDef = sqlite3FindFunction(pParse->db, zId, nId, n, enc, 0); if( pDef==0 ){ @@ -754,11 +753,11 @@ pItem->pExpr = pE = sqlite3Expr(db, TK_INTEGER, 0, 0, 0); if( pE==0 ) return 1; pE->pColl = pColl; pE->flags |= EP_IntValue | flags; pE->iTable = iCol; - pItem->iCol = (u16)iCol; + pItem->iCol = iCol; pItem->done = 1; }else{ moreToDo = 1; } } @@ -858,11 +857,11 @@ if( iCol>0 ){ /* If an AS-name match is found, mark this ORDER BY column as being ** a copy of the iCol-th result-set column. The subsequent call to ** sqlite3ResolveOrderGroupBy() will convert the expression to a ** copy of the iCol-th result-set expression. */ - pItem->iCol = (u16)iCol; + pItem->iCol = iCol; continue; } if( sqlite3ExprIsInteger(pE, &iCol) ){ /* The ORDER BY term is an integer constant. Again, set the column ** number so that sqlite3ResolveOrderGroupBy() will convert the @@ -869,11 +868,11 @@ ** order-by term to a copy of the result-set expression */ if( iCol<1 ){ resolveOutOfRangeError(pParse, zType, i+1, nResult); return 1; } - pItem->iCol = (u16)iCol; + pItem->iCol = iCol; continue; } /* Otherwise, treat the ORDER BY term as an ordinary expression */ pItem->iCol = 0; @@ -961,11 +960,11 @@ for(i=0; ipSrc->nSrc; i++){ struct SrcList_item *pItem = &p->pSrc->a[i]; if( pItem->pSelect ){ const char *zSavedContext = pParse->zAuthContext; if( pItem->zName ) pParse->zAuthContext = pItem->zName; - sqlite3ResolveSelectNames(pParse, pItem->pSelect, pOuterNC); + sqlite3ResolveSelectNames(pParse, pItem->pSelect, &sNC); pParse->zAuthContext = zSavedContext; if( pParse->nErr || db->mallocFailed ) return WRC_Abort; } } DELETED src/rowset.c Index: src/rowset.c ================================================================== --- src/rowset.c +++ /dev/null @@ -1,238 +0,0 @@ -/* -** 2008 December 3 -** -** 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 module implements an object we call a "Row Set". -** -** The RowSet object is a bag of rowids. Rowids -** are inserted into the bag in an arbitrary order. Then they are -** pulled from the bag in sorted order. Rowids only appear in the -** bag once. If the same rowid is inserted multiple times, the -** second and subsequent inserts make no difference on the output. -** -** This implementation accumulates rowids in a linked list. For -** output, it first sorts the linked list (removing duplicates during -** the sort) then returns elements one by one by walking the list. -** -** Big chunks of rowid/next-ptr pairs are allocated at a time, to -** reduce the malloc overhead. -** -** $Id: rowset.c,v 1.3 2009/01/13 20:14:16 drh Exp $ -*/ -#include "sqliteInt.h" - -/* -** The number of rowset entries per allocation chunk. -*/ -#define ROWSET_ENTRY_PER_CHUNK 63 - -/* -** Each entry in a RowSet is an instance of the following -** structure: -*/ -struct RowSetEntry { - i64 v; /* ROWID value for this entry */ - struct RowSetEntry *pNext; /* Next entry on a list of all entries */ -}; - -/* -** Index entries are allocated in large chunks (instances of the -** following structure) to reduce memory allocation overhead. The -** chunks are kept on a linked list so that they can be deallocated -** when the RowSet is destroyed. -*/ -struct RowSetChunk { - struct RowSetChunk *pNext; /* Next chunk on list of them all */ - struct RowSetEntry aEntry[ROWSET_ENTRY_PER_CHUNK]; /* Allocated entries */ -}; - -/* -** A RowSet in an instance of the following structure. -** -** A typedef of this structure if found in sqliteInt.h. -*/ -struct RowSet { - struct RowSetChunk *pChunk; /* List of all chunk allocations */ - sqlite3 *db; /* The database connection */ - struct RowSetEntry *pEntry; /* List of entries in the rowset */ - struct RowSetEntry *pLast; /* Last entry on the pEntry list */ - struct RowSetEntry *pFresh; /* Source of new entry objects */ - u16 nFresh; /* Number of objects on pFresh */ - u8 isSorted; /* True if content is sorted */ -}; - -/* -** Turn bulk memory into a RowSet object. N bytes of memory -** are available at pSpace. The db pointer is used as a memory context -** for any subsequent allocations that need to occur. -** Return a pointer to the new RowSet object. -** -** It must be the case that N is sufficient to make a Rowset. If not -** an assertion fault occurs. -** -** If N is larger than the minimum, use the surplus as an initial -** allocation of entries available to be filled. -*/ -RowSet *sqlite3RowSetInit(sqlite3 *db, void *pSpace, unsigned int N){ - RowSet *p; - assert( N >= sizeof(*p) ); - p = pSpace; - p->pChunk = 0; - p->db = db; - p->pEntry = 0; - p->pLast = 0; - p->pFresh = (struct RowSetEntry*)&p[1]; - p->nFresh = (u16)((N - sizeof(*p))/sizeof(struct RowSetEntry)); - p->isSorted = 1; - return p; -} - -/* -** Deallocate all chunks from a RowSet. -*/ -void sqlite3RowSetClear(RowSet *p){ - struct RowSetChunk *pChunk, *pNextChunk; - for(pChunk=p->pChunk; pChunk; pChunk = pNextChunk){ - pNextChunk = pChunk->pNext; - sqlite3DbFree(p->db, pChunk); - } - p->pChunk = 0; - p->nFresh = 0; - p->pEntry = 0; - p->pLast = 0; - p->isSorted = 1; -} - -/* -** Insert a new value into a RowSet. -** -** The mallocFailed flag of the database connection is set if a -** memory allocation fails. -*/ -void sqlite3RowSetInsert(RowSet *p, i64 rowid){ - struct RowSetEntry *pEntry; - struct RowSetEntry *pLast; - if( p==0 ) return; /* Must have been a malloc failure */ - if( p->nFresh==0 ){ - struct RowSetChunk *pNew; - pNew = sqlite3DbMallocRaw(p->db, sizeof(*pNew)); - if( pNew==0 ){ - return; - } - pNew->pNext = p->pChunk; - p->pChunk = pNew; - p->pFresh = pNew->aEntry; - p->nFresh = ROWSET_ENTRY_PER_CHUNK; - } - pEntry = p->pFresh++; - p->nFresh--; - pEntry->v = rowid; - pEntry->pNext = 0; - pLast = p->pLast; - if( pLast ){ - if( p->isSorted && rowid<=pLast->v ){ - p->isSorted = 0; - } - pLast->pNext = pEntry; - }else{ - assert( p->pEntry==0 ); - p->pEntry = pEntry; - } - p->pLast = pEntry; -} - -/* -** Merge two lists of RowSet entries. Remove duplicates. -** -** The input lists are assumed to be in sorted order. -*/ -static struct RowSetEntry *boolidxMerge( - struct RowSetEntry *pA, /* First sorted list to be merged */ - struct RowSetEntry *pB /* Second sorted list to be merged */ -){ - struct RowSetEntry head; - struct RowSetEntry *pTail; - - pTail = &head; - while( pA && pB ){ - assert( pA->pNext==0 || pA->v<=pA->pNext->v ); - assert( pB->pNext==0 || pB->v<=pB->pNext->v ); - if( pA->vv ){ - pTail->pNext = pA; - pA = pA->pNext; - pTail = pTail->pNext; - }else if( pB->vv ){ - pTail->pNext = pB; - pB = pB->pNext; - pTail = pTail->pNext; - }else{ - pA = pA->pNext; - } - } - if( pA ){ - assert( pA->pNext==0 || pA->v<=pA->pNext->v ); - pTail->pNext = pA; - }else{ - assert( pB==0 || pB->pNext==0 || pB->v<=pB->pNext->v ); - pTail->pNext = pB; - } - return head.pNext; -} - -/* -** Sort all elements of the RowSet into ascending order. -*/ -static void sqlite3RowSetSort(RowSet *p){ - unsigned int i; - struct RowSetEntry *pEntry; - struct RowSetEntry *aBucket[40]; - - assert( p->isSorted==0 ); - memset(aBucket, 0, sizeof(aBucket)); - while( p->pEntry ){ - pEntry = p->pEntry; - p->pEntry = pEntry->pNext; - pEntry->pNext = 0; - for(i=0; aBucket[i]; i++){ - pEntry = boolidxMerge(aBucket[i],pEntry); - aBucket[i] = 0; - } - aBucket[i] = pEntry; - } - pEntry = 0; - for(i=0; ipEntry = pEntry; - p->pLast = 0; - p->isSorted = 1; -} - -/* -** Extract the next (smallest) element from the RowSet. -** Write the element into *pRowid. Return 1 on success. Return -** 0 if the RowSet is already empty. -*/ -int sqlite3RowSetNext(RowSet *p, i64 *pRowid){ - if( !p->isSorted ){ - sqlite3RowSetSort(p); - } - if( p->pEntry ){ - *pRowid = p->pEntry->v; - p->pEntry = p->pEntry->pNext; - if( p->pEntry==0 ){ - sqlite3RowSetClear(p); - } - return 1; - }else{ - return 0; - } -} Index: src/select.c ================================================================== --- src/select.c +++ src/select.c @@ -10,11 +10,11 @@ ** ************************************************************************* ** This file contains C code routines that are called by the parser ** to handle SELECT statements in SQLite. ** -** $Id: select.c,v 1.499 2009/02/09 13:19:28 drh Exp $ +** $Id: select.c,v 1.480 2008/10/07 19:53:14 drh Exp $ */ #include "sqliteInt.h" /* @@ -35,11 +35,11 @@ /* ** Initialize a SelectDest structure. */ void sqlite3SelectDestInit(SelectDest *pDest, int eDest, int iParm){ - pDest->eDest = (u8)eDest; + pDest->eDest = eDest; pDest->iParm = iParm; pDest->affinity = 0; pDest->iMem = 0; pDest->nMem = 0; } @@ -63,11 +63,11 @@ ){ Select *pNew; Select standin; sqlite3 *db = pParse->db; pNew = sqlite3DbMallocZero(db, sizeof(*pNew) ); - assert( db->mallocFailed || !pOffset || pLimit ); /* OFFSET implies LIMIT */ + assert( !pOffset || pLimit ); /* Can't have OFFSET without LIMIT. */ if( pNew==0 ){ pNew = &standin; memset(pNew, 0, sizeof(*pNew)); } if( pEList==0 ){ @@ -142,18 +142,18 @@ apAll[0] = pA; apAll[1] = pB; apAll[2] = pC; for(i=0; i<3 && apAll[i]; i++){ p = apAll[i]; - for(j=0; jn==keywords[j].nChar && sqlite3StrNICmp((char*)p->z, keywords[j].zKeyword, p->n)==0 ){ jointype |= keywords[j].code; break; } } - if( j>=ArraySize(keywords) ){ + if( j>=sizeof(keywords)/sizeof(keywords[0]) ){ jointype |= JT_ERROR; break; } } if( @@ -189,11 +189,11 @@ /* ** Set the value of a token to a '\000'-terminated string. */ static void setToken(Token *p, const char *z){ p->z = (u8*)z; - p->n = z ? sqlite3Strlen30(z) : 0; + p->n = z ? strlen(z) : 0; p->dyn = 0; } /* ** Set the token to the double-quoted and escaped version of the string pointed @@ -218,17 +218,17 @@ if( *z2 ){ /* String contains " characters - copy and quote the string. */ p->z = (u8 *)sqlite3MPrintf(pParse->db, "\"%w\"", z); if( p->z ){ - p->n = sqlite3Strlen30((char *)p->z); + p->n = strlen((char *)p->z); p->dyn = 1; } }else{ /* String contains no " characters - copy the pointer. */ p->z = (u8*)z; - p->n = (int)(z2 - z); + p->n = (z2 - z); p->dyn = 0; } } /* @@ -340,11 +340,11 @@ for(i=0; inSrc-1; i++, pRight++, pLeft++){ Table *pLeftTab = pLeft->pTab; Table *pRightTab = pRight->pTab; int isOuter; - if( NEVER(pLeftTab==0 || pRightTab==0) ) continue; + if( pLeftTab==0 || pRightTab==0 ) continue; isOuter = (pRight->jointype & JT_OUTER)!=0; /* When the NATURAL keyword is present, add WHERE clause terms for ** every column that the two tables have in common. */ @@ -540,12 +540,11 @@ int regResult; /* Start of memory holding result set */ int eDest = pDest->eDest; /* How to dispose of results */ int iParm = pDest->iParm; /* First argument to disposal method */ int nResultCol; /* Number of result columns */ - assert( v ); - if( NEVER(v==0) ) return; + if( v==0 ) return; assert( pEList!=0 ); hasDistinct = distinct>=0; if( pOrderBy==0 && !hasDistinct ){ codeOffset(v, p, iContinue); } @@ -559,12 +558,15 @@ } if( pDest->iMem==0 ){ pDest->iMem = pParse->nMem+1; pDest->nMem = nResultCol; pParse->nMem += nResultCol; - }else{ - assert( pDest->nMem==nResultCol ); + }else if( pDest->nMem!=nResultCol ){ + /* This happens when two SELECTs of a compound SELECT have differing + ** numbers of result columns. The error message will be generated by + ** a higher-level routine. */ + return; } regResult = pDest->iMem; if( nColumn>0 ){ for(i=0; inExpr; pInfo = sqlite3DbMallocZero(db, sizeof(*pInfo) + nExpr*(sizeof(CollSeq*)+1) ); if( pInfo ){ pInfo->aSortOrder = (u8*)&pInfo->aColl[nExpr]; - pInfo->nField = (u16)nExpr; + pInfo->nField = nExpr; pInfo->enc = ENC(db); - pInfo->db = db; for(i=0, pItem=pList->a; ipExpr); if( !pColl ){ pColl = db->pDfltColl; @@ -782,12 +783,12 @@ Select *p, /* The SELECT statement */ Vdbe *v, /* Generate code into this VDBE */ int nColumn, /* Number of columns of data */ SelectDest *pDest /* Write the sorted results here */ ){ - int addrBreak = sqlite3VdbeMakeLabel(v); /* Jump here to exit loop */ - int addrContinue = sqlite3VdbeMakeLabel(v); /* Jump here for next cycle */ + int brk = sqlite3VdbeMakeLabel(v); + int cont = sqlite3VdbeMakeLabel(v); int addr; int iTab; int pseudoTab = 0; ExprList *pOrderBy = p->pOrderBy; @@ -801,20 +802,18 @@ if( eDest==SRT_Output || eDest==SRT_Coroutine ){ pseudoTab = pParse->nTab++; sqlite3VdbeAddOp2(v, OP_SetNumColumns, 0, nColumn); sqlite3VdbeAddOp2(v, OP_OpenPseudo, pseudoTab, eDest==SRT_Output); } - addr = 1 + sqlite3VdbeAddOp2(v, OP_Sort, iTab, addrBreak); - codeOffset(v, p, addrContinue); + addr = 1 + sqlite3VdbeAddOp2(v, OP_Sort, iTab, brk); + codeOffset(v, p, cont); regRow = sqlite3GetTempReg(pParse); regRowid = sqlite3GetTempReg(pParse); sqlite3VdbeAddOp3(v, OP_Column, iTab, pOrderBy->nExpr + 1, regRow); switch( eDest ){ case SRT_Table: case SRT_EphemTab: { - testcase( eDest==SRT_Table ); - testcase( eDest==SRT_EphemTab ); sqlite3VdbeAddOp2(v, OP_NewRowid, iParm, regRowid); sqlite3VdbeAddOp3(v, OP_Insert, iParm, regRow, regRowid); sqlite3VdbeChangeP5(v, OPFLAG_APPEND); break; } @@ -834,12 +833,10 @@ } #endif case SRT_Output: case SRT_Coroutine: { int i; - testcase( eDest==SRT_Output ); - testcase( eDest==SRT_Coroutine ); sqlite3VdbeAddOp2(v, OP_Integer, 1, regRowid); sqlite3VdbeAddOp3(v, OP_Insert, pseudoTab, regRow, regRowid); for(i=0; iiMem+i ); sqlite3VdbeAddOp3(v, OP_Column, pseudoTab, i, pDest->iMem+i); @@ -864,16 +861,17 @@ */ assert( p->iLimit==0 ); /* The bottom of the loop */ - sqlite3VdbeResolveLabel(v, addrContinue); + sqlite3VdbeResolveLabel(v, cont); sqlite3VdbeAddOp2(v, OP_Next, iTab, addr); - sqlite3VdbeResolveLabel(v, addrBreak); + sqlite3VdbeResolveLabel(v, brk); if( eDest==SRT_Output || eDest==SRT_Coroutine ){ sqlite3VdbeAddOp2(v, OP_Close, pseudoTab, 0); } + } /* ** Return a pointer to a string containing the 'declaration type' of the ** expression pExpr. The string may be treated as static by the caller. @@ -946,11 +944,11 @@ if( pS ){ /* The "table" is actually a sub-select or a view in the FROM clause ** of the SELECT statement. Return the declaration type and origin ** data for the result-set column of the sub-select. */ - if( ALWAYS(iCol>=0 && iColpEList->nExpr) ){ + if( iCol>=0 && iColpEList->nExpr ){ /* If iCol is less than zero, then the expression requests the ** rowid of the sub-select or view. This expression is legal (see ** test case misc2.2.2) - it always evaluates to NULL. */ NameContext sNC; @@ -958,11 +956,11 @@ sNC.pSrcList = pS->pSrc; sNC.pNext = 0; sNC.pParse = pNC->pParse; zType = columnType(&sNC, p, &zOriginDb, &zOriginTab, &zOriginCol); } - }else if( ALWAYS(pTab->pSchema) ){ + }else if( pTab->pSchema ){ /* A real table */ assert( !pS ); if( iCol<0 ) iCol = pTab->iPKey; assert( iCol==-1 || (iCol>=0 && iColnCol) ); if( iCol<0 ){ @@ -1033,17 +1031,17 @@ /* The vdbe must make its own copy of the column-type and other ** column specific strings, in case the schema is reset before this ** virtual machine is deleted. */ - sqlite3VdbeSetColName(v, i, COLNAME_DATABASE, zOrigDb, SQLITE_TRANSIENT); - sqlite3VdbeSetColName(v, i, COLNAME_TABLE, zOrigTab, SQLITE_TRANSIENT); - sqlite3VdbeSetColName(v, i, COLNAME_COLUMN, zOrigCol, SQLITE_TRANSIENT); + sqlite3VdbeSetColName(v, i, COLNAME_DATABASE, zOrigDb, P4_TRANSIENT); + sqlite3VdbeSetColName(v, i, COLNAME_TABLE, zOrigTab, P4_TRANSIENT); + sqlite3VdbeSetColName(v, i, COLNAME_COLUMN, zOrigCol, P4_TRANSIENT); #else zType = columnType(&sNC, p, 0, 0, 0); #endif - sqlite3VdbeSetColName(v, i, COLNAME_DECLTYPE, zType, SQLITE_TRANSIENT); + sqlite3VdbeSetColName(v, i, COLNAME_DECLTYPE, zType, P4_TRANSIENT); } #endif /* SQLITE_OMIT_DECLTYPE */ } /* @@ -1067,11 +1065,11 @@ return; } #endif assert( v!=0 ); - if( pParse->colNamesSet || NEVER(v==0) || db->mallocFailed ) return; + if( pParse->colNamesSet || v==0 || db->mallocFailed ) return; pParse->colNamesSet = 1; fullNames = (db->flags & SQLITE_FullColNames)!=0; shortNames = (db->flags & SQLITE_ShortColNames)!=0; sqlite3VdbeSetNumCols(v, pEList->nExpr); for(i=0; inExpr; i++){ @@ -1078,18 +1076,16 @@ Expr *p; p = pEList->a[i].pExpr; if( p==0 ) continue; if( pEList->a[i].zName ){ char *zName = pEList->a[i].zName; - sqlite3VdbeSetColName(v, i, COLNAME_NAME, zName, SQLITE_TRANSIENT); + sqlite3VdbeSetColName(v, i, COLNAME_NAME, zName, strlen(zName)); }else if( (p->op==TK_COLUMN || p->op==TK_AGG_COLUMN) && pTabList ){ Table *pTab; char *zCol; int iCol = p->iColumn; - for(j=0; ALWAYS(jnSrc); j++){ - if( pTabList->a[j].iCursor==p->iTable ) break; - } + for(j=0; jnSrc && pTabList->a[j].iCursor!=p->iTable; j++){} assert( jnSrc ); pTab = pTabList->a[j].pTab; if( iCol<0 ) iCol = pTab->iPKey; assert( iCol==-1 || (iCol>=0 && iColnCol) ); if( iCol<0 ){ @@ -1096,22 +1092,24 @@ zCol = "rowid"; }else{ zCol = pTab->aCol[iCol].zName; } if( !shortNames && !fullNames ){ - sqlite3VdbeSetColName(v, i, COLNAME_NAME, - sqlite3DbStrNDup(db, (char*)p->span.z, p->span.n), SQLITE_DYNAMIC); - }else if( fullNames ){ + sqlite3VdbeSetColName(v, i, COLNAME_NAME, (char*)p->span.z, p->span.n); + }else if( fullNames || (!shortNames && pTabList->nSrc>1) ){ char *zName = 0; - zName = sqlite3MPrintf(db, "%s.%s", pTab->zName, zCol); - sqlite3VdbeSetColName(v, i, COLNAME_NAME, zName, SQLITE_DYNAMIC); + char *zTab; + + zTab = pTabList->a[j].zAlias; + if( fullNames || zTab==0 ) zTab = pTab->zName; + zName = sqlite3MPrintf(db, "%s.%s", zTab, zCol); + sqlite3VdbeSetColName(v, i, COLNAME_NAME, zName, P4_DYNAMIC); }else{ - sqlite3VdbeSetColName(v, i, COLNAME_NAME, zCol, SQLITE_TRANSIENT); + sqlite3VdbeSetColName(v, i, COLNAME_NAME, zCol, strlen(zCol)); } }else{ - sqlite3VdbeSetColName(v, i, COLNAME_NAME, - sqlite3DbStrNDup(db, (char*)p->span.z, p->span.n), SQLITE_DYNAMIC); + sqlite3VdbeSetColName(v, i, COLNAME_NAME, (char*)p->span.z, p->span.n); } } generateColumnTypes(pParse, pTabList, pEList); } @@ -1148,18 +1146,17 @@ Parse *pParse, /* Parsing context */ ExprList *pEList, /* Expr list from which to derive column names */ int *pnCol, /* Write the number of columns here */ Column **paCol /* Write the new column list here */ ){ - sqlite3 *db = pParse->db; /* Database connection */ - int i, j; /* Loop counters */ - int cnt; /* Index added to make the name unique */ - Column *aCol, *pCol; /* For looping over result columns */ - int nCol; /* Number of columns in the result set */ - Expr *p; /* Expression for a single result column */ - char *zName; /* Column name */ - int nName; /* Size of name in zName[] */ + sqlite3 *db = pParse->db; + int i, j, cnt; + Column *aCol, *pCol; + int nCol; + Expr *p; + char *zName; + int nName; *pnCol = nCol = pEList->nExpr; aCol = *paCol = sqlite3DbMallocZero(db, sizeof(aCol[0])*nCol); if( aCol==0 ) return SQLITE_NOMEM; for(i=0, pCol=aCol; ipRight==0 || p->pRight->token.z==0 || p->pRight->token.z[0]!=0 ); if( (zName = pEList->a[i].zName)!=0 ){ /* If the column contains an "AS " phrase, use as the name */ zName = sqlite3DbStrDup(db, zName); }else{ - Expr *pColExpr = p; /* The expression that is the result column name */ - Table *pTab; /* Table associated with this expression */ - while( pColExpr->op==TK_DOT ) pColExpr = pColExpr->pRight; - if( pColExpr->op==TK_COLUMN && (pTab = pColExpr->pTab)!=0 ){ + Expr *pCol = p; + Table *pTab; + while( pCol->op==TK_DOT ) pCol = pCol->pRight; + if( pCol->op==TK_COLUMN && (pTab = pCol->pTab)!=0 ){ /* For columns use the column name name */ - int iCol = pColExpr->iColumn; + int iCol = pCol->iColumn; if( iCol<0 ) iCol = pTab->iPKey; zName = sqlite3MPrintf(db, "%s", iCol>=0 ? pTab->aCol[iCol].zName : "rowid"); }else{ /* Use the original text of the column expression as its name */ - Token *pToken = (pColExpr->span.z?&pColExpr->span:&pColExpr->token); - zName = sqlite3MPrintf(db, "%T", pToken); + zName = sqlite3MPrintf(db, "%T", &pCol->span); } } if( db->mallocFailed ){ sqlite3DbFree(db, zName); break; @@ -1193,11 +1189,11 @@ sqlite3Dequote(zName); /* Make sure the column name is unique. If the name is not unique, ** append a integer to the name so that it becomes unique. */ - nName = sqlite3Strlen30(zName); + nName = strlen(zName); for(j=cnt=0; jzName = zName; } if( db->mallocFailed ){ + int j; for(j=0; jnLimit and p->nOffset */ int addr; SelectDest uniondest; priorOp = SRT_Union; - if( dest.eDest==priorOp && ALWAYS(!p->pLimit &&!p->pOffset) ){ + if( dest.eDest==priorOp && !p->pLimit && !p->pOffset ){ /* We can reuse a temporary table generated by a SELECT to our ** right. */ - assert( p->pRightmost!=p ); /* Can only happen for leftward elements - ** of a 3-way or more compound */ - assert( p->pLimit==0 ); /* Not allowed on leftward elements */ - assert( p->pOffset==0 ); /* Not allowed on leftward elements */ unionTab = dest.iParm; }else{ /* We will need to create our own temporary table to hold the ** intermediate results. */ @@ -1735,11 +1728,11 @@ rc = SQLITE_NOMEM; goto multi_select_end; } pKeyInfo->enc = ENC(db); - pKeyInfo->nField = (u16)nCol; + pKeyInfo->nField = nCol; for(i=0, apColl=pKeyInfo->aColl; ipDfltColl; @@ -2036,11 +2029,11 @@ int addrSelectA; /* Address of the select-A coroutine */ int addrSelectB; /* Address of the select-B coroutine */ int regOutA; /* Address register for the output-A subroutine */ int regOutB; /* Address register for the output-B subroutine */ int addrOutA; /* Address of the output-A subroutine */ - int addrOutB = 0; /* Address of the output-B subroutine */ + int addrOutB; /* Address of the output-B subroutine */ int addrEofA; /* Address of the select-A-exhausted subroutine */ int addrEofB; /* Address of the select-B-exhausted subroutine */ int addrAltB; /* Address of the AB subroutine */ @@ -2093,11 +2086,11 @@ Expr *pNew = sqlite3PExpr(pParse, TK_INTEGER, 0, 0, 0); if( pNew==0 ) return SQLITE_NOMEM; pNew->flags |= EP_IntValue; pNew->iTable = i; pOrderBy = sqlite3ExprListAppend(pParse, pOrderBy, pNew, 0); - pOrderBy->a[nOrderBy++].iCol = (u16)i; + pOrderBy->a[nOrderBy++].iCol = i; } } } /* Compute the comparison permutation and keyinfo that is used with @@ -2116,11 +2109,11 @@ } pKeyMerge = sqlite3DbMallocRaw(db, sizeof(*pKeyMerge)+nOrderBy*(sizeof(CollSeq*)+1)); if( pKeyMerge ){ pKeyMerge->aSortOrder = (u8*)&pKeyMerge->aColl[nOrderBy]; - pKeyMerge->nField = (u16)nOrderBy; + pKeyMerge->nField = nOrderBy; pKeyMerge->enc = ENC(db); for(i=0; ia[i].pExpr; if( pTerm->flags & EP_ExpCollate ){ @@ -2149,18 +2142,18 @@ */ if( op==TK_ALL ){ regPrev = 0; }else{ int nExpr = p->pEList->nExpr; - assert( nOrderBy>=nExpr || db->mallocFailed ); + assert( nOrderBy>=nExpr ); regPrev = sqlite3GetTempRange(pParse, nExpr+1); sqlite3VdbeAddOp2(v, OP_Integer, 0, regPrev); pKeyDup = sqlite3DbMallocZero(db, sizeof(*pKeyDup) + nExpr*(sizeof(CollSeq*)+1) ); if( pKeyDup ){ pKeyDup->aSortOrder = (u8*)&pKeyDup->aColl[nExpr]; - pKeyDup->nField = (u16)nExpr; + pKeyDup->nField = nExpr; pKeyDup->enc = ENC(db); for(i=0; iaColl[i] = multiSelectCollSeq(pParse, p, i); pKeyDup->aSortOrder[i] = 0; } @@ -2408,12 +2401,10 @@ pExpr->iAgg = pNew->iAgg; sqlite3TokenCopy(db, &pExpr->token, &pNew->token); sqlite3TokenCopy(db, &pExpr->span, &pNew->span); pExpr->pSelect = sqlite3SelectDup(db, pNew->pSelect); pExpr->flags = pNew->flags; - pExpr->pAggInfo = pNew->pAggInfo; - pNew->pAggInfo = 0; } }else{ substExpr(db, pExpr->pLeft, iTable, pEList); substExpr(db, pExpr->pRight, iTable, pEList); substSelect(db, pExpr->pSelect, iTable, pEList); @@ -2447,12 +2438,11 @@ substExprList(db, p->pOrderBy, iTable, pEList); substExpr(db, p->pHaving, iTable, pEList); substExpr(db, p->pWhere, iTable, pEList); substSelect(db, p->pPrior, iTable, pEList); pSrc = p->pSrc; - assert( pSrc ); /* Even for (SELECT 1) we have: pSrc!=0 but pSrc->nSrc==0 */ - if( ALWAYS(pSrc) ){ + if( pSrc ){ for(i=pSrc->nSrc, pItem=pSrc->a; i>0; i--, pItem++){ substSelect(db, pItem->pSelect, iTable, pEList); } } } @@ -2579,12 +2569,11 @@ struct SrcList_item *pSubitem; /* The subquery */ sqlite3 *db = pParse->db; /* Check to see if flattening is permitted. Return 0 if not. */ - assert( p!=0 ); - assert( p->pPrior==0 ); /* Unable to flatten compound queries */ + if( p==0 ) return 0; pSrc = p->pSrc; assert( pSrc && iFrom>=0 && iFromnSrc ); pSubitem = &pSrc->a[iFrom]; iParent = pSubitem->iCursor; pSub = pSubitem->pSelect; @@ -2657,11 +2646,11 @@ ** use only the UNION ALL operator. And none of the simple select queries ** that make up the compound SELECT are allowed to be aggregate or distinct ** queries. */ if( pSub->pPrior ){ - if( isAgg || (p->selFlags & SF_Distinct)!=0 || pSrc->nSrc!=1 ){ + if( p->pPrior || isAgg || (p->selFlags & SF_Distinct)!=0 || pSrc->nSrc!=1 ){ return 0; } for(pSub1=pSub; pSub1; pSub1=pSub1->pPrior){ if( (pSub1->selFlags & (SF_Distinct|SF_Aggregate))!=0 || (pSub1->pPrior && pSub1->op!=TK_ALL) @@ -2692,150 +2681,96 @@ ** be of the form: ** ** SELECT FROM () ** ** followed by any ORDER BY, LIMIT and/or OFFSET clauses. This block - ** creates N-1 copies of the parent query without any ORDER BY, LIMIT or + ** creates N copies of the parent query without any ORDER BY, LIMIT or ** OFFSET clauses and joins them to the left-hand-side of the original ** using UNION ALL operators. In this case N is the number of simple ** select statements in the compound sub-query. - ** - ** Example: - ** - ** SELECT a+1 FROM ( - ** SELECT x FROM tab - ** UNION ALL - ** SELECT y FROM tab - ** UNION ALL - ** SELECT abs(z*2) FROM tab2 - ** ) WHERE a!=5 ORDER BY 1 - ** - ** Transformed into: - ** - ** SELECT x+1 FROM tab WHERE x+1!=5 - ** UNION ALL - ** SELECT y+1 FROM tab WHERE y+1!=5 - ** UNION ALL - ** SELECT abs(z*2)+1 FROM tab2 WHERE abs(z*2)+1!=5 - ** ORDER BY 1 - ** - ** We call this the "compound-subquery flattening". */ for(pSub=pSub->pPrior; pSub; pSub=pSub->pPrior){ Select *pNew; ExprList *pOrderBy = p->pOrderBy; Expr *pLimit = p->pLimit; + Expr *pOffset = p->pOffset; Select *pPrior = p->pPrior; p->pOrderBy = 0; p->pSrc = 0; p->pPrior = 0; p->pLimit = 0; pNew = sqlite3SelectDup(db, p); - p->pLimit = pLimit; + pNew->pPrior = pPrior; + p->pPrior = pNew; p->pOrderBy = pOrderBy; - p->pSrc = pSrc; p->op = TK_ALL; + p->pSrc = pSrc; + p->pLimit = pLimit; + p->pOffset = pOffset; p->pRightmost = 0; - if( pNew==0 ){ - pNew = pPrior; - }else{ - pNew->pPrior = pPrior; - pNew->pRightmost = 0; - } - p->pPrior = pNew; - if( db->mallocFailed ) return 1; + pNew->pRightmost = 0; } /* Begin flattening the iFrom-th entry of the FROM clause ** in the outer query. */ pSub = pSub1 = pSubitem->pSelect; - - /* Delete the transient table structure associated with the - ** subquery - */ - sqlite3DbFree(db, pSubitem->zDatabase); - sqlite3DbFree(db, pSubitem->zName); - sqlite3DbFree(db, pSubitem->zAlias); - pSubitem->zDatabase = 0; - pSubitem->zName = 0; - pSubitem->zAlias = 0; - pSubitem->pSelect = 0; - - /* Defer deleting the Table object associated with the - ** subquery until code generation is - ** complete, since there may still exist Expr.pTab entries that - ** refer to the subquery even after flattening. Ticket #3346. - */ - if( pSubitem->pTab!=0 ){ - Table *pTabToDel = pSubitem->pTab; - if( pTabToDel->nRef==1 ){ - pTabToDel->pNextZombie = pParse->pZombieTab; - pParse->pZombieTab = pTabToDel; - }else{ - pTabToDel->nRef--; - } - pSubitem->pTab = 0; - } - - /* The following loop runs once for each term in a compound-subquery - ** flattening (as described above). If we are doing a different kind - ** of flattening - a flattening other than a compound-subquery flattening - - ** then this loop only runs once. - ** - ** This loop moves all of the FROM elements of the subquery into the - ** the FROM clause of the outer query. Before doing this, remember - ** the cursor number for the original outer query FROM element in - ** iParent. The iParent cursor will never be used. Subsequent code - ** will scan expressions looking for iParent references and replace - ** those references with expressions that resolve to the subquery FROM - ** elements we are now copying in. - */ for(pParent=p; pParent; pParent=pParent->pPrior, pSub=pSub->pPrior){ - int nSubSrc; - u8 jointype = 0; - pSubSrc = pSub->pSrc; /* FROM clause of subquery */ - nSubSrc = pSubSrc->nSrc; /* Number of terms in subquery FROM clause */ - pSrc = pParent->pSrc; /* FROM clause of the outer query */ + int nSubSrc = pSubSrc->nSrc; + int jointype = 0; + pSubSrc = pSub->pSrc; + pSrc = pParent->pSrc; + /* Move all of the FROM elements of the subquery into the + ** the FROM clause of the outer query. Before doing this, remember + ** the cursor number for the original outer query FROM element in + ** iParent. The iParent cursor will never be used. Subsequent code + ** will scan expressions looking for iParent references and replace + ** those references with expressions that resolve to the subquery FROM + ** elements we are now copying in. + */ if( pSrc ){ - assert( pParent==p ); /* First time through the loop */ + Table *pTabToDel; + pSubitem = &pSrc->a[iFrom]; + nSubSrc = pSubSrc->nSrc; jointype = pSubitem->jointype; - }else{ - assert( pParent!=p ); /* 2nd and subsequent times through the loop */ - pSrc = pParent->pSrc = sqlite3SrcListAppend(db, 0, 0, 0); - if( pSrc==0 ){ - assert( db->mallocFailed ); - break; - } - } - - /* The subquery uses a single slot of the FROM clause of the outer - ** query. If the subquery has more than one element in its FROM clause, - ** then expand the outer query to make space for it to hold all elements - ** of the subquery. - ** - ** Example: - ** - ** SELECT * FROM tabA, (SELECT * FROM sub1, sub2), tabB; - ** - ** The outer query has 3 slots in its FROM clause. One slot of the - ** outer query (the middle slot) is used by the subquery. The next - ** block of code will expand the out query to 4 slots. The middle - ** slot is expanded to two slots in order to make space for the - ** two elements in the FROM clause of the subquery. - */ - if( nSubSrc>1 ){ - pParent->pSrc = pSrc = sqlite3SrcListEnlarge(db, pSrc, nSubSrc-1,iFrom+1); - if( db->mallocFailed ){ - break; - } - } - - /* Transfer the FROM clause terms from the subquery into the - ** outer query. - */ + sqlite3DbFree(db, pSubitem->zDatabase); + sqlite3DbFree(db, pSubitem->zName); + sqlite3DbFree(db, pSubitem->zAlias); + pSubitem->zDatabase = 0; + pSubitem->zName = 0; + pSubitem->zAlias = 0; + + /* If the FROM element is a subquery, defer deleting the Table + ** object associated with that subquery until code generation is + ** complete, since there may still exist Expr.pTab entires that + ** refer to the subquery even after flattening. Ticket #3346. + */ + if( (pTabToDel = pSubitem->pTab)!=0 ){ + if( pTabToDel->nRef==1 ){ + pTabToDel->pNextZombie = pParse->pZombieTab; + pParse->pZombieTab = pTabToDel; + }else{ + pTabToDel->nRef--; + } + } + pSubitem->pTab = 0; + } + if( nSubSrc!=1 || !pSrc ){ + int extra = nSubSrc - 1; + for(i=(pSrc?1:0); ipSrc = 0; + return 1; + } + } + pParent->pSrc = pSrc; + for(i=pSrc->nSrc-1; i-extra>=iFrom; i--){ + pSrc->a[i] = pSrc->a[i-extra]; + } + } for(i=0; ia[i+iFrom] = pSubSrc->a[i]; memset(&pSubSrc->a[i], 0, sizeof(pSubSrc->a[i])); } pSrc->a[iFrom].jointype = jointype; @@ -2926,11 +2861,11 @@ ** 1. There is a single object in the FROM clause. ** ** 2. There is a single expression in the result set, and it is ** either min(x) or max(x), where x is a column reference. */ -static u8 minMaxQuery(Select *p){ +static int minMaxQuery(Parse *pParse, Select *p){ Expr *pExpr; ExprList *pEList = p->pEList; if( pEList->nExpr!=1 ) return WHERE_ORDERBY_NORMAL; pExpr = pEList->a[0].pExpr; @@ -3156,11 +3091,11 @@ if( IsHiddenColumn(&pTab->aCol[j]) ){ assert(IsVirtual(pTab)); continue; } - if( i>0 && zTName==0 ){ + if( i>0 ){ struct SrcList_item *pLeft = &pTabList->a[i-1]; if( (pLeft[1].jointype & JT_NATURAL)!=0 && columnIndex(pLeft->pTab, zName)>=0 ){ /* In a NATURAL join, omit the join columns from the ** table on the right */ @@ -3226,12 +3161,11 @@ ** are walked without any actions being taken at each node. Presumably, ** when this routine is used for Walker.xExprCallback then ** Walker.xSelectCallback is set to do something useful for every ** subquery in the parser tree. */ -static int exprWalkNoop(Walker *NotUsed, Expr *NotUsed2){ - UNUSED_PARAMETER2(NotUsed, NotUsed2); +static int exprWalkNoop(Walker *pWalker, Expr *pExpr){ return WRC_Continue; } /* ** This routine "expands" a SELECT statement and all of its subqueries. @@ -3363,12 +3297,12 @@ for(pFunc=pAggInfo->aFunc, i=0; inFunc; i++, pFunc++){ sqlite3VdbeAddOp2(v, OP_Null, 0, pFunc->iMem); if( pFunc->iDistinct>=0 ){ Expr *pE = pFunc->pExpr; if( pE->pList==0 || pE->pList->nExpr!=1 ){ - sqlite3ErrorMsg(pParse, "DISTINCT aggregates must have exactly one " - "argument"); + sqlite3ErrorMsg(pParse, "DISTINCT in aggregate must be followed " + "by an expression"); pFunc->iDistinct = -1; }else{ KeyInfo *pKeyInfo = keyInfoFromExprList(pParse, pE->pList); sqlite3VdbeAddOp4(v, OP_OpenEphemeral, pFunc->iDistinct, 0, 0, (char*)pKeyInfo, P4_KEYINFO_HANDOFF); @@ -3434,11 +3368,11 @@ } sqlite3VdbeAddOp4(v, OP_CollSeq, 0, 0, 0, (char *)pColl, P4_COLLSEQ); } sqlite3VdbeAddOp4(v, OP_AggStep, 0, regAgg, pF->iMem, (void*)pF->pFunc, P4_FUNCDEF); - sqlite3VdbeChangeP5(v, (u8)nArg); + sqlite3VdbeChangeP5(v, nArg); sqlite3ReleaseTempRange(pParse, regAgg, nArg); sqlite3ExprCacheAffinityChange(pParse, regAgg, nArg); if( addrNext ){ sqlite3VdbeResolveLabel(v, addrNext); } @@ -3543,17 +3477,21 @@ assert(pDest->eDest==SRT_Exists || pDest->eDest==SRT_Union || pDest->eDest==SRT_Except || pDest->eDest==SRT_Discard); p->selFlags &= ~SF_Distinct; } sqlite3SelectPrep(pParse, p, 0); - pTabList = p->pSrc; - pEList = p->pEList; - if( pParse->nErr || db->mallocFailed ){ + if( pParse->nErr ){ goto select_end; } p->pOrderBy = pOrderBy; + + + /* Make local copies of the parameters for this query. + */ + pTabList = p->pSrc; isAgg = (p->selFlags & SF_Aggregate)!=0; + pEList = p->pEList; if( pEList==0 ) goto select_end; /* ** Do not even attempt to generate any code if we have already seen ** errors before this routine starts. @@ -3709,11 +3647,11 @@ /* Aggregate and non-aggregate queries are handled differently */ if( !isAgg && pGroupBy==0 ){ /* This case is for non-aggregate queries ** Begin the database scan */ - pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, &pOrderBy, 0, 0); + pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, &pOrderBy, 0); if( pWInfo==0 ) goto select_end; /* If sorting index that was created by a prior OP_OpenEphemeral ** instruction ended up not being needed, then change the OP_OpenEphemeral ** into an OP_Noop. @@ -3746,17 +3684,17 @@ /* Remove any and all aliases between the result set and the ** GROUP BY clause. */ if( pGroupBy ){ - int k; /* Loop counter */ + int i; /* Loop counter */ struct ExprList_item *pItem; /* For looping over expression in a list */ - for(k=p->pEList->nExpr, pItem=p->pEList->a; k>0; k--, pItem++){ + for(i=p->pEList->nExpr, pItem=p->pEList->a; i>0; i--, pItem++){ pItem->iAlias = 0; } - for(k=pGroupBy->nExpr, pItem=pGroupBy->a; k>0; k--, pItem++){ + for(i=pGroupBy->nExpr, pItem=pGroupBy->a; i>0; i--, pItem++){ pItem->iAlias = 0; } } @@ -3830,11 +3768,11 @@ ** This might involve two separate loops with an OP_Sort in between, or ** it might be a single loop that uses an index to extract information ** in the right order to begin with. */ sqlite3VdbeAddOp2(v, OP_Gosub, regReset, addrReset); - pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, &pGroupBy, 0, 0); + pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, &pGroupBy, 0); if( pWInfo==0 ) goto select_end; if( pGroupBy==0 ){ /* The optimizer is able to deliver rows in group by order so ** we do not have to sort. The OP_OpenEphemeral table will be ** cancelled later because we still need to use the pKeyInfo @@ -4014,25 +3952,25 @@ ** + The optimizer code in where.c (the thing that decides which ** index or indices to use) should place a different priority on ** satisfying the 'ORDER BY' clause than it does in other cases. ** Refer to code and comments in where.c for details. */ - flag = minMaxQuery(p); + flag = minMaxQuery(pParse, p); if( flag ){ pDel = pMinMax = sqlite3ExprListDup(db, p->pEList->a[0].pExpr->pList); if( pMinMax && !db->mallocFailed ){ - pMinMax->a[0].sortOrder = flag!=WHERE_ORDERBY_MIN ?1:0; + pMinMax->a[0].sortOrder = flag!=WHERE_ORDERBY_MIN; pMinMax->a[0].pExpr->op = TK_COLUMN; } } /* This case runs if the aggregate has no GROUP BY clause. The ** processing is much simpler since there is only a single row ** of output. */ resetAccumulator(pParse, &sAggInfo); - pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, &pMinMax, flag, 0); + pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, &pMinMax, flag); if( pWInfo==0 ){ sqlite3ExprListDelete(db, pDel); goto select_end; } updateAccumulator(pParse, &sAggInfo); Index: src/shell.c ================================================================== --- src/shell.c +++ src/shell.c @@ -10,17 +10,12 @@ ** ************************************************************************* ** This file contains code to implement the "sqlite" command line ** utility for accessing SQLite databases. ** -** $Id: shell.c,v 1.201 2009/02/04 22:46:47 drh Exp $ +** $Id: shell.c,v 1.185 2008/08/11 19:12:35 drh Exp $ */ -#if defined(_WIN32) || defined(WIN32) -/* This needs to come before any includes for MSVC compiler */ -#define _CRT_SECURE_NO_WARNINGS -#endif - #include #include #include #include #include "sqlite3.h" @@ -27,13 +22,11 @@ #include #include #if !defined(_WIN32) && !defined(WIN32) && !defined(__OS2__) # include -# if !defined(__RTP__) && !defined(_WRS_KERNEL) -# include -# endif +# include # include # include #endif #ifdef __OS2__ @@ -51,12 +44,10 @@ # define stifle_history(X) #endif #if defined(_WIN32) || defined(WIN32) # include -#define isatty(h) _isatty(h) -#define access(f,m) _access((f),(m)) #else /* Make sure isatty() has a prototype. */ extern int isatty(); #endif @@ -67,11 +58,11 @@ * overridden with the -batch command line option. */ #define isatty(x) 1 #endif -#if !defined(_WIN32) && !defined(WIN32) && !defined(__OS2__) && !defined(__RTP__) && !defined(_WRS_KERNEL) +#if !defined(_WIN32) && !defined(WIN32) && !defined(__OS2__) #include #include /* Saved resource information for the beginning of an operation */ static struct rusage sBegin; @@ -113,14 +104,10 @@ #define BEGIN_TIMER #define END_TIMER #define HAS_TIMER 0 #endif -/* -** Used to prevent warnings about unused parameters -*/ -#define UNUSED_PARAMETER(x) (void)(x) /* ** If the following flag is set, then command execution stops ** at an error if we are not interactive. */ @@ -225,12 +212,10 @@ int argc, sqlite3_value **argv ){ assert( 0==argc ); assert( zShellStatic ); - UNUSED_PARAMETER(argc); - UNUSED_PARAMETER(argv); sqlite3_result_text(context, zShellStatic, -1, SQLITE_STATIC); } /* @@ -366,21 +351,11 @@ }; /* ** Number of elements in an array */ -#define ArraySize(X) (int)(sizeof(X)/sizeof(X[0])) - -/* -** Compute a string length that is limited to what can be stored in -** lower 30 bits of a 32-bit signed integer. -*/ -static int strlen30(const char *z){ - const char *z2 = z; - while( *z2 ){ z2++; } - return 0x3fffffff & (int)(z2 - z); -} +#define ArraySize(X) (sizeof(X)/sizeof(X[0])) /* ** Output the given string as a quoted string using SQL quoting conventions. */ static void output_quoted_string(FILE *out, const char *z){ @@ -493,11 +468,11 @@ FILE *out = p->out; if( z==0 ){ fprintf(out,"%s",p->nullvalue); }else{ int i; - int nSep = strlen30(p->separator); + int nSep = strlen(p->separator); for(i=0; z[i]; i++){ if( needCsvQuote[((unsigned char*)z)[i]] || (z[i]==p->separator[0] && (nSep==1 || memcmp(z, p->separator, nSep)==0)) ){ i = 0; @@ -523,11 +498,10 @@ #ifdef SIGINT /* ** This routine runs when the user presses Ctrl-C */ static void interrupt_handler(int NotUsed){ - UNUSED_PARAMETER(NotUsed); seenInterrupt = 1; if( db ) sqlite3_interrupt(db); } #endif @@ -541,11 +515,11 @@ switch( p->mode ){ case MODE_Line: { int w = 5; if( azArg==0 ) break; for(i=0; iw ) w = len; } if( p->cnt++>0 ) fprintf(p->out,"\n"); for(i=0; iout,"%*s = %s\n", w, azCol[i], @@ -562,13 +536,13 @@ w = p->colWidth[i]; }else{ w = 0; } if( w<=0 ){ - w = strlen30(azCol[i] ? azCol[i] : ""); + w = strlen(azCol[i] ? azCol[i] : ""); if( w<10 ) w = 10; - n = strlen30(azArg && azArg[i] ? azArg[i] : p->nullvalue); + n = strlen(azArg && azArg[i] ? azArg[i] : p->nullvalue); if( wactualWidth) ){ p->actualWidth[i] = w; } @@ -596,13 +570,12 @@ if( iactualWidth) ){ w = p->actualWidth[i]; }else{ w = 10; } - if( p->mode==MODE_Explain && azArg[i] && - strlen30(azArg[i])>w ){ - w = strlen30(azArg[i]); + if( p->mode==MODE_Explain && azArg[i] && strlen(azArg[i])>w ){ + w = strlen(azArg[i]); } fprintf(p->out,"%-*.*s%s",w,w, azArg[i] ? azArg[i] : p->nullvalue, i==nArg-1 ? "\n": " "); } break; @@ -745,12 +718,12 @@ ** quote character for zAppend. */ static char *appendText(char *zIn, char const *zAppend, char quote){ int len; int i; - int nAppend = strlen30(zAppend); - int nIn = (zIn?strlen30(zIn):0); + int nAppend = strlen(zAppend); + int nIn = (zIn?strlen(zIn):0); len = nAppend+nIn+1; if( quote ){ len += 2; for(i=0; idb, zQuery, dump_callback, p, pzErrMsg); if( rc==SQLITE_CORRUPT ){ char *zQ2; - int len = strlen30(zQuery); + int len = strlen(zQuery); if( pzErrMsg ) sqlite3_free(*pzErrMsg); zQ2 = malloc( len+100 ); if( zQ2==0 ) return rc; sqlite3_snprintf(sizeof(zQ2), zQ2, "%s ORDER BY rowid DESC", zQuery); rc = sqlite3_exec(p->db, zQ2, dump_callback, p, pzErrMsg); @@ -928,11 +900,10 @@ /* ** Text of a help message */ static char zHelp[] = - ".backup ?DB? FILE Backup DB (default \"main\") to FILE\n" ".bail ON|OFF Stop after hitting an error. Default OFF\n" ".databases List names and files of attached databases\n" ".dump ?TABLE? ... Dump the database in an SQL text format\n" ".echo ON|OFF Turn command echo on or off\n" ".exit Exit this program\n" @@ -960,11 +931,10 @@ ".output FILENAME Send output to FILENAME\n" ".output stdout Send output to the screen\n" ".prompt MAIN CONTINUE Replace the standard prompts\n" ".quit Exit this program\n" ".read FILENAME Execute SQL in FILENAME\n" - ".restore ?DB? FILE Restore content of DB (default \"main\") from FILE\n" ".schema ?TABLE? Show the CREATE statements\n" ".separator STRING Change separator used by output mode and .import\n" ".show Show the current values for various settings\n" ".tables ?PATTERN? List names of tables matching a LIKE pattern\n" ".timeout MS Try opening locked tables for MS milliseconds\n" @@ -1008,12 +978,11 @@ ** \r -> carriage return ** \NNN -> ascii character NNN in octal ** \\ -> backslash */ static void resolve_backslashes(char *z){ - int i, j; - char c; + int i, j, c; for(i=j=0; (c = z[i])!=0; i++, j++){ if( c=='\\' ){ c = z[++i]; if( c=='n' ){ c = '\n'; @@ -1043,11 +1012,11 @@ */ static int booleanValue(char *zArg){ int val = atoi(zArg); int j; for(j=0; zArg[j]; j++){ - zArg[j] = (char)tolower(zArg[j]); + zArg[j] = tolower(zArg[j]); } if( strcmp(zArg,"on")==0 ){ val = 1; }else if( strcmp(zArg,"yes")==0 ){ val = 1; @@ -1090,49 +1059,13 @@ } /* Process the input line. */ if( nArg==0 ) return rc; - n = strlen30(azArg[0]); + n = strlen(azArg[0]); c = azArg[0][0]; - if( c=='b' && n>=3 && strncmp(azArg[0], "backup", n)==0 && nArg>1 ){ - const char *zDestFile; - const char *zDb; - sqlite3 *pDest; - sqlite3_backup *pBackup; - int rc; - if( nArg==2 ){ - zDestFile = azArg[1]; - zDb = "main"; - }else{ - zDestFile = azArg[2]; - zDb = azArg[1]; - } - rc = sqlite3_open(zDestFile, &pDest); - if( rc!=SQLITE_OK ){ - fprintf(stderr, "Error: cannot open %s\n", zDestFile); - sqlite3_close(pDest); - return 1; - } - open_db(p); - pBackup = sqlite3_backup_init(pDest, "main", p->db, zDb); - if( pBackup==0 ){ - fprintf(stderr, "Error: %s\n", sqlite3_errmsg(pDest)); - sqlite3_close(pDest); - return 1; - } - while( (rc = sqlite3_backup_step(pBackup,100))==SQLITE_OK ){} - sqlite3_backup_finish(pBackup); - if( rc==SQLITE_DONE ){ - rc = SQLITE_OK; - }else{ - fprintf(stderr, "Error: %s\n", sqlite3_errmsg(pDest)); - } - sqlite3_close(pDest); - }else - - if( c=='b' && n>=3 && strncmp(azArg[0], "bail", n)==0 && nArg>1 ){ + if( c=='b' && n>1 && strncmp(azArg[0], "bail", n)==0 && nArg>1 ){ bail_on_error = booleanValue(azArg[1]); }else if( c=='d' && n>1 && strncmp(azArg[0], "databases", n)==0 ){ struct callback_data data; @@ -1244,11 +1177,11 @@ strncmp(azArg[0], "headers", n)==0 )&& nArg>1 ){ p->showHeader = booleanValue(azArg[1]); }else if( c=='h' && strncmp(azArg[0], "help", n)==0 ){ - fprintf(stderr,"%s",zHelp); + fprintf(stderr,zHelp); }else if( c=='i' && strncmp(azArg[0], "import", n)==0 && nArg>=3 ){ char *zTable = azArg[2]; /* Insert data into this table */ char *zFile = azArg[1]; /* The file from which to extract data */ @@ -1264,18 +1197,18 @@ char *zCommit; /* How to commit changes */ FILE *in; /* The input file */ int lineno = 0; /* Line number of input file */ open_db(p); - nSep = strlen30(p->separator); + nSep = strlen(p->separator); if( nSep==0 ){ fprintf(stderr, "non-null separator required for import\n"); return 0; } zSql = sqlite3_mprintf("SELECT * FROM '%q'", zTable); if( zSql==0 ) return 0; - nByte = strlen30(zSql); + nByte = strlen(zSql); rc = sqlite3_prepare(p->db, zSql, -1, &pStmt, 0); sqlite3_free(zSql); if( rc ){ fprintf(stderr,"Error: %s\n", sqlite3_errmsg(db)); nCol = 0; @@ -1286,11 +1219,11 @@ sqlite3_finalize(pStmt); if( nCol==0 ) return 0; zSql = malloc( nByte + 20 + nCol*2 ); if( zSql==0 ) return 0; sqlite3_snprintf(nByte+20, zSql, "INSERT INTO '%q' VALUES(?", zTable); - j = strlen30(zSql); + j = strlen(zSql); for(i=1; i=2 ){ - int n2 = strlen30(azArg[1]); + int n2 = strlen(azArg[1]); if( strncmp(azArg[1],"line",n2)==0 || strncmp(azArg[1],"lines",n2)==0 ){ p->mode = MODE_Line; }else if( strncmp(azArg[1],"column",n2)==0 @@ -1489,76 +1421,30 @@ if( c=='q' && strncmp(azArg[0], "quit", n)==0 ){ rc = 2; }else - if( c=='r' && n>=3 && strncmp(azArg[0], "read", n)==0 && nArg==2 ){ + if( c=='r' && strncmp(azArg[0], "read", n)==0 && nArg==2 ){ FILE *alt = fopen(azArg[1], "rb"); if( alt==0 ){ fprintf(stderr,"can't open \"%s\"\n", azArg[1]); }else{ process_input(p, alt); fclose(alt); } }else - if( c=='r' && n>=3 && strncmp(azArg[0], "restore", n)==0 && nArg>1 ){ - const char *zSrcFile; - const char *zDb; - sqlite3 *pSrc; - sqlite3_backup *pBackup; - int rc; - int nTimeout = 0; - - if( nArg==2 ){ - zSrcFile = azArg[1]; - zDb = "main"; - }else{ - zSrcFile = azArg[2]; - zDb = azArg[1]; - } - rc = sqlite3_open(zSrcFile, &pSrc); - if( rc!=SQLITE_OK ){ - fprintf(stderr, "Error: cannot open %s\n", zSrcFile); - sqlite3_close(pSrc); - return 1; - } - open_db(p); - pBackup = sqlite3_backup_init(p->db, zDb, pSrc, "main"); - if( pBackup==0 ){ - fprintf(stderr, "Error: %s\n", sqlite3_errmsg(p->db)); - sqlite3_close(pSrc); - return 1; - } - while( (rc = sqlite3_backup_step(pBackup,100))==SQLITE_OK - || rc==SQLITE_BUSY ){ - if( rc==SQLITE_BUSY ){ - if( nTimeout++ >= 3 ) break; - sqlite3_sleep(100); - } - } - sqlite3_backup_finish(pBackup); - if( rc==SQLITE_DONE ){ - rc = SQLITE_OK; - }else if( rc==SQLITE_BUSY || rc==SQLITE_LOCKED ){ - fprintf(stderr, "source database is busy\n"); - }else{ - fprintf(stderr, "Error: %s\n", sqlite3_errmsg(p->db)); - } - sqlite3_close(pSrc); - }else - if( c=='s' && strncmp(azArg[0], "schema", n)==0 ){ struct callback_data data; char *zErrMsg = 0; open_db(p); memcpy(&data, p, sizeof(data)); data.showHeader = 0; data.mode = MODE_Semi; if( nArg>1 ){ int i; - for(i=0; azArg[1][i]; i++) azArg[1][i] = (char)tolower(azArg[1][i]); + for(i=0; azArg[1][i]; i++) azArg[1][i] = tolower(azArg[1][i]); if( strcmp(azArg[1],"sqlite_master")==0 ){ char *new_argv[2], *new_colv[2]; new_argv[0] = "CREATE TABLE sqlite_master (\n" " type text,\n" " name text,\n" @@ -1585,24 +1471,22 @@ callback(&data, 1, new_argv, new_colv); }else{ zShellStatic = azArg[1]; sqlite3_exec(p->db, "SELECT sql FROM " - " (SELECT sql sql, type type, tbl_name tbl_name, name name" - " FROM sqlite_master UNION ALL" - " SELECT sql, type, tbl_name, name FROM sqlite_temp_master) " + " (SELECT * FROM sqlite_master UNION ALL" + " SELECT * FROM sqlite_temp_master) " "WHERE tbl_name LIKE shellstatic() AND type!='meta' AND sql NOTNULL " "ORDER BY substr(type,2,1), name", callback, &data, &zErrMsg); zShellStatic = 0; } }else{ sqlite3_exec(p->db, "SELECT sql FROM " - " (SELECT sql sql, type type, tbl_name tbl_name, name name" - " FROM sqlite_master UNION ALL" - " SELECT sql, type, tbl_name, name FROM sqlite_temp_master) " + " (SELECT * FROM sqlite_master UNION ALL" + " SELECT * FROM sqlite_temp_master) " "WHERE type!='meta' AND sql NOTNULL AND name NOT LIKE 'sqlite_%'" "ORDER BY substr(type,2,1), name", callback, &data, &zErrMsg ); } @@ -1625,11 +1509,11 @@ fprintf(p->out,"%9.9s: %s\n","mode", modeDescr[p->mode]); fprintf(p->out,"%9.9s: ", "nullvalue"); output_c_string(p->out, p->nullvalue); fprintf(p->out, "\n"); fprintf(p->out,"%9.9s: %s\n","output", - strlen30(p->outfile) ? p->outfile : "stdout"); + strlen(p->outfile) ? p->outfile : "stdout"); fprintf(p->out,"%9.9s: ", "separator"); output_c_string(p->out, p->separator); fprintf(p->out, "\n"); fprintf(p->out,"%9.9s: ","width"); for (i=0;i<(int)ArraySize(p->colWidth) && p->colWidth[i] != 0;i++) { @@ -1674,11 +1558,11 @@ int len, maxlen = 0; int i, j; int nPrintCol, nPrintRow; for(i=1; i<=nRow; i++){ if( azResult[i]==0 ) continue; - len = strlen30(azResult[i]); + len = strlen(azResult[i]); if( len>maxlen ) maxlen = len; } nPrintCol = 80/(maxlen+2); if( nPrintCol<1 ) nPrintCol = 1; nPrintRow = (nRow + nPrintCol - 1)/nPrintCol; @@ -1762,34 +1646,18 @@ ** than a semi-colon. The SQL Server style "go" command is understood ** as is the Oracle "/". */ static int _is_command_terminator(const char *zLine){ while( isspace(*(unsigned char*)zLine) ){ zLine++; }; - if( zLine[0]=='/' && _all_whitespace(&zLine[1]) ){ - return 1; /* Oracle */ - } + if( zLine[0]=='/' && _all_whitespace(&zLine[1]) ) return 1; /* Oracle */ if( tolower(zLine[0])=='g' && tolower(zLine[1])=='o' && _all_whitespace(&zLine[2]) ){ return 1; /* SQL Server */ } return 0; } -/* -** Return true if zSql is a complete SQL statement. Return false if it -** ends in the middle of a string literal or C-style comment. -*/ -static int _is_complete(char *zSql, int nSql){ - int rc; - if( zSql==0 ) return 1; - zSql[nSql] = ';'; - zSql[nSql+1] = 0; - rc = sqlite3_complete(zSql); - zSql[nSql] = 0; - return rc; -} - /* ** Read input from *in and process it. If *in==0 then input ** is interactive - the user is typing it it. Otherwise, input ** is coming from a file or device. A prompt is issued and history ** is saved only if input is interactive. An interrupt signal will @@ -1829,30 +1697,30 @@ }else if( rc ){ errCnt++; } continue; } - if( _is_command_terminator(zLine) && _is_complete(zSql, nSql) ){ + if( _is_command_terminator(zLine) ){ memcpy(zLine,";",2); } nSqlPrior = nSql; if( zSql==0 ){ int i; for(i=0; zLine[i] && isspace((unsigned char)zLine[i]); i++){} if( zLine[i]!=0 ){ - nSql = strlen30(zLine); - zSql = malloc( nSql+3 ); + nSql = strlen(zLine); + zSql = malloc( nSql+1 ); if( zSql==0 ){ fprintf(stderr, "out of memory\n"); exit(1); } memcpy(zSql, zLine, nSql+1); startline = lineno; } }else{ - int len = strlen30(zLine); - zSql = realloc( zSql, nSql + len + 4 ); + int len = strlen(zLine); + zSql = realloc( zSql, nSql + len + 2 ); if( zSql==0 ){ fprintf(stderr,"%s: out of memory!\n", Argv0); exit(1); } zSql[nSql++] = '\n'; @@ -1887,11 +1755,11 @@ zSql = 0; nSql = 0; } } if( zSql ){ - if( !_all_whitespace(zSql) ) fprintf(stderr, "Incomplete SQL: %s\n", zSql); + if( !_all_whitespace(zSql) ) printf("Incomplete SQL: %s\n", zSql); free(zSql); } free(zLine); return errCnt; } @@ -1903,11 +1771,11 @@ ** function should free the result. */ static char *find_home_dir(void){ char *home_dir = NULL; -#if !defined(_WIN32) && !defined(WIN32) && !defined(__OS2__) && !defined(_WIN32_WCE) && !defined(__RTP__) && !defined(_WRS_KERNEL) +#if !defined(_WIN32) && !defined(WIN32) && !defined(__OS2__) && !defined(_WIN32_WCE) struct passwd *pwent; uid_t uid = getuid(); if( (pwent=getpwuid(uid)) != NULL) { home_dir = pwent->pw_dir; } @@ -1934,11 +1802,11 @@ char *zDrive, *zPath; int n; zDrive = getenv("HOMEDRIVE"); zPath = getenv("HOMEPATH"); if( zDrive && zPath ){ - n = strlen30(zDrive) + strlen30(zPath) + 1; + n = strlen(zDrive) + strlen(zPath) + 1; home_dir = malloc( n ); if( home_dir==0 ) return 0; sqlite3_snprintf(n, home_dir, "%s%s", zDrive, zPath); return home_dir; } @@ -1947,11 +1815,11 @@ #endif #endif /* !_WIN32_WCE */ if( home_dir ){ - int n = strlen30(home_dir) + 1; + int n = strlen(home_dir) + 1; char *z = malloc( n ); if( z ) memcpy(z, home_dir, n); home_dir = z; } @@ -1973,16 +1841,14 @@ int nBuf; if (sqliterc == NULL) { home_dir = find_home_dir(); if( home_dir==0 ){ -#if !defined(__RTP__) && !defined(_WRS_KERNEL) fprintf(stderr,"%s: cannot locate your home directory!\n", Argv0); -#endif return; } - nBuf = strlen30(home_dir) + 16; + nBuf = strlen(home_dir) + 16; zBuf = malloc( nBuf ); if( zBuf==0 ){ fprintf(stderr,"%s: out of memory!\n", Argv0); exit(1); } @@ -2201,15 +2067,12 @@ "Enter \".help\" for instructions\n" "Enter SQL statements terminated with a \";\"\n", sqlite3_libversion() ); zHome = find_home_dir(); - if( zHome ){ - nHistory = strlen30(zHome) + 20; - if( (zHistory = malloc(nHistory))!=0 ){ - sqlite3_snprintf(nHistory, zHistory,"%s/.sqlite_history", zHome); - } + if( zHome && (zHistory = malloc(nHistory = strlen(zHome)+20))!=0 ){ + sqlite3_snprintf(nHistory, zHistory,"%s/.sqlite_history", zHome); } #if defined(HAVE_READLINE) && HAVE_READLINE==1 if( zHistory ) read_history(zHistory); #endif rc = process_input(&data, 0); Index: src/sqlite.h.in ================================================================== --- src/sqlite.h.in +++ src/sqlite.h.in @@ -28,11 +28,11 @@ ** The name of this file under configuration management is "sqlite.h.in". ** The makefile makes some minor changes to this file (such as inserting ** the version number) and changes its name to "sqlite3.h" as ** part of the build process. ** -** @(#) $Id: sqlite.h.in,v 1.429 2009/02/10 13:41:42 drh Exp $ +** @(#) $Id: sqlite.h.in,v 1.404 2008/10/12 00:27:54 shane Exp $ */ #ifndef _SQLITE3_H_ #define _SQLITE3_H_ #include /* Needed for the definition of va_list */ @@ -376,18 +376,16 @@ ** ** {H12134} The [sqlite3_exec(D,S,C,A,E)] routine shall set the value of ** *E to NULL if E is not NULL and there are no errors. ** ** {H12137} The [sqlite3_exec(D,S,C,A,E)] function shall set the [error code] -** and message accessible via [sqlite3_errcode()], -** [sqlite3_extended_errcode()], +** and message accessible via [sqlite3_errcode()], ** [sqlite3_errmsg()], and [sqlite3_errmsg16()]. ** ** {H12138} If the S parameter to [sqlite3_exec(D,S,C,A,E)] is NULL or an ** empty string or contains nothing other than whitespace, comments, ** and/or semicolons, then results of [sqlite3_errcode()], -** [sqlite3_extended_errcode()], ** [sqlite3_errmsg()], and [sqlite3_errmsg16()] ** shall reset to indicate no errors. ** ** ASSUMPTIONS: ** @@ -505,12 +503,10 @@ #define SQLITE_IOERR_BLOCKED (SQLITE_IOERR | (11<<8)) #define SQLITE_IOERR_NOMEM (SQLITE_IOERR | (12<<8)) #define SQLITE_IOERR_ACCESS (SQLITE_IOERR | (13<<8)) #define SQLITE_IOERR_CHECKRESERVEDLOCK (SQLITE_IOERR | (14<<8)) #define SQLITE_IOERR_LOCK (SQLITE_IOERR | (15<<8)) -#define SQLITE_IOERR_CLOSE (SQLITE_IOERR | (16<<8)) -#define SQLITE_IOERR_DIR_CLOSE (SQLITE_IOERR | (17<<8)) /* ** CAPI3REF: Flags For File Open Operations {H10230} ** ** These bit values are intended for use in the @@ -587,11 +583,11 @@ ** ** When the SQLITE_SYNC_DATAONLY flag is used, it means that the ** sync operation only needs to flush data to mass storage. Inode ** information need not be flushed. The SQLITE_SYNC_NORMAL flag means ** to use normal fsync() semantics. The SQLITE_SYNC_FULL flag means -** to use Mac OS X style fullsync instead of fsync(). +** to use Mac OS-X style fullsync instead of fsync(). */ #define SQLITE_SYNC_NORMAL 0x00002 #define SQLITE_SYNC_FULL 0x00003 #define SQLITE_SYNC_DATAONLY 0x00010 @@ -619,11 +615,11 @@ ** This object defines the methods used to perform various operations ** against the open file represented by the [sqlite3_file] object. ** ** The flags argument to xSync may be one of [SQLITE_SYNC_NORMAL] or ** [SQLITE_SYNC_FULL]. The first choice is the normal fsync(). -** The second choice is a Mac OS X style fullsync. The [SQLITE_SYNC_DATAONLY] +** The second choice is a Mac OS-X style fullsync. The [SQLITE_SYNC_DATAONLY] ** flag may be ORed in to indicate that only the data of the file ** and not its inode needs to be synced. ** ** The integer values to xLock() and xUnlock() are one of **
    @@ -682,16 +678,10 @@ ** that when data is appended to a file, the data is appended ** first then the size of the file is extended, never the other ** way around. The SQLITE_IOCAP_SEQUENTIAL property means that ** information is written to disk in the same order as calls ** to xWrite(). -** -** If xRead() returns SQLITE_IOERR_SHORT_READ it must also fill -** in the unread portions of the buffer with zeros. A VFS that -** fails to zero-fill short reads might seem to work. However, -** failure to zero-fill short reads will eventually lead to -** database corruption. */ typedef struct sqlite3_io_methods sqlite3_io_methods; struct sqlite3_io_methods { int iVersion; int (*xClose)(sqlite3_file*); @@ -723,13 +713,10 @@ ** into an integer that the pArg argument points to. This capability ** is used during testing and only needs to be supported when SQLITE_TEST ** is defined. */ #define SQLITE_FCNTL_LOCKSTATE 1 -#define SQLITE_GET_LOCKPROXYFILE 2 -#define SQLITE_SET_LOCKPROXYFILE 3 -#define SQLITE_LAST_ERRNO 4 /* ** CAPI3REF: Mutex Handle {H17110} ** ** The mutex module within SQLite defines [sqlite3_mutex] to be an @@ -773,30 +760,30 @@ ** object once the object has been registered. ** ** The zName field holds the name of the VFS module. The name must ** be unique across all VFS modules. ** -** SQLite will guarantee that the zFilename parameter to xOpen +** {H11141} SQLite will guarantee that the zFilename parameter to xOpen ** is either a NULL pointer or string obtained ** from xFullPathname(). SQLite further guarantees that ** the string will be valid and unchanged until xClose() is -** called. Because of the previous sentense, +** called. {END} Because of the previous sentense, ** the [sqlite3_file] can safely store a pointer to the ** filename if it needs to remember the filename for some reason. ** If the zFilename parameter is xOpen is a NULL pointer then xOpen ** must invite its own temporary name for the file. Whenever the ** xFilename parameter is NULL it will also be the case that the ** flags parameter will include [SQLITE_OPEN_DELETEONCLOSE]. ** -** The flags argument to xOpen() includes all bits set in +** {H11142} The flags argument to xOpen() includes all bits set in ** the flags argument to [sqlite3_open_v2()]. Or if [sqlite3_open()] ** or [sqlite3_open16()] is used, then flags includes at least -** [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]. +** [SQLITE_OPEN_READWRITE] | [SQLITE_OPEN_CREATE]. {END} ** If xOpen() opens a file read-only then it sets *pOutFlags to ** include [SQLITE_OPEN_READONLY]. Other bits in *pOutFlags may be set. ** -** SQLite will also add one of the following flags to the xOpen() +** {H11143} SQLite will also add one of the following flags to the xOpen() ** call, depending on the object being opened: ** **
      **
    • [SQLITE_OPEN_MAIN_DB] **
    • [SQLITE_OPEN_MAIN_JOURNAL] @@ -803,11 +790,11 @@ **
    • [SQLITE_OPEN_TEMP_DB] **
    • [SQLITE_OPEN_TEMP_JOURNAL] **
    • [SQLITE_OPEN_TRANSIENT_DB] **
    • [SQLITE_OPEN_SUBJOURNAL] **
    • [SQLITE_OPEN_MASTER_JOURNAL] -**
    +**
{END} ** ** The file I/O implementation can use the object type flags to ** change the way it deals with files. For example, an application ** that does not care about crash recovery or rollback might make ** the open of a journal file a no-op. Writes to this journal would @@ -821,32 +808,32 @@ **
    **
  • [SQLITE_OPEN_DELETEONCLOSE] **
  • [SQLITE_OPEN_EXCLUSIVE] **
** -** The [SQLITE_OPEN_DELETEONCLOSE] flag means the file should be -** deleted when it is closed. The [SQLITE_OPEN_DELETEONCLOSE] +** {H11145} The [SQLITE_OPEN_DELETEONCLOSE] flag means the file should be +** deleted when it is closed. {H11146} The [SQLITE_OPEN_DELETEONCLOSE] ** will be set for TEMP databases, journals and for subjournals. ** -** The [SQLITE_OPEN_EXCLUSIVE] flag means the file should be opened +** {H11147} The [SQLITE_OPEN_EXCLUSIVE] flag means the file should be opened ** for exclusive access. This flag is set for all files except ** for the main database file. ** -** At least szOsFile bytes of memory are allocated by SQLite +** {H11148} At least szOsFile bytes of memory are allocated by SQLite ** to hold the [sqlite3_file] structure passed as the third -** argument to xOpen. The xOpen method does not have to +** argument to xOpen. {END} The xOpen method does not have to ** allocate the structure; it should just fill it in. ** -** The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS] +** {H11149} The flags argument to xAccess() may be [SQLITE_ACCESS_EXISTS] ** to test for the existence of a file, or [SQLITE_ACCESS_READWRITE] to ** test whether a file is readable and writable, or [SQLITE_ACCESS_READ] -** to test whether a file is at least readable. The file can be a +** to test whether a file is at least readable. {END} The file can be a ** directory. ** -** SQLite will always allocate at least mxPathname+1 bytes for the -** output buffer xFullPathname. The exact size of the output buffer -** is also passed as a parameter to both methods. If the output buffer +** {H11150} SQLite will always allocate at least mxPathname+1 bytes for the +** output buffer xFullPathname. {H11151} The exact size of the output buffer +** is also passed as a parameter to both methods. {END} If the output buffer ** is not large enough, [SQLITE_CANTOPEN] should be returned. Since this is ** handled as a fatal error by SQLite, vfs implementations should endeavor ** to prevent this by setting mxPathname to a sufficiently large value. ** ** The xRandomness(), xSleep(), and xCurrentTime() interfaces @@ -856,11 +843,10 @@ ** of good-quality randomness into zOut. The return value is ** the actual number of bytes of randomness obtained. ** The xSleep() method causes the calling thread to sleep for at ** least the number of microseconds given. The xCurrentTime() ** method returns a Julian Day Number for the current date and time. -** */ typedef struct sqlite3_vfs sqlite3_vfs; struct sqlite3_vfs { int iVersion; /* Structure version number */ int szOsFile; /* Size of subclassed sqlite3_file */ @@ -873,11 +859,11 @@ int (*xDelete)(sqlite3_vfs*, const char *zName, int syncDir); int (*xAccess)(sqlite3_vfs*, const char *zName, int flags, int *pResOut); int (*xFullPathname)(sqlite3_vfs*, const char *zName, int nOut, char *zOut); void *(*xDlOpen)(sqlite3_vfs*, const char *zFilename); void (*xDlError)(sqlite3_vfs*, int nByte, char *zErrMsg); - void (*(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol))(void); + void *(*xDlSym)(sqlite3_vfs*,void*, const char *zSymbol); void (*xDlClose)(sqlite3_vfs*, void*); int (*xRandomness)(sqlite3_vfs*, int nByte, char *zOut); int (*xSleep)(sqlite3_vfs*, int microseconds); int (*xCurrentTime)(sqlite3_vfs*, double*); int (*xGetLastError)(sqlite3_vfs*, int, char *); @@ -886,18 +872,18 @@ }; /* ** CAPI3REF: Flags for the xAccess VFS method {H11190} ** -** These integer constants can be used as the third parameter to +** {H11191} These integer constants can be used as the third parameter to ** the xAccess method of an [sqlite3_vfs] object. {END} They determine ** what kind of permissions the xAccess method is looking for. -** With SQLITE_ACCESS_EXISTS, the xAccess method +** {H11192} With SQLITE_ACCESS_EXISTS, the xAccess method ** simply checks whether the file exists. -** With SQLITE_ACCESS_READWRITE, the xAccess method +** {H11193} With SQLITE_ACCESS_READWRITE, the xAccess method ** checks whether the file is both readable and writable. -** With SQLITE_ACCESS_READ, the xAccess method +** {H11194} With SQLITE_ACCESS_READ, the xAccess method ** checks whether the file is readable. */ #define SQLITE_ACCESS_EXISTS 0 #define SQLITE_ACCESS_READWRITE 1 #define SQLITE_ACCESS_READ 2 @@ -1048,11 +1034,11 @@ ** {H14150} A successful call to [sqlite3_config]([SQLITE_CONFIG_SCRATCH],S,Z,N) ** where Z and N are non-negative integers and ** S is a pointer to an aligned memory buffer not less than ** Z*N bytes in size shall cause S to be used by the ** [scratch memory allocator] for as many as N simulataneous -** allocations each of size (Z & ~7). +** allocations each of size Z. ** ** {H14153} A successful call to [sqlite3_config]([SQLITE_CONFIG_SCRATCH],S,Z,N) ** where S is a NULL pointer shall disable the ** [scratch memory allocator]. ** @@ -1060,11 +1046,11 @@ ** [sqlite3_config]([SQLITE_CONFIG_PAGECACHE],S,Z,N) ** where Z and N are non-negative integers and ** S is a pointer to an aligned memory buffer not less than ** Z*N bytes in size shall cause S to be used by the ** [pagecache memory allocator] for as many as N simulataneous -** allocations each of size (Z & ~7). +** allocations each of size Z. ** ** {H14159} A successful call to ** [sqlite3_config]([SQLITE_CONFIG_PAGECACHE],S,Z,N) ** where S is a NULL pointer shall disable the ** [pagecache memory allocator]. @@ -1278,14 +1264,11 @@ ** scratch buffers or if no scratch buffer space is specified, then SQLite ** goes to [sqlite3_malloc()] to obtain the memory it needs. ** **
SQLITE_CONFIG_PAGECACHE
**
This option specifies a static memory buffer that SQLite can use for -** the database page cache with the default page cache implemenation. -** This configuration should not be used if an application-define page -** cache implementation is loaded using the SQLITE_CONFIG_PCACHE option. -** There are three arguments to this option: A pointer to the +** the database page cache. There are three arguments: A pointer to the ** memory, the size of each page buffer (sz), and the number of pages (N). ** The sz argument must be a power of two between 512 and 32768. The first ** argument should point to an allocation of at least sz*N bytes of memory. ** SQLite will use the memory provided by the first argument to satisfy its ** memory needs for the first N pages that it adds to cache. If additional @@ -1326,21 +1309,10 @@ **
This option takes two arguments that determine the default ** memory allcation lookaside optimization. The first argument is the ** size of each lookaside buffer slot and the second is the number of ** slots allocated to each database connection.
** -**
SQLITE_CONFIG_PCACHE
-**
This option takes a single argument which is a pointer to -** an [sqlite3_pcache_methods] object. This object specifies the interface -** to a custom page cache implementation. SQLite makes a copy of the -** object and uses it for page cache memory allocations.
-** -**
SQLITE_CONFIG_GETPCACHE
-**
This option takes a single argument which is a pointer to an -** [sqlite3_pcache_methods] object. SQLite copies of the current -** page cache implementation into that object.
-** ** */ #define SQLITE_CONFIG_SINGLETHREAD 1 /* nil */ #define SQLITE_CONFIG_MULTITHREAD 2 /* nil */ #define SQLITE_CONFIG_SERIALIZED 3 /* nil */ @@ -1350,14 +1322,12 @@ #define SQLITE_CONFIG_PAGECACHE 7 /* void*, int sz, int N */ #define SQLITE_CONFIG_HEAP 8 /* void*, int nByte, int min */ #define SQLITE_CONFIG_MEMSTATUS 9 /* boolean */ #define SQLITE_CONFIG_MUTEX 10 /* sqlite3_mutex_methods* */ #define SQLITE_CONFIG_GETMUTEX 11 /* sqlite3_mutex_methods* */ -/* previously SQLITE_CONFIG_CHUNKALLOC 12 which is now unused. */ +#define SQLITE_CONFIG_CHUNKALLOC 12 /* int threshold */ #define SQLITE_CONFIG_LOOKASIDE 13 /* int int */ -#define SQLITE_CONFIG_PCACHE 14 /* sqlite3_pcache_methods* */ -#define SQLITE_CONFIG_GETPCACHE 15 /* sqlite3_pcache_methods* */ /* ** CAPI3REF: Configuration Options {H10170} ** EXPERIMENTAL ** @@ -1408,22 +1378,22 @@ /* ** CAPI3REF: Last Insert Rowid {H12220} ** ** Each entry in an SQLite table has a unique 64-bit signed -** integer key called the [ROWID | "rowid"]. The rowid is always available +** integer key called the "rowid". The rowid is always available ** as an undeclared column named ROWID, OID, or _ROWID_ as long as those ** names are not also used by explicitly declared columns. If -** the table has a column of type [INTEGER PRIMARY KEY] then that column +** the table has a column of type INTEGER PRIMARY KEY then that column ** is another alias for the rowid. ** -** This routine returns the [rowid] of the most recent +** This routine returns the rowid of the most recent ** successful [INSERT] into the database from the [database connection] ** in the first argument. If no successful [INSERT]s ** have ever occurred on that database connection, zero is returned. ** -** If an [INSERT] occurs within a trigger, then the [rowid] of the inserted +** If an [INSERT] occurs within a trigger, then the rowid of the inserted ** row is returned by this routine as long as the trigger is running. ** But once the trigger terminates, the value returned by this routine ** reverts to the last value inserted before the trigger fired. ** ** An [INSERT] that fails due to a constraint violation is not a @@ -1439,12 +1409,11 @@ ** For the purposes of this routine, an [INSERT] is considered to ** be successful even if it is subsequently rolled back. ** ** INVARIANTS: ** -** {H12221} The [sqlite3_last_insert_rowid()] function shall return -** the [rowid] +** {H12221} The [sqlite3_last_insert_rowid()] function shall return the rowid ** of the most recent successful [INSERT] performed on the same ** [database connection] and within the same or higher level ** trigger context, or zero if there have been no qualifying ** [INSERT] statements. ** @@ -1454,14 +1423,14 @@ ** ** ASSUMPTIONS: ** ** {A12232} If a separate thread performs a new [INSERT] on the same ** database connection while the [sqlite3_last_insert_rowid()] -** function is running and thus changes the last insert [rowid], +** function is running and thus changes the last insert rowid, ** then the value returned by [sqlite3_last_insert_rowid()] is ** unpredictable and might not equal either the old or the new -** last insert [rowid]. +** last insert rowid. */ sqlite3_int64 sqlite3_last_insert_rowid(sqlite3*); /* ** CAPI3REF: Count The Number Of Rows Modified {H12240} @@ -2033,11 +2002,11 @@ ** to sqlite3_free() is harmless. After being freed, memory ** should neither be read nor written. Even reading previously freed ** memory might result in a segmentation fault or other severe error. ** Memory corruption, a segmentation fault, or other severe error ** might result if sqlite3_free() is called with a non-NULL pointer that -** was not obtained from sqlite3_malloc() or sqlite3_realloc(). +** was not obtained from sqlite3_malloc() or sqlite3_free(). ** ** The sqlite3_realloc() interface attempts to resize a ** prior memory allocation to be at least N bytes, where N is the ** second parameter. The memory allocation to be resized is the first ** parameter. If the first parameter to sqlite3_realloc() @@ -2168,12 +2137,12 @@ /* ** CAPI3REF: Pseudo-Random Number Generator {H17390} ** ** SQLite contains a high-quality pseudo-random number generator (PRNG) used to -** select random [ROWID | ROWIDs] when inserting new records into a table that -** already uses the largest possible [ROWID]. The PRNG is also used for +** select random ROWIDs when inserting new records into a table that +** already uses the largest possible ROWID. The PRNG is also used for ** the build-in random() and randomblob() SQL functions. This interface allows ** applications to access the same PRNG for other purposes. ** ** A call to this routine stores N bytes of randomness into buffer P. ** @@ -2395,21 +2364,20 @@ #define SQLITE_DROP_VIEW 17 /* View Name NULL */ #define SQLITE_INSERT 18 /* Table Name NULL */ #define SQLITE_PRAGMA 19 /* Pragma Name 1st arg or NULL */ #define SQLITE_READ 20 /* Table Name Column Name */ #define SQLITE_SELECT 21 /* NULL NULL */ -#define SQLITE_TRANSACTION 22 /* Operation NULL */ +#define SQLITE_TRANSACTION 22 /* NULL NULL */ #define SQLITE_UPDATE 23 /* Table Name Column Name */ #define SQLITE_ATTACH 24 /* Filename NULL */ #define SQLITE_DETACH 25 /* Database Name NULL */ #define SQLITE_ALTER_TABLE 26 /* Database Name Table Name */ #define SQLITE_REINDEX 27 /* Index Name NULL */ #define SQLITE_ANALYZE 28 /* Table Name NULL */ #define SQLITE_CREATE_VTABLE 29 /* Table Name Module Name */ #define SQLITE_DROP_VTABLE 30 /* Table Name Module Name */ -#define SQLITE_FUNCTION 31 /* NULL Function Name */ -#define SQLITE_SAVEPOINT 32 /* Operation Savepoint Name */ +#define SQLITE_FUNCTION 31 /* Function Name NULL */ #define SQLITE_COPY 0 /* No longer used */ /* ** CAPI3REF: Tracing And Profiling Functions {H12280} ** EXPERIMENTAL @@ -2688,44 +2656,27 @@ ** ** The sqlite3_errcode() interface returns the numeric [result code] or ** [extended result code] for the most recent failed sqlite3_* API call ** associated with a [database connection]. If a prior API call failed ** but the most recent API call succeeded, the return value from -** sqlite3_errcode() is undefined. The sqlite3_extended_errcode() -** interface is the same except that it always returns the -** [extended result code] even when extended result codes are -** disabled. +** sqlite3_errcode() is undefined. ** ** The sqlite3_errmsg() and sqlite3_errmsg16() return English-language ** text that describes the error, as either UTF-8 or UTF-16 respectively. ** Memory to hold the error message string is managed internally. ** The application does not need to worry about freeing the result. ** However, the error string might be overwritten or deallocated by ** subsequent calls to other SQLite interface functions. ** -** When the serialized [threading mode] is in use, it might be the -** case that a second error occurs on a separate thread in between -** the time of the first error and the call to these interfaces. -** When that happens, the second error will be reported since these -** interfaces always report the most recent result. To avoid -** this, each thread can obtain exclusive use of the [database connection] D -** by invoking [sqlite3_mutex_enter]([sqlite3_db_mutex](D)) before beginning -** to use D and invoking [sqlite3_mutex_leave]([sqlite3_db_mutex](D)) after -** all calls to the interfaces listed here are completed. -** ** If an interface fails with SQLITE_MISUSE, that means the interface ** was invoked incorrectly by the application. In that case, the ** error code and message may or may not be set. ** ** INVARIANTS: ** ** {H12801} The [sqlite3_errcode(D)] interface returns the numeric ** [result code] or [extended result code] for the most recently -** failed interface call associated with the [database connection] D. -** -** {H12802} The [sqlite3_extended_errcode(D)] interface returns the numeric -** [extended result code] for the most recently ** failed interface call associated with the [database connection] D. ** ** {H12803} The [sqlite3_errmsg(D)] and [sqlite3_errmsg16(D)] ** interfaces return English-language text that describes ** the error in the mostly recently failed interface call, @@ -2735,22 +2686,19 @@ ** are valid until the next SQLite interface call. ** ** {H12808} Calls to API routines that do not return an error code ** (example: [sqlite3_data_count()]) do not ** change the error code or message returned by -** [sqlite3_errcode()], [sqlite3_extended_errcode()], -** [sqlite3_errmsg()], or [sqlite3_errmsg16()]. +** [sqlite3_errcode()], [sqlite3_errmsg()], or [sqlite3_errmsg16()]. ** ** {H12809} Interfaces that are not associated with a specific ** [database connection] (examples: ** [sqlite3_mprintf()] or [sqlite3_enable_shared_cache()] ** do not change the values returned by -** [sqlite3_errcode()], [sqlite3_extended_errcode()], -** [sqlite3_errmsg()], or [sqlite3_errmsg16()]. +** [sqlite3_errcode()], [sqlite3_errmsg()], or [sqlite3_errmsg16()]. */ int sqlite3_errcode(sqlite3 *db); -int sqlite3_extended_errcode(sqlite3 *db); const char *sqlite3_errmsg(sqlite3*); const void *sqlite3_errmsg16(sqlite3*); /* ** CAPI3REF: SQL Statement Object {H13000} @@ -4173,11 +4121,11 @@ ** ** These functions are [deprecated]. In order to maintain ** backwards compatibility with older code, these functions continue ** to be supported. However, new applications should avoid ** the use of these functions. To help encourage people to avoid -** using these functions, we are not going to tell you what they do. +** using these functions, we are not going to tell you want they do. */ #ifndef SQLITE_OMIT_DEPRECATED SQLITE_DEPRECATED int sqlite3_aggregate_count(sqlite3_context*); SQLITE_DEPRECATED int sqlite3_expired(sqlite3_stmt*); SQLITE_DEPRECATED int sqlite3_transfer_bindings(sqlite3_stmt*, sqlite3_stmt*); @@ -4975,12 +4923,12 @@ /* ** CAPI3REF: Find The Database Handle Of A Prepared Statement {H13120} ** ** The sqlite3_db_handle interface returns the [database connection] handle -** to which a [prepared statement] belongs. The [database connection] -** returned by sqlite3_db_handle is the same [database connection] that was the first argument +** to which a [prepared statement] belongs. The database handle returned by +** sqlite3_db_handle is the same database handle that was the first argument ** to the [sqlite3_prepare_v2()] call (or its variants) that was used to ** create the statement in the first place. ** ** INVARIANTS: ** @@ -5119,12 +5067,12 @@ ** The second callback argument is one of [SQLITE_INSERT], [SQLITE_DELETE], ** or [SQLITE_UPDATE], depending on the operation that caused the callback ** to be invoked. ** The third and fourth arguments to the callback contain pointers to the ** database and table name containing the affected row. -** The final callback parameter is the [rowid] of the row. -** In the case of an update, this is the [rowid] after the update takes place. +** The final callback parameter is the rowid of the row. In the case of +** an update, this is the rowid after the update takes place. ** ** The update hook is not invoked when internal system tables are ** modified (i.e. sqlite_master and sqlite_sequence). ** ** The update hook implementation must not do anything that will modify @@ -5163,11 +5111,11 @@ ** ** {H12983} The third and fourth arguments to the callback contain pointers ** to zero-terminated UTF-8 strings which are the names of the ** database and table that is being updated. -** {H12985} The final callback parameter is the [rowid] of the row after +** {H12985} The final callback parameter is the rowid of the row after ** the change occurs. */ void *sqlite3_update_hook( sqlite3*, void(*)(void *,int ,char const *,char const *,sqlite3_int64), @@ -5329,11 +5277,11 @@ ** ** 5th const char* Data type ** 6th const char* Name of default collation sequence ** 7th int True if column has a NOT NULL constraint ** 8th int True if column is part of the PRIMARY KEY -** 9th int True if column is [AUTOINCREMENT] +** 9th int True if column is AUTOINCREMENT ** ** ** ** The memory pointed to by the character pointers returned for the ** declaration type and collation sequence is valid only until the next @@ -5340,13 +5288,13 @@ ** call to any SQLite API function. ** ** If the specified table is actually a view, an [error code] is returned. ** ** If the specified column is "rowid", "oid" or "_rowid_" and an -** [INTEGER PRIMARY KEY] column has been explicitly declared, then the output +** INTEGER PRIMARY KEY column has been explicitly declared, then the output ** parameters are set for the explicitly declared column. If there is no -** explicitly declared [INTEGER PRIMARY KEY] column, then the output +** explicitly declared INTEGER PRIMARY KEY column, then the output ** parameters are set as follows: ** **
 **     data type: "INTEGER"
 **     collation sequence: "BINARY"
@@ -5449,11 +5397,11 @@
 ** {H12643} This routine stores a pointer to the extension in an array
 **          that is obtained from [sqlite3_malloc()].
 **
 ** {H12644} Automatic extensions apply across all threads.
 */
-int sqlite3_auto_extension(void (*xEntryPoint)(void));
+int sqlite3_auto_extension(void *xEntryPoint);
 
 /*
 ** CAPI3REF: Reset Automatic Extension Loading {H12660} 
 **
 ** This function disables all previously registered automatic
@@ -5766,11 +5714,11 @@
 ** This interfaces opens a [BLOB handle | handle] to the BLOB located
 ** in row iRow, column zColumn, table zTable in database zDb;
 ** in other words, the same BLOB that would be selected by:
 **
 ** 
-**     SELECT zColumn FROM zDb.zTable WHERE [rowid] = iRow;
+**     SELECT zColumn FROM zDb.zTable WHERE rowid = iRow;
 ** 
{END} ** ** If the flags parameter is non-zero, the the BLOB is opened for read ** and write access. If it is zero, the BLOB is opened for read access. ** @@ -5815,11 +5763,10 @@ ** {H17819} The [sqlite3_blob_open()] interface shall return [SQLITE_OK] on ** success and an appropriate [error code] on failure. ** ** {H17821} If an error occurs during evaluation of [sqlite3_blob_open(D,...)] ** then subsequent calls to [sqlite3_errcode(D)], -** [sqlite3_extended_errcode()], ** [sqlite3_errmsg(D)], and [sqlite3_errmsg16(D)] shall return ** information appropriate for that error. ** ** {H17824} If any column in the row that a [sqlite3_blob] has open is ** changed by a separate [UPDATE] or [DELETE] statement or by @@ -5929,11 +5876,10 @@ ** the [sqlite3_blob_read(P,Z,N,X)] interface shall return an ** appropriate [error code] or [extended error code]. ** ** {H17868} If an error occurs during evaluation of [sqlite3_blob_read(P,...)] ** then subsequent calls to [sqlite3_errcode(D)], -** [sqlite3_extended_errcode()], ** [sqlite3_errmsg(D)], and [sqlite3_errmsg16(D)] shall return ** information appropriate for that error, where D is the ** [database connection] that was used to open the [BLOB handle] P. */ int sqlite3_blob_read(sqlite3_blob *, void *Z, int N, int iOffset); @@ -5999,11 +5945,10 @@ ** the [sqlite3_blob_write(P,Z,N,X)] interface shall return an ** appropriate [error code] or [extended error code]. ** ** {H17888} If an error occurs during evaluation of [sqlite3_blob_write(D,...)] ** then subsequent calls to [sqlite3_errcode(D)], -** [sqlite3_extended_errcode()], ** [sqlite3_errmsg(D)], and [sqlite3_errmsg16(D)] shall return ** information appropriate for that error. */ int sqlite3_blob_write(sqlite3_blob *, const void *z, int n, int iOffset); @@ -6297,21 +6242,10 @@ #define SQLITE_MUTEX_STATIC_MEM2 4 /* sqlite3_release_memory() */ #define SQLITE_MUTEX_STATIC_PRNG 5 /* sqlite3_random() */ #define SQLITE_MUTEX_STATIC_LRU 6 /* lru page list */ #define SQLITE_MUTEX_STATIC_LRU2 7 /* lru page list */ -/* -** CAPI3REF: Retrieve the mutex for a database connection {H17002} -** -** This interface returns a pointer the [sqlite3_mutex] object that -** serializes access to the [database connection] given in the argument -** when the [threading mode] is Serialized. -** If the [threading mode] is Single-thread or Multi-thread then this -** routine returns a NULL pointer. -*/ -sqlite3_mutex *sqlite3_db_mutex(sqlite3*); - /* ** CAPI3REF: Low-Level Control Of Database Files {H11300} ** ** {H11301} The [sqlite3_file_control()] interface makes a direct call to the ** xFileControl method for the [sqlite3_io_methods] object associated @@ -6370,11 +6304,10 @@ #define SQLITE_TESTCTRL_PRNG_RESTORE 6 #define SQLITE_TESTCTRL_PRNG_RESET 7 #define SQLITE_TESTCTRL_BITVEC_TEST 8 #define SQLITE_TESTCTRL_FAULT_INSTALL 9 #define SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS 10 -#define SQLITE_TESTCTRL_PENDING_BYTE 11 /* ** CAPI3REF: SQLite Runtime Status {H17200} ** EXPERIMENTAL ** @@ -6578,349 +6511,10 @@ ** */ #define SQLITE_STMTSTATUS_FULLSCAN_STEP 1 #define SQLITE_STMTSTATUS_SORT 2 -/* -** CAPI3REF: Custom Page Cache Object -** EXPERIMENTAL -** -** The sqlite3_pcache type is opaque. It is implemented by -** the pluggable module. The SQLite core has no knowledge of -** its size or internal structure and never deals with the -** sqlite3_pcache object except by holding and passing pointers -** to the object. -** -** See [sqlite3_pcache_methods] for additional information. -*/ -typedef struct sqlite3_pcache sqlite3_pcache; - -/* -** CAPI3REF: Application Defined Page Cache. -** EXPERIMENTAL -** -** The [sqlite3_config]([SQLITE_CONFIG_PCACHE], ...) interface can -** register an alternative page cache implementation by passing in an -** instance of the sqlite3_pcache_methods structure. The majority of the -** heap memory used by sqlite is used by the page cache to cache data read -** from, or ready to be written to, the database file. By implementing a -** custom page cache using this API, an application can control more -** precisely the amount of memory consumed by sqlite, the way in which -** said memory is allocated and released, and the policies used to -** determine exactly which parts of a database file are cached and for -** how long. -** -** The contents of the structure are copied to an internal buffer by sqlite -** within the call to [sqlite3_config]. -** -** The xInit() method is called once for each call to [sqlite3_initialize()] -** (usually only once during the lifetime of the process). It is passed -** a copy of the sqlite3_pcache_methods.pArg value. It can be used to set -** up global structures and mutexes required by the custom page cache -** implementation. The xShutdown() method is called from within -** [sqlite3_shutdown()], if the application invokes this API. It can be used -** to clean up any outstanding resources before process shutdown, if required. -** -** The xCreate() method is used to construct a new cache instance. The -** first parameter, szPage, is the size in bytes of the pages that must -** be allocated by the cache. szPage will not be a power of two. The -** second argument, bPurgeable, is true if the cache being created will -** be used to cache database pages read from a file stored on disk, or -** false if it is used for an in-memory database. The cache implementation -** does not have to do anything special based on the value of bPurgeable, -** it is purely advisory. -** -** The xCachesize() method may be called at any time by SQLite to set the -** suggested maximum cache-size (number of pages stored by) the cache -** instance passed as the first argument. This is the value configured using -** the SQLite "[PRAGMA cache_size]" command. As with the bPurgeable parameter, -** the implementation is not required to do anything special with this -** value, it is advisory only. -** -** The xPagecount() method should return the number of pages currently -** stored in the cache supplied as an argument. -** -** The xFetch() method is used to fetch a page and return a pointer to it. -** A 'page', in this context, is a buffer of szPage bytes aligned at an -** 8-byte boundary. The page to be fetched is determined by the key. The -** mimimum key value is 1. After it has been retrieved using xFetch, the page -** is considered to be pinned. -** -** If the requested page is already in the page cache, then a pointer to -** the cached buffer should be returned with its contents intact. If the -** page is not already in the cache, then the expected behaviour of the -** cache is determined by the value of the createFlag parameter passed -** to xFetch, according to the following table: -** -** -**
createFlagExpected Behaviour -**
0NULL should be returned. No new cache entry is created. -**
1If createFlag is set to 1, this indicates that -** SQLite is holding pinned pages that can be unpinned -** by writing their contents to the database file (a -** relatively expensive operation). In this situation the -** cache implementation has two choices: it can return NULL, -** in which case SQLite will attempt to unpin one or more -** pages before re-requesting the same page, or it can -** allocate a new page and return a pointer to it. If a new -** page is allocated, then the first sizeof(void*) bytes of -** it (at least) must be zeroed before it is returned. -**
2If createFlag is set to 2, then SQLite is not holding any -** pinned pages associated with the specific cache passed -** as the first argument to xFetch() that can be unpinned. The -** cache implementation should attempt to allocate a new -** cache entry and return a pointer to it. Again, the first -** sizeof(void*) bytes of the page should be zeroed before -** it is returned. If the xFetch() method returns NULL when -** createFlag==2, SQLite assumes that a memory allocation -** failed and returns SQLITE_NOMEM to the user. -**
-** -** xUnpin() is called by SQLite with a pointer to a currently pinned page -** as its second argument. If the third parameter, discard, is non-zero, -** then the page should be evicted from the cache. In this case SQLite -** assumes that the next time the page is retrieved from the cache using -** the xFetch() method, it will be zeroed. If the discard parameter is -** zero, then the page is considered to be unpinned. The cache implementation -** may choose to reclaim (free or recycle) unpinned pages at any time. -** SQLite assumes that next time the page is retrieved from the cache -** it will either be zeroed, or contain the same data that it did when it -** was unpinned. -** -** The cache is not required to perform any reference counting. A single -** call to xUnpin() unpins the page regardless of the number of prior calls -** to xFetch(). -** -** The xRekey() method is used to change the key value associated with the -** page passed as the second argument from oldKey to newKey. If the cache -** previously contains an entry associated with newKey, it should be -** discarded. Any prior cache entry associated with newKey is guaranteed not -** to be pinned. -** -** When SQLite calls the xTruncate() method, the cache must discard all -** existing cache entries with page numbers (keys) greater than or equal -** to the value of the iLimit parameter passed to xTruncate(). If any -** of these pages are pinned, they are implicitly unpinned, meaning that -** they can be safely discarded. -** -** The xDestroy() method is used to delete a cache allocated by xCreate(). -** All resources associated with the specified cache should be freed. After -** calling the xDestroy() method, SQLite considers the [sqlite3_pcache*] -** handle invalid, and will not use it with any other sqlite3_pcache_methods -** functions. -*/ -typedef struct sqlite3_pcache_methods sqlite3_pcache_methods; -struct sqlite3_pcache_methods { - void *pArg; - int (*xInit)(void*); - void (*xShutdown)(void*); - sqlite3_pcache *(*xCreate)(int szPage, int bPurgeable); - void (*xCachesize)(sqlite3_pcache*, int nCachesize); - int (*xPagecount)(sqlite3_pcache*); - void *(*xFetch)(sqlite3_pcache*, unsigned key, int createFlag); - void (*xUnpin)(sqlite3_pcache*, void*, int discard); - void (*xRekey)(sqlite3_pcache*, void*, unsigned oldKey, unsigned newKey); - void (*xTruncate)(sqlite3_pcache*, unsigned iLimit); - void (*xDestroy)(sqlite3_pcache*); -}; - -/* -** CAPI3REF: Online Backup Object -** EXPERIMENTAL -** -** The sqlite3_backup object records state information about an ongoing -** online backup operation. The sqlite3_backup object is created by -** a call to [sqlite3_backup_init()] and is destroyed by a call to -** [sqlite3_backup_finish()]. -** -** See Also: [Using the SQLite Online Backup API] -*/ -typedef struct sqlite3_backup sqlite3_backup; - -/* -** CAPI3REF: Online Backup API. -** EXPERIMENTAL -** -** This API is used to overwrite the contents of one database with that -** of another. It is useful either for creating backups of databases or -** for copying in-memory databases to or from persistent files. -** -** See Also: [Using the SQLite Online Backup API] -** -** Exclusive access is required to the destination database for the -** duration of the operation. However the source database is only -** read-locked while it is actually being read, it is not locked -** continuously for the entire operation. Thus, the backup may be -** performed on a live database without preventing other users from -** writing to the database for an extended period of time. -** -** To perform a backup operation: -**
    -**
  1. sqlite3_backup_init() is called once to initialize the -** backup, -**
  2. sqlite3_backup_step() is called one or more times to transfer -** the data between the two databases, and finally -**
  3. sqlite3_backup_finish() is called to release all resources -** associated with the backup operation. -**
-** There should be exactly one call to sqlite3_backup_finish() for each -** successful call to sqlite3_backup_init(). -** -** sqlite3_backup_init() -** -** The first two arguments passed to [sqlite3_backup_init()] are the database -** handle associated with the destination database and the database name -** used to attach the destination database to the handle. The database name -** is "main" for the main database, "temp" for the temporary database, or -** the name specified as part of the [ATTACH] statement if the destination is -** an attached database. The third and fourth arguments passed to -** sqlite3_backup_init() identify the [database connection] -** and database name used -** to access the source database. The values passed for the source and -** destination [database connection] parameters must not be the same. -** -** If an error occurs within sqlite3_backup_init(), then NULL is returned -** and an error code and error message written into the [database connection] -** passed as the first argument. They may be retrieved using the -** [sqlite3_errcode()], [sqlite3_errmsg()], and [sqlite3_errmsg16()] functions. -** Otherwise, if successful, a pointer to an [sqlite3_backup] object is -** returned. This pointer may be used with the sqlite3_backup_step() and -** sqlite3_backup_finish() functions to perform the specified backup -** operation. -** -** sqlite3_backup_step() -** -** Function [sqlite3_backup_step()] is used to copy up to nPage pages between -** the source and destination databases, where nPage is the value of the -** second parameter passed to sqlite3_backup_step(). If nPage is a negative -** value, all remaining source pages are copied. If the required pages are -** succesfully copied, but there are still more pages to copy before the -** backup is complete, it returns [SQLITE_OK]. If no error occured and there -** are no more pages to copy, then [SQLITE_DONE] is returned. If an error -** occurs, then an SQLite error code is returned. As well as [SQLITE_OK] and -** [SQLITE_DONE], a call to sqlite3_backup_step() may return [SQLITE_READONLY], -** [SQLITE_NOMEM], [SQLITE_BUSY], [SQLITE_LOCKED], or an -** [SQLITE_IOERR_ACCESS | SQLITE_IOERR_XXX] extended error code. -** -** As well as the case where the destination database file was opened for -** read-only access, sqlite3_backup_step() may return [SQLITE_READONLY] if -** the destination is an in-memory database with a different page size -** from the source database. -** -** If sqlite3_backup_step() cannot obtain a required file-system lock, then -** the [sqlite3_busy_handler | busy-handler function] -** is invoked (if one is specified). If the -** busy-handler returns non-zero before the lock is available, then -** [SQLITE_BUSY] is returned to the caller. In this case the call to -** sqlite3_backup_step() can be retried later. If the source -** [database connection] -** is being used to write to the source database when sqlite3_backup_step() -** is called, then [SQLITE_LOCKED] is returned immediately. Again, in this -** case the call to sqlite3_backup_step() can be retried later on. If -** [SQLITE_IOERR_ACCESS | SQLITE_IOERR_XXX], [SQLITE_NOMEM], or -** [SQLITE_READONLY] is returned, then -** there is no point in retrying the call to sqlite3_backup_step(). These -** errors are considered fatal. At this point the application must accept -** that the backup operation has failed and pass the backup operation handle -** to the sqlite3_backup_finish() to release associated resources. -** -** Following the first call to sqlite3_backup_step(), an exclusive lock is -** obtained on the destination file. It is not released until either -** sqlite3_backup_finish() is called or the backup operation is complete -** and sqlite3_backup_step() returns [SQLITE_DONE]. Additionally, each time -** a call to sqlite3_backup_step() is made a [shared lock] is obtained on -** the source database file. This lock is released before the -** sqlite3_backup_step() call returns. Because the source database is not -** locked between calls to sqlite3_backup_step(), it may be modified mid-way -** through the backup procedure. If the source database is modified by an -** external process or via a database connection other than the one being -** used by the backup operation, then the backup will be transparently -** restarted by the next call to sqlite3_backup_step(). If the source -** database is modified by the using the same database connection as is used -** by the backup operation, then the backup database is transparently -** updated at the same time. -** -** sqlite3_backup_finish() -** -** Once sqlite3_backup_step() has returned [SQLITE_DONE], or when the -** application wishes to abandon the backup operation, the [sqlite3_backup] -** object should be passed to sqlite3_backup_finish(). This releases all -** resources associated with the backup operation. If sqlite3_backup_step() -** has not yet returned [SQLITE_DONE], then any active write-transaction on the -** destination database is rolled back. The [sqlite3_backup] object is invalid -** and may not be used following a call to sqlite3_backup_finish(). -** -** The value returned by sqlite3_backup_finish is [SQLITE_OK] if no error -** occurred, regardless or whether or not sqlite3_backup_step() was called -** a sufficient number of times to complete the backup operation. Or, if -** an out-of-memory condition or IO error occured during a call to -** sqlite3_backup_step() then [SQLITE_NOMEM] or an -** [SQLITE_IOERR_ACCESS | SQLITE_IOERR_XXX] error code -** is returned. In this case the error code and an error message are -** written to the destination [database connection]. -** -** A return of [SQLITE_BUSY] or [SQLITE_LOCKED] from sqlite3_backup_step() is -** not a permanent error and does not affect the return value of -** sqlite3_backup_finish(). -** -** sqlite3_backup_remaining(), sqlite3_backup_pagecount() -** -** Each call to sqlite3_backup_step() sets two values stored internally -** by an [sqlite3_backup] object. The number of pages still to be backed -** up, which may be queried by sqlite3_backup_remaining(), and the total -** number of pages in the source database file, which may be queried by -** sqlite3_backup_pagecount(). -** -** The values returned by these functions are only updated by -** sqlite3_backup_step(). If the source database is modified during a backup -** operation, then the values are not updated to account for any extra -** pages that need to be updated or the size of the source database file -** changing. -** -** Concurrent Usage of Database Handles -** -** The source [database connection] may be used by the application for other -** purposes while a backup operation is underway or being initialized. -** If SQLite is compiled and configured to support threadsafe database -** connections, then the source database connection may be used concurrently -** from within other threads. -** -** However, the application must guarantee that the destination database -** connection handle is not passed to any other API (by any thread) after -** sqlite3_backup_init() is called and before the corresponding call to -** sqlite3_backup_finish(). Unfortunately SQLite does not currently check -** for this, if the application does use the destination [database connection] -** for some other purpose during a backup operation, things may appear to -** work correctly but in fact be subtly malfunctioning. Use of the -** destination database connection while a backup is in progress might -** also cause a mutex deadlock. -** -** Furthermore, if running in [shared cache mode], the application must -** guarantee that the shared cache used by the destination database -** is not accessed while the backup is running. In practice this means -** that the application must guarantee that the file-system file being -** backed up to is not accessed by any connection within the process, -** not just the specific connection that was passed to sqlite3_backup_init(). -** -** The [sqlite3_backup] object itself is partially threadsafe. Multiple -** threads may safely make multiple concurrent calls to sqlite3_backup_step(). -** However, the sqlite3_backup_remaining() and sqlite3_backup_pagecount() -** APIs are not strictly speaking threadsafe. If they are invoked at the -** same time as another thread is invoking sqlite3_backup_step() it is -** possible that they return invalid values. -*/ -sqlite3_backup *sqlite3_backup_init( - sqlite3 *pDest, /* Destination database handle */ - const char *zDestName, /* Destination database name */ - sqlite3 *pSource, /* Source database handle */ - const char *zSourceName /* Source database name */ -); -int sqlite3_backup_step(sqlite3_backup *p, int nPage); -int sqlite3_backup_finish(sqlite3_backup *p); -int sqlite3_backup_remaining(sqlite3_backup *p); -int sqlite3_backup_pagecount(sqlite3_backup *p); - /* ** Undo the hack that converts floating point types to integer for ** builds on processors without floating point support. */ #ifdef SQLITE_OMIT_FLOATING_POINT Index: src/sqliteInt.h ================================================================== --- src/sqliteInt.h +++ src/sqliteInt.h @@ -9,11 +9,11 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* ** Internal interface definitions for SQLite. ** -** @(#) $Id: sqliteInt.h,v 1.833 2009/02/05 16:53:43 drh Exp $ +** @(#) $Id: sqliteInt.h,v 1.784 2008/10/13 15:35:09 drh Exp $ */ #ifndef _SQLITEINT_H_ #define _SQLITEINT_H_ /* @@ -30,11 +30,11 @@ #if defined(__BORLANDC__) #pragma warn -rch /* unreachable code */ #pragma warn -ccc /* Condition is always true or false */ #pragma warn -aus /* Assigned value is never used */ #pragma warn -csu /* Comparing signed and unsigned */ -#pragma warn -spa /* Suspicious pointer arithmetic */ +#pragma warn -spa /* Suspicous pointer arithmetic */ #endif /* Needed for various definitions... */ #ifndef _GNU_SOURCE # define _GNU_SOURCE @@ -48,10 +48,59 @@ #endif #ifdef HAVE_INTTYPES_H #include #endif +/* +** A macro used to aid in coverage testing. When doing coverage +** testing, the condition inside the argument must be evaluated +** both true and false in order to get full branch coverage. +** This macro can be inserted to ensure adequate test coverage +** in places where simple condition/decision coverage is inadequate. +*/ +#ifdef SQLITE_COVERAGE_TEST + void sqlite3Coverage(int); +# define testcase(X) if( X ){ sqlite3Coverage(__LINE__); } +#else +# define testcase(X) +#endif + +/* +** The ALWAYS and NEVER macros surround boolean expressions which +** are intended to always be true or false, respectively. Such +** expressions could be omitted from the code completely. But they +** are included in a few cases in order to enhance the resilience +** of SQLite to unexpected behavior - to make the code "self-healing" +** or "ductile" rather than being "brittle" and crashing at the first +** hint of unplanned behavior. +** +** When doing coverage testing ALWAYS and NEVER are hard-coded to +** be true and false so that the unreachable code then specify will +** not be counted as untested code. +*/ +#ifdef SQLITE_COVERAGE_TEST +# define ALWAYS(X) (1) +# define NEVER(X) (0) +#else +# define ALWAYS(X) (X) +# define NEVER(X) (X) +#endif + +/* +** The macro unlikely() is a hint that surrounds a boolean +** expression that is usually false. Macro likely() surrounds +** a boolean expression that is usually true. GCC is able to +** use these hints to generate better code, sometimes. +*/ +#if defined(__GNUC__) && 0 +# define likely(X) __builtin_expect((X),1) +# define unlikely(X) __builtin_expect((X),0) +#else +# define likely(X) !!(X) +# define unlikely(X) !!(X) +#endif + /* * This macro is used to "hide" some ugliness in casting an int * value to a ptr value under the MSVC 64-bit compiler. Casting * non 64-bit values to ptr types results in a "hard" error with * the MSVC 64-bit compiler which this attempts to avoid. @@ -66,27 +115,27 @@ */ #define SQLITE_INT_TO_PTR(X) ((void*)&((char*)0)[X]) #define SQLITE_PTR_TO_INT(X) ((int)(((char*)X)-(char*)0)) /* -** These #defines should enable >2GB file support on POSIX if the +** These #defines should enable >2GB file support on Posix if the ** underlying operating system supports it. If the OS lacks ** large file support, or if the OS is windows, these should be no-ops. ** ** Ticket #2739: The _LARGEFILE_SOURCE macro must appear before any ** system #includes. Hence, this block of code must be the very first ** code in all source files. ** ** Large file support can be disabled using the -DSQLITE_DISABLE_LFS switch ** on the compiler command line. This is necessary if you are compiling -** on a recent machine (ex: Red Hat 7.2) but you want your code to work -** on an older machine (ex: Red Hat 6.0). If you compile on Red Hat 7.2 +** on a recent machine (ex: RedHat 7.2) but you want your code to work +** on an older machine (ex: RedHat 6.0). If you compile on RedHat 7.2 ** without this option, LFS is enable. But LFS does not exist in the kernel -** in Red Hat 6.0, so the code won't work. Hence, for maximum binary +** in RedHat 6.0, so the code won't work. Hence, for maximum binary ** portability you should omit LFS. ** -** Similar is true for Mac OS X. LFS is only supported on Mac OS X 9 and later. +** Similar is true for MacOS. LFS is only supported on MacOS 9 and later. */ #ifndef SQLITE_DISABLE_LFS # define _LARGE_FILE 1 # ifndef _FILE_OFFSET_BITS # define _FILE_OFFSET_BITS 64 @@ -109,11 +158,11 @@ #endif /* ** The SQLITE_DEFAULT_MEMSTATUS macro must be defined as either 0 or 1. ** It determines whether or not the features related to -** SQLITE_CONFIG_MEMSTATUS are available by default or not. This value can +** SQLITE_CONFIG_MEMSTATUS are availabe by default or not. This value can ** be overridden at runtime using the sqlite3_config() API. */ #if !defined(SQLITE_DEFAULT_MEMSTATUS) # define SQLITE_DEFAULT_MEMSTATUS 1 #endif @@ -152,11 +201,11 @@ # define SQLITE_MALLOC_SOFT_LIMIT 1024 #endif /* ** We need to define _XOPEN_SOURCE as follows in order to enable -** recursive mutexes on most Unix systems. But Mac OS X is different. +** recursive mutexes on most unix systems. But Mac OS X is different. ** The _XOPEN_SOURCE define causes problems for Mac OS X we are told, ** so it is omitted there. See ticket #2673. ** ** Later we learn that _XOPEN_SOURCE is poorly or incorrectly ** implemented on some systems. So we avoid defining it at all @@ -185,97 +234,10 @@ */ #if !defined(NDEBUG) && !defined(SQLITE_DEBUG) # define NDEBUG 1 #endif -/* -** The testcase() macro is used to aid in coverage testing. When -** doing coverage testing, the condition inside the argument to -** testcase() must be evaluated both true and false in order to -** get full branch coverage. The testcase() macro is inserted -** to help ensure adequate test coverage in places where simple -** condition/decision coverage is inadequate. For example, testcase() -** can be used to make sure boundary values are tested. For -** bitmask tests, testcase() can be used to make sure each bit -** is significant and used at least once. On switch statements -** where multiple cases go to the same block of code, testcase() -** can insure that all cases are evaluated. -** -*/ -#ifdef SQLITE_COVERAGE_TEST - void sqlite3Coverage(int); -# define testcase(X) if( X ){ sqlite3Coverage(__LINE__); } -#else -# define testcase(X) -#endif - -/* -** The TESTONLY macro is used to enclose variable declarations or -** other bits of code that are needed to support the arguments -** within testcase() and assert() macros. -*/ -#if !defined(NDEBUG) || defined(SQLITE_COVERAGE_TEST) -# define TESTONLY(X) X -#else -# define TESTONLY(X) -#endif - -/* -** The ALWAYS and NEVER macros surround boolean expressions which -** are intended to always be true or false, respectively. Such -** expressions could be omitted from the code completely. But they -** are included in a few cases in order to enhance the resilience -** of SQLite to unexpected behavior - to make the code "self-healing" -** or "ductile" rather than being "brittle" and crashing at the first -** hint of unplanned behavior. -** -** In other words, ALWAYS and NEVER are added for defensive code. -** -** When doing coverage testing ALWAYS and NEVER are hard-coded to -** be true and false so that the unreachable code then specify will -** not be counted as untested code. -*/ -#if defined(SQLITE_COVERAGE_TEST) -# define ALWAYS(X) (1) -# define NEVER(X) (0) -#elif !defined(NDEBUG) - int sqlite3Assert(void); -# define ALWAYS(X) ((X)?1:sqlite3Assert()) -# define NEVER(X) ((X)?sqlite3Assert():0) -#else -# define ALWAYS(X) (X) -# define NEVER(X) (X) -#endif - -/* -** The macro unlikely() is a hint that surrounds a boolean -** expression that is usually false. Macro likely() surrounds -** a boolean expression that is usually true. GCC is able to -** use these hints to generate better code, sometimes. -*/ -#if defined(__GNUC__) && 0 -# define likely(X) __builtin_expect((X),1) -# define unlikely(X) __builtin_expect((X),0) -#else -# define likely(X) !!(X) -# define unlikely(X) !!(X) -#endif - -/* -** Sometimes we need a small amount of code such as a variable initialization -** to setup for a later assert() statement. We do not want this code to -** appear when assert() is disabled. The following macro is therefore -** used to contain that setup code. The "VVA" acronym stands for -** "Verification, Validation, and Accreditation". In other words, the -** code within VVA_ONLY() will only run during verification processes. -*/ -#ifndef NDEBUG -# define VVA_ONLY(X) X -#else -# define VVA_ONLY(X) -#endif - #include "sqlite3.h" #include "hash.h" #include "parse.h" #include #include @@ -419,11 +381,11 @@ /* ** Macros to determine whether the machine is big or little endian, ** evaluated at runtime. */ #ifdef SQLITE_AMALGAMATION -const int sqlite3one = 1; +const int sqlite3one; #else extern const int sqlite3one; #endif #if defined(i386) || defined(__i386__) || defined(_M_IX86)\ || defined(__x86_64) || defined(__x86_64__) @@ -480,11 +442,11 @@ /* ** A convenience macro that returns the number of elements in ** an array. */ -#define ArraySize(X) ((int)(sizeof(X)/sizeof(X[0]))) +#define ArraySize(X) (sizeof(X)/sizeof(X[0])) /* ** The following value as a destructor means to use sqlite3DbFree(). ** This is an internal extension to SQLITE_STATIC and SQLITE_TRANSIENT. */ @@ -499,11 +461,11 @@ ** macro is used for this purpose. And instead of referencing the variable ** directly, we use its constant as a key to lookup the run-time allocated ** buffer that holds real variable. The constant is also the initializer ** for the run-time allocated buffer. ** -** In the usual case where WSD is supported, the SQLITE_WSD and GLOBAL +** In the usually case where WSD is supported, the SQLITE_WSD and GLOBAL ** macros become no-ops and have zero performance impact. */ #ifdef SQLITE_OMIT_WSD #define SQLITE_WSD const #define GLOBAL(t,v) (*(t*)sqlite3_wsd_find((void*)&(v), sizeof(v))) @@ -514,36 +476,16 @@ #define SQLITE_WSD #define GLOBAL(t,v) v #define sqlite3GlobalConfig sqlite3Config #endif -/* -** The following macros are used to suppress compiler warnings and to -** make it clear to human readers when a function parameter is deliberately -** left unused within the body of a function. This usually happens when -** a function is called via a function pointer. For example the -** implementation of an SQL aggregate step callback may not use the -** parameter indicating the number of arguments passed to the aggregate, -** if it knows that this is enforced elsewhere. -** -** When a function parameter is not used at all within the body of a function, -** it is generally named "NotUsed" or "NotUsed2" to make things even clearer. -** However, these macros may also be used to suppress warnings related to -** parameters that may or may not be used depending on compilation options. -** For example those parameters only used in assert() statements. In these -** cases the parameters are named as per the usual conventions. -*/ -#define UNUSED_PARAMETER(x) (void)(x) -#define UNUSED_PARAMETER2(x,y) UNUSED_PARAMETER(x),UNUSED_PARAMETER(y) - /* ** Forward references to structures */ typedef struct AggInfo AggInfo; typedef struct AuthContext AuthContext; typedef struct Bitvec Bitvec; -typedef struct RowSet RowSet; typedef struct CollSeq CollSeq; typedef struct Column Column; typedef struct Db Db; typedef struct Schema Schema; typedef struct Expr Expr; @@ -558,11 +500,10 @@ typedef struct Lookaside Lookaside; typedef struct LookasideSlot LookasideSlot; typedef struct Module Module; typedef struct NameContext NameContext; typedef struct Parse Parse; -typedef struct Savepoint Savepoint; typedef struct Select Select; typedef struct SrcList SrcList; typedef struct StrAccum StrAccum; typedef struct Table Table; typedef struct TableLock TableLock; @@ -570,11 +511,10 @@ typedef struct TriggerStack TriggerStack; typedef struct TriggerStep TriggerStep; typedef struct Trigger Trigger; typedef struct UnpackedRecord UnpackedRecord; typedef struct Walker Walker; -typedef struct WherePlan WherePlan; typedef struct WhereInfo WhereInfo; typedef struct WhereLevel WhereLevel; /* ** Defer sourcing vdbe.h and btree.h until after the "u8" and @@ -599,11 +539,11 @@ */ struct Db { char *zName; /* Name of this database */ Btree *pBt; /* The B*Tree structure for this database file */ u8 inTrans; /* 0: not writable. 1: Transaction. 2: Checkpoint */ - u8 safety_level; /* How aggressive at syncing data to disk */ + u8 safety_level; /* How aggressive at synching data to disk */ void *pAux; /* Auxiliary data. Usually NULL */ void (*xFreeAux)(void*); /* Routine to free pAux */ Schema *pSchema; /* Pointer to database schema (possibly shared) */ }; @@ -663,11 +603,11 @@ */ #define SQLITE_N_LIMIT (SQLITE_LIMIT_VARIABLE_NUMBER+1) /* ** Lookaside malloc is a set of fixed-size buffers that can be used -** to satisfy small transient memory allocation requests for objects +** to satisify small transient memory allocation requests for objects ** associated with a particular database connection. The use of ** lookaside malloc provides a significant performance enhancement ** (approx 10%) by avoiding numerous malloc/free requests while parsing ** SQL statements. ** @@ -728,11 +668,11 @@ */ struct sqlite3 { sqlite3_vfs *pVfs; /* OS Interface */ int nDb; /* Number of backends currently in use */ Db *aDb; /* All backends */ - int flags; /* Miscellaneous flags. See below */ + int flags; /* Miscellanous flags. See below */ int openFlags; /* Flags passed to sqlite3_vfs.xOpen() */ int errCode; /* Most recent error code (SQLITE_*) */ int errMask; /* & result codes with this before returning */ u8 autoCommit; /* The auto-commit flag. */ u8 temp_store; /* 1: file 2: memory 0: default */ @@ -743,11 +683,11 @@ int nextPagesize; /* Pagesize after VACUUM if >0 */ int nTable; /* Number of tables in the database */ CollSeq *pDfltColl; /* The default collating sequence (BINARY) */ i64 lastRowid; /* ROWID of most recent insert (see above) */ i64 priorNewRowid; /* Last randomly generated ROWID */ - u32 magic; /* Magic number for detect library misuse */ + int magic; /* Magic number for detect library misuse */ int nChange; /* Value returned by sqlite3_changes() */ int nTotalChange; /* Value returned by sqlite3_total_changes() */ sqlite3_mutex *mutex; /* Connection mutex */ int aLimit[SQLITE_N_LIMIT]; /* Limits */ struct sqlite3InitInfo { /* Information used during initialization */ @@ -754,14 +694,13 @@ int iDb; /* When back is being initialized */ int newTnum; /* Rootpage of table being initialized */ u8 busy; /* TRUE if currently initializing */ } init; int nExtension; /* Number of loaded extensions */ - void **aExtension; /* Array of shared library handles */ + void **aExtension; /* Array of shared libraray handles */ struct Vdbe *pVdbe; /* List of active virtual machines */ - int activeVdbeCnt; /* Number of VDBEs currently executing */ - int writeVdbeCnt; /* Number of active VDBEs that are writing */ + int activeVdbeCnt; /* Number of vdbes currently executing */ void (*xTrace)(void*,const char*); /* Trace function */ void *pTraceArg; /* Argument to the trace function */ void (*xProfile)(void*,const char*,u64); /* Profiling function */ void *pProfileArg; /* Argument to profile function */ void *pCommitArg; /* Argument to xCommitCallback() */ @@ -803,13 +742,10 @@ int busyTimeout; /* Busy handler timeout, in msec */ Db aDbStatic[2]; /* Static space for the 2 default backends */ #ifdef SQLITE_SSE sqlite3_stmt *pFetch; /* Used by SSE to fetch stored statements */ #endif - Savepoint *pSavepoint; /* List of active savepoints */ - int nSavepoint; /* Number of non-transaction savepoints */ - u8 isTransactionSavepoint; /* True if the outermost savepoint is a TS */ }; /* ** A macro to discover the encoding of a database. */ @@ -844,11 +780,10 @@ #define SQLITE_LoadExtension 0x00020000 /* Enable load_extension */ #define SQLITE_RecoveryMode 0x00040000 /* Ignore schema errors */ #define SQLITE_SharedCache 0x00080000 /* Cache sharing is enabled */ #define SQLITE_Vtab 0x00100000 /* There exists a virtual table */ -#define SQLITE_CommitBusy 0x00200000 /* In the process of committing */ /* ** Possible values for the sqlite.magic field. ** The numbers are obtained at random and have no special meaning, other ** than being distinct from one another. @@ -871,23 +806,22 @@ u8 flags; /* Some combination of SQLITE_FUNC_* */ void *pUserData; /* User data parameter */ FuncDef *pNext; /* Next function with same name */ void (*xFunc)(sqlite3_context*,int,sqlite3_value**); /* Regular function */ void (*xStep)(sqlite3_context*,int,sqlite3_value**); /* Aggregate step */ - void (*xFinalize)(sqlite3_context*); /* Aggregate finalizer */ + void (*xFinalize)(sqlite3_context*); /* Aggregate finializer */ char *zName; /* SQL name of the function. */ FuncDef *pHash; /* Next with a different name but the same hash */ }; /* ** Possible values for FuncDef.flags */ #define SQLITE_FUNC_LIKE 0x01 /* Candidate for the LIKE optimization */ #define SQLITE_FUNC_CASE 0x02 /* Case-sensitive LIKE-type function */ -#define SQLITE_FUNC_EPHEM 0x04 /* Ephemeral. Delete with VDBE */ +#define SQLITE_FUNC_EPHEM 0x04 /* Ephermeral. Delete with VDBE */ #define SQLITE_FUNC_NEEDCOLL 0x08 /* sqlite3GetFuncCollSeq() might be called */ -#define SQLITE_FUNC_PRIVATE 0x10 /* Allowed for internal use only */ /* ** The following three macros, FUNCTION(), LIKEFUNC() and AGGREGATE() are ** used to create the initializers for the FuncDef structures. ** @@ -911,36 +845,17 @@ ** available as the function user-data (sqlite3_user_data()). The ** FuncDef.flags variable is set to the value passed as the flags ** parameter. */ #define FUNCTION(zName, nArg, iArg, bNC, xFunc) \ - {nArg, SQLITE_UTF8, bNC*8, SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, #zName, 0} + {nArg, SQLITE_UTF8, bNC*8, SQLITE_INT_TO_PTR(iArg), 0, xFunc, 0, 0, #zName} #define STR_FUNCTION(zName, nArg, pArg, bNC, xFunc) \ - {nArg, SQLITE_UTF8, bNC*8, pArg, 0, xFunc, 0, 0, #zName, 0} + {nArg, SQLITE_UTF8, bNC*8, pArg, 0, xFunc, 0, 0, #zName} #define LIKEFUNC(zName, nArg, arg, flags) \ - {nArg, SQLITE_UTF8, flags, (void *)arg, 0, likeFunc, 0, 0, #zName, 0} + {nArg, SQLITE_UTF8, flags, (void *)arg, 0, likeFunc, 0, 0, #zName} #define AGGREGATE(zName, nArg, arg, nc, xStep, xFinal) \ - {nArg, SQLITE_UTF8, nc*8, SQLITE_INT_TO_PTR(arg), 0, 0, xStep,xFinal,#zName,0} - -/* -** All current savepoints are stored in a linked list starting at -** sqlite3.pSavepoint. The first element in the list is the most recently -** opened savepoint. Savepoints are added to the list by the vdbe -** OP_Savepoint instruction. -*/ -struct Savepoint { - char *zName; /* Savepoint name (nul-terminated) */ - Savepoint *pNext; /* Parent savepoint (if any) */ -}; - -/* -** The following are used as the second parameter to sqlite3Savepoint(), -** and as the P1 argument to the OP_Savepoint instruction. -*/ -#define SAVEPOINT_BEGIN 0 -#define SAVEPOINT_RELEASE 1 -#define SAVEPOINT_ROLLBACK 2 + {nArg, SQLITE_UTF8, nc*8, SQLITE_INT_TO_PTR(arg), 0, 0, xStep,xFinal, #zName} /* ** Each SQLite module (virtual table definition) is defined by an ** instance of the following structure, stored in the sqlite3.aModule @@ -973,11 +888,11 @@ /* ** A "Collating Sequence" is defined by an instance of the following ** structure. Conceptually, a collating sequence consists of a name and ** a comparison routine that defines the order of that sequence. ** -** There may two separate implementations of the collation function, one +** There may two seperate implementations of the collation function, one ** that processes text in UTF-8 encoding (CollSeq.xCmp) and another that ** processes text encoded in UTF-16 (CollSeq.xCmp16), using the machine ** native byte order. When a collation sequence is invoked, SQLite selects ** the version that will require the least expensive encoding ** translations, if any. @@ -1112,11 +1027,11 @@ /* ** Allowed values for Tabe.tabFlags. */ #define TF_Readonly 0x01 /* Read-only system table */ -#define TF_Ephemeral 0x02 /* An ephemeral table */ +#define TF_Ephemeral 0x02 /* An emphermal table */ #define TF_HasPrimaryKey 0x04 /* Table has a primary key */ #define TF_Autoincrement 0x08 /* Integer primary key is autoincrement */ #define TF_Virtual 0x10 /* Is a virtual table */ #define TF_NeedMetadata 0x20 /* aCol[].zType and aCol[].pColl missing */ @@ -1150,20 +1065,20 @@ ** ** For foreign key "fk1", the from-table is "ex1" and the to-table is "ex2". ** ** Each REFERENCES clause generates an instance of the following structure ** which is attached to the from-table. The to-table need not exist when -** the from-table is created. The existence of the to-table is not checked +** the from-table is created. The existance of the to-table is not checked ** until an attempt is made to insert data into the from-table. ** ** The sqlite.aFKey hash table stores pointers to this structure ** given the name of a to-table. For each to-table, all foreign keys ** associated with that table are on a linked list using the FKey.pNextTo ** field. */ struct FKey { - Table *pFrom; /* The table that contains the REFERENCES clause */ + Table *pFrom; /* The table that constains the REFERENCES clause */ FKey *pNextFrom; /* Next foreign key in pFrom */ char *zTo; /* Name of table that the key points to */ FKey *pNextTo; /* Next foreign key that points to zTo */ int nCol; /* Number of columns in this key */ struct sColMap { /* Mapping of columns in pFrom to columns in zTo */ @@ -1235,15 +1150,15 @@ ** values. ** ** A record is an object that contains one or more fields of data. ** Records are used to store the content of a table row and to store ** the key of an index. A blob encoding of a record is created by -** the OP_MakeRecord opcode of the VDBE and is disassembled by the +** the OP_MakeRecord opcode of the VDBE and is disassemblied by the ** OP_Column opcode. ** ** This structure holds a record that has already been disassembled -** into its constituent fields. +** into its constitutent fields. */ struct UnpackedRecord { KeyInfo *pKeyInfo; /* Collation and sort-order information */ u16 nField; /* Number of entries in apMem[] */ u16 flags; /* Boolean settings. UNPACKED_... below */ @@ -1304,11 +1219,11 @@ /* ** Each token coming out of the lexer is an instance of ** this structure. Tokens are also used as part of an expression. ** ** Note if Token.z==0 then Token.dyn and Token.n are undefined and -** may contain random values. Do not make any assumptions about Token.dyn +** may contain random values. Do not make any assuptions about Token.dyn ** and Token.n when Token.z==0. */ struct Token { const unsigned char *z; /* Text of the token. Not NULL-terminated! */ unsigned dyn : 1; /* True for malloced memory, false for static */ @@ -1351,11 +1266,11 @@ ** aggregate functions */ struct AggInfo_func { /* For each aggregate function */ Expr *pExpr; /* Expression encoding the function */ FuncDef *pFunc; /* The aggregate function implementation */ int iMem; /* Memory location that acts as accumulator */ - int iDistinct; /* Ephemeral table used to enforce DISTINCT */ + int iDistinct; /* Ephermeral table used to enforce DISTINCT */ } *aFunc; int nFunc; /* Number of entries in aFunc[] */ int nFuncAlloc; /* Number of slots allocated for aFunc[] */ }; @@ -1505,15 +1420,10 @@ ** tables in a join to 32 instead of 64. But it also reduces the size ** of the library by 738 bytes on ix86. */ typedef u64 Bitmask; -/* -** The number of bits in a Bitmask. "BMS" means "BitMask Size". -*/ -#define BMS ((int)(sizeof(Bitmask)*8)) - /* ** The following structure describes the FROM clause of a SELECT statement. ** Each table or subquery in the FROM clause is a separate element of ** the SrcList.a[] array. ** @@ -1537,15 +1447,15 @@ char *zAlias; /* The "B" part of a "A AS B" phrase. zName is the "A" */ Table *pTab; /* An SQL table corresponding to zName */ Select *pSelect; /* A SELECT statement used in place of a table name */ u8 isPopulated; /* Temporary table associated with SELECT is populated */ u8 jointype; /* Type of join between this able and the previous */ - u8 notIndexed; /* True if there is a NOT INDEXED clause */ int iCursor; /* The VDBE cursor number used to access this table */ Expr *pOn; /* The ON clause of a join */ IdList *pUsing; /* The USING clause of a join */ - Bitmask colUsed; /* Bit N (1<" clause */ Index *pIndex; /* Index structure corresponding to zIndex, if any */ } a[1]; /* One entry for each identifier on the list */ }; @@ -1558,89 +1468,64 @@ #define JT_LEFT 0x0008 /* Left outer join */ #define JT_RIGHT 0x0010 /* Right outer join */ #define JT_OUTER 0x0020 /* The "OUTER" keyword is present */ #define JT_ERROR 0x0040 /* unknown or unsupported join type */ - -/* -** A WherePlan object holds information that describes a lookup -** strategy. -** -** This object is intended to be opaque outside of the where.c module. -** It is included here only so that that compiler will know how big it -** is. None of the fields in this object should be used outside of -** the where.c module. -** -** Within the union, pIdx is only used when wsFlags&WHERE_INDEXED is true. -** pTerm is only used when wsFlags&WHERE_MULTI_OR is true. And pVtabIdx -** is only used when wsFlags&WHERE_VIRTUALTABLE is true. It is never the -** case that more than one of these conditions is true. -*/ -struct WherePlan { - u32 wsFlags; /* WHERE_* flags that describe the strategy */ - u32 nEq; /* Number of == constraints */ - union { - Index *pIdx; /* Index when WHERE_INDEXED is true */ - struct WhereTerm *pTerm; /* WHERE clause term for OR-search */ - sqlite3_index_info *pVtabIdx; /* Virtual table index to use */ - } u; -}; - /* ** For each nested loop in a WHERE clause implementation, the WhereInfo ** structure contains a single instance of this structure. This structure ** is intended to be private the the where.c module and should not be ** access or modified by other modules. ** -** The pIdxInfo field is used to help pick the best index on a -** virtual table. The pIdxInfo pointer contains indexing +** The pIdxInfo and pBestIdx fields are used to help pick the best +** index on a virtual table. The pIdxInfo pointer contains indexing ** information for the i-th table in the FROM clause before reordering. ** All the pIdxInfo pointers are freed by whereInfoFree() in where.c. -** All other information in the i-th WhereLevel object for the i-th table -** after FROM clause ordering. +** The pBestIdx pointer is a copy of pIdxInfo for the i-th table after +** FROM clause ordering. This is a little confusing so I will repeat +** it in different words. WhereInfo.a[i].pIdxInfo is index information +** for WhereInfo.pTabList.a[i]. WhereInfo.a[i].pBestInfo is the +** index information for the i-th loop of the join. pBestInfo is always +** either NULL or a copy of some pIdxInfo. So for cleanup it is +** sufficient to free all of the pIdxInfo pointers. +** */ struct WhereLevel { - WherePlan plan; /* query plan for this element of the FROM clause */ + int iFrom; /* Which entry in the FROM clause */ + int flags; /* Flags associated with this level */ + int iMem; /* First memory cell used by this level */ int iLeftJoin; /* Memory cell used to implement LEFT OUTER JOIN */ + Index *pIdx; /* Index used. NULL if no index */ int iTabCur; /* The VDBE cursor used to access the table */ - int iIdxCur; /* The VDBE cursor used to access pIdx */ - int addrBrk; /* Jump here to break out of the loop */ - int addrNxt; /* Jump here to start the next IN combination */ - int addrCont; /* Jump here to continue with the next loop cycle */ - int addrFirst; /* First instruction of interior of the loop */ - u8 iFrom; /* Which entry in the FROM clause */ - u8 op, p5; /* Opcode and P5 of the opcode that ends the loop */ - int p1, p2; /* Operands of the opcode used to ends the loop */ - union { /* Information that depends on plan.wsFlags */ - struct { - int nIn; /* Number of entries in aInLoop[] */ - struct InLoop { - int iCur; /* The VDBE cursor used by this IN operator */ - int addrInTop; /* Top of the IN loop */ - } *aInLoop; /* Information about each nested IN operator */ - } in; /* Used when plan.wsFlags&WHERE_IN_ABLE */ - } u; + int iIdxCur; /* The VDBE cursor used to acesss pIdx */ + int brk; /* Jump here to break out of the loop */ + int nxt; /* Jump here to start the next IN combination */ + int cont; /* Jump here to continue with the next loop cycle */ + int top; /* First instruction of interior of the loop */ + int op, p1, p2, p5; /* Opcode used to terminate the loop */ + int nEq; /* Number of == or IN constraints on this loop */ + int nIn; /* Number of IN operators constraining this loop */ + struct InLoop { + int iCur; /* The VDBE cursor used by this IN operator */ + int topAddr; /* Top of the IN loop */ + } *aInLoop; /* Information about each nested IN operator */ + sqlite3_index_info *pBestIdx; /* Index information for this level */ /* The following field is really not part of the current level. But - ** we need a place to cache virtual table index information for each - ** virtual table in the FROM clause and the WhereLevel structure is - ** a convenient place since there is one WhereLevel for each FROM clause - ** element. + ** we need a place to cache index information for each table in the + ** FROM clause and the WhereLevel structure is a convenient place. */ sqlite3_index_info *pIdxInfo; /* Index info for n-th source table */ }; /* -** Flags appropriate for the wctrlFlags parameter of sqlite3WhereBegin(). +** Flags appropriate for the wflags parameter of sqlite3WhereBegin(). */ -#define WHERE_ORDERBY_NORMAL 0x0000 /* No-op */ -#define WHERE_ORDERBY_MIN 0x0001 /* ORDER BY processing for min() func */ -#define WHERE_ORDERBY_MAX 0x0002 /* ORDER BY processing for max() func */ -#define WHERE_ONEPASS_DESIRED 0x0004 /* Want to do one-pass UPDATE/DELETE */ -#define WHERE_FILL_ROWSET 0x0008 /* Save results in a RowSet object */ -#define WHERE_OMIT_OPEN 0x0010 /* Table cursor are already open */ -#define WHERE_OMIT_CLOSE 0x0020 /* Omit close of table & index cursors */ +#define WHERE_ORDERBY_NORMAL 0 /* No-op */ +#define WHERE_ORDERBY_MIN 1 /* ORDER BY processing for min() func */ +#define WHERE_ORDERBY_MAX 2 /* ORDER BY processing for max() func */ +#define WHERE_ONEPASS_DESIRED 4 /* Want to do one-pass UPDATE/DELETE */ /* ** The WHERE clause processing routine has two halves. The ** first part does the start of the WHERE loop and the second ** half does the tail of the WHERE loop. An instance of @@ -1647,20 +1532,18 @@ ** this structure is returned by the first half and passed ** into the second half to give some continuity. */ struct WhereInfo { Parse *pParse; /* Parsing and code generating context */ - u16 wctrlFlags; /* Flags originally passed to sqlite3WhereBegin() */ u8 okOnePass; /* Ok to use one-pass algorithm for UPDATE or DELETE */ - int regRowSet; /* Store rowids in this rowset if >=0 */ - SrcList *pTabList; /* List of tables in the join */ - int iTop; /* The very beginning of the WHERE loop */ - int iContinue; /* Jump here to continue with next record */ - int iBreak; /* Jump here to break out of the loop */ - int nLevel; /* Number of nested loop */ - struct WhereClause *pWC; /* Decomposition of the WHERE clause */ - WhereLevel a[1]; /* Information about each nest loop in WHERE */ + SrcList *pTabList; /* List of tables in the join */ + int iTop; /* The very beginning of the WHERE loop */ + int iContinue; /* Jump here to continue with next record */ + int iBreak; /* Jump here to break out of the loop */ + int nLevel; /* Number of nested loop */ + sqlite3_index_info **apInfo; /* Array of pointers to index info structures */ + WhereLevel a[1]; /* Information about each nest loop in the WHERE */ }; /* ** A NameContext defines a context in which to resolve table and column ** names. The context consists of a list of tables (the pSrcList) field and @@ -1765,11 +1648,11 @@ #define SRT_Table 8 /* Store result as data with an automatic rowid */ #define SRT_EphemTab 9 /* Create transient tab and store like SRT_Table */ #define SRT_Coroutine 10 /* Generate a single row of result */ /* -** A structure used to customize the behavior of sqlite3Select(). See +** A structure used to customize the behaviour of sqlite3Select(). See ** comments above sqlite3Select() for details. */ typedef struct SelectDest SelectDest; struct SelectDest { u8 eDest; /* How to dispose of the results */ @@ -1841,11 +1724,10 @@ int nVar; /* Number of '?' variables seen in the SQL so far */ int nVarExpr; /* Number of used slots in apVarExpr[] */ int nVarExprAlloc; /* Number of allocated slots in apVarExpr[] */ Expr **apVarExpr; /* Pointers to :aaa and $aaaa wildcard expressions */ int nAlias; /* Number of aliased result set columns */ - int nAliasAlloc; /* Number of allocated slots for aAlias[] */ int *aAlias; /* Register used to hold aliased result */ u8 explain; /* True if the EXPLAIN flag is found on the query */ Token sErrToken; /* The token at which the error occurred */ Token sNameToken; /* Token with unqualified schema object name */ Token sLastToken; /* The last token parsed */ @@ -1906,11 +1788,11 @@ struct Trigger { char *name; /* The name of the trigger */ char *table; /* The table or view to which the trigger applies */ u8 op; /* One of TK_DELETE, TK_UPDATE, TK_INSERT */ u8 tr_tm; /* One of TRIGGER_BEFORE, TRIGGER_AFTER */ - Expr *pWhen; /* The WHEN clause of the expression (may be NULL) */ + Expr *pWhen; /* The WHEN clause of the expresion (may be NULL) */ IdList *pColumns; /* If this is an UPDATE OF trigger, the is stored here */ Token nameToken; /* Token containing zName. Use during parsing only */ Schema *pSchema; /* Schema containing the trigger */ Schema *pTabSchema; /* Schema containing the table */ @@ -2044,11 +1926,11 @@ char *zText; /* The string collected so far */ int nChar; /* Length of the string so far */ int nAlloc; /* Amount of space allocated in zText */ int mxAlloc; /* Maximum allowed string length */ u8 mallocFailed; /* Becomes true if any memory allocation fails */ - u8 useMalloc; /* True if zText is enlargeable using realloc */ + u8 useMalloc; /* True if zText is enlargable using realloc */ u8 tooBig; /* Becomes true if string size exceeds limits */ }; /* ** A pointer to this structure is used to communicate information @@ -2073,29 +1955,27 @@ int mxStrlen; /* Maximum string length */ int szLookaside; /* Default lookaside buffer size */ int nLookaside; /* Default lookaside buffer count */ sqlite3_mem_methods m; /* Low-level memory allocation interface */ sqlite3_mutex_methods mutex; /* Low-level mutex interface */ - sqlite3_pcache_methods pcache; /* Low-level page-cache interface */ void *pHeap; /* Heap storage space */ int nHeap; /* Size of pHeap[] */ int mnReq, mxReq; /* Min and max heap requests sizes */ void *pScratch; /* Scratch memory */ int szScratch; /* Size of each scratch buffer */ int nScratch; /* Number of scratch buffers */ void *pPage; /* Page cache memory */ int szPage; /* Size of each page in pPage[] */ int nPage; /* Number of pages in pPage[] */ - int mxParserStack; /* maximum depth of the parser stack */ - int sharedCacheEnabled; /* true if shared-cache mode enabled */ - /* The above might be initialized to non-zero. The following need to always - ** initially be zero, however. */ int isInit; /* True after initialization has finished */ int inProgress; /* True while initialization in progress */ int isMallocInit; /* True after malloc is initialized */ sqlite3_mutex *pInitMutex; /* Mutex used by sqlite3_initialize() */ int nRefInitMutex; /* Number of users of pInitMutex */ + int nSmall; /* alloc size threshold used by mem6.c */ + int mxParserStack; /* maximum depth of the parser stack */ + int sharedCacheEnabled; /* true if shared-cache mode enabled */ }; /* ** Context pointer passed down through the tree-walk. */ @@ -2118,13 +1998,13 @@ /* ** Return code from the parse-tree walking primitives and their ** callbacks. */ -#define WRC_Continue 0 /* Continue down into children */ -#define WRC_Prune 1 /* Omit children but continue walking siblings */ -#define WRC_Abort 2 /* Abandon the tree walk */ +#define WRC_Continue 0 +#define WRC_Prune 1 +#define WRC_Abort 2 /* ** Assuming zIn points to the first byte of a UTF-8 character, ** advance zIn to point to the first byte of the next UTF-8 character. */ @@ -2145,42 +2025,17 @@ # define SQLITE_CORRUPT_BKPT sqlite3Corrupt() #else # define SQLITE_CORRUPT_BKPT SQLITE_CORRUPT #endif -/* -** The following macros mimic the standard library functions toupper(), -** isspace(), isalnum(), isdigit() and isxdigit(), respectively. The -** sqlite versions only work for ASCII characters, regardless of locale. -*/ -#ifdef SQLITE_ASCII -# define sqlite3Toupper(x) ((x)&~(sqlite3CtypeMap[(unsigned char)(x)]&0x20)) -# define sqlite3Isspace(x) (sqlite3CtypeMap[(unsigned char)(x)]&0x01) -# define sqlite3Isalnum(x) (sqlite3CtypeMap[(unsigned char)(x)]&0x06) -# define sqlite3Isalpha(x) (sqlite3CtypeMap[(unsigned char)(x)]&0x02) -# define sqlite3Isdigit(x) (sqlite3CtypeMap[(unsigned char)(x)]&0x04) -# define sqlite3Isxdigit(x) (sqlite3CtypeMap[(unsigned char)(x)]&0x08) -# define sqlite3Tolower(x) (sqlite3UpperToLower[(unsigned char)(x)]) -#else -# include -# define sqlite3Toupper(x) toupper((unsigned char)(x)) -# define sqlite3Isspace(x) isspace((unsigned char)(x)) -# define sqlite3Isalnum(x) isalnum((unsigned char)(x)) -# define sqlite3Isalpha(x) isalpha((unsigned char)(x)) -# define sqlite3Isdigit(x) isdigit((unsigned char)(x)) -# define sqlite3Isxdigit(x) isxdigit((unsigned char)(x)) -# define sqlite3Tolower(x) tolower((unsigned char)(x)) -#endif - /* ** Internal function prototypes */ int sqlite3StrICmp(const char *, const char *); int sqlite3StrNICmp(const char *, const char *, int); int sqlite3IsNumber(const char*, int*, u8); int sqlite3Strlen(sqlite3*, const char*); -int sqlite3Strlen30(const char*); int sqlite3MallocInit(void); void sqlite3MallocEnd(void); void *sqlite3Malloc(int); void *sqlite3MallocZero(int); @@ -2197,20 +2052,16 @@ void *sqlite3ScratchMalloc(int); void sqlite3ScratchFree(void*); void *sqlite3PageMalloc(int); void sqlite3PageFree(void*); void sqlite3MemSetDefault(void); +const sqlite3_mem_methods *sqlite3MemGetDefault(void); +const sqlite3_mem_methods *sqlite3MemGetMemsys5(void); +const sqlite3_mem_methods *sqlite3MemGetMemsys3(void); +const sqlite3_mem_methods *sqlite3MemGetMemsys6(void); void sqlite3BenignMallocHooks(void (*)(void), void (*)(void)); int sqlite3MemoryAlarm(void (*)(void*, sqlite3_int64, int), void*, sqlite3_int64); - -#ifdef SQLITE_ENABLE_MEMSYS3 -const sqlite3_mem_methods *sqlite3MemGetMemsys3(void); -#endif -#ifdef SQLITE_ENABLE_MEMSYS5 -const sqlite3_mem_methods *sqlite3MemGetMemsys5(void); -#endif - #ifndef SQLITE_MUTEX_OMIT sqlite3_mutex_methods *sqlite3DefaultMutex(void); sqlite3_mutex *sqlite3MutexAlloc(int); int sqlite3MutexInit(void); @@ -2277,18 +2128,12 @@ Bitvec *sqlite3BitvecCreate(u32); int sqlite3BitvecTest(Bitvec*, u32); int sqlite3BitvecSet(Bitvec*, u32); void sqlite3BitvecClear(Bitvec*, u32); void sqlite3BitvecDestroy(Bitvec*); -u32 sqlite3BitvecSize(Bitvec*); int sqlite3BitvecBuiltinTest(int,int*); -RowSet *sqlite3RowSetInit(sqlite3*, void*, unsigned int); -void sqlite3RowSetClear(RowSet*); -void sqlite3RowSetInsert(RowSet*, i64); -int sqlite3RowSetNext(RowSet*, i64*); - void sqlite3CreateView(Parse*,Token*,Token*,Token*,Select*,int,int); #if !defined(SQLITE_OMIT_VIEW) || !defined(SQLITE_OMIT_VIRTUALTABLE) int sqlite3ViewGetColumnNames(Parse*,Table*); #else @@ -2299,11 +2144,10 @@ void sqlite3DeleteTable(Table*); void sqlite3Insert(Parse*, SrcList*, ExprList*, Select*, IdList*, int); void *sqlite3ArrayAllocate(sqlite3*,void*,int,int,int*,int*,int*); IdList *sqlite3IdListAppend(sqlite3*, IdList*, Token*); int sqlite3IdListIndex(IdList*,const char*); -SrcList *sqlite3SrcListEnlarge(sqlite3*, SrcList*, int, int); SrcList *sqlite3SrcListAppend(sqlite3*, SrcList*, Token*, Token*); SrcList *sqlite3SrcListAppendFromTerm(Parse*, SrcList*, Token*, Token*, Token*, Select*, Expr*, IdList*); void sqlite3SrcListIndexedBy(Parse *, SrcList *, Token *); int sqlite3IndexedByLookup(Parse *, struct SrcList_item *); @@ -2324,18 +2168,18 @@ #if defined(SQLITE_ENABLE_UPDATE_DELETE_LIMIT) && !defined(SQLITE_OMIT_SUBQUERY) Expr *sqlite3LimitWhere(Parse *, SrcList *, Expr *, ExprList *, Expr *, Expr *, char *); #endif void sqlite3DeleteFrom(Parse*, SrcList*, Expr*); void sqlite3Update(Parse*, SrcList*, ExprList*, Expr*, int); -WhereInfo *sqlite3WhereBegin(Parse*, SrcList*, Expr*, ExprList**, u8, int); +WhereInfo *sqlite3WhereBegin(Parse*, SrcList*, Expr*, ExprList**, u8); void sqlite3WhereEnd(WhereInfo*); int sqlite3ExprCodeGetColumn(Parse*, Table*, int, int, int, int); void sqlite3ExprCodeMove(Parse*, int, int, int); void sqlite3ExprCodeCopy(Parse*, int, int, int); void sqlite3ExprClearColumnCache(Parse*, int); void sqlite3ExprCacheAffinityChange(Parse*, int, int); -void sqlite3ExprWritableRegister(Parse*,int); +int sqlite3ExprWritableRegister(Parse*,int,int); void sqlite3ExprHardCopy(Parse*,int,int); int sqlite3ExprCode(Parse*, Expr*, int); int sqlite3ExprCodeTemp(Parse*, Expr*, int*); int sqlite3ExprCodeTarget(Parse*, Expr*, int); int sqlite3ExprCodeAndCache(Parse*, Expr*, int); @@ -2362,12 +2206,10 @@ void sqlite3RollbackAll(sqlite3*); void sqlite3CodeVerifySchema(Parse*, int); void sqlite3BeginTransaction(Parse*, int); void sqlite3CommitTransaction(Parse*); void sqlite3RollbackTransaction(Parse*); -void sqlite3Savepoint(Parse*, int, Token*); -void sqlite3CloseSavepoints(sqlite3 *); int sqlite3ExprIsConstant(Expr*); int sqlite3ExprIsConstantNotJoin(Expr*); int sqlite3ExprIsConstantOrFunction(Expr*); int sqlite3ExprIsInteger(Expr*, int*); int sqlite3IsRowid(const char*); @@ -2374,11 +2216,11 @@ void sqlite3GenerateRowDelete(Parse*, Table*, int, int, int); void sqlite3GenerateRowIndexDelete(Parse*, Table*, int, int*); int sqlite3GenerateIndexKey(Parse*, Index*, int, int, int); void sqlite3GenerateConstraintChecks(Parse*,Table*,int,int, int*,int,int,int,int); -void sqlite3CompleteInsertion(Parse*, Table*, int, int, int*, int, int, int); +void sqlite3CompleteInsertion(Parse*, Table*, int, int, int*,int,int,int,int); int sqlite3OpenTableAndIndices(Parse*, Table*, int, int); void sqlite3BeginWriteOperation(Parse*, int, int); Expr *sqlite3ExprDup(sqlite3*,Expr*); void sqlite3TokenCopy(sqlite3*,Token*, Token*); ExprList *sqlite3ExprListDup(sqlite3*,ExprList*); @@ -2388,10 +2230,11 @@ void sqlite3FuncDefInsert(FuncDefHash*, FuncDef*); FuncDef *sqlite3FindFunction(sqlite3*,const char*,int,int,u8,int); void sqlite3RegisterBuiltinFunctions(sqlite3*); void sqlite3RegisterDateTimeFunctions(void); void sqlite3RegisterGlobalFunctions(void); +int sqlite3GetBuiltinFunction(const char *, int, FuncDef **); #ifdef SQLITE_DEBUG int sqlite3SafetyOn(sqlite3*); int sqlite3SafetyOff(sqlite3*); #else # define sqlite3SafetyOn(A) 0 @@ -2409,11 +2252,11 @@ void sqlite3BeginTrigger(Parse*, Token*,Token*,int,int,IdList*,SrcList*, Expr*,int, int); void sqlite3FinishTrigger(Parse*, TriggerStep*, Token*); void sqlite3DropTrigger(Parse*, SrcList*, int); void sqlite3DropTriggerPtr(Parse*, Trigger*); - int sqlite3TriggersExist(Table*, int, ExprList*); + int sqlite3TriggersExist(Parse*, Table*, int, ExprList*); int sqlite3CodeRowTrigger(Parse*, int, ExprList*, int, Table *, int, int, int, int, u32*, u32*); void sqliteViewTriggers(Parse*, Table*, Expr*, int, ExprList*); void sqlite3DeleteTriggerStep(sqlite3*, TriggerStep*); TriggerStep *sqlite3TriggerSelectStep(sqlite3*,Select*); @@ -2422,11 +2265,11 @@ TriggerStep *sqlite3TriggerUpdateStep(sqlite3*,Token*,ExprList*, Expr*, int); TriggerStep *sqlite3TriggerDeleteStep(sqlite3*,Token*, Expr*); void sqlite3DeleteTrigger(sqlite3*, Trigger*); void sqlite3UnlinkAndDeleteTrigger(sqlite3*,int,const char*); #else -# define sqlite3TriggersExist(B,C,D,E,F) 0 +# define sqlite3TriggersExist(A,B,C,D,E,F) 0 # define sqlite3DeleteTrigger(A,B) # define sqlite3DropTriggerPtr(A,B) # define sqlite3UnlinkAndDeleteTrigger(A,B,C) # define sqlite3CodeRowTrigger(A,B,C,D,E,F,G,H,I,J,K) 0 #endif @@ -2469,12 +2312,12 @@ ** are coded to assume the single byte case is already handled (which ** the MACRO form does). */ int sqlite3PutVarint(unsigned char*, u64); int sqlite3PutVarint32(unsigned char*, u32); -u8 sqlite3GetVarint(const unsigned char *, u64 *); -u8 sqlite3GetVarint32(const unsigned char *, u32 *); +int sqlite3GetVarint(const unsigned char *, u64 *); +int sqlite3GetVarint32(const unsigned char *, u32 *); int sqlite3VarintLen(u64 v); /* ** The header of a record consists of a sequence variable-length integers. ** These integers are almost always small and are encoded as a single byte. @@ -2490,12 +2333,12 @@ ** ** x = getVarint32( A, B ); ** x = putVarint32( A, B ); ** */ -#define getVarint32(A,B) (u8)((*(A)<(u8)0x80) ? ((B) = (u32)*(A)),1 : sqlite3GetVarint32((A), (u32 *)&(B))) -#define putVarint32(A,B) (u8)(((u32)(B)<(u32)0x80) ? (*(A) = (unsigned char)(B)),1 : sqlite3PutVarint32((A), (B))) +#define getVarint32(A,B) ((*(A)<(unsigned char)0x80) ? ((B) = (u32)*(A)),1 : sqlite3GetVarint32((A), &(B))) +#define putVarint32(A,B) (((B)<(u32)0x80) ? (*(A) = (unsigned char)(B)),1 : sqlite3PutVarint32((A), (B))) #define getVarint sqlite3GetVarint #define putVarint sqlite3PutVarint void sqlite3IndexAffinityStr(Vdbe *, Index *); @@ -2526,14 +2369,12 @@ char *sqlite3Utf16to8(sqlite3 *, const void*, int); int sqlite3ValueFromExpr(sqlite3 *, Expr *, u8, u8, sqlite3_value **); void sqlite3ValueApplyAffinity(sqlite3_value *, u8, u8); #ifndef SQLITE_AMALGAMATION extern const unsigned char sqlite3UpperToLower[]; -extern const unsigned char sqlite3CtypeMap[]; extern SQLITE_WSD struct Sqlite3Config sqlite3Config; extern SQLITE_WSD FuncDefHash sqlite3GlobalFunctions; -extern int sqlite3PendingByte; #endif void sqlite3RootPageMoved(Db*, int, int); void sqlite3Reindex(Parse*, Token*, Token*); void sqlite3AlterFunctions(sqlite3*); void sqlite3AlterRenameTable(Parse*, SrcList*, Token*); @@ -2551,15 +2392,15 @@ CollSeq *sqlite3GetCollSeq(sqlite3*, CollSeq *, const char *, int); char sqlite3AffinityType(const Token*); void sqlite3Analyze(Parse*, Token*, Token*); int sqlite3InvokeBusyHandler(BusyHandler*); int sqlite3FindDb(sqlite3*, Token*); -int sqlite3FindDbName(sqlite3 *, const char *); int sqlite3AnalysisLoad(sqlite3*,int iDB); void sqlite3DefaultRowEst(Index*); void sqlite3RegisterLikeFunctions(sqlite3*, int); int sqlite3IsLikeFunction(sqlite3*,Expr*,int*,char*); +void sqlite3AttachFunctions(sqlite3 *); void sqlite3MinimumFileFormat(Parse*, int, int); void sqlite3SchemaFree(void *); Schema *sqlite3SchemaGet(sqlite3 *, Btree *); int sqlite3SchemaToIndex(sqlite3 *db, Schema *); KeyInfo *sqlite3IndexKeyinfo(Parse *, Index *); @@ -2573,13 +2414,10 @@ void sqlite3StrAccumAppend(StrAccum*,const char*,int); char *sqlite3StrAccumFinish(StrAccum*); void sqlite3StrAccumReset(StrAccum*); void sqlite3SelectDestInit(SelectDest*,int,int); -void sqlite3BackupRestart(sqlite3_backup *); -void sqlite3BackupUpdate(sqlite3_backup *, Pgno, const u8 *); - /* ** The interface to the LEMON-generated parser */ void *sqlite3ParserAlloc(void*(*)(size_t)); void sqlite3ParserFree(void*, void(*)(void*)); @@ -2608,17 +2446,15 @@ #ifdef SQLITE_OMIT_VIRTUALTABLE # define sqlite3VtabClear(X) # define sqlite3VtabSync(X,Y) SQLITE_OK # define sqlite3VtabRollback(X) # define sqlite3VtabCommit(X) -# define sqlite3VtabInSync(db) 0 #else void sqlite3VtabClear(Table*); int sqlite3VtabSync(sqlite3 *db, char **); int sqlite3VtabRollback(sqlite3 *db); int sqlite3VtabCommit(sqlite3 *db); -# define sqlite3VtabInSync(db) ((db)->nVTrans>0 && (db)->aVTrans==0) #endif void sqlite3VtabMakeWritable(Parse*,Table*); void sqlite3VtabLock(sqlite3_vtab*); void sqlite3VtabUnlock(sqlite3*, sqlite3_vtab*); void sqlite3VtabBeginParse(Parse*, Token*, Token*, Token*); @@ -2667,14 +2503,10 @@ int sqlite3JournalCreate(sqlite3_file *); #else #define sqlite3JournalSize(pVfs) ((pVfs)->szOsFile) #endif -void sqlite3MemJournalOpen(sqlite3_file *); -int sqlite3MemJournalSize(void); -int sqlite3IsMemJournal(sqlite3_file *); - #if SQLITE_MAX_EXPR_DEPTH>0 void sqlite3ExprSetHeight(Parse *pParse, Expr *p); int sqlite3SelectExprHeight(Select *); int sqlite3ExprCheckHeight(Parse*, int); #else Index: src/sqliteLimit.h ================================================================== --- src/sqliteLimit.h +++ src/sqliteLimit.h @@ -10,11 +10,11 @@ ** ************************************************************************* ** ** This file defines various limits of what SQLite can process. ** -** @(#) $Id: sqliteLimit.h,v 1.10 2009/01/10 16:15:09 danielk1977 Exp $ +** @(#) $Id: sqliteLimit.h,v 1.8 2008/03/26 15:56:22 drh Exp $ */ /* ** The maximum length of a TEXT or BLOB in bytes. This also ** limits the size of a row in a table or index. @@ -94,11 +94,11 @@ /* ** The maximum number of arguments to an SQL function. */ #ifndef SQLITE_MAX_FUNCTION_ARG -# define SQLITE_MAX_FUNCTION_ARG 127 +# define SQLITE_MAX_FUNCTION_ARG 100 #endif /* ** The maximum number of in-memory pages to use for the main database ** table and for temporary tables. The SQLITE_DEFAULT_CACHE_SIZE @@ -128,17 +128,10 @@ #endif /* Maximum page size. The upper bound on this value is 32768. This a limit ** imposed by the necessity of storing the value in a 2-byte unsigned integer ** and the fact that the page size must be a power of 2. -** -** If this limit is changed, then the compiled library is technically -** incompatible with an SQLite library compiled with a different limit. If -** a process operating on a database with a page-size of 65536 bytes -** crashes, then an instance of SQLite compiled with the default page-size -** limit will not be able to rollback the aborted transaction. This could -** lead to database corruption. */ #ifndef SQLITE_MAX_PAGE_SIZE # define SQLITE_MAX_PAGE_SIZE 32768 #endif Index: src/table.c ================================================================== --- src/table.c +++ src/table.c @@ -14,11 +14,11 @@ ** interface routine of sqlite3_exec(). ** ** These routines are in a separate files so that they will not be linked ** if they are not used. ** -** $Id: table.c,v 1.39 2009/01/19 20:49:10 drh Exp $ +** $Id: table.c,v 1.36 2008/07/08 22:28:49 shane Exp $ */ #include "sqliteInt.h" #include #include @@ -90,11 +90,11 @@ if( argv!=0 ){ for(i=0; iazResult[p->nData++] = z; @@ -130,11 +130,10 @@ TabResult res; *pazResult = 0; if( pnColumn ) *pnColumn = 0; if( pnRow ) *pnRow = 0; - if( pzErrMsg ) *pzErrMsg = 0; res.zErrMsg = 0; res.nResult = 0; res.nRow = 0; res.nColumn = 0; res.nData = 1; Index: src/tclsqlite.c ================================================================== --- src/tclsqlite.c +++ src/tclsqlite.c @@ -10,11 +10,11 @@ ** ************************************************************************* ** A TCL Interface to SQLite. Append this file to sqlite3.c and ** compile the whole thing to build a TCL-enabled version of SQLite. ** -** $Id: tclsqlite.c,v 1.236 2009/02/04 22:46:47 drh Exp $ +** $Id: tclsqlite.c,v 1.228 2008/10/09 14:45:26 drh Exp $ */ #include "tcl.h" #include /* @@ -116,11 +116,10 @@ SqlPreparedStmt *stmtLast; /* Last statement in the list */ int maxStmt; /* The next maximum number of stmtList */ int nStmt; /* Number of statements in stmtList */ IncrblobChannel *pIncrblob;/* Linked list of open incrblob channels */ int nStep, nSort; /* Statistics for most recent operation */ - int nTransaction; /* Number of nested [transaction] methods */ }; struct IncrblobChannel { sqlite3_blob *pBlob; /* sqlite3 blob handle */ SqliteDb *pDb; /* Associated database connection */ @@ -127,21 +126,10 @@ int iSeek; /* Current seek offset */ Tcl_Channel channel; /* Channel identifier */ IncrblobChannel *pNext; /* Linked list of all open incrblob channels */ IncrblobChannel *pPrev; /* Linked list of all open incrblob channels */ }; - -/* -** Compute a string length that is limited to what can be stored in -** lower 30 bits of a 32-bit signed integer. -*/ -static int strlen30(const char *z){ - const char *z2 = z; - while( *z2 ){ z2++; } - return 0x3fffffff & (int)(z2 - z); -} - #ifndef SQLITE_OMIT_INCRBLOB /* ** Close all incrblob channels opened using database connection pDb. ** This is called when shutting down the database connection. @@ -394,11 +382,11 @@ ** structure. */ static SqlFunc *findSqlFunc(SqliteDb *pDb, const char *zName){ SqlFunc *p, *pNew; int i; - pNew = (SqlFunc*)Tcl_Alloc( sizeof(*pNew) + strlen30(zName) + 1 ); + pNew = (SqlFunc*)Tcl_Alloc( sizeof(*pNew) + strlen(zName) + 1 ); pNew->zName = (char*)&pNew[1]; for(i=0; zName[i]; i++){ pNew->zName[i] = tolower(zName[i]); } pNew->zName[i] = 0; for(p=pDb->pFunc; p; p=p->pNext){ if( strcmp(p->zName, pNew->zName)==0 ){ @@ -808,11 +796,10 @@ case SQLITE_REINDEX : zCode="SQLITE_REINDEX"; break; case SQLITE_ANALYZE : zCode="SQLITE_ANALYZE"; break; case SQLITE_CREATE_VTABLE : zCode="SQLITE_CREATE_VTABLE"; break; case SQLITE_DROP_VTABLE : zCode="SQLITE_DROP_VTABLE"; break; case SQLITE_FUNCTION : zCode="SQLITE_FUNCTION"; break; - case SQLITE_SAVEPOINT : zCode="SQLITE_SAVEPOINT"; break; default : zCode="????"; break; } Tcl_DStringInit(&str); Tcl_DStringAppend(&str, pDb->zAuth, -1); Tcl_DStringAppendElement(&str, zCode); @@ -981,35 +968,34 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){ SqliteDb *pDb = (SqliteDb*)cd; int choice; int rc = TCL_OK; static const char *DB_strs[] = { - "authorizer", "backup", "busy", - "cache", "changes", "close", - "collate", "collation_needed", "commit_hook", - "complete", "copy", "enable_load_extension", - "errorcode", "eval", "exists", - "function", "incrblob", "interrupt", - "last_insert_rowid", "nullvalue", "onecolumn", - "profile", "progress", "rekey", - "restore", "rollback_hook", "status", - "timeout", "total_changes", "trace", - "transaction", "update_hook", "version", - 0 + "authorizer", "busy", "cache", + "changes", "close", "collate", + "collation_needed", "commit_hook", "complete", + "copy", "enable_load_extension","errorcode", + "eval", "exists", "function", + "incrblob", "interrupt", "last_insert_rowid", + "nullvalue", "onecolumn", "profile", + "progress", "rekey", "rollback_hook", + "status", "timeout", "total_changes", + "trace", "transaction", "update_hook", + "version", 0 }; enum DB_enum { - DB_AUTHORIZER, DB_BACKUP, DB_BUSY, - DB_CACHE, DB_CHANGES, DB_CLOSE, - DB_COLLATE, DB_COLLATION_NEEDED, DB_COMMIT_HOOK, - DB_COMPLETE, DB_COPY, DB_ENABLE_LOAD_EXTENSION, - DB_ERRORCODE, DB_EVAL, DB_EXISTS, - DB_FUNCTION, DB_INCRBLOB, DB_INTERRUPT, - DB_LAST_INSERT_ROWID, DB_NULLVALUE, DB_ONECOLUMN, - DB_PROFILE, DB_PROGRESS, DB_REKEY, - DB_RESTORE, DB_ROLLBACK_HOOK, DB_STATUS, - DB_TIMEOUT, DB_TOTAL_CHANGES, DB_TRACE, - DB_TRANSACTION, DB_UPDATE_HOOK, DB_VERSION, + DB_AUTHORIZER, DB_BUSY, DB_CACHE, + DB_CHANGES, DB_CLOSE, DB_COLLATE, + DB_COLLATION_NEEDED, DB_COMMIT_HOOK, DB_COMPLETE, + DB_COPY, DB_ENABLE_LOAD_EXTENSION,DB_ERRORCODE, + DB_EVAL, DB_EXISTS, DB_FUNCTION, + DB_INCRBLOB, DB_INTERRUPT, DB_LAST_INSERT_ROWID, + DB_NULLVALUE, DB_ONECOLUMN, DB_PROFILE, + DB_PROGRESS, DB_REKEY, DB_ROLLBACK_HOOK, + DB_STATUS, DB_TIMEOUT, DB_TOTAL_CHANGES, + DB_TRACE, DB_TRANSACTION, DB_UPDATE_HOOK, + DB_VERSION }; /* don't leave trailing commas on DB_enum, it confuses the AIX xlc compiler */ if( objc<2 ){ Tcl_WrongNumArgs(interp, 1, objv, "SUBCOMMAND ..."); @@ -1073,59 +1059,10 @@ } #endif break; } - /* $db backup ?DATABASE? FILENAME - ** - ** Open or create a database file named FILENAME. Transfer the - ** content of local database DATABASE (default: "main") into the - ** FILENAME database. - */ - case DB_BACKUP: { - const char *zDestFile; - const char *zSrcDb; - sqlite3 *pDest; - sqlite3_backup *pBackup; - - if( objc==3 ){ - zSrcDb = "main"; - zDestFile = Tcl_GetString(objv[2]); - }else if( objc==4 ){ - zSrcDb = Tcl_GetString(objv[2]); - zDestFile = Tcl_GetString(objv[3]); - }else{ - Tcl_WrongNumArgs(interp, 2, objv, "?DATABASE? FILENAME"); - return TCL_ERROR; - } - rc = sqlite3_open(zDestFile, &pDest); - if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, "cannot open target database: ", - sqlite3_errmsg(pDest), (char*)0); - sqlite3_close(pDest); - return TCL_ERROR; - } - pBackup = sqlite3_backup_init(pDest, "main", pDb->db, zSrcDb); - if( pBackup==0 ){ - Tcl_AppendResult(interp, "backup failed: ", - sqlite3_errmsg(pDest), (char*)0); - sqlite3_close(pDest); - return TCL_ERROR; - } - while( (rc = sqlite3_backup_step(pBackup,100))==SQLITE_OK ){} - sqlite3_backup_finish(pBackup); - if( rc==SQLITE_DONE ){ - rc = TCL_OK; - }else{ - Tcl_AppendResult(interp, "backup failed: ", - sqlite3_errmsg(pDest), (char*)0); - rc = TCL_ERROR; - } - sqlite3_close(pDest); - break; - } - /* $db busy ?CALLBACK? ** ** Invoke the given callback if an SQL statement attempts to open ** a locked database file. */ @@ -1400,12 +1337,12 @@ zNull = ""; } zConflict = Tcl_GetStringFromObj(objv[2], 0); zTable = Tcl_GetStringFromObj(objv[3], 0); zFile = Tcl_GetStringFromObj(objv[4], 0); - nSep = strlen30(zSep); - nNull = strlen30(zNull); + nSep = strlen(zSep); + nNull = strlen(zNull); if( nSep==0 ){ Tcl_AppendResult(interp,"Error: non-null separator required for copy",0); return TCL_ERROR; } if(strcmp(zConflict, "rollback") != 0 && @@ -1421,11 +1358,11 @@ zSql = sqlite3_mprintf("SELECT * FROM '%q'", zTable); if( zSql==0 ){ Tcl_AppendResult(interp, "Error: no such table: ", zTable, 0); return TCL_ERROR; } - nByte = strlen30(zSql); + nByte = strlen(zSql); rc = sqlite3_prepare(pDb->db, zSql, -1, &pStmt, 0); sqlite3_free(zSql); if( rc ){ Tcl_AppendResult(interp, "Error: ", sqlite3_errmsg(pDb->db), 0); nCol = 0; @@ -1441,11 +1378,11 @@ Tcl_AppendResult(interp, "Error: can't malloc()", 0); return TCL_ERROR; } sqlite3_snprintf(nByte+50, zSql, "INSERT OR %q INTO '%q' VALUES(?", zConflict, zTable); - j = strlen30(zSql); + j = strlen(zSql); for(i=1; i0 && strcmp(azCol[i], zNull)==0) - || strlen30(azCol[i])==0 - ){ + if ((nNull>0 && strcmp(azCol[i], zNull)==0) || strlen(azCol[i])==0) { sqlite3_bind_null(pStmt, i+1); }else{ sqlite3_bind_text(pStmt, i+1, azCol[i], -1, SQLITE_STATIC); } } @@ -1643,11 +1578,11 @@ /* Try to find a SQL statement that has already been compiled and ** which matches the next sequence of SQL. */ pStmt = 0; - len = strlen30(zSql); + len = strlen(zSql); for(pPreStmt = pDb->stmtList; pPreStmt; pPreStmt=pPreStmt->pNext){ int n = pPreStmt->nSql; if( len>=n && memcmp(pPreStmt->zSql, zSql, n)==0 && (zSql[n]==0 || zSql[n-1]==';') @@ -1896,11 +1831,11 @@ pPreStmt = (SqlPreparedStmt*)Tcl_Alloc( sizeof(*pPreStmt) ); if( pPreStmt==0 ) return TCL_ERROR; pPreStmt->pStmt = pStmt; pPreStmt->nSql = len; pPreStmt->zSql = sqlite3_sql(pStmt); - assert( strlen30(pPreStmt->zSql)==len ); + assert( strlen(pPreStmt->zSql)==len ); assert( 0==memcmp(pPreStmt->zSql, zSql, len) ); } /* Add the prepared statement to the beginning of the cache list */ @@ -1957,11 +1892,11 @@ Tcl_Obj *pScript; char *zName; int nArg = -1; if( objc==6 ){ const char *z = Tcl_GetString(objv[3]); - int n = strlen30(z); + int n = strlen(z); if( n>2 && strncmp(z, "-argcount",n)==0 ){ if( Tcl_GetIntFromObj(interp, objv[4], &nArg) ) return TCL_ERROR; if( nArg<0 ){ Tcl_AppendResult(interp, "number of arguments must be non-negative", (char*)0); @@ -2199,69 +2134,10 @@ } #endif break; } - /* $db restore ?DATABASE? FILENAME - ** - ** Open a database file named FILENAME. Transfer the content - ** of FILENAME into the local database DATABASE (default: "main"). - */ - case DB_RESTORE: { - const char *zSrcFile; - const char *zDestDb; - sqlite3 *pSrc; - sqlite3_backup *pBackup; - int nTimeout = 0; - - if( objc==3 ){ - zDestDb = "main"; - zSrcFile = Tcl_GetString(objv[2]); - }else if( objc==4 ){ - zDestDb = Tcl_GetString(objv[2]); - zSrcFile = Tcl_GetString(objv[3]); - }else{ - Tcl_WrongNumArgs(interp, 2, objv, "?DATABASE? FILENAME"); - return TCL_ERROR; - } - rc = sqlite3_open_v2(zSrcFile, &pSrc, SQLITE_OPEN_READONLY, 0); - if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, "cannot open source database: ", - sqlite3_errmsg(pSrc), (char*)0); - sqlite3_close(pSrc); - return TCL_ERROR; - } - pBackup = sqlite3_backup_init(pDb->db, zDestDb, pSrc, "main"); - if( pBackup==0 ){ - Tcl_AppendResult(interp, "restore failed: ", - sqlite3_errmsg(pDb->db), (char*)0); - sqlite3_close(pSrc); - return TCL_ERROR; - } - while( (rc = sqlite3_backup_step(pBackup,100))==SQLITE_OK - || rc==SQLITE_BUSY ){ - if( rc==SQLITE_BUSY ){ - if( nTimeout++ >= 3 ) break; - sqlite3_sleep(100); - } - } - sqlite3_backup_finish(pBackup); - if( rc==SQLITE_DONE ){ - rc = TCL_OK; - }else if( rc==SQLITE_BUSY || rc==SQLITE_LOCKED ){ - Tcl_AppendResult(interp, "restore failed: source database busy", - (char*)0); - rc = TCL_ERROR; - }else{ - Tcl_AppendResult(interp, "restore failed: ", - sqlite3_errmsg(pDb->db), (char*)0); - rc = TCL_ERROR; - } - sqlite3_close(pSrc); - break; - } - /* ** $db status (step|sort) ** ** Display SQLITE_STMTSTATUS_FULLSCAN_STEP or ** SQLITE_STMTSTATUS_SORT for the most recent eval. @@ -2369,21 +2245,20 @@ ** ** This command was inspired by Dave Thomas's talk on Ruby at the ** 2005 O'Reilly Open Source Convention (OSCON). */ case DB_TRANSACTION: { + int inTrans; Tcl_Obj *pScript; - const char *zBegin = "SAVEPOINT _tcl_transaction"; - const char *zEnd; + const char *zBegin = "BEGIN"; if( objc!=3 && objc!=4 ){ Tcl_WrongNumArgs(interp, 2, objv, "[TYPE] SCRIPT"); return TCL_ERROR; } - - if( pDb->nTransaction ){ - zBegin = "SAVEPOINT _tcl_transaction"; - }else if( pDb->nTransaction==0 && objc==4 ){ + if( objc==3 ){ + pScript = objv[2]; + } else { static const char *TTYPE_strs[] = { "deferred", "exclusive", "immediate", 0 }; enum TTYPE_enum { TTYPE_DEFERRED, TTYPE_EXCLUSIVE, TTYPE_IMMEDIATE @@ -2396,59 +2271,32 @@ switch( (enum TTYPE_enum)ttype ){ case TTYPE_DEFERRED: /* no-op */; break; case TTYPE_EXCLUSIVE: zBegin = "BEGIN EXCLUSIVE"; break; case TTYPE_IMMEDIATE: zBegin = "BEGIN IMMEDIATE"; break; } - } - pScript = objv[objc-1]; - - pDb->disableAuth++; - rc = sqlite3_exec(pDb->db, zBegin, 0, 0, 0); - pDb->disableAuth--; - if( rc!=SQLITE_OK ){ - Tcl_AppendResult(interp, sqlite3_errmsg(pDb->db), 0); - return TCL_ERROR; - } - - pDb->nTransaction++; + pScript = objv[3]; + } + inTrans = !sqlite3_get_autocommit(pDb->db); + if( !inTrans ){ + pDb->disableAuth++; + (void)sqlite3_exec(pDb->db, zBegin, 0, 0, 0); + pDb->disableAuth--; + } rc = Tcl_EvalObjEx(interp, pScript, 0); - pDb->nTransaction--; - - if( rc!=TCL_ERROR ){ - if( pDb->nTransaction ){ - zEnd = "RELEASE _tcl_transaction"; - }else{ + if( !inTrans ){ + const char *zEnd; + if( rc==TCL_ERROR ){ + zEnd = "ROLLBACK"; + } else { zEnd = "COMMIT"; } - }else{ - if( pDb->nTransaction ){ - zEnd = "ROLLBACK TO _tcl_transaction ; RELEASE _tcl_transaction"; - }else{ - zEnd = "ROLLBACK"; - } - } - - pDb->disableAuth++; - if( sqlite3_exec(pDb->db, zEnd, 0, 0, 0) ){ - /* This is a tricky scenario to handle. The most likely cause of an - ** error is that the exec() above was an attempt to commit the - ** top-level transaction that returned SQLITE_BUSY. Or, less likely, - ** that an IO-error has occured. In either case, throw a Tcl exception - ** and try to rollback the transaction. - ** - ** But it could also be that the user executed one or more BEGIN, - ** COMMIT, SAVEPOINT, RELEASE or ROLLBACK commands that are confusing - ** this method's logic. Not clear how this would be best handled. - */ - if( rc!=TCL_ERROR ){ - Tcl_AppendResult(interp, sqlite3_errmsg(pDb->db), 0); - rc = TCL_ERROR; - } - sqlite3_exec(pDb->db, "ROLLBACK", 0, 0, 0); - } - pDb->disableAuth--; - + pDb->disableAuth++; + if( sqlite3_exec(pDb->db, zEnd, 0, 0, 0) ){ + sqlite3_exec(pDb->db, "ROLLBACK", 0, 0, 0); + } + pDb->disableAuth--; + } break; } /* ** $db update_hook ?script? @@ -2770,11 +2618,10 @@ extern int Sqlitetestsse_Init(Tcl_Interp*); extern int Sqlitetesttclvar_Init(Tcl_Interp*); extern int SqlitetestThread_Init(Tcl_Interp*); extern int SqlitetestOnefile_Init(); extern int SqlitetestOsinst_Init(Tcl_Interp*); - extern int Sqlitetestbackup_Init(Tcl_Interp*); Md5_Init(interp); Sqliteconfig_Init(interp); Sqlitetest1_Init(interp); Sqlitetest2_Init(interp); @@ -2794,11 +2641,10 @@ Sqlitetestschema_Init(interp); Sqlitetesttclvar_Init(interp); SqlitetestThread_Init(interp); SqlitetestOnefile_Init(interp); SqlitetestOsinst_Init(interp); - Sqlitetestbackup_Init(interp); #ifdef SQLITE_SSE Sqlitetestsse_Init(interp); #endif } @@ -2814,11 +2660,11 @@ Tcl_SetVar(interp, "argv", argv[i], TCL_GLOBAL_ONLY | TCL_LIST_ELEMENT | TCL_APPEND_VALUE); } if( TCLSH==1 && Tcl_EvalFile(interp, argv[1])!=TCL_OK ){ const char *zInfo = Tcl_GetVar(interp, "errorInfo", TCL_GLOBAL_ONLY); - if( zInfo==0 ) zInfo = Tcl_GetStringResult(interp); + if( zInfo==0 ) zInfo = interp->result; fprintf(stderr,"%s: %s\n", *argv, zInfo); return 1; } } if( argc<=1 || TCLSH==2 ){ Index: src/test1.c ================================================================== --- src/test1.c +++ src/test1.c @@ -11,11 +11,11 @@ ************************************************************************* ** Code for testing all sorts of SQLite interfaces. This code ** is not included in the SQLite library. It is used for automated ** testing of the SQLite library. ** -** $Id: test1.c,v 1.347 2009/02/03 16:51:25 danielk1977 Exp $ +** $Id: test1.c,v 1.328 2008/10/12 00:27:54 shane Exp $ */ #include "sqliteInt.h" #include "tcl.h" #include #include @@ -115,57 +115,39 @@ } const char *sqlite3TestErrorName(int rc){ const char *zName = 0; - switch( rc ){ - case SQLITE_OK: zName = "SQLITE_OK"; break; - case SQLITE_ERROR: zName = "SQLITE_ERROR"; break; - case SQLITE_INTERNAL: zName = "SQLITE_INTERNAL"; break; - case SQLITE_PERM: zName = "SQLITE_PERM"; break; - case SQLITE_ABORT: zName = "SQLITE_ABORT"; break; - case SQLITE_BUSY: zName = "SQLITE_BUSY"; break; - case SQLITE_LOCKED: zName = "SQLITE_LOCKED"; break; - case SQLITE_NOMEM: zName = "SQLITE_NOMEM"; break; - case SQLITE_READONLY: zName = "SQLITE_READONLY"; break; - case SQLITE_INTERRUPT: zName = "SQLITE_INTERRUPT"; break; - case SQLITE_IOERR: zName = "SQLITE_IOERR"; break; - case SQLITE_CORRUPT: zName = "SQLITE_CORRUPT"; break; - case SQLITE_NOTFOUND: zName = "SQLITE_NOTFOUND"; break; - case SQLITE_FULL: zName = "SQLITE_FULL"; break; - case SQLITE_CANTOPEN: zName = "SQLITE_CANTOPEN"; break; - case SQLITE_PROTOCOL: zName = "SQLITE_PROTOCOL"; break; - case SQLITE_EMPTY: zName = "SQLITE_EMPTY"; break; - case SQLITE_SCHEMA: zName = "SQLITE_SCHEMA"; break; - case SQLITE_TOOBIG: zName = "SQLITE_TOOBIG"; break; - case SQLITE_CONSTRAINT: zName = "SQLITE_CONSTRAINT"; break; - case SQLITE_MISMATCH: zName = "SQLITE_MISMATCH"; break; - case SQLITE_MISUSE: zName = "SQLITE_MISUSE"; break; - case SQLITE_NOLFS: zName = "SQLITE_NOLFS"; break; - case SQLITE_AUTH: zName = "SQLITE_AUTH"; break; - case SQLITE_FORMAT: zName = "SQLITE_FORMAT"; break; - case SQLITE_RANGE: zName = "SQLITE_RANGE"; break; - case SQLITE_NOTADB: zName = "SQLITE_NOTADB"; break; - case SQLITE_ROW: zName = "SQLITE_ROW"; break; - case SQLITE_DONE: zName = "SQLITE_DONE"; break; - case SQLITE_IOERR_READ: zName = "SQLITE_IOERR_READ"; break; - case SQLITE_IOERR_SHORT_READ: zName = "SQLITE_IOERR_SHORT_READ"; break; - case SQLITE_IOERR_WRITE: zName = "SQLITE_IOERR_WRITE"; break; - case SQLITE_IOERR_FSYNC: zName = "SQLITE_IOERR_FSYNC"; break; - case SQLITE_IOERR_DIR_FSYNC: zName = "SQLITE_IOERR_DIR_FSYNC"; break; - case SQLITE_IOERR_TRUNCATE: zName = "SQLITE_IOERR_TRUNCATE"; break; - case SQLITE_IOERR_FSTAT: zName = "SQLITE_IOERR_FSTAT"; break; - case SQLITE_IOERR_UNLOCK: zName = "SQLITE_IOERR_UNLOCK"; break; - case SQLITE_IOERR_RDLOCK: zName = "SQLITE_IOERR_RDLOCK"; break; - case SQLITE_IOERR_DELETE: zName = "SQLITE_IOERR_DELETE"; break; - case SQLITE_IOERR_BLOCKED: zName = "SQLITE_IOERR_BLOCKED"; break; - case SQLITE_IOERR_NOMEM: zName = "SQLITE_IOERR_NOMEM"; break; - case SQLITE_IOERR_ACCESS: zName = "SQLITE_IOERR_ACCESS"; break; - case SQLITE_IOERR_CHECKRESERVEDLOCK: - zName = "SQLITE_IOERR_CHECKRESERVEDLOCK"; break; - case SQLITE_IOERR_LOCK: zName = "SQLITE_IOERR_LOCK"; break; - default: zName = "SQLITE_Unknown"; break; + switch( rc & 0xff ){ + case SQLITE_OK: zName = "SQLITE_OK"; break; + case SQLITE_ERROR: zName = "SQLITE_ERROR"; break; + case SQLITE_PERM: zName = "SQLITE_PERM"; break; + case SQLITE_ABORT: zName = "SQLITE_ABORT"; break; + case SQLITE_BUSY: zName = "SQLITE_BUSY"; break; + case SQLITE_LOCKED: zName = "SQLITE_LOCKED"; break; + case SQLITE_NOMEM: zName = "SQLITE_NOMEM"; break; + case SQLITE_READONLY: zName = "SQLITE_READONLY"; break; + case SQLITE_INTERRUPT: zName = "SQLITE_INTERRUPT"; break; + case SQLITE_IOERR: zName = "SQLITE_IOERR"; break; + case SQLITE_CORRUPT: zName = "SQLITE_CORRUPT"; break; + case SQLITE_FULL: zName = "SQLITE_FULL"; break; + case SQLITE_CANTOPEN: zName = "SQLITE_CANTOPEN"; break; + case SQLITE_PROTOCOL: zName = "SQLITE_PROTOCOL"; break; + case SQLITE_EMPTY: zName = "SQLITE_EMPTY"; break; + case SQLITE_SCHEMA: zName = "SQLITE_SCHEMA"; break; + case SQLITE_CONSTRAINT: zName = "SQLITE_CONSTRAINT"; break; + case SQLITE_MISMATCH: zName = "SQLITE_MISMATCH"; break; + case SQLITE_MISUSE: zName = "SQLITE_MISUSE"; break; + case SQLITE_NOLFS: zName = "SQLITE_NOLFS"; break; + case SQLITE_AUTH: zName = "SQLITE_AUTH"; break; + case SQLITE_FORMAT: zName = "SQLITE_FORMAT"; break; + case SQLITE_RANGE: zName = "SQLITE_RANGE"; break; + case SQLITE_ROW: zName = "SQLITE_ROW"; break; + case SQLITE_DONE: zName = "SQLITE_DONE"; break; + case SQLITE_NOTADB: zName = "SQLITE_NOTADB"; break; + case SQLITE_TOOBIG: zName = "SQLITE_TOOBIG"; break; + default: zName = "SQLITE_Unknown"; break; } return zName; } #define t1ErrorName sqlite3TestErrorName @@ -178,12 +160,11 @@ /* ** Check a return value to make sure it agrees with the results ** from sqlite3_errcode. */ int sqlite3TestErrCode(Tcl_Interp *interp, sqlite3 *db, int rc){ - if( sqlite3_threadsafe()==0 && rc!=SQLITE_MISUSE && rc!=SQLITE_OK - && sqlite3_errcode(db)!=rc ){ + if( rc!=SQLITE_MISUSE && rc!=SQLITE_OK && sqlite3_errcode(db)!=rc ){ char zBuf[200]; int r2 = sqlite3_errcode(db); sprintf(zBuf, "error code %s (%d) does not match sqlite3_errcode %s (%d)", t1ErrorName(rc), rc, t1ErrorName(r2), r2); Tcl_ResetResult(interp); @@ -324,57 +305,10 @@ Tcl_DStringInit(&str); zSql = sqlite3_mprintf(argv[2], argv[3]); rc = sqlite3_exec(db, zSql, exec_printf_cb, &str, &zErr); sqlite3_free(zSql); sprintf(zBuf, "%d", rc); - Tcl_AppendElement(interp, zBuf); - Tcl_AppendElement(interp, rc==SQLITE_OK ? Tcl_DStringValue(&str) : zErr); - Tcl_DStringFree(&str); - if( zErr ) sqlite3_free(zErr); - if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR; - return TCL_OK; -} - -/* -** Usage: sqlite3_exec_hex DB HEX -** -** Invoke the sqlite3_exec() on a string that is obtained by translating -** HEX into ASCII. Most characters are translated as is. %HH becomes -** a hex character. -*/ -static int test_exec_hex( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - char **argv /* Text of each argument */ -){ - sqlite3 *db; - Tcl_DString str; - int rc, i, j; - char *zErr = 0; - char *zHex; - char zSql[500]; - char zBuf[30]; - if( argc!=3 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " DB HEX", 0); - return TCL_ERROR; - } - if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR; - zHex = argv[2]; - for(i=j=0; i>8); + } + Tcl_AppendResult(interp, (char *)t1ErrorName(rc), zBuf, 0); return TCL_OK; } /* -** Usage: sqlite3_errmsg DB +** Usage: test_errmsg DB ** ** Returns the UTF-8 representation of the error message string for the ** most recent sqlite3_* API call. */ static int test_errmsg( @@ -3277,11 +3157,11 @@ #endif /* SQLITE_OMIT_UTF16 */ return TCL_OK; } /* -** Usage: sqlite3_prepare DB sql bytes ?tailvar? +** Usage: sqlite3_prepare DB sql bytes tailvar ** ** Compile up to bytes of the supplied SQL string using ** database handle . The parameter is the name of a global ** variable that is set to the unused portion of (if any). A ** STMT handle is returned. @@ -3298,22 +3178,22 @@ const char *zTail = 0; sqlite3_stmt *pStmt = 0; char zBuf[50]; int rc; - if( objc!=5 && objc!=4 ){ + if( objc!=5 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " DB sql bytes ?tailvar?", 0); + Tcl_GetString(objv[0]), " DB sql bytes tailvar", 0); return TCL_ERROR; } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; zSql = Tcl_GetString(objv[2]); if( Tcl_GetIntFromObj(interp, objv[3], &bytes) ) return TCL_ERROR; - rc = sqlite3_prepare(db, zSql, bytes, &pStmt, objc>=5 ? &zTail : 0); + rc = sqlite3_prepare(db, zSql, bytes, &pStmt, &zTail); if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR; - if( zTail && objc>=5 ){ + if( zTail ){ if( bytes>=0 ){ bytes = bytes - (zTail-zSql); } if( strlen(zTail) bytes of the supplied SQL string using ** database handle . The parameter is the name of a global ** variable that is set to the unused portion of (if any). A ** STMT handle is returned. @@ -3354,23 +3234,23 @@ const char *zTail = 0; sqlite3_stmt *pStmt = 0; char zBuf[50]; int rc; - if( objc!=5 && objc!=4 ){ + if( objc!=5 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", Tcl_GetString(objv[0]), " DB sql bytes tailvar", 0); return TCL_ERROR; } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; zSql = Tcl_GetString(objv[2]); if( Tcl_GetIntFromObj(interp, objv[3], &bytes) ) return TCL_ERROR; - rc = sqlite3_prepare_v2(db, zSql, bytes, &pStmt, objc>=5 ? &zTail : 0); + rc = sqlite3_prepare_v2(db, zSql, bytes, &pStmt, &zTail); assert(rc==SQLITE_OK || pStmt==0); if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR; - if( zTail && objc>=5 ){ + if( zTail ){ if( bytes>=0 ){ bytes = bytes - (zTail-zSql); } Tcl_ObjSetVar2(interp, objv[4], 0, Tcl_NewStringObj(zTail, bytes), 0); } @@ -3452,36 +3332,34 @@ char zBuf[50]; int rc; int bytes; /* The integer specified as arg 3 */ int objlen; /* The byte-array length of arg 2 */ - if( objc!=5 && objc!=4 ){ + if( objc!=5 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " DB sql bytes ?tailvar?", 0); + Tcl_GetString(objv[0]), " DB sql bytes tailvar", 0); return TCL_ERROR; } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; zSql = Tcl_GetByteArrayFromObj(objv[2], &objlen); if( Tcl_GetIntFromObj(interp, objv[3], &bytes) ) return TCL_ERROR; - rc = sqlite3_prepare16(db, zSql, bytes, &pStmt, objc>=5 ? &zTail : 0); + rc = sqlite3_prepare16(db, zSql, bytes, &pStmt, &zTail); if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR; if( rc ){ return TCL_ERROR; } - if( objc>=5 ){ - if( zTail ){ - objlen = objlen - ((u8 *)zTail-(u8 *)zSql); - }else{ - objlen = 0; - } - pTail = Tcl_NewByteArrayObj((u8 *)zTail, objlen); - Tcl_IncrRefCount(pTail); - Tcl_ObjSetVar2(interp, objv[4], 0, pTail, 0); - Tcl_DecrRefCount(pTail); - } + if( zTail ){ + objlen = objlen - ((u8 *)zTail-(u8 *)zSql); + }else{ + objlen = 0; + } + pTail = Tcl_NewByteArrayObj((u8 *)zTail, objlen); + Tcl_IncrRefCount(pTail); + Tcl_ObjSetVar2(interp, objv[4], 0, pTail, 0); + Tcl_DecrRefCount(pTail); if( pStmt ){ if( sqlite3TestMakePointerStr(interp, zBuf, pStmt) ) return TCL_ERROR; } Tcl_AppendResult(interp, zBuf, 0); @@ -3488,11 +3366,11 @@ #endif /* SQLITE_OMIT_UTF16 */ return TCL_OK; } /* -** Usage: sqlite3_prepare16_v2 DB sql bytes ?tailvar? +** Usage: sqlite3_prepare16_v2 DB sql bytes tailvar ** ** Compile up to bytes of the supplied SQL string using ** database handle . The parameter is the name of a global ** variable that is set to the unused portion of (if any). A ** STMT handle is returned. @@ -3512,36 +3390,34 @@ char zBuf[50]; int rc; int bytes; /* The integer specified as arg 3 */ int objlen; /* The byte-array length of arg 2 */ - if( objc!=5 && objc!=4 ){ + if( objc!=5 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetString(objv[0]), " DB sql bytes ?tailvar?", 0); + Tcl_GetString(objv[0]), " DB sql bytes tailvar", 0); return TCL_ERROR; } if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ) return TCL_ERROR; zSql = Tcl_GetByteArrayFromObj(objv[2], &objlen); if( Tcl_GetIntFromObj(interp, objv[3], &bytes) ) return TCL_ERROR; - rc = sqlite3_prepare16_v2(db, zSql, bytes, &pStmt, objc>=5 ? &zTail : 0); + rc = sqlite3_prepare16_v2(db, zSql, bytes, &pStmt, &zTail); if( sqlite3TestErrCode(interp, db, rc) ) return TCL_ERROR; if( rc ){ return TCL_ERROR; } - if( objc>=5 ){ - if( zTail ){ - objlen = objlen - ((u8 *)zTail-(u8 *)zSql); - }else{ - objlen = 0; - } - pTail = Tcl_NewByteArrayObj((u8 *)zTail, objlen); - Tcl_IncrRefCount(pTail); - Tcl_ObjSetVar2(interp, objv[4], 0, pTail, 0); - Tcl_DecrRefCount(pTail); - } + if( zTail ){ + objlen = objlen - ((u8 *)zTail-(u8 *)zSql); + }else{ + objlen = 0; + } + pTail = Tcl_NewByteArrayObj((u8 *)zTail, objlen); + Tcl_IncrRefCount(pTail); + Tcl_ObjSetVar2(interp, objv[4], 0, pTail, 0); + Tcl_DecrRefCount(pTail); if( pStmt ){ if( sqlite3TestMakePointerStr(interp, zBuf, pStmt) ) return TCL_ERROR; } Tcl_AppendResult(interp, zBuf, 0); @@ -3998,11 +3874,11 @@ db->magic = SQLITE_MAGIC_CLOSED; }else if( strcmp(argv[2], "SQLITE_MAGIC_BUSY")==0 ){ db->magic = SQLITE_MAGIC_BUSY; }else if( strcmp(argv[2], "SQLITE_MAGIC_ERROR")==0 ){ db->magic = SQLITE_MAGIC_ERROR; - }else if( Tcl_GetInt(interp, argv[2], (int*)&db->magic) ){ + }else if( Tcl_GetInt(interp, argv[2], &db->magic) ){ return TCL_ERROR; } return TCL_OK; } @@ -4549,113 +4425,12 @@ assert( rc==SQLITE_ERROR ); rc = sqlite3_file_control(db, "main", -1, &iArg); assert( rc==SQLITE_ERROR ); rc = sqlite3_file_control(db, "temp", -1, &iArg); assert( rc==SQLITE_ERROR ); - - return TCL_OK; -} - - -/* -** tclcmd: file_control_lasterrno_test DB -** -** This TCL command runs the sqlite3_file_control interface and -** verifies correct operation of the SQLITE_LAST_ERRNO verb. -*/ -static int file_control_lasterrno_test( - ClientData clientData, /* Pointer to sqlite3_enable_XXX function */ - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int objc, /* Number of arguments */ - Tcl_Obj *CONST objv[] /* Command arguments */ -){ - int iArg = 0; - sqlite3 *db; - int rc; - - if( objc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " DB", 0); - return TCL_ERROR; - } - if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ){ - return TCL_ERROR; - } - rc = sqlite3_file_control(db, NULL, SQLITE_LAST_ERRNO, &iArg); - if( rc ){ - Tcl_SetObjResult(interp, Tcl_NewIntObj(rc)); - return TCL_ERROR; - } - if( iArg!=0 ) { - Tcl_AppendResult(interp, "Unexpected non-zero errno: ", - Tcl_GetStringFromObj(Tcl_NewIntObj(iArg), 0), " ", 0); - return TCL_ERROR; - } - return TCL_OK; -} - -/* -** tclcmd: file_control_lockproxy_test DB -** -** This TCL command runs the sqlite3_file_control interface and -** verifies correct operation of the SQLITE_GET_LOCKPROXYFILE and -** SQLITE_SET_LOCKPROXYFILE verbs. -*/ -static int file_control_lockproxy_test( - ClientData clientData, /* Pointer to sqlite3_enable_XXX function */ - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int objc, /* Number of arguments */ - Tcl_Obj *CONST objv[] /* Command arguments */ -){ - sqlite3 *db; - - if( objc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", - Tcl_GetStringFromObj(objv[0], 0), " DB", 0); - return TCL_ERROR; - } - if( getDbPointer(interp, Tcl_GetString(objv[1]), &db) ){ - return TCL_ERROR; - } - -#if !defined(SQLITE_ENABLE_LOCKING_STYLE) -# if defined(__APPLE__) -# define SQLITE_ENABLE_LOCKING_STYLE 1 -# else -# define SQLITE_ENABLE_LOCKING_STYLE 0 -# endif -#endif -#if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__) - { - char *proxyPath = "test.proxy"; - char *testPath; - int rc; - rc = sqlite3_file_control(db, NULL, SQLITE_SET_LOCKPROXYFILE, proxyPath); - if( rc ){ - Tcl_SetObjResult(interp, Tcl_NewIntObj(rc)); - return TCL_ERROR; - } - rc = sqlite3_file_control(db, NULL, SQLITE_GET_LOCKPROXYFILE, &testPath); - if( strncmp(proxyPath,testPath,11) ){ - Tcl_AppendResult(interp, "Lock proxy file did not match the " - "previously assigned value", 0); - return TCL_ERROR; - } - if( rc ){ - Tcl_SetObjResult(interp, Tcl_NewIntObj(rc)); - return TCL_ERROR; - } - rc = sqlite3_file_control(db, NULL, SQLITE_SET_LOCKPROXYFILE, proxyPath); - if( rc ){ - Tcl_SetObjResult(interp, Tcl_NewIntObj(rc)); - return TCL_ERROR; - } - } -#endif - return TCL_OK; -} - + return TCL_OK; +} /* ** tclcmd: sqlite3_vfs_list ** ** Return a tcl list containing the names of all registered vfs's. @@ -4824,13 +4599,10 @@ extern int sqlite3_search_count; extern int sqlite3_interrupt_count; extern int sqlite3_open_file_count; extern int sqlite3_sort_count; extern int sqlite3_current_time; -#if SQLITE_OS_UNIX && defined(__APPLE__) - extern int sqlite3_hostid_num; -#endif extern int sqlite3_max_blobsize; extern int sqlite3BtreeSharedCacheReport(void*, Tcl_Interp*,int,Tcl_Obj*CONST*); static struct { char *zName; @@ -4838,11 +4610,10 @@ } aCmd[] = { { "db_enter", (Tcl_CmdProc*)db_enter }, { "db_leave", (Tcl_CmdProc*)db_leave }, { "sqlite3_mprintf_int", (Tcl_CmdProc*)sqlite3_mprintf_int }, { "sqlite3_mprintf_int64", (Tcl_CmdProc*)sqlite3_mprintf_int64 }, - { "sqlite3_mprintf_long", (Tcl_CmdProc*)sqlite3_mprintf_long }, { "sqlite3_mprintf_str", (Tcl_CmdProc*)sqlite3_mprintf_str }, { "sqlite3_snprintf_str", (Tcl_CmdProc*)sqlite3_snprintf_str }, { "sqlite3_mprintf_stronly", (Tcl_CmdProc*)sqlite3_mprintf_stronly}, { "sqlite3_mprintf_double", (Tcl_CmdProc*)sqlite3_mprintf_double }, { "sqlite3_mprintf_scaled", (Tcl_CmdProc*)sqlite3_mprintf_scaled }, @@ -4850,11 +4621,10 @@ { "sqlite3_mprintf_z_test", (Tcl_CmdProc*)test_mprintf_z }, { "sqlite3_mprintf_n_test", (Tcl_CmdProc*)test_mprintf_n }, { "sqlite3_snprintf_int", (Tcl_CmdProc*)test_snprintf_int }, { "sqlite3_last_insert_rowid", (Tcl_CmdProc*)test_last_rowid }, { "sqlite3_exec_printf", (Tcl_CmdProc*)test_exec_printf }, - { "sqlite3_exec_hex", (Tcl_CmdProc*)test_exec_hex }, { "sqlite3_exec", (Tcl_CmdProc*)test_exec }, { "sqlite3_exec_nr", (Tcl_CmdProc*)test_exec_nr }, #ifndef SQLITE_OMIT_GET_TABLE { "sqlite3_get_table_printf", (Tcl_CmdProc*)test_get_table_printf }, #endif @@ -4895,11 +4665,10 @@ { "sqlite3_bind_parameter_name", test_bind_parameter_name, 0}, { "sqlite3_bind_parameter_index", test_bind_parameter_index, 0}, { "sqlite3_clear_bindings", test_clear_bindings, 0}, { "sqlite3_sleep", test_sleep, 0}, { "sqlite3_errcode", test_errcode ,0 }, - { "sqlite3_extended_errcode", test_ex_errcode ,0 }, { "sqlite3_errmsg", test_errmsg ,0 }, { "sqlite3_errmsg16", test_errmsg16 ,0 }, { "sqlite3_open", test_open ,0 }, { "sqlite3_open16", test_open16 ,0 }, { "sqlite3_complete16", test_complete16 ,0 }, @@ -4973,12 +4742,10 @@ { "vfs_unlink_test", vfs_unlink_test, 0 }, { "vfs_initfail_test", vfs_initfail_test, 0 }, { "vfs_unregister_all", vfs_unregister_all, 0 }, { "vfs_reregister_all", vfs_reregister_all, 0 }, { "file_control_test", file_control_test, 0 }, - { "file_control_lasterrno_test", file_control_lasterrno_test, 0 }, - { "file_control_lockproxy_test", file_control_lockproxy_test, 0 }, { "sqlite3_vfs_list", vfs_list, 0 }, /* Functions from os.h */ #ifndef SQLITE_OMIT_UTF16 { "add_test_collate", test_collate, 0 }, @@ -5008,11 +4775,11 @@ extern int sqlite3_like_count; extern int sqlite3_xferopt_count; extern int sqlite3_pager_readdb_count; extern int sqlite3_pager_writedb_count; extern int sqlite3_pager_writej_count; -#if defined(__linux__) && defined(SQLITE_TEST) && SQLITE_THREADSAFE +#if SQLITE_OS_UNIX && defined(SQLITE_TEST) && SQLITE_THREADSAFE extern int threadsOverrideEachOthersLocks; #endif #if SQLITE_OS_WIN extern int sqlite3_os_type; #endif @@ -5020,15 +4787,13 @@ extern int sqlite3WhereTrace; extern int sqlite3OSTrace; extern int sqlite3VdbeAddopTrace; #endif #ifdef SQLITE_TEST + extern int sqlite3_enable_in_opt; extern char sqlite3_query_plan[]; static char *query_plan = sqlite3_query_plan; -#ifdef SQLITE_ENABLE_FTS3 - extern int sqlite3_fts3_enable_parentheses; -#endif #endif for(i=0; i #include @@ -163,11 +163,11 @@ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " ID\"", 0); return TCL_ERROR; } pPager = sqlite3TestTextToPtr(argv[1]); - rc = sqlite3PagerCommitPhaseOne(pPager, 0, 0); + rc = sqlite3PagerCommitPhaseOne(pPager, 0, 0, 0); if( rc!=SQLITE_OK ){ Tcl_AppendResult(interp, errorName(rc), 0); return TCL_ERROR; } rc = sqlite3PagerCommitPhaseTwo(pPager); @@ -195,11 +195,11 @@ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " ID\"", 0); return TCL_ERROR; } pPager = sqlite3TestTextToPtr(argv[1]); - rc = sqlite3PagerOpenSavepoint(pPager, 1); + rc = sqlite3PagerStmtBegin(pPager); if( rc!=SQLITE_OK ){ Tcl_AppendResult(interp, errorName(rc), 0); return TCL_ERROR; } return TCL_OK; @@ -222,12 +222,11 @@ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " ID\"", 0); return TCL_ERROR; } pPager = sqlite3TestTextToPtr(argv[1]); - rc = sqlite3PagerSavepoint(pPager, SAVEPOINT_ROLLBACK, 0); - sqlite3PagerSavepoint(pPager, SAVEPOINT_RELEASE, 0); + rc = sqlite3PagerStmtRollback(pPager); if( rc!=SQLITE_OK ){ Tcl_AppendResult(interp, errorName(rc), 0); return TCL_ERROR; } return TCL_OK; @@ -250,11 +249,11 @@ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " ID\"", 0); return TCL_ERROR; } pPager = sqlite3TestTextToPtr(argv[1]); - rc = sqlite3PagerSavepoint(pPager, SAVEPOINT_RELEASE, 0); + rc = sqlite3PagerStmtCommit(pPager); if( rc!=SQLITE_OK ){ Tcl_AppendResult(interp, errorName(rc), 0); return TCL_ERROR; } return TCL_OK; @@ -391,19 +390,24 @@ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ int argc, /* Number of arguments */ const char **argv /* Text of each argument */ ){ Pager *pPager; + int rc; int pgno; if( argc!=3 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " ID PGNO\"", 0); return TCL_ERROR; } pPager = sqlite3TestTextToPtr(argv[1]); if( Tcl_GetInt(interp, argv[2], &pgno) ) return TCL_ERROR; - sqlite3PagerTruncateImage(pPager, pgno); + rc = sqlite3PagerTruncate(pPager, pgno); + if( rc!=SQLITE_OK ){ + Tcl_AppendResult(interp, errorName(rc), 0); + return TCL_ERROR; + } return TCL_OK; } /* @@ -416,17 +420,22 @@ Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ int argc, /* Number of arguments */ const char **argv /* Text of each argument */ ){ DbPage *pPage; + int rc; if( argc!=2 ){ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " PAGE\"", 0); return TCL_ERROR; } pPage = (DbPage *)sqlite3TestTextToPtr(argv[1]); - sqlite3PagerUnref(pPage); + rc = sqlite3PagerUnref(pPage); + if( rc!=SQLITE_OK ){ + Tcl_AppendResult(interp, errorName(rc), 0); + return TCL_ERROR; + } return TCL_OK; } /* ** Usage: page_read PAGE @@ -554,33 +563,10 @@ return TCL_OK; } #endif -/* -** test_control_pending_byte PENDING_BYTE -** -** Set the PENDING_BYTE using the sqlite3_test_control() interface. -*/ -static int testPendingByte( - void *NotUsed, - Tcl_Interp *interp, /* The TCL interpreter that invoked this command */ - int argc, /* Number of arguments */ - const char **argv /* Text of each argument */ -){ - int pbyte; - int rc; - if( argc!=2 ){ - Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], - " PENDING-BYTE\"", (void*)0); - } - if( Tcl_GetInt(interp, argv[1], &pbyte) ) return TCL_ERROR; - rc = sqlite3_test_control(SQLITE_TESTCTRL_PENDING_BYTE, pbyte); - Tcl_SetObjResult(interp, Tcl_NewIntObj(rc)); - return TCL_OK; -} - /* ** sqlite3BitvecBuiltinTest SIZE PROGRAM ** ** Invoke the SQLITE_TESTCTRL_BITVEC_TEST operator on test_control. ** See comments on sqlite3BitvecBuiltinTest() for additional information. @@ -600,14 +586,14 @@ " SIZE PROGRAM\"", (void*)0); } if( Tcl_GetInt(interp, argv[1], &sz) ) return TCL_ERROR; z = argv[2]; while( nProg<99 && *z ){ - while( *z && !sqlite3Isdigit(*z) ){ z++; } + while( *z && !isdigit(*z) ){ z++; } if( *z==0 ) break; aProg[nProg++] = atoi(z); - while( sqlite3Isdigit(*z) ){ z++; } + while( isdigit(*z) ){ z++; } } aProg[nProg] = 0; rc = sqlite3_test_control(SQLITE_TESTCTRL_BITVEC_TEST, sz, aProg); Tcl_SetObjResult(interp, Tcl_NewIntObj(rc)); return TCL_OK; @@ -645,12 +631,11 @@ { "page_number", (Tcl_CmdProc*)page_number }, { "pager_truncate", (Tcl_CmdProc*)pager_truncate }, #ifndef SQLITE_OMIT_DISKIO { "fake_big_file", (Tcl_CmdProc*)fake_big_file }, #endif - { "sqlite3BitvecBuiltinTest",(Tcl_CmdProc*)testBitvecBuiltinTest }, - { "sqlite3_test_control_pending_byte", (Tcl_CmdProc*)testPendingByte }, + { "sqlite3BitvecBuiltinTest",(Tcl_CmdProc*)testBitvecBuiltinTest}, }; int i; for(i=0; i @@ -387,11 +387,11 @@ return TCL_ERROR; } pBt = sqlite3TestTextToPtr(argv[1]); if( Tcl_GetInt(interp, argv[2], &iTable) ) return TCL_ERROR; sqlite3BtreeEnter(pBt); - rc = sqlite3BtreeClearTable(pBt, iTable, 0); + rc = sqlite3BtreeClearTable(pBt, iTable); sqlite3BtreeLeave(pBt); if( rc!=SQLITE_OK ){ Tcl_AppendResult(interp, errorName(rc), 0); return TCL_ERROR; } Index: src/test6.c ================================================================== --- src/test6.c +++ src/test6.c @@ -12,11 +12,11 @@ ** ** This file contains code that modified the OS layer in order to simulate ** the effect on the database file of an OS crash or power failure. This ** is used to test the ability of SQLite to recover from those situations. ** -** $Id: test6.c,v 1.42 2009/02/10 14:28:57 danielk1977 Exp $ +** $Id: test6.c,v 1.39 2008/06/06 11:11:26 danielk1977 Exp $ */ #if SQLITE_TEST /* This file is used for testing only */ #include "sqliteInt.h" #include "tcl.h" @@ -562,27 +562,12 @@ } if( rc==SQLITE_OK ){ pWrapper->nData = (4096 + pWrapper->iSize); pWrapper->zData = crash_malloc(pWrapper->nData); if( pWrapper->zData ){ - /* os_unix.c contains an assert() that fails if the caller attempts - ** to read data from the 512-byte locking region of a file opened - ** with the SQLITE_OPEN_MAIN_DB flag. This region of a database file - ** never contains valid data anyhow. So avoid doing such a read here. - */ - const int isDb = (flags&SQLITE_OPEN_MAIN_DB); - i64 iChunk = pWrapper->iSize; - if( iChunk>PENDING_BYTE && isDb ){ - iChunk = PENDING_BYTE; - } memset(pWrapper->zData, 0, pWrapper->nData); - rc = sqlite3OsRead(pReal, pWrapper->zData, iChunk, 0); - if( SQLITE_OK==rc && pWrapper->iSize>(PENDING_BYTE+512) && isDb ){ - i64 iOff = PENDING_BYTE+512; - iChunk = pWrapper->iSize - iOff; - rc = sqlite3OsRead(pReal, &pWrapper->zData[iOff], iChunk, iOff); - } + rc = sqlite3OsRead(pReal, pWrapper->zData, pWrapper->iSize, 0); }else{ rc = SQLITE_NOMEM; } } if( rc!=SQLITE_OK && pWrapper->pMethod ){ @@ -619,13 +604,13 @@ } static void cfDlError(sqlite3_vfs *pCfVfs, int nByte, char *zErrMsg){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData; pVfs->xDlError(pVfs, nByte, zErrMsg); } -static void (*cfDlSym(sqlite3_vfs *pCfVfs, void *pH, const char *zSym))(void){ +static void *cfDlSym(sqlite3_vfs *pCfVfs, void *pHandle, const char *zSymbol){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData; - return pVfs->xDlSym(pVfs, pH, zSym); + return pVfs->xDlSym(pVfs, pHandle, zSymbol); } static void cfDlClose(sqlite3_vfs *pCfVfs, void *pHandle){ sqlite3_vfs *pVfs = (sqlite3_vfs *)pCfVfs->pAppData; pVfs->xDlClose(pVfs, pHandle); } @@ -877,68 +862,10 @@ devsym_register(iDc, iSectorSize); return TCL_OK; } -/* -** tclcmd: register_jt_vfs ?-default? PARENT-VFS -*/ -static int jtObjCmd( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - int jt_register(char *, int); - char *zParent = 0; - - if( objc!=2 && objc!=3 ){ - Tcl_WrongNumArgs(interp, 1, objv, "?-default? PARENT-VFS"); - return TCL_ERROR; - } - zParent = Tcl_GetString(objv[1]); - if( objc==3 ){ - if( strcmp(zParent, "-default") ){ - Tcl_AppendResult(interp, - "bad option \"", zParent, "\": must be -default", 0 - ); - return TCL_ERROR; - } - zParent = Tcl_GetString(objv[2]); - } - - if( !(*zParent) ){ - zParent = 0; - } - if( jt_register(zParent, objc==3) ){ - Tcl_AppendResult(interp, "Error in jt_register", 0); - return TCL_ERROR; - } - - return TCL_OK; -} - -/* -** tclcmd: unregister_jt_vfs -*/ -static int jtUnregisterObjCmd( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - void jt_unregister(void); - - if( objc!=1 ){ - Tcl_WrongNumArgs(interp, 1, objv, ""); - return TCL_ERROR; - } - - jt_unregister(); - return TCL_OK; -} - #endif /* SQLITE_OMIT_DISKIO */ /* ** This procedure registers the TCL procedures defined in this file. */ @@ -945,12 +872,10 @@ int Sqlitetest6_Init(Tcl_Interp *interp){ #ifndef SQLITE_OMIT_DISKIO Tcl_CreateObjCommand(interp, "sqlite3_crash_enable", crashEnableCmd, 0, 0); Tcl_CreateObjCommand(interp, "sqlite3_crashparams", crashParamsObjCmd, 0, 0); Tcl_CreateObjCommand(interp, "sqlite3_simulate_device", devSymObjCmd, 0, 0); - Tcl_CreateObjCommand(interp, "register_jt_vfs", jtObjCmd, 0, 0); - Tcl_CreateObjCommand(interp, "unregister_jt_vfs", jtUnregisterObjCmd, 0, 0); #endif return TCL_OK; } #endif /* SQLITE_TEST */ DELETED src/test_backup.c Index: src/test_backup.c ================================================================== --- src/test_backup.c +++ /dev/null @@ -1,148 +0,0 @@ -/* -** 2009 January 28 -** -** 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. -** -************************************************************************* -** -** $Id: test_backup.c,v 1.1 2009/02/03 16:51:25 danielk1977 Exp $ -*/ - -#include "tcl.h" -#include -#include - -/* These functions are implemented in test1.c. */ -int getDbPointer(Tcl_Interp *, const char *, sqlite3 **); -const char *sqlite3TestErrorName(int); - -static int backupTestCmd( - ClientData clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *const*objv -){ - enum BackupSubCommandEnum { - BACKUP_STEP, BACKUP_FINISH, BACKUP_REMAINING, BACKUP_PAGECOUNT - }; - struct BackupSubCommand { - const char *zCmd; - enum BackupSubCommandEnum eCmd; - int nArg; - const char *zArg; - } aSub[] = { - {"step", BACKUP_STEP , 1, "npage" }, - {"finish", BACKUP_FINISH , 0, "" }, - {"remaining", BACKUP_REMAINING , 0, "" }, - {"pagecount", BACKUP_PAGECOUNT , 0, "" }, - {0, 0, 0, 0} - }; - - sqlite3_backup *p = (sqlite3_backup *)clientData; - int iCmd; - int rc; - - rc = Tcl_GetIndexFromObjStruct( - interp, objv[1], aSub, sizeof(aSub[0]), "option", 0, &iCmd - ); - if( rc!=TCL_OK ){ - return rc; - } - if( objc!=(2 + aSub[iCmd].nArg) ){ - Tcl_WrongNumArgs(interp, 2, objv, aSub[iCmd].zArg); - return TCL_ERROR; - } - - switch( aSub[iCmd].eCmd ){ - - case BACKUP_FINISH: { - Tcl_CmdInfo cmdInfo; - Tcl_Command cmd = Tcl_GetCommandFromObj(interp, objv[0]); - Tcl_GetCommandInfoFromToken(cmd, &cmdInfo); - cmdInfo.deleteProc = 0; - Tcl_SetCommandInfoFromToken(cmd, &cmdInfo); - Tcl_DeleteCommandFromToken(interp, cmd); - - rc = sqlite3_backup_finish(p); - Tcl_SetResult(interp, (char *)sqlite3TestErrorName(rc), TCL_STATIC); - break; - } - - case BACKUP_STEP: { - int nPage; - if( TCL_OK!=Tcl_GetIntFromObj(interp, objv[2], &nPage) ){ - return TCL_ERROR; - } - rc = sqlite3_backup_step(p, nPage); - Tcl_SetResult(interp, (char *)sqlite3TestErrorName(rc), TCL_STATIC); - break; - } - - case BACKUP_REMAINING: - Tcl_SetObjResult(interp, Tcl_NewIntObj(sqlite3_backup_remaining(p))); - break; - - case BACKUP_PAGECOUNT: - Tcl_SetObjResult(interp, Tcl_NewIntObj(sqlite3_backup_pagecount(p))); - break; - } - - return TCL_OK; -} - -static void backupTestFinish(ClientData clientData){ - sqlite3_backup *pBackup = (sqlite3_backup *)clientData; - sqlite3_backup_finish(pBackup); -} - -/* -** sqlite3_backup CMDNAME DESTHANDLE DESTNAME SRCHANDLE SRCNAME -** -*/ -static int backupTestInit( - ClientData clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *const*objv -){ - sqlite3_backup *pBackup; - sqlite3 *pDestDb; - sqlite3 *pSrcDb; - const char *zDestName; - const char *zSrcName; - const char *zCmd; - - if( objc!=6 ){ - Tcl_WrongNumArgs( - interp, 1, objv, "CMDNAME DESTHANDLE DESTNAME SRCHANDLE SRCNAME" - ); - return TCL_ERROR; - } - - zCmd = Tcl_GetString(objv[1]); - getDbPointer(interp, Tcl_GetString(objv[2]), &pDestDb); - zDestName = Tcl_GetString(objv[3]); - getDbPointer(interp, Tcl_GetString(objv[4]), &pSrcDb); - zSrcName = Tcl_GetString(objv[5]); - - pBackup = sqlite3_backup_init(pDestDb, zDestName, pSrcDb, zSrcName); - if( !pBackup ){ - Tcl_AppendResult(interp, "sqlite3_backup_init() failed", 0); - return TCL_ERROR; - } - - Tcl_CreateObjCommand(interp, zCmd, backupTestCmd, pBackup, backupTestFinish); - Tcl_SetObjResult(interp, objv[1]); - return TCL_OK; -} - -int Sqlitetestbackup_Init(Tcl_Interp *interp){ - Tcl_CreateObjCommand(interp, "sqlite3_backup", backupTestInit, 0, 0); - return TCL_OK; -} - Index: src/test_config.c ================================================================== --- src/test_config.c +++ src/test_config.c @@ -14,11 +14,11 @@ ** None of the code in this file goes into a deliverable build. ** ** The focus of this file is providing the TCL testing layer ** access to compile-time constants. ** -** $Id: test_config.c,v 1.47 2009/01/12 14:01:45 danielk1977 Exp $ +** $Id: test_config.c,v 1.42 2008/10/12 00:27:54 shane Exp $ */ #include "sqliteLimit.h" #include "sqliteInt.h" @@ -390,29 +390,10 @@ Tcl_SetVar2(interp, "sqlite_options", "schema_version", "0", TCL_GLOBAL_ONLY); #else Tcl_SetVar2(interp, "sqlite_options", "schema_version", "1", TCL_GLOBAL_ONLY); #endif -#if !defined(SQLITE_ENABLE_LOCKING_STYLE) -# if defined(__APPLE__) -# define SQLITE_ENABLE_LOCKING_STYLE 1 -# else -# define SQLITE_ENABLE_LOCKING_STYLE 0 -# endif -#endif -#if SQLITE_ENABLE_LOCKING_STYLE && defined(__APPLE__) - Tcl_SetVar2(interp,"sqlite_options","lock_proxy_pragmas","1",TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp,"sqlite_options","lock_proxy_pragmas","0",TCL_GLOBAL_ONLY); -#endif -#if defined(SQLITE_PREFER_PROXY_LOCKING) && defined(__APPLE__) - Tcl_SetVar2(interp,"sqlite_options","prefer_proxy_locking","1",TCL_GLOBAL_ONLY); -#else - Tcl_SetVar2(interp,"sqlite_options","prefer_proxy_locking","0",TCL_GLOBAL_ONLY); -#endif - - #ifdef SQLITE_OMIT_SHARED_CACHE Tcl_SetVar2(interp, "sqlite_options", "shared_cache", "0", TCL_GLOBAL_ONLY); #else Tcl_SetVar2(interp, "sqlite_options", "shared_cache", "1", TCL_GLOBAL_ONLY); #endif Index: src/test_devsym.c ================================================================== --- src/test_devsym.c +++ src/test_devsym.c @@ -12,11 +12,11 @@ ** ** This file contains code that modified the OS layer in order to simulate ** different device types (by overriding the return values of the ** xDeviceCharacteristics() and xSectorSize() methods). ** -** $Id: test_devsym.c,v 1.9 2008/12/09 01:32:03 drh Exp $ +** $Id: test_devsym.c,v 1.8 2008/09/12 10:22:40 danielk1977 Exp $ */ #if SQLITE_TEST /* This file is used for testing only */ #include "sqlite3.h" #include "sqliteInt.h" @@ -61,11 +61,11 @@ static int devsymAccess(sqlite3_vfs*, const char *zName, int flags, int *); static int devsymFullPathname(sqlite3_vfs*, const char *zName, int, char *zOut); #ifndef SQLITE_OMIT_LOAD_EXTENSION static void *devsymDlOpen(sqlite3_vfs*, const char *zFilename); static void devsymDlError(sqlite3_vfs*, int nByte, char *zErrMsg); -static void (*devsymDlSym(sqlite3_vfs*,void*, const char *zSymbol))(void); +static void *devsymDlSym(sqlite3_vfs*,void*, const char *zSymbol); static void devsymDlClose(sqlite3_vfs*, void*); #endif /* SQLITE_OMIT_LOAD_EXTENSION */ static int devsymRandomness(sqlite3_vfs*, int nByte, char *zOut); static int devsymSleep(sqlite3_vfs*, int microseconds); static int devsymCurrentTime(sqlite3_vfs*, double*); @@ -298,12 +298,12 @@ } /* ** Return a pointer to the symbol zSymbol in the dynamic library pHandle. */ -static void (*devsymDlSym(sqlite3_vfs *pVfs, void *p, const char *zSym))(void){ - return sqlite3OsDlSym(g.pVfs, p, zSym); +static void *devsymDlSym(sqlite3_vfs *pVfs, void *pHandle, const char *zSymbol){ + return sqlite3OsDlSym(g.pVfs, pHandle, zSymbol); } /* ** Close the dynamic library handle pHandle. */ DELETED src/test_journal.c Index: src/test_journal.c ================================================================== --- src/test_journal.c +++ /dev/null @@ -1,775 +0,0 @@ -/* -** 2008 Jan 22 -** -** 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 contains code for a VFS layer that acts as a wrapper around -** an existing VFS. The code in this file attempts to verify that SQLite -** correctly populates and syncs a journal file before writing to a -** corresponding database file. -** -** $Id: test_journal.c,v 1.9 2009/01/11 18:24:27 drh Exp $ -*/ -#if SQLITE_TEST /* This file is used for testing only */ - -#include "sqlite3.h" -#include "sqliteInt.h" - -/* -** INTERFACE -** -** The public interface to this wrapper VFS is two functions: -** -** jt_register() -** jt_unregister() -** -** See header comments associated with those two functions below for -** details. -** -** LIMITATIONS -** -** This wrapper will not work if "PRAGMA synchronous = off" is used. -** -** OPERATION -** -** Starting a Transaction: -** -** When a write-transaction is started, the contents of the database is -** inspected and the following data stored as part of the database file -** handle (type struct jt_file): -** -** a) The page-size of the database file. -** b) The number of pages that are in the database file. -** c) The set of page numbers corresponding to free-list leaf pages. -** d) A check-sum for every page in the database file. -** -** The start of a write-transaction is deemed to have occured when a -** 28-byte journal header is written to byte offset 0 of the journal -** file. -** -** Syncing the Journal File: -** -** Whenever the xSync method is invoked to sync a journal-file, the -** contents of the journal file are read. For each page written to -** the journal file, a check-sum is calculated and compared to the -** check-sum calculated for the corresponding database page when the -** write-transaction was initialized. The success of the comparison -** is assert()ed. So if SQLite has written something other than the -** original content to the database file, an assert() will fail. -** -** Additionally, the set of page numbers for which records exist in -** the journal file is added to (unioned with) the set of page numbers -** corresponding to free-list leaf pages collected when the -** write-transaction was initialized. This set comprises the page-numbers -** corresponding to those pages that SQLite may now safely modify. -** -** Writing to the Database File: -** -** When a block of data is written to a database file, the following -** invariants are asserted: -** -** a) That the block of data is an aligned block of page-size bytes. -** -** b) That if the page being written did not exist when the -** transaction was started (i.e. the database file is growing), then -** the journal-file must have been synced at least once since -** the start of the transaction. -** -** c) That if the page being written did exist when the transaction -** was started, then the page must have either been a free-list -** leaf page at the start of the transaction, or else must have -** been stored in the journal file prior to the most recent sync. -** -** Closing a Transaction: -** -** When a transaction is closed, all data collected at the start of -** the transaction, or following an xSync of a journal-file, is -** discarded. The end of a transaction is recognized when any one -** of the following occur: -** -** a) A block of zeroes (or anything else that is not a valid -** journal-header) is written to the start of the journal file. -** -** b) A journal file is truncated to zero bytes in size using xTruncate. -** -** c) The journal file is deleted using xDelete. -*/ - -/* -** Maximum pathname length supported by the jt backend. -*/ -#define JT_MAX_PATHNAME 512 - -/* -** Name used to identify this VFS. -*/ -#define JT_VFS_NAME "jt" - -typedef struct jt_file jt_file; -struct jt_file { - sqlite3_file base; - const char *zName; /* Name of open file */ - int flags; /* Flags the file was opened with */ - - /* The following are only used by database file file handles */ - int eLock; /* Current lock held on the file */ - u32 nPage; /* Size of file in pages when transaction started */ - u32 nPagesize; /* Page size when transaction started */ - Bitvec *pWritable; /* Bitvec of pages that may be written to the file */ - u32 *aCksum; /* Checksum for first nPage pages */ - int nSync; /* Number of times journal file has been synced */ - - /* Only used by journal file-handles */ - sqlite3_int64 iMaxOff; /* Maximum offset written to this transaction */ - - jt_file *pNext; /* All files are stored in a linked list */ - sqlite3_file *pReal; /* The file handle for the underlying vfs */ -}; - -/* -** Method declarations for jt_file. -*/ -static int jtClose(sqlite3_file*); -static int jtRead(sqlite3_file*, void*, int iAmt, sqlite3_int64 iOfst); -static int jtWrite(sqlite3_file*,const void*,int iAmt, sqlite3_int64 iOfst); -static int jtTruncate(sqlite3_file*, sqlite3_int64 size); -static int jtSync(sqlite3_file*, int flags); -static int jtFileSize(sqlite3_file*, sqlite3_int64 *pSize); -static int jtLock(sqlite3_file*, int); -static int jtUnlock(sqlite3_file*, int); -static int jtCheckReservedLock(sqlite3_file*, int *); -static int jtFileControl(sqlite3_file*, int op, void *pArg); -static int jtSectorSize(sqlite3_file*); -static int jtDeviceCharacteristics(sqlite3_file*); - -/* -** Method declarations for jt_vfs. -*/ -static int jtOpen(sqlite3_vfs*, const char *, sqlite3_file*, int , int *); -static int jtDelete(sqlite3_vfs*, const char *zName, int syncDir); -static int jtAccess(sqlite3_vfs*, const char *zName, int flags, int *); -static int jtFullPathname(sqlite3_vfs*, const char *zName, int, char *zOut); -static void *jtDlOpen(sqlite3_vfs*, const char *zFilename); -static void jtDlError(sqlite3_vfs*, int nByte, char *zErrMsg); -static void (*jtDlSym(sqlite3_vfs*,void*, const char *zSymbol))(void); -static void jtDlClose(sqlite3_vfs*, void*); -static int jtRandomness(sqlite3_vfs*, int nByte, char *zOut); -static int jtSleep(sqlite3_vfs*, int microseconds); -static int jtCurrentTime(sqlite3_vfs*, double*); - -static sqlite3_vfs jt_vfs = { - 1, /* iVersion */ - sizeof(jt_file), /* szOsFile */ - JT_MAX_PATHNAME, /* mxPathname */ - 0, /* pNext */ - JT_VFS_NAME, /* zName */ - 0, /* pAppData */ - jtOpen, /* xOpen */ - jtDelete, /* xDelete */ - jtAccess, /* xAccess */ - jtFullPathname, /* xFullPathname */ - jtDlOpen, /* xDlOpen */ - jtDlError, /* xDlError */ - jtDlSym, /* xDlSym */ - jtDlClose, /* xDlClose */ - jtRandomness, /* xRandomness */ - jtSleep, /* xSleep */ - jtCurrentTime /* xCurrentTime */ -}; - -static sqlite3_io_methods jt_io_methods = { - 1, /* iVersion */ - jtClose, /* xClose */ - jtRead, /* xRead */ - jtWrite, /* xWrite */ - jtTruncate, /* xTruncate */ - jtSync, /* xSync */ - jtFileSize, /* xFileSize */ - jtLock, /* xLock */ - jtUnlock, /* xUnlock */ - jtCheckReservedLock, /* xCheckReservedLock */ - jtFileControl, /* xFileControl */ - jtSectorSize, /* xSectorSize */ - jtDeviceCharacteristics /* xDeviceCharacteristics */ -}; - -struct JtGlobal { - sqlite3_vfs *pVfs; /* Parent VFS */ - jt_file *pList; /* List of all open files */ -}; -static struct JtGlobal g = {0, 0}; - -/* -** The jt_file pointed to by the argument may or may not be a file-handle -** open on a main database file. If it is, and a transaction is currently -** opened on the file, then discard all transaction related data. -*/ -static void closeTransaction(jt_file *p){ - sqlite3BitvecDestroy(p->pWritable); - sqlite3_free(p->aCksum); - p->pWritable = 0; - p->aCksum = 0; - p->nSync = 0; -} - -/* -** Close an jt-file. -*/ -static int jtClose(sqlite3_file *pFile){ - jt_file **pp; - jt_file *p = (jt_file *)pFile; - - closeTransaction(p); - if( p->zName ){ - for(pp=&g.pList; *pp!=p; pp=&(*pp)->pNext); - *pp = p->pNext; - } - - return sqlite3OsClose(p->pReal); -} - -/* -** Read data from an jt-file. -*/ -static int jtRead( - sqlite3_file *pFile, - void *zBuf, - int iAmt, - sqlite_int64 iOfst -){ - jt_file *p = (jt_file *)pFile; - return sqlite3OsRead(p->pReal, zBuf, iAmt, iOfst); -} - - -/* -** Parameter zJournal is the name of a journal file that is currently -** open. This function locates and returns the handle opened on the -** corresponding database file by the pager that currently has the -** journal file opened. This file-handle is identified by the -** following properties: -** -** a) SQLITE_OPEN_MAIN_DB was specified when the file was opened. -** -** b) The file-name specified when the file was opened matches -** all but the final 8 characters of the journal file name. -** -** c) There is currently a reserved lock on the file. -**/ -static jt_file *locateDatabaseHandle(const char *zJournal){ - jt_file *pMain = 0; - for(pMain=g.pList; pMain; pMain=pMain->pNext){ - int nName = strlen(zJournal) - strlen("-journal"); - if( (pMain->flags&SQLITE_OPEN_MAIN_DB) - && (strlen(pMain->zName)==nName) - && 0==memcmp(pMain->zName, zJournal, nName) - && (pMain->eLock>=SQLITE_LOCK_RESERVED) - ){ - break; - } - } - return pMain; -} - -/* -** Parameter z points to a buffer of 4 bytes in size containing a -** unsigned 32-bit integer stored in big-endian format. Decode the -** integer and return its value. -*/ -static u32 decodeUint32(const unsigned char *z){ - return (z[0]<<24) + (z[1]<<16) + (z[2]<<8) + z[3]; -} - -/* -** Calculate a checksum from the buffer of length n bytes pointed to -** by parameter z. -*/ -static u32 genCksum(const unsigned char *z, int n){ - int i; - u32 cksum = 0; - for(i=0; ipReal; - int rc = SQLITE_OK; - - aData = sqlite3_malloc(pMain->nPagesize); - pMain->pWritable = sqlite3BitvecCreate(pMain->nPage); - pMain->aCksum = sqlite3_malloc(sizeof(u32) * (pMain->nPage + 1)); - pJournal->iMaxOff = 0; - - if( !pMain->pWritable || !pMain->aCksum || !aData ){ - rc = SQLITE_IOERR_NOMEM; - }else if( pMain->nPage>0 ){ - u32 iTrunk; - - /* Read the database free-list. Add the page-number for each free-list - ** leaf to the jt_file.pWritable bitvec. - */ - rc = sqlite3OsRead(p, aData, pMain->nPagesize, 0); - iTrunk = decodeUint32(&aData[32]); - while( rc==SQLITE_OK && iTrunk>0 ){ - u32 nLeaf; - u32 iLeaf; - sqlite3_int64 iOff = (iTrunk-1)*pMain->nPagesize; - rc = sqlite3OsRead(p, aData, pMain->nPagesize, iOff); - nLeaf = decodeUint32(&aData[4]); - for(iLeaf=0; rc==SQLITE_OK && iLeafpWritable, pgno); - } - iTrunk = decodeUint32(aData); - } - - /* Calculate and store a checksum for each page in the database file. */ - if( rc==SQLITE_OK ){ - int ii; - for(ii=0; rc==SQLITE_OK && iinPage; ii++){ - i64 iOff = (i64)(pMain->nPagesize) * (i64)ii; - rc = sqlite3OsRead(pMain->pReal, aData, pMain->nPagesize, iOff); - pMain->aCksum[ii] = genCksum(aData, pMain->nPagesize); - } - } - } - - sqlite3_free(aData); - return rc; -} - -/* -** Write data to an jt-file. -*/ -static int jtWrite( - sqlite3_file *pFile, - const void *zBuf, - int iAmt, - sqlite_int64 iOfst -){ - jt_file *p = (jt_file *)pFile; - if( p->flags&SQLITE_OPEN_MAIN_JOURNAL ){ - if( iOfst==0 ){ - jt_file *pMain = locateDatabaseHandle(p->zName); - assert( pMain ); - - if( decodeJournalHdr(zBuf, 0, &pMain->nPage, 0, &pMain->nPagesize) ){ - /* Zeroing the first journal-file header. This is the end of a - ** transaction. */ - closeTransaction(pMain); - }else{ - /* Writing the first journal header to a journal file. This happens - ** when a transaction is first started. */ - int rc; - if( SQLITE_OK!=(rc=openTransaction(pMain, p)) ){ - return rc; - } - } - } - if( p->iMaxOff<(iOfst + iAmt) ){ - p->iMaxOff = iOfst + iAmt; - } - } - - if( p->flags&SQLITE_OPEN_MAIN_DB && p->pWritable ){ - u32 pgno = iOfst/p->nPagesize + 1; - - assert( (iAmt==1 || iAmt==p->nPagesize) && ((iOfst+iAmt)%p->nPagesize)==0 ); - assert( pgno<=p->nPage || p->nSync>0 ); - assert( pgno>p->nPage || sqlite3BitvecTest(p->pWritable, pgno) ); - } - - return sqlite3OsWrite(p->pReal, zBuf, iAmt, iOfst); -} - -/* -** Truncate an jt-file. -*/ -static int jtTruncate(sqlite3_file *pFile, sqlite_int64 size){ - jt_file *p = (jt_file *)pFile; - if( p->flags&SQLITE_OPEN_MAIN_JOURNAL && size==0 ){ - /* Truncating a journal file. This is the end of a transaction. */ - jt_file *pMain = locateDatabaseHandle(p->zName); - closeTransaction(pMain); - } - if( p->flags&SQLITE_OPEN_MAIN_DB && p->pWritable ){ - u32 pgno; - u32 locking_page = (u32)(PENDING_BYTE/p->nPagesize+1); - for(pgno=size/p->nPagesize+1; pgno<=p->nPage; pgno++){ - assert( pgno==locking_page || sqlite3BitvecTest(p->pWritable, pgno) ); - } - } - return sqlite3OsTruncate(p->pReal, size); -} - -/* -** The first argument to this function is a handle open on a journal file. -** This function reads the journal file and adds the page number for each -** page in the journal to the Bitvec object passed as the second argument. -*/ -static int readJournalFile(jt_file *p, jt_file *pMain){ - int rc = SQLITE_OK; - unsigned char zBuf[28]; - sqlite3_file *pReal = p->pReal; - sqlite3_int64 iOff = 0; - sqlite3_int64 iSize = p->iMaxOff; - unsigned char *aPage; - - aPage = sqlite3_malloc(pMain->nPagesize); - if( !aPage ){ - return SQLITE_IOERR_NOMEM; - } - - while( rc==SQLITE_OK && iOff=(iOff+nSector) ){ - rc = sqlite3OsRead(pReal, zBuf, 28, iOff); - if( rc!=SQLITE_OK || 0==decodeJournalHdr(zBuf, 0, 0, 0, 0) ){ - continue; - } - } - nRec = (iSize-iOff) / (pMain->nPagesize+8); - } - - /* Read all the records that follow the journal-header just read. */ - for(ii=0; rc==SQLITE_OK && ii0 && pgno<=pMain->nPage ){ - if( 0==sqlite3BitvecTest(pMain->pWritable, pgno) ){ - rc = sqlite3OsRead(pReal, aPage, pMain->nPagesize, iOff+4); - if( rc==SQLITE_OK ){ - u32 cksum = genCksum(aPage, pMain->nPagesize); - assert( cksum==pMain->aCksum[pgno-1] ); - } - } - sqlite3BitvecSet(pMain->pWritable, pgno); - } - iOff += (8 + pMain->nPagesize); - } - } - - iOff = ((iOff + (nSector-1)) / nSector) * nSector; - } - -finish_rjf: - sqlite3_free(aPage); - if( rc==SQLITE_IOERR_SHORT_READ ){ - rc = SQLITE_OK; - } - return rc; -} - -/* -** Sync an jt-file. -*/ -static int jtSync(sqlite3_file *pFile, int flags){ - jt_file *p = (jt_file *)pFile; - - if( p->flags&SQLITE_OPEN_MAIN_JOURNAL ){ - int rc; - jt_file *pMain; /* The associated database file */ - - /* The journal file is being synced. At this point, we inspect the - ** contents of the file up to this point and set each bit in the - ** jt_file.pWritable bitvec of the main database file associated with - ** this journal file. - */ - pMain = locateDatabaseHandle(p->zName); - assert(pMain); - - /* Set the bitvec values */ - if( pMain->pWritable ){ - pMain->nSync++; - rc = readJournalFile(p, pMain); - if( rc!=SQLITE_OK ){ - return rc; - } - } - } - - return sqlite3OsSync(p->pReal, flags); -} - -/* -** Return the current file-size of an jt-file. -*/ -static int jtFileSize(sqlite3_file *pFile, sqlite_int64 *pSize){ - jt_file *p = (jt_file *)pFile; - return sqlite3OsFileSize(p->pReal, pSize); -} - -/* -** Lock an jt-file. -*/ -static int jtLock(sqlite3_file *pFile, int eLock){ - int rc; - jt_file *p = (jt_file *)pFile; - rc = sqlite3OsLock(p->pReal, eLock); - if( rc==SQLITE_OK && eLock>p->eLock ){ - p->eLock = eLock; - } - return rc; -} - -/* -** Unlock an jt-file. -*/ -static int jtUnlock(sqlite3_file *pFile, int eLock){ - int rc; - jt_file *p = (jt_file *)pFile; - rc = sqlite3OsUnlock(p->pReal, eLock); - if( rc==SQLITE_OK && eLockeLock ){ - p->eLock = eLock; - } - return rc; -} - -/* -** Check if another file-handle holds a RESERVED lock on an jt-file. -*/ -static int jtCheckReservedLock(sqlite3_file *pFile, int *pResOut){ - jt_file *p = (jt_file *)pFile; - return sqlite3OsCheckReservedLock(p->pReal, pResOut); -} - -/* -** File control method. For custom operations on an jt-file. -*/ -static int jtFileControl(sqlite3_file *pFile, int op, void *pArg){ - jt_file *p = (jt_file *)pFile; - return sqlite3OsFileControl(p->pReal, op, pArg); -} - -/* -** Return the sector-size in bytes for an jt-file. -*/ -static int jtSectorSize(sqlite3_file *pFile){ - jt_file *p = (jt_file *)pFile; - return sqlite3OsSectorSize(p->pReal); -} - -/* -** Return the device characteristic flags supported by an jt-file. -*/ -static int jtDeviceCharacteristics(sqlite3_file *pFile){ - jt_file *p = (jt_file *)pFile; - return sqlite3OsDeviceCharacteristics(p->pReal); -} - -/* -** Open an jt file handle. -*/ -static int jtOpen( - sqlite3_vfs *pVfs, - const char *zName, - sqlite3_file *pFile, - int flags, - int *pOutFlags -){ - int rc; - jt_file *p = (jt_file *)pFile; - p->pReal = (sqlite3_file *)&p[1]; - p->pReal->pMethods = 0; - rc = sqlite3OsOpen(g.pVfs, zName, p->pReal, flags, pOutFlags); - assert( rc==SQLITE_OK || p->pReal->pMethods==0 ); - if( rc==SQLITE_OK ){ - pFile->pMethods = &jt_io_methods; - p->eLock = 0; - p->zName = zName; - p->flags = flags; - p->pNext = 0; - p->pWritable = 0; - p->aCksum = 0; - if( zName ){ - p->pNext = g.pList; - g.pList = p; - } - } - return rc; -} - -/* -** Delete the file located at zPath. If the dirSync argument is true, -** ensure the file-system modifications are synced to disk before -** returning. -*/ -static int jtDelete(sqlite3_vfs *pVfs, const char *zPath, int dirSync){ - int nPath = strlen(zPath); - if( nPath>8 && 0==strcmp("-journal", &zPath[nPath-8]) ){ - /* Deleting a journal file. The end of a transaction. */ - jt_file *pMain = locateDatabaseHandle(zPath); - if( pMain ){ - closeTransaction(pMain); - } - } - - return sqlite3OsDelete(g.pVfs, zPath, dirSync); -} - -/* -** Test for access permissions. Return true if the requested permission -** is available, or false otherwise. -*/ -static int jtAccess( - sqlite3_vfs *pVfs, - const char *zPath, - int flags, - int *pResOut -){ - return sqlite3OsAccess(g.pVfs, zPath, flags, pResOut); -} - -/* -** Populate buffer zOut with the full canonical pathname corresponding -** to the pathname in zPath. zOut is guaranteed to point to a buffer -** of at least (JT_MAX_PATHNAME+1) bytes. -*/ -static int jtFullPathname( - sqlite3_vfs *pVfs, - const char *zPath, - int nOut, - char *zOut -){ - return sqlite3OsFullPathname(g.pVfs, zPath, nOut, zOut); -} - -/* -** Open the dynamic library located at zPath and return a handle. -*/ -static void *jtDlOpen(sqlite3_vfs *pVfs, const char *zPath){ - return g.pVfs->xDlOpen(g.pVfs, zPath); -} - -/* -** Populate the buffer zErrMsg (size nByte bytes) with a human readable -** utf-8 string describing the most recent error encountered associated -** with dynamic libraries. -*/ -static void jtDlError(sqlite3_vfs *pVfs, int nByte, char *zErrMsg){ - g.pVfs->xDlError(g.pVfs, nByte, zErrMsg); -} - -/* -** Return a pointer to the symbol zSymbol in the dynamic library pHandle. -*/ -static void (*jtDlSym(sqlite3_vfs *pVfs, void *p, const char *zSym))(void){ - return g.pVfs->xDlSym(g.pVfs, p, zSym); -} - -/* -** Close the dynamic library handle pHandle. -*/ -static void jtDlClose(sqlite3_vfs *pVfs, void *pHandle){ - g.pVfs->xDlClose(g.pVfs, pHandle); -} - -/* -** Populate the buffer pointed to by zBufOut with nByte bytes of -** random data. -*/ -static int jtRandomness(sqlite3_vfs *pVfs, int nByte, char *zBufOut){ - return sqlite3OsRandomness(g.pVfs, nByte, zBufOut); -} - -/* -** Sleep for nMicro microseconds. Return the number of microseconds -** actually slept. -*/ -static int jtSleep(sqlite3_vfs *pVfs, int nMicro){ - return sqlite3OsSleep(g.pVfs, nMicro); -} - -/* -** Return the current time as a Julian Day number in *pTimeOut. -*/ -static int jtCurrentTime(sqlite3_vfs *pVfs, double *pTimeOut){ - return sqlite3OsCurrentTime(g.pVfs, pTimeOut); -} - -/************************************************************************** -** Start of public API. -*/ - -/* -** Configure the jt VFS as a wrapper around the VFS named by parameter -** zWrap. If the isDefault parameter is true, then the jt VFS is installed -** as the new default VFS for SQLite connections. If isDefault is not -** true, then the jt VFS is installed as non-default. In this case it -** is available via its name, "jt". -*/ -int jt_register(char *zWrap, int isDefault){ - g.pVfs = sqlite3_vfs_find(zWrap); - if( g.pVfs==0 ){ - return SQLITE_ERROR; - } - jt_vfs.szOsFile = sizeof(jt_file) + g.pVfs->szOsFile; - sqlite3_vfs_register(&jt_vfs, isDefault); - return SQLITE_OK; -} - -/* -** Uninstall the jt VFS, if it is installed. -*/ -void jt_unregister(){ - sqlite3_vfs_unregister(&jt_vfs); -} - -#endif Index: src/test_malloc.c ================================================================== --- src/test_malloc.c +++ src/test_malloc.c @@ -11,11 +11,11 @@ ************************************************************************* ** ** This file contains code used to implement test interfaces to the ** memory allocation subsystem. ** -** $Id: test_malloc.c,v 1.53 2009/02/04 15:27:40 danielk1977 Exp $ +** $Id: test_malloc.c,v 1.49 2008/10/15 11:43:55 danielk1977 Exp $ */ #include "sqliteInt.h" #include "tcl.h" #include #include @@ -130,19 +130,10 @@ memfault.iCountdown = nDelay; memfault.nRepeat = nRepeat; memfault.nBenign = 0; memfault.nFail = 0; memfault.enable = nDelay>=0; - - /* Sometimes, when running multi-threaded tests, the isBenignMode - ** variable is not properly incremented/decremented so that it is - ** 0 when not inside a benign malloc block. This doesn't affect - ** the multi-threaded tests, as they do not use this system. But - ** it does affect OOM tests run later in the same process. So - ** zero the variable here, just to be sure. - */ - memfault.isBenignMode = 0; } /* ** Return the number of faults (both hard and benign faults) that have ** occurred since the injector was last configured. @@ -952,56 +943,10 @@ Tcl_ListObjAppendElement(0, pResult, Tcl_NewIntObj(N)); Tcl_SetObjResult(interp, pResult); return TCL_OK; } -/* -** Usage: sqlite3_config_alt_pcache INSTALL_FLAG DISCARD_CHANCE PRNG_SEED -** -** Set up the alternative test page cache. Install if INSTALL_FLAG is -** true and uninstall (reverting to the default page cache) if INSTALL_FLAG -** is false. DISCARD_CHANGE is an integer between 0 and 100 inclusive -** which determines the chance of discarding a page when unpinned. 100 -** is certainty. 0 is never. PRNG_SEED is the pseudo-random number generator -** seed. -*/ -static int test_alt_pcache( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - int installFlag; - int discardChance = 0; - int prngSeed = 0; - int highStress = 0; - extern void installTestPCache(int,unsigned,unsigned,unsigned); - if( objc<2 || objc>5 ){ - Tcl_WrongNumArgs(interp, 1, objv, - "INSTALLFLAG DISCARDCHANCE PRNGSEEED HIGHSTRESS"); - return TCL_ERROR; - } - if( Tcl_GetIntFromObj(interp, objv[1], &installFlag) ) return TCL_ERROR; - if( objc>=3 && Tcl_GetIntFromObj(interp, objv[2], &discardChance) ){ - return TCL_ERROR; - } - if( objc>=4 && Tcl_GetIntFromObj(interp, objv[3], &prngSeed) ){ - return TCL_ERROR; - } - if( objc>=5 && Tcl_GetIntFromObj(interp, objv[4], &highStress) ){ - return TCL_ERROR; - } - if( discardChance<0 || discardChance>100 ){ - Tcl_AppendResult(interp, "discard-chance should be between 0 and 100", - (char*)0); - return TCL_ERROR; - } - installTestPCache(installFlag, (unsigned)discardChance, (unsigned)prngSeed, - (unsigned)highStress); - return TCL_OK; -} - /* ** Usage: sqlite3_config_memstatus BOOLEAN ** ** Enable or disable memory status reporting using SQLITE_CONFIG_MEMSTATUS. */ @@ -1019,10 +964,32 @@ if( Tcl_GetBooleanFromObj(interp, objv[1], &enable) ) return TCL_ERROR; rc = sqlite3_config(SQLITE_CONFIG_MEMSTATUS, enable); Tcl_SetObjResult(interp, Tcl_NewIntObj(rc)); return TCL_OK; } + +/* +** Usage: sqlite3_config_chunkalloc +** +*/ +static int test_config_chunkalloc( + void * clientData, + Tcl_Interp *interp, + int objc, + Tcl_Obj *CONST objv[] +){ + int rc; + int nThreshold; + if( objc!=2 ){ + Tcl_WrongNumArgs(interp, 1, objv, "THRESHOLD"); + return TCL_ERROR; + } + if( Tcl_GetIntFromObj(interp, objv[1], &nThreshold) ) return TCL_ERROR; + rc = sqlite3_config(SQLITE_CONFIG_CHUNKALLOC, nThreshold); + Tcl_SetObjResult(interp, Tcl_NewIntObj(rc)); + return TCL_OK; +} /* ** Usage: sqlite3_config_lookaside SIZE COUNT ** */ @@ -1365,25 +1332,25 @@ { "sqlite3_memdebug_settitle", test_memdebug_settitle ,0 }, { "sqlite3_memdebug_malloc_count", test_memdebug_malloc_count ,0 }, { "sqlite3_memdebug_log", test_memdebug_log ,0 }, { "sqlite3_config_scratch", test_config_scratch ,0 }, { "sqlite3_config_pagecache", test_config_pagecache ,0 }, - { "sqlite3_config_alt_pcache", test_alt_pcache ,0 }, { "sqlite3_status", test_status ,0 }, { "sqlite3_db_status", test_db_status ,0 }, { "install_malloc_faultsim", test_install_malloc_faultsim ,0 }, { "sqlite3_config_heap", test_config_heap ,0 }, { "sqlite3_config_memstatus", test_config_memstatus ,0 }, + { "sqlite3_config_chunkalloc", test_config_chunkalloc ,0 }, { "sqlite3_config_lookaside", test_config_lookaside ,0 }, { "sqlite3_config_error", test_config_error ,0 }, { "sqlite3_db_config_lookaside",test_db_config_lookaside ,0 }, { "sqlite3_dump_memsys3", test_dump_memsys3 ,3 }, - { "sqlite3_dump_memsys5", test_dump_memsys3 ,5 }, + { "sqlite3_dump_memsys5", test_dump_memsys3 ,5 } }; int i; for(i=0; iresult); return TCL_OK; } /* ** A TCL command to take the md5 hash of a file. The argument is the @@ -342,12 +340,11 @@ if( n<=0 ) break; MD5Update(&ctx, (unsigned char*)zBuf, (unsigned)n); } fclose(in); MD5Final(digest, &ctx); - DigestToBase16(digest, zBuf); - Tcl_AppendResult(interp, zBuf, (char*)0); + DigestToBase16(digest, interp->result); return TCL_OK; } /* ** Register the two TCL commands above with the TCL interpreter. Index: src/test_mutex.c ================================================================== --- src/test_mutex.c +++ src/test_mutex.c @@ -8,11 +8,11 @@ ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** -** $Id: test_mutex.c,v 1.13 2009/01/19 17:40:12 drh Exp $ +** $Id: test_mutex.c,v 1.11 2008/07/19 13:43:24 danielk1977 Exp $ */ #include "tcl.h" #include "sqlite3.h" #include "sqliteInt.h" @@ -357,73 +357,19 @@ rc = sqlite3_config(i); Tcl_SetResult(interp, (char *)sqlite3TestErrorName(rc), TCL_VOLATILE); return TCL_OK; } -static sqlite3 *getDbPointer(Tcl_Interp *pInterp, Tcl_Obj *pObj){ - sqlite3 *db; - Tcl_CmdInfo info; - char *zCmd = Tcl_GetString(pObj); - if( Tcl_GetCommandInfo(pInterp, zCmd, &info) ){ - db = *((sqlite3 **)info.objClientData); - }else{ - db = (sqlite3*)sqlite3TestTextToPtr(zCmd); - } - assert( db ); - return db; -} - -static int test_enter_db_mutex( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - sqlite3 *db; - if( objc!=2 ){ - Tcl_WrongNumArgs(interp, 1, objv, "DB"); - return TCL_ERROR; - } - db = getDbPointer(interp, objv[1]); - if( !db ){ - return TCL_ERROR; - } - sqlite3_mutex_enter(sqlite3_db_mutex(db)); - return TCL_OK; -} - -static int test_leave_db_mutex( - void * clientData, - Tcl_Interp *interp, - int objc, - Tcl_Obj *CONST objv[] -){ - sqlite3 *db; - if( objc!=2 ){ - Tcl_WrongNumArgs(interp, 1, objv, "DB"); - return TCL_ERROR; - } - db = getDbPointer(interp, objv[1]); - if( !db ){ - return TCL_ERROR; - } - sqlite3_mutex_leave(sqlite3_db_mutex(db)); - return TCL_OK; -} - int Sqlitetest_mutex_Init(Tcl_Interp *interp){ static struct { char *zName; Tcl_ObjCmdProc *xProc; } aCmd[] = { { "sqlite3_shutdown", (Tcl_ObjCmdProc*)test_shutdown }, { "sqlite3_initialize", (Tcl_ObjCmdProc*)test_initialize }, { "sqlite3_config", (Tcl_ObjCmdProc*)test_config }, - { "enter_db_mutex", (Tcl_ObjCmdProc*)test_enter_db_mutex }, - { "leave_db_mutex", (Tcl_ObjCmdProc*)test_leave_db_mutex }, - { "alloc_dealloc_mutex", (Tcl_ObjCmdProc*)test_alloc_mutex }, { "install_mutex_counters", (Tcl_ObjCmdProc*)test_install_mutex_counters }, { "read_mutex_counters", (Tcl_ObjCmdProc*)test_read_mutex_counters }, { "clear_mutex_counters", (Tcl_ObjCmdProc*)test_clear_mutex_counters }, }; Index: src/test_onefile.c ================================================================== --- src/test_onefile.c +++ src/test_onefile.c @@ -8,11 +8,11 @@ ** May you find forgiveness for yourself and forgive others. ** May you share freely, never taking more than you give. ** ************************************************************************* ** -** $Id: test_onefile.c,v 1.10 2008/12/09 01:32:03 drh Exp $ +** $Id: test_onefile.c,v 1.9 2008/06/26 10:54:12 danielk1977 Exp $ ** ** OVERVIEW: ** ** This file contains some example code demonstrating how the SQLite ** vfs feature can be used to have SQLite operate directly on an @@ -166,11 +166,11 @@ static int fsDelete(sqlite3_vfs*, const char *zName, int syncDir); static int fsAccess(sqlite3_vfs*, const char *zName, int flags, int *); static int fsFullPathname(sqlite3_vfs*, const char *zName, int nOut,char *zOut); static void *fsDlOpen(sqlite3_vfs*, const char *zFilename); static void fsDlError(sqlite3_vfs*, int nByte, char *zErrMsg); -static void (*fsDlSym(sqlite3_vfs*,void*, const char *zSymbol))(void); +static void *fsDlSym(sqlite3_vfs*,void*, const char *zSymbol); static void fsDlClose(sqlite3_vfs*, void*); static int fsRandomness(sqlite3_vfs*, int nByte, char *zOut); static int fsSleep(sqlite3_vfs*, int microseconds); static int fsCurrentTime(sqlite3_vfs*, double*); @@ -763,13 +763,13 @@ } /* ** Return a pointer to the symbol zSymbol in the dynamic library pHandle. */ -static void (*fsDlSym(sqlite3_vfs *pVfs, void *pH, const char *zSym))(void){ +static void *fsDlSym(sqlite3_vfs *pVfs, void *pHandle, const char *zSymbol){ sqlite3_vfs *pParent = ((fs_vfs_t *)pVfs)->pParent; - return pParent->xDlSym(pParent, pH, zSym); + return pParent->xDlSym(pParent, pHandle, zSymbol); } /* ** Close the dynamic library handle pHandle. */ Index: src/test_osinst.c ================================================================== --- src/test_osinst.c +++ src/test_osinst.c @@ -12,11 +12,11 @@ ** ** This file contains the implementation of an SQLite vfs wrapper that ** adds instrumentation to all vfs and file methods. C and Tcl interfaces ** are provided to control the instrumentation. ** -** $Id: test_osinst.c,v 1.19 2009/01/08 17:57:32 danielk1977 Exp $ +** $Id: test_osinst.c,v 1.18 2008/07/25 13:32:45 drh Exp $ */ #ifdef SQLITE_ENABLE_INSTVFS /* ** C interface: @@ -178,11 +178,11 @@ static int instDelete(sqlite3_vfs*, const char *zName, int syncDir); static int instAccess(sqlite3_vfs*, const char *zName, int flags, int *); static int instFullPathname(sqlite3_vfs*, const char *zName, int, char *zOut); static void *instDlOpen(sqlite3_vfs*, const char *zFilename); static void instDlError(sqlite3_vfs*, int nByte, char *zErrMsg); -static void (*instDlSym(sqlite3_vfs *pVfs, void *p, const char*zSym))(void); +static void *instDlSym(sqlite3_vfs*,void*, const char *zSymbol); static void instDlClose(sqlite3_vfs*, void*); static int instRandomness(sqlite3_vfs*, int nByte, char *zOut); static int instSleep(sqlite3_vfs*, int microseconds); static int instCurrentTime(sqlite3_vfs*, double*); @@ -455,12 +455,12 @@ } /* ** Return a pointer to the symbol zSymbol in the dynamic library pHandle. */ -static void (*instDlSym(sqlite3_vfs *pVfs, void *p, const char *zSym))(void){ - return REALVFS(pVfs)->xDlSym(REALVFS(pVfs), p, zSym); +static void *instDlSym(sqlite3_vfs *pVfs, void *pHandle, const char *zSymbol){ + return REALVFS(pVfs)->xDlSym(REALVFS(pVfs), pHandle, zSymbol); } /* ** Close the dynamic library handle pHandle. */ DELETED src/test_pcache.c Index: src/test_pcache.c ================================================================== --- src/test_pcache.c +++ /dev/null @@ -1,450 +0,0 @@ -/* -** 2008 November 18 -** -** 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 contains code used for testing the SQLite system. -** None of the code in this file goes into a deliverable build. -** -** This file contains an application-defined pager cache -** implementation that can be plugged in in place of the -** default pcache. This alternative pager cache will throw -** some errors that the default cache does not. -** -** This pagecache implementation is designed for simplicity -** not speed. -** -** $Id: test_pcache.c,v 1.2 2009/01/07 03:59:47 drh Exp $ -*/ -#include "sqlite3.h" -#include -#include - -/* -** Global data used by this test implementation. There is no -** mutexing, which means this page cache will not work in a -** multi-threaded test. -*/ -typedef struct testpcacheGlobalType testpcacheGlobalType; -struct testpcacheGlobalType { - void *pDummy; /* Dummy allocation to simulate failures */ - int nInstance; /* Number of current instances */ - unsigned discardChance; /* Chance of discarding on an unpin (0-100) */ - unsigned prngSeed; /* Seed for the PRNG */ - unsigned highStress; /* Call xStress agressively */ -}; -static testpcacheGlobalType testpcacheGlobal; - -/* -** Initializer. -** -** Verify that the initializer is only called when the system is -** uninitialized. Allocate some memory and report SQLITE_NOMEM if -** the allocation fails. This provides a means to test the recovery -** from a failed initialization attempt. It also verifies that the -** the destructor always gets call - otherwise there would be a -** memory leak. -*/ -static int testpcacheInit(void *pArg){ - assert( pArg==(void*)&testpcacheGlobal ); - assert( testpcacheGlobal.pDummy==0 ); - assert( testpcacheGlobal.nInstance==0 ); - testpcacheGlobal.pDummy = sqlite3_malloc(10); - return testpcacheGlobal.pDummy==0 ? SQLITE_NOMEM : SQLITE_OK; -} - -/* -** Destructor -** -** Verify that this is only called after initialization. -** Free the memory allocated by the initializer. -*/ -static void testpcacheShutdown(void *pArg){ - assert( pArg==(void*)&testpcacheGlobal ); - assert( testpcacheGlobal.pDummy!=0 ); - assert( testpcacheGlobal.nInstance==0 ); - sqlite3_free( testpcacheGlobal.pDummy ); - testpcacheGlobal.pDummy = 0; -} - -/* -** Number of pages in a cache -*/ -#define TESTPCACHE_NPAGE 217 -#define TESTPCACHE_RESERVE 17 - -/* -** Magic numbers used to determine validity of the page cache. -*/ -#define TESTPCACHE_VALID 0x364585fd -#define TESTPCACHE_CLEAR 0xd42670d4 - -/* -** Private implementation of a page cache. -*/ -typedef struct testpcache testpcache; -struct testpcache { - int szPage; /* Size of each page. Multiple of 8. */ - int bPurgeable; /* True if the page cache is purgeable */ - int nFree; /* Number of unused slots in a[] */ - int nPinned; /* Number of pinned slots in a[] */ - unsigned iRand; /* State of the PRNG */ - unsigned iMagic; /* Magic number for sanity checking */ - struct testpcachePage { - unsigned key; /* The key for this page. 0 means unallocated */ - int isPinned; /* True if the page is pinned */ - void *pData; /* Data for this page */ - } a[TESTPCACHE_NPAGE]; /* All pages in the cache */ -}; - -/* -** Get a random number using the PRNG in the given page cache. -*/ -static unsigned testpcacheRandom(testpcache *p){ - unsigned x = 0; - int i; - for(i=0; i<4; i++){ - p->iRand = (p->iRand*69069 + 5); - x = (x<<8) | ((p->iRand>>16)&0xff); - } - return x; -} - - -/* -** Allocate a new page cache instance. -*/ -static sqlite3_pcache *testpcacheCreate(int szPage, int bPurgeable){ - int nMem; - char *x; - testpcache *p; - int i; - assert( testpcacheGlobal.pDummy!=0 ); - szPage = (szPage+7)&~7; - nMem = sizeof(testpcache) + TESTPCACHE_NPAGE*szPage; - p = sqlite3_malloc( nMem ); - if( p==0 ) return 0; - x = (char*)&p[1]; - p->szPage = szPage; - p->nFree = TESTPCACHE_NPAGE; - p->nPinned = 0; - p->iRand = testpcacheGlobal.prngSeed; - p->bPurgeable = bPurgeable; - p->iMagic = TESTPCACHE_VALID; - for(i=0; ia[i].key = 0; - p->a[i].isPinned = 0; - p->a[i].pData = (void*)x; - } - testpcacheGlobal.nInstance++; - return (sqlite3_pcache*)p; -} - -/* -** Set the cache size -*/ -static void testpcacheCachesize(sqlite3_pcache *pCache, int newSize){ - testpcache *p = (testpcache*)pCache; - assert( p->iMagic==TESTPCACHE_VALID ); - assert( newSize>=1 ); - assert( testpcacheGlobal.pDummy!=0 ); - assert( testpcacheGlobal.nInstance>0 ); -} - -/* -** Return the number of pages in the cache that are being used. -** This includes both pinned and unpinned pages. -*/ -static int testpcachePagecount(sqlite3_pcache *pCache){ - testpcache *p = (testpcache*)pCache; - assert( p->iMagic==TESTPCACHE_VALID ); - assert( testpcacheGlobal.pDummy!=0 ); - assert( testpcacheGlobal.nInstance>0 ); - return TESTPCACHE_NPAGE - p->nFree; -} - -/* -** Fetch a page. -*/ -static void *testpcacheFetch( - sqlite3_pcache *pCache, - unsigned key, - int createFlag -){ - testpcache *p = (testpcache*)pCache; - int i, j; - assert( p->iMagic==TESTPCACHE_VALID ); - assert( testpcacheGlobal.pDummy!=0 ); - assert( testpcacheGlobal.nInstance>0 ); - - /* See if the page is already in cache. Return immediately if it is */ - for(i=0; ia[i].key==key ){ - if( !p->a[i].isPinned ){ - p->nPinned++; - assert( p->nPinned <= TESTPCACHE_NPAGE - p->nFree ); - p->a[i].isPinned = 1; - } - return p->a[i].pData; - } - } - - /* If createFlag is 0, never allocate a new page */ - if( createFlag==0 ){ - return 0; - } - - /* If no pages are available, always fail */ - if( p->nPinned==TESTPCACHE_NPAGE ){ - return 0; - } - - /* Do not allocate the last TESTPCACHE_RESERVE pages unless createFlag is 2 */ - if( p->nPinned>=TESTPCACHE_NPAGE-TESTPCACHE_RESERVE && createFlag<2 ){ - return 0; - } - - /* Do not allocate if highStress is enabled and createFlag is not 2. - ** - ** The highStress setting causes pagerStress() to be called much more - ** often, which exercises the pager logic more intensely. - */ - if( testpcacheGlobal.highStress && createFlag<2 ){ - return 0; - } - - /* Find a free page to allocate if there are any free pages. - ** Withhold TESTPCACHE_RESERVE free pages until createFlag is 2. - */ - if( p->nFree>TESTPCACHE_RESERVE || (createFlag==2 && p->nFree>0) ){ - j = testpcacheRandom(p) % TESTPCACHE_NPAGE; - for(i=0; ia[j].key==0 ){ - p->a[j].key = key; - p->a[j].isPinned = 1; - memset(p->a[j].pData, 0, p->szPage); - p->nPinned++; - p->nFree--; - assert( p->nPinned <= TESTPCACHE_NPAGE - p->nFree ); - return p->a[j].pData; - } - } - - /* The prior loop always finds a freepage to allocate */ - assert( 0 ); - } - - /* If this cache is not purgeable then we have to fail. - */ - if( p->bPurgeable==0 ){ - return 0; - } - - /* If there are no free pages, recycle a page. The page to - ** recycle is selected at random from all unpinned pages. - */ - j = testpcacheRandom(p) % TESTPCACHE_NPAGE; - for(i=0; ia[j].key>0 && p->a[j].isPinned==0 ){ - p->a[j].key = key; - p->a[j].isPinned = 1; - memset(p->a[j].pData, 0, p->szPage); - p->nPinned++; - assert( p->nPinned <= TESTPCACHE_NPAGE - p->nFree ); - return p->a[j].pData; - } - } - - /* The previous loop always finds a page to recycle. */ - assert(0); - return 0; -} - -/* -** Unpin a page. -*/ -static void testpcacheUnpin( - sqlite3_pcache *pCache, - void *pOldPage, - int discard -){ - testpcache *p = (testpcache*)pCache; - int i; - assert( p->iMagic==TESTPCACHE_VALID ); - assert( testpcacheGlobal.pDummy!=0 ); - assert( testpcacheGlobal.nInstance>0 ); - - /* Randomly discard pages as they are unpinned according to the - ** discardChance setting. If discardChance is 0, the random discard - ** never happens. If discardChance is 100, it always happens. - */ - if( p->bPurgeable - && (100-testpcacheGlobal.discardChance) <= (testpcacheRandom(p)%100) - ){ - discard = 1; - } - - for(i=0; ia[i].pData==pOldPage ){ - /* The pOldPage pointer always points to a pinned page */ - assert( p->a[i].isPinned ); - p->a[i].isPinned = 0; - p->nPinned--; - assert( p->nPinned>=0 ); - if( discard ){ - p->a[i].key = 0; - p->nFree++; - assert( p->nFree<=TESTPCACHE_NPAGE ); - } - return; - } - } - - /* The pOldPage pointer always points to a valid page */ - assert( 0 ); -} - - -/* -** Rekey a single page. -*/ -static void testpcacheRekey( - sqlite3_pcache *pCache, - void *pOldPage, - unsigned oldKey, - unsigned newKey -){ - testpcache *p = (testpcache*)pCache; - int i; - assert( p->iMagic==TESTPCACHE_VALID ); - assert( testpcacheGlobal.pDummy!=0 ); - assert( testpcacheGlobal.nInstance>0 ); - - /* If there already exists another page at newKey, verify that - ** the other page is unpinned and discard it. - */ - for(i=0; ia[i].key==newKey ){ - /* The new key is never a page that is already pinned */ - assert( p->a[i].isPinned==0 ); - p->a[i].key = 0; - p->nFree++; - assert( p->nFree<=TESTPCACHE_NPAGE ); - break; - } - } - - /* Find the page to be rekeyed and rekey it. - */ - for(i=0; ia[i].key==oldKey ){ - /* The oldKey and pOldPage parameters match */ - assert( p->a[i].pData==pOldPage ); - /* Page to be rekeyed must be pinned */ - assert( p->a[i].isPinned ); - p->a[i].key = newKey; - return; - } - } - - /* Rekey is always given a valid page to work with */ - assert( 0 ); -} - - -/* -** Truncate the page cache. Every page with a key of iLimit or larger -** is discarded. -*/ -static void testpcacheTruncate(sqlite3_pcache *pCache, unsigned iLimit){ - testpcache *p = (testpcache*)pCache; - unsigned int i; - assert( p->iMagic==TESTPCACHE_VALID ); - assert( testpcacheGlobal.pDummy!=0 ); - assert( testpcacheGlobal.nInstance>0 ); - for(i=0; ia[i].key>=iLimit ){ - p->a[i].key = 0; - if( p->a[i].isPinned ){ - p->nPinned--; - assert( p->nPinned>=0 ); - } - p->nFree++; - assert( p->nFree<=TESTPCACHE_NPAGE ); - } - } -} - -/* -** Destroy a page cache. -*/ -static void testpcacheDestroy(sqlite3_pcache *pCache){ - testpcache *p = (testpcache*)pCache; - assert( p->iMagic==TESTPCACHE_VALID ); - assert( testpcacheGlobal.pDummy!=0 ); - assert( testpcacheGlobal.nInstance>0 ); - p->iMagic = TESTPCACHE_CLEAR; - sqlite3_free(p); - testpcacheGlobal.nInstance--; -} - - -/* -** Invoke this routine to register or unregister the testing pager cache -** implemented by this file. -** -** Install the test pager cache if installFlag is 1 and uninstall it if -** installFlag is 0. -** -** When installing, discardChance is a number between 0 and 100 that -** indicates the probability of discarding a page when unpinning the -** page. 0 means never discard (unless the discard flag is set). -** 100 means always discard. -*/ -void installTestPCache( - int installFlag, /* True to install. False to uninstall. */ - unsigned discardChance, /* 0-100. Chance to discard on unpin */ - unsigned prngSeed, /* Seed for the PRNG */ - unsigned highStress /* Call xStress agressively */ -){ - static const sqlite3_pcache_methods testPcache = { - (void*)&testpcacheGlobal, - testpcacheInit, - testpcacheShutdown, - testpcacheCreate, - testpcacheCachesize, - testpcachePagecount, - testpcacheFetch, - testpcacheUnpin, - testpcacheRekey, - testpcacheTruncate, - testpcacheDestroy, - }; - static sqlite3_pcache_methods defaultPcache; - static int isInstalled = 0; - - assert( testpcacheGlobal.nInstance==0 ); - assert( testpcacheGlobal.pDummy==0 ); - assert( discardChance<=100 ); - testpcacheGlobal.discardChance = discardChance; - testpcacheGlobal.prngSeed = prngSeed ^ (prngSeed<<16); - testpcacheGlobal.highStress = highStress; - if( installFlag!=isInstalled ){ - if( installFlag ){ - sqlite3_config(SQLITE_CONFIG_GETPCACHE, &defaultPcache); - assert( defaultPcache.xCreate!=testpcacheCreate ); - sqlite3_config(SQLITE_CONFIG_PCACHE, &testPcache); - }else{ - assert( defaultPcache.xCreate!=0 ); - sqlite3_config(SQLITE_CONFIG_PCACHE, &defaultPcache); - } - isInstalled = installFlag; - } -} Index: src/test_thread.c ================================================================== --- src/test_thread.c +++ src/test_thread.c @@ -12,23 +12,20 @@ ** ** This file contains the implementation of some Tcl commands used to ** test that sqlite3 database handles may be concurrently accessed by ** multiple threads. Right now this only works on unix. ** -** $Id: test_thread.c,v 1.10 2009/02/03 19:55:20 shane Exp $ +** $Id: test_thread.c,v 1.8 2008/08/28 13:55:10 danielk1977 Exp $ */ #include "sqliteInt.h" #include -#if SQLITE_THREADSAFE +#if SQLITE_THREADSAFE && defined(TCL_THREADS) #include - -#if !defined(_MSC_VER) #include -#endif /* ** One of these is allocated for each thread created by [sqlthread spawn]. */ typedef struct SqlThread SqlThread; @@ -65,11 +62,10 @@ EvalEvent *p = (EvalEvent *)evPtr; rc = Tcl_Eval(p->interp, p->zScript); if( rc!=TCL_OK ){ Tcl_BackgroundError(p->interp); } - UNUSED_PARAMETER(flags); return 1; } /* ** Register an EvalEvent to evaluate the script pScript in the @@ -98,18 +94,17 @@ static Tcl_ThreadCreateType tclScriptThread(ClientData pSqlThread){ Tcl_Interp *interp; Tcl_Obj *pRes; Tcl_Obj *pList; int rc; + SqlThread *p = (SqlThread *)pSqlThread; - extern int Sqlitetest_mutex_Init(Tcl_Interp*); interp = Tcl_CreateInterp(); Tcl_CreateObjCommand(interp, "clock_seconds", clock_seconds_proc, 0, 0); Tcl_CreateObjCommand(interp, "sqlthread", sqlthread_proc, pSqlThread, 0); Sqlitetest1_Init(interp); - Sqlitetest_mutex_Init(interp); rc = Tcl_Eval(interp, p->zScript); pRes = Tcl_GetObjResult(interp); pList = Tcl_NewObj(); Tcl_IncrRefCount(pList); @@ -130,11 +125,11 @@ ckfree((void *)p); Tcl_DecrRefCount(pList); Tcl_DecrRefCount(pRes); Tcl_DeleteInterp(interp); - TCL_THREAD_CREATE_RETURN; + return; } /* ** sqlthread spawn VARNAME SCRIPT ** @@ -161,12 +156,10 @@ /* Parameters for thread creation */ const int nStack = TCL_THREAD_STACK_DEFAULT; const int flags = TCL_THREAD_NOFLAGS; assert(objc==4); - UNUSED_PARAMETER(clientData); - UNUSED_PARAMETER(objc); zVarname = Tcl_GetStringFromObj(objv[2], &nVarname); zScript = Tcl_GetStringFromObj(objv[3], &nScript); pNew = (SqlThread *)ckalloc(sizeof(SqlThread)+nVarname+nScript+2); @@ -208,12 +201,10 @@ char *zMsg; int nMsg; SqlThread *p = (SqlThread *)clientData; assert(objc==3); - UNUSED_PARAMETER(objc); - if( p==0 ){ Tcl_AppendResult(interp, "no parent thread", 0); return TCL_ERROR; } @@ -229,12 +220,10 @@ return TCL_OK; } static int xBusy(void *pArg, int nBusy){ - UNUSED_PARAMETER(pArg); - UNUSED_PARAMETER(nBusy); sqlite3_sleep(50); return 1; /* Try again... */ } /* @@ -255,13 +244,10 @@ sqlite3 *db; int rc; char zBuf[100]; extern void Md5_Register(sqlite3*); - UNUSED_PARAMETER(clientData); - UNUSED_PARAMETER(objc); - zFilename = Tcl_GetString(objv[2]); rc = sqlite3_open(zFilename, &db); Md5_Register(db); sqlite3_busy_handler(db, xBusy, 0); @@ -284,13 +270,10 @@ int objc, Tcl_Obj *CONST objv[] ){ Tcl_ThreadId id = Tcl_GetCurrentThread(); Tcl_SetObjResult(interp, Tcl_NewIntObj((int)id)); - UNUSED_PARAMETER(clientData); - UNUSED_PARAMETER(objc); - UNUSED_PARAMETER(objv); return TCL_OK; } /* @@ -351,13 +334,10 @@ Tcl_Obj *CONST objv[] ){ Tcl_Time now; Tcl_GetTime(&now); Tcl_SetObjResult(interp, Tcl_NewIntObj(now.sec)); - UNUSED_PARAMETER(clientData); - UNUSED_PARAMETER(objc); - UNUSED_PARAMETER(objv); return TCL_OK; } /* ** Register commands with the TCL interpreter. Index: src/tokenize.c ================================================================== --- src/tokenize.c +++ src/tokenize.c @@ -13,13 +13,14 @@ ** ** This file contains C code that splits an SQL input string up into ** individual tokens and sends those tokens one-by-one over to the ** parser for analysis. ** -** $Id: tokenize.c,v 1.153 2009/01/20 16:53:41 danielk1977 Exp $ +** $Id: tokenize.c,v 1.152 2008/09/01 15:52:11 drh Exp $ */ #include "sqliteInt.h" +#include #include /* ** The charMap() macro maps alphabetic characters into their ** lower-case ASCII equivalent. On ASCII machines, this is just @@ -121,11 +122,11 @@ */ int sqlite3GetToken(const unsigned char *z, int *tokenType){ int i, c; switch( *z ){ case ' ': case '\t': case '\n': case '\f': case '\r': { - for(i=1; sqlite3Isspace(z[i]); i++){} + for(i=1; isspace(z[i]); i++){} *tokenType = TK_SPACE; return i; } case '-': { if( z[1]=='-' ){ @@ -255,11 +256,11 @@ return i; } } case '.': { #ifndef SQLITE_OMIT_FLOATING_POINT - if( !sqlite3Isdigit(z[1]) ) + if( !isdigit(z[1]) ) #endif { *tokenType = TK_DOT; return 1; } @@ -267,24 +268,24 @@ ** number that begins with ".". Fall thru into the next case */ } case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': { *tokenType = TK_INTEGER; - for(i=0; sqlite3Isdigit(z[i]); i++){} + for(i=0; isdigit(z[i]); i++){} #ifndef SQLITE_OMIT_FLOATING_POINT if( z[i]=='.' ){ i++; - while( sqlite3Isdigit(z[i]) ){ i++; } + while( isdigit(z[i]) ){ i++; } *tokenType = TK_FLOAT; } if( (z[i]=='e' || z[i]=='E') && - ( sqlite3Isdigit(z[i+1]) - || ((z[i+1]=='+' || z[i+1]=='-') && sqlite3Isdigit(z[i+2])) + ( isdigit(z[i+1]) + || ((z[i+1]=='+' || z[i+1]=='-') && isdigit(z[i+2])) ) ){ i += 2; - while( sqlite3Isdigit(z[i]) ){ i++; } + while( isdigit(z[i]) ){ i++; } *tokenType = TK_FLOAT; } #endif while( IdChar(z[i]) ){ *tokenType = TK_ILLEGAL; @@ -297,15 +298,15 @@ *tokenType = c==']' ? TK_ID : TK_ILLEGAL; return i; } case '?': { *tokenType = TK_VARIABLE; - for(i=1; sqlite3Isdigit(z[i]); i++){} + for(i=1; isdigit(z[i]); i++){} return i; } case '#': { - for(i=1; sqlite3Isdigit(z[i]); i++){} + for(i=1; isdigit(z[i]); i++){} if( i>1 ){ /* Parameters of the form #NNN (where NNN is a number) are used ** internally by sqlite3NestedParse. */ *tokenType = TK_REGISTER; return i; @@ -325,11 +326,11 @@ n++; #ifndef SQLITE_OMIT_TCL_VARIABLE }else if( c=='(' && n>0 ){ do{ i++; - }while( (c=z[i])!=0 && !sqlite3Isspace(c) && c!=')' ); + }while( (c=z[i])!=0 && !isspace(c) && c!=')' ); if( c==')' ){ i++; }else{ *tokenType = TK_ILLEGAL; } @@ -347,11 +348,11 @@ #ifndef SQLITE_OMIT_BLOB_LITERAL case 'x': case 'X': { if( z[1]=='\'' ){ *tokenType = TK_BLOB; for(i=2; (c=z[i])!=0 && c!='\''; i++){ - if( !sqlite3Isxdigit(c) ){ + if( !isxdigit(c) ){ *tokenType = TK_ILLEGAL; } } if( i%2 || !c ) *tokenType = TK_ILLEGAL; if( c ) i++; Index: src/trigger.c ================================================================== --- src/trigger.c +++ src/trigger.c @@ -8,11 +8,11 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* ** ** -** $Id: trigger.c,v 1.133 2008/12/26 07:56:39 danielk1977 Exp $ +** $Id: trigger.c,v 1.129 2008/08/20 16:35:10 drh Exp $ */ #include "sqliteInt.h" #ifndef SQLITE_OMIT_TRIGGER /* @@ -62,12 +62,10 @@ DbFixer sFix; int iTabDb; assert( pName1!=0 ); /* pName1->z might be NULL, but not pName1 itself */ assert( pName2!=0 ); - assert( op==TK_INSERT || op==TK_UPDATE || op==TK_DELETE ); - assert( op>0 && op<0xff ); if( isTemp ){ /* If TEMP was specified, then the trigger name may not be qualified. */ if( pName2->n>0 ){ sqlite3ErrorMsg(pParse, "temporary trigger may not have qualified name"); goto trigger_cleanup; @@ -116,12 +114,11 @@ ** specified name exists */ zName = sqlite3NameFromToken(db, pName); if( !zName || SQLITE_OK!=sqlite3CheckObjectName(pParse, zName) ){ goto trigger_cleanup; } - if( sqlite3HashFind(&(db->aDb[iDb].pSchema->trigHash), - zName, sqlite3Strlen30(zName)) ){ + if( sqlite3HashFind(&(db->aDb[iDb].pSchema->trigHash), zName,strlen(zName)) ){ if( !noErr ){ sqlite3ErrorMsg(pParse, "trigger %T already exists", pName); } goto trigger_cleanup; } @@ -178,11 +175,11 @@ pTrigger->name = zName; zName = 0; pTrigger->table = sqlite3DbStrDup(db, pTableName->a[0].zName); pTrigger->pSchema = db->aDb[iDb].pSchema; pTrigger->pTabSchema = pTab->pSchema; - pTrigger->op = (u8)op; + pTrigger->op = op; pTrigger->tr_tm = tr_tm==TK_BEFORE ? TRIGGER_BEFORE : TRIGGER_AFTER; pTrigger->pWhen = sqlite3ExprDup(db, pWhen); pTrigger->pColumns = sqlite3IdListDup(db, pColumns); sqlite3TokenCopy(db, &pTrigger->nameToken,pName); assert( pParse->pNewTrigger==0 ); @@ -254,17 +251,17 @@ if( db->init.busy ){ int n; Table *pTab; Trigger *pDel; pDel = sqlite3HashInsert(&db->aDb[iDb].pSchema->trigHash, - pTrig->name, sqlite3Strlen30(pTrig->name), pTrig); + pTrig->name, strlen(pTrig->name), pTrig); if( pDel ){ assert( pDel==pTrig ); db->mallocFailed = 1; goto triggerfinish_cleanup; } - n = sqlite3Strlen30(pTrig->table) + 1; + n = strlen(pTrig->table) + 1; pTab = sqlite3HashFind(&pTrig->pTabSchema->tblHash, pTrig->table, n); assert( pTab!=0 ); pTrig->pNext = pTab->pTrigger; pTab->pTrigger = pTrig; pTrig = 0; @@ -463,11 +460,11 @@ } assert( pName->nSrc==1 ); zDb = pName->a[0].zDatabase; zName = pName->a[0].zName; - nName = sqlite3Strlen30(zName); + nName = strlen(zName); for(i=OMIT_TEMPDB; inDb; i++){ int j = (i<2) ? i^1 : i; /* Search TEMP before MAIN */ if( zDb && sqlite3StrICmp(db->aDb[j].zName, zDb) ) continue; pTrigger = sqlite3HashFind(&(db->aDb[j].pSchema->trigHash), zName, nName); if( pTrigger ) break; @@ -487,11 +484,11 @@ /* ** Return a pointer to the Table structure for the table that a trigger ** is set on. */ static Table *tableOfTrigger(Trigger *pTrigger){ - int n = sqlite3Strlen30(pTrigger->table) + 1; + int n = strlen(pTrigger->table) + 1; return sqlite3HashFind(&pTrigger->pTabSchema->tblHash, pTrigger->table, n); } /* @@ -552,11 +549,11 @@ /* ** Remove a trigger from the hash tables of the sqlite* pointer. */ void sqlite3UnlinkAndDeleteTrigger(sqlite3 *db, int iDb, const char *zName){ Trigger *pTrigger; - int nName = sqlite3Strlen30(zName); + int nName = strlen(zName); pTrigger = sqlite3HashInsert(&(db->aDb[iDb].pSchema->trigHash), zName, nName, 0); if( pTrigger ){ Table *pTable = tableOfTrigger(pTrigger); assert( pTable!=0 ); @@ -604,10 +601,11 @@ ** ** The returned bit vector is some combination of TRIGGER_BEFORE and ** TRIGGER_AFTER. */ int sqlite3TriggersExist( + Parse *pParse, /* Used to check for recursive triggers */ Table *pTab, /* The table the contains the triggers */ int op, /* one of TK_DELETE, TK_INSERT, TK_UPDATE */ ExprList *pChanges /* Columns that change in an UPDATE statement */ ){ Trigger *pTrigger; @@ -643,11 +641,11 @@ iDb = sqlite3SchemaToIndex(pParse->db, pStep->pTrig->pSchema); if( iDb==0 || iDb>=2 ){ assert( iDbdb->nDb ); sDb.z = (u8*)pParse->db->aDb[iDb].zName; - sDb.n = sqlite3Strlen30((char*)sDb.z); + sDb.n = strlen((char*)sDb.z); pSrc = sqlite3SrcListAppend(pParse->db, 0, &sDb, &pStep->target); } else { pSrc = sqlite3SrcListAppend(pParse->db, 0, &pStep->target, 0); } return pSrc; @@ -670,11 +668,10 @@ assert( pTriggerStep!=0 ); assert( v!=0 ); sqlite3VdbeAddOp2(v, OP_ContextPush, 0, 0); VdbeComment((v, "begin trigger %s", pStepList->pTrig->name)); while( pTriggerStep ){ - sqlite3ExprClearColumnCache(pParse, -1); orconf = (orconfin == OE_Default)?pTriggerStep->orconf:orconfin; pParse->trigStack->orconf = orconf; switch( pTriggerStep->op ){ case TK_SELECT: { Select *ss = sqlite3SelectDup(db, pTriggerStep->pSelect); Index: src/update.c ================================================================== --- src/update.c +++ src/update.c @@ -10,11 +10,11 @@ ** ************************************************************************* ** This file contains C code routines that are called by the parser ** to handle UPDATE statements. ** -** $Id: update.c,v 1.191 2008/12/23 23:56:22 drh Exp $ +** $Id: update.c,v 1.185 2008/10/09 18:48:31 danielk1977 Exp $ */ #include "sqliteInt.h" #ifndef SQLITE_OMIT_VIRTUALTABLE /* Forward declaration */ @@ -107,14 +107,14 @@ #ifndef SQLITE_OMIT_TRIGGER int isView; /* Trying to update a view */ int triggers_exist = 0; /* True if any row triggers exist */ #endif - int iBeginAfterTrigger = 0; /* Address of after trigger program */ - int iEndAfterTrigger = 0; /* Exit of after trigger program */ - int iBeginBeforeTrigger = 0; /* Address of before trigger program */ - int iEndBeforeTrigger = 0; /* Exit of before trigger program */ + int iBeginAfterTrigger; /* Address of after trigger program */ + int iEndAfterTrigger; /* Exit of after trigger program */ + int iBeginBeforeTrigger; /* Address of before trigger program */ + int iEndBeforeTrigger; /* Exit of before trigger program */ u32 old_col_mask = 0; /* Mask of OLD.* columns in use */ u32 new_col_mask = 0; /* Mask of NEW.* columns in use */ int newIdx = -1; /* index of trigger "new" temp table */ int oldIdx = -1; /* index of trigger "old" temp table */ @@ -122,11 +122,10 @@ /* Register Allocations */ int regRowCount = 0; /* A count of rows changed */ int regOldRowid; /* The old rowid */ int regNewRowid; /* The new rowid */ int regData; /* New data for the row */ - int regRowSet = 0; /* Rowset of rows to be updated */ sContext.pParse = 0; db = pParse->db; if( pParse->nErr || db->mallocFailed ){ goto update_cleanup; @@ -141,11 +140,11 @@ /* Figure out if we have any triggers and if the table being ** updated is a view */ #ifndef SQLITE_OMIT_TRIGGER - triggers_exist = sqlite3TriggersExist(pTab, TK_UPDATE, pChanges); + triggers_exist = sqlite3TriggersExist(pParse, pTab, TK_UPDATE, pChanges); isView = pTab->pSelect!=0; #else # define triggers_exist 0 # define isView 0 #endif @@ -344,21 +343,18 @@ /* Begin the database scan */ sqlite3VdbeAddOp2(v, OP_Null, 0, regOldRowid); pWInfo = sqlite3WhereBegin(pParse, pTabList, pWhere, 0, - WHERE_ONEPASS_DESIRED, 0); + WHERE_ONEPASS_DESIRED); if( pWInfo==0 ) goto update_cleanup; okOnePass = pWInfo->okOnePass; /* Remember the rowid of every item to be updated. */ sqlite3VdbeAddOp2(v, IsVirtual(pTab)?OP_VRowid:OP_Rowid, iCur, regOldRowid); - if( !okOnePass ){ - regRowSet = ++pParse->nMem; - sqlite3VdbeAddOp2(v, OP_RowSetAdd, regRowSet, regOldRowid); - } + if( !okOnePass ) sqlite3VdbeAddOp2(v, OP_FifoWrite, regOldRowid, 0); /* End the database scan loop. */ sqlite3WhereEnd(pWInfo); @@ -407,11 +403,11 @@ if( okOnePass ){ int a1 = sqlite3VdbeAddOp1(v, OP_NotNull, regOldRowid); addr = sqlite3VdbeAddOp0(v, OP_Goto); sqlite3VdbeJumpHere(v, a1); }else{ - addr = sqlite3VdbeAddOp3(v, OP_RowSetRead, regRowSet, 0, regOldRowid); + addr = sqlite3VdbeAddOp2(v, OP_FifoRead, regOldRowid, 0); } if( triggers_exist ){ int regRowid; int regRow; @@ -527,11 +523,11 @@ sqlite3VdbeJumpHere(v, j1); /* Create the new index entries and the new record. */ sqlite3CompleteInsertion(pParse, pTab, iCur, regNewRowid, - aRegIdx, 1, -1, 0); + aRegIdx, chngRowid, 1, -1, 0); } /* Increment the row counter */ if( db->flags & SQLITE_CountRows && !pParse->trigStack){ @@ -570,11 +566,11 @@ ** invoke the callback function. */ if( db->flags & SQLITE_CountRows && !pParse->trigStack && pParse->nested==0 ){ sqlite3VdbeAddOp2(v, OP_ResultRow, regRowCount, 1); sqlite3VdbeSetNumCols(v, 1); - sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "rows updated", SQLITE_STATIC); + sqlite3VdbeSetColName(v, 0, COLNAME_NAME, "rows updated", P4_STATIC); } update_cleanup: sqlite3AuthContextPop(&sContext); sqlite3DbFree(db, aRegIdx); Index: src/utf.c ================================================================== --- src/utf.c +++ src/utf.c @@ -10,11 +10,11 @@ ** ************************************************************************* ** This file contains routines used to translate between UTF-8, ** UTF-16, UTF-16BE, and UTF-16LE. ** -** $Id: utf.c,v 1.70 2008/12/10 22:30:25 shane Exp $ +** $Id: utf.c,v 1.65 2008/08/12 15:04:59 danielk1977 Exp $ ** ** Notes on UTF-8: ** ** Byte-0 Byte-1 Byte-2 Byte-3 Value ** 0xxxxxxx 00000000 00000000 0xxxxxxx @@ -37,23 +37,21 @@ */ #include "sqliteInt.h" #include #include "vdbeInt.h" -#ifndef SQLITE_AMALGAMATION /* ** The following constant value is used by the SQLITE_BIGENDIAN and ** SQLITE_LITTLEENDIAN macros. */ const int sqlite3one = 1; -#endif /* SQLITE_AMALGAMATION */ /* ** This lookup table is used to help decode the first byte of ** a multi-byte UTF8 character. */ -static const unsigned char sqlite3Utf8Trans1[] = { +static const unsigned char sqlite3UtfTrans1[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, @@ -63,50 +61,50 @@ }; #define WRITE_UTF8(zOut, c) { \ if( c<0x00080 ){ \ - *zOut++ = (u8)(c&0xFF); \ - } \ - else if( c<0x00800 ){ \ - *zOut++ = 0xC0 + (u8)((c>>6)&0x1F); \ - *zOut++ = 0x80 + (u8)(c & 0x3F); \ - } \ - else if( c<0x10000 ){ \ - *zOut++ = 0xE0 + (u8)((c>>12)&0x0F); \ - *zOut++ = 0x80 + (u8)((c>>6) & 0x3F); \ - *zOut++ = 0x80 + (u8)(c & 0x3F); \ - }else{ \ - *zOut++ = 0xF0 + (u8)((c>>18) & 0x07); \ - *zOut++ = 0x80 + (u8)((c>>12) & 0x3F); \ - *zOut++ = 0x80 + (u8)((c>>6) & 0x3F); \ - *zOut++ = 0x80 + (u8)(c & 0x3F); \ - } \ -} - -#define WRITE_UTF16LE(zOut, c) { \ - if( c<=0xFFFF ){ \ - *zOut++ = (u8)(c&0x00FF); \ - *zOut++ = (u8)((c>>8)&0x00FF); \ - }else{ \ - *zOut++ = (u8)(((c>>10)&0x003F) + (((c-0x10000)>>10)&0x00C0)); \ - *zOut++ = (u8)(0x00D8 + (((c-0x10000)>>18)&0x03)); \ - *zOut++ = (u8)(c&0x00FF); \ - *zOut++ = (u8)(0x00DC + ((c>>8)&0x03)); \ - } \ -} - -#define WRITE_UTF16BE(zOut, c) { \ - if( c<=0xFFFF ){ \ - *zOut++ = (u8)((c>>8)&0x00FF); \ - *zOut++ = (u8)(c&0x00FF); \ - }else{ \ - *zOut++ = (u8)(0x00D8 + (((c-0x10000)>>18)&0x03)); \ - *zOut++ = (u8)(((c>>10)&0x003F) + (((c-0x10000)>>10)&0x00C0)); \ - *zOut++ = (u8)(0x00DC + ((c>>8)&0x03)); \ - *zOut++ = (u8)(c&0x00FF); \ - } \ + *zOut++ = (c&0xFF); \ + } \ + else if( c<0x00800 ){ \ + *zOut++ = 0xC0 + ((c>>6)&0x1F); \ + *zOut++ = 0x80 + (c & 0x3F); \ + } \ + else if( c<0x10000 ){ \ + *zOut++ = 0xE0 + ((c>>12)&0x0F); \ + *zOut++ = 0x80 + ((c>>6) & 0x3F); \ + *zOut++ = 0x80 + (c & 0x3F); \ + }else{ \ + *zOut++ = 0xF0 + ((c>>18) & 0x07); \ + *zOut++ = 0x80 + ((c>>12) & 0x3F); \ + *zOut++ = 0x80 + ((c>>6) & 0x3F); \ + *zOut++ = 0x80 + (c & 0x3F); \ + } \ +} + +#define WRITE_UTF16LE(zOut, c) { \ + if( c<=0xFFFF ){ \ + *zOut++ = (c&0x00FF); \ + *zOut++ = ((c>>8)&0x00FF); \ + }else{ \ + *zOut++ = (((c>>10)&0x003F) + (((c-0x10000)>>10)&0x00C0)); \ + *zOut++ = (0x00D8 + (((c-0x10000)>>18)&0x03)); \ + *zOut++ = (c&0x00FF); \ + *zOut++ = (0x00DC + ((c>>8)&0x03)); \ + } \ +} + +#define WRITE_UTF16BE(zOut, c) { \ + if( c<=0xFFFF ){ \ + *zOut++ = ((c>>8)&0x00FF); \ + *zOut++ = (c&0x00FF); \ + }else{ \ + *zOut++ = (0x00D8 + (((c-0x10000)>>18)&0x03)); \ + *zOut++ = (((c>>10)&0x003F) + (((c-0x10000)>>10)&0x00C0)); \ + *zOut++ = (0x00DC + ((c>>8)&0x03)); \ + *zOut++ = (c&0x00FF); \ + } \ } #define READ_UTF16LE(zIn, c){ \ c = (*zIn++); \ c += ((*zIn++)<<8); \ @@ -157,11 +155,11 @@ ** encodings to 0xfffd as some systems recommend. */ #define READ_UTF8(zIn, zTerm, c) \ c = *(zIn++); \ if( c>=0xc0 ){ \ - c = sqlite3Utf8Trans1[c-0xc0]; \ + c = sqlite3UtfTrans1[c-0xc0]; \ while( zIn!=zTerm && (*zIn & 0xc0)==0x80 ){ \ c = (c<<6) + (0x3f & *(zIn++)); \ } \ if( c<0x80 \ || (c&0xFFFFF800)==0xD800 \ @@ -226,11 +224,11 @@ if( rc!=SQLITE_OK ){ assert( rc==SQLITE_NOMEM ); return SQLITE_NOMEM; } zIn = (u8*)pMem->z; - zTerm = &zIn[pMem->n&~1]; + zTerm = &zIn[pMem->n]; while( zInn &= ~1; len = pMem->n * 2 + 1; }else{ /* When converting from UTF-8 to UTF-16 the maximum growth is caused ** when a 1-byte UTF-8 character is translated into a 2-byte UTF-16 ** character. Two bytes are required in the output buffer for the @@ -286,11 +283,11 @@ /* c = sqlite3Utf8Read(zIn, zTerm, (const u8**)&zIn); */ READ_UTF8(zIn, zTerm, c); WRITE_UTF16BE(z, c); } } - pMem->n = (int)(z - zOut); + pMem->n = z - zOut; *z++ = 0; }else{ assert( desiredEnc==SQLITE_UTF8 ); if( pMem->enc==SQLITE_UTF16LE ){ /* UTF-16 Little-endian -> UTF-8 */ @@ -303,11 +300,11 @@ while( zInn = (int)(z - zOut); + pMem->n = z - zOut; } *z = 0; assert( (pMem->n+(desiredEnc==SQLITE_UTF8?1:2))<=len ); sqlite3VdbeMemRelease(pMem); @@ -405,11 +402,11 @@ ** correct UTF-8 encoding to be longer than a malformed encoding). */ int sqlite3Utf8To8(unsigned char *zIn){ unsigned char *zOut = zIn; unsigned char *zStart = zIn; - unsigned char *zTerm = &zIn[sqlite3Strlen30((char *)zIn)]; + unsigned char *zTerm = &zIn[strlen((char *)zIn)]; u32 c; while( zIn[0] ){ c = sqlite3Utf8Read(zIn, zTerm, (const u8**)&zIn); if( c!=0xfffd ){ @@ -473,11 +470,11 @@ while( c && ((nChar<0) || n0 && n<=4 ); + n = z-zBuf; z[0] = 0; zTerm = z; z = zBuf; c = sqlite3Utf8Read(z, zTerm, (const u8**)&z); t = i; @@ -509,12 +505,11 @@ } for(i=0; i<0x00110000; i++){ if( i>=0xD800 && i<0xE000 ) continue; z = zBuf; WRITE_UTF16LE(z, i); - n = (int)(z-zBuf); - assert( n>0 && n<=4 ); + n = z-zBuf; z[0] = 0; z = zBuf; READ_UTF16LE(z, c); assert( c==i ); assert( (z-zBuf)==n ); @@ -521,16 +516,15 @@ } for(i=0; i<0x00110000; i++){ if( i>=0xD800 && i<0xE000 ) continue; z = zBuf; WRITE_UTF16BE(z, i); - n = (int)(z-zBuf); - assert( n>0 && n<=4 ); + n = z-zBuf; z[0] = 0; z = zBuf; READ_UTF16BE(z, c); assert( c==i ); assert( (z-zBuf)==n ); } } #endif /* SQLITE_TEST */ #endif /* SQLITE_OMIT_UTF16 */ Index: src/util.c ================================================================== --- src/util.c +++ src/util.c @@ -12,45 +12,16 @@ ** Utility functions used throughout sqlite. ** ** This file contains functions for allocating memory, comparing ** strings, and stuff like that. ** -** $Id: util.c,v 1.248 2009/02/04 03:59:25 shane Exp $ +** $Id: util.c,v 1.241 2008/07/28 19:34:54 drh Exp $ */ #include "sqliteInt.h" #include - -/* -** Routine needed to support the testcase() macro. -*/ -#ifdef SQLITE_COVERAGE_TEST -void sqlite3Coverage(int x){ - static int dummy = 0; - dummy += x; -} -#endif - -/* -** Routine needed to support the ALWAYS() and NEVER() macros. -** -** The argument to ALWAYS() should always be true and the argument -** to NEVER() should always be false. If either is not the case -** then this routine is called in order to throw an error. -** -** This routine only exists if assert() is operational. It always -** throws an assert on its first invocation. The variable has a long -** name to help the assert() message be more readable. The variable -** is used to prevent a too-clever optimizer from optimizing out the -** entire call. -*/ -#ifndef NDEBUG -int sqlite3Assert(void){ - static volatile int ALWAYS_was_false_or_NEVER_was_true = 0; - assert( ALWAYS_was_false_or_NEVER_was_true ); /* Always fails */ - return ALWAYS_was_false_or_NEVER_was_true++; /* Not Reached */ -} -#endif +#include + /* ** Return true if the floating point value is Not a Number (NaN). */ int sqlite3IsNaN(double x){ @@ -77,30 +48,20 @@ volatile double y = x; volatile double z = y; return y!=z; } -/* -** Compute a string length that is limited to what can be stored in -** lower 30 bits of a 32-bit signed integer. -*/ -int sqlite3Strlen30(const char *z){ - const char *z2 = z; - while( *z2 ){ z2++; } - return 0x3fffffff & (int)(z2 - z); -} - /* ** Return the length of a string, except do not allow the string length ** to exceed the SQLITE_LIMIT_LENGTH setting. */ int sqlite3Strlen(sqlite3 *db, const char *z){ const char *z2 = z; int len; - int x; + size_t x; while( *z2 ){ z2++; } - x = (int)(z2 - z); + x = z2 - z; len = 0x7fffffff & x; if( len!=x || len > db->aLimit[SQLITE_LIMIT_LENGTH] ){ return db->aLimit[SQLITE_LIMIT_LENGTH]; }else{ return len; @@ -192,11 +153,11 @@ ** 2002-Feb-14: This routine is extended to remove MS-Access style ** brackets from around identifers. For example: "[a-b-c]" becomes ** "a-b-c". */ void sqlite3Dequote(char *z){ - char quote; + int quote; int i, j; if( z==0 ) return; quote = z[0]; switch( quote ){ case '\'': break; @@ -252,27 +213,27 @@ */ int sqlite3IsNumber(const char *z, int *realnum, u8 enc){ int incr = (enc==SQLITE_UTF8?1:2); if( enc==SQLITE_UTF16BE ) z++; if( *z=='-' || *z=='+' ) z += incr; - if( !sqlite3Isdigit(*z) ){ + if( !isdigit(*(u8*)z) ){ return 0; } z += incr; if( realnum ) *realnum = 0; - while( sqlite3Isdigit(*z) ){ z += incr; } + while( isdigit(*(u8*)z) ){ z += incr; } if( *z=='.' ){ z += incr; - if( !sqlite3Isdigit(*z) ) return 0; - while( sqlite3Isdigit(*z) ){ z += incr; } + if( !isdigit(*(u8*)z) ) return 0; + while( isdigit(*(u8*)z) ){ z += incr; } if( realnum ) *realnum = 1; } if( *z=='e' || *z=='E' ){ z += incr; if( *z=='+' || *z=='-' ) z += incr; - if( !sqlite3Isdigit(*z) ) return 0; - while( sqlite3Isdigit(*z) ){ z += incr; } + if( !isdigit(*(u8*)z) ) return 0; + while( isdigit(*(u8*)z) ){ z += incr; } if( realnum ) *realnum = 1; } return *z==0; } @@ -292,21 +253,21 @@ #ifndef SQLITE_OMIT_FLOATING_POINT int sign = 1; const char *zBegin = z; LONGDOUBLE_TYPE v1 = 0.0; int nSignificant = 0; - while( sqlite3Isspace(*z) ) z++; + while( isspace(*(u8*)z) ) z++; if( *z=='-' ){ sign = -1; z++; }else if( *z=='+' ){ z++; } while( z[0]=='0' ){ z++; } - while( sqlite3Isdigit(*z) ){ + while( isdigit(*(u8*)z) ){ v1 = v1*10.0 + (*z - '0'); z++; nSignificant++; } if( *z=='.' ){ @@ -316,11 +277,11 @@ while( z[0]=='0' ){ divisor *= 10.0; z++; } } - while( sqlite3Isdigit(*z) ){ + while( isdigit(*(u8*)z) ){ if( nSignificant<18 ){ v1 = v1*10.0 + (*z - '0'); divisor *= 10.0; nSignificant++; } @@ -337,11 +298,11 @@ esign = -1; z++; }else if( *z=='+' ){ z++; } - while( sqlite3Isdigit(*z) ){ + while( isdigit(*(u8*)z) ){ eval = eval*10 + *z - '0'; z++; } while( eval>=64 ){ scale *= 1.0e+64; eval -= 64; } while( eval>=16 ){ scale *= 1.0e+16; eval -= 16; } @@ -351,12 +312,12 @@ v1 /= scale; }else{ v1 *= scale; } } - *pResult = (double)(sign<0 ? -v1 : v1); - return (int)(z - zBegin); + *pResult = sign<0 ? -v1 : v1; + return z - zBegin; #else return sqlite3Atoi64(z, pResult); #endif /* SQLITE_OMIT_FLOATING_POINT */ } @@ -396,11 +357,11 @@ int sqlite3Atoi64(const char *zNum, i64 *pNum){ i64 v = 0; int neg; int i, c; const char *zStart; - while( sqlite3Isspace(*zNum) ) zNum++; + while( isspace(*(u8*)zNum) ) zNum++; if( *zNum=='-' ){ neg = 1; zNum++; }else if( *zNum=='+' ){ neg = 0; @@ -538,21 +499,21 @@ */ int sqlite3PutVarint(unsigned char *p, u64 v){ int i, j, n; u8 buf[10]; if( v & (((u64)0xff000000)<<32) ){ - p[8] = (u8)v; + p[8] = v; v >>= 8; for(i=7; i>=0; i--){ - p[i] = (u8)((v & 0x7f) | 0x80); + p[i] = (v & 0x7f) | 0x80; v >>= 7; } return 9; } n = 0; do{ - buf[n++] = (u8)((v & 0x7f) | 0x80); + buf[n++] = (v & 0x7f) | 0x80; v >>= 7; }while( v!=0 ); buf[0] &= 0x7f; assert( n<=9 ); for(i=0, j=n-1; j>=0; j--, i++){ @@ -575,22 +536,22 @@ p[0] = v; return 1; } #endif if( (v & ~0x3fff)==0 ){ - p[0] = (u8)((v>>7) | 0x80); - p[1] = (u8)(v & 0x7f); + p[0] = (v>>7) | 0x80; + p[1] = v & 0x7f; return 2; } return sqlite3PutVarint(p, v); } /* ** Read a 64-bit variable-length integer from memory starting at p[0]. ** Return the number of bytes read. The value is stored in *v. */ -u8 sqlite3GetVarint(const unsigned char *p, u64 *v){ +int sqlite3GetVarint(const unsigned char *p, u64 *v){ u32 a,b,s; a = *p; /* a: p0 (unmasked) */ if (!(a&0x80)) @@ -748,11 +709,11 @@ ** Return the number of bytes read. The value is stored in *v. ** A MACRO version, getVarint32, is provided which inlines the ** single-byte case. All code should use the MACRO version as ** this function assumes the single-byte case has already been handled. */ -u8 sqlite3GetVarint32(const unsigned char *p, u32 *v){ +int sqlite3GetVarint32(const unsigned char *p, u32 *v){ u32 a,b; a = *p; /* a: p0 (unmasked) */ #ifndef getVarint32 @@ -817,11 +778,11 @@ ** file. In that case we are not in any hurry. Use the (relatively ** slow) general-purpose sqlite3GetVarint() routine to extract the ** value. */ { u64 v64; - u8 n; + int n; p -= 4; n = sqlite3GetVarint(p, &v64); assert( n>5 && n<=9 ); *v = (u32)v64; @@ -848,14 +809,14 @@ */ u32 sqlite3Get4byte(const u8 *p){ return (p[0]<<24) | (p[1]<<16) | (p[2]<<8) | p[3]; } void sqlite3Put4byte(unsigned char *p, u32 v){ - p[0] = (u8)(v>>24); - p[1] = (u8)(v>>16); - p[2] = (u8)(v>>8); - p[3] = (u8)v; + p[0] = v>>24; + p[1] = v>>16; + p[2] = v>>8; + p[3] = v; } #if !defined(SQLITE_OMIT_BLOB_LITERAL) || defined(SQLITE_HAS_CODEC) @@ -862,19 +823,19 @@ /* ** Translate a single byte of Hex into an integer. ** This routinen only works if h really is a valid hexadecimal ** character: 0..9a..fA..F */ -static u8 hexToInt(int h){ +static int hexToInt(int h){ assert( (h>='0' && h<='9') || (h>='a' && h<='f') || (h>='A' && h<='F') ); #ifdef SQLITE_ASCII h += 9*(1&(h>>6)); #endif #ifdef SQLITE_EBCDIC h += 9*(1&~(h>>4)); #endif - return (u8)(h & 0xf); + return h & 0xf; } #endif /* !SQLITE_OMIT_BLOB_LITERAL || SQLITE_HAS_CODEC */ #if !defined(SQLITE_OMIT_BLOB_LITERAL) || defined(SQLITE_HAS_CODEC) /* @@ -971,21 +932,21 @@ ** use. sqlite3SafetyCheckSickOrOk() allows a db pointer that failed to ** open properly and is not fit for general use but which can be ** used as an argument to sqlite3_errmsg() or sqlite3_close(). */ int sqlite3SafetyCheckOk(sqlite3 *db){ - u32 magic; + int magic; if( db==0 ) return 0; magic = db->magic; if( magic!=SQLITE_MAGIC_OPEN && magic!=SQLITE_MAGIC_BUSY ) return 0; return 1; } int sqlite3SafetyCheckSickOrOk(sqlite3 *db){ - u32 magic; + int magic; if( db==0 ) return 0; magic = db->magic; if( magic!=SQLITE_MAGIC_SICK && magic!=SQLITE_MAGIC_OPEN && magic!=SQLITE_MAGIC_BUSY ) return 0; return 1; } Index: src/vacuum.c ================================================================== --- src/vacuum.c +++ src/vacuum.c @@ -12,11 +12,11 @@ ** This file contains code used to implement the VACUUM command. ** ** Most of the code in this file may be omitted by defining the ** SQLITE_OMIT_VACUUM macro. ** -** $Id: vacuum.c,v 1.86 2009/02/03 16:51:25 danielk1977 Exp $ +** $Id: vacuum.c,v 1.83 2008/08/26 21:07:27 drh Exp $ */ #include "sqliteInt.h" #include "vdbeInt.h" #if !defined(SQLITE_OMIT_VACUUM) && !defined(SQLITE_OMIT_ATTACH) @@ -89,21 +89,21 @@ int saved_nTotalChange; /* Saved value of db->nTotalChange */ Db *pDb = 0; /* Database to detach at end of vacuum */ int isMemDb; /* True is vacuuming a :memory: database */ int nRes; - if( !db->autoCommit ){ - sqlite3SetString(pzErrMsg, db, "cannot VACUUM from within a transaction"); - return SQLITE_ERROR; - } - /* Save the current value of the write-schema flag before setting it. */ saved_flags = db->flags; saved_nChange = db->nChange; saved_nTotalChange = db->nTotalChange; db->flags |= SQLITE_WriteSchema | SQLITE_IgnoreChecks; + if( !db->autoCommit ){ + sqlite3SetString(pzErrMsg, db, "cannot VACUUM from within a transaction"); + rc = SQLITE_ERROR; + goto end_of_vacuum; + } pMain = db->aDb[0].pBt; pMainPager = sqlite3BtreePager(pMain); isMemDb = sqlite3PagerFile(pMainPager)->pMethods==0; /* Attach the temporary database as 'vacuum_db'. The synchronous pragma @@ -249,11 +249,11 @@ assert( 1==sqlite3BtreeIsInTrans(pTemp) ); assert( 1==sqlite3BtreeIsInTrans(pMain) ); /* Copy Btree meta values */ - for(i=0; i #include "vdbeInt.h" /* ** The following global variable is incremented every time a cursor -** moves, either by the OP_SeekXX, OP_Next, or OP_Prev opcodes. The test +** moves, either by the OP_MoveXX, OP_Next, or OP_Prev opcodes. The test ** procedures use this information to make sure that indices are ** working correctly. This variable has no function other than to ** help verify the correct operation of the library. */ #ifdef SQLITE_TEST @@ -174,29 +175,29 @@ /* ** Return true if an opcode has any of the OPFLG_xxx properties ** specified by mask. */ int sqlite3VdbeOpcodeHasProperty(int opcode, int mask){ - assert( opcode>0 && opcode<(int)sizeof(opcodeProperty) ); + assert( opcode>0 && opcodenMem-1), etc. */ Mem *pMem = &p->aMem[p->nMem-iCur]; int nByte; - VdbeCursor *pCx = 0; + Cursor *pCx = 0; /* If the opcode of pOp is OP_SetNumColumns, then pOp->p2 contains ** the number of fields in the records contained in the table or ** index being opened. Use this to reserve space for the - ** VdbeCursor.aType[] array. + ** Cursor.aType[] array. */ int nField = 0; if( pOp->opcode==OP_SetNumColumns || pOp->opcode==OP_OpenEphemeral ){ nField = pOp->p2; } nByte = - sizeof(VdbeCursor) + + sizeof(Cursor) + (isBtreeCursor?sqlite3BtreeCursorSize():0) + 2*nField*sizeof(u32); assert( iCurnCursor ); if( p->apCsr[iCur] ){ sqlite3VdbeFreeCursor(p, p->apCsr[iCur]); p->apCsr[iCur] = 0; } if( SQLITE_OK==sqlite3VdbeMemGrow(pMem, nByte, 0) ){ - p->apCsr[iCur] = pCx = (VdbeCursor*)pMem->z; + p->apCsr[iCur] = pCx = (Cursor *)pMem->z; memset(pMem->z, 0, nByte); pCx->iDb = iDb; pCx->nField = nField; if( nField ){ - pCx->aType = (u32 *)&pMem->z[sizeof(VdbeCursor)]; + pCx->aType = (u32 *)&pMem->z[sizeof(Cursor)]; } if( isBtreeCursor ){ - pCx->pCursor = (BtCursor*) - &pMem->z[sizeof(VdbeCursor)+2*nField*sizeof(u32)]; + pCx->pCursor = (BtCursor *)&pMem->z[sizeof(Cursor)+2*nField*sizeof(u32)]; } } return pCx; } @@ -367,28 +367,28 @@ }else{ c = 's'; } sqlite3_snprintf(100, zCsr, "%c", c); - zCsr += sqlite3Strlen30(zCsr); + zCsr += strlen(zCsr); sqlite3_snprintf(100, zCsr, "%d[", pMem->n); - zCsr += sqlite3Strlen30(zCsr); + zCsr += strlen(zCsr); for(i=0; i<16 && in; i++){ sqlite3_snprintf(100, zCsr, "%02X", ((int)pMem->z[i] & 0xFF)); - zCsr += sqlite3Strlen30(zCsr); + zCsr += strlen(zCsr); } for(i=0; i<16 && in; i++){ char z = pMem->z[i]; if( z<32 || z>126 ) *zCsr++ = '.'; else *zCsr++ = z; } sqlite3_snprintf(100, zCsr, "]%s", encnames[pMem->enc]); - zCsr += sqlite3Strlen30(zCsr); + zCsr += strlen(zCsr); if( f & MEM_Zero ){ - sqlite3_snprintf(100, zCsr,"+%dz",pMem->u.nZero); - zCsr += sqlite3Strlen30(zCsr); + sqlite3_snprintf(100, zCsr,"+%lldz",pMem->u.i); + zCsr += strlen(zCsr); } *zCsr = '\0'; }else if( f & MEM_Str ){ int j, k; zBuf[0] = ' '; @@ -404,11 +404,11 @@ }else{ zBuf[1] = 's'; } k = 2; sqlite3_snprintf(100, &zBuf[k], "%d", pMem->n); - k += sqlite3Strlen30(&zBuf[k]); + k += strlen(&zBuf[k]); zBuf[k++] = '['; for(j=0; j<15 && jn; j++){ u8 c = pMem->z[j]; if( c>=0x20 && c<0x7f ){ zBuf[k++] = c; @@ -416,11 +416,11 @@ zBuf[k++] = '.'; } } zBuf[k++] = ']'; sqlite3_snprintf(100,&zBuf[k], encnames[pMem->enc]); - k += sqlite3Strlen30(&zBuf[k]); + k += strlen(&zBuf[k]); zBuf[k++] = 0; } } #endif @@ -496,30 +496,10 @@ rc = sqlite3OsAccess(db->pVfs, zFile, SQLITE_ACCESS_EXISTS, &res); return (res && rc==SQLITE_OK); } #endif -#ifndef NDEBUG -/* -** This function is only called from within an assert() expression. It -** checks that the sqlite3.nTransaction variable is correctly set to -** the number of non-transaction savepoints currently in the -** linked list starting at sqlite3.pSavepoint. -** -** Usage: -** -** assert( checkSavepointCount(db) ); -*/ -static int checkSavepointCount(sqlite3 *db){ - int n = 0; - Savepoint *p; - for(p=db->pSavepoint; p; p=p->pNext) n++; - assert( n==(db->nSavepoint + db->isTransactionSavepoint) ); - return 1; -} -#endif - /* ** Execute as much of a VDBE program as we can then return. ** ** sqlite3VdbeMakeReady() must be called before this routine in order to ** close the program with a final OP_Halt and to set up the callbacks @@ -555,14 +535,12 @@ int pc; /* The program counter */ Op *pOp; /* Current operation */ int rc = SQLITE_OK; /* Value to return */ sqlite3 *db = p->db; /* The database */ u8 encoding = ENC(db); /* The database encoding */ - Mem *pIn1 = 0; /* 1st input operand */ - Mem *pIn2 = 0; /* 2nd input operand */ - Mem *pIn3 = 0; /* 3rd input operand */ - Mem *pOut = 0; /* Output operand */ + Mem *pIn1, *pIn2, *pIn3; /* Input operands */ + Mem *pOut; /* Output operand */ u8 opProperty; int iCompare = 0; /* Result of last OP_Compare operation */ int *aPermute = 0; /* Permuation of columns for OP_Compare */ #ifdef VDBE_PROFILE u64 start; /* CPU clock count at start of opcode */ @@ -570,10 +548,11 @@ #endif #ifndef SQLITE_OMIT_PROGRESS_CALLBACK int nProgressOps = 0; /* Opcodes executed since progress callback. */ #endif UnpackedRecord aTempRec[16]; /* Space to hold a transient UnpackedRecord */ + assert( p->magic==VDBE_MAGIC_RUN ); /* sqlite3_step() verifies this */ assert( db->magic==SQLITE_MAGIC_BUSY ); sqlite3BtreeMutexArrayEnter(&p->aMutex); if( p->rc==SQLITE_NOMEM ){ @@ -798,33 +777,36 @@ ** ** Jump to the next instruction after the address in register P1. */ case OP_Return: { /* in1 */ assert( pIn1->flags & MEM_Int ); - pc = (int)pIn1->u.i; + pc = pIn1->u.i; break; } /* Opcode: Yield P1 * * * * ** ** Swap the program counter with the value in register P1. */ -case OP_Yield: { /* in1 */ +case OP_Yield: { int pcDest; + assert( pOp->p1>0 ); + assert( pOp->p1<=p->nMem ); + pIn1 = &p->aMem[pOp->p1]; assert( (pIn1->flags & MEM_Dyn)==0 ); pIn1->flags = MEM_Int; - pcDest = (int)pIn1->u.i; + pcDest = pIn1->u.i; pIn1->u.i = pc; REGISTER_TRACE(pOp->p1, pIn1); pc = pcDest; break; } /* Opcode: Halt P1 P2 * P4 * ** -** Exit immediately. All open cursors, etc are closed +** Exit immediately. All open cursors, Fifos, etc are closed ** automatically. ** ** P1 is the result code returned by sqlite3_exec(), sqlite3_reset(), ** or sqlite3_finalize(). For a normal halt, this should be SQLITE_OK (0). ** For errors, it can be some other value. If P1!=0 then P2 will determine @@ -896,11 +878,11 @@ ** into an OP_String before it is executed for the first time. */ case OP_String8: { /* same as TK_STRING, out2-prerelease */ assert( pOp->p4.z!=0 ); pOp->opcode = OP_String; - pOp->p1 = sqlite3Strlen30(pOp->p4.z); + pOp->p1 = strlen(pOp->p4.z); #ifndef SQLITE_OMIT_UTF16 if( encoding!=SQLITE_UTF8 ){ sqlite3VdbeMemSetStr(pOut, pOp->p4.z, -1, SQLITE_UTF8, SQLITE_STATIC); if( SQLITE_OK!=sqlite3VdbeChangeEncoding(pOut, encoding) ) goto no_mem; @@ -948,10 +930,11 @@ case OP_Null: { /* out2-prerelease */ break; } +#ifndef SQLITE_OMIT_BLOB_LITERAL /* Opcode: Blob P1 P2 * P4 ** ** P4 points to a blob of data P1 bytes long. Store this ** blob in register P2. This instruction is not coded directly ** by the compiler. Instead, the compiler layer specifies @@ -964,10 +947,11 @@ sqlite3VdbeMemSetStr(pOut, pOp->p4.z, pOp->p1, 0, 0); pOut->enc = encoding; UPDATE_MAX_BLOBSIZE(pOut); break; } +#endif /* SQLITE_OMIT_BLOB_LITERAL */ /* Opcode: Variable P1 P2 * * * ** ** The value of variable P1 is written into register P2. A variable is ** an unknown in the original SQL string as handed to sqlite3_compile(). @@ -1027,11 +1011,14 @@ ** Make a copy of register P1 into register P2. ** ** This instruction makes a deep copy of the value. A duplicate ** is made of any string or blob constant. See also OP_SCopy. */ -case OP_Copy: { /* in1 */ +case OP_Copy: { + assert( pOp->p1>0 ); + assert( pOp->p1<=p->nMem ); + pIn1 = &p->aMem[pOp->p1]; assert( pOp->p2>0 ); assert( pOp->p2<=p->nMem ); pOut = &p->aMem[pOp->p2]; assert( pOut!=pIn1 ); sqlite3VdbeMemShallowCopy(pOut, pIn1, MEM_Ephem); @@ -1050,11 +1037,14 @@ ** Worse, if the original is deallocated, the copy becomes invalid. ** Thus the program must guarantee that the original will not change ** during the lifetime of the copy. Use OP_Copy to make a complete ** copy. */ -case OP_SCopy: { /* in1 */ +case OP_SCopy: { + assert( pOp->p1>0 ); + assert( pOp->p1<=p->nMem ); + pIn1 = &p->aMem[pOp->p1]; REGISTER_TRACE(pOp->p1, pIn1); assert( pOp->p2>0 ); assert( pOp->p2<=p->nMem ); pOut = &p->aMem[pOp->p2]; assert( pOut!=pIn1 ); @@ -1128,21 +1118,21 @@ nByte = pIn1->n + pIn2->n; if( nByte>db->aLimit[SQLITE_LIMIT_LENGTH] ){ goto too_big; } MemSetTypeFlag(pOut, MEM_Str); - if( sqlite3VdbeMemGrow(pOut, (int)nByte+2, pOut==pIn2) ){ + if( sqlite3VdbeMemGrow(pOut, nByte+2, pOut==pIn2) ){ goto no_mem; } if( pOut!=pIn2 ){ memcpy(pOut->z, pIn2->z, pIn2->n); } memcpy(&pOut->z[pIn2->n], pIn1->z, pIn1->n); pOut->z[nByte] = 0; pOut->z[nByte+1] = 0; pOut->flags |= MEM_Term; - pOut->n = (int)nByte; + pOut->n = nByte; pOut->enc = encoding; UPDATE_MAX_BLOBSIZE(pOut); break; } @@ -1226,21 +1216,20 @@ switch( pOp->opcode ){ case OP_Add: b += a; break; case OP_Subtract: b -= a; break; case OP_Multiply: b *= a; break; case OP_Divide: { - /* (double)0 In case of SQLITE_OMIT_FLOATING_POINT... */ - if( a==(double)0 ) goto arithmetic_result_is_null; + if( a==0.0 ) goto arithmetic_result_is_null; b /= a; break; } default: { i64 ia = (i64)a; i64 ib = (i64)b; if( ia==0 ) goto arithmetic_result_is_null; if( ia==-1 ) ia = 1; - b = (double)(ib % ia); + b = ib % ia; break; } } if( sqlite3IsNaN(b) ){ goto arithmetic_result_is_null; @@ -1445,10 +1434,40 @@ case OP_AddImm: { /* in1 */ sqlite3VdbeMemIntegerify(pIn1); pIn1->u.i += pOp->p2; break; } + +/* Opcode: ForceInt P1 P2 P3 * * +** +** Convert value in register P1 into an integer. If the value +** in P1 is not numeric (meaning that is is a NULL or a string that +** does not look like an integer or floating point number) then +** jump to P2. If the value in P1 is numeric then +** convert it into the least integer that is greater than or equal to its +** current value if P3==0, or to the least integer that is strictly +** greater than its current value if P3==1. +*/ +case OP_ForceInt: { /* jump, in1 */ + i64 v; + applyAffinity(pIn1, SQLITE_AFF_NUMERIC, encoding); + if( (pIn1->flags & (MEM_Int|MEM_Real))==0 ){ + pc = pOp->p2 - 1; + break; + } + if( pIn1->flags & MEM_Int ){ + v = pIn1->u.i + (pOp->p3!=0); + }else{ + assert( pIn1->flags & MEM_Real ); + v = (sqlite3_int64)pIn1->r; + if( pIn1->r>(double)v ) v++; + if( pOp->p3 && pIn1->r==(double)v ) v++; + } + pIn1->u.i = v; + MemSetTypeFlag(pIn1, MEM_Int); + break; +} /* Opcode: MustBeInt P1 P2 * * * ** ** Force the value in register P1 to be an integer. If the value ** in P1 is not an integer and cannot be converted into an integer @@ -1501,11 +1520,11 @@ assert( MEM_Str==(MEM_Blob>>3) ); pIn1->flags |= (pIn1->flags&MEM_Blob)>>3; applyAffinity(pIn1, SQLITE_AFF_TEXT, encoding); rc = ExpandBlob(pIn1); assert( pIn1->flags & MEM_Str || db->mallocFailed ); - pIn1->flags &= ~(MEM_Int|MEM_Real|MEM_Blob|MEM_Zero); + pIn1->flags &= ~(MEM_Int|MEM_Real|MEM_Blob); UPDATE_MAX_BLOBSIZE(pIn1); break; } /* Opcode: ToBlob P1 * * * * @@ -1520,14 +1539,12 @@ case OP_ToBlob: { /* same as TK_TO_BLOB, in1 */ if( pIn1->flags & MEM_Null ) break; if( (pIn1->flags & MEM_Blob)==0 ){ applyAffinity(pIn1, SQLITE_AFF_TEXT, encoding); assert( pIn1->flags & MEM_Str || db->mallocFailed ); - MemSetTypeFlag(pIn1, MEM_Blob); - }else{ - pIn1->flags &= ~(MEM_TypeMask&~MEM_Blob); } + MemSetTypeFlag(pIn1, MEM_Blob); UPDATE_MAX_BLOBSIZE(pIn1); break; } /* Opcode: ToNumeric P1 * * * * @@ -1670,11 +1687,10 @@ affinity = pOp->p5 & SQLITE_AFF_MASK; if( affinity ){ applyAffinity(pIn1, affinity, encoding); applyAffinity(pIn3, affinity, encoding); - if( db->mallocFailed ) goto no_mem; } assert( pOp->p4type==P4_COLLSEQ || pOp->p4.pColl==0 ); ExpandBlob(pIn1); ExpandBlob(pIn3); @@ -1821,39 +1837,35 @@ MemSetTypeFlag(pOut, MEM_Int); } break; } -/* Opcode: Not P1 P2 * * * +/* Opcode: Not P1 * * * * ** -** Interpret the value in register P1 as a boolean value. Store the -** boolean complement in register P2. If the value in register P1 is -** NULL, then a NULL is stored in P2. +** Interpret the value in register P1 as a boolean value. Replace it +** with its complement. If the value in register P1 is NULL its value +** is unchanged. */ case OP_Not: { /* same as TK_NOT, in1 */ - pOut = &p->aMem[pOp->p2]; - if( pIn1->flags & MEM_Null ){ - sqlite3VdbeMemSetNull(pOut); - }else{ - sqlite3VdbeMemSetInt64(pOut, !sqlite3VdbeIntValue(pIn1)); - } + if( pIn1->flags & MEM_Null ) break; /* Do nothing to NULLs */ + sqlite3VdbeMemIntegerify(pIn1); + pIn1->u.i = !pIn1->u.i; + assert( pIn1->flags&MEM_Int ); break; } -/* Opcode: BitNot P1 P2 * * * +/* Opcode: BitNot P1 * * * * ** -** Interpret the content of register P1 as an integer. Store the -** ones-complement of the P1 value into register P2. If P1 holds -** a NULL then store a NULL in P2. +** Interpret the content of register P1 as an integer. Replace it +** with its ones-complement. If the value is originally NULL, leave +** it unchanged. */ case OP_BitNot: { /* same as TK_BITNOT, in1 */ - pOut = &p->aMem[pOp->p2]; - if( pIn1->flags & MEM_Null ){ - sqlite3VdbeMemSetNull(pOut); - }else{ - sqlite3VdbeMemSetInt64(pOut, ~sqlite3VdbeIntValue(pIn1)); - } + if( pIn1->flags & MEM_Null ) break; /* Do nothing to NULLs */ + sqlite3VdbeMemIntegerify(pIn1); + pIn1->u.i = ~pIn1->u.i; + assert( pIn1->flags&MEM_Int ); break; } /* Opcode: If P1 P2 P3 * * ** @@ -1872,11 +1884,11 @@ int c; if( pIn1->flags & MEM_Null ){ c = pOp->p3; }else{ #ifdef SQLITE_OMIT_FLOATING_POINT - c = sqlite3VdbeIntValue(pIn1)!=0; + c = sqlite3VdbeIntValue(pIn1); #else c = sqlite3VdbeRealValue(pIn1)!=0.0; #endif if( pOp->opcode==OP_IfNot ) c = !c; } @@ -1943,32 +1955,37 @@ ** information about the format of the data.) Extract the P2-th column ** from this record. If there are less that (P2+1) ** values in the record, extract a NULL. ** ** The value extracted is stored in register P3. +** +** If the KeyAsData opcode has previously executed on this cursor, then the +** field might be extracted from the key rather than the data. ** ** If the column contains fewer than P2 fields, then extract a NULL. Or, ** if the P4 argument is a P4_MEM use the value of the P4 argument as ** the result. */ case OP_Column: { - int payloadSize; /* Number of bytes in the record */ + u32 payloadSize; /* Number of bytes in the record */ int p1 = pOp->p1; /* P1 value of the opcode */ int p2 = pOp->p2; /* column number to retrieve */ - VdbeCursor *pC = 0;/* The VDBE cursor */ + Cursor *pC = 0; /* The VDBE cursor */ char *zRec; /* Pointer to complete record-data */ BtCursor *pCrsr; /* The BTree cursor */ u32 *aType; /* aType[i] holds the numeric type of the i-th column */ u32 *aOffset; /* aOffset[i] is offset to start of data for i-th column */ - int nField; /* number of fields in the record */ + u32 nField; /* number of fields in the record */ int len; /* The length of the serialized data for the column */ int i; /* Loop counter */ char *zData; /* Part of the record being decoded */ Mem *pDest; /* Where to write the extracted value */ Mem sMem; /* For storing the record being decoded */ - memset(&sMem, 0, sizeof(sMem)); + sMem.flags = 0; + sMem.db = 0; + sMem.zMalloc = 0; assert( p1nCursor ); assert( pOp->p3>0 && pOp->p3<=p->nMem ); pDest = &p->aMem[pOp->p3]; MemSetTypeFlag(pDest, MEM_Null); @@ -1980,11 +1997,11 @@ ** If the record is stored in a cursor, the complete record text ** might be available in the pC->aRow cache. Or it might not be. ** If the data is unavailable, zRec is set to NULL. ** ** We also compute the number of columns in the record. For cursors, - ** the number of columns is stored in the VdbeCursor.nField element. + ** the number of columns is stored in the Cursor.nField element. */ pC = p->apCsr[p1]; assert( pC!=0 ); #ifndef SQLITE_OMIT_VIRTUALTABLE assert( pC->pVtabCursor==0 ); @@ -2001,13 +2018,13 @@ payloadSize = pC->payloadSize; zRec = (char*)pC->aRow; }else if( pC->isIndex ){ i64 payloadSize64; sqlite3BtreeKeySize(pCrsr, &payloadSize64); - payloadSize = (int)payloadSize64; + payloadSize = payloadSize64; }else{ - sqlite3BtreeDataSize(pCrsr, (u32 *)&payloadSize); + sqlite3BtreeDataSize(pCrsr, &payloadSize); } nField = pC->nField; }else{ assert( pC->pseudoTable ); /* The record is the sole entry of a pseudo-table */ @@ -2037,13 +2054,13 @@ if( pC->cacheStatus==p->cacheCtr ){ aOffset = pC->aOffset; }else{ u8 *zIdx; /* Index into header */ u8 *zEndHdr; /* Pointer to first byte after the header */ - int offset; /* Offset into the data */ + u32 offset; /* Offset into the data */ int szHdrSz; /* Size of the header size field at start of record */ - int avail = 0; /* Number of bytes of available data */ + int avail; /* Number of bytes of available data */ assert(aType); pC->aOffset = aOffset = &aType[nField]; pC->payloadSize = payloadSize; pC->cacheStatus = p->cacheCtr; @@ -2238,11 +2255,11 @@ */ u8 *zNewRecord; /* A buffer to hold the data for the new record */ Mem *pRec; /* The new record */ u64 nData = 0; /* Number of bytes of data space */ int nHdr = 0; /* Number of bytes of header space */ - i64 nByte = 0; /* Data space required for this record */ + u64 nByte = 0; /* Data space required for this record */ int nZero = 0; /* Number of zero bytes at the end of the record */ int nVarint; /* Number of bytes in a varint */ u32 serial_type; /* Type field */ Mem *pData0; /* First field to be combined into the record */ Mem *pLast; /* Last field of the record */ @@ -2275,11 +2292,11 @@ nData += len; nHdr += sqlite3VarintLen(serial_type); if( pRec->flags & MEM_Zero ){ /* Only pure zero-filled BLOBs can be input to this Opcode. ** We do not allow blobs with a prefix and a zero-filled tail. */ - nZero += pRec->u.nZero; + nZero += pRec->u.i; }else if( len ){ nZero = 0; } } @@ -2298,11 +2315,11 @@ ** be one of the input registers (because the following call to ** sqlite3VdbeMemGrow() could clobber the value before it is used). */ assert( pOp->p3p1 || pOp->p3>=pOp->p1+pOp->p2 ); pOut = &p->aMem[pOp->p3]; - if( sqlite3VdbeMemGrow(pOut, (int)nByte, 0) ){ + if( sqlite3VdbeMemGrow(pOut, nByte, 0) ){ goto no_mem; } zNewRecord = (u8 *)pOut->z; /* Write the record */ @@ -2310,20 +2327,20 @@ for(pRec=pData0; pRec<=pLast; pRec++){ serial_type = sqlite3VdbeSerialType(pRec, file_format); i += putVarint32(&zNewRecord[i], serial_type); /* serial type */ } for(pRec=pData0; pRec<=pLast; pRec++){ /* serial data */ - i += sqlite3VdbeSerialPut(&zNewRecord[i], (int)(nByte-i), pRec,file_format); + i += sqlite3VdbeSerialPut(&zNewRecord[i], nByte-i, pRec, file_format); } assert( i==nByte ); assert( pOp->p3>0 && pOp->p3<=p->nMem ); - pOut->n = (int)nByte; + pOut->n = nByte; pOut->flags = MEM_Blob | MEM_Dyn; pOut->xDel = 0; if( nZero ){ - pOut->u.nZero = nZero; + pOut->u.i = nZero; pOut->flags |= MEM_Zero; } pOut->enc = SQLITE_UTF8; /* In case the blob is ever converted to text */ REGISTER_TRACE(pOp->p3, pOut); UPDATE_MAX_BLOBSIZE(pOut); @@ -2367,201 +2384,59 @@ } } break; } -/* Opcode: Savepoint P1 * * P4 * -** -** Open, release or rollback the savepoint named by parameter P4, depending -** on the value of P1. To open a new savepoint, P1==0. To release (commit) an -** existing savepoint, P1==1, or to rollback an existing savepoint P1==2. -*/ -case OP_Savepoint: { - int p1 = pOp->p1; - char *zName = pOp->p4.z; /* Name of savepoint */ - - /* Assert that the p1 parameter is valid. Also that if there is no open - ** transaction, then there cannot be any savepoints. - */ - assert( db->pSavepoint==0 || db->autoCommit==0 ); - assert( p1==SAVEPOINT_BEGIN||p1==SAVEPOINT_RELEASE||p1==SAVEPOINT_ROLLBACK ); - assert( db->pSavepoint || db->isTransactionSavepoint==0 ); - assert( checkSavepointCount(db) ); - - if( p1==SAVEPOINT_BEGIN ){ - if( db->writeVdbeCnt>0 ){ - /* A new savepoint cannot be created if there are active write - ** statements (i.e. open read/write incremental blob handles). - */ - sqlite3SetString(&p->zErrMsg, db, "cannot open savepoint - " - "SQL statements in progress"); - rc = SQLITE_BUSY; - }else{ - int nName = sqlite3Strlen30(zName); - Savepoint *pNew; - - /* Create a new savepoint structure. */ - pNew = sqlite3DbMallocRaw(db, sizeof(Savepoint)+nName+1); - if( pNew ){ - pNew->zName = (char *)&pNew[1]; - memcpy(pNew->zName, zName, nName+1); - - /* If there is no open transaction, then mark this as a special - ** "transaction savepoint". */ - if( db->autoCommit ){ - db->autoCommit = 0; - db->isTransactionSavepoint = 1; - }else{ - db->nSavepoint++; - } - - /* Link the new savepoint into the database handle's list. */ - pNew->pNext = db->pSavepoint; - db->pSavepoint = pNew; - } - } - }else{ - Savepoint *pSavepoint; - int iSavepoint = 0; - - /* Find the named savepoint. If there is no such savepoint, then an - ** an error is returned to the user. */ - for( - pSavepoint=db->pSavepoint; - pSavepoint && sqlite3StrICmp(pSavepoint->zName, zName); - pSavepoint=pSavepoint->pNext - ){ - iSavepoint++; - } - if( !pSavepoint ){ - sqlite3SetString(&p->zErrMsg, db, "no such savepoint: %s", zName); - rc = SQLITE_ERROR; - }else if( - db->writeVdbeCnt>0 || (p1==SAVEPOINT_ROLLBACK && db->activeVdbeCnt>1) - ){ - /* It is not possible to release (commit) a savepoint if there are - ** active write statements. It is not possible to rollback a savepoint - ** if there are any active statements at all. - */ - sqlite3SetString(&p->zErrMsg, db, - "cannot %s savepoint - SQL statements in progress", - (p1==SAVEPOINT_ROLLBACK ? "rollback": "release") - ); - rc = SQLITE_BUSY; - }else{ - - /* Determine whether or not this is a transaction savepoint. If so, - ** and this is a RELEASE command, then the current transaction - ** is committed. - */ - int isTransaction = pSavepoint->pNext==0 && db->isTransactionSavepoint; - if( isTransaction && p1==SAVEPOINT_RELEASE ){ - db->autoCommit = 1; - if( sqlite3VdbeHalt(p)==SQLITE_BUSY ){ - p->pc = pc; - db->autoCommit = 0; - p->rc = rc = SQLITE_BUSY; - goto vdbe_return; - } - db->isTransactionSavepoint = 0; - rc = p->rc; - }else{ - int ii; - iSavepoint = db->nSavepoint - iSavepoint - 1; - for(ii=0; iinDb; ii++){ - rc = sqlite3BtreeSavepoint(db->aDb[ii].pBt, p1, iSavepoint); - if( rc!=SQLITE_OK ){ - goto abort_due_to_error; - } - } - if( p1==SAVEPOINT_ROLLBACK && (db->flags&SQLITE_InternChanges)!=0 ){ - sqlite3ExpirePreparedStatements(db); - sqlite3ResetInternalSchema(db, 0); - } - } - - /* Regardless of whether this is a RELEASE or ROLLBACK, destroy all - ** savepoints nested inside of the savepoint being operated on. */ - while( db->pSavepoint!=pSavepoint ){ - Savepoint *pTmp = db->pSavepoint; - db->pSavepoint = pTmp->pNext; - sqlite3DbFree(db, pTmp); - db->nSavepoint--; - } - - /* If it is a RELEASE, then destroy the savepoint being operated on too */ - if( p1==SAVEPOINT_RELEASE ){ - assert( pSavepoint==db->pSavepoint ); - db->pSavepoint = pSavepoint->pNext; - sqlite3DbFree(db, pSavepoint); - if( !isTransaction ){ - db->nSavepoint--; - } - } - } - } - - break; -} - /* Opcode: AutoCommit P1 P2 * * * ** ** Set the database auto-commit flag to P1 (1 or 0). If P2 is true, roll ** back any currently active btree transactions. If there are any active ** VMs (apart from this one), then the COMMIT or ROLLBACK statement fails. ** ** This instruction causes the VM to halt. */ case OP_AutoCommit: { - int desiredAutoCommit = pOp->p1; - int rollback = pOp->p2; - int turnOnAC = desiredAutoCommit && !db->autoCommit; + u8 i = pOp->p1; + u8 rollback = pOp->p2; - assert( desiredAutoCommit==1 || desiredAutoCommit==0 ); - assert( desiredAutoCommit==1 || rollback==0 ); + assert( i==1 || i==0 ); + assert( i==1 || rollback==0 ); assert( db->activeVdbeCnt>0 ); /* At least this one VM is active */ - if( turnOnAC && rollback && db->activeVdbeCnt>1 ){ - /* If this instruction implements a ROLLBACK and other VMs are + if( db->activeVdbeCnt>1 && i && !db->autoCommit ){ + /* If this instruction implements a COMMIT or ROLLBACK, other VMs are ** still running, and a transaction is active, return an error indicating ** that the other VMs must complete first. */ - sqlite3SetString(&p->zErrMsg, db, "cannot rollback transaction - " - "SQL statements in progress"); - rc = SQLITE_BUSY; - }else if( turnOnAC && !rollback && db->writeVdbeCnt>1 ){ - /* If this instruction implements a COMMIT and other VMs are writing - ** return an error indicating that the other VMs must complete first. - */ - sqlite3SetString(&p->zErrMsg, db, "cannot commit transaction - " - "SQL statements in progress"); - rc = SQLITE_BUSY; - }else if( desiredAutoCommit!=db->autoCommit ){ - if( rollback ){ - assert( desiredAutoCommit==1 ); + sqlite3SetString(&p->zErrMsg, db, "cannot %s transaction - " + "SQL statements in progress", + rollback ? "rollback" : "commit"); + rc = SQLITE_ERROR; + }else if( i!=db->autoCommit ){ + if( pOp->p2 ){ + assert( i==1 ); sqlite3RollbackAll(db); db->autoCommit = 1; }else{ - db->autoCommit = (u8)desiredAutoCommit; + db->autoCommit = i; if( sqlite3VdbeHalt(p)==SQLITE_BUSY ){ p->pc = pc; - db->autoCommit = (u8)(1-desiredAutoCommit); + db->autoCommit = 1-i; p->rc = rc = SQLITE_BUSY; goto vdbe_return; } } - sqlite3CloseSavepoints(db); if( p->rc==SQLITE_OK ){ rc = SQLITE_DONE; }else{ rc = SQLITE_ERROR; } goto vdbe_return; }else{ sqlite3SetString(&p->zErrMsg, db, - (!desiredAutoCommit)?"cannot start a transaction within a transaction":( + (!i)?"cannot start a transaction within a transaction":( (rollback)?"cannot rollback - no transaction is active": "cannot commit - no transaction is active")); rc = SQLITE_ERROR; } @@ -2675,15 +2550,15 @@ sqlite3VdbeMemIntegerify(pIn3); /* See note about index shifting on OP_ReadCookie */ rc = sqlite3BtreeUpdateMeta(pDb->pBt, 1+pOp->p2, (int)pIn3->u.i); if( pOp->p2==0 ){ /* When the schema cookie changes, record the new cookie internally */ - pDb->pSchema->schema_cookie = (int)pIn3->u.i; + pDb->pSchema->schema_cookie = pIn3->u.i; db->flags |= SQLITE_InternChanges; }else if( pOp->p2==1 ){ /* Record changes in the file format */ - pDb->pSchema->file_format = (u8)pIn3->u.i; + pDb->pSchema->file_format = pIn3->u.i; } if( pOp->p1==1 ){ /* Invalidate all prepared statements whenever the TEMP database ** schema is changed. Ticket #1644 */ sqlite3ExpirePreparedStatements(db); @@ -2794,11 +2669,11 @@ int i = pOp->p1; int p2 = pOp->p2; int iDb = pOp->p3; int wrFlag; Btree *pX; - VdbeCursor *pCur; + Cursor *pCur; Db *pDb; assert( iDb>=0 && iDbnDb ); assert( (p->btreeMask & (1<aDb[iDb]; @@ -2815,15 +2690,12 @@ if( pOp->p5 ){ assert( p2>0 ); assert( p2<=p->nMem ); pIn2 = &p->aMem[p2]; sqlite3VdbeMemIntegerify(pIn2); - p2 = (int)pIn2->u.i; - if( p2<2 ) { - rc = SQLITE_CORRUPT_BKPT; - goto abort_due_to_error; - } + p2 = pIn2->u.i; + assert( p2>=2 ); } assert( i>=0 ); pCur = allocateCursor(p, i, &pOp[-1], iDb, 1); if( pCur==0 ) goto no_mem; pCur->nullRow = 1; @@ -2850,12 +2722,12 @@ */ if( (flags & 0xf0)!=0 || ((flags & 0x07)!=5 && (flags & 0x07)!=2) ){ rc = SQLITE_CORRUPT_BKPT; goto abort_due_to_error; } - pCur->isTable = (flags & BTREE_INTKEY)!=0 ?1:0; - pCur->isIndex = (flags & BTREE_ZERODATA)!=0 ?1:0; + pCur->isTable = (flags & BTREE_INTKEY)!=0; + pCur->isIndex = (flags & BTREE_ZERODATA)!=0; /* If P4==0 it means we are expected to open a table. If P4!=0 then ** we expect to be opening an index. If this is not what happened, ** then the database is corrupt */ if( (pCur->isTable && pOp->p4type==P4_KEYINFO) @@ -2897,11 +2769,11 @@ ** this opcode. Then this opcode was call OpenVirtual. But ** that created confusion with the whole virtual-table idea. */ case OP_OpenEphemeral: { int i = pOp->p1; - VdbeCursor *pCx; + Cursor *pCx; static const int openFlags = SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_EXCLUSIVE | SQLITE_OPEN_DELETEONCLOSE | @@ -2963,17 +2835,17 @@ ** memory cell containing the row data is not overwritten until the ** pseudo table is closed (or a new row is inserted into it). */ case OP_OpenPseudo: { int i = pOp->p1; - VdbeCursor *pCx; + Cursor *pCx; assert( i>=0 ); pCx = allocateCursor(p, i, &pOp[-1], -1, 0); if( pCx==0 ) goto no_mem; pCx->nullRow = 1; pCx->pseudoTable = 1; - pCx->ephemPseudoTable = (u8)pOp->p2; + pCx->ephemPseudoTable = pOp->p2; pCx->isTable = 1; pCx->isIndex = 0; break; } @@ -2988,144 +2860,106 @@ sqlite3VdbeFreeCursor(p, p->apCsr[i]); p->apCsr[i] = 0; break; } -/* Opcode: SeekGe P1 P2 P3 P4 * +/* Opcode: MoveGe P1 P2 P3 P4 * ** ** If cursor P1 refers to an SQL table (B-Tree that uses integer keys), -** use the value in register P3 as the key. If cursor P1 refers +** use the integer value in register P3 as a key. If cursor P1 refers ** to an SQL index, then P3 is the first in an array of P4 registers ** that are used as an unpacked index key. ** ** Reposition cursor P1 so that it points to the smallest entry that ** is greater than or equal to the key value. If there are no records ** greater than or equal to the key and P2 is not zero, then jump to P2. ** -** See also: Found, NotFound, Distinct, SeekLt, SeekGt, SeekLe +** A special feature of this opcode (and different from the +** related OP_MoveGt, OP_MoveLt, and OP_MoveLe) is that if P2 is +** zero and P1 is an SQL table (a b-tree with integer keys) then +** the seek is deferred until it is actually needed. It might be +** the case that the cursor is never accessed. By deferring the +** seek, we avoid unnecessary seeks. +** +** See also: Found, NotFound, Distinct, MoveLt, MoveGt, MoveLe */ -/* Opcode: SeekGt P1 P2 P3 P4 * +/* Opcode: MoveGt P1 P2 P3 P4 * ** ** If cursor P1 refers to an SQL table (B-Tree that uses integer keys), -** use the value in register P3 as a key. If cursor P1 refers +** use the integer value in register P3 as a key. If cursor P1 refers ** to an SQL index, then P3 is the first in an array of P4 registers ** that are used as an unpacked index key. ** ** Reposition cursor P1 so that it points to the smallest entry that ** is greater than the key value. If there are no records greater than ** the key and P2 is not zero, then jump to P2. ** -** See also: Found, NotFound, Distinct, SeekLt, SeekGe, SeekLe +** See also: Found, NotFound, Distinct, MoveLt, MoveGe, MoveLe */ -/* Opcode: SeekLt P1 P2 P3 P4 * +/* Opcode: MoveLt P1 P2 P3 P4 * ** ** If cursor P1 refers to an SQL table (B-Tree that uses integer keys), -** use the value in register P3 as a key. If cursor P1 refers +** use the integer value in register P3 as a key. If cursor P1 refers ** to an SQL index, then P3 is the first in an array of P4 registers ** that are used as an unpacked index key. ** ** Reposition cursor P1 so that it points to the largest entry that ** is less than the key value. If there are no records less than ** the key and P2 is not zero, then jump to P2. ** -** See also: Found, NotFound, Distinct, SeekGt, SeekGe, SeekLe +** See also: Found, NotFound, Distinct, MoveGt, MoveGe, MoveLe */ -/* Opcode: SeekLe P1 P2 P3 P4 * +/* Opcode: MoveLe P1 P2 P3 P4 * ** ** If cursor P1 refers to an SQL table (B-Tree that uses integer keys), -** use the value in register P3 as a key. If cursor P1 refers +** use the integer value in register P3 as a key. If cursor P1 refers ** to an SQL index, then P3 is the first in an array of P4 registers ** that are used as an unpacked index key. ** ** Reposition cursor P1 so that it points to the largest entry that ** is less than or equal to the key value. If there are no records ** less than or equal to the key and P2 is not zero, then jump to P2. ** -** See also: Found, NotFound, Distinct, SeekGt, SeekGe, SeekLt +** See also: Found, NotFound, Distinct, MoveGt, MoveGe, MoveLt */ -case OP_SeekLt: /* jump, in3 */ -case OP_SeekLe: /* jump, in3 */ -case OP_SeekGe: /* jump, in3 */ -case OP_SeekGt: { /* jump, in3 */ +case OP_MoveLt: /* jump, in3 */ +case OP_MoveLe: /* jump, in3 */ +case OP_MoveGe: /* jump, in3 */ +case OP_MoveGt: { /* jump, in3 */ int i = pOp->p1; - VdbeCursor *pC; + Cursor *pC; assert( i>=0 && inCursor ); - assert( pOp->p2!=0 ); pC = p->apCsr[i]; assert( pC!=0 ); if( pC->pCursor!=0 ){ int res, oc; oc = pOp->opcode; pC->nullRow = 0; if( pC->isTable ){ - i64 iKey; /* The rowid we are to seek to */ - - /* The input value in P3 might be of any type: integer, real, string, - ** blob, or NULL. But it needs to be an integer before we can do - ** the seek, so covert it. */ - applyNumericAffinity(pIn3); - iKey = sqlite3VdbeIntValue(pIn3); - pC->rowidIsValid = 0; - - /* If the P3 value could not be converted into an integer without - ** loss of information, then special processing is required... */ - if( (pIn3->flags & MEM_Int)==0 ){ - if( (pIn3->flags & MEM_Real)==0 ){ - /* If the P3 value cannot be converted into any kind of a number, - ** then the seek is not possible, so jump to P2 */ - pc = pOp->p2 - 1; - break; - } - /* If we reach this point, then the P3 value must be a floating - ** point number. */ - assert( (pIn3->flags & MEM_Real)!=0 ); - - if( iKey==SMALLEST_INT64 && (pIn3->r<(double)iKey || pIn3->r>0) ){ - /* The P3 value is to large in magnitude to be expressed as an - ** integer. */ - res = 1; - if( pIn3->r<0 ){ - if( oc==OP_SeekGt || oc==OP_SeekGe ){ - rc = sqlite3BtreeFirst(pC->pCursor, &res); - if( rc!=SQLITE_OK ) goto abort_due_to_error; - } - }else{ - if( oc==OP_SeekLt || oc==OP_SeekLe ){ - rc = sqlite3BtreeLast(pC->pCursor, &res); - if( rc!=SQLITE_OK ) goto abort_due_to_error; - } - } - if( res ){ - pc = pOp->p2 - 1; - } - break; - }else if( oc==OP_SeekLt || oc==OP_SeekGe ){ - /* Use the ceiling() function to convert real->int */ - if( pIn3->r > (double)iKey ) iKey++; - }else{ - /* Use the floor() function to convert real->int */ - assert( oc==OP_SeekLe || oc==OP_SeekGt ); - if( pIn3->r < (double)iKey ) iKey--; - } - } + i64 iKey = sqlite3VdbeIntValue(pIn3); + if( pOp->p2==0 ){ + assert( pOp->opcode==OP_MoveGe ); + pC->movetoTarget = iKey; + pC->rowidIsValid = 0; + pC->deferredMoveto = 1; + break; + } rc = sqlite3BtreeMovetoUnpacked(pC->pCursor, 0, (u64)iKey, 0, &res); if( rc!=SQLITE_OK ){ goto abort_due_to_error; } - if( res==0 ){ - pC->rowidIsValid = 1; - pC->lastRowid = iKey; - } + pC->lastRowid = iKey; + pC->rowidIsValid = res==0; }else{ UnpackedRecord r; int nField = pOp->p4.i; assert( pOp->p4type==P4_INT32 ); assert( nField>0 ); r.pKeyInfo = pC->pKeyInfo; - r.nField = (u16)nField; - if( oc==OP_SeekGt || oc==OP_SeekLe ){ + r.nField = nField; + if( oc==OP_MoveGt || oc==OP_MoveLe ){ r.flags = UNPACKED_INCRKEY; }else{ r.flags = 0; } r.aMem = &p->aMem[pOp->p3]; @@ -3138,21 +2972,21 @@ pC->deferredMoveto = 0; pC->cacheStatus = CACHE_STALE; #ifdef SQLITE_TEST sqlite3_search_count++; #endif - if( oc==OP_SeekGe || oc==OP_SeekGt ){ - if( res<0 || (res==0 && oc==OP_SeekGt) ){ + if( oc==OP_MoveGe || oc==OP_MoveGt ){ + if( res<0 ){ rc = sqlite3BtreeNext(pC->pCursor, &res); if( rc!=SQLITE_OK ) goto abort_due_to_error; pC->rowidIsValid = 0; }else{ res = 0; } }else{ - assert( oc==OP_SeekLt || oc==OP_SeekLe ); - if( res>0 || (res==0 && oc==OP_SeekLt) ){ + assert( oc==OP_MoveLt || oc==OP_MoveLe ); + if( res>=0 ){ rc = sqlite3BtreePrevious(pC->pCursor, &res); if( rc!=SQLITE_OK ) goto abort_due_to_error; pC->rowidIsValid = 0; }else{ /* res might be negative because the table is empty. Check to @@ -3173,37 +3007,10 @@ pc = pOp->p2 - 1; } break; } -/* Opcode: Seek P1 P2 * * * -** -** P1 is an open table cursor and P2 is a rowid integer. Arrange -** for P1 to move so that it points to the rowid given by P2. -** -** This is actually a deferred seek. Nothing actually happens until -** the cursor is used to read a record. That way, if no reads -** occur, no unnecessary I/O happens. -*/ -case OP_Seek: { /* in2 */ - int i = pOp->p1; - VdbeCursor *pC; - - assert( i>=0 && inCursor ); - pC = p->apCsr[i]; - assert( pC!=0 ); - if( pC->pCursor!=0 ){ - assert( pC->isTable ); - pC->nullRow = 0; - pC->movetoTarget = sqlite3VdbeIntValue(pIn2); - pC->rowidIsValid = 0; - pC->deferredMoveto = 1; - } - break; -} - - /* Opcode: Found P1 P2 P3 * * ** ** Register P3 holds a blob constructed by MakeRecord. P1 is an index. ** If an entry that matches the value in register p3 exists in P1 then ** jump to P2. If the P3 value does not match any entry in P1 @@ -3234,11 +3041,11 @@ */ case OP_NotFound: /* jump, in3 */ case OP_Found: { /* jump, in3 */ int i = pOp->p1; int alreadyExists = 0; - VdbeCursor *pC; + Cursor *pC; assert( i>=0 && inCursor ); assert( p->apCsr[i]!=0 ); if( (pC = p->apCsr[i])->pCursor!=0 ){ int res; UnpackedRecord *pIdxKey; @@ -3290,11 +3097,11 @@ ** ** See also: NotFound, NotExists, Found */ case OP_IsUnique: { /* jump, in3 */ int i = pOp->p1; - VdbeCursor *pCx; + Cursor *pCx; BtCursor *pCrsr; Mem *pK; i64 R; /* Pop the value R off the top of the stack @@ -3387,25 +3194,30 @@ ** ** See also: Found, NotFound, IsUnique */ case OP_NotExists: { /* jump, in3 */ int i = pOp->p1; - VdbeCursor *pC; + Cursor *pC; BtCursor *pCrsr; assert( i>=0 && inCursor ); assert( p->apCsr[i]!=0 ); if( (pCrsr = (pC = p->apCsr[i])->pCursor)!=0 ){ - int res = 0; + int res; u64 iKey; assert( pIn3->flags & MEM_Int ); assert( p->apCsr[i]->isTable ); iKey = intToKey(pIn3->u.i); rc = sqlite3BtreeMovetoUnpacked(pCrsr, 0, iKey, 0,&res); pC->lastRowid = pIn3->u.i; - pC->rowidIsValid = res==0 ?1:0; + pC->rowidIsValid = res==0; pC->nullRow = 0; pC->cacheStatus = CACHE_STALE; + /* res might be uninitialized if rc!=SQLITE_OK. But if rc!=SQLITE_OK + ** processing is about to abort so we really do not care whether or not + ** the following jump is taken. (In other words, do not stress over + ** the error that valgrind sometimes shows on the next statement when + ** running ioerr.test and similar failure-recovery test scripts.) */ if( res!=0 ){ pc = pOp->p2 - 1; assert( pC->rowidIsValid==0 ); } }else if( !pC->pseudoTable ){ @@ -3451,11 +3263,11 @@ ** AUTOINCREMENT feature. */ case OP_NewRowid: { /* out2-prerelease */ int i = pOp->p1; i64 v = 0; - VdbeCursor *pC; + Cursor *pC; assert( i>=0 && inCursor ); assert( p->apCsr[i]!=0 ); if( (pC = p->apCsr[i])->pCursor==0 ){ /* The zero initialization above is all that is needed */ }else{ @@ -3506,11 +3318,11 @@ #else /* Some compilers complain about constants of the form 0x7fffffffffffffff. ** Others complain about 0x7ffffffffffffffffLL. The following macro seems ** to provide the constant while making all compilers happy. */ -# define MAX_ROWID (i64)( (((u64)0x7fffffff)<<32) | (u64)0xffffffff ) +# define MAX_ROWID ( (((u64)0x7fffffff)<<32) | (u64)0xffffffff ) #endif if( !pC->useRandomRowid ){ if( pC->nextRowidValid ){ v = pC->nextRowid; @@ -3619,11 +3431,11 @@ Mem *pData = &p->aMem[pOp->p2]; Mem *pKey = &p->aMem[pOp->p3]; i64 iKey; /* The integer ROWID or key for the record to be inserted */ int i = pOp->p1; - VdbeCursor *pC; + Cursor *pC; assert( i>=0 && inCursor ); pC = p->apCsr[i]; assert( pC!=0 ); assert( pC->pCursor!=0 || pC->pseudoTable ); assert( pKey->flags & MEM_Int ); @@ -3665,11 +3477,11 @@ } pC->nullRow = 0; }else{ int nZero; if( pData->flags & MEM_Zero ){ - nZero = pData->u.nZero; + nZero = pData->u.i; }else{ nZero = 0; } rc = sqlite3BtreeInsert(pC->pCursor, 0, iKey, pData->z, pData->n, nZero, @@ -3713,11 +3525,11 @@ ** using OP_NotFound prior to invoking this opcode. */ case OP_Delete: { int i = pOp->p1; i64 iKey; - VdbeCursor *pC; + Cursor *pC; assert( i>=0 && inCursor ); pC = p->apCsr[i]; assert( pC!=0 ); assert( pC->pCursor!=0 ); /* Only valid for real tables, no pseudotables */ @@ -3784,11 +3596,11 @@ ** of a real table, not a pseudo-table. */ case OP_RowKey: case OP_RowData: { int i = pOp->p1; - VdbeCursor *pC; + Cursor *pC; BtCursor *pCrsr; u32 n; pOut = &p->aMem[pOp->p2]; @@ -3809,14 +3621,14 @@ assert( !pC->isTable ); sqlite3BtreeKeySize(pCrsr, &n64); if( n64>db->aLimit[SQLITE_LIMIT_LENGTH] ){ goto too_big; } - n = (int)n64; + n = n64; }else{ sqlite3BtreeDataSize(pCrsr, &n); - if( (int)n>db->aLimit[SQLITE_LIMIT_LENGTH] ){ + if( n>db->aLimit[SQLITE_LIMIT_LENGTH] ){ goto too_big; } } if( sqlite3VdbeMemGrow(pOut, n, 0) ){ goto no_mem; @@ -3838,11 +3650,11 @@ ** Store in register P2 an integer which is the key of the table entry that ** P1 is currently point to. */ case OP_Rowid: { /* out2-prerelease */ int i = pOp->p1; - VdbeCursor *pC; + Cursor *pC; i64 v; assert( i>=0 && inCursor ); pC = p->apCsr[i]; assert( pC!=0 ); @@ -3871,11 +3683,11 @@ ** that occur while the cursor is on the null row will always ** write a NULL. */ case OP_NullRow: { int i = pOp->p1; - VdbeCursor *pC; + Cursor *pC; assert( i>=0 && inCursor ); pC = p->apCsr[i]; assert( pC!=0 ); pC->nullRow = 1; @@ -3894,23 +3706,22 @@ ** If P2 is 0 or if the table or index is not empty, fall through ** to the following instruction. */ case OP_Last: { /* jump */ int i = pOp->p1; - VdbeCursor *pC; + Cursor *pC; BtCursor *pCrsr; int res; assert( i>=0 && inCursor ); pC = p->apCsr[i]; assert( pC!=0 ); pCrsr = pC->pCursor; assert( pCrsr!=0 ); rc = sqlite3BtreeLast(pCrsr, &res); - pC->nullRow = (u8)res; + pC->nullRow = res; pC->deferredMoveto = 0; - pC->rowidIsValid = 0; pC->cacheStatus = CACHE_STALE; if( res && pOp->p2>0 ){ pc = pOp->p2 - 1; } break; @@ -3945,27 +3756,26 @@ ** If P2 is 0 or if the table or index is not empty, fall through ** to the following instruction. */ case OP_Rewind: { /* jump */ int i = pOp->p1; - VdbeCursor *pC; + Cursor *pC; BtCursor *pCrsr; int res; assert( i>=0 && inCursor ); pC = p->apCsr[i]; assert( pC!=0 ); if( (pCrsr = pC->pCursor)!=0 ){ rc = sqlite3BtreeFirst(pCrsr, &res); - pC->atFirst = res==0 ?1:0; + pC->atFirst = res==0; pC->deferredMoveto = 0; pC->cacheStatus = CACHE_STALE; - pC->rowidIsValid = 0; }else{ res = 1; } - pC->nullRow = (u8)res; + pC->nullRow = res; assert( pOp->p2>0 && pOp->p2nOp ); if( res ){ pc = pOp->p2 - 1; } break; @@ -3991,11 +3801,11 @@ ** ** The P1 cursor must be for a real table, not a pseudo-table. */ case OP_Prev: /* jump */ case OP_Next: { /* jump */ - VdbeCursor *pC; + Cursor *pC; BtCursor *pCrsr; int res; CHECK_FOR_INTERRUPT; assert( pOp->p1>=0 && pOp->p1nCursor ); @@ -4007,11 +3817,11 @@ assert( pCrsr ); res = 1; assert( pC->deferredMoveto==0 ); rc = pOp->opcode==OP_Next ? sqlite3BtreeNext(pCrsr, &res) : sqlite3BtreePrevious(pCrsr, &res); - pC->nullRow = (u8)res; + pC->nullRow = res; pC->cacheStatus = CACHE_STALE; if( res==0 ){ pc = pOp->p2 - 1; if( pOp->p5 ) p->aCounter[pOp->p5-1]++; #ifdef SQLITE_TEST @@ -4023,11 +3833,11 @@ } /* Opcode: IdxInsert P1 P2 P3 * * ** ** Register P2 holds a SQL index key made using the -** MakeRecord instructions. This opcode writes that key +** MakeIdxRec instructions. This opcode writes that key ** into the index P1. Data for the entry is nil. ** ** P3 is a flag that provides a hint to the b-tree layer that this ** insert is likely to be an append. ** @@ -4034,11 +3844,11 @@ ** This instruction only works for indices. The equivalent instruction ** for tables is OP_Insert. */ case OP_IdxInsert: { /* in2 */ int i = pOp->p1; - VdbeCursor *pC; + Cursor *pC; BtCursor *pCrsr; assert( i>=0 && inCursor ); assert( p->apCsr[i]!=0 ); assert( pIn2->flags & MEM_Blob ); if( (pCrsr = (pC = p->apCsr[i])->pCursor)!=0 ){ @@ -4061,21 +3871,21 @@ ** an unpacked index key. This opcode removes that entry from the ** index opened by cursor P1. */ case OP_IdxDelete: { int i = pOp->p1; - VdbeCursor *pC; + Cursor *pC; BtCursor *pCrsr; assert( pOp->p3>0 ); assert( pOp->p2>0 && pOp->p2+pOp->p3<=p->nMem ); assert( i>=0 && inCursor ); assert( p->apCsr[i]!=0 ); if( (pCrsr = (pC = p->apCsr[i])->pCursor)!=0 ){ int res; UnpackedRecord r; r.pKeyInfo = pC->pKeyInfo; - r.nField = (u16)pOp->p3; + r.nField = pOp->p3; r.flags = 0; r.aMem = &p->aMem[pOp->p2]; rc = sqlite3BtreeMovetoUnpacked(pCrsr, &r, 0, 0, &res); if( rc==SQLITE_OK && res==0 ){ rc = sqlite3BtreeDelete(pCrsr); @@ -4090,16 +3900,16 @@ ** ** Write into register P2 an integer which is the last entry in the record at ** the end of the index key pointed to by cursor P1. This integer should be ** the rowid of the table entry to which this index entry points. ** -** See also: Rowid, MakeRecord. +** See also: Rowid, MakeIdxRec. */ case OP_IdxRowid: { /* out2-prerelease */ int i = pOp->p1; BtCursor *pCrsr; - VdbeCursor *pC; + Cursor *pC; assert( i>=0 && inCursor ); assert( p->apCsr[i]!=0 ); if( (pCrsr = (pC = p->apCsr[i])->pCursor)!=0 ){ i64 rowid; @@ -4145,11 +3955,11 @@ ** to the comparison. This makes the opcode work like IdxLE. */ case OP_IdxLT: /* jump, in3 */ case OP_IdxGE: { /* jump, in3 */ int i= pOp->p1; - VdbeCursor *pC; + Cursor *pC; assert( i>=0 && inCursor ); assert( p->apCsr[i]!=0 ); if( (pC = p->apCsr[i])->pCursor!=0 ){ int res; @@ -4156,11 +3966,11 @@ UnpackedRecord r; assert( pC->deferredMoveto==0 ); assert( pOp->p5==0 || pOp->p5==1 ); assert( pOp->p4type==P4_INT32 ); r.pKeyInfo = pC->pKeyInfo; - r.nField = (u16)pOp->p4.i; + r.nField = pOp->p4.i; if( pOp->p5 ){ r.flags = UNPACKED_INCRKEY | UNPACKED_IGNORE_ROWID; }else{ r.flags = UNPACKED_IGNORE_ROWID; } @@ -4230,40 +4040,25 @@ #endif } break; } -/* Opcode: Clear P1 P2 P3 +/* Opcode: Clear P1 P2 * ** ** Delete all contents of the database table or index whose root page ** in the database file is given by P1. But, unlike Destroy, do not ** remove the table or index from the database file. ** ** The table being clear is in the main database file if P2==0. If ** P2==1 then the table to be clear is in the auxiliary database file ** that is used to store tables create using CREATE TEMPORARY TABLE. ** -** If the P3 value is non-zero, then the table refered to must be an -** intkey table (an SQL table, not an index). In this case the row change -** count is incremented by the number of rows in the table being cleared. -** If P3 is greater than zero, then the value stored in register P3 is -** also incremented by the number of rows in the table being cleared. -** ** See also: Destroy */ case OP_Clear: { - int nChange = 0; assert( (p->btreeMask & (1<p2))!=0 ); - rc = sqlite3BtreeClearTable( - db->aDb[pOp->p2].pBt, pOp->p1, (pOp->p3 ? &nChange : 0) - ); - if( pOp->p3 ){ - p->nChange += nChange; - if( pOp->p3>0 ){ - p->aMem[pOp->p3].u.i += nChange; - } - } + rc = sqlite3BtreeClearTable(db->aDb[pOp->p2].pBt, pOp->p1); break; } /* Opcode: CreateTable P1 P2 * * * ** @@ -4287,11 +4082,11 @@ ** ** See documentation on OP_CreateTable for additional information. */ case OP_CreateIndex: /* out2-prerelease */ case OP_CreateTable: { /* out2-prerelease */ - int pgno = 0; + int pgno; int flags; Db *pDb; assert( pOp->p1>=0 && pOp->p1nDb ); assert( (p->btreeMask & (1<p1))!=0 ); pDb = &db->aDb[pOp->p1]; @@ -4301,12 +4096,14 @@ flags = BTREE_LEAFDATA|BTREE_INTKEY; }else{ flags = BTREE_ZERODATA; } rc = sqlite3BtreeCreateTable(pDb->pBt, &pgno, flags); - pOut->u.i = pgno; - MemSetTypeFlag(pOut, MEM_Int); + if( rc==SQLITE_OK ){ + pOut->u.i = pgno; + MemSetTypeFlag(pOut, MEM_Int); + } break; } /* Opcode: ParseSchema P1 P2 * P4 * ** @@ -4443,17 +4240,17 @@ pnErr = &p->aMem[pOp->p3]; assert( (pnErr->flags & MEM_Int)!=0 ); assert( (pnErr->flags & (MEM_Str|MEM_Blob))==0 ); pIn1 = &p->aMem[pOp->p1]; for(j=0; jp5nDb ); assert( (p->btreeMask & (1<p5))!=0 ); z = sqlite3BtreeIntegrityCheck(db->aDb[pOp->p5].pBt, aRoot, nRoot, - (int)pnErr->u.i, &nErr); + pnErr->u.i, &nErr); sqlite3DbFree(db, aRoot); pnErr->u.i -= nErr; sqlite3VdbeMemSetNull(pIn1); if( nErr==0 ){ assert( z==0 ); @@ -4466,60 +4263,39 @@ sqlite3VdbeChangeEncoding(pIn1, encoding); break; } #endif /* SQLITE_OMIT_INTEGRITY_CHECK */ -/* Opcode: RowSetAdd P1 P2 * * * -** -** Insert the integer value held by register P2 into a boolean index -** held in register P1. -** -** An assertion fails if P2 is not an integer. -*/ -case OP_RowSetAdd: { /* in2 */ - Mem *pIdx; - Mem *pVal; - assert( pOp->p1>0 && pOp->p1<=p->nMem ); - pIdx = &p->aMem[pOp->p1]; - assert( pOp->p2>0 && pOp->p2<=p->nMem ); - pVal = &p->aMem[pOp->p2]; - assert( (pVal->flags & MEM_Int)!=0 ); - if( (pIdx->flags & MEM_RowSet)==0 ){ - sqlite3VdbeMemSetRowSet(pIdx); - if( (pIdx->flags & MEM_RowSet)==0 ) goto no_mem; - } - sqlite3RowSetInsert(pIdx->u.pRowSet, pVal->u.i); - break; -} - -/* Opcode: RowSetRead P1 P2 P3 * * -** -** Extract the smallest value from boolean index P1 and put that value into -** register P3. Or, if boolean index P1 is initially empty, leave P3 -** unchanged and jump to instruction P2. -*/ -case OP_RowSetRead: { /* jump, out3 */ - Mem *pIdx; - i64 val; - assert( pOp->p1>0 && pOp->p1<=p->nMem ); - CHECK_FOR_INTERRUPT; - pIdx = &p->aMem[pOp->p1]; - pOut = &p->aMem[pOp->p3]; - if( (pIdx->flags & MEM_RowSet)==0 - || sqlite3RowSetNext(pIdx->u.pRowSet, &val)==0 - ){ - /* The boolean index is empty */ - sqlite3VdbeMemSetNull(pIdx); - pc = pOp->p2 - 1; - }else{ - /* A value was pulled from the index */ - assert( pOp->p3>0 && pOp->p3<=p->nMem ); - sqlite3VdbeMemSetInt64(pOut, val); - } - break; -} - +/* Opcode: FifoWrite P1 * * * * +** +** Write the integer from register P1 into the Fifo. +*/ +case OP_FifoWrite: { /* in1 */ + p->sFifo.db = db; + if( sqlite3VdbeFifoPush(&p->sFifo, sqlite3VdbeIntValue(pIn1))==SQLITE_NOMEM ){ + goto no_mem; + } + break; +} + +/* Opcode: FifoRead P1 P2 * * * +** +** Attempt to read a single integer from the Fifo. Store that +** integer in register P1. +** +** If the Fifo is empty jump to P2. +*/ +case OP_FifoRead: { /* jump */ + CHECK_FOR_INTERRUPT; + assert( pOp->p1>0 && pOp->p1<=p->nMem ); + pOut = &p->aMem[pOp->p1]; + MemSetTypeFlag(pOut, MEM_Int); + if( sqlite3VdbeFifoPop(&p->sFifo, &pOut->u.i)==SQLITE_DONE ){ + pc = pOp->p2 - 1; + } + break; +} #ifndef SQLITE_OMIT_TRIGGER /* Opcode: ContextPush * * * ** ** Save the current Vdbe context such that it can be restored by a ContextPop @@ -4539,10 +4315,12 @@ if( p->contextStack==0 ) goto no_mem; } pContext = &p->contextStack[i]; pContext->lastRowid = db->lastRowid; pContext->nChange = p->nChange; + pContext->sFifo = p->sFifo; + sqlite3VdbeFifoInit(&p->sFifo, db); break; } /* Opcode: ContextPop * * * ** @@ -4553,10 +4331,12 @@ case OP_ContextPop: { Context *pContext = &p->contextStack[--p->contextStackTop]; assert( p->contextStackTop>=0 ); db->lastRowid = pContext->lastRowid; p->nChange = pContext->nChange; + sqlite3VdbeFifoClear(&p->sFifo); + p->sFifo = pContext->sFifo; break; } #endif /* #ifndef SQLITE_OMIT_TRIGGER */ #ifndef SQLITE_OMIT_AUTOINCREMENT @@ -4774,11 +4554,11 @@ ** P4 contains a pointer to the name of the table being locked. This is only ** used to generate an error message if the lock cannot be obtained. */ case OP_TableLock: { int p1 = pOp->p1; - u8 isWriteLock = (u8)pOp->p3; + u8 isWriteLock = pOp->p3; assert( p1>=0 && p1nDb ); assert( (p->btreeMask & (1<aDb[p1].pBt, pOp->p2, isWriteLock); if( rc==SQLITE_LOCKED ){ @@ -4843,11 +4623,11 @@ ** P4 is a pointer to a virtual table object, an sqlite3_vtab structure. ** P1 is a cursor number. This opcode opens a cursor to the virtual ** table and stores that cursor in P1. */ case OP_VOpen: { - VdbeCursor *pCur = 0; + Cursor *pCur = 0; sqlite3_vtab_cursor *pVtabCursor = 0; sqlite3_vtab *pVtab = pOp->p4.pVtab; sqlite3_module *pModule = (sqlite3_module *)pVtab->pModule; @@ -4902,22 +4682,22 @@ Mem *pQuery = &p->aMem[pOp->p3]; Mem *pArgc = &pQuery[1]; sqlite3_vtab_cursor *pVtabCursor; sqlite3_vtab *pVtab; - VdbeCursor *pCur = p->apCsr[pOp->p1]; + Cursor *pCur = p->apCsr[pOp->p1]; REGISTER_TRACE(pOp->p3, pQuery); assert( pCur->pVtabCursor ); pVtabCursor = pCur->pVtabCursor; pVtab = pVtabCursor->pVtab; pModule = pVtab->pModule; /* Grab the index number and argc parameters */ assert( (pQuery->flags&MEM_Int)!=0 && pArgc->flags==MEM_Int ); - nArg = (int)pArgc->u.i; - iQuery = (int)pQuery->u.i; + nArg = pArgc->u.i; + iQuery = pQuery->u.i; /* Invoke the xFilter method */ { int res = 0; int i; @@ -4959,11 +4739,11 @@ */ case OP_VRowid: { /* out2-prerelease */ sqlite3_vtab *pVtab; const sqlite3_module *pModule; sqlite_int64 iRow; - VdbeCursor *pCur = p->apCsr[pOp->p1]; + Cursor *pCur = p->apCsr[pOp->p1]; assert( pCur->pVtabCursor ); if( pCur->nullRow ){ break; } @@ -4993,11 +4773,11 @@ sqlite3_vtab *pVtab; const sqlite3_module *pModule; Mem *pDest; sqlite3_context sContext; - VdbeCursor *pCur = p->apCsr[pOp->p1]; + Cursor *pCur = p->apCsr[pOp->p1]; assert( pCur->pVtabCursor ); assert( pOp->p3>0 && pOp->p3<=p->nMem ); pDest = &p->aMem[pOp->p3]; if( pCur->nullRow ){ sqlite3VdbeMemSetNull(pDest); @@ -5051,11 +4831,11 @@ case OP_VNext: { /* jump */ sqlite3_vtab *pVtab; const sqlite3_module *pModule; int res = 0; - VdbeCursor *pCur = p->apCsr[pOp->p1]; + Cursor *pCur = p->apCsr[pOp->p1]; assert( pCur->pVtabCursor ); if( pCur->nullRow ){ break; } pVtab = pCur->pVtabCursor->pVtab; Index: src/vdbe.h ================================================================== --- src/vdbe.h +++ src/vdbe.h @@ -13,11 +13,11 @@ ** ** This header defines the interface to the virtual database engine ** or VDBE. The VDBE implements an abstract machine that runs a ** simple program to access and modify the underlying database. ** -** $Id: vdbe.h,v 1.139 2008/10/31 10:53:23 danielk1977 Exp $ +** $Id: vdbe.h,v 1.138 2008/08/20 22:06:48 drh Exp $ */ #ifndef _SQLITE_VDBE_H_ #define _SQLITE_VDBE_H_ #include @@ -176,11 +176,11 @@ void sqlite3VdbeTrace(Vdbe*,FILE*); #endif void sqlite3VdbeResetStepResult(Vdbe*); int sqlite3VdbeReset(Vdbe*); void sqlite3VdbeSetNumCols(Vdbe*,int); -int sqlite3VdbeSetColName(Vdbe*, int, int, const char *, void(*)(void*)); +int sqlite3VdbeSetColName(Vdbe*, int, int, const char *, int); void sqlite3VdbeCountChanges(Vdbe*); sqlite3 *sqlite3VdbeDb(Vdbe*); void sqlite3VdbeSetSql(Vdbe*, const char *z, int n); void sqlite3VdbeSwap(Vdbe*,Vdbe*); Index: src/vdbeInt.h ================================================================== --- src/vdbeInt.h +++ src/vdbeInt.h @@ -13,11 +13,11 @@ ** VDBE. This information used to all be at the top of the single ** source code file "vdbe.c". When that file became too big (over ** 6000 lines long) it was split up into several smaller files and ** this header information was factored out. ** -** $Id: vdbeInt.h,v 1.162 2009/02/03 15:39:01 drh Exp $ +** $Id: vdbeInt.h,v 1.155 2008/10/07 23:46:38 drh Exp $ */ #ifndef _VDBEINT_H_ #define _VDBEINT_H_ /* @@ -48,16 +48,16 @@ ** is currently pointing to. ** ** Every cursor that the virtual machine has open is represented by an ** instance of the following structure. ** -** If the VdbeCursor.isTriggerRow flag is set it means that this cursor is +** If the Cursor.isTriggerRow flag is set it means that this cursor is ** really a single row that represents the NEW or OLD pseudo-table of -** a row trigger. The data for the row is stored in VdbeCursor.pData and -** the rowid is in VdbeCursor.iKey. +** a row trigger. The data for the row is stored in Cursor.pData and +** the rowid is in Cursor.iKey. */ -struct VdbeCursor { +struct Cursor { BtCursor *pCursor; /* The cursor structure of the backend */ int iDb; /* Index of cursor database in db->aDb[] (or -1) */ i64 lastRowid; /* Last rowid from a Next or NextIdx operation */ i64 nextRowid; /* Next rowid returned by OP_NewRowid */ Bool zeroed; /* True if zeroed out and ready for reuse */ @@ -91,14 +91,14 @@ int payloadSize; /* Total number of bytes in the record */ u32 *aType; /* Type values for all entries in the record */ u32 *aOffset; /* Cached offsets to the start of each columns data */ u8 *aRow; /* Data for the current row, if all on one page */ }; -typedef struct VdbeCursor VdbeCursor; +typedef struct Cursor Cursor; /* -** A value for VdbeCursor.cacheValid that means the cache is always invalid. +** A value for Cursor.cacheValid that means the cache is always invalid. */ #define CACHE_STALE 0 /* ** Internally, the vdbe manipulates nearly all SQL values as Mem @@ -111,14 +111,12 @@ ** one of SQLITE_NULL, SQLITE_INTEGER, SQLITE_REAL, SQLITE_TEXT or ** SQLITE_BLOB. */ struct Mem { union { - i64 i; /* Integer value. */ - int nZero; /* Used when bit MEM_Zero is set in flags */ + i64 i; /* Integer value. Or FuncDef* when flags==MEM_Agg */ FuncDef *pDef; /* Used only when flags==MEM_Agg */ - RowSet *pRowSet; /* Used only when flags==MEM_RowSet */ } u; double r; /* Real value */ sqlite3 *db; /* The associated database connection */ char *z; /* String or BLOB value */ int n; /* Number of characters in string value, excluding '\0' */ @@ -147,37 +145,31 @@ #define MEM_Null 0x0001 /* Value is NULL */ #define MEM_Str 0x0002 /* Value is a string */ #define MEM_Int 0x0004 /* Value is an integer */ #define MEM_Real 0x0008 /* Value is a real number */ #define MEM_Blob 0x0010 /* Value is a BLOB */ -#define MEM_RowSet 0x0020 /* Value is a RowSet object */ -#define MEM_TypeMask 0x00ff /* Mask of type bits */ + +#define MemSetTypeFlag(p, f) \ + ((p)->flags = ((p)->flags&~(MEM_Int|MEM_Real|MEM_Null|MEM_Blob|MEM_Str))|f) /* Whenever Mem contains a valid string or blob representation, one of ** the following flags must be set to determine the memory management ** policy for Mem.z. The MEM_Term flag tells us whether or not the ** string is \000 or \u0000 terminated */ -#define MEM_Term 0x0200 /* String rep is nul terminated */ -#define MEM_Dyn 0x0400 /* Need to call sqliteFree() on Mem.z */ -#define MEM_Static 0x0800 /* Mem.z points to a static string */ -#define MEM_Ephem 0x1000 /* Mem.z points to an ephemeral string */ -#define MEM_Agg 0x2000 /* Mem.z points to an agg function context */ -#define MEM_Zero 0x4000 /* Mem.i contains count of 0s appended to blob */ +#define MEM_Term 0x0020 /* String rep is nul terminated */ +#define MEM_Dyn 0x0040 /* Need to call sqliteFree() on Mem.z */ +#define MEM_Static 0x0080 /* Mem.z points to a static string */ +#define MEM_Ephem 0x0100 /* Mem.z points to an ephemeral string */ +#define MEM_Agg 0x0400 /* Mem.z points to an agg function context */ +#define MEM_Zero 0x0800 /* Mem.i contains count of 0s appended to blob */ #ifdef SQLITE_OMIT_INCRBLOB #undef MEM_Zero #define MEM_Zero 0x0000 #endif - -/* -** Clear any existing type flags from a Mem and replace them with f -*/ -#define MemSetTypeFlag(p, f) \ - ((p)->flags = ((p)->flags&~(MEM_TypeMask|MEM_Zero))|f) - /* A VdbeFunc is just a FuncDef (defined in sqliteInt.h) that contains ** additional information about auxiliary information bound to arguments ** of the function. This is used to implement the sqlite3_get_auxdata() ** and sqlite3_set_auxdata() APIs. The "auxdata" is some auxiliary data @@ -227,10 +219,37 @@ struct Set { Hash hash; /* A set is just a hash table */ HashElem *prev; /* Previously accessed hash elemen */ }; +/* +** A FifoPage structure holds a single page of valves. Pages are arranged +** in a list. +*/ +typedef struct FifoPage FifoPage; +struct FifoPage { + int nSlot; /* Number of entries aSlot[] */ + int iWrite; /* Push the next value into this entry in aSlot[] */ + int iRead; /* Read the next value from this entry in aSlot[] */ + FifoPage *pNext; /* Next page in the fifo */ + i64 aSlot[1]; /* One or more slots for rowid values */ +}; + +/* +** The Fifo structure is typedef-ed in vdbeInt.h. But the implementation +** of that structure is private to this file. +** +** The Fifo structure describes the entire fifo. +*/ +typedef struct Fifo Fifo; +struct Fifo { + int nEntry; /* Total number of entries */ + sqlite3 *db; /* The associated database connection */ + FifoPage *pFirst; /* First page on the list */ + FifoPage *pLast; /* Last page on the list */ +}; + /* ** A Context stores the last insert rowid, the last statement change count, ** and the current statement change count (i.e. changes since last statement). ** The current keylist is also stored in the context. ** Elements of Context structure type make up the ContextStack, which is @@ -240,10 +259,11 @@ */ typedef struct Context Context; struct Context { i64 lastRowid; /* Last insert rowid (sqlite3.lastRowid) */ int nChange; /* Statement changes (Vdbe.nChanges) */ + Fifo sFifo; /* Records that will participate in a DELETE or UPDATE */ }; /* ** An instance of the virtual machine. This structure contains the complete ** state of the virtual machine. @@ -269,20 +289,21 @@ int nLabelAlloc; /* Number of slots allocated in aLabel[] */ int *aLabel; /* Space to hold the labels */ Mem **apArg; /* Arguments to currently executing user function */ Mem *aColName; /* Column names to return */ int nCursor; /* Number of slots in apCsr[] */ - VdbeCursor **apCsr; /* One element of this array for each open cursor */ + Cursor **apCsr; /* One element of this array for each open cursor */ int nVar; /* Number of entries in aVar[] */ Mem *aVar; /* Values for the OP_Variable opcode. */ char **azVar; /* Name of variables */ int okVar; /* True if azVar[] has been initialized */ - u32 magic; /* Magic number for sanity checking */ + int magic; /* Magic number for sanity checking */ int nMem; /* Number of memory locations currently allocated */ Mem *aMem; /* The memory locations */ int nCallback; /* Number of callbacks invoked so far */ - int cacheCtr; /* VdbeCursor row cache generation counter */ + int cacheCtr; /* Cursor row cache generation counter */ + Fifo sFifo; /* A list of ROWIDs */ int contextStackTop; /* Index of top element in the context stack */ int contextStackDepth; /* The size of the "context" stack */ Context *contextStack; /* Stack used by opcodes ContextPush & ContextPop*/ int pc; /* The program counter */ int rc; /* Value to return */ @@ -296,12 +317,10 @@ u8 explain; /* True if EXPLAIN present on SQL command */ u8 changeCntOn; /* True to update the change-counter */ u8 expired; /* True if the VM needs to be recompiled */ u8 minWriteFileFormat; /* Minimum file format for writable database files */ u8 inVtabMethod; /* See comments above */ - u8 usesStmtJournal; /* True if uses a statement journal */ - u8 readOnly; /* True for read-only statements */ int nChange; /* Number of db changes made since last reset */ i64 startTime; /* Time when query started - used for profiling */ int btreeMask; /* Bitmask of db->aDb[] entries referenced */ BtreeMutexArray aMutex; /* An array of Btree used here and needing locks */ int aCounter[2]; /* Counters used by sqlite3_stmt_status() */ @@ -330,13 +349,13 @@ #define VDBE_MAGIC_DEAD 0xb606c3c8 /* The VDBE has been deallocated */ /* ** Function prototypes */ -void sqlite3VdbeFreeCursor(Vdbe *, VdbeCursor*); +void sqlite3VdbeFreeCursor(Vdbe *, Cursor*); void sqliteVdbePopStack(Vdbe*,int); -int sqlite3VdbeCursorMoveto(VdbeCursor*); +int sqlite3VdbeCursorMoveto(Cursor*); #if defined(SQLITE_DEBUG) || defined(VDBE_PROFILE) void sqlite3VdbePrintOp(FILE*, int, Op*); #endif int sqlite3VdbeSerialTypeLen(u32); u32 sqlite3VdbeSerialType(Mem*, int); @@ -343,11 +362,11 @@ int sqlite3VdbeSerialPut(unsigned char*, int, Mem*, int); int sqlite3VdbeSerialGet(const unsigned char*, u32, Mem*); void sqlite3VdbeDeleteAuxData(VdbeFunc*, int); int sqlite2BtreeKeyCompare(BtCursor *, const void *, int, int, int *); -int sqlite3VdbeIdxKeyCompare(VdbeCursor*,UnpackedRecord*,int*); +int sqlite3VdbeIdxKeyCompare(Cursor*,UnpackedRecord*,int*); int sqlite3VdbeIdxRowid(BtCursor *, i64 *); int sqlite3MemCompare(const Mem*, const Mem*, const CollSeq*); int sqlite3VdbeExec(Vdbe*); int sqlite3VdbeList(Vdbe*); int sqlite3VdbeHalt(Vdbe*); @@ -360,11 +379,10 @@ int sqlite3VdbeMemSetStr(Mem*, const char*, int, u8, void(*)(void*)); void sqlite3VdbeMemSetInt64(Mem*, i64); void sqlite3VdbeMemSetDouble(Mem*, double); void sqlite3VdbeMemSetNull(Mem*); void sqlite3VdbeMemSetZeroBlob(Mem*,int); -void sqlite3VdbeMemSetRowSet(Mem*); int sqlite3VdbeMemMakeWriteable(Mem*); int sqlite3VdbeMemStringify(Mem*, int); i64 sqlite3VdbeIntValue(Mem*); int sqlite3VdbeMemIntegerify(Mem*); double sqlite3VdbeRealValue(Mem*); @@ -380,19 +398,26 @@ int sqlite3VdbeMemGrow(Mem *pMem, int n, int preserve); #ifdef SQLITE_ENABLE_MEMORY_MANAGEMENT int sqlite3VdbeReleaseBuffers(Vdbe *p); #endif +#ifndef NDEBUG + void sqlite3VdbeMemSanity(Mem*); +#endif int sqlite3VdbeMemTranslate(Mem*, u8); #ifdef SQLITE_DEBUG void sqlite3VdbePrintSql(Vdbe*); void sqlite3VdbeMemPrettyPrint(Mem *pMem, char *zBuf); #endif int sqlite3VdbeMemHandleBom(Mem *pMem); +void sqlite3VdbeFifoInit(Fifo*, sqlite3*); +int sqlite3VdbeFifoPush(Fifo*, i64); +int sqlite3VdbeFifoPop(Fifo*, i64*); +void sqlite3VdbeFifoClear(Fifo*); #ifndef SQLITE_OMIT_INCRBLOB int sqlite3VdbeMemExpandBlob(Mem *); #else #define sqlite3VdbeMemExpandBlob(x) SQLITE_OK #endif #endif /* !defined(_VDBEINT_H_) */ Index: src/vdbeapi.c ================================================================== --- src/vdbeapi.c +++ src/vdbeapi.c @@ -11,11 +11,11 @@ ************************************************************************* ** ** This file contains code use to implement APIs that are part of the ** VDBE. ** -** $Id: vdbeapi.c,v 1.151 2009/02/04 03:59:25 shane Exp $ +** $Id: vdbeapi.c,v 1.147 2008/10/13 10:37:50 danielk1977 Exp $ */ #include "sqliteInt.h" #include "vdbeInt.h" #if 0 && defined(SQLITE_ENABLE_MEMORY_MANAGEMENT) @@ -282,11 +282,11 @@ } double sqlite3_value_double(sqlite3_value *pVal){ return sqlite3VdbeRealValue((Mem*)pVal); } int sqlite3_value_int(sqlite3_value *pVal){ - return (int)sqlite3VdbeIntValue((Mem*)pVal); + return sqlite3VdbeIntValue((Mem*)pVal); } sqlite_int64 sqlite3_value_int64(sqlite3_value *pVal){ return sqlite3VdbeIntValue((Mem*)pVal); } const unsigned char *sqlite3_value_text(sqlite3_value *pVal){ @@ -461,16 +461,15 @@ #ifndef SQLITE_OMIT_TRACE if( db->xProfile && !db->init.busy ){ double rNow; sqlite3OsCurrentTime(db->pVfs, &rNow); - p->startTime = (u64)((rNow - (int)rNow)*3600.0*24.0*1000000000.0); + p->startTime = (rNow - (int)rNow)*3600.0*24.0*1000000000.0; } #endif db->activeVdbeCnt++; - if( p->readOnly==0 ) db->writeVdbeCnt++; p->pc = 0; stmtLruRemove(p); } #ifndef SQLITE_OMIT_EXPLAIN if( p->explain ){ @@ -492,12 +491,11 @@ && p->aOp[0].opcode==OP_Trace && p->aOp[0].p4.z!=0 ){ double rNow; u64 elapseTime; sqlite3OsCurrentTime(db->pVfs, &rNow); - elapseTime = (u64)((rNow - (int)rNow)*3600.0*24.0*1000000000.0); - elapseTime -= p->startTime; + elapseTime = (rNow - (int)rNow)*3600.0*24.0*1000000000.0 - p->startTime; db->xProfile(db->pProfileArg, p->aOp[0].p4.z, elapseTime); } #endif db->errCode = rc; @@ -600,16 +598,15 @@ ** for name resolution but are actually overloaded by the xFindFunction ** method of virtual tables. */ void sqlite3InvalidFunction( sqlite3_context *context, /* The function calling context */ - int NotUsed, /* Number of arguments to the function */ - sqlite3_value **NotUsed2 /* Value of each argument */ + int argc, /* Number of arguments to the function */ + sqlite3_value **argv /* Value of each argument */ ){ const char *zName = context->pFunc->zName; char *zErr; - UNUSED_PARAMETER2(NotUsed, NotUsed2); zErr = sqlite3MPrintf(0, "unable to use function %s in the requested context", zName); sqlite3_result_error(context, zErr, -1); sqlite3_free(zErr); } @@ -750,12 +747,11 @@ if( pVm && pVm->pResultSet!=0 && inResColumn && i>=0 ){ sqlite3_mutex_enter(pVm->db->mutex); vals = sqlite3_data_count(pStmt); pOut = &pVm->pResultSet[i]; }else{ - /* ((double)0) In case of SQLITE_OMIT_FLOATING_POINT... */ - static const Mem nullMem = {{0}, (double)0, 0, "", 0, MEM_Null, SQLITE_NULL, 0, 0, 0 }; + static const Mem nullMem = {{0}, 0.0, 0, "", 0, MEM_Null, SQLITE_NULL, 0, 0, 0 }; if( pVm->db ){ sqlite3_mutex_enter(pVm->db->mutex); sqlite3Error(pVm->db, SQLITE_RANGE, 0); } pOut = (Mem*)&nullMem; @@ -1052,11 +1048,11 @@ sqlite3_stmt *pStmt, /* The statement to bind against */ int i, /* Index of the parameter to bind */ const void *zData, /* Pointer to the data to be bound */ int nData, /* Number of bytes of data to be bound */ void (*xDel)(void*), /* Destructor for the data */ - u8 encoding /* Encoding for the data */ + int encoding /* Encoding for the data */ ){ Vdbe *p = (Vdbe *)pStmt; Mem *pVar; int rc; Index: src/vdbeaux.c ================================================================== --- src/vdbeaux.c +++ src/vdbeaux.c @@ -12,13 +12,14 @@ ** This file contains code used for creating, destroying, and populating ** a VDBE (or an "sqlite3_stmt" as it is known to the outside world.) Prior ** to version 2.8.7, all this code was combined into the vdbe.c source file. ** But that file was getting too big so this subroutines were split out. ** -** $Id: vdbeaux.c,v 1.435 2009/02/03 16:51:25 danielk1977 Exp $ +** $Id: vdbeaux.c,v 1.412 2008/10/11 17:51:39 danielk1977 Exp $ */ #include "sqliteInt.h" +#include #include "vdbeInt.h" /* @@ -97,27 +98,25 @@ p->trace = trace; } #endif /* -** Resize the Vdbe.aOp array so that it is at least one op larger than -** it was. +** Resize the Vdbe.aOp array so that it contains at least N +** elements. ** -** If an out-of-memory error occurs while resizing the array, return -** SQLITE_NOMEM. In this case Vdbe.aOp and Vdbe.nOpAlloc remain -** unchanged (this is so that any opcodes already allocated can be -** correctly deallocated along with the rest of the Vdbe). +** If an out-of-memory error occurs while resizing the array, +** Vdbe.aOp and Vdbe.nOpAlloc remain unchanged (this is so that +** any opcodes already allocated can be correctly deallocated +** along with the rest of the Vdbe). */ -static int growOpArray(Vdbe *p){ +static void resizeOpArray(Vdbe *p, int N){ VdbeOp *pNew; - int nNew = (p->nOpAlloc ? p->nOpAlloc*2 : (int)(1024/sizeof(Op))); - pNew = sqlite3DbRealloc(p->db, p->aOp, nNew*sizeof(Op)); + pNew = sqlite3DbRealloc(p->db, p->aOp, N*sizeof(Op)); if( pNew ){ - p->nOpAlloc = nNew; + p->nOpAlloc = N; p->aOp = pNew; } - return (pNew ? SQLITE_OK : SQLITE_NOMEM); } /* ** Add a new instruction to the list of instructions current in the ** VDBE. Return the address of the new instruction. @@ -138,19 +137,19 @@ int i; VdbeOp *pOp; i = p->nOp; assert( p->magic==VDBE_MAGIC_INIT ); - assert( op>0 && op<0xff ); if( p->nOpAlloc<=i ){ - if( growOpArray(p) ){ + resizeOpArray(p, p->nOpAlloc ? p->nOpAlloc*2 : 1024/sizeof(Op)); + if( p->db->mallocFailed ){ return 0; } } p->nOp++; pOp = &p->aOp[i]; - pOp->opcode = (u8)op; + pOp->opcode = op; pOp->p5 = 0; pOp->p1 = p1; pOp->p2 = p2; pOp->p3 = p3; pOp->p4.p = 0; @@ -211,14 +210,13 @@ int sqlite3VdbeMakeLabel(Vdbe *p){ int i; i = p->nLabel++; assert( p->magic==VDBE_MAGIC_INIT ); if( i>=p->nLabelAlloc ){ - int n = p->nLabelAlloc*2 + 5; + p->nLabelAlloc = p->nLabelAlloc*2 + 10; p->aLabel = sqlite3DbReallocOrFree(p->db, p->aLabel, - n*sizeof(p->aLabel[0])); - p->nLabelAlloc = sqlite3DbMallocSize(p->db, p->aLabel)/sizeof(p->aLabel[0]); + p->nLabelAlloc*sizeof(p->aLabel[0])); } if( p->aLabel ){ p->aLabel[i] = -1; } return -1-i; @@ -267,12 +265,10 @@ int nMaxArgs = 0; Op *pOp; int *aLabel = p->aLabel; int doesStatementRollback = 0; int hasStatementBegin = 0; - p->readOnly = 1; - p->usesStmtJournal = 0; for(pOp=p->aOp, i=p->nOp-1; i>=0; i--, pOp++){ u8 opcode = pOp->opcode; if( opcode==OP_Function || opcode==OP_AggStep ){ if( pOp->p5>nMaxArgs ) nMaxArgs = pOp->p5; @@ -285,15 +281,12 @@ if( pOp->p1==SQLITE_CONSTRAINT && pOp->p2==OE_Abort ){ doesStatementRollback = 1; } }else if( opcode==OP_Statement ){ hasStatementBegin = 1; - p->usesStmtJournal = 1; }else if( opcode==OP_Destroy ){ doesStatementRollback = 1; - }else if( opcode==OP_Transaction && pOp->p2!=0 ){ - p->readOnly = 0; #ifndef SQLITE_OMIT_VIRTUALTABLE }else if( opcode==OP_VUpdate || opcode==OP_VRename ){ doesStatementRollback = 1; }else if( opcode==OP_VFilter ){ int n; @@ -318,11 +311,10 @@ ** transactions are not needed. So change every OP_Statement ** opcode into an OP_Noop. This avoid a call to sqlite3OsOpenExclusive() ** which can be expensive on some platforms. */ if( hasStatementBegin && !doesStatementRollback ){ - p->usesStmtJournal = 0; for(pOp=p->aOp, i=p->nOp-1; i>=0; i--, pOp++){ if( pOp->opcode==OP_Statement ){ pOp->opcode = OP_Noop; } } @@ -342,11 +334,15 @@ ** address of the first operation added. */ int sqlite3VdbeAddOpList(Vdbe *p, int nOp, VdbeOpList const *aOp){ int addr; assert( p->magic==VDBE_MAGIC_INIT ); - if( p->nOp + nOp > p->nOpAlloc && growOpArray(p) ){ + if( p->nOp + nOp > p->nOpAlloc ){ + resizeOpArray(p, p->nOpAlloc ? p->nOpAlloc*2 : 1024/sizeof(Op)); + assert( p->nOp+nOp<=p->nOpAlloc || p->db->mallocFailed ); + } + if( p->db->mallocFailed ){ return 0; } addr = p->nOp; if( nOp>0 ){ int i; @@ -541,11 +537,11 @@ pOp->p4.p = 0; if( n==P4_INT32 ){ /* Note: this cast is safe, because the origin data point was an int ** that was cast to a (const char *). */ pOp->p4.i = SQLITE_PTR_TO_INT(zP4); - pOp->p4type = P4_INT32; + pOp->p4type = n; }else if( zP4==0 ){ pOp->p4.p = 0; pOp->p4type = P4_NOTUSED; }else if( n==P4_KEYINFO ){ KeyInfo *pKeyInfo; @@ -571,13 +567,13 @@ }else if( n==P4_KEYINFO_HANDOFF ){ pOp->p4.p = (void*)zP4; pOp->p4type = P4_KEYINFO; }else if( n<0 ){ pOp->p4.p = (void*)zP4; - pOp->p4type = (signed char)n; + pOp->p4type = n; }else{ - if( n==0 ) n = sqlite3Strlen30(zP4); + if( n==0 ) n = strlen(zP4); pOp->p4.z = sqlite3DbStrNDup(p->db, zP4, n); pOp->p4type = P4_DYNAMIC; } } @@ -637,15 +633,15 @@ case P4_KEYINFO_STATIC: case P4_KEYINFO: { int i, j; KeyInfo *pKeyInfo = pOp->p4.pKeyInfo; sqlite3_snprintf(nTemp, zTemp, "keyinfo(%d", pKeyInfo->nField); - i = sqlite3Strlen30(zTemp); + i = strlen(zTemp); for(j=0; jnField; j++){ CollSeq *pColl = pKeyInfo->aColl[j]; if( pColl ){ - int n = sqlite3Strlen30(pColl->zName); + int n = strlen(pColl->zName); if( i+n>nTemp-6 ){ memcpy(&zTemp[i],",...",4); break; } zTemp[i++] = ','; @@ -727,11 +723,11 @@ ** */ void sqlite3VdbeUsesBtree(Vdbe *p, int i){ int mask; assert( i>=0 && idb->nDb ); - assert( i<(int)sizeof(p->btreeMask)*8 ); + assert( ibtreeMask)*8 ); mask = 1<btreeMask & mask)==0 ){ p->btreeMask |= mask; sqlite3BtreeMutexArrayInsert(&p->aMutex, p->db->aDb[i].pBt); } @@ -765,11 +761,11 @@ */ static void releaseMemArray(Mem *p, int N){ if( p && N ){ Mem *pEnd; sqlite3 *db = p->db; - u8 malloc_failed = db->mallocFailed; + int malloc_failed = db->mallocFailed; for(pEnd=&p[N]; pdb->mutex) ); for(ii=1; ii<=p->nMem; ii++){ Mem *pMem = &p->aMem[ii]; - if( pMem->flags & MEM_RowSet ){ - sqlite3RowSetClear(pMem->u.pRowSet); - } if( pMem->z && pMem->flags&MEM_Dyn ){ assert( !pMem->xDel ); nFree += sqlite3DbMallocSize(pMem->db, pMem->z); sqlite3VdbeMemRelease(pMem); } @@ -838,25 +831,18 @@ Mem *pMem = p->pResultSet = &p->aMem[1]; assert( p->explain ); if( p->magic!=VDBE_MAGIC_RUN ) return SQLITE_MISUSE; assert( db->magic==SQLITE_MAGIC_BUSY ); - assert( p->rc==SQLITE_OK || p->rc==SQLITE_BUSY || p->rc==SQLITE_NOMEM ); + assert( p->rc==SQLITE_OK || p->rc==SQLITE_BUSY ); /* Even though this opcode does not use dynamic strings for ** the result, result columns may become dynamic if the user calls ** sqlite3_column_text16(), causing a translation to UTF-16 encoding. */ releaseMemArray(pMem, p->nMem); - if( p->rc==SQLITE_NOMEM ){ - /* This happens if a malloc() inside a call to sqlite3_column_text() or - ** sqlite3_column_text16() failed. */ - db->mallocFailed = 1; - return SQLITE_ERROR; - } - do{ i = p->pc++; }while( inOp && p->explain==2 && p->aOp[i].opcode!=OP_Explain ); if( i>=p->nOp ){ p->rc = SQLITE_OK; @@ -875,11 +861,11 @@ pMem++; pMem->flags = MEM_Static|MEM_Str|MEM_Term; pMem->z = (char*)sqlite3OpcodeName(pOp->opcode); /* Opcode */ assert( pMem->z!=0 ); - pMem->n = sqlite3Strlen30(pMem->z); + pMem->n = strlen(pMem->z); pMem->type = SQLITE_TEXT; pMem->enc = SQLITE_UTF8; pMem++; } @@ -908,11 +894,11 @@ z = displayP4(pOp, pMem->z, 32); if( z!=pMem->z ){ sqlite3VdbeMemSetStr(pMem, z, -1, SQLITE_UTF8, 0); }else{ assert( pMem->z!=0 ); - pMem->n = sqlite3Strlen30(pMem->z); + pMem->n = strlen(pMem->z); pMem->enc = SQLITE_UTF8; } pMem->type = SQLITE_TEXT; pMem++; @@ -930,11 +916,11 @@ #ifdef SQLITE_DEBUG if( pOp->zComment ){ pMem->flags = MEM_Str|MEM_Term; pMem->z = pOp->zComment; - pMem->n = sqlite3Strlen30(pMem->z); + pMem->n = strlen(pMem->z); pMem->enc = SQLITE_UTF8; pMem->type = SQLITE_TEXT; }else #endif { @@ -960,11 +946,11 @@ VdbeOp *pOp; if( nOp<1 ) return; pOp = &p->aOp[0]; if( pOp->opcode==OP_Trace && pOp->p4.z!=0 ){ const char *z = pOp->p4.z; - while( sqlite3Isspace(*z) ) z++; + while( isspace(*(u8*)z) ) z++; printf("SQL: [%s]\n", z); } } #endif @@ -980,13 +966,13 @@ pOp = &p->aOp[0]; if( pOp->opcode==OP_Trace && pOp->p4.z!=0 ){ int i, j; char z[1000]; sqlite3_snprintf(sizeof(z), z, "%s", pOp->p4.z); - for(i=0; sqlite3Isspace(z[i]); i++){} + for(i=0; isspace((unsigned char)z[i]); i++){} for(j=0; z[i]; i++){ - if( sqlite3Isspace(z[i]) ){ + if( isspace((unsigned char)z[i]) ){ if( z[i-1]!=' ' ){ z[j++] = ' '; } }else{ z[j++] = z[i]; @@ -1023,17 +1009,21 @@ /* There should be at least one opcode. */ assert( p->nOp>0 ); - /* Set the magic to VDBE_MAGIC_RUN sooner rather than later. */ + /* Set the magic to VDBE_MAGIC_RUN sooner rather than later. This + * is because the call to resizeOpArray() below may shrink the + * p->aOp[] array to save memory if called when in VDBE_MAGIC_RUN + * state. + */ p->magic = VDBE_MAGIC_RUN; /* For each cursor required, also allocate a memory cell. Memory ** cells (nMem+1-nCursor)..nMem, inclusive, will never be used by ** the vdbe program. Instead they are used to allocate space for - ** VdbeCursor/BtCursor structures. The blob of memory associated with + ** Cursor/BtCursor structures. The blob of memory associated with ** cursor 0 is stored in memory cell nMem. Memory cell (nMem-1) ** stores the blob of memory associated with cursor 1, etc. ** ** See also: allocateCursor(). */ @@ -1043,30 +1033,31 @@ ** Allocation space for registers. */ if( p->aMem==0 ){ int nArg; /* Maximum number of args passed to a user function. */ resolveP2Values(p, &nArg); + /*resizeOpArray(p, p->nOp);*/ assert( nVar>=0 ); if( isExplain && nMem<10 ){ - nMem = 10; + p->nMem = nMem = 10; } p->aMem = sqlite3DbMallocZero(db, nMem*sizeof(Mem) /* aMem */ + nVar*sizeof(Mem) /* aVar */ + nArg*sizeof(Mem*) /* apArg */ + nVar*sizeof(char*) /* azVar */ - + nCursor*sizeof(VdbeCursor*)+1 /* apCsr */ + + nCursor*sizeof(Cursor*) + 1 /* apCsr */ ); if( !db->mallocFailed ){ p->aMem--; /* aMem[] goes from 1..nMem */ p->nMem = nMem; /* not from 0..nMem-1 */ p->aVar = &p->aMem[nMem+1]; p->nVar = nVar; p->okVar = 0; p->apArg = (Mem**)&p->aVar[nVar]; p->azVar = (char**)&p->apArg[nArg]; - p->apCsr = (VdbeCursor**)&p->azVar[nVar]; + p->apCsr = (Cursor**)&p->azVar[nVar]; p->nCursor = nCursor; for(n=0; naVar[n].flags = MEM_Null; p->aVar[n].db = db; } @@ -1105,11 +1096,11 @@ /* ** Close a VDBE cursor and release all the resources that cursor ** happens to hold. */ -void sqlite3VdbeFreeCursor(Vdbe *p, VdbeCursor *pCx){ +void sqlite3VdbeFreeCursor(Vdbe *p, Cursor *pCx){ if( pCx==0 ){ return; } if( pCx->pBt ){ sqlite3BtreeClose(pCx->pBt); @@ -1140,11 +1131,11 @@ */ static void closeAllCursorsExceptActiveVtabs(Vdbe *p){ int i; if( p->apCsr==0 ) return; for(i=0; inCursor; i++){ - VdbeCursor *pC = p->apCsr[i]; + Cursor *pC = p->apCsr[i]; if( pC && (!p->inVtabMethod || !pC->pVtabCursor) ){ sqlite3VdbeFreeCursor(p, pC); p->apCsr[i] = 0; } } @@ -1158,20 +1149,20 @@ ** variables in the aVar[] array. */ static void Cleanup(Vdbe *p){ int i; sqlite3 *db = p->db; - Mem *pMem; closeAllCursorsExceptActiveVtabs(p); - for(pMem=&p->aMem[1], i=1; i<=p->nMem; i++, pMem++){ - if( pMem->flags & MEM_RowSet ){ - sqlite3RowSetClear(pMem->u.pRowSet); - } - MemSetTypeFlag(pMem, MEM_Null); + for(i=1; i<=p->nMem; i++){ + MemSetTypeFlag(&p->aMem[i], MEM_Null); } releaseMemArray(&p->aMem[1], p->nMem); + sqlite3VdbeFifoClear(&p->sFifo); if( p->contextStack ){ + for(i=0; icontextStackTop; i++){ + sqlite3VdbeFifoClear(&p->contextStack[i].sFifo); + } sqlite3DbFree(db, p->contextStack); } p->contextStack = 0; p->contextStackDepth = 0; p->contextStackTop = 0; @@ -1208,33 +1199,32 @@ ** Set the name of the idx'th column to be returned by the SQL statement. ** zName must be a pointer to a nul terminated string. ** ** This call must be made after a call to sqlite3VdbeSetNumCols(). ** -** The final parameter, xDel, must be one of SQLITE_DYNAMIC, SQLITE_STATIC -** or SQLITE_TRANSIENT. If it is SQLITE_DYNAMIC, then the buffer pointed -** to by zName will be freed by sqlite3DbFree() when the vdbe is destroyed. +** If N==P4_STATIC it means that zName is a pointer to a constant static +** string and we can just copy the pointer. If it is P4_DYNAMIC, then +** the string is freed using sqlite3DbFree(db, ) when the vdbe is finished with +** it. Otherwise, N bytes of zName are copied. */ -int sqlite3VdbeSetColName( - Vdbe *p, /* Vdbe being configured */ - int idx, /* Index of column zName applies to */ - int var, /* One of the COLNAME_* constants */ - const char *zName, /* Pointer to buffer containing name */ - void (*xDel)(void*) /* Memory management strategy for zName */ -){ +int sqlite3VdbeSetColName(Vdbe *p, int idx, int var, const char *zName, int N){ int rc; Mem *pColName; assert( idxnResColumn ); assert( vardb->mallocFailed ){ - assert( !zName || xDel!=SQLITE_DYNAMIC ); - return SQLITE_NOMEM; - } + if( p->db->mallocFailed ) return SQLITE_NOMEM; assert( p->aColName!=0 ); pColName = &(p->aColName[idx+var*p->nResColumn]); - rc = sqlite3VdbeMemSetStr(pColName, zName, -1, SQLITE_UTF8, xDel); - assert( rc!=0 || !zName || (pColName->flags&MEM_Term)!=0 ); + if( N==P4_DYNAMIC || N==P4_STATIC ){ + rc = sqlite3VdbeMemSetStr(pColName, zName, -1, SQLITE_UTF8, SQLITE_STATIC); + }else{ + rc = sqlite3VdbeMemSetStr(pColName, zName, N, SQLITE_UTF8,SQLITE_TRANSIENT); + } + if( rc==SQLITE_OK && N==P4_DYNAMIC ){ + pColName->flags &= (~MEM_Static); + pColName->zMalloc = pColName->z; + } return rc; } /* ** A read or write transaction may or may not be active on database handle @@ -1273,16 +1263,13 @@ } } /* If there are any write-transactions at all, invoke the commit hook */ if( needXcommit && db->xCommitCallback ){ - assert( (db->flags & SQLITE_CommitBusy)==0 ); - db->flags |= SQLITE_CommitBusy; (void)sqlite3SafetyOff(db); rc = db->xCommitCallback(db->pCommitArg); (void)sqlite3SafetyOn(db); - db->flags &= ~SQLITE_CommitBusy; if( rc ){ return SQLITE_CONSTRAINT; } } @@ -1293,14 +1280,12 @@ ** If the return value of sqlite3BtreeGetFilename() is a zero length ** string, it means the main database is :memory: or a temp file. In ** that case we do not support atomic multi-file commits, so use the ** simple case then too. */ - if( 0==sqlite3Strlen30(sqlite3BtreeGetFilename(db->aDb[0].pBt)) - || nTrans<=1 - ){ - for(i=0; rc==SQLITE_OK && inDb; i++){ + if( 0==strlen(sqlite3BtreeGetFilename(db->aDb[0].pBt)) || nTrans<=1 ){ + for(i=0; rc==SQLITE_OK && inDb; i++){ Btree *pBt = db->aDb[i].pBt; if( pBt ){ rc = sqlite3BtreeCommitPhaseOne(pBt, 0); } } @@ -1335,14 +1320,14 @@ i64 offset = 0; int res; /* Select a master journal file name */ do { - u32 iRandom; + u32 random; sqlite3DbFree(db, zMaster); - sqlite3_randomness(sizeof(iRandom), &iRandom); - zMaster = sqlite3MPrintf(db, "%s-mj%08X", zMainFile, iRandom&0x7fffffff); + sqlite3_randomness(sizeof(random), &random); + zMaster = sqlite3MPrintf(db, "%s-mj%08X", zMainFile, random&0x7fffffff); if( !zMaster ){ return SQLITE_NOMEM; } rc = sqlite3OsAccess(pVfs, zMaster, SQLITE_ACCESS_EXISTS, &res); }while( rc==SQLITE_OK && res ); @@ -1371,12 +1356,12 @@ char const *zFile = sqlite3BtreeGetJournalname(pBt); if( zFile[0]==0 ) continue; /* Ignore :memory: databases */ if( !needSync && !sqlite3BtreeSyncDisabled(pBt) ){ needSync = 1; } - rc = sqlite3OsWrite(pMaster, zFile, sqlite3Strlen30(zFile)+1, offset); - offset += sqlite3Strlen30(zFile)+1; + rc = sqlite3OsWrite(pMaster, zFile, strlen(zFile)+1, offset); + offset += strlen(zFile)+1; if( rc!=SQLITE_OK ){ sqlite3OsCloseFree(pMaster); sqlite3OsDelete(pVfs, zMaster, 0); sqlite3DbFree(db, zMaster); return rc; @@ -1385,14 +1370,14 @@ } /* Sync the master journal file. If the IOCAP_SEQUENTIAL device ** flag is set this is not required. */ - if( needSync - && 0==(sqlite3OsDeviceCharacteristics(pMaster)&SQLITE_IOCAP_SEQUENTIAL) - && SQLITE_OK!=(rc = sqlite3OsSync(pMaster, SQLITE_SYNC_NORMAL)) - ){ + zMainFile = sqlite3BtreeGetDirname(db->aDb[0].pBt); + if( (needSync + && (0==(sqlite3OsDeviceCharacteristics(pMaster)&SQLITE_IOCAP_SEQUENTIAL)) + && (rc=sqlite3OsSync(pMaster, SQLITE_SYNC_NORMAL))!=SQLITE_OK) ){ sqlite3OsCloseFree(pMaster); sqlite3OsDelete(pVfs, zMaster, 0); sqlite3DbFree(db, zMaster); return rc; } @@ -1466,21 +1451,18 @@ */ #ifndef NDEBUG static void checkActiveVdbeCnt(sqlite3 *db){ Vdbe *p; int cnt = 0; - int nWrite = 0; p = db->pVdbe; while( p ){ if( p->magic==VDBE_MAGIC_RUN && p->pc>=0 ){ cnt++; - if( p->readOnly==0 ) nWrite++; } p = p->pNext; } assert( cnt==db->activeVdbeCnt ); - assert( nWrite==db->writeVdbeCnt ); } #else #define checkActiveVdbeCnt(x) #endif @@ -1564,43 +1546,65 @@ /* Check for one of the special errors */ mrc = p->rc & 0xff; isSpecialError = mrc==SQLITE_NOMEM || mrc==SQLITE_IOERR || mrc==SQLITE_INTERRUPT || mrc==SQLITE_FULL; if( isSpecialError ){ + /* This loop does static analysis of the query to see which of the + ** following three categories it falls into: + ** + ** Read-only + ** Query with statement journal + ** Query without statement journal + ** + ** We could do something more elegant than this static analysis (i.e. + ** store the type of query as part of the compliation phase), but + ** handling malloc() or IO failure is a fairly obscure edge case so + ** this is probably easier. Todo: Might be an opportunity to reduce + ** code size a very small amount though... + */ + int notReadOnly = 0; + int isStatement = 0; + assert(p->aOp || p->nOp==0); + for(i=0; inOp; i++){ + switch( p->aOp[i].opcode ){ + case OP_Transaction: + notReadOnly |= p->aOp[i].p2; + break; + case OP_Statement: + isStatement = 1; + break; + } + } + + /* If the query was read-only, we need do no rollback at all. Otherwise, ** proceed with the special handling. */ - if( !p->readOnly || mrc!=SQLITE_INTERRUPT ){ - if( p->rc==SQLITE_IOERR_BLOCKED && p->usesStmtJournal ){ + if( notReadOnly || mrc!=SQLITE_INTERRUPT ){ + if( p->rc==SQLITE_IOERR_BLOCKED && isStatement ){ xFunc = sqlite3BtreeRollbackStmt; p->rc = SQLITE_BUSY; - }else if( (mrc==SQLITE_NOMEM || mrc==SQLITE_FULL) - && p->usesStmtJournal ){ + } else if( (mrc==SQLITE_NOMEM || mrc==SQLITE_FULL) && isStatement ){ xFunc = sqlite3BtreeRollbackStmt; }else{ /* We are forced to roll back the active transaction. Before doing ** so, abort any other statements this handle currently has active. */ invalidateCursorsOnModifiedBtrees(db); sqlite3RollbackAll(db); - sqlite3CloseSavepoints(db); db->autoCommit = 1; } } } /* If the auto-commit flag is set and this is the only active vdbe, then ** we do either a commit or rollback of the current transaction. ** ** Note: This block also runs if one of the special errors handled - ** above has occurred. + ** above has occured. */ - if( !sqlite3VtabInSync(db) - && db->autoCommit - && db->writeVdbeCnt==(p->readOnly==0) - && (db->flags & SQLITE_CommitBusy)==0 - ){ + if( db->autoCommit && db->activeVdbeCnt==1 ){ if( p->rc==SQLITE_OK || (p->errorAction==OE_Fail && !isSpecialError) ){ /* The auto-commit flag is true, and the vdbe program was ** successful or hit an 'OR FAIL' constraint. This means a commit ** is required. */ @@ -1625,11 +1629,10 @@ }else if( p->errorAction==OE_Abort ){ xFunc = sqlite3BtreeRollbackStmt; }else{ invalidateCursorsOnModifiedBtrees(db); sqlite3RollbackAll(db); - sqlite3CloseSavepoints(db); db->autoCommit = 1; } } /* If xFunc is not NULL, then it is one of sqlite3BtreeRollbackStmt or @@ -1677,14 +1680,10 @@ } /* We have successfully halted and closed the VM. Record this fact. */ if( p->pc>=0 ){ db->activeVdbeCnt--; - if( !p->readOnly ){ - db->writeVdbeCnt--; - } - assert( db->activeVdbeCnt>=db->writeVdbeCnt ); } p->magic = VDBE_MAGIC_HALT; checkActiveVdbeCnt(db); if( p->db->mallocFailed ){ p->rc = SQLITE_NOMEM; @@ -1864,21 +1863,21 @@ /* ** If a MoveTo operation is pending on the given cursor, then do that ** MoveTo now. Return an error code. If no MoveTo is pending, this ** routine does nothing and returns SQLITE_OK. */ -int sqlite3VdbeCursorMoveto(VdbeCursor *p){ +int sqlite3VdbeCursorMoveto(Cursor *p){ if( p->deferredMoveto ){ int res, rc; #ifdef SQLITE_TEST extern int sqlite3_search_count; #endif assert( p->isTable ); rc = sqlite3BtreeMovetoUnpacked(p->pCursor, 0, p->movetoTarget, 0, &res); if( rc ) return rc; p->lastRowid = keyToInt(p->movetoTarget); - p->rowidIsValid = res==0 ?1:0; + p->rowidIsValid = res==0; if( res<0 ){ rc = sqlite3BtreeNext(p->pCursor, &res); if( rc ) return rc; } #ifdef SQLITE_TEST @@ -1954,11 +1953,11 @@ /* Figure out whether to use 1, 2, 4, 6 or 8 bytes. */ # define MAX_6BYTE ((((i64)0x00008000)<<32)-1) i64 i = pMem->u.i; u64 u; if( file_format>=4 && (i&1)==i ){ - return 8+(u32)i; + return 8+i; } u = i<0 ? -i : i; if( u<=127 ) return 1; if( u<=32767 ) return 2; if( u<=8388607 ) return 3; @@ -1967,14 +1966,14 @@ return 6; } if( flags&MEM_Real ){ return 7; } - assert( pMem->db->mallocFailed || flags&(MEM_Str|MEM_Blob) ); + assert( flags&(MEM_Str|MEM_Blob) ); n = pMem->n; if( flags & MEM_Zero ){ - n += pMem->u.nZero; + n += pMem->u.i; } assert( n>=0 ); return ((n*2) + 12 + ((flags&MEM_Str)!=0)); } @@ -2077,25 +2076,25 @@ v = pMem->u.i; } len = i = sqlite3VdbeSerialTypeLen(serial_type); assert( len<=nBuf ); while( i-- ){ - buf[i] = (u8)(v&0xFF); + buf[i] = (v&0xFF); v >>= 8; } return len; } /* String or blob */ if( serial_type>=12 ){ - assert( pMem->n + ((pMem->flags & MEM_Zero)?pMem->u.nZero:0) + assert( pMem->n + ((pMem->flags & MEM_Zero)?pMem->u.i:0) == sqlite3VdbeSerialTypeLen(serial_type) ); assert( pMem->n<=nBuf ); len = pMem->n; memcpy(buf, pMem->z, len); if( pMem->flags & MEM_Zero ){ - len += pMem->u.nZero; + len += pMem->u.i; if( len>nBuf ){ len = nBuf; } memset(&buf[pMem->n], 0, len-pMem->n); } @@ -2224,12 +2223,12 @@ UnpackedRecord *pSpace,/* Space available to hold resulting object */ int szSpace /* Size of pSpace[] in bytes */ ){ const unsigned char *aKey = (const unsigned char *)pKey; UnpackedRecord *p; - int nByte, d; - u32 idx; + int nByte; + int idx, d; u16 u; /* Unsigned loop counter */ u32 szHdr; Mem *pMem; assert( sizeof(Mem)>sizeof(*p) ); @@ -2249,11 +2248,11 @@ d = szHdr; u = 0; while( idxnField ){ u32 serial_type; - idx += getVarint32(&aKey[idx], serial_type); + idx += getVarint32( aKey+idx, serial_type); if( d>=nKey && sqlite3VdbeSerialTypeLen(serial_type)>0 ) break; pMem->enc = pKeyInfo->enc; pMem->db = pKeyInfo->db; pMem->flags = 0; pMem->zMalloc = 0; @@ -2314,11 +2313,11 @@ */ int sqlite3VdbeRecordCompare( int nKey1, const void *pKey1, /* Left key */ UnpackedRecord *pPKey2 /* Right key */ ){ - int d1; /* Offset into aKey[] of next data element */ + u32 d1; /* Offset into aKey[] of next data element */ u32 idx1; /* Offset into aKey[] of next header element */ u32 szHdr1; /* Number of bytes in header */ int i = 0; int nField; int rc = 0; @@ -2387,78 +2386,37 @@ /* ** pCur points at an index entry created using the OP_MakeRecord opcode. ** Read the rowid (the last field in the record) and store it in *rowid. ** Return SQLITE_OK if everything works, or an error code otherwise. -** -** pCur might be pointing to text obtained from a corrupt database file. -** So the content cannot be trusted. Do appropriate checks on the content. */ int sqlite3VdbeIdxRowid(BtCursor *pCur, i64 *rowid){ i64 nCellKey = 0; int rc; u32 szHdr; /* Size of the header */ u32 typeRowid; /* Serial type of the rowid */ u32 lenRowid; /* Size of the rowid */ Mem m, v; - /* Get the size of the index entry. Only indices entries of less - ** than 2GiB are support - anything large must be database corruption */ sqlite3BtreeKeySize(pCur, &nCellKey); - if( unlikely(nCellKey<=0 || nCellKey>0x7fffffff) ){ + if( nCellKey<=0 ){ return SQLITE_CORRUPT_BKPT; } - - /* Read in the complete content of the index entry */ m.flags = 0; m.db = 0; m.zMalloc = 0; - rc = sqlite3VdbeMemFromBtree(pCur, 0, (int)nCellKey, 1, &m); + rc = sqlite3VdbeMemFromBtree(pCur, 0, nCellKey, 1, &m); if( rc ){ return rc; } - - /* The index entry must begin with a header size */ (void)getVarint32((u8*)m.z, szHdr); - testcase( szHdr==2 ); - testcase( szHdr==m.n ); - if( unlikely(szHdr<2 || (int)szHdr>m.n) ){ - goto idx_rowid_corruption; - } - - /* The last field of the index should be an integer - the ROWID. - ** Verify that the last entry really is an integer. */ (void)getVarint32((u8*)&m.z[szHdr-1], typeRowid); - testcase( typeRowid==1 ); - testcase( typeRowid==2 ); - testcase( typeRowid==3 ); - testcase( typeRowid==4 ); - testcase( typeRowid==5 ); - testcase( typeRowid==6 ); - testcase( typeRowid==8 ); - testcase( typeRowid==9 ); - if( unlikely(typeRowid<1 || typeRowid>9 || typeRowid==7) ){ - goto idx_rowid_corruption; - } lenRowid = sqlite3VdbeSerialTypeLen(typeRowid); - testcase( m.n-lenRowid==szHdr ); - if( unlikely(m.n-lenRowidpCursor; Mem m; sqlite3BtreeKeySize(pCur, &nCellKey); - if( nCellKey<=0 || nCellKey>0x7fffffff ){ + if( nCellKey<=0 ){ *res = 0; return SQLITE_OK; } m.db = 0; m.flags = 0; m.zMalloc = 0; - rc = sqlite3VdbeMemFromBtree(pC->pCursor, 0, (int)nCellKey, 1, &m); + rc = sqlite3VdbeMemFromBtree(pC->pCursor, 0, nCellKey, 1, &m); if( rc ){ return rc; } assert( pUnpacked->flags & UNPACKED_IGNORE_ROWID ); *res = sqlite3VdbeRecordCompare(m.n, m.z, pUnpacked); ADDED src/vdbefifo.c Index: src/vdbefifo.c ================================================================== --- /dev/null +++ src/vdbefifo.c @@ -0,0 +1,130 @@ +/* +** 2005 June 16 +** +** 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 a FIFO queue of rowids used for processing +** UPDATE and DELETE statements. +** +** $Id: vdbefifo.c,v 1.8 2008/07/28 19:34:54 drh Exp $ +*/ +#include "sqliteInt.h" +#include "vdbeInt.h" + +/* +** Constants FIFOSIZE_FIRST and FIFOSIZE_MAX are the initial +** number of entries in a fifo page and the maximum number of +** entries in a fifo page. +*/ +#define FIFOSIZE_FIRST (((128-sizeof(FifoPage))/8)+1) +#ifdef SQLITE_MALLOC_SOFT_LIMIT +# define FIFOSIZE_MAX (((SQLITE_MALLOC_SOFT_LIMIT-sizeof(FifoPage))/8)+1) +#else +# define FIFOSIZE_MAX (((262144-sizeof(FifoPage))/8)+1) +#endif + +/* +** Allocate a new FifoPage and return a pointer to it. Return NULL if +** we run out of memory. Leave space on the page for nEntry entries. +*/ +static FifoPage *allocateFifoPage(sqlite3 *db, int nEntry){ + FifoPage *pPage; + if( nEntry>FIFOSIZE_MAX ){ + nEntry = FIFOSIZE_MAX; + } + pPage = sqlite3DbMallocRaw(db, sizeof(FifoPage) + sizeof(i64)*(nEntry-1) ); + if( pPage ){ + pPage->nSlot = nEntry; + pPage->iWrite = 0; + pPage->iRead = 0; + pPage->pNext = 0; + } + return pPage; +} + +/* +** Initialize a Fifo structure. +*/ +void sqlite3VdbeFifoInit(Fifo *pFifo, sqlite3 *db){ + memset(pFifo, 0, sizeof(*pFifo)); + pFifo->db = db; +} + +/* +** Push a single 64-bit integer value into the Fifo. Return SQLITE_OK +** normally. SQLITE_NOMEM is returned if we are unable to allocate +** memory. +*/ +int sqlite3VdbeFifoPush(Fifo *pFifo, i64 val){ + FifoPage *pPage; + pPage = pFifo->pLast; + if( pPage==0 ){ + pPage = pFifo->pLast = pFifo->pFirst = + allocateFifoPage(pFifo->db, FIFOSIZE_FIRST); + if( pPage==0 ){ + return SQLITE_NOMEM; + } + }else if( pPage->iWrite>=pPage->nSlot ){ + pPage->pNext = allocateFifoPage(pFifo->db, pFifo->nEntry); + if( pPage->pNext==0 ){ + return SQLITE_NOMEM; + } + pPage = pFifo->pLast = pPage->pNext; + } + pPage->aSlot[pPage->iWrite++] = val; + pFifo->nEntry++; + return SQLITE_OK; +} + +/* +** Extract a single 64-bit integer value from the Fifo. The integer +** extracted is the one least recently inserted. If the Fifo is empty +** return SQLITE_DONE. +*/ +int sqlite3VdbeFifoPop(Fifo *pFifo, i64 *pVal){ + FifoPage *pPage; + if( pFifo->nEntry==0 ){ + return SQLITE_DONE; + } + assert( pFifo->nEntry>0 ); + pPage = pFifo->pFirst; + assert( pPage!=0 ); + assert( pPage->iWrite>pPage->iRead ); + assert( pPage->iWrite<=pPage->nSlot ); + assert( pPage->iReadnSlot ); + assert( pPage->iRead>=0 ); + *pVal = pPage->aSlot[pPage->iRead++]; + pFifo->nEntry--; + if( pPage->iRead>=pPage->iWrite ){ + pFifo->pFirst = pPage->pNext; + sqlite3DbFree(pFifo->db, pPage); + if( pFifo->nEntry==0 ){ + assert( pFifo->pLast==pPage ); + pFifo->pLast = 0; + }else{ + assert( pFifo->pFirst!=0 ); + } + }else{ + assert( pFifo->nEntry>0 ); + } + return SQLITE_OK; +} + +/* +** Delete all information from a Fifo object. Free all memory held +** by the Fifo. +*/ +void sqlite3VdbeFifoClear(Fifo *pFifo){ + FifoPage *pPage, *pNextPage; + for(pPage=pFifo->pFirst; pPage; pPage=pNextPage){ + pNextPage = pPage->pNext; + sqlite3DbFree(pFifo->db, pPage); + } + sqlite3VdbeFifoInit(pFifo, pFifo->db); +} Index: src/vdbemem.c ================================================================== --- src/vdbemem.c +++ src/vdbemem.c @@ -13,13 +13,14 @@ ** This file contains code use to manipulate "Mem" structure. A "Mem" ** stores a single value in the VDBE. Mem is an opaque structure visible ** only within the VDBE. Interface routines refer to a Mem using the ** name sqlite_value ** -** $Id: vdbemem.c,v 1.137 2009/02/04 03:59:25 shane Exp $ +** $Id: vdbemem.c,v 1.123 2008/09/16 12:06:08 danielk1977 Exp $ */ #include "sqliteInt.h" +#include #include "vdbeInt.h" /* ** Call sqlite3VdbeMemExpandBlob() on the supplied value (type Mem*) ** P if required. @@ -39,13 +40,10 @@ ** SQLITE_NOMEM may be returned if a malloc() fails during conversion ** between formats. */ int sqlite3VdbeChangeEncoding(Mem *pMem, int desiredEnc){ int rc; - assert( (pMem->flags&MEM_RowSet)==0 ); - assert( desiredEnc==SQLITE_UTF8 || desiredEnc==SQLITE_UTF16LE - || desiredEnc==SQLITE_UTF16BE ); if( !(pMem->flags&MEM_Str) || pMem->enc==desiredEnc ){ return SQLITE_OK; } assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) ); #ifdef SQLITE_OMIT_UTF16 @@ -53,11 +51,11 @@ #else /* MemTranslate() may return SQLITE_OK or SQLITE_NOMEM. If NOMEM is returned, ** then the encoding of the value may not have changed. */ - rc = sqlite3VdbeMemTranslate(pMem, (u8)desiredEnc); + rc = sqlite3VdbeMemTranslate(pMem, desiredEnc); assert(rc==SQLITE_OK || rc==SQLITE_NOMEM); assert(rc==SQLITE_OK || pMem->enc!=desiredEnc); assert(rc==SQLITE_NOMEM || pMem->enc==desiredEnc); return rc; #endif @@ -81,16 +79,18 @@ ((pMem->zMalloc && pMem->zMalloc==pMem->z) ? 1 : 0) + (((pMem->flags&MEM_Dyn)&&pMem->xDel) ? 1 : 0) + ((pMem->flags&MEM_Ephem) ? 1 : 0) + ((pMem->flags&MEM_Static) ? 1 : 0) ); - assert( (pMem->flags&MEM_RowSet)==0 ); if( n<32 ) n = 32; if( sqlite3DbMallocSize(pMem->db, pMem->zMalloc)z==pMem->zMalloc ){ pMem->z = pMem->zMalloc = sqlite3DbReallocOrFree(pMem->db, pMem->z, n); + if( !pMem->z ){ + pMem->flags = MEM_Null; + } preserve = 0; }else{ sqlite3DbFree(pMem->db, pMem->zMalloc); pMem->zMalloc = sqlite3DbMallocRaw(pMem->db, n); } @@ -102,15 +102,11 @@ if( pMem->flags&MEM_Dyn && pMem->xDel ){ pMem->xDel((void *)(pMem->z)); } pMem->z = pMem->zMalloc; - if( pMem->z==0 ){ - pMem->flags = MEM_Null; - }else{ - pMem->flags &= ~(MEM_Ephem|MEM_Static); - } + pMem->flags &= ~(MEM_Ephem|MEM_Static); pMem->xDel = 0; return (pMem->z ? SQLITE_OK : SQLITE_NOMEM); } /* @@ -122,11 +118,10 @@ ** Return SQLITE_OK on success or SQLITE_NOMEM if malloc fails. */ int sqlite3VdbeMemMakeWriteable(Mem *pMem){ int f; assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) ); - assert( (pMem->flags&MEM_RowSet)==0 ); expandBlob(pMem); f = pMem->flags; if( (f&(MEM_Str|MEM_Blob)) && pMem->z!=pMem->zMalloc ){ if( sqlite3VdbeMemGrow(pMem, pMem->n + 2, 1) ){ return SQLITE_NOMEM; @@ -146,24 +141,23 @@ #ifndef SQLITE_OMIT_INCRBLOB int sqlite3VdbeMemExpandBlob(Mem *pMem){ if( pMem->flags & MEM_Zero ){ int nByte; assert( pMem->flags&MEM_Blob ); - assert( (pMem->flags&MEM_RowSet)==0 ); assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) ); /* Set nByte to the number of bytes required to store the expanded blob. */ - nByte = pMem->n + pMem->u.nZero; + nByte = pMem->n + pMem->u.i; if( nByte<=0 ){ nByte = 1; } if( sqlite3VdbeMemGrow(pMem, nByte, 1) ){ return SQLITE_NOMEM; } - memset(&pMem->z[pMem->n], 0, pMem->u.nZero); - pMem->n += pMem->u.nZero; + memset(&pMem->z[pMem->n], 0, pMem->u.i); + pMem->n += pMem->u.i; pMem->flags &= ~(MEM_Zero|MEM_Term); } return SQLITE_OK; } #endif @@ -206,12 +200,10 @@ assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) ); assert( !(fg&MEM_Zero) ); assert( !(fg&(MEM_Str|MEM_Blob)) ); assert( fg&(MEM_Int|MEM_Real) ); - assert( (pMem->flags&MEM_RowSet)==0 ); - if( sqlite3VdbeMemGrow(pMem, nByte, 0) ){ return SQLITE_NOMEM; } @@ -225,11 +217,11 @@ sqlite3_snprintf(nByte, pMem->z, "%lld", pMem->u.i); }else{ assert( fg & MEM_Real ); sqlite3_snprintf(nByte, pMem->z, "%!.15g", pMem->r); } - pMem->n = sqlite3Strlen30(pMem->z); + pMem->n = strlen(pMem->z); pMem->enc = SQLITE_UTF8; pMem->flags |= MEM_Str|MEM_Term; sqlite3VdbeChangeEncoding(pMem, enc); return rc; } @@ -254,11 +246,11 @@ ctx.pMem = pMem; ctx.pFunc = pFunc; pFunc->xFinalize(&ctx); assert( 0==(pMem->flags&MEM_Dyn) && !pMem->xDel ); sqlite3DbFree(pMem->db, pMem->zMalloc); - memcpy(pMem, &ctx.s, sizeof(ctx.s)); + *pMem = ctx.s; rc = (ctx.isError?SQLITE_ERROR:SQLITE_OK); } return rc; } @@ -272,15 +264,12 @@ if( p->flags&MEM_Agg ){ sqlite3VdbeMemFinalize(p, p->u.pDef); assert( (p->flags & MEM_Agg)==0 ); sqlite3VdbeMemRelease(p); }else if( p->flags&MEM_Dyn && p->xDel ){ - assert( (p->flags&MEM_RowSet)==0 ); p->xDel((void *)p->z); p->xDel = 0; - }else if( p->flags&MEM_RowSet ){ - sqlite3RowSetClear(p->u.pRowSet); } } /* ** Release any memory held by the Mem. This may leave the Mem in an @@ -371,50 +360,49 @@ if( pMem->flags & MEM_Real ){ return pMem->r; }else if( pMem->flags & MEM_Int ){ return (double)pMem->u.i; }else if( pMem->flags & (MEM_Str|MEM_Blob) ){ - /* (double)0 In case of SQLITE_OMIT_FLOATING_POINT... */ - double val = (double)0; + double val = 0.0; pMem->flags |= MEM_Str; if( sqlite3VdbeChangeEncoding(pMem, SQLITE_UTF8) || sqlite3VdbeMemNulTerminate(pMem) ){ - /* (double)0 In case of SQLITE_OMIT_FLOATING_POINT... */ - return (double)0; + return 0.0; } assert( pMem->z ); sqlite3AtoF(pMem->z, &val); return val; }else{ - /* (double)0 In case of SQLITE_OMIT_FLOATING_POINT... */ - return (double)0; + return 0.0; } } /* ** The MEM structure is already a MEM_Real. Try to also make it a ** MEM_Int if we can. */ void sqlite3VdbeIntegerAffinity(Mem *pMem){ assert( pMem->flags & MEM_Real ); - assert( (pMem->flags & MEM_RowSet)==0 ); assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) ); pMem->u.i = doubleToInt64(pMem->r); if( pMem->r==(double)pMem->u.i ){ pMem->flags |= MEM_Int; } } + +static void setTypeFlag(Mem *pMem, int f){ + MemSetTypeFlag(pMem, f); +} /* ** Convert pMem to type integer. Invalidate any prior representations. */ int sqlite3VdbeMemIntegerify(Mem *pMem){ assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) ); - assert( (pMem->flags & MEM_RowSet)==0 ); pMem->u.i = sqlite3VdbeIntValue(pMem); - MemSetTypeFlag(pMem, MEM_Int); + setTypeFlag(pMem, MEM_Int); return SQLITE_OK; } /* ** Convert pMem so that it is of type MEM_Real. @@ -421,11 +409,11 @@ ** Invalidate any prior representations. */ int sqlite3VdbeMemRealify(Mem *pMem){ assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) ); pMem->r = sqlite3VdbeRealValue(pMem); - MemSetTypeFlag(pMem, MEM_Real); + setTypeFlag(pMem, MEM_Real); return SQLITE_OK; } /* ** Convert pMem so that it has types MEM_Real or MEM_Int or both. @@ -442,37 +430,35 @@ r2 = (double)i; if( r1==r2 ){ sqlite3VdbeMemIntegerify(pMem); }else{ pMem->r = r1; - MemSetTypeFlag(pMem, MEM_Real); + setTypeFlag(pMem, MEM_Real); } return SQLITE_OK; } /* ** Delete any previous value and set the value stored in *pMem to NULL. */ void sqlite3VdbeMemSetNull(Mem *pMem){ - if( pMem->flags & MEM_RowSet ){ - sqlite3RowSetClear(pMem->u.pRowSet); - } - MemSetTypeFlag(pMem, MEM_Null); + setTypeFlag(pMem, MEM_Null); pMem->type = SQLITE_NULL; } /* ** Delete any previous value and set the value to be a BLOB of length ** n containing all zeros. */ void sqlite3VdbeMemSetZeroBlob(Mem *pMem, int n){ sqlite3VdbeMemRelease(pMem); + setTypeFlag(pMem, MEM_Blob); pMem->flags = MEM_Blob|MEM_Zero; pMem->type = SQLITE_BLOB; pMem->n = 0; if( n<0 ) n = 0; - pMem->u.nZero = n; + pMem->u.i = n; pMem->enc = SQLITE_UTF8; } /* ** Delete any previous value and set the value stored in *pMem to val, @@ -498,44 +484,20 @@ pMem->flags = MEM_Real; pMem->type = SQLITE_FLOAT; } } -/* -** Delete any previous value and set the value of pMem to be an -** empty boolean index. -*/ -void sqlite3VdbeMemSetRowSet(Mem *pMem){ - sqlite3 *db = pMem->db; - assert( db!=0 ); - if( pMem->flags & MEM_RowSet ){ - sqlite3RowSetClear(pMem->u.pRowSet); - }else{ - sqlite3VdbeMemRelease(pMem); - pMem->zMalloc = sqlite3DbMallocRaw(db, 64); - } - if( db->mallocFailed ){ - pMem->flags = MEM_Null; - }else{ - assert( pMem->zMalloc ); - pMem->u.pRowSet = sqlite3RowSetInit(db, pMem->zMalloc, - sqlite3DbMallocSize(db, pMem->zMalloc)); - assert( pMem->u.pRowSet!=0 ); - pMem->flags = MEM_RowSet; - } -} - /* ** Return true if the Mem object contains a TEXT or BLOB that is ** too large - whose size exceeds SQLITE_MAX_LENGTH. */ int sqlite3VdbeMemTooBig(Mem *p){ assert( p->db!=0 ); if( p->flags & (MEM_Str|MEM_Blob) ){ int n = p->n; if( p->flags & MEM_Zero ){ - n += p->u.nZero; + n += p->u.i; } return n>p->db->aLimit[SQLITE_LIMIT_LENGTH]; } return 0; } @@ -550,11 +512,10 @@ ** pTo are freed. The pFrom->z field is not duplicated. If ** pFrom->z is used, then pTo->z points to the same thing as pFrom->z ** and flags gets srcType (either MEM_Ephem or MEM_Static). */ void sqlite3VdbeMemShallowCopy(Mem *pTo, const Mem *pFrom, int srcType){ - assert( (pFrom->flags & MEM_RowSet)==0 ); sqlite3VdbeMemReleaseExternal(pTo); memcpy(pTo, pFrom, MEMCELLSIZE); pTo->xDel = 0; if( (pFrom->flags&MEM_Dyn)!=0 || pFrom->z==pFrom->zMalloc ){ pTo->flags &= ~(MEM_Dyn|MEM_Static|MEM_Ephem); @@ -568,11 +529,10 @@ ** freed before the copy is made. */ int sqlite3VdbeMemCopy(Mem *pTo, const Mem *pFrom){ int rc = SQLITE_OK; - assert( (pFrom->flags & MEM_RowSet)==0 ); sqlite3VdbeMemReleaseExternal(pTo); memcpy(pTo, pFrom, MEMCELLSIZE); pTo->flags &= ~MEM_Dyn; if( pTo->flags&(MEM_Str|MEM_Blob) ){ @@ -619,14 +579,13 @@ u8 enc, /* Encoding of z. 0 for BLOBs */ void (*xDel)(void*) /* Destructor function */ ){ int nByte = n; /* New value for pMem->n */ int iLimit; /* Maximum allowed string or blob size */ - u16 flags = 0; /* New value for pMem->flags */ + int flags = 0; /* New value for pMem->flags */ assert( pMem->db==0 || sqlite3_mutex_held(pMem->db->mutex) ); - assert( (pMem->flags & MEM_RowSet)==0 ); /* If z is a NULL pointer, set pMem to contain an SQL NULL. */ if( !z ){ sqlite3VdbeMemSetNull(pMem); return SQLITE_OK; @@ -645,10 +604,13 @@ }else{ for(nByte=0; nByte<=iLimit && (z[nByte] | z[nByte+1]); nByte+=2){} } flags |= MEM_Term; } + if( nByte>iLimit ){ + return SQLITE_TOOBIG; + } /* The following block sets the new values of Mem.z and Mem.xDel. It ** also sets a flag in local variable "flags" to indicate the memory ** management (one of MEM_Dyn or MEM_Static). */ @@ -655,13 +617,10 @@ if( xDel==SQLITE_TRANSIENT ){ int nAlloc = nByte; if( flags&MEM_Term ){ nAlloc += (enc==SQLITE_UTF8?1:2); } - if( nByte>iLimit ){ - return SQLITE_TOOBIG; - } if( sqlite3VdbeMemGrow(pMem, nAlloc, 0) ){ return SQLITE_NOMEM; } memcpy(pMem->z, z, nAlloc); }else if( xDel==SQLITE_DYNAMIC ){ @@ -672,13 +631,10 @@ sqlite3VdbeMemRelease(pMem); pMem->z = (char *)z; pMem->xDel = xDel; flags |= ((xDel==SQLITE_STATIC)?MEM_Static:MEM_Dyn); } - if( nByte>iLimit ){ - return SQLITE_TOOBIG; - } pMem->n = nByte; pMem->flags = flags; pMem->enc = (enc==0 ? SQLITE_UTF8 : enc); pMem->type = (enc==0 ? SQLITE_BLOB : SQLITE_TEXT); @@ -710,11 +666,10 @@ ** DESC order. */ f1 = pMem1->flags; f2 = pMem2->flags; combined_flags = f1|f2; - assert( (combined_flags & MEM_RowSet)==0 ); /* If one value is NULL, it is less than the other. If both values ** are NULL, return 0. */ if( combined_flags&MEM_Null ){ @@ -733,16 +688,16 @@ return -1; } if( (f1 & f2 & MEM_Int)==0 ){ double r1, r2; if( (f1&MEM_Real)==0 ){ - r1 = (double)pMem1->u.i; + r1 = pMem1->u.i; }else{ r1 = pMem1->r; } if( (f2&MEM_Real)==0 ){ - r2 = (double)pMem2->u.i; + r2 = pMem2->u.i; }else{ r2 = pMem2->r; } if( r1r2 ) return 1; @@ -838,11 +793,10 @@ sqlite3 *db; /* Database connection */ int rc = SQLITE_OK; db = sqlite3BtreeCursorDb(pCur); assert( sqlite3_mutex_held(db->mutex) ); - assert( (pMem->flags & MEM_RowSet)==0 ); if( key ){ zData = (char *)sqlite3BtreeKeyFetch(pCur, &available); }else{ zData = (char *)sqlite3BtreeDataFetch(pCur, &available); } @@ -870,10 +824,59 @@ pMem->n = amt; return rc; } +#if 0 +/* +** Perform various checks on the memory cell pMem. An assert() will +** fail if pMem is internally inconsistent. +*/ +void sqlite3VdbeMemSanity(Mem *pMem){ + int flags = pMem->flags; + assert( flags!=0 ); /* Must define some type */ + if( flags & (MEM_Str|MEM_Blob) ){ + int x = flags & (MEM_Static|MEM_Dyn|MEM_Ephem|MEM_Short); + assert( x!=0 ); /* Strings must define a string subtype */ + assert( (x & (x-1))==0 ); /* Only one string subtype can be defined */ + assert( pMem->z!=0 ); /* Strings must have a value */ + /* Mem.z points to Mem.zShort iff the subtype is MEM_Short */ + assert( (x & MEM_Short)==0 || pMem->z==pMem->zShort ); + assert( (x & MEM_Short)!=0 || pMem->z!=pMem->zShort ); + /* No destructor unless there is MEM_Dyn */ + assert( pMem->xDel==0 || (pMem->flags & MEM_Dyn)!=0 ); + + if( (flags & MEM_Str) ){ + assert( pMem->enc==SQLITE_UTF8 || + pMem->enc==SQLITE_UTF16BE || + pMem->enc==SQLITE_UTF16LE + ); + /* If the string is UTF-8 encoded and nul terminated, then pMem->n + ** must be the length of the string. (Later:) If the database file + ** has been corrupted, '\000' characters might have been inserted + ** into the middle of the string. In that case, the strlen() might + ** be less. + */ + if( pMem->enc==SQLITE_UTF8 && (flags & MEM_Term) ){ + assert( strlen(pMem->z)<=pMem->n ); + assert( pMem->z[pMem->n]==0 ); + } + } + }else{ + /* Cannot define a string subtype for non-string objects */ + assert( (pMem->flags & (MEM_Static|MEM_Dyn|MEM_Ephem|MEM_Short))==0 ); + assert( pMem->xDel==0 ); + } + /* MEM_Null excludes all other types */ + assert( (pMem->flags&(MEM_Str|MEM_Int|MEM_Real|MEM_Blob))==0 + || (pMem->flags&MEM_Null)==0 ); + /* If the MEM is both real and integer, the values are equal */ + assert( (pMem->flags & (MEM_Int|MEM_Real))!=(MEM_Int|MEM_Real) + || pMem->r==pMem->u.i ); +} +#endif + /* This function is only available internally, it is not part of the ** external API. It works in a similar way to sqlite3_value_text(), ** except the data returned is in the encoding specified by the second ** parameter, which must be one of SQLITE_UTF16BE, SQLITE_UTF16LE or ** SQLITE_UTF8. @@ -885,11 +888,10 @@ const void *sqlite3ValueText(sqlite3_value* pVal, u8 enc){ if( !pVal ) return 0; assert( pVal->db==0 || sqlite3_mutex_held(pVal->db->mutex) ); assert( (enc&3)==(enc&~SQLITE_UTF16_ALIGNED) ); - assert( (pVal->flags & MEM_RowSet)==0 ); if( pVal->flags&MEM_Null ){ return 0; } assert( (MEM_Blob>>3) == MEM_Str ); @@ -905,11 +907,11 @@ } sqlite3VdbeMemNulTerminate(pVal); }else{ assert( (pVal->flags&MEM_Blob)==0 ); sqlite3VdbeMemStringify(pVal, enc); - assert( 0==(1&SQLITE_PTR_TO_INT(pVal->z)) ); + assert( 0==(1&(int)pVal->z) ); } assert(pVal->enc==(enc & ~SQLITE_UTF16_ALIGNED) || pVal->db==0 || pVal->db->mallocFailed ); if( pVal->enc==(enc & ~SQLITE_UTF16_ALIGNED) ){ return pVal->z; @@ -970,12 +972,11 @@ sqlite3ValueApplyAffinity(pVal, affinity, enc); } }else if( op==TK_UMINUS ) { if( SQLITE_OK==sqlite3ValueFromExpr(db,pExpr->pLeft,enc,affinity,&pVal) ){ pVal->u.i = -1 * pVal->u.i; - /* (double)-1 In case of SQLITE_OMIT_FLOATING_POINT... */ - pVal->r = (double)-1 * pVal->r; + pVal->r = -1.0 * pVal->r; } } #ifndef SQLITE_OMIT_BLOB_LITERAL else if( op==TK_BLOB ){ int nVal; @@ -982,11 +983,10 @@ assert( pExpr->token.n>=3 ); assert( pExpr->token.z[0]=='x' || pExpr->token.z[0]=='X' ); assert( pExpr->token.z[1]=='\'' ); assert( pExpr->token.z[pExpr->token.n-1]=='\'' ); pVal = sqlite3ValueNew(db); - if( !pVal ) goto no_mem; nVal = pExpr->token.n - 3; zVal = (char*)pExpr->token.z + 2; sqlite3VdbeMemSetStr(pVal, sqlite3HexToBlob(db, zVal, nVal), nVal/2, 0, SQLITE_DYNAMIC); } @@ -1031,12 +1031,12 @@ */ int sqlite3ValueBytes(sqlite3_value *pVal, u8 enc){ Mem *p = (Mem*)pVal; if( (p->flags & MEM_Blob)!=0 || sqlite3ValueText(pVal, enc) ){ if( p->flags & MEM_Zero ){ - return p->n + p->u.nZero; + return p->n+p->u.i; }else{ return p->n; } } return 0; } Index: src/vtab.c ================================================================== --- src/vtab.c +++ src/vtab.c @@ -9,11 +9,11 @@ ** May you share freely, never taking more than you give. ** ************************************************************************* ** This file contains code used to help implement virtual tables. ** -** $Id: vtab.c,v 1.81 2008/12/10 19:26:24 drh Exp $ +** $Id: vtab.c,v 1.76 2008/08/20 16:35:10 drh Exp $ */ #ifndef SQLITE_OMIT_VIRTUALTABLE #include "sqliteInt.h" static int createModule( @@ -25,11 +25,11 @@ ) { int rc, nName; Module *pMod; sqlite3_mutex_enter(db->mutex); - nName = sqlite3Strlen30(zName); + nName = strlen(zName); pMod = (Module *)sqlite3DbMallocRaw(db, sizeof(Module) + nName + 1); if( pMod ){ Module *pDel; char *zCopy = (char *)(&pMod[1]); memcpy(zCopy, zName, nName+1); @@ -44,12 +44,10 @@ sqlite3DbFree(db, pDel); if( pDel==pMod ){ db->mallocFailed = 1; } sqlite3ResetInternalSchema(db, 0); - }else if( xDestroy ){ - xDestroy(pAux); } rc = sqlite3ApiExit(db, SQLITE_OK); sqlite3_mutex_leave(db->mutex); return rc; } @@ -191,11 +189,11 @@ pTable->tabFlags |= TF_Virtual; pTable->nModuleArg = 0; addModuleArgument(db, pTable, sqlite3NameFromToken(db, pModuleName)); addModuleArgument(db, pTable, sqlite3DbStrDup(db, db->aDb[iDb].zName)); addModuleArgument(db, pTable, sqlite3DbStrDup(db, pTable->zName)); - pParse->sNameToken.n = (int)(&pModuleName->z[pModuleName->n] - pName1->z); + pParse->sNameToken.n = pModuleName->z + pModuleName->n - pName1->z; #ifndef SQLITE_OMIT_AUTHORIZATION /* Creating a virtual table invokes the authorization callback twice. ** The first invocation, to obtain permission to INSERT a row into the ** sqlite_master table, has already been made by sqlite3StartTable(). @@ -239,12 +237,11 @@ pTab = pParse->pNewTable; if( pTab==0 ) return; db = pParse->db; if( pTab->nModuleArg<1 ) return; zModule = pTab->azModuleArg[0]; - pMod = (Module*)sqlite3HashFind(&db->aModule, zModule, - sqlite3Strlen30(zModule)); + pMod = (Module *)sqlite3HashFind(&db->aModule, zModule, strlen(zModule)); pTab->pMod = pMod; /* If the CREATE VIRTUAL TABLE statement is being entered for the ** first time (in other words if the virtual table is actually being ** created now instead of just being read out of sqlite_master) then @@ -257,11 +254,11 @@ int iDb; Vdbe *v; /* Compute the complete text of the CREATE VIRTUAL TABLE statement */ if( pEnd ){ - pParse->sNameToken.n = (int)(pEnd->z - pParse->sNameToken.z) + pEnd->n; + pParse->sNameToken.n = pEnd->z - pParse->sNameToken.z + pEnd->n; } zStmt = sqlite3MPrintf(db, "CREATE VIRTUAL TABLE %T", &pParse->sNameToken); /* A slot for the record has already been allocated in the ** SQLITE_MASTER table. We just need to update that slot with all @@ -288,11 +285,11 @@ sqlite3VdbeAddOp2(v, OP_Expire, 0, 0); zWhere = sqlite3MPrintf(db, "name='%q'", pTab->zName); sqlite3VdbeAddOp4(v, OP_ParseSchema, iDb, 1, 0, zWhere, P4_DYNAMIC); sqlite3VdbeAddOp4(v, OP_VCreate, iDb, 0, 0, - pTab->zName, sqlite3Strlen30(pTab->zName) + 1); + pTab->zName, strlen(pTab->zName) + 1); } /* If we are rereading the sqlite_master table create the in-memory ** record of the table. If the module has already been registered, ** also call the xConnect method here. @@ -299,11 +296,11 @@ */ else { Table *pOld; Schema *pSchema = pTab->pSchema; const char *zName = pTab->zName; - int nName = sqlite3Strlen30(zName) + 1; + int nName = strlen(zName) + 1; pOld = sqlite3HashInsert(&pSchema->tblHash, zName, nName, pTab); if( pOld ){ db->mallocFailed = 1; assert( pTab==pOld ); /* Malloc must have failed inside HashInsert() */ return; @@ -332,11 +329,11 @@ if( pArg->z==0 ){ pArg->z = p->z; pArg->n = p->n; }else{ assert(pArg->z < p->z); - pArg->n = (int)(&p->z[p->n] - pArg->z); + pArg->n = (p->z + p->n - pArg->z); } } /* ** Invoke a virtual table constructor (either xCreate or xConnect). The @@ -404,11 +401,11 @@ for(iCol=0; iColnCol; iCol++){ char *zType = pTab->aCol[iCol].zType; int nType; int i = 0; if( !zType ) continue; - nType = sqlite3Strlen30(zType); + nType = strlen(zType); if( sqlite3StrNICmp("hidden", zType, 6) || (zType[6] && zType[6]!=' ') ){ for(i=0; iaVTrans is NULL and db->nVTrans is greater ** than zero, then this function is being called from within a ** virtual module xSync() callback. It is illegal to write to ** virtual module tables in this case, so return SQLITE_LOCKED. */ - if( sqlite3VtabInSync(db) ){ + if( 0==db->aVTrans && db->nVTrans>0 ){ return SQLITE_LOCKED; } if( !pVtab ){ return SQLITE_OK; } @@ -761,12 +758,12 @@ Expr *pExpr /* First argument to the function */ ){ Table *pTab; sqlite3_vtab *pVtab; sqlite3_module *pMod; - void (*xFunc)(sqlite3_context*,int,sqlite3_value**) = 0; - void *pArg = 0; + void (*xFunc)(sqlite3_context*,int,sqlite3_value**); + void *pArg; FuncDef *pNew; int rc = 0; char *zLowerName; unsigned char *z; @@ -803,18 +800,17 @@ return pDef; } /* Create a new ephemeral function definition for the overloaded ** function */ - pNew = sqlite3DbMallocZero(db, sizeof(*pNew) - + sqlite3Strlen30(pDef->zName) ); + pNew = sqlite3DbMallocZero(db, sizeof(*pNew) + strlen(pDef->zName) ); if( pNew==0 ){ return pDef; } *pNew = *pDef; pNew->zName = (char *)&pNew[1]; - memcpy(pNew->zName, pDef->zName, sqlite3Strlen30(pDef->zName)+1); + memcpy(pNew->zName, pDef->zName, strlen(pDef->zName)+1); pNew->xFunc = xFunc; pNew->pUserData = pArg; pNew->flags |= SQLITE_FUNC_EPHEM; return pNew; } Index: src/where.c ================================================================== --- src/where.c +++ src/where.c @@ -14,14 +14,19 @@ ** generating the code that loops through a table looking for applicable ** rows. Indices are selected and used to speed the search when doing ** so is applicable. Because this module is responsible for selecting ** indices, you might also think of this module as the "query optimizer". ** -** $Id: where.c,v 1.368 2009/02/04 03:59:25 shane Exp $ +** $Id: where.c,v 1.326 2008/10/11 16:47:36 drh Exp $ */ #include "sqliteInt.h" +/* +** The number of bits in a Bitmask. "BMS" means "BitMask Size". +*/ +#define BMS (sizeof(Bitmask)*8) + /* ** Trace output macros */ #if defined(SQLITE_TEST) || defined(SQLITE_DEBUG) int sqlite3WhereTrace = 0; @@ -33,22 +38,16 @@ #endif /* Forward reference */ typedef struct WhereClause WhereClause; -typedef struct WhereMaskSet WhereMaskSet; -typedef struct WhereOrInfo WhereOrInfo; -typedef struct WhereAndInfo WhereAndInfo; -typedef struct WhereCost WhereCost; +typedef struct ExprMaskSet ExprMaskSet; /* ** The query generator uses an array of instances of this structure to ** help it analyze the subexpressions of the WHERE clause. Each WHERE -** clause subexpression is separated from the others by AND operators. -** (Note: the same data structure is also reused to hold a group of terms -** separated by OR operators. But at the top-level, everything is AND -** separated.) +** clause subexpression is separated from the others by an AND operator. ** ** All WhereTerms are collected into a single WhereClause structure. ** The following identity holds: ** ** WhereTerm.pWC->a[WhereTerm.idx] == WhereTerm @@ -56,103 +55,62 @@ ** When a term is of the form: ** ** X ** ** where X is a column name and is one of certain operators, -** then WhereTerm.leftCursor and WhereTerm.u.leftColumn record the -** cursor number and column number for X. WhereTerm.eOperator records +** then WhereTerm.leftCursor and WhereTerm.leftColumn record the +** cursor number and column number for X. WhereTerm.operator records ** the using a bitmask encoding defined by WO_xxx below. The ** use of a bitmask encoding for the operator allows us to search ** quickly for terms that match any of several different operators. ** -** A WhereTerm might also be two or more subterms connected by OR: -** -** (t1.X ) OR (t1.Y ) OR .... -** -** In this second case, wtFlag as the TERM_ORINFO set and eOperator==WO_OR -** and the WhereTerm.u.pOrInfo field points to auxiliary information that -** is collected about the -** -** If a term in the WHERE clause does not match either of the two previous -** categories, then eOperator==0. The WhereTerm.pExpr field is still set -** to the original subexpression content and wtFlags is set up appropriately -** but no other fields in the WhereTerm object are meaningful. -** -** When eOperator!=0, prereqRight and prereqAll record sets of cursor numbers, -** but they do so indirectly. A single WhereMaskSet structure translates +** prereqRight and prereqAll record sets of cursor numbers, +** but they do so indirectly. A single ExprMaskSet structure translates ** cursor number into bits and the translated bit is stored in the prereq ** fields. The translation is used in order to maximize the number of ** bits that will fit in a Bitmask. The VDBE cursor numbers might be ** spread out over the non-negative integers. For example, the cursor -** numbers might be 3, 8, 9, 10, 20, 23, 41, and 45. The WhereMaskSet +** numbers might be 3, 8, 9, 10, 20, 23, 41, and 45. The ExprMaskSet ** translates these sparse cursor numbers into consecutive integers ** beginning with 0 in order to make the best possible use of the available ** bits in the Bitmask. So, in the example above, the cursor numbers ** would be mapped into integers 0 through 7. -** -** The number of terms in a join is limited by the number of bits -** in prereqRight and prereqAll. The default is 64 bits, hence SQLite -** is only able to process joins with 64 or fewer tables. */ typedef struct WhereTerm WhereTerm; struct WhereTerm { - Expr *pExpr; /* Pointer to the subexpression that is this term */ - int iParent; /* Disable pWC->a[iParent] when this term disabled */ - int leftCursor; /* Cursor number of X in "X " */ - union { - int leftColumn; /* Column number of X in "X " */ - WhereOrInfo *pOrInfo; /* Extra information if eOperator==WO_OR */ - WhereAndInfo *pAndInfo; /* Extra information if eOperator==WO_AND */ - } u; + Expr *pExpr; /* Pointer to the subexpression */ + i16 iParent; /* Disable pWC->a[iParent] when this term disabled */ + i16 leftCursor; /* Cursor number of X in "X " */ + i16 leftColumn; /* Column number of X in "X " */ u16 eOperator; /* A WO_xx value describing */ - u8 wtFlags; /* TERM_xxx bit flags. See below */ + u8 flags; /* Bit flags. See below */ u8 nChild; /* Number of children that must disable us */ WhereClause *pWC; /* The clause this term is part of */ - Bitmask prereqRight; /* Bitmask of tables used by pExpr->pRight */ - Bitmask prereqAll; /* Bitmask of tables referenced by pExpr */ + Bitmask prereqRight; /* Bitmask of tables used by pRight */ + Bitmask prereqAll; /* Bitmask of tables referenced by p */ }; /* -** Allowed values of WhereTerm.wtFlags +** Allowed values of WhereTerm.flags */ #define TERM_DYNAMIC 0x01 /* Need to call sqlite3ExprDelete(db, pExpr) */ #define TERM_VIRTUAL 0x02 /* Added by the optimizer. Do not code */ #define TERM_CODED 0x04 /* This term is already coded */ #define TERM_COPIED 0x08 /* Has a child */ -#define TERM_ORINFO 0x10 /* Need to free the WhereTerm.u.pOrInfo object */ -#define TERM_ANDINFO 0x20 /* Need to free the WhereTerm.u.pAndInfo obj */ -#define TERM_OR_OK 0x40 /* Used during OR-clause processing */ +#define TERM_OR_OK 0x10 /* Used during OR-clause processing */ /* ** An instance of the following structure holds all information about a ** WHERE clause. Mostly this is a container for one or more WhereTerms. */ struct WhereClause { Parse *pParse; /* The parser context */ - WhereMaskSet *pMaskSet; /* Mapping of table cursor numbers to bitmasks */ - u8 op; /* Split operator. TK_AND or TK_OR */ + ExprMaskSet *pMaskSet; /* Mapping of table indices to bitmasks */ int nTerm; /* Number of terms */ int nSlot; /* Number of entries in a[] */ WhereTerm *a; /* Each a[] describes a term of the WHERE cluase */ - WhereTerm aStatic[4]; /* Initial static space for a[] */ -}; - -/* -** A WhereTerm with eOperator==WO_OR has its u.pOrInfo pointer set to -** a dynamically allocated instance of the following structure. -*/ -struct WhereOrInfo { - WhereClause wc; /* Decomposition into subterms */ - Bitmask indexable; /* Bitmask of all indexable tables in the clause */ -}; - -/* -** A WhereTerm with eOperator==WO_AND has its u.pAndInfo pointer set to -** a dynamically allocated instance of the following structure. -*/ -struct WhereAndInfo { - WhereClause wc; /* The subexpression broken out */ + WhereTerm aStatic[10]; /* Initial static space for a[] */ }; /* ** An instance of the following structure keeps track of a mapping ** between VDBE cursor numbers and bits of the bitmasks in WhereTerm. @@ -163,186 +121,137 @@ ** contain gaps in the numbering sequence. But we want to make maximum ** use of the bits in our bitmasks. This structure provides a mapping ** from the sparse cursor numbers into consecutive integers beginning ** with 0. ** -** If WhereMaskSet.ix[A]==B it means that The A-th bit of a Bitmask +** If ExprMaskSet.ix[A]==B it means that The A-th bit of a Bitmask ** corresponds VDBE cursor number B. The A-th bit of a bitmask is 1<3, 5->1, 8->2, 29->0, ** 57->5, 73->4. Or one of 719 other combinations might be used. It ** does not really matter. What is important is that sparse cursor ** numbers all get mapped into bit numbers that begin with 0 and contain ** no gaps. */ -struct WhereMaskSet { +struct ExprMaskSet { int n; /* Number of assigned cursor values */ - int ix[BMS]; /* Cursor assigned to each bit */ + int ix[sizeof(Bitmask)*8]; /* Cursor assigned to each bit */ }; -/* -** A WhereCost object records a lookup strategy and the estimated -** cost of pursuing that strategy. -*/ -struct WhereCost { - WherePlan plan; /* The lookup strategy */ - double rCost; /* Overall cost of pursuing this search strategy */ - double nRow; /* Estimated number of output rows */ -}; /* ** Bitmasks for the operators that indices are able to exploit. An ** OR-ed combination of these values can be used when searching for ** terms in the where clause. */ -#define WO_IN 0x001 -#define WO_EQ 0x002 +#define WO_IN 1 +#define WO_EQ 2 #define WO_LT (WO_EQ<<(TK_LT-TK_EQ)) #define WO_LE (WO_EQ<<(TK_LE-TK_EQ)) #define WO_GT (WO_EQ<<(TK_GT-TK_EQ)) #define WO_GE (WO_EQ<<(TK_GE-TK_EQ)) -#define WO_MATCH 0x040 -#define WO_ISNULL 0x080 -#define WO_OR 0x100 /* Two or more OR-connected terms */ -#define WO_AND 0x200 /* Two or more AND-connected terms */ - -#define WO_ALL 0xfff /* Mask of all possible WO_* values */ -#define WO_SINGLE 0x0ff /* Mask of all non-compound WO_* values */ +#define WO_MATCH 64 +#define WO_ISNULL 128 /* -** Value for wsFlags returned by bestIndex() and stored in -** WhereLevel.wsFlags. These flags determine which search -** strategies are appropriate. +** Value for flags returned by bestIndex(). ** -** The least significant 12 bits is reserved as a mask for WO_ values above. -** The WhereLevel.wsFlags field is usually set to WO_IN|WO_EQ|WO_ISNULL. -** But if the table is the right table of a left join, WhereLevel.wsFlags -** is set to WO_IN|WO_EQ. The WhereLevel.wsFlags field can then be used as +** The least significant byte is reserved as a mask for WO_ values above. +** The WhereLevel.flags field is usually set to WO_IN|WO_EQ|WO_ISNULL. +** But if the table is the right table of a left join, WhereLevel.flags +** is set to WO_IN|WO_EQ. The WhereLevel.flags field can then be used as ** the "op" parameter to findTerm when we are resolving equality constraints. ** ISNULL constraints will then not be used on the right table of a left ** join. Tickets #2177 and #2189. */ -#define WHERE_ROWID_EQ 0x00001000 /* rowid=EXPR or rowid IN (...) */ -#define WHERE_ROWID_RANGE 0x00002000 /* rowidEXPR */ -#define WHERE_COLUMN_EQ 0x00010000 /* x=EXPR or x IN (...) */ -#define WHERE_COLUMN_RANGE 0x00020000 /* xEXPR */ -#define WHERE_COLUMN_IN 0x00040000 /* x IN (...) */ -#define WHERE_INDEXED 0x00070000 /* Anything that uses an index */ -#define WHERE_IN_ABLE 0x00071000 /* Able to support an IN operator */ -#define WHERE_TOP_LIMIT 0x00100000 /* xEXPR or x>=EXPR constraint */ -#define WHERE_IDX_ONLY 0x00800000 /* Use index only - omit table */ -#define WHERE_ORDERBY 0x01000000 /* Output will appear in correct order */ -#define WHERE_REVERSE 0x02000000 /* Scan in reverse order */ -#define WHERE_UNIQUE 0x04000000 /* Selects no more than one row */ -#define WHERE_VIRTUALTABLE 0x08000000 /* Use virtual-table processing */ -#define WHERE_MULTI_OR 0x10000000 /* OR using multiple indices */ +#define WHERE_ROWID_EQ 0x000100 /* rowid=EXPR or rowid IN (...) */ +#define WHERE_ROWID_RANGE 0x000200 /* rowidEXPR */ +#define WHERE_COLUMN_EQ 0x001000 /* x=EXPR or x IN (...) */ +#define WHERE_COLUMN_RANGE 0x002000 /* xEXPR */ +#define WHERE_COLUMN_IN 0x004000 /* x IN (...) */ +#define WHERE_TOP_LIMIT 0x010000 /* xEXPR or x>=EXPR constraint */ +#define WHERE_IDX_ONLY 0x080000 /* Use index only - omit table */ +#define WHERE_ORDERBY 0x100000 /* Output will appear in correct order */ +#define WHERE_REVERSE 0x200000 /* Scan in reverse order */ +#define WHERE_UNIQUE 0x400000 /* Selects no more than one row */ +#define WHERE_VIRTUALTABLE 0x800000 /* Use virtual-table processing */ /* ** Initialize a preallocated WhereClause structure. */ static void whereClauseInit( WhereClause *pWC, /* The WhereClause to be initialized */ Parse *pParse, /* The parsing context */ - WhereMaskSet *pMaskSet /* Mapping from table cursor numbers to bitmasks */ + ExprMaskSet *pMaskSet /* Mapping from table indices to bitmasks */ ){ pWC->pParse = pParse; pWC->pMaskSet = pMaskSet; pWC->nTerm = 0; pWC->nSlot = ArraySize(pWC->aStatic); pWC->a = pWC->aStatic; } -/* Forward reference */ -static void whereClauseClear(WhereClause*); - -/* -** Deallocate all memory associated with a WhereOrInfo object. -*/ -static void whereOrInfoDelete(sqlite3 *db, WhereOrInfo *p){ - whereClauseClear(&p->wc); - sqlite3DbFree(db, p); -} - -/* -** Deallocate all memory associated with a WhereAndInfo object. -*/ -static void whereAndInfoDelete(sqlite3 *db, WhereAndInfo *p){ - whereClauseClear(&p->wc); - sqlite3DbFree(db, p); -} - /* ** Deallocate a WhereClause structure. The WhereClause structure ** itself is not freed. This routine is the inverse of whereClauseInit(). */ static void whereClauseClear(WhereClause *pWC){ int i; WhereTerm *a; sqlite3 *db = pWC->pParse->db; for(i=pWC->nTerm-1, a=pWC->a; i>=0; i--, a++){ - if( a->wtFlags & TERM_DYNAMIC ){ + if( a->flags & TERM_DYNAMIC ){ sqlite3ExprDelete(db, a->pExpr); } - if( a->wtFlags & TERM_ORINFO ){ - whereOrInfoDelete(db, a->u.pOrInfo); - }else if( a->wtFlags & TERM_ANDINFO ){ - whereAndInfoDelete(db, a->u.pAndInfo); - } } if( pWC->a!=pWC->aStatic ){ sqlite3DbFree(db, pWC->a); } } /* -** Add a single new WhereTerm entry to the WhereClause object pWC. -** The new WhereTerm object is constructed from Expr p and with wtFlags. -** The index in pWC->a[] of the new WhereTerm is returned on success. -** 0 is returned if the new WhereTerm could not be added due to a memory -** allocation error. The memory allocation failure will be recorded in -** the db->mallocFailed flag so that higher-level functions can detect it. -** -** This routine will increase the size of the pWC->a[] array as necessary. -** -** If the wtFlags argument includes TERM_DYNAMIC, then responsibility -** for freeing the expression p is assumed by the WhereClause object pWC. -** This is true even if this routine fails to allocate a new WhereTerm. +** Add a new entries to the WhereClause structure. Increase the allocated +** space as necessary. +** +** If the flags argument includes TERM_DYNAMIC, then responsibility +** for freeing the expression p is assumed by the WhereClause object. ** ** WARNING: This routine might reallocate the space used to store ** WhereTerms. All pointers to WhereTerms should be invalidated after ** calling this routine. Such pointers may be reinitialized by referencing ** the pWC->a[] array. */ -static int whereClauseInsert(WhereClause *pWC, Expr *p, u8 wtFlags){ +static int whereClauseInsert(WhereClause *pWC, Expr *p, int flags){ WhereTerm *pTerm; int idx; if( pWC->nTerm>=pWC->nSlot ){ WhereTerm *pOld = pWC->a; sqlite3 *db = pWC->pParse->db; pWC->a = sqlite3DbMallocRaw(db, sizeof(pWC->a[0])*pWC->nSlot*2 ); if( pWC->a==0 ){ - if( wtFlags & TERM_DYNAMIC ){ + if( flags & TERM_DYNAMIC ){ sqlite3ExprDelete(db, p); } pWC->a = pOld; return 0; } memcpy(pWC->a, pOld, sizeof(pWC->a[0])*pWC->nTerm); if( pOld!=pWC->aStatic ){ sqlite3DbFree(db, pOld); } - pWC->nSlot = sqlite3DbMallocSize(db, pWC->a)/sizeof(pWC->a[0]); + pWC->nSlot *= 2; } - pTerm = &pWC->a[idx = pWC->nTerm++]; + pTerm = &pWC->a[idx = pWC->nTerm]; + pWC->nTerm++; pTerm->pExpr = p; - pTerm->wtFlags = wtFlags; + pTerm->flags = flags; pTerm->pWC = pWC; pTerm->iParent = -1; return idx; } @@ -358,15 +267,14 @@ ** ** The original WHERE clause in pExpr is unaltered. All this routine ** does is make slot[] entries point to substructure within pExpr. ** ** In the previous sentence and in the diagram, "slot[]" refers to -** the WhereClause.a[] array. The slot[] array grows as needed to contain +** the WhereClause.a[] array. This array grows as needed to contain ** all terms of the WHERE clause. */ static void whereSplit(WhereClause *pWC, Expr *pExpr, int op){ - pWC->op = (u8)op; if( pExpr==0 ) return; if( pExpr->op!=op ){ whereClauseInsert(pWC, pExpr, 0); }else{ whereSplit(pWC, pExpr->pLeft, op); @@ -381,11 +289,11 @@ /* ** Return the bitmask for the given cursor number. Return 0 if ** iCursor is not in the set. */ -static Bitmask getMask(WhereMaskSet *pMaskSet, int iCursor){ +static Bitmask getMask(ExprMaskSet *pMaskSet, int iCursor){ int i; for(i=0; in; i++){ if( pMaskSet->ix[i]==iCursor ){ return ((Bitmask)1)<ix[] ** array will never overflow. */ -static void createMask(WhereMaskSet *pMaskSet, int iCursor){ +static void createMask(ExprMaskSet *pMaskSet, int iCursor){ assert( pMaskSet->n < ArraySize(pMaskSet->ix) ); pMaskSet->ix[pMaskSet->n++] = iCursor; } /* @@ -418,13 +326,13 @@ ** sets their opcodes to TK_COLUMN and their Expr.iTable fields to ** the VDBE cursor number of the table. This routine just has to ** translate the cursor numbers into bitmask values and OR all ** the bitmasks together. */ -static Bitmask exprListTableUsage(WhereMaskSet*, ExprList*); -static Bitmask exprSelectTableUsage(WhereMaskSet*, Select*); -static Bitmask exprTableUsage(WhereMaskSet *pMaskSet, Expr *p){ +static Bitmask exprListTableUsage(ExprMaskSet*, ExprList*); +static Bitmask exprSelectTableUsage(ExprMaskSet*, Select*); +static Bitmask exprTableUsage(ExprMaskSet *pMaskSet, Expr *p){ Bitmask mask = 0; if( p==0 ) return 0; if( p->op==TK_COLUMN ){ mask = getMask(pMaskSet, p->iTable); return mask; @@ -433,21 +341,21 @@ mask |= exprTableUsage(pMaskSet, p->pLeft); mask |= exprListTableUsage(pMaskSet, p->pList); mask |= exprSelectTableUsage(pMaskSet, p->pSelect); return mask; } -static Bitmask exprListTableUsage(WhereMaskSet *pMaskSet, ExprList *pList){ +static Bitmask exprListTableUsage(ExprMaskSet *pMaskSet, ExprList *pList){ int i; Bitmask mask = 0; if( pList ){ for(i=0; inExpr; i++){ mask |= exprTableUsage(pMaskSet, pList->a[i].pExpr); } } return mask; } -static Bitmask exprSelectTableUsage(WhereMaskSet *pMaskSet, Select *pS){ +static Bitmask exprSelectTableUsage(ExprMaskSet *pMaskSet, Select *pS){ Bitmask mask = 0; while( pS ){ mask |= exprListTableUsage(pMaskSet, pS->pEList); mask |= exprListTableUsage(pMaskSet, pS->pGroupBy); mask |= exprListTableUsage(pMaskSet, pS->pOrderBy); @@ -470,11 +378,11 @@ assert( TK_GE==TK_EQ+4 ); return op==TK_IN || (op>=TK_EQ && op<=TK_GE) || op==TK_ISNULL; } /* -** Swap two objects of type TYPE. +** Swap two objects of type T. */ #define SWAP(TYPE,A,B) {TYPE t=A; A=B; B=t;} /* ** Commute a comparison operator. Expressions of the form "X op Y" @@ -509,20 +417,19 @@ } /* ** Translate from TK_xx operator to WO_xx bitmask. */ -static u16 operatorMask(int op){ - u16 c; +static int operatorMask(int op){ + int c; assert( allowedOp(op) ); if( op==TK_IN ){ c = WO_IN; }else if( op==TK_ISNULL ){ c = WO_ISNULL; }else{ - assert( (WO_EQ<<(op-TK_EQ)) < 0x7fff ); - c = (u16)(WO_EQ<<(op-TK_EQ)); + c = WO_EQ<<(op-TK_EQ); } assert( op!=TK_ISNULL || c==WO_ISNULL ); assert( op!=TK_IN || c==WO_IN ); assert( op!=TK_EQ || c==WO_EQ ); assert( op!=TK_LT || c==WO_LT ); @@ -541,21 +448,20 @@ static WhereTerm *findTerm( WhereClause *pWC, /* The WHERE clause to be searched */ int iCur, /* Cursor number of LHS */ int iColumn, /* Column number of LHS */ Bitmask notReady, /* RHS must not overlap with this mask */ - u32 op, /* Mask of WO_xx values describing operator */ + u16 op, /* Mask of WO_xx values describing operator */ Index *pIdx /* Must be compatible with this index, if not NULL */ ){ WhereTerm *pTerm; int k; assert( iCur>=0 ); - op &= WO_ALL; for(pTerm=pWC->a, k=pWC->nTerm; k; k--, pTerm++){ if( pTerm->leftCursor==iCur && (pTerm->prereqRight & notReady)==0 - && pTerm->u.leftColumn==iColumn + && pTerm->leftColumn==iColumn && (pTerm->eOperator & op)!=0 ){ if( pIdx && pTerm->eOperator!=WO_ISNULL ){ Expr *pX = pTerm->pExpr; CollSeq *pColl; @@ -570,16 +476,18 @@ ** it to be useful for optimising expression pX. Store this ** value in variable pColl. */ assert(pX->pLeft); pColl = sqlite3BinaryCompareCollSeq(pParse, pX->pLeft, pX->pRight); - assert(pColl || pParse->nErr); + if( !pColl ){ + pColl = pParse->db->pDfltColl; + } for(j=0; pIdx->aiColumn[j]!=iColumn; j++){ if( NEVER(j>=pIdx->nColumn) ) return 0; } - if( pColl && sqlite3StrICmp(pColl->zName, pIdx->azColl[j]) ) continue; + if( sqlite3StrICmp(pColl->zName, pIdx->azColl[j]) ) continue; } return pTerm; } } return 0; @@ -617,28 +525,28 @@ Expr *pExpr, /* Test this expression */ int *pnPattern, /* Number of non-wildcard prefix characters */ int *pisComplete, /* True if the only wildcard is % in the last character */ int *pnoCase /* True if uppercase is equivalent to lowercase */ ){ - const char *z; /* String on RHS of LIKE operator */ - Expr *pRight, *pLeft; /* Right and left size of LIKE operator */ - ExprList *pList; /* List of operands to the LIKE operator */ - int c; /* One character in z[] */ - int cnt; /* Number of non-wildcard prefix characters */ - char wc[3]; /* Wildcard characters */ - CollSeq *pColl; /* Collating sequence for LHS */ - sqlite3 *db = pParse->db; /* Database connection */ + const char *z; + Expr *pRight, *pLeft; + ExprList *pList; + int c, cnt; + char wc[3]; + CollSeq *pColl; + sqlite3 *db = pParse->db; if( !sqlite3IsLikeFunction(db, pExpr, pnoCase, wc) ){ return 0; } #ifdef SQLITE_EBCDIC if( *pnoCase ) return 0; #endif pList = pExpr->pList; pRight = pList->a[0].pExpr; - if( pRight->op!=TK_STRING ){ + if( pRight->op!=TK_STRING + && (pRight->op!=TK_REGISTER || pRight->iColumn!=TK_STRING) ){ return 0; } pLeft = pList->a[1].pExpr; if( pLeft->op!=TK_COLUMN ){ return 0; @@ -657,11 +565,11 @@ z = (char *)pRight->token.z; cnt = 0; if( z ){ while( (c=z[cnt])!=0 && c!=wc[0] && c!=wc[1] && c!=wc[2] ){ cnt++; } } - if( cnt==0 || 255==(u8)z[cnt-1] ){ + if( cnt==0 || 255==(u8)z[cnt] ){ return 0; } *pisComplete = z[cnt]==wc[0] && z[cnt+1]==0; *pnPattern = cnt; return 1; @@ -709,314 +617,124 @@ pDerived->iRightJoinTable = pBase->iRightJoinTable; } #if !defined(SQLITE_OMIT_OR_OPTIMIZATION) && !defined(SQLITE_OMIT_SUBQUERY) /* -** Analyze a term that consists of two or more OR-connected -** subterms. So in: -** -** ... WHERE (a=5) AND (b=7 OR c=9 OR d=13) AND (d=13) -** ^^^^^^^^^^^^^^^^^^^^ -** -** This routine analyzes terms such as the middle term in the above example. -** A WhereOrTerm object is computed and attached to the term under -** analysis, regardless of the outcome of the analysis. Hence: -** -** WhereTerm.wtFlags |= TERM_ORINFO -** WhereTerm.u.pOrInfo = a dynamically allocated WhereOrTerm object -** -** The term being analyzed must have two or more of OR-connected subterms. -** A single subterm might be a set of AND-connected sub-subterms. -** Examples of terms under analysis: -** -** (A) t1.x=t2.y OR t1.x=t2.z OR t1.y=15 OR t1.z=t3.a+5 -** (B) x=expr1 OR expr2=x OR x=expr3 -** (C) t1.x=t2.y OR (t1.x=t2.z AND t1.y=15) -** (D) x=expr1 OR (y>11 AND y<22 AND z LIKE '*hello*') -** (E) (p.a=1 AND q.b=2 AND r.c=3) OR (p.x=4 AND q.y=5 AND r.z=6) -** -** CASE 1: -** -** If all subterms are of the form T.C=expr for some single column of C -** a single table T (as shown in example B above) then create a new virtual -** term that is an equivalent IN expression. In other words, if the term -** being analyzed is: -** -** x = expr1 OR expr2 = x OR x = expr3 -** -** then create a new virtual term like this: -** -** x IN (expr1,expr2,expr3) -** -** CASE 2: -** -** If all subterms are indexable by a single table T, then set -** -** WhereTerm.eOperator = WO_OR -** WhereTerm.u.pOrInfo->indexable |= the cursor number for table T -** -** A subterm is "indexable" if it is of the form -** "T.C " where C is any column of table T and -** is one of "=", "<", "<=", ">", ">=", "IS NULL", or "IN". -** A subterm is also indexable if it is an AND of two or more -** subsubterms at least one of which is indexable. Indexable AND -** subterms have their eOperator set to WO_AND and they have -** u.pAndInfo set to a dynamically allocated WhereAndTerm object. -** -** From another point of view, "indexable" means that the subterm could -** potentially be used with an index if an appropriate index exists. -** This analysis does not consider whether or not the index exists; that -** is something the bestIndex() routine will determine. This analysis -** only looks at whether subterms appropriate for indexing exist. -** -** All examples A through E above all satisfy case 2. But if a term -** also statisfies case 1 (such as B) we know that the optimizer will -** always prefer case 1, so in that case we pretend that case 2 is not -** satisfied. -** -** It might be the case that multiple tables are indexable. For example, -** (E) above is indexable on tables P, Q, and R. -** -** Terms that satisfy case 2 are candidates for lookup by using -** separate indices to find rowids for each subterm and composing -** the union of all rowids using a RowSet object. This is similar -** to "bitmap indices" in other database engines. -** -** OTHERWISE: -** -** If neither case 1 nor case 2 apply, then leave the eOperator set to -** zero. This term is not useful for search. -*/ -static void exprAnalyzeOrTerm( - SrcList *pSrc, /* the FROM clause */ - WhereClause *pWC, /* the complete WHERE clause */ - int idxTerm /* Index of the OR-term to be analyzed */ -){ - Parse *pParse = pWC->pParse; /* Parser context */ - sqlite3 *db = pParse->db; /* Database connection */ - WhereTerm *pTerm = &pWC->a[idxTerm]; /* The term to be analyzed */ - Expr *pExpr = pTerm->pExpr; /* The expression of the term */ - WhereMaskSet *pMaskSet = pWC->pMaskSet; /* Table use masks */ - int i; /* Loop counters */ - WhereClause *pOrWc; /* Breakup of pTerm into subterms */ - WhereTerm *pOrTerm; /* A Sub-term within the pOrWc */ - WhereOrInfo *pOrInfo; /* Additional information associated with pTerm */ - Bitmask chngToIN; /* Tables that might satisfy case 1 */ - Bitmask indexable; /* Tables that are indexable, satisfying case 2 */ - - /* - ** Break the OR clause into its separate subterms. The subterms are - ** stored in a WhereClause structure containing within the WhereOrInfo - ** object that is attached to the original OR clause term. - */ - assert( (pTerm->wtFlags & (TERM_DYNAMIC|TERM_ORINFO|TERM_ANDINFO))==0 ); - assert( pExpr->op==TK_OR ); - pTerm->u.pOrInfo = pOrInfo = sqlite3DbMallocZero(db, sizeof(*pOrInfo)); - if( pOrInfo==0 ) return; - pTerm->wtFlags |= TERM_ORINFO; - pOrWc = &pOrInfo->wc; - whereClauseInit(pOrWc, pWC->pParse, pMaskSet); - whereSplit(pOrWc, pExpr, TK_OR); - exprAnalyzeAll(pSrc, pOrWc); - if( db->mallocFailed ) return; - assert( pOrWc->nTerm>=2 ); - - /* - ** Compute the set of tables that might satisfy cases 1 or 2. - */ - indexable = chngToIN = ~(Bitmask)0; - for(i=pOrWc->nTerm-1, pOrTerm=pOrWc->a; i>=0 && indexable; i--, pOrTerm++){ - if( (pOrTerm->eOperator & WO_SINGLE)==0 ){ - WhereAndInfo *pAndInfo; - assert( pOrTerm->eOperator==0 ); - assert( (pOrTerm->wtFlags & (TERM_ANDINFO|TERM_ORINFO))==0 ); - chngToIN = 0; - pAndInfo = sqlite3DbMallocRaw(db, sizeof(*pAndInfo)); - if( pAndInfo ){ - WhereClause *pAndWC; - WhereTerm *pAndTerm; - int j; - Bitmask b = 0; - pOrTerm->u.pAndInfo = pAndInfo; - pOrTerm->wtFlags |= TERM_ANDINFO; - pOrTerm->eOperator = WO_AND; - pAndWC = &pAndInfo->wc; - whereClauseInit(pAndWC, pWC->pParse, pMaskSet); - whereSplit(pAndWC, pOrTerm->pExpr, TK_AND); - exprAnalyzeAll(pSrc, pAndWC); - testcase( db->mallocFailed ); - if( !db->mallocFailed ){ - for(j=0, pAndTerm=pAndWC->a; jnTerm; j++, pAndTerm++){ - assert( pAndTerm->pExpr ); - if( allowedOp(pAndTerm->pExpr->op) ){ - b |= getMask(pMaskSet, pAndTerm->leftCursor); - } - } - } - indexable &= b; - } - }else if( pOrTerm->wtFlags & TERM_COPIED ){ - /* Skip this term for now. We revisit it when we process the - ** corresponding TERM_VIRTUAL term */ - }else{ - Bitmask b; - b = getMask(pMaskSet, pOrTerm->leftCursor); - if( pOrTerm->wtFlags & TERM_VIRTUAL ){ - WhereTerm *pOther = &pOrWc->a[pOrTerm->iParent]; - b |= getMask(pMaskSet, pOther->leftCursor); - } - indexable &= b; - if( pOrTerm->eOperator!=WO_EQ ){ - chngToIN = 0; - }else{ - chngToIN &= b; - } - } - } - - /* - ** Record the set of tables that satisfy case 2. The set might be - ** empty. - */ - pOrInfo->indexable = indexable; - pTerm->eOperator = indexable==0 ? 0 : WO_OR; - - /* - ** chngToIN holds a set of tables that *might* satisfy case 1. But - ** we have to do some additional checking to see if case 1 really - ** is satisfied. - */ - if( chngToIN ){ - int okToChngToIN = 0; /* True if the conversion to IN is valid */ - int iColumn = -1; /* Column index on lhs of IN operator */ - int iCursor = -1; /* Table cursor common to all terms */ - int j = 0; /* Loop counter */ - - /* Search for a table and column that appears on one side or the - ** other of the == operator in every subterm. That table and column - ** will be recorded in iCursor and iColumn. There might not be any - ** such table and column. Set okToChngToIN if an appropriate table - ** and column is found but leave okToChngToIN false if not found. - */ - for(j=0; j<2 && !okToChngToIN; j++){ - pOrTerm = pOrWc->a; - for(i=pOrWc->nTerm-1; i>=0; i--, pOrTerm++){ - assert( pOrTerm->eOperator==WO_EQ ); - pOrTerm->wtFlags &= ~TERM_OR_OK; - if( pOrTerm->leftCursor==iColumn ) continue; - if( (chngToIN & getMask(pMaskSet, pOrTerm->leftCursor))==0 ) continue; - iColumn = pOrTerm->u.leftColumn; - iCursor = pOrTerm->leftCursor; - break; - } - if( i<0 ){ - assert( j==1 ); - assert( (chngToIN&(chngToIN-1))==0 ); - assert( chngToIN==getMask(pMaskSet, iColumn) ); - break; - } - okToChngToIN = 1; - for(; i>=0 && okToChngToIN; i--, pOrTerm++){ - assert( pOrTerm->eOperator==WO_EQ ); - if( pOrTerm->leftCursor!=iCursor ){ - pOrTerm->wtFlags &= ~TERM_OR_OK; - }else if( pOrTerm->u.leftColumn!=iColumn ){ - okToChngToIN = 0; - }else{ - int affLeft, affRight; - /* If the right-hand side is also a column, then the affinities - ** of both right and left sides must be such that no type - ** conversions are required on the right. (Ticket #2249) - */ - affRight = sqlite3ExprAffinity(pOrTerm->pExpr->pRight); - affLeft = sqlite3ExprAffinity(pOrTerm->pExpr->pLeft); - if( affRight!=0 && affRight!=affLeft ){ - okToChngToIN = 0; - }else{ - pOrTerm->wtFlags |= TERM_OR_OK; - } - } - } - } - - /* At this point, okToChngToIN is true if original pTerm satisfies - ** case 1. In that case, construct a new virtual term that is - ** pTerm converted into an IN operator. - */ - if( okToChngToIN ){ - Expr *pDup; /* A transient duplicate expression */ - ExprList *pList = 0; /* The RHS of the IN operator */ - Expr *pLeft = 0; /* The LHS of the IN operator */ - Expr *pNew; /* The complete IN operator */ - - for(i=pOrWc->nTerm-1, pOrTerm=pOrWc->a; i>=0; i--, pOrTerm++){ - if( (pOrTerm->wtFlags & TERM_OR_OK)==0 ) continue; - assert( pOrTerm->eOperator==WO_EQ ); - assert( pOrTerm->leftCursor==iCursor ); - assert( pOrTerm->u.leftColumn==iColumn ); - pDup = sqlite3ExprDup(db, pOrTerm->pExpr->pRight); - pList = sqlite3ExprListAppend(pWC->pParse, pList, pDup, 0); - pLeft = pOrTerm->pExpr->pLeft; - } - assert( pLeft!=0 ); - pDup = sqlite3ExprDup(db, pLeft); - pNew = sqlite3Expr(db, TK_IN, pDup, 0, 0); - if( pNew ){ - int idxNew; - transferJoinMarkings(pNew, pExpr); - pNew->pList = pList; - idxNew = whereClauseInsert(pWC, pNew, TERM_VIRTUAL|TERM_DYNAMIC); - testcase( idxNew==0 ); - exprAnalyze(pSrc, pWC, idxNew); - pTerm = &pWC->a[idxTerm]; - pWC->a[idxNew].iParent = idxTerm; - pTerm->nChild = 1; - }else{ - sqlite3ExprListDelete(db, pList); - } - pTerm->eOperator = 0; /* case 1 trumps case 2 */ - } - } +** Return TRUE if the given term of an OR clause can be converted +** into an IN clause. The iCursor and iColumn define the left-hand +** side of the IN clause. +** +** The context is that we have multiple OR-connected equality terms +** like this: +** +** a= OR a= OR b= OR ... +** +** The pOrTerm input to this routine corresponds to a single term of +** this OR clause. In order for the term to be a candidate for +** conversion to an IN operator, the following must be true: +** +** * The left-hand side of the term must be the column which +** is identified by iCursor and iColumn. +** +** * If the right-hand side is also a column, then the affinities +** of both right and left sides must be such that no type +** conversions are required on the right. (Ticket #2249) +** +** If both of these conditions are true, then return true. Otherwise +** return false. +*/ +static int orTermIsOptCandidate(WhereTerm *pOrTerm, int iCursor, int iColumn){ + int affLeft, affRight; + assert( pOrTerm->eOperator==WO_EQ ); + if( pOrTerm->leftCursor!=iCursor ){ + return 0; + } + if( pOrTerm->leftColumn!=iColumn ){ + return 0; + } + affRight = sqlite3ExprAffinity(pOrTerm->pExpr->pRight); + if( affRight==0 ){ + return 1; + } + affLeft = sqlite3ExprAffinity(pOrTerm->pExpr->pLeft); + if( affRight!=affLeft ){ + return 0; + } + return 1; +} + +/* +** Return true if the given term of an OR clause can be ignored during +** a check to make sure all OR terms are candidates for optimization. +** In other words, return true if a call to the orTermIsOptCandidate() +** above returned false but it is not necessary to disqualify the +** optimization. +** +** Suppose the original OR phrase was this: +** +** a=4 OR a=11 OR a=b +** +** During analysis, the third term gets flipped around and duplicate +** so that we are left with this: +** +** a=4 OR a=11 OR a=b OR b=a +** +** Since the last two terms are duplicates, only one of them +** has to qualify in order for the whole phrase to qualify. When +** this routine is called, we know that pOrTerm did not qualify. +** This routine merely checks to see if pOrTerm has a duplicate that +** might qualify. If there is a duplicate that has not yet been +** disqualified, then return true. If there are no duplicates, or +** the duplicate has also been disqualified, return false. +*/ +static int orTermHasOkDuplicate(WhereClause *pOr, WhereTerm *pOrTerm){ + if( pOrTerm->flags & TERM_COPIED ){ + /* This is the original term. The duplicate is to the left had + ** has not yet been analyzed and thus has not yet been disqualified. */ + return 1; + } + if( (pOrTerm->flags & TERM_VIRTUAL)!=0 + && (pOr->a[pOrTerm->iParent].flags & TERM_OR_OK)!=0 ){ + /* This is a duplicate term. The original qualified so this one + ** does not have to. */ + return 1; + } + /* This is either a singleton term or else it is a duplicate for + ** which the original did not qualify. Either way we are done for. */ + return 0; } #endif /* !SQLITE_OMIT_OR_OPTIMIZATION && !SQLITE_OMIT_SUBQUERY */ - /* ** The input to this routine is an WhereTerm structure with only the ** "pExpr" field filled in. The job of this routine is to analyze the ** subexpression and populate all the other fields of the WhereTerm ** structure. ** ** If the expression is of the form " X" it gets commuted -** to the standard form of "X ". -** -** If the expression is of the form "X Y" where both X and Y are -** columns, then the original expression is unchanged and a new virtual -** term of the form "Y X" is added to the WHERE clause and -** analyzed separately. The original term is marked with TERM_COPIED -** and the new term is marked with TERM_DYNAMIC (because it's pExpr -** needs to be freed with the WhereClause) and TERM_VIRTUAL (because it -** is a commuted copy of a prior term.) The original term has nChild=1 -** and the copy has idxParent set to the index of the original term. +** to the standard form of "X ". If the expression is of +** the form "X Y" where both X and Y are columns, then the original +** expression is unchanged and a new virtual expression of the form +** "Y X" is added to the WHERE clause and analyzed separately. */ static void exprAnalyze( SrcList *pSrc, /* the FROM clause */ WhereClause *pWC, /* the WHERE clause */ int idxTerm /* Index of the term to be analyzed */ ){ - WhereTerm *pTerm; /* The term to be analyzed */ - WhereMaskSet *pMaskSet; /* Set of table index masks */ - Expr *pExpr; /* The expression to be analyzed */ - Bitmask prereqLeft; /* Prerequesites of the pExpr->pLeft */ - Bitmask prereqAll; /* Prerequesites of pExpr */ + WhereTerm *pTerm; + ExprMaskSet *pMaskSet; + Expr *pExpr; + Bitmask prereqLeft; + Bitmask prereqAll; Bitmask extraRight = 0; int nPattern; int isComplete; int noCase; - int op; /* Top-level operator. pExpr->op */ - Parse *pParse = pWC->pParse; /* Parsing context */ - sqlite3 *db = pParse->db; /* Database connection */ + int op; + Parse *pParse = pWC->pParse; + sqlite3 *db = pParse->db; if( db->mallocFailed ){ return; } pTerm = &pWC->a[idxTerm]; @@ -1047,11 +765,11 @@ if( allowedOp(op) && (pTerm->prereqRight & prereqLeft)==0 ){ Expr *pLeft = pExpr->pLeft; Expr *pRight = pExpr->pRight; if( pLeft->op==TK_COLUMN ){ pTerm->leftCursor = pLeft->iTable; - pTerm->u.leftColumn = pLeft->iColumn; + pTerm->leftColumn = pLeft->iColumn; pTerm->eOperator = operatorMask(op); } if( pRight && pRight->op==TK_COLUMN ){ WhereTerm *pNew; Expr *pDup; @@ -1066,42 +784,30 @@ if( idxNew==0 ) return; pNew = &pWC->a[idxNew]; pNew->iParent = idxTerm; pTerm = &pWC->a[idxTerm]; pTerm->nChild = 1; - pTerm->wtFlags |= TERM_COPIED; + pTerm->flags |= TERM_COPIED; }else{ pDup = pExpr; pNew = pTerm; } exprCommute(pParse, pDup); pLeft = pDup->pLeft; pNew->leftCursor = pLeft->iTable; - pNew->u.leftColumn = pLeft->iColumn; + pNew->leftColumn = pLeft->iColumn; pNew->prereqRight = prereqLeft; pNew->prereqAll = prereqAll; pNew->eOperator = operatorMask(pDup->op); } } #ifndef SQLITE_OMIT_BETWEEN_OPTIMIZATION /* If a term is the BETWEEN operator, create two new virtual terms - ** that define the range that the BETWEEN implements. For example: - ** - ** a BETWEEN b AND c - ** - ** is converted into: - ** - ** (a BETWEEN b AND c) AND (a>=b) AND (a<=c) - ** - ** The two new terms are added onto the end of the WhereClause object. - ** The new terms are "dynamic" and are children of the original BETWEEN - ** term. That means that if the BETWEEN term is coded, the children are - ** skipped. Or, if the children are satisfied by an index, the original - ** BETWEEN term is skipped. + ** that define the range that the BETWEEN implements. */ - else if( pExpr->op==TK_BETWEEN && pWC->op==TK_AND ){ + else if( pExpr->op==TK_BETWEEN ){ ExprList *pList = pExpr->pList; int i; static const u8 ops[] = {TK_GE, TK_LE}; assert( pList!=0 ); assert( pList->nExpr==2 ); @@ -1109,26 +815,91 @@ Expr *pNewExpr; int idxNew; pNewExpr = sqlite3Expr(db, ops[i], sqlite3ExprDup(db, pExpr->pLeft), sqlite3ExprDup(db, pList->a[i].pExpr), 0); idxNew = whereClauseInsert(pWC, pNewExpr, TERM_VIRTUAL|TERM_DYNAMIC); - testcase( idxNew==0 ); exprAnalyze(pSrc, pWC, idxNew); pTerm = &pWC->a[idxTerm]; pWC->a[idxNew].iParent = idxTerm; } pTerm->nChild = 2; } #endif /* SQLITE_OMIT_BETWEEN_OPTIMIZATION */ #if !defined(SQLITE_OMIT_OR_OPTIMIZATION) && !defined(SQLITE_OMIT_SUBQUERY) - /* Analyze a term that is composed of two or more subterms connected by - ** an OR operator. + /* Attempt to convert OR-connected terms into an IN operator so that + ** they can make use of indices. Example: + ** + ** x = expr1 OR expr2 = x OR x = expr3 + ** + ** is converted into + ** + ** x IN (expr1,expr2,expr3) + ** + ** This optimization must be omitted if OMIT_SUBQUERY is defined because + ** the compiler for the the IN operator is part of sub-queries. */ else if( pExpr->op==TK_OR ){ - assert( pWC->op==TK_AND ); - exprAnalyzeOrTerm(pSrc, pWC, idxTerm); + int ok; + int i, j; + int iColumn, iCursor; + WhereClause sOr; + WhereTerm *pOrTerm; + + assert( (pTerm->flags & TERM_DYNAMIC)==0 ); + whereClauseInit(&sOr, pWC->pParse, pMaskSet); + whereSplit(&sOr, pExpr, TK_OR); + exprAnalyzeAll(pSrc, &sOr); + assert( sOr.nTerm>=2 ); + j = 0; + if( db->mallocFailed ) goto or_not_possible; + do{ + assert( j=0; + for(i=sOr.nTerm-1, pOrTerm=sOr.a; i>=0 && ok; i--, pOrTerm++){ + if( pOrTerm->eOperator!=WO_EQ ){ + goto or_not_possible; + } + if( orTermIsOptCandidate(pOrTerm, iCursor, iColumn) ){ + pOrTerm->flags |= TERM_OR_OK; + }else if( orTermHasOkDuplicate(&sOr, pOrTerm) ){ + pOrTerm->flags &= ~TERM_OR_OK; + }else{ + ok = 0; + } + } + }while( !ok && (sOr.a[j++].flags & TERM_COPIED)!=0 && j<2 ); + if( ok ){ + ExprList *pList = 0; + Expr *pNew, *pDup; + Expr *pLeft = 0; + for(i=sOr.nTerm-1, pOrTerm=sOr.a; i>=0; i--, pOrTerm++){ + if( (pOrTerm->flags & TERM_OR_OK)==0 ) continue; + pDup = sqlite3ExprDup(db, pOrTerm->pExpr->pRight); + pList = sqlite3ExprListAppend(pWC->pParse, pList, pDup, 0); + pLeft = pOrTerm->pExpr->pLeft; + } + assert( pLeft!=0 ); + pDup = sqlite3ExprDup(db, pLeft); + pNew = sqlite3Expr(db, TK_IN, pDup, 0, 0); + if( pNew ){ + int idxNew; + transferJoinMarkings(pNew, pExpr); + pNew->pList = pList; + idxNew = whereClauseInsert(pWC, pNew, TERM_VIRTUAL|TERM_DYNAMIC); + exprAnalyze(pSrc, pWC, idxNew); + pTerm = &pWC->a[idxTerm]; + pWC->a[idxNew].iParent = idxTerm; + pTerm->nChild = 1; + }else{ + sqlite3ExprListDelete(db, pList); + } + } +or_not_possible: + whereClauseClear(&sOr); } #endif /* SQLITE_OMIT_OR_OPTIMIZATION */ #ifndef SQLITE_OMIT_LIKE_OPTIMIZATION /* Add constraints to reduce the search space on a LIKE or GLOB @@ -1139,12 +910,11 @@ ** x>='abc' AND x<'abd' AND x LIKE 'abc%' ** ** The last character of the prefix "abc" is incremented to form the ** termination condition "abd". */ - if( isLikeOrGlob(pParse, pExpr, &nPattern, &isComplete, &noCase) - && pWC->op==TK_AND ){ + if( isLikeOrGlob(pParse, pExpr, &nPattern, &isComplete, &noCase) ){ Expr *pLeft, *pRight; Expr *pStr1, *pStr2; Expr *pNewExpr1, *pNewExpr2; int idxNew1, idxNew2; @@ -1168,15 +938,13 @@ } *pC = c + 1; } pNewExpr1 = sqlite3PExpr(pParse, TK_GE, sqlite3ExprDup(db,pLeft), pStr1, 0); idxNew1 = whereClauseInsert(pWC, pNewExpr1, TERM_VIRTUAL|TERM_DYNAMIC); - testcase( idxNew1==0 ); exprAnalyze(pSrc, pWC, idxNew1); pNewExpr2 = sqlite3PExpr(pParse, TK_LT, sqlite3ExprDup(db,pLeft), pStr2, 0); idxNew2 = whereClauseInsert(pWC, pNewExpr2, TERM_VIRTUAL|TERM_DYNAMIC); - testcase( idxNew2==0 ); exprAnalyze(pSrc, pWC, idxNew2); pTerm = &pWC->a[idxTerm]; if( isComplete ){ pWC->a[idxNew1].iParent = idxTerm; pWC->a[idxNew2].iParent = idxTerm; @@ -1204,20 +972,19 @@ prereqColumn = exprTableUsage(pMaskSet, pLeft); if( (prereqExpr & prereqColumn)==0 ){ Expr *pNewExpr; pNewExpr = sqlite3Expr(db, TK_MATCH, 0, sqlite3ExprDup(db, pRight), 0); idxNew = whereClauseInsert(pWC, pNewExpr, TERM_VIRTUAL|TERM_DYNAMIC); - testcase( idxNew==0 ); pNewTerm = &pWC->a[idxNew]; pNewTerm->prereqRight = prereqExpr; pNewTerm->leftCursor = pLeft->iTable; - pNewTerm->u.leftColumn = pLeft->iColumn; + pNewTerm->leftColumn = pLeft->iColumn; pNewTerm->eOperator = WO_MATCH; pNewTerm->iParent = idxTerm; pTerm = &pWC->a[idxTerm]; pTerm->nChild = 1; - pTerm->wtFlags |= TERM_COPIED; + pTerm->flags |= TERM_COPIED; pNewTerm->prereqAll = pTerm->prereqAll; } } #endif /* SQLITE_OMIT_VIRTUALTABLE */ @@ -1231,11 +998,11 @@ ** Return TRUE if any of the expressions in pList->a[iFirst...] contain ** a reference to any table other than the iBase table. */ static int referencesOtherTables( ExprList *pList, /* Search expressions in ths list */ - WhereMaskSet *pMaskSet, /* Mapping from tables to bitmaps */ + ExprMaskSet *pMaskSet, /* Mapping from tables to bitmaps */ int iFirst, /* Be searching with the iFirst-th expression */ int iBase /* Ignore references to this table */ ){ Bitmask allowed = ~getMask(pMaskSet, iBase); while( iFirstnExpr ){ @@ -1266,11 +1033,11 @@ ** set to 1 if the ORDER BY clause is all DESC and it is set to 0 if ** the ORDER BY clause is all ASC. */ static int isSortingIndex( Parse *pParse, /* Parsing context */ - WhereMaskSet *pMaskSet, /* Mapping from table cursor numbers to bitmaps */ + ExprMaskSet *pMaskSet, /* Mapping from table indices to bitmaps */ Index *pIdx, /* The index we are testing */ int base, /* Cursor number for the table to be sorted */ ExprList *pOrderBy, /* The ORDER BY clause */ int nEqCol, /* Number of index columns with == constraints */ int *pbRev /* Set to 1 if ORDER BY is DESC */ @@ -1389,11 +1156,11 @@ ** true for reverse ROWID and false for forward ROWID order. */ static int sortableByRowid( int base, /* Cursor number for table to be sorted */ ExprList *pOrderBy, /* The ORDER BY clause */ - WhereMaskSet *pMaskSet, /* Mapping from table cursors to bitmaps */ + ExprMaskSet *pMaskSet, /* Mapping from tables to bitmaps */ int *pbRev /* Set to 1 if ORDER BY is DESC */ ){ Expr *p; assert( pOrderBy!=0 ); @@ -1509,10 +1276,11 @@ ** allocated and initialized for this virtual table, then allocate ** and initialize it now */ pIdxInfo = *ppIdxInfo; if( pIdxInfo==0 ){ + WhereTerm *pTerm; int nTerm; WHERETRACE(("Recomputing index info for %s...\n", pTab->zName)); /* Count the number of possible WHERE clause constraints referring ** to this virtual table */ @@ -1545,12 +1313,11 @@ pIdxInfo = sqlite3DbMallocZero(pParse->db, sizeof(*pIdxInfo) + (sizeof(*pIdxCons) + sizeof(*pUsage))*nTerm + sizeof(*pIdxOrderBy)*nOrderBy ); if( pIdxInfo==0 ){ sqlite3ErrorMsg(pParse, "out of memory"); - /* (double)0 In case of SQLITE_OMIT_FLOATING_POINT... */ - return (double)0; + return 0.0; } *ppIdxInfo = pIdxInfo; /* Initialize the structure. The sqlite3_index_info structure contains ** many fields that are declared "const" to prevent xBestIndex from @@ -1571,13 +1338,13 @@ if( pTerm->leftCursor != pSrc->iCursor ) continue; assert( (pTerm->eOperator&(pTerm->eOperator-1))==0 ); testcase( pTerm->eOperator==WO_IN ); testcase( pTerm->eOperator==WO_ISNULL ); if( pTerm->eOperator & (WO_IN|WO_ISNULL) ) continue; - pIdxCons[j].iColumn = pTerm->u.leftColumn; + pIdxCons[j].iColumn = pTerm->leftColumn; pIdxCons[j].iTermOffset = i; - pIdxCons[j].op = (u8)pTerm->eOperator; + pIdxCons[j].op = pTerm->eOperator; /* The direct assignment in the previous line is possible only because ** the WO_ and SQLITE_INDEX_CONSTRAINT_ codes are identical. The ** following asserts verify this fact. */ assert( WO_EQ==SQLITE_INDEX_CONSTRAINT_EQ ); assert( WO_LT==SQLITE_INDEX_CONSTRAINT_LT ); @@ -1639,22 +1406,21 @@ pIdxCons = *(struct sqlite3_index_constraint**)&pIdxInfo->aConstraint; pUsage = pIdxInfo->aConstraintUsage; for(i=0; inConstraint; i++, pIdxCons++){ j = pIdxCons->iTermOffset; pTerm = &pWC->a[j]; - pIdxCons->usable = (pTerm->prereqRight & notReady)==0 ?1:0; + pIdxCons->usable = (pTerm->prereqRight & notReady)==0; } memset(pUsage, 0, sizeof(pUsage[0])*pIdxInfo->nConstraint); if( pIdxInfo->needToFreeIdxStr ){ sqlite3_free(pIdxInfo->idxStr); } pIdxInfo->idxStr = 0; pIdxInfo->idxNum = 0; pIdxInfo->needToFreeIdxStr = 0; pIdxInfo->orderByConsumed = 0; - /* ((double)2) In case of SQLITE_OMIT_FLOATING_POINT... */ - pIdxInfo->estimatedCost = SQLITE_BIG_DBL / ((double)2); + pIdxInfo->estimatedCost = SQLITE_BIG_DBL / 2.0; nOrderBy = pIdxInfo->nOrderBy; if( pIdxInfo->nOrderBy && !orderByUsable ){ *(int*)&pIdxInfo->nOrderBy = 0; } @@ -1679,27 +1445,26 @@ for(i=0; inConstraint; i++){ if( !pIdxInfo->aConstraint[i].usable && pUsage[i].argvIndex>0 ){ sqlite3ErrorMsg(pParse, "table %s: xBestIndex returned an invalid plan", pTab->zName); - /* (double)0 In case of SQLITE_OMIT_FLOATING_POINT... */ - return (double)0; + return 0.0; } } *(int*)&pIdxInfo->nOrderBy = nOrderBy; return pIdxInfo->estimatedCost; } #endif /* SQLITE_OMIT_VIRTUALTABLE */ /* -** Find the query plan for accessing a particular table. Write the -** best query plan and its cost into the WhereCost object supplied as the -** last parameter. +** Find the best index for accessing a particular table. Return a pointer +** to the index, flags that describe how the index should be used, the +** number of equality constraints, and the "cost" for this index. ** -** The lowest cost plan wins. The cost is an estimate of the amount of -** CPU and disk I/O need to process the request using the selected plan. +** The lowest cost index wins. The cost is an estimate of the amount of +** CPU and disk I/O need to process the request using the selected index. ** Factors that influence cost include: ** ** * The estimated number of rows that will be retrieved. (The ** fewer the better.) ** @@ -1707,41 +1472,45 @@ ** ** * Whether or not there must be separate lookups in the ** index and in the main table. ** ** If there was an INDEXED BY clause attached to the table in the SELECT -** statement, then this function only considers plans using the +** statement, then this function only considers strategies using the ** named index. If one cannot be found, then the returned cost is -** SQLITE_BIG_DBL. If a plan can be found that uses the named index, +** SQLITE_BIG_DBL. If a strategy can be found that uses the named index, ** then the cost is calculated in the usual way. ** ** If a NOT INDEXED clause was attached to the table in the SELECT ** statement, then no indexes are considered. However, the selected -** plan may still take advantage of the tables built-in rowid +** stategy may still take advantage of the tables built-in rowid ** index. */ -static void bestIndex( +static double bestIndex( Parse *pParse, /* The parsing context */ WhereClause *pWC, /* The WHERE clause */ struct SrcList_item *pSrc, /* The FROM clause term to search */ Bitmask notReady, /* Mask of cursors that are not available */ - ExprList *pOrderBy, /* The ORDER BY clause */ - WhereCost *pCost /* Lowest cost query plan */ + ExprList *pOrderBy, /* The order by clause */ + Index **ppIndex, /* Make *ppIndex point to the best index */ + int *pFlags, /* Put flags describing this choice in *pFlags */ + int *pnEq /* Put the number of == or IN constraints here */ ){ - WhereTerm *pTerm; /* A single term of the WHERE clause */ + WhereTerm *pTerm; + Index *bestIdx = 0; /* Index that gives the lowest cost */ + double lowestCost; /* The cost of using bestIdx */ + int bestFlags = 0; /* Flags associated with bestIdx */ + int bestNEq = 0; /* Best value for nEq */ int iCur = pSrc->iCursor; /* The cursor of the table to be accessed */ Index *pProbe; /* An index we are evaluating */ int rev; /* True to scan in reverse order */ - int wsFlags; /* Flags associated with pProbe */ + int flags; /* Flags associated with pProbe */ int nEq; /* Number of == or IN constraints */ int eqTermMask; /* Mask of valid equality operators */ double cost; /* Cost of using pProbe */ - double nRow; /* Estimated number of rows in result set */ - int i; /* Loop counter */ - Bitmask maskSrc; /* Bitmask for the pSrc table */ - WHERETRACE(("bestIndex: tbl=%s notReady=%llx\n", pSrc->pTab->zName,notReady)); + WHERETRACE(("bestIndex: tbl=%s notReady=%llx\n", pSrc->pTab->zName, notReady)); + lowestCost = SQLITE_BIG_DBL; pProbe = pSrc->pTab->pIndex; if( pSrc->notIndexed ){ pProbe = 0; } @@ -1749,150 +1518,91 @@ ** clause that refer to the ROWID, then we will never be able to do ** anything other than a full table scan on this table. We might as ** well put it first in the join order. That way, perhaps it can be ** referenced by other tables in the join. */ - memset(pCost, 0, sizeof(*pCost)); if( pProbe==0 && findTerm(pWC, iCur, -1, 0, WO_EQ|WO_IN|WO_LT|WO_LE|WO_GT|WO_GE,0)==0 && (pOrderBy==0 || !sortableByRowid(iCur, pOrderBy, pWC->pMaskSet, &rev)) ){ - return; + *pFlags = 0; + *ppIndex = 0; + *pnEq = 0; + return 0.0; } - pCost->rCost = SQLITE_BIG_DBL; /* Check for a rowid=EXPR or rowid IN (...) constraints. If there was ** an INDEXED BY clause attached to this table, skip this step. */ if( !pSrc->pIndex ){ pTerm = findTerm(pWC, iCur, -1, notReady, WO_EQ|WO_IN, 0); if( pTerm ){ Expr *pExpr; - pCost->plan.wsFlags = WHERE_ROWID_EQ; + *ppIndex = 0; + bestFlags = WHERE_ROWID_EQ; if( pTerm->eOperator & WO_EQ ){ /* Rowid== is always the best pick. Look no further. Because only ** a single row is generated, output is always in sorted order */ - pCost->plan.wsFlags = WHERE_ROWID_EQ | WHERE_UNIQUE; - pCost->plan.nEq = 1; + *pFlags = WHERE_ROWID_EQ | WHERE_UNIQUE; + *pnEq = 1; WHERETRACE(("... best is rowid\n")); - pCost->rCost = 0; - pCost->nRow = 1; - return; + return 0.0; }else if( (pExpr = pTerm->pExpr)->pList!=0 ){ /* Rowid IN (LIST): cost is NlogN where N is the number of list ** elements. */ - pCost->rCost = pCost->nRow = pExpr->pList->nExpr; - pCost->rCost *= estLog(pCost->rCost); + lowestCost = pExpr->pList->nExpr; + lowestCost *= estLog(lowestCost); }else{ /* Rowid IN (SELECT): cost is NlogN where N is the number of rows ** in the result of the inner select. We have no way to estimate ** that value so make a wild guess. */ - pCost->nRow = 100; - pCost->rCost = 200; + lowestCost = 200; } - WHERETRACE(("... rowid IN cost: %.9g\n", pCost->rCost)); + WHERETRACE(("... rowid IN cost: %.9g\n", lowestCost)); } /* Estimate the cost of a table scan. If we do not know how many ** entries are in the table, use 1 million as a guess. */ cost = pProbe ? pProbe->aiRowEst[0] : 1000000; WHERETRACE(("... table scan base cost: %.9g\n", cost)); - wsFlags = WHERE_ROWID_RANGE; + flags = WHERE_ROWID_RANGE; /* Check for constraints on a range of rowids in a table scan. */ pTerm = findTerm(pWC, iCur, -1, notReady, WO_LT|WO_LE|WO_GT|WO_GE, 0); if( pTerm ){ if( findTerm(pWC, iCur, -1, notReady, WO_LT|WO_LE, 0) ){ - wsFlags |= WHERE_TOP_LIMIT; - cost /= 3; /* Guess that rowidEXPR eliminates two-thirds of rows */ } WHERETRACE(("... rowid range reduces cost to %.9g\n", cost)); }else{ - wsFlags = 0; + flags = 0; } - nRow = cost; /* If the table scan does not satisfy the ORDER BY clause, increase ** the cost by NlogN to cover the expense of sorting. */ if( pOrderBy ){ if( sortableByRowid(iCur, pOrderBy, pWC->pMaskSet, &rev) ){ - wsFlags |= WHERE_ORDERBY|WHERE_ROWID_RANGE; + flags |= WHERE_ORDERBY|WHERE_ROWID_RANGE; if( rev ){ - wsFlags |= WHERE_REVERSE; + flags |= WHERE_REVERSE; } }else{ cost += cost*estLog(cost); WHERETRACE(("... sorting increases cost to %.9g\n", cost)); } } - if( costrCost ){ - pCost->rCost = cost; - pCost->nRow = nRow; - pCost->plan.wsFlags = wsFlags; - } - } - -#ifndef SQLITE_OMIT_OR_OPTIMIZATION - /* Search for an OR-clause that can be used to look up the table. - */ - maskSrc = getMask(pWC->pMaskSet, iCur); - for(i=0, pTerm=pWC->a; inTerm; i++, pTerm++){ - WhereClause tempWC; - tempWC = *pWC; - if( pTerm->eOperator==WO_OR - && ((pTerm->prereqAll & ~maskSrc) & notReady)==0 - && (pTerm->u.pOrInfo->indexable & maskSrc)!=0 ){ - WhereClause *pOrWC = &pTerm->u.pOrInfo->wc; - WhereTerm *pOrTerm; - int j; - int sortable = 0; - double rTotal = 0; - nRow = 0; - for(j=0, pOrTerm=pOrWC->a; jnTerm; j++, pOrTerm++){ - WhereCost sTermCost; - WHERETRACE(("... Multi-index OR testing for term %d of %d....\n", j,i)); - if( pOrTerm->eOperator==WO_AND ){ - WhereClause *pAndWC = &pOrTerm->u.pAndInfo->wc; - bestIndex(pParse, pAndWC, pSrc, notReady, 0, &sTermCost); - }else if( pOrTerm->leftCursor==iCur ){ - tempWC.a = pOrTerm; - tempWC.nTerm = 1; - bestIndex(pParse, &tempWC, pSrc, notReady, 0, &sTermCost); - }else{ - continue; - } - rTotal += sTermCost.rCost; - nRow += sTermCost.nRow; - if( rTotal>=pCost->rCost ) break; - } - if( pOrderBy!=0 ){ - if( sortableByRowid(iCur, pOrderBy, pWC->pMaskSet, &rev) && !rev ){ - sortable = 1; - }else{ - rTotal += nRow*estLog(nRow); - WHERETRACE(("... sorting increases OR cost to %.9g\n", rTotal)); - } - } - WHERETRACE(("... multi-index OR cost=%.9g nrow=%.9g\n", - rTotal, nRow)); - if( rTotalrCost ){ - pCost->rCost = rTotal; - pCost->nRow = nRow; - pCost->plan.wsFlags = WHERE_MULTI_OR; - pCost->plan.u.pTerm = pTerm; - if( sortable ){ - pCost->plan.wsFlags = WHERE_ORDERBY|WHERE_MULTI_OR; - } - } - } - } -#endif /* SQLITE_OMIT_OR_OPTIMIZATION */ + if( costpIndex ){ pProbe = pSrc->pIndex; } for(; pProbe; pProbe=(pSrc->pIndex ? 0 : pProbe->pNext)){ + int i; /* Loop counter */ double inMultiplier = 1; WHERETRACE(("... index %s:\n", pProbe->zName)); /* Count the number of columns in the index that are satisfied ** by x=EXPR constraints or x IN (...) constraints. */ - wsFlags = 0; + flags = 0; for(i=0; inColumn; i++){ int j = pProbe->aiColumn[i]; pTerm = findTerm(pWC, iCur, j, notReady, eqTermMask, pProbe); if( pTerm==0 ) break; - wsFlags |= WHERE_COLUMN_EQ; + flags |= WHERE_COLUMN_EQ; if( pTerm->eOperator & WO_IN ){ Expr *pExpr = pTerm->pExpr; - wsFlags |= WHERE_COLUMN_IN; + flags |= WHERE_COLUMN_IN; if( pExpr->pSelect!=0 ){ inMultiplier *= 25; - }else if( pExpr->pList ){ + }else if( ALWAYS(pExpr->pList) ){ inMultiplier *= pExpr->pList->nExpr + 1; } } } - nRow = pProbe->aiRowEst[i] * inMultiplier; - cost = nRow * estLog(inMultiplier); + cost = pProbe->aiRowEst[i] * inMultiplier * estLog(inMultiplier); nEq = i; - if( pProbe->onError!=OE_None && (wsFlags & WHERE_COLUMN_IN)==0 + if( pProbe->onError!=OE_None && (flags & WHERE_COLUMN_IN)==0 && nEq==pProbe->nColumn ){ - wsFlags |= WHERE_UNIQUE; + flags |= WHERE_UNIQUE; } WHERETRACE(("...... nEq=%d inMult=%.9g cost=%.9g\n",nEq,inMultiplier,cost)); /* Look for range constraints */ if( nEqnColumn ){ int j = pProbe->aiColumn[nEq]; pTerm = findTerm(pWC, iCur, j, notReady, WO_LT|WO_LE|WO_GT|WO_GE, pProbe); if( pTerm ){ - wsFlags |= WHERE_COLUMN_RANGE; + flags |= WHERE_COLUMN_RANGE; if( findTerm(pWC, iCur, j, notReady, WO_LT|WO_LE, pProbe) ){ - wsFlags |= WHERE_TOP_LIMIT; + flags |= WHERE_TOP_LIMIT; cost /= 3; - nRow /= 3; } if( findTerm(pWC, iCur, j, notReady, WO_GT|WO_GE, pProbe) ){ - wsFlags |= WHERE_BTM_LIMIT; + flags |= WHERE_BTM_LIMIT; cost /= 3; - nRow /= 3; } WHERETRACE(("...... range reduces cost to %.9g\n", cost)); } } /* Add the additional cost of sorting if that is a factor. */ if( pOrderBy ){ - if( (wsFlags & WHERE_COLUMN_IN)==0 && + if( (flags & WHERE_COLUMN_IN)==0 && isSortingIndex(pParse,pWC->pMaskSet,pProbe,iCur,pOrderBy,nEq,&rev) ){ - if( wsFlags==0 ){ - wsFlags = WHERE_COLUMN_RANGE; + if( flags==0 ){ + flags = WHERE_COLUMN_RANGE; } - wsFlags |= WHERE_ORDERBY; + flags |= WHERE_ORDERBY; if( rev ){ - wsFlags |= WHERE_REVERSE; + flags |= WHERE_REVERSE; } }else{ cost += cost*estLog(cost); WHERETRACE(("...... orderby increases cost to %.9g\n", cost)); } @@ -1982,45 +1690,44 @@ /* Check to see if we can get away with using just the index without ** ever reading the table. If that is the case, then halve the ** cost of this index. */ - if( wsFlags && pSrc->colUsed < (((Bitmask)1)<<(BMS-1)) ){ + if( flags && pSrc->colUsed < (((Bitmask)1)<<(BMS-1)) ){ Bitmask m = pSrc->colUsed; int j; for(j=0; jnColumn; j++){ int x = pProbe->aiColumn[j]; if( xrCost ){ - pCost->rCost = cost; - pCost->nRow = nRow; - pCost->plan.wsFlags = wsFlags; - pCost->plan.nEq = nEq; - assert( pCost->plan.wsFlags & WHERE_INDEXED ); - pCost->plan.u.pIdx = pProbe; + if( flags && cost < lowestCost ){ + bestIdx = pProbe; + lowestCost = cost; + bestFlags = flags; + bestNEq = nEq; } } /* Report the best result */ - pCost->plan.wsFlags |= eqTermMask; - WHERETRACE(("best index is %s, cost=%.9g, nrow=%.9g, wsFlags=%x, nEq=%d\n", - (pCost->plan.wsFlags & WHERE_INDEXED)!=0 ? - pCost->plan.u.pIdx->zName : "(none)", pCost->nRow, - pCost->rCost, pCost->plan.wsFlags, pCost->plan.nEq)); + *ppIndex = bestIdx; + WHERETRACE(("best index is %s, cost=%.9g, flags=%x, nEq=%d\n", + bestIdx ? bestIdx->zName : "(none)", lowestCost, bestFlags, bestNEq)); + *pFlags = bestFlags | eqTermMask; + *pnEq = bestNEq; + return lowestCost; } /* ** Disable a term in the WHERE clause. Except, do not disable the term @@ -2045,14 +1752,14 @@ ** as we can without disabling too much. If we disabled in (1), we'd get ** the wrong answer. See ticket #813. */ static void disableTerm(WhereLevel *pLevel, WhereTerm *pTerm){ if( pTerm - && ALWAYS((pTerm->wtFlags & TERM_CODED)==0) + && ALWAYS((pTerm->flags & TERM_CODED)==0) && (pLevel->iLeftJoin==0 || ExprHasProperty(pTerm->pExpr, EP_FromJoin)) ){ - pTerm->wtFlags |= TERM_CODED; + pTerm->flags |= TERM_CODED; if( pTerm->iParent>=0 ){ WhereTerm *pOther = &pTerm->pWC->a[pTerm->iParent]; if( (--pOther->nChild)==0 ){ disableTerm(pLevel, pOther); } @@ -2112,30 +1819,28 @@ iReg = iTarget; eType = sqlite3FindInIndex(pParse, pX, 0); iTab = pX->iTable; sqlite3VdbeAddOp2(v, OP_Rewind, iTab, 0); VdbeComment((v, "%.*s", pX->span.n, pX->span.z)); - assert( pLevel->plan.wsFlags & WHERE_IN_ABLE ); - if( pLevel->u.in.nIn==0 ){ - pLevel->addrNxt = sqlite3VdbeMakeLabel(v); - } - pLevel->u.in.nIn++; - pLevel->u.in.aInLoop = - sqlite3DbReallocOrFree(pParse->db, pLevel->u.in.aInLoop, - sizeof(pLevel->u.in.aInLoop[0])*pLevel->u.in.nIn); - pIn = pLevel->u.in.aInLoop; + if( pLevel->nIn==0 ){ + pLevel->nxt = sqlite3VdbeMakeLabel(v); + } + pLevel->nIn++; + pLevel->aInLoop = sqlite3DbReallocOrFree(pParse->db, pLevel->aInLoop, + sizeof(pLevel->aInLoop[0])*pLevel->nIn); + pIn = pLevel->aInLoop; if( pIn ){ - pIn += pLevel->u.in.nIn - 1; + pIn += pLevel->nIn - 1; pIn->iCur = iTab; if( eType==IN_INDEX_ROWID ){ - pIn->addrInTop = sqlite3VdbeAddOp2(v, OP_Rowid, iTab, iReg); + pIn->topAddr = sqlite3VdbeAddOp2(v, OP_Rowid, iTab, iReg); }else{ - pIn->addrInTop = sqlite3VdbeAddOp3(v, OP_Column, iTab, 0, iReg); + pIn->topAddr = sqlite3VdbeAddOp3(v, OP_Column, iTab, 0, iReg); } sqlite3VdbeAddOp1(v, OP_IsNull, iReg); }else{ - pLevel->u.in.nIn = 0; + pLevel->nIn = 0; } #endif } disableTerm(pLevel, pTerm); return iReg; @@ -2148,20 +1853,20 @@ ** For example, consider table t1(a,b,c,d,e,f) with index i1(a,b,c). ** Suppose the WHERE clause is this: a==5 AND b IN (1,2,3) AND c>5 AND c<10 ** The index has as many as three equality constraints, but in this ** example, the third "c" value is an inequality. So only two ** constraints are coded. This routine will generate code to evaluate -** a==5 and b IN (1,2,3). The current values for a and b will be stored -** in consecutive registers and the index of the first register is returned. +** a==5 and b IN (1,2,3). The current values for a and b will be left +** on the stack - a is the deepest and b the shallowest. ** ** In the example above nEq==2. But this subroutine works for any value ** of nEq including 0. If nEq==0, this routine is nearly a no-op. ** The only thing it does is allocate the pLevel->iMem memory cell. ** -** This routine always allocates at least one memory cell and returns -** the index of that memory cell. The code that -** calls this routine will use that memory cell to store the termination +** This routine always allocates at least one memory cell and puts +** the address of that memory cell in pLevel->iMem. The code that +** calls this routine will use pLevel->iMem to store the termination ** key value of the loop. If one or more IN operators appear, then ** this routine allocates an additional nEq memory cells for internal ** use. */ static int codeAllEqualityTerms( @@ -2169,650 +1874,49 @@ WhereLevel *pLevel, /* Which nested loop of the FROM we are coding */ WhereClause *pWC, /* The WHERE clause */ Bitmask notReady, /* Which parts of FROM have not yet been coded */ int nExtraReg /* Number of extra registers to allocate */ ){ - int nEq = pLevel->plan.nEq; /* The number of == or IN constraints to code */ - Vdbe *v = pParse->pVdbe; /* The vm under construction */ - Index *pIdx; /* The index being used for this loop */ + int nEq = pLevel->nEq; /* The number of == or IN constraints to code */ + Vdbe *v = pParse->pVdbe; /* The virtual machine under construction */ + Index *pIdx = pLevel->pIdx; /* The index being used for this loop */ int iCur = pLevel->iTabCur; /* The cursor of the table */ WhereTerm *pTerm; /* A single constraint term */ int j; /* Loop counter */ int regBase; /* Base register */ - int nReg; /* Number of registers to allocate */ - - /* This module is only called on query plans that use an index. */ - assert( pLevel->plan.wsFlags & WHERE_INDEXED ); - pIdx = pLevel->plan.u.pIdx; /* Figure out how many memory cells we will need then allocate them. + ** We always need at least one used to store the loop terminator + ** value. If there are IN operators we'll need one for each == or + ** IN constraint. */ - regBase = pParse->nMem + 1; - nReg = pLevel->plan.nEq + nExtraReg; - pParse->nMem += nReg; + pLevel->iMem = pParse->nMem + 1; + regBase = pParse->nMem + 2; + pParse->nMem += pLevel->nEq + 2 + nExtraReg; /* Evaluate the equality constraints */ assert( pIdx->nColumn>=nEq ); for(j=0; jaiColumn[j]; - pTerm = findTerm(pWC, iCur, k, notReady, pLevel->plan.wsFlags, pIdx); + pTerm = findTerm(pWC, iCur, k, notReady, pLevel->flags, pIdx); if( NEVER(pTerm==0) ) break; - assert( (pTerm->wtFlags & TERM_CODED)==0 ); + assert( (pTerm->flags & TERM_CODED)==0 ); r1 = codeEqualityTerm(pParse, pTerm, pLevel, regBase+j); if( r1!=regBase+j ){ - if( nReg==1 ){ - sqlite3ReleaseTempReg(pParse, regBase); - regBase = r1; - }else{ - sqlite3VdbeAddOp2(v, OP_SCopy, r1, regBase+j); - } + sqlite3VdbeAddOp2(v, OP_SCopy, r1, regBase+j); } testcase( pTerm->eOperator & WO_ISNULL ); testcase( pTerm->eOperator & WO_IN ); if( (pTerm->eOperator & (WO_ISNULL|WO_IN))==0 ){ - sqlite3VdbeAddOp2(v, OP_IsNull, regBase+j, pLevel->addrBrk); + sqlite3VdbeAddOp2(v, OP_IsNull, regBase+j, pLevel->brk); } } return regBase; } -/* -** Return TRUE if the WhereClause pWC contains no terms that -** are not virtual and which have not been coded. -** -** To put it another way, return TRUE if no additional WHERE clauses -** tests are required in order to establish that the current row -** should go to output and return FALSE if there are some terms of -** the WHERE clause that need to be validated before outputing the row. -*/ -static int whereRowReadyForOutput(WhereClause *pWC){ - WhereTerm *pTerm; - int j; - - for(pTerm=pWC->a, j=pWC->nTerm; j>0; j--, pTerm++){ - if( (pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED))==0 ) return 0; - } - return 1; -} - -/* -** Generate code for the start of the iLevel-th loop in the WHERE clause -** implementation described by pWInfo. -*/ -static Bitmask codeOneLoopStart( - WhereInfo *pWInfo, /* Complete information about the WHERE clause */ - int iLevel, /* Which level of pWInfo->a[] should be coded */ - u8 wctrlFlags, /* One of the WHERE_* flags defined in sqliteInt.h */ - Bitmask notReady /* Which tables are currently available */ -){ - int j, k; /* Loop counters */ - int iCur; /* The VDBE cursor for the table */ - int addrNxt; /* Where to jump to continue with the next IN case */ - int omitTable; /* True if we use the index only */ - int bRev; /* True if we need to scan in reverse order */ - WhereLevel *pLevel; /* The where level to be coded */ - WhereClause *pWC; /* Decomposition of the entire WHERE clause */ - WhereTerm *pTerm; /* A WHERE clause term */ - Parse *pParse; /* Parsing context */ - Vdbe *v; /* The prepared stmt under constructions */ - struct SrcList_item *pTabItem; /* FROM clause term being coded */ - int addrBrk; /* Jump here to break out of the loop */ - int addrCont; /* Jump here to continue with next cycle */ - int regRowSet; /* Write rowids to this RowSet if non-negative */ - int codeRowSetEarly; /* True if index fully constrains the search */ - - - pParse = pWInfo->pParse; - v = pParse->pVdbe; - pWC = pWInfo->pWC; - pLevel = &pWInfo->a[iLevel]; - pTabItem = &pWInfo->pTabList->a[pLevel->iFrom]; - iCur = pTabItem->iCursor; - bRev = (pLevel->plan.wsFlags & WHERE_REVERSE)!=0; - omitTable = (pLevel->plan.wsFlags & WHERE_IDX_ONLY)!=0; - regRowSet = pWInfo->regRowSet; - codeRowSetEarly = 0; - - /* Create labels for the "break" and "continue" instructions - ** for the current loop. Jump to addrBrk to break out of a loop. - ** Jump to cont to go immediately to the next iteration of the - ** loop. - ** - ** When there is an IN operator, we also have a "addrNxt" label that - ** means to continue with the next IN value combination. When - ** there are no IN operators in the constraints, the "addrNxt" label - ** is the same as "addrBrk". - */ - addrBrk = pLevel->addrBrk = pLevel->addrNxt = sqlite3VdbeMakeLabel(v); - addrCont = pLevel->addrCont = sqlite3VdbeMakeLabel(v); - - /* If this is the right table of a LEFT OUTER JOIN, allocate and - ** initialize a memory cell that records if this table matches any - ** row of the left table of the join. - */ - if( pLevel->iFrom>0 && (pTabItem[0].jointype & JT_LEFT)!=0 ){ - pLevel->iLeftJoin = ++pParse->nMem; - sqlite3VdbeAddOp2(v, OP_Integer, 0, pLevel->iLeftJoin); - VdbeComment((v, "init LEFT JOIN no-match flag")); - } - -#ifndef SQLITE_OMIT_VIRTUALTABLE - if( (pLevel->plan.wsFlags & WHERE_VIRTUALTABLE)!=0 ){ - /* Case 0: The table is a virtual-table. Use the VFilter and VNext - ** to access the data. - */ - int iReg; /* P3 Value for OP_VFilter */ - sqlite3_index_info *pVtabIdx = pLevel->plan.u.pVtabIdx; - int nConstraint = pVtabIdx->nConstraint; - struct sqlite3_index_constraint_usage *aUsage = - pVtabIdx->aConstraintUsage; - const struct sqlite3_index_constraint *aConstraint = - pVtabIdx->aConstraint; - - iReg = sqlite3GetTempRange(pParse, nConstraint+2); - pParse->disableColCache++; - for(j=1; j<=nConstraint; j++){ - for(k=0; kdisableColCache ); - sqlite3ExprCode(pParse, pWC->a[iTerm].pExpr->pRight, iReg+j+1); - break; - } - } - if( k==nConstraint ) break; - } - assert( pParse->disableColCache ); - pParse->disableColCache--; - sqlite3VdbeAddOp2(v, OP_Integer, pVtabIdx->idxNum, iReg); - sqlite3VdbeAddOp2(v, OP_Integer, j-1, iReg+1); - sqlite3VdbeAddOp4(v, OP_VFilter, iCur, addrBrk, iReg, pVtabIdx->idxStr, - pVtabIdx->needToFreeIdxStr ? P4_MPRINTF : P4_STATIC); - pVtabIdx->needToFreeIdxStr = 0; - for(j=0; ja[iTerm]); - } - } - pLevel->op = OP_VNext; - pLevel->p1 = iCur; - pLevel->p2 = sqlite3VdbeCurrentAddr(v); - codeRowSetEarly = regRowSet>=0 ? whereRowReadyForOutput(pWC) : 0; - if( codeRowSetEarly ){ - sqlite3VdbeAddOp2(v, OP_VRowid, iCur, iReg); - sqlite3VdbeAddOp2(v, OP_RowSetAdd, regRowSet, iReg); - } - sqlite3ReleaseTempRange(pParse, iReg, nConstraint+2); - }else -#endif /* SQLITE_OMIT_VIRTUALTABLE */ - - if( pLevel->plan.wsFlags & WHERE_ROWID_EQ ){ - /* Case 1: We can directly reference a single row using an - ** equality comparison against the ROWID field. Or - ** we reference multiple rows using a "rowid IN (...)" - ** construct. - */ - int r1; - int rtmp = sqlite3GetTempReg(pParse); - pTerm = findTerm(pWC, iCur, -1, notReady, WO_EQ|WO_IN, 0); - assert( pTerm!=0 ); - assert( pTerm->pExpr!=0 ); - assert( pTerm->leftCursor==iCur ); - assert( omitTable==0 ); - r1 = codeEqualityTerm(pParse, pTerm, pLevel, rtmp); - addrNxt = pLevel->addrNxt; - sqlite3VdbeAddOp2(v, OP_MustBeInt, r1, addrNxt); - sqlite3VdbeAddOp3(v, OP_NotExists, iCur, addrNxt, r1); - codeRowSetEarly = (pWC->nTerm==1 && regRowSet>=0) ?1:0; - if( codeRowSetEarly ){ - sqlite3VdbeAddOp2(v, OP_RowSetAdd, regRowSet, r1); - } - sqlite3ReleaseTempReg(pParse, rtmp); - VdbeComment((v, "pk")); - pLevel->op = OP_Noop; - }else if( pLevel->plan.wsFlags & WHERE_ROWID_RANGE ){ - /* Case 2: We have an inequality comparison against the ROWID field. - */ - int testOp = OP_Noop; - int start; - int memEndValue = 0; - WhereTerm *pStart, *pEnd; - - assert( omitTable==0 ); - pStart = findTerm(pWC, iCur, -1, notReady, WO_GT|WO_GE, 0); - pEnd = findTerm(pWC, iCur, -1, notReady, WO_LT|WO_LE, 0); - if( bRev ){ - pTerm = pStart; - pStart = pEnd; - pEnd = pTerm; - } - if( pStart ){ - Expr *pX; /* The expression that defines the start bound */ - int r1, rTemp; /* Registers for holding the start boundary */ - - /* The following constant maps TK_xx codes into corresponding - ** seek opcodes. It depends on a particular ordering of TK_xx - */ - const u8 aMoveOp[] = { - /* TK_GT */ OP_SeekGt, - /* TK_LE */ OP_SeekLe, - /* TK_LT */ OP_SeekLt, - /* TK_GE */ OP_SeekGe - }; - assert( TK_LE==TK_GT+1 ); /* Make sure the ordering.. */ - assert( TK_LT==TK_GT+2 ); /* ... of the TK_xx values... */ - assert( TK_GE==TK_GT+3 ); /* ... is correcct. */ - - pX = pStart->pExpr; - assert( pX!=0 ); - assert( pStart->leftCursor==iCur ); - r1 = sqlite3ExprCodeTemp(pParse, pX->pRight, &rTemp); - sqlite3VdbeAddOp3(v, aMoveOp[pX->op-TK_GT], iCur, addrBrk, r1); - VdbeComment((v, "pk")); - sqlite3ExprCacheAffinityChange(pParse, r1, 1); - sqlite3ReleaseTempReg(pParse, rTemp); - disableTerm(pLevel, pStart); - }else{ - sqlite3VdbeAddOp2(v, bRev ? OP_Last : OP_Rewind, iCur, addrBrk); - } - if( pEnd ){ - Expr *pX; - pX = pEnd->pExpr; - assert( pX!=0 ); - assert( pEnd->leftCursor==iCur ); - memEndValue = ++pParse->nMem; - sqlite3ExprCode(pParse, pX->pRight, memEndValue); - if( pX->op==TK_LT || pX->op==TK_GT ){ - testOp = bRev ? OP_Le : OP_Ge; - }else{ - testOp = bRev ? OP_Lt : OP_Gt; - } - disableTerm(pLevel, pEnd); - } - start = sqlite3VdbeCurrentAddr(v); - pLevel->op = bRev ? OP_Prev : OP_Next; - pLevel->p1 = iCur; - pLevel->p2 = start; - pLevel->p5 = (pStart==0 && pEnd==0) ?1:0; - codeRowSetEarly = regRowSet>=0 ? whereRowReadyForOutput(pWC) : 0; - if( codeRowSetEarly || testOp!=OP_Noop ){ - int r1 = sqlite3GetTempReg(pParse); - sqlite3VdbeAddOp2(v, OP_Rowid, iCur, r1); - if( testOp!=OP_Noop ){ - sqlite3VdbeAddOp3(v, testOp, memEndValue, addrBrk, r1); - sqlite3VdbeChangeP5(v, SQLITE_AFF_NUMERIC | SQLITE_JUMPIFNULL); - } - if( codeRowSetEarly ){ - sqlite3VdbeAddOp2(v, OP_RowSetAdd, regRowSet, r1); - } - sqlite3ReleaseTempReg(pParse, r1); - } - }else if( pLevel->plan.wsFlags & (WHERE_COLUMN_RANGE|WHERE_COLUMN_EQ) ){ - /* Case 3: A scan using an index. - ** - ** The WHERE clause may contain zero or more equality - ** terms ("==" or "IN" operators) that refer to the N - ** left-most columns of the index. It may also contain - ** inequality constraints (>, <, >= or <=) on the indexed - ** column that immediately follows the N equalities. Only - ** the right-most column can be an inequality - the rest must - ** use the "==" and "IN" operators. For example, if the - ** index is on (x,y,z), then the following clauses are all - ** optimized: - ** - ** x=5 - ** x=5 AND y=10 - ** x=5 AND y<10 - ** x=5 AND y>5 AND y<10 - ** x=5 AND y=5 AND z<=10 - ** - ** The z<10 term of the following cannot be used, only - ** the x=5 term: - ** - ** x=5 AND z<10 - ** - ** N may be zero if there are inequality constraints. - ** If there are no inequality constraints, then N is at - ** least one. - ** - ** This case is also used when there are no WHERE clause - ** constraints but an index is selected anyway, in order - ** to force the output order to conform to an ORDER BY. - */ - int aStartOp[] = { - 0, - 0, - OP_Rewind, /* 2: (!start_constraints && startEq && !bRev) */ - OP_Last, /* 3: (!start_constraints && startEq && bRev) */ - OP_SeekGt, /* 4: (start_constraints && !startEq && !bRev) */ - OP_SeekLt, /* 5: (start_constraints && !startEq && bRev) */ - OP_SeekGe, /* 6: (start_constraints && startEq && !bRev) */ - OP_SeekLe /* 7: (start_constraints && startEq && bRev) */ - }; - int aEndOp[] = { - OP_Noop, /* 0: (!end_constraints) */ - OP_IdxGE, /* 1: (end_constraints && !bRev) */ - OP_IdxLT /* 2: (end_constraints && bRev) */ - }; - int nEq = pLevel->plan.nEq; - int isMinQuery = 0; /* If this is an optimized SELECT min(x).. */ - int regBase; /* Base register holding constraint values */ - int r1; /* Temp register */ - WhereTerm *pRangeStart = 0; /* Inequality constraint at range start */ - WhereTerm *pRangeEnd = 0; /* Inequality constraint at range end */ - int startEq; /* True if range start uses ==, >= or <= */ - int endEq; /* True if range end uses ==, >= or <= */ - int start_constraints; /* Start of range is constrained */ - int nConstraint; /* Number of constraint terms */ - Index *pIdx; /* The index we will be using */ - int iIdxCur; /* The VDBE cursor for the index */ - int nExtraReg = 0; /* Number of extra registers needed */ - int op; /* Instruction opcode */ - - pIdx = pLevel->plan.u.pIdx; - iIdxCur = pLevel->iIdxCur; - k = pIdx->aiColumn[nEq]; /* Column for inequality constraints */ - - /* If this loop satisfies a sort order (pOrderBy) request that - ** was passed to this function to implement a "SELECT min(x) ..." - ** query, then the caller will only allow the loop to run for - ** a single iteration. This means that the first row returned - ** should not have a NULL value stored in 'x'. If column 'x' is - ** the first one after the nEq equality constraints in the index, - ** this requires some special handling. - */ - if( (wctrlFlags&WHERE_ORDERBY_MIN)!=0 - && (pLevel->plan.wsFlags&WHERE_ORDERBY) - && (pIdx->nColumn>nEq) - ){ - /* assert( pOrderBy->nExpr==1 ); */ - /* assert( pOrderBy->a[0].pExpr->iColumn==pIdx->aiColumn[nEq] ); */ - isMinQuery = 1; - nExtraReg = 1; - } - - /* Find any inequality constraint terms for the start and end - ** of the range. - */ - if( pLevel->plan.wsFlags & WHERE_TOP_LIMIT ){ - pRangeEnd = findTerm(pWC, iCur, k, notReady, (WO_LT|WO_LE), pIdx); - nExtraReg = 1; - } - if( pLevel->plan.wsFlags & WHERE_BTM_LIMIT ){ - pRangeStart = findTerm(pWC, iCur, k, notReady, (WO_GT|WO_GE), pIdx); - nExtraReg = 1; - } - - /* Generate code to evaluate all constraint terms using == or IN - ** and store the values of those terms in an array of registers - ** starting at regBase. - */ - regBase = codeAllEqualityTerms(pParse, pLevel, pWC, notReady, nExtraReg); - addrNxt = pLevel->addrNxt; - - - /* If we are doing a reverse order scan on an ascending index, or - ** a forward order scan on a descending index, interchange the - ** start and end terms (pRangeStart and pRangeEnd). - */ - if( bRev==(pIdx->aSortOrder[nEq]==SQLITE_SO_ASC) ){ - SWAP(WhereTerm *, pRangeEnd, pRangeStart); - } - - testcase( pRangeStart && pRangeStart->eOperator & WO_LE ); - testcase( pRangeStart && pRangeStart->eOperator & WO_GE ); - testcase( pRangeEnd && pRangeEnd->eOperator & WO_LE ); - testcase( pRangeEnd && pRangeEnd->eOperator & WO_GE ); - startEq = !pRangeStart || pRangeStart->eOperator & (WO_LE|WO_GE); - endEq = !pRangeEnd || pRangeEnd->eOperator & (WO_LE|WO_GE); - start_constraints = pRangeStart || nEq>0; - - /* Seek the index cursor to the start of the range. */ - nConstraint = nEq; - if( pRangeStart ){ - int dcc = pParse->disableColCache; - if( pRangeEnd ){ - pParse->disableColCache++; - } - sqlite3ExprCode(pParse, pRangeStart->pExpr->pRight, regBase+nEq); - pParse->disableColCache = dcc; - sqlite3VdbeAddOp2(v, OP_IsNull, regBase+nEq, addrNxt); - nConstraint++; - }else if( isMinQuery ){ - sqlite3VdbeAddOp2(v, OP_Null, 0, regBase+nEq); - nConstraint++; - startEq = 0; - start_constraints = 1; - } - codeApplyAffinity(pParse, regBase, nConstraint, pIdx); - op = aStartOp[(start_constraints<<2) + (startEq<<1) + bRev]; - assert( op!=0 ); - testcase( op==OP_Rewind ); - testcase( op==OP_Last ); - testcase( op==OP_SeekGt ); - testcase( op==OP_SeekGe ); - testcase( op==OP_SeekLe ); - testcase( op==OP_SeekLt ); - sqlite3VdbeAddOp4(v, op, iIdxCur, addrNxt, regBase, - SQLITE_INT_TO_PTR(nConstraint), P4_INT32); - - /* Load the value for the inequality constraint at the end of the - ** range (if any). - */ - nConstraint = nEq; - if( pRangeEnd ){ - sqlite3ExprCode(pParse, pRangeEnd->pExpr->pRight, regBase+nEq); - sqlite3VdbeAddOp2(v, OP_IsNull, regBase+nEq, addrNxt); - codeApplyAffinity(pParse, regBase, nEq+1, pIdx); - nConstraint++; - } - - /* Top of the loop body */ - pLevel->p2 = sqlite3VdbeCurrentAddr(v); - - /* Check if the index cursor is past the end of the range. */ - op = aEndOp[(pRangeEnd || nEq) * (1 + bRev)]; - testcase( op==OP_Noop ); - testcase( op==OP_IdxGE ); - testcase( op==OP_IdxLT ); - if( op!=OP_Noop ){ - sqlite3VdbeAddOp4(v, op, iIdxCur, addrNxt, regBase, - SQLITE_INT_TO_PTR(nConstraint), P4_INT32); - sqlite3VdbeChangeP5(v, endEq!=bRev ?1:0); - } - - /* If there are inequality constraints, check that the value - ** of the table column that the inequality contrains is not NULL. - ** If it is, jump to the next iteration of the loop. - */ - r1 = sqlite3GetTempReg(pParse); - testcase( pLevel->plan.wsFlags & WHERE_BTM_LIMIT ); - testcase( pLevel->plan.wsFlags & WHERE_TOP_LIMIT ); - if( pLevel->plan.wsFlags & (WHERE_BTM_LIMIT|WHERE_TOP_LIMIT) ){ - sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, nEq, r1); - sqlite3VdbeAddOp2(v, OP_IsNull, r1, addrCont); - } - - /* Seek the table cursor, if required */ - disableTerm(pLevel, pRangeStart); - disableTerm(pLevel, pRangeEnd); - codeRowSetEarly = regRowSet>=0 ? whereRowReadyForOutput(pWC) : 0; - if( !omitTable || codeRowSetEarly ){ - sqlite3VdbeAddOp2(v, OP_IdxRowid, iIdxCur, r1); - if( codeRowSetEarly ){ - sqlite3VdbeAddOp2(v, OP_RowSetAdd, regRowSet, r1); - }else{ - sqlite3VdbeAddOp2(v, OP_Seek, iCur, r1); /* Deferred seek */ - } - } - sqlite3ReleaseTempReg(pParse, r1); - - /* Record the instruction used to terminate the loop. Disable - ** WHERE clause terms made redundant by the index range scan. - */ - pLevel->op = bRev ? OP_Prev : OP_Next; - pLevel->p1 = iIdxCur; - }else - -#ifndef SQLITE_OMIT_OR_OPTIMIZATION - if( pLevel->plan.wsFlags & WHERE_MULTI_OR ){ - /* Case 4: Two or more separately indexed terms connected by OR - ** - ** Example: - ** - ** CREATE TABLE t1(a,b,c,d); - ** CREATE INDEX i1 ON t1(a); - ** CREATE INDEX i2 ON t1(b); - ** CREATE INDEX i3 ON t1(c); - ** - ** SELECT * FROM t1 WHERE a=5 OR b=7 OR (c=11 AND d=13) - ** - ** In the example, there are three indexed terms connected by OR. - ** The top of the loop is constructed by creating a RowSet object - ** and populating it. Then looping over elements of the rowset. - ** - ** Null 1 - ** # fill RowSet 1 with entries where a=5 using i1 - ** # fill Rowset 1 with entries where b=7 using i2 - ** # fill Rowset 1 with entries where c=11 and d=13 i3 and t1 - ** A: RowSetRead 1, B, 2 - ** Seek i, 2 - ** - ** The bottom of the loop looks like this: - ** - ** Goto 0, A - ** B: - */ - int regOrRowset; /* Register holding the RowSet object */ - int regNextRowid; /* Register holding next rowid */ - WhereClause *pOrWc; /* The OR-clause broken out into subterms */ - WhereTerm *pOrTerm; /* A single subterm within the OR-clause */ - SrcList oneTab; /* Shortened table list */ - - pTerm = pLevel->plan.u.pTerm; - assert( pTerm!=0 ); - assert( pTerm->eOperator==WO_OR ); - assert( (pTerm->wtFlags & TERM_ORINFO)!=0 ); - pOrWc = &pTerm->u.pOrInfo->wc; - codeRowSetEarly = (regRowSet>=0 && pWC->nTerm==1) ?1:0; - - if( codeRowSetEarly ){ - regOrRowset = regRowSet; - }else{ - regOrRowset = sqlite3GetTempReg(pParse); - sqlite3VdbeAddOp2(v, OP_Null, 0, regOrRowset); - } - oneTab.nSrc = 1; - oneTab.nAlloc = 1; - oneTab.a[0] = *pTabItem; - for(j=0, pOrTerm=pOrWc->a; jnTerm; j++, pOrTerm++){ - WhereInfo *pSubWInfo; - if( pOrTerm->leftCursor!=iCur && pOrTerm->eOperator!=WO_AND ) continue; - pSubWInfo = sqlite3WhereBegin(pParse, &oneTab, pOrTerm->pExpr, 0, - WHERE_FILL_ROWSET | WHERE_OMIT_OPEN | WHERE_OMIT_CLOSE, - regOrRowset); - if( pSubWInfo ){ - sqlite3WhereEnd(pSubWInfo); - } - } - sqlite3VdbeResolveLabel(v, addrCont); - if( !codeRowSetEarly ){ - regNextRowid = sqlite3GetTempReg(pParse); - addrCont = - sqlite3VdbeAddOp3(v, OP_RowSetRead, regOrRowset,addrBrk,regNextRowid); - sqlite3VdbeAddOp2(v, OP_Seek, iCur, regNextRowid); - sqlite3ReleaseTempReg(pParse, regNextRowid); - /* sqlite3ReleaseTempReg(pParse, regOrRowset); // Preserve the RowSet */ - pLevel->op = OP_Goto; - pLevel->p2 = addrCont; - }else{ - pLevel->op = OP_Noop; - } - disableTerm(pLevel, pTerm); - }else -#endif /* SQLITE_OMIT_OR_OPTIMIZATION */ - - { - /* Case 5: There is no usable index. We must do a complete - ** scan of the entire table. - */ - assert( omitTable==0 ); - assert( bRev==0 ); - pLevel->op = OP_Next; - pLevel->p1 = iCur; - pLevel->p2 = 1 + sqlite3VdbeAddOp2(v, OP_Rewind, iCur, addrBrk); - pLevel->p5 = SQLITE_STMTSTATUS_FULLSCAN_STEP; - codeRowSetEarly = 0; - } - notReady &= ~getMask(pWC->pMaskSet, iCur); - - /* Insert code to test every subexpression that can be completely - ** computed using the current set of tables. - */ - k = 0; - for(pTerm=pWC->a, j=pWC->nTerm; j>0; j--, pTerm++){ - Expr *pE; - testcase( pTerm->wtFlags & TERM_VIRTUAL ); - testcase( pTerm->wtFlags & TERM_CODED ); - if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue; - if( (pTerm->prereqAll & notReady)!=0 ) continue; - pE = pTerm->pExpr; - assert( pE!=0 ); - if( pLevel->iLeftJoin && !ExprHasProperty(pE, EP_FromJoin) ){ - continue; - } - pParse->disableColCache += k; - sqlite3ExprIfFalse(pParse, pE, addrCont, SQLITE_JUMPIFNULL); - pParse->disableColCache -= k; - k = 1; - pTerm->wtFlags |= TERM_CODED; - } - - /* For a LEFT OUTER JOIN, generate code that will record the fact that - ** at least one row of the right table has matched the left table. - */ - if( pLevel->iLeftJoin ){ - pLevel->addrFirst = sqlite3VdbeCurrentAddr(v); - sqlite3VdbeAddOp2(v, OP_Integer, 1, pLevel->iLeftJoin); - VdbeComment((v, "record LEFT JOIN hit")); - sqlite3ExprClearColumnCache(pParse, pLevel->iTabCur); - sqlite3ExprClearColumnCache(pParse, pLevel->iIdxCur); - for(pTerm=pWC->a, j=0; jnTerm; j++, pTerm++){ - testcase( pTerm->wtFlags & TERM_VIRTUAL ); - testcase( pTerm->wtFlags & TERM_CODED ); - if( pTerm->wtFlags & (TERM_VIRTUAL|TERM_CODED) ) continue; - if( (pTerm->prereqAll & notReady)!=0 ) continue; - assert( pTerm->pExpr ); - sqlite3ExprIfFalse(pParse, pTerm->pExpr, addrCont, SQLITE_JUMPIFNULL); - pTerm->wtFlags |= TERM_CODED; - } - } - - /* - ** If it was requested to store the results in a rowset and that has - ** not already been do, then do so now. - */ - if( regRowSet>=0 && !codeRowSetEarly ){ - int r1 = sqlite3GetTempReg(pParse); -#ifndef SQLITE_OMIT_VIRTUALTABLE - if( (pLevel->plan.wsFlags & WHERE_VIRTUALTABLE)!=0 ){ - sqlite3VdbeAddOp2(v, OP_VRowid, iCur, r1); - }else -#endif - { - sqlite3VdbeAddOp2(v, OP_Rowid, iCur, r1); - } - sqlite3VdbeAddOp2(v, OP_RowSetAdd, regRowSet, r1); - sqlite3ReleaseTempReg(pParse, r1); - } - - return notReady; -} - #if defined(SQLITE_TEST) /* ** The following variable holds a text description of query plan generated ** by the most recent call to sqlite3WhereBegin(). Each call to WhereBegin ** overwrites the previous. This information is used for testing and @@ -2831,18 +1935,14 @@ if( pWInfo ){ int i; for(i=0; inLevel; i++){ sqlite3_index_info *pInfo = pWInfo->a[i].pIdxInfo; if( pInfo ){ - assert( pInfo->needToFreeIdxStr==0 || db->mallocFailed ); - if( pInfo->needToFreeIdxStr ){ - sqlite3_free(pInfo->idxStr); - } + assert( pInfo->needToFreeIdxStr==0 ); sqlite3DbFree(db, pInfo); } } - whereClauseClear(pWInfo->pWC); sqlite3DbFree(db, pWInfo); } } @@ -2937,23 +2037,24 @@ WhereInfo *sqlite3WhereBegin( Parse *pParse, /* The parser context */ SrcList *pTabList, /* A list of all tables to be scanned */ Expr *pWhere, /* The WHERE clause */ ExprList **ppOrderBy, /* An ORDER BY clause, or NULL */ - u8 wctrlFlags, /* One of the WHERE_* flags defined in sqliteInt.h */ - int regRowSet /* Register hold RowSet if WHERE_FILL_ROWSET is set */ + u8 wflags /* One of the WHERE_* flags defined in sqliteInt.h */ ){ int i; /* Loop counter */ WhereInfo *pWInfo; /* Will become the return value of this function */ Vdbe *v = pParse->pVdbe; /* The virtual database engine */ + int brk, cont = 0; /* Addresses used during code generation */ Bitmask notReady; /* Cursors that are not yet positioned */ - WhereMaskSet *pMaskSet; /* The expression mask set */ - WhereClause *pWC; /* Decomposition of the WHERE clause */ + WhereTerm *pTerm; /* A single term in the WHERE clause */ + ExprMaskSet maskSet; /* The expression mask set */ + WhereClause wc; /* The WHERE clause is divided into these terms */ struct SrcList_item *pTabItem; /* A single entry from pTabList */ WhereLevel *pLevel; /* A single level in the pWInfo list */ int iFrom; /* First unused FROM clause element */ - int andFlags; /* AND-ed combination of all pWC->a[].wtFlags */ + int andFlags; /* AND-ed combination of all wc.a[].flags */ sqlite3 *db; /* Database connection */ ExprList *pOrderBy = 0; /* The number of tables in the FROM clause is limited by the number of ** bits in a Bitmask @@ -2965,40 +2066,32 @@ if( ppOrderBy ){ pOrderBy = *ppOrderBy; } + /* Split the WHERE clause into separate subexpressions where each + ** subexpression is separated by an AND operator. + */ + initMaskSet(&maskSet); + whereClauseInit(&wc, pParse, &maskSet); + sqlite3ExprCodeConstants(pParse, pWhere); + whereSplit(&wc, pWhere, TK_AND); + /* Allocate and initialize the WhereInfo structure that will become the ** return value. */ db = pParse->db; pWInfo = sqlite3DbMallocZero(db, - sizeof(WhereInfo) - + (pTabList->nSrc-1)*sizeof(WhereLevel) - + sizeof(WhereClause) - + sizeof(WhereMaskSet) - ); + sizeof(WhereInfo) + pTabList->nSrc*sizeof(WhereLevel)); if( db->mallocFailed ){ goto whereBeginError; } pWInfo->nLevel = pTabList->nSrc; pWInfo->pParse = pParse; pWInfo->pTabList = pTabList; pWInfo->iBreak = sqlite3VdbeMakeLabel(v); - pWInfo->regRowSet = (wctrlFlags & WHERE_FILL_ROWSET) ? regRowSet : -1; - pWInfo->pWC = pWC = (WhereClause*)&pWInfo->a[pWInfo->nLevel]; - pWInfo->wctrlFlags = wctrlFlags; - pMaskSet = (WhereMaskSet*)&pWC[1]; - - /* Split the WHERE clause into separate subexpressions where each - ** subexpression is separated by an AND operator. - */ - initMaskSet(pMaskSet); - whereClauseInit(pWC, pParse, pMaskSet); - sqlite3ExprCodeConstants(pParse, pWhere); - whereSplit(pWC, pWhere, TK_AND); - + /* Special case: a WHERE clause that is constant. Evaluate the ** expression and either jump over all of the code or fall thru. */ if( pWhere && (pTabList->nSrc==0 || sqlite3ExprIsConstantNotJoin(pWhere)) ){ sqlite3ExprIfFalse(pParse, pWhere, pWInfo->iBreak, SQLITE_JUMPIFNULL); @@ -3015,17 +2108,17 @@ ** of the join. Subtracting one from the right table bitmask gives a ** bitmask for all tables to the left of the join. Knowing the bitmask ** for all tables to the left of a left join is important. Ticket #3015. */ for(i=0; inSrc; i++){ - createMask(pMaskSet, pTabList->a[i].iCursor); + createMask(&maskSet, pTabList->a[i].iCursor); } #ifndef NDEBUG { Bitmask toTheLeft = 0; for(i=0; inSrc; i++){ - Bitmask m = getMask(pMaskSet, pTabList->a[i].iCursor); + Bitmask m = getMask(&maskSet, pTabList->a[i].iCursor); assert( (m-1)==toTheLeft ); toTheLeft |= m; } } #endif @@ -3033,26 +2126,25 @@ /* Analyze all of the subexpressions. Note that exprAnalyze() might ** add new virtual terms onto the end of the WHERE clause. We do not ** want to analyze these virtual terms, so start analyzing at the end ** and work forward so that the added virtual terms are never processed. */ - exprAnalyzeAll(pTabList, pWC); + exprAnalyzeAll(pTabList, &wc); if( db->mallocFailed ){ goto whereBeginError; } /* Chose the best index to use for each table in the FROM clause. ** ** This loop fills in the following fields: ** ** pWInfo->a[].pIdx The index to use for this level of the loop. - ** pWInfo->a[].wsFlags WHERE_xxx flags associated with pIdx + ** pWInfo->a[].flags WHERE_xxx flags associated with pIdx ** pWInfo->a[].nEq The number of == and IN constraints ** pWInfo->a[].iFrom Which term of the FROM clause is being coded ** pWInfo->a[].iTabCur The VDBE cursor for the database table ** pWInfo->a[].iIdxCur The VDBE cursor for the index - ** pWInfo->a[].pTerm When wsFlags==WO_OR, the OR-clause term ** ** This loop also figures out the nesting order of tables in the FROM ** clause. */ notReady = ~(Bitmask)0; @@ -3059,105 +2151,108 @@ pTabItem = pTabList->a; pLevel = pWInfo->a; andFlags = ~0; WHERETRACE(("*** Optimizer Start ***\n")); for(i=iFrom=0, pLevel=pWInfo->a; inSrc; i++, pLevel++){ - WhereCost bestPlan; /* Most efficient plan seen so far */ Index *pIdx; /* Index for FROM table at pTabItem */ + int flags; /* Flags asssociated with pIdx */ + int nEq; /* Number of == or IN constraints */ + double cost; /* The cost for pIdx */ int j; /* For looping over FROM tables */ + Index *pBest = 0; /* The best index seen so far */ + int bestFlags = 0; /* Flags associated with pBest */ + int bestNEq = 0; /* nEq associated with pBest */ + double lowestCost; /* Cost of the pBest */ int bestJ = 0; /* The value of j */ Bitmask m; /* Bitmask value for j or bestJ */ int once = 0; /* True when first table is seen */ + sqlite3_index_info *pIndex; /* Current virtual index */ - memset(&bestPlan, 0, sizeof(bestPlan)); - bestPlan.rCost = SQLITE_BIG_DBL; + lowestCost = SQLITE_BIG_DBL; for(j=iFrom, pTabItem=&pTabList->a[j]; jnSrc; j++, pTabItem++){ int doNotReorder; /* True if this table should not be reordered */ - WhereCost sCost; /* Cost information from bestIndex() */ doNotReorder = (pTabItem->jointype & (JT_LEFT|JT_CROSS))!=0; if( once && doNotReorder ) break; - m = getMask(pMaskSet, pTabItem->iCursor); + m = getMask(&maskSet, pTabItem->iCursor); if( (m & notReady)==0 ){ if( j==iFrom ) iFrom++; continue; } assert( pTabItem->pTab ); #ifndef SQLITE_OMIT_VIRTUALTABLE if( IsVirtual(pTabItem->pTab) ){ - sqlite3_index_info *pVtabIdx; /* Current virtual index */ sqlite3_index_info **ppIdxInfo = &pWInfo->a[j].pIdxInfo; - sCost.rCost = bestVirtualIndex(pParse, pWC, pTabItem, notReady, - ppOrderBy ? *ppOrderBy : 0, i==0, - ppIdxInfo); - sCost.plan.wsFlags = WHERE_VIRTUALTABLE; - sCost.plan.u.pVtabIdx = pVtabIdx = *ppIdxInfo; - if( pVtabIdx && pVtabIdx->orderByConsumed ){ - sCost.plan.wsFlags = WHERE_VIRTUALTABLE | WHERE_ORDERBY; - } - sCost.plan.nEq = 0; - /* (double)2 In case of SQLITE_OMIT_FLOATING_POINT... */ - if( (SQLITE_BIG_DBL/((double)2))orderByConsumed ){ + flags = WHERE_VIRTUALTABLE | WHERE_ORDERBY; + } + pIdx = 0; + nEq = 0; + if( (SQLITE_BIG_DBL/2.0)pBestIdx never set. */ - /* (double)2 In case of SQLITE_OMIT_FLOATING_POINT... */ - sCost.rCost = (SQLITE_BIG_DBL/((double)2)); + cost = (SQLITE_BIG_DBL/2.0); } }else #endif { - bestIndex(pParse, pWC, pTabItem, notReady, - (i==0 && ppOrderBy) ? *ppOrderBy : 0, &sCost); + cost = bestIndex(pParse, &wc, pTabItem, notReady, + (i==0 && ppOrderBy) ? *ppOrderBy : 0, + &pIdx, &flags, &nEq); + pIndex = 0; } - if( once==0 || sCost.rCostpBestIdx = pIndex; } if( doNotReorder ) break; } - assert( once ); - assert( notReady & getMask(pMaskSet, pTabList->a[bestJ].iCursor) ); WHERETRACE(("*** Optimizer selects table %d for loop %d\n", bestJ, pLevel-pWInfo->a)); - if( (bestPlan.plan.wsFlags & WHERE_ORDERBY)!=0 ){ + if( (bestFlags & WHERE_ORDERBY)!=0 ){ *ppOrderBy = 0; } - andFlags &= bestPlan.plan.wsFlags; - pLevel->plan = bestPlan.plan; - if( bestPlan.plan.wsFlags & WHERE_INDEXED ){ + andFlags &= bestFlags; + pLevel->flags = bestFlags; + pLevel->pIdx = pBest; + pLevel->nEq = bestNEq; + pLevel->aInLoop = 0; + pLevel->nIn = 0; + if( pBest ){ pLevel->iIdxCur = pParse->nTab++; }else{ pLevel->iIdxCur = -1; } - notReady &= ~getMask(pMaskSet, pTabList->a[bestJ].iCursor); - pLevel->iFrom = (u8)bestJ; + notReady &= ~getMask(&maskSet, pTabList->a[bestJ].iCursor); + pLevel->iFrom = bestJ; /* Check that if the table scanned by this loop iteration had an ** INDEXED BY clause attached to it, that the named index is being ** used for the scan. If not, then query compilation has failed. ** Return an error. */ pIdx = pTabList->a[bestJ].pIndex; - if( pIdx ){ - if( (bestPlan.plan.wsFlags & WHERE_INDEXED)==0 ){ - sqlite3ErrorMsg(pParse, "cannot use index: %s", pIdx->zName); - goto whereBeginError; - }else{ - /* If an INDEXED BY clause is used, the bestIndex() function is - ** guaranteed to find the index specified in the INDEXED BY clause - ** if it find an index at all. */ - assert( bestPlan.plan.u.pIdx==pIdx ); - } + assert( !pIdx || !pBest || pIdx==pBest ); + if( pIdx && pBest!=pIdx ){ + sqlite3ErrorMsg(pParse, "cannot use index: %s", pIdx->zName); + goto whereBeginError; } } WHERETRACE(("*** Optimizer Finished ***\n")); - if( db->mallocFailed ){ - goto whereBeginError; - } /* If the total query only selects a single row, then the ORDER BY ** clause is irrelevant. */ if( (andFlags & WHERE_UNIQUE)!=0 && ppOrderBy ){ @@ -3167,48 +2262,47 @@ /* If the caller is an UPDATE or DELETE statement that is requesting ** to use a one-pass algorithm, determine if this is appropriate. ** The one-pass algorithm only works if the WHERE clause constraints ** the statement to update a single row. */ - assert( (wctrlFlags & WHERE_ONEPASS_DESIRED)==0 || pWInfo->nLevel==1 ); - if( (wctrlFlags & WHERE_ONEPASS_DESIRED)!=0 && (andFlags & WHERE_UNIQUE)!=0 ){ + assert( (wflags & WHERE_ONEPASS_DESIRED)==0 || pWInfo->nLevel==1 ); + if( (wflags & WHERE_ONEPASS_DESIRED)!=0 && (andFlags & WHERE_UNIQUE)!=0 ){ pWInfo->okOnePass = 1; - pWInfo->a[0].plan.wsFlags &= ~WHERE_IDX_ONLY; + pWInfo->a[0].flags &= ~WHERE_IDX_ONLY; } /* Open all tables in the pTabList and any indices selected for ** searching those tables. */ sqlite3CodeVerifySchema(pParse, -1); /* Insert the cookie verifier Goto */ for(i=0, pLevel=pWInfo->a; inSrc; i++, pLevel++){ Table *pTab; /* Table to open */ + Index *pIx; /* Index used to access pTab (if any) */ int iDb; /* Index of database containing table/index */ + int iIdxCur = pLevel->iIdxCur; #ifndef SQLITE_OMIT_EXPLAIN if( pParse->explain==2 ){ char *zMsg; struct SrcList_item *pItem = &pTabList->a[pLevel->iFrom]; zMsg = sqlite3MPrintf(db, "TABLE %s", pItem->zName); if( pItem->zAlias ){ zMsg = sqlite3MAppendf(db, zMsg, "%s AS %s", zMsg, pItem->zAlias); } - if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 ){ - zMsg = sqlite3MAppendf(db, zMsg, "%s WITH INDEX %s", - zMsg, pLevel->plan.u.pIdx->zName); - }else if( pLevel->plan.wsFlags & WHERE_MULTI_OR ){ - zMsg = sqlite3MAppendf(db, zMsg, "%s VIA MULTI-INDEX UNION", zMsg); - }else if( pLevel->plan.wsFlags & (WHERE_ROWID_EQ|WHERE_ROWID_RANGE) ){ + if( (pIx = pLevel->pIdx)!=0 ){ + zMsg = sqlite3MAppendf(db, zMsg, "%s WITH INDEX %s", zMsg, pIx->zName); + }else if( pLevel->flags & (WHERE_ROWID_EQ|WHERE_ROWID_RANGE) ){ zMsg = sqlite3MAppendf(db, zMsg, "%s USING PRIMARY KEY", zMsg); } #ifndef SQLITE_OMIT_VIRTUALTABLE - else if( (pLevel->plan.wsFlags & WHERE_VIRTUALTABLE)!=0 ){ - sqlite3_index_info *pVtabIdx = pLevel->plan.u.pVtabIdx; + else if( pLevel->pBestIdx ){ + sqlite3_index_info *pBestIdx = pLevel->pBestIdx; zMsg = sqlite3MAppendf(db, zMsg, "%s VIRTUAL TABLE INDEX %d:%s", zMsg, - pVtabIdx->idxNum, pVtabIdx->idxStr); + pBestIdx->idxNum, pBestIdx->idxStr); } #endif - if( pLevel->plan.wsFlags & WHERE_ORDERBY ){ + if( pLevel->flags & WHERE_ORDERBY ){ zMsg = sqlite3MAppendf(db, zMsg, "%s ORDER BY", zMsg); } sqlite3VdbeAddOp4(v, OP_Explain, i, pLevel->iFrom, 0, zMsg, P4_DYNAMIC); } #endif /* SQLITE_OMIT_EXPLAIN */ @@ -3215,21 +2309,20 @@ pTabItem = &pTabList->a[pLevel->iFrom]; pTab = pTabItem->pTab; iDb = sqlite3SchemaToIndex(pParse->db, pTab->pSchema); if( (pTab->tabFlags & TF_Ephemeral)!=0 || pTab->pSelect ) continue; #ifndef SQLITE_OMIT_VIRTUALTABLE - if( (pLevel->plan.wsFlags & WHERE_VIRTUALTABLE)!=0 ){ + if( pLevel->pBestIdx ){ int iCur = pTabItem->iCursor; sqlite3VdbeAddOp4(v, OP_VOpen, iCur, 0, 0, (const char*)pTab->pVtab, P4_VTAB); }else #endif - if( (pLevel->plan.wsFlags & WHERE_IDX_ONLY)==0 - && (wctrlFlags & WHERE_OMIT_OPEN)==0 ){ + if( (pLevel->flags & WHERE_IDX_ONLY)==0 ){ int op = pWInfo->okOnePass ? OP_OpenWrite : OP_OpenRead; sqlite3OpenTable(pParse, pTabItem->iCursor, iDb, pTab, op); - if( !pWInfo->okOnePass && pTab->nColokOnePass && pTab->nCol<(sizeof(Bitmask)*8) ){ Bitmask b = pTabItem->colUsed; int n = 0; for(; b; b=b>>1, n++){} sqlite3VdbeChangeP2(v, sqlite3VdbeCurrentAddr(v)-2, n); assert( n<=pTab->nCol ); @@ -3236,16 +2329,13 @@ } }else{ sqlite3TableLock(pParse, iDb, pTab->tnum, 0, pTab->zName); } pLevel->iTabCur = pTabItem->iCursor; - if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 ){ - Index *pIx = pLevel->plan.u.pIdx; + if( (pIx = pLevel->pIdx)!=0 ){ KeyInfo *pKey = sqlite3IndexKeyinfo(pParse, pIx); - int iIdxCur = pLevel->iIdxCur; assert( pIx->pSchema==pTab->pSchema ); - assert( iIdxCur>=0 ); sqlite3VdbeAddOp2(v, OP_SetNumColumns, 0, pIx->nColumn+1); sqlite3VdbeAddOp4(v, OP_OpenRead, iIdxCur, pIx->tnum, iDb, (char*)pKey, P4_KEYINFO_HANDOFF); VdbeComment((v, "%s", pIx->zName)); } @@ -3256,13 +2346,412 @@ /* Generate the code to do the search. Each iteration of the for ** loop below generates code for a single nested loop of the VM ** program. */ notReady = ~(Bitmask)0; - for(i=0; inSrc; i++){ - notReady = codeOneLoopStart(pWInfo, i, wctrlFlags, notReady); - pWInfo->iContinue = pWInfo->a[i].addrCont; + for(i=0, pLevel=pWInfo->a; inSrc; i++, pLevel++){ + int j; + int iCur = pTabItem->iCursor; /* The VDBE cursor for the table */ + Index *pIdx; /* The index we will be using */ + int nxt; /* Where to jump to continue with the next IN case */ + int iIdxCur; /* The VDBE cursor for the index */ + int omitTable; /* True if we use the index only */ + int bRev; /* True if we need to scan in reverse order */ + + pTabItem = &pTabList->a[pLevel->iFrom]; + iCur = pTabItem->iCursor; + pIdx = pLevel->pIdx; + iIdxCur = pLevel->iIdxCur; + bRev = (pLevel->flags & WHERE_REVERSE)!=0; + omitTable = (pLevel->flags & WHERE_IDX_ONLY)!=0; + + /* Create labels for the "break" and "continue" instructions + ** for the current loop. Jump to brk to break out of a loop. + ** Jump to cont to go immediately to the next iteration of the + ** loop. + ** + ** When there is an IN operator, we also have a "nxt" label that + ** means to continue with the next IN value combination. When + ** there are no IN operators in the constraints, the "nxt" label + ** is the same as "brk". + */ + brk = pLevel->brk = pLevel->nxt = sqlite3VdbeMakeLabel(v); + cont = pLevel->cont = sqlite3VdbeMakeLabel(v); + + /* If this is the right table of a LEFT OUTER JOIN, allocate and + ** initialize a memory cell that records if this table matches any + ** row of the left table of the join. + */ + if( pLevel->iFrom>0 && (pTabItem[0].jointype & JT_LEFT)!=0 ){ + pLevel->iLeftJoin = ++pParse->nMem; + sqlite3VdbeAddOp2(v, OP_Integer, 0, pLevel->iLeftJoin); + VdbeComment((v, "init LEFT JOIN no-match flag")); + } + +#ifndef SQLITE_OMIT_VIRTUALTABLE + if( pLevel->pBestIdx ){ + /* Case 0: The table is a virtual-table. Use the VFilter and VNext + ** to access the data. + */ + int j; + int iReg; /* P3 Value for OP_VFilter */ + sqlite3_index_info *pBestIdx = pLevel->pBestIdx; + int nConstraint = pBestIdx->nConstraint; + struct sqlite3_index_constraint_usage *aUsage = + pBestIdx->aConstraintUsage; + const struct sqlite3_index_constraint *aConstraint = + pBestIdx->aConstraint; + + iReg = sqlite3GetTempRange(pParse, nConstraint+2); + pParse->disableColCache++; + for(j=1; j<=nConstraint; j++){ + int k; + for(k=0; kdisableColCache ); + sqlite3ExprCode(pParse, wc.a[iTerm].pExpr->pRight, iReg+j+1); + break; + } + } + if( k==nConstraint ) break; + } + assert( pParse->disableColCache ); + pParse->disableColCache--; + sqlite3VdbeAddOp2(v, OP_Integer, pBestIdx->idxNum, iReg); + sqlite3VdbeAddOp2(v, OP_Integer, j-1, iReg+1); + sqlite3VdbeAddOp4(v, OP_VFilter, iCur, brk, iReg, pBestIdx->idxStr, + pBestIdx->needToFreeIdxStr ? P4_MPRINTF : P4_STATIC); + sqlite3ReleaseTempRange(pParse, iReg, nConstraint+2); + pBestIdx->needToFreeIdxStr = 0; + for(j=0; jop = OP_VNext; + pLevel->p1 = iCur; + pLevel->p2 = sqlite3VdbeCurrentAddr(v); + }else +#endif /* SQLITE_OMIT_VIRTUALTABLE */ + + if( pLevel->flags & WHERE_ROWID_EQ ){ + /* Case 1: We can directly reference a single row using an + ** equality comparison against the ROWID field. Or + ** we reference multiple rows using a "rowid IN (...)" + ** construct. + */ + int r1; + int rtmp = sqlite3GetTempReg(pParse); + pTerm = findTerm(&wc, iCur, -1, notReady, WO_EQ|WO_IN, 0); + assert( pTerm!=0 ); + assert( pTerm->pExpr!=0 ); + assert( pTerm->leftCursor==iCur ); + assert( omitTable==0 ); + r1 = codeEqualityTerm(pParse, pTerm, pLevel, rtmp); + nxt = pLevel->nxt; + sqlite3VdbeAddOp2(v, OP_MustBeInt, r1, nxt); + sqlite3VdbeAddOp3(v, OP_NotExists, iCur, nxt, r1); + sqlite3ReleaseTempReg(pParse, rtmp); + VdbeComment((v, "pk")); + pLevel->op = OP_Noop; + }else if( pLevel->flags & WHERE_ROWID_RANGE ){ + /* Case 2: We have an inequality comparison against the ROWID field. + */ + int testOp = OP_Noop; + int start; + WhereTerm *pStart, *pEnd; + + assert( omitTable==0 ); + pStart = findTerm(&wc, iCur, -1, notReady, WO_GT|WO_GE, 0); + pEnd = findTerm(&wc, iCur, -1, notReady, WO_LT|WO_LE, 0); + if( bRev ){ + pTerm = pStart; + pStart = pEnd; + pEnd = pTerm; + } + if( pStart ){ + Expr *pX; + int r1, regFree1; + pX = pStart->pExpr; + assert( pX!=0 ); + assert( pStart->leftCursor==iCur ); + r1 = sqlite3ExprCodeTemp(pParse, pX->pRight, ®Free1); + sqlite3VdbeAddOp3(v, OP_ForceInt, r1, brk, + pX->op==TK_LE || pX->op==TK_GT); + sqlite3VdbeAddOp3(v, bRev ? OP_MoveLt : OP_MoveGe, iCur, brk, r1); + VdbeComment((v, "pk")); + sqlite3ReleaseTempReg(pParse, regFree1); + disableTerm(pLevel, pStart); + }else{ + sqlite3VdbeAddOp2(v, bRev ? OP_Last : OP_Rewind, iCur, brk); + } + if( pEnd ){ + Expr *pX; + pX = pEnd->pExpr; + assert( pX!=0 ); + assert( pEnd->leftCursor==iCur ); + pLevel->iMem = ++pParse->nMem; + sqlite3ExprCode(pParse, pX->pRight, pLevel->iMem); + if( pX->op==TK_LT || pX->op==TK_GT ){ + testOp = bRev ? OP_Le : OP_Ge; + }else{ + testOp = bRev ? OP_Lt : OP_Gt; + } + disableTerm(pLevel, pEnd); + } + start = sqlite3VdbeCurrentAddr(v); + pLevel->op = bRev ? OP_Prev : OP_Next; + pLevel->p1 = iCur; + pLevel->p2 = start; + if( testOp!=OP_Noop ){ + int r1 = sqlite3GetTempReg(pParse); + sqlite3VdbeAddOp2(v, OP_Rowid, iCur, r1); + /* sqlite3VdbeAddOp2(v, OP_SCopy, pLevel->iMem, 0); */ + sqlite3VdbeAddOp3(v, testOp, pLevel->iMem, brk, r1); + sqlite3VdbeChangeP5(v, SQLITE_AFF_NUMERIC | SQLITE_JUMPIFNULL); + sqlite3ReleaseTempReg(pParse, r1); + } + }else if( pLevel->flags & (WHERE_COLUMN_RANGE|WHERE_COLUMN_EQ) ){ + /* Case 3: A scan using an index. + ** + ** The WHERE clause may contain zero or more equality + ** terms ("==" or "IN" operators) that refer to the N + ** left-most columns of the index. It may also contain + ** inequality constraints (>, <, >= or <=) on the indexed + ** column that immediately follows the N equalities. Only + ** the right-most column can be an inequality - the rest must + ** use the "==" and "IN" operators. For example, if the + ** index is on (x,y,z), then the following clauses are all + ** optimized: + ** + ** x=5 + ** x=5 AND y=10 + ** x=5 AND y<10 + ** x=5 AND y>5 AND y<10 + ** x=5 AND y=5 AND z<=10 + ** + ** The z<10 term of the following cannot be used, only + ** the x=5 term: + ** + ** x=5 AND z<10 + ** + ** N may be zero if there are inequality constraints. + ** If there are no inequality constraints, then N is at + ** least one. + ** + ** This case is also used when there are no WHERE clause + ** constraints but an index is selected anyway, in order + ** to force the output order to conform to an ORDER BY. + */ + int aStartOp[] = { + 0, + 0, + OP_Rewind, /* 2: (!start_constraints && startEq && !bRev) */ + OP_Last, /* 3: (!start_constraints && startEq && bRev) */ + OP_MoveGt, /* 4: (start_constraints && !startEq && !bRev) */ + OP_MoveLt, /* 5: (start_constraints && !startEq && bRev) */ + OP_MoveGe, /* 6: (start_constraints && startEq && !bRev) */ + OP_MoveLe /* 7: (start_constraints && startEq && bRev) */ + }; + int aEndOp[] = { + OP_Noop, /* 0: (!end_constraints) */ + OP_IdxGE, /* 1: (end_constraints && !bRev) */ + OP_IdxLT /* 2: (end_constraints && bRev) */ + }; + int nEq = pLevel->nEq; + int isMinQuery = 0; /* If this is an optimized SELECT min(x).. */ + int regBase; /* Base register holding constraint values */ + int r1; /* Temp register */ + WhereTerm *pRangeStart = 0; /* Inequality constraint at range start */ + WhereTerm *pRangeEnd = 0; /* Inequality constraint at range end */ + int startEq; /* True if range start uses ==, >= or <= */ + int endEq; /* True if range end uses ==, >= or <= */ + int start_constraints; /* Start of range is constrained */ + int k = pIdx->aiColumn[nEq]; /* Column for inequality constraints */ + int nConstraint; /* Number of constraint terms */ + int op; + + /* Generate code to evaluate all constraint terms using == or IN + ** and store the values of those terms in an array of registers + ** starting at regBase. + */ + regBase = codeAllEqualityTerms(pParse, pLevel, &wc, notReady, 2); + nxt = pLevel->nxt; + + /* If this loop satisfies a sort order (pOrderBy) request that + ** was passed to this function to implement a "SELECT min(x) ..." + ** query, then the caller will only allow the loop to run for + ** a single iteration. This means that the first row returned + ** should not have a NULL value stored in 'x'. If column 'x' is + ** the first one after the nEq equality constraints in the index, + ** this requires some special handling. + */ + if( (wflags&WHERE_ORDERBY_MIN)!=0 + && (pLevel->flags&WHERE_ORDERBY) + && (pIdx->nColumn>nEq) + ){ + assert( pOrderBy->nExpr==1 ); + assert( pOrderBy->a[0].pExpr->iColumn==pIdx->aiColumn[nEq] ); + isMinQuery = 1; + } + + /* Find any inequality constraint terms for the start and end + ** of the range. + */ + if( pLevel->flags & WHERE_TOP_LIMIT ){ + pRangeEnd = findTerm(&wc, iCur, k, notReady, (WO_LT|WO_LE), pIdx); + } + if( pLevel->flags & WHERE_BTM_LIMIT ){ + pRangeStart = findTerm(&wc, iCur, k, notReady, (WO_GT|WO_GE), pIdx); + } + + /* If we are doing a reverse order scan on an ascending index, or + ** a forward order scan on a descending index, interchange the + ** start and end terms (pRangeStart and pRangeEnd). + */ + if( bRev==(pIdx->aSortOrder[nEq]==SQLITE_SO_ASC) ){ + SWAP(WhereTerm *, pRangeEnd, pRangeStart); + } + + testcase( pRangeStart && pRangeStart->eOperator & WO_LE ); + testcase( pRangeStart && pRangeStart->eOperator & WO_GE ); + testcase( pRangeEnd && pRangeEnd->eOperator & WO_LE ); + testcase( pRangeEnd && pRangeEnd->eOperator & WO_GE ); + startEq = !pRangeStart || pRangeStart->eOperator & (WO_LE|WO_GE); + endEq = !pRangeEnd || pRangeEnd->eOperator & (WO_LE|WO_GE); + start_constraints = pRangeStart || nEq>0; + + /* Seek the index cursor to the start of the range. */ + nConstraint = nEq; + if( pRangeStart ){ + int dcc = pParse->disableColCache; + if( pRangeEnd ){ + pParse->disableColCache++; + } + sqlite3ExprCode(pParse, pRangeStart->pExpr->pRight, regBase+nEq); + pParse->disableColCache = dcc; + sqlite3VdbeAddOp2(v, OP_IsNull, regBase+nEq, nxt); + nConstraint++; + }else if( isMinQuery ){ + sqlite3VdbeAddOp2(v, OP_Null, 0, regBase+nEq); + nConstraint++; + startEq = 0; + start_constraints = 1; + } + codeApplyAffinity(pParse, regBase, nConstraint, pIdx); + op = aStartOp[(start_constraints<<2) + (startEq<<1) + bRev]; + assert( op!=0 ); + testcase( op==OP_Rewind ); + testcase( op==OP_Last ); + testcase( op==OP_MoveGt ); + testcase( op==OP_MoveGe ); + testcase( op==OP_MoveLe ); + testcase( op==OP_MoveLt ); + sqlite3VdbeAddOp4(v, op, iIdxCur, nxt, regBase, + SQLITE_INT_TO_PTR(nConstraint), P4_INT32); + + /* Load the value for the inequality constraint at the end of the + ** range (if any). + */ + nConstraint = nEq; + if( pRangeEnd ){ + sqlite3ExprCode(pParse, pRangeEnd->pExpr->pRight, regBase+nEq); + sqlite3VdbeAddOp2(v, OP_IsNull, regBase+nEq, nxt); + codeApplyAffinity(pParse, regBase, nEq+1, pIdx); + nConstraint++; + } + + /* Top of the loop body */ + pLevel->p2 = sqlite3VdbeCurrentAddr(v); + + /* Check if the index cursor is past the end of the range. */ + op = aEndOp[(pRangeEnd || nEq) * (1 + bRev)]; + testcase( op==OP_Noop ); + testcase( op==OP_IdxGE ); + testcase( op==OP_IdxLT ); + sqlite3VdbeAddOp4(v, op, iIdxCur, nxt, regBase, + SQLITE_INT_TO_PTR(nConstraint), P4_INT32); + sqlite3VdbeChangeP5(v, endEq!=bRev); + + /* If there are inequality constraints, check that the value + ** of the table column that the inequality contrains is not NULL. + ** If it is, jump to the next iteration of the loop. + */ + r1 = sqlite3GetTempReg(pParse); + testcase( pLevel->flags & WHERE_BTM_LIMIT ); + testcase( pLevel->flags & WHERE_TOP_LIMIT ); + if( pLevel->flags & (WHERE_BTM_LIMIT|WHERE_TOP_LIMIT) ){ + sqlite3VdbeAddOp3(v, OP_Column, iIdxCur, nEq, r1); + sqlite3VdbeAddOp2(v, OP_IsNull, r1, cont); + } + + /* Seek the table cursor, if required */ + if( !omitTable ){ + sqlite3VdbeAddOp2(v, OP_IdxRowid, iIdxCur, r1); + sqlite3VdbeAddOp3(v, OP_MoveGe, iCur, 0, r1); /* Deferred seek */ + } + sqlite3ReleaseTempReg(pParse, r1); + + /* Record the instruction used to terminate the loop. Disable + ** WHERE clause terms made redundant by the index range scan. + */ + pLevel->op = bRev ? OP_Prev : OP_Next; + pLevel->p1 = iIdxCur; + disableTerm(pLevel, pRangeStart); + disableTerm(pLevel, pRangeEnd); + }else{ + /* Case 4: There is no usable index. We must do a complete + ** scan of the entire table. + */ + assert( omitTable==0 ); + assert( bRev==0 ); + pLevel->op = OP_Next; + pLevel->p1 = iCur; + pLevel->p2 = 1 + sqlite3VdbeAddOp2(v, OP_Rewind, iCur, brk); + pLevel->p5 = SQLITE_STMTSTATUS_FULLSCAN_STEP; + } + notReady &= ~getMask(&maskSet, iCur); + + /* Insert code to test every subexpression that can be completely + ** computed using the current set of tables. + */ + for(pTerm=wc.a, j=wc.nTerm; j>0; j--, pTerm++){ + Expr *pE; + testcase( pTerm->flags & TERM_VIRTUAL ); + testcase( pTerm->flags & TERM_CODED ); + if( pTerm->flags & (TERM_VIRTUAL|TERM_CODED) ) continue; + if( (pTerm->prereqAll & notReady)!=0 ) continue; + pE = pTerm->pExpr; + assert( pE!=0 ); + if( pLevel->iLeftJoin && !ExprHasProperty(pE, EP_FromJoin) ){ + continue; + } + sqlite3ExprIfFalse(pParse, pE, cont, SQLITE_JUMPIFNULL); + pTerm->flags |= TERM_CODED; + } + + /* For a LEFT OUTER JOIN, generate code that will record the fact that + ** at least one row of the right table has matched the left table. + */ + if( pLevel->iLeftJoin ){ + pLevel->top = sqlite3VdbeCurrentAddr(v); + sqlite3VdbeAddOp2(v, OP_Integer, 1, pLevel->iLeftJoin); + VdbeComment((v, "record LEFT JOIN hit")); + sqlite3ExprClearColumnCache(pParse, pLevel->iTabCur); + sqlite3ExprClearColumnCache(pParse, pLevel->iIdxCur); + for(pTerm=wc.a, j=0; jflags & TERM_VIRTUAL ); + testcase( pTerm->flags & TERM_CODED ); + if( pTerm->flags & (TERM_VIRTUAL|TERM_CODED) ) continue; + if( (pTerm->prereqAll & notReady)!=0 ) continue; + assert( pTerm->pExpr ); + sqlite3ExprIfFalse(pParse, pTerm->pExpr, cont, SQLITE_JUMPIFNULL); + pTerm->flags |= TERM_CODED; + } + } } #ifdef SQLITE_TEST /* For testing and debugging use only */ /* Record in the query plan information about the current table ** and the index used to access it (if any). If the table itself @@ -3275,36 +2764,36 @@ int n; pLevel = &pWInfo->a[i]; pTabItem = &pTabList->a[pLevel->iFrom]; z = pTabItem->zAlias; if( z==0 ) z = pTabItem->pTab->zName; - n = sqlite3Strlen30(z); + n = strlen(z); if( n+nQPlan < sizeof(sqlite3_query_plan)-10 ){ - if( pLevel->plan.wsFlags & WHERE_IDX_ONLY ){ + if( pLevel->flags & WHERE_IDX_ONLY ){ memcpy(&sqlite3_query_plan[nQPlan], "{}", 2); nQPlan += 2; }else{ memcpy(&sqlite3_query_plan[nQPlan], z, n); nQPlan += n; } sqlite3_query_plan[nQPlan++] = ' '; } - testcase( pLevel->plan.wsFlags & WHERE_ROWID_EQ ); - testcase( pLevel->plan.wsFlags & WHERE_ROWID_RANGE ); - if( pLevel->plan.wsFlags & (WHERE_ROWID_EQ|WHERE_ROWID_RANGE) ){ + testcase( pLevel->flags & WHERE_ROWID_EQ ); + testcase( pLevel->flags & WHERE_ROWID_RANGE ); + if( pLevel->flags & (WHERE_ROWID_EQ|WHERE_ROWID_RANGE) ){ memcpy(&sqlite3_query_plan[nQPlan], "* ", 2); nQPlan += 2; - }else if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 ){ - n = sqlite3Strlen30(pLevel->plan.u.pIdx->zName); + }else if( pLevel->pIdx==0 ){ + memcpy(&sqlite3_query_plan[nQPlan], "{} ", 3); + nQPlan += 3; + }else{ + n = strlen(pLevel->pIdx->zName); if( n+nQPlan < sizeof(sqlite3_query_plan)-2 ){ - memcpy(&sqlite3_query_plan[nQPlan], pLevel->plan.u.pIdx->zName, n); + memcpy(&sqlite3_query_plan[nQPlan], pLevel->pIdx->zName, n); nQPlan += n; sqlite3_query_plan[nQPlan++] = ' '; } - }else{ - memcpy(&sqlite3_query_plan[nQPlan], "{} ", 3); - nQPlan += 3; } } while( nQPlan>0 && sqlite3_query_plan[nQPlan-1]==' ' ){ sqlite3_query_plan[--nQPlan] = 0; } @@ -3313,14 +2802,17 @@ #endif /* SQLITE_TEST // Testing and debugging use only */ /* Record the continuation address in the WhereInfo structure. Then ** clean up and return. */ + pWInfo->iContinue = cont; + whereClauseClear(&wc); return pWInfo; /* Jump here if malloc fails */ whereBeginError: + whereClauseClear(&wc); whereInfoFree(db, pWInfo); return 0; } /* @@ -3338,35 +2830,35 @@ /* Generate loop termination code. */ sqlite3ExprClearColumnCache(pParse, -1); for(i=pTabList->nSrc-1; i>=0; i--){ pLevel = &pWInfo->a[i]; - sqlite3VdbeResolveLabel(v, pLevel->addrCont); + sqlite3VdbeResolveLabel(v, pLevel->cont); if( pLevel->op!=OP_Noop ){ sqlite3VdbeAddOp2(v, pLevel->op, pLevel->p1, pLevel->p2); sqlite3VdbeChangeP5(v, pLevel->p5); } - if( pLevel->plan.wsFlags & WHERE_IN_ABLE && pLevel->u.in.nIn>0 ){ + if( pLevel->nIn ){ struct InLoop *pIn; int j; - sqlite3VdbeResolveLabel(v, pLevel->addrNxt); - for(j=pLevel->u.in.nIn, pIn=&pLevel->u.in.aInLoop[j-1]; j>0; j--, pIn--){ - sqlite3VdbeJumpHere(v, pIn->addrInTop+1); - sqlite3VdbeAddOp2(v, OP_Next, pIn->iCur, pIn->addrInTop); - sqlite3VdbeJumpHere(v, pIn->addrInTop-1); - } - sqlite3DbFree(db, pLevel->u.in.aInLoop); - } - sqlite3VdbeResolveLabel(v, pLevel->addrBrk); + sqlite3VdbeResolveLabel(v, pLevel->nxt); + for(j=pLevel->nIn, pIn=&pLevel->aInLoop[j-1]; j>0; j--, pIn--){ + sqlite3VdbeJumpHere(v, pIn->topAddr+1); + sqlite3VdbeAddOp2(v, OP_Next, pIn->iCur, pIn->topAddr); + sqlite3VdbeJumpHere(v, pIn->topAddr-1); + } + sqlite3DbFree(db, pLevel->aInLoop); + } + sqlite3VdbeResolveLabel(v, pLevel->brk); if( pLevel->iLeftJoin ){ int addr; addr = sqlite3VdbeAddOp1(v, OP_IfPos, pLevel->iLeftJoin); sqlite3VdbeAddOp1(v, OP_NullRow, pTabList->a[i].iCursor); if( pLevel->iIdxCur>=0 ){ sqlite3VdbeAddOp1(v, OP_NullRow, pLevel->iIdxCur); } - sqlite3VdbeAddOp2(v, OP_Goto, 0, pLevel->addrFirst); + sqlite3VdbeAddOp2(v, OP_Goto, 0, pLevel->top); sqlite3VdbeJumpHere(v, addr); } } /* The "break" point is here, just past the end of the outer loop. @@ -3379,17 +2871,15 @@ for(i=0, pLevel=pWInfo->a; inSrc; i++, pLevel++){ struct SrcList_item *pTabItem = &pTabList->a[pLevel->iFrom]; Table *pTab = pTabItem->pTab; assert( pTab!=0 ); if( (pTab->tabFlags & TF_Ephemeral)!=0 || pTab->pSelect ) continue; - if( (pWInfo->wctrlFlags & WHERE_OMIT_CLOSE)==0 ){ - if( !pWInfo->okOnePass && (pLevel->plan.wsFlags & WHERE_IDX_ONLY)==0 ){ - sqlite3VdbeAddOp1(v, OP_Close, pTabItem->iCursor); - } - if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 ){ - sqlite3VdbeAddOp1(v, OP_Close, pLevel->iIdxCur); - } + if( !pWInfo->okOnePass && (pLevel->flags & WHERE_IDX_ONLY)==0 ){ + sqlite3VdbeAddOp1(v, OP_Close, pTabItem->iCursor); + } + if( pLevel->pIdx!=0 ){ + sqlite3VdbeAddOp1(v, OP_Close, pLevel->iIdxCur); } /* If this scan uses an index, make code substitutions to read data ** from the index in preference to the table. Sometimes, this means ** the table need never be read from. This is a performance boost, @@ -3401,15 +2891,15 @@ ** sqlite3WhereEnd will have created code that references the table ** directly. This loop scans all that code looking for opcodes ** that reference the table and converts them into opcodes that ** reference the index. */ - if( (pLevel->plan.wsFlags & WHERE_INDEXED)!=0 ){ + if( pLevel->pIdx ){ int k, j, last; VdbeOp *pOp; - Index *pIdx = pLevel->plan.u.pIdx; - int useIndexOnly = pLevel->plan.wsFlags & WHERE_IDX_ONLY; + Index *pIdx = pLevel->pIdx; + int useIndexOnly = pLevel->flags & WHERE_IDX_ONLY; assert( pIdx!=0 ); pOp = sqlite3VdbeGetOp(v, pWInfo->iTop); last = sqlite3VdbeCurrentAddr(v); for(k=pWInfo->iTop; k0 } } {9 1 8 2 7 3} do_test alias-1.3 { ::seq::reset @@ -74,16 +75,16 @@ ::seq::reset db eval { SELECT x, sequence() AS y FROM t1 WHERE y BETWEEN 0 AND 99 } } {9 1 8 2 7 3} -#do_test alias-1.7 { -# ::seq::reset -# db eval { -# SELECT x, sequence() AS y FROM t1 WHERE y IN (55,66,3) -# } -#} {7 3} +do_test alias-1.7 { + ::seq::reset + db eval { + SELECT x, sequence() AS y FROM t1 WHERE y IN (55,66,3) + } +} {7 3} do_test alias-1.8 { ::seq::reset db eval { SELECT x, 1-sequence() AS y FROM t1 ORDER BY y } Index: test/all.test ================================================================== --- test/all.test +++ test/all.test @@ -8,11 +8,11 @@ # May you share freely, never taking more than you give. # #*********************************************************************** # This file runs all tests. # -# $Id: all.test,v 1.62 2009/01/06 18:43:51 drh Exp $ +# $Id: all.test,v 1.59 2008/10/13 14:16:11 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl rename finish_test really_finish_test proc finish_test {} { @@ -21,11 +21,11 @@ } if {[file exists ./sqlite_test_count]} { set COUNT [exec cat ./sqlite_test_count] } else { - set COUNT 1 + set COUNT 3 } if {[llength $argv]>0} { foreach {name value} $argv { switch -- $name { @@ -62,10 +62,12 @@ lappend EXCLUDE veryquick.test ;# Alternate test driver script lappend EXCLUDE malloc.test ;# Run seperately later. lappend EXCLUDE misuse.test ;# Run seperately later. lappend EXCLUDE memleak.test ;# Alternate test driver script lappend EXCLUDE permutations.test ;# Run seperately later. +lappend EXCLUDE fuzz.test +lappend EXCLUDE fuzz3.test lappend EXCLUDE soak.test ;# Takes a very long time (default 1 hr) lappend EXCLUDE fts3.test ;# Wrapper for muliple fts3*.tests lappend EXCLUDE mallocAll.test ;# Wrapper for running all malloc tests # Files to include in the test. If this list is empty then everything @@ -73,10 +75,15 @@ # set INCLUDE { } for {set Counter 0} {$Counter<$COUNT && $nErr==0} {incr Counter} { + if {$Counter%2} { + set ::SETUP_SQL {PRAGMA default_synchronous=off;} + } else { + catch {unset ::SETUP_SQL} + } foreach testfile [lsort -dictionary [glob $testdir/*.test]] { set tail [file tail $testfile] if {[lsearch -exact $EXCLUDE $tail]>=0} continue if {[llength $INCLUDE]>0 && [lsearch -exact $INCLUDE $tail]<0} continue reset_prng_state Index: test/altermalloc.test ================================================================== --- test/altermalloc.test +++ test/altermalloc.test @@ -10,11 +10,11 @@ #************************************************************************* # This file implements regression tests for SQLite library. The # focus of this script is testing the ALTER TABLE statement and # specifically out-of-memory conditions within that command. # -# $Id: altermalloc.test,v 1.10 2008/10/30 17:21:13 danielk1977 Exp $ +# $Id: altermalloc.test,v 1.9 2008/08/04 20:13:27 drh Exp $ # set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -37,11 +37,10 @@ } -sqlbody { CREATE TABLE t1(a int); ALTER TABLE t1 ADD COLUMN b INTEGER DEFAULT NULL; ALTER TABLE t1 ADD COLUMN c TEXT DEFAULT 'default-text'; ALTER TABLE t1 RENAME TO t2; - ALTER TABLE t2 ADD COLUMN d BLOB DEFAULT X'ABCD'; } # Test malloc() failure on an ALTER TABLE on a virtual table. # ifcapable vtab { Index: test/attachmalloc.test ================================================================== --- test/attachmalloc.test +++ test/attachmalloc.test @@ -10,11 +10,11 @@ #************************************************************************* # This file implements regression tests for SQLite library. The # focus of this script is testing the ATTACH statement and # specifically out-of-memory conditions within that command. # -# $Id: attachmalloc.test,v 1.10 2008/10/22 10:45:38 danielk1977 Exp $ +# $Id: attachmalloc.test,v 1.9 2008/08/04 20:13:27 drh Exp $ # set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -44,20 +44,6 @@ CREATE TABLE three.t1(x); ATTACH 'test4.db' AS four; CREATE TABLE four.t1(x); } -do_malloc_test attachmalloc-2 -tclprep { - file delete -force test2.db - file delete -force test2.db-journal - sqlite3 db2 test2.db - db2 eval { - CREATE TABLE t1(a, b, c); - CREATE INDEX i1 ON t1(a, b); - } - db2 close -} -sqlbody { - CREATE TABLE t1(d, e, f); - ATTACH 'test2.db' AS db1; -} - finish_test Index: test/auth.test ================================================================== --- test/auth.test +++ test/auth.test @@ -10,11 +10,11 @@ #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script is testing the sqlite3_set_authorizer() API # and related functionality. # -# $Id: auth.test,v 1.44 2008/10/27 15:34:33 danielk1977 Exp $ +# $Id: auth.test,v 1.43 2008/07/02 13:13:52 danielk1977 Exp $ # set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -416,14 +416,11 @@ } catchsql {DELETE FROM t2 WHERE a=11} } {0 {}} do_test auth-1.50 { execsql {SELECT * FROM t2} -} {} -do_test auth-1.50.2 { - execsql {INSERT INTO t2 VALUES(11, 2, 33)} -} {} +} {11 2 33} do_test auth-1.51 { proc auth {code arg1 arg2 arg3 arg4} { if {$code=="SQLITE_SELECT"} { return SQLITE_DENY DELETED test/auth3.test Index: test/auth3.test ================================================================== --- test/auth3.test +++ /dev/null @@ -1,111 +0,0 @@ -# 2008 October 27 -# -# The author disclaims copyright to this source code. In place of -# a legal notice, here is a blessing: -# -# May you do good and not evil. -# May you find forgiveness for yourself and forgive others. -# May you share freely, never taking more than you give. -# -#*********************************************************************** -# -# Test that the truncate optimization is disabled if the SQLITE_DELETE -# authorization callback returns SQLITE_IGNORE. -# -# $Id: auth3.test,v 1.1 2008/10/27 15:34:33 danielk1977 Exp $ -# - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -# disable this test if the SQLITE_OMIT_AUTHORIZATION macro is -# defined during compilation. -if {[catch {db auth {}} msg]} { - finish_test - return -} - -# Disable the statement cache for these tests. -# -db cache size 0 - -db authorizer ::auth -proc auth {code arg1 arg2 arg3 arg4} { - if {$code=="SQLITE_DELETE"} { - return $::authcode - } - return SQLITE_OK -} - -#-------------------------------------------------------------------------- -# The following tests - auth3-1.* - test that return values of SQLITE_DENY, -# SQLITE_IGNORE, SQLITE_OK and are correctly handled when returned -# by an SQLITE_DELETE authorization callback triggered by a -# "DELETE FROM " statement. -# -do_test auth3-1.1 { - execsql { - CREATE TABLE t1(a,b,c); - INSERT INTO t1 VALUES(1, 2, 3); - INSERT INTO t1 VALUES(4, 5, 6); - } -} {} -do_test auth3.1.2 { - set ::authcode SQLITE_DENY - catchsql { DELETE FROM t1 } -} {1 {not authorized}} -do_test auth3.1.3 { - set ::authcode SQLITE_INVALID - catchsql { DELETE FROM t1 } -} {1 {illegal return value (1) from the authorization function - should be SQLITE_OK, SQLITE_IGNORE, or SQLITE_DENY}} -do_test auth3.1.4 { - execsql { SELECT * FROM t1 } -} {1 2 3 4 5 6} -do_test auth3-1.5 { - set ::authcode SQLITE_IGNORE - execsql { - DELETE FROM t1; - SELECT * FROM t1; - } -} {} -do_test auth3-1.6 { - set ::authcode SQLITE_OK - execsql { - INSERT INTO t1 VALUES(1, 2, 3); - INSERT INTO t1 VALUES(4, 5, 6); - DELETE FROM t1; - SELECT * FROM t1; - } -} {} - -#-------------------------------------------------------------------------- -# These tests - auth3-2.* - test that returning SQLITE_IGNORE really does -# disable the truncate optimization. -# -do_test auth3-2.1 { - set ::authcode SQLITE_OK - execsql { - INSERT INTO t1 VALUES(1, 2, 3); - INSERT INTO t1 VALUES(4, 5, 6); - } - set sqlite_search_count 0 - execsql { - DELETE FROM t1; - } - set sqlite_search_count -} {0} - -do_test auth3-2.2 { - set ::authcode SQLITE_IGNORE - execsql { - INSERT INTO t1 VALUES(1, 2, 3); - INSERT INTO t1 VALUES(4, 5, 6); - } - set sqlite_search_count 0 - execsql { - DELETE FROM t1; - } - set sqlite_search_count -} {1} - -finish_test DELETED test/backup.test Index: test/backup.test ================================================================== --- test/backup.test +++ /dev/null @@ -1,813 +0,0 @@ -# 2009 January 30 -# -# 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 the sqlite3_backup_XXX API. -# -# $Id: backup.test,v 1.5 2009/02/09 18:55:46 danielk1977 Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -#--------------------------------------------------------------------- -# Test organization: -# -# backup-1.*: Warm-body tests. -# -# backup-2.*: Test backup under various conditions. To and from in-memory -# databases. To and from empty/populated databases. etc. -# -# backup-3.*: Verify that the locking-page (pending byte page) is handled. -# -# backup-4.*: Test various error conditions. -# -# backup-5.*: Test the source database being modified during a backup. -# -# backup-6.*: Test the backup_remaining() and backup_pagecount() APIs. -# -# backup-7.*: Test SQLITE_BUSY and SQLITE_LOCKED errors. -# -# backup-8.*: Test multiple simultaneous backup operations. -# -# backup-9.*: Test that passing a negative argument to backup_step() is -# interpreted as "copy the whole file". -# - -proc data_checksum {db file} { $db one "SELECT md5sum(a, b) FROM ${file}.t1" } -proc test_contents {name db1 file1 db2 file2} { - $db2 eval {select * from sqlite_master} - $db1 eval {select * from sqlite_master} - set checksum [data_checksum $db2 $file2] - uplevel [list do_test $name [list data_checksum $db1 $file1] $checksum] -} - -do_test backup-1.1 { - execsql { - BEGIN; - CREATE TABLE t1(a, b); - CREATE INDEX i1 ON t1(a, b); - INSERT INTO t1 VALUES(1, randstr(1000,1000)); - INSERT INTO t1 VALUES(2, randstr(1000,1000)); - INSERT INTO t1 VALUES(3, randstr(1000,1000)); - INSERT INTO t1 VALUES(4, randstr(1000,1000)); - INSERT INTO t1 VALUES(5, randstr(1000,1000)); - COMMIT; - } -} {} - -# Sanity check to verify that the [test_contents] proc works. -# -test_contents backup-1.2 db main db main - -# Check that it is possible to create and finish backup operations. -# -do_test backup-1.3.1 { - file delete test2.db - sqlite3 db2 test2.db - sqlite3_backup B db2 main db main -} {B} -do_test backup-1.3.2 { - B finish -} {SQLITE_OK} -do_test backup-1.3.3 { - info commands B -} {} - -# Simplest backup operation. Backup test.db to test2.db. test2.db is -# initially empty. test.db uses the default page size. -# -do_test backup-1.4.1 { - sqlite3_backup B db2 main db main -} {B} -do_test backup-1.4.2 { - B step 200 -} {SQLITE_DONE} -do_test backup-1.4.3 { - B finish -} {SQLITE_OK} -do_test backup-1.4.4 { - info commands B -} {} -test_contents backup-1.4.5 db2 main db main -db close -db2 close -# -# End of backup-1.* tests. -#--------------------------------------------------------------------- - - -#--------------------------------------------------------------------- -# The following tests, backup-2.*, are based on the following procedure: -# -# 1) Populate the source database. -# 2) Populate the destination database. -# 3) Run the backup to completion. (backup-2.*.1) -# 4) Integrity check the destination db. (backup-2.*.2) -# 5) Check that the contents of the destination db is the same as that -# of the source db. (backup-2.*.3) -# -# The test is run with all possible combinations of the following -# input parameters, except that if the destination is an in-memory -# database, the only page size tested is 1024 bytes (the same as the -# source page-size). -# -# * Source database is an in-memory database, OR -# * Source database is a file-backed database. -# -# * Target database is an in-memory database, OR -# * Target database is a file-backed database. -# -# * Destination database is a main file, OR -# * Destination database is an attached file, OR -# * Destination database is a temp database. -# -# * Target database is empty (zero bytes), OR -# * Target database is larger than the source, OR -# * Target database is smaller than the source. -# -# * Target database page-size is the same as the source, OR -# * Target database page-size is larger than the source, OR -# * Target database page-size is smaller than the source. -# -# * Each call to step copies a single page, OR -# * A single call to step copies the entire source database. -# -set iTest 1 -foreach zSrcFile {test.db :memory:} { -foreach zDestFile {test2.db :memory:} { -foreach zOpenScript [list { - sqlite3 db $zSrcFile - sqlite3 db2 $zSrcFile - db2 eval "ATTACH '$zDestFile' AS bak" - set db_dest db2 - set file_dest bak -} { - sqlite3 db $zSrcFile - sqlite3 db2 $zDestFile - set db_dest db2 - set file_dest main -} { - sqlite3 db $zSrcFile - sqlite3 db2 $zDestFile - set db_dest db2 - set file_dest temp -}] { -foreach rows_dest {0 3 10} { -foreach pgsz_dest {512 1024 2048} { -foreach nPagePerStep {1 200} { - - # Open the databases. - catch { file delete test.db } - catch { file delete test2.db } - eval $zOpenScript - - if {$zDestFile ne ":memory:" || $pgsz_dest == 1024 } { - - if 0 { - puts -nonewline "Test $iTest: src=$zSrcFile dest=$zDestFile" - puts -nonewline " (as $db_dest.$file_dest)" - puts -nonewline " rows_dest=$rows_dest pgsz_dest=$pgsz_dest" - puts "" - } - - # Set up the content of the source database. - execsql { - BEGIN; - CREATE TABLE t1(a, b); - CREATE INDEX i1 ON t1(a, b); - INSERT INTO t1 VALUES(1, randstr(1000,1000)); - INSERT INTO t1 VALUES(2, randstr(1000,1000)); - INSERT INTO t1 VALUES(3, randstr(1000,1000)); - INSERT INTO t1 VALUES(4, randstr(1000,1000)); - INSERT INTO t1 VALUES(5, randstr(1000,1000)); - COMMIT; - } - - - - # Set up the content of the target database. - execsql "PRAGMA ${file_dest}.page_size = ${pgsz_dest}" $db_dest - if {$rows_dest != 0} { - execsql " - BEGIN; - CREATE TABLE ${file_dest}.t1(a, b); - CREATE INDEX ${file_dest}.i1 ON t1(a, b); - " $db_dest - for {set ii 0} {$ii < $rows_dest} {incr ii} { - execsql " - INSERT INTO ${file_dest}.t1 VALUES(1, randstr(1000,1000)) - " $db_dest - } - } - - # Backup the source database. - do_test backup-2.$iTest.1 { - sqlite3_backup B $db_dest $file_dest db main - while {[B step $nPagePerStep]=="SQLITE_OK"} {} - B finish - } {SQLITE_OK} - - # Run integrity check on the backup. - do_test backup-2.$iTest.2 { - execsql "PRAGMA ${file_dest}.integrity_check" $db_dest - } {ok} - - test_contents backup-2.$iTest.3 db main $db_dest $file_dest - - } - - db close - catch {db2 close} - incr iTest - -} } } } } } -# -# End of backup-2.* tests. -#--------------------------------------------------------------------- - -#--------------------------------------------------------------------- -# These tests, backup-3.*, ensure that nothing goes wrong if either -# the source or destination database are large enough to include the -# the locking-page (the page that contains the range of bytes that -# the locks are applied to). These tests assume that the pending -# byte is at offset 0x00010000 (64KB offset), as set by tester.tcl, -# not at the 1GB offset as it usually is. -# -# The test procedure is as follows (same procedure as used for -# the backup-2.* tests): -# -# 1) Populate the source database. -# 2) Populate the destination database. -# 3) Run the backup to completion. (backup-3.*.1) -# 4) Integrity check the destination db. (backup-3.*.2) -# 5) Check that the contents of the destination db is the same as that -# of the source db. (backup-3.*.3) -# -# The test procedure is run with the following parameters varied: -# -# * Source database includes pending-byte page. -# * Source database does not include pending-byte page. -# -# * Target database includes pending-byte page. -# * Target database does not include pending-byte page. -# -# * Target database page-size is the same as the source, OR -# * Target database page-size is larger than the source, OR -# * Target database page-size is smaller than the source. -# -set iTest 1 -foreach nSrcPg {10 64 65 66 100} { -foreach nDestRow {10 100} { -foreach nDestPgsz {512 1024 2048 4096} { - - catch { file delete test.db } - catch { file delete test2.db } - sqlite3 db test.db - sqlite3 db2 test2.db - - # Set up the content of the two databases. - # - execsql { PRAGMA page_size = 1024 } - execsql "PRAGMA page_size = $nDestPgsz" db2 - foreach db {db db2} { - execsql { - BEGIN; - CREATE TABLE t1(a, b); - CREATE INDEX i1 ON t1(a, b); - COMMIT; - } $db - } - while {[file size test.db]/1024 < $nSrcPg} { - execsql { INSERT INTO t1 VALUES($ii, randstr(200,200)) } - } - - for {set ii 0} {$ii < $nDestRow} {incr ii} { - execsql { INSERT INTO t1 VALUES($ii, randstr(1000,1000)) } db2 - } - - # Backup the source database. - do_test backup-3.$iTest.1 { - sqlite3_backup B db main db2 main - while {[B step 10]=="SQLITE_OK"} {} - B finish - } {SQLITE_OK} - - # Run integrity check on the backup. - do_test backup-3.$iTest.2 { - execsql "PRAGMA integrity_check" db2 - } {ok} - - test_contents backup-3.$iTest.3 db main db2 main - - db close - db2 close - incr iTest -} -} -} -# -# End of backup-3.* tests. -#--------------------------------------------------------------------- - - -#--------------------------------------------------------------------- -# The following tests, backup-4.*, test various error conditions: -# -# backup-4.1.*: Test invalid database names. -# -# backup-4.2.*: Test that the source database cannot be detached while -# a backup is in progress. -# -# backup-4.3.*: Test that the source database handle cannot be closed -# while a backup is in progress. -# -# backup-4.4.*: Test an attempt to specify the same handle for the -# source and destination databases. -# -# backup-4.5.*: Test that an in-memory destination with a different -# page-size to the source database is an error. -# -sqlite3 db test.db -sqlite3 db2 test2.db - -do_test backup-4.1.1 { - catch { sqlite3_backup B db aux db2 main } -} {1} -do_test backup-4.1.2 { - sqlite3_errmsg db -} {unknown database aux} -do_test backup-4.1.3 { - catch { sqlite3_backup B db main db2 aux } -} {1} -do_test backup-4.1.4 { - sqlite3_errmsg db -} {unknown database aux} - -do_test backup-4.2.1 { - execsql { ATTACH 'test3.db' AS aux1 } - execsql { ATTACH 'test4.db' AS aux2 } db2 - sqlite3_backup B db aux1 db2 aux2 -} {B} -do_test backup-4.2.2 { - catchsql { DETACH aux2 } db2 -} {1 {database aux2 is locked}} -do_test backup-4.2.3 { - B step 50 -} {SQLITE_DONE} -do_test backup-4.2.4 { - B finish -} {SQLITE_OK} - -do_test backup-4.3.1 { - sqlite3_backup B db aux1 db2 aux2 -} {B} -do_test backup-4.3.2 { - db2 cache flush - sqlite3_close db2 -} {SQLITE_BUSY} -do_test backup-4.3.3 { - sqlite3_errmsg db2 -} {unable to close due to unfinished backup operation} -do_test backup-4.3.4 { - B step 50 -} {SQLITE_DONE} -do_test backup-4.3.5 { - B finish -} {SQLITE_OK} - -do_test backup-4.4.1 { - set rc [catch {sqlite3_backup B db main db aux1}] - list $rc [sqlite3_errcode db] [sqlite3_errmsg db] -} {1 SQLITE_ERROR {source and destination must be distinct}} -db close -db2 close - -do_test backup-4.5.1 { - catch { file delete -force test.db } - sqlite3 db test.db - sqlite3 db2 :memory: - execsql { - CREATE TABLE t1(a, b); - INSERT INTO t1 VALUES(1, 2); - } - execsql { - PRAGMA page_size = 4096; - CREATE TABLE t2(a, b); - INSERT INTO t2 VALUES(3, 4); - } db2 - sqlite3_backup B db2 main db main -} {B} -do_test backup-4.5.2 { - B step 5000 -} {SQLITE_READONLY} -do_test backup-4.5.3 { - B finish -} {SQLITE_READONLY} - -db close -db2 close -# -# End of backup-5.* tests. -#--------------------------------------------------------------------- - -#--------------------------------------------------------------------- -# The following tests, backup-5.*, test that the backup works properly -# when the source database is modified during the backup. Test cases -# are organized as follows: -# -# backup-5.x.1.*: Nothing special. Modify the database mid-backup. -# -# backup-5.x.2.*: Modify the database mid-backup so that one or more -# pages are written out due to cache stress. Then -# rollback the transaction. -# -# backup-5.x.3.*: Database is vacuumed. -# -# backup-5.x.4.*: Database is vacuumed and the page-size modified. -# -# backup-5.x.5.*: Database is shrunk via incr-vacuum. -# -# Each test is run three times, in the following configurations: -# -# 1) Backing up file-to-file. The writer writes via an external pager. -# 2) Backing up file-to-file. The writer writes via the same pager as -# is used by the backup operation. -# 3) Backing up memory-to-file. -# -set iTest 0 -foreach {writer file} {db test.db db3 test.db db :memory:} { - incr iTest - catch { file delete bak.db } - sqlite3 db2 bak.db - catch { file delete $file } - sqlite3 db $file - sqlite3 db3 $file - - do_test backup-5.$iTest.1.1 { - execsql { - BEGIN; - CREATE TABLE t1(a, b); - CREATE INDEX i1 ON t1(a, b); - INSERT INTO t1 VALUES(1, randstr(1000,1000)); - INSERT INTO t1 VALUES(2, randstr(1000,1000)); - INSERT INTO t1 VALUES(3, randstr(1000,1000)); - INSERT INTO t1 VALUES(4, randstr(1000,1000)); - INSERT INTO t1 VALUES(5, randstr(1000,1000)); - COMMIT; - } - expr {[execsql {PRAGMA page_count}] > 10} - } {1} - do_test backup-5.$iTest.1.2 { - sqlite3_backup B db2 main db main - B step 5 - } {SQLITE_OK} - do_test backup-5.$iTest.1.3 { - execsql { UPDATE t1 SET a = a + 1 } $writer - B step 50 - } {SQLITE_DONE} - do_test backup-5.$iTest.1.4 { - B finish - } {SQLITE_OK} - integrity_check backup-5.$iTest.1.5 db2 - test_contents backup-5.$iTest.1.6 db main db2 main - - do_test backup-5.$iTest.2.1 { - execsql { - PRAGMA cache_size = 10; - BEGIN; - INSERT INTO t1 SELECT '', randstr(1000,1000) FROM t1; - INSERT INTO t1 SELECT '', randstr(1000,1000) FROM t1; - INSERT INTO t1 SELECT '', randstr(1000,1000) FROM t1; - INSERT INTO t1 SELECT '', randstr(1000,1000) FROM t1; - COMMIT; - } - } {} - do_test backup-5.$iTest.2.2 { - sqlite3_backup B db2 main db main - B step 50 - } {SQLITE_OK} - do_test backup-5.$iTest.2.3 { - execsql { - BEGIN; - UPDATE t1 SET a = a + 1; - ROLLBACK; - } $writer - B step 5000 - } {SQLITE_DONE} - do_test backup-5.$iTest.2.4 { - B finish - } {SQLITE_OK} - integrity_check backup-5.$iTest.2.5 db2 - test_contents backup-5.$iTest.2.6 db main db2 main - - do_test backup-5.$iTest.3.1 { - execsql { UPDATE t1 SET b = randstr(1000,1000) } - } {} - do_test backup-5.$iTest.3.2 { - sqlite3_backup B db2 main db main - B step 50 - } {SQLITE_OK} - do_test backup-5.$iTest.3.3 { - execsql { VACUUM } $writer - B step 5000 - } {SQLITE_DONE} - do_test backup-5.$iTest.3.4 { - B finish - } {SQLITE_OK} - integrity_check backup-5.$iTest.3.5 db2 - test_contents backup-5.$iTest.3.6 db main db2 main - - do_test backup-5.$iTest.4.1 { - execsql { UPDATE t1 SET b = randstr(1000,1000) } - } {} - do_test backup-5.$iTest.4.2 { - sqlite3_backup B db2 main db main - B step 50 - } {SQLITE_OK} - do_test backup-5.$iTest.4.3 { - execsql { - PRAGMA page_size = 2048; - VACUUM; - } $writer - B step 5000 - } {SQLITE_DONE} - do_test backup-5.$iTest.4.4 { - B finish - } {SQLITE_OK} - integrity_check backup-5.$iTest.4.5 db2 - test_contents backup-5.$iTest.4.6 db main db2 main - - catch { file delete bak.db } - sqlite3 db2 bak.db - catch { file delete $file } - sqlite3 db $file - sqlite3 db3 $file - do_test backup-5.$iTest.5.1 { - execsql { - PRAGMA auto_vacuum = incremental; - BEGIN; - CREATE TABLE t1(a, b); - CREATE INDEX i1 ON t1(a, b); - INSERT INTO t1 VALUES(1, randstr(1000,1000)); - INSERT INTO t1 VALUES(2, randstr(1000,1000)); - INSERT INTO t1 VALUES(3, randstr(1000,1000)); - INSERT INTO t1 VALUES(4, randstr(1000,1000)); - INSERT INTO t1 VALUES(5, randstr(1000,1000)); - COMMIT; - } - } {} - do_test backup-5.$iTest.5.2 { - sqlite3_backup B db2 main db main - B step 8 - } {SQLITE_OK} - do_test backup-5.$iTest.5.3 { - execsql { - DELETE FROM t1; - PRAGMA incremental_vacuum; - } $writer - B step 50 - } {SQLITE_DONE} - do_test backup-5.$iTest.5.4 { - B finish - } {SQLITE_OK} - integrity_check backup-5.$iTest.5.5 db2 - test_contents backup-5.$iTest.5.6 db main db2 main -} -catch {db close} -catch {db2 close} -catch {db3 close} -# -# End of backup-5.* tests. -#--------------------------------------------------------------------- - -#--------------------------------------------------------------------- -# Test the sqlite3_backup_remaining() and backup_pagecount() APIs. -# -do_test backup-6.1 { - catch { file delete -force test.db } - catch { file delete -force test2.db } - sqlite3 db test.db - sqlite3 db2 test2.db - execsql { - BEGIN; - CREATE TABLE t1(a, b); - CREATE INDEX i1 ON t1(a, b); - INSERT INTO t1 VALUES(1, randstr(1000,1000)); - INSERT INTO t1 VALUES(2, randstr(1000,1000)); - INSERT INTO t1 VALUES(3, randstr(1000,1000)); - INSERT INTO t1 VALUES(4, randstr(1000,1000)); - INSERT INTO t1 VALUES(5, randstr(1000,1000)); - COMMIT; - } -} {} -do_test backup-6.2 { - set nTotal [expr {[file size test.db]/1024}] - sqlite3_backup B db2 main db main - B step 1 -} {SQLITE_OK} -do_test backup-6.3 { - B pagecount -} $nTotal -do_test backup-6.4 { - B remaining -} [expr $nTotal-1] -do_test backup-6.5 { - B step 5 - list [B remaining] [B pagecount] -} [list [expr $nTotal-6] $nTotal] -do_test backup-6.6 { - execsql { CREATE TABLE t2(a PRIMARY KEY, b) } - B step 1 - list [B remaining] [B pagecount] -} [list [expr $nTotal-5] [expr $nTotal+2]] - -do_test backup-6.X { - B finish -} {SQLITE_OK} - - - -#--------------------------------------------------------------------- -# Test cases backup-7.* test that SQLITE_BUSY and SQLITE_LOCKED errors -# are returned correctly: -# -# backup-7.1.*: Source database is externally locked (return SQLITE_BUSY). -# -# backup-7.2.*: Attempt to step the backup process while a -# write-transaction is underway on the source pager (return -# SQLITE_LOCKED). -# -# backup-7.3.*: Destination database is externally locked (return SQLITE_BUSY). -# -do_test backup-7.0 { - catch { file delete -force test.db } - catch { file delete -force test2.db } - sqlite3 db2 test2.db - sqlite3 db test.db - execsql { - CREATE TABLE t1(a, b); - CREATE INDEX i1 ON t1(a, b); - INSERT INTO t1 VALUES(1, randstr(1000,1000)); - INSERT INTO t1 SELECT a+ 1, randstr(1000,1000) FROM t1; - INSERT INTO t1 SELECT a+ 2, randstr(1000,1000) FROM t1; - INSERT INTO t1 SELECT a+ 4, randstr(1000,1000) FROM t1; - INSERT INTO t1 SELECT a+ 8, randstr(1000,1000) FROM t1; - INSERT INTO t1 SELECT a+16, randstr(1000,1000) FROM t1; - INSERT INTO t1 SELECT a+32, randstr(1000,1000) FROM t1; - INSERT INTO t1 SELECT a+64, randstr(1000,1000) FROM t1; - } -} {} - -do_test backup-7.1.1 { - sqlite3_backup B db2 main db main - B step 5 -} {SQLITE_OK} -do_test backup-7.1.2 { - sqlite3 db3 test.db - execsql { BEGIN EXCLUSIVE } db3 - B step 5 -} {SQLITE_BUSY} -do_test backup-7.1.3 { - execsql { ROLLBACK } db3 - B step 5 -} {SQLITE_OK} -do_test backup-7.2.1 { - execsql { - BEGIN; - INSERT INTO t1 VALUES(1, 4); - } -} {} -do_test backup-7.2.2 { - B step 5000 -} {SQLITE_LOCKED} -do_test backup-7.2.3 { - execsql { ROLLBACK } - B step 5000 -} {SQLITE_DONE} -do_test backup-7.2.4 { - B finish -} {SQLITE_OK} -test_contents backup-7.2.5 db main db2 main -integrity_check backup-7.3.6 db2 - -do_test backup-7.3.1 { - db2 close - db3 close - file delete -force test2.db - sqlite3 db2 test2.db - sqlite3 db3 test2.db - - sqlite3_backup B db2 main db main - execsql { BEGIN ; CREATE TABLE t2(a, b); } db3 - - B step 5 -} {SQLITE_BUSY} -do_test backup-7.3.2 { - execsql { COMMIT } db3 - B step 5000 -} {SQLITE_DONE} -do_test backup-7.3.3 { - B finish -} {SQLITE_OK} -test_contents backup-7.3.4 db main db2 main -integrity_check backup-7.3.5 db2 -catch { db2 close } -catch { db3 close } - -#----------------------------------------------------------------------- -# The following tests, backup-8.*, test attaching multiple backup -# processes to the same source database. Also, reading from the source -# database while a read transaction is active. -# -# These tests reuse the database "test.db" left over from backup-7.*. -# -do_test backup-8.1 { - catch { file delete -force test2.db } - catch { file delete -force test3.db } - sqlite3 db2 test2.db - sqlite3 db3 test3.db - - sqlite3_backup B2 db2 main db main - sqlite3_backup B3 db3 main db main - list [B2 finish] [B3 finish] -} {SQLITE_OK SQLITE_OK} -do_test backup-8.2 { - sqlite3_backup B3 db3 main db main - sqlite3_backup B2 db2 main db main - list [B2 finish] [B3 finish] -} {SQLITE_OK SQLITE_OK} -do_test backup-8.3 { - sqlite3_backup B2 db2 main db main - sqlite3_backup B3 db3 main db main - B2 step 5 -} {SQLITE_OK} -do_test backup-8.4 { - execsql { - BEGIN; - SELECT * FROM sqlite_master; - } - B3 step 5 -} {SQLITE_OK} -do_test backup-8.5 { - list [B3 step 5000] [B3 finish] -} {SQLITE_DONE SQLITE_OK} -do_test backup-8.6 { - list [B2 step 5000] [B2 finish] -} {SQLITE_DONE SQLITE_OK} -test_contents backup-8.7 db main db2 main -test_contents backup-8.8 db main db3 main -do_test backup-8.9 { - execsql { PRAGMA lock_status } -} {main shared temp closed} -do_test backup-8.10 { - execsql COMMIT -} {} -catch { db2 close } -catch { db3 close } - -#----------------------------------------------------------------------- -# The following tests, backup-9.*, test that: -# -# * Passing 0 as an argument to sqlite3_backup_step() means no pages -# are backed up (backup-9.1.*), and -# * Passing a negative value as an argument to sqlite3_backup_step() means -# all pages are backed up (backup-9.2.*). -# -# These tests reuse the database "test.db" left over from backup-7.*. -# -do_test backup-9.1.1 { - sqlite3 db2 test2.db - sqlite3_backup B db2 main db main - B step 1 -} {SQLITE_OK} -do_test backup-9.1.2 { - set nRemaining [B remaining] - expr {$nRemaining>100} -} {1} -do_test backup-9.1.3 { - B step 0 -} {SQLITE_OK} -do_test backup-9.1.4 { - B remaining -} $nRemaining - -do_test backup-9.2.1 { - B step -1 -} {SQLITE_DONE} -do_test backup-9.2.2 { - B remaining -} {0} -do_test backup-9.2.3 { - B finish -} {SQLITE_OK} -catch {db2 close} - -finish_test - DELETED test/backup_ioerr.test Index: test/backup_ioerr.test ================================================================== --- test/backup_ioerr.test +++ /dev/null @@ -1,286 +0,0 @@ -# 2009 January 30 -# -# 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 the handling of IO errors by the -# sqlite3_backup_XXX APIs. -# -# $Id: backup_ioerr.test,v 1.2 2009/02/04 22:46:47 drh Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -proc data_checksum {db file} { - $db one "SELECT md5sum(a, b) FROM ${file}.t1" -} -proc test_contents {name db1 file1 db2 file2} { - $db2 eval {select * from sqlite_master} - $db1 eval {select * from sqlite_master} - set checksum [data_checksum $db2 $file2] - uplevel [list do_test $name [list data_checksum $db1 $file1] $checksum] -} - -#-------------------------------------------------------------------- -# This proc creates a database of approximately 290 pages. Depending -# on whether or not auto-vacuum is configured. Test cases backup_ioerr-1.* -# verify nothing more than this assumption. -# -proc populate_database {db {xtra_large 0}} { - execsql { - BEGIN; - CREATE TABLE t1(a, b); - INSERT INTO t1 VALUES(1, randstr(1000,1000)); - INSERT INTO t1 SELECT a+ 1, randstr(1000,1000) FROM t1; - INSERT INTO t1 SELECT a+ 2, randstr(1000,1000) FROM t1; - INSERT INTO t1 SELECT a+ 4, randstr(1000,1000) FROM t1; - INSERT INTO t1 SELECT a+ 8, randstr(1000,1000) FROM t1; - INSERT INTO t1 SELECT a+16, randstr(1000,1000) FROM t1; - INSERT INTO t1 SELECT a+32, randstr(1000,1000) FROM t1; - CREATE INDEX i1 ON t1(b); - COMMIT; - } $db - if {$xtra_large} { - execsql { INSERT INTO t1 SELECT a+64, randstr(1000,1000) FROM t1 } $db - } -} -do_test backup_ioerr-1.1 { - populate_database db - set nPage [expr {[file size test.db] / 1024}] - expr {$nPage>140 && $nPage<150} -} {1} -do_test backup_ioerr-1.2 { - expr {[file size test.db] > $sqlite_pending_byte} -} {1} -do_test backup_ioerr-1.3 { - db close - file delete -force test.db -} {} - -# Turn off IO error simulation. -# -proc clear_ioerr_simulation {} { - set ::sqlite_io_error_hit 0 - set ::sqlite_io_error_hardhit 0 - set ::sqlite_io_error_pending 0 - set ::sqlite_io_error_persist 0 -} - -#-------------------------------------------------------------------- -# The following procedure runs with SQLite's IO error simulation -# enabled. -# -# 1) Start with a reasonably sized database. One that includes the -# pending-byte (locking) page. -# -# 2) Open a backup process. Set the cache-size for the destination -# database to 10 pages only. -# -# 3) Step the backup process N times to partially backup the database -# file. If an IO error is reported, then the backup process is -# concluded with a call to backup_finish(). -# -# If an IO error occurs, verify that: -# -# * the call to backup_step() returns an SQLITE_IOERR_XXX error code. -# -# * after the failed call to backup_step() but before the call to -# backup_finish() the destination database handle error code and -# error message remain unchanged. -# -# * the call to backup_finish() returns an SQLITE_IOERR_XXX error code. -# -# * following the call to backup_finish(), the destination database -# handle has been populated with an error code and error message. -# -# 4) Write to the database via the source database connection. Check -# that: -# -# * If an IO error occurs while writing the source database, the -# write operation should report an IO error. The backup should -# proceed as normal. -# -# * If an IO error occurs while updating the backup, the write -# operation should proceed normally. The error should be reported -# from the next call to backup_step() (in step 5 of this test -# procedure). -# -# 5) Step the backup process to finish the backup. If an IO error is -# reported, then the backup process is concluded with a call to -# backup_finish(). -# -# Test that if an IO error occurs, or if one occured while updating -# the backup database during step 4, then the conditions listed -# under step 3 are all true. -# -# 6) Finish the backup process. -# -# * If the backup succeeds (backup_finish() returns SQLITE_OK), then -# the contents of the backup database should match that of the -# source database. -# -# * If the backup fails (backup_finish() returns other than SQLITE_OK), -# then the contents of the backup database should be as they were -# before the operation was started. -# -# The following factors are varied: -# -# * Destination database is initially larger than the source database, OR -# * Destination database is initially smaller than the source database. -# -# * IO errors are transient, OR -# * IO errors are persistent. -# -# * Destination page-size is smaller than the source. -# * Destination page-size is the same as the source. -# * Destination page-size is larger than the source. -# - -set iTest 1 -foreach bPersist {0 1} { -foreach iDestPagesize {512 1024 4096} { -foreach zSetupBak [list "" {populate_database ddb 1}] { - - incr iTest - set bStop 0 -for {set iError 1} {$bStop == 0} {incr iError} { - # Disable IO error simulation. - clear_ioerr_simulation - - catch { ddb close } - catch { sdb close } - catch { file delete -force test.db } - catch { file delete -force bak.db } - - # Open the source and destination databases. - sqlite3 sdb test.db - sqlite3 ddb bak.db - - # Step 1: Populate the source and destination databases. - populate_database sdb - ddb eval "PRAGMA page_size = $iDestPagesize" - ddb eval "PRAGMA cache_size = 10" - eval $zSetupBak - - # Step 2: Open the backup process. - sqlite3_backup B ddb main sdb main - - # Enable IO error simulation. - set ::sqlite_io_error_pending $iError - set ::sqlite_io_error_persist $bPersist - - # Step 3: Partially backup the database. If an IO error occurs, check - # a few things then skip to the next iteration of the loop. - # - set rc [B step 100] - if {$::sqlite_io_error_hardhit} { - - do_test backup_ioerr-$iTest.$iError.1 { - string match SQLITE_IOERR* $rc - } {1} - do_test backup_ioerr-$iTest.$iError.2 { - list [sqlite3_errcode ddb] [sqlite3_errmsg ddb] - } {SQLITE_OK {not an error}} - - set rc [B finish] - do_test backup_ioerr-$iTest.$iError.3 { - string match SQLITE_IOERR* $rc - } {1} - - do_test backup_ioerr-$iTest.$iError.4 { - sqlite3_errmsg ddb - } {disk I/O error} - - clear_ioerr_simulation - sqlite3 ddb bak.db - integrity_check backup_ioerr-$iTest.$iError.5 ddb - - continue - } - - # No IO error was encountered during step 3. Check that backup_step() - # returned SQLITE_OK before proceding. - do_test backup_ioerr-$iTest.$iError.6 { - expr {$rc eq "SQLITE_OK"} - } {1} - - # Step 4: Write to the source database. - set rc [catchsql { UPDATE t1 SET b = randstr(1000,1000) WHERE a < 50 } sdb] - - if {[lindex $rc 0] && $::sqlite_io_error_persist==0} { - # The IO error occured while updating the source database. In this - # case the backup should be able to continue. - set rc [B step 5000] - if { $rc != "SQLITE_IOERR_UNLOCK" } { - do_test backup_ioerr-$iTest.$iError.7 { - list [B step 5000] [B finish] - } {SQLITE_DONE SQLITE_OK} - - clear_ioerr_simulation - test_contents backup_ioerr-$iTest.$iError.8 ddb main sdb main - integrity_check backup_ioerr-$iTest.$iError.9 ddb - } else { - do_test backup_ioerr-$iTest.$iError.10 { - B finish - } {SQLITE_IOERR_UNLOCK} - } - - clear_ioerr_simulation - sqlite3 ddb bak.db - integrity_check backup_ioerr-$iTest.$iError.11 ddb - - continue - } - - # Step 5: Finish the backup operation. If an IO error occurs, check that - # it is reported correctly and skip to the next iteration of the loop. - # - set rc [B step 5000] - if {$rc != "SQLITE_DONE"} { - do_test backup_ioerr-$iTest.$iError.12 { - string match SQLITE_IOERR* $rc - } {1} - do_test backup_ioerr-$iTest.$iError.13 { - list [sqlite3_errcode ddb] [sqlite3_errmsg ddb] - } {SQLITE_OK {not an error}} - - set rc [B finish] - do_test backup_ioerr-$iTest.$iError.14 { - string match SQLITE_IOERR* $rc - } {1} - do_test backup_ioerr-$iTest.$iError.15 { - sqlite3_errmsg ddb - } {disk I/O error} - - clear_ioerr_simulation - sqlite3 ddb bak.db - integrity_check backup_ioerr-$iTest.$iError.16 ddb - - continue - } - - # The backup was successfully completed. - # - do_test backup_ioerr-$iTest.$iError.17 { - list [set rc] [B finish] - } {SQLITE_DONE SQLITE_OK} - - clear_ioerr_simulation - sqlite3 sdb test.db - sqlite3 ddb bak.db - - test_contents backup_ioerr-$iTest.$iError.18 ddb main sdb main - integrity_check backup_ioerr-$iTest.$iError.19 ddb - - set bStop [expr $::sqlite_io_error_pending<=0] -}}}} - -catch { sdb close } -catch { ddb close } -finish_test DELETED test/backup_malloc.test Index: test/backup_malloc.test ================================================================== --- test/backup_malloc.test +++ /dev/null @@ -1,86 +0,0 @@ -# 2009 January 30 -# -# 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 the handling of OOM errors by the -# sqlite3_backup_XXX APIs. -# -# $Id: backup_malloc.test,v 1.2 2009/02/04 22:46:47 drh Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -source $testdir/malloc_common.tcl - -do_malloc_test backup_malloc-1 -tclprep { - execsql { - PRAGMA cache_size = 10; - BEGIN; - CREATE TABLE t1(a, b); - INSERT INTO t1 VALUES(1, randstr(1000,1000)); - INSERT INTO t1 SELECT a+ 1, randstr(1000,1000) FROM t1; - INSERT INTO t1 SELECT a+ 2, randstr(1000,1000) FROM t1; - INSERT INTO t1 SELECT a+ 4, randstr(1000,1000) FROM t1; - INSERT INTO t1 SELECT a+ 8, randstr(1000,1000) FROM t1; - INSERT INTO t1 SELECT a+16, randstr(1000,1000) FROM t1; - INSERT INTO t1 SELECT a+32, randstr(1000,1000) FROM t1; - INSERT INTO t1 SELECT a+64, randstr(1000,1000) FROM t1; - CREATE INDEX i1 ON t1(b); - COMMIT; - } - sqlite3 db2 test2.db - execsql { PRAGMA cache_size = 10 } db2 -} -tclbody { - - # Create a backup object. - # - set rc [catch {sqlite3_backup B db2 main db main}] - if {$rc && [sqlite3_errcode db2] == "SQLITE_NOMEM"} { - error "out of memory" - } - - # Run the backup process some. - # - set rc [B step 50] - if {$rc == "SQLITE_NOMEM" || $rc == "SQLITE_IOERR_NOMEM"} { - error "out of memory" - } - - # Update the database. - # - execsql { UPDATE t1 SET a = a + 1 } - - # Finish doing the backup. - # - set rc [B step 5000] - if {$rc == "SQLITE_NOMEM" || $rc == "SQLITE_IOERR_NOMEM"} { - error "out of memory" - } - - # Finalize the backup. - B finish -} -cleanup { - catch { B finish } -} - -do_malloc_test backup_malloc-1 -tclprep { - sqlite3 db2 test2.db -} -tclbody { - set rc [catch {sqlite3_backup B db2 temp db main}] - set errcode [sqlite3_errcode db2] - if {$rc && ($errcode == "SQLITE_NOMEM" || $errcode == "SQLITE_IOERR_NOMEM")} { - error "out of memory" - } -} -cleanup { - catch { B finish } - db2 close -} - -finish_test Index: test/bigfile.test ================================================================== --- test/bigfile.test +++ test/bigfile.test @@ -10,11 +10,11 @@ #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script testing the ability of SQLite to handle database # files larger than 4GB. # -# $Id: bigfile.test,v 1.11 2008/11/21 22:21:51 drh Exp $ +# $Id: bigfile.test,v 1.10 2007/08/18 10:59:21 danielk1977 Exp $ # set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -62,11 +62,11 @@ # Try to create a large file - a file that is larger than 2^32 bytes. # If this fails, it means that the system being tested does not support # large files. So skip all of the remaining tests in this file. # db close -if {[catch {fake_big_file 4096 [pwd]/test.db} msg]} { +if {[catch {fake_big_file 4096 test.db} msg]} { puts "**** Unable to create a file larger than 4096 MB. *****" puts "$msg" finish_test return } @@ -103,11 +103,11 @@ SELECT md5sum(x) FROM t2; } } $::MAGIC_SUM db close -if {[catch {fake_big_file 8192 [pwd]/test.db}]} { +if {[catch {fake_big_file 8192 test.db}]} { puts "**** Unable to create a file larger than 8192 MB. *****" finish_test return } @@ -140,11 +140,11 @@ SELECT md5sum(x) FROM t3; } } $::MAGIC_SUM db close -if {[catch {fake_big_file 16384 [pwd]/test.db}]} { +if {[catch {fake_big_file 16384 test.db}]} { puts "**** Unable to create a file larger than 16384 MB. *****" finish_test return } Index: test/bind.test ================================================================== --- test/bind.test +++ test/bind.test @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script testing the sqlite_bind API. # -# $Id: bind.test,v 1.46 2009/02/09 05:18:33 danielk1977 Exp $ +# $Id: bind.test,v 1.45 2008/10/03 09:10:46 danielk1977 Exp $ # set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -655,32 +655,6 @@ list [sqlite3_column_type $VM 0] [sqlite3_column_type $VM 1] \ [sqlite3_column_type $VM 2] } {NULL NULL NULL} sqlite3_finalize $VM -#-------------------------------------------------------------------- -# These tests attempt to reproduce bug #3463. -# -proc param_names {db zSql} { - set ret [list] - set VM [sqlite3_prepare db $zSql -1 TAIL] - for {set ii 1} {$ii <= [sqlite3_bind_parameter_count $VM]} {incr ii} { - lappend ret [sqlite3_bind_parameter_name $VM $ii] - } - sqlite3_finalize $VM - set ret -} - -do_test bind-14.1 { - param_names db { SELECT @a, @b } -} {@a @b} -do_test bind-14.2 { - param_names db { SELECT NULL FROM (SELECT NULL) WHERE @a = @b } -} {@a @b} -do_test bind-14.3 { - param_names db { SELECT @a FROM (SELECT NULL) WHERE 1 = @b } -} {@a @b} -do_test bind-14.4 { - param_names db { SELECT @a, @b FROM (SELECT NULL) } -} {@a @b} - finish_test Index: test/bitvec.test ================================================================== --- test/bitvec.test +++ test/bitvec.test @@ -9,11 +9,11 @@ # #*********************************************************************** # # Unit testing of the Bitvec object. # -# $Id: bitvec.test,v 1.3 2008/11/19 18:30:35 shane Exp $ +# $Id: bitvec.test,v 1.2 2008/03/21 16:45:48 drh Exp $ # set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -183,5 +183,9 @@ bitvec_malloc_test bitvec-3.3.$n $n 50000 {1 50000 1 1 0} } finish_test return + + + +finish_test DELETED test/boundary1.tcl Index: test/boundary1.tcl ================================================================== --- test/boundary1.tcl +++ /dev/null @@ -1,289 +0,0 @@ -puts {# 2008 December 11 -# -# The author disclaims copyright to this source code. In place of -# a legal notice, here is a blessing: -# -# May you do good and not evil. -# May you find forgiveness for yourself and forgive others. -# May you share freely, never taking more than you give. -# -#*********************************************************************** -# This file implements regression tests for SQLite library. -# -# This file is automatically generated from a separate TCL script. -# This file seeks to exercise integer boundary values. -# -# $Id: boundary1.tcl,v 1.3 2009/01/02 15:45:48 shane Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -# Many of the boundary tests depend on a working 64-bit implementation. -if {![working_64bit_int]} { finish_test; return } -} - -expr srand(0) - -# Generate interesting boundary numbers -# -foreach x { - 0 - 1 - 0x7f - 0x7fff - 0x7fffff - 0x7fffffff - 0x7fffffffff - 0x7fffffffffff - 0x7fffffffffffff - 0x7fffffffffffffff -} { - set x [expr {wide($x)}] - set boundarynum($x) 1 - set boundarynum([expr {$x+1}]) 1 - set boundarynum([expr {-($x+1)}]) 1 - set boundarynum([expr {-($x+2)}]) 1 - set boundarynum([expr {$x+$x+1}]) 1 - set boundarynum([expr {$x+$x+2}]) 1 -} -set x [expr {wide(127)}] -for {set i 1} {$i<=9} {incr i} { - set boundarynum($x) 1 - set boundarynum([expr {$x+1}]) 1 - set x [expr {wide($x*128 + 127)}] -} - -# Scramble the $inlist into a random order. -# -proc scramble {inlist} { - set y {} - foreach x $inlist { - lappend y [list [expr {rand()}] $x] - } - set y [lsort $y] - set outlist {} - foreach x $y { - lappend outlist [lindex $x 1] - } - return $outlist -} - -# A simple selection sort. Not trying to be efficient. -# -proc sort {inlist} { - set outlist {} - set mn [lindex $inlist 0] - foreach x $inlist { - if {$x<$mn} {set mn $x} - } - set outlist $mn - set mx $mn - while {1} { - set valid 0 - foreach x $inlist { - if {$x>$mx && (!$valid || $mn>$x)} { - set mn $x - set valid 1 - } - } - if {!$valid} break - lappend outlist $mn - set mx $mn - } - return $outlist -} - -# Reverse the order of a list -# -proc reverse {inlist} { - set i [llength $inlist] - set outlist {} - for {incr i -1} {$i>=0} {incr i -1} { - lappend outlist [lindex $inlist $i] - } - return $outlist -} - -set nums1 [scramble [array names boundarynum]] -set nums2 [scramble [array names boundarynum]] - -set tname boundary1 -puts "do_test $tname-1.1 \173" -puts " db eval \173" -puts " CREATE TABLE t1(a,x);" -set a 0 -foreach r $nums1 { - incr a - set t1ra($r) $a - set t1ar($a) $r - set x [format %08x%08x [expr {wide($r)>>32}] $r] - set t1rx($r) $x - set t1xr($x) $r - puts " INSERT INTO t1(oid,a,x) VALUES($r,$a,'$x');" -} -puts " CREATE INDEX t1i1 ON t1(a);" -puts " CREATE INDEX t1i2 ON t1(x);" -puts " \175" -puts "\175 {}" - -puts "do_test $tname-1.2 \173" -puts " db eval \173" -puts " SELECT count(*) FROM t1" -puts " \175" -puts "\175 {64}" - -set nums3 $nums2 -lappend nums3 9.22337303685477580800e+18 -lappend nums3 -9.22337303685477580800e+18 - -set i 0 -foreach r $nums3 { - incr i - - if {abs($r)<9.22337203685477580800e+18} { - set x $t1rx($r) - set a $t1ra($r) - set r5 $r.5 - set r0 $r.0 - puts "do_test $tname-2.$i.1 \173" - puts " db eval \173" - puts " SELECT * FROM t1 WHERE rowid=$r" - puts " \175" - puts "\175 {$a $x}" - puts "do_test $tname-2.$i.2 \173" - puts " db eval \173" - puts " SELECT rowid, a FROM t1 WHERE x='$x'" - puts " \175" - puts "\175 {$r $a}" - puts "do_test $tname-2.$i.3 \173" - puts " db eval \173" - puts " SELECT rowid, x FROM t1 WHERE a=$a" - puts " \175" - puts "\175 {$r $x}" - } - - foreach op {> >= < <=} subno {gt ge lt le} { - - ################################################################ 2.x.y.1 - set rset {} - set aset {} - foreach rx $nums2 { - if "\$rx $op \$r" { - lappend rset $rx - lappend aset $t1ra($rx) - } - } - puts "do_test $tname-2.$i.$subno.1 \173" - puts " db eval \173" - puts " SELECT a FROM t1 WHERE rowid $op $r ORDER BY a" - puts " \175" - puts "\175 {[sort $aset]}" - - ################################################################ 2.x.y.2 - puts "do_test $tname-2.$i.$subno.2 \173" - puts " db eval \173" - puts " SELECT a FROM t1 WHERE rowid $op $r ORDER BY a DESC" - puts " \175" - puts "\175 {[reverse [sort $aset]]}" - - ################################################################ 2.x.y.3 - set aset {} - foreach rx [sort $rset] { - lappend aset $t1ra($rx) - } - puts "do_test $tname-2.$i.$subno.3 \173" - puts " db eval \173" - puts " SELECT a FROM t1 WHERE rowid $op $r ORDER BY rowid" - puts " \175" - puts "\175 {$aset}" - - ################################################################ 2.x.y.4 - set aset {} - foreach rx [reverse [sort $rset]] { - lappend aset $t1ra($rx) - } - puts "do_test $tname-2.$i.$subno.4 \173" - puts " db eval \173" - puts " SELECT a FROM t1 WHERE rowid $op $r ORDER BY rowid DESC" - puts " \175" - puts "\175 {$aset}" - - ################################################################ 2.x.y.5 - set aset {} - set xset {} - foreach rx $rset { - lappend xset $t1rx($rx) - } - foreach x [sort $xset] { - set rx $t1xr($x) - lappend aset $t1ra($rx) - } - puts "do_test $tname-2.$i.$subno.5 \173" - puts " db eval \173" - puts " SELECT a FROM t1 WHERE rowid $op $r ORDER BY x" - puts " \175" - puts "\175 {$aset}" - - ################################################################ 2.x.y.10 - if {abs($r)>9223372036854775808 || [string length $r5]>15} continue - set rset {} - set aset {} - foreach rx $nums2 { - if "\$rx $op \$r0" { - lappend rset $rx - } - } - foreach rx [sort $rset] { - lappend aset $t1ra($rx) - } - puts "do_test $tname-2.$i.$subno.10 \173" - puts " db eval \173" - puts " SELECT a FROM t1 WHERE rowid $op $r0 ORDER BY rowid" - puts " \175" - puts "\175 {$aset}" - - ################################################################ 2.x.y.11 - set aset {} - foreach rx [reverse [sort $rset]] { - lappend aset $t1ra($rx) - } - puts "do_test $tname-2.$i.$subno.11 \173" - puts " db eval \173" - puts " SELECT a FROM t1 WHERE rowid $op $r0 ORDER BY rowid DESC" - puts " \175" - puts "\175 {$aset}" - - - ################################################################ 2.x.y.12 - set rset {} - set aset {} - foreach rx $nums2 { - if "\$rx $op \$r5" { - lappend rset $rx - } - } - foreach rx [sort $rset] { - lappend aset $t1ra($rx) - } - puts "do_test $tname-2.$i.$subno.12 \173" - puts " db eval \173" - puts " SELECT a FROM t1 WHERE rowid $op $r5 ORDER BY rowid" - puts " \175" - puts "\175 {$aset}" - - ################################################################ 2.x.y.13 - set aset {} - foreach rx [reverse [sort $rset]] { - lappend aset $t1ra($rx) - } - puts "do_test $tname-2.$i.$subno.13 \173" - puts " db eval \173" - puts " SELECT a FROM t1 WHERE rowid $op $r5 ORDER BY rowid DESC" - puts " \175" - puts "\175 {$aset}" - } - -} - - -puts {finish_test} DELETED test/boundary1.test Index: test/boundary1.test ================================================================== --- test/boundary1.test +++ /dev/null @@ -1,7645 +0,0 @@ -# 2008 December 11 -# -# The author disclaims copyright to this source code. In place of -# a legal notice, here is a blessing: -# -# May you do good and not evil. -# May you find forgiveness for yourself and forgive others. -# May you share freely, never taking more than you give. -# -#*********************************************************************** -# This file implements regression tests for SQLite library. -# -# This file is automatically generated from a separate TCL script. -# This file seeks to exercise integer boundary values. -# -# $Id: boundary1.test,v 1.2 2009/01/02 15:45:48 shane Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -# Many of the boundary tests depend on a working 64-bit implementation. -if {![working_64bit_int]} { finish_test; return } - -do_test boundary1-1.1 { - db eval { - CREATE TABLE t1(a,x); - INSERT INTO t1(oid,a,x) VALUES(-8388609,1,'ffffffffff7fffff'); - INSERT INTO t1(oid,a,x) VALUES(-36028797018963969,2,'ff7fffffffffffff'); - INSERT INTO t1(oid,a,x) VALUES(9223372036854775807,3,'7fffffffffffffff'); - INSERT INTO t1(oid,a,x) VALUES(127,4,'000000000000007f'); - INSERT INTO t1(oid,a,x) VALUES(3,5,'0000000000000003'); - INSERT INTO t1(oid,a,x) VALUES(16777216,6,'0000000001000000'); - INSERT INTO t1(oid,a,x) VALUES(4398046511103,7,'000003ffffffffff'); - INSERT INTO t1(oid,a,x) VALUES(16383,8,'0000000000003fff'); - INSERT INTO t1(oid,a,x) VALUES(16777215,9,'0000000000ffffff'); - INSERT INTO t1(oid,a,x) VALUES(281474976710655,10,'0000ffffffffffff'); - INSERT INTO t1(oid,a,x) VALUES(-2147483648,11,'ffffffff80000000'); - INSERT INTO t1(oid,a,x) VALUES(268435455,12,'000000000fffffff'); - INSERT INTO t1(oid,a,x) VALUES(562949953421311,13,'0001ffffffffffff'); - INSERT INTO t1(oid,a,x) VALUES(4294967295,14,'00000000ffffffff'); - INSERT INTO t1(oid,a,x) VALUES(2097151,15,'00000000001fffff'); - INSERT INTO t1(oid,a,x) VALUES(16384,16,'0000000000004000'); - INSERT INTO t1(oid,a,x) VALUES(72057594037927935,17,'00ffffffffffffff'); - INSERT INTO t1(oid,a,x) VALUES(8388607,18,'00000000007fffff'); - INSERT INTO t1(oid,a,x) VALUES(1099511627776,19,'0000010000000000'); - INSERT INTO t1(oid,a,x) VALUES(2147483647,20,'000000007fffffff'); - INSERT INTO t1(oid,a,x) VALUES(-140737488355329,21,'ffff7fffffffffff'); - INSERT INTO t1(oid,a,x) VALUES(34359738368,22,'0000000800000000'); - INSERT INTO t1(oid,a,x) VALUES(32767,23,'0000000000007fff'); - INSERT INTO t1(oid,a,x) VALUES(8388608,24,'0000000000800000'); - INSERT INTO t1(oid,a,x) VALUES(140737488355327,25,'00007fffffffffff'); - INSERT INTO t1(oid,a,x) VALUES(281474976710656,26,'0001000000000000'); - INSERT INTO t1(oid,a,x) VALUES(36028797018963967,27,'007fffffffffffff'); - INSERT INTO t1(oid,a,x) VALUES(72057594037927936,28,'0100000000000000'); - INSERT INTO t1(oid,a,x) VALUES(-32769,29,'ffffffffffff7fff'); - INSERT INTO t1(oid,a,x) VALUES(255,30,'00000000000000ff'); - INSERT INTO t1(oid,a,x) VALUES(4,31,'0000000000000004'); - INSERT INTO t1(oid,a,x) VALUES(-32768,32,'ffffffffffff8000'); - INSERT INTO t1(oid,a,x) VALUES(-2,33,'fffffffffffffffe'); - INSERT INTO t1(oid,a,x) VALUES(140737488355328,34,'0000800000000000'); - INSERT INTO t1(oid,a,x) VALUES(549755813888,35,'0000008000000000'); - INSERT INTO t1(oid,a,x) VALUES(4294967296,36,'0000000100000000'); - INSERT INTO t1(oid,a,x) VALUES(-8388608,37,'ffffffffff800000'); - INSERT INTO t1(oid,a,x) VALUES(-1,38,'ffffffffffffffff'); - INSERT INTO t1(oid,a,x) VALUES(34359738367,39,'00000007ffffffff'); - INSERT INTO t1(oid,a,x) VALUES(268435456,40,'0000000010000000'); - INSERT INTO t1(oid,a,x) VALUES(2,41,'0000000000000002'); - INSERT INTO t1(oid,a,x) VALUES(2097152,42,'0000000000200000'); - INSERT INTO t1(oid,a,x) VALUES(562949953421312,43,'0002000000000000'); - INSERT INTO t1(oid,a,x) VALUES(-140737488355328,44,'ffff800000000000'); - INSERT INTO t1(oid,a,x) VALUES(36028797018963968,45,'0080000000000000'); - INSERT INTO t1(oid,a,x) VALUES(549755813887,46,'0000007fffffffff'); - INSERT INTO t1(oid,a,x) VALUES(-2147483649,47,'ffffffff7fffffff'); - INSERT INTO t1(oid,a,x) VALUES(65535,48,'000000000000ffff'); - INSERT INTO t1(oid,a,x) VALUES(128,49,'0000000000000080'); - INSERT INTO t1(oid,a,x) VALUES(32768,50,'0000000000008000'); - INSERT INTO t1(oid,a,x) VALUES(2147483648,51,'0000000080000000'); - INSERT INTO t1(oid,a,x) VALUES(-3,52,'fffffffffffffffd'); - INSERT INTO t1(oid,a,x) VALUES(-128,53,'ffffffffffffff80'); - INSERT INTO t1(oid,a,x) VALUES(-129,54,'ffffffffffffff7f'); - INSERT INTO t1(oid,a,x) VALUES(-9223372036854775808,55,'8000000000000000'); - INSERT INTO t1(oid,a,x) VALUES(4398046511104,56,'0000040000000000'); - INSERT INTO t1(oid,a,x) VALUES(1099511627775,57,'000000ffffffffff'); - INSERT INTO t1(oid,a,x) VALUES(-549755813889,58,'ffffff7fffffffff'); - INSERT INTO t1(oid,a,x) VALUES(0,59,'0000000000000000'); - INSERT INTO t1(oid,a,x) VALUES(1,60,'0000000000000001'); - INSERT INTO t1(oid,a,x) VALUES(256,61,'0000000000000100'); - INSERT INTO t1(oid,a,x) VALUES(65536,62,'0000000000010000'); - INSERT INTO t1(oid,a,x) VALUES(-549755813888,63,'ffffff8000000000'); - INSERT INTO t1(oid,a,x) VALUES(-36028797018963968,64,'ff80000000000000'); - CREATE INDEX t1i1 ON t1(a); - CREATE INDEX t1i2 ON t1(x); - } -} {} -do_test boundary1-1.2 { - db eval { - SELECT count(*) FROM t1 - } -} {64} -do_test boundary1-2.1.1 { - db eval { - SELECT * FROM t1 WHERE rowid=72057594037927935 - } -} {17 00ffffffffffffff} -do_test boundary1-2.1.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='00ffffffffffffff' - } -} {72057594037927935 17} -do_test boundary1-2.1.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=17 - } -} {72057594037927935 00ffffffffffffff} -do_test boundary1-2.1.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 72057594037927935 ORDER BY a - } -} {3 28} -do_test boundary1-2.1.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 72057594037927935 ORDER BY a DESC - } -} {28 3} -do_test boundary1-2.1.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 72057594037927935 ORDER BY rowid - } -} {28 3} -do_test boundary1-2.1.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 72057594037927935 ORDER BY rowid DESC - } -} {3 28} -do_test boundary1-2.1.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 72057594037927935 ORDER BY x - } -} {28 3} -do_test boundary1-2.1.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 72057594037927935 ORDER BY a - } -} {3 17 28} -do_test boundary1-2.1.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 72057594037927935 ORDER BY a DESC - } -} {28 17 3} -do_test boundary1-2.1.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 72057594037927935 ORDER BY rowid - } -} {17 28 3} -do_test boundary1-2.1.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 72057594037927935 ORDER BY rowid DESC - } -} {3 28 17} -do_test boundary1-2.1.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 72057594037927935 ORDER BY x - } -} {17 28 3} -do_test boundary1-2.1.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 72057594037927935 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.1.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 72057594037927935 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 27 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary1-2.1.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 72057594037927935 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45} -do_test boundary1-2.1.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 72057594037927935 ORDER BY rowid DESC - } -} {45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.1.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 72057594037927935 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.1.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 72057594037927935 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.1.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 72057594037927935 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary1-2.1.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 72057594037927935 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17} -do_test boundary1-2.1.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 72057594037927935 ORDER BY rowid DESC - } -} {17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.1.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 72057594037927935 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.2.1 { - db eval { - SELECT * FROM t1 WHERE rowid=16384 - } -} {16 0000000000004000} -do_test boundary1-2.2.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='0000000000004000' - } -} {16384 16} -do_test boundary1-2.2.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=16 - } -} {16384 0000000000004000} -do_test boundary1-2.2.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 16384 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary1-2.2.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 16384 ORDER BY a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary1-2.2.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 16384 ORDER BY rowid - } -} {23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.2.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 16384 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23} -do_test boundary1-2.2.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 16384 ORDER BY x - } -} {23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.2.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 16384 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary1-2.2.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 16384 ORDER BY a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 7 6 3} -do_test boundary1-2.2.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 16384 ORDER BY rowid - } -} {16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.2.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 16384 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16} -do_test boundary1-2.2.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 16384 ORDER BY x - } -} {16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.2.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 16384 ORDER BY a - } -} {1 2 4 5 8 11 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary1-2.2.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 16384 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 11 8 5 4 2 1} -do_test boundary1-2.2.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 16384 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8} -do_test boundary1-2.2.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 16384 ORDER BY rowid DESC - } -} {8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.2.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 16384 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.2.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 16384 ORDER BY a - } -} {1 2 4 5 8 11 16 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary1-2.2.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 16384 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 16 11 8 5 4 2 1} -do_test boundary1-2.2.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 16384 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16} -do_test boundary1-2.2.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 16384 ORDER BY rowid DESC - } -} {16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.2.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 16384 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.3.1 { - db eval { - SELECT * FROM t1 WHERE rowid=4294967296 - } -} {36 0000000100000000} -do_test boundary1-2.3.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='0000000100000000' - } -} {4294967296 36} -do_test boundary1-2.3.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=36 - } -} {4294967296 0000000100000000} -do_test boundary1-2.3.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 4294967296 ORDER BY a - } -} {3 7 10 13 17 19 22 25 26 27 28 34 35 39 43 45 46 56 57} -do_test boundary1-2.3.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 4294967296 ORDER BY a DESC - } -} {57 56 46 45 43 39 35 34 28 27 26 25 22 19 17 13 10 7 3} -do_test boundary1-2.3.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 4294967296 ORDER BY rowid - } -} {39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.3.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 4294967296 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39} -do_test boundary1-2.3.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 4294967296 ORDER BY x - } -} {39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.3.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 4294967296 ORDER BY a - } -} {3 7 10 13 17 19 22 25 26 27 28 34 35 36 39 43 45 46 56 57} -do_test boundary1-2.3.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 4294967296 ORDER BY a DESC - } -} {57 56 46 45 43 39 36 35 34 28 27 26 25 22 19 17 13 10 7 3} -do_test boundary1-2.3.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 4294967296 ORDER BY rowid - } -} {36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.3.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 4294967296 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36} -do_test boundary1-2.3.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 4294967296 ORDER BY x - } -} {36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.3.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 4294967296 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.3.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 4294967296 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary1-2.3.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 4294967296 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14} -do_test boundary1-2.3.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 4294967296 ORDER BY rowid DESC - } -} {14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.3.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 4294967296 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.3.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 4294967296 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 23 24 29 30 31 32 33 36 37 38 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.3.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 4294967296 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 38 37 36 33 32 31 30 29 24 23 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary1-2.3.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 4294967296 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36} -do_test boundary1-2.3.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 4294967296 ORDER BY rowid DESC - } -} {36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.3.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 4294967296 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.4.1 { - db eval { - SELECT * FROM t1 WHERE rowid=16777216 - } -} {6 0000000001000000} -do_test boundary1-2.4.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='0000000001000000' - } -} {16777216 6} -do_test boundary1-2.4.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=6 - } -} {16777216 0000000001000000} -do_test boundary1-2.4.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 16777216 ORDER BY a - } -} {3 7 10 12 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary1-2.4.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 16777216 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 12 10 7 3} -do_test boundary1-2.4.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 16777216 ORDER BY rowid - } -} {12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.4.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 16777216 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12} -do_test boundary1-2.4.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 16777216 ORDER BY x - } -} {12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.4.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 16777216 ORDER BY a - } -} {3 6 7 10 12 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary1-2.4.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 16777216 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 12 10 7 6 3} -do_test boundary1-2.4.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 16777216 ORDER BY rowid - } -} {6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.4.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 16777216 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6} -do_test boundary1-2.4.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 16777216 ORDER BY x - } -} {6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.4.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 16777216 ORDER BY a - } -} {1 2 4 5 8 9 11 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.4.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 16777216 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 11 9 8 5 4 2 1} -do_test boundary1-2.4.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 16777216 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9} -do_test boundary1-2.4.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 16777216 ORDER BY rowid DESC - } -} {9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.4.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 16777216 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.4.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 16777216 ORDER BY a - } -} {1 2 4 5 6 8 9 11 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.4.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 16777216 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 11 9 8 6 5 4 2 1} -do_test boundary1-2.4.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 16777216 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6} -do_test boundary1-2.4.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 16777216 ORDER BY rowid DESC - } -} {6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.4.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 16777216 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.5.1 { - db eval { - SELECT * FROM t1 WHERE rowid=-32769 - } -} {29 ffffffffffff7fff} -do_test boundary1-2.5.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='ffffffffffff7fff' - } -} {-32769 29} -do_test boundary1-2.5.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=29 - } -} {-32769 ffffffffffff7fff} -do_test boundary1-2.5.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > -32769 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 32 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary1-2.5.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > -32769 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 32 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary1-2.5.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > -32769 ORDER BY rowid - } -} {32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.5.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > -32769 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32} -do_test boundary1-2.5.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > -32769 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 32 54 53 52 33 38} -do_test boundary1-2.5.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= -32769 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary1-2.5.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= -32769 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary1-2.5.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= -32769 ORDER BY rowid - } -} {29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.5.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= -32769 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29} -do_test boundary1-2.5.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= -32769 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 29 32 54 53 52 33 38} -do_test boundary1-2.5.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < -32769 ORDER BY a - } -} {1 2 11 21 37 44 47 55 58 63 64} -do_test boundary1-2.5.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < -32769 ORDER BY a DESC - } -} {64 63 58 55 47 44 37 21 11 2 1} -do_test boundary1-2.5.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < -32769 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37} -do_test boundary1-2.5.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < -32769 ORDER BY rowid DESC - } -} {37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.5.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < -32769 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37} -do_test boundary1-2.5.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= -32769 ORDER BY a - } -} {1 2 11 21 29 37 44 47 55 58 63 64} -do_test boundary1-2.5.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= -32769 ORDER BY a DESC - } -} {64 63 58 55 47 44 37 29 21 11 2 1} -do_test boundary1-2.5.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= -32769 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29} -do_test boundary1-2.5.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= -32769 ORDER BY rowid DESC - } -} {29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.5.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= -32769 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29} -do_test boundary1-2.6.1 { - db eval { - SELECT * FROM t1 WHERE rowid=-140737488355329 - } -} {21 ffff7fffffffffff} -do_test boundary1-2.6.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='ffff7fffffffffff' - } -} {-140737488355329 21} -do_test boundary1-2.6.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=21 - } -} {-140737488355329 ffff7fffffffffff} -do_test boundary1-2.6.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > -140737488355329 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63} -do_test boundary1-2.6.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > -140737488355329 ORDER BY a DESC - } -} {63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary1-2.6.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > -140737488355329 ORDER BY rowid - } -} {44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.6.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > -140737488355329 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44} -do_test boundary1-2.6.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > -140737488355329 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.6.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= -140737488355329 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63} -do_test boundary1-2.6.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= -140737488355329 ORDER BY a DESC - } -} {63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary1-2.6.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= -140737488355329 ORDER BY rowid - } -} {21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.6.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= -140737488355329 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21} -do_test boundary1-2.6.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= -140737488355329 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.6.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < -140737488355329 ORDER BY a - } -} {2 55 64} -do_test boundary1-2.6.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < -140737488355329 ORDER BY a DESC - } -} {64 55 2} -do_test boundary1-2.6.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < -140737488355329 ORDER BY rowid - } -} {55 2 64} -do_test boundary1-2.6.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < -140737488355329 ORDER BY rowid DESC - } -} {64 2 55} -do_test boundary1-2.6.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < -140737488355329 ORDER BY x - } -} {55 2 64} -do_test boundary1-2.6.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= -140737488355329 ORDER BY a - } -} {2 21 55 64} -do_test boundary1-2.6.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= -140737488355329 ORDER BY a DESC - } -} {64 55 21 2} -do_test boundary1-2.6.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= -140737488355329 ORDER BY rowid - } -} {55 2 64 21} -do_test boundary1-2.6.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= -140737488355329 ORDER BY rowid DESC - } -} {21 64 2 55} -do_test boundary1-2.6.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= -140737488355329 ORDER BY x - } -} {55 2 64 21} -do_test boundary1-2.7.1 { - db eval { - SELECT * FROM t1 WHERE rowid=2 - } -} {41 0000000000000002} -do_test boundary1-2.7.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='0000000000000002' - } -} {2 41} -do_test boundary1-2.7.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=41 - } -} {2 0000000000000002} -do_test boundary1-2.7.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 2 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary1-2.7.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 2 ORDER BY a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary1-2.7.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 2 ORDER BY rowid - } -} {5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.7.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 2 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5} -do_test boundary1-2.7.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 2 ORDER BY x - } -} {5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.7.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 2 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 41 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary1-2.7.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 2 ORDER BY a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 41 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary1-2.7.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 2 ORDER BY rowid - } -} {41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.7.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 2 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41} -do_test boundary1-2.7.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 2 ORDER BY x - } -} {41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.7.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 2 ORDER BY a - } -} {1 2 11 21 29 32 33 37 38 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary1-2.7.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 2 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 38 37 33 32 29 21 11 2 1} -do_test boundary1-2.7.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 2 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60} -do_test boundary1-2.7.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 2 ORDER BY rowid DESC - } -} {60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.7.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 2 ORDER BY x - } -} {59 60 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.7.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 2 ORDER BY a - } -} {1 2 11 21 29 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary1-2.7.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 2 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 29 21 11 2 1} -do_test boundary1-2.7.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 2 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41} -do_test boundary1-2.7.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 2 ORDER BY rowid DESC - } -} {41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.7.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 2 ORDER BY x - } -} {59 60 41 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.8.1 { - db eval { - SELECT * FROM t1 WHERE rowid=4 - } -} {31 0000000000000004} -do_test boundary1-2.8.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='0000000000000004' - } -} {4 31} -do_test boundary1-2.8.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=31 - } -} {4 0000000000000004} -do_test boundary1-2.8.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 4 ORDER BY a - } -} {3 4 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary1-2.8.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 4 ORDER BY a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 4 3} -do_test boundary1-2.8.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 4 ORDER BY rowid - } -} {4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.8.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 4 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4} -do_test boundary1-2.8.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 4 ORDER BY x - } -} {4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.8.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 4 ORDER BY a - } -} {3 4 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary1-2.8.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 4 ORDER BY a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 4 3} -do_test boundary1-2.8.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 4 ORDER BY rowid - } -} {31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.8.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 4 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31} -do_test boundary1-2.8.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 4 ORDER BY x - } -} {31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.8.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 4 ORDER BY a - } -} {1 2 5 11 21 29 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary1-2.8.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 4 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 29 21 11 5 2 1} -do_test boundary1-2.8.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 4 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5} -do_test boundary1-2.8.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 4 ORDER BY rowid DESC - } -} {5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.8.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 4 ORDER BY x - } -} {59 60 41 5 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.8.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 4 ORDER BY a - } -} {1 2 5 11 21 29 31 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary1-2.8.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 4 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 31 29 21 11 5 2 1} -do_test boundary1-2.8.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 4 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31} -do_test boundary1-2.8.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 4 ORDER BY rowid DESC - } -} {31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.8.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 4 ORDER BY x - } -} {59 60 41 5 31 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.9.1 { - db eval { - SELECT * FROM t1 WHERE rowid=562949953421311 - } -} {13 0001ffffffffffff} -do_test boundary1-2.9.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='0001ffffffffffff' - } -} {562949953421311 13} -do_test boundary1-2.9.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=13 - } -} {562949953421311 0001ffffffffffff} -do_test boundary1-2.9.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 562949953421311 ORDER BY a - } -} {3 17 27 28 43 45} -do_test boundary1-2.9.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 562949953421311 ORDER BY a DESC - } -} {45 43 28 27 17 3} -do_test boundary1-2.9.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 562949953421311 ORDER BY rowid - } -} {43 27 45 17 28 3} -do_test boundary1-2.9.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 562949953421311 ORDER BY rowid DESC - } -} {3 28 17 45 27 43} -do_test boundary1-2.9.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 562949953421311 ORDER BY x - } -} {43 27 45 17 28 3} -do_test boundary1-2.9.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 562949953421311 ORDER BY a - } -} {3 13 17 27 28 43 45} -do_test boundary1-2.9.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 562949953421311 ORDER BY a DESC - } -} {45 43 28 27 17 13 3} -do_test boundary1-2.9.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 562949953421311 ORDER BY rowid - } -} {13 43 27 45 17 28 3} -do_test boundary1-2.9.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 562949953421311 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13} -do_test boundary1-2.9.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 562949953421311 ORDER BY x - } -} {13 43 27 45 17 28 3} -do_test boundary1-2.9.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 562949953421311 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 14 15 16 18 19 20 21 22 23 24 25 26 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.9.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 562949953421311 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 26 25 24 23 22 21 20 19 18 16 15 14 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary1-2.9.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 562949953421311 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26} -do_test boundary1-2.9.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 562949953421311 ORDER BY rowid DESC - } -} {26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.9.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 562949953421311 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.9.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 562949953421311 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.9.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 562949953421311 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary1-2.9.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 562949953421311 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13} -do_test boundary1-2.9.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 562949953421311 ORDER BY rowid DESC - } -} {13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.9.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 562949953421311 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.10.1 { - db eval { - SELECT * FROM t1 WHERE rowid=256 - } -} {61 0000000000000100} -do_test boundary1-2.10.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='0000000000000100' - } -} {256 61} -do_test boundary1-2.10.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=61 - } -} {256 0000000000000100} -do_test boundary1-2.10.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 256 ORDER BY a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary1-2.10.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 256 ORDER BY a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary1-2.10.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 256 ORDER BY rowid - } -} {8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.10.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 256 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8} -do_test boundary1-2.10.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 256 ORDER BY x - } -} {8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.10.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 256 ORDER BY a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 61 62} -do_test boundary1-2.10.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 256 ORDER BY a DESC - } -} {62 61 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary1-2.10.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 256 ORDER BY rowid - } -} {61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.10.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 256 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61} -do_test boundary1-2.10.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 256 ORDER BY x - } -} {61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.10.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 256 ORDER BY a - } -} {1 2 4 5 11 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 63 64} -do_test boundary1-2.10.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 256 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 11 5 4 2 1} -do_test boundary1-2.10.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 256 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30} -do_test boundary1-2.10.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 256 ORDER BY rowid DESC - } -} {30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.10.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 256 ORDER BY x - } -} {59 60 41 5 31 4 49 30 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.10.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 256 ORDER BY a - } -} {1 2 4 5 11 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary1-2.10.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 256 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 11 5 4 2 1} -do_test boundary1-2.10.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 256 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61} -do_test boundary1-2.10.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 256 ORDER BY rowid DESC - } -} {61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.10.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 256 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.11.1 { - db eval { - SELECT * FROM t1 WHERE rowid=34359738368 - } -} {22 0000000800000000} -do_test boundary1-2.11.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='0000000800000000' - } -} {34359738368 22} -do_test boundary1-2.11.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=22 - } -} {34359738368 0000000800000000} -do_test boundary1-2.11.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 34359738368 ORDER BY a - } -} {3 7 10 13 17 19 25 26 27 28 34 35 43 45 46 56 57} -do_test boundary1-2.11.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 34359738368 ORDER BY a DESC - } -} {57 56 46 45 43 35 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary1-2.11.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 34359738368 ORDER BY rowid - } -} {46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.11.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 34359738368 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46} -do_test boundary1-2.11.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 34359738368 ORDER BY x - } -} {46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.11.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 34359738368 ORDER BY a - } -} {3 7 10 13 17 19 22 25 26 27 28 34 35 43 45 46 56 57} -do_test boundary1-2.11.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 34359738368 ORDER BY a DESC - } -} {57 56 46 45 43 35 34 28 27 26 25 22 19 17 13 10 7 3} -do_test boundary1-2.11.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 34359738368 ORDER BY rowid - } -} {22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.11.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 34359738368 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22} -do_test boundary1-2.11.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 34359738368 ORDER BY x - } -} {22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.11.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 34359738368 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 23 24 29 30 31 32 33 36 37 38 39 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.11.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 34359738368 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 39 38 37 36 33 32 31 30 29 24 23 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary1-2.11.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 34359738368 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39} -do_test boundary1-2.11.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 34359738368 ORDER BY rowid DESC - } -} {39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.11.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 34359738368 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.11.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 34359738368 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 36 37 38 39 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.11.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 34359738368 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 39 38 37 36 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary1-2.11.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 34359738368 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22} -do_test boundary1-2.11.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 34359738368 ORDER BY rowid DESC - } -} {22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.11.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 34359738368 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.12.1 { - db eval { - SELECT * FROM t1 WHERE rowid=65536 - } -} {62 0000000000010000} -do_test boundary1-2.12.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='0000000000010000' - } -} {65536 62} -do_test boundary1-2.12.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=62 - } -} {65536 0000000000010000} -do_test boundary1-2.12.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 65536 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 51 56 57} -do_test boundary1-2.12.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 65536 ORDER BY a DESC - } -} {57 56 51 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary1-2.12.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 65536 ORDER BY rowid - } -} {15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.12.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 65536 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15} -do_test boundary1-2.12.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 65536 ORDER BY x - } -} {15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.12.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 65536 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 51 56 57 62} -do_test boundary1-2.12.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 65536 ORDER BY a DESC - } -} {62 57 56 51 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary1-2.12.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 65536 ORDER BY rowid - } -} {62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.12.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 65536 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62} -do_test boundary1-2.12.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 65536 ORDER BY x - } -} {62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.12.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 65536 ORDER BY a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 48 49 50 52 53 54 55 58 59 60 61 63 64} -do_test boundary1-2.12.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 65536 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 50 49 48 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary1-2.12.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 65536 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48} -do_test boundary1-2.12.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 65536 ORDER BY rowid DESC - } -} {48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.12.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 65536 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.12.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 65536 ORDER BY a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.12.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 65536 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary1-2.12.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 65536 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62} -do_test boundary1-2.12.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 65536 ORDER BY rowid DESC - } -} {62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.12.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 65536 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.13.1 { - db eval { - SELECT * FROM t1 WHERE rowid=268435456 - } -} {40 0000000010000000} -do_test boundary1-2.13.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='0000000010000000' - } -} {268435456 40} -do_test boundary1-2.13.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=40 - } -} {268435456 0000000010000000} -do_test boundary1-2.13.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 268435456 ORDER BY a - } -} {3 7 10 13 14 17 19 20 22 25 26 27 28 34 35 36 39 43 45 46 51 56 57} -do_test boundary1-2.13.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 268435456 ORDER BY a DESC - } -} {57 56 51 46 45 43 39 36 35 34 28 27 26 25 22 20 19 17 14 13 10 7 3} -do_test boundary1-2.13.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 268435456 ORDER BY rowid - } -} {20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.13.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 268435456 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20} -do_test boundary1-2.13.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 268435456 ORDER BY x - } -} {20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.13.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 268435456 ORDER BY a - } -} {3 7 10 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary1-2.13.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 268435456 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 10 7 3} -do_test boundary1-2.13.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 268435456 ORDER BY rowid - } -} {40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.13.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 268435456 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40} -do_test boundary1-2.13.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 268435456 ORDER BY x - } -} {40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.13.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 268435456 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.13.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 268435456 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary1-2.13.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 268435456 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12} -do_test boundary1-2.13.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 268435456 ORDER BY rowid DESC - } -} {12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.13.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 268435456 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.13.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 268435456 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.13.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 268435456 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary1-2.13.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 268435456 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40} -do_test boundary1-2.13.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 268435456 ORDER BY rowid DESC - } -} {40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.13.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 268435456 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.14.1 { - db eval { - SELECT * FROM t1 WHERE rowid=-140737488355328 - } -} {44 ffff800000000000} -do_test boundary1-2.14.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='ffff800000000000' - } -} {-140737488355328 44} -do_test boundary1-2.14.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=44 - } -} {-140737488355328 ffff800000000000} -do_test boundary1-2.14.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > -140737488355328 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63} -do_test boundary1-2.14.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > -140737488355328 ORDER BY a DESC - } -} {63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary1-2.14.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > -140737488355328 ORDER BY rowid - } -} {58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.14.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > -140737488355328 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58} -do_test boundary1-2.14.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > -140737488355328 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.14.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= -140737488355328 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63} -do_test boundary1-2.14.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= -140737488355328 ORDER BY a DESC - } -} {63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary1-2.14.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= -140737488355328 ORDER BY rowid - } -} {44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.14.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= -140737488355328 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44} -do_test boundary1-2.14.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= -140737488355328 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.14.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < -140737488355328 ORDER BY a - } -} {2 21 55 64} -do_test boundary1-2.14.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < -140737488355328 ORDER BY a DESC - } -} {64 55 21 2} -do_test boundary1-2.14.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < -140737488355328 ORDER BY rowid - } -} {55 2 64 21} -do_test boundary1-2.14.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < -140737488355328 ORDER BY rowid DESC - } -} {21 64 2 55} -do_test boundary1-2.14.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < -140737488355328 ORDER BY x - } -} {55 2 64 21} -do_test boundary1-2.14.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= -140737488355328 ORDER BY a - } -} {2 21 44 55 64} -do_test boundary1-2.14.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= -140737488355328 ORDER BY a DESC - } -} {64 55 44 21 2} -do_test boundary1-2.14.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= -140737488355328 ORDER BY rowid - } -} {55 2 64 21 44} -do_test boundary1-2.14.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= -140737488355328 ORDER BY rowid DESC - } -} {44 21 64 2 55} -do_test boundary1-2.14.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= -140737488355328 ORDER BY x - } -} {55 2 64 21 44} -do_test boundary1-2.15.1 { - db eval { - SELECT * FROM t1 WHERE rowid=1099511627776 - } -} {19 0000010000000000} -do_test boundary1-2.15.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='0000010000000000' - } -} {1099511627776 19} -do_test boundary1-2.15.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=19 - } -} {1099511627776 0000010000000000} -do_test boundary1-2.15.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 1099511627776 ORDER BY a - } -} {3 7 10 13 17 25 26 27 28 34 43 45 56} -do_test boundary1-2.15.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 1099511627776 ORDER BY a DESC - } -} {56 45 43 34 28 27 26 25 17 13 10 7 3} -do_test boundary1-2.15.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 1099511627776 ORDER BY rowid - } -} {7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.15.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 1099511627776 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7} -do_test boundary1-2.15.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 1099511627776 ORDER BY x - } -} {7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.15.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 1099511627776 ORDER BY a - } -} {3 7 10 13 17 19 25 26 27 28 34 43 45 56} -do_test boundary1-2.15.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 1099511627776 ORDER BY a DESC - } -} {56 45 43 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary1-2.15.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 1099511627776 ORDER BY rowid - } -} {19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.15.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 1099511627776 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19} -do_test boundary1-2.15.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 1099511627776 ORDER BY x - } -} {19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.15.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 1099511627776 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 57 58 59 60 61 62 63 64} -do_test boundary1-2.15.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 1099511627776 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary1-2.15.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 1099511627776 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57} -do_test boundary1-2.15.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 1099511627776 ORDER BY rowid DESC - } -} {57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.15.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 1099511627776 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.15.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 1099511627776 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 19 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 57 58 59 60 61 62 63 64} -do_test boundary1-2.15.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 1099511627776 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 19 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary1-2.15.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 1099511627776 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19} -do_test boundary1-2.15.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 1099511627776 ORDER BY rowid DESC - } -} {19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.15.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 1099511627776 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.16.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 9223372036854775807 ORDER BY a - } -} {} -do_test boundary1-2.16.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 9223372036854775807 ORDER BY a DESC - } -} {} -do_test boundary1-2.16.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 9223372036854775807 ORDER BY rowid - } -} {} -do_test boundary1-2.16.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 9223372036854775807 ORDER BY rowid DESC - } -} {} -do_test boundary1-2.16.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 9223372036854775807 ORDER BY x - } -} {} -do_test boundary1-2.16.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 9223372036854775807 ORDER BY a - } -} {3} -do_test boundary1-2.16.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 9223372036854775807 ORDER BY a DESC - } -} {3} -do_test boundary1-2.16.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 9223372036854775807 ORDER BY rowid - } -} {3} -do_test boundary1-2.16.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 9223372036854775807 ORDER BY rowid DESC - } -} {3} -do_test boundary1-2.16.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 9223372036854775807 ORDER BY x - } -} {3} -do_test boundary1-2.16.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 9223372036854775807 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.16.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 9223372036854775807 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary1-2.16.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 9223372036854775807 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28} -do_test boundary1-2.16.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 9223372036854775807 ORDER BY rowid DESC - } -} {28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.16.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 9223372036854775807 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.16.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 9223372036854775807 ORDER BY a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.16.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 9223372036854775807 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary1-2.16.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 9223372036854775807 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.16.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 9223372036854775807 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.16.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 9223372036854775807 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.17.1 { - db eval { - SELECT * FROM t1 WHERE rowid=32768 - } -} {50 0000000000008000} -do_test boundary1-2.17.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='0000000000008000' - } -} {32768 50} -do_test boundary1-2.17.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=50 - } -} {32768 0000000000008000} -do_test boundary1-2.17.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 32768 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 51 56 57 62} -do_test boundary1-2.17.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 32768 ORDER BY a DESC - } -} {62 57 56 51 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary1-2.17.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 32768 ORDER BY rowid - } -} {48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.17.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 32768 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48} -do_test boundary1-2.17.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 32768 ORDER BY x - } -} {48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.17.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 32768 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary1-2.17.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 32768 ORDER BY a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary1-2.17.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 32768 ORDER BY rowid - } -} {50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.17.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 32768 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50} -do_test boundary1-2.17.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 32768 ORDER BY x - } -} {50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.17.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 32768 ORDER BY a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary1-2.17.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 32768 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary1-2.17.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 32768 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23} -do_test boundary1-2.17.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 32768 ORDER BY rowid DESC - } -} {23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.17.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 32768 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.17.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 32768 ORDER BY a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 49 50 52 53 54 55 58 59 60 61 63 64} -do_test boundary1-2.17.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 32768 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 50 49 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary1-2.17.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 32768 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50} -do_test boundary1-2.17.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 32768 ORDER BY rowid DESC - } -} {50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.17.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 32768 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.18.1 { - db eval { - SELECT * FROM t1 WHERE rowid=-36028797018963968 - } -} {64 ff80000000000000} -do_test boundary1-2.18.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='ff80000000000000' - } -} {-36028797018963968 64} -do_test boundary1-2.18.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=64 - } -} {-36028797018963968 ff80000000000000} -do_test boundary1-2.18.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > -36028797018963968 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63} -do_test boundary1-2.18.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > -36028797018963968 ORDER BY a DESC - } -} {63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary1-2.18.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > -36028797018963968 ORDER BY rowid - } -} {21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.18.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > -36028797018963968 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21} -do_test boundary1-2.18.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > -36028797018963968 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.18.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= -36028797018963968 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.18.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= -36028797018963968 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary1-2.18.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= -36028797018963968 ORDER BY rowid - } -} {64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.18.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= -36028797018963968 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64} -do_test boundary1-2.18.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= -36028797018963968 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.18.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < -36028797018963968 ORDER BY a - } -} {2 55} -do_test boundary1-2.18.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < -36028797018963968 ORDER BY a DESC - } -} {55 2} -do_test boundary1-2.18.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < -36028797018963968 ORDER BY rowid - } -} {55 2} -do_test boundary1-2.18.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < -36028797018963968 ORDER BY rowid DESC - } -} {2 55} -do_test boundary1-2.18.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < -36028797018963968 ORDER BY x - } -} {55 2} -do_test boundary1-2.18.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= -36028797018963968 ORDER BY a - } -} {2 55 64} -do_test boundary1-2.18.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= -36028797018963968 ORDER BY a DESC - } -} {64 55 2} -do_test boundary1-2.18.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= -36028797018963968 ORDER BY rowid - } -} {55 2 64} -do_test boundary1-2.18.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= -36028797018963968 ORDER BY rowid DESC - } -} {64 2 55} -do_test boundary1-2.18.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= -36028797018963968 ORDER BY x - } -} {55 2 64} -do_test boundary1-2.19.1 { - db eval { - SELECT * FROM t1 WHERE rowid=65535 - } -} {48 000000000000ffff} -do_test boundary1-2.19.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='000000000000ffff' - } -} {65535 48} -do_test boundary1-2.19.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=48 - } -} {65535 000000000000ffff} -do_test boundary1-2.19.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 65535 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 51 56 57 62} -do_test boundary1-2.19.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 65535 ORDER BY a DESC - } -} {62 57 56 51 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary1-2.19.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 65535 ORDER BY rowid - } -} {62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.19.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 65535 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62} -do_test boundary1-2.19.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 65535 ORDER BY x - } -} {62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.19.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 65535 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 51 56 57 62} -do_test boundary1-2.19.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 65535 ORDER BY a DESC - } -} {62 57 56 51 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary1-2.19.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 65535 ORDER BY rowid - } -} {48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.19.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 65535 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48} -do_test boundary1-2.19.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 65535 ORDER BY x - } -} {48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.19.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 65535 ORDER BY a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 49 50 52 53 54 55 58 59 60 61 63 64} -do_test boundary1-2.19.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 65535 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 50 49 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary1-2.19.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 65535 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50} -do_test boundary1-2.19.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 65535 ORDER BY rowid DESC - } -} {50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.19.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 65535 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.19.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 65535 ORDER BY a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 48 49 50 52 53 54 55 58 59 60 61 63 64} -do_test boundary1-2.19.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 65535 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 50 49 48 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary1-2.19.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 65535 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48} -do_test boundary1-2.19.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 65535 ORDER BY rowid DESC - } -} {48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.19.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 65535 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.20.1 { - db eval { - SELECT * FROM t1 WHERE rowid=4294967295 - } -} {14 00000000ffffffff} -do_test boundary1-2.20.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='00000000ffffffff' - } -} {4294967295 14} -do_test boundary1-2.20.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=14 - } -} {4294967295 00000000ffffffff} -do_test boundary1-2.20.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 4294967295 ORDER BY a - } -} {3 7 10 13 17 19 22 25 26 27 28 34 35 36 39 43 45 46 56 57} -do_test boundary1-2.20.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 4294967295 ORDER BY a DESC - } -} {57 56 46 45 43 39 36 35 34 28 27 26 25 22 19 17 13 10 7 3} -do_test boundary1-2.20.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 4294967295 ORDER BY rowid - } -} {36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.20.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 4294967295 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36} -do_test boundary1-2.20.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 4294967295 ORDER BY x - } -} {36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.20.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 4294967295 ORDER BY a - } -} {3 7 10 13 14 17 19 22 25 26 27 28 34 35 36 39 43 45 46 56 57} -do_test boundary1-2.20.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 4294967295 ORDER BY a DESC - } -} {57 56 46 45 43 39 36 35 34 28 27 26 25 22 19 17 14 13 10 7 3} -do_test boundary1-2.20.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 4294967295 ORDER BY rowid - } -} {14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.20.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 4294967295 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14} -do_test boundary1-2.20.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 4294967295 ORDER BY x - } -} {14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.20.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 4294967295 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 20 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.20.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 4294967295 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 20 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary1-2.20.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 4294967295 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51} -do_test boundary1-2.20.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 4294967295 ORDER BY rowid DESC - } -} {51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.20.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 4294967295 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.20.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 4294967295 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.20.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 4294967295 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary1-2.20.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 4294967295 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14} -do_test boundary1-2.20.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 4294967295 ORDER BY rowid DESC - } -} {14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.20.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 4294967295 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.21.1 { - db eval { - SELECT * FROM t1 WHERE rowid=1099511627775 - } -} {57 000000ffffffffff} -do_test boundary1-2.21.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='000000ffffffffff' - } -} {1099511627775 57} -do_test boundary1-2.21.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=57 - } -} {1099511627775 000000ffffffffff} -do_test boundary1-2.21.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 1099511627775 ORDER BY a - } -} {3 7 10 13 17 19 25 26 27 28 34 43 45 56} -do_test boundary1-2.21.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 1099511627775 ORDER BY a DESC - } -} {56 45 43 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary1-2.21.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 1099511627775 ORDER BY rowid - } -} {19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.21.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 1099511627775 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19} -do_test boundary1-2.21.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 1099511627775 ORDER BY x - } -} {19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.21.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 1099511627775 ORDER BY a - } -} {3 7 10 13 17 19 25 26 27 28 34 43 45 56 57} -do_test boundary1-2.21.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 1099511627775 ORDER BY a DESC - } -} {57 56 45 43 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary1-2.21.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 1099511627775 ORDER BY rowid - } -} {57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.21.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 1099511627775 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57} -do_test boundary1-2.21.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 1099511627775 ORDER BY x - } -} {57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.21.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 1099511627775 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.21.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 1099511627775 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary1-2.21.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 1099511627775 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35} -do_test boundary1-2.21.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 1099511627775 ORDER BY rowid DESC - } -} {35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.21.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 1099511627775 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.21.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 1099511627775 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 57 58 59 60 61 62 63 64} -do_test boundary1-2.21.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 1099511627775 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary1-2.21.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 1099511627775 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57} -do_test boundary1-2.21.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 1099511627775 ORDER BY rowid DESC - } -} {57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.21.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 1099511627775 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.22.1 { - db eval { - SELECT * FROM t1 WHERE rowid=-8388608 - } -} {37 ffffffffff800000} -do_test boundary1-2.22.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='ffffffffff800000' - } -} {-8388608 37} -do_test boundary1-2.22.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=37 - } -} {-8388608 ffffffffff800000} -do_test boundary1-2.22.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > -8388608 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary1-2.22.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > -8388608 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary1-2.22.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > -8388608 ORDER BY rowid - } -} {29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.22.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > -8388608 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29} -do_test boundary1-2.22.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > -8388608 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 29 32 54 53 52 33 38} -do_test boundary1-2.22.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= -8388608 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary1-2.22.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= -8388608 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary1-2.22.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= -8388608 ORDER BY rowid - } -} {37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.22.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= -8388608 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37} -do_test boundary1-2.22.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= -8388608 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 37 29 32 54 53 52 33 38} -do_test boundary1-2.22.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < -8388608 ORDER BY a - } -} {1 2 11 21 44 47 55 58 63 64} -do_test boundary1-2.22.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < -8388608 ORDER BY a DESC - } -} {64 63 58 55 47 44 21 11 2 1} -do_test boundary1-2.22.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < -8388608 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1} -do_test boundary1-2.22.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < -8388608 ORDER BY rowid DESC - } -} {1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.22.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < -8388608 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1} -do_test boundary1-2.22.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= -8388608 ORDER BY a - } -} {1 2 11 21 37 44 47 55 58 63 64} -do_test boundary1-2.22.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= -8388608 ORDER BY a DESC - } -} {64 63 58 55 47 44 37 21 11 2 1} -do_test boundary1-2.22.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= -8388608 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37} -do_test boundary1-2.22.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= -8388608 ORDER BY rowid DESC - } -} {37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.22.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= -8388608 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37} -do_test boundary1-2.23.1 { - db eval { - SELECT * FROM t1 WHERE rowid=549755813888 - } -} {35 0000008000000000} -do_test boundary1-2.23.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='0000008000000000' - } -} {549755813888 35} -do_test boundary1-2.23.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=35 - } -} {549755813888 0000008000000000} -do_test boundary1-2.23.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 549755813888 ORDER BY a - } -} {3 7 10 13 17 19 25 26 27 28 34 43 45 56 57} -do_test boundary1-2.23.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 549755813888 ORDER BY a DESC - } -} {57 56 45 43 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary1-2.23.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 549755813888 ORDER BY rowid - } -} {57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.23.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 549755813888 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57} -do_test boundary1-2.23.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 549755813888 ORDER BY x - } -} {57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.23.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 549755813888 ORDER BY a - } -} {3 7 10 13 17 19 25 26 27 28 34 35 43 45 56 57} -do_test boundary1-2.23.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 549755813888 ORDER BY a DESC - } -} {57 56 45 43 35 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary1-2.23.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 549755813888 ORDER BY rowid - } -} {35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.23.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 549755813888 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35} -do_test boundary1-2.23.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 549755813888 ORDER BY x - } -} {35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.23.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 549755813888 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.23.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 549755813888 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary1-2.23.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 549755813888 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46} -do_test boundary1-2.23.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 549755813888 ORDER BY rowid DESC - } -} {46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.23.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 549755813888 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.23.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 549755813888 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.23.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 549755813888 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary1-2.23.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 549755813888 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35} -do_test boundary1-2.23.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 549755813888 ORDER BY rowid DESC - } -} {35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.23.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 549755813888 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.24.1 { - db eval { - SELECT * FROM t1 WHERE rowid=8388607 - } -} {18 00000000007fffff} -do_test boundary1-2.24.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='00000000007fffff' - } -} {8388607 18} -do_test boundary1-2.24.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=18 - } -} {8388607 00000000007fffff} -do_test boundary1-2.24.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 8388607 ORDER BY a - } -} {3 6 7 9 10 12 13 14 17 19 20 22 24 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary1-2.24.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 8388607 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 24 22 20 19 17 14 13 12 10 9 7 6 3} -do_test boundary1-2.24.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 8388607 ORDER BY rowid - } -} {24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.24.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 8388607 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24} -do_test boundary1-2.24.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 8388607 ORDER BY x - } -} {24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.24.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 8388607 ORDER BY a - } -} {3 6 7 9 10 12 13 14 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary1-2.24.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 8388607 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 14 13 12 10 9 7 6 3} -do_test boundary1-2.24.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 8388607 ORDER BY rowid - } -} {18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.24.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 8388607 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18} -do_test boundary1-2.24.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 8388607 ORDER BY x - } -} {18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.24.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 8388607 ORDER BY a - } -} {1 2 4 5 8 11 15 16 21 23 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.24.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 8388607 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 23 21 16 15 11 8 5 4 2 1} -do_test boundary1-2.24.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 8388607 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42} -do_test boundary1-2.24.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 8388607 ORDER BY rowid DESC - } -} {42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.24.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 8388607 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.24.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 8388607 ORDER BY a - } -} {1 2 4 5 8 11 15 16 18 21 23 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.24.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 8388607 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 23 21 18 16 15 11 8 5 4 2 1} -do_test boundary1-2.24.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 8388607 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18} -do_test boundary1-2.24.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 8388607 ORDER BY rowid DESC - } -} {18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.24.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 8388607 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.25.1 { - db eval { - SELECT * FROM t1 WHERE rowid=-3 - } -} {52 fffffffffffffffd} -do_test boundary1-2.25.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='fffffffffffffffd' - } -} {-3 52} -do_test boundary1-2.25.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=52 - } -} {-3 fffffffffffffffd} -do_test boundary1-2.25.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > -3 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 56 57 59 60 61 62} -do_test boundary1-2.25.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > -3 ORDER BY a DESC - } -} {62 61 60 59 57 56 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary1-2.25.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > -3 ORDER BY rowid - } -} {33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.25.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > -3 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33} -do_test boundary1-2.25.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > -3 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 33 38} -do_test boundary1-2.25.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= -3 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 56 57 59 60 61 62} -do_test boundary1-2.25.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= -3 ORDER BY a DESC - } -} {62 61 60 59 57 56 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary1-2.25.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= -3 ORDER BY rowid - } -} {52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.25.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= -3 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52} -do_test boundary1-2.25.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= -3 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 52 33 38} -do_test boundary1-2.25.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < -3 ORDER BY a - } -} {1 2 11 21 29 32 37 44 47 53 54 55 58 63 64} -do_test boundary1-2.25.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < -3 ORDER BY a DESC - } -} {64 63 58 55 54 53 47 44 37 32 29 21 11 2 1} -do_test boundary1-2.25.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < -3 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53} -do_test boundary1-2.25.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < -3 ORDER BY rowid DESC - } -} {53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.25.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < -3 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53} -do_test boundary1-2.25.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= -3 ORDER BY a - } -} {1 2 11 21 29 32 37 44 47 52 53 54 55 58 63 64} -do_test boundary1-2.25.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= -3 ORDER BY a DESC - } -} {64 63 58 55 54 53 52 47 44 37 32 29 21 11 2 1} -do_test boundary1-2.25.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= -3 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52} -do_test boundary1-2.25.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= -3 ORDER BY rowid DESC - } -} {52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.25.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= -3 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52} -do_test boundary1-2.26.1 { - db eval { - SELECT * FROM t1 WHERE rowid=0 - } -} {59 0000000000000000} -do_test boundary1-2.26.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='0000000000000000' - } -} {0 59} -do_test boundary1-2.26.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=59 - } -} {0 0000000000000000} -do_test boundary1-2.26.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 0 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 41 42 43 45 46 48 49 50 51 56 57 60 61 62} -do_test boundary1-2.26.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 0 ORDER BY a DESC - } -} {62 61 60 57 56 51 50 49 48 46 45 43 42 41 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary1-2.26.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 0 ORDER BY rowid - } -} {60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.26.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 0 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60} -do_test boundary1-2.26.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 0 ORDER BY x - } -} {60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.26.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 0 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 41 42 43 45 46 48 49 50 51 56 57 59 60 61 62} -do_test boundary1-2.26.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 0 ORDER BY a DESC - } -} {62 61 60 59 57 56 51 50 49 48 46 45 43 42 41 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary1-2.26.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 0 ORDER BY rowid - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.26.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 0 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59} -do_test boundary1-2.26.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 0 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.26.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 0 ORDER BY a - } -} {1 2 11 21 29 32 33 37 38 44 47 52 53 54 55 58 63 64} -do_test boundary1-2.26.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 0 ORDER BY a DESC - } -} {64 63 58 55 54 53 52 47 44 38 37 33 32 29 21 11 2 1} -do_test boundary1-2.26.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 0 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.26.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 0 ORDER BY rowid DESC - } -} {38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.26.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 0 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.26.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 0 ORDER BY a - } -} {1 2 11 21 29 32 33 37 38 44 47 52 53 54 55 58 59 63 64} -do_test boundary1-2.26.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 0 ORDER BY a DESC - } -} {64 63 59 58 55 54 53 52 47 44 38 37 33 32 29 21 11 2 1} -do_test boundary1-2.26.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 0 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59} -do_test boundary1-2.26.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 0 ORDER BY rowid DESC - } -} {59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.26.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 0 ORDER BY x - } -} {59 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.27.1 { - db eval { - SELECT * FROM t1 WHERE rowid=-1 - } -} {38 ffffffffffffffff} -do_test boundary1-2.27.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='ffffffffffffffff' - } -} {-1 38} -do_test boundary1-2.27.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=38 - } -} {-1 ffffffffffffffff} -do_test boundary1-2.27.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > -1 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 41 42 43 45 46 48 49 50 51 56 57 59 60 61 62} -do_test boundary1-2.27.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > -1 ORDER BY a DESC - } -} {62 61 60 59 57 56 51 50 49 48 46 45 43 42 41 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary1-2.27.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > -1 ORDER BY rowid - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.27.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > -1 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59} -do_test boundary1-2.27.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > -1 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.27.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= -1 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 56 57 59 60 61 62} -do_test boundary1-2.27.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= -1 ORDER BY a DESC - } -} {62 61 60 59 57 56 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary1-2.27.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= -1 ORDER BY rowid - } -} {38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.27.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= -1 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38} -do_test boundary1-2.27.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= -1 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 38} -do_test boundary1-2.27.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < -1 ORDER BY a - } -} {1 2 11 21 29 32 33 37 44 47 52 53 54 55 58 63 64} -do_test boundary1-2.27.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < -1 ORDER BY a DESC - } -} {64 63 58 55 54 53 52 47 44 37 33 32 29 21 11 2 1} -do_test boundary1-2.27.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < -1 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33} -do_test boundary1-2.27.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < -1 ORDER BY rowid DESC - } -} {33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.27.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < -1 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33} -do_test boundary1-2.27.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= -1 ORDER BY a - } -} {1 2 11 21 29 32 33 37 38 44 47 52 53 54 55 58 63 64} -do_test boundary1-2.27.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= -1 ORDER BY a DESC - } -} {64 63 58 55 54 53 52 47 44 38 37 33 32 29 21 11 2 1} -do_test boundary1-2.27.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= -1 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.27.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= -1 ORDER BY rowid DESC - } -} {38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.27.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= -1 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.28.1 { - db eval { - SELECT * FROM t1 WHERE rowid=-2 - } -} {33 fffffffffffffffe} -do_test boundary1-2.28.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='fffffffffffffffe' - } -} {-2 33} -do_test boundary1-2.28.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=33 - } -} {-2 fffffffffffffffe} -do_test boundary1-2.28.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > -2 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 56 57 59 60 61 62} -do_test boundary1-2.28.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > -2 ORDER BY a DESC - } -} {62 61 60 59 57 56 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary1-2.28.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > -2 ORDER BY rowid - } -} {38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.28.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > -2 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38} -do_test boundary1-2.28.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > -2 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 38} -do_test boundary1-2.28.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= -2 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 56 57 59 60 61 62} -do_test boundary1-2.28.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= -2 ORDER BY a DESC - } -} {62 61 60 59 57 56 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary1-2.28.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= -2 ORDER BY rowid - } -} {33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.28.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= -2 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33} -do_test boundary1-2.28.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= -2 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 33 38} -do_test boundary1-2.28.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < -2 ORDER BY a - } -} {1 2 11 21 29 32 37 44 47 52 53 54 55 58 63 64} -do_test boundary1-2.28.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < -2 ORDER BY a DESC - } -} {64 63 58 55 54 53 52 47 44 37 32 29 21 11 2 1} -do_test boundary1-2.28.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < -2 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52} -do_test boundary1-2.28.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < -2 ORDER BY rowid DESC - } -} {52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.28.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < -2 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52} -do_test boundary1-2.28.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= -2 ORDER BY a - } -} {1 2 11 21 29 32 33 37 44 47 52 53 54 55 58 63 64} -do_test boundary1-2.28.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= -2 ORDER BY a DESC - } -} {64 63 58 55 54 53 52 47 44 37 33 32 29 21 11 2 1} -do_test boundary1-2.28.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= -2 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33} -do_test boundary1-2.28.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= -2 ORDER BY rowid DESC - } -} {33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.28.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= -2 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33} -do_test boundary1-2.29.1 { - db eval { - SELECT * FROM t1 WHERE rowid=2097152 - } -} {42 0000000000200000} -do_test boundary1-2.29.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='0000000000200000' - } -} {2097152 42} -do_test boundary1-2.29.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=42 - } -} {2097152 0000000000200000} -do_test boundary1-2.29.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 2097152 ORDER BY a - } -} {3 6 7 9 10 12 13 14 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary1-2.29.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 2097152 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 14 13 12 10 9 7 6 3} -do_test boundary1-2.29.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 2097152 ORDER BY rowid - } -} {18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.29.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 2097152 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18} -do_test boundary1-2.29.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 2097152 ORDER BY x - } -} {18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.29.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 2097152 ORDER BY a - } -} {3 6 7 9 10 12 13 14 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 51 56 57} -do_test boundary1-2.29.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 2097152 ORDER BY a DESC - } -} {57 56 51 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 14 13 12 10 9 7 6 3} -do_test boundary1-2.29.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 2097152 ORDER BY rowid - } -} {42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.29.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 2097152 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42} -do_test boundary1-2.29.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 2097152 ORDER BY x - } -} {42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.29.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 2097152 ORDER BY a - } -} {1 2 4 5 8 11 15 16 21 23 29 30 31 32 33 37 38 41 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.29.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 2097152 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 41 38 37 33 32 31 30 29 23 21 16 15 11 8 5 4 2 1} -do_test boundary1-2.29.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 2097152 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15} -do_test boundary1-2.29.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 2097152 ORDER BY rowid DESC - } -} {15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.29.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 2097152 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.29.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 2097152 ORDER BY a - } -} {1 2 4 5 8 11 15 16 21 23 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.29.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 2097152 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 23 21 16 15 11 8 5 4 2 1} -do_test boundary1-2.29.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 2097152 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42} -do_test boundary1-2.29.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 2097152 ORDER BY rowid DESC - } -} {42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.29.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 2097152 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.30.1 { - db eval { - SELECT * FROM t1 WHERE rowid=128 - } -} {49 0000000000000080} -do_test boundary1-2.30.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='0000000000000080' - } -} {128 49} -do_test boundary1-2.30.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=49 - } -} {128 0000000000000080} -do_test boundary1-2.30.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 128 ORDER BY a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 34 35 36 39 40 42 43 45 46 48 50 51 56 57 61 62} -do_test boundary1-2.30.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 128 ORDER BY a DESC - } -} {62 61 57 56 51 50 48 46 45 43 42 40 39 36 35 34 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary1-2.30.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 128 ORDER BY rowid - } -} {30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.30.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 128 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30} -do_test boundary1-2.30.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 128 ORDER BY x - } -} {30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.30.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 128 ORDER BY a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary1-2.30.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 128 ORDER BY a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary1-2.30.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 128 ORDER BY rowid - } -} {49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.30.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 128 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49} -do_test boundary1-2.30.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 128 ORDER BY x - } -} {49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.30.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 128 ORDER BY a - } -} {1 2 4 5 11 21 29 31 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary1-2.30.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 128 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 31 29 21 11 5 4 2 1} -do_test boundary1-2.30.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 128 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4} -do_test boundary1-2.30.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 128 ORDER BY rowid DESC - } -} {4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.30.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 128 ORDER BY x - } -} {59 60 41 5 31 4 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.30.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 128 ORDER BY a - } -} {1 2 4 5 11 21 29 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 63 64} -do_test boundary1-2.30.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 128 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 29 21 11 5 4 2 1} -do_test boundary1-2.30.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 128 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49} -do_test boundary1-2.30.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 128 ORDER BY rowid DESC - } -} {49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.30.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 128 ORDER BY x - } -} {59 60 41 5 31 4 49 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.31.1 { - db eval { - SELECT * FROM t1 WHERE rowid=255 - } -} {30 00000000000000ff} -do_test boundary1-2.31.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='00000000000000ff' - } -} {255 30} -do_test boundary1-2.31.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=30 - } -} {255 00000000000000ff} -do_test boundary1-2.31.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 255 ORDER BY a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 61 62} -do_test boundary1-2.31.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 255 ORDER BY a DESC - } -} {62 61 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary1-2.31.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 255 ORDER BY rowid - } -} {61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.31.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 255 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61} -do_test boundary1-2.31.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 255 ORDER BY x - } -} {61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.31.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 255 ORDER BY a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 34 35 36 39 40 42 43 45 46 48 50 51 56 57 61 62} -do_test boundary1-2.31.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 255 ORDER BY a DESC - } -} {62 61 57 56 51 50 48 46 45 43 42 40 39 36 35 34 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary1-2.31.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 255 ORDER BY rowid - } -} {30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.31.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 255 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30} -do_test boundary1-2.31.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 255 ORDER BY x - } -} {30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.31.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 255 ORDER BY a - } -} {1 2 4 5 11 21 29 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 63 64} -do_test boundary1-2.31.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 255 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 29 21 11 5 4 2 1} -do_test boundary1-2.31.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 255 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49} -do_test boundary1-2.31.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 255 ORDER BY rowid DESC - } -} {49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.31.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 255 ORDER BY x - } -} {59 60 41 5 31 4 49 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.31.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 255 ORDER BY a - } -} {1 2 4 5 11 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 63 64} -do_test boundary1-2.31.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 255 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 11 5 4 2 1} -do_test boundary1-2.31.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 255 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30} -do_test boundary1-2.31.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 255 ORDER BY rowid DESC - } -} {30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.31.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 255 ORDER BY x - } -} {59 60 41 5 31 4 49 30 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.32.1 { - db eval { - SELECT * FROM t1 WHERE rowid=-2147483648 - } -} {11 ffffffff80000000} -do_test boundary1-2.32.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='ffffffff80000000' - } -} {-2147483648 11} -do_test boundary1-2.32.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=11 - } -} {-2147483648 ffffffff80000000} -do_test boundary1-2.32.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > -2147483648 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary1-2.32.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > -2147483648 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3 1} -do_test boundary1-2.32.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > -2147483648 ORDER BY rowid - } -} {1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.32.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > -2147483648 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1} -do_test boundary1-2.32.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > -2147483648 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.32.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= -2147483648 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary1-2.32.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= -2147483648 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary1-2.32.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= -2147483648 ORDER BY rowid - } -} {11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.32.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= -2147483648 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11} -do_test boundary1-2.32.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= -2147483648 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.32.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < -2147483648 ORDER BY a - } -} {2 21 44 47 55 58 63 64} -do_test boundary1-2.32.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < -2147483648 ORDER BY a DESC - } -} {64 63 58 55 47 44 21 2} -do_test boundary1-2.32.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < -2147483648 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47} -do_test boundary1-2.32.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < -2147483648 ORDER BY rowid DESC - } -} {47 63 58 44 21 64 2 55} -do_test boundary1-2.32.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < -2147483648 ORDER BY x - } -} {55 2 64 21 44 58 63 47} -do_test boundary1-2.32.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= -2147483648 ORDER BY a - } -} {2 11 21 44 47 55 58 63 64} -do_test boundary1-2.32.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= -2147483648 ORDER BY a DESC - } -} {64 63 58 55 47 44 21 11 2} -do_test boundary1-2.32.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= -2147483648 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11} -do_test boundary1-2.32.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= -2147483648 ORDER BY rowid DESC - } -} {11 47 63 58 44 21 64 2 55} -do_test boundary1-2.32.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= -2147483648 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11} -do_test boundary1-2.33.1 { - db eval { - SELECT * FROM t1 WHERE rowid=34359738367 - } -} {39 00000007ffffffff} -do_test boundary1-2.33.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='00000007ffffffff' - } -} {34359738367 39} -do_test boundary1-2.33.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=39 - } -} {34359738367 00000007ffffffff} -do_test boundary1-2.33.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 34359738367 ORDER BY a - } -} {3 7 10 13 17 19 22 25 26 27 28 34 35 43 45 46 56 57} -do_test boundary1-2.33.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 34359738367 ORDER BY a DESC - } -} {57 56 46 45 43 35 34 28 27 26 25 22 19 17 13 10 7 3} -do_test boundary1-2.33.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 34359738367 ORDER BY rowid - } -} {22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.33.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 34359738367 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22} -do_test boundary1-2.33.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 34359738367 ORDER BY x - } -} {22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.33.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 34359738367 ORDER BY a - } -} {3 7 10 13 17 19 22 25 26 27 28 34 35 39 43 45 46 56 57} -do_test boundary1-2.33.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 34359738367 ORDER BY a DESC - } -} {57 56 46 45 43 39 35 34 28 27 26 25 22 19 17 13 10 7 3} -do_test boundary1-2.33.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 34359738367 ORDER BY rowid - } -} {39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.33.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 34359738367 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39} -do_test boundary1-2.33.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 34359738367 ORDER BY x - } -} {39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.33.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 34359738367 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 23 24 29 30 31 32 33 36 37 38 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.33.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 34359738367 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 38 37 36 33 32 31 30 29 24 23 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary1-2.33.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 34359738367 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36} -do_test boundary1-2.33.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 34359738367 ORDER BY rowid DESC - } -} {36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.33.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 34359738367 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.33.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 34359738367 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 23 24 29 30 31 32 33 36 37 38 39 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.33.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 34359738367 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 39 38 37 36 33 32 31 30 29 24 23 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary1-2.33.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 34359738367 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39} -do_test boundary1-2.33.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 34359738367 ORDER BY rowid DESC - } -} {39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.33.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 34359738367 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.34.1 { - db eval { - SELECT * FROM t1 WHERE rowid=-549755813889 - } -} {58 ffffff7fffffffff} -do_test boundary1-2.34.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='ffffff7fffffffff' - } -} {-549755813889 58} -do_test boundary1-2.34.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=58 - } -} {-549755813889 ffffff7fffffffff} -do_test boundary1-2.34.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > -549755813889 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 47 48 49 50 51 52 53 54 56 57 59 60 61 62 63} -do_test boundary1-2.34.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > -549755813889 ORDER BY a DESC - } -} {63 62 61 60 59 57 56 54 53 52 51 50 49 48 47 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary1-2.34.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > -549755813889 ORDER BY rowid - } -} {63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.34.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > -549755813889 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63} -do_test boundary1-2.34.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > -549755813889 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.34.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= -549755813889 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63} -do_test boundary1-2.34.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= -549755813889 ORDER BY a DESC - } -} {63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary1-2.34.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= -549755813889 ORDER BY rowid - } -} {58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.34.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= -549755813889 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58} -do_test boundary1-2.34.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= -549755813889 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.34.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < -549755813889 ORDER BY a - } -} {2 21 44 55 64} -do_test boundary1-2.34.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < -549755813889 ORDER BY a DESC - } -} {64 55 44 21 2} -do_test boundary1-2.34.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < -549755813889 ORDER BY rowid - } -} {55 2 64 21 44} -do_test boundary1-2.34.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < -549755813889 ORDER BY rowid DESC - } -} {44 21 64 2 55} -do_test boundary1-2.34.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < -549755813889 ORDER BY x - } -} {55 2 64 21 44} -do_test boundary1-2.34.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= -549755813889 ORDER BY a - } -} {2 21 44 55 58 64} -do_test boundary1-2.34.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= -549755813889 ORDER BY a DESC - } -} {64 58 55 44 21 2} -do_test boundary1-2.34.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= -549755813889 ORDER BY rowid - } -} {55 2 64 21 44 58} -do_test boundary1-2.34.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= -549755813889 ORDER BY rowid DESC - } -} {58 44 21 64 2 55} -do_test boundary1-2.34.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= -549755813889 ORDER BY x - } -} {55 2 64 21 44 58} -do_test boundary1-2.35.1 { - db eval { - SELECT * FROM t1 WHERE rowid=-32768 - } -} {32 ffffffffffff8000} -do_test boundary1-2.35.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='ffffffffffff8000' - } -} {-32768 32} -do_test boundary1-2.35.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=32 - } -} {-32768 ffffffffffff8000} -do_test boundary1-2.35.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > -32768 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary1-2.35.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > -32768 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary1-2.35.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > -32768 ORDER BY rowid - } -} {54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.35.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > -32768 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54} -do_test boundary1-2.35.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > -32768 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 54 53 52 33 38} -do_test boundary1-2.35.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= -32768 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 32 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary1-2.35.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= -32768 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 32 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary1-2.35.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= -32768 ORDER BY rowid - } -} {32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.35.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= -32768 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32} -do_test boundary1-2.35.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= -32768 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 32 54 53 52 33 38} -do_test boundary1-2.35.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < -32768 ORDER BY a - } -} {1 2 11 21 29 37 44 47 55 58 63 64} -do_test boundary1-2.35.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < -32768 ORDER BY a DESC - } -} {64 63 58 55 47 44 37 29 21 11 2 1} -do_test boundary1-2.35.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < -32768 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29} -do_test boundary1-2.35.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < -32768 ORDER BY rowid DESC - } -} {29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.35.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < -32768 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29} -do_test boundary1-2.35.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= -32768 ORDER BY a - } -} {1 2 11 21 29 32 37 44 47 55 58 63 64} -do_test boundary1-2.35.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= -32768 ORDER BY a DESC - } -} {64 63 58 55 47 44 37 32 29 21 11 2 1} -do_test boundary1-2.35.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= -32768 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32} -do_test boundary1-2.35.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= -32768 ORDER BY rowid DESC - } -} {32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.35.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= -32768 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32} -do_test boundary1-2.36.1 { - db eval { - SELECT * FROM t1 WHERE rowid=2147483647 - } -} {20 000000007fffffff} -do_test boundary1-2.36.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='000000007fffffff' - } -} {2147483647 20} -do_test boundary1-2.36.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=20 - } -} {2147483647 000000007fffffff} -do_test boundary1-2.36.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 2147483647 ORDER BY a - } -} {3 7 10 13 14 17 19 22 25 26 27 28 34 35 36 39 43 45 46 51 56 57} -do_test boundary1-2.36.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 2147483647 ORDER BY a DESC - } -} {57 56 51 46 45 43 39 36 35 34 28 27 26 25 22 19 17 14 13 10 7 3} -do_test boundary1-2.36.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 2147483647 ORDER BY rowid - } -} {51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.36.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 2147483647 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51} -do_test boundary1-2.36.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 2147483647 ORDER BY x - } -} {51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.36.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 2147483647 ORDER BY a - } -} {3 7 10 13 14 17 19 20 22 25 26 27 28 34 35 36 39 43 45 46 51 56 57} -do_test boundary1-2.36.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 2147483647 ORDER BY a DESC - } -} {57 56 51 46 45 43 39 36 35 34 28 27 26 25 22 20 19 17 14 13 10 7 3} -do_test boundary1-2.36.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 2147483647 ORDER BY rowid - } -} {20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.36.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 2147483647 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20} -do_test boundary1-2.36.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 2147483647 ORDER BY x - } -} {20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.36.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 2147483647 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.36.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 2147483647 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary1-2.36.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 2147483647 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40} -do_test boundary1-2.36.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 2147483647 ORDER BY rowid DESC - } -} {40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.36.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 2147483647 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.36.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 2147483647 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 20 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.36.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 2147483647 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 20 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary1-2.36.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 2147483647 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20} -do_test boundary1-2.36.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 2147483647 ORDER BY rowid DESC - } -} {20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.36.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 2147483647 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.37.1 { - db eval { - SELECT * FROM t1 WHERE rowid=-129 - } -} {54 ffffffffffffff7f} -do_test boundary1-2.37.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='ffffffffffffff7f' - } -} {-129 54} -do_test boundary1-2.37.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=54 - } -} {-129 ffffffffffffff7f} -do_test boundary1-2.37.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > -129 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 56 57 59 60 61 62} -do_test boundary1-2.37.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > -129 ORDER BY a DESC - } -} {62 61 60 59 57 56 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary1-2.37.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > -129 ORDER BY rowid - } -} {53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.37.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > -129 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53} -do_test boundary1-2.37.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > -129 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 53 52 33 38} -do_test boundary1-2.37.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= -129 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary1-2.37.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= -129 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary1-2.37.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= -129 ORDER BY rowid - } -} {54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.37.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= -129 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54} -do_test boundary1-2.37.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= -129 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 54 53 52 33 38} -do_test boundary1-2.37.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < -129 ORDER BY a - } -} {1 2 11 21 29 32 37 44 47 55 58 63 64} -do_test boundary1-2.37.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < -129 ORDER BY a DESC - } -} {64 63 58 55 47 44 37 32 29 21 11 2 1} -do_test boundary1-2.37.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < -129 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32} -do_test boundary1-2.37.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < -129 ORDER BY rowid DESC - } -} {32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.37.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < -129 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32} -do_test boundary1-2.37.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= -129 ORDER BY a - } -} {1 2 11 21 29 32 37 44 47 54 55 58 63 64} -do_test boundary1-2.37.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= -129 ORDER BY a DESC - } -} {64 63 58 55 54 47 44 37 32 29 21 11 2 1} -do_test boundary1-2.37.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= -129 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54} -do_test boundary1-2.37.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= -129 ORDER BY rowid DESC - } -} {54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.37.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= -129 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54} -do_test boundary1-2.38.1 { - db eval { - SELECT * FROM t1 WHERE rowid=-128 - } -} {53 ffffffffffffff80} -do_test boundary1-2.38.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='ffffffffffffff80' - } -} {-128 53} -do_test boundary1-2.38.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=53 - } -} {-128 ffffffffffffff80} -do_test boundary1-2.38.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > -128 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 56 57 59 60 61 62} -do_test boundary1-2.38.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > -128 ORDER BY a DESC - } -} {62 61 60 59 57 56 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary1-2.38.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > -128 ORDER BY rowid - } -} {52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.38.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > -128 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52} -do_test boundary1-2.38.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > -128 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 52 33 38} -do_test boundary1-2.38.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= -128 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 56 57 59 60 61 62} -do_test boundary1-2.38.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= -128 ORDER BY a DESC - } -} {62 61 60 59 57 56 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary1-2.38.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= -128 ORDER BY rowid - } -} {53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.38.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= -128 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53} -do_test boundary1-2.38.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= -128 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 53 52 33 38} -do_test boundary1-2.38.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < -128 ORDER BY a - } -} {1 2 11 21 29 32 37 44 47 54 55 58 63 64} -do_test boundary1-2.38.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < -128 ORDER BY a DESC - } -} {64 63 58 55 54 47 44 37 32 29 21 11 2 1} -do_test boundary1-2.38.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < -128 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54} -do_test boundary1-2.38.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < -128 ORDER BY rowid DESC - } -} {54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.38.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < -128 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54} -do_test boundary1-2.38.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= -128 ORDER BY a - } -} {1 2 11 21 29 32 37 44 47 53 54 55 58 63 64} -do_test boundary1-2.38.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= -128 ORDER BY a DESC - } -} {64 63 58 55 54 53 47 44 37 32 29 21 11 2 1} -do_test boundary1-2.38.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= -128 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53} -do_test boundary1-2.38.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= -128 ORDER BY rowid DESC - } -} {53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.38.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= -128 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53} -do_test boundary1-2.39.1 { - db eval { - SELECT * FROM t1 WHERE rowid=72057594037927936 - } -} {28 0100000000000000} -do_test boundary1-2.39.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='0100000000000000' - } -} {72057594037927936 28} -do_test boundary1-2.39.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=28 - } -} {72057594037927936 0100000000000000} -do_test boundary1-2.39.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 72057594037927936 ORDER BY a - } -} {3} -do_test boundary1-2.39.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 72057594037927936 ORDER BY a DESC - } -} {3} -do_test boundary1-2.39.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 72057594037927936 ORDER BY rowid - } -} {3} -do_test boundary1-2.39.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 72057594037927936 ORDER BY rowid DESC - } -} {3} -do_test boundary1-2.39.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 72057594037927936 ORDER BY x - } -} {3} -do_test boundary1-2.39.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 72057594037927936 ORDER BY a - } -} {3 28} -do_test boundary1-2.39.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 72057594037927936 ORDER BY a DESC - } -} {28 3} -do_test boundary1-2.39.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 72057594037927936 ORDER BY rowid - } -} {28 3} -do_test boundary1-2.39.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 72057594037927936 ORDER BY rowid DESC - } -} {3 28} -do_test boundary1-2.39.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 72057594037927936 ORDER BY x - } -} {28 3} -do_test boundary1-2.39.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 72057594037927936 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.39.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 72057594037927936 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary1-2.39.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 72057594037927936 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17} -do_test boundary1-2.39.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 72057594037927936 ORDER BY rowid DESC - } -} {17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.39.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 72057594037927936 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.39.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 72057594037927936 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.39.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 72057594037927936 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary1-2.39.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 72057594037927936 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28} -do_test boundary1-2.39.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 72057594037927936 ORDER BY rowid DESC - } -} {28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.39.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 72057594037927936 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.40.1 { - db eval { - SELECT * FROM t1 WHERE rowid=2147483648 - } -} {51 0000000080000000} -do_test boundary1-2.40.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='0000000080000000' - } -} {2147483648 51} -do_test boundary1-2.40.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=51 - } -} {2147483648 0000000080000000} -do_test boundary1-2.40.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 2147483648 ORDER BY a - } -} {3 7 10 13 14 17 19 22 25 26 27 28 34 35 36 39 43 45 46 56 57} -do_test boundary1-2.40.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 2147483648 ORDER BY a DESC - } -} {57 56 46 45 43 39 36 35 34 28 27 26 25 22 19 17 14 13 10 7 3} -do_test boundary1-2.40.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 2147483648 ORDER BY rowid - } -} {14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.40.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 2147483648 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14} -do_test boundary1-2.40.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 2147483648 ORDER BY x - } -} {14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.40.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 2147483648 ORDER BY a - } -} {3 7 10 13 14 17 19 22 25 26 27 28 34 35 36 39 43 45 46 51 56 57} -do_test boundary1-2.40.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 2147483648 ORDER BY a DESC - } -} {57 56 51 46 45 43 39 36 35 34 28 27 26 25 22 19 17 14 13 10 7 3} -do_test boundary1-2.40.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 2147483648 ORDER BY rowid - } -} {51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.40.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 2147483648 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51} -do_test boundary1-2.40.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 2147483648 ORDER BY x - } -} {51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.40.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 2147483648 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 20 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.40.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 2147483648 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 20 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary1-2.40.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 2147483648 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20} -do_test boundary1-2.40.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 2147483648 ORDER BY rowid DESC - } -} {20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.40.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 2147483648 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.40.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 2147483648 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 20 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.40.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 2147483648 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 20 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary1-2.40.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 2147483648 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51} -do_test boundary1-2.40.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 2147483648 ORDER BY rowid DESC - } -} {51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.40.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 2147483648 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.41.1 { - db eval { - SELECT * FROM t1 WHERE rowid=549755813887 - } -} {46 0000007fffffffff} -do_test boundary1-2.41.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='0000007fffffffff' - } -} {549755813887 46} -do_test boundary1-2.41.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=46 - } -} {549755813887 0000007fffffffff} -do_test boundary1-2.41.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 549755813887 ORDER BY a - } -} {3 7 10 13 17 19 25 26 27 28 34 35 43 45 56 57} -do_test boundary1-2.41.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 549755813887 ORDER BY a DESC - } -} {57 56 45 43 35 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary1-2.41.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 549755813887 ORDER BY rowid - } -} {35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.41.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 549755813887 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35} -do_test boundary1-2.41.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 549755813887 ORDER BY x - } -} {35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.41.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 549755813887 ORDER BY a - } -} {3 7 10 13 17 19 25 26 27 28 34 35 43 45 46 56 57} -do_test boundary1-2.41.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 549755813887 ORDER BY a DESC - } -} {57 56 46 45 43 35 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary1-2.41.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 549755813887 ORDER BY rowid - } -} {46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.41.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 549755813887 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46} -do_test boundary1-2.41.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 549755813887 ORDER BY x - } -} {46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.41.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 549755813887 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 36 37 38 39 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.41.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 549755813887 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 39 38 37 36 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary1-2.41.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 549755813887 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22} -do_test boundary1-2.41.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 549755813887 ORDER BY rowid DESC - } -} {22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.41.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 549755813887 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.41.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 549755813887 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.41.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 549755813887 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary1-2.41.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 549755813887 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46} -do_test boundary1-2.41.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 549755813887 ORDER BY rowid DESC - } -} {46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.41.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 549755813887 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.42.1 { - db eval { - SELECT * FROM t1 WHERE rowid=-549755813888 - } -} {63 ffffff8000000000} -do_test boundary1-2.42.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='ffffff8000000000' - } -} {-549755813888 63} -do_test boundary1-2.42.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=63 - } -} {-549755813888 ffffff8000000000} -do_test boundary1-2.42.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > -549755813888 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 47 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary1-2.42.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > -549755813888 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 47 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary1-2.42.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > -549755813888 ORDER BY rowid - } -} {47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.42.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > -549755813888 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47} -do_test boundary1-2.42.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > -549755813888 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.42.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= -549755813888 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 47 48 49 50 51 52 53 54 56 57 59 60 61 62 63} -do_test boundary1-2.42.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= -549755813888 ORDER BY a DESC - } -} {63 62 61 60 59 57 56 54 53 52 51 50 49 48 47 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary1-2.42.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= -549755813888 ORDER BY rowid - } -} {63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.42.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= -549755813888 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63} -do_test boundary1-2.42.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= -549755813888 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.42.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < -549755813888 ORDER BY a - } -} {2 21 44 55 58 64} -do_test boundary1-2.42.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < -549755813888 ORDER BY a DESC - } -} {64 58 55 44 21 2} -do_test boundary1-2.42.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < -549755813888 ORDER BY rowid - } -} {55 2 64 21 44 58} -do_test boundary1-2.42.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < -549755813888 ORDER BY rowid DESC - } -} {58 44 21 64 2 55} -do_test boundary1-2.42.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < -549755813888 ORDER BY x - } -} {55 2 64 21 44 58} -do_test boundary1-2.42.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= -549755813888 ORDER BY a - } -} {2 21 44 55 58 63 64} -do_test boundary1-2.42.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= -549755813888 ORDER BY a DESC - } -} {64 63 58 55 44 21 2} -do_test boundary1-2.42.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= -549755813888 ORDER BY rowid - } -} {55 2 64 21 44 58 63} -do_test boundary1-2.42.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= -549755813888 ORDER BY rowid DESC - } -} {63 58 44 21 64 2 55} -do_test boundary1-2.42.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= -549755813888 ORDER BY x - } -} {55 2 64 21 44 58 63} -do_test boundary1-2.43.1 { - db eval { - SELECT * FROM t1 WHERE rowid=281474976710655 - } -} {10 0000ffffffffffff} -do_test boundary1-2.43.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='0000ffffffffffff' - } -} {281474976710655 10} -do_test boundary1-2.43.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=10 - } -} {281474976710655 0000ffffffffffff} -do_test boundary1-2.43.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 281474976710655 ORDER BY a - } -} {3 13 17 26 27 28 43 45} -do_test boundary1-2.43.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 281474976710655 ORDER BY a DESC - } -} {45 43 28 27 26 17 13 3} -do_test boundary1-2.43.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 281474976710655 ORDER BY rowid - } -} {26 13 43 27 45 17 28 3} -do_test boundary1-2.43.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 281474976710655 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26} -do_test boundary1-2.43.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 281474976710655 ORDER BY x - } -} {26 13 43 27 45 17 28 3} -do_test boundary1-2.43.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 281474976710655 ORDER BY a - } -} {3 10 13 17 26 27 28 43 45} -do_test boundary1-2.43.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 281474976710655 ORDER BY a DESC - } -} {45 43 28 27 26 17 13 10 3} -do_test boundary1-2.43.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 281474976710655 ORDER BY rowid - } -} {10 26 13 43 27 45 17 28 3} -do_test boundary1-2.43.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 281474976710655 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10} -do_test boundary1-2.43.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 281474976710655 ORDER BY x - } -} {10 26 13 43 27 45 17 28 3} -do_test boundary1-2.43.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 281474976710655 ORDER BY a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 25 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.43.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 281474976710655 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 25 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary1-2.43.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 281474976710655 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34} -do_test boundary1-2.43.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 281474976710655 ORDER BY rowid DESC - } -} {34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.43.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 281474976710655 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.43.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 281474976710655 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 14 15 16 18 19 20 21 22 23 24 25 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.43.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 281474976710655 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 25 24 23 22 21 20 19 18 16 15 14 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary1-2.43.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 281474976710655 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10} -do_test boundary1-2.43.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 281474976710655 ORDER BY rowid DESC - } -} {10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.43.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 281474976710655 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.44.1 { - db eval { - SELECT * FROM t1 WHERE rowid=4398046511103 - } -} {7 000003ffffffffff} -do_test boundary1-2.44.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='000003ffffffffff' - } -} {4398046511103 7} -do_test boundary1-2.44.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=7 - } -} {4398046511103 000003ffffffffff} -do_test boundary1-2.44.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 4398046511103 ORDER BY a - } -} {3 10 13 17 25 26 27 28 34 43 45 56} -do_test boundary1-2.44.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 4398046511103 ORDER BY a DESC - } -} {56 45 43 34 28 27 26 25 17 13 10 3} -do_test boundary1-2.44.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 4398046511103 ORDER BY rowid - } -} {56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.44.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 4398046511103 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56} -do_test boundary1-2.44.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 4398046511103 ORDER BY x - } -} {56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.44.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 4398046511103 ORDER BY a - } -} {3 7 10 13 17 25 26 27 28 34 43 45 56} -do_test boundary1-2.44.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 4398046511103 ORDER BY a DESC - } -} {56 45 43 34 28 27 26 25 17 13 10 7 3} -do_test boundary1-2.44.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 4398046511103 ORDER BY rowid - } -} {7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.44.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 4398046511103 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7} -do_test boundary1-2.44.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 4398046511103 ORDER BY x - } -} {7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.44.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 4398046511103 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 19 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 57 58 59 60 61 62 63 64} -do_test boundary1-2.44.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 4398046511103 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 19 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary1-2.44.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 4398046511103 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19} -do_test boundary1-2.44.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 4398046511103 ORDER BY rowid DESC - } -} {19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.44.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 4398046511103 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.44.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 4398046511103 ORDER BY a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 57 58 59 60 61 62 63 64} -do_test boundary1-2.44.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 4398046511103 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary1-2.44.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 4398046511103 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7} -do_test boundary1-2.44.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 4398046511103 ORDER BY rowid DESC - } -} {7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.44.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 4398046511103 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.45.1 { - db eval { - SELECT * FROM t1 WHERE rowid=268435455 - } -} {12 000000000fffffff} -do_test boundary1-2.45.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='000000000fffffff' - } -} {268435455 12} -do_test boundary1-2.45.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=12 - } -} {268435455 000000000fffffff} -do_test boundary1-2.45.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 268435455 ORDER BY a - } -} {3 7 10 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary1-2.45.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 268435455 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 10 7 3} -do_test boundary1-2.45.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 268435455 ORDER BY rowid - } -} {40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.45.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 268435455 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40} -do_test boundary1-2.45.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 268435455 ORDER BY x - } -} {40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.45.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 268435455 ORDER BY a - } -} {3 7 10 12 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary1-2.45.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 268435455 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 12 10 7 3} -do_test boundary1-2.45.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 268435455 ORDER BY rowid - } -} {12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.45.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 268435455 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12} -do_test boundary1-2.45.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 268435455 ORDER BY x - } -} {12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.45.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 268435455 ORDER BY a - } -} {1 2 4 5 6 8 9 11 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.45.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 268435455 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 11 9 8 6 5 4 2 1} -do_test boundary1-2.45.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 268435455 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6} -do_test boundary1-2.45.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 268435455 ORDER BY rowid DESC - } -} {6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.45.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 268435455 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.45.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 268435455 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.45.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 268435455 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary1-2.45.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 268435455 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12} -do_test boundary1-2.45.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 268435455 ORDER BY rowid DESC - } -} {12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.45.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 268435455 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.46.1 { - db eval { - SELECT * FROM t1 WHERE rowid=-9223372036854775808 - } -} {55 8000000000000000} -do_test boundary1-2.46.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='8000000000000000' - } -} {-9223372036854775808 55} -do_test boundary1-2.46.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=55 - } -} {-9223372036854775808 8000000000000000} -do_test boundary1-2.46.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > -9223372036854775808 ORDER BY a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.46.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > -9223372036854775808 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary1-2.46.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > -9223372036854775808 ORDER BY rowid - } -} {2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.46.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > -9223372036854775808 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2} -do_test boundary1-2.46.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > -9223372036854775808 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.46.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= -9223372036854775808 ORDER BY a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.46.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= -9223372036854775808 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary1-2.46.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= -9223372036854775808 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.46.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= -9223372036854775808 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.46.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= -9223372036854775808 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.46.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < -9223372036854775808 ORDER BY a - } -} {} -do_test boundary1-2.46.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < -9223372036854775808 ORDER BY a DESC - } -} {} -do_test boundary1-2.46.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < -9223372036854775808 ORDER BY rowid - } -} {} -do_test boundary1-2.46.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < -9223372036854775808 ORDER BY rowid DESC - } -} {} -do_test boundary1-2.46.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < -9223372036854775808 ORDER BY x - } -} {} -do_test boundary1-2.46.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= -9223372036854775808 ORDER BY a - } -} {55} -do_test boundary1-2.46.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= -9223372036854775808 ORDER BY a DESC - } -} {55} -do_test boundary1-2.46.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= -9223372036854775808 ORDER BY rowid - } -} {55} -do_test boundary1-2.46.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= -9223372036854775808 ORDER BY rowid DESC - } -} {55} -do_test boundary1-2.46.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= -9223372036854775808 ORDER BY x - } -} {55} -do_test boundary1-2.47.1 { - db eval { - SELECT * FROM t1 WHERE rowid=562949953421312 - } -} {43 0002000000000000} -do_test boundary1-2.47.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='0002000000000000' - } -} {562949953421312 43} -do_test boundary1-2.47.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=43 - } -} {562949953421312 0002000000000000} -do_test boundary1-2.47.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 562949953421312 ORDER BY a - } -} {3 17 27 28 45} -do_test boundary1-2.47.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 562949953421312 ORDER BY a DESC - } -} {45 28 27 17 3} -do_test boundary1-2.47.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 562949953421312 ORDER BY rowid - } -} {27 45 17 28 3} -do_test boundary1-2.47.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 562949953421312 ORDER BY rowid DESC - } -} {3 28 17 45 27} -do_test boundary1-2.47.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 562949953421312 ORDER BY x - } -} {27 45 17 28 3} -do_test boundary1-2.47.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 562949953421312 ORDER BY a - } -} {3 17 27 28 43 45} -do_test boundary1-2.47.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 562949953421312 ORDER BY a DESC - } -} {45 43 28 27 17 3} -do_test boundary1-2.47.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 562949953421312 ORDER BY rowid - } -} {43 27 45 17 28 3} -do_test boundary1-2.47.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 562949953421312 ORDER BY rowid DESC - } -} {3 28 17 45 27 43} -do_test boundary1-2.47.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 562949953421312 ORDER BY x - } -} {43 27 45 17 28 3} -do_test boundary1-2.47.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 562949953421312 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.47.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 562949953421312 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary1-2.47.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 562949953421312 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13} -do_test boundary1-2.47.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 562949953421312 ORDER BY rowid DESC - } -} {13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.47.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 562949953421312 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.47.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 562949953421312 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.47.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 562949953421312 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary1-2.47.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 562949953421312 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43} -do_test boundary1-2.47.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 562949953421312 ORDER BY rowid DESC - } -} {43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.47.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 562949953421312 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.48.1 { - db eval { - SELECT * FROM t1 WHERE rowid=-8388609 - } -} {1 ffffffffff7fffff} -do_test boundary1-2.48.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='ffffffffff7fffff' - } -} {-8388609 1} -do_test boundary1-2.48.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=1 - } -} {-8388609 ffffffffff7fffff} -do_test boundary1-2.48.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > -8388609 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary1-2.48.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > -8388609 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary1-2.48.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > -8388609 ORDER BY rowid - } -} {37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.48.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > -8388609 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37} -do_test boundary1-2.48.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > -8388609 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 37 29 32 54 53 52 33 38} -do_test boundary1-2.48.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= -8388609 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary1-2.48.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= -8388609 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3 1} -do_test boundary1-2.48.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= -8388609 ORDER BY rowid - } -} {1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.48.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= -8388609 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1} -do_test boundary1-2.48.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= -8388609 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.48.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < -8388609 ORDER BY a - } -} {2 11 21 44 47 55 58 63 64} -do_test boundary1-2.48.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < -8388609 ORDER BY a DESC - } -} {64 63 58 55 47 44 21 11 2} -do_test boundary1-2.48.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < -8388609 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11} -do_test boundary1-2.48.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < -8388609 ORDER BY rowid DESC - } -} {11 47 63 58 44 21 64 2 55} -do_test boundary1-2.48.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < -8388609 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11} -do_test boundary1-2.48.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= -8388609 ORDER BY a - } -} {1 2 11 21 44 47 55 58 63 64} -do_test boundary1-2.48.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= -8388609 ORDER BY a DESC - } -} {64 63 58 55 47 44 21 11 2 1} -do_test boundary1-2.48.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= -8388609 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1} -do_test boundary1-2.48.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= -8388609 ORDER BY rowid DESC - } -} {1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.48.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= -8388609 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1} -do_test boundary1-2.49.1 { - db eval { - SELECT * FROM t1 WHERE rowid=16777215 - } -} {9 0000000000ffffff} -do_test boundary1-2.49.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='0000000000ffffff' - } -} {16777215 9} -do_test boundary1-2.49.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=9 - } -} {16777215 0000000000ffffff} -do_test boundary1-2.49.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 16777215 ORDER BY a - } -} {3 6 7 10 12 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary1-2.49.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 16777215 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 12 10 7 6 3} -do_test boundary1-2.49.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 16777215 ORDER BY rowid - } -} {6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.49.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 16777215 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6} -do_test boundary1-2.49.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 16777215 ORDER BY x - } -} {6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.49.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 16777215 ORDER BY a - } -} {3 6 7 9 10 12 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary1-2.49.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 16777215 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 12 10 9 7 6 3} -do_test boundary1-2.49.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 16777215 ORDER BY rowid - } -} {9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.49.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 16777215 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9} -do_test boundary1-2.49.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 16777215 ORDER BY x - } -} {9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.49.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 16777215 ORDER BY a - } -} {1 2 4 5 8 11 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.49.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 16777215 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 11 8 5 4 2 1} -do_test boundary1-2.49.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 16777215 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24} -do_test boundary1-2.49.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 16777215 ORDER BY rowid DESC - } -} {24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.49.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 16777215 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.49.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 16777215 ORDER BY a - } -} {1 2 4 5 8 9 11 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.49.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 16777215 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 11 9 8 5 4 2 1} -do_test boundary1-2.49.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 16777215 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9} -do_test boundary1-2.49.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 16777215 ORDER BY rowid DESC - } -} {9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.49.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 16777215 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.50.1 { - db eval { - SELECT * FROM t1 WHERE rowid=8388608 - } -} {24 0000000000800000} -do_test boundary1-2.50.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='0000000000800000' - } -} {8388608 24} -do_test boundary1-2.50.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=24 - } -} {8388608 0000000000800000} -do_test boundary1-2.50.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 8388608 ORDER BY a - } -} {3 6 7 9 10 12 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary1-2.50.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 8388608 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 12 10 9 7 6 3} -do_test boundary1-2.50.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 8388608 ORDER BY rowid - } -} {9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.50.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 8388608 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9} -do_test boundary1-2.50.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 8388608 ORDER BY x - } -} {9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.50.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 8388608 ORDER BY a - } -} {3 6 7 9 10 12 13 14 17 19 20 22 24 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary1-2.50.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 8388608 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 24 22 20 19 17 14 13 12 10 9 7 6 3} -do_test boundary1-2.50.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 8388608 ORDER BY rowid - } -} {24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.50.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 8388608 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24} -do_test boundary1-2.50.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 8388608 ORDER BY x - } -} {24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.50.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 8388608 ORDER BY a - } -} {1 2 4 5 8 11 15 16 18 21 23 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.50.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 8388608 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 23 21 18 16 15 11 8 5 4 2 1} -do_test boundary1-2.50.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 8388608 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18} -do_test boundary1-2.50.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 8388608 ORDER BY rowid DESC - } -} {18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.50.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 8388608 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.50.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 8388608 ORDER BY a - } -} {1 2 4 5 8 11 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.50.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 8388608 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 11 8 5 4 2 1} -do_test boundary1-2.50.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 8388608 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24} -do_test boundary1-2.50.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 8388608 ORDER BY rowid DESC - } -} {24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.50.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 8388608 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.51.1 { - db eval { - SELECT * FROM t1 WHERE rowid=16383 - } -} {8 0000000000003fff} -do_test boundary1-2.51.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='0000000000003fff' - } -} {16383 8} -do_test boundary1-2.51.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=8 - } -} {16383 0000000000003fff} -do_test boundary1-2.51.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 16383 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary1-2.51.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 16383 ORDER BY a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 7 6 3} -do_test boundary1-2.51.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 16383 ORDER BY rowid - } -} {16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.51.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 16383 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16} -do_test boundary1-2.51.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 16383 ORDER BY x - } -} {16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.51.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 16383 ORDER BY a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary1-2.51.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 16383 ORDER BY a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary1-2.51.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 16383 ORDER BY rowid - } -} {8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.51.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 16383 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8} -do_test boundary1-2.51.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 16383 ORDER BY x - } -} {8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.51.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 16383 ORDER BY a - } -} {1 2 4 5 11 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary1-2.51.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 16383 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 11 5 4 2 1} -do_test boundary1-2.51.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 16383 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61} -do_test boundary1-2.51.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 16383 ORDER BY rowid DESC - } -} {61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.51.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 16383 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.51.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 16383 ORDER BY a - } -} {1 2 4 5 8 11 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary1-2.51.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 16383 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 11 8 5 4 2 1} -do_test boundary1-2.51.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 16383 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8} -do_test boundary1-2.51.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 16383 ORDER BY rowid DESC - } -} {8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.51.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 16383 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.52.1 { - db eval { - SELECT * FROM t1 WHERE rowid=140737488355328 - } -} {34 0000800000000000} -do_test boundary1-2.52.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='0000800000000000' - } -} {140737488355328 34} -do_test boundary1-2.52.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=34 - } -} {140737488355328 0000800000000000} -do_test boundary1-2.52.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 140737488355328 ORDER BY a - } -} {3 10 13 17 26 27 28 43 45} -do_test boundary1-2.52.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 140737488355328 ORDER BY a DESC - } -} {45 43 28 27 26 17 13 10 3} -do_test boundary1-2.52.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 140737488355328 ORDER BY rowid - } -} {10 26 13 43 27 45 17 28 3} -do_test boundary1-2.52.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 140737488355328 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10} -do_test boundary1-2.52.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 140737488355328 ORDER BY x - } -} {10 26 13 43 27 45 17 28 3} -do_test boundary1-2.52.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 140737488355328 ORDER BY a - } -} {3 10 13 17 26 27 28 34 43 45} -do_test boundary1-2.52.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 140737488355328 ORDER BY a DESC - } -} {45 43 34 28 27 26 17 13 10 3} -do_test boundary1-2.52.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 140737488355328 ORDER BY rowid - } -} {34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.52.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 140737488355328 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34} -do_test boundary1-2.52.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 140737488355328 ORDER BY x - } -} {34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.52.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 140737488355328 ORDER BY a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 25 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.52.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 140737488355328 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 25 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary1-2.52.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 140737488355328 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25} -do_test boundary1-2.52.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 140737488355328 ORDER BY rowid DESC - } -} {25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.52.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 140737488355328 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.52.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 140737488355328 ORDER BY a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 25 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.52.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 140737488355328 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 25 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary1-2.52.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 140737488355328 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34} -do_test boundary1-2.52.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 140737488355328 ORDER BY rowid DESC - } -} {34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.52.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 140737488355328 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.53.1 { - db eval { - SELECT * FROM t1 WHERE rowid=2097151 - } -} {15 00000000001fffff} -do_test boundary1-2.53.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='00000000001fffff' - } -} {2097151 15} -do_test boundary1-2.53.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=15 - } -} {2097151 00000000001fffff} -do_test boundary1-2.53.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 2097151 ORDER BY a - } -} {3 6 7 9 10 12 13 14 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 51 56 57} -do_test boundary1-2.53.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 2097151 ORDER BY a DESC - } -} {57 56 51 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 14 13 12 10 9 7 6 3} -do_test boundary1-2.53.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 2097151 ORDER BY rowid - } -} {42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.53.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 2097151 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42} -do_test boundary1-2.53.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 2097151 ORDER BY x - } -} {42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.53.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 2097151 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 51 56 57} -do_test boundary1-2.53.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 2097151 ORDER BY a DESC - } -} {57 56 51 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary1-2.53.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 2097151 ORDER BY rowid - } -} {15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.53.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 2097151 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15} -do_test boundary1-2.53.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 2097151 ORDER BY x - } -} {15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.53.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 2097151 ORDER BY a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.53.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 2097151 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary1-2.53.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 2097151 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62} -do_test boundary1-2.53.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 2097151 ORDER BY rowid DESC - } -} {62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.53.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 2097151 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.53.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 2097151 ORDER BY a - } -} {1 2 4 5 8 11 15 16 21 23 29 30 31 32 33 37 38 41 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary1-2.53.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 2097151 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 41 38 37 33 32 31 30 29 23 21 16 15 11 8 5 4 2 1} -do_test boundary1-2.53.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 2097151 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15} -do_test boundary1-2.53.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 2097151 ORDER BY rowid DESC - } -} {15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.53.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 2097151 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.54.1 { - db eval { - SELECT * FROM t1 WHERE rowid=140737488355327 - } -} {25 00007fffffffffff} -do_test boundary1-2.54.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='00007fffffffffff' - } -} {140737488355327 25} -do_test boundary1-2.54.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=25 - } -} {140737488355327 00007fffffffffff} -do_test boundary1-2.54.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 140737488355327 ORDER BY a - } -} {3 10 13 17 26 27 28 34 43 45} -do_test boundary1-2.54.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 140737488355327 ORDER BY a DESC - } -} {45 43 34 28 27 26 17 13 10 3} -do_test boundary1-2.54.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 140737488355327 ORDER BY rowid - } -} {34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.54.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 140737488355327 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34} -do_test boundary1-2.54.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 140737488355327 ORDER BY x - } -} {34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.54.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 140737488355327 ORDER BY a - } -} {3 10 13 17 25 26 27 28 34 43 45} -do_test boundary1-2.54.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 140737488355327 ORDER BY a DESC - } -} {45 43 34 28 27 26 25 17 13 10 3} -do_test boundary1-2.54.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 140737488355327 ORDER BY rowid - } -} {25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.54.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 140737488355327 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25} -do_test boundary1-2.54.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 140737488355327 ORDER BY x - } -} {25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.54.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 140737488355327 ORDER BY a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.54.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 140737488355327 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary1-2.54.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 140737488355327 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56} -do_test boundary1-2.54.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 140737488355327 ORDER BY rowid DESC - } -} {56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.54.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 140737488355327 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.54.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 140737488355327 ORDER BY a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 25 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.54.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 140737488355327 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 25 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary1-2.54.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 140737488355327 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25} -do_test boundary1-2.54.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 140737488355327 ORDER BY rowid DESC - } -} {25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.54.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 140737488355327 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.55.1 { - db eval { - SELECT * FROM t1 WHERE rowid=281474976710656 - } -} {26 0001000000000000} -do_test boundary1-2.55.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='0001000000000000' - } -} {281474976710656 26} -do_test boundary1-2.55.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=26 - } -} {281474976710656 0001000000000000} -do_test boundary1-2.55.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 281474976710656 ORDER BY a - } -} {3 13 17 27 28 43 45} -do_test boundary1-2.55.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 281474976710656 ORDER BY a DESC - } -} {45 43 28 27 17 13 3} -do_test boundary1-2.55.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 281474976710656 ORDER BY rowid - } -} {13 43 27 45 17 28 3} -do_test boundary1-2.55.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 281474976710656 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13} -do_test boundary1-2.55.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 281474976710656 ORDER BY x - } -} {13 43 27 45 17 28 3} -do_test boundary1-2.55.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 281474976710656 ORDER BY a - } -} {3 13 17 26 27 28 43 45} -do_test boundary1-2.55.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 281474976710656 ORDER BY a DESC - } -} {45 43 28 27 26 17 13 3} -do_test boundary1-2.55.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 281474976710656 ORDER BY rowid - } -} {26 13 43 27 45 17 28 3} -do_test boundary1-2.55.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 281474976710656 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26} -do_test boundary1-2.55.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 281474976710656 ORDER BY x - } -} {26 13 43 27 45 17 28 3} -do_test boundary1-2.55.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 281474976710656 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 14 15 16 18 19 20 21 22 23 24 25 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.55.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 281474976710656 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 25 24 23 22 21 20 19 18 16 15 14 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary1-2.55.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 281474976710656 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10} -do_test boundary1-2.55.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 281474976710656 ORDER BY rowid DESC - } -} {10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.55.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 281474976710656 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.55.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 281474976710656 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 14 15 16 18 19 20 21 22 23 24 25 26 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.55.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 281474976710656 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 26 25 24 23 22 21 20 19 18 16 15 14 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary1-2.55.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 281474976710656 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26} -do_test boundary1-2.55.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 281474976710656 ORDER BY rowid DESC - } -} {26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.55.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 281474976710656 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.56.1 { - db eval { - SELECT * FROM t1 WHERE rowid=32767 - } -} {23 0000000000007fff} -do_test boundary1-2.56.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='0000000000007fff' - } -} {32767 23} -do_test boundary1-2.56.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=23 - } -} {32767 0000000000007fff} -do_test boundary1-2.56.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 32767 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary1-2.56.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 32767 ORDER BY a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary1-2.56.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 32767 ORDER BY rowid - } -} {50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.56.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 32767 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50} -do_test boundary1-2.56.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 32767 ORDER BY x - } -} {50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.56.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 32767 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary1-2.56.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 32767 ORDER BY a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary1-2.56.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 32767 ORDER BY rowid - } -} {23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.56.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 32767 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23} -do_test boundary1-2.56.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 32767 ORDER BY x - } -} {23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.56.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 32767 ORDER BY a - } -} {1 2 4 5 8 11 16 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary1-2.56.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 32767 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 16 11 8 5 4 2 1} -do_test boundary1-2.56.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 32767 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16} -do_test boundary1-2.56.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 32767 ORDER BY rowid DESC - } -} {16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.56.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 32767 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.56.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 32767 ORDER BY a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary1-2.56.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 32767 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary1-2.56.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 32767 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23} -do_test boundary1-2.56.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 32767 ORDER BY rowid DESC - } -} {23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.56.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 32767 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.57.1 { - db eval { - SELECT * FROM t1 WHERE rowid=127 - } -} {4 000000000000007f} -do_test boundary1-2.57.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='000000000000007f' - } -} {127 4} -do_test boundary1-2.57.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=4 - } -} {127 000000000000007f} -do_test boundary1-2.57.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 127 ORDER BY a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary1-2.57.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 127 ORDER BY a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary1-2.57.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 127 ORDER BY rowid - } -} {49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.57.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 127 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49} -do_test boundary1-2.57.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 127 ORDER BY x - } -} {49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.57.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 127 ORDER BY a - } -} {3 4 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary1-2.57.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 127 ORDER BY a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 4 3} -do_test boundary1-2.57.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 127 ORDER BY rowid - } -} {4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.57.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 127 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4} -do_test boundary1-2.57.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 127 ORDER BY x - } -} {4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.57.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 127 ORDER BY a - } -} {1 2 5 11 21 29 31 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary1-2.57.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 127 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 31 29 21 11 5 2 1} -do_test boundary1-2.57.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 127 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31} -do_test boundary1-2.57.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 127 ORDER BY rowid DESC - } -} {31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.57.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 127 ORDER BY x - } -} {59 60 41 5 31 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.57.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 127 ORDER BY a - } -} {1 2 4 5 11 21 29 31 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary1-2.57.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 127 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 31 29 21 11 5 4 2 1} -do_test boundary1-2.57.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 127 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4} -do_test boundary1-2.57.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 127 ORDER BY rowid DESC - } -} {4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.57.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 127 ORDER BY x - } -} {59 60 41 5 31 4 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.58.1 { - db eval { - SELECT * FROM t1 WHERE rowid=36028797018963967 - } -} {27 007fffffffffffff} -do_test boundary1-2.58.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='007fffffffffffff' - } -} {36028797018963967 27} -do_test boundary1-2.58.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=27 - } -} {36028797018963967 007fffffffffffff} -do_test boundary1-2.58.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 36028797018963967 ORDER BY a - } -} {3 17 28 45} -do_test boundary1-2.58.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 36028797018963967 ORDER BY a DESC - } -} {45 28 17 3} -do_test boundary1-2.58.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 36028797018963967 ORDER BY rowid - } -} {45 17 28 3} -do_test boundary1-2.58.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 36028797018963967 ORDER BY rowid DESC - } -} {3 28 17 45} -do_test boundary1-2.58.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 36028797018963967 ORDER BY x - } -} {45 17 28 3} -do_test boundary1-2.58.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 36028797018963967 ORDER BY a - } -} {3 17 27 28 45} -do_test boundary1-2.58.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 36028797018963967 ORDER BY a DESC - } -} {45 28 27 17 3} -do_test boundary1-2.58.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 36028797018963967 ORDER BY rowid - } -} {27 45 17 28 3} -do_test boundary1-2.58.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 36028797018963967 ORDER BY rowid DESC - } -} {3 28 17 45 27} -do_test boundary1-2.58.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 36028797018963967 ORDER BY x - } -} {27 45 17 28 3} -do_test boundary1-2.58.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 36028797018963967 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.58.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 36028797018963967 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary1-2.58.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 36028797018963967 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43} -do_test boundary1-2.58.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 36028797018963967 ORDER BY rowid DESC - } -} {43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.58.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 36028797018963967 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.58.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 36028797018963967 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.58.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 36028797018963967 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 27 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary1-2.58.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 36028797018963967 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27} -do_test boundary1-2.58.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 36028797018963967 ORDER BY rowid DESC - } -} {27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.58.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 36028797018963967 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.59.1 { - db eval { - SELECT * FROM t1 WHERE rowid=4398046511104 - } -} {56 0000040000000000} -do_test boundary1-2.59.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='0000040000000000' - } -} {4398046511104 56} -do_test boundary1-2.59.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=56 - } -} {4398046511104 0000040000000000} -do_test boundary1-2.59.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 4398046511104 ORDER BY a - } -} {3 10 13 17 25 26 27 28 34 43 45} -do_test boundary1-2.59.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 4398046511104 ORDER BY a DESC - } -} {45 43 34 28 27 26 25 17 13 10 3} -do_test boundary1-2.59.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 4398046511104 ORDER BY rowid - } -} {25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.59.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 4398046511104 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25} -do_test boundary1-2.59.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 4398046511104 ORDER BY x - } -} {25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.59.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 4398046511104 ORDER BY a - } -} {3 10 13 17 25 26 27 28 34 43 45 56} -do_test boundary1-2.59.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 4398046511104 ORDER BY a DESC - } -} {56 45 43 34 28 27 26 25 17 13 10 3} -do_test boundary1-2.59.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 4398046511104 ORDER BY rowid - } -} {56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.59.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 4398046511104 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56} -do_test boundary1-2.59.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 4398046511104 ORDER BY x - } -} {56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.59.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 4398046511104 ORDER BY a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 57 58 59 60 61 62 63 64} -do_test boundary1-2.59.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 4398046511104 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary1-2.59.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 4398046511104 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7} -do_test boundary1-2.59.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 4398046511104 ORDER BY rowid DESC - } -} {7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.59.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 4398046511104 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.59.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 4398046511104 ORDER BY a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.59.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 4398046511104 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary1-2.59.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 4398046511104 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56} -do_test boundary1-2.59.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 4398046511104 ORDER BY rowid DESC - } -} {56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.59.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 4398046511104 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.60.1 { - db eval { - SELECT * FROM t1 WHERE rowid=1 - } -} {60 0000000000000001} -do_test boundary1-2.60.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='0000000000000001' - } -} {1 60} -do_test boundary1-2.60.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=60 - } -} {1 0000000000000001} -do_test boundary1-2.60.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 1 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 41 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary1-2.60.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 1 ORDER BY a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 41 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary1-2.60.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 1 ORDER BY rowid - } -} {41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.60.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 1 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41} -do_test boundary1-2.60.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 1 ORDER BY x - } -} {41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.60.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 1 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 41 42 43 45 46 48 49 50 51 56 57 60 61 62} -do_test boundary1-2.60.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 1 ORDER BY a DESC - } -} {62 61 60 57 56 51 50 49 48 46 45 43 42 41 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary1-2.60.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 1 ORDER BY rowid - } -} {60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.60.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 1 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60} -do_test boundary1-2.60.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 1 ORDER BY x - } -} {60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.60.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 1 ORDER BY a - } -} {1 2 11 21 29 32 33 37 38 44 47 52 53 54 55 58 59 63 64} -do_test boundary1-2.60.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 1 ORDER BY a DESC - } -} {64 63 59 58 55 54 53 52 47 44 38 37 33 32 29 21 11 2 1} -do_test boundary1-2.60.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 1 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59} -do_test boundary1-2.60.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 1 ORDER BY rowid DESC - } -} {59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.60.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 1 ORDER BY x - } -} {59 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.60.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 1 ORDER BY a - } -} {1 2 11 21 29 32 33 37 38 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary1-2.60.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 1 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 38 37 33 32 29 21 11 2 1} -do_test boundary1-2.60.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 1 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60} -do_test boundary1-2.60.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 1 ORDER BY rowid DESC - } -} {60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.60.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 1 ORDER BY x - } -} {59 60 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.61.1 { - db eval { - SELECT * FROM t1 WHERE rowid=36028797018963968 - } -} {45 0080000000000000} -do_test boundary1-2.61.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='0080000000000000' - } -} {36028797018963968 45} -do_test boundary1-2.61.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=45 - } -} {36028797018963968 0080000000000000} -do_test boundary1-2.61.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 36028797018963968 ORDER BY a - } -} {3 17 28} -do_test boundary1-2.61.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 36028797018963968 ORDER BY a DESC - } -} {28 17 3} -do_test boundary1-2.61.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 36028797018963968 ORDER BY rowid - } -} {17 28 3} -do_test boundary1-2.61.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 36028797018963968 ORDER BY rowid DESC - } -} {3 28 17} -do_test boundary1-2.61.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 36028797018963968 ORDER BY x - } -} {17 28 3} -do_test boundary1-2.61.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 36028797018963968 ORDER BY a - } -} {3 17 28 45} -do_test boundary1-2.61.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 36028797018963968 ORDER BY a DESC - } -} {45 28 17 3} -do_test boundary1-2.61.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 36028797018963968 ORDER BY rowid - } -} {45 17 28 3} -do_test boundary1-2.61.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 36028797018963968 ORDER BY rowid DESC - } -} {3 28 17 45} -do_test boundary1-2.61.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 36028797018963968 ORDER BY x - } -} {45 17 28 3} -do_test boundary1-2.61.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 36028797018963968 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.61.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 36028797018963968 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 27 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary1-2.61.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 36028797018963968 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27} -do_test boundary1-2.61.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 36028797018963968 ORDER BY rowid DESC - } -} {27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.61.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 36028797018963968 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.61.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 36028797018963968 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.61.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 36028797018963968 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 27 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary1-2.61.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 36028797018963968 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45} -do_test boundary1-2.61.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 36028797018963968 ORDER BY rowid DESC - } -} {45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.61.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 36028797018963968 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.62.1 { - db eval { - SELECT * FROM t1 WHERE rowid=-2147483649 - } -} {47 ffffffff7fffffff} -do_test boundary1-2.62.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='ffffffff7fffffff' - } -} {-2147483649 47} -do_test boundary1-2.62.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=47 - } -} {-2147483649 ffffffff7fffffff} -do_test boundary1-2.62.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > -2147483649 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary1-2.62.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > -2147483649 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary1-2.62.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > -2147483649 ORDER BY rowid - } -} {11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.62.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > -2147483649 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11} -do_test boundary1-2.62.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > -2147483649 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.62.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= -2147483649 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 47 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary1-2.62.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= -2147483649 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 47 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary1-2.62.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= -2147483649 ORDER BY rowid - } -} {47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.62.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= -2147483649 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47} -do_test boundary1-2.62.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= -2147483649 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.62.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < -2147483649 ORDER BY a - } -} {2 21 44 55 58 63 64} -do_test boundary1-2.62.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < -2147483649 ORDER BY a DESC - } -} {64 63 58 55 44 21 2} -do_test boundary1-2.62.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < -2147483649 ORDER BY rowid - } -} {55 2 64 21 44 58 63} -do_test boundary1-2.62.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < -2147483649 ORDER BY rowid DESC - } -} {63 58 44 21 64 2 55} -do_test boundary1-2.62.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < -2147483649 ORDER BY x - } -} {55 2 64 21 44 58 63} -do_test boundary1-2.62.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= -2147483649 ORDER BY a - } -} {2 21 44 47 55 58 63 64} -do_test boundary1-2.62.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= -2147483649 ORDER BY a DESC - } -} {64 63 58 55 47 44 21 2} -do_test boundary1-2.62.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= -2147483649 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47} -do_test boundary1-2.62.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= -2147483649 ORDER BY rowid DESC - } -} {47 63 58 44 21 64 2 55} -do_test boundary1-2.62.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= -2147483649 ORDER BY x - } -} {55 2 64 21 44 58 63 47} -do_test boundary1-2.63.1 { - db eval { - SELECT * FROM t1 WHERE rowid=-36028797018963969 - } -} {2 ff7fffffffffffff} -do_test boundary1-2.63.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='ff7fffffffffffff' - } -} {-36028797018963969 2} -do_test boundary1-2.63.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=2 - } -} {-36028797018963969 ff7fffffffffffff} -do_test boundary1-2.63.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > -36028797018963969 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.63.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > -36028797018963969 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary1-2.63.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > -36028797018963969 ORDER BY rowid - } -} {64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.63.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > -36028797018963969 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64} -do_test boundary1-2.63.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > -36028797018963969 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.63.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= -36028797018963969 ORDER BY a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.63.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= -36028797018963969 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary1-2.63.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= -36028797018963969 ORDER BY rowid - } -} {2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.63.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= -36028797018963969 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2} -do_test boundary1-2.63.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= -36028797018963969 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.63.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < -36028797018963969 ORDER BY a - } -} {55} -do_test boundary1-2.63.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < -36028797018963969 ORDER BY a DESC - } -} {55} -do_test boundary1-2.63.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < -36028797018963969 ORDER BY rowid - } -} {55} -do_test boundary1-2.63.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < -36028797018963969 ORDER BY rowid DESC - } -} {55} -do_test boundary1-2.63.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < -36028797018963969 ORDER BY x - } -} {55} -do_test boundary1-2.63.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= -36028797018963969 ORDER BY a - } -} {2 55} -do_test boundary1-2.63.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= -36028797018963969 ORDER BY a DESC - } -} {55 2} -do_test boundary1-2.63.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= -36028797018963969 ORDER BY rowid - } -} {55 2} -do_test boundary1-2.63.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= -36028797018963969 ORDER BY rowid DESC - } -} {2 55} -do_test boundary1-2.63.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= -36028797018963969 ORDER BY x - } -} {55 2} -do_test boundary1-2.64.1 { - db eval { - SELECT * FROM t1 WHERE rowid=3 - } -} {5 0000000000000003} -do_test boundary1-2.64.2 { - db eval { - SELECT rowid, a FROM t1 WHERE x='0000000000000003' - } -} {3 5} -do_test boundary1-2.64.3 { - db eval { - SELECT rowid, x FROM t1 WHERE a=5 - } -} {3 0000000000000003} -do_test boundary1-2.64.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 3 ORDER BY a - } -} {3 4 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary1-2.64.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 3 ORDER BY a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 4 3} -do_test boundary1-2.64.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 3 ORDER BY rowid - } -} {31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.64.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 3 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31} -do_test boundary1-2.64.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 3 ORDER BY x - } -} {31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.64.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 3 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary1-2.64.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 3 ORDER BY a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary1-2.64.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 3 ORDER BY rowid - } -} {5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.64.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 3 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5} -do_test boundary1-2.64.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 3 ORDER BY x - } -} {5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.64.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 3 ORDER BY a - } -} {1 2 11 21 29 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary1-2.64.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 3 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 29 21 11 2 1} -do_test boundary1-2.64.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 3 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41} -do_test boundary1-2.64.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 3 ORDER BY rowid DESC - } -} {41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.64.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 3 ORDER BY x - } -} {59 60 41 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.64.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 3 ORDER BY a - } -} {1 2 5 11 21 29 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary1-2.64.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 3 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 29 21 11 5 2 1} -do_test boundary1-2.64.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 3 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5} -do_test boundary1-2.64.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 3 ORDER BY rowid DESC - } -} {5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.64.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 3 ORDER BY x - } -} {59 60 41 5 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.65.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > 9.22337303685477580800e+18 ORDER BY a - } -} {} -do_test boundary1-2.65.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > 9.22337303685477580800e+18 ORDER BY a DESC - } -} {} -do_test boundary1-2.65.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > 9.22337303685477580800e+18 ORDER BY rowid - } -} {} -do_test boundary1-2.65.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > 9.22337303685477580800e+18 ORDER BY rowid DESC - } -} {} -do_test boundary1-2.65.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > 9.22337303685477580800e+18 ORDER BY x - } -} {} -do_test boundary1-2.65.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= 9.22337303685477580800e+18 ORDER BY a - } -} {} -do_test boundary1-2.65.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= 9.22337303685477580800e+18 ORDER BY a DESC - } -} {} -do_test boundary1-2.65.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= 9.22337303685477580800e+18 ORDER BY rowid - } -} {} -do_test boundary1-2.65.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= 9.22337303685477580800e+18 ORDER BY rowid DESC - } -} {} -do_test boundary1-2.65.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= 9.22337303685477580800e+18 ORDER BY x - } -} {} -do_test boundary1-2.65.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < 9.22337303685477580800e+18 ORDER BY a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.65.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < 9.22337303685477580800e+18 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary1-2.65.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < 9.22337303685477580800e+18 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.65.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < 9.22337303685477580800e+18 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.65.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < 9.22337303685477580800e+18 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.65.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= 9.22337303685477580800e+18 ORDER BY a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.65.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= 9.22337303685477580800e+18 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary1-2.65.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= 9.22337303685477580800e+18 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.65.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= 9.22337303685477580800e+18 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.65.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= 9.22337303685477580800e+18 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.66.gt.1 { - db eval { - SELECT a FROM t1 WHERE rowid > -9.22337303685477580800e+18 ORDER BY a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.66.gt.2 { - db eval { - SELECT a FROM t1 WHERE rowid > -9.22337303685477580800e+18 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary1-2.66.gt.3 { - db eval { - SELECT a FROM t1 WHERE rowid > -9.22337303685477580800e+18 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.66.gt.4 { - db eval { - SELECT a FROM t1 WHERE rowid > -9.22337303685477580800e+18 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.66.gt.5 { - db eval { - SELECT a FROM t1 WHERE rowid > -9.22337303685477580800e+18 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.66.ge.1 { - db eval { - SELECT a FROM t1 WHERE rowid >= -9.22337303685477580800e+18 ORDER BY a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary1-2.66.ge.2 { - db eval { - SELECT a FROM t1 WHERE rowid >= -9.22337303685477580800e+18 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary1-2.66.ge.3 { - db eval { - SELECT a FROM t1 WHERE rowid >= -9.22337303685477580800e+18 ORDER BY rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary1-2.66.ge.4 { - db eval { - SELECT a FROM t1 WHERE rowid >= -9.22337303685477580800e+18 ORDER BY rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary1-2.66.ge.5 { - db eval { - SELECT a FROM t1 WHERE rowid >= -9.22337303685477580800e+18 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary1-2.66.lt.1 { - db eval { - SELECT a FROM t1 WHERE rowid < -9.22337303685477580800e+18 ORDER BY a - } -} {} -do_test boundary1-2.66.lt.2 { - db eval { - SELECT a FROM t1 WHERE rowid < -9.22337303685477580800e+18 ORDER BY a DESC - } -} {} -do_test boundary1-2.66.lt.3 { - db eval { - SELECT a FROM t1 WHERE rowid < -9.22337303685477580800e+18 ORDER BY rowid - } -} {} -do_test boundary1-2.66.lt.4 { - db eval { - SELECT a FROM t1 WHERE rowid < -9.22337303685477580800e+18 ORDER BY rowid DESC - } -} {} -do_test boundary1-2.66.lt.5 { - db eval { - SELECT a FROM t1 WHERE rowid < -9.22337303685477580800e+18 ORDER BY x - } -} {} -do_test boundary1-2.66.le.1 { - db eval { - SELECT a FROM t1 WHERE rowid <= -9.22337303685477580800e+18 ORDER BY a - } -} {} -do_test boundary1-2.66.le.2 { - db eval { - SELECT a FROM t1 WHERE rowid <= -9.22337303685477580800e+18 ORDER BY a DESC - } -} {} -do_test boundary1-2.66.le.3 { - db eval { - SELECT a FROM t1 WHERE rowid <= -9.22337303685477580800e+18 ORDER BY rowid - } -} {} -do_test boundary1-2.66.le.4 { - db eval { - SELECT a FROM t1 WHERE rowid <= -9.22337303685477580800e+18 ORDER BY rowid DESC - } -} {} -do_test boundary1-2.66.le.5 { - db eval { - SELECT a FROM t1 WHERE rowid <= -9.22337303685477580800e+18 ORDER BY x - } -} {} -finish_test DELETED test/boundary2.tcl Index: test/boundary2.tcl ================================================================== --- test/boundary2.tcl +++ /dev/null @@ -1,445 +0,0 @@ -puts {# 2008 December 11 -# -# The author disclaims copyright to this source code. In place of -# a legal notice, here is a blessing: -# -# May you do good and not evil. -# May you find forgiveness for yourself and forgive others. -# May you share freely, never taking more than you give. -# -#*********************************************************************** -# This file implements regression tests for SQLite library. -# -# This file is automatically generated from a separate TCL script. -# This file seeks to exercise integer boundary values. -# -# $Id: boundary2.tcl,v 1.3 2009/01/02 15:45:48 shane Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -# Many of the boundary tests depend on a working 64-bit implementation. -if {![working_64bit_int]} { finish_test; return } -} - -expr srand(0) - -# Generate interesting boundary numbers -# -foreach x { - 0 - 1 - 0x7f - 0x7fff - 0x7fffff - 0x7fffffff - 0x7fffffffff - 0x7fffffffffff - 0x7fffffffffffff - 0x7fffffffffffffff -} { - set x [expr {wide($x)}] - set boundarynum($x) 1 - set boundarynum([expr {$x+1}]) 1 - set boundarynum([expr {-($x+1)}]) 1 - set boundarynum([expr {-($x+2)}]) 1 - set boundarynum([expr {$x+$x+1}]) 1 - set boundarynum([expr {$x+$x+2}]) 1 -} -set x [expr {wide(127)}] -for {set i 1} {$i<=9} {incr i} { - set boundarynum($x) 1 - set boundarynum([expr {$x+1}]) 1 - set x [expr {wide($x*128 + 127)}] -} - -# Scramble the $inlist into a random order. -# -proc scramble {inlist} { - set y {} - foreach x $inlist { - lappend y [list [expr {rand()}] $x] - } - set y [lsort $y] - set outlist {} - foreach x $y { - lappend outlist [lindex $x 1] - } - return $outlist -} - -# A simple selection sort. Not trying to be efficient. -# -proc sort {inlist} { - set outlist {} - set mn [lindex $inlist 0] - foreach x $inlist { - if {$x<$mn} {set mn $x} - } - set outlist $mn - set mx $mn - while {1} { - set valid 0 - foreach x $inlist { - if {$x>$mx && (!$valid || $mn>$x)} { - set mn $x - set valid 1 - } - } - if {!$valid} break - lappend outlist $mn - set mx $mn - } - return $outlist -} - -# Reverse the order of a list -# -proc reverse {inlist} { - set i [llength $inlist] - set outlist {} - for {incr i -1} {$i>=0} {incr i -1} { - lappend outlist [lindex $inlist $i] - } - return $outlist -} - -set nums1 [scramble [array names boundarynum]] -set nums2 [scramble [array names boundarynum]] - -set tname boundary2 -puts "do_test $tname-1.1 \173" -puts " db eval \173" -puts " CREATE TABLE t1(r INTEGER, a INTEGER, x TEXT);" -set a 0 -foreach r $nums1 { - incr a - set t1ra($r) $a - set t1ar($a) $r - set x [format %08x%08x [expr {wide($r)>>32}] $r] - set t1rx($r) $x - set t1xr($x) $r - puts " INSERT INTO t1 VALUES($r,$a,'$x');" -} -puts " CREATE INDEX t1i1 ON t1(r);" -puts " CREATE INDEX t1i2 ON t1(a);" -puts " CREATE INDEX t1i3 ON t1(x);" -puts " \175" -puts "\175 {}" - -puts "do_test $tname-1.2 \173" -puts " db eval \173" -puts " SELECT count(*) FROM t1" -puts " \175" -puts "\175 {64}" - -set nums3 $nums2 -lappend nums3 9.22337303685477580800e+18 -lappend nums3 -9.22337303685477580800e+18 - -set i 0 -foreach r $nums3 { - incr i - - if {abs($r)<9.22337203685477580800e+18} { - set x $t1rx($r) - set a $t1ra($r) - set r5 $r.5 - set r0 $r.0 - puts "do_test $tname-2.$i.1 \173" - puts " db eval \173" - puts " SELECT * FROM t1 WHERE r=$r" - puts " \175" - puts "\175 {$r $a $x}" - puts "do_test $tname-2.$i.2 \173" - puts " db eval \173" - puts " SELECT r, a FROM t1 WHERE x='$x'" - puts " \175" - puts "\175 {$r $a}" - puts "do_test $tname-2.$i.3 \173" - puts " db eval \173" - puts " SELECT r, x FROM t1 WHERE a=$a" - puts " \175" - puts "\175 {$r $x}" - } - - foreach op {> >= < <=} subno {gt ge lt le} { - - ################################################################ 2.x.y.1 - set rset {} - set aset {} - foreach rx $nums2 { - if "\$rx $op \$r" { - lappend rset $rx - lappend aset $t1ra($rx) - } - } - puts "do_test $tname-2.$i.$subno.1 \173" - puts " db eval \173" - puts " SELECT a FROM t1 WHERE r $op $r ORDER BY a" - puts " \175" - puts "\175 {[sort $aset]}" - - ################################################################ 2.x.y.2 - puts "do_test $tname-2.$i.$subno.2 \173" - puts " db eval \173" - puts " SELECT a FROM t1 WHERE r $op $r ORDER BY a DESC" - puts " \175" - puts "\175 {[reverse [sort $aset]]}" - - ################################################################ 2.x.y.3 - set aset {} - foreach rx [sort $rset] { - lappend aset $t1ra($rx) - } - puts "do_test $tname-2.$i.$subno.3 \173" - puts " db eval \173" - puts " SELECT a FROM t1 WHERE r $op $r ORDER BY r" - puts " \175" - puts "\175 {$aset}" - - ################################################################ 2.x.y.4 - set aset {} - foreach rx [reverse [sort $rset]] { - lappend aset $t1ra($rx) - } - puts "do_test $tname-2.$i.$subno.4 \173" - puts " db eval \173" - puts " SELECT a FROM t1 WHERE r $op $r ORDER BY r DESC" - puts " \175" - puts "\175 {$aset}" - - ################################################################ 2.x.y.5 - set aset {} - set xset {} - foreach rx $rset { - lappend xset $t1rx($rx) - } - foreach x [sort $xset] { - set rx $t1xr($x) - lappend aset $t1ra($rx) - } - puts "do_test $tname-2.$i.$subno.5 \173" - puts " db eval \173" - puts " SELECT a FROM t1 WHERE r $op $r ORDER BY x" - puts " \175" - puts "\175 {$aset}" - - ################################################################ 2.x.y.10 - if {abs($r)>9223372036854775808 || [string length $r5]>15} continue - set rset {} - set aset {} - foreach rx $nums2 { - if "\$rx $op \$r0" { - lappend rset $rx - } - } - foreach rx [sort $rset] { - lappend aset $t1ra($rx) - } - puts "do_test $tname-2.$i.$subno.10 \173" - puts " db eval \173" - puts " SELECT a FROM t1 WHERE r $op $r0 ORDER BY r" - puts " \175" - puts "\175 {$aset}" - - ################################################################ 2.x.y.11 - set aset {} - foreach rx [reverse [sort $rset]] { - lappend aset $t1ra($rx) - } - puts "do_test $tname-2.$i.$subno.11 \173" - puts " db eval \173" - puts " SELECT a FROM t1 WHERE r $op $r0 ORDER BY r DESC" - puts " \175" - puts "\175 {$aset}" - - - ################################################################ 2.x.y.12 - set rset {} - set aset {} - foreach rx $nums2 { - if "\$rx $op \$r5" { - lappend rset $rx - } - } - foreach rx [sort $rset] { - lappend aset $t1ra($rx) - } - puts "do_test $tname-2.$i.$subno.12 \173" - puts " db eval \173" - puts " SELECT a FROM t1 WHERE r $op $r5 ORDER BY r" - puts " \175" - puts "\175 {$aset}" - - ################################################################ 2.x.y.13 - set aset {} - foreach rx [reverse [sort $rset]] { - lappend aset $t1ra($rx) - } - puts "do_test $tname-2.$i.$subno.13 \173" - puts " db eval \173" - puts " SELECT a FROM t1 WHERE r $op $r5 ORDER BY r DESC" - puts " \175" - puts "\175 {$aset}" - } -} - -puts "do_test $tname-3.1 \173" -puts " db eval \173" -puts " DROP INDEX t1i1;" -puts " DROP INDEX t1i2;" -puts " DROP INDEX t1i3;" -puts " \175" -puts "\175 {}" - -set i 0 -foreach r $nums3 { - incr i - - if {abs($r)<9.22337203685477580800e+18} { - set x $t1rx($r) - set a $t1ra($r) - set r5 $r.5 - set r0 $r.0 - puts "do_test $tname-4.$i.1 \173" - puts " db eval \173" - puts " SELECT * FROM t1 WHERE r=$r" - puts " \175" - puts "\175 {$r $a $x}" - puts "do_test $tname-4.$i.2 \173" - puts " db eval \173" - puts " SELECT r, a FROM t1 WHERE x='$x'" - puts " \175" - puts "\175 {$r $a}" - puts "do_test $tname-4.$i.3 \173" - puts " db eval \173" - puts " SELECT r, x FROM t1 WHERE a=$a" - puts " \175" - puts "\175 {$r $x}" - } - - foreach op {> >= < <=} subno {gt ge lt le} { - - ################################################################ 2.x.y.1 - set rset {} - set aset {} - foreach rx $nums2 { - if "\$rx $op \$r" { - lappend rset $rx - lappend aset $t1ra($rx) - } - } - puts "do_test $tname-4.$i.$subno.1 \173" - puts " db eval \173" - puts " SELECT a FROM t1 WHERE r $op $r ORDER BY a" - puts " \175" - puts "\175 {[sort $aset]}" - - ################################################################ 2.x.y.2 - puts "do_test $tname-4.$i.$subno.2 \173" - puts " db eval \173" - puts " SELECT a FROM t1 WHERE r $op $r ORDER BY a DESC" - puts " \175" - puts "\175 {[reverse [sort $aset]]}" - - ################################################################ 2.x.y.3 - set aset {} - foreach rx [sort $rset] { - lappend aset $t1ra($rx) - } - puts "do_test $tname-4.$i.$subno.3 \173" - puts " db eval \173" - puts " SELECT a FROM t1 WHERE r $op $r ORDER BY r" - puts " \175" - puts "\175 {$aset}" - - ################################################################ 2.x.y.4 - set aset {} - foreach rx [reverse [sort $rset]] { - lappend aset $t1ra($rx) - } - puts "do_test $tname-4.$i.$subno.4 \173" - puts " db eval \173" - puts " SELECT a FROM t1 WHERE r $op $r ORDER BY r DESC" - puts " \175" - puts "\175 {$aset}" - - ################################################################ 2.x.y.5 - set aset {} - set xset {} - foreach rx $rset { - lappend xset $t1rx($rx) - } - foreach x [sort $xset] { - set rx $t1xr($x) - lappend aset $t1ra($rx) - } - puts "do_test $tname-4.$i.$subno.5 \173" - puts " db eval \173" - puts " SELECT a FROM t1 WHERE r $op $r ORDER BY x" - puts " \175" - puts "\175 {$aset}" - - ################################################################ 2.x.y.10 - if {abs($r)>9223372036854775808 || [string length $r5]>15} continue - set rset {} - set aset {} - foreach rx $nums2 { - if "\$rx $op \$r0" { - lappend rset $rx - } - } - foreach rx [sort $rset] { - lappend aset $t1ra($rx) - } - puts "do_test $tname-4.$i.$subno.10 \173" - puts " db eval \173" - puts " SELECT a FROM t1 WHERE r $op $r0 ORDER BY r" - puts " \175" - puts "\175 {$aset}" - - ################################################################ 2.x.y.11 - set aset {} - foreach rx [reverse [sort $rset]] { - lappend aset $t1ra($rx) - } - puts "do_test $tname-4.$i.$subno.11 \173" - puts " db eval \173" - puts " SELECT a FROM t1 WHERE r $op $r0 ORDER BY r DESC" - puts " \175" - puts "\175 {$aset}" - - - ################################################################ 2.x.y.12 - set rset {} - set aset {} - foreach rx $nums2 { - if "\$rx $op \$r5" { - lappend rset $rx - } - } - foreach rx [sort $rset] { - lappend aset $t1ra($rx) - } - puts "do_test $tname-4.$i.$subno.12 \173" - puts " db eval \173" - puts " SELECT a FROM t1 WHERE r $op $r5 ORDER BY r" - puts " \175" - puts "\175 {$aset}" - - ################################################################ 2.x.y.13 - set aset {} - foreach rx [reverse [sort $rset]] { - lappend aset $t1ra($rx) - } - puts "do_test $tname-4.$i.$subno.13 \173" - puts " db eval \173" - puts " SELECT a FROM t1 WHERE r $op $r5 ORDER BY r DESC" - puts " \175" - puts "\175 {$aset}" - } -} - - -puts {finish_test} DELETED test/boundary2.test Index: test/boundary2.test ================================================================== --- test/boundary2.test +++ /dev/null @@ -1,15198 +0,0 @@ -# 2008 December 11 -# -# The author disclaims copyright to this source code. In place of -# a legal notice, here is a blessing: -# -# May you do good and not evil. -# May you find forgiveness for yourself and forgive others. -# May you share freely, never taking more than you give. -# -#*********************************************************************** -# This file implements regression tests for SQLite library. -# -# This file is automatically generated from a separate TCL script. -# This file seeks to exercise integer boundary values. -# -# $Id: boundary2.test,v 1.2 2009/01/02 15:45:48 shane Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -# Many of the boundary tests depend on a working 64-bit implementation. -if {![working_64bit_int]} { finish_test; return } - -do_test boundary2-1.1 { - db eval { - CREATE TABLE t1(r INTEGER, a INTEGER, x TEXT); - INSERT INTO t1 VALUES(-8388609,1,'ffffffffff7fffff'); - INSERT INTO t1 VALUES(-36028797018963969,2,'ff7fffffffffffff'); - INSERT INTO t1 VALUES(9223372036854775807,3,'7fffffffffffffff'); - INSERT INTO t1 VALUES(127,4,'000000000000007f'); - INSERT INTO t1 VALUES(3,5,'0000000000000003'); - INSERT INTO t1 VALUES(16777216,6,'0000000001000000'); - INSERT INTO t1 VALUES(4398046511103,7,'000003ffffffffff'); - INSERT INTO t1 VALUES(16383,8,'0000000000003fff'); - INSERT INTO t1 VALUES(16777215,9,'0000000000ffffff'); - INSERT INTO t1 VALUES(281474976710655,10,'0000ffffffffffff'); - INSERT INTO t1 VALUES(-2147483648,11,'ffffffff80000000'); - INSERT INTO t1 VALUES(268435455,12,'000000000fffffff'); - INSERT INTO t1 VALUES(562949953421311,13,'0001ffffffffffff'); - INSERT INTO t1 VALUES(4294967295,14,'00000000ffffffff'); - INSERT INTO t1 VALUES(2097151,15,'00000000001fffff'); - INSERT INTO t1 VALUES(16384,16,'0000000000004000'); - INSERT INTO t1 VALUES(72057594037927935,17,'00ffffffffffffff'); - INSERT INTO t1 VALUES(8388607,18,'00000000007fffff'); - INSERT INTO t1 VALUES(1099511627776,19,'0000010000000000'); - INSERT INTO t1 VALUES(2147483647,20,'000000007fffffff'); - INSERT INTO t1 VALUES(-140737488355329,21,'ffff7fffffffffff'); - INSERT INTO t1 VALUES(34359738368,22,'0000000800000000'); - INSERT INTO t1 VALUES(32767,23,'0000000000007fff'); - INSERT INTO t1 VALUES(8388608,24,'0000000000800000'); - INSERT INTO t1 VALUES(140737488355327,25,'00007fffffffffff'); - INSERT INTO t1 VALUES(281474976710656,26,'0001000000000000'); - INSERT INTO t1 VALUES(36028797018963967,27,'007fffffffffffff'); - INSERT INTO t1 VALUES(72057594037927936,28,'0100000000000000'); - INSERT INTO t1 VALUES(-32769,29,'ffffffffffff7fff'); - INSERT INTO t1 VALUES(255,30,'00000000000000ff'); - INSERT INTO t1 VALUES(4,31,'0000000000000004'); - INSERT INTO t1 VALUES(-32768,32,'ffffffffffff8000'); - INSERT INTO t1 VALUES(-2,33,'fffffffffffffffe'); - INSERT INTO t1 VALUES(140737488355328,34,'0000800000000000'); - INSERT INTO t1 VALUES(549755813888,35,'0000008000000000'); - INSERT INTO t1 VALUES(4294967296,36,'0000000100000000'); - INSERT INTO t1 VALUES(-8388608,37,'ffffffffff800000'); - INSERT INTO t1 VALUES(-1,38,'ffffffffffffffff'); - INSERT INTO t1 VALUES(34359738367,39,'00000007ffffffff'); - INSERT INTO t1 VALUES(268435456,40,'0000000010000000'); - INSERT INTO t1 VALUES(2,41,'0000000000000002'); - INSERT INTO t1 VALUES(2097152,42,'0000000000200000'); - INSERT INTO t1 VALUES(562949953421312,43,'0002000000000000'); - INSERT INTO t1 VALUES(-140737488355328,44,'ffff800000000000'); - INSERT INTO t1 VALUES(36028797018963968,45,'0080000000000000'); - INSERT INTO t1 VALUES(549755813887,46,'0000007fffffffff'); - INSERT INTO t1 VALUES(-2147483649,47,'ffffffff7fffffff'); - INSERT INTO t1 VALUES(65535,48,'000000000000ffff'); - INSERT INTO t1 VALUES(128,49,'0000000000000080'); - INSERT INTO t1 VALUES(32768,50,'0000000000008000'); - INSERT INTO t1 VALUES(2147483648,51,'0000000080000000'); - INSERT INTO t1 VALUES(-3,52,'fffffffffffffffd'); - INSERT INTO t1 VALUES(-128,53,'ffffffffffffff80'); - INSERT INTO t1 VALUES(-129,54,'ffffffffffffff7f'); - INSERT INTO t1 VALUES(-9223372036854775808,55,'8000000000000000'); - INSERT INTO t1 VALUES(4398046511104,56,'0000040000000000'); - INSERT INTO t1 VALUES(1099511627775,57,'000000ffffffffff'); - INSERT INTO t1 VALUES(-549755813889,58,'ffffff7fffffffff'); - INSERT INTO t1 VALUES(0,59,'0000000000000000'); - INSERT INTO t1 VALUES(1,60,'0000000000000001'); - INSERT INTO t1 VALUES(256,61,'0000000000000100'); - INSERT INTO t1 VALUES(65536,62,'0000000000010000'); - INSERT INTO t1 VALUES(-549755813888,63,'ffffff8000000000'); - INSERT INTO t1 VALUES(-36028797018963968,64,'ff80000000000000'); - CREATE INDEX t1i1 ON t1(r); - CREATE INDEX t1i2 ON t1(a); - CREATE INDEX t1i3 ON t1(x); - } -} {} -do_test boundary2-1.2 { - db eval { - SELECT count(*) FROM t1 - } -} {64} -do_test boundary2-2.1.1 { - db eval { - SELECT * FROM t1 WHERE r=72057594037927935 - } -} {72057594037927935 17 00ffffffffffffff} -do_test boundary2-2.1.2 { - db eval { - SELECT r, a FROM t1 WHERE x='00ffffffffffffff' - } -} {72057594037927935 17} -do_test boundary2-2.1.3 { - db eval { - SELECT r, x FROM t1 WHERE a=17 - } -} {72057594037927935 00ffffffffffffff} -do_test boundary2-2.1.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 72057594037927935 ORDER BY a - } -} {3 28} -do_test boundary2-2.1.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 72057594037927935 ORDER BY a DESC - } -} {28 3} -do_test boundary2-2.1.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 72057594037927935 ORDER BY r - } -} {28 3} -do_test boundary2-2.1.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 72057594037927935 ORDER BY r DESC - } -} {3 28} -do_test boundary2-2.1.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 72057594037927935 ORDER BY x - } -} {28 3} -do_test boundary2-2.1.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 72057594037927935 ORDER BY a - } -} {3 17 28} -do_test boundary2-2.1.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 72057594037927935 ORDER BY a DESC - } -} {28 17 3} -do_test boundary2-2.1.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 72057594037927935 ORDER BY r - } -} {17 28 3} -do_test boundary2-2.1.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 72057594037927935 ORDER BY r DESC - } -} {3 28 17} -do_test boundary2-2.1.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 72057594037927935 ORDER BY x - } -} {17 28 3} -do_test boundary2-2.1.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 72057594037927935 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.1.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 72057594037927935 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 27 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-2.1.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 72057594037927935 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45} -do_test boundary2-2.1.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 72057594037927935 ORDER BY r DESC - } -} {45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.1.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 72057594037927935 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.1.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 72057594037927935 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.1.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 72057594037927935 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-2.1.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 72057594037927935 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17} -do_test boundary2-2.1.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 72057594037927935 ORDER BY r DESC - } -} {17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.1.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 72057594037927935 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.2.1 { - db eval { - SELECT * FROM t1 WHERE r=16384 - } -} {16384 16 0000000000004000} -do_test boundary2-2.2.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000000004000' - } -} {16384 16} -do_test boundary2-2.2.3 { - db eval { - SELECT r, x FROM t1 WHERE a=16 - } -} {16384 0000000000004000} -do_test boundary2-2.2.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 16384 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary2-2.2.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 16384 ORDER BY a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary2-2.2.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 16384 ORDER BY r - } -} {23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.2.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 16384 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23} -do_test boundary2-2.2.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 16384 ORDER BY x - } -} {23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.2.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 16384 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary2-2.2.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 16384 ORDER BY a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 7 6 3} -do_test boundary2-2.2.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 16384 ORDER BY r - } -} {16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.2.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 16384 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16} -do_test boundary2-2.2.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 16384 ORDER BY x - } -} {16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.2.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 16384 ORDER BY a - } -} {1 2 4 5 8 11 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary2-2.2.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 16384 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 11 8 5 4 2 1} -do_test boundary2-2.2.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 16384 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8} -do_test boundary2-2.2.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 16384 ORDER BY r DESC - } -} {8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.2.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 16384 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.2.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 16384 ORDER BY a - } -} {1 2 4 5 8 11 16 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary2-2.2.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 16384 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 16 11 8 5 4 2 1} -do_test boundary2-2.2.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 16384 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16} -do_test boundary2-2.2.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 16384 ORDER BY r DESC - } -} {16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.2.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 16384 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.3.1 { - db eval { - SELECT * FROM t1 WHERE r=4294967296 - } -} {4294967296 36 0000000100000000} -do_test boundary2-2.3.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000100000000' - } -} {4294967296 36} -do_test boundary2-2.3.3 { - db eval { - SELECT r, x FROM t1 WHERE a=36 - } -} {4294967296 0000000100000000} -do_test boundary2-2.3.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 4294967296 ORDER BY a - } -} {3 7 10 13 17 19 22 25 26 27 28 34 35 39 43 45 46 56 57} -do_test boundary2-2.3.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 4294967296 ORDER BY a DESC - } -} {57 56 46 45 43 39 35 34 28 27 26 25 22 19 17 13 10 7 3} -do_test boundary2-2.3.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 4294967296 ORDER BY r - } -} {39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.3.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 4294967296 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39} -do_test boundary2-2.3.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 4294967296 ORDER BY x - } -} {39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.3.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 4294967296 ORDER BY a - } -} {3 7 10 13 17 19 22 25 26 27 28 34 35 36 39 43 45 46 56 57} -do_test boundary2-2.3.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 4294967296 ORDER BY a DESC - } -} {57 56 46 45 43 39 36 35 34 28 27 26 25 22 19 17 13 10 7 3} -do_test boundary2-2.3.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 4294967296 ORDER BY r - } -} {36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.3.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 4294967296 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36} -do_test boundary2-2.3.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 4294967296 ORDER BY x - } -} {36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.3.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 4294967296 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.3.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 4294967296 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-2.3.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 4294967296 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14} -do_test boundary2-2.3.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 4294967296 ORDER BY r DESC - } -} {14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.3.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 4294967296 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.3.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 4294967296 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 23 24 29 30 31 32 33 36 37 38 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.3.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 4294967296 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 38 37 36 33 32 31 30 29 24 23 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-2.3.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 4294967296 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36} -do_test boundary2-2.3.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 4294967296 ORDER BY r DESC - } -} {36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.3.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 4294967296 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.4.1 { - db eval { - SELECT * FROM t1 WHERE r=16777216 - } -} {16777216 6 0000000001000000} -do_test boundary2-2.4.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000001000000' - } -} {16777216 6} -do_test boundary2-2.4.3 { - db eval { - SELECT r, x FROM t1 WHERE a=6 - } -} {16777216 0000000001000000} -do_test boundary2-2.4.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 16777216 ORDER BY a - } -} {3 7 10 12 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary2-2.4.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 16777216 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 12 10 7 3} -do_test boundary2-2.4.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 16777216 ORDER BY r - } -} {12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.4.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 16777216 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12} -do_test boundary2-2.4.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 16777216 ORDER BY x - } -} {12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.4.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 16777216 ORDER BY a - } -} {3 6 7 10 12 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary2-2.4.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 16777216 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 12 10 7 6 3} -do_test boundary2-2.4.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 16777216 ORDER BY r - } -} {6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.4.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 16777216 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6} -do_test boundary2-2.4.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 16777216 ORDER BY x - } -} {6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.4.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 16777216 ORDER BY a - } -} {1 2 4 5 8 9 11 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.4.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 16777216 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 11 9 8 5 4 2 1} -do_test boundary2-2.4.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 16777216 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9} -do_test boundary2-2.4.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 16777216 ORDER BY r DESC - } -} {9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.4.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 16777216 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.4.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 16777216 ORDER BY a - } -} {1 2 4 5 6 8 9 11 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.4.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 16777216 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 11 9 8 6 5 4 2 1} -do_test boundary2-2.4.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 16777216 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6} -do_test boundary2-2.4.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 16777216 ORDER BY r DESC - } -} {6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.4.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 16777216 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.5.1 { - db eval { - SELECT * FROM t1 WHERE r=-32769 - } -} {-32769 29 ffffffffffff7fff} -do_test boundary2-2.5.2 { - db eval { - SELECT r, a FROM t1 WHERE x='ffffffffffff7fff' - } -} {-32769 29} -do_test boundary2-2.5.3 { - db eval { - SELECT r, x FROM t1 WHERE a=29 - } -} {-32769 ffffffffffff7fff} -do_test boundary2-2.5.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -32769 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 32 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary2-2.5.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -32769 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 32 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-2.5.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -32769 ORDER BY r - } -} {32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.5.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -32769 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32} -do_test boundary2-2.5.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -32769 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 32 54 53 52 33 38} -do_test boundary2-2.5.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -32769 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary2-2.5.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -32769 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-2.5.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -32769 ORDER BY r - } -} {29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.5.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -32769 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29} -do_test boundary2-2.5.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -32769 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 29 32 54 53 52 33 38} -do_test boundary2-2.5.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -32769 ORDER BY a - } -} {1 2 11 21 37 44 47 55 58 63 64} -do_test boundary2-2.5.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -32769 ORDER BY a DESC - } -} {64 63 58 55 47 44 37 21 11 2 1} -do_test boundary2-2.5.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -32769 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37} -do_test boundary2-2.5.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -32769 ORDER BY r DESC - } -} {37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.5.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -32769 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37} -do_test boundary2-2.5.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -32769 ORDER BY a - } -} {1 2 11 21 29 37 44 47 55 58 63 64} -do_test boundary2-2.5.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -32769 ORDER BY a DESC - } -} {64 63 58 55 47 44 37 29 21 11 2 1} -do_test boundary2-2.5.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -32769 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29} -do_test boundary2-2.5.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -32769 ORDER BY r DESC - } -} {29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.5.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -32769 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29} -do_test boundary2-2.6.1 { - db eval { - SELECT * FROM t1 WHERE r=-140737488355329 - } -} {-140737488355329 21 ffff7fffffffffff} -do_test boundary2-2.6.2 { - db eval { - SELECT r, a FROM t1 WHERE x='ffff7fffffffffff' - } -} {-140737488355329 21} -do_test boundary2-2.6.3 { - db eval { - SELECT r, x FROM t1 WHERE a=21 - } -} {-140737488355329 ffff7fffffffffff} -do_test boundary2-2.6.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -140737488355329 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63} -do_test boundary2-2.6.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -140737488355329 ORDER BY a DESC - } -} {63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary2-2.6.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -140737488355329 ORDER BY r - } -} {44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.6.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -140737488355329 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44} -do_test boundary2-2.6.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -140737488355329 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.6.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -140737488355329 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63} -do_test boundary2-2.6.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -140737488355329 ORDER BY a DESC - } -} {63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary2-2.6.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -140737488355329 ORDER BY r - } -} {21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.6.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -140737488355329 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21} -do_test boundary2-2.6.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -140737488355329 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.6.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -140737488355329 ORDER BY a - } -} {2 55 64} -do_test boundary2-2.6.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -140737488355329 ORDER BY a DESC - } -} {64 55 2} -do_test boundary2-2.6.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -140737488355329 ORDER BY r - } -} {55 2 64} -do_test boundary2-2.6.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -140737488355329 ORDER BY r DESC - } -} {64 2 55} -do_test boundary2-2.6.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -140737488355329 ORDER BY x - } -} {55 2 64} -do_test boundary2-2.6.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -140737488355329 ORDER BY a - } -} {2 21 55 64} -do_test boundary2-2.6.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -140737488355329 ORDER BY a DESC - } -} {64 55 21 2} -do_test boundary2-2.6.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -140737488355329 ORDER BY r - } -} {55 2 64 21} -do_test boundary2-2.6.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -140737488355329 ORDER BY r DESC - } -} {21 64 2 55} -do_test boundary2-2.6.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -140737488355329 ORDER BY x - } -} {55 2 64 21} -do_test boundary2-2.7.1 { - db eval { - SELECT * FROM t1 WHERE r=2 - } -} {2 41 0000000000000002} -do_test boundary2-2.7.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000000000002' - } -} {2 41} -do_test boundary2-2.7.3 { - db eval { - SELECT r, x FROM t1 WHERE a=41 - } -} {2 0000000000000002} -do_test boundary2-2.7.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 2 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary2-2.7.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 2 ORDER BY a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-2.7.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 2 ORDER BY r - } -} {5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.7.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 2 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5} -do_test boundary2-2.7.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 2 ORDER BY x - } -} {5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.7.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 2 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 41 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary2-2.7.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 2 ORDER BY a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 41 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-2.7.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 2 ORDER BY r - } -} {41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.7.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 2 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41} -do_test boundary2-2.7.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 2 ORDER BY x - } -} {41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.7.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 2 ORDER BY a - } -} {1 2 11 21 29 32 33 37 38 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary2-2.7.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 2 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 38 37 33 32 29 21 11 2 1} -do_test boundary2-2.7.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 2 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60} -do_test boundary2-2.7.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 2 ORDER BY r DESC - } -} {60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.7.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 2 ORDER BY x - } -} {59 60 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.7.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 2 ORDER BY a - } -} {1 2 11 21 29 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary2-2.7.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 2 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 29 21 11 2 1} -do_test boundary2-2.7.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 2 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41} -do_test boundary2-2.7.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 2 ORDER BY r DESC - } -} {41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.7.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 2 ORDER BY x - } -} {59 60 41 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.8.1 { - db eval { - SELECT * FROM t1 WHERE r=4 - } -} {4 31 0000000000000004} -do_test boundary2-2.8.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000000000004' - } -} {4 31} -do_test boundary2-2.8.3 { - db eval { - SELECT r, x FROM t1 WHERE a=31 - } -} {4 0000000000000004} -do_test boundary2-2.8.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 4 ORDER BY a - } -} {3 4 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary2-2.8.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 4 ORDER BY a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 4 3} -do_test boundary2-2.8.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 4 ORDER BY r - } -} {4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.8.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 4 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4} -do_test boundary2-2.8.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 4 ORDER BY x - } -} {4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.8.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 4 ORDER BY a - } -} {3 4 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary2-2.8.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 4 ORDER BY a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 4 3} -do_test boundary2-2.8.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 4 ORDER BY r - } -} {31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.8.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 4 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31} -do_test boundary2-2.8.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 4 ORDER BY x - } -} {31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.8.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 4 ORDER BY a - } -} {1 2 5 11 21 29 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary2-2.8.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 4 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 29 21 11 5 2 1} -do_test boundary2-2.8.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 4 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5} -do_test boundary2-2.8.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 4 ORDER BY r DESC - } -} {5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.8.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 4 ORDER BY x - } -} {59 60 41 5 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.8.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 4 ORDER BY a - } -} {1 2 5 11 21 29 31 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary2-2.8.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 4 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 31 29 21 11 5 2 1} -do_test boundary2-2.8.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 4 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31} -do_test boundary2-2.8.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 4 ORDER BY r DESC - } -} {31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.8.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 4 ORDER BY x - } -} {59 60 41 5 31 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.9.1 { - db eval { - SELECT * FROM t1 WHERE r=562949953421311 - } -} {562949953421311 13 0001ffffffffffff} -do_test boundary2-2.9.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0001ffffffffffff' - } -} {562949953421311 13} -do_test boundary2-2.9.3 { - db eval { - SELECT r, x FROM t1 WHERE a=13 - } -} {562949953421311 0001ffffffffffff} -do_test boundary2-2.9.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 562949953421311 ORDER BY a - } -} {3 17 27 28 43 45} -do_test boundary2-2.9.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 562949953421311 ORDER BY a DESC - } -} {45 43 28 27 17 3} -do_test boundary2-2.9.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 562949953421311 ORDER BY r - } -} {43 27 45 17 28 3} -do_test boundary2-2.9.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 562949953421311 ORDER BY r DESC - } -} {3 28 17 45 27 43} -do_test boundary2-2.9.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 562949953421311 ORDER BY x - } -} {43 27 45 17 28 3} -do_test boundary2-2.9.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 562949953421311 ORDER BY a - } -} {3 13 17 27 28 43 45} -do_test boundary2-2.9.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 562949953421311 ORDER BY a DESC - } -} {45 43 28 27 17 13 3} -do_test boundary2-2.9.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 562949953421311 ORDER BY r - } -} {13 43 27 45 17 28 3} -do_test boundary2-2.9.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 562949953421311 ORDER BY r DESC - } -} {3 28 17 45 27 43 13} -do_test boundary2-2.9.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 562949953421311 ORDER BY x - } -} {13 43 27 45 17 28 3} -do_test boundary2-2.9.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 562949953421311 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 14 15 16 18 19 20 21 22 23 24 25 26 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.9.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 562949953421311 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 26 25 24 23 22 21 20 19 18 16 15 14 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-2.9.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 562949953421311 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26} -do_test boundary2-2.9.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 562949953421311 ORDER BY r DESC - } -} {26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.9.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 562949953421311 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.9.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 562949953421311 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.9.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 562949953421311 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-2.9.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 562949953421311 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13} -do_test boundary2-2.9.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 562949953421311 ORDER BY r DESC - } -} {13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.9.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 562949953421311 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.10.1 { - db eval { - SELECT * FROM t1 WHERE r=256 - } -} {256 61 0000000000000100} -do_test boundary2-2.10.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000000000100' - } -} {256 61} -do_test boundary2-2.10.3 { - db eval { - SELECT r, x FROM t1 WHERE a=61 - } -} {256 0000000000000100} -do_test boundary2-2.10.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 256 ORDER BY a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary2-2.10.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 256 ORDER BY a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary2-2.10.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 256 ORDER BY r - } -} {8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.10.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 256 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8} -do_test boundary2-2.10.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 256 ORDER BY x - } -} {8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.10.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 256 ORDER BY a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 61 62} -do_test boundary2-2.10.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 256 ORDER BY a DESC - } -} {62 61 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary2-2.10.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 256 ORDER BY r - } -} {61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.10.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 256 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61} -do_test boundary2-2.10.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 256 ORDER BY x - } -} {61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.10.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 256 ORDER BY a - } -} {1 2 4 5 11 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 63 64} -do_test boundary2-2.10.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 256 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 11 5 4 2 1} -do_test boundary2-2.10.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 256 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30} -do_test boundary2-2.10.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 256 ORDER BY r DESC - } -} {30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.10.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 256 ORDER BY x - } -} {59 60 41 5 31 4 49 30 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.10.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 256 ORDER BY a - } -} {1 2 4 5 11 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary2-2.10.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 256 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 11 5 4 2 1} -do_test boundary2-2.10.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 256 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61} -do_test boundary2-2.10.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 256 ORDER BY r DESC - } -} {61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.10.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 256 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.11.1 { - db eval { - SELECT * FROM t1 WHERE r=34359738368 - } -} {34359738368 22 0000000800000000} -do_test boundary2-2.11.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000800000000' - } -} {34359738368 22} -do_test boundary2-2.11.3 { - db eval { - SELECT r, x FROM t1 WHERE a=22 - } -} {34359738368 0000000800000000} -do_test boundary2-2.11.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 34359738368 ORDER BY a - } -} {3 7 10 13 17 19 25 26 27 28 34 35 43 45 46 56 57} -do_test boundary2-2.11.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 34359738368 ORDER BY a DESC - } -} {57 56 46 45 43 35 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary2-2.11.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 34359738368 ORDER BY r - } -} {46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.11.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 34359738368 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46} -do_test boundary2-2.11.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 34359738368 ORDER BY x - } -} {46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.11.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 34359738368 ORDER BY a - } -} {3 7 10 13 17 19 22 25 26 27 28 34 35 43 45 46 56 57} -do_test boundary2-2.11.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 34359738368 ORDER BY a DESC - } -} {57 56 46 45 43 35 34 28 27 26 25 22 19 17 13 10 7 3} -do_test boundary2-2.11.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 34359738368 ORDER BY r - } -} {22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.11.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 34359738368 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22} -do_test boundary2-2.11.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 34359738368 ORDER BY x - } -} {22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.11.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 34359738368 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 23 24 29 30 31 32 33 36 37 38 39 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.11.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 34359738368 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 39 38 37 36 33 32 31 30 29 24 23 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-2.11.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 34359738368 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39} -do_test boundary2-2.11.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 34359738368 ORDER BY r DESC - } -} {39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.11.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 34359738368 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.11.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 34359738368 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 36 37 38 39 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.11.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 34359738368 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 39 38 37 36 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-2.11.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 34359738368 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22} -do_test boundary2-2.11.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 34359738368 ORDER BY r DESC - } -} {22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.11.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 34359738368 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.12.1 { - db eval { - SELECT * FROM t1 WHERE r=65536 - } -} {65536 62 0000000000010000} -do_test boundary2-2.12.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000000010000' - } -} {65536 62} -do_test boundary2-2.12.3 { - db eval { - SELECT r, x FROM t1 WHERE a=62 - } -} {65536 0000000000010000} -do_test boundary2-2.12.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 65536 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 51 56 57} -do_test boundary2-2.12.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 65536 ORDER BY a DESC - } -} {57 56 51 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary2-2.12.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 65536 ORDER BY r - } -} {15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.12.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 65536 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15} -do_test boundary2-2.12.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 65536 ORDER BY x - } -} {15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.12.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 65536 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 51 56 57 62} -do_test boundary2-2.12.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 65536 ORDER BY a DESC - } -} {62 57 56 51 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary2-2.12.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 65536 ORDER BY r - } -} {62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.12.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 65536 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62} -do_test boundary2-2.12.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 65536 ORDER BY x - } -} {62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.12.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 65536 ORDER BY a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 48 49 50 52 53 54 55 58 59 60 61 63 64} -do_test boundary2-2.12.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 65536 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 50 49 48 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary2-2.12.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 65536 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48} -do_test boundary2-2.12.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 65536 ORDER BY r DESC - } -} {48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.12.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 65536 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.12.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 65536 ORDER BY a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.12.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 65536 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary2-2.12.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 65536 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62} -do_test boundary2-2.12.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 65536 ORDER BY r DESC - } -} {62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.12.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 65536 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.13.1 { - db eval { - SELECT * FROM t1 WHERE r=268435456 - } -} {268435456 40 0000000010000000} -do_test boundary2-2.13.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000010000000' - } -} {268435456 40} -do_test boundary2-2.13.3 { - db eval { - SELECT r, x FROM t1 WHERE a=40 - } -} {268435456 0000000010000000} -do_test boundary2-2.13.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 268435456 ORDER BY a - } -} {3 7 10 13 14 17 19 20 22 25 26 27 28 34 35 36 39 43 45 46 51 56 57} -do_test boundary2-2.13.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 268435456 ORDER BY a DESC - } -} {57 56 51 46 45 43 39 36 35 34 28 27 26 25 22 20 19 17 14 13 10 7 3} -do_test boundary2-2.13.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 268435456 ORDER BY r - } -} {20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.13.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 268435456 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20} -do_test boundary2-2.13.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 268435456 ORDER BY x - } -} {20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.13.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 268435456 ORDER BY a - } -} {3 7 10 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary2-2.13.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 268435456 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 10 7 3} -do_test boundary2-2.13.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 268435456 ORDER BY r - } -} {40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.13.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 268435456 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40} -do_test boundary2-2.13.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 268435456 ORDER BY x - } -} {40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.13.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 268435456 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.13.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 268435456 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary2-2.13.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 268435456 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12} -do_test boundary2-2.13.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 268435456 ORDER BY r DESC - } -} {12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.13.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 268435456 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.13.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 268435456 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.13.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 268435456 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary2-2.13.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 268435456 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40} -do_test boundary2-2.13.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 268435456 ORDER BY r DESC - } -} {40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.13.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 268435456 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.14.1 { - db eval { - SELECT * FROM t1 WHERE r=-140737488355328 - } -} {-140737488355328 44 ffff800000000000} -do_test boundary2-2.14.2 { - db eval { - SELECT r, a FROM t1 WHERE x='ffff800000000000' - } -} {-140737488355328 44} -do_test boundary2-2.14.3 { - db eval { - SELECT r, x FROM t1 WHERE a=44 - } -} {-140737488355328 ffff800000000000} -do_test boundary2-2.14.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -140737488355328 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63} -do_test boundary2-2.14.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -140737488355328 ORDER BY a DESC - } -} {63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary2-2.14.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -140737488355328 ORDER BY r - } -} {58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.14.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -140737488355328 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58} -do_test boundary2-2.14.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -140737488355328 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.14.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -140737488355328 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63} -do_test boundary2-2.14.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -140737488355328 ORDER BY a DESC - } -} {63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary2-2.14.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -140737488355328 ORDER BY r - } -} {44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.14.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -140737488355328 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44} -do_test boundary2-2.14.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -140737488355328 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.14.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -140737488355328 ORDER BY a - } -} {2 21 55 64} -do_test boundary2-2.14.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -140737488355328 ORDER BY a DESC - } -} {64 55 21 2} -do_test boundary2-2.14.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -140737488355328 ORDER BY r - } -} {55 2 64 21} -do_test boundary2-2.14.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -140737488355328 ORDER BY r DESC - } -} {21 64 2 55} -do_test boundary2-2.14.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -140737488355328 ORDER BY x - } -} {55 2 64 21} -do_test boundary2-2.14.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -140737488355328 ORDER BY a - } -} {2 21 44 55 64} -do_test boundary2-2.14.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -140737488355328 ORDER BY a DESC - } -} {64 55 44 21 2} -do_test boundary2-2.14.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -140737488355328 ORDER BY r - } -} {55 2 64 21 44} -do_test boundary2-2.14.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -140737488355328 ORDER BY r DESC - } -} {44 21 64 2 55} -do_test boundary2-2.14.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -140737488355328 ORDER BY x - } -} {55 2 64 21 44} -do_test boundary2-2.15.1 { - db eval { - SELECT * FROM t1 WHERE r=1099511627776 - } -} {1099511627776 19 0000010000000000} -do_test boundary2-2.15.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000010000000000' - } -} {1099511627776 19} -do_test boundary2-2.15.3 { - db eval { - SELECT r, x FROM t1 WHERE a=19 - } -} {1099511627776 0000010000000000} -do_test boundary2-2.15.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 1099511627776 ORDER BY a - } -} {3 7 10 13 17 25 26 27 28 34 43 45 56} -do_test boundary2-2.15.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 1099511627776 ORDER BY a DESC - } -} {56 45 43 34 28 27 26 25 17 13 10 7 3} -do_test boundary2-2.15.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 1099511627776 ORDER BY r - } -} {7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.15.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 1099511627776 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7} -do_test boundary2-2.15.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 1099511627776 ORDER BY x - } -} {7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.15.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 1099511627776 ORDER BY a - } -} {3 7 10 13 17 19 25 26 27 28 34 43 45 56} -do_test boundary2-2.15.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 1099511627776 ORDER BY a DESC - } -} {56 45 43 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary2-2.15.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 1099511627776 ORDER BY r - } -} {19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.15.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 1099511627776 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19} -do_test boundary2-2.15.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 1099511627776 ORDER BY x - } -} {19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.15.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 1099511627776 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 57 58 59 60 61 62 63 64} -do_test boundary2-2.15.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 1099511627776 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-2.15.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 1099511627776 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57} -do_test boundary2-2.15.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 1099511627776 ORDER BY r DESC - } -} {57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.15.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 1099511627776 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.15.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 1099511627776 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 19 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 57 58 59 60 61 62 63 64} -do_test boundary2-2.15.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 1099511627776 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 19 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-2.15.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 1099511627776 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19} -do_test boundary2-2.15.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 1099511627776 ORDER BY r DESC - } -} {19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.15.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 1099511627776 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.16.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 9223372036854775807 ORDER BY a - } -} {} -do_test boundary2-2.16.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 9223372036854775807 ORDER BY a DESC - } -} {} -do_test boundary2-2.16.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 9223372036854775807 ORDER BY r - } -} {} -do_test boundary2-2.16.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 9223372036854775807 ORDER BY r DESC - } -} {} -do_test boundary2-2.16.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 9223372036854775807 ORDER BY x - } -} {} -do_test boundary2-2.16.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 9223372036854775807 ORDER BY a - } -} {3} -do_test boundary2-2.16.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 9223372036854775807 ORDER BY a DESC - } -} {3} -do_test boundary2-2.16.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 9223372036854775807 ORDER BY r - } -} {3} -do_test boundary2-2.16.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 9223372036854775807 ORDER BY r DESC - } -} {3} -do_test boundary2-2.16.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 9223372036854775807 ORDER BY x - } -} {3} -do_test boundary2-2.16.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 9223372036854775807 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.16.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 9223372036854775807 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-2.16.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 9223372036854775807 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28} -do_test boundary2-2.16.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 9223372036854775807 ORDER BY r DESC - } -} {28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.16.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 9223372036854775807 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.16.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 9223372036854775807 ORDER BY a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.16.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 9223372036854775807 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary2-2.16.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 9223372036854775807 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.16.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 9223372036854775807 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.16.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 9223372036854775807 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.17.1 { - db eval { - SELECT * FROM t1 WHERE r=32768 - } -} {32768 50 0000000000008000} -do_test boundary2-2.17.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000000008000' - } -} {32768 50} -do_test boundary2-2.17.3 { - db eval { - SELECT r, x FROM t1 WHERE a=50 - } -} {32768 0000000000008000} -do_test boundary2-2.17.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 32768 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 51 56 57 62} -do_test boundary2-2.17.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 32768 ORDER BY a DESC - } -} {62 57 56 51 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary2-2.17.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 32768 ORDER BY r - } -} {48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.17.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 32768 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48} -do_test boundary2-2.17.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 32768 ORDER BY x - } -} {48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.17.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 32768 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary2-2.17.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 32768 ORDER BY a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary2-2.17.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 32768 ORDER BY r - } -} {50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.17.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 32768 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50} -do_test boundary2-2.17.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 32768 ORDER BY x - } -} {50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.17.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 32768 ORDER BY a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary2-2.17.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 32768 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary2-2.17.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 32768 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23} -do_test boundary2-2.17.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 32768 ORDER BY r DESC - } -} {23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.17.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 32768 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.17.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 32768 ORDER BY a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 49 50 52 53 54 55 58 59 60 61 63 64} -do_test boundary2-2.17.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 32768 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 50 49 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary2-2.17.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 32768 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50} -do_test boundary2-2.17.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 32768 ORDER BY r DESC - } -} {50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.17.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 32768 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.18.1 { - db eval { - SELECT * FROM t1 WHERE r=-36028797018963968 - } -} {-36028797018963968 64 ff80000000000000} -do_test boundary2-2.18.2 { - db eval { - SELECT r, a FROM t1 WHERE x='ff80000000000000' - } -} {-36028797018963968 64} -do_test boundary2-2.18.3 { - db eval { - SELECT r, x FROM t1 WHERE a=64 - } -} {-36028797018963968 ff80000000000000} -do_test boundary2-2.18.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -36028797018963968 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63} -do_test boundary2-2.18.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -36028797018963968 ORDER BY a DESC - } -} {63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary2-2.18.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -36028797018963968 ORDER BY r - } -} {21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.18.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -36028797018963968 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21} -do_test boundary2-2.18.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -36028797018963968 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.18.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -36028797018963968 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.18.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -36028797018963968 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary2-2.18.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -36028797018963968 ORDER BY r - } -} {64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.18.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -36028797018963968 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64} -do_test boundary2-2.18.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -36028797018963968 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.18.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -36028797018963968 ORDER BY a - } -} {2 55} -do_test boundary2-2.18.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -36028797018963968 ORDER BY a DESC - } -} {55 2} -do_test boundary2-2.18.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -36028797018963968 ORDER BY r - } -} {55 2} -do_test boundary2-2.18.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -36028797018963968 ORDER BY r DESC - } -} {2 55} -do_test boundary2-2.18.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -36028797018963968 ORDER BY x - } -} {55 2} -do_test boundary2-2.18.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -36028797018963968 ORDER BY a - } -} {2 55 64} -do_test boundary2-2.18.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -36028797018963968 ORDER BY a DESC - } -} {64 55 2} -do_test boundary2-2.18.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -36028797018963968 ORDER BY r - } -} {55 2 64} -do_test boundary2-2.18.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -36028797018963968 ORDER BY r DESC - } -} {64 2 55} -do_test boundary2-2.18.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -36028797018963968 ORDER BY x - } -} {55 2 64} -do_test boundary2-2.19.1 { - db eval { - SELECT * FROM t1 WHERE r=65535 - } -} {65535 48 000000000000ffff} -do_test boundary2-2.19.2 { - db eval { - SELECT r, a FROM t1 WHERE x='000000000000ffff' - } -} {65535 48} -do_test boundary2-2.19.3 { - db eval { - SELECT r, x FROM t1 WHERE a=48 - } -} {65535 000000000000ffff} -do_test boundary2-2.19.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 65535 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 51 56 57 62} -do_test boundary2-2.19.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 65535 ORDER BY a DESC - } -} {62 57 56 51 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary2-2.19.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 65535 ORDER BY r - } -} {62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.19.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 65535 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62} -do_test boundary2-2.19.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 65535 ORDER BY x - } -} {62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.19.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 65535 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 51 56 57 62} -do_test boundary2-2.19.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 65535 ORDER BY a DESC - } -} {62 57 56 51 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary2-2.19.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 65535 ORDER BY r - } -} {48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.19.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 65535 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48} -do_test boundary2-2.19.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 65535 ORDER BY x - } -} {48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.19.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 65535 ORDER BY a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 49 50 52 53 54 55 58 59 60 61 63 64} -do_test boundary2-2.19.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 65535 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 50 49 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary2-2.19.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 65535 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50} -do_test boundary2-2.19.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 65535 ORDER BY r DESC - } -} {50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.19.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 65535 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.19.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 65535 ORDER BY a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 48 49 50 52 53 54 55 58 59 60 61 63 64} -do_test boundary2-2.19.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 65535 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 50 49 48 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary2-2.19.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 65535 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48} -do_test boundary2-2.19.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 65535 ORDER BY r DESC - } -} {48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.19.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 65535 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.20.1 { - db eval { - SELECT * FROM t1 WHERE r=4294967295 - } -} {4294967295 14 00000000ffffffff} -do_test boundary2-2.20.2 { - db eval { - SELECT r, a FROM t1 WHERE x='00000000ffffffff' - } -} {4294967295 14} -do_test boundary2-2.20.3 { - db eval { - SELECT r, x FROM t1 WHERE a=14 - } -} {4294967295 00000000ffffffff} -do_test boundary2-2.20.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 4294967295 ORDER BY a - } -} {3 7 10 13 17 19 22 25 26 27 28 34 35 36 39 43 45 46 56 57} -do_test boundary2-2.20.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 4294967295 ORDER BY a DESC - } -} {57 56 46 45 43 39 36 35 34 28 27 26 25 22 19 17 13 10 7 3} -do_test boundary2-2.20.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 4294967295 ORDER BY r - } -} {36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.20.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 4294967295 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36} -do_test boundary2-2.20.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 4294967295 ORDER BY x - } -} {36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.20.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 4294967295 ORDER BY a - } -} {3 7 10 13 14 17 19 22 25 26 27 28 34 35 36 39 43 45 46 56 57} -do_test boundary2-2.20.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 4294967295 ORDER BY a DESC - } -} {57 56 46 45 43 39 36 35 34 28 27 26 25 22 19 17 14 13 10 7 3} -do_test boundary2-2.20.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 4294967295 ORDER BY r - } -} {14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.20.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 4294967295 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14} -do_test boundary2-2.20.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 4294967295 ORDER BY x - } -} {14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.20.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 4294967295 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 20 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.20.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 4294967295 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 20 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary2-2.20.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 4294967295 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51} -do_test boundary2-2.20.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 4294967295 ORDER BY r DESC - } -} {51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.20.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 4294967295 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.20.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 4294967295 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.20.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 4294967295 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-2.20.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 4294967295 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14} -do_test boundary2-2.20.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 4294967295 ORDER BY r DESC - } -} {14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.20.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 4294967295 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.21.1 { - db eval { - SELECT * FROM t1 WHERE r=1099511627775 - } -} {1099511627775 57 000000ffffffffff} -do_test boundary2-2.21.2 { - db eval { - SELECT r, a FROM t1 WHERE x='000000ffffffffff' - } -} {1099511627775 57} -do_test boundary2-2.21.3 { - db eval { - SELECT r, x FROM t1 WHERE a=57 - } -} {1099511627775 000000ffffffffff} -do_test boundary2-2.21.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 1099511627775 ORDER BY a - } -} {3 7 10 13 17 19 25 26 27 28 34 43 45 56} -do_test boundary2-2.21.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 1099511627775 ORDER BY a DESC - } -} {56 45 43 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary2-2.21.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 1099511627775 ORDER BY r - } -} {19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.21.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 1099511627775 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19} -do_test boundary2-2.21.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 1099511627775 ORDER BY x - } -} {19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.21.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 1099511627775 ORDER BY a - } -} {3 7 10 13 17 19 25 26 27 28 34 43 45 56 57} -do_test boundary2-2.21.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 1099511627775 ORDER BY a DESC - } -} {57 56 45 43 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary2-2.21.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 1099511627775 ORDER BY r - } -} {57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.21.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 1099511627775 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57} -do_test boundary2-2.21.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 1099511627775 ORDER BY x - } -} {57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.21.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 1099511627775 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.21.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 1099511627775 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-2.21.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 1099511627775 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35} -do_test boundary2-2.21.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 1099511627775 ORDER BY r DESC - } -} {35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.21.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 1099511627775 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.21.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 1099511627775 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 57 58 59 60 61 62 63 64} -do_test boundary2-2.21.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 1099511627775 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-2.21.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 1099511627775 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57} -do_test boundary2-2.21.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 1099511627775 ORDER BY r DESC - } -} {57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.21.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 1099511627775 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.22.1 { - db eval { - SELECT * FROM t1 WHERE r=-8388608 - } -} {-8388608 37 ffffffffff800000} -do_test boundary2-2.22.2 { - db eval { - SELECT r, a FROM t1 WHERE x='ffffffffff800000' - } -} {-8388608 37} -do_test boundary2-2.22.3 { - db eval { - SELECT r, x FROM t1 WHERE a=37 - } -} {-8388608 ffffffffff800000} -do_test boundary2-2.22.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -8388608 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary2-2.22.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -8388608 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-2.22.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -8388608 ORDER BY r - } -} {29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.22.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -8388608 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29} -do_test boundary2-2.22.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -8388608 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 29 32 54 53 52 33 38} -do_test boundary2-2.22.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -8388608 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary2-2.22.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -8388608 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-2.22.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -8388608 ORDER BY r - } -} {37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.22.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -8388608 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37} -do_test boundary2-2.22.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -8388608 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 37 29 32 54 53 52 33 38} -do_test boundary2-2.22.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -8388608 ORDER BY a - } -} {1 2 11 21 44 47 55 58 63 64} -do_test boundary2-2.22.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -8388608 ORDER BY a DESC - } -} {64 63 58 55 47 44 21 11 2 1} -do_test boundary2-2.22.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -8388608 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1} -do_test boundary2-2.22.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -8388608 ORDER BY r DESC - } -} {1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.22.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -8388608 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1} -do_test boundary2-2.22.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -8388608 ORDER BY a - } -} {1 2 11 21 37 44 47 55 58 63 64} -do_test boundary2-2.22.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -8388608 ORDER BY a DESC - } -} {64 63 58 55 47 44 37 21 11 2 1} -do_test boundary2-2.22.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -8388608 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37} -do_test boundary2-2.22.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -8388608 ORDER BY r DESC - } -} {37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.22.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -8388608 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37} -do_test boundary2-2.23.1 { - db eval { - SELECT * FROM t1 WHERE r=549755813888 - } -} {549755813888 35 0000008000000000} -do_test boundary2-2.23.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000008000000000' - } -} {549755813888 35} -do_test boundary2-2.23.3 { - db eval { - SELECT r, x FROM t1 WHERE a=35 - } -} {549755813888 0000008000000000} -do_test boundary2-2.23.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 549755813888 ORDER BY a - } -} {3 7 10 13 17 19 25 26 27 28 34 43 45 56 57} -do_test boundary2-2.23.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 549755813888 ORDER BY a DESC - } -} {57 56 45 43 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary2-2.23.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 549755813888 ORDER BY r - } -} {57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.23.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 549755813888 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57} -do_test boundary2-2.23.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 549755813888 ORDER BY x - } -} {57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.23.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 549755813888 ORDER BY a - } -} {3 7 10 13 17 19 25 26 27 28 34 35 43 45 56 57} -do_test boundary2-2.23.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 549755813888 ORDER BY a DESC - } -} {57 56 45 43 35 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary2-2.23.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 549755813888 ORDER BY r - } -} {35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.23.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 549755813888 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35} -do_test boundary2-2.23.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 549755813888 ORDER BY x - } -} {35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.23.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 549755813888 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.23.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 549755813888 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-2.23.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 549755813888 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46} -do_test boundary2-2.23.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 549755813888 ORDER BY r DESC - } -} {46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.23.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 549755813888 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.23.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 549755813888 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.23.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 549755813888 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-2.23.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 549755813888 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35} -do_test boundary2-2.23.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 549755813888 ORDER BY r DESC - } -} {35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.23.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 549755813888 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.24.1 { - db eval { - SELECT * FROM t1 WHERE r=8388607 - } -} {8388607 18 00000000007fffff} -do_test boundary2-2.24.2 { - db eval { - SELECT r, a FROM t1 WHERE x='00000000007fffff' - } -} {8388607 18} -do_test boundary2-2.24.3 { - db eval { - SELECT r, x FROM t1 WHERE a=18 - } -} {8388607 00000000007fffff} -do_test boundary2-2.24.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 8388607 ORDER BY a - } -} {3 6 7 9 10 12 13 14 17 19 20 22 24 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary2-2.24.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 8388607 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 24 22 20 19 17 14 13 12 10 9 7 6 3} -do_test boundary2-2.24.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 8388607 ORDER BY r - } -} {24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.24.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 8388607 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24} -do_test boundary2-2.24.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 8388607 ORDER BY x - } -} {24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.24.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 8388607 ORDER BY a - } -} {3 6 7 9 10 12 13 14 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary2-2.24.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 8388607 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 14 13 12 10 9 7 6 3} -do_test boundary2-2.24.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 8388607 ORDER BY r - } -} {18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.24.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 8388607 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18} -do_test boundary2-2.24.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 8388607 ORDER BY x - } -} {18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.24.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 8388607 ORDER BY a - } -} {1 2 4 5 8 11 15 16 21 23 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.24.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 8388607 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 23 21 16 15 11 8 5 4 2 1} -do_test boundary2-2.24.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 8388607 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42} -do_test boundary2-2.24.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 8388607 ORDER BY r DESC - } -} {42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.24.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 8388607 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.24.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 8388607 ORDER BY a - } -} {1 2 4 5 8 11 15 16 18 21 23 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.24.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 8388607 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 23 21 18 16 15 11 8 5 4 2 1} -do_test boundary2-2.24.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 8388607 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18} -do_test boundary2-2.24.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 8388607 ORDER BY r DESC - } -} {18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.24.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 8388607 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.25.1 { - db eval { - SELECT * FROM t1 WHERE r=-3 - } -} {-3 52 fffffffffffffffd} -do_test boundary2-2.25.2 { - db eval { - SELECT r, a FROM t1 WHERE x='fffffffffffffffd' - } -} {-3 52} -do_test boundary2-2.25.3 { - db eval { - SELECT r, x FROM t1 WHERE a=52 - } -} {-3 fffffffffffffffd} -do_test boundary2-2.25.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -3 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 56 57 59 60 61 62} -do_test boundary2-2.25.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -3 ORDER BY a DESC - } -} {62 61 60 59 57 56 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-2.25.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -3 ORDER BY r - } -} {33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.25.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -3 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33} -do_test boundary2-2.25.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -3 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 33 38} -do_test boundary2-2.25.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -3 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 56 57 59 60 61 62} -do_test boundary2-2.25.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -3 ORDER BY a DESC - } -} {62 61 60 59 57 56 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-2.25.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -3 ORDER BY r - } -} {52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.25.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -3 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52} -do_test boundary2-2.25.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -3 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 52 33 38} -do_test boundary2-2.25.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -3 ORDER BY a - } -} {1 2 11 21 29 32 37 44 47 53 54 55 58 63 64} -do_test boundary2-2.25.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -3 ORDER BY a DESC - } -} {64 63 58 55 54 53 47 44 37 32 29 21 11 2 1} -do_test boundary2-2.25.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -3 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53} -do_test boundary2-2.25.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -3 ORDER BY r DESC - } -} {53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.25.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -3 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53} -do_test boundary2-2.25.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -3 ORDER BY a - } -} {1 2 11 21 29 32 37 44 47 52 53 54 55 58 63 64} -do_test boundary2-2.25.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -3 ORDER BY a DESC - } -} {64 63 58 55 54 53 52 47 44 37 32 29 21 11 2 1} -do_test boundary2-2.25.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -3 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52} -do_test boundary2-2.25.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -3 ORDER BY r DESC - } -} {52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.25.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -3 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52} -do_test boundary2-2.26.1 { - db eval { - SELECT * FROM t1 WHERE r=0 - } -} {0 59 0000000000000000} -do_test boundary2-2.26.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000000000000' - } -} {0 59} -do_test boundary2-2.26.3 { - db eval { - SELECT r, x FROM t1 WHERE a=59 - } -} {0 0000000000000000} -do_test boundary2-2.26.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 0 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 41 42 43 45 46 48 49 50 51 56 57 60 61 62} -do_test boundary2-2.26.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 0 ORDER BY a DESC - } -} {62 61 60 57 56 51 50 49 48 46 45 43 42 41 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-2.26.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 0 ORDER BY r - } -} {60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.26.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 0 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60} -do_test boundary2-2.26.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 0 ORDER BY x - } -} {60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.26.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 0 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 41 42 43 45 46 48 49 50 51 56 57 59 60 61 62} -do_test boundary2-2.26.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 0 ORDER BY a DESC - } -} {62 61 60 59 57 56 51 50 49 48 46 45 43 42 41 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-2.26.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 0 ORDER BY r - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.26.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 0 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59} -do_test boundary2-2.26.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 0 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.26.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 0 ORDER BY a - } -} {1 2 11 21 29 32 33 37 38 44 47 52 53 54 55 58 63 64} -do_test boundary2-2.26.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 0 ORDER BY a DESC - } -} {64 63 58 55 54 53 52 47 44 38 37 33 32 29 21 11 2 1} -do_test boundary2-2.26.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 0 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.26.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 0 ORDER BY r DESC - } -} {38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.26.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 0 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.26.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 0 ORDER BY a - } -} {1 2 11 21 29 32 33 37 38 44 47 52 53 54 55 58 59 63 64} -do_test boundary2-2.26.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 0 ORDER BY a DESC - } -} {64 63 59 58 55 54 53 52 47 44 38 37 33 32 29 21 11 2 1} -do_test boundary2-2.26.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 0 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59} -do_test boundary2-2.26.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 0 ORDER BY r DESC - } -} {59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.26.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 0 ORDER BY x - } -} {59 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.27.1 { - db eval { - SELECT * FROM t1 WHERE r=-1 - } -} {-1 38 ffffffffffffffff} -do_test boundary2-2.27.2 { - db eval { - SELECT r, a FROM t1 WHERE x='ffffffffffffffff' - } -} {-1 38} -do_test boundary2-2.27.3 { - db eval { - SELECT r, x FROM t1 WHERE a=38 - } -} {-1 ffffffffffffffff} -do_test boundary2-2.27.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -1 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 41 42 43 45 46 48 49 50 51 56 57 59 60 61 62} -do_test boundary2-2.27.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -1 ORDER BY a DESC - } -} {62 61 60 59 57 56 51 50 49 48 46 45 43 42 41 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-2.27.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -1 ORDER BY r - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.27.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -1 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59} -do_test boundary2-2.27.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -1 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.27.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -1 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 56 57 59 60 61 62} -do_test boundary2-2.27.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -1 ORDER BY a DESC - } -} {62 61 60 59 57 56 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-2.27.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -1 ORDER BY r - } -} {38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.27.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -1 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38} -do_test boundary2-2.27.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -1 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 38} -do_test boundary2-2.27.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -1 ORDER BY a - } -} {1 2 11 21 29 32 33 37 44 47 52 53 54 55 58 63 64} -do_test boundary2-2.27.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -1 ORDER BY a DESC - } -} {64 63 58 55 54 53 52 47 44 37 33 32 29 21 11 2 1} -do_test boundary2-2.27.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -1 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33} -do_test boundary2-2.27.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -1 ORDER BY r DESC - } -} {33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.27.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -1 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33} -do_test boundary2-2.27.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -1 ORDER BY a - } -} {1 2 11 21 29 32 33 37 38 44 47 52 53 54 55 58 63 64} -do_test boundary2-2.27.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -1 ORDER BY a DESC - } -} {64 63 58 55 54 53 52 47 44 38 37 33 32 29 21 11 2 1} -do_test boundary2-2.27.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -1 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.27.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -1 ORDER BY r DESC - } -} {38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.27.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -1 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.28.1 { - db eval { - SELECT * FROM t1 WHERE r=-2 - } -} {-2 33 fffffffffffffffe} -do_test boundary2-2.28.2 { - db eval { - SELECT r, a FROM t1 WHERE x='fffffffffffffffe' - } -} {-2 33} -do_test boundary2-2.28.3 { - db eval { - SELECT r, x FROM t1 WHERE a=33 - } -} {-2 fffffffffffffffe} -do_test boundary2-2.28.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -2 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 56 57 59 60 61 62} -do_test boundary2-2.28.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -2 ORDER BY a DESC - } -} {62 61 60 59 57 56 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-2.28.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -2 ORDER BY r - } -} {38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.28.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -2 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38} -do_test boundary2-2.28.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -2 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 38} -do_test boundary2-2.28.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -2 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 56 57 59 60 61 62} -do_test boundary2-2.28.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -2 ORDER BY a DESC - } -} {62 61 60 59 57 56 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-2.28.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -2 ORDER BY r - } -} {33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.28.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -2 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33} -do_test boundary2-2.28.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -2 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 33 38} -do_test boundary2-2.28.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -2 ORDER BY a - } -} {1 2 11 21 29 32 37 44 47 52 53 54 55 58 63 64} -do_test boundary2-2.28.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -2 ORDER BY a DESC - } -} {64 63 58 55 54 53 52 47 44 37 32 29 21 11 2 1} -do_test boundary2-2.28.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -2 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52} -do_test boundary2-2.28.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -2 ORDER BY r DESC - } -} {52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.28.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -2 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52} -do_test boundary2-2.28.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -2 ORDER BY a - } -} {1 2 11 21 29 32 33 37 44 47 52 53 54 55 58 63 64} -do_test boundary2-2.28.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -2 ORDER BY a DESC - } -} {64 63 58 55 54 53 52 47 44 37 33 32 29 21 11 2 1} -do_test boundary2-2.28.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -2 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33} -do_test boundary2-2.28.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -2 ORDER BY r DESC - } -} {33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.28.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -2 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33} -do_test boundary2-2.29.1 { - db eval { - SELECT * FROM t1 WHERE r=2097152 - } -} {2097152 42 0000000000200000} -do_test boundary2-2.29.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000000200000' - } -} {2097152 42} -do_test boundary2-2.29.3 { - db eval { - SELECT r, x FROM t1 WHERE a=42 - } -} {2097152 0000000000200000} -do_test boundary2-2.29.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 2097152 ORDER BY a - } -} {3 6 7 9 10 12 13 14 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary2-2.29.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 2097152 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 14 13 12 10 9 7 6 3} -do_test boundary2-2.29.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 2097152 ORDER BY r - } -} {18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.29.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 2097152 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18} -do_test boundary2-2.29.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 2097152 ORDER BY x - } -} {18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.29.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 2097152 ORDER BY a - } -} {3 6 7 9 10 12 13 14 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 51 56 57} -do_test boundary2-2.29.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 2097152 ORDER BY a DESC - } -} {57 56 51 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 14 13 12 10 9 7 6 3} -do_test boundary2-2.29.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 2097152 ORDER BY r - } -} {42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.29.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 2097152 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42} -do_test boundary2-2.29.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 2097152 ORDER BY x - } -} {42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.29.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 2097152 ORDER BY a - } -} {1 2 4 5 8 11 15 16 21 23 29 30 31 32 33 37 38 41 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.29.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 2097152 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 41 38 37 33 32 31 30 29 23 21 16 15 11 8 5 4 2 1} -do_test boundary2-2.29.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 2097152 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15} -do_test boundary2-2.29.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 2097152 ORDER BY r DESC - } -} {15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.29.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 2097152 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.29.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 2097152 ORDER BY a - } -} {1 2 4 5 8 11 15 16 21 23 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.29.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 2097152 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 23 21 16 15 11 8 5 4 2 1} -do_test boundary2-2.29.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 2097152 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42} -do_test boundary2-2.29.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 2097152 ORDER BY r DESC - } -} {42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.29.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 2097152 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.30.1 { - db eval { - SELECT * FROM t1 WHERE r=128 - } -} {128 49 0000000000000080} -do_test boundary2-2.30.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000000000080' - } -} {128 49} -do_test boundary2-2.30.3 { - db eval { - SELECT r, x FROM t1 WHERE a=49 - } -} {128 0000000000000080} -do_test boundary2-2.30.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 128 ORDER BY a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 34 35 36 39 40 42 43 45 46 48 50 51 56 57 61 62} -do_test boundary2-2.30.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 128 ORDER BY a DESC - } -} {62 61 57 56 51 50 48 46 45 43 42 40 39 36 35 34 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary2-2.30.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 128 ORDER BY r - } -} {30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.30.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 128 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30} -do_test boundary2-2.30.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 128 ORDER BY x - } -} {30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.30.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 128 ORDER BY a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary2-2.30.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 128 ORDER BY a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary2-2.30.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 128 ORDER BY r - } -} {49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.30.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 128 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49} -do_test boundary2-2.30.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 128 ORDER BY x - } -} {49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.30.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 128 ORDER BY a - } -} {1 2 4 5 11 21 29 31 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary2-2.30.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 128 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 31 29 21 11 5 4 2 1} -do_test boundary2-2.30.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 128 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4} -do_test boundary2-2.30.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 128 ORDER BY r DESC - } -} {4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.30.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 128 ORDER BY x - } -} {59 60 41 5 31 4 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.30.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 128 ORDER BY a - } -} {1 2 4 5 11 21 29 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 63 64} -do_test boundary2-2.30.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 128 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 29 21 11 5 4 2 1} -do_test boundary2-2.30.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 128 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49} -do_test boundary2-2.30.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 128 ORDER BY r DESC - } -} {49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.30.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 128 ORDER BY x - } -} {59 60 41 5 31 4 49 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.31.1 { - db eval { - SELECT * FROM t1 WHERE r=255 - } -} {255 30 00000000000000ff} -do_test boundary2-2.31.2 { - db eval { - SELECT r, a FROM t1 WHERE x='00000000000000ff' - } -} {255 30} -do_test boundary2-2.31.3 { - db eval { - SELECT r, x FROM t1 WHERE a=30 - } -} {255 00000000000000ff} -do_test boundary2-2.31.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 255 ORDER BY a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 61 62} -do_test boundary2-2.31.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 255 ORDER BY a DESC - } -} {62 61 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary2-2.31.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 255 ORDER BY r - } -} {61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.31.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 255 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61} -do_test boundary2-2.31.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 255 ORDER BY x - } -} {61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.31.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 255 ORDER BY a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 34 35 36 39 40 42 43 45 46 48 50 51 56 57 61 62} -do_test boundary2-2.31.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 255 ORDER BY a DESC - } -} {62 61 57 56 51 50 48 46 45 43 42 40 39 36 35 34 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary2-2.31.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 255 ORDER BY r - } -} {30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.31.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 255 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30} -do_test boundary2-2.31.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 255 ORDER BY x - } -} {30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.31.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 255 ORDER BY a - } -} {1 2 4 5 11 21 29 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 63 64} -do_test boundary2-2.31.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 255 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 29 21 11 5 4 2 1} -do_test boundary2-2.31.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 255 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49} -do_test boundary2-2.31.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 255 ORDER BY r DESC - } -} {49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.31.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 255 ORDER BY x - } -} {59 60 41 5 31 4 49 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.31.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 255 ORDER BY a - } -} {1 2 4 5 11 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 63 64} -do_test boundary2-2.31.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 255 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 11 5 4 2 1} -do_test boundary2-2.31.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 255 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30} -do_test boundary2-2.31.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 255 ORDER BY r DESC - } -} {30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.31.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 255 ORDER BY x - } -} {59 60 41 5 31 4 49 30 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.32.1 { - db eval { - SELECT * FROM t1 WHERE r=-2147483648 - } -} {-2147483648 11 ffffffff80000000} -do_test boundary2-2.32.2 { - db eval { - SELECT r, a FROM t1 WHERE x='ffffffff80000000' - } -} {-2147483648 11} -do_test boundary2-2.32.3 { - db eval { - SELECT r, x FROM t1 WHERE a=11 - } -} {-2147483648 ffffffff80000000} -do_test boundary2-2.32.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -2147483648 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary2-2.32.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -2147483648 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3 1} -do_test boundary2-2.32.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -2147483648 ORDER BY r - } -} {1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.32.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -2147483648 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1} -do_test boundary2-2.32.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -2147483648 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.32.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -2147483648 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary2-2.32.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -2147483648 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary2-2.32.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -2147483648 ORDER BY r - } -} {11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.32.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -2147483648 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11} -do_test boundary2-2.32.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -2147483648 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.32.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -2147483648 ORDER BY a - } -} {2 21 44 47 55 58 63 64} -do_test boundary2-2.32.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -2147483648 ORDER BY a DESC - } -} {64 63 58 55 47 44 21 2} -do_test boundary2-2.32.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -2147483648 ORDER BY r - } -} {55 2 64 21 44 58 63 47} -do_test boundary2-2.32.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -2147483648 ORDER BY r DESC - } -} {47 63 58 44 21 64 2 55} -do_test boundary2-2.32.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -2147483648 ORDER BY x - } -} {55 2 64 21 44 58 63 47} -do_test boundary2-2.32.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -2147483648 ORDER BY a - } -} {2 11 21 44 47 55 58 63 64} -do_test boundary2-2.32.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -2147483648 ORDER BY a DESC - } -} {64 63 58 55 47 44 21 11 2} -do_test boundary2-2.32.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -2147483648 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11} -do_test boundary2-2.32.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -2147483648 ORDER BY r DESC - } -} {11 47 63 58 44 21 64 2 55} -do_test boundary2-2.32.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -2147483648 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11} -do_test boundary2-2.33.1 { - db eval { - SELECT * FROM t1 WHERE r=34359738367 - } -} {34359738367 39 00000007ffffffff} -do_test boundary2-2.33.2 { - db eval { - SELECT r, a FROM t1 WHERE x='00000007ffffffff' - } -} {34359738367 39} -do_test boundary2-2.33.3 { - db eval { - SELECT r, x FROM t1 WHERE a=39 - } -} {34359738367 00000007ffffffff} -do_test boundary2-2.33.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 34359738367 ORDER BY a - } -} {3 7 10 13 17 19 22 25 26 27 28 34 35 43 45 46 56 57} -do_test boundary2-2.33.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 34359738367 ORDER BY a DESC - } -} {57 56 46 45 43 35 34 28 27 26 25 22 19 17 13 10 7 3} -do_test boundary2-2.33.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 34359738367 ORDER BY r - } -} {22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.33.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 34359738367 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22} -do_test boundary2-2.33.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 34359738367 ORDER BY x - } -} {22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.33.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 34359738367 ORDER BY a - } -} {3 7 10 13 17 19 22 25 26 27 28 34 35 39 43 45 46 56 57} -do_test boundary2-2.33.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 34359738367 ORDER BY a DESC - } -} {57 56 46 45 43 39 35 34 28 27 26 25 22 19 17 13 10 7 3} -do_test boundary2-2.33.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 34359738367 ORDER BY r - } -} {39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.33.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 34359738367 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39} -do_test boundary2-2.33.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 34359738367 ORDER BY x - } -} {39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.33.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 34359738367 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 23 24 29 30 31 32 33 36 37 38 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.33.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 34359738367 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 38 37 36 33 32 31 30 29 24 23 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-2.33.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 34359738367 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36} -do_test boundary2-2.33.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 34359738367 ORDER BY r DESC - } -} {36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.33.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 34359738367 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.33.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 34359738367 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 23 24 29 30 31 32 33 36 37 38 39 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.33.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 34359738367 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 39 38 37 36 33 32 31 30 29 24 23 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-2.33.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 34359738367 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39} -do_test boundary2-2.33.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 34359738367 ORDER BY r DESC - } -} {39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.33.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 34359738367 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.34.1 { - db eval { - SELECT * FROM t1 WHERE r=-549755813889 - } -} {-549755813889 58 ffffff7fffffffff} -do_test boundary2-2.34.2 { - db eval { - SELECT r, a FROM t1 WHERE x='ffffff7fffffffff' - } -} {-549755813889 58} -do_test boundary2-2.34.3 { - db eval { - SELECT r, x FROM t1 WHERE a=58 - } -} {-549755813889 ffffff7fffffffff} -do_test boundary2-2.34.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -549755813889 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 47 48 49 50 51 52 53 54 56 57 59 60 61 62 63} -do_test boundary2-2.34.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -549755813889 ORDER BY a DESC - } -} {63 62 61 60 59 57 56 54 53 52 51 50 49 48 47 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary2-2.34.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -549755813889 ORDER BY r - } -} {63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.34.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -549755813889 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63} -do_test boundary2-2.34.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -549755813889 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.34.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -549755813889 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63} -do_test boundary2-2.34.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -549755813889 ORDER BY a DESC - } -} {63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary2-2.34.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -549755813889 ORDER BY r - } -} {58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.34.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -549755813889 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58} -do_test boundary2-2.34.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -549755813889 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.34.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -549755813889 ORDER BY a - } -} {2 21 44 55 64} -do_test boundary2-2.34.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -549755813889 ORDER BY a DESC - } -} {64 55 44 21 2} -do_test boundary2-2.34.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -549755813889 ORDER BY r - } -} {55 2 64 21 44} -do_test boundary2-2.34.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -549755813889 ORDER BY r DESC - } -} {44 21 64 2 55} -do_test boundary2-2.34.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -549755813889 ORDER BY x - } -} {55 2 64 21 44} -do_test boundary2-2.34.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -549755813889 ORDER BY a - } -} {2 21 44 55 58 64} -do_test boundary2-2.34.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -549755813889 ORDER BY a DESC - } -} {64 58 55 44 21 2} -do_test boundary2-2.34.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -549755813889 ORDER BY r - } -} {55 2 64 21 44 58} -do_test boundary2-2.34.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -549755813889 ORDER BY r DESC - } -} {58 44 21 64 2 55} -do_test boundary2-2.34.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -549755813889 ORDER BY x - } -} {55 2 64 21 44 58} -do_test boundary2-2.35.1 { - db eval { - SELECT * FROM t1 WHERE r=-32768 - } -} {-32768 32 ffffffffffff8000} -do_test boundary2-2.35.2 { - db eval { - SELECT r, a FROM t1 WHERE x='ffffffffffff8000' - } -} {-32768 32} -do_test boundary2-2.35.3 { - db eval { - SELECT r, x FROM t1 WHERE a=32 - } -} {-32768 ffffffffffff8000} -do_test boundary2-2.35.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -32768 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary2-2.35.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -32768 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-2.35.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -32768 ORDER BY r - } -} {54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.35.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -32768 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54} -do_test boundary2-2.35.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -32768 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 54 53 52 33 38} -do_test boundary2-2.35.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -32768 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 32 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary2-2.35.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -32768 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 32 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-2.35.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -32768 ORDER BY r - } -} {32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.35.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -32768 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32} -do_test boundary2-2.35.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -32768 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 32 54 53 52 33 38} -do_test boundary2-2.35.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -32768 ORDER BY a - } -} {1 2 11 21 29 37 44 47 55 58 63 64} -do_test boundary2-2.35.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -32768 ORDER BY a DESC - } -} {64 63 58 55 47 44 37 29 21 11 2 1} -do_test boundary2-2.35.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -32768 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29} -do_test boundary2-2.35.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -32768 ORDER BY r DESC - } -} {29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.35.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -32768 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29} -do_test boundary2-2.35.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -32768 ORDER BY a - } -} {1 2 11 21 29 32 37 44 47 55 58 63 64} -do_test boundary2-2.35.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -32768 ORDER BY a DESC - } -} {64 63 58 55 47 44 37 32 29 21 11 2 1} -do_test boundary2-2.35.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -32768 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32} -do_test boundary2-2.35.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -32768 ORDER BY r DESC - } -} {32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.35.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -32768 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32} -do_test boundary2-2.36.1 { - db eval { - SELECT * FROM t1 WHERE r=2147483647 - } -} {2147483647 20 000000007fffffff} -do_test boundary2-2.36.2 { - db eval { - SELECT r, a FROM t1 WHERE x='000000007fffffff' - } -} {2147483647 20} -do_test boundary2-2.36.3 { - db eval { - SELECT r, x FROM t1 WHERE a=20 - } -} {2147483647 000000007fffffff} -do_test boundary2-2.36.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 2147483647 ORDER BY a - } -} {3 7 10 13 14 17 19 22 25 26 27 28 34 35 36 39 43 45 46 51 56 57} -do_test boundary2-2.36.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 2147483647 ORDER BY a DESC - } -} {57 56 51 46 45 43 39 36 35 34 28 27 26 25 22 19 17 14 13 10 7 3} -do_test boundary2-2.36.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 2147483647 ORDER BY r - } -} {51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.36.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 2147483647 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51} -do_test boundary2-2.36.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 2147483647 ORDER BY x - } -} {51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.36.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 2147483647 ORDER BY a - } -} {3 7 10 13 14 17 19 20 22 25 26 27 28 34 35 36 39 43 45 46 51 56 57} -do_test boundary2-2.36.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 2147483647 ORDER BY a DESC - } -} {57 56 51 46 45 43 39 36 35 34 28 27 26 25 22 20 19 17 14 13 10 7 3} -do_test boundary2-2.36.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 2147483647 ORDER BY r - } -} {20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.36.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 2147483647 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20} -do_test boundary2-2.36.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 2147483647 ORDER BY x - } -} {20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.36.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 2147483647 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.36.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 2147483647 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary2-2.36.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 2147483647 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40} -do_test boundary2-2.36.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 2147483647 ORDER BY r DESC - } -} {40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.36.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 2147483647 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.36.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 2147483647 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 20 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.36.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 2147483647 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 20 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary2-2.36.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 2147483647 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20} -do_test boundary2-2.36.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 2147483647 ORDER BY r DESC - } -} {20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.36.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 2147483647 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.37.1 { - db eval { - SELECT * FROM t1 WHERE r=-129 - } -} {-129 54 ffffffffffffff7f} -do_test boundary2-2.37.2 { - db eval { - SELECT r, a FROM t1 WHERE x='ffffffffffffff7f' - } -} {-129 54} -do_test boundary2-2.37.3 { - db eval { - SELECT r, x FROM t1 WHERE a=54 - } -} {-129 ffffffffffffff7f} -do_test boundary2-2.37.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -129 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 56 57 59 60 61 62} -do_test boundary2-2.37.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -129 ORDER BY a DESC - } -} {62 61 60 59 57 56 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-2.37.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -129 ORDER BY r - } -} {53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.37.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -129 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53} -do_test boundary2-2.37.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -129 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 53 52 33 38} -do_test boundary2-2.37.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -129 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary2-2.37.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -129 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-2.37.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -129 ORDER BY r - } -} {54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.37.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -129 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54} -do_test boundary2-2.37.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -129 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 54 53 52 33 38} -do_test boundary2-2.37.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -129 ORDER BY a - } -} {1 2 11 21 29 32 37 44 47 55 58 63 64} -do_test boundary2-2.37.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -129 ORDER BY a DESC - } -} {64 63 58 55 47 44 37 32 29 21 11 2 1} -do_test boundary2-2.37.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -129 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32} -do_test boundary2-2.37.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -129 ORDER BY r DESC - } -} {32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.37.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -129 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32} -do_test boundary2-2.37.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -129 ORDER BY a - } -} {1 2 11 21 29 32 37 44 47 54 55 58 63 64} -do_test boundary2-2.37.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -129 ORDER BY a DESC - } -} {64 63 58 55 54 47 44 37 32 29 21 11 2 1} -do_test boundary2-2.37.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -129 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54} -do_test boundary2-2.37.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -129 ORDER BY r DESC - } -} {54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.37.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -129 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54} -do_test boundary2-2.38.1 { - db eval { - SELECT * FROM t1 WHERE r=-128 - } -} {-128 53 ffffffffffffff80} -do_test boundary2-2.38.2 { - db eval { - SELECT r, a FROM t1 WHERE x='ffffffffffffff80' - } -} {-128 53} -do_test boundary2-2.38.3 { - db eval { - SELECT r, x FROM t1 WHERE a=53 - } -} {-128 ffffffffffffff80} -do_test boundary2-2.38.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -128 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 56 57 59 60 61 62} -do_test boundary2-2.38.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -128 ORDER BY a DESC - } -} {62 61 60 59 57 56 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-2.38.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -128 ORDER BY r - } -} {52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.38.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -128 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52} -do_test boundary2-2.38.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -128 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 52 33 38} -do_test boundary2-2.38.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -128 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 56 57 59 60 61 62} -do_test boundary2-2.38.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -128 ORDER BY a DESC - } -} {62 61 60 59 57 56 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-2.38.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -128 ORDER BY r - } -} {53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.38.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -128 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53} -do_test boundary2-2.38.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -128 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 53 52 33 38} -do_test boundary2-2.38.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -128 ORDER BY a - } -} {1 2 11 21 29 32 37 44 47 54 55 58 63 64} -do_test boundary2-2.38.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -128 ORDER BY a DESC - } -} {64 63 58 55 54 47 44 37 32 29 21 11 2 1} -do_test boundary2-2.38.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -128 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54} -do_test boundary2-2.38.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -128 ORDER BY r DESC - } -} {54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.38.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -128 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54} -do_test boundary2-2.38.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -128 ORDER BY a - } -} {1 2 11 21 29 32 37 44 47 53 54 55 58 63 64} -do_test boundary2-2.38.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -128 ORDER BY a DESC - } -} {64 63 58 55 54 53 47 44 37 32 29 21 11 2 1} -do_test boundary2-2.38.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -128 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53} -do_test boundary2-2.38.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -128 ORDER BY r DESC - } -} {53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.38.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -128 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53} -do_test boundary2-2.39.1 { - db eval { - SELECT * FROM t1 WHERE r=72057594037927936 - } -} {72057594037927936 28 0100000000000000} -do_test boundary2-2.39.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0100000000000000' - } -} {72057594037927936 28} -do_test boundary2-2.39.3 { - db eval { - SELECT r, x FROM t1 WHERE a=28 - } -} {72057594037927936 0100000000000000} -do_test boundary2-2.39.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 72057594037927936 ORDER BY a - } -} {3} -do_test boundary2-2.39.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 72057594037927936 ORDER BY a DESC - } -} {3} -do_test boundary2-2.39.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 72057594037927936 ORDER BY r - } -} {3} -do_test boundary2-2.39.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 72057594037927936 ORDER BY r DESC - } -} {3} -do_test boundary2-2.39.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 72057594037927936 ORDER BY x - } -} {3} -do_test boundary2-2.39.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 72057594037927936 ORDER BY a - } -} {3 28} -do_test boundary2-2.39.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 72057594037927936 ORDER BY a DESC - } -} {28 3} -do_test boundary2-2.39.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 72057594037927936 ORDER BY r - } -} {28 3} -do_test boundary2-2.39.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 72057594037927936 ORDER BY r DESC - } -} {3 28} -do_test boundary2-2.39.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 72057594037927936 ORDER BY x - } -} {28 3} -do_test boundary2-2.39.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 72057594037927936 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.39.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 72057594037927936 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-2.39.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 72057594037927936 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17} -do_test boundary2-2.39.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 72057594037927936 ORDER BY r DESC - } -} {17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.39.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 72057594037927936 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.39.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 72057594037927936 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.39.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 72057594037927936 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-2.39.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 72057594037927936 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28} -do_test boundary2-2.39.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 72057594037927936 ORDER BY r DESC - } -} {28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.39.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 72057594037927936 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.40.1 { - db eval { - SELECT * FROM t1 WHERE r=2147483648 - } -} {2147483648 51 0000000080000000} -do_test boundary2-2.40.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000080000000' - } -} {2147483648 51} -do_test boundary2-2.40.3 { - db eval { - SELECT r, x FROM t1 WHERE a=51 - } -} {2147483648 0000000080000000} -do_test boundary2-2.40.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 2147483648 ORDER BY a - } -} {3 7 10 13 14 17 19 22 25 26 27 28 34 35 36 39 43 45 46 56 57} -do_test boundary2-2.40.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 2147483648 ORDER BY a DESC - } -} {57 56 46 45 43 39 36 35 34 28 27 26 25 22 19 17 14 13 10 7 3} -do_test boundary2-2.40.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 2147483648 ORDER BY r - } -} {14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.40.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 2147483648 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14} -do_test boundary2-2.40.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 2147483648 ORDER BY x - } -} {14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.40.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 2147483648 ORDER BY a - } -} {3 7 10 13 14 17 19 22 25 26 27 28 34 35 36 39 43 45 46 51 56 57} -do_test boundary2-2.40.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 2147483648 ORDER BY a DESC - } -} {57 56 51 46 45 43 39 36 35 34 28 27 26 25 22 19 17 14 13 10 7 3} -do_test boundary2-2.40.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 2147483648 ORDER BY r - } -} {51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.40.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 2147483648 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51} -do_test boundary2-2.40.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 2147483648 ORDER BY x - } -} {51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.40.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 2147483648 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 20 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.40.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 2147483648 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 20 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary2-2.40.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 2147483648 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20} -do_test boundary2-2.40.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 2147483648 ORDER BY r DESC - } -} {20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.40.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 2147483648 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.40.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 2147483648 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 20 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.40.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 2147483648 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 20 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary2-2.40.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 2147483648 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51} -do_test boundary2-2.40.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 2147483648 ORDER BY r DESC - } -} {51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.40.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 2147483648 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.41.1 { - db eval { - SELECT * FROM t1 WHERE r=549755813887 - } -} {549755813887 46 0000007fffffffff} -do_test boundary2-2.41.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000007fffffffff' - } -} {549755813887 46} -do_test boundary2-2.41.3 { - db eval { - SELECT r, x FROM t1 WHERE a=46 - } -} {549755813887 0000007fffffffff} -do_test boundary2-2.41.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 549755813887 ORDER BY a - } -} {3 7 10 13 17 19 25 26 27 28 34 35 43 45 56 57} -do_test boundary2-2.41.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 549755813887 ORDER BY a DESC - } -} {57 56 45 43 35 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary2-2.41.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 549755813887 ORDER BY r - } -} {35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.41.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 549755813887 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35} -do_test boundary2-2.41.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 549755813887 ORDER BY x - } -} {35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.41.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 549755813887 ORDER BY a - } -} {3 7 10 13 17 19 25 26 27 28 34 35 43 45 46 56 57} -do_test boundary2-2.41.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 549755813887 ORDER BY a DESC - } -} {57 56 46 45 43 35 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary2-2.41.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 549755813887 ORDER BY r - } -} {46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.41.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 549755813887 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46} -do_test boundary2-2.41.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 549755813887 ORDER BY x - } -} {46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.41.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 549755813887 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 36 37 38 39 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.41.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 549755813887 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 39 38 37 36 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-2.41.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 549755813887 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22} -do_test boundary2-2.41.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 549755813887 ORDER BY r DESC - } -} {22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.41.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 549755813887 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.41.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 549755813887 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.41.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 549755813887 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-2.41.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 549755813887 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46} -do_test boundary2-2.41.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 549755813887 ORDER BY r DESC - } -} {46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.41.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 549755813887 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.42.1 { - db eval { - SELECT * FROM t1 WHERE r=-549755813888 - } -} {-549755813888 63 ffffff8000000000} -do_test boundary2-2.42.2 { - db eval { - SELECT r, a FROM t1 WHERE x='ffffff8000000000' - } -} {-549755813888 63} -do_test boundary2-2.42.3 { - db eval { - SELECT r, x FROM t1 WHERE a=63 - } -} {-549755813888 ffffff8000000000} -do_test boundary2-2.42.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -549755813888 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 47 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary2-2.42.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -549755813888 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 47 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary2-2.42.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -549755813888 ORDER BY r - } -} {47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.42.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -549755813888 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47} -do_test boundary2-2.42.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -549755813888 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.42.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -549755813888 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 47 48 49 50 51 52 53 54 56 57 59 60 61 62 63} -do_test boundary2-2.42.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -549755813888 ORDER BY a DESC - } -} {63 62 61 60 59 57 56 54 53 52 51 50 49 48 47 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary2-2.42.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -549755813888 ORDER BY r - } -} {63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.42.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -549755813888 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63} -do_test boundary2-2.42.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -549755813888 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.42.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -549755813888 ORDER BY a - } -} {2 21 44 55 58 64} -do_test boundary2-2.42.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -549755813888 ORDER BY a DESC - } -} {64 58 55 44 21 2} -do_test boundary2-2.42.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -549755813888 ORDER BY r - } -} {55 2 64 21 44 58} -do_test boundary2-2.42.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -549755813888 ORDER BY r DESC - } -} {58 44 21 64 2 55} -do_test boundary2-2.42.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -549755813888 ORDER BY x - } -} {55 2 64 21 44 58} -do_test boundary2-2.42.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -549755813888 ORDER BY a - } -} {2 21 44 55 58 63 64} -do_test boundary2-2.42.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -549755813888 ORDER BY a DESC - } -} {64 63 58 55 44 21 2} -do_test boundary2-2.42.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -549755813888 ORDER BY r - } -} {55 2 64 21 44 58 63} -do_test boundary2-2.42.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -549755813888 ORDER BY r DESC - } -} {63 58 44 21 64 2 55} -do_test boundary2-2.42.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -549755813888 ORDER BY x - } -} {55 2 64 21 44 58 63} -do_test boundary2-2.43.1 { - db eval { - SELECT * FROM t1 WHERE r=281474976710655 - } -} {281474976710655 10 0000ffffffffffff} -do_test boundary2-2.43.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000ffffffffffff' - } -} {281474976710655 10} -do_test boundary2-2.43.3 { - db eval { - SELECT r, x FROM t1 WHERE a=10 - } -} {281474976710655 0000ffffffffffff} -do_test boundary2-2.43.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 281474976710655 ORDER BY a - } -} {3 13 17 26 27 28 43 45} -do_test boundary2-2.43.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 281474976710655 ORDER BY a DESC - } -} {45 43 28 27 26 17 13 3} -do_test boundary2-2.43.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 281474976710655 ORDER BY r - } -} {26 13 43 27 45 17 28 3} -do_test boundary2-2.43.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 281474976710655 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26} -do_test boundary2-2.43.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 281474976710655 ORDER BY x - } -} {26 13 43 27 45 17 28 3} -do_test boundary2-2.43.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 281474976710655 ORDER BY a - } -} {3 10 13 17 26 27 28 43 45} -do_test boundary2-2.43.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 281474976710655 ORDER BY a DESC - } -} {45 43 28 27 26 17 13 10 3} -do_test boundary2-2.43.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 281474976710655 ORDER BY r - } -} {10 26 13 43 27 45 17 28 3} -do_test boundary2-2.43.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 281474976710655 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10} -do_test boundary2-2.43.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 281474976710655 ORDER BY x - } -} {10 26 13 43 27 45 17 28 3} -do_test boundary2-2.43.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 281474976710655 ORDER BY a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 25 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.43.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 281474976710655 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 25 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary2-2.43.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 281474976710655 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34} -do_test boundary2-2.43.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 281474976710655 ORDER BY r DESC - } -} {34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.43.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 281474976710655 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.43.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 281474976710655 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 14 15 16 18 19 20 21 22 23 24 25 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.43.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 281474976710655 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 25 24 23 22 21 20 19 18 16 15 14 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-2.43.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 281474976710655 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10} -do_test boundary2-2.43.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 281474976710655 ORDER BY r DESC - } -} {10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.43.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 281474976710655 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.44.1 { - db eval { - SELECT * FROM t1 WHERE r=4398046511103 - } -} {4398046511103 7 000003ffffffffff} -do_test boundary2-2.44.2 { - db eval { - SELECT r, a FROM t1 WHERE x='000003ffffffffff' - } -} {4398046511103 7} -do_test boundary2-2.44.3 { - db eval { - SELECT r, x FROM t1 WHERE a=7 - } -} {4398046511103 000003ffffffffff} -do_test boundary2-2.44.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 4398046511103 ORDER BY a - } -} {3 10 13 17 25 26 27 28 34 43 45 56} -do_test boundary2-2.44.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 4398046511103 ORDER BY a DESC - } -} {56 45 43 34 28 27 26 25 17 13 10 3} -do_test boundary2-2.44.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 4398046511103 ORDER BY r - } -} {56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.44.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 4398046511103 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56} -do_test boundary2-2.44.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 4398046511103 ORDER BY x - } -} {56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.44.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 4398046511103 ORDER BY a - } -} {3 7 10 13 17 25 26 27 28 34 43 45 56} -do_test boundary2-2.44.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 4398046511103 ORDER BY a DESC - } -} {56 45 43 34 28 27 26 25 17 13 10 7 3} -do_test boundary2-2.44.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 4398046511103 ORDER BY r - } -} {7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.44.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 4398046511103 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7} -do_test boundary2-2.44.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 4398046511103 ORDER BY x - } -} {7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.44.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 4398046511103 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 19 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 57 58 59 60 61 62 63 64} -do_test boundary2-2.44.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 4398046511103 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 19 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-2.44.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 4398046511103 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19} -do_test boundary2-2.44.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 4398046511103 ORDER BY r DESC - } -} {19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.44.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 4398046511103 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.44.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 4398046511103 ORDER BY a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 57 58 59 60 61 62 63 64} -do_test boundary2-2.44.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 4398046511103 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary2-2.44.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 4398046511103 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7} -do_test boundary2-2.44.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 4398046511103 ORDER BY r DESC - } -} {7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.44.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 4398046511103 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.45.1 { - db eval { - SELECT * FROM t1 WHERE r=268435455 - } -} {268435455 12 000000000fffffff} -do_test boundary2-2.45.2 { - db eval { - SELECT r, a FROM t1 WHERE x='000000000fffffff' - } -} {268435455 12} -do_test boundary2-2.45.3 { - db eval { - SELECT r, x FROM t1 WHERE a=12 - } -} {268435455 000000000fffffff} -do_test boundary2-2.45.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 268435455 ORDER BY a - } -} {3 7 10 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary2-2.45.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 268435455 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 10 7 3} -do_test boundary2-2.45.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 268435455 ORDER BY r - } -} {40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.45.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 268435455 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40} -do_test boundary2-2.45.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 268435455 ORDER BY x - } -} {40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.45.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 268435455 ORDER BY a - } -} {3 7 10 12 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary2-2.45.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 268435455 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 12 10 7 3} -do_test boundary2-2.45.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 268435455 ORDER BY r - } -} {12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.45.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 268435455 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12} -do_test boundary2-2.45.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 268435455 ORDER BY x - } -} {12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.45.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 268435455 ORDER BY a - } -} {1 2 4 5 6 8 9 11 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.45.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 268435455 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 11 9 8 6 5 4 2 1} -do_test boundary2-2.45.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 268435455 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6} -do_test boundary2-2.45.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 268435455 ORDER BY r DESC - } -} {6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.45.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 268435455 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.45.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 268435455 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.45.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 268435455 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary2-2.45.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 268435455 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12} -do_test boundary2-2.45.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 268435455 ORDER BY r DESC - } -} {12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.45.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 268435455 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.46.1 { - db eval { - SELECT * FROM t1 WHERE r=-9223372036854775808 - } -} {-9223372036854775808 55 8000000000000000} -do_test boundary2-2.46.2 { - db eval { - SELECT r, a FROM t1 WHERE x='8000000000000000' - } -} {-9223372036854775808 55} -do_test boundary2-2.46.3 { - db eval { - SELECT r, x FROM t1 WHERE a=55 - } -} {-9223372036854775808 8000000000000000} -do_test boundary2-2.46.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -9223372036854775808 ORDER BY a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.46.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -9223372036854775808 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary2-2.46.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -9223372036854775808 ORDER BY r - } -} {2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.46.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -9223372036854775808 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2} -do_test boundary2-2.46.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -9223372036854775808 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.46.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -9223372036854775808 ORDER BY a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.46.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -9223372036854775808 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary2-2.46.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -9223372036854775808 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.46.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -9223372036854775808 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.46.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -9223372036854775808 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.46.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -9223372036854775808 ORDER BY a - } -} {} -do_test boundary2-2.46.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -9223372036854775808 ORDER BY a DESC - } -} {} -do_test boundary2-2.46.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -9223372036854775808 ORDER BY r - } -} {} -do_test boundary2-2.46.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -9223372036854775808 ORDER BY r DESC - } -} {} -do_test boundary2-2.46.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -9223372036854775808 ORDER BY x - } -} {} -do_test boundary2-2.46.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -9223372036854775808 ORDER BY a - } -} {55} -do_test boundary2-2.46.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -9223372036854775808 ORDER BY a DESC - } -} {55} -do_test boundary2-2.46.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -9223372036854775808 ORDER BY r - } -} {55} -do_test boundary2-2.46.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -9223372036854775808 ORDER BY r DESC - } -} {55} -do_test boundary2-2.46.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -9223372036854775808 ORDER BY x - } -} {55} -do_test boundary2-2.47.1 { - db eval { - SELECT * FROM t1 WHERE r=562949953421312 - } -} {562949953421312 43 0002000000000000} -do_test boundary2-2.47.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0002000000000000' - } -} {562949953421312 43} -do_test boundary2-2.47.3 { - db eval { - SELECT r, x FROM t1 WHERE a=43 - } -} {562949953421312 0002000000000000} -do_test boundary2-2.47.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 562949953421312 ORDER BY a - } -} {3 17 27 28 45} -do_test boundary2-2.47.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 562949953421312 ORDER BY a DESC - } -} {45 28 27 17 3} -do_test boundary2-2.47.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 562949953421312 ORDER BY r - } -} {27 45 17 28 3} -do_test boundary2-2.47.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 562949953421312 ORDER BY r DESC - } -} {3 28 17 45 27} -do_test boundary2-2.47.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 562949953421312 ORDER BY x - } -} {27 45 17 28 3} -do_test boundary2-2.47.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 562949953421312 ORDER BY a - } -} {3 17 27 28 43 45} -do_test boundary2-2.47.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 562949953421312 ORDER BY a DESC - } -} {45 43 28 27 17 3} -do_test boundary2-2.47.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 562949953421312 ORDER BY r - } -} {43 27 45 17 28 3} -do_test boundary2-2.47.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 562949953421312 ORDER BY r DESC - } -} {3 28 17 45 27 43} -do_test boundary2-2.47.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 562949953421312 ORDER BY x - } -} {43 27 45 17 28 3} -do_test boundary2-2.47.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 562949953421312 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.47.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 562949953421312 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-2.47.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 562949953421312 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13} -do_test boundary2-2.47.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 562949953421312 ORDER BY r DESC - } -} {13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.47.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 562949953421312 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.47.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 562949953421312 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.47.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 562949953421312 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-2.47.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 562949953421312 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43} -do_test boundary2-2.47.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 562949953421312 ORDER BY r DESC - } -} {43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.47.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 562949953421312 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.48.1 { - db eval { - SELECT * FROM t1 WHERE r=-8388609 - } -} {-8388609 1 ffffffffff7fffff} -do_test boundary2-2.48.2 { - db eval { - SELECT r, a FROM t1 WHERE x='ffffffffff7fffff' - } -} {-8388609 1} -do_test boundary2-2.48.3 { - db eval { - SELECT r, x FROM t1 WHERE a=1 - } -} {-8388609 ffffffffff7fffff} -do_test boundary2-2.48.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -8388609 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary2-2.48.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -8388609 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-2.48.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -8388609 ORDER BY r - } -} {37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.48.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -8388609 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37} -do_test boundary2-2.48.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -8388609 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 37 29 32 54 53 52 33 38} -do_test boundary2-2.48.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -8388609 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary2-2.48.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -8388609 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3 1} -do_test boundary2-2.48.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -8388609 ORDER BY r - } -} {1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.48.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -8388609 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1} -do_test boundary2-2.48.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -8388609 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.48.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -8388609 ORDER BY a - } -} {2 11 21 44 47 55 58 63 64} -do_test boundary2-2.48.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -8388609 ORDER BY a DESC - } -} {64 63 58 55 47 44 21 11 2} -do_test boundary2-2.48.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -8388609 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11} -do_test boundary2-2.48.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -8388609 ORDER BY r DESC - } -} {11 47 63 58 44 21 64 2 55} -do_test boundary2-2.48.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -8388609 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11} -do_test boundary2-2.48.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -8388609 ORDER BY a - } -} {1 2 11 21 44 47 55 58 63 64} -do_test boundary2-2.48.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -8388609 ORDER BY a DESC - } -} {64 63 58 55 47 44 21 11 2 1} -do_test boundary2-2.48.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -8388609 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1} -do_test boundary2-2.48.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -8388609 ORDER BY r DESC - } -} {1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.48.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -8388609 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1} -do_test boundary2-2.49.1 { - db eval { - SELECT * FROM t1 WHERE r=16777215 - } -} {16777215 9 0000000000ffffff} -do_test boundary2-2.49.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000000ffffff' - } -} {16777215 9} -do_test boundary2-2.49.3 { - db eval { - SELECT r, x FROM t1 WHERE a=9 - } -} {16777215 0000000000ffffff} -do_test boundary2-2.49.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 16777215 ORDER BY a - } -} {3 6 7 10 12 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary2-2.49.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 16777215 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 12 10 7 6 3} -do_test boundary2-2.49.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 16777215 ORDER BY r - } -} {6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.49.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 16777215 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6} -do_test boundary2-2.49.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 16777215 ORDER BY x - } -} {6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.49.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 16777215 ORDER BY a - } -} {3 6 7 9 10 12 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary2-2.49.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 16777215 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 12 10 9 7 6 3} -do_test boundary2-2.49.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 16777215 ORDER BY r - } -} {9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.49.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 16777215 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9} -do_test boundary2-2.49.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 16777215 ORDER BY x - } -} {9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.49.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 16777215 ORDER BY a - } -} {1 2 4 5 8 11 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.49.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 16777215 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 11 8 5 4 2 1} -do_test boundary2-2.49.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 16777215 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24} -do_test boundary2-2.49.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 16777215 ORDER BY r DESC - } -} {24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.49.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 16777215 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.49.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 16777215 ORDER BY a - } -} {1 2 4 5 8 9 11 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.49.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 16777215 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 11 9 8 5 4 2 1} -do_test boundary2-2.49.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 16777215 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9} -do_test boundary2-2.49.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 16777215 ORDER BY r DESC - } -} {9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.49.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 16777215 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.50.1 { - db eval { - SELECT * FROM t1 WHERE r=8388608 - } -} {8388608 24 0000000000800000} -do_test boundary2-2.50.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000000800000' - } -} {8388608 24} -do_test boundary2-2.50.3 { - db eval { - SELECT r, x FROM t1 WHERE a=24 - } -} {8388608 0000000000800000} -do_test boundary2-2.50.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 8388608 ORDER BY a - } -} {3 6 7 9 10 12 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary2-2.50.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 8388608 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 12 10 9 7 6 3} -do_test boundary2-2.50.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 8388608 ORDER BY r - } -} {9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.50.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 8388608 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9} -do_test boundary2-2.50.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 8388608 ORDER BY x - } -} {9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.50.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 8388608 ORDER BY a - } -} {3 6 7 9 10 12 13 14 17 19 20 22 24 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary2-2.50.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 8388608 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 24 22 20 19 17 14 13 12 10 9 7 6 3} -do_test boundary2-2.50.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 8388608 ORDER BY r - } -} {24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.50.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 8388608 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24} -do_test boundary2-2.50.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 8388608 ORDER BY x - } -} {24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.50.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 8388608 ORDER BY a - } -} {1 2 4 5 8 11 15 16 18 21 23 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.50.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 8388608 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 23 21 18 16 15 11 8 5 4 2 1} -do_test boundary2-2.50.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 8388608 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18} -do_test boundary2-2.50.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 8388608 ORDER BY r DESC - } -} {18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.50.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 8388608 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.50.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 8388608 ORDER BY a - } -} {1 2 4 5 8 11 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.50.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 8388608 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 11 8 5 4 2 1} -do_test boundary2-2.50.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 8388608 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24} -do_test boundary2-2.50.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 8388608 ORDER BY r DESC - } -} {24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.50.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 8388608 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.51.1 { - db eval { - SELECT * FROM t1 WHERE r=16383 - } -} {16383 8 0000000000003fff} -do_test boundary2-2.51.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000000003fff' - } -} {16383 8} -do_test boundary2-2.51.3 { - db eval { - SELECT r, x FROM t1 WHERE a=8 - } -} {16383 0000000000003fff} -do_test boundary2-2.51.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 16383 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary2-2.51.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 16383 ORDER BY a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 7 6 3} -do_test boundary2-2.51.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 16383 ORDER BY r - } -} {16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.51.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 16383 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16} -do_test boundary2-2.51.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 16383 ORDER BY x - } -} {16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.51.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 16383 ORDER BY a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary2-2.51.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 16383 ORDER BY a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary2-2.51.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 16383 ORDER BY r - } -} {8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.51.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 16383 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8} -do_test boundary2-2.51.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 16383 ORDER BY x - } -} {8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.51.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 16383 ORDER BY a - } -} {1 2 4 5 11 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary2-2.51.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 16383 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 11 5 4 2 1} -do_test boundary2-2.51.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 16383 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61} -do_test boundary2-2.51.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 16383 ORDER BY r DESC - } -} {61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.51.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 16383 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.51.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 16383 ORDER BY a - } -} {1 2 4 5 8 11 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary2-2.51.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 16383 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 11 8 5 4 2 1} -do_test boundary2-2.51.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 16383 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8} -do_test boundary2-2.51.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 16383 ORDER BY r DESC - } -} {8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.51.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 16383 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.52.1 { - db eval { - SELECT * FROM t1 WHERE r=140737488355328 - } -} {140737488355328 34 0000800000000000} -do_test boundary2-2.52.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000800000000000' - } -} {140737488355328 34} -do_test boundary2-2.52.3 { - db eval { - SELECT r, x FROM t1 WHERE a=34 - } -} {140737488355328 0000800000000000} -do_test boundary2-2.52.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 140737488355328 ORDER BY a - } -} {3 10 13 17 26 27 28 43 45} -do_test boundary2-2.52.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 140737488355328 ORDER BY a DESC - } -} {45 43 28 27 26 17 13 10 3} -do_test boundary2-2.52.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 140737488355328 ORDER BY r - } -} {10 26 13 43 27 45 17 28 3} -do_test boundary2-2.52.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 140737488355328 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10} -do_test boundary2-2.52.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 140737488355328 ORDER BY x - } -} {10 26 13 43 27 45 17 28 3} -do_test boundary2-2.52.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 140737488355328 ORDER BY a - } -} {3 10 13 17 26 27 28 34 43 45} -do_test boundary2-2.52.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 140737488355328 ORDER BY a DESC - } -} {45 43 34 28 27 26 17 13 10 3} -do_test boundary2-2.52.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 140737488355328 ORDER BY r - } -} {34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.52.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 140737488355328 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34} -do_test boundary2-2.52.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 140737488355328 ORDER BY x - } -} {34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.52.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 140737488355328 ORDER BY a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 25 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.52.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 140737488355328 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 25 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary2-2.52.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 140737488355328 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25} -do_test boundary2-2.52.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 140737488355328 ORDER BY r DESC - } -} {25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.52.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 140737488355328 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.52.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 140737488355328 ORDER BY a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 25 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.52.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 140737488355328 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 25 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary2-2.52.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 140737488355328 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34} -do_test boundary2-2.52.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 140737488355328 ORDER BY r DESC - } -} {34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.52.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 140737488355328 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.53.1 { - db eval { - SELECT * FROM t1 WHERE r=2097151 - } -} {2097151 15 00000000001fffff} -do_test boundary2-2.53.2 { - db eval { - SELECT r, a FROM t1 WHERE x='00000000001fffff' - } -} {2097151 15} -do_test boundary2-2.53.3 { - db eval { - SELECT r, x FROM t1 WHERE a=15 - } -} {2097151 00000000001fffff} -do_test boundary2-2.53.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 2097151 ORDER BY a - } -} {3 6 7 9 10 12 13 14 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 51 56 57} -do_test boundary2-2.53.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 2097151 ORDER BY a DESC - } -} {57 56 51 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 14 13 12 10 9 7 6 3} -do_test boundary2-2.53.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 2097151 ORDER BY r - } -} {42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.53.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 2097151 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42} -do_test boundary2-2.53.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 2097151 ORDER BY x - } -} {42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.53.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 2097151 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 51 56 57} -do_test boundary2-2.53.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 2097151 ORDER BY a DESC - } -} {57 56 51 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary2-2.53.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 2097151 ORDER BY r - } -} {15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.53.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 2097151 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15} -do_test boundary2-2.53.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 2097151 ORDER BY x - } -} {15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.53.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 2097151 ORDER BY a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.53.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 2097151 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary2-2.53.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 2097151 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62} -do_test boundary2-2.53.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 2097151 ORDER BY r DESC - } -} {62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.53.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 2097151 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.53.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 2097151 ORDER BY a - } -} {1 2 4 5 8 11 15 16 21 23 29 30 31 32 33 37 38 41 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-2.53.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 2097151 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 41 38 37 33 32 31 30 29 23 21 16 15 11 8 5 4 2 1} -do_test boundary2-2.53.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 2097151 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15} -do_test boundary2-2.53.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 2097151 ORDER BY r DESC - } -} {15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.53.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 2097151 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.54.1 { - db eval { - SELECT * FROM t1 WHERE r=140737488355327 - } -} {140737488355327 25 00007fffffffffff} -do_test boundary2-2.54.2 { - db eval { - SELECT r, a FROM t1 WHERE x='00007fffffffffff' - } -} {140737488355327 25} -do_test boundary2-2.54.3 { - db eval { - SELECT r, x FROM t1 WHERE a=25 - } -} {140737488355327 00007fffffffffff} -do_test boundary2-2.54.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 140737488355327 ORDER BY a - } -} {3 10 13 17 26 27 28 34 43 45} -do_test boundary2-2.54.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 140737488355327 ORDER BY a DESC - } -} {45 43 34 28 27 26 17 13 10 3} -do_test boundary2-2.54.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 140737488355327 ORDER BY r - } -} {34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.54.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 140737488355327 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34} -do_test boundary2-2.54.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 140737488355327 ORDER BY x - } -} {34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.54.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 140737488355327 ORDER BY a - } -} {3 10 13 17 25 26 27 28 34 43 45} -do_test boundary2-2.54.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 140737488355327 ORDER BY a DESC - } -} {45 43 34 28 27 26 25 17 13 10 3} -do_test boundary2-2.54.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 140737488355327 ORDER BY r - } -} {25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.54.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 140737488355327 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25} -do_test boundary2-2.54.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 140737488355327 ORDER BY x - } -} {25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.54.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 140737488355327 ORDER BY a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.54.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 140737488355327 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary2-2.54.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 140737488355327 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56} -do_test boundary2-2.54.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 140737488355327 ORDER BY r DESC - } -} {56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.54.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 140737488355327 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.54.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 140737488355327 ORDER BY a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 25 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.54.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 140737488355327 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 25 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary2-2.54.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 140737488355327 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25} -do_test boundary2-2.54.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 140737488355327 ORDER BY r DESC - } -} {25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.54.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 140737488355327 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.55.1 { - db eval { - SELECT * FROM t1 WHERE r=281474976710656 - } -} {281474976710656 26 0001000000000000} -do_test boundary2-2.55.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0001000000000000' - } -} {281474976710656 26} -do_test boundary2-2.55.3 { - db eval { - SELECT r, x FROM t1 WHERE a=26 - } -} {281474976710656 0001000000000000} -do_test boundary2-2.55.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 281474976710656 ORDER BY a - } -} {3 13 17 27 28 43 45} -do_test boundary2-2.55.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 281474976710656 ORDER BY a DESC - } -} {45 43 28 27 17 13 3} -do_test boundary2-2.55.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 281474976710656 ORDER BY r - } -} {13 43 27 45 17 28 3} -do_test boundary2-2.55.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 281474976710656 ORDER BY r DESC - } -} {3 28 17 45 27 43 13} -do_test boundary2-2.55.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 281474976710656 ORDER BY x - } -} {13 43 27 45 17 28 3} -do_test boundary2-2.55.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 281474976710656 ORDER BY a - } -} {3 13 17 26 27 28 43 45} -do_test boundary2-2.55.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 281474976710656 ORDER BY a DESC - } -} {45 43 28 27 26 17 13 3} -do_test boundary2-2.55.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 281474976710656 ORDER BY r - } -} {26 13 43 27 45 17 28 3} -do_test boundary2-2.55.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 281474976710656 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26} -do_test boundary2-2.55.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 281474976710656 ORDER BY x - } -} {26 13 43 27 45 17 28 3} -do_test boundary2-2.55.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 281474976710656 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 14 15 16 18 19 20 21 22 23 24 25 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.55.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 281474976710656 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 25 24 23 22 21 20 19 18 16 15 14 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-2.55.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 281474976710656 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10} -do_test boundary2-2.55.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 281474976710656 ORDER BY r DESC - } -} {10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.55.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 281474976710656 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.55.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 281474976710656 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 14 15 16 18 19 20 21 22 23 24 25 26 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.55.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 281474976710656 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 26 25 24 23 22 21 20 19 18 16 15 14 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-2.55.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 281474976710656 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26} -do_test boundary2-2.55.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 281474976710656 ORDER BY r DESC - } -} {26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.55.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 281474976710656 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.56.1 { - db eval { - SELECT * FROM t1 WHERE r=32767 - } -} {32767 23 0000000000007fff} -do_test boundary2-2.56.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000000007fff' - } -} {32767 23} -do_test boundary2-2.56.3 { - db eval { - SELECT r, x FROM t1 WHERE a=23 - } -} {32767 0000000000007fff} -do_test boundary2-2.56.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 32767 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary2-2.56.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 32767 ORDER BY a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary2-2.56.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 32767 ORDER BY r - } -} {50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.56.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 32767 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50} -do_test boundary2-2.56.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 32767 ORDER BY x - } -} {50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.56.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 32767 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary2-2.56.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 32767 ORDER BY a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary2-2.56.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 32767 ORDER BY r - } -} {23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.56.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 32767 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23} -do_test boundary2-2.56.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 32767 ORDER BY x - } -} {23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.56.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 32767 ORDER BY a - } -} {1 2 4 5 8 11 16 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary2-2.56.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 32767 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 16 11 8 5 4 2 1} -do_test boundary2-2.56.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 32767 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16} -do_test boundary2-2.56.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 32767 ORDER BY r DESC - } -} {16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.56.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 32767 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.56.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 32767 ORDER BY a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary2-2.56.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 32767 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary2-2.56.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 32767 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23} -do_test boundary2-2.56.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 32767 ORDER BY r DESC - } -} {23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.56.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 32767 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.57.1 { - db eval { - SELECT * FROM t1 WHERE r=127 - } -} {127 4 000000000000007f} -do_test boundary2-2.57.2 { - db eval { - SELECT r, a FROM t1 WHERE x='000000000000007f' - } -} {127 4} -do_test boundary2-2.57.3 { - db eval { - SELECT r, x FROM t1 WHERE a=4 - } -} {127 000000000000007f} -do_test boundary2-2.57.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 127 ORDER BY a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary2-2.57.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 127 ORDER BY a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary2-2.57.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 127 ORDER BY r - } -} {49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.57.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 127 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49} -do_test boundary2-2.57.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 127 ORDER BY x - } -} {49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.57.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 127 ORDER BY a - } -} {3 4 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary2-2.57.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 127 ORDER BY a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 4 3} -do_test boundary2-2.57.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 127 ORDER BY r - } -} {4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.57.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 127 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4} -do_test boundary2-2.57.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 127 ORDER BY x - } -} {4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.57.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 127 ORDER BY a - } -} {1 2 5 11 21 29 31 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary2-2.57.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 127 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 31 29 21 11 5 2 1} -do_test boundary2-2.57.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 127 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31} -do_test boundary2-2.57.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 127 ORDER BY r DESC - } -} {31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.57.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 127 ORDER BY x - } -} {59 60 41 5 31 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.57.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 127 ORDER BY a - } -} {1 2 4 5 11 21 29 31 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary2-2.57.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 127 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 31 29 21 11 5 4 2 1} -do_test boundary2-2.57.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 127 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4} -do_test boundary2-2.57.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 127 ORDER BY r DESC - } -} {4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.57.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 127 ORDER BY x - } -} {59 60 41 5 31 4 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.58.1 { - db eval { - SELECT * FROM t1 WHERE r=36028797018963967 - } -} {36028797018963967 27 007fffffffffffff} -do_test boundary2-2.58.2 { - db eval { - SELECT r, a FROM t1 WHERE x='007fffffffffffff' - } -} {36028797018963967 27} -do_test boundary2-2.58.3 { - db eval { - SELECT r, x FROM t1 WHERE a=27 - } -} {36028797018963967 007fffffffffffff} -do_test boundary2-2.58.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 36028797018963967 ORDER BY a - } -} {3 17 28 45} -do_test boundary2-2.58.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 36028797018963967 ORDER BY a DESC - } -} {45 28 17 3} -do_test boundary2-2.58.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 36028797018963967 ORDER BY r - } -} {45 17 28 3} -do_test boundary2-2.58.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 36028797018963967 ORDER BY r DESC - } -} {3 28 17 45} -do_test boundary2-2.58.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 36028797018963967 ORDER BY x - } -} {45 17 28 3} -do_test boundary2-2.58.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 36028797018963967 ORDER BY a - } -} {3 17 27 28 45} -do_test boundary2-2.58.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 36028797018963967 ORDER BY a DESC - } -} {45 28 27 17 3} -do_test boundary2-2.58.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 36028797018963967 ORDER BY r - } -} {27 45 17 28 3} -do_test boundary2-2.58.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 36028797018963967 ORDER BY r DESC - } -} {3 28 17 45 27} -do_test boundary2-2.58.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 36028797018963967 ORDER BY x - } -} {27 45 17 28 3} -do_test boundary2-2.58.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 36028797018963967 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.58.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 36028797018963967 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-2.58.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 36028797018963967 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43} -do_test boundary2-2.58.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 36028797018963967 ORDER BY r DESC - } -} {43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.58.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 36028797018963967 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.58.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 36028797018963967 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.58.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 36028797018963967 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 27 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-2.58.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 36028797018963967 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27} -do_test boundary2-2.58.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 36028797018963967 ORDER BY r DESC - } -} {27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.58.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 36028797018963967 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.59.1 { - db eval { - SELECT * FROM t1 WHERE r=4398046511104 - } -} {4398046511104 56 0000040000000000} -do_test boundary2-2.59.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000040000000000' - } -} {4398046511104 56} -do_test boundary2-2.59.3 { - db eval { - SELECT r, x FROM t1 WHERE a=56 - } -} {4398046511104 0000040000000000} -do_test boundary2-2.59.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 4398046511104 ORDER BY a - } -} {3 10 13 17 25 26 27 28 34 43 45} -do_test boundary2-2.59.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 4398046511104 ORDER BY a DESC - } -} {45 43 34 28 27 26 25 17 13 10 3} -do_test boundary2-2.59.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 4398046511104 ORDER BY r - } -} {25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.59.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 4398046511104 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25} -do_test boundary2-2.59.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 4398046511104 ORDER BY x - } -} {25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.59.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 4398046511104 ORDER BY a - } -} {3 10 13 17 25 26 27 28 34 43 45 56} -do_test boundary2-2.59.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 4398046511104 ORDER BY a DESC - } -} {56 45 43 34 28 27 26 25 17 13 10 3} -do_test boundary2-2.59.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 4398046511104 ORDER BY r - } -} {56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.59.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 4398046511104 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56} -do_test boundary2-2.59.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 4398046511104 ORDER BY x - } -} {56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.59.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 4398046511104 ORDER BY a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 57 58 59 60 61 62 63 64} -do_test boundary2-2.59.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 4398046511104 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary2-2.59.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 4398046511104 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7} -do_test boundary2-2.59.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 4398046511104 ORDER BY r DESC - } -} {7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.59.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 4398046511104 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.59.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 4398046511104 ORDER BY a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.59.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 4398046511104 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary2-2.59.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 4398046511104 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56} -do_test boundary2-2.59.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 4398046511104 ORDER BY r DESC - } -} {56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.59.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 4398046511104 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.60.1 { - db eval { - SELECT * FROM t1 WHERE r=1 - } -} {1 60 0000000000000001} -do_test boundary2-2.60.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000000000001' - } -} {1 60} -do_test boundary2-2.60.3 { - db eval { - SELECT r, x FROM t1 WHERE a=60 - } -} {1 0000000000000001} -do_test boundary2-2.60.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 1 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 41 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary2-2.60.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 1 ORDER BY a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 41 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-2.60.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 1 ORDER BY r - } -} {41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.60.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 1 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41} -do_test boundary2-2.60.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 1 ORDER BY x - } -} {41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.60.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 1 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 41 42 43 45 46 48 49 50 51 56 57 60 61 62} -do_test boundary2-2.60.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 1 ORDER BY a DESC - } -} {62 61 60 57 56 51 50 49 48 46 45 43 42 41 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-2.60.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 1 ORDER BY r - } -} {60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.60.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 1 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60} -do_test boundary2-2.60.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 1 ORDER BY x - } -} {60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.60.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 1 ORDER BY a - } -} {1 2 11 21 29 32 33 37 38 44 47 52 53 54 55 58 59 63 64} -do_test boundary2-2.60.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 1 ORDER BY a DESC - } -} {64 63 59 58 55 54 53 52 47 44 38 37 33 32 29 21 11 2 1} -do_test boundary2-2.60.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 1 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59} -do_test boundary2-2.60.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 1 ORDER BY r DESC - } -} {59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.60.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 1 ORDER BY x - } -} {59 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.60.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 1 ORDER BY a - } -} {1 2 11 21 29 32 33 37 38 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary2-2.60.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 1 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 38 37 33 32 29 21 11 2 1} -do_test boundary2-2.60.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 1 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60} -do_test boundary2-2.60.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 1 ORDER BY r DESC - } -} {60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.60.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 1 ORDER BY x - } -} {59 60 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.61.1 { - db eval { - SELECT * FROM t1 WHERE r=36028797018963968 - } -} {36028797018963968 45 0080000000000000} -do_test boundary2-2.61.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0080000000000000' - } -} {36028797018963968 45} -do_test boundary2-2.61.3 { - db eval { - SELECT r, x FROM t1 WHERE a=45 - } -} {36028797018963968 0080000000000000} -do_test boundary2-2.61.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 36028797018963968 ORDER BY a - } -} {3 17 28} -do_test boundary2-2.61.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 36028797018963968 ORDER BY a DESC - } -} {28 17 3} -do_test boundary2-2.61.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 36028797018963968 ORDER BY r - } -} {17 28 3} -do_test boundary2-2.61.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 36028797018963968 ORDER BY r DESC - } -} {3 28 17} -do_test boundary2-2.61.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 36028797018963968 ORDER BY x - } -} {17 28 3} -do_test boundary2-2.61.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 36028797018963968 ORDER BY a - } -} {3 17 28 45} -do_test boundary2-2.61.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 36028797018963968 ORDER BY a DESC - } -} {45 28 17 3} -do_test boundary2-2.61.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 36028797018963968 ORDER BY r - } -} {45 17 28 3} -do_test boundary2-2.61.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 36028797018963968 ORDER BY r DESC - } -} {3 28 17 45} -do_test boundary2-2.61.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 36028797018963968 ORDER BY x - } -} {45 17 28 3} -do_test boundary2-2.61.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 36028797018963968 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.61.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 36028797018963968 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 27 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-2.61.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 36028797018963968 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27} -do_test boundary2-2.61.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 36028797018963968 ORDER BY r DESC - } -} {27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.61.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 36028797018963968 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.61.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 36028797018963968 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.61.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 36028797018963968 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 27 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-2.61.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 36028797018963968 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45} -do_test boundary2-2.61.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 36028797018963968 ORDER BY r DESC - } -} {45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.61.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 36028797018963968 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.62.1 { - db eval { - SELECT * FROM t1 WHERE r=-2147483649 - } -} {-2147483649 47 ffffffff7fffffff} -do_test boundary2-2.62.2 { - db eval { - SELECT r, a FROM t1 WHERE x='ffffffff7fffffff' - } -} {-2147483649 47} -do_test boundary2-2.62.3 { - db eval { - SELECT r, x FROM t1 WHERE a=47 - } -} {-2147483649 ffffffff7fffffff} -do_test boundary2-2.62.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -2147483649 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary2-2.62.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -2147483649 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary2-2.62.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -2147483649 ORDER BY r - } -} {11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.62.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -2147483649 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11} -do_test boundary2-2.62.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -2147483649 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.62.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -2147483649 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 47 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary2-2.62.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -2147483649 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 47 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary2-2.62.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -2147483649 ORDER BY r - } -} {47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.62.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -2147483649 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47} -do_test boundary2-2.62.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -2147483649 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.62.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -2147483649 ORDER BY a - } -} {2 21 44 55 58 63 64} -do_test boundary2-2.62.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -2147483649 ORDER BY a DESC - } -} {64 63 58 55 44 21 2} -do_test boundary2-2.62.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -2147483649 ORDER BY r - } -} {55 2 64 21 44 58 63} -do_test boundary2-2.62.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -2147483649 ORDER BY r DESC - } -} {63 58 44 21 64 2 55} -do_test boundary2-2.62.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -2147483649 ORDER BY x - } -} {55 2 64 21 44 58 63} -do_test boundary2-2.62.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -2147483649 ORDER BY a - } -} {2 21 44 47 55 58 63 64} -do_test boundary2-2.62.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -2147483649 ORDER BY a DESC - } -} {64 63 58 55 47 44 21 2} -do_test boundary2-2.62.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -2147483649 ORDER BY r - } -} {55 2 64 21 44 58 63 47} -do_test boundary2-2.62.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -2147483649 ORDER BY r DESC - } -} {47 63 58 44 21 64 2 55} -do_test boundary2-2.62.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -2147483649 ORDER BY x - } -} {55 2 64 21 44 58 63 47} -do_test boundary2-2.63.1 { - db eval { - SELECT * FROM t1 WHERE r=-36028797018963969 - } -} {-36028797018963969 2 ff7fffffffffffff} -do_test boundary2-2.63.2 { - db eval { - SELECT r, a FROM t1 WHERE x='ff7fffffffffffff' - } -} {-36028797018963969 2} -do_test boundary2-2.63.3 { - db eval { - SELECT r, x FROM t1 WHERE a=2 - } -} {-36028797018963969 ff7fffffffffffff} -do_test boundary2-2.63.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -36028797018963969 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.63.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -36028797018963969 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary2-2.63.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -36028797018963969 ORDER BY r - } -} {64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.63.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -36028797018963969 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64} -do_test boundary2-2.63.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -36028797018963969 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.63.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -36028797018963969 ORDER BY a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.63.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -36028797018963969 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary2-2.63.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -36028797018963969 ORDER BY r - } -} {2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.63.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -36028797018963969 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2} -do_test boundary2-2.63.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -36028797018963969 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.63.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -36028797018963969 ORDER BY a - } -} {55} -do_test boundary2-2.63.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -36028797018963969 ORDER BY a DESC - } -} {55} -do_test boundary2-2.63.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -36028797018963969 ORDER BY r - } -} {55} -do_test boundary2-2.63.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -36028797018963969 ORDER BY r DESC - } -} {55} -do_test boundary2-2.63.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -36028797018963969 ORDER BY x - } -} {55} -do_test boundary2-2.63.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -36028797018963969 ORDER BY a - } -} {2 55} -do_test boundary2-2.63.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -36028797018963969 ORDER BY a DESC - } -} {55 2} -do_test boundary2-2.63.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -36028797018963969 ORDER BY r - } -} {55 2} -do_test boundary2-2.63.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -36028797018963969 ORDER BY r DESC - } -} {2 55} -do_test boundary2-2.63.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -36028797018963969 ORDER BY x - } -} {55 2} -do_test boundary2-2.64.1 { - db eval { - SELECT * FROM t1 WHERE r=3 - } -} {3 5 0000000000000003} -do_test boundary2-2.64.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000000000003' - } -} {3 5} -do_test boundary2-2.64.3 { - db eval { - SELECT r, x FROM t1 WHERE a=5 - } -} {3 0000000000000003} -do_test boundary2-2.64.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 3 ORDER BY a - } -} {3 4 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary2-2.64.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 3 ORDER BY a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 4 3} -do_test boundary2-2.64.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 3 ORDER BY r - } -} {31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.64.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 3 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31} -do_test boundary2-2.64.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 3 ORDER BY x - } -} {31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.64.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 3 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary2-2.64.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 3 ORDER BY a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-2.64.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 3 ORDER BY r - } -} {5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.64.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 3 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5} -do_test boundary2-2.64.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 3 ORDER BY x - } -} {5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.64.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 3 ORDER BY a - } -} {1 2 11 21 29 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary2-2.64.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 3 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 29 21 11 2 1} -do_test boundary2-2.64.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 3 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41} -do_test boundary2-2.64.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 3 ORDER BY r DESC - } -} {41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.64.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 3 ORDER BY x - } -} {59 60 41 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.64.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 3 ORDER BY a - } -} {1 2 5 11 21 29 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary2-2.64.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 3 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 29 21 11 5 2 1} -do_test boundary2-2.64.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 3 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5} -do_test boundary2-2.64.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 3 ORDER BY r DESC - } -} {5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.64.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 3 ORDER BY x - } -} {59 60 41 5 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.65.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 9.22337303685477580800e+18 ORDER BY a - } -} {} -do_test boundary2-2.65.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 9.22337303685477580800e+18 ORDER BY a DESC - } -} {} -do_test boundary2-2.65.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 9.22337303685477580800e+18 ORDER BY r - } -} {} -do_test boundary2-2.65.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 9.22337303685477580800e+18 ORDER BY r DESC - } -} {} -do_test boundary2-2.65.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 9.22337303685477580800e+18 ORDER BY x - } -} {} -do_test boundary2-2.65.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 9.22337303685477580800e+18 ORDER BY a - } -} {} -do_test boundary2-2.65.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 9.22337303685477580800e+18 ORDER BY a DESC - } -} {} -do_test boundary2-2.65.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 9.22337303685477580800e+18 ORDER BY r - } -} {} -do_test boundary2-2.65.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 9.22337303685477580800e+18 ORDER BY r DESC - } -} {} -do_test boundary2-2.65.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 9.22337303685477580800e+18 ORDER BY x - } -} {} -do_test boundary2-2.65.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 9.22337303685477580800e+18 ORDER BY a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.65.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 9.22337303685477580800e+18 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary2-2.65.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 9.22337303685477580800e+18 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.65.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 9.22337303685477580800e+18 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.65.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 9.22337303685477580800e+18 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.65.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 9.22337303685477580800e+18 ORDER BY a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.65.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 9.22337303685477580800e+18 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary2-2.65.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 9.22337303685477580800e+18 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.65.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 9.22337303685477580800e+18 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.65.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 9.22337303685477580800e+18 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.66.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -9.22337303685477580800e+18 ORDER BY a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.66.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -9.22337303685477580800e+18 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary2-2.66.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -9.22337303685477580800e+18 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.66.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -9.22337303685477580800e+18 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.66.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -9.22337303685477580800e+18 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.66.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -9.22337303685477580800e+18 ORDER BY a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-2.66.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -9.22337303685477580800e+18 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary2-2.66.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -9.22337303685477580800e+18 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-2.66.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -9.22337303685477580800e+18 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-2.66.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -9.22337303685477580800e+18 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-2.66.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -9.22337303685477580800e+18 ORDER BY a - } -} {} -do_test boundary2-2.66.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -9.22337303685477580800e+18 ORDER BY a DESC - } -} {} -do_test boundary2-2.66.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -9.22337303685477580800e+18 ORDER BY r - } -} {} -do_test boundary2-2.66.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -9.22337303685477580800e+18 ORDER BY r DESC - } -} {} -do_test boundary2-2.66.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -9.22337303685477580800e+18 ORDER BY x - } -} {} -do_test boundary2-2.66.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -9.22337303685477580800e+18 ORDER BY a - } -} {} -do_test boundary2-2.66.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -9.22337303685477580800e+18 ORDER BY a DESC - } -} {} -do_test boundary2-2.66.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -9.22337303685477580800e+18 ORDER BY r - } -} {} -do_test boundary2-2.66.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -9.22337303685477580800e+18 ORDER BY r DESC - } -} {} -do_test boundary2-2.66.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -9.22337303685477580800e+18 ORDER BY x - } -} {} -do_test boundary2-3.1 { - db eval { - DROP INDEX t1i1; - DROP INDEX t1i2; - DROP INDEX t1i3; - } -} {} -do_test boundary2-4.1.1 { - db eval { - SELECT * FROM t1 WHERE r=72057594037927935 - } -} {72057594037927935 17 00ffffffffffffff} -do_test boundary2-4.1.2 { - db eval { - SELECT r, a FROM t1 WHERE x='00ffffffffffffff' - } -} {72057594037927935 17} -do_test boundary2-4.1.3 { - db eval { - SELECT r, x FROM t1 WHERE a=17 - } -} {72057594037927935 00ffffffffffffff} -do_test boundary2-4.1.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 72057594037927935 ORDER BY a - } -} {3 28} -do_test boundary2-4.1.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 72057594037927935 ORDER BY a DESC - } -} {28 3} -do_test boundary2-4.1.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 72057594037927935 ORDER BY r - } -} {28 3} -do_test boundary2-4.1.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 72057594037927935 ORDER BY r DESC - } -} {3 28} -do_test boundary2-4.1.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 72057594037927935 ORDER BY x - } -} {28 3} -do_test boundary2-4.1.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 72057594037927935 ORDER BY a - } -} {3 17 28} -do_test boundary2-4.1.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 72057594037927935 ORDER BY a DESC - } -} {28 17 3} -do_test boundary2-4.1.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 72057594037927935 ORDER BY r - } -} {17 28 3} -do_test boundary2-4.1.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 72057594037927935 ORDER BY r DESC - } -} {3 28 17} -do_test boundary2-4.1.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 72057594037927935 ORDER BY x - } -} {17 28 3} -do_test boundary2-4.1.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 72057594037927935 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.1.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 72057594037927935 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 27 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-4.1.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 72057594037927935 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45} -do_test boundary2-4.1.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 72057594037927935 ORDER BY r DESC - } -} {45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.1.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 72057594037927935 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.1.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 72057594037927935 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.1.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 72057594037927935 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-4.1.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 72057594037927935 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17} -do_test boundary2-4.1.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 72057594037927935 ORDER BY r DESC - } -} {17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.1.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 72057594037927935 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.2.1 { - db eval { - SELECT * FROM t1 WHERE r=16384 - } -} {16384 16 0000000000004000} -do_test boundary2-4.2.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000000004000' - } -} {16384 16} -do_test boundary2-4.2.3 { - db eval { - SELECT r, x FROM t1 WHERE a=16 - } -} {16384 0000000000004000} -do_test boundary2-4.2.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 16384 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary2-4.2.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 16384 ORDER BY a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary2-4.2.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 16384 ORDER BY r - } -} {23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.2.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 16384 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23} -do_test boundary2-4.2.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 16384 ORDER BY x - } -} {23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.2.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 16384 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary2-4.2.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 16384 ORDER BY a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 7 6 3} -do_test boundary2-4.2.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 16384 ORDER BY r - } -} {16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.2.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 16384 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16} -do_test boundary2-4.2.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 16384 ORDER BY x - } -} {16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.2.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 16384 ORDER BY a - } -} {1 2 4 5 8 11 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary2-4.2.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 16384 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 11 8 5 4 2 1} -do_test boundary2-4.2.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 16384 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8} -do_test boundary2-4.2.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 16384 ORDER BY r DESC - } -} {8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.2.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 16384 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.2.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 16384 ORDER BY a - } -} {1 2 4 5 8 11 16 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary2-4.2.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 16384 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 16 11 8 5 4 2 1} -do_test boundary2-4.2.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 16384 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16} -do_test boundary2-4.2.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 16384 ORDER BY r DESC - } -} {16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.2.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 16384 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.3.1 { - db eval { - SELECT * FROM t1 WHERE r=4294967296 - } -} {4294967296 36 0000000100000000} -do_test boundary2-4.3.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000100000000' - } -} {4294967296 36} -do_test boundary2-4.3.3 { - db eval { - SELECT r, x FROM t1 WHERE a=36 - } -} {4294967296 0000000100000000} -do_test boundary2-4.3.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 4294967296 ORDER BY a - } -} {3 7 10 13 17 19 22 25 26 27 28 34 35 39 43 45 46 56 57} -do_test boundary2-4.3.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 4294967296 ORDER BY a DESC - } -} {57 56 46 45 43 39 35 34 28 27 26 25 22 19 17 13 10 7 3} -do_test boundary2-4.3.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 4294967296 ORDER BY r - } -} {39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.3.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 4294967296 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39} -do_test boundary2-4.3.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 4294967296 ORDER BY x - } -} {39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.3.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 4294967296 ORDER BY a - } -} {3 7 10 13 17 19 22 25 26 27 28 34 35 36 39 43 45 46 56 57} -do_test boundary2-4.3.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 4294967296 ORDER BY a DESC - } -} {57 56 46 45 43 39 36 35 34 28 27 26 25 22 19 17 13 10 7 3} -do_test boundary2-4.3.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 4294967296 ORDER BY r - } -} {36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.3.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 4294967296 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36} -do_test boundary2-4.3.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 4294967296 ORDER BY x - } -} {36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.3.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 4294967296 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.3.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 4294967296 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-4.3.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 4294967296 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14} -do_test boundary2-4.3.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 4294967296 ORDER BY r DESC - } -} {14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.3.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 4294967296 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.3.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 4294967296 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 23 24 29 30 31 32 33 36 37 38 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.3.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 4294967296 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 38 37 36 33 32 31 30 29 24 23 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-4.3.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 4294967296 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36} -do_test boundary2-4.3.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 4294967296 ORDER BY r DESC - } -} {36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.3.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 4294967296 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.4.1 { - db eval { - SELECT * FROM t1 WHERE r=16777216 - } -} {16777216 6 0000000001000000} -do_test boundary2-4.4.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000001000000' - } -} {16777216 6} -do_test boundary2-4.4.3 { - db eval { - SELECT r, x FROM t1 WHERE a=6 - } -} {16777216 0000000001000000} -do_test boundary2-4.4.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 16777216 ORDER BY a - } -} {3 7 10 12 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary2-4.4.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 16777216 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 12 10 7 3} -do_test boundary2-4.4.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 16777216 ORDER BY r - } -} {12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.4.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 16777216 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12} -do_test boundary2-4.4.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 16777216 ORDER BY x - } -} {12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.4.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 16777216 ORDER BY a - } -} {3 6 7 10 12 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary2-4.4.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 16777216 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 12 10 7 6 3} -do_test boundary2-4.4.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 16777216 ORDER BY r - } -} {6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.4.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 16777216 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6} -do_test boundary2-4.4.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 16777216 ORDER BY x - } -} {6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.4.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 16777216 ORDER BY a - } -} {1 2 4 5 8 9 11 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.4.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 16777216 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 11 9 8 5 4 2 1} -do_test boundary2-4.4.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 16777216 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9} -do_test boundary2-4.4.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 16777216 ORDER BY r DESC - } -} {9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.4.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 16777216 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.4.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 16777216 ORDER BY a - } -} {1 2 4 5 6 8 9 11 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.4.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 16777216 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 11 9 8 6 5 4 2 1} -do_test boundary2-4.4.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 16777216 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6} -do_test boundary2-4.4.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 16777216 ORDER BY r DESC - } -} {6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.4.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 16777216 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.5.1 { - db eval { - SELECT * FROM t1 WHERE r=-32769 - } -} {-32769 29 ffffffffffff7fff} -do_test boundary2-4.5.2 { - db eval { - SELECT r, a FROM t1 WHERE x='ffffffffffff7fff' - } -} {-32769 29} -do_test boundary2-4.5.3 { - db eval { - SELECT r, x FROM t1 WHERE a=29 - } -} {-32769 ffffffffffff7fff} -do_test boundary2-4.5.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -32769 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 32 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary2-4.5.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -32769 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 32 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-4.5.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -32769 ORDER BY r - } -} {32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.5.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -32769 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32} -do_test boundary2-4.5.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -32769 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 32 54 53 52 33 38} -do_test boundary2-4.5.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -32769 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary2-4.5.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -32769 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-4.5.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -32769 ORDER BY r - } -} {29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.5.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -32769 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29} -do_test boundary2-4.5.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -32769 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 29 32 54 53 52 33 38} -do_test boundary2-4.5.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -32769 ORDER BY a - } -} {1 2 11 21 37 44 47 55 58 63 64} -do_test boundary2-4.5.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -32769 ORDER BY a DESC - } -} {64 63 58 55 47 44 37 21 11 2 1} -do_test boundary2-4.5.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -32769 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37} -do_test boundary2-4.5.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -32769 ORDER BY r DESC - } -} {37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.5.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -32769 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37} -do_test boundary2-4.5.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -32769 ORDER BY a - } -} {1 2 11 21 29 37 44 47 55 58 63 64} -do_test boundary2-4.5.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -32769 ORDER BY a DESC - } -} {64 63 58 55 47 44 37 29 21 11 2 1} -do_test boundary2-4.5.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -32769 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29} -do_test boundary2-4.5.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -32769 ORDER BY r DESC - } -} {29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.5.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -32769 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29} -do_test boundary2-4.6.1 { - db eval { - SELECT * FROM t1 WHERE r=-140737488355329 - } -} {-140737488355329 21 ffff7fffffffffff} -do_test boundary2-4.6.2 { - db eval { - SELECT r, a FROM t1 WHERE x='ffff7fffffffffff' - } -} {-140737488355329 21} -do_test boundary2-4.6.3 { - db eval { - SELECT r, x FROM t1 WHERE a=21 - } -} {-140737488355329 ffff7fffffffffff} -do_test boundary2-4.6.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -140737488355329 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63} -do_test boundary2-4.6.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -140737488355329 ORDER BY a DESC - } -} {63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary2-4.6.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -140737488355329 ORDER BY r - } -} {44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.6.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -140737488355329 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44} -do_test boundary2-4.6.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -140737488355329 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.6.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -140737488355329 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63} -do_test boundary2-4.6.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -140737488355329 ORDER BY a DESC - } -} {63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary2-4.6.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -140737488355329 ORDER BY r - } -} {21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.6.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -140737488355329 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21} -do_test boundary2-4.6.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -140737488355329 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.6.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -140737488355329 ORDER BY a - } -} {2 55 64} -do_test boundary2-4.6.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -140737488355329 ORDER BY a DESC - } -} {64 55 2} -do_test boundary2-4.6.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -140737488355329 ORDER BY r - } -} {55 2 64} -do_test boundary2-4.6.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -140737488355329 ORDER BY r DESC - } -} {64 2 55} -do_test boundary2-4.6.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -140737488355329 ORDER BY x - } -} {55 2 64} -do_test boundary2-4.6.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -140737488355329 ORDER BY a - } -} {2 21 55 64} -do_test boundary2-4.6.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -140737488355329 ORDER BY a DESC - } -} {64 55 21 2} -do_test boundary2-4.6.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -140737488355329 ORDER BY r - } -} {55 2 64 21} -do_test boundary2-4.6.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -140737488355329 ORDER BY r DESC - } -} {21 64 2 55} -do_test boundary2-4.6.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -140737488355329 ORDER BY x - } -} {55 2 64 21} -do_test boundary2-4.7.1 { - db eval { - SELECT * FROM t1 WHERE r=2 - } -} {2 41 0000000000000002} -do_test boundary2-4.7.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000000000002' - } -} {2 41} -do_test boundary2-4.7.3 { - db eval { - SELECT r, x FROM t1 WHERE a=41 - } -} {2 0000000000000002} -do_test boundary2-4.7.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 2 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary2-4.7.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 2 ORDER BY a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-4.7.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 2 ORDER BY r - } -} {5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.7.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 2 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5} -do_test boundary2-4.7.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 2 ORDER BY x - } -} {5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.7.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 2 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 41 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary2-4.7.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 2 ORDER BY a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 41 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-4.7.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 2 ORDER BY r - } -} {41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.7.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 2 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41} -do_test boundary2-4.7.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 2 ORDER BY x - } -} {41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.7.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 2 ORDER BY a - } -} {1 2 11 21 29 32 33 37 38 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary2-4.7.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 2 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 38 37 33 32 29 21 11 2 1} -do_test boundary2-4.7.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 2 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60} -do_test boundary2-4.7.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 2 ORDER BY r DESC - } -} {60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.7.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 2 ORDER BY x - } -} {59 60 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.7.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 2 ORDER BY a - } -} {1 2 11 21 29 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary2-4.7.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 2 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 29 21 11 2 1} -do_test boundary2-4.7.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 2 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41} -do_test boundary2-4.7.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 2 ORDER BY r DESC - } -} {41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.7.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 2 ORDER BY x - } -} {59 60 41 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.8.1 { - db eval { - SELECT * FROM t1 WHERE r=4 - } -} {4 31 0000000000000004} -do_test boundary2-4.8.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000000000004' - } -} {4 31} -do_test boundary2-4.8.3 { - db eval { - SELECT r, x FROM t1 WHERE a=31 - } -} {4 0000000000000004} -do_test boundary2-4.8.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 4 ORDER BY a - } -} {3 4 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary2-4.8.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 4 ORDER BY a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 4 3} -do_test boundary2-4.8.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 4 ORDER BY r - } -} {4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.8.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 4 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4} -do_test boundary2-4.8.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 4 ORDER BY x - } -} {4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.8.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 4 ORDER BY a - } -} {3 4 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary2-4.8.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 4 ORDER BY a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 4 3} -do_test boundary2-4.8.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 4 ORDER BY r - } -} {31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.8.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 4 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31} -do_test boundary2-4.8.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 4 ORDER BY x - } -} {31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.8.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 4 ORDER BY a - } -} {1 2 5 11 21 29 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary2-4.8.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 4 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 29 21 11 5 2 1} -do_test boundary2-4.8.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 4 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5} -do_test boundary2-4.8.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 4 ORDER BY r DESC - } -} {5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.8.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 4 ORDER BY x - } -} {59 60 41 5 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.8.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 4 ORDER BY a - } -} {1 2 5 11 21 29 31 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary2-4.8.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 4 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 31 29 21 11 5 2 1} -do_test boundary2-4.8.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 4 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31} -do_test boundary2-4.8.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 4 ORDER BY r DESC - } -} {31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.8.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 4 ORDER BY x - } -} {59 60 41 5 31 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.9.1 { - db eval { - SELECT * FROM t1 WHERE r=562949953421311 - } -} {562949953421311 13 0001ffffffffffff} -do_test boundary2-4.9.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0001ffffffffffff' - } -} {562949953421311 13} -do_test boundary2-4.9.3 { - db eval { - SELECT r, x FROM t1 WHERE a=13 - } -} {562949953421311 0001ffffffffffff} -do_test boundary2-4.9.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 562949953421311 ORDER BY a - } -} {3 17 27 28 43 45} -do_test boundary2-4.9.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 562949953421311 ORDER BY a DESC - } -} {45 43 28 27 17 3} -do_test boundary2-4.9.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 562949953421311 ORDER BY r - } -} {43 27 45 17 28 3} -do_test boundary2-4.9.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 562949953421311 ORDER BY r DESC - } -} {3 28 17 45 27 43} -do_test boundary2-4.9.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 562949953421311 ORDER BY x - } -} {43 27 45 17 28 3} -do_test boundary2-4.9.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 562949953421311 ORDER BY a - } -} {3 13 17 27 28 43 45} -do_test boundary2-4.9.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 562949953421311 ORDER BY a DESC - } -} {45 43 28 27 17 13 3} -do_test boundary2-4.9.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 562949953421311 ORDER BY r - } -} {13 43 27 45 17 28 3} -do_test boundary2-4.9.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 562949953421311 ORDER BY r DESC - } -} {3 28 17 45 27 43 13} -do_test boundary2-4.9.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 562949953421311 ORDER BY x - } -} {13 43 27 45 17 28 3} -do_test boundary2-4.9.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 562949953421311 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 14 15 16 18 19 20 21 22 23 24 25 26 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.9.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 562949953421311 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 26 25 24 23 22 21 20 19 18 16 15 14 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-4.9.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 562949953421311 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26} -do_test boundary2-4.9.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 562949953421311 ORDER BY r DESC - } -} {26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.9.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 562949953421311 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.9.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 562949953421311 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.9.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 562949953421311 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-4.9.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 562949953421311 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13} -do_test boundary2-4.9.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 562949953421311 ORDER BY r DESC - } -} {13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.9.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 562949953421311 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.10.1 { - db eval { - SELECT * FROM t1 WHERE r=256 - } -} {256 61 0000000000000100} -do_test boundary2-4.10.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000000000100' - } -} {256 61} -do_test boundary2-4.10.3 { - db eval { - SELECT r, x FROM t1 WHERE a=61 - } -} {256 0000000000000100} -do_test boundary2-4.10.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 256 ORDER BY a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary2-4.10.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 256 ORDER BY a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary2-4.10.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 256 ORDER BY r - } -} {8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.10.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 256 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8} -do_test boundary2-4.10.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 256 ORDER BY x - } -} {8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.10.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 256 ORDER BY a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 61 62} -do_test boundary2-4.10.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 256 ORDER BY a DESC - } -} {62 61 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary2-4.10.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 256 ORDER BY r - } -} {61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.10.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 256 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61} -do_test boundary2-4.10.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 256 ORDER BY x - } -} {61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.10.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 256 ORDER BY a - } -} {1 2 4 5 11 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 63 64} -do_test boundary2-4.10.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 256 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 11 5 4 2 1} -do_test boundary2-4.10.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 256 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30} -do_test boundary2-4.10.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 256 ORDER BY r DESC - } -} {30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.10.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 256 ORDER BY x - } -} {59 60 41 5 31 4 49 30 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.10.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 256 ORDER BY a - } -} {1 2 4 5 11 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary2-4.10.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 256 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 11 5 4 2 1} -do_test boundary2-4.10.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 256 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61} -do_test boundary2-4.10.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 256 ORDER BY r DESC - } -} {61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.10.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 256 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.11.1 { - db eval { - SELECT * FROM t1 WHERE r=34359738368 - } -} {34359738368 22 0000000800000000} -do_test boundary2-4.11.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000800000000' - } -} {34359738368 22} -do_test boundary2-4.11.3 { - db eval { - SELECT r, x FROM t1 WHERE a=22 - } -} {34359738368 0000000800000000} -do_test boundary2-4.11.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 34359738368 ORDER BY a - } -} {3 7 10 13 17 19 25 26 27 28 34 35 43 45 46 56 57} -do_test boundary2-4.11.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 34359738368 ORDER BY a DESC - } -} {57 56 46 45 43 35 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary2-4.11.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 34359738368 ORDER BY r - } -} {46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.11.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 34359738368 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46} -do_test boundary2-4.11.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 34359738368 ORDER BY x - } -} {46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.11.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 34359738368 ORDER BY a - } -} {3 7 10 13 17 19 22 25 26 27 28 34 35 43 45 46 56 57} -do_test boundary2-4.11.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 34359738368 ORDER BY a DESC - } -} {57 56 46 45 43 35 34 28 27 26 25 22 19 17 13 10 7 3} -do_test boundary2-4.11.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 34359738368 ORDER BY r - } -} {22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.11.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 34359738368 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22} -do_test boundary2-4.11.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 34359738368 ORDER BY x - } -} {22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.11.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 34359738368 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 23 24 29 30 31 32 33 36 37 38 39 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.11.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 34359738368 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 39 38 37 36 33 32 31 30 29 24 23 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-4.11.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 34359738368 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39} -do_test boundary2-4.11.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 34359738368 ORDER BY r DESC - } -} {39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.11.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 34359738368 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.11.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 34359738368 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 36 37 38 39 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.11.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 34359738368 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 39 38 37 36 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-4.11.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 34359738368 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22} -do_test boundary2-4.11.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 34359738368 ORDER BY r DESC - } -} {22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.11.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 34359738368 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.12.1 { - db eval { - SELECT * FROM t1 WHERE r=65536 - } -} {65536 62 0000000000010000} -do_test boundary2-4.12.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000000010000' - } -} {65536 62} -do_test boundary2-4.12.3 { - db eval { - SELECT r, x FROM t1 WHERE a=62 - } -} {65536 0000000000010000} -do_test boundary2-4.12.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 65536 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 51 56 57} -do_test boundary2-4.12.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 65536 ORDER BY a DESC - } -} {57 56 51 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary2-4.12.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 65536 ORDER BY r - } -} {15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.12.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 65536 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15} -do_test boundary2-4.12.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 65536 ORDER BY x - } -} {15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.12.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 65536 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 51 56 57 62} -do_test boundary2-4.12.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 65536 ORDER BY a DESC - } -} {62 57 56 51 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary2-4.12.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 65536 ORDER BY r - } -} {62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.12.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 65536 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62} -do_test boundary2-4.12.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 65536 ORDER BY x - } -} {62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.12.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 65536 ORDER BY a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 48 49 50 52 53 54 55 58 59 60 61 63 64} -do_test boundary2-4.12.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 65536 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 50 49 48 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary2-4.12.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 65536 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48} -do_test boundary2-4.12.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 65536 ORDER BY r DESC - } -} {48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.12.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 65536 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.12.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 65536 ORDER BY a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.12.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 65536 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary2-4.12.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 65536 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62} -do_test boundary2-4.12.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 65536 ORDER BY r DESC - } -} {62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.12.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 65536 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.13.1 { - db eval { - SELECT * FROM t1 WHERE r=268435456 - } -} {268435456 40 0000000010000000} -do_test boundary2-4.13.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000010000000' - } -} {268435456 40} -do_test boundary2-4.13.3 { - db eval { - SELECT r, x FROM t1 WHERE a=40 - } -} {268435456 0000000010000000} -do_test boundary2-4.13.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 268435456 ORDER BY a - } -} {3 7 10 13 14 17 19 20 22 25 26 27 28 34 35 36 39 43 45 46 51 56 57} -do_test boundary2-4.13.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 268435456 ORDER BY a DESC - } -} {57 56 51 46 45 43 39 36 35 34 28 27 26 25 22 20 19 17 14 13 10 7 3} -do_test boundary2-4.13.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 268435456 ORDER BY r - } -} {20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.13.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 268435456 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20} -do_test boundary2-4.13.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 268435456 ORDER BY x - } -} {20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.13.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 268435456 ORDER BY a - } -} {3 7 10 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary2-4.13.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 268435456 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 10 7 3} -do_test boundary2-4.13.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 268435456 ORDER BY r - } -} {40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.13.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 268435456 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40} -do_test boundary2-4.13.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 268435456 ORDER BY x - } -} {40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.13.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 268435456 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.13.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 268435456 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary2-4.13.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 268435456 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12} -do_test boundary2-4.13.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 268435456 ORDER BY r DESC - } -} {12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.13.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 268435456 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.13.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 268435456 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.13.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 268435456 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary2-4.13.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 268435456 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40} -do_test boundary2-4.13.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 268435456 ORDER BY r DESC - } -} {40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.13.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 268435456 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.14.1 { - db eval { - SELECT * FROM t1 WHERE r=-140737488355328 - } -} {-140737488355328 44 ffff800000000000} -do_test boundary2-4.14.2 { - db eval { - SELECT r, a FROM t1 WHERE x='ffff800000000000' - } -} {-140737488355328 44} -do_test boundary2-4.14.3 { - db eval { - SELECT r, x FROM t1 WHERE a=44 - } -} {-140737488355328 ffff800000000000} -do_test boundary2-4.14.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -140737488355328 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63} -do_test boundary2-4.14.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -140737488355328 ORDER BY a DESC - } -} {63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary2-4.14.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -140737488355328 ORDER BY r - } -} {58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.14.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -140737488355328 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58} -do_test boundary2-4.14.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -140737488355328 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.14.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -140737488355328 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63} -do_test boundary2-4.14.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -140737488355328 ORDER BY a DESC - } -} {63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary2-4.14.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -140737488355328 ORDER BY r - } -} {44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.14.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -140737488355328 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44} -do_test boundary2-4.14.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -140737488355328 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.14.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -140737488355328 ORDER BY a - } -} {2 21 55 64} -do_test boundary2-4.14.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -140737488355328 ORDER BY a DESC - } -} {64 55 21 2} -do_test boundary2-4.14.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -140737488355328 ORDER BY r - } -} {55 2 64 21} -do_test boundary2-4.14.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -140737488355328 ORDER BY r DESC - } -} {21 64 2 55} -do_test boundary2-4.14.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -140737488355328 ORDER BY x - } -} {55 2 64 21} -do_test boundary2-4.14.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -140737488355328 ORDER BY a - } -} {2 21 44 55 64} -do_test boundary2-4.14.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -140737488355328 ORDER BY a DESC - } -} {64 55 44 21 2} -do_test boundary2-4.14.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -140737488355328 ORDER BY r - } -} {55 2 64 21 44} -do_test boundary2-4.14.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -140737488355328 ORDER BY r DESC - } -} {44 21 64 2 55} -do_test boundary2-4.14.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -140737488355328 ORDER BY x - } -} {55 2 64 21 44} -do_test boundary2-4.15.1 { - db eval { - SELECT * FROM t1 WHERE r=1099511627776 - } -} {1099511627776 19 0000010000000000} -do_test boundary2-4.15.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000010000000000' - } -} {1099511627776 19} -do_test boundary2-4.15.3 { - db eval { - SELECT r, x FROM t1 WHERE a=19 - } -} {1099511627776 0000010000000000} -do_test boundary2-4.15.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 1099511627776 ORDER BY a - } -} {3 7 10 13 17 25 26 27 28 34 43 45 56} -do_test boundary2-4.15.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 1099511627776 ORDER BY a DESC - } -} {56 45 43 34 28 27 26 25 17 13 10 7 3} -do_test boundary2-4.15.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 1099511627776 ORDER BY r - } -} {7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.15.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 1099511627776 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7} -do_test boundary2-4.15.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 1099511627776 ORDER BY x - } -} {7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.15.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 1099511627776 ORDER BY a - } -} {3 7 10 13 17 19 25 26 27 28 34 43 45 56} -do_test boundary2-4.15.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 1099511627776 ORDER BY a DESC - } -} {56 45 43 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary2-4.15.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 1099511627776 ORDER BY r - } -} {19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.15.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 1099511627776 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19} -do_test boundary2-4.15.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 1099511627776 ORDER BY x - } -} {19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.15.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 1099511627776 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 57 58 59 60 61 62 63 64} -do_test boundary2-4.15.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 1099511627776 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-4.15.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 1099511627776 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57} -do_test boundary2-4.15.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 1099511627776 ORDER BY r DESC - } -} {57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.15.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 1099511627776 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.15.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 1099511627776 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 19 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 57 58 59 60 61 62 63 64} -do_test boundary2-4.15.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 1099511627776 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 19 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-4.15.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 1099511627776 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19} -do_test boundary2-4.15.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 1099511627776 ORDER BY r DESC - } -} {19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.15.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 1099511627776 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.16.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 9223372036854775807 ORDER BY a - } -} {} -do_test boundary2-4.16.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 9223372036854775807 ORDER BY a DESC - } -} {} -do_test boundary2-4.16.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 9223372036854775807 ORDER BY r - } -} {} -do_test boundary2-4.16.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 9223372036854775807 ORDER BY r DESC - } -} {} -do_test boundary2-4.16.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 9223372036854775807 ORDER BY x - } -} {} -do_test boundary2-4.16.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 9223372036854775807 ORDER BY a - } -} {3} -do_test boundary2-4.16.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 9223372036854775807 ORDER BY a DESC - } -} {3} -do_test boundary2-4.16.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 9223372036854775807 ORDER BY r - } -} {3} -do_test boundary2-4.16.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 9223372036854775807 ORDER BY r DESC - } -} {3} -do_test boundary2-4.16.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 9223372036854775807 ORDER BY x - } -} {3} -do_test boundary2-4.16.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 9223372036854775807 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.16.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 9223372036854775807 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-4.16.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 9223372036854775807 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28} -do_test boundary2-4.16.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 9223372036854775807 ORDER BY r DESC - } -} {28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.16.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 9223372036854775807 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.16.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 9223372036854775807 ORDER BY a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.16.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 9223372036854775807 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary2-4.16.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 9223372036854775807 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.16.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 9223372036854775807 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.16.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 9223372036854775807 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.17.1 { - db eval { - SELECT * FROM t1 WHERE r=32768 - } -} {32768 50 0000000000008000} -do_test boundary2-4.17.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000000008000' - } -} {32768 50} -do_test boundary2-4.17.3 { - db eval { - SELECT r, x FROM t1 WHERE a=50 - } -} {32768 0000000000008000} -do_test boundary2-4.17.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 32768 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 51 56 57 62} -do_test boundary2-4.17.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 32768 ORDER BY a DESC - } -} {62 57 56 51 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary2-4.17.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 32768 ORDER BY r - } -} {48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.17.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 32768 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48} -do_test boundary2-4.17.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 32768 ORDER BY x - } -} {48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.17.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 32768 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary2-4.17.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 32768 ORDER BY a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary2-4.17.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 32768 ORDER BY r - } -} {50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.17.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 32768 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50} -do_test boundary2-4.17.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 32768 ORDER BY x - } -} {50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.17.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 32768 ORDER BY a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary2-4.17.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 32768 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary2-4.17.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 32768 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23} -do_test boundary2-4.17.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 32768 ORDER BY r DESC - } -} {23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.17.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 32768 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.17.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 32768 ORDER BY a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 49 50 52 53 54 55 58 59 60 61 63 64} -do_test boundary2-4.17.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 32768 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 50 49 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary2-4.17.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 32768 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50} -do_test boundary2-4.17.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 32768 ORDER BY r DESC - } -} {50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.17.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 32768 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.18.1 { - db eval { - SELECT * FROM t1 WHERE r=-36028797018963968 - } -} {-36028797018963968 64 ff80000000000000} -do_test boundary2-4.18.2 { - db eval { - SELECT r, a FROM t1 WHERE x='ff80000000000000' - } -} {-36028797018963968 64} -do_test boundary2-4.18.3 { - db eval { - SELECT r, x FROM t1 WHERE a=64 - } -} {-36028797018963968 ff80000000000000} -do_test boundary2-4.18.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -36028797018963968 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63} -do_test boundary2-4.18.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -36028797018963968 ORDER BY a DESC - } -} {63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary2-4.18.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -36028797018963968 ORDER BY r - } -} {21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.18.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -36028797018963968 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21} -do_test boundary2-4.18.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -36028797018963968 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.18.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -36028797018963968 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.18.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -36028797018963968 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary2-4.18.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -36028797018963968 ORDER BY r - } -} {64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.18.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -36028797018963968 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64} -do_test boundary2-4.18.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -36028797018963968 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.18.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -36028797018963968 ORDER BY a - } -} {2 55} -do_test boundary2-4.18.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -36028797018963968 ORDER BY a DESC - } -} {55 2} -do_test boundary2-4.18.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -36028797018963968 ORDER BY r - } -} {55 2} -do_test boundary2-4.18.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -36028797018963968 ORDER BY r DESC - } -} {2 55} -do_test boundary2-4.18.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -36028797018963968 ORDER BY x - } -} {55 2} -do_test boundary2-4.18.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -36028797018963968 ORDER BY a - } -} {2 55 64} -do_test boundary2-4.18.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -36028797018963968 ORDER BY a DESC - } -} {64 55 2} -do_test boundary2-4.18.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -36028797018963968 ORDER BY r - } -} {55 2 64} -do_test boundary2-4.18.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -36028797018963968 ORDER BY r DESC - } -} {64 2 55} -do_test boundary2-4.18.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -36028797018963968 ORDER BY x - } -} {55 2 64} -do_test boundary2-4.19.1 { - db eval { - SELECT * FROM t1 WHERE r=65535 - } -} {65535 48 000000000000ffff} -do_test boundary2-4.19.2 { - db eval { - SELECT r, a FROM t1 WHERE x='000000000000ffff' - } -} {65535 48} -do_test boundary2-4.19.3 { - db eval { - SELECT r, x FROM t1 WHERE a=48 - } -} {65535 000000000000ffff} -do_test boundary2-4.19.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 65535 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 51 56 57 62} -do_test boundary2-4.19.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 65535 ORDER BY a DESC - } -} {62 57 56 51 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary2-4.19.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 65535 ORDER BY r - } -} {62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.19.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 65535 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62} -do_test boundary2-4.19.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 65535 ORDER BY x - } -} {62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.19.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 65535 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 51 56 57 62} -do_test boundary2-4.19.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 65535 ORDER BY a DESC - } -} {62 57 56 51 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary2-4.19.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 65535 ORDER BY r - } -} {48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.19.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 65535 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48} -do_test boundary2-4.19.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 65535 ORDER BY x - } -} {48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.19.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 65535 ORDER BY a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 49 50 52 53 54 55 58 59 60 61 63 64} -do_test boundary2-4.19.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 65535 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 50 49 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary2-4.19.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 65535 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50} -do_test boundary2-4.19.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 65535 ORDER BY r DESC - } -} {50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.19.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 65535 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.19.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 65535 ORDER BY a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 48 49 50 52 53 54 55 58 59 60 61 63 64} -do_test boundary2-4.19.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 65535 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 50 49 48 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary2-4.19.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 65535 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48} -do_test boundary2-4.19.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 65535 ORDER BY r DESC - } -} {48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.19.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 65535 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.20.1 { - db eval { - SELECT * FROM t1 WHERE r=4294967295 - } -} {4294967295 14 00000000ffffffff} -do_test boundary2-4.20.2 { - db eval { - SELECT r, a FROM t1 WHERE x='00000000ffffffff' - } -} {4294967295 14} -do_test boundary2-4.20.3 { - db eval { - SELECT r, x FROM t1 WHERE a=14 - } -} {4294967295 00000000ffffffff} -do_test boundary2-4.20.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 4294967295 ORDER BY a - } -} {3 7 10 13 17 19 22 25 26 27 28 34 35 36 39 43 45 46 56 57} -do_test boundary2-4.20.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 4294967295 ORDER BY a DESC - } -} {57 56 46 45 43 39 36 35 34 28 27 26 25 22 19 17 13 10 7 3} -do_test boundary2-4.20.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 4294967295 ORDER BY r - } -} {36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.20.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 4294967295 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36} -do_test boundary2-4.20.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 4294967295 ORDER BY x - } -} {36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.20.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 4294967295 ORDER BY a - } -} {3 7 10 13 14 17 19 22 25 26 27 28 34 35 36 39 43 45 46 56 57} -do_test boundary2-4.20.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 4294967295 ORDER BY a DESC - } -} {57 56 46 45 43 39 36 35 34 28 27 26 25 22 19 17 14 13 10 7 3} -do_test boundary2-4.20.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 4294967295 ORDER BY r - } -} {14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.20.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 4294967295 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14} -do_test boundary2-4.20.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 4294967295 ORDER BY x - } -} {14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.20.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 4294967295 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 20 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.20.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 4294967295 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 20 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary2-4.20.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 4294967295 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51} -do_test boundary2-4.20.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 4294967295 ORDER BY r DESC - } -} {51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.20.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 4294967295 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.20.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 4294967295 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.20.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 4294967295 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-4.20.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 4294967295 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14} -do_test boundary2-4.20.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 4294967295 ORDER BY r DESC - } -} {14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.20.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 4294967295 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.21.1 { - db eval { - SELECT * FROM t1 WHERE r=1099511627775 - } -} {1099511627775 57 000000ffffffffff} -do_test boundary2-4.21.2 { - db eval { - SELECT r, a FROM t1 WHERE x='000000ffffffffff' - } -} {1099511627775 57} -do_test boundary2-4.21.3 { - db eval { - SELECT r, x FROM t1 WHERE a=57 - } -} {1099511627775 000000ffffffffff} -do_test boundary2-4.21.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 1099511627775 ORDER BY a - } -} {3 7 10 13 17 19 25 26 27 28 34 43 45 56} -do_test boundary2-4.21.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 1099511627775 ORDER BY a DESC - } -} {56 45 43 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary2-4.21.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 1099511627775 ORDER BY r - } -} {19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.21.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 1099511627775 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19} -do_test boundary2-4.21.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 1099511627775 ORDER BY x - } -} {19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.21.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 1099511627775 ORDER BY a - } -} {3 7 10 13 17 19 25 26 27 28 34 43 45 56 57} -do_test boundary2-4.21.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 1099511627775 ORDER BY a DESC - } -} {57 56 45 43 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary2-4.21.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 1099511627775 ORDER BY r - } -} {57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.21.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 1099511627775 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57} -do_test boundary2-4.21.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 1099511627775 ORDER BY x - } -} {57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.21.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 1099511627775 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.21.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 1099511627775 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-4.21.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 1099511627775 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35} -do_test boundary2-4.21.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 1099511627775 ORDER BY r DESC - } -} {35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.21.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 1099511627775 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.21.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 1099511627775 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 57 58 59 60 61 62 63 64} -do_test boundary2-4.21.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 1099511627775 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-4.21.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 1099511627775 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57} -do_test boundary2-4.21.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 1099511627775 ORDER BY r DESC - } -} {57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.21.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 1099511627775 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.22.1 { - db eval { - SELECT * FROM t1 WHERE r=-8388608 - } -} {-8388608 37 ffffffffff800000} -do_test boundary2-4.22.2 { - db eval { - SELECT r, a FROM t1 WHERE x='ffffffffff800000' - } -} {-8388608 37} -do_test boundary2-4.22.3 { - db eval { - SELECT r, x FROM t1 WHERE a=37 - } -} {-8388608 ffffffffff800000} -do_test boundary2-4.22.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -8388608 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary2-4.22.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -8388608 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-4.22.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -8388608 ORDER BY r - } -} {29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.22.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -8388608 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29} -do_test boundary2-4.22.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -8388608 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 29 32 54 53 52 33 38} -do_test boundary2-4.22.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -8388608 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary2-4.22.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -8388608 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-4.22.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -8388608 ORDER BY r - } -} {37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.22.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -8388608 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37} -do_test boundary2-4.22.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -8388608 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 37 29 32 54 53 52 33 38} -do_test boundary2-4.22.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -8388608 ORDER BY a - } -} {1 2 11 21 44 47 55 58 63 64} -do_test boundary2-4.22.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -8388608 ORDER BY a DESC - } -} {64 63 58 55 47 44 21 11 2 1} -do_test boundary2-4.22.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -8388608 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1} -do_test boundary2-4.22.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -8388608 ORDER BY r DESC - } -} {1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.22.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -8388608 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1} -do_test boundary2-4.22.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -8388608 ORDER BY a - } -} {1 2 11 21 37 44 47 55 58 63 64} -do_test boundary2-4.22.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -8388608 ORDER BY a DESC - } -} {64 63 58 55 47 44 37 21 11 2 1} -do_test boundary2-4.22.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -8388608 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37} -do_test boundary2-4.22.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -8388608 ORDER BY r DESC - } -} {37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.22.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -8388608 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37} -do_test boundary2-4.23.1 { - db eval { - SELECT * FROM t1 WHERE r=549755813888 - } -} {549755813888 35 0000008000000000} -do_test boundary2-4.23.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000008000000000' - } -} {549755813888 35} -do_test boundary2-4.23.3 { - db eval { - SELECT r, x FROM t1 WHERE a=35 - } -} {549755813888 0000008000000000} -do_test boundary2-4.23.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 549755813888 ORDER BY a - } -} {3 7 10 13 17 19 25 26 27 28 34 43 45 56 57} -do_test boundary2-4.23.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 549755813888 ORDER BY a DESC - } -} {57 56 45 43 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary2-4.23.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 549755813888 ORDER BY r - } -} {57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.23.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 549755813888 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57} -do_test boundary2-4.23.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 549755813888 ORDER BY x - } -} {57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.23.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 549755813888 ORDER BY a - } -} {3 7 10 13 17 19 25 26 27 28 34 35 43 45 56 57} -do_test boundary2-4.23.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 549755813888 ORDER BY a DESC - } -} {57 56 45 43 35 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary2-4.23.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 549755813888 ORDER BY r - } -} {35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.23.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 549755813888 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35} -do_test boundary2-4.23.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 549755813888 ORDER BY x - } -} {35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.23.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 549755813888 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.23.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 549755813888 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-4.23.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 549755813888 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46} -do_test boundary2-4.23.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 549755813888 ORDER BY r DESC - } -} {46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.23.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 549755813888 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.23.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 549755813888 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.23.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 549755813888 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-4.23.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 549755813888 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35} -do_test boundary2-4.23.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 549755813888 ORDER BY r DESC - } -} {35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.23.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 549755813888 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.24.1 { - db eval { - SELECT * FROM t1 WHERE r=8388607 - } -} {8388607 18 00000000007fffff} -do_test boundary2-4.24.2 { - db eval { - SELECT r, a FROM t1 WHERE x='00000000007fffff' - } -} {8388607 18} -do_test boundary2-4.24.3 { - db eval { - SELECT r, x FROM t1 WHERE a=18 - } -} {8388607 00000000007fffff} -do_test boundary2-4.24.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 8388607 ORDER BY a - } -} {3 6 7 9 10 12 13 14 17 19 20 22 24 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary2-4.24.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 8388607 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 24 22 20 19 17 14 13 12 10 9 7 6 3} -do_test boundary2-4.24.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 8388607 ORDER BY r - } -} {24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.24.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 8388607 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24} -do_test boundary2-4.24.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 8388607 ORDER BY x - } -} {24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.24.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 8388607 ORDER BY a - } -} {3 6 7 9 10 12 13 14 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary2-4.24.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 8388607 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 14 13 12 10 9 7 6 3} -do_test boundary2-4.24.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 8388607 ORDER BY r - } -} {18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.24.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 8388607 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18} -do_test boundary2-4.24.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 8388607 ORDER BY x - } -} {18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.24.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 8388607 ORDER BY a - } -} {1 2 4 5 8 11 15 16 21 23 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.24.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 8388607 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 23 21 16 15 11 8 5 4 2 1} -do_test boundary2-4.24.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 8388607 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42} -do_test boundary2-4.24.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 8388607 ORDER BY r DESC - } -} {42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.24.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 8388607 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.24.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 8388607 ORDER BY a - } -} {1 2 4 5 8 11 15 16 18 21 23 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.24.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 8388607 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 23 21 18 16 15 11 8 5 4 2 1} -do_test boundary2-4.24.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 8388607 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18} -do_test boundary2-4.24.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 8388607 ORDER BY r DESC - } -} {18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.24.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 8388607 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.25.1 { - db eval { - SELECT * FROM t1 WHERE r=-3 - } -} {-3 52 fffffffffffffffd} -do_test boundary2-4.25.2 { - db eval { - SELECT r, a FROM t1 WHERE x='fffffffffffffffd' - } -} {-3 52} -do_test boundary2-4.25.3 { - db eval { - SELECT r, x FROM t1 WHERE a=52 - } -} {-3 fffffffffffffffd} -do_test boundary2-4.25.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -3 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 56 57 59 60 61 62} -do_test boundary2-4.25.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -3 ORDER BY a DESC - } -} {62 61 60 59 57 56 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-4.25.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -3 ORDER BY r - } -} {33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.25.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -3 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33} -do_test boundary2-4.25.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -3 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 33 38} -do_test boundary2-4.25.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -3 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 56 57 59 60 61 62} -do_test boundary2-4.25.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -3 ORDER BY a DESC - } -} {62 61 60 59 57 56 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-4.25.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -3 ORDER BY r - } -} {52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.25.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -3 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52} -do_test boundary2-4.25.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -3 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 52 33 38} -do_test boundary2-4.25.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -3 ORDER BY a - } -} {1 2 11 21 29 32 37 44 47 53 54 55 58 63 64} -do_test boundary2-4.25.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -3 ORDER BY a DESC - } -} {64 63 58 55 54 53 47 44 37 32 29 21 11 2 1} -do_test boundary2-4.25.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -3 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53} -do_test boundary2-4.25.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -3 ORDER BY r DESC - } -} {53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.25.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -3 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53} -do_test boundary2-4.25.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -3 ORDER BY a - } -} {1 2 11 21 29 32 37 44 47 52 53 54 55 58 63 64} -do_test boundary2-4.25.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -3 ORDER BY a DESC - } -} {64 63 58 55 54 53 52 47 44 37 32 29 21 11 2 1} -do_test boundary2-4.25.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -3 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52} -do_test boundary2-4.25.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -3 ORDER BY r DESC - } -} {52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.25.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -3 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52} -do_test boundary2-4.26.1 { - db eval { - SELECT * FROM t1 WHERE r=0 - } -} {0 59 0000000000000000} -do_test boundary2-4.26.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000000000000' - } -} {0 59} -do_test boundary2-4.26.3 { - db eval { - SELECT r, x FROM t1 WHERE a=59 - } -} {0 0000000000000000} -do_test boundary2-4.26.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 0 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 41 42 43 45 46 48 49 50 51 56 57 60 61 62} -do_test boundary2-4.26.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 0 ORDER BY a DESC - } -} {62 61 60 57 56 51 50 49 48 46 45 43 42 41 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-4.26.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 0 ORDER BY r - } -} {60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.26.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 0 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60} -do_test boundary2-4.26.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 0 ORDER BY x - } -} {60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.26.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 0 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 41 42 43 45 46 48 49 50 51 56 57 59 60 61 62} -do_test boundary2-4.26.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 0 ORDER BY a DESC - } -} {62 61 60 59 57 56 51 50 49 48 46 45 43 42 41 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-4.26.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 0 ORDER BY r - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.26.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 0 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59} -do_test boundary2-4.26.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 0 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.26.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 0 ORDER BY a - } -} {1 2 11 21 29 32 33 37 38 44 47 52 53 54 55 58 63 64} -do_test boundary2-4.26.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 0 ORDER BY a DESC - } -} {64 63 58 55 54 53 52 47 44 38 37 33 32 29 21 11 2 1} -do_test boundary2-4.26.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 0 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.26.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 0 ORDER BY r DESC - } -} {38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.26.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 0 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.26.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 0 ORDER BY a - } -} {1 2 11 21 29 32 33 37 38 44 47 52 53 54 55 58 59 63 64} -do_test boundary2-4.26.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 0 ORDER BY a DESC - } -} {64 63 59 58 55 54 53 52 47 44 38 37 33 32 29 21 11 2 1} -do_test boundary2-4.26.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 0 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59} -do_test boundary2-4.26.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 0 ORDER BY r DESC - } -} {59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.26.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 0 ORDER BY x - } -} {59 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.27.1 { - db eval { - SELECT * FROM t1 WHERE r=-1 - } -} {-1 38 ffffffffffffffff} -do_test boundary2-4.27.2 { - db eval { - SELECT r, a FROM t1 WHERE x='ffffffffffffffff' - } -} {-1 38} -do_test boundary2-4.27.3 { - db eval { - SELECT r, x FROM t1 WHERE a=38 - } -} {-1 ffffffffffffffff} -do_test boundary2-4.27.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -1 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 41 42 43 45 46 48 49 50 51 56 57 59 60 61 62} -do_test boundary2-4.27.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -1 ORDER BY a DESC - } -} {62 61 60 59 57 56 51 50 49 48 46 45 43 42 41 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-4.27.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -1 ORDER BY r - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.27.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -1 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59} -do_test boundary2-4.27.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -1 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.27.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -1 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 56 57 59 60 61 62} -do_test boundary2-4.27.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -1 ORDER BY a DESC - } -} {62 61 60 59 57 56 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-4.27.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -1 ORDER BY r - } -} {38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.27.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -1 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38} -do_test boundary2-4.27.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -1 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 38} -do_test boundary2-4.27.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -1 ORDER BY a - } -} {1 2 11 21 29 32 33 37 44 47 52 53 54 55 58 63 64} -do_test boundary2-4.27.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -1 ORDER BY a DESC - } -} {64 63 58 55 54 53 52 47 44 37 33 32 29 21 11 2 1} -do_test boundary2-4.27.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -1 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33} -do_test boundary2-4.27.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -1 ORDER BY r DESC - } -} {33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.27.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -1 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33} -do_test boundary2-4.27.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -1 ORDER BY a - } -} {1 2 11 21 29 32 33 37 38 44 47 52 53 54 55 58 63 64} -do_test boundary2-4.27.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -1 ORDER BY a DESC - } -} {64 63 58 55 54 53 52 47 44 38 37 33 32 29 21 11 2 1} -do_test boundary2-4.27.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -1 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.27.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -1 ORDER BY r DESC - } -} {38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.27.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -1 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.28.1 { - db eval { - SELECT * FROM t1 WHERE r=-2 - } -} {-2 33 fffffffffffffffe} -do_test boundary2-4.28.2 { - db eval { - SELECT r, a FROM t1 WHERE x='fffffffffffffffe' - } -} {-2 33} -do_test boundary2-4.28.3 { - db eval { - SELECT r, x FROM t1 WHERE a=33 - } -} {-2 fffffffffffffffe} -do_test boundary2-4.28.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -2 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 56 57 59 60 61 62} -do_test boundary2-4.28.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -2 ORDER BY a DESC - } -} {62 61 60 59 57 56 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-4.28.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -2 ORDER BY r - } -} {38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.28.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -2 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38} -do_test boundary2-4.28.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -2 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 38} -do_test boundary2-4.28.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -2 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 56 57 59 60 61 62} -do_test boundary2-4.28.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -2 ORDER BY a DESC - } -} {62 61 60 59 57 56 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-4.28.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -2 ORDER BY r - } -} {33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.28.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -2 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33} -do_test boundary2-4.28.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -2 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 33 38} -do_test boundary2-4.28.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -2 ORDER BY a - } -} {1 2 11 21 29 32 37 44 47 52 53 54 55 58 63 64} -do_test boundary2-4.28.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -2 ORDER BY a DESC - } -} {64 63 58 55 54 53 52 47 44 37 32 29 21 11 2 1} -do_test boundary2-4.28.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -2 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52} -do_test boundary2-4.28.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -2 ORDER BY r DESC - } -} {52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.28.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -2 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52} -do_test boundary2-4.28.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -2 ORDER BY a - } -} {1 2 11 21 29 32 33 37 44 47 52 53 54 55 58 63 64} -do_test boundary2-4.28.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -2 ORDER BY a DESC - } -} {64 63 58 55 54 53 52 47 44 37 33 32 29 21 11 2 1} -do_test boundary2-4.28.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -2 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33} -do_test boundary2-4.28.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -2 ORDER BY r DESC - } -} {33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.28.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -2 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33} -do_test boundary2-4.29.1 { - db eval { - SELECT * FROM t1 WHERE r=2097152 - } -} {2097152 42 0000000000200000} -do_test boundary2-4.29.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000000200000' - } -} {2097152 42} -do_test boundary2-4.29.3 { - db eval { - SELECT r, x FROM t1 WHERE a=42 - } -} {2097152 0000000000200000} -do_test boundary2-4.29.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 2097152 ORDER BY a - } -} {3 6 7 9 10 12 13 14 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary2-4.29.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 2097152 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 14 13 12 10 9 7 6 3} -do_test boundary2-4.29.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 2097152 ORDER BY r - } -} {18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.29.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 2097152 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18} -do_test boundary2-4.29.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 2097152 ORDER BY x - } -} {18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.29.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 2097152 ORDER BY a - } -} {3 6 7 9 10 12 13 14 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 51 56 57} -do_test boundary2-4.29.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 2097152 ORDER BY a DESC - } -} {57 56 51 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 14 13 12 10 9 7 6 3} -do_test boundary2-4.29.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 2097152 ORDER BY r - } -} {42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.29.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 2097152 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42} -do_test boundary2-4.29.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 2097152 ORDER BY x - } -} {42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.29.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 2097152 ORDER BY a - } -} {1 2 4 5 8 11 15 16 21 23 29 30 31 32 33 37 38 41 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.29.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 2097152 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 41 38 37 33 32 31 30 29 23 21 16 15 11 8 5 4 2 1} -do_test boundary2-4.29.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 2097152 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15} -do_test boundary2-4.29.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 2097152 ORDER BY r DESC - } -} {15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.29.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 2097152 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.29.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 2097152 ORDER BY a - } -} {1 2 4 5 8 11 15 16 21 23 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.29.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 2097152 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 23 21 16 15 11 8 5 4 2 1} -do_test boundary2-4.29.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 2097152 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42} -do_test boundary2-4.29.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 2097152 ORDER BY r DESC - } -} {42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.29.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 2097152 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.30.1 { - db eval { - SELECT * FROM t1 WHERE r=128 - } -} {128 49 0000000000000080} -do_test boundary2-4.30.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000000000080' - } -} {128 49} -do_test boundary2-4.30.3 { - db eval { - SELECT r, x FROM t1 WHERE a=49 - } -} {128 0000000000000080} -do_test boundary2-4.30.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 128 ORDER BY a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 34 35 36 39 40 42 43 45 46 48 50 51 56 57 61 62} -do_test boundary2-4.30.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 128 ORDER BY a DESC - } -} {62 61 57 56 51 50 48 46 45 43 42 40 39 36 35 34 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary2-4.30.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 128 ORDER BY r - } -} {30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.30.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 128 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30} -do_test boundary2-4.30.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 128 ORDER BY x - } -} {30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.30.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 128 ORDER BY a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary2-4.30.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 128 ORDER BY a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary2-4.30.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 128 ORDER BY r - } -} {49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.30.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 128 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49} -do_test boundary2-4.30.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 128 ORDER BY x - } -} {49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.30.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 128 ORDER BY a - } -} {1 2 4 5 11 21 29 31 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary2-4.30.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 128 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 31 29 21 11 5 4 2 1} -do_test boundary2-4.30.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 128 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4} -do_test boundary2-4.30.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 128 ORDER BY r DESC - } -} {4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.30.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 128 ORDER BY x - } -} {59 60 41 5 31 4 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.30.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 128 ORDER BY a - } -} {1 2 4 5 11 21 29 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 63 64} -do_test boundary2-4.30.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 128 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 29 21 11 5 4 2 1} -do_test boundary2-4.30.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 128 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49} -do_test boundary2-4.30.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 128 ORDER BY r DESC - } -} {49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.30.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 128 ORDER BY x - } -} {59 60 41 5 31 4 49 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.31.1 { - db eval { - SELECT * FROM t1 WHERE r=255 - } -} {255 30 00000000000000ff} -do_test boundary2-4.31.2 { - db eval { - SELECT r, a FROM t1 WHERE x='00000000000000ff' - } -} {255 30} -do_test boundary2-4.31.3 { - db eval { - SELECT r, x FROM t1 WHERE a=30 - } -} {255 00000000000000ff} -do_test boundary2-4.31.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 255 ORDER BY a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 61 62} -do_test boundary2-4.31.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 255 ORDER BY a DESC - } -} {62 61 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary2-4.31.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 255 ORDER BY r - } -} {61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.31.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 255 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61} -do_test boundary2-4.31.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 255 ORDER BY x - } -} {61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.31.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 255 ORDER BY a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 34 35 36 39 40 42 43 45 46 48 50 51 56 57 61 62} -do_test boundary2-4.31.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 255 ORDER BY a DESC - } -} {62 61 57 56 51 50 48 46 45 43 42 40 39 36 35 34 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary2-4.31.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 255 ORDER BY r - } -} {30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.31.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 255 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30} -do_test boundary2-4.31.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 255 ORDER BY x - } -} {30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.31.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 255 ORDER BY a - } -} {1 2 4 5 11 21 29 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 63 64} -do_test boundary2-4.31.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 255 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 29 21 11 5 4 2 1} -do_test boundary2-4.31.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 255 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49} -do_test boundary2-4.31.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 255 ORDER BY r DESC - } -} {49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.31.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 255 ORDER BY x - } -} {59 60 41 5 31 4 49 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.31.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 255 ORDER BY a - } -} {1 2 4 5 11 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 63 64} -do_test boundary2-4.31.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 255 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 11 5 4 2 1} -do_test boundary2-4.31.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 255 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30} -do_test boundary2-4.31.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 255 ORDER BY r DESC - } -} {30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.31.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 255 ORDER BY x - } -} {59 60 41 5 31 4 49 30 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.32.1 { - db eval { - SELECT * FROM t1 WHERE r=-2147483648 - } -} {-2147483648 11 ffffffff80000000} -do_test boundary2-4.32.2 { - db eval { - SELECT r, a FROM t1 WHERE x='ffffffff80000000' - } -} {-2147483648 11} -do_test boundary2-4.32.3 { - db eval { - SELECT r, x FROM t1 WHERE a=11 - } -} {-2147483648 ffffffff80000000} -do_test boundary2-4.32.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -2147483648 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary2-4.32.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -2147483648 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3 1} -do_test boundary2-4.32.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -2147483648 ORDER BY r - } -} {1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.32.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -2147483648 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1} -do_test boundary2-4.32.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -2147483648 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.32.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -2147483648 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary2-4.32.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -2147483648 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary2-4.32.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -2147483648 ORDER BY r - } -} {11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.32.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -2147483648 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11} -do_test boundary2-4.32.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -2147483648 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.32.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -2147483648 ORDER BY a - } -} {2 21 44 47 55 58 63 64} -do_test boundary2-4.32.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -2147483648 ORDER BY a DESC - } -} {64 63 58 55 47 44 21 2} -do_test boundary2-4.32.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -2147483648 ORDER BY r - } -} {55 2 64 21 44 58 63 47} -do_test boundary2-4.32.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -2147483648 ORDER BY r DESC - } -} {47 63 58 44 21 64 2 55} -do_test boundary2-4.32.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -2147483648 ORDER BY x - } -} {55 2 64 21 44 58 63 47} -do_test boundary2-4.32.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -2147483648 ORDER BY a - } -} {2 11 21 44 47 55 58 63 64} -do_test boundary2-4.32.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -2147483648 ORDER BY a DESC - } -} {64 63 58 55 47 44 21 11 2} -do_test boundary2-4.32.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -2147483648 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11} -do_test boundary2-4.32.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -2147483648 ORDER BY r DESC - } -} {11 47 63 58 44 21 64 2 55} -do_test boundary2-4.32.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -2147483648 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11} -do_test boundary2-4.33.1 { - db eval { - SELECT * FROM t1 WHERE r=34359738367 - } -} {34359738367 39 00000007ffffffff} -do_test boundary2-4.33.2 { - db eval { - SELECT r, a FROM t1 WHERE x='00000007ffffffff' - } -} {34359738367 39} -do_test boundary2-4.33.3 { - db eval { - SELECT r, x FROM t1 WHERE a=39 - } -} {34359738367 00000007ffffffff} -do_test boundary2-4.33.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 34359738367 ORDER BY a - } -} {3 7 10 13 17 19 22 25 26 27 28 34 35 43 45 46 56 57} -do_test boundary2-4.33.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 34359738367 ORDER BY a DESC - } -} {57 56 46 45 43 35 34 28 27 26 25 22 19 17 13 10 7 3} -do_test boundary2-4.33.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 34359738367 ORDER BY r - } -} {22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.33.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 34359738367 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22} -do_test boundary2-4.33.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 34359738367 ORDER BY x - } -} {22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.33.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 34359738367 ORDER BY a - } -} {3 7 10 13 17 19 22 25 26 27 28 34 35 39 43 45 46 56 57} -do_test boundary2-4.33.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 34359738367 ORDER BY a DESC - } -} {57 56 46 45 43 39 35 34 28 27 26 25 22 19 17 13 10 7 3} -do_test boundary2-4.33.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 34359738367 ORDER BY r - } -} {39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.33.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 34359738367 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39} -do_test boundary2-4.33.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 34359738367 ORDER BY x - } -} {39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.33.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 34359738367 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 23 24 29 30 31 32 33 36 37 38 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.33.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 34359738367 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 38 37 36 33 32 31 30 29 24 23 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-4.33.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 34359738367 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36} -do_test boundary2-4.33.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 34359738367 ORDER BY r DESC - } -} {36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.33.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 34359738367 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.33.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 34359738367 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 23 24 29 30 31 32 33 36 37 38 39 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.33.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 34359738367 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 39 38 37 36 33 32 31 30 29 24 23 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-4.33.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 34359738367 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39} -do_test boundary2-4.33.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 34359738367 ORDER BY r DESC - } -} {39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.33.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 34359738367 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.34.1 { - db eval { - SELECT * FROM t1 WHERE r=-549755813889 - } -} {-549755813889 58 ffffff7fffffffff} -do_test boundary2-4.34.2 { - db eval { - SELECT r, a FROM t1 WHERE x='ffffff7fffffffff' - } -} {-549755813889 58} -do_test boundary2-4.34.3 { - db eval { - SELECT r, x FROM t1 WHERE a=58 - } -} {-549755813889 ffffff7fffffffff} -do_test boundary2-4.34.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -549755813889 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 47 48 49 50 51 52 53 54 56 57 59 60 61 62 63} -do_test boundary2-4.34.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -549755813889 ORDER BY a DESC - } -} {63 62 61 60 59 57 56 54 53 52 51 50 49 48 47 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary2-4.34.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -549755813889 ORDER BY r - } -} {63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.34.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -549755813889 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63} -do_test boundary2-4.34.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -549755813889 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.34.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -549755813889 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63} -do_test boundary2-4.34.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -549755813889 ORDER BY a DESC - } -} {63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary2-4.34.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -549755813889 ORDER BY r - } -} {58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.34.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -549755813889 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58} -do_test boundary2-4.34.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -549755813889 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.34.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -549755813889 ORDER BY a - } -} {2 21 44 55 64} -do_test boundary2-4.34.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -549755813889 ORDER BY a DESC - } -} {64 55 44 21 2} -do_test boundary2-4.34.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -549755813889 ORDER BY r - } -} {55 2 64 21 44} -do_test boundary2-4.34.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -549755813889 ORDER BY r DESC - } -} {44 21 64 2 55} -do_test boundary2-4.34.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -549755813889 ORDER BY x - } -} {55 2 64 21 44} -do_test boundary2-4.34.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -549755813889 ORDER BY a - } -} {2 21 44 55 58 64} -do_test boundary2-4.34.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -549755813889 ORDER BY a DESC - } -} {64 58 55 44 21 2} -do_test boundary2-4.34.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -549755813889 ORDER BY r - } -} {55 2 64 21 44 58} -do_test boundary2-4.34.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -549755813889 ORDER BY r DESC - } -} {58 44 21 64 2 55} -do_test boundary2-4.34.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -549755813889 ORDER BY x - } -} {55 2 64 21 44 58} -do_test boundary2-4.35.1 { - db eval { - SELECT * FROM t1 WHERE r=-32768 - } -} {-32768 32 ffffffffffff8000} -do_test boundary2-4.35.2 { - db eval { - SELECT r, a FROM t1 WHERE x='ffffffffffff8000' - } -} {-32768 32} -do_test boundary2-4.35.3 { - db eval { - SELECT r, x FROM t1 WHERE a=32 - } -} {-32768 ffffffffffff8000} -do_test boundary2-4.35.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -32768 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary2-4.35.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -32768 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-4.35.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -32768 ORDER BY r - } -} {54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.35.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -32768 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54} -do_test boundary2-4.35.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -32768 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 54 53 52 33 38} -do_test boundary2-4.35.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -32768 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 32 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary2-4.35.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -32768 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 32 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-4.35.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -32768 ORDER BY r - } -} {32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.35.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -32768 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32} -do_test boundary2-4.35.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -32768 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 32 54 53 52 33 38} -do_test boundary2-4.35.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -32768 ORDER BY a - } -} {1 2 11 21 29 37 44 47 55 58 63 64} -do_test boundary2-4.35.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -32768 ORDER BY a DESC - } -} {64 63 58 55 47 44 37 29 21 11 2 1} -do_test boundary2-4.35.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -32768 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29} -do_test boundary2-4.35.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -32768 ORDER BY r DESC - } -} {29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.35.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -32768 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29} -do_test boundary2-4.35.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -32768 ORDER BY a - } -} {1 2 11 21 29 32 37 44 47 55 58 63 64} -do_test boundary2-4.35.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -32768 ORDER BY a DESC - } -} {64 63 58 55 47 44 37 32 29 21 11 2 1} -do_test boundary2-4.35.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -32768 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32} -do_test boundary2-4.35.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -32768 ORDER BY r DESC - } -} {32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.35.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -32768 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32} -do_test boundary2-4.36.1 { - db eval { - SELECT * FROM t1 WHERE r=2147483647 - } -} {2147483647 20 000000007fffffff} -do_test boundary2-4.36.2 { - db eval { - SELECT r, a FROM t1 WHERE x='000000007fffffff' - } -} {2147483647 20} -do_test boundary2-4.36.3 { - db eval { - SELECT r, x FROM t1 WHERE a=20 - } -} {2147483647 000000007fffffff} -do_test boundary2-4.36.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 2147483647 ORDER BY a - } -} {3 7 10 13 14 17 19 22 25 26 27 28 34 35 36 39 43 45 46 51 56 57} -do_test boundary2-4.36.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 2147483647 ORDER BY a DESC - } -} {57 56 51 46 45 43 39 36 35 34 28 27 26 25 22 19 17 14 13 10 7 3} -do_test boundary2-4.36.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 2147483647 ORDER BY r - } -} {51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.36.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 2147483647 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51} -do_test boundary2-4.36.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 2147483647 ORDER BY x - } -} {51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.36.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 2147483647 ORDER BY a - } -} {3 7 10 13 14 17 19 20 22 25 26 27 28 34 35 36 39 43 45 46 51 56 57} -do_test boundary2-4.36.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 2147483647 ORDER BY a DESC - } -} {57 56 51 46 45 43 39 36 35 34 28 27 26 25 22 20 19 17 14 13 10 7 3} -do_test boundary2-4.36.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 2147483647 ORDER BY r - } -} {20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.36.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 2147483647 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20} -do_test boundary2-4.36.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 2147483647 ORDER BY x - } -} {20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.36.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 2147483647 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.36.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 2147483647 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary2-4.36.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 2147483647 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40} -do_test boundary2-4.36.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 2147483647 ORDER BY r DESC - } -} {40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.36.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 2147483647 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.36.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 2147483647 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 20 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.36.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 2147483647 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 20 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary2-4.36.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 2147483647 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20} -do_test boundary2-4.36.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 2147483647 ORDER BY r DESC - } -} {20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.36.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 2147483647 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.37.1 { - db eval { - SELECT * FROM t1 WHERE r=-129 - } -} {-129 54 ffffffffffffff7f} -do_test boundary2-4.37.2 { - db eval { - SELECT r, a FROM t1 WHERE x='ffffffffffffff7f' - } -} {-129 54} -do_test boundary2-4.37.3 { - db eval { - SELECT r, x FROM t1 WHERE a=54 - } -} {-129 ffffffffffffff7f} -do_test boundary2-4.37.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -129 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 56 57 59 60 61 62} -do_test boundary2-4.37.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -129 ORDER BY a DESC - } -} {62 61 60 59 57 56 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-4.37.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -129 ORDER BY r - } -} {53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.37.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -129 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53} -do_test boundary2-4.37.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -129 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 53 52 33 38} -do_test boundary2-4.37.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -129 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary2-4.37.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -129 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-4.37.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -129 ORDER BY r - } -} {54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.37.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -129 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54} -do_test boundary2-4.37.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -129 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 54 53 52 33 38} -do_test boundary2-4.37.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -129 ORDER BY a - } -} {1 2 11 21 29 32 37 44 47 55 58 63 64} -do_test boundary2-4.37.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -129 ORDER BY a DESC - } -} {64 63 58 55 47 44 37 32 29 21 11 2 1} -do_test boundary2-4.37.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -129 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32} -do_test boundary2-4.37.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -129 ORDER BY r DESC - } -} {32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.37.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -129 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32} -do_test boundary2-4.37.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -129 ORDER BY a - } -} {1 2 11 21 29 32 37 44 47 54 55 58 63 64} -do_test boundary2-4.37.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -129 ORDER BY a DESC - } -} {64 63 58 55 54 47 44 37 32 29 21 11 2 1} -do_test boundary2-4.37.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -129 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54} -do_test boundary2-4.37.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -129 ORDER BY r DESC - } -} {54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.37.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -129 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54} -do_test boundary2-4.38.1 { - db eval { - SELECT * FROM t1 WHERE r=-128 - } -} {-128 53 ffffffffffffff80} -do_test boundary2-4.38.2 { - db eval { - SELECT r, a FROM t1 WHERE x='ffffffffffffff80' - } -} {-128 53} -do_test boundary2-4.38.3 { - db eval { - SELECT r, x FROM t1 WHERE a=53 - } -} {-128 ffffffffffffff80} -do_test boundary2-4.38.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -128 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 56 57 59 60 61 62} -do_test boundary2-4.38.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -128 ORDER BY a DESC - } -} {62 61 60 59 57 56 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-4.38.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -128 ORDER BY r - } -} {52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.38.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -128 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52} -do_test boundary2-4.38.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -128 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 52 33 38} -do_test boundary2-4.38.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -128 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 56 57 59 60 61 62} -do_test boundary2-4.38.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -128 ORDER BY a DESC - } -} {62 61 60 59 57 56 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-4.38.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -128 ORDER BY r - } -} {53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.38.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -128 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53} -do_test boundary2-4.38.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -128 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 53 52 33 38} -do_test boundary2-4.38.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -128 ORDER BY a - } -} {1 2 11 21 29 32 37 44 47 54 55 58 63 64} -do_test boundary2-4.38.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -128 ORDER BY a DESC - } -} {64 63 58 55 54 47 44 37 32 29 21 11 2 1} -do_test boundary2-4.38.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -128 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54} -do_test boundary2-4.38.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -128 ORDER BY r DESC - } -} {54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.38.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -128 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54} -do_test boundary2-4.38.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -128 ORDER BY a - } -} {1 2 11 21 29 32 37 44 47 53 54 55 58 63 64} -do_test boundary2-4.38.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -128 ORDER BY a DESC - } -} {64 63 58 55 54 53 47 44 37 32 29 21 11 2 1} -do_test boundary2-4.38.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -128 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53} -do_test boundary2-4.38.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -128 ORDER BY r DESC - } -} {53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.38.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -128 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53} -do_test boundary2-4.39.1 { - db eval { - SELECT * FROM t1 WHERE r=72057594037927936 - } -} {72057594037927936 28 0100000000000000} -do_test boundary2-4.39.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0100000000000000' - } -} {72057594037927936 28} -do_test boundary2-4.39.3 { - db eval { - SELECT r, x FROM t1 WHERE a=28 - } -} {72057594037927936 0100000000000000} -do_test boundary2-4.39.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 72057594037927936 ORDER BY a - } -} {3} -do_test boundary2-4.39.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 72057594037927936 ORDER BY a DESC - } -} {3} -do_test boundary2-4.39.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 72057594037927936 ORDER BY r - } -} {3} -do_test boundary2-4.39.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 72057594037927936 ORDER BY r DESC - } -} {3} -do_test boundary2-4.39.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 72057594037927936 ORDER BY x - } -} {3} -do_test boundary2-4.39.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 72057594037927936 ORDER BY a - } -} {3 28} -do_test boundary2-4.39.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 72057594037927936 ORDER BY a DESC - } -} {28 3} -do_test boundary2-4.39.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 72057594037927936 ORDER BY r - } -} {28 3} -do_test boundary2-4.39.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 72057594037927936 ORDER BY r DESC - } -} {3 28} -do_test boundary2-4.39.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 72057594037927936 ORDER BY x - } -} {28 3} -do_test boundary2-4.39.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 72057594037927936 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.39.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 72057594037927936 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-4.39.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 72057594037927936 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17} -do_test boundary2-4.39.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 72057594037927936 ORDER BY r DESC - } -} {17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.39.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 72057594037927936 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.39.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 72057594037927936 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.39.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 72057594037927936 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-4.39.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 72057594037927936 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28} -do_test boundary2-4.39.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 72057594037927936 ORDER BY r DESC - } -} {28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.39.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 72057594037927936 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.40.1 { - db eval { - SELECT * FROM t1 WHERE r=2147483648 - } -} {2147483648 51 0000000080000000} -do_test boundary2-4.40.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000080000000' - } -} {2147483648 51} -do_test boundary2-4.40.3 { - db eval { - SELECT r, x FROM t1 WHERE a=51 - } -} {2147483648 0000000080000000} -do_test boundary2-4.40.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 2147483648 ORDER BY a - } -} {3 7 10 13 14 17 19 22 25 26 27 28 34 35 36 39 43 45 46 56 57} -do_test boundary2-4.40.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 2147483648 ORDER BY a DESC - } -} {57 56 46 45 43 39 36 35 34 28 27 26 25 22 19 17 14 13 10 7 3} -do_test boundary2-4.40.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 2147483648 ORDER BY r - } -} {14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.40.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 2147483648 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14} -do_test boundary2-4.40.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 2147483648 ORDER BY x - } -} {14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.40.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 2147483648 ORDER BY a - } -} {3 7 10 13 14 17 19 22 25 26 27 28 34 35 36 39 43 45 46 51 56 57} -do_test boundary2-4.40.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 2147483648 ORDER BY a DESC - } -} {57 56 51 46 45 43 39 36 35 34 28 27 26 25 22 19 17 14 13 10 7 3} -do_test boundary2-4.40.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 2147483648 ORDER BY r - } -} {51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.40.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 2147483648 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51} -do_test boundary2-4.40.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 2147483648 ORDER BY x - } -} {51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.40.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 2147483648 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 20 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.40.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 2147483648 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 20 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary2-4.40.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 2147483648 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20} -do_test boundary2-4.40.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 2147483648 ORDER BY r DESC - } -} {20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.40.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 2147483648 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.40.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 2147483648 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 20 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.40.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 2147483648 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 20 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary2-4.40.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 2147483648 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51} -do_test boundary2-4.40.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 2147483648 ORDER BY r DESC - } -} {51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.40.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 2147483648 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.41.1 { - db eval { - SELECT * FROM t1 WHERE r=549755813887 - } -} {549755813887 46 0000007fffffffff} -do_test boundary2-4.41.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000007fffffffff' - } -} {549755813887 46} -do_test boundary2-4.41.3 { - db eval { - SELECT r, x FROM t1 WHERE a=46 - } -} {549755813887 0000007fffffffff} -do_test boundary2-4.41.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 549755813887 ORDER BY a - } -} {3 7 10 13 17 19 25 26 27 28 34 35 43 45 56 57} -do_test boundary2-4.41.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 549755813887 ORDER BY a DESC - } -} {57 56 45 43 35 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary2-4.41.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 549755813887 ORDER BY r - } -} {35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.41.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 549755813887 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35} -do_test boundary2-4.41.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 549755813887 ORDER BY x - } -} {35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.41.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 549755813887 ORDER BY a - } -} {3 7 10 13 17 19 25 26 27 28 34 35 43 45 46 56 57} -do_test boundary2-4.41.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 549755813887 ORDER BY a DESC - } -} {57 56 46 45 43 35 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary2-4.41.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 549755813887 ORDER BY r - } -} {46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.41.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 549755813887 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46} -do_test boundary2-4.41.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 549755813887 ORDER BY x - } -} {46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.41.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 549755813887 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 36 37 38 39 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.41.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 549755813887 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 39 38 37 36 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-4.41.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 549755813887 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22} -do_test boundary2-4.41.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 549755813887 ORDER BY r DESC - } -} {22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.41.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 549755813887 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.41.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 549755813887 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.41.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 549755813887 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-4.41.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 549755813887 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46} -do_test boundary2-4.41.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 549755813887 ORDER BY r DESC - } -} {46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.41.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 549755813887 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.42.1 { - db eval { - SELECT * FROM t1 WHERE r=-549755813888 - } -} {-549755813888 63 ffffff8000000000} -do_test boundary2-4.42.2 { - db eval { - SELECT r, a FROM t1 WHERE x='ffffff8000000000' - } -} {-549755813888 63} -do_test boundary2-4.42.3 { - db eval { - SELECT r, x FROM t1 WHERE a=63 - } -} {-549755813888 ffffff8000000000} -do_test boundary2-4.42.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -549755813888 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 47 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary2-4.42.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -549755813888 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 47 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary2-4.42.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -549755813888 ORDER BY r - } -} {47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.42.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -549755813888 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47} -do_test boundary2-4.42.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -549755813888 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.42.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -549755813888 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 47 48 49 50 51 52 53 54 56 57 59 60 61 62 63} -do_test boundary2-4.42.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -549755813888 ORDER BY a DESC - } -} {63 62 61 60 59 57 56 54 53 52 51 50 49 48 47 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary2-4.42.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -549755813888 ORDER BY r - } -} {63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.42.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -549755813888 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63} -do_test boundary2-4.42.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -549755813888 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.42.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -549755813888 ORDER BY a - } -} {2 21 44 55 58 64} -do_test boundary2-4.42.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -549755813888 ORDER BY a DESC - } -} {64 58 55 44 21 2} -do_test boundary2-4.42.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -549755813888 ORDER BY r - } -} {55 2 64 21 44 58} -do_test boundary2-4.42.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -549755813888 ORDER BY r DESC - } -} {58 44 21 64 2 55} -do_test boundary2-4.42.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -549755813888 ORDER BY x - } -} {55 2 64 21 44 58} -do_test boundary2-4.42.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -549755813888 ORDER BY a - } -} {2 21 44 55 58 63 64} -do_test boundary2-4.42.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -549755813888 ORDER BY a DESC - } -} {64 63 58 55 44 21 2} -do_test boundary2-4.42.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -549755813888 ORDER BY r - } -} {55 2 64 21 44 58 63} -do_test boundary2-4.42.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -549755813888 ORDER BY r DESC - } -} {63 58 44 21 64 2 55} -do_test boundary2-4.42.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -549755813888 ORDER BY x - } -} {55 2 64 21 44 58 63} -do_test boundary2-4.43.1 { - db eval { - SELECT * FROM t1 WHERE r=281474976710655 - } -} {281474976710655 10 0000ffffffffffff} -do_test boundary2-4.43.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000ffffffffffff' - } -} {281474976710655 10} -do_test boundary2-4.43.3 { - db eval { - SELECT r, x FROM t1 WHERE a=10 - } -} {281474976710655 0000ffffffffffff} -do_test boundary2-4.43.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 281474976710655 ORDER BY a - } -} {3 13 17 26 27 28 43 45} -do_test boundary2-4.43.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 281474976710655 ORDER BY a DESC - } -} {45 43 28 27 26 17 13 3} -do_test boundary2-4.43.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 281474976710655 ORDER BY r - } -} {26 13 43 27 45 17 28 3} -do_test boundary2-4.43.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 281474976710655 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26} -do_test boundary2-4.43.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 281474976710655 ORDER BY x - } -} {26 13 43 27 45 17 28 3} -do_test boundary2-4.43.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 281474976710655 ORDER BY a - } -} {3 10 13 17 26 27 28 43 45} -do_test boundary2-4.43.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 281474976710655 ORDER BY a DESC - } -} {45 43 28 27 26 17 13 10 3} -do_test boundary2-4.43.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 281474976710655 ORDER BY r - } -} {10 26 13 43 27 45 17 28 3} -do_test boundary2-4.43.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 281474976710655 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10} -do_test boundary2-4.43.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 281474976710655 ORDER BY x - } -} {10 26 13 43 27 45 17 28 3} -do_test boundary2-4.43.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 281474976710655 ORDER BY a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 25 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.43.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 281474976710655 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 25 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary2-4.43.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 281474976710655 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34} -do_test boundary2-4.43.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 281474976710655 ORDER BY r DESC - } -} {34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.43.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 281474976710655 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.43.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 281474976710655 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 14 15 16 18 19 20 21 22 23 24 25 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.43.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 281474976710655 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 25 24 23 22 21 20 19 18 16 15 14 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-4.43.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 281474976710655 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10} -do_test boundary2-4.43.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 281474976710655 ORDER BY r DESC - } -} {10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.43.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 281474976710655 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.44.1 { - db eval { - SELECT * FROM t1 WHERE r=4398046511103 - } -} {4398046511103 7 000003ffffffffff} -do_test boundary2-4.44.2 { - db eval { - SELECT r, a FROM t1 WHERE x='000003ffffffffff' - } -} {4398046511103 7} -do_test boundary2-4.44.3 { - db eval { - SELECT r, x FROM t1 WHERE a=7 - } -} {4398046511103 000003ffffffffff} -do_test boundary2-4.44.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 4398046511103 ORDER BY a - } -} {3 10 13 17 25 26 27 28 34 43 45 56} -do_test boundary2-4.44.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 4398046511103 ORDER BY a DESC - } -} {56 45 43 34 28 27 26 25 17 13 10 3} -do_test boundary2-4.44.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 4398046511103 ORDER BY r - } -} {56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.44.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 4398046511103 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56} -do_test boundary2-4.44.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 4398046511103 ORDER BY x - } -} {56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.44.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 4398046511103 ORDER BY a - } -} {3 7 10 13 17 25 26 27 28 34 43 45 56} -do_test boundary2-4.44.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 4398046511103 ORDER BY a DESC - } -} {56 45 43 34 28 27 26 25 17 13 10 7 3} -do_test boundary2-4.44.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 4398046511103 ORDER BY r - } -} {7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.44.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 4398046511103 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7} -do_test boundary2-4.44.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 4398046511103 ORDER BY x - } -} {7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.44.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 4398046511103 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 19 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 57 58 59 60 61 62 63 64} -do_test boundary2-4.44.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 4398046511103 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 19 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary2-4.44.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 4398046511103 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19} -do_test boundary2-4.44.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 4398046511103 ORDER BY r DESC - } -} {19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.44.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 4398046511103 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.44.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 4398046511103 ORDER BY a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 57 58 59 60 61 62 63 64} -do_test boundary2-4.44.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 4398046511103 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary2-4.44.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 4398046511103 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7} -do_test boundary2-4.44.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 4398046511103 ORDER BY r DESC - } -} {7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.44.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 4398046511103 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.45.1 { - db eval { - SELECT * FROM t1 WHERE r=268435455 - } -} {268435455 12 000000000fffffff} -do_test boundary2-4.45.2 { - db eval { - SELECT r, a FROM t1 WHERE x='000000000fffffff' - } -} {268435455 12} -do_test boundary2-4.45.3 { - db eval { - SELECT r, x FROM t1 WHERE a=12 - } -} {268435455 000000000fffffff} -do_test boundary2-4.45.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 268435455 ORDER BY a - } -} {3 7 10 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary2-4.45.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 268435455 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 10 7 3} -do_test boundary2-4.45.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 268435455 ORDER BY r - } -} {40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.45.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 268435455 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40} -do_test boundary2-4.45.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 268435455 ORDER BY x - } -} {40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.45.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 268435455 ORDER BY a - } -} {3 7 10 12 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary2-4.45.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 268435455 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 12 10 7 3} -do_test boundary2-4.45.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 268435455 ORDER BY r - } -} {12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.45.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 268435455 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12} -do_test boundary2-4.45.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 268435455 ORDER BY x - } -} {12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.45.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 268435455 ORDER BY a - } -} {1 2 4 5 6 8 9 11 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.45.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 268435455 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 11 9 8 6 5 4 2 1} -do_test boundary2-4.45.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 268435455 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6} -do_test boundary2-4.45.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 268435455 ORDER BY r DESC - } -} {6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.45.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 268435455 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.45.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 268435455 ORDER BY a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.45.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 268435455 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary2-4.45.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 268435455 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12} -do_test boundary2-4.45.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 268435455 ORDER BY r DESC - } -} {12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.45.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 268435455 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.46.1 { - db eval { - SELECT * FROM t1 WHERE r=-9223372036854775808 - } -} {-9223372036854775808 55 8000000000000000} -do_test boundary2-4.46.2 { - db eval { - SELECT r, a FROM t1 WHERE x='8000000000000000' - } -} {-9223372036854775808 55} -do_test boundary2-4.46.3 { - db eval { - SELECT r, x FROM t1 WHERE a=55 - } -} {-9223372036854775808 8000000000000000} -do_test boundary2-4.46.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -9223372036854775808 ORDER BY a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.46.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -9223372036854775808 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary2-4.46.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -9223372036854775808 ORDER BY r - } -} {2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.46.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -9223372036854775808 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2} -do_test boundary2-4.46.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -9223372036854775808 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.46.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -9223372036854775808 ORDER BY a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.46.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -9223372036854775808 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary2-4.46.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -9223372036854775808 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.46.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -9223372036854775808 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.46.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -9223372036854775808 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.46.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -9223372036854775808 ORDER BY a - } -} {} -do_test boundary2-4.46.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -9223372036854775808 ORDER BY a DESC - } -} {} -do_test boundary2-4.46.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -9223372036854775808 ORDER BY r - } -} {} -do_test boundary2-4.46.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -9223372036854775808 ORDER BY r DESC - } -} {} -do_test boundary2-4.46.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -9223372036854775808 ORDER BY x - } -} {} -do_test boundary2-4.46.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -9223372036854775808 ORDER BY a - } -} {55} -do_test boundary2-4.46.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -9223372036854775808 ORDER BY a DESC - } -} {55} -do_test boundary2-4.46.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -9223372036854775808 ORDER BY r - } -} {55} -do_test boundary2-4.46.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -9223372036854775808 ORDER BY r DESC - } -} {55} -do_test boundary2-4.46.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -9223372036854775808 ORDER BY x - } -} {55} -do_test boundary2-4.47.1 { - db eval { - SELECT * FROM t1 WHERE r=562949953421312 - } -} {562949953421312 43 0002000000000000} -do_test boundary2-4.47.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0002000000000000' - } -} {562949953421312 43} -do_test boundary2-4.47.3 { - db eval { - SELECT r, x FROM t1 WHERE a=43 - } -} {562949953421312 0002000000000000} -do_test boundary2-4.47.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 562949953421312 ORDER BY a - } -} {3 17 27 28 45} -do_test boundary2-4.47.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 562949953421312 ORDER BY a DESC - } -} {45 28 27 17 3} -do_test boundary2-4.47.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 562949953421312 ORDER BY r - } -} {27 45 17 28 3} -do_test boundary2-4.47.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 562949953421312 ORDER BY r DESC - } -} {3 28 17 45 27} -do_test boundary2-4.47.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 562949953421312 ORDER BY x - } -} {27 45 17 28 3} -do_test boundary2-4.47.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 562949953421312 ORDER BY a - } -} {3 17 27 28 43 45} -do_test boundary2-4.47.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 562949953421312 ORDER BY a DESC - } -} {45 43 28 27 17 3} -do_test boundary2-4.47.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 562949953421312 ORDER BY r - } -} {43 27 45 17 28 3} -do_test boundary2-4.47.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 562949953421312 ORDER BY r DESC - } -} {3 28 17 45 27 43} -do_test boundary2-4.47.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 562949953421312 ORDER BY x - } -} {43 27 45 17 28 3} -do_test boundary2-4.47.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 562949953421312 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.47.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 562949953421312 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-4.47.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 562949953421312 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13} -do_test boundary2-4.47.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 562949953421312 ORDER BY r DESC - } -} {13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.47.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 562949953421312 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.47.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 562949953421312 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.47.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 562949953421312 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-4.47.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 562949953421312 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43} -do_test boundary2-4.47.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 562949953421312 ORDER BY r DESC - } -} {43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.47.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 562949953421312 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.48.1 { - db eval { - SELECT * FROM t1 WHERE r=-8388609 - } -} {-8388609 1 ffffffffff7fffff} -do_test boundary2-4.48.2 { - db eval { - SELECT r, a FROM t1 WHERE x='ffffffffff7fffff' - } -} {-8388609 1} -do_test boundary2-4.48.3 { - db eval { - SELECT r, x FROM t1 WHERE a=1 - } -} {-8388609 ffffffffff7fffff} -do_test boundary2-4.48.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -8388609 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary2-4.48.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -8388609 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-4.48.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -8388609 ORDER BY r - } -} {37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.48.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -8388609 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37} -do_test boundary2-4.48.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -8388609 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 37 29 32 54 53 52 33 38} -do_test boundary2-4.48.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -8388609 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary2-4.48.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -8388609 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3 1} -do_test boundary2-4.48.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -8388609 ORDER BY r - } -} {1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.48.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -8388609 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1} -do_test boundary2-4.48.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -8388609 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.48.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -8388609 ORDER BY a - } -} {2 11 21 44 47 55 58 63 64} -do_test boundary2-4.48.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -8388609 ORDER BY a DESC - } -} {64 63 58 55 47 44 21 11 2} -do_test boundary2-4.48.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -8388609 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11} -do_test boundary2-4.48.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -8388609 ORDER BY r DESC - } -} {11 47 63 58 44 21 64 2 55} -do_test boundary2-4.48.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -8388609 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11} -do_test boundary2-4.48.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -8388609 ORDER BY a - } -} {1 2 11 21 44 47 55 58 63 64} -do_test boundary2-4.48.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -8388609 ORDER BY a DESC - } -} {64 63 58 55 47 44 21 11 2 1} -do_test boundary2-4.48.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -8388609 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1} -do_test boundary2-4.48.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -8388609 ORDER BY r DESC - } -} {1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.48.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -8388609 ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1} -do_test boundary2-4.49.1 { - db eval { - SELECT * FROM t1 WHERE r=16777215 - } -} {16777215 9 0000000000ffffff} -do_test boundary2-4.49.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000000ffffff' - } -} {16777215 9} -do_test boundary2-4.49.3 { - db eval { - SELECT r, x FROM t1 WHERE a=9 - } -} {16777215 0000000000ffffff} -do_test boundary2-4.49.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 16777215 ORDER BY a - } -} {3 6 7 10 12 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary2-4.49.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 16777215 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 12 10 7 6 3} -do_test boundary2-4.49.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 16777215 ORDER BY r - } -} {6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.49.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 16777215 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6} -do_test boundary2-4.49.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 16777215 ORDER BY x - } -} {6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.49.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 16777215 ORDER BY a - } -} {3 6 7 9 10 12 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary2-4.49.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 16777215 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 12 10 9 7 6 3} -do_test boundary2-4.49.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 16777215 ORDER BY r - } -} {9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.49.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 16777215 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9} -do_test boundary2-4.49.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 16777215 ORDER BY x - } -} {9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.49.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 16777215 ORDER BY a - } -} {1 2 4 5 8 11 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.49.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 16777215 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 11 8 5 4 2 1} -do_test boundary2-4.49.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 16777215 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24} -do_test boundary2-4.49.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 16777215 ORDER BY r DESC - } -} {24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.49.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 16777215 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.49.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 16777215 ORDER BY a - } -} {1 2 4 5 8 9 11 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.49.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 16777215 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 11 9 8 5 4 2 1} -do_test boundary2-4.49.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 16777215 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9} -do_test boundary2-4.49.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 16777215 ORDER BY r DESC - } -} {9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.49.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 16777215 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.50.1 { - db eval { - SELECT * FROM t1 WHERE r=8388608 - } -} {8388608 24 0000000000800000} -do_test boundary2-4.50.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000000800000' - } -} {8388608 24} -do_test boundary2-4.50.3 { - db eval { - SELECT r, x FROM t1 WHERE a=24 - } -} {8388608 0000000000800000} -do_test boundary2-4.50.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 8388608 ORDER BY a - } -} {3 6 7 9 10 12 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary2-4.50.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 8388608 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 12 10 9 7 6 3} -do_test boundary2-4.50.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 8388608 ORDER BY r - } -} {9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.50.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 8388608 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9} -do_test boundary2-4.50.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 8388608 ORDER BY x - } -} {9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.50.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 8388608 ORDER BY a - } -} {3 6 7 9 10 12 13 14 17 19 20 22 24 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary2-4.50.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 8388608 ORDER BY a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 24 22 20 19 17 14 13 12 10 9 7 6 3} -do_test boundary2-4.50.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 8388608 ORDER BY r - } -} {24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.50.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 8388608 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24} -do_test boundary2-4.50.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 8388608 ORDER BY x - } -} {24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.50.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 8388608 ORDER BY a - } -} {1 2 4 5 8 11 15 16 18 21 23 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.50.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 8388608 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 23 21 18 16 15 11 8 5 4 2 1} -do_test boundary2-4.50.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 8388608 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18} -do_test boundary2-4.50.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 8388608 ORDER BY r DESC - } -} {18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.50.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 8388608 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.50.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 8388608 ORDER BY a - } -} {1 2 4 5 8 11 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.50.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 8388608 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 11 8 5 4 2 1} -do_test boundary2-4.50.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 8388608 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24} -do_test boundary2-4.50.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 8388608 ORDER BY r DESC - } -} {24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.50.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 8388608 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.51.1 { - db eval { - SELECT * FROM t1 WHERE r=16383 - } -} {16383 8 0000000000003fff} -do_test boundary2-4.51.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000000003fff' - } -} {16383 8} -do_test boundary2-4.51.3 { - db eval { - SELECT r, x FROM t1 WHERE a=8 - } -} {16383 0000000000003fff} -do_test boundary2-4.51.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 16383 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary2-4.51.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 16383 ORDER BY a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 7 6 3} -do_test boundary2-4.51.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 16383 ORDER BY r - } -} {16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.51.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 16383 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16} -do_test boundary2-4.51.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 16383 ORDER BY x - } -} {16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.51.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 16383 ORDER BY a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary2-4.51.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 16383 ORDER BY a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary2-4.51.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 16383 ORDER BY r - } -} {8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.51.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 16383 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8} -do_test boundary2-4.51.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 16383 ORDER BY x - } -} {8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.51.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 16383 ORDER BY a - } -} {1 2 4 5 11 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary2-4.51.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 16383 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 11 5 4 2 1} -do_test boundary2-4.51.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 16383 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61} -do_test boundary2-4.51.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 16383 ORDER BY r DESC - } -} {61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.51.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 16383 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.51.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 16383 ORDER BY a - } -} {1 2 4 5 8 11 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary2-4.51.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 16383 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 11 8 5 4 2 1} -do_test boundary2-4.51.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 16383 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8} -do_test boundary2-4.51.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 16383 ORDER BY r DESC - } -} {8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.51.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 16383 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.52.1 { - db eval { - SELECT * FROM t1 WHERE r=140737488355328 - } -} {140737488355328 34 0000800000000000} -do_test boundary2-4.52.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000800000000000' - } -} {140737488355328 34} -do_test boundary2-4.52.3 { - db eval { - SELECT r, x FROM t1 WHERE a=34 - } -} {140737488355328 0000800000000000} -do_test boundary2-4.52.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 140737488355328 ORDER BY a - } -} {3 10 13 17 26 27 28 43 45} -do_test boundary2-4.52.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 140737488355328 ORDER BY a DESC - } -} {45 43 28 27 26 17 13 10 3} -do_test boundary2-4.52.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 140737488355328 ORDER BY r - } -} {10 26 13 43 27 45 17 28 3} -do_test boundary2-4.52.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 140737488355328 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10} -do_test boundary2-4.52.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 140737488355328 ORDER BY x - } -} {10 26 13 43 27 45 17 28 3} -do_test boundary2-4.52.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 140737488355328 ORDER BY a - } -} {3 10 13 17 26 27 28 34 43 45} -do_test boundary2-4.52.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 140737488355328 ORDER BY a DESC - } -} {45 43 34 28 27 26 17 13 10 3} -do_test boundary2-4.52.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 140737488355328 ORDER BY r - } -} {34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.52.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 140737488355328 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34} -do_test boundary2-4.52.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 140737488355328 ORDER BY x - } -} {34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.52.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 140737488355328 ORDER BY a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 25 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.52.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 140737488355328 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 25 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary2-4.52.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 140737488355328 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25} -do_test boundary2-4.52.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 140737488355328 ORDER BY r DESC - } -} {25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.52.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 140737488355328 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.52.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 140737488355328 ORDER BY a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 25 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.52.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 140737488355328 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 25 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary2-4.52.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 140737488355328 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34} -do_test boundary2-4.52.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 140737488355328 ORDER BY r DESC - } -} {34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.52.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 140737488355328 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.53.1 { - db eval { - SELECT * FROM t1 WHERE r=2097151 - } -} {2097151 15 00000000001fffff} -do_test boundary2-4.53.2 { - db eval { - SELECT r, a FROM t1 WHERE x='00000000001fffff' - } -} {2097151 15} -do_test boundary2-4.53.3 { - db eval { - SELECT r, x FROM t1 WHERE a=15 - } -} {2097151 00000000001fffff} -do_test boundary2-4.53.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 2097151 ORDER BY a - } -} {3 6 7 9 10 12 13 14 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 51 56 57} -do_test boundary2-4.53.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 2097151 ORDER BY a DESC - } -} {57 56 51 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 14 13 12 10 9 7 6 3} -do_test boundary2-4.53.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 2097151 ORDER BY r - } -} {42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.53.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 2097151 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42} -do_test boundary2-4.53.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 2097151 ORDER BY x - } -} {42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.53.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 2097151 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 51 56 57} -do_test boundary2-4.53.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 2097151 ORDER BY a DESC - } -} {57 56 51 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary2-4.53.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 2097151 ORDER BY r - } -} {15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.53.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 2097151 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15} -do_test boundary2-4.53.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 2097151 ORDER BY x - } -} {15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.53.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 2097151 ORDER BY a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.53.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 2097151 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary2-4.53.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 2097151 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62} -do_test boundary2-4.53.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 2097151 ORDER BY r DESC - } -} {62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.53.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 2097151 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.53.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 2097151 ORDER BY a - } -} {1 2 4 5 8 11 15 16 21 23 29 30 31 32 33 37 38 41 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary2-4.53.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 2097151 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 41 38 37 33 32 31 30 29 23 21 16 15 11 8 5 4 2 1} -do_test boundary2-4.53.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 2097151 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15} -do_test boundary2-4.53.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 2097151 ORDER BY r DESC - } -} {15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.53.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 2097151 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.54.1 { - db eval { - SELECT * FROM t1 WHERE r=140737488355327 - } -} {140737488355327 25 00007fffffffffff} -do_test boundary2-4.54.2 { - db eval { - SELECT r, a FROM t1 WHERE x='00007fffffffffff' - } -} {140737488355327 25} -do_test boundary2-4.54.3 { - db eval { - SELECT r, x FROM t1 WHERE a=25 - } -} {140737488355327 00007fffffffffff} -do_test boundary2-4.54.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 140737488355327 ORDER BY a - } -} {3 10 13 17 26 27 28 34 43 45} -do_test boundary2-4.54.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 140737488355327 ORDER BY a DESC - } -} {45 43 34 28 27 26 17 13 10 3} -do_test boundary2-4.54.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 140737488355327 ORDER BY r - } -} {34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.54.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 140737488355327 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34} -do_test boundary2-4.54.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 140737488355327 ORDER BY x - } -} {34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.54.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 140737488355327 ORDER BY a - } -} {3 10 13 17 25 26 27 28 34 43 45} -do_test boundary2-4.54.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 140737488355327 ORDER BY a DESC - } -} {45 43 34 28 27 26 25 17 13 10 3} -do_test boundary2-4.54.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 140737488355327 ORDER BY r - } -} {25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.54.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 140737488355327 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25} -do_test boundary2-4.54.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 140737488355327 ORDER BY x - } -} {25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.54.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 140737488355327 ORDER BY a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.54.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 140737488355327 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary2-4.54.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 140737488355327 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56} -do_test boundary2-4.54.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 140737488355327 ORDER BY r DESC - } -} {56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.54.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 140737488355327 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.54.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 140737488355327 ORDER BY a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 25 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.54.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 140737488355327 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 25 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary2-4.54.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 140737488355327 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25} -do_test boundary2-4.54.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 140737488355327 ORDER BY r DESC - } -} {25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.54.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 140737488355327 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.55.1 { - db eval { - SELECT * FROM t1 WHERE r=281474976710656 - } -} {281474976710656 26 0001000000000000} -do_test boundary2-4.55.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0001000000000000' - } -} {281474976710656 26} -do_test boundary2-4.55.3 { - db eval { - SELECT r, x FROM t1 WHERE a=26 - } -} {281474976710656 0001000000000000} -do_test boundary2-4.55.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 281474976710656 ORDER BY a - } -} {3 13 17 27 28 43 45} -do_test boundary2-4.55.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 281474976710656 ORDER BY a DESC - } -} {45 43 28 27 17 13 3} -do_test boundary2-4.55.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 281474976710656 ORDER BY r - } -} {13 43 27 45 17 28 3} -do_test boundary2-4.55.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 281474976710656 ORDER BY r DESC - } -} {3 28 17 45 27 43 13} -do_test boundary2-4.55.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 281474976710656 ORDER BY x - } -} {13 43 27 45 17 28 3} -do_test boundary2-4.55.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 281474976710656 ORDER BY a - } -} {3 13 17 26 27 28 43 45} -do_test boundary2-4.55.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 281474976710656 ORDER BY a DESC - } -} {45 43 28 27 26 17 13 3} -do_test boundary2-4.55.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 281474976710656 ORDER BY r - } -} {26 13 43 27 45 17 28 3} -do_test boundary2-4.55.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 281474976710656 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26} -do_test boundary2-4.55.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 281474976710656 ORDER BY x - } -} {26 13 43 27 45 17 28 3} -do_test boundary2-4.55.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 281474976710656 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 14 15 16 18 19 20 21 22 23 24 25 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.55.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 281474976710656 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 25 24 23 22 21 20 19 18 16 15 14 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-4.55.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 281474976710656 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10} -do_test boundary2-4.55.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 281474976710656 ORDER BY r DESC - } -} {10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.55.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 281474976710656 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.55.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 281474976710656 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 14 15 16 18 19 20 21 22 23 24 25 26 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.55.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 281474976710656 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 26 25 24 23 22 21 20 19 18 16 15 14 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-4.55.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 281474976710656 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26} -do_test boundary2-4.55.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 281474976710656 ORDER BY r DESC - } -} {26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.55.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 281474976710656 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.56.1 { - db eval { - SELECT * FROM t1 WHERE r=32767 - } -} {32767 23 0000000000007fff} -do_test boundary2-4.56.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000000007fff' - } -} {32767 23} -do_test boundary2-4.56.3 { - db eval { - SELECT r, x FROM t1 WHERE a=23 - } -} {32767 0000000000007fff} -do_test boundary2-4.56.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 32767 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary2-4.56.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 32767 ORDER BY a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary2-4.56.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 32767 ORDER BY r - } -} {50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.56.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 32767 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50} -do_test boundary2-4.56.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 32767 ORDER BY x - } -} {50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.56.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 32767 ORDER BY a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary2-4.56.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 32767 ORDER BY a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary2-4.56.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 32767 ORDER BY r - } -} {23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.56.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 32767 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23} -do_test boundary2-4.56.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 32767 ORDER BY x - } -} {23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.56.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 32767 ORDER BY a - } -} {1 2 4 5 8 11 16 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary2-4.56.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 32767 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 16 11 8 5 4 2 1} -do_test boundary2-4.56.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 32767 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16} -do_test boundary2-4.56.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 32767 ORDER BY r DESC - } -} {16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.56.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 32767 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.56.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 32767 ORDER BY a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary2-4.56.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 32767 ORDER BY a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary2-4.56.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 32767 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23} -do_test boundary2-4.56.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 32767 ORDER BY r DESC - } -} {23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.56.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 32767 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.57.1 { - db eval { - SELECT * FROM t1 WHERE r=127 - } -} {127 4 000000000000007f} -do_test boundary2-4.57.2 { - db eval { - SELECT r, a FROM t1 WHERE x='000000000000007f' - } -} {127 4} -do_test boundary2-4.57.3 { - db eval { - SELECT r, x FROM t1 WHERE a=4 - } -} {127 000000000000007f} -do_test boundary2-4.57.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 127 ORDER BY a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary2-4.57.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 127 ORDER BY a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary2-4.57.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 127 ORDER BY r - } -} {49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.57.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 127 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49} -do_test boundary2-4.57.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 127 ORDER BY x - } -} {49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.57.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 127 ORDER BY a - } -} {3 4 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary2-4.57.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 127 ORDER BY a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 4 3} -do_test boundary2-4.57.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 127 ORDER BY r - } -} {4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.57.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 127 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4} -do_test boundary2-4.57.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 127 ORDER BY x - } -} {4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.57.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 127 ORDER BY a - } -} {1 2 5 11 21 29 31 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary2-4.57.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 127 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 31 29 21 11 5 2 1} -do_test boundary2-4.57.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 127 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31} -do_test boundary2-4.57.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 127 ORDER BY r DESC - } -} {31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.57.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 127 ORDER BY x - } -} {59 60 41 5 31 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.57.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 127 ORDER BY a - } -} {1 2 4 5 11 21 29 31 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary2-4.57.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 127 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 31 29 21 11 5 4 2 1} -do_test boundary2-4.57.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 127 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4} -do_test boundary2-4.57.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 127 ORDER BY r DESC - } -} {4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.57.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 127 ORDER BY x - } -} {59 60 41 5 31 4 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.58.1 { - db eval { - SELECT * FROM t1 WHERE r=36028797018963967 - } -} {36028797018963967 27 007fffffffffffff} -do_test boundary2-4.58.2 { - db eval { - SELECT r, a FROM t1 WHERE x='007fffffffffffff' - } -} {36028797018963967 27} -do_test boundary2-4.58.3 { - db eval { - SELECT r, x FROM t1 WHERE a=27 - } -} {36028797018963967 007fffffffffffff} -do_test boundary2-4.58.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 36028797018963967 ORDER BY a - } -} {3 17 28 45} -do_test boundary2-4.58.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 36028797018963967 ORDER BY a DESC - } -} {45 28 17 3} -do_test boundary2-4.58.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 36028797018963967 ORDER BY r - } -} {45 17 28 3} -do_test boundary2-4.58.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 36028797018963967 ORDER BY r DESC - } -} {3 28 17 45} -do_test boundary2-4.58.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 36028797018963967 ORDER BY x - } -} {45 17 28 3} -do_test boundary2-4.58.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 36028797018963967 ORDER BY a - } -} {3 17 27 28 45} -do_test boundary2-4.58.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 36028797018963967 ORDER BY a DESC - } -} {45 28 27 17 3} -do_test boundary2-4.58.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 36028797018963967 ORDER BY r - } -} {27 45 17 28 3} -do_test boundary2-4.58.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 36028797018963967 ORDER BY r DESC - } -} {3 28 17 45 27} -do_test boundary2-4.58.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 36028797018963967 ORDER BY x - } -} {27 45 17 28 3} -do_test boundary2-4.58.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 36028797018963967 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.58.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 36028797018963967 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-4.58.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 36028797018963967 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43} -do_test boundary2-4.58.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 36028797018963967 ORDER BY r DESC - } -} {43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.58.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 36028797018963967 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.58.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 36028797018963967 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.58.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 36028797018963967 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 27 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-4.58.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 36028797018963967 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27} -do_test boundary2-4.58.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 36028797018963967 ORDER BY r DESC - } -} {27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.58.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 36028797018963967 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.59.1 { - db eval { - SELECT * FROM t1 WHERE r=4398046511104 - } -} {4398046511104 56 0000040000000000} -do_test boundary2-4.59.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000040000000000' - } -} {4398046511104 56} -do_test boundary2-4.59.3 { - db eval { - SELECT r, x FROM t1 WHERE a=56 - } -} {4398046511104 0000040000000000} -do_test boundary2-4.59.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 4398046511104 ORDER BY a - } -} {3 10 13 17 25 26 27 28 34 43 45} -do_test boundary2-4.59.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 4398046511104 ORDER BY a DESC - } -} {45 43 34 28 27 26 25 17 13 10 3} -do_test boundary2-4.59.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 4398046511104 ORDER BY r - } -} {25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.59.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 4398046511104 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25} -do_test boundary2-4.59.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 4398046511104 ORDER BY x - } -} {25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.59.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 4398046511104 ORDER BY a - } -} {3 10 13 17 25 26 27 28 34 43 45 56} -do_test boundary2-4.59.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 4398046511104 ORDER BY a DESC - } -} {56 45 43 34 28 27 26 25 17 13 10 3} -do_test boundary2-4.59.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 4398046511104 ORDER BY r - } -} {56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.59.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 4398046511104 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56} -do_test boundary2-4.59.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 4398046511104 ORDER BY x - } -} {56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.59.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 4398046511104 ORDER BY a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 57 58 59 60 61 62 63 64} -do_test boundary2-4.59.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 4398046511104 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary2-4.59.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 4398046511104 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7} -do_test boundary2-4.59.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 4398046511104 ORDER BY r DESC - } -} {7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.59.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 4398046511104 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.59.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 4398046511104 ORDER BY a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.59.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 4398046511104 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary2-4.59.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 4398046511104 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56} -do_test boundary2-4.59.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 4398046511104 ORDER BY r DESC - } -} {56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.59.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 4398046511104 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.60.1 { - db eval { - SELECT * FROM t1 WHERE r=1 - } -} {1 60 0000000000000001} -do_test boundary2-4.60.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000000000001' - } -} {1 60} -do_test boundary2-4.60.3 { - db eval { - SELECT r, x FROM t1 WHERE a=60 - } -} {1 0000000000000001} -do_test boundary2-4.60.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 1 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 41 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary2-4.60.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 1 ORDER BY a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 41 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-4.60.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 1 ORDER BY r - } -} {41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.60.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 1 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41} -do_test boundary2-4.60.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 1 ORDER BY x - } -} {41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.60.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 1 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 41 42 43 45 46 48 49 50 51 56 57 60 61 62} -do_test boundary2-4.60.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 1 ORDER BY a DESC - } -} {62 61 60 57 56 51 50 49 48 46 45 43 42 41 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-4.60.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 1 ORDER BY r - } -} {60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.60.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 1 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60} -do_test boundary2-4.60.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 1 ORDER BY x - } -} {60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.60.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 1 ORDER BY a - } -} {1 2 11 21 29 32 33 37 38 44 47 52 53 54 55 58 59 63 64} -do_test boundary2-4.60.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 1 ORDER BY a DESC - } -} {64 63 59 58 55 54 53 52 47 44 38 37 33 32 29 21 11 2 1} -do_test boundary2-4.60.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 1 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59} -do_test boundary2-4.60.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 1 ORDER BY r DESC - } -} {59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.60.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 1 ORDER BY x - } -} {59 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.60.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 1 ORDER BY a - } -} {1 2 11 21 29 32 33 37 38 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary2-4.60.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 1 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 38 37 33 32 29 21 11 2 1} -do_test boundary2-4.60.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 1 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60} -do_test boundary2-4.60.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 1 ORDER BY r DESC - } -} {60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.60.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 1 ORDER BY x - } -} {59 60 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.61.1 { - db eval { - SELECT * FROM t1 WHERE r=36028797018963968 - } -} {36028797018963968 45 0080000000000000} -do_test boundary2-4.61.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0080000000000000' - } -} {36028797018963968 45} -do_test boundary2-4.61.3 { - db eval { - SELECT r, x FROM t1 WHERE a=45 - } -} {36028797018963968 0080000000000000} -do_test boundary2-4.61.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 36028797018963968 ORDER BY a - } -} {3 17 28} -do_test boundary2-4.61.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 36028797018963968 ORDER BY a DESC - } -} {28 17 3} -do_test boundary2-4.61.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 36028797018963968 ORDER BY r - } -} {17 28 3} -do_test boundary2-4.61.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 36028797018963968 ORDER BY r DESC - } -} {3 28 17} -do_test boundary2-4.61.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 36028797018963968 ORDER BY x - } -} {17 28 3} -do_test boundary2-4.61.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 36028797018963968 ORDER BY a - } -} {3 17 28 45} -do_test boundary2-4.61.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 36028797018963968 ORDER BY a DESC - } -} {45 28 17 3} -do_test boundary2-4.61.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 36028797018963968 ORDER BY r - } -} {45 17 28 3} -do_test boundary2-4.61.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 36028797018963968 ORDER BY r DESC - } -} {3 28 17 45} -do_test boundary2-4.61.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 36028797018963968 ORDER BY x - } -} {45 17 28 3} -do_test boundary2-4.61.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 36028797018963968 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.61.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 36028797018963968 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 27 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-4.61.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 36028797018963968 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27} -do_test boundary2-4.61.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 36028797018963968 ORDER BY r DESC - } -} {27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.61.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 36028797018963968 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.61.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 36028797018963968 ORDER BY a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.61.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 36028797018963968 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 27 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary2-4.61.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 36028797018963968 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45} -do_test boundary2-4.61.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 36028797018963968 ORDER BY r DESC - } -} {45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.61.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 36028797018963968 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.62.1 { - db eval { - SELECT * FROM t1 WHERE r=-2147483649 - } -} {-2147483649 47 ffffffff7fffffff} -do_test boundary2-4.62.2 { - db eval { - SELECT r, a FROM t1 WHERE x='ffffffff7fffffff' - } -} {-2147483649 47} -do_test boundary2-4.62.3 { - db eval { - SELECT r, x FROM t1 WHERE a=47 - } -} {-2147483649 ffffffff7fffffff} -do_test boundary2-4.62.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -2147483649 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary2-4.62.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -2147483649 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary2-4.62.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -2147483649 ORDER BY r - } -} {11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.62.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -2147483649 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11} -do_test boundary2-4.62.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -2147483649 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.62.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -2147483649 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 47 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary2-4.62.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -2147483649 ORDER BY a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 47 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary2-4.62.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -2147483649 ORDER BY r - } -} {47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.62.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -2147483649 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47} -do_test boundary2-4.62.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -2147483649 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.62.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -2147483649 ORDER BY a - } -} {2 21 44 55 58 63 64} -do_test boundary2-4.62.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -2147483649 ORDER BY a DESC - } -} {64 63 58 55 44 21 2} -do_test boundary2-4.62.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -2147483649 ORDER BY r - } -} {55 2 64 21 44 58 63} -do_test boundary2-4.62.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -2147483649 ORDER BY r DESC - } -} {63 58 44 21 64 2 55} -do_test boundary2-4.62.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -2147483649 ORDER BY x - } -} {55 2 64 21 44 58 63} -do_test boundary2-4.62.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -2147483649 ORDER BY a - } -} {2 21 44 47 55 58 63 64} -do_test boundary2-4.62.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -2147483649 ORDER BY a DESC - } -} {64 63 58 55 47 44 21 2} -do_test boundary2-4.62.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -2147483649 ORDER BY r - } -} {55 2 64 21 44 58 63 47} -do_test boundary2-4.62.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -2147483649 ORDER BY r DESC - } -} {47 63 58 44 21 64 2 55} -do_test boundary2-4.62.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -2147483649 ORDER BY x - } -} {55 2 64 21 44 58 63 47} -do_test boundary2-4.63.1 { - db eval { - SELECT * FROM t1 WHERE r=-36028797018963969 - } -} {-36028797018963969 2 ff7fffffffffffff} -do_test boundary2-4.63.2 { - db eval { - SELECT r, a FROM t1 WHERE x='ff7fffffffffffff' - } -} {-36028797018963969 2} -do_test boundary2-4.63.3 { - db eval { - SELECT r, x FROM t1 WHERE a=2 - } -} {-36028797018963969 ff7fffffffffffff} -do_test boundary2-4.63.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -36028797018963969 ORDER BY a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.63.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -36028797018963969 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary2-4.63.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -36028797018963969 ORDER BY r - } -} {64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.63.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -36028797018963969 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64} -do_test boundary2-4.63.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -36028797018963969 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.63.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -36028797018963969 ORDER BY a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.63.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -36028797018963969 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary2-4.63.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -36028797018963969 ORDER BY r - } -} {2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.63.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -36028797018963969 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2} -do_test boundary2-4.63.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -36028797018963969 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.63.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -36028797018963969 ORDER BY a - } -} {55} -do_test boundary2-4.63.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -36028797018963969 ORDER BY a DESC - } -} {55} -do_test boundary2-4.63.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -36028797018963969 ORDER BY r - } -} {55} -do_test boundary2-4.63.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -36028797018963969 ORDER BY r DESC - } -} {55} -do_test boundary2-4.63.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -36028797018963969 ORDER BY x - } -} {55} -do_test boundary2-4.63.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -36028797018963969 ORDER BY a - } -} {2 55} -do_test boundary2-4.63.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -36028797018963969 ORDER BY a DESC - } -} {55 2} -do_test boundary2-4.63.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -36028797018963969 ORDER BY r - } -} {55 2} -do_test boundary2-4.63.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -36028797018963969 ORDER BY r DESC - } -} {2 55} -do_test boundary2-4.63.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -36028797018963969 ORDER BY x - } -} {55 2} -do_test boundary2-4.64.1 { - db eval { - SELECT * FROM t1 WHERE r=3 - } -} {3 5 0000000000000003} -do_test boundary2-4.64.2 { - db eval { - SELECT r, a FROM t1 WHERE x='0000000000000003' - } -} {3 5} -do_test boundary2-4.64.3 { - db eval { - SELECT r, x FROM t1 WHERE a=5 - } -} {3 0000000000000003} -do_test boundary2-4.64.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 3 ORDER BY a - } -} {3 4 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary2-4.64.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 3 ORDER BY a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 4 3} -do_test boundary2-4.64.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 3 ORDER BY r - } -} {31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.64.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 3 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31} -do_test boundary2-4.64.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 3 ORDER BY x - } -} {31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.64.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 3 ORDER BY a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary2-4.64.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 3 ORDER BY a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary2-4.64.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 3 ORDER BY r - } -} {5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.64.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 3 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5} -do_test boundary2-4.64.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 3 ORDER BY x - } -} {5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.64.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 3 ORDER BY a - } -} {1 2 11 21 29 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary2-4.64.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 3 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 29 21 11 2 1} -do_test boundary2-4.64.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 3 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41} -do_test boundary2-4.64.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 3 ORDER BY r DESC - } -} {41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.64.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 3 ORDER BY x - } -} {59 60 41 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.64.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 3 ORDER BY a - } -} {1 2 5 11 21 29 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary2-4.64.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 3 ORDER BY a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 29 21 11 5 2 1} -do_test boundary2-4.64.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 3 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5} -do_test boundary2-4.64.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 3 ORDER BY r DESC - } -} {5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.64.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 3 ORDER BY x - } -} {59 60 41 5 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.65.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > 9.22337303685477580800e+18 ORDER BY a - } -} {} -do_test boundary2-4.65.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > 9.22337303685477580800e+18 ORDER BY a DESC - } -} {} -do_test boundary2-4.65.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > 9.22337303685477580800e+18 ORDER BY r - } -} {} -do_test boundary2-4.65.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > 9.22337303685477580800e+18 ORDER BY r DESC - } -} {} -do_test boundary2-4.65.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > 9.22337303685477580800e+18 ORDER BY x - } -} {} -do_test boundary2-4.65.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= 9.22337303685477580800e+18 ORDER BY a - } -} {} -do_test boundary2-4.65.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= 9.22337303685477580800e+18 ORDER BY a DESC - } -} {} -do_test boundary2-4.65.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= 9.22337303685477580800e+18 ORDER BY r - } -} {} -do_test boundary2-4.65.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= 9.22337303685477580800e+18 ORDER BY r DESC - } -} {} -do_test boundary2-4.65.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= 9.22337303685477580800e+18 ORDER BY x - } -} {} -do_test boundary2-4.65.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < 9.22337303685477580800e+18 ORDER BY a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.65.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < 9.22337303685477580800e+18 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary2-4.65.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < 9.22337303685477580800e+18 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.65.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < 9.22337303685477580800e+18 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.65.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < 9.22337303685477580800e+18 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.65.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= 9.22337303685477580800e+18 ORDER BY a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.65.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= 9.22337303685477580800e+18 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary2-4.65.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= 9.22337303685477580800e+18 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.65.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= 9.22337303685477580800e+18 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.65.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= 9.22337303685477580800e+18 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.66.gt.1 { - db eval { - SELECT a FROM t1 WHERE r > -9.22337303685477580800e+18 ORDER BY a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.66.gt.2 { - db eval { - SELECT a FROM t1 WHERE r > -9.22337303685477580800e+18 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary2-4.66.gt.3 { - db eval { - SELECT a FROM t1 WHERE r > -9.22337303685477580800e+18 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.66.gt.4 { - db eval { - SELECT a FROM t1 WHERE r > -9.22337303685477580800e+18 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.66.gt.5 { - db eval { - SELECT a FROM t1 WHERE r > -9.22337303685477580800e+18 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.66.ge.1 { - db eval { - SELECT a FROM t1 WHERE r >= -9.22337303685477580800e+18 ORDER BY a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary2-4.66.ge.2 { - db eval { - SELECT a FROM t1 WHERE r >= -9.22337303685477580800e+18 ORDER BY a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary2-4.66.ge.3 { - db eval { - SELECT a FROM t1 WHERE r >= -9.22337303685477580800e+18 ORDER BY r - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary2-4.66.ge.4 { - db eval { - SELECT a FROM t1 WHERE r >= -9.22337303685477580800e+18 ORDER BY r DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary2-4.66.ge.5 { - db eval { - SELECT a FROM t1 WHERE r >= -9.22337303685477580800e+18 ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary2-4.66.lt.1 { - db eval { - SELECT a FROM t1 WHERE r < -9.22337303685477580800e+18 ORDER BY a - } -} {} -do_test boundary2-4.66.lt.2 { - db eval { - SELECT a FROM t1 WHERE r < -9.22337303685477580800e+18 ORDER BY a DESC - } -} {} -do_test boundary2-4.66.lt.3 { - db eval { - SELECT a FROM t1 WHERE r < -9.22337303685477580800e+18 ORDER BY r - } -} {} -do_test boundary2-4.66.lt.4 { - db eval { - SELECT a FROM t1 WHERE r < -9.22337303685477580800e+18 ORDER BY r DESC - } -} {} -do_test boundary2-4.66.lt.5 { - db eval { - SELECT a FROM t1 WHERE r < -9.22337303685477580800e+18 ORDER BY x - } -} {} -do_test boundary2-4.66.le.1 { - db eval { - SELECT a FROM t1 WHERE r <= -9.22337303685477580800e+18 ORDER BY a - } -} {} -do_test boundary2-4.66.le.2 { - db eval { - SELECT a FROM t1 WHERE r <= -9.22337303685477580800e+18 ORDER BY a DESC - } -} {} -do_test boundary2-4.66.le.3 { - db eval { - SELECT a FROM t1 WHERE r <= -9.22337303685477580800e+18 ORDER BY r - } -} {} -do_test boundary2-4.66.le.4 { - db eval { - SELECT a FROM t1 WHERE r <= -9.22337303685477580800e+18 ORDER BY r DESC - } -} {} -do_test boundary2-4.66.le.5 { - db eval { - SELECT a FROM t1 WHERE r <= -9.22337303685477580800e+18 ORDER BY x - } -} {} -finish_test DELETED test/boundary3.tcl Index: test/boundary3.tcl ================================================================== --- test/boundary3.tcl +++ /dev/null @@ -1,290 +0,0 @@ -puts {# 2008 December 11 -# -# The author disclaims copyright to this source code. In place of -# a legal notice, here is a blessing: -# -# May you do good and not evil. -# May you find forgiveness for yourself and forgive others. -# May you share freely, never taking more than you give. -# -#*********************************************************************** -# This file implements regression tests for SQLite library. -# -# This file is automatically generated from a separate TCL script. -# This file seeks to exercise integer boundary values. -# -# $Id: boundary3.tcl,v 1.3 2009/01/02 15:45:48 shane Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -# Many of the boundary tests depend on a working 64-bit implementation. -if {![working_64bit_int]} { finish_test; return } -} - -expr srand(0) - -# Generate interesting boundary numbers -# -foreach x { - 0 - 1 - 0x7f - 0x7fff - 0x7fffff - 0x7fffffff - 0x7fffffffff - 0x7fffffffffff - 0x7fffffffffffff - 0x7fffffffffffffff -} { - set x [expr {wide($x)}] - set boundarynum($x) 1 - set boundarynum([expr {$x+1}]) 1 - set boundarynum([expr {-($x+1)}]) 1 - set boundarynum([expr {-($x+2)}]) 1 - set boundarynum([expr {$x+$x+1}]) 1 - set boundarynum([expr {$x+$x+2}]) 1 -} -set x [expr {wide(127)}] -for {set i 1} {$i<=9} {incr i} { - set boundarynum($x) 1 - set boundarynum([expr {$x+1}]) 1 - set x [expr {wide($x*128 + 127)}] -} - -# Scramble the $inlist into a random order. -# -proc scramble {inlist} { - set y {} - foreach x $inlist { - lappend y [list [expr {rand()}] $x] - } - set y [lsort $y] - set outlist {} - foreach x $y { - lappend outlist [lindex $x 1] - } - return $outlist -} - -# A simple selection sort. Not trying to be efficient. -# -proc sort {inlist} { - set outlist {} - set mn [lindex $inlist 0] - foreach x $inlist { - if {$x<$mn} {set mn $x} - } - set outlist $mn - set mx $mn - while {1} { - set valid 0 - foreach x $inlist { - if {$x>$mx && (!$valid || $mn>$x)} { - set mn $x - set valid 1 - } - } - if {!$valid} break - lappend outlist $mn - set mx $mn - } - return $outlist -} - -# Reverse the order of a list -# -proc reverse {inlist} { - set i [llength $inlist] - set outlist {} - for {incr i -1} {$i>=0} {incr i -1} { - lappend outlist [lindex $inlist $i] - } - return $outlist -} - -set nums1 [scramble [array names boundarynum]] -set nums2 [scramble [array names boundarynum]] - -set tname boundary3 -puts "do_test $tname-1.1 \173" -puts " db eval \173" -puts " CREATE TABLE t1(a,x);" -set a 0 -foreach r $nums1 { - incr a - set t1ra($r) $a - set t1ar($a) $r - set x [format %08x%08x [expr {wide($r)>>32}] $r] - set t1rx($r) $x - set t1xr($x) $r - puts " INSERT INTO t1(oid,a,x) VALUES($r,$a,'$x');" -} -puts " CREATE INDEX t1i1 ON t1(a);" -puts " CREATE INDEX t1i2 ON t1(x);" -puts " \175" -puts "\175 {}" - -puts "do_test $tname-1.2 \173" -puts " db eval \173" -puts " SELECT count(*) FROM t1" -puts " \175" -puts "\175 {64}" - -puts "do_test $tname-1.3 \173" -puts " db eval \173" -puts " CREATE TABLE t2(r,a);" -puts " INSERT INTO t2 SELECT rowid, a FROM t1;" -puts " CREATE INDEX t2i1 ON t2(r);" -puts " CREATE INDEX t2i2 ON t2(a);" -puts " INSERT INTO t2 VALUES(9.22337303685477580800e+18,65);" -set t1ra(9.22337303685477580800e+18) 65 -set t1ar(65) 9.22337303685477580800e+18) -puts " INSERT INTO t2 VALUES(-9.22337303685477580800e+18,66);" -set t1ra(-9.22337303685477580800e+18) 66 -set t1ar(66) -9.22337303685477580800e+18) -puts " SELECT count(*) FROM t2;" -puts " \175" -puts "\175 {66}" - -set nums3 $nums2 -lappend nums3 9.22337303685477580800e+18 -lappend nums3 -9.22337303685477580800e+18 - -set i 0 -foreach r $nums3 { - incr i - - set r5 $r.5 - set r0 $r.0 - if {abs($r)<9.22337203685477580800e+18} { - set x $t1rx($r) - set a $t1ra($r) - puts "do_test $tname-2.$i.1 \173" - puts " db eval \173" - puts " SELECT t1.* FROM t1, t2 WHERE t1.rowid=$r AND t2.a=t1.a" - puts " \175" - puts "\175 {$a $x}" - puts "do_test $tname-2.$i.2 \173" - puts " db eval \173" - puts " SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='$x'" - puts " \175" - puts "\175 {$r $a}" - puts "do_test $tname-2.$i.3 \173" - puts " db eval \173" - puts " SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=$a" - puts " \175" - puts "\175 {$r $x}" - } - - foreach op {> >= < <=} subno {gt ge lt le} { - - ################################################################ 2.x.y.1 - set rset {} - set aset {} - foreach rx $nums2 { - if "\$rx $op \$r" { - lappend rset $rx - lappend aset $t1ra($rx) - } - } - puts "do_test $tname-2.$i.$subno.1 \173" - puts " db eval \173" - puts " SELECT t2.a FROM t1 JOIN t2 USING(a)" - puts " WHERE t1.rowid $op $r ORDER BY t2.a" - puts " \175" - puts "\175 {[sort $aset]}" - - ################################################################ 2.x.y.2 - puts "do_test $tname-2.$i.$subno.2 \173" - puts " db eval \173" - puts " SELECT t2.a FROM t2 NATURAL JOIN t1" - puts " WHERE t1.rowid $op $r ORDER BY t1.a DESC" - puts " \175" - puts "\175 {[reverse [sort $aset]]}" - - - ################################################################ 2.x.y.3 - set ax $t1ra($r) - set aset {} - foreach rx [sort $rset] { - lappend aset $t1ra($rx) - } - puts "do_test $tname-2.$i.$subno.3 \173" - puts " db eval \173" - puts " SELECT t1.a FROM t1 JOIN t2 ON t1.rowid $op t2.r" - puts " WHERE t2.a=$ax" - puts " ORDER BY t1.rowid" - puts " \175" - puts "\175 {$aset}" - - ################################################################ 2.x.y.4 - set aset {} - foreach rx [reverse [sort $rset]] { - lappend aset $t1ra($rx) - } - puts "do_test $tname-2.$i.$subno.4 \173" - puts " db eval \173" - puts " SELECT t1.a FROM t1 JOIN t2 ON t1.rowid $op t2.r" - puts " WHERE t2.a=$ax" - puts " ORDER BY t1.rowid DESC" - puts " \175" - puts "\175 {$aset}" - - ################################################################ 2.x.y.5 - set aset {} - set xset {} - foreach rx $rset { - lappend xset $t1rx($rx) - } - foreach x [sort $xset] { - set rx $t1xr($x) - lappend aset $t1ra($rx) - } - puts "do_test $tname-2.$i.$subno.5 \173" - puts " db eval \173" - puts " SELECT t1.a FROM t1 JOIN t2 ON t1.rowid $op t2.r" - puts " WHERE t2.a=$ax" - puts " ORDER BY x" - puts " \175" - puts "\175 {$aset}" - - ################################################################ 2.x.y.10 - if {[string length $r5]>15} continue - set rset {} - set aset {} - foreach rx $nums2 { - if "\$rx $op \$r0" { - lappend rset $rx - } - } - foreach rx [sort $rset] { - lappend aset $t1ra($rx) - } - puts "do_test $tname-2.$i.$subno.10 \173" - puts " db eval \173" - puts " SELECT t1.a FROM t1 JOIN t2 ON t1.rowid $op CAST(t2.r AS real)" - puts " WHERE t2.a=$ax" - puts " ORDER BY t1.rowid" - puts " \175" - puts "\175 {$aset}" - - ################################################################ 2.x.y.11 - set aset {} - foreach rx [reverse [sort $rset]] { - lappend aset $t1ra($rx) - } - puts "do_test $tname-2.$i.$subno.11 \173" - puts " db eval \173" - puts " SELECT t1.a FROM t1 JOIN t2 ON t1.rowid $op CAST(t2.r AS real)" - puts " WHERE t2.a=$ax" - puts " ORDER BY t1.rowid DESC" - puts " \175" - puts "\175 {$aset}" - } - -} - - -puts {finish_test} DELETED test/boundary3.test Index: test/boundary3.test ================================================================== --- test/boundary3.test +++ /dev/null @@ -1,12456 +0,0 @@ -# 2008 December 11 -# -# The author disclaims copyright to this source code. In place of -# a legal notice, here is a blessing: -# -# May you do good and not evil. -# May you find forgiveness for yourself and forgive others. -# May you share freely, never taking more than you give. -# -#*********************************************************************** -# This file implements regression tests for SQLite library. -# -# This file is automatically generated from a separate TCL script. -# This file seeks to exercise integer boundary values. -# -# $Id: boundary3.test,v 1.2 2009/01/02 15:45:48 shane Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -# Many of the boundary tests depend on a working 64-bit implementation. -if {![working_64bit_int]} { finish_test; return } - -do_test boundary3-1.1 { - db eval { - CREATE TABLE t1(a,x); - INSERT INTO t1(oid,a,x) VALUES(-8388609,1,'ffffffffff7fffff'); - INSERT INTO t1(oid,a,x) VALUES(-36028797018963969,2,'ff7fffffffffffff'); - INSERT INTO t1(oid,a,x) VALUES(9223372036854775807,3,'7fffffffffffffff'); - INSERT INTO t1(oid,a,x) VALUES(127,4,'000000000000007f'); - INSERT INTO t1(oid,a,x) VALUES(3,5,'0000000000000003'); - INSERT INTO t1(oid,a,x) VALUES(16777216,6,'0000000001000000'); - INSERT INTO t1(oid,a,x) VALUES(4398046511103,7,'000003ffffffffff'); - INSERT INTO t1(oid,a,x) VALUES(16383,8,'0000000000003fff'); - INSERT INTO t1(oid,a,x) VALUES(16777215,9,'0000000000ffffff'); - INSERT INTO t1(oid,a,x) VALUES(281474976710655,10,'0000ffffffffffff'); - INSERT INTO t1(oid,a,x) VALUES(-2147483648,11,'ffffffff80000000'); - INSERT INTO t1(oid,a,x) VALUES(268435455,12,'000000000fffffff'); - INSERT INTO t1(oid,a,x) VALUES(562949953421311,13,'0001ffffffffffff'); - INSERT INTO t1(oid,a,x) VALUES(4294967295,14,'00000000ffffffff'); - INSERT INTO t1(oid,a,x) VALUES(2097151,15,'00000000001fffff'); - INSERT INTO t1(oid,a,x) VALUES(16384,16,'0000000000004000'); - INSERT INTO t1(oid,a,x) VALUES(72057594037927935,17,'00ffffffffffffff'); - INSERT INTO t1(oid,a,x) VALUES(8388607,18,'00000000007fffff'); - INSERT INTO t1(oid,a,x) VALUES(1099511627776,19,'0000010000000000'); - INSERT INTO t1(oid,a,x) VALUES(2147483647,20,'000000007fffffff'); - INSERT INTO t1(oid,a,x) VALUES(-140737488355329,21,'ffff7fffffffffff'); - INSERT INTO t1(oid,a,x) VALUES(34359738368,22,'0000000800000000'); - INSERT INTO t1(oid,a,x) VALUES(32767,23,'0000000000007fff'); - INSERT INTO t1(oid,a,x) VALUES(8388608,24,'0000000000800000'); - INSERT INTO t1(oid,a,x) VALUES(140737488355327,25,'00007fffffffffff'); - INSERT INTO t1(oid,a,x) VALUES(281474976710656,26,'0001000000000000'); - INSERT INTO t1(oid,a,x) VALUES(36028797018963967,27,'007fffffffffffff'); - INSERT INTO t1(oid,a,x) VALUES(72057594037927936,28,'0100000000000000'); - INSERT INTO t1(oid,a,x) VALUES(-32769,29,'ffffffffffff7fff'); - INSERT INTO t1(oid,a,x) VALUES(255,30,'00000000000000ff'); - INSERT INTO t1(oid,a,x) VALUES(4,31,'0000000000000004'); - INSERT INTO t1(oid,a,x) VALUES(-32768,32,'ffffffffffff8000'); - INSERT INTO t1(oid,a,x) VALUES(-2,33,'fffffffffffffffe'); - INSERT INTO t1(oid,a,x) VALUES(140737488355328,34,'0000800000000000'); - INSERT INTO t1(oid,a,x) VALUES(549755813888,35,'0000008000000000'); - INSERT INTO t1(oid,a,x) VALUES(4294967296,36,'0000000100000000'); - INSERT INTO t1(oid,a,x) VALUES(-8388608,37,'ffffffffff800000'); - INSERT INTO t1(oid,a,x) VALUES(-1,38,'ffffffffffffffff'); - INSERT INTO t1(oid,a,x) VALUES(34359738367,39,'00000007ffffffff'); - INSERT INTO t1(oid,a,x) VALUES(268435456,40,'0000000010000000'); - INSERT INTO t1(oid,a,x) VALUES(2,41,'0000000000000002'); - INSERT INTO t1(oid,a,x) VALUES(2097152,42,'0000000000200000'); - INSERT INTO t1(oid,a,x) VALUES(562949953421312,43,'0002000000000000'); - INSERT INTO t1(oid,a,x) VALUES(-140737488355328,44,'ffff800000000000'); - INSERT INTO t1(oid,a,x) VALUES(36028797018963968,45,'0080000000000000'); - INSERT INTO t1(oid,a,x) VALUES(549755813887,46,'0000007fffffffff'); - INSERT INTO t1(oid,a,x) VALUES(-2147483649,47,'ffffffff7fffffff'); - INSERT INTO t1(oid,a,x) VALUES(65535,48,'000000000000ffff'); - INSERT INTO t1(oid,a,x) VALUES(128,49,'0000000000000080'); - INSERT INTO t1(oid,a,x) VALUES(32768,50,'0000000000008000'); - INSERT INTO t1(oid,a,x) VALUES(2147483648,51,'0000000080000000'); - INSERT INTO t1(oid,a,x) VALUES(-3,52,'fffffffffffffffd'); - INSERT INTO t1(oid,a,x) VALUES(-128,53,'ffffffffffffff80'); - INSERT INTO t1(oid,a,x) VALUES(-129,54,'ffffffffffffff7f'); - INSERT INTO t1(oid,a,x) VALUES(-9223372036854775808,55,'8000000000000000'); - INSERT INTO t1(oid,a,x) VALUES(4398046511104,56,'0000040000000000'); - INSERT INTO t1(oid,a,x) VALUES(1099511627775,57,'000000ffffffffff'); - INSERT INTO t1(oid,a,x) VALUES(-549755813889,58,'ffffff7fffffffff'); - INSERT INTO t1(oid,a,x) VALUES(0,59,'0000000000000000'); - INSERT INTO t1(oid,a,x) VALUES(1,60,'0000000000000001'); - INSERT INTO t1(oid,a,x) VALUES(256,61,'0000000000000100'); - INSERT INTO t1(oid,a,x) VALUES(65536,62,'0000000000010000'); - INSERT INTO t1(oid,a,x) VALUES(-549755813888,63,'ffffff8000000000'); - INSERT INTO t1(oid,a,x) VALUES(-36028797018963968,64,'ff80000000000000'); - CREATE INDEX t1i1 ON t1(a); - CREATE INDEX t1i2 ON t1(x); - } -} {} -do_test boundary3-1.2 { - db eval { - SELECT count(*) FROM t1 - } -} {64} -do_test boundary3-1.3 { - db eval { - CREATE TABLE t2(r,a); - INSERT INTO t2 SELECT rowid, a FROM t1; - CREATE INDEX t2i1 ON t2(r); - CREATE INDEX t2i2 ON t2(a); - INSERT INTO t2 VALUES(9.22337303685477580800e+18,65); - INSERT INTO t2 VALUES(-9.22337303685477580800e+18,66); - SELECT count(*) FROM t2; - } -} {66} -do_test boundary3-2.1.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=72057594037927935 AND t2.a=t1.a - } -} {17 00ffffffffffffff} -do_test boundary3-2.1.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='00ffffffffffffff' - } -} {72057594037927935 17} -do_test boundary3-2.1.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=17 - } -} {72057594037927935 00ffffffffffffff} -do_test boundary3-2.1.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 72057594037927935 ORDER BY t2.a - } -} {3 28} -do_test boundary3-2.1.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 72057594037927935 ORDER BY t1.a DESC - } -} {28 3} -do_test boundary3-2.1.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=17 - ORDER BY t1.rowid - } -} {28 3} -do_test boundary3-2.1.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=17 - ORDER BY t1.rowid DESC - } -} {3 28} -do_test boundary3-2.1.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=17 - ORDER BY x - } -} {28 3} -do_test boundary3-2.1.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 72057594037927935 ORDER BY t2.a - } -} {3 17 28} -do_test boundary3-2.1.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 72057594037927935 ORDER BY t1.a DESC - } -} {28 17 3} -do_test boundary3-2.1.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=17 - ORDER BY t1.rowid - } -} {17 28 3} -do_test boundary3-2.1.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=17 - ORDER BY t1.rowid DESC - } -} {3 28 17} -do_test boundary3-2.1.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=17 - ORDER BY x - } -} {17 28 3} -do_test boundary3-2.1.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 72057594037927935 ORDER BY t2.a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.1.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 72057594037927935 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 27 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary3-2.1.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=17 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45} -do_test boundary3-2.1.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=17 - ORDER BY t1.rowid DESC - } -} {45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.1.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=17 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.1.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 72057594037927935 ORDER BY t2.a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.1.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 72057594037927935 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary3-2.1.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=17 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17} -do_test boundary3-2.1.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=17 - ORDER BY t1.rowid DESC - } -} {17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.1.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=17 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.2.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=16384 AND t2.a=t1.a - } -} {16 0000000000004000} -do_test boundary3-2.2.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='0000000000004000' - } -} {16384 16} -do_test boundary3-2.2.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=16 - } -} {16384 0000000000004000} -do_test boundary3-2.2.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 16384 ORDER BY t2.a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary3-2.2.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 16384 ORDER BY t1.a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary3-2.2.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=16 - ORDER BY t1.rowid - } -} {23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.2.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=16 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23} -do_test boundary3-2.2.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=16 - ORDER BY x - } -} {23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.2.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=16 - ORDER BY t1.rowid - } -} {23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.2.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=16 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23} -do_test boundary3-2.2.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 16384 ORDER BY t2.a - } -} {3 6 7 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary3-2.2.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 16384 ORDER BY t1.a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 7 6 3} -do_test boundary3-2.2.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=16 - ORDER BY t1.rowid - } -} {16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.2.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=16 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16} -do_test boundary3-2.2.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=16 - ORDER BY x - } -} {16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.2.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=16 - ORDER BY t1.rowid - } -} {16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.2.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=16 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16} -do_test boundary3-2.2.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 16384 ORDER BY t2.a - } -} {1 2 4 5 8 11 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary3-2.2.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 16384 ORDER BY t1.a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 11 8 5 4 2 1} -do_test boundary3-2.2.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=16 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8} -do_test boundary3-2.2.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=16 - ORDER BY t1.rowid DESC - } -} {8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.2.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=16 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.2.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=16 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8} -do_test boundary3-2.2.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=16 - ORDER BY t1.rowid DESC - } -} {8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.2.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 16384 ORDER BY t2.a - } -} {1 2 4 5 8 11 16 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary3-2.2.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 16384 ORDER BY t1.a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 16 11 8 5 4 2 1} -do_test boundary3-2.2.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=16 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16} -do_test boundary3-2.2.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=16 - ORDER BY t1.rowid DESC - } -} {16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.2.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=16 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.2.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=16 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16} -do_test boundary3-2.2.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=16 - ORDER BY t1.rowid DESC - } -} {16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.3.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=4294967296 AND t2.a=t1.a - } -} {36 0000000100000000} -do_test boundary3-2.3.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='0000000100000000' - } -} {4294967296 36} -do_test boundary3-2.3.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=36 - } -} {4294967296 0000000100000000} -do_test boundary3-2.3.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 4294967296 ORDER BY t2.a - } -} {3 7 10 13 17 19 22 25 26 27 28 34 35 39 43 45 46 56 57} -do_test boundary3-2.3.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 4294967296 ORDER BY t1.a DESC - } -} {57 56 46 45 43 39 35 34 28 27 26 25 22 19 17 13 10 7 3} -do_test boundary3-2.3.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=36 - ORDER BY t1.rowid - } -} {39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.3.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=36 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39} -do_test boundary3-2.3.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=36 - ORDER BY x - } -} {39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.3.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=36 - ORDER BY t1.rowid - } -} {39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.3.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=36 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39} -do_test boundary3-2.3.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 4294967296 ORDER BY t2.a - } -} {3 7 10 13 17 19 22 25 26 27 28 34 35 36 39 43 45 46 56 57} -do_test boundary3-2.3.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 4294967296 ORDER BY t1.a DESC - } -} {57 56 46 45 43 39 36 35 34 28 27 26 25 22 19 17 13 10 7 3} -do_test boundary3-2.3.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=36 - ORDER BY t1.rowid - } -} {36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.3.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=36 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36} -do_test boundary3-2.3.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=36 - ORDER BY x - } -} {36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.3.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=36 - ORDER BY t1.rowid - } -} {36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.3.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=36 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36} -do_test boundary3-2.3.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 4294967296 ORDER BY t2.a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.3.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 4294967296 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary3-2.3.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=36 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14} -do_test boundary3-2.3.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=36 - ORDER BY t1.rowid DESC - } -} {14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.3.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=36 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.3.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=36 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14} -do_test boundary3-2.3.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=36 - ORDER BY t1.rowid DESC - } -} {14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.3.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 4294967296 ORDER BY t2.a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 23 24 29 30 31 32 33 36 37 38 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.3.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 4294967296 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 38 37 36 33 32 31 30 29 24 23 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary3-2.3.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=36 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36} -do_test boundary3-2.3.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=36 - ORDER BY t1.rowid DESC - } -} {36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.3.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=36 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.3.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=36 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36} -do_test boundary3-2.3.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=36 - ORDER BY t1.rowid DESC - } -} {36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.4.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=16777216 AND t2.a=t1.a - } -} {6 0000000001000000} -do_test boundary3-2.4.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='0000000001000000' - } -} {16777216 6} -do_test boundary3-2.4.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=6 - } -} {16777216 0000000001000000} -do_test boundary3-2.4.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 16777216 ORDER BY t2.a - } -} {3 7 10 12 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary3-2.4.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 16777216 ORDER BY t1.a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 12 10 7 3} -do_test boundary3-2.4.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=6 - ORDER BY t1.rowid - } -} {12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.4.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=6 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12} -do_test boundary3-2.4.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=6 - ORDER BY x - } -} {12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.4.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=6 - ORDER BY t1.rowid - } -} {12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.4.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=6 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12} -do_test boundary3-2.4.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 16777216 ORDER BY t2.a - } -} {3 6 7 10 12 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary3-2.4.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 16777216 ORDER BY t1.a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 12 10 7 6 3} -do_test boundary3-2.4.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=6 - ORDER BY t1.rowid - } -} {6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.4.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=6 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6} -do_test boundary3-2.4.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=6 - ORDER BY x - } -} {6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.4.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=6 - ORDER BY t1.rowid - } -} {6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.4.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=6 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6} -do_test boundary3-2.4.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 16777216 ORDER BY t2.a - } -} {1 2 4 5 8 9 11 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.4.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 16777216 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 11 9 8 5 4 2 1} -do_test boundary3-2.4.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=6 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9} -do_test boundary3-2.4.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=6 - ORDER BY t1.rowid DESC - } -} {9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.4.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=6 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.4.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=6 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9} -do_test boundary3-2.4.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=6 - ORDER BY t1.rowid DESC - } -} {9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.4.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 16777216 ORDER BY t2.a - } -} {1 2 4 5 6 8 9 11 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.4.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 16777216 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 11 9 8 6 5 4 2 1} -do_test boundary3-2.4.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=6 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6} -do_test boundary3-2.4.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=6 - ORDER BY t1.rowid DESC - } -} {6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.4.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=6 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.4.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=6 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6} -do_test boundary3-2.4.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=6 - ORDER BY t1.rowid DESC - } -} {6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.5.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=-32769 AND t2.a=t1.a - } -} {29 ffffffffffff7fff} -do_test boundary3-2.5.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='ffffffffffff7fff' - } -} {-32769 29} -do_test boundary3-2.5.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=29 - } -} {-32769 ffffffffffff7fff} -do_test boundary3-2.5.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > -32769 ORDER BY t2.a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 32 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary3-2.5.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > -32769 ORDER BY t1.a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 32 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary3-2.5.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=29 - ORDER BY t1.rowid - } -} {32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.5.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=29 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32} -do_test boundary3-2.5.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=29 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 32 54 53 52 33 38} -do_test boundary3-2.5.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=29 - ORDER BY t1.rowid - } -} {32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.5.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=29 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32} -do_test boundary3-2.5.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= -32769 ORDER BY t2.a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary3-2.5.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= -32769 ORDER BY t1.a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary3-2.5.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=29 - ORDER BY t1.rowid - } -} {29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.5.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=29 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29} -do_test boundary3-2.5.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=29 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 29 32 54 53 52 33 38} -do_test boundary3-2.5.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=29 - ORDER BY t1.rowid - } -} {29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.5.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=29 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29} -do_test boundary3-2.5.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < -32769 ORDER BY t2.a - } -} {1 2 11 21 37 44 47 55 58 63 64} -do_test boundary3-2.5.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < -32769 ORDER BY t1.a DESC - } -} {64 63 58 55 47 44 37 21 11 2 1} -do_test boundary3-2.5.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=29 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37} -do_test boundary3-2.5.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=29 - ORDER BY t1.rowid DESC - } -} {37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.5.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=29 - ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37} -do_test boundary3-2.5.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=29 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37} -do_test boundary3-2.5.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=29 - ORDER BY t1.rowid DESC - } -} {37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.5.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= -32769 ORDER BY t2.a - } -} {1 2 11 21 29 37 44 47 55 58 63 64} -do_test boundary3-2.5.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= -32769 ORDER BY t1.a DESC - } -} {64 63 58 55 47 44 37 29 21 11 2 1} -do_test boundary3-2.5.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=29 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29} -do_test boundary3-2.5.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=29 - ORDER BY t1.rowid DESC - } -} {29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.5.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=29 - ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29} -do_test boundary3-2.5.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=29 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29} -do_test boundary3-2.5.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=29 - ORDER BY t1.rowid DESC - } -} {29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.6.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=-140737488355329 AND t2.a=t1.a - } -} {21 ffff7fffffffffff} -do_test boundary3-2.6.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='ffff7fffffffffff' - } -} {-140737488355329 21} -do_test boundary3-2.6.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=21 - } -} {-140737488355329 ffff7fffffffffff} -do_test boundary3-2.6.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > -140737488355329 ORDER BY t2.a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63} -do_test boundary3-2.6.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > -140737488355329 ORDER BY t1.a DESC - } -} {63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary3-2.6.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=21 - ORDER BY t1.rowid - } -} {44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.6.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=21 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44} -do_test boundary3-2.6.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=21 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.6.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= -140737488355329 ORDER BY t2.a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63} -do_test boundary3-2.6.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= -140737488355329 ORDER BY t1.a DESC - } -} {63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary3-2.6.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=21 - ORDER BY t1.rowid - } -} {21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.6.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=21 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21} -do_test boundary3-2.6.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=21 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.6.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < -140737488355329 ORDER BY t2.a - } -} {2 55 64} -do_test boundary3-2.6.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < -140737488355329 ORDER BY t1.a DESC - } -} {64 55 2} -do_test boundary3-2.6.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=21 - ORDER BY t1.rowid - } -} {55 2 64} -do_test boundary3-2.6.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=21 - ORDER BY t1.rowid DESC - } -} {64 2 55} -do_test boundary3-2.6.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=21 - ORDER BY x - } -} {55 2 64} -do_test boundary3-2.6.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= -140737488355329 ORDER BY t2.a - } -} {2 21 55 64} -do_test boundary3-2.6.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= -140737488355329 ORDER BY t1.a DESC - } -} {64 55 21 2} -do_test boundary3-2.6.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=21 - ORDER BY t1.rowid - } -} {55 2 64 21} -do_test boundary3-2.6.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=21 - ORDER BY t1.rowid DESC - } -} {21 64 2 55} -do_test boundary3-2.6.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=21 - ORDER BY x - } -} {55 2 64 21} -do_test boundary3-2.7.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=2 AND t2.a=t1.a - } -} {41 0000000000000002} -do_test boundary3-2.7.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='0000000000000002' - } -} {2 41} -do_test boundary3-2.7.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=41 - } -} {2 0000000000000002} -do_test boundary3-2.7.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 2 ORDER BY t2.a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary3-2.7.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 2 ORDER BY t1.a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary3-2.7.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=41 - ORDER BY t1.rowid - } -} {5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.7.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=41 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5} -do_test boundary3-2.7.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=41 - ORDER BY x - } -} {5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.7.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=41 - ORDER BY t1.rowid - } -} {5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.7.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=41 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5} -do_test boundary3-2.7.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 2 ORDER BY t2.a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 41 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary3-2.7.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 2 ORDER BY t1.a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 41 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary3-2.7.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=41 - ORDER BY t1.rowid - } -} {41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.7.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=41 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41} -do_test boundary3-2.7.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=41 - ORDER BY x - } -} {41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.7.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=41 - ORDER BY t1.rowid - } -} {41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.7.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=41 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41} -do_test boundary3-2.7.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 2 ORDER BY t2.a - } -} {1 2 11 21 29 32 33 37 38 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary3-2.7.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 2 ORDER BY t1.a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 38 37 33 32 29 21 11 2 1} -do_test boundary3-2.7.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=41 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60} -do_test boundary3-2.7.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=41 - ORDER BY t1.rowid DESC - } -} {60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.7.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=41 - ORDER BY x - } -} {59 60 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.7.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=41 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60} -do_test boundary3-2.7.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=41 - ORDER BY t1.rowid DESC - } -} {60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.7.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 2 ORDER BY t2.a - } -} {1 2 11 21 29 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary3-2.7.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 2 ORDER BY t1.a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 29 21 11 2 1} -do_test boundary3-2.7.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=41 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41} -do_test boundary3-2.7.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=41 - ORDER BY t1.rowid DESC - } -} {41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.7.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=41 - ORDER BY x - } -} {59 60 41 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.7.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=41 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41} -do_test boundary3-2.7.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=41 - ORDER BY t1.rowid DESC - } -} {41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.8.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=4 AND t2.a=t1.a - } -} {31 0000000000000004} -do_test boundary3-2.8.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='0000000000000004' - } -} {4 31} -do_test boundary3-2.8.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=31 - } -} {4 0000000000000004} -do_test boundary3-2.8.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 4 ORDER BY t2.a - } -} {3 4 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary3-2.8.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 4 ORDER BY t1.a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 4 3} -do_test boundary3-2.8.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=31 - ORDER BY t1.rowid - } -} {4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.8.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=31 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4} -do_test boundary3-2.8.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=31 - ORDER BY x - } -} {4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.8.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=31 - ORDER BY t1.rowid - } -} {4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.8.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=31 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4} -do_test boundary3-2.8.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 4 ORDER BY t2.a - } -} {3 4 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary3-2.8.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 4 ORDER BY t1.a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 4 3} -do_test boundary3-2.8.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=31 - ORDER BY t1.rowid - } -} {31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.8.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=31 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31} -do_test boundary3-2.8.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=31 - ORDER BY x - } -} {31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.8.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=31 - ORDER BY t1.rowid - } -} {31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.8.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=31 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31} -do_test boundary3-2.8.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 4 ORDER BY t2.a - } -} {1 2 5 11 21 29 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary3-2.8.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 4 ORDER BY t1.a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 29 21 11 5 2 1} -do_test boundary3-2.8.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=31 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5} -do_test boundary3-2.8.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=31 - ORDER BY t1.rowid DESC - } -} {5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.8.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=31 - ORDER BY x - } -} {59 60 41 5 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.8.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=31 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5} -do_test boundary3-2.8.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=31 - ORDER BY t1.rowid DESC - } -} {5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.8.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 4 ORDER BY t2.a - } -} {1 2 5 11 21 29 31 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary3-2.8.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 4 ORDER BY t1.a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 31 29 21 11 5 2 1} -do_test boundary3-2.8.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=31 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31} -do_test boundary3-2.8.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=31 - ORDER BY t1.rowid DESC - } -} {31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.8.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=31 - ORDER BY x - } -} {59 60 41 5 31 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.8.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=31 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31} -do_test boundary3-2.8.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=31 - ORDER BY t1.rowid DESC - } -} {31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.9.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=562949953421311 AND t2.a=t1.a - } -} {13 0001ffffffffffff} -do_test boundary3-2.9.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='0001ffffffffffff' - } -} {562949953421311 13} -do_test boundary3-2.9.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=13 - } -} {562949953421311 0001ffffffffffff} -do_test boundary3-2.9.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 562949953421311 ORDER BY t2.a - } -} {3 17 27 28 43 45} -do_test boundary3-2.9.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 562949953421311 ORDER BY t1.a DESC - } -} {45 43 28 27 17 3} -do_test boundary3-2.9.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=13 - ORDER BY t1.rowid - } -} {43 27 45 17 28 3} -do_test boundary3-2.9.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=13 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43} -do_test boundary3-2.9.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=13 - ORDER BY x - } -} {43 27 45 17 28 3} -do_test boundary3-2.9.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 562949953421311 ORDER BY t2.a - } -} {3 13 17 27 28 43 45} -do_test boundary3-2.9.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 562949953421311 ORDER BY t1.a DESC - } -} {45 43 28 27 17 13 3} -do_test boundary3-2.9.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=13 - ORDER BY t1.rowid - } -} {13 43 27 45 17 28 3} -do_test boundary3-2.9.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=13 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13} -do_test boundary3-2.9.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=13 - ORDER BY x - } -} {13 43 27 45 17 28 3} -do_test boundary3-2.9.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 562949953421311 ORDER BY t2.a - } -} {1 2 4 5 6 7 8 9 10 11 12 14 15 16 18 19 20 21 22 23 24 25 26 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.9.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 562949953421311 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 26 25 24 23 22 21 20 19 18 16 15 14 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary3-2.9.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=13 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26} -do_test boundary3-2.9.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=13 - ORDER BY t1.rowid DESC - } -} {26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.9.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=13 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.9.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 562949953421311 ORDER BY t2.a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.9.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 562949953421311 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary3-2.9.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=13 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13} -do_test boundary3-2.9.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=13 - ORDER BY t1.rowid DESC - } -} {13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.9.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=13 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.10.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=256 AND t2.a=t1.a - } -} {61 0000000000000100} -do_test boundary3-2.10.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='0000000000000100' - } -} {256 61} -do_test boundary3-2.10.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=61 - } -} {256 0000000000000100} -do_test boundary3-2.10.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 256 ORDER BY t2.a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary3-2.10.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 256 ORDER BY t1.a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary3-2.10.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=61 - ORDER BY t1.rowid - } -} {8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.10.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=61 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8} -do_test boundary3-2.10.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=61 - ORDER BY x - } -} {8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.10.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=61 - ORDER BY t1.rowid - } -} {8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.10.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=61 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8} -do_test boundary3-2.10.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 256 ORDER BY t2.a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 61 62} -do_test boundary3-2.10.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 256 ORDER BY t1.a DESC - } -} {62 61 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary3-2.10.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=61 - ORDER BY t1.rowid - } -} {61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.10.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=61 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61} -do_test boundary3-2.10.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=61 - ORDER BY x - } -} {61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.10.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=61 - ORDER BY t1.rowid - } -} {61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.10.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=61 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61} -do_test boundary3-2.10.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 256 ORDER BY t2.a - } -} {1 2 4 5 11 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 63 64} -do_test boundary3-2.10.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 256 ORDER BY t1.a DESC - } -} {64 63 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 11 5 4 2 1} -do_test boundary3-2.10.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=61 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30} -do_test boundary3-2.10.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=61 - ORDER BY t1.rowid DESC - } -} {30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.10.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=61 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.10.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=61 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30} -do_test boundary3-2.10.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=61 - ORDER BY t1.rowid DESC - } -} {30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.10.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 256 ORDER BY t2.a - } -} {1 2 4 5 11 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary3-2.10.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 256 ORDER BY t1.a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 11 5 4 2 1} -do_test boundary3-2.10.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=61 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61} -do_test boundary3-2.10.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=61 - ORDER BY t1.rowid DESC - } -} {61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.10.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=61 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.10.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=61 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61} -do_test boundary3-2.10.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=61 - ORDER BY t1.rowid DESC - } -} {61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.11.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=34359738368 AND t2.a=t1.a - } -} {22 0000000800000000} -do_test boundary3-2.11.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='0000000800000000' - } -} {34359738368 22} -do_test boundary3-2.11.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=22 - } -} {34359738368 0000000800000000} -do_test boundary3-2.11.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 34359738368 ORDER BY t2.a - } -} {3 7 10 13 17 19 25 26 27 28 34 35 43 45 46 56 57} -do_test boundary3-2.11.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 34359738368 ORDER BY t1.a DESC - } -} {57 56 46 45 43 35 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary3-2.11.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=22 - ORDER BY t1.rowid - } -} {46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.11.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=22 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46} -do_test boundary3-2.11.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=22 - ORDER BY x - } -} {46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.11.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=22 - ORDER BY t1.rowid - } -} {46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.11.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=22 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46} -do_test boundary3-2.11.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 34359738368 ORDER BY t2.a - } -} {3 7 10 13 17 19 22 25 26 27 28 34 35 43 45 46 56 57} -do_test boundary3-2.11.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 34359738368 ORDER BY t1.a DESC - } -} {57 56 46 45 43 35 34 28 27 26 25 22 19 17 13 10 7 3} -do_test boundary3-2.11.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=22 - ORDER BY t1.rowid - } -} {22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.11.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=22 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22} -do_test boundary3-2.11.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=22 - ORDER BY x - } -} {22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.11.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=22 - ORDER BY t1.rowid - } -} {22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.11.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=22 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22} -do_test boundary3-2.11.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 34359738368 ORDER BY t2.a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 23 24 29 30 31 32 33 36 37 38 39 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.11.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 34359738368 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 39 38 37 36 33 32 31 30 29 24 23 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary3-2.11.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=22 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39} -do_test boundary3-2.11.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=22 - ORDER BY t1.rowid DESC - } -} {39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.11.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=22 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.11.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=22 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39} -do_test boundary3-2.11.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=22 - ORDER BY t1.rowid DESC - } -} {39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.11.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 34359738368 ORDER BY t2.a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 36 37 38 39 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.11.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 34359738368 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 39 38 37 36 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary3-2.11.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=22 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22} -do_test boundary3-2.11.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=22 - ORDER BY t1.rowid DESC - } -} {22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.11.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=22 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.11.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=22 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22} -do_test boundary3-2.11.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=22 - ORDER BY t1.rowid DESC - } -} {22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.12.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=65536 AND t2.a=t1.a - } -} {62 0000000000010000} -do_test boundary3-2.12.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='0000000000010000' - } -} {65536 62} -do_test boundary3-2.12.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=62 - } -} {65536 0000000000010000} -do_test boundary3-2.12.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 65536 ORDER BY t2.a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 51 56 57} -do_test boundary3-2.12.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 65536 ORDER BY t1.a DESC - } -} {57 56 51 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary3-2.12.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=62 - ORDER BY t1.rowid - } -} {15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.12.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=62 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15} -do_test boundary3-2.12.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=62 - ORDER BY x - } -} {15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.12.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=62 - ORDER BY t1.rowid - } -} {15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.12.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=62 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15} -do_test boundary3-2.12.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 65536 ORDER BY t2.a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 51 56 57 62} -do_test boundary3-2.12.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 65536 ORDER BY t1.a DESC - } -} {62 57 56 51 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary3-2.12.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=62 - ORDER BY t1.rowid - } -} {62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.12.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=62 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62} -do_test boundary3-2.12.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=62 - ORDER BY x - } -} {62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.12.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=62 - ORDER BY t1.rowid - } -} {62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.12.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=62 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62} -do_test boundary3-2.12.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 65536 ORDER BY t2.a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 48 49 50 52 53 54 55 58 59 60 61 63 64} -do_test boundary3-2.12.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 65536 ORDER BY t1.a DESC - } -} {64 63 61 60 59 58 55 54 53 52 50 49 48 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary3-2.12.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=62 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48} -do_test boundary3-2.12.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=62 - ORDER BY t1.rowid DESC - } -} {48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.12.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=62 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.12.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=62 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48} -do_test boundary3-2.12.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=62 - ORDER BY t1.rowid DESC - } -} {48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.12.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 65536 ORDER BY t2.a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.12.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 65536 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary3-2.12.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=62 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62} -do_test boundary3-2.12.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=62 - ORDER BY t1.rowid DESC - } -} {62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.12.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=62 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.12.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=62 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62} -do_test boundary3-2.12.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=62 - ORDER BY t1.rowid DESC - } -} {62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.13.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=268435456 AND t2.a=t1.a - } -} {40 0000000010000000} -do_test boundary3-2.13.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='0000000010000000' - } -} {268435456 40} -do_test boundary3-2.13.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=40 - } -} {268435456 0000000010000000} -do_test boundary3-2.13.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 268435456 ORDER BY t2.a - } -} {3 7 10 13 14 17 19 20 22 25 26 27 28 34 35 36 39 43 45 46 51 56 57} -do_test boundary3-2.13.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 268435456 ORDER BY t1.a DESC - } -} {57 56 51 46 45 43 39 36 35 34 28 27 26 25 22 20 19 17 14 13 10 7 3} -do_test boundary3-2.13.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=40 - ORDER BY t1.rowid - } -} {20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.13.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=40 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20} -do_test boundary3-2.13.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=40 - ORDER BY x - } -} {20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.13.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=40 - ORDER BY t1.rowid - } -} {20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.13.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=40 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20} -do_test boundary3-2.13.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 268435456 ORDER BY t2.a - } -} {3 7 10 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary3-2.13.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 268435456 ORDER BY t1.a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 10 7 3} -do_test boundary3-2.13.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=40 - ORDER BY t1.rowid - } -} {40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.13.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=40 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40} -do_test boundary3-2.13.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=40 - ORDER BY x - } -} {40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.13.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=40 - ORDER BY t1.rowid - } -} {40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.13.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=40 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40} -do_test boundary3-2.13.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 268435456 ORDER BY t2.a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.13.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 268435456 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary3-2.13.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=40 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12} -do_test boundary3-2.13.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=40 - ORDER BY t1.rowid DESC - } -} {12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.13.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=40 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.13.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=40 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12} -do_test boundary3-2.13.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=40 - ORDER BY t1.rowid DESC - } -} {12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.13.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 268435456 ORDER BY t2.a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.13.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 268435456 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary3-2.13.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=40 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40} -do_test boundary3-2.13.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=40 - ORDER BY t1.rowid DESC - } -} {40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.13.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=40 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.13.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=40 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40} -do_test boundary3-2.13.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=40 - ORDER BY t1.rowid DESC - } -} {40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.14.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=-140737488355328 AND t2.a=t1.a - } -} {44 ffff800000000000} -do_test boundary3-2.14.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='ffff800000000000' - } -} {-140737488355328 44} -do_test boundary3-2.14.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=44 - } -} {-140737488355328 ffff800000000000} -do_test boundary3-2.14.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > -140737488355328 ORDER BY t2.a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63} -do_test boundary3-2.14.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > -140737488355328 ORDER BY t1.a DESC - } -} {63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary3-2.14.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=44 - ORDER BY t1.rowid - } -} {58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.14.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=44 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58} -do_test boundary3-2.14.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=44 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.14.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= -140737488355328 ORDER BY t2.a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63} -do_test boundary3-2.14.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= -140737488355328 ORDER BY t1.a DESC - } -} {63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary3-2.14.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=44 - ORDER BY t1.rowid - } -} {44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.14.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=44 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44} -do_test boundary3-2.14.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=44 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.14.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < -140737488355328 ORDER BY t2.a - } -} {2 21 55 64} -do_test boundary3-2.14.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < -140737488355328 ORDER BY t1.a DESC - } -} {64 55 21 2} -do_test boundary3-2.14.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=44 - ORDER BY t1.rowid - } -} {55 2 64 21} -do_test boundary3-2.14.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=44 - ORDER BY t1.rowid DESC - } -} {21 64 2 55} -do_test boundary3-2.14.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=44 - ORDER BY x - } -} {55 2 64 21} -do_test boundary3-2.14.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= -140737488355328 ORDER BY t2.a - } -} {2 21 44 55 64} -do_test boundary3-2.14.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= -140737488355328 ORDER BY t1.a DESC - } -} {64 55 44 21 2} -do_test boundary3-2.14.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=44 - ORDER BY t1.rowid - } -} {55 2 64 21 44} -do_test boundary3-2.14.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=44 - ORDER BY t1.rowid DESC - } -} {44 21 64 2 55} -do_test boundary3-2.14.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=44 - ORDER BY x - } -} {55 2 64 21 44} -do_test boundary3-2.15.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=1099511627776 AND t2.a=t1.a - } -} {19 0000010000000000} -do_test boundary3-2.15.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='0000010000000000' - } -} {1099511627776 19} -do_test boundary3-2.15.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=19 - } -} {1099511627776 0000010000000000} -do_test boundary3-2.15.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 1099511627776 ORDER BY t2.a - } -} {3 7 10 13 17 25 26 27 28 34 43 45 56} -do_test boundary3-2.15.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 1099511627776 ORDER BY t1.a DESC - } -} {56 45 43 34 28 27 26 25 17 13 10 7 3} -do_test boundary3-2.15.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=19 - ORDER BY t1.rowid - } -} {7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.15.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=19 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7} -do_test boundary3-2.15.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=19 - ORDER BY x - } -} {7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.15.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=19 - ORDER BY t1.rowid - } -} {7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.15.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=19 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7} -do_test boundary3-2.15.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 1099511627776 ORDER BY t2.a - } -} {3 7 10 13 17 19 25 26 27 28 34 43 45 56} -do_test boundary3-2.15.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 1099511627776 ORDER BY t1.a DESC - } -} {56 45 43 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary3-2.15.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=19 - ORDER BY t1.rowid - } -} {19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.15.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=19 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19} -do_test boundary3-2.15.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=19 - ORDER BY x - } -} {19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.15.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=19 - ORDER BY t1.rowid - } -} {19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.15.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=19 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19} -do_test boundary3-2.15.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 1099511627776 ORDER BY t2.a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 57 58 59 60 61 62 63 64} -do_test boundary3-2.15.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 1099511627776 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary3-2.15.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=19 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57} -do_test boundary3-2.15.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=19 - ORDER BY t1.rowid DESC - } -} {57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.15.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=19 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.15.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=19 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57} -do_test boundary3-2.15.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=19 - ORDER BY t1.rowid DESC - } -} {57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.15.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 1099511627776 ORDER BY t2.a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 19 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 57 58 59 60 61 62 63 64} -do_test boundary3-2.15.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 1099511627776 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 19 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary3-2.15.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=19 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19} -do_test boundary3-2.15.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=19 - ORDER BY t1.rowid DESC - } -} {19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.15.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=19 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.15.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=19 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19} -do_test boundary3-2.15.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=19 - ORDER BY t1.rowid DESC - } -} {19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.16.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 9223372036854775807 ORDER BY t2.a - } -} {} -do_test boundary3-2.16.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 9223372036854775807 ORDER BY t1.a DESC - } -} {} -do_test boundary3-2.16.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=3 - ORDER BY t1.rowid - } -} {} -do_test boundary3-2.16.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=3 - ORDER BY t1.rowid DESC - } -} {} -do_test boundary3-2.16.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=3 - ORDER BY x - } -} {} -do_test boundary3-2.16.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 9223372036854775807 ORDER BY t2.a - } -} {3} -do_test boundary3-2.16.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 9223372036854775807 ORDER BY t1.a DESC - } -} {3} -do_test boundary3-2.16.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=3 - ORDER BY t1.rowid - } -} {3} -do_test boundary3-2.16.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=3 - ORDER BY t1.rowid DESC - } -} {3} -do_test boundary3-2.16.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=3 - ORDER BY x - } -} {3} -do_test boundary3-2.16.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 9223372036854775807 ORDER BY t2.a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.16.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 9223372036854775807 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary3-2.16.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=3 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28} -do_test boundary3-2.16.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=3 - ORDER BY t1.rowid DESC - } -} {28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.16.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=3 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.16.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 9223372036854775807 ORDER BY t2.a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.16.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 9223372036854775807 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary3-2.16.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=3 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.16.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=3 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.16.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=3 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.17.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=32768 AND t2.a=t1.a - } -} {50 0000000000008000} -do_test boundary3-2.17.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='0000000000008000' - } -} {32768 50} -do_test boundary3-2.17.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=50 - } -} {32768 0000000000008000} -do_test boundary3-2.17.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 32768 ORDER BY t2.a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 51 56 57 62} -do_test boundary3-2.17.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 32768 ORDER BY t1.a DESC - } -} {62 57 56 51 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary3-2.17.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=50 - ORDER BY t1.rowid - } -} {48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.17.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=50 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48} -do_test boundary3-2.17.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=50 - ORDER BY x - } -} {48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.17.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=50 - ORDER BY t1.rowid - } -} {48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.17.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=50 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48} -do_test boundary3-2.17.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 32768 ORDER BY t2.a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary3-2.17.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 32768 ORDER BY t1.a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary3-2.17.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=50 - ORDER BY t1.rowid - } -} {50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.17.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=50 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50} -do_test boundary3-2.17.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=50 - ORDER BY x - } -} {50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.17.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=50 - ORDER BY t1.rowid - } -} {50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.17.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=50 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50} -do_test boundary3-2.17.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 32768 ORDER BY t2.a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary3-2.17.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 32768 ORDER BY t1.a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary3-2.17.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=50 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23} -do_test boundary3-2.17.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=50 - ORDER BY t1.rowid DESC - } -} {23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.17.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=50 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.17.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=50 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23} -do_test boundary3-2.17.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=50 - ORDER BY t1.rowid DESC - } -} {23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.17.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 32768 ORDER BY t2.a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 49 50 52 53 54 55 58 59 60 61 63 64} -do_test boundary3-2.17.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 32768 ORDER BY t1.a DESC - } -} {64 63 61 60 59 58 55 54 53 52 50 49 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary3-2.17.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=50 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50} -do_test boundary3-2.17.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=50 - ORDER BY t1.rowid DESC - } -} {50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.17.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=50 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.17.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=50 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50} -do_test boundary3-2.17.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=50 - ORDER BY t1.rowid DESC - } -} {50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.18.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=-36028797018963968 AND t2.a=t1.a - } -} {64 ff80000000000000} -do_test boundary3-2.18.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='ff80000000000000' - } -} {-36028797018963968 64} -do_test boundary3-2.18.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=64 - } -} {-36028797018963968 ff80000000000000} -do_test boundary3-2.18.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > -36028797018963968 ORDER BY t2.a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63} -do_test boundary3-2.18.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > -36028797018963968 ORDER BY t1.a DESC - } -} {63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary3-2.18.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=64 - ORDER BY t1.rowid - } -} {21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.18.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=64 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21} -do_test boundary3-2.18.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=64 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.18.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= -36028797018963968 ORDER BY t2.a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.18.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= -36028797018963968 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary3-2.18.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=64 - ORDER BY t1.rowid - } -} {64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.18.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=64 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64} -do_test boundary3-2.18.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=64 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.18.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < -36028797018963968 ORDER BY t2.a - } -} {2 55} -do_test boundary3-2.18.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < -36028797018963968 ORDER BY t1.a DESC - } -} {55 2} -do_test boundary3-2.18.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=64 - ORDER BY t1.rowid - } -} {55 2} -do_test boundary3-2.18.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=64 - ORDER BY t1.rowid DESC - } -} {2 55} -do_test boundary3-2.18.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=64 - ORDER BY x - } -} {55 2} -do_test boundary3-2.18.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= -36028797018963968 ORDER BY t2.a - } -} {2 55 64} -do_test boundary3-2.18.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= -36028797018963968 ORDER BY t1.a DESC - } -} {64 55 2} -do_test boundary3-2.18.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=64 - ORDER BY t1.rowid - } -} {55 2 64} -do_test boundary3-2.18.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=64 - ORDER BY t1.rowid DESC - } -} {64 2 55} -do_test boundary3-2.18.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=64 - ORDER BY x - } -} {55 2 64} -do_test boundary3-2.19.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=65535 AND t2.a=t1.a - } -} {48 000000000000ffff} -do_test boundary3-2.19.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='000000000000ffff' - } -} {65535 48} -do_test boundary3-2.19.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=48 - } -} {65535 000000000000ffff} -do_test boundary3-2.19.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 65535 ORDER BY t2.a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 51 56 57 62} -do_test boundary3-2.19.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 65535 ORDER BY t1.a DESC - } -} {62 57 56 51 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary3-2.19.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=48 - ORDER BY t1.rowid - } -} {62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.19.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=48 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62} -do_test boundary3-2.19.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=48 - ORDER BY x - } -} {62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.19.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=48 - ORDER BY t1.rowid - } -} {62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.19.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=48 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62} -do_test boundary3-2.19.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 65535 ORDER BY t2.a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 51 56 57 62} -do_test boundary3-2.19.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 65535 ORDER BY t1.a DESC - } -} {62 57 56 51 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary3-2.19.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=48 - ORDER BY t1.rowid - } -} {48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.19.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=48 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48} -do_test boundary3-2.19.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=48 - ORDER BY x - } -} {48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.19.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=48 - ORDER BY t1.rowid - } -} {48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.19.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=48 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48} -do_test boundary3-2.19.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 65535 ORDER BY t2.a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 49 50 52 53 54 55 58 59 60 61 63 64} -do_test boundary3-2.19.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 65535 ORDER BY t1.a DESC - } -} {64 63 61 60 59 58 55 54 53 52 50 49 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary3-2.19.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=48 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50} -do_test boundary3-2.19.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=48 - ORDER BY t1.rowid DESC - } -} {50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.19.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=48 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.19.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=48 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50} -do_test boundary3-2.19.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=48 - ORDER BY t1.rowid DESC - } -} {50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.19.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 65535 ORDER BY t2.a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 48 49 50 52 53 54 55 58 59 60 61 63 64} -do_test boundary3-2.19.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 65535 ORDER BY t1.a DESC - } -} {64 63 61 60 59 58 55 54 53 52 50 49 48 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary3-2.19.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=48 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48} -do_test boundary3-2.19.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=48 - ORDER BY t1.rowid DESC - } -} {48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.19.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=48 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.19.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=48 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48} -do_test boundary3-2.19.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=48 - ORDER BY t1.rowid DESC - } -} {48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.20.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=4294967295 AND t2.a=t1.a - } -} {14 00000000ffffffff} -do_test boundary3-2.20.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='00000000ffffffff' - } -} {4294967295 14} -do_test boundary3-2.20.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=14 - } -} {4294967295 00000000ffffffff} -do_test boundary3-2.20.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 4294967295 ORDER BY t2.a - } -} {3 7 10 13 17 19 22 25 26 27 28 34 35 36 39 43 45 46 56 57} -do_test boundary3-2.20.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 4294967295 ORDER BY t1.a DESC - } -} {57 56 46 45 43 39 36 35 34 28 27 26 25 22 19 17 13 10 7 3} -do_test boundary3-2.20.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=14 - ORDER BY t1.rowid - } -} {36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.20.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=14 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36} -do_test boundary3-2.20.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=14 - ORDER BY x - } -} {36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.20.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=14 - ORDER BY t1.rowid - } -} {36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.20.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=14 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36} -do_test boundary3-2.20.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 4294967295 ORDER BY t2.a - } -} {3 7 10 13 14 17 19 22 25 26 27 28 34 35 36 39 43 45 46 56 57} -do_test boundary3-2.20.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 4294967295 ORDER BY t1.a DESC - } -} {57 56 46 45 43 39 36 35 34 28 27 26 25 22 19 17 14 13 10 7 3} -do_test boundary3-2.20.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=14 - ORDER BY t1.rowid - } -} {14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.20.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=14 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14} -do_test boundary3-2.20.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=14 - ORDER BY x - } -} {14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.20.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=14 - ORDER BY t1.rowid - } -} {14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.20.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=14 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14} -do_test boundary3-2.20.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 4294967295 ORDER BY t2.a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 20 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.20.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 4294967295 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 20 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary3-2.20.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=14 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51} -do_test boundary3-2.20.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=14 - ORDER BY t1.rowid DESC - } -} {51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.20.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=14 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.20.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=14 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51} -do_test boundary3-2.20.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=14 - ORDER BY t1.rowid DESC - } -} {51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.20.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 4294967295 ORDER BY t2.a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.20.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 4294967295 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary3-2.20.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=14 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14} -do_test boundary3-2.20.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=14 - ORDER BY t1.rowid DESC - } -} {14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.20.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=14 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.20.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=14 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14} -do_test boundary3-2.20.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=14 - ORDER BY t1.rowid DESC - } -} {14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.21.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=1099511627775 AND t2.a=t1.a - } -} {57 000000ffffffffff} -do_test boundary3-2.21.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='000000ffffffffff' - } -} {1099511627775 57} -do_test boundary3-2.21.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=57 - } -} {1099511627775 000000ffffffffff} -do_test boundary3-2.21.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 1099511627775 ORDER BY t2.a - } -} {3 7 10 13 17 19 25 26 27 28 34 43 45 56} -do_test boundary3-2.21.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 1099511627775 ORDER BY t1.a DESC - } -} {56 45 43 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary3-2.21.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=57 - ORDER BY t1.rowid - } -} {19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.21.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=57 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19} -do_test boundary3-2.21.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=57 - ORDER BY x - } -} {19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.21.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=57 - ORDER BY t1.rowid - } -} {19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.21.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=57 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19} -do_test boundary3-2.21.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 1099511627775 ORDER BY t2.a - } -} {3 7 10 13 17 19 25 26 27 28 34 43 45 56 57} -do_test boundary3-2.21.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 1099511627775 ORDER BY t1.a DESC - } -} {57 56 45 43 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary3-2.21.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=57 - ORDER BY t1.rowid - } -} {57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.21.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=57 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57} -do_test boundary3-2.21.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=57 - ORDER BY x - } -} {57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.21.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=57 - ORDER BY t1.rowid - } -} {57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.21.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=57 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57} -do_test boundary3-2.21.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 1099511627775 ORDER BY t2.a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.21.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 1099511627775 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary3-2.21.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=57 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35} -do_test boundary3-2.21.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=57 - ORDER BY t1.rowid DESC - } -} {35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.21.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=57 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.21.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=57 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35} -do_test boundary3-2.21.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=57 - ORDER BY t1.rowid DESC - } -} {35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.21.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 1099511627775 ORDER BY t2.a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 57 58 59 60 61 62 63 64} -do_test boundary3-2.21.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 1099511627775 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary3-2.21.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=57 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57} -do_test boundary3-2.21.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=57 - ORDER BY t1.rowid DESC - } -} {57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.21.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=57 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.21.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=57 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57} -do_test boundary3-2.21.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=57 - ORDER BY t1.rowid DESC - } -} {57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.22.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=-8388608 AND t2.a=t1.a - } -} {37 ffffffffff800000} -do_test boundary3-2.22.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='ffffffffff800000' - } -} {-8388608 37} -do_test boundary3-2.22.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=37 - } -} {-8388608 ffffffffff800000} -do_test boundary3-2.22.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > -8388608 ORDER BY t2.a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary3-2.22.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > -8388608 ORDER BY t1.a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary3-2.22.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=37 - ORDER BY t1.rowid - } -} {29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.22.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=37 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29} -do_test boundary3-2.22.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=37 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 29 32 54 53 52 33 38} -do_test boundary3-2.22.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=37 - ORDER BY t1.rowid - } -} {29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.22.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=37 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29} -do_test boundary3-2.22.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= -8388608 ORDER BY t2.a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary3-2.22.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= -8388608 ORDER BY t1.a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary3-2.22.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=37 - ORDER BY t1.rowid - } -} {37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.22.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=37 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37} -do_test boundary3-2.22.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=37 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 37 29 32 54 53 52 33 38} -do_test boundary3-2.22.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=37 - ORDER BY t1.rowid - } -} {37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.22.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=37 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37} -do_test boundary3-2.22.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < -8388608 ORDER BY t2.a - } -} {1 2 11 21 44 47 55 58 63 64} -do_test boundary3-2.22.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < -8388608 ORDER BY t1.a DESC - } -} {64 63 58 55 47 44 21 11 2 1} -do_test boundary3-2.22.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=37 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1} -do_test boundary3-2.22.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=37 - ORDER BY t1.rowid DESC - } -} {1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.22.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=37 - ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1} -do_test boundary3-2.22.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=37 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1} -do_test boundary3-2.22.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=37 - ORDER BY t1.rowid DESC - } -} {1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.22.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= -8388608 ORDER BY t2.a - } -} {1 2 11 21 37 44 47 55 58 63 64} -do_test boundary3-2.22.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= -8388608 ORDER BY t1.a DESC - } -} {64 63 58 55 47 44 37 21 11 2 1} -do_test boundary3-2.22.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=37 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37} -do_test boundary3-2.22.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=37 - ORDER BY t1.rowid DESC - } -} {37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.22.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=37 - ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37} -do_test boundary3-2.22.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=37 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37} -do_test boundary3-2.22.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=37 - ORDER BY t1.rowid DESC - } -} {37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.23.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=549755813888 AND t2.a=t1.a - } -} {35 0000008000000000} -do_test boundary3-2.23.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='0000008000000000' - } -} {549755813888 35} -do_test boundary3-2.23.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=35 - } -} {549755813888 0000008000000000} -do_test boundary3-2.23.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 549755813888 ORDER BY t2.a - } -} {3 7 10 13 17 19 25 26 27 28 34 43 45 56 57} -do_test boundary3-2.23.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 549755813888 ORDER BY t1.a DESC - } -} {57 56 45 43 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary3-2.23.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=35 - ORDER BY t1.rowid - } -} {57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.23.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=35 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57} -do_test boundary3-2.23.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=35 - ORDER BY x - } -} {57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.23.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=35 - ORDER BY t1.rowid - } -} {57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.23.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=35 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57} -do_test boundary3-2.23.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 549755813888 ORDER BY t2.a - } -} {3 7 10 13 17 19 25 26 27 28 34 35 43 45 56 57} -do_test boundary3-2.23.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 549755813888 ORDER BY t1.a DESC - } -} {57 56 45 43 35 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary3-2.23.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=35 - ORDER BY t1.rowid - } -} {35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.23.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=35 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35} -do_test boundary3-2.23.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=35 - ORDER BY x - } -} {35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.23.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=35 - ORDER BY t1.rowid - } -} {35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.23.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=35 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35} -do_test boundary3-2.23.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 549755813888 ORDER BY t2.a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.23.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 549755813888 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary3-2.23.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=35 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46} -do_test boundary3-2.23.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=35 - ORDER BY t1.rowid DESC - } -} {46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.23.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=35 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.23.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=35 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46} -do_test boundary3-2.23.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=35 - ORDER BY t1.rowid DESC - } -} {46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.23.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 549755813888 ORDER BY t2.a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.23.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 549755813888 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary3-2.23.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=35 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35} -do_test boundary3-2.23.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=35 - ORDER BY t1.rowid DESC - } -} {35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.23.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=35 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.23.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=35 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35} -do_test boundary3-2.23.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=35 - ORDER BY t1.rowid DESC - } -} {35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.24.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=8388607 AND t2.a=t1.a - } -} {18 00000000007fffff} -do_test boundary3-2.24.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='00000000007fffff' - } -} {8388607 18} -do_test boundary3-2.24.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=18 - } -} {8388607 00000000007fffff} -do_test boundary3-2.24.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 8388607 ORDER BY t2.a - } -} {3 6 7 9 10 12 13 14 17 19 20 22 24 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary3-2.24.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 8388607 ORDER BY t1.a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 24 22 20 19 17 14 13 12 10 9 7 6 3} -do_test boundary3-2.24.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=18 - ORDER BY t1.rowid - } -} {24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.24.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=18 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24} -do_test boundary3-2.24.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=18 - ORDER BY x - } -} {24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.24.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=18 - ORDER BY t1.rowid - } -} {24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.24.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=18 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24} -do_test boundary3-2.24.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 8388607 ORDER BY t2.a - } -} {3 6 7 9 10 12 13 14 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary3-2.24.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 8388607 ORDER BY t1.a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 14 13 12 10 9 7 6 3} -do_test boundary3-2.24.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=18 - ORDER BY t1.rowid - } -} {18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.24.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=18 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18} -do_test boundary3-2.24.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=18 - ORDER BY x - } -} {18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.24.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=18 - ORDER BY t1.rowid - } -} {18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.24.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=18 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18} -do_test boundary3-2.24.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 8388607 ORDER BY t2.a - } -} {1 2 4 5 8 11 15 16 21 23 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.24.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 8388607 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 23 21 16 15 11 8 5 4 2 1} -do_test boundary3-2.24.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=18 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42} -do_test boundary3-2.24.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=18 - ORDER BY t1.rowid DESC - } -} {42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.24.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=18 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.24.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=18 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42} -do_test boundary3-2.24.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=18 - ORDER BY t1.rowid DESC - } -} {42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.24.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 8388607 ORDER BY t2.a - } -} {1 2 4 5 8 11 15 16 18 21 23 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.24.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 8388607 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 23 21 18 16 15 11 8 5 4 2 1} -do_test boundary3-2.24.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=18 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18} -do_test boundary3-2.24.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=18 - ORDER BY t1.rowid DESC - } -} {18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.24.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=18 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.24.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=18 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18} -do_test boundary3-2.24.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=18 - ORDER BY t1.rowid DESC - } -} {18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.25.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=-3 AND t2.a=t1.a - } -} {52 fffffffffffffffd} -do_test boundary3-2.25.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='fffffffffffffffd' - } -} {-3 52} -do_test boundary3-2.25.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=52 - } -} {-3 fffffffffffffffd} -do_test boundary3-2.25.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > -3 ORDER BY t2.a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 56 57 59 60 61 62} -do_test boundary3-2.25.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > -3 ORDER BY t1.a DESC - } -} {62 61 60 59 57 56 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary3-2.25.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=52 - ORDER BY t1.rowid - } -} {33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.25.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=52 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33} -do_test boundary3-2.25.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=52 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 33 38} -do_test boundary3-2.25.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=52 - ORDER BY t1.rowid - } -} {33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.25.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=52 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33} -do_test boundary3-2.25.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= -3 ORDER BY t2.a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 56 57 59 60 61 62} -do_test boundary3-2.25.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= -3 ORDER BY t1.a DESC - } -} {62 61 60 59 57 56 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary3-2.25.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=52 - ORDER BY t1.rowid - } -} {52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.25.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=52 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52} -do_test boundary3-2.25.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=52 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 52 33 38} -do_test boundary3-2.25.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=52 - ORDER BY t1.rowid - } -} {52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.25.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=52 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52} -do_test boundary3-2.25.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < -3 ORDER BY t2.a - } -} {1 2 11 21 29 32 37 44 47 53 54 55 58 63 64} -do_test boundary3-2.25.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < -3 ORDER BY t1.a DESC - } -} {64 63 58 55 54 53 47 44 37 32 29 21 11 2 1} -do_test boundary3-2.25.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=52 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53} -do_test boundary3-2.25.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=52 - ORDER BY t1.rowid DESC - } -} {53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.25.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=52 - ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53} -do_test boundary3-2.25.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=52 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53} -do_test boundary3-2.25.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=52 - ORDER BY t1.rowid DESC - } -} {53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.25.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= -3 ORDER BY t2.a - } -} {1 2 11 21 29 32 37 44 47 52 53 54 55 58 63 64} -do_test boundary3-2.25.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= -3 ORDER BY t1.a DESC - } -} {64 63 58 55 54 53 52 47 44 37 32 29 21 11 2 1} -do_test boundary3-2.25.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=52 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52} -do_test boundary3-2.25.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=52 - ORDER BY t1.rowid DESC - } -} {52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.25.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=52 - ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52} -do_test boundary3-2.25.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=52 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52} -do_test boundary3-2.25.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=52 - ORDER BY t1.rowid DESC - } -} {52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.26.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=0 AND t2.a=t1.a - } -} {59 0000000000000000} -do_test boundary3-2.26.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='0000000000000000' - } -} {0 59} -do_test boundary3-2.26.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=59 - } -} {0 0000000000000000} -do_test boundary3-2.26.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 0 ORDER BY t2.a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 41 42 43 45 46 48 49 50 51 56 57 60 61 62} -do_test boundary3-2.26.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 0 ORDER BY t1.a DESC - } -} {62 61 60 57 56 51 50 49 48 46 45 43 42 41 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary3-2.26.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=59 - ORDER BY t1.rowid - } -} {60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.26.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=59 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60} -do_test boundary3-2.26.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=59 - ORDER BY x - } -} {60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.26.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=59 - ORDER BY t1.rowid - } -} {60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.26.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=59 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60} -do_test boundary3-2.26.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 0 ORDER BY t2.a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 41 42 43 45 46 48 49 50 51 56 57 59 60 61 62} -do_test boundary3-2.26.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 0 ORDER BY t1.a DESC - } -} {62 61 60 59 57 56 51 50 49 48 46 45 43 42 41 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary3-2.26.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=59 - ORDER BY t1.rowid - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.26.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=59 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59} -do_test boundary3-2.26.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=59 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.26.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=59 - ORDER BY t1.rowid - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.26.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=59 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59} -do_test boundary3-2.26.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 0 ORDER BY t2.a - } -} {1 2 11 21 29 32 33 37 38 44 47 52 53 54 55 58 63 64} -do_test boundary3-2.26.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 0 ORDER BY t1.a DESC - } -} {64 63 58 55 54 53 52 47 44 38 37 33 32 29 21 11 2 1} -do_test boundary3-2.26.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=59 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.26.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=59 - ORDER BY t1.rowid DESC - } -} {38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.26.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=59 - ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.26.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=59 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.26.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=59 - ORDER BY t1.rowid DESC - } -} {38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.26.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 0 ORDER BY t2.a - } -} {1 2 11 21 29 32 33 37 38 44 47 52 53 54 55 58 59 63 64} -do_test boundary3-2.26.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 0 ORDER BY t1.a DESC - } -} {64 63 59 58 55 54 53 52 47 44 38 37 33 32 29 21 11 2 1} -do_test boundary3-2.26.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=59 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59} -do_test boundary3-2.26.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=59 - ORDER BY t1.rowid DESC - } -} {59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.26.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=59 - ORDER BY x - } -} {59 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.26.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=59 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59} -do_test boundary3-2.26.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=59 - ORDER BY t1.rowid DESC - } -} {59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.27.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=-1 AND t2.a=t1.a - } -} {38 ffffffffffffffff} -do_test boundary3-2.27.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='ffffffffffffffff' - } -} {-1 38} -do_test boundary3-2.27.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=38 - } -} {-1 ffffffffffffffff} -do_test boundary3-2.27.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > -1 ORDER BY t2.a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 41 42 43 45 46 48 49 50 51 56 57 59 60 61 62} -do_test boundary3-2.27.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > -1 ORDER BY t1.a DESC - } -} {62 61 60 59 57 56 51 50 49 48 46 45 43 42 41 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary3-2.27.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=38 - ORDER BY t1.rowid - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.27.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=38 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59} -do_test boundary3-2.27.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=38 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.27.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=38 - ORDER BY t1.rowid - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.27.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=38 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59} -do_test boundary3-2.27.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= -1 ORDER BY t2.a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 56 57 59 60 61 62} -do_test boundary3-2.27.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= -1 ORDER BY t1.a DESC - } -} {62 61 60 59 57 56 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary3-2.27.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=38 - ORDER BY t1.rowid - } -} {38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.27.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=38 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38} -do_test boundary3-2.27.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=38 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 38} -do_test boundary3-2.27.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=38 - ORDER BY t1.rowid - } -} {38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.27.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=38 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38} -do_test boundary3-2.27.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < -1 ORDER BY t2.a - } -} {1 2 11 21 29 32 33 37 44 47 52 53 54 55 58 63 64} -do_test boundary3-2.27.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < -1 ORDER BY t1.a DESC - } -} {64 63 58 55 54 53 52 47 44 37 33 32 29 21 11 2 1} -do_test boundary3-2.27.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=38 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33} -do_test boundary3-2.27.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=38 - ORDER BY t1.rowid DESC - } -} {33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.27.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=38 - ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33} -do_test boundary3-2.27.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=38 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33} -do_test boundary3-2.27.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=38 - ORDER BY t1.rowid DESC - } -} {33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.27.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= -1 ORDER BY t2.a - } -} {1 2 11 21 29 32 33 37 38 44 47 52 53 54 55 58 63 64} -do_test boundary3-2.27.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= -1 ORDER BY t1.a DESC - } -} {64 63 58 55 54 53 52 47 44 38 37 33 32 29 21 11 2 1} -do_test boundary3-2.27.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=38 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.27.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=38 - ORDER BY t1.rowid DESC - } -} {38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.27.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=38 - ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.27.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=38 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.27.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=38 - ORDER BY t1.rowid DESC - } -} {38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.28.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=-2 AND t2.a=t1.a - } -} {33 fffffffffffffffe} -do_test boundary3-2.28.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='fffffffffffffffe' - } -} {-2 33} -do_test boundary3-2.28.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=33 - } -} {-2 fffffffffffffffe} -do_test boundary3-2.28.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > -2 ORDER BY t2.a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 56 57 59 60 61 62} -do_test boundary3-2.28.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > -2 ORDER BY t1.a DESC - } -} {62 61 60 59 57 56 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary3-2.28.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=33 - ORDER BY t1.rowid - } -} {38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.28.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=33 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38} -do_test boundary3-2.28.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=33 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 38} -do_test boundary3-2.28.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=33 - ORDER BY t1.rowid - } -} {38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.28.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=33 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38} -do_test boundary3-2.28.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= -2 ORDER BY t2.a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 56 57 59 60 61 62} -do_test boundary3-2.28.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= -2 ORDER BY t1.a DESC - } -} {62 61 60 59 57 56 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary3-2.28.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=33 - ORDER BY t1.rowid - } -} {33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.28.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=33 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33} -do_test boundary3-2.28.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=33 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 33 38} -do_test boundary3-2.28.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=33 - ORDER BY t1.rowid - } -} {33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.28.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=33 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33} -do_test boundary3-2.28.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < -2 ORDER BY t2.a - } -} {1 2 11 21 29 32 37 44 47 52 53 54 55 58 63 64} -do_test boundary3-2.28.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < -2 ORDER BY t1.a DESC - } -} {64 63 58 55 54 53 52 47 44 37 32 29 21 11 2 1} -do_test boundary3-2.28.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=33 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52} -do_test boundary3-2.28.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=33 - ORDER BY t1.rowid DESC - } -} {52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.28.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=33 - ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52} -do_test boundary3-2.28.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=33 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52} -do_test boundary3-2.28.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=33 - ORDER BY t1.rowid DESC - } -} {52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.28.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= -2 ORDER BY t2.a - } -} {1 2 11 21 29 32 33 37 44 47 52 53 54 55 58 63 64} -do_test boundary3-2.28.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= -2 ORDER BY t1.a DESC - } -} {64 63 58 55 54 53 52 47 44 37 33 32 29 21 11 2 1} -do_test boundary3-2.28.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=33 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33} -do_test boundary3-2.28.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=33 - ORDER BY t1.rowid DESC - } -} {33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.28.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=33 - ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33} -do_test boundary3-2.28.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=33 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33} -do_test boundary3-2.28.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=33 - ORDER BY t1.rowid DESC - } -} {33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.29.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=2097152 AND t2.a=t1.a - } -} {42 0000000000200000} -do_test boundary3-2.29.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='0000000000200000' - } -} {2097152 42} -do_test boundary3-2.29.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=42 - } -} {2097152 0000000000200000} -do_test boundary3-2.29.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 2097152 ORDER BY t2.a - } -} {3 6 7 9 10 12 13 14 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary3-2.29.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 2097152 ORDER BY t1.a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 14 13 12 10 9 7 6 3} -do_test boundary3-2.29.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=42 - ORDER BY t1.rowid - } -} {18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.29.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=42 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18} -do_test boundary3-2.29.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=42 - ORDER BY x - } -} {18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.29.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=42 - ORDER BY t1.rowid - } -} {18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.29.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=42 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18} -do_test boundary3-2.29.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 2097152 ORDER BY t2.a - } -} {3 6 7 9 10 12 13 14 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 51 56 57} -do_test boundary3-2.29.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 2097152 ORDER BY t1.a DESC - } -} {57 56 51 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 14 13 12 10 9 7 6 3} -do_test boundary3-2.29.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=42 - ORDER BY t1.rowid - } -} {42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.29.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=42 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42} -do_test boundary3-2.29.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=42 - ORDER BY x - } -} {42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.29.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=42 - ORDER BY t1.rowid - } -} {42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.29.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=42 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42} -do_test boundary3-2.29.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 2097152 ORDER BY t2.a - } -} {1 2 4 5 8 11 15 16 21 23 29 30 31 32 33 37 38 41 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.29.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 2097152 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 41 38 37 33 32 31 30 29 23 21 16 15 11 8 5 4 2 1} -do_test boundary3-2.29.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=42 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15} -do_test boundary3-2.29.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=42 - ORDER BY t1.rowid DESC - } -} {15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.29.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=42 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.29.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=42 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15} -do_test boundary3-2.29.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=42 - ORDER BY t1.rowid DESC - } -} {15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.29.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 2097152 ORDER BY t2.a - } -} {1 2 4 5 8 11 15 16 21 23 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.29.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 2097152 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 23 21 16 15 11 8 5 4 2 1} -do_test boundary3-2.29.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=42 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42} -do_test boundary3-2.29.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=42 - ORDER BY t1.rowid DESC - } -} {42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.29.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=42 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.29.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=42 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42} -do_test boundary3-2.29.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=42 - ORDER BY t1.rowid DESC - } -} {42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.30.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=128 AND t2.a=t1.a - } -} {49 0000000000000080} -do_test boundary3-2.30.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='0000000000000080' - } -} {128 49} -do_test boundary3-2.30.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=49 - } -} {128 0000000000000080} -do_test boundary3-2.30.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 128 ORDER BY t2.a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 34 35 36 39 40 42 43 45 46 48 50 51 56 57 61 62} -do_test boundary3-2.30.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 128 ORDER BY t1.a DESC - } -} {62 61 57 56 51 50 48 46 45 43 42 40 39 36 35 34 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary3-2.30.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=49 - ORDER BY t1.rowid - } -} {30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.30.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=49 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30} -do_test boundary3-2.30.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=49 - ORDER BY x - } -} {30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.30.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=49 - ORDER BY t1.rowid - } -} {30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.30.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=49 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30} -do_test boundary3-2.30.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 128 ORDER BY t2.a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary3-2.30.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 128 ORDER BY t1.a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary3-2.30.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=49 - ORDER BY t1.rowid - } -} {49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.30.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=49 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49} -do_test boundary3-2.30.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=49 - ORDER BY x - } -} {49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.30.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=49 - ORDER BY t1.rowid - } -} {49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.30.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=49 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49} -do_test boundary3-2.30.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 128 ORDER BY t2.a - } -} {1 2 4 5 11 21 29 31 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary3-2.30.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 128 ORDER BY t1.a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 31 29 21 11 5 4 2 1} -do_test boundary3-2.30.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=49 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4} -do_test boundary3-2.30.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=49 - ORDER BY t1.rowid DESC - } -} {4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.30.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=49 - ORDER BY x - } -} {59 60 41 5 31 4 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.30.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=49 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4} -do_test boundary3-2.30.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=49 - ORDER BY t1.rowid DESC - } -} {4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.30.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 128 ORDER BY t2.a - } -} {1 2 4 5 11 21 29 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 63 64} -do_test boundary3-2.30.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 128 ORDER BY t1.a DESC - } -} {64 63 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 29 21 11 5 4 2 1} -do_test boundary3-2.30.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=49 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49} -do_test boundary3-2.30.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=49 - ORDER BY t1.rowid DESC - } -} {49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.30.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=49 - ORDER BY x - } -} {59 60 41 5 31 4 49 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.30.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=49 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49} -do_test boundary3-2.30.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=49 - ORDER BY t1.rowid DESC - } -} {49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.31.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=255 AND t2.a=t1.a - } -} {30 00000000000000ff} -do_test boundary3-2.31.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='00000000000000ff' - } -} {255 30} -do_test boundary3-2.31.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=30 - } -} {255 00000000000000ff} -do_test boundary3-2.31.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 255 ORDER BY t2.a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 61 62} -do_test boundary3-2.31.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 255 ORDER BY t1.a DESC - } -} {62 61 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary3-2.31.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=30 - ORDER BY t1.rowid - } -} {61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.31.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=30 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61} -do_test boundary3-2.31.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=30 - ORDER BY x - } -} {61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.31.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=30 - ORDER BY t1.rowid - } -} {61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.31.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=30 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61} -do_test boundary3-2.31.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 255 ORDER BY t2.a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 34 35 36 39 40 42 43 45 46 48 50 51 56 57 61 62} -do_test boundary3-2.31.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 255 ORDER BY t1.a DESC - } -} {62 61 57 56 51 50 48 46 45 43 42 40 39 36 35 34 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary3-2.31.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=30 - ORDER BY t1.rowid - } -} {30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.31.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=30 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30} -do_test boundary3-2.31.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=30 - ORDER BY x - } -} {30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.31.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=30 - ORDER BY t1.rowid - } -} {30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.31.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=30 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30} -do_test boundary3-2.31.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 255 ORDER BY t2.a - } -} {1 2 4 5 11 21 29 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 63 64} -do_test boundary3-2.31.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 255 ORDER BY t1.a DESC - } -} {64 63 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 29 21 11 5 4 2 1} -do_test boundary3-2.31.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=30 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49} -do_test boundary3-2.31.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=30 - ORDER BY t1.rowid DESC - } -} {49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.31.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=30 - ORDER BY x - } -} {59 60 41 5 31 4 49 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.31.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=30 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49} -do_test boundary3-2.31.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=30 - ORDER BY t1.rowid DESC - } -} {49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.31.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 255 ORDER BY t2.a - } -} {1 2 4 5 11 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 63 64} -do_test boundary3-2.31.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 255 ORDER BY t1.a DESC - } -} {64 63 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 11 5 4 2 1} -do_test boundary3-2.31.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=30 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30} -do_test boundary3-2.31.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=30 - ORDER BY t1.rowid DESC - } -} {30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.31.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=30 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.31.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=30 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30} -do_test boundary3-2.31.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=30 - ORDER BY t1.rowid DESC - } -} {30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.32.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=-2147483648 AND t2.a=t1.a - } -} {11 ffffffff80000000} -do_test boundary3-2.32.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='ffffffff80000000' - } -} {-2147483648 11} -do_test boundary3-2.32.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=11 - } -} {-2147483648 ffffffff80000000} -do_test boundary3-2.32.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > -2147483648 ORDER BY t2.a - } -} {1 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary3-2.32.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > -2147483648 ORDER BY t1.a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3 1} -do_test boundary3-2.32.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=11 - ORDER BY t1.rowid - } -} {1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.32.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=11 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1} -do_test boundary3-2.32.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=11 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.32.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=11 - ORDER BY t1.rowid - } -} {1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.32.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=11 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1} -do_test boundary3-2.32.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= -2147483648 ORDER BY t2.a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary3-2.32.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= -2147483648 ORDER BY t1.a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary3-2.32.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=11 - ORDER BY t1.rowid - } -} {11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.32.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=11 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11} -do_test boundary3-2.32.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=11 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.32.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=11 - ORDER BY t1.rowid - } -} {11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.32.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=11 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11} -do_test boundary3-2.32.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < -2147483648 ORDER BY t2.a - } -} {2 21 44 47 55 58 63 64} -do_test boundary3-2.32.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < -2147483648 ORDER BY t1.a DESC - } -} {64 63 58 55 47 44 21 2} -do_test boundary3-2.32.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=11 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47} -do_test boundary3-2.32.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=11 - ORDER BY t1.rowid DESC - } -} {47 63 58 44 21 64 2 55} -do_test boundary3-2.32.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=11 - ORDER BY x - } -} {55 2 64 21 44 58 63 47} -do_test boundary3-2.32.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=11 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47} -do_test boundary3-2.32.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=11 - ORDER BY t1.rowid DESC - } -} {47 63 58 44 21 64 2 55} -do_test boundary3-2.32.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= -2147483648 ORDER BY t2.a - } -} {2 11 21 44 47 55 58 63 64} -do_test boundary3-2.32.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= -2147483648 ORDER BY t1.a DESC - } -} {64 63 58 55 47 44 21 11 2} -do_test boundary3-2.32.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=11 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11} -do_test boundary3-2.32.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=11 - ORDER BY t1.rowid DESC - } -} {11 47 63 58 44 21 64 2 55} -do_test boundary3-2.32.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=11 - ORDER BY x - } -} {55 2 64 21 44 58 63 47 11} -do_test boundary3-2.32.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=11 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11} -do_test boundary3-2.32.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=11 - ORDER BY t1.rowid DESC - } -} {11 47 63 58 44 21 64 2 55} -do_test boundary3-2.33.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=34359738367 AND t2.a=t1.a - } -} {39 00000007ffffffff} -do_test boundary3-2.33.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='00000007ffffffff' - } -} {34359738367 39} -do_test boundary3-2.33.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=39 - } -} {34359738367 00000007ffffffff} -do_test boundary3-2.33.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 34359738367 ORDER BY t2.a - } -} {3 7 10 13 17 19 22 25 26 27 28 34 35 43 45 46 56 57} -do_test boundary3-2.33.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 34359738367 ORDER BY t1.a DESC - } -} {57 56 46 45 43 35 34 28 27 26 25 22 19 17 13 10 7 3} -do_test boundary3-2.33.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=39 - ORDER BY t1.rowid - } -} {22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.33.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=39 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22} -do_test boundary3-2.33.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=39 - ORDER BY x - } -} {22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.33.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=39 - ORDER BY t1.rowid - } -} {22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.33.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=39 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22} -do_test boundary3-2.33.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 34359738367 ORDER BY t2.a - } -} {3 7 10 13 17 19 22 25 26 27 28 34 35 39 43 45 46 56 57} -do_test boundary3-2.33.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 34359738367 ORDER BY t1.a DESC - } -} {57 56 46 45 43 39 35 34 28 27 26 25 22 19 17 13 10 7 3} -do_test boundary3-2.33.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=39 - ORDER BY t1.rowid - } -} {39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.33.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=39 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39} -do_test boundary3-2.33.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=39 - ORDER BY x - } -} {39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.33.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=39 - ORDER BY t1.rowid - } -} {39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.33.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=39 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39} -do_test boundary3-2.33.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 34359738367 ORDER BY t2.a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 23 24 29 30 31 32 33 36 37 38 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.33.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 34359738367 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 38 37 36 33 32 31 30 29 24 23 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary3-2.33.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=39 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36} -do_test boundary3-2.33.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=39 - ORDER BY t1.rowid DESC - } -} {36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.33.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=39 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.33.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=39 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36} -do_test boundary3-2.33.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=39 - ORDER BY t1.rowid DESC - } -} {36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.33.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 34359738367 ORDER BY t2.a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 23 24 29 30 31 32 33 36 37 38 39 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.33.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 34359738367 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 39 38 37 36 33 32 31 30 29 24 23 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary3-2.33.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=39 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39} -do_test boundary3-2.33.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=39 - ORDER BY t1.rowid DESC - } -} {39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.33.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=39 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.33.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=39 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39} -do_test boundary3-2.33.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=39 - ORDER BY t1.rowid DESC - } -} {39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.34.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=-549755813889 AND t2.a=t1.a - } -} {58 ffffff7fffffffff} -do_test boundary3-2.34.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='ffffff7fffffffff' - } -} {-549755813889 58} -do_test boundary3-2.34.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=58 - } -} {-549755813889 ffffff7fffffffff} -do_test boundary3-2.34.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > -549755813889 ORDER BY t2.a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 47 48 49 50 51 52 53 54 56 57 59 60 61 62 63} -do_test boundary3-2.34.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > -549755813889 ORDER BY t1.a DESC - } -} {63 62 61 60 59 57 56 54 53 52 51 50 49 48 47 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary3-2.34.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=58 - ORDER BY t1.rowid - } -} {63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.34.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=58 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63} -do_test boundary3-2.34.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=58 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.34.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=58 - ORDER BY t1.rowid - } -} {63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.34.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=58 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63} -do_test boundary3-2.34.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= -549755813889 ORDER BY t2.a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63} -do_test boundary3-2.34.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= -549755813889 ORDER BY t1.a DESC - } -} {63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary3-2.34.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=58 - ORDER BY t1.rowid - } -} {58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.34.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=58 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58} -do_test boundary3-2.34.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=58 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.34.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=58 - ORDER BY t1.rowid - } -} {58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.34.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=58 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58} -do_test boundary3-2.34.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < -549755813889 ORDER BY t2.a - } -} {2 21 44 55 64} -do_test boundary3-2.34.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < -549755813889 ORDER BY t1.a DESC - } -} {64 55 44 21 2} -do_test boundary3-2.34.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=58 - ORDER BY t1.rowid - } -} {55 2 64 21 44} -do_test boundary3-2.34.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=58 - ORDER BY t1.rowid DESC - } -} {44 21 64 2 55} -do_test boundary3-2.34.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=58 - ORDER BY x - } -} {55 2 64 21 44} -do_test boundary3-2.34.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=58 - ORDER BY t1.rowid - } -} {55 2 64 21 44} -do_test boundary3-2.34.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=58 - ORDER BY t1.rowid DESC - } -} {44 21 64 2 55} -do_test boundary3-2.34.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= -549755813889 ORDER BY t2.a - } -} {2 21 44 55 58 64} -do_test boundary3-2.34.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= -549755813889 ORDER BY t1.a DESC - } -} {64 58 55 44 21 2} -do_test boundary3-2.34.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=58 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58} -do_test boundary3-2.34.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=58 - ORDER BY t1.rowid DESC - } -} {58 44 21 64 2 55} -do_test boundary3-2.34.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=58 - ORDER BY x - } -} {55 2 64 21 44 58} -do_test boundary3-2.34.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=58 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58} -do_test boundary3-2.34.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=58 - ORDER BY t1.rowid DESC - } -} {58 44 21 64 2 55} -do_test boundary3-2.35.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=-32768 AND t2.a=t1.a - } -} {32 ffffffffffff8000} -do_test boundary3-2.35.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='ffffffffffff8000' - } -} {-32768 32} -do_test boundary3-2.35.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=32 - } -} {-32768 ffffffffffff8000} -do_test boundary3-2.35.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > -32768 ORDER BY t2.a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary3-2.35.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > -32768 ORDER BY t1.a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary3-2.35.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=32 - ORDER BY t1.rowid - } -} {54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.35.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=32 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54} -do_test boundary3-2.35.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=32 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 54 53 52 33 38} -do_test boundary3-2.35.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=32 - ORDER BY t1.rowid - } -} {54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.35.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=32 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54} -do_test boundary3-2.35.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= -32768 ORDER BY t2.a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 32 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary3-2.35.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= -32768 ORDER BY t1.a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 32 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary3-2.35.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=32 - ORDER BY t1.rowid - } -} {32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.35.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=32 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32} -do_test boundary3-2.35.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=32 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 32 54 53 52 33 38} -do_test boundary3-2.35.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=32 - ORDER BY t1.rowid - } -} {32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.35.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=32 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32} -do_test boundary3-2.35.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < -32768 ORDER BY t2.a - } -} {1 2 11 21 29 37 44 47 55 58 63 64} -do_test boundary3-2.35.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < -32768 ORDER BY t1.a DESC - } -} {64 63 58 55 47 44 37 29 21 11 2 1} -do_test boundary3-2.35.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=32 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29} -do_test boundary3-2.35.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=32 - ORDER BY t1.rowid DESC - } -} {29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.35.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=32 - ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29} -do_test boundary3-2.35.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=32 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29} -do_test boundary3-2.35.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=32 - ORDER BY t1.rowid DESC - } -} {29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.35.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= -32768 ORDER BY t2.a - } -} {1 2 11 21 29 32 37 44 47 55 58 63 64} -do_test boundary3-2.35.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= -32768 ORDER BY t1.a DESC - } -} {64 63 58 55 47 44 37 32 29 21 11 2 1} -do_test boundary3-2.35.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=32 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32} -do_test boundary3-2.35.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=32 - ORDER BY t1.rowid DESC - } -} {32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.35.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=32 - ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32} -do_test boundary3-2.35.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=32 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32} -do_test boundary3-2.35.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=32 - ORDER BY t1.rowid DESC - } -} {32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.36.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=2147483647 AND t2.a=t1.a - } -} {20 000000007fffffff} -do_test boundary3-2.36.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='000000007fffffff' - } -} {2147483647 20} -do_test boundary3-2.36.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=20 - } -} {2147483647 000000007fffffff} -do_test boundary3-2.36.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 2147483647 ORDER BY t2.a - } -} {3 7 10 13 14 17 19 22 25 26 27 28 34 35 36 39 43 45 46 51 56 57} -do_test boundary3-2.36.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 2147483647 ORDER BY t1.a DESC - } -} {57 56 51 46 45 43 39 36 35 34 28 27 26 25 22 19 17 14 13 10 7 3} -do_test boundary3-2.36.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=20 - ORDER BY t1.rowid - } -} {51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.36.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=20 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51} -do_test boundary3-2.36.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=20 - ORDER BY x - } -} {51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.36.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=20 - ORDER BY t1.rowid - } -} {51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.36.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=20 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51} -do_test boundary3-2.36.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 2147483647 ORDER BY t2.a - } -} {3 7 10 13 14 17 19 20 22 25 26 27 28 34 35 36 39 43 45 46 51 56 57} -do_test boundary3-2.36.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 2147483647 ORDER BY t1.a DESC - } -} {57 56 51 46 45 43 39 36 35 34 28 27 26 25 22 20 19 17 14 13 10 7 3} -do_test boundary3-2.36.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=20 - ORDER BY t1.rowid - } -} {20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.36.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=20 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20} -do_test boundary3-2.36.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=20 - ORDER BY x - } -} {20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.36.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=20 - ORDER BY t1.rowid - } -} {20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.36.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=20 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20} -do_test boundary3-2.36.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 2147483647 ORDER BY t2.a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.36.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 2147483647 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary3-2.36.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=20 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40} -do_test boundary3-2.36.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=20 - ORDER BY t1.rowid DESC - } -} {40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.36.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=20 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.36.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=20 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40} -do_test boundary3-2.36.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=20 - ORDER BY t1.rowid DESC - } -} {40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.36.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 2147483647 ORDER BY t2.a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 20 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.36.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 2147483647 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 20 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary3-2.36.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=20 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20} -do_test boundary3-2.36.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=20 - ORDER BY t1.rowid DESC - } -} {20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.36.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=20 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.36.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=20 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20} -do_test boundary3-2.36.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=20 - ORDER BY t1.rowid DESC - } -} {20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.37.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=-129 AND t2.a=t1.a - } -} {54 ffffffffffffff7f} -do_test boundary3-2.37.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='ffffffffffffff7f' - } -} {-129 54} -do_test boundary3-2.37.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=54 - } -} {-129 ffffffffffffff7f} -do_test boundary3-2.37.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > -129 ORDER BY t2.a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 56 57 59 60 61 62} -do_test boundary3-2.37.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > -129 ORDER BY t1.a DESC - } -} {62 61 60 59 57 56 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary3-2.37.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=54 - ORDER BY t1.rowid - } -} {53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.37.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=54 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53} -do_test boundary3-2.37.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=54 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 53 52 33 38} -do_test boundary3-2.37.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=54 - ORDER BY t1.rowid - } -} {53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.37.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=54 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53} -do_test boundary3-2.37.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= -129 ORDER BY t2.a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary3-2.37.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= -129 ORDER BY t1.a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary3-2.37.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=54 - ORDER BY t1.rowid - } -} {54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.37.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=54 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54} -do_test boundary3-2.37.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=54 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 54 53 52 33 38} -do_test boundary3-2.37.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=54 - ORDER BY t1.rowid - } -} {54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.37.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=54 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54} -do_test boundary3-2.37.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < -129 ORDER BY t2.a - } -} {1 2 11 21 29 32 37 44 47 55 58 63 64} -do_test boundary3-2.37.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < -129 ORDER BY t1.a DESC - } -} {64 63 58 55 47 44 37 32 29 21 11 2 1} -do_test boundary3-2.37.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=54 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32} -do_test boundary3-2.37.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=54 - ORDER BY t1.rowid DESC - } -} {32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.37.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=54 - ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32} -do_test boundary3-2.37.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=54 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32} -do_test boundary3-2.37.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=54 - ORDER BY t1.rowid DESC - } -} {32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.37.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= -129 ORDER BY t2.a - } -} {1 2 11 21 29 32 37 44 47 54 55 58 63 64} -do_test boundary3-2.37.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= -129 ORDER BY t1.a DESC - } -} {64 63 58 55 54 47 44 37 32 29 21 11 2 1} -do_test boundary3-2.37.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=54 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54} -do_test boundary3-2.37.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=54 - ORDER BY t1.rowid DESC - } -} {54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.37.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=54 - ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54} -do_test boundary3-2.37.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=54 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54} -do_test boundary3-2.37.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=54 - ORDER BY t1.rowid DESC - } -} {54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.38.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=-128 AND t2.a=t1.a - } -} {53 ffffffffffffff80} -do_test boundary3-2.38.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='ffffffffffffff80' - } -} {-128 53} -do_test boundary3-2.38.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=53 - } -} {-128 ffffffffffffff80} -do_test boundary3-2.38.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > -128 ORDER BY t2.a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 56 57 59 60 61 62} -do_test boundary3-2.38.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > -128 ORDER BY t1.a DESC - } -} {62 61 60 59 57 56 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary3-2.38.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=53 - ORDER BY t1.rowid - } -} {52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.38.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=53 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52} -do_test boundary3-2.38.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=53 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 52 33 38} -do_test boundary3-2.38.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=53 - ORDER BY t1.rowid - } -} {52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.38.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=53 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52} -do_test boundary3-2.38.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= -128 ORDER BY t2.a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 33 34 35 36 38 39 40 41 42 43 45 46 48 49 50 51 52 53 56 57 59 60 61 62} -do_test boundary3-2.38.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= -128 ORDER BY t1.a DESC - } -} {62 61 60 59 57 56 53 52 51 50 49 48 46 45 43 42 41 40 39 38 36 35 34 33 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary3-2.38.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=53 - ORDER BY t1.rowid - } -} {53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.38.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=53 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53} -do_test boundary3-2.38.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=53 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 53 52 33 38} -do_test boundary3-2.38.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=53 - ORDER BY t1.rowid - } -} {53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.38.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=53 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53} -do_test boundary3-2.38.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < -128 ORDER BY t2.a - } -} {1 2 11 21 29 32 37 44 47 54 55 58 63 64} -do_test boundary3-2.38.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < -128 ORDER BY t1.a DESC - } -} {64 63 58 55 54 47 44 37 32 29 21 11 2 1} -do_test boundary3-2.38.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=53 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54} -do_test boundary3-2.38.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=53 - ORDER BY t1.rowid DESC - } -} {54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.38.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=53 - ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54} -do_test boundary3-2.38.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=53 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54} -do_test boundary3-2.38.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=53 - ORDER BY t1.rowid DESC - } -} {54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.38.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= -128 ORDER BY t2.a - } -} {1 2 11 21 29 32 37 44 47 53 54 55 58 63 64} -do_test boundary3-2.38.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= -128 ORDER BY t1.a DESC - } -} {64 63 58 55 54 53 47 44 37 32 29 21 11 2 1} -do_test boundary3-2.38.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=53 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53} -do_test boundary3-2.38.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=53 - ORDER BY t1.rowid DESC - } -} {53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.38.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=53 - ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53} -do_test boundary3-2.38.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=53 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53} -do_test boundary3-2.38.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=53 - ORDER BY t1.rowid DESC - } -} {53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.39.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=72057594037927936 AND t2.a=t1.a - } -} {28 0100000000000000} -do_test boundary3-2.39.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='0100000000000000' - } -} {72057594037927936 28} -do_test boundary3-2.39.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=28 - } -} {72057594037927936 0100000000000000} -do_test boundary3-2.39.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 72057594037927936 ORDER BY t2.a - } -} {3} -do_test boundary3-2.39.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 72057594037927936 ORDER BY t1.a DESC - } -} {3} -do_test boundary3-2.39.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=28 - ORDER BY t1.rowid - } -} {3} -do_test boundary3-2.39.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=28 - ORDER BY t1.rowid DESC - } -} {3} -do_test boundary3-2.39.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=28 - ORDER BY x - } -} {3} -do_test boundary3-2.39.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 72057594037927936 ORDER BY t2.a - } -} {3 28} -do_test boundary3-2.39.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 72057594037927936 ORDER BY t1.a DESC - } -} {28 3} -do_test boundary3-2.39.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=28 - ORDER BY t1.rowid - } -} {28 3} -do_test boundary3-2.39.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=28 - ORDER BY t1.rowid DESC - } -} {3 28} -do_test boundary3-2.39.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=28 - ORDER BY x - } -} {28 3} -do_test boundary3-2.39.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 72057594037927936 ORDER BY t2.a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.39.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 72057594037927936 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary3-2.39.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=28 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17} -do_test boundary3-2.39.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=28 - ORDER BY t1.rowid DESC - } -} {17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.39.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=28 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.39.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 72057594037927936 ORDER BY t2.a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.39.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 72057594037927936 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary3-2.39.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=28 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28} -do_test boundary3-2.39.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=28 - ORDER BY t1.rowid DESC - } -} {28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.39.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=28 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.40.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=2147483648 AND t2.a=t1.a - } -} {51 0000000080000000} -do_test boundary3-2.40.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='0000000080000000' - } -} {2147483648 51} -do_test boundary3-2.40.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=51 - } -} {2147483648 0000000080000000} -do_test boundary3-2.40.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 2147483648 ORDER BY t2.a - } -} {3 7 10 13 14 17 19 22 25 26 27 28 34 35 36 39 43 45 46 56 57} -do_test boundary3-2.40.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 2147483648 ORDER BY t1.a DESC - } -} {57 56 46 45 43 39 36 35 34 28 27 26 25 22 19 17 14 13 10 7 3} -do_test boundary3-2.40.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=51 - ORDER BY t1.rowid - } -} {14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.40.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=51 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14} -do_test boundary3-2.40.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=51 - ORDER BY x - } -} {14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.40.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=51 - ORDER BY t1.rowid - } -} {14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.40.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=51 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14} -do_test boundary3-2.40.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 2147483648 ORDER BY t2.a - } -} {3 7 10 13 14 17 19 22 25 26 27 28 34 35 36 39 43 45 46 51 56 57} -do_test boundary3-2.40.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 2147483648 ORDER BY t1.a DESC - } -} {57 56 51 46 45 43 39 36 35 34 28 27 26 25 22 19 17 14 13 10 7 3} -do_test boundary3-2.40.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=51 - ORDER BY t1.rowid - } -} {51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.40.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=51 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51} -do_test boundary3-2.40.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=51 - ORDER BY x - } -} {51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.40.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=51 - ORDER BY t1.rowid - } -} {51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.40.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=51 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51} -do_test boundary3-2.40.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 2147483648 ORDER BY t2.a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 20 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.40.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 2147483648 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 20 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary3-2.40.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=51 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20} -do_test boundary3-2.40.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=51 - ORDER BY t1.rowid DESC - } -} {20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.40.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=51 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.40.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=51 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20} -do_test boundary3-2.40.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=51 - ORDER BY t1.rowid DESC - } -} {20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.40.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 2147483648 ORDER BY t2.a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 20 21 23 24 29 30 31 32 33 37 38 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.40.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 2147483648 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 38 37 33 32 31 30 29 24 23 21 20 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary3-2.40.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=51 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51} -do_test boundary3-2.40.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=51 - ORDER BY t1.rowid DESC - } -} {51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.40.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=51 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.40.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=51 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51} -do_test boundary3-2.40.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=51 - ORDER BY t1.rowid DESC - } -} {51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.41.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=549755813887 AND t2.a=t1.a - } -} {46 0000007fffffffff} -do_test boundary3-2.41.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='0000007fffffffff' - } -} {549755813887 46} -do_test boundary3-2.41.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=46 - } -} {549755813887 0000007fffffffff} -do_test boundary3-2.41.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 549755813887 ORDER BY t2.a - } -} {3 7 10 13 17 19 25 26 27 28 34 35 43 45 56 57} -do_test boundary3-2.41.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 549755813887 ORDER BY t1.a DESC - } -} {57 56 45 43 35 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary3-2.41.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=46 - ORDER BY t1.rowid - } -} {35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.41.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=46 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35} -do_test boundary3-2.41.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=46 - ORDER BY x - } -} {35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.41.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=46 - ORDER BY t1.rowid - } -} {35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.41.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=46 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35} -do_test boundary3-2.41.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 549755813887 ORDER BY t2.a - } -} {3 7 10 13 17 19 25 26 27 28 34 35 43 45 46 56 57} -do_test boundary3-2.41.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 549755813887 ORDER BY t1.a DESC - } -} {57 56 46 45 43 35 34 28 27 26 25 19 17 13 10 7 3} -do_test boundary3-2.41.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=46 - ORDER BY t1.rowid - } -} {46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.41.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=46 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46} -do_test boundary3-2.41.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=46 - ORDER BY x - } -} {46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.41.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=46 - ORDER BY t1.rowid - } -} {46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.41.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=46 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46} -do_test boundary3-2.41.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 549755813887 ORDER BY t2.a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 36 37 38 39 40 41 42 44 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.41.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 549755813887 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 44 42 41 40 39 38 37 36 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary3-2.41.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=46 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22} -do_test boundary3-2.41.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=46 - ORDER BY t1.rowid DESC - } -} {22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.41.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=46 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.41.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=46 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22} -do_test boundary3-2.41.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=46 - ORDER BY t1.rowid DESC - } -} {22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.41.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 549755813887 ORDER BY t2.a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 20 21 22 23 24 29 30 31 32 33 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.41.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 549755813887 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 33 32 31 30 29 24 23 22 21 20 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary3-2.41.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=46 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46} -do_test boundary3-2.41.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=46 - ORDER BY t1.rowid DESC - } -} {46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.41.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=46 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.41.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=46 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46} -do_test boundary3-2.41.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=46 - ORDER BY t1.rowid DESC - } -} {46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.42.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=-549755813888 AND t2.a=t1.a - } -} {63 ffffff8000000000} -do_test boundary3-2.42.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='ffffff8000000000' - } -} {-549755813888 63} -do_test boundary3-2.42.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=63 - } -} {-549755813888 ffffff8000000000} -do_test boundary3-2.42.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > -549755813888 ORDER BY t2.a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 47 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary3-2.42.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > -549755813888 ORDER BY t1.a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 47 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary3-2.42.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=63 - ORDER BY t1.rowid - } -} {47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.42.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=63 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47} -do_test boundary3-2.42.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=63 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.42.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=63 - ORDER BY t1.rowid - } -} {47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.42.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=63 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47} -do_test boundary3-2.42.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= -549755813888 ORDER BY t2.a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 47 48 49 50 51 52 53 54 56 57 59 60 61 62 63} -do_test boundary3-2.42.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= -549755813888 ORDER BY t1.a DESC - } -} {63 62 61 60 59 57 56 54 53 52 51 50 49 48 47 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary3-2.42.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=63 - ORDER BY t1.rowid - } -} {63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.42.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=63 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63} -do_test boundary3-2.42.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=63 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.42.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=63 - ORDER BY t1.rowid - } -} {63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.42.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=63 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63} -do_test boundary3-2.42.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < -549755813888 ORDER BY t2.a - } -} {2 21 44 55 58 64} -do_test boundary3-2.42.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < -549755813888 ORDER BY t1.a DESC - } -} {64 58 55 44 21 2} -do_test boundary3-2.42.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=63 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58} -do_test boundary3-2.42.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=63 - ORDER BY t1.rowid DESC - } -} {58 44 21 64 2 55} -do_test boundary3-2.42.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=63 - ORDER BY x - } -} {55 2 64 21 44 58} -do_test boundary3-2.42.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=63 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58} -do_test boundary3-2.42.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=63 - ORDER BY t1.rowid DESC - } -} {58 44 21 64 2 55} -do_test boundary3-2.42.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= -549755813888 ORDER BY t2.a - } -} {2 21 44 55 58 63 64} -do_test boundary3-2.42.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= -549755813888 ORDER BY t1.a DESC - } -} {64 63 58 55 44 21 2} -do_test boundary3-2.42.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=63 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63} -do_test boundary3-2.42.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=63 - ORDER BY t1.rowid DESC - } -} {63 58 44 21 64 2 55} -do_test boundary3-2.42.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=63 - ORDER BY x - } -} {55 2 64 21 44 58 63} -do_test boundary3-2.42.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=63 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63} -do_test boundary3-2.42.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=63 - ORDER BY t1.rowid DESC - } -} {63 58 44 21 64 2 55} -do_test boundary3-2.43.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=281474976710655 AND t2.a=t1.a - } -} {10 0000ffffffffffff} -do_test boundary3-2.43.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='0000ffffffffffff' - } -} {281474976710655 10} -do_test boundary3-2.43.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=10 - } -} {281474976710655 0000ffffffffffff} -do_test boundary3-2.43.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 281474976710655 ORDER BY t2.a - } -} {3 13 17 26 27 28 43 45} -do_test boundary3-2.43.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 281474976710655 ORDER BY t1.a DESC - } -} {45 43 28 27 26 17 13 3} -do_test boundary3-2.43.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=10 - ORDER BY t1.rowid - } -} {26 13 43 27 45 17 28 3} -do_test boundary3-2.43.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=10 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26} -do_test boundary3-2.43.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=10 - ORDER BY x - } -} {26 13 43 27 45 17 28 3} -do_test boundary3-2.43.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 281474976710655 ORDER BY t2.a - } -} {3 10 13 17 26 27 28 43 45} -do_test boundary3-2.43.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 281474976710655 ORDER BY t1.a DESC - } -} {45 43 28 27 26 17 13 10 3} -do_test boundary3-2.43.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=10 - ORDER BY t1.rowid - } -} {10 26 13 43 27 45 17 28 3} -do_test boundary3-2.43.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=10 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10} -do_test boundary3-2.43.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=10 - ORDER BY x - } -} {10 26 13 43 27 45 17 28 3} -do_test boundary3-2.43.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 281474976710655 ORDER BY t2.a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 25 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.43.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 281474976710655 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 25 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary3-2.43.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=10 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34} -do_test boundary3-2.43.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=10 - ORDER BY t1.rowid DESC - } -} {34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.43.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=10 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.43.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 281474976710655 ORDER BY t2.a - } -} {1 2 4 5 6 7 8 9 10 11 12 14 15 16 18 19 20 21 22 23 24 25 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.43.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 281474976710655 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 25 24 23 22 21 20 19 18 16 15 14 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary3-2.43.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=10 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10} -do_test boundary3-2.43.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=10 - ORDER BY t1.rowid DESC - } -} {10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.43.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=10 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.44.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=4398046511103 AND t2.a=t1.a - } -} {7 000003ffffffffff} -do_test boundary3-2.44.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='000003ffffffffff' - } -} {4398046511103 7} -do_test boundary3-2.44.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=7 - } -} {4398046511103 000003ffffffffff} -do_test boundary3-2.44.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 4398046511103 ORDER BY t2.a - } -} {3 10 13 17 25 26 27 28 34 43 45 56} -do_test boundary3-2.44.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 4398046511103 ORDER BY t1.a DESC - } -} {56 45 43 34 28 27 26 25 17 13 10 3} -do_test boundary3-2.44.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=7 - ORDER BY t1.rowid - } -} {56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.44.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=7 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56} -do_test boundary3-2.44.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=7 - ORDER BY x - } -} {56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.44.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=7 - ORDER BY t1.rowid - } -} {56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.44.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=7 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56} -do_test boundary3-2.44.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 4398046511103 ORDER BY t2.a - } -} {3 7 10 13 17 25 26 27 28 34 43 45 56} -do_test boundary3-2.44.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 4398046511103 ORDER BY t1.a DESC - } -} {56 45 43 34 28 27 26 25 17 13 10 7 3} -do_test boundary3-2.44.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=7 - ORDER BY t1.rowid - } -} {7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.44.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=7 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7} -do_test boundary3-2.44.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=7 - ORDER BY x - } -} {7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.44.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=7 - ORDER BY t1.rowid - } -} {7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.44.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=7 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7} -do_test boundary3-2.44.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 4398046511103 ORDER BY t2.a - } -} {1 2 4 5 6 8 9 11 12 14 15 16 18 19 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 57 58 59 60 61 62 63 64} -do_test boundary3-2.44.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 4398046511103 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 19 18 16 15 14 12 11 9 8 6 5 4 2 1} -do_test boundary3-2.44.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=7 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19} -do_test boundary3-2.44.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=7 - ORDER BY t1.rowid DESC - } -} {19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.44.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=7 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.44.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=7 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19} -do_test boundary3-2.44.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=7 - ORDER BY t1.rowid DESC - } -} {19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.44.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 4398046511103 ORDER BY t2.a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 57 58 59 60 61 62 63 64} -do_test boundary3-2.44.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 4398046511103 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary3-2.44.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=7 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7} -do_test boundary3-2.44.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=7 - ORDER BY t1.rowid DESC - } -} {7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.44.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=7 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.44.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=7 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7} -do_test boundary3-2.44.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=7 - ORDER BY t1.rowid DESC - } -} {7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.45.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=268435455 AND t2.a=t1.a - } -} {12 000000000fffffff} -do_test boundary3-2.45.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='000000000fffffff' - } -} {268435455 12} -do_test boundary3-2.45.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=12 - } -} {268435455 000000000fffffff} -do_test boundary3-2.45.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 268435455 ORDER BY t2.a - } -} {3 7 10 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary3-2.45.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 268435455 ORDER BY t1.a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 10 7 3} -do_test boundary3-2.45.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=12 - ORDER BY t1.rowid - } -} {40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.45.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=12 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40} -do_test boundary3-2.45.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=12 - ORDER BY x - } -} {40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.45.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=12 - ORDER BY t1.rowid - } -} {40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.45.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=12 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40} -do_test boundary3-2.45.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 268435455 ORDER BY t2.a - } -} {3 7 10 12 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary3-2.45.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 268435455 ORDER BY t1.a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 12 10 7 3} -do_test boundary3-2.45.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=12 - ORDER BY t1.rowid - } -} {12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.45.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=12 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12} -do_test boundary3-2.45.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=12 - ORDER BY x - } -} {12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.45.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=12 - ORDER BY t1.rowid - } -} {12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.45.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=12 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12} -do_test boundary3-2.45.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 268435455 ORDER BY t2.a - } -} {1 2 4 5 6 8 9 11 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.45.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 268435455 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 11 9 8 6 5 4 2 1} -do_test boundary3-2.45.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=12 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6} -do_test boundary3-2.45.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=12 - ORDER BY t1.rowid DESC - } -} {6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.45.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=12 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.45.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=12 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6} -do_test boundary3-2.45.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=12 - ORDER BY t1.rowid DESC - } -} {6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.45.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 268435455 ORDER BY t2.a - } -} {1 2 4 5 6 8 9 11 12 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.45.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 268435455 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 12 11 9 8 6 5 4 2 1} -do_test boundary3-2.45.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=12 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12} -do_test boundary3-2.45.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=12 - ORDER BY t1.rowid DESC - } -} {12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.45.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=12 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.45.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=12 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12} -do_test boundary3-2.45.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=12 - ORDER BY t1.rowid DESC - } -} {12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.46.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=-9223372036854775808 AND t2.a=t1.a - } -} {55 8000000000000000} -do_test boundary3-2.46.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='8000000000000000' - } -} {-9223372036854775808 55} -do_test boundary3-2.46.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=55 - } -} {-9223372036854775808 8000000000000000} -do_test boundary3-2.46.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > -9223372036854775808 ORDER BY t2.a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.46.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > -9223372036854775808 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary3-2.46.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=55 - ORDER BY t1.rowid - } -} {2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.46.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=55 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2} -do_test boundary3-2.46.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=55 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.46.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= -9223372036854775808 ORDER BY t2.a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.46.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= -9223372036854775808 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary3-2.46.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=55 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.46.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=55 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.46.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=55 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.46.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < -9223372036854775808 ORDER BY t2.a - } -} {} -do_test boundary3-2.46.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < -9223372036854775808 ORDER BY t1.a DESC - } -} {} -do_test boundary3-2.46.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=55 - ORDER BY t1.rowid - } -} {} -do_test boundary3-2.46.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=55 - ORDER BY t1.rowid DESC - } -} {} -do_test boundary3-2.46.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=55 - ORDER BY x - } -} {} -do_test boundary3-2.46.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= -9223372036854775808 ORDER BY t2.a - } -} {55} -do_test boundary3-2.46.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= -9223372036854775808 ORDER BY t1.a DESC - } -} {55} -do_test boundary3-2.46.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=55 - ORDER BY t1.rowid - } -} {55} -do_test boundary3-2.46.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=55 - ORDER BY t1.rowid DESC - } -} {55} -do_test boundary3-2.46.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=55 - ORDER BY x - } -} {55} -do_test boundary3-2.47.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=562949953421312 AND t2.a=t1.a - } -} {43 0002000000000000} -do_test boundary3-2.47.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='0002000000000000' - } -} {562949953421312 43} -do_test boundary3-2.47.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=43 - } -} {562949953421312 0002000000000000} -do_test boundary3-2.47.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 562949953421312 ORDER BY t2.a - } -} {3 17 27 28 45} -do_test boundary3-2.47.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 562949953421312 ORDER BY t1.a DESC - } -} {45 28 27 17 3} -do_test boundary3-2.47.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=43 - ORDER BY t1.rowid - } -} {27 45 17 28 3} -do_test boundary3-2.47.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=43 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27} -do_test boundary3-2.47.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=43 - ORDER BY x - } -} {27 45 17 28 3} -do_test boundary3-2.47.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 562949953421312 ORDER BY t2.a - } -} {3 17 27 28 43 45} -do_test boundary3-2.47.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 562949953421312 ORDER BY t1.a DESC - } -} {45 43 28 27 17 3} -do_test boundary3-2.47.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=43 - ORDER BY t1.rowid - } -} {43 27 45 17 28 3} -do_test boundary3-2.47.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=43 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43} -do_test boundary3-2.47.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=43 - ORDER BY x - } -} {43 27 45 17 28 3} -do_test boundary3-2.47.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 562949953421312 ORDER BY t2.a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.47.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 562949953421312 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary3-2.47.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=43 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13} -do_test boundary3-2.47.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=43 - ORDER BY t1.rowid DESC - } -} {13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.47.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=43 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.47.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 562949953421312 ORDER BY t2.a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.47.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 562949953421312 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary3-2.47.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=43 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43} -do_test boundary3-2.47.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=43 - ORDER BY t1.rowid DESC - } -} {43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.47.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=43 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.48.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=-8388609 AND t2.a=t1.a - } -} {1 ffffffffff7fffff} -do_test boundary3-2.48.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='ffffffffff7fffff' - } -} {-8388609 1} -do_test boundary3-2.48.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=1 - } -} {-8388609 ffffffffff7fffff} -do_test boundary3-2.48.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > -8388609 ORDER BY t2.a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary3-2.48.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > -8388609 ORDER BY t1.a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary3-2.48.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=1 - ORDER BY t1.rowid - } -} {37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.48.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=1 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37} -do_test boundary3-2.48.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=1 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 37 29 32 54 53 52 33 38} -do_test boundary3-2.48.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=1 - ORDER BY t1.rowid - } -} {37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.48.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=1 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37} -do_test boundary3-2.48.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= -8388609 ORDER BY t2.a - } -} {1 3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary3-2.48.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= -8388609 ORDER BY t1.a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3 1} -do_test boundary3-2.48.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=1 - ORDER BY t1.rowid - } -} {1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.48.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=1 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1} -do_test boundary3-2.48.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=1 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.48.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=1 - ORDER BY t1.rowid - } -} {1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.48.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=1 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1} -do_test boundary3-2.48.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < -8388609 ORDER BY t2.a - } -} {2 11 21 44 47 55 58 63 64} -do_test boundary3-2.48.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < -8388609 ORDER BY t1.a DESC - } -} {64 63 58 55 47 44 21 11 2} -do_test boundary3-2.48.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=1 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11} -do_test boundary3-2.48.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=1 - ORDER BY t1.rowid DESC - } -} {11 47 63 58 44 21 64 2 55} -do_test boundary3-2.48.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=1 - ORDER BY x - } -} {55 2 64 21 44 58 63 47 11} -do_test boundary3-2.48.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=1 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11} -do_test boundary3-2.48.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=1 - ORDER BY t1.rowid DESC - } -} {11 47 63 58 44 21 64 2 55} -do_test boundary3-2.48.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= -8388609 ORDER BY t2.a - } -} {1 2 11 21 44 47 55 58 63 64} -do_test boundary3-2.48.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= -8388609 ORDER BY t1.a DESC - } -} {64 63 58 55 47 44 21 11 2 1} -do_test boundary3-2.48.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=1 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1} -do_test boundary3-2.48.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=1 - ORDER BY t1.rowid DESC - } -} {1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.48.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=1 - ORDER BY x - } -} {55 2 64 21 44 58 63 47 11 1} -do_test boundary3-2.48.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=1 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1} -do_test boundary3-2.48.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=1 - ORDER BY t1.rowid DESC - } -} {1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.49.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=16777215 AND t2.a=t1.a - } -} {9 0000000000ffffff} -do_test boundary3-2.49.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='0000000000ffffff' - } -} {16777215 9} -do_test boundary3-2.49.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=9 - } -} {16777215 0000000000ffffff} -do_test boundary3-2.49.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 16777215 ORDER BY t2.a - } -} {3 6 7 10 12 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary3-2.49.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 16777215 ORDER BY t1.a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 12 10 7 6 3} -do_test boundary3-2.49.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=9 - ORDER BY t1.rowid - } -} {6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.49.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=9 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6} -do_test boundary3-2.49.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=9 - ORDER BY x - } -} {6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.49.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=9 - ORDER BY t1.rowid - } -} {6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.49.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=9 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6} -do_test boundary3-2.49.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 16777215 ORDER BY t2.a - } -} {3 6 7 9 10 12 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary3-2.49.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 16777215 ORDER BY t1.a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 12 10 9 7 6 3} -do_test boundary3-2.49.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=9 - ORDER BY t1.rowid - } -} {9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.49.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=9 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9} -do_test boundary3-2.49.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=9 - ORDER BY x - } -} {9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.49.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=9 - ORDER BY t1.rowid - } -} {9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.49.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=9 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9} -do_test boundary3-2.49.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 16777215 ORDER BY t2.a - } -} {1 2 4 5 8 11 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.49.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 16777215 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 11 8 5 4 2 1} -do_test boundary3-2.49.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=9 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24} -do_test boundary3-2.49.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=9 - ORDER BY t1.rowid DESC - } -} {24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.49.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=9 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.49.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=9 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24} -do_test boundary3-2.49.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=9 - ORDER BY t1.rowid DESC - } -} {24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.49.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 16777215 ORDER BY t2.a - } -} {1 2 4 5 8 9 11 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.49.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 16777215 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 11 9 8 5 4 2 1} -do_test boundary3-2.49.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=9 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9} -do_test boundary3-2.49.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=9 - ORDER BY t1.rowid DESC - } -} {9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.49.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=9 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.49.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=9 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9} -do_test boundary3-2.49.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=9 - ORDER BY t1.rowid DESC - } -} {9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.50.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=8388608 AND t2.a=t1.a - } -} {24 0000000000800000} -do_test boundary3-2.50.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='0000000000800000' - } -} {8388608 24} -do_test boundary3-2.50.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=24 - } -} {8388608 0000000000800000} -do_test boundary3-2.50.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 8388608 ORDER BY t2.a - } -} {3 6 7 9 10 12 13 14 17 19 20 22 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary3-2.50.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 8388608 ORDER BY t1.a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 22 20 19 17 14 13 12 10 9 7 6 3} -do_test boundary3-2.50.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=24 - ORDER BY t1.rowid - } -} {9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.50.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=24 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9} -do_test boundary3-2.50.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=24 - ORDER BY x - } -} {9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.50.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=24 - ORDER BY t1.rowid - } -} {9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.50.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=24 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9} -do_test boundary3-2.50.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 8388608 ORDER BY t2.a - } -} {3 6 7 9 10 12 13 14 17 19 20 22 24 25 26 27 28 34 35 36 39 40 43 45 46 51 56 57} -do_test boundary3-2.50.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 8388608 ORDER BY t1.a DESC - } -} {57 56 51 46 45 43 40 39 36 35 34 28 27 26 25 24 22 20 19 17 14 13 12 10 9 7 6 3} -do_test boundary3-2.50.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=24 - ORDER BY t1.rowid - } -} {24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.50.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=24 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24} -do_test boundary3-2.50.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=24 - ORDER BY x - } -} {24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.50.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=24 - ORDER BY t1.rowid - } -} {24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.50.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=24 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24} -do_test boundary3-2.50.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 8388608 ORDER BY t2.a - } -} {1 2 4 5 8 11 15 16 18 21 23 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.50.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 8388608 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 23 21 18 16 15 11 8 5 4 2 1} -do_test boundary3-2.50.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=24 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18} -do_test boundary3-2.50.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=24 - ORDER BY t1.rowid DESC - } -} {18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.50.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=24 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.50.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=24 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18} -do_test boundary3-2.50.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=24 - ORDER BY t1.rowid DESC - } -} {18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.50.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 8388608 ORDER BY t2.a - } -} {1 2 4 5 8 11 15 16 18 21 23 24 29 30 31 32 33 37 38 41 42 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.50.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 8388608 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 42 41 38 37 33 32 31 30 29 24 23 21 18 16 15 11 8 5 4 2 1} -do_test boundary3-2.50.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=24 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24} -do_test boundary3-2.50.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=24 - ORDER BY t1.rowid DESC - } -} {24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.50.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=24 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.50.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=24 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24} -do_test boundary3-2.50.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=24 - ORDER BY t1.rowid DESC - } -} {24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.51.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=16383 AND t2.a=t1.a - } -} {8 0000000000003fff} -do_test boundary3-2.51.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='0000000000003fff' - } -} {16383 8} -do_test boundary3-2.51.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=8 - } -} {16383 0000000000003fff} -do_test boundary3-2.51.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 16383 ORDER BY t2.a - } -} {3 6 7 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary3-2.51.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 16383 ORDER BY t1.a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 7 6 3} -do_test boundary3-2.51.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=8 - ORDER BY t1.rowid - } -} {16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.51.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=8 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16} -do_test boundary3-2.51.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=8 - ORDER BY x - } -} {16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.51.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=8 - ORDER BY t1.rowid - } -} {16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.51.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=8 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16} -do_test boundary3-2.51.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 16383 ORDER BY t2.a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary3-2.51.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 16383 ORDER BY t1.a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary3-2.51.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=8 - ORDER BY t1.rowid - } -} {8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.51.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=8 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8} -do_test boundary3-2.51.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=8 - ORDER BY x - } -} {8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.51.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=8 - ORDER BY t1.rowid - } -} {8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.51.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=8 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8} -do_test boundary3-2.51.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 16383 ORDER BY t2.a - } -} {1 2 4 5 11 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary3-2.51.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 16383 ORDER BY t1.a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 11 5 4 2 1} -do_test boundary3-2.51.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=8 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61} -do_test boundary3-2.51.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=8 - ORDER BY t1.rowid DESC - } -} {61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.51.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=8 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.51.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=8 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61} -do_test boundary3-2.51.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=8 - ORDER BY t1.rowid DESC - } -} {61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.51.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 16383 ORDER BY t2.a - } -} {1 2 4 5 8 11 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary3-2.51.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 16383 ORDER BY t1.a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 11 8 5 4 2 1} -do_test boundary3-2.51.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=8 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8} -do_test boundary3-2.51.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=8 - ORDER BY t1.rowid DESC - } -} {8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.51.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=8 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.51.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=8 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8} -do_test boundary3-2.51.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=8 - ORDER BY t1.rowid DESC - } -} {8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.52.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=140737488355328 AND t2.a=t1.a - } -} {34 0000800000000000} -do_test boundary3-2.52.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='0000800000000000' - } -} {140737488355328 34} -do_test boundary3-2.52.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=34 - } -} {140737488355328 0000800000000000} -do_test boundary3-2.52.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 140737488355328 ORDER BY t2.a - } -} {3 10 13 17 26 27 28 43 45} -do_test boundary3-2.52.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 140737488355328 ORDER BY t1.a DESC - } -} {45 43 28 27 26 17 13 10 3} -do_test boundary3-2.52.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=34 - ORDER BY t1.rowid - } -} {10 26 13 43 27 45 17 28 3} -do_test boundary3-2.52.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=34 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10} -do_test boundary3-2.52.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=34 - ORDER BY x - } -} {10 26 13 43 27 45 17 28 3} -do_test boundary3-2.52.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 140737488355328 ORDER BY t2.a - } -} {3 10 13 17 26 27 28 34 43 45} -do_test boundary3-2.52.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 140737488355328 ORDER BY t1.a DESC - } -} {45 43 34 28 27 26 17 13 10 3} -do_test boundary3-2.52.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=34 - ORDER BY t1.rowid - } -} {34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.52.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=34 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34} -do_test boundary3-2.52.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=34 - ORDER BY x - } -} {34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.52.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 140737488355328 ORDER BY t2.a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 25 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.52.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 140737488355328 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 25 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary3-2.52.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=34 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25} -do_test boundary3-2.52.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=34 - ORDER BY t1.rowid DESC - } -} {25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.52.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=34 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.52.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 140737488355328 ORDER BY t2.a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 25 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.52.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 140737488355328 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 25 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary3-2.52.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=34 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34} -do_test boundary3-2.52.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=34 - ORDER BY t1.rowid DESC - } -} {34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.52.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=34 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.53.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=2097151 AND t2.a=t1.a - } -} {15 00000000001fffff} -do_test boundary3-2.53.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='00000000001fffff' - } -} {2097151 15} -do_test boundary3-2.53.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=15 - } -} {2097151 00000000001fffff} -do_test boundary3-2.53.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 2097151 ORDER BY t2.a - } -} {3 6 7 9 10 12 13 14 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 51 56 57} -do_test boundary3-2.53.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 2097151 ORDER BY t1.a DESC - } -} {57 56 51 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 14 13 12 10 9 7 6 3} -do_test boundary3-2.53.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=15 - ORDER BY t1.rowid - } -} {42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.53.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=15 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42} -do_test boundary3-2.53.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=15 - ORDER BY x - } -} {42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.53.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=15 - ORDER BY t1.rowid - } -} {42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.53.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=15 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42} -do_test boundary3-2.53.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 2097151 ORDER BY t2.a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 51 56 57} -do_test boundary3-2.53.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 2097151 ORDER BY t1.a DESC - } -} {57 56 51 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary3-2.53.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=15 - ORDER BY t1.rowid - } -} {15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.53.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=15 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15} -do_test boundary3-2.53.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=15 - ORDER BY x - } -} {15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.53.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=15 - ORDER BY t1.rowid - } -} {15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.53.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=15 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15} -do_test boundary3-2.53.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 2097151 ORDER BY t2.a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.53.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 2097151 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary3-2.53.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=15 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62} -do_test boundary3-2.53.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=15 - ORDER BY t1.rowid DESC - } -} {62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.53.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=15 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.53.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=15 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62} -do_test boundary3-2.53.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=15 - ORDER BY t1.rowid DESC - } -} {62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.53.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 2097151 ORDER BY t2.a - } -} {1 2 4 5 8 11 15 16 21 23 29 30 31 32 33 37 38 41 44 47 48 49 50 52 53 54 55 58 59 60 61 62 63 64} -do_test boundary3-2.53.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 2097151 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 55 54 53 52 50 49 48 47 44 41 38 37 33 32 31 30 29 23 21 16 15 11 8 5 4 2 1} -do_test boundary3-2.53.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=15 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15} -do_test boundary3-2.53.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=15 - ORDER BY t1.rowid DESC - } -} {15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.53.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=15 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.53.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=15 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15} -do_test boundary3-2.53.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=15 - ORDER BY t1.rowid DESC - } -} {15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.54.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=140737488355327 AND t2.a=t1.a - } -} {25 00007fffffffffff} -do_test boundary3-2.54.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='00007fffffffffff' - } -} {140737488355327 25} -do_test boundary3-2.54.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=25 - } -} {140737488355327 00007fffffffffff} -do_test boundary3-2.54.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 140737488355327 ORDER BY t2.a - } -} {3 10 13 17 26 27 28 34 43 45} -do_test boundary3-2.54.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 140737488355327 ORDER BY t1.a DESC - } -} {45 43 34 28 27 26 17 13 10 3} -do_test boundary3-2.54.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=25 - ORDER BY t1.rowid - } -} {34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.54.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=25 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34} -do_test boundary3-2.54.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=25 - ORDER BY x - } -} {34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.54.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 140737488355327 ORDER BY t2.a - } -} {3 10 13 17 25 26 27 28 34 43 45} -do_test boundary3-2.54.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 140737488355327 ORDER BY t1.a DESC - } -} {45 43 34 28 27 26 25 17 13 10 3} -do_test boundary3-2.54.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=25 - ORDER BY t1.rowid - } -} {25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.54.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=25 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25} -do_test boundary3-2.54.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=25 - ORDER BY x - } -} {25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.54.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 140737488355327 ORDER BY t2.a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.54.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 140737488355327 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary3-2.54.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=25 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56} -do_test boundary3-2.54.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=25 - ORDER BY t1.rowid DESC - } -} {56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.54.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=25 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.54.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 140737488355327 ORDER BY t2.a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 25 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.54.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 140737488355327 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 25 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary3-2.54.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=25 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25} -do_test boundary3-2.54.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=25 - ORDER BY t1.rowid DESC - } -} {25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.54.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=25 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.55.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=281474976710656 AND t2.a=t1.a - } -} {26 0001000000000000} -do_test boundary3-2.55.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='0001000000000000' - } -} {281474976710656 26} -do_test boundary3-2.55.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=26 - } -} {281474976710656 0001000000000000} -do_test boundary3-2.55.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 281474976710656 ORDER BY t2.a - } -} {3 13 17 27 28 43 45} -do_test boundary3-2.55.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 281474976710656 ORDER BY t1.a DESC - } -} {45 43 28 27 17 13 3} -do_test boundary3-2.55.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=26 - ORDER BY t1.rowid - } -} {13 43 27 45 17 28 3} -do_test boundary3-2.55.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=26 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13} -do_test boundary3-2.55.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=26 - ORDER BY x - } -} {13 43 27 45 17 28 3} -do_test boundary3-2.55.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 281474976710656 ORDER BY t2.a - } -} {3 13 17 26 27 28 43 45} -do_test boundary3-2.55.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 281474976710656 ORDER BY t1.a DESC - } -} {45 43 28 27 26 17 13 3} -do_test boundary3-2.55.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=26 - ORDER BY t1.rowid - } -} {26 13 43 27 45 17 28 3} -do_test boundary3-2.55.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=26 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26} -do_test boundary3-2.55.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=26 - ORDER BY x - } -} {26 13 43 27 45 17 28 3} -do_test boundary3-2.55.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 281474976710656 ORDER BY t2.a - } -} {1 2 4 5 6 7 8 9 10 11 12 14 15 16 18 19 20 21 22 23 24 25 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.55.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 281474976710656 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 25 24 23 22 21 20 19 18 16 15 14 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary3-2.55.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=26 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10} -do_test boundary3-2.55.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=26 - ORDER BY t1.rowid DESC - } -} {10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.55.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=26 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.55.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 281474976710656 ORDER BY t2.a - } -} {1 2 4 5 6 7 8 9 10 11 12 14 15 16 18 19 20 21 22 23 24 25 26 29 30 31 32 33 34 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.55.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 281474976710656 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 34 33 32 31 30 29 26 25 24 23 22 21 20 19 18 16 15 14 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary3-2.55.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=26 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26} -do_test boundary3-2.55.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=26 - ORDER BY t1.rowid DESC - } -} {26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.55.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=26 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.56.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=32767 AND t2.a=t1.a - } -} {23 0000000000007fff} -do_test boundary3-2.56.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='0000000000007fff' - } -} {32767 23} -do_test boundary3-2.56.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=23 - } -} {32767 0000000000007fff} -do_test boundary3-2.56.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 32767 ORDER BY t2.a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary3-2.56.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 32767 ORDER BY t1.a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary3-2.56.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=23 - ORDER BY t1.rowid - } -} {50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.56.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=23 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50} -do_test boundary3-2.56.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=23 - ORDER BY x - } -} {50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.56.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=23 - ORDER BY t1.rowid - } -} {50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.56.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=23 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50} -do_test boundary3-2.56.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 32767 ORDER BY t2.a - } -} {3 6 7 9 10 12 13 14 15 17 18 19 20 22 23 24 25 26 27 28 34 35 36 39 40 42 43 45 46 48 50 51 56 57 62} -do_test boundary3-2.56.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 32767 ORDER BY t1.a DESC - } -} {62 57 56 51 50 48 46 45 43 42 40 39 36 35 34 28 27 26 25 24 23 22 20 19 18 17 15 14 13 12 10 9 7 6 3} -do_test boundary3-2.56.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=23 - ORDER BY t1.rowid - } -} {23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.56.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=23 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23} -do_test boundary3-2.56.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=23 - ORDER BY x - } -} {23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.56.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=23 - ORDER BY t1.rowid - } -} {23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.56.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=23 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23} -do_test boundary3-2.56.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 32767 ORDER BY t2.a - } -} {1 2 4 5 8 11 16 21 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary3-2.56.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 32767 ORDER BY t1.a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 21 16 11 8 5 4 2 1} -do_test boundary3-2.56.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=23 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16} -do_test boundary3-2.56.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=23 - ORDER BY t1.rowid DESC - } -} {16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.56.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=23 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.56.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=23 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16} -do_test boundary3-2.56.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=23 - ORDER BY t1.rowid DESC - } -} {16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.56.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 32767 ORDER BY t2.a - } -} {1 2 4 5 8 11 16 21 23 29 30 31 32 33 37 38 41 44 47 49 52 53 54 55 58 59 60 61 63 64} -do_test boundary3-2.56.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 32767 ORDER BY t1.a DESC - } -} {64 63 61 60 59 58 55 54 53 52 49 47 44 41 38 37 33 32 31 30 29 23 21 16 11 8 5 4 2 1} -do_test boundary3-2.56.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=23 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23} -do_test boundary3-2.56.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=23 - ORDER BY t1.rowid DESC - } -} {23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.56.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=23 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.56.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=23 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23} -do_test boundary3-2.56.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=23 - ORDER BY t1.rowid DESC - } -} {23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.57.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=127 AND t2.a=t1.a - } -} {4 000000000000007f} -do_test boundary3-2.57.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='000000000000007f' - } -} {127 4} -do_test boundary3-2.57.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=4 - } -} {127 000000000000007f} -do_test boundary3-2.57.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 127 ORDER BY t2.a - } -} {3 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary3-2.57.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 127 ORDER BY t1.a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 3} -do_test boundary3-2.57.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=4 - ORDER BY t1.rowid - } -} {49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.57.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=4 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49} -do_test boundary3-2.57.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=4 - ORDER BY x - } -} {49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.57.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=4 - ORDER BY t1.rowid - } -} {49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.57.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=4 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49} -do_test boundary3-2.57.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 127 ORDER BY t2.a - } -} {3 4 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary3-2.57.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 127 ORDER BY t1.a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 4 3} -do_test boundary3-2.57.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=4 - ORDER BY t1.rowid - } -} {4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.57.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=4 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4} -do_test boundary3-2.57.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=4 - ORDER BY x - } -} {4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.57.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=4 - ORDER BY t1.rowid - } -} {4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.57.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=4 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4} -do_test boundary3-2.57.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 127 ORDER BY t2.a - } -} {1 2 5 11 21 29 31 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary3-2.57.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 127 ORDER BY t1.a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 31 29 21 11 5 2 1} -do_test boundary3-2.57.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=4 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31} -do_test boundary3-2.57.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=4 - ORDER BY t1.rowid DESC - } -} {31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.57.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=4 - ORDER BY x - } -} {59 60 41 5 31 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.57.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=4 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31} -do_test boundary3-2.57.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=4 - ORDER BY t1.rowid DESC - } -} {31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.57.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 127 ORDER BY t2.a - } -} {1 2 4 5 11 21 29 31 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary3-2.57.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 127 ORDER BY t1.a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 31 29 21 11 5 4 2 1} -do_test boundary3-2.57.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=4 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4} -do_test boundary3-2.57.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=4 - ORDER BY t1.rowid DESC - } -} {4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.57.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=4 - ORDER BY x - } -} {59 60 41 5 31 4 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.57.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=4 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4} -do_test boundary3-2.57.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=4 - ORDER BY t1.rowid DESC - } -} {4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.58.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=36028797018963967 AND t2.a=t1.a - } -} {27 007fffffffffffff} -do_test boundary3-2.58.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='007fffffffffffff' - } -} {36028797018963967 27} -do_test boundary3-2.58.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=27 - } -} {36028797018963967 007fffffffffffff} -do_test boundary3-2.58.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 36028797018963967 ORDER BY t2.a - } -} {3 17 28 45} -do_test boundary3-2.58.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 36028797018963967 ORDER BY t1.a DESC - } -} {45 28 17 3} -do_test boundary3-2.58.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=27 - ORDER BY t1.rowid - } -} {45 17 28 3} -do_test boundary3-2.58.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=27 - ORDER BY t1.rowid DESC - } -} {3 28 17 45} -do_test boundary3-2.58.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=27 - ORDER BY x - } -} {45 17 28 3} -do_test boundary3-2.58.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 36028797018963967 ORDER BY t2.a - } -} {3 17 27 28 45} -do_test boundary3-2.58.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 36028797018963967 ORDER BY t1.a DESC - } -} {45 28 27 17 3} -do_test boundary3-2.58.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=27 - ORDER BY t1.rowid - } -} {27 45 17 28 3} -do_test boundary3-2.58.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=27 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27} -do_test boundary3-2.58.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=27 - ORDER BY x - } -} {27 45 17 28 3} -do_test boundary3-2.58.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 36028797018963967 ORDER BY t2.a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.58.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 36028797018963967 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary3-2.58.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=27 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43} -do_test boundary3-2.58.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=27 - ORDER BY t1.rowid DESC - } -} {43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.58.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=27 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.58.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 36028797018963967 ORDER BY t2.a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.58.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 36028797018963967 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 27 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary3-2.58.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=27 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27} -do_test boundary3-2.58.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=27 - ORDER BY t1.rowid DESC - } -} {27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.58.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=27 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.59.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=4398046511104 AND t2.a=t1.a - } -} {56 0000040000000000} -do_test boundary3-2.59.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='0000040000000000' - } -} {4398046511104 56} -do_test boundary3-2.59.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=56 - } -} {4398046511104 0000040000000000} -do_test boundary3-2.59.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 4398046511104 ORDER BY t2.a - } -} {3 10 13 17 25 26 27 28 34 43 45} -do_test boundary3-2.59.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 4398046511104 ORDER BY t1.a DESC - } -} {45 43 34 28 27 26 25 17 13 10 3} -do_test boundary3-2.59.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=56 - ORDER BY t1.rowid - } -} {25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.59.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=56 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25} -do_test boundary3-2.59.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=56 - ORDER BY x - } -} {25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.59.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=56 - ORDER BY t1.rowid - } -} {25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.59.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=56 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25} -do_test boundary3-2.59.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 4398046511104 ORDER BY t2.a - } -} {3 10 13 17 25 26 27 28 34 43 45 56} -do_test boundary3-2.59.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 4398046511104 ORDER BY t1.a DESC - } -} {56 45 43 34 28 27 26 25 17 13 10 3} -do_test boundary3-2.59.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=56 - ORDER BY t1.rowid - } -} {56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.59.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=56 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56} -do_test boundary3-2.59.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=56 - ORDER BY x - } -} {56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.59.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=56 - ORDER BY t1.rowid - } -} {56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.59.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=56 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56} -do_test boundary3-2.59.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 4398046511104 ORDER BY t2.a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 57 58 59 60 61 62 63 64} -do_test boundary3-2.59.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 4398046511104 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary3-2.59.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=56 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7} -do_test boundary3-2.59.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=56 - ORDER BY t1.rowid DESC - } -} {7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.59.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=56 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.59.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=56 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7} -do_test boundary3-2.59.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=56 - ORDER BY t1.rowid DESC - } -} {7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.59.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 4398046511104 ORDER BY t2.a - } -} {1 2 4 5 6 7 8 9 11 12 14 15 16 18 19 20 21 22 23 24 29 30 31 32 33 35 36 37 38 39 40 41 42 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.59.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 4398046511104 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 42 41 40 39 38 37 36 35 33 32 31 30 29 24 23 22 21 20 19 18 16 15 14 12 11 9 8 7 6 5 4 2 1} -do_test boundary3-2.59.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=56 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56} -do_test boundary3-2.59.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=56 - ORDER BY t1.rowid DESC - } -} {56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.59.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=56 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.59.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=56 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56} -do_test boundary3-2.59.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=56 - ORDER BY t1.rowid DESC - } -} {56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.60.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=1 AND t2.a=t1.a - } -} {60 0000000000000001} -do_test boundary3-2.60.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='0000000000000001' - } -} {1 60} -do_test boundary3-2.60.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=60 - } -} {1 0000000000000001} -do_test boundary3-2.60.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 1 ORDER BY t2.a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 41 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary3-2.60.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 1 ORDER BY t1.a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 41 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary3-2.60.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=60 - ORDER BY t1.rowid - } -} {41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.60.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=60 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41} -do_test boundary3-2.60.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=60 - ORDER BY x - } -} {41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.60.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=60 - ORDER BY t1.rowid - } -} {41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.60.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=60 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41} -do_test boundary3-2.60.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 1 ORDER BY t2.a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 41 42 43 45 46 48 49 50 51 56 57 60 61 62} -do_test boundary3-2.60.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 1 ORDER BY t1.a DESC - } -} {62 61 60 57 56 51 50 49 48 46 45 43 42 41 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary3-2.60.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=60 - ORDER BY t1.rowid - } -} {60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.60.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=60 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60} -do_test boundary3-2.60.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=60 - ORDER BY x - } -} {60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.60.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=60 - ORDER BY t1.rowid - } -} {60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.60.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=60 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60} -do_test boundary3-2.60.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 1 ORDER BY t2.a - } -} {1 2 11 21 29 32 33 37 38 44 47 52 53 54 55 58 59 63 64} -do_test boundary3-2.60.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 1 ORDER BY t1.a DESC - } -} {64 63 59 58 55 54 53 52 47 44 38 37 33 32 29 21 11 2 1} -do_test boundary3-2.60.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=60 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59} -do_test boundary3-2.60.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=60 - ORDER BY t1.rowid DESC - } -} {59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.60.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=60 - ORDER BY x - } -} {59 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.60.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=60 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59} -do_test boundary3-2.60.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=60 - ORDER BY t1.rowid DESC - } -} {59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.60.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 1 ORDER BY t2.a - } -} {1 2 11 21 29 32 33 37 38 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary3-2.60.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 1 ORDER BY t1.a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 38 37 33 32 29 21 11 2 1} -do_test boundary3-2.60.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=60 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60} -do_test boundary3-2.60.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=60 - ORDER BY t1.rowid DESC - } -} {60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.60.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=60 - ORDER BY x - } -} {59 60 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.60.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=60 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60} -do_test boundary3-2.60.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=60 - ORDER BY t1.rowid DESC - } -} {60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.61.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=36028797018963968 AND t2.a=t1.a - } -} {45 0080000000000000} -do_test boundary3-2.61.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='0080000000000000' - } -} {36028797018963968 45} -do_test boundary3-2.61.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=45 - } -} {36028797018963968 0080000000000000} -do_test boundary3-2.61.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 36028797018963968 ORDER BY t2.a - } -} {3 17 28} -do_test boundary3-2.61.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 36028797018963968 ORDER BY t1.a DESC - } -} {28 17 3} -do_test boundary3-2.61.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=45 - ORDER BY t1.rowid - } -} {17 28 3} -do_test boundary3-2.61.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=45 - ORDER BY t1.rowid DESC - } -} {3 28 17} -do_test boundary3-2.61.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=45 - ORDER BY x - } -} {17 28 3} -do_test boundary3-2.61.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 36028797018963968 ORDER BY t2.a - } -} {3 17 28 45} -do_test boundary3-2.61.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 36028797018963968 ORDER BY t1.a DESC - } -} {45 28 17 3} -do_test boundary3-2.61.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=45 - ORDER BY t1.rowid - } -} {45 17 28 3} -do_test boundary3-2.61.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=45 - ORDER BY t1.rowid DESC - } -} {3 28 17 45} -do_test boundary3-2.61.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=45 - ORDER BY x - } -} {45 17 28 3} -do_test boundary3-2.61.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 36028797018963968 ORDER BY t2.a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.61.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 36028797018963968 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 27 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary3-2.61.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=45 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27} -do_test boundary3-2.61.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=45 - ORDER BY t1.rowid DESC - } -} {27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.61.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=45 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.61.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 36028797018963968 ORDER BY t2.a - } -} {1 2 4 5 6 7 8 9 10 11 12 13 14 15 16 18 19 20 21 22 23 24 25 26 27 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.61.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 36028797018963968 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 27 26 25 24 23 22 21 20 19 18 16 15 14 13 12 11 10 9 8 7 6 5 4 2 1} -do_test boundary3-2.61.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=45 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45} -do_test boundary3-2.61.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=45 - ORDER BY t1.rowid DESC - } -} {45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.61.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=45 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.62.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=-2147483649 AND t2.a=t1.a - } -} {47 ffffffff7fffffff} -do_test boundary3-2.62.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='ffffffff7fffffff' - } -} {-2147483649 47} -do_test boundary3-2.62.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=47 - } -} {-2147483649 ffffffff7fffffff} -do_test boundary3-2.62.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > -2147483649 ORDER BY t2.a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary3-2.62.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > -2147483649 ORDER BY t1.a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary3-2.62.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=47 - ORDER BY t1.rowid - } -} {11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.62.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=47 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11} -do_test boundary3-2.62.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=47 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.62.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=47 - ORDER BY t1.rowid - } -} {11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.62.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=47 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11} -do_test boundary3-2.62.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= -2147483649 ORDER BY t2.a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 45 46 47 48 49 50 51 52 53 54 56 57 59 60 61 62} -do_test boundary3-2.62.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= -2147483649 ORDER BY t1.a DESC - } -} {62 61 60 59 57 56 54 53 52 51 50 49 48 47 46 45 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary3-2.62.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=47 - ORDER BY t1.rowid - } -} {47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.62.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=47 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47} -do_test boundary3-2.62.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=47 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.62.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=47 - ORDER BY t1.rowid - } -} {47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.62.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=47 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47} -do_test boundary3-2.62.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < -2147483649 ORDER BY t2.a - } -} {2 21 44 55 58 63 64} -do_test boundary3-2.62.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < -2147483649 ORDER BY t1.a DESC - } -} {64 63 58 55 44 21 2} -do_test boundary3-2.62.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=47 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63} -do_test boundary3-2.62.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=47 - ORDER BY t1.rowid DESC - } -} {63 58 44 21 64 2 55} -do_test boundary3-2.62.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=47 - ORDER BY x - } -} {55 2 64 21 44 58 63} -do_test boundary3-2.62.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=47 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63} -do_test boundary3-2.62.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=47 - ORDER BY t1.rowid DESC - } -} {63 58 44 21 64 2 55} -do_test boundary3-2.62.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= -2147483649 ORDER BY t2.a - } -} {2 21 44 47 55 58 63 64} -do_test boundary3-2.62.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= -2147483649 ORDER BY t1.a DESC - } -} {64 63 58 55 47 44 21 2} -do_test boundary3-2.62.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=47 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47} -do_test boundary3-2.62.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=47 - ORDER BY t1.rowid DESC - } -} {47 63 58 44 21 64 2 55} -do_test boundary3-2.62.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=47 - ORDER BY x - } -} {55 2 64 21 44 58 63 47} -do_test boundary3-2.62.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=47 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47} -do_test boundary3-2.62.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=47 - ORDER BY t1.rowid DESC - } -} {47 63 58 44 21 64 2 55} -do_test boundary3-2.63.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=-36028797018963969 AND t2.a=t1.a - } -} {2 ff7fffffffffffff} -do_test boundary3-2.63.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='ff7fffffffffffff' - } -} {-36028797018963969 2} -do_test boundary3-2.63.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=2 - } -} {-36028797018963969 ff7fffffffffffff} -do_test boundary3-2.63.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > -36028797018963969 ORDER BY t2.a - } -} {1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.63.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > -36028797018963969 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 1} -do_test boundary3-2.63.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=2 - ORDER BY t1.rowid - } -} {64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.63.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=2 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64} -do_test boundary3-2.63.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=2 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.63.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= -36028797018963969 ORDER BY t2.a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.63.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= -36028797018963969 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary3-2.63.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=2 - ORDER BY t1.rowid - } -} {2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.63.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=2 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2} -do_test boundary3-2.63.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=2 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.63.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < -36028797018963969 ORDER BY t2.a - } -} {55} -do_test boundary3-2.63.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < -36028797018963969 ORDER BY t1.a DESC - } -} {55} -do_test boundary3-2.63.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=2 - ORDER BY t1.rowid - } -} {55} -do_test boundary3-2.63.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=2 - ORDER BY t1.rowid DESC - } -} {55} -do_test boundary3-2.63.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=2 - ORDER BY x - } -} {55} -do_test boundary3-2.63.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= -36028797018963969 ORDER BY t2.a - } -} {2 55} -do_test boundary3-2.63.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= -36028797018963969 ORDER BY t1.a DESC - } -} {55 2} -do_test boundary3-2.63.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=2 - ORDER BY t1.rowid - } -} {55 2} -do_test boundary3-2.63.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=2 - ORDER BY t1.rowid DESC - } -} {2 55} -do_test boundary3-2.63.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=2 - ORDER BY x - } -} {55 2} -do_test boundary3-2.64.1 { - db eval { - SELECT t1.* FROM t1, t2 WHERE t1.rowid=3 AND t2.a=t1.a - } -} {5 0000000000000003} -do_test boundary3-2.64.2 { - db eval { - SELECT t2.* FROM t1 JOIN t2 USING(a) WHERE x='0000000000000003' - } -} {3 5} -do_test boundary3-2.64.3 { - db eval { - SELECT t1.rowid, x FROM t1 JOIN t2 ON t2.r=t1.rowid WHERE t2.a=5 - } -} {3 0000000000000003} -do_test boundary3-2.64.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 3 ORDER BY t2.a - } -} {3 4 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary3-2.64.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 3 ORDER BY t1.a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 4 3} -do_test boundary3-2.64.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=5 - ORDER BY t1.rowid - } -} {31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.64.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=5 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31} -do_test boundary3-2.64.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=5 - ORDER BY x - } -} {31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.64.gt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=5 - ORDER BY t1.rowid - } -} {31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.64.gt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > CAST(t2.r AS real) - WHERE t2.a=5 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31} -do_test boundary3-2.64.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 3 ORDER BY t2.a - } -} {3 4 5 6 7 8 9 10 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 30 31 34 35 36 39 40 42 43 45 46 48 49 50 51 56 57 61 62} -do_test boundary3-2.64.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 3 ORDER BY t1.a DESC - } -} {62 61 57 56 51 50 49 48 46 45 43 42 40 39 36 35 34 31 30 28 27 26 25 24 23 22 20 19 18 17 16 15 14 13 12 10 9 8 7 6 5 4 3} -do_test boundary3-2.64.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=5 - ORDER BY t1.rowid - } -} {5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.64.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=5 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5} -do_test boundary3-2.64.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=5 - ORDER BY x - } -} {5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.64.ge.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=5 - ORDER BY t1.rowid - } -} {5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.64.ge.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= CAST(t2.r AS real) - WHERE t2.a=5 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5} -do_test boundary3-2.64.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 3 ORDER BY t2.a - } -} {1 2 11 21 29 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary3-2.64.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 3 ORDER BY t1.a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 29 21 11 2 1} -do_test boundary3-2.64.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=5 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41} -do_test boundary3-2.64.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=5 - ORDER BY t1.rowid DESC - } -} {41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.64.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=5 - ORDER BY x - } -} {59 60 41 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.64.lt.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=5 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41} -do_test boundary3-2.64.lt.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < CAST(t2.r AS real) - WHERE t2.a=5 - ORDER BY t1.rowid DESC - } -} {41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.64.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 3 ORDER BY t2.a - } -} {1 2 5 11 21 29 32 33 37 38 41 44 47 52 53 54 55 58 59 60 63 64} -do_test boundary3-2.64.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 3 ORDER BY t1.a DESC - } -} {64 63 60 59 58 55 54 53 52 47 44 41 38 37 33 32 29 21 11 5 2 1} -do_test boundary3-2.64.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=5 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5} -do_test boundary3-2.64.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=5 - ORDER BY t1.rowid DESC - } -} {5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.64.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=5 - ORDER BY x - } -} {59 60 41 5 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.64.le.10 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=5 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5} -do_test boundary3-2.64.le.11 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= CAST(t2.r AS real) - WHERE t2.a=5 - ORDER BY t1.rowid DESC - } -} {5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.65.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > 9.22337303685477580800e+18 ORDER BY t2.a - } -} {} -do_test boundary3-2.65.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > 9.22337303685477580800e+18 ORDER BY t1.a DESC - } -} {} -do_test boundary3-2.65.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=65 - ORDER BY t1.rowid - } -} {} -do_test boundary3-2.65.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=65 - ORDER BY t1.rowid DESC - } -} {} -do_test boundary3-2.65.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=65 - ORDER BY x - } -} {} -do_test boundary3-2.65.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= 9.22337303685477580800e+18 ORDER BY t2.a - } -} {} -do_test boundary3-2.65.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= 9.22337303685477580800e+18 ORDER BY t1.a DESC - } -} {} -do_test boundary3-2.65.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=65 - ORDER BY t1.rowid - } -} {} -do_test boundary3-2.65.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=65 - ORDER BY t1.rowid DESC - } -} {} -do_test boundary3-2.65.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=65 - ORDER BY x - } -} {} -do_test boundary3-2.65.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < 9.22337303685477580800e+18 ORDER BY t2.a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.65.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < 9.22337303685477580800e+18 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary3-2.65.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=65 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.65.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=65 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.65.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=65 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.65.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= 9.22337303685477580800e+18 ORDER BY t2.a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.65.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= 9.22337303685477580800e+18 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary3-2.65.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=65 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.65.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=65 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.65.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=65 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.66.gt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid > -9.22337303685477580800e+18 ORDER BY t2.a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.66.gt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid > -9.22337303685477580800e+18 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary3-2.66.gt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=66 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.66.gt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=66 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.66.gt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid > t2.r - WHERE t2.a=66 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.66.ge.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid >= -9.22337303685477580800e+18 ORDER BY t2.a - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64} -do_test boundary3-2.66.ge.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid >= -9.22337303685477580800e+18 ORDER BY t1.a DESC - } -} {64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1} -do_test boundary3-2.66.ge.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=66 - ORDER BY t1.rowid - } -} {55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38 59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3} -do_test boundary3-2.66.ge.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=66 - ORDER BY t1.rowid DESC - } -} {3 28 17 45 27 43 13 26 10 34 25 56 7 19 57 35 46 22 39 36 14 51 20 40 12 6 9 24 18 42 15 62 48 50 23 16 8 61 30 49 4 31 5 41 60 59 38 33 52 53 54 32 29 37 1 11 47 63 58 44 21 64 2 55} -do_test boundary3-2.66.ge.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid >= t2.r - WHERE t2.a=66 - ORDER BY x - } -} {59 60 41 5 31 4 49 30 61 8 16 23 50 48 62 15 42 18 24 9 6 12 40 20 51 14 36 39 22 46 35 57 19 7 56 25 34 10 26 13 43 27 45 17 28 3 55 2 64 21 44 58 63 47 11 1 37 29 32 54 53 52 33 38} -do_test boundary3-2.66.lt.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid < -9.22337303685477580800e+18 ORDER BY t2.a - } -} {} -do_test boundary3-2.66.lt.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid < -9.22337303685477580800e+18 ORDER BY t1.a DESC - } -} {} -do_test boundary3-2.66.lt.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=66 - ORDER BY t1.rowid - } -} {} -do_test boundary3-2.66.lt.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=66 - ORDER BY t1.rowid DESC - } -} {} -do_test boundary3-2.66.lt.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid < t2.r - WHERE t2.a=66 - ORDER BY x - } -} {} -do_test boundary3-2.66.le.1 { - db eval { - SELECT t2.a FROM t1 JOIN t2 USING(a) - WHERE t1.rowid <= -9.22337303685477580800e+18 ORDER BY t2.a - } -} {} -do_test boundary3-2.66.le.2 { - db eval { - SELECT t2.a FROM t2 NATURAL JOIN t1 - WHERE t1.rowid <= -9.22337303685477580800e+18 ORDER BY t1.a DESC - } -} {} -do_test boundary3-2.66.le.3 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=66 - ORDER BY t1.rowid - } -} {} -do_test boundary3-2.66.le.4 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=66 - ORDER BY t1.rowid DESC - } -} {} -do_test boundary3-2.66.le.5 { - db eval { - SELECT t1.a FROM t1 JOIN t2 ON t1.rowid <= t2.r - WHERE t2.a=66 - ORDER BY x - } -} {} -finish_test DELETED test/boundary4.tcl Index: test/boundary4.tcl ================================================================== --- test/boundary4.tcl +++ /dev/null @@ -1,339 +0,0 @@ -puts {# 2008 December 11 -# -# The author disclaims copyright to this source code. In place of -# a legal notice, here is a blessing: -# -# May you do good and not evil. -# May you find forgiveness for yourself and forgive others. -# May you share freely, never taking more than you give. -# -#*********************************************************************** -# This file implements regression tests for SQLite library. -# -# This file is automatically generated from a separate TCL script. -# This file seeks to exercise integer boundary values. -# -# $Id: boundary4.tcl,v 1.3 2009/01/02 15:45:48 shane Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -# Many of the boundary tests depend on a working 64-bit implementation. -if {![working_64bit_int]} { finish_test; return } -} - -expr srand(0) - -# Generate interesting boundary numbers -# -foreach x { - 0x7f - 0x7fff - 0x7fffff - 0x7fffffff - 0x7fffffffff - 0x7fffffffffff - 0x7fffffffffffff - 0x7fffffffffffffff -} { - set x [expr {wide($x)}] - set boundarynum($x) 1 - set boundarynum([expr {$x+1}]) 1 - set boundarynum([expr {-($x+1)}]) 1 - set boundarynum([expr {-($x+2)}]) 1 - set boundarynum([expr {$x+$x+1}]) 1 - set boundarynum([expr {$x+$x+2}]) 1 -} -set x [expr {wide(127)}] -for {set i 127} {$i<=9} {incr i} { - set boundarynum($x) 1 - set boundarynum([expr {$x+1}]) 1 - set x [expr {wide($x*128 + 127)}] -} - -# Scramble the $inlist into a random order. -# -proc scramble {inlist} { - set y {} - foreach x $inlist { - lappend y [list [expr {rand()}] $x] - } - set y [lsort $y] - set outlist {} - foreach x $y { - lappend outlist [lindex $x 1] - } - return $outlist -} - -# A simple selection sort. Not trying to be efficient. -# -proc sort {inlist} { - set outlist {} - set mn [lindex $inlist 0] - foreach x $inlist { - if {$x<$mn} {set mn $x} - } - set outlist $mn - set mx $mn - while {1} { - set valid 0 - foreach x $inlist { - if {$x>$mx && (!$valid || $mn>$x)} { - set mn $x - set valid 1 - } - } - if {!$valid} break - lappend outlist $mn - set mx $mn - } - return $outlist -} - -# Reverse the order of a list -# -proc reverse {inlist} { - set i [llength $inlist] - set outlist {} - for {incr i -1} {$i>=0} {incr i -1} { - lappend outlist [lindex $inlist $i] - } - return $outlist -} - -set nums1 [scramble [array names boundarynum]] -set nums2 [scramble [array names boundarynum]] - -set tname boundary4 -puts "do_test $tname-1.1 \173" -puts " db eval \173" -puts " CREATE TABLE t1(a,x);" -set a 0 -set all_rowid {} -set all_a {} -set all_x {} -foreach r $nums1 { - incr a - set t1ra($r) $a - set t1ar($a) $r - set x [format %08x%08x [expr {wide($r)>>32}] $r] - set t1rx($r) $x - set t1xr($x) $r - puts " INSERT INTO t1(oid,a,x) VALUES($r,$a,'$x');" - lappend all_rowid $r - lappend all_a $a - lappend all_x $x -} -puts " CREATE INDEX t1i1 ON t1(a);" -puts " CREATE INDEX t1i2 ON t1(x);" -puts " \175" -puts "\175 {}" - -puts "do_test $tname-1.2 \173" -puts " db eval \173" -puts " SELECT count(*) FROM t1" -puts " \175" -puts "\175 {[llength $nums1]}" - -proc maketest {tnum sql answer} { - puts "do_test $::tname-$tnum \173" - puts " db eval \173" - puts " $sql" - puts " \175" - puts "\175 {$answer}" -} - -set ans {} -foreach r [sort $all_rowid] { - lappend ans $r $t1ra($r) $t1rx($r) -} -maketest 1.3 {SELECT rowid, a, x FROM t1 ORDER BY +rowid} $ans -maketest 1.4 {SELECT rowid, a, x FROM t1 ORDER BY rowid} $ans - -set ans {} -foreach r [reverse [sort $all_rowid]] { - lappend ans $r $t1ra($r) $t1rx($r) -} -maketest 1.5 {SELECT rowid, a, x FROM t1 ORDER BY +rowid DESC} $ans -maketest 1.6 {SELECT rowid, a, x FROM t1 ORDER BY rowid DESC} $ans - -set ans {} -foreach a [sort $all_a] { - set r $t1ar($a) - lappend ans $r $a $t1rx($r) -} -maketest 1.7 {SELECT rowid, a, x FROM t1 ORDER BY +a} $ans -maketest 1.8 {SELECT rowid, a, x FROM t1 ORDER BY a} $ans - -set ans {} -foreach a [reverse [sort $all_a]] { - set r $t1ar($a) - lappend ans $r $a $t1rx($r) -} -maketest 1.9 {SELECT rowid, a, x FROM t1 ORDER BY +a DESC} $ans -maketest 1.10 {SELECT rowid, a, x FROM t1 ORDER BY a DESC} $ans - -set ans {} -foreach x [sort $all_x] { - set r $t1xr($x) - lappend ans $r $t1ra($r) $x -} -maketest 1.11 {SELECT rowid, a, x FROM t1 ORDER BY +x} $ans -maketest 1.12 {SELECT rowid, a, x FROM t1 ORDER BY x} $ans - -set ans {} -foreach x [reverse [sort $all_x]] { - set r $t1xr($x) - lappend ans $r $t1ra($r) $x -} -maketest 1.13 {SELECT rowid, a, x FROM t1 ORDER BY +x DESC} $ans -maketest 1.14 {SELECT rowid, a, x FROM t1 ORDER BY x DESC} $ans - -maketest 2.1 {UPDATE t1 SET rowid=a, a=rowid} {} - -set ans {} -foreach r [sort $all_rowid] { - lappend ans $r $t1ra($r) $t1rx($r) -} -maketest 2.3 {SELECT a, rowid, x FROM t1 ORDER BY +a} $ans -maketest 2.4 {SELECT a, rowid, x FROM t1 ORDER BY a} $ans - -set ans {} -foreach r [reverse [sort $all_rowid]] { - lappend ans $r $t1ra($r) $t1rx($r) -} -maketest 2.5 {SELECT a, rowid, x FROM t1 ORDER BY +a DESC} $ans -maketest 2.6 {SELECT a, rowid, x FROM t1 ORDER BY a DESC} $ans - -set ans {} -foreach a [sort $all_a] { - set r $t1ar($a) - lappend ans $r $a $t1rx($r) -} -maketest 2.7 {SELECT a, rowid, x FROM t1 ORDER BY +rowid} $ans -maketest 2.8 {SELECT a, rowid, x FROM t1 ORDER BY rowid} $ans - -set ans {} -foreach a [reverse [sort $all_a]] { - set r $t1ar($a) - lappend ans $r $a $t1rx($r) -} -maketest 2.9 {SELECT a, rowid, x FROM t1 ORDER BY +rowid DESC} $ans -maketest 2.10 {SELECT a, rowid, x FROM t1 ORDER BY rowid DESC} $ans - -set ans {} -foreach x [sort $all_x] { - set r $t1xr($x) - lappend ans $r $t1ra($r) $x -} -maketest 2.11 {SELECT a, rowid, x FROM t1 ORDER BY +x} $ans -maketest 2.12 {SELECT a, rowid, x FROM t1 ORDER BY x} $ans - -set ans {} -foreach x [reverse [sort $all_x]] { - set r $t1xr($x) - lappend ans $r $t1ra($r) $x -} -maketest 2.13 {SELECT a, rowid, x FROM t1 ORDER BY +x DESC} $ans -maketest 2.14 {SELECT a, rowid, x FROM t1 ORDER BY x DESC} $ans - -maketest 3.1 {UPDATE t1 SET rowid=a, a=rowid} {} -maketest 3.2 {ALTER TABLE t1 ADD COLUMN z; UPDATE t1 SET z=zeroblob(600)} {} - -set ans {} -foreach r [sort $all_rowid] { - lappend ans $r $t1ra($r) $t1rx($r) -} -maketest 3.3 {SELECT rowid, a, x FROM t1 ORDER BY +rowid} $ans -maketest 3.4 {SELECT rowid, a, x FROM t1 ORDER BY rowid} $ans - -set ans {} -foreach r [reverse [sort $all_rowid]] { - lappend ans $r $t1ra($r) $t1rx($r) -} -maketest 3.5 {SELECT rowid, a, x FROM t1 ORDER BY +rowid DESC} $ans -maketest 3.6 {SELECT rowid, a, x FROM t1 ORDER BY rowid DESC} $ans - -set ans {} -foreach a [sort $all_a] { - set r $t1ar($a) - lappend ans $r $a $t1rx($r) -} -maketest 3.7 {SELECT rowid, a, x FROM t1 ORDER BY +a} $ans -maketest 3.8 {SELECT rowid, a, x FROM t1 ORDER BY a} $ans - -set ans {} -foreach a [reverse [sort $all_a]] { - set r $t1ar($a) - lappend ans $r $a $t1rx($r) -} -maketest 3.9 {SELECT rowid, a, x FROM t1 ORDER BY +a DESC} $ans -maketest 3.10 {SELECT rowid, a, x FROM t1 ORDER BY a DESC} $ans - -set ans {} -foreach x [sort $all_x] { - set r $t1xr($x) - lappend ans $r $t1ra($r) $x -} -maketest 3.11 {SELECT rowid, a, x FROM t1 ORDER BY +x} $ans -maketest 3.12 {SELECT rowid, a, x FROM t1 ORDER BY x} $ans - -set ans {} -foreach x [reverse [sort $all_x]] { - set r $t1xr($x) - lappend ans $r $t1ra($r) $x -} -maketest 3.13 {SELECT rowid, a, x FROM t1 ORDER BY +x DESC} $ans -maketest 3.14 {SELECT rowid, a, x FROM t1 ORDER BY x DESC} $ans - - -maketest 4.1 {UPDATE t1 SET rowid=a, a=rowid, x=z, z=x} {} - -set ans {} -foreach r [sort $all_rowid] { - lappend ans $r $t1ra($r) $t1rx($r) -} -maketest 4.3 {SELECT a, rowid, z FROM t1 ORDER BY +a} $ans -maketest 4.4 {SELECT a, rowid, z FROM t1 ORDER BY a} $ans - -set ans {} -foreach r [reverse [sort $all_rowid]] { - lappend ans $r $t1ra($r) $t1rx($r) -} -maketest 4.5 {SELECT a, rowid, z FROM t1 ORDER BY +a DESC} $ans -maketest 4.6 {SELECT a, rowid, z FROM t1 ORDER BY a DESC} $ans - -set ans {} -foreach a [sort $all_a] { - set r $t1ar($a) - lappend ans $r $a $t1rx($r) -} -maketest 4.7 {SELECT a, rowid, z FROM t1 ORDER BY +rowid} $ans -maketest 4.8 {SELECT a, rowid, z FROM t1 ORDER BY rowid} $ans - -set ans {} -foreach a [reverse [sort $all_a]] { - set r $t1ar($a) - lappend ans $r $a $t1rx($r) -} -maketest 4.9 {SELECT a, rowid, z FROM t1 ORDER BY +rowid DESC} $ans -maketest 4.10 {SELECT a, rowid, z FROM t1 ORDER BY rowid DESC} $ans - -set ans {} -foreach x [sort $all_x] { - set r $t1xr($x) - lappend ans $r $t1ra($r) $x -} -maketest 4.11 {SELECT a, rowid, z FROM t1 ORDER BY +z} $ans -maketest 4.12 {SELECT a, rowid, z FROM t1 ORDER BY z} $ans - -set ans {} -foreach x [reverse [sort $all_x]] { - set r $t1xr($x) - lappend ans $r $t1ra($r) $x -} -maketest 4.13 {SELECT a, rowid, z FROM t1 ORDER BY +z DESC} $ans -maketest 4.14 {SELECT a, rowid, z FROM t1 ORDER BY z DESC} $ans - -puts {finish_test} DELETED test/boundary4.test Index: test/boundary4.test ================================================================== --- test/boundary4.test +++ /dev/null @@ -1,342 +0,0 @@ -# 2008 December 11 -# -# The author disclaims copyright to this source code. In place of -# a legal notice, here is a blessing: -# -# May you do good and not evil. -# May you find forgiveness for yourself and forgive others. -# May you share freely, never taking more than you give. -# -#*********************************************************************** -# This file implements regression tests for SQLite library. -# -# This file is automatically generated from a separate TCL script. -# This file seeks to exercise integer boundary values. -# -# $Id: boundary4.test,v 1.2 2009/01/02 15:45:48 shane Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -# Many of the boundary tests depend on a working 64-bit implementation. -if {![working_64bit_int]} { finish_test; return } - -do_test boundary4-1.1 { - db eval { - CREATE TABLE t1(a,x); - INSERT INTO t1(oid,a,x) VALUES(549755813887,1,'0000007fffffffff'); - INSERT INTO t1(oid,a,x) VALUES(-8388608,2,'ffffffffff800000'); - INSERT INTO t1(oid,a,x) VALUES(0,3,'0000000000000000'); - INSERT INTO t1(oid,a,x) VALUES(-129,4,'ffffffffffffff7f'); - INSERT INTO t1(oid,a,x) VALUES(8388608,5,'0000000000800000'); - INSERT INTO t1(oid,a,x) VALUES(65535,6,'000000000000ffff'); - INSERT INTO t1(oid,a,x) VALUES(8388607,7,'00000000007fffff'); - INSERT INTO t1(oid,a,x) VALUES(1099511627776,8,'0000010000000000'); - INSERT INTO t1(oid,a,x) VALUES(16777215,9,'0000000000ffffff'); - INSERT INTO t1(oid,a,x) VALUES(32767,10,'0000000000007fff'); - INSERT INTO t1(oid,a,x) VALUES(4294967296,11,'0000000100000000'); - INSERT INTO t1(oid,a,x) VALUES(-549755813888,12,'ffffff8000000000'); - INSERT INTO t1(oid,a,x) VALUES(-140737488355328,13,'ffff800000000000'); - INSERT INTO t1(oid,a,x) VALUES(256,14,'0000000000000100'); - INSERT INTO t1(oid,a,x) VALUES(16777216,15,'0000000001000000'); - INSERT INTO t1(oid,a,x) VALUES(72057594037927936,16,'0100000000000000'); - INSERT INTO t1(oid,a,x) VALUES(-1,17,'ffffffffffffffff'); - INSERT INTO t1(oid,a,x) VALUES(9223372036854775807,18,'7fffffffffffffff'); - INSERT INTO t1(oid,a,x) VALUES(281474976710655,19,'0000ffffffffffff'); - INSERT INTO t1(oid,a,x) VALUES(1099511627775,20,'000000ffffffffff'); - INSERT INTO t1(oid,a,x) VALUES(-8388609,21,'ffffffffff7fffff'); - INSERT INTO t1(oid,a,x) VALUES(32768,22,'0000000000008000'); - INSERT INTO t1(oid,a,x) VALUES(36028797018963968,23,'0080000000000000'); - INSERT INTO t1(oid,a,x) VALUES(-32769,24,'ffffffffffff7fff'); - INSERT INTO t1(oid,a,x) VALUES(127,25,'000000000000007f'); - INSERT INTO t1(oid,a,x) VALUES(-9223372036854775808,26,'8000000000000000'); - INSERT INTO t1(oid,a,x) VALUES(72057594037927935,27,'00ffffffffffffff'); - INSERT INTO t1(oid,a,x) VALUES(-549755813889,28,'ffffff7fffffffff'); - INSERT INTO t1(oid,a,x) VALUES(255,29,'00000000000000ff'); - INSERT INTO t1(oid,a,x) VALUES(-36028797018963969,30,'ff7fffffffffffff'); - INSERT INTO t1(oid,a,x) VALUES(-2147483648,31,'ffffffff80000000'); - INSERT INTO t1(oid,a,x) VALUES(281474976710656,32,'0001000000000000'); - INSERT INTO t1(oid,a,x) VALUES(65536,33,'0000000000010000'); - INSERT INTO t1(oid,a,x) VALUES(140737488355328,34,'0000800000000000'); - INSERT INTO t1(oid,a,x) VALUES(549755813888,35,'0000008000000000'); - INSERT INTO t1(oid,a,x) VALUES(2147483648,36,'0000000080000000'); - INSERT INTO t1(oid,a,x) VALUES(4294967295,37,'00000000ffffffff'); - INSERT INTO t1(oid,a,x) VALUES(140737488355327,38,'00007fffffffffff'); - INSERT INTO t1(oid,a,x) VALUES(-2147483649,39,'ffffffff7fffffff'); - INSERT INTO t1(oid,a,x) VALUES(36028797018963967,40,'007fffffffffffff'); - INSERT INTO t1(oid,a,x) VALUES(128,41,'0000000000000080'); - INSERT INTO t1(oid,a,x) VALUES(-32768,42,'ffffffffffff8000'); - INSERT INTO t1(oid,a,x) VALUES(-36028797018963968,43,'ff80000000000000'); - INSERT INTO t1(oid,a,x) VALUES(-140737488355329,44,'ffff7fffffffffff'); - INSERT INTO t1(oid,a,x) VALUES(-128,45,'ffffffffffffff80'); - INSERT INTO t1(oid,a,x) VALUES(2147483647,46,'000000007fffffff'); - CREATE INDEX t1i1 ON t1(a); - CREATE INDEX t1i2 ON t1(x); - } -} {} -do_test boundary4-1.2 { - db eval { - SELECT count(*) FROM t1 - } -} {46} -do_test boundary4-1.3 { - db eval { - SELECT rowid, a, x FROM t1 ORDER BY +rowid - } -} {-9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff 0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff} -do_test boundary4-1.4 { - db eval { - SELECT rowid, a, x FROM t1 ORDER BY rowid - } -} {-9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff 0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff} -do_test boundary4-1.5 { - db eval { - SELECT rowid, a, x FROM t1 ORDER BY +rowid DESC - } -} {9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000 -1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000} -do_test boundary4-1.6 { - db eval { - SELECT rowid, a, x FROM t1 ORDER BY rowid DESC - } -} {9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000 -1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000} -do_test boundary4-1.7 { - db eval { - SELECT rowid, a, x FROM t1 ORDER BY +a - } -} {549755813887 1 0000007fffffffff -8388608 2 ffffffffff800000 0 3 0000000000000000 -129 4 ffffffffffffff7f 8388608 5 0000000000800000 65535 6 000000000000ffff 8388607 7 00000000007fffff 1099511627776 8 0000010000000000 16777215 9 0000000000ffffff 32767 10 0000000000007fff 4294967296 11 0000000100000000 -549755813888 12 ffffff8000000000 -140737488355328 13 ffff800000000000 256 14 0000000000000100 16777216 15 0000000001000000 72057594037927936 16 0100000000000000 -1 17 ffffffffffffffff 9223372036854775807 18 7fffffffffffffff 281474976710655 19 0000ffffffffffff 1099511627775 20 000000ffffffffff -8388609 21 ffffffffff7fffff 32768 22 0000000000008000 36028797018963968 23 0080000000000000 -32769 24 ffffffffffff7fff 127 25 000000000000007f -9223372036854775808 26 8000000000000000 72057594037927935 27 00ffffffffffffff -549755813889 28 ffffff7fffffffff 255 29 00000000000000ff -36028797018963969 30 ff7fffffffffffff -2147483648 31 ffffffff80000000 281474976710656 32 0001000000000000 65536 33 0000000000010000 140737488355328 34 0000800000000000 549755813888 35 0000008000000000 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 140737488355327 38 00007fffffffffff -2147483649 39 ffffffff7fffffff 36028797018963967 40 007fffffffffffff 128 41 0000000000000080 -32768 42 ffffffffffff8000 -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -128 45 ffffffffffffff80 2147483647 46 000000007fffffff} -do_test boundary4-1.8 { - db eval { - SELECT rowid, a, x FROM t1 ORDER BY a - } -} {549755813887 1 0000007fffffffff -8388608 2 ffffffffff800000 0 3 0000000000000000 -129 4 ffffffffffffff7f 8388608 5 0000000000800000 65535 6 000000000000ffff 8388607 7 00000000007fffff 1099511627776 8 0000010000000000 16777215 9 0000000000ffffff 32767 10 0000000000007fff 4294967296 11 0000000100000000 -549755813888 12 ffffff8000000000 -140737488355328 13 ffff800000000000 256 14 0000000000000100 16777216 15 0000000001000000 72057594037927936 16 0100000000000000 -1 17 ffffffffffffffff 9223372036854775807 18 7fffffffffffffff 281474976710655 19 0000ffffffffffff 1099511627775 20 000000ffffffffff -8388609 21 ffffffffff7fffff 32768 22 0000000000008000 36028797018963968 23 0080000000000000 -32769 24 ffffffffffff7fff 127 25 000000000000007f -9223372036854775808 26 8000000000000000 72057594037927935 27 00ffffffffffffff -549755813889 28 ffffff7fffffffff 255 29 00000000000000ff -36028797018963969 30 ff7fffffffffffff -2147483648 31 ffffffff80000000 281474976710656 32 0001000000000000 65536 33 0000000000010000 140737488355328 34 0000800000000000 549755813888 35 0000008000000000 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 140737488355327 38 00007fffffffffff -2147483649 39 ffffffff7fffffff 36028797018963967 40 007fffffffffffff 128 41 0000000000000080 -32768 42 ffffffffffff8000 -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -128 45 ffffffffffffff80 2147483647 46 000000007fffffff} -do_test boundary4-1.9 { - db eval { - SELECT rowid, a, x FROM t1 ORDER BY +a DESC - } -} {2147483647 46 000000007fffffff -128 45 ffffffffffffff80 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -32768 42 ffffffffffff8000 128 41 0000000000000080 36028797018963967 40 007fffffffffffff -2147483649 39 ffffffff7fffffff 140737488355327 38 00007fffffffffff 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 549755813888 35 0000008000000000 140737488355328 34 0000800000000000 65536 33 0000000000010000 281474976710656 32 0001000000000000 -2147483648 31 ffffffff80000000 -36028797018963969 30 ff7fffffffffffff 255 29 00000000000000ff -549755813889 28 ffffff7fffffffff 72057594037927935 27 00ffffffffffffff -9223372036854775808 26 8000000000000000 127 25 000000000000007f -32769 24 ffffffffffff7fff 36028797018963968 23 0080000000000000 32768 22 0000000000008000 -8388609 21 ffffffffff7fffff 1099511627775 20 000000ffffffffff 281474976710655 19 0000ffffffffffff 9223372036854775807 18 7fffffffffffffff -1 17 ffffffffffffffff 72057594037927936 16 0100000000000000 16777216 15 0000000001000000 256 14 0000000000000100 -140737488355328 13 ffff800000000000 -549755813888 12 ffffff8000000000 4294967296 11 0000000100000000 32767 10 0000000000007fff 16777215 9 0000000000ffffff 1099511627776 8 0000010000000000 8388607 7 00000000007fffff 65535 6 000000000000ffff 8388608 5 0000000000800000 -129 4 ffffffffffffff7f 0 3 0000000000000000 -8388608 2 ffffffffff800000 549755813887 1 0000007fffffffff} -do_test boundary4-1.10 { - db eval { - SELECT rowid, a, x FROM t1 ORDER BY a DESC - } -} {2147483647 46 000000007fffffff -128 45 ffffffffffffff80 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -32768 42 ffffffffffff8000 128 41 0000000000000080 36028797018963967 40 007fffffffffffff -2147483649 39 ffffffff7fffffff 140737488355327 38 00007fffffffffff 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 549755813888 35 0000008000000000 140737488355328 34 0000800000000000 65536 33 0000000000010000 281474976710656 32 0001000000000000 -2147483648 31 ffffffff80000000 -36028797018963969 30 ff7fffffffffffff 255 29 00000000000000ff -549755813889 28 ffffff7fffffffff 72057594037927935 27 00ffffffffffffff -9223372036854775808 26 8000000000000000 127 25 000000000000007f -32769 24 ffffffffffff7fff 36028797018963968 23 0080000000000000 32768 22 0000000000008000 -8388609 21 ffffffffff7fffff 1099511627775 20 000000ffffffffff 281474976710655 19 0000ffffffffffff 9223372036854775807 18 7fffffffffffffff -1 17 ffffffffffffffff 72057594037927936 16 0100000000000000 16777216 15 0000000001000000 256 14 0000000000000100 -140737488355328 13 ffff800000000000 -549755813888 12 ffffff8000000000 4294967296 11 0000000100000000 32767 10 0000000000007fff 16777215 9 0000000000ffffff 1099511627776 8 0000010000000000 8388607 7 00000000007fffff 65535 6 000000000000ffff 8388608 5 0000000000800000 -129 4 ffffffffffffff7f 0 3 0000000000000000 -8388608 2 ffffffffff800000 549755813887 1 0000007fffffffff} -do_test boundary4-1.11 { - db eval { - SELECT rowid, a, x FROM t1 ORDER BY +x - } -} {0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff -9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff} -do_test boundary4-1.12 { - db eval { - SELECT rowid, a, x FROM t1 ORDER BY x - } -} {0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff -9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff} -do_test boundary4-1.13 { - db eval { - SELECT rowid, a, x FROM t1 ORDER BY +x DESC - } -} {-1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000 9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000} -do_test boundary4-1.14 { - db eval { - SELECT rowid, a, x FROM t1 ORDER BY x DESC - } -} {-1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000 9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000} -do_test boundary4-2.1 { - db eval { - UPDATE t1 SET rowid=a, a=rowid - } -} {} -do_test boundary4-2.3 { - db eval { - SELECT a, rowid, x FROM t1 ORDER BY +a - } -} {-9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff 0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff} -do_test boundary4-2.4 { - db eval { - SELECT a, rowid, x FROM t1 ORDER BY a - } -} {-9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff 0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff} -do_test boundary4-2.5 { - db eval { - SELECT a, rowid, x FROM t1 ORDER BY +a DESC - } -} {9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000 -1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000} -do_test boundary4-2.6 { - db eval { - SELECT a, rowid, x FROM t1 ORDER BY a DESC - } -} {9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000 -1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000} -do_test boundary4-2.7 { - db eval { - SELECT a, rowid, x FROM t1 ORDER BY +rowid - } -} {549755813887 1 0000007fffffffff -8388608 2 ffffffffff800000 0 3 0000000000000000 -129 4 ffffffffffffff7f 8388608 5 0000000000800000 65535 6 000000000000ffff 8388607 7 00000000007fffff 1099511627776 8 0000010000000000 16777215 9 0000000000ffffff 32767 10 0000000000007fff 4294967296 11 0000000100000000 -549755813888 12 ffffff8000000000 -140737488355328 13 ffff800000000000 256 14 0000000000000100 16777216 15 0000000001000000 72057594037927936 16 0100000000000000 -1 17 ffffffffffffffff 9223372036854775807 18 7fffffffffffffff 281474976710655 19 0000ffffffffffff 1099511627775 20 000000ffffffffff -8388609 21 ffffffffff7fffff 32768 22 0000000000008000 36028797018963968 23 0080000000000000 -32769 24 ffffffffffff7fff 127 25 000000000000007f -9223372036854775808 26 8000000000000000 72057594037927935 27 00ffffffffffffff -549755813889 28 ffffff7fffffffff 255 29 00000000000000ff -36028797018963969 30 ff7fffffffffffff -2147483648 31 ffffffff80000000 281474976710656 32 0001000000000000 65536 33 0000000000010000 140737488355328 34 0000800000000000 549755813888 35 0000008000000000 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 140737488355327 38 00007fffffffffff -2147483649 39 ffffffff7fffffff 36028797018963967 40 007fffffffffffff 128 41 0000000000000080 -32768 42 ffffffffffff8000 -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -128 45 ffffffffffffff80 2147483647 46 000000007fffffff} -do_test boundary4-2.8 { - db eval { - SELECT a, rowid, x FROM t1 ORDER BY rowid - } -} {549755813887 1 0000007fffffffff -8388608 2 ffffffffff800000 0 3 0000000000000000 -129 4 ffffffffffffff7f 8388608 5 0000000000800000 65535 6 000000000000ffff 8388607 7 00000000007fffff 1099511627776 8 0000010000000000 16777215 9 0000000000ffffff 32767 10 0000000000007fff 4294967296 11 0000000100000000 -549755813888 12 ffffff8000000000 -140737488355328 13 ffff800000000000 256 14 0000000000000100 16777216 15 0000000001000000 72057594037927936 16 0100000000000000 -1 17 ffffffffffffffff 9223372036854775807 18 7fffffffffffffff 281474976710655 19 0000ffffffffffff 1099511627775 20 000000ffffffffff -8388609 21 ffffffffff7fffff 32768 22 0000000000008000 36028797018963968 23 0080000000000000 -32769 24 ffffffffffff7fff 127 25 000000000000007f -9223372036854775808 26 8000000000000000 72057594037927935 27 00ffffffffffffff -549755813889 28 ffffff7fffffffff 255 29 00000000000000ff -36028797018963969 30 ff7fffffffffffff -2147483648 31 ffffffff80000000 281474976710656 32 0001000000000000 65536 33 0000000000010000 140737488355328 34 0000800000000000 549755813888 35 0000008000000000 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 140737488355327 38 00007fffffffffff -2147483649 39 ffffffff7fffffff 36028797018963967 40 007fffffffffffff 128 41 0000000000000080 -32768 42 ffffffffffff8000 -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -128 45 ffffffffffffff80 2147483647 46 000000007fffffff} -do_test boundary4-2.9 { - db eval { - SELECT a, rowid, x FROM t1 ORDER BY +rowid DESC - } -} {2147483647 46 000000007fffffff -128 45 ffffffffffffff80 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -32768 42 ffffffffffff8000 128 41 0000000000000080 36028797018963967 40 007fffffffffffff -2147483649 39 ffffffff7fffffff 140737488355327 38 00007fffffffffff 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 549755813888 35 0000008000000000 140737488355328 34 0000800000000000 65536 33 0000000000010000 281474976710656 32 0001000000000000 -2147483648 31 ffffffff80000000 -36028797018963969 30 ff7fffffffffffff 255 29 00000000000000ff -549755813889 28 ffffff7fffffffff 72057594037927935 27 00ffffffffffffff -9223372036854775808 26 8000000000000000 127 25 000000000000007f -32769 24 ffffffffffff7fff 36028797018963968 23 0080000000000000 32768 22 0000000000008000 -8388609 21 ffffffffff7fffff 1099511627775 20 000000ffffffffff 281474976710655 19 0000ffffffffffff 9223372036854775807 18 7fffffffffffffff -1 17 ffffffffffffffff 72057594037927936 16 0100000000000000 16777216 15 0000000001000000 256 14 0000000000000100 -140737488355328 13 ffff800000000000 -549755813888 12 ffffff8000000000 4294967296 11 0000000100000000 32767 10 0000000000007fff 16777215 9 0000000000ffffff 1099511627776 8 0000010000000000 8388607 7 00000000007fffff 65535 6 000000000000ffff 8388608 5 0000000000800000 -129 4 ffffffffffffff7f 0 3 0000000000000000 -8388608 2 ffffffffff800000 549755813887 1 0000007fffffffff} -do_test boundary4-2.10 { - db eval { - SELECT a, rowid, x FROM t1 ORDER BY rowid DESC - } -} {2147483647 46 000000007fffffff -128 45 ffffffffffffff80 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -32768 42 ffffffffffff8000 128 41 0000000000000080 36028797018963967 40 007fffffffffffff -2147483649 39 ffffffff7fffffff 140737488355327 38 00007fffffffffff 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 549755813888 35 0000008000000000 140737488355328 34 0000800000000000 65536 33 0000000000010000 281474976710656 32 0001000000000000 -2147483648 31 ffffffff80000000 -36028797018963969 30 ff7fffffffffffff 255 29 00000000000000ff -549755813889 28 ffffff7fffffffff 72057594037927935 27 00ffffffffffffff -9223372036854775808 26 8000000000000000 127 25 000000000000007f -32769 24 ffffffffffff7fff 36028797018963968 23 0080000000000000 32768 22 0000000000008000 -8388609 21 ffffffffff7fffff 1099511627775 20 000000ffffffffff 281474976710655 19 0000ffffffffffff 9223372036854775807 18 7fffffffffffffff -1 17 ffffffffffffffff 72057594037927936 16 0100000000000000 16777216 15 0000000001000000 256 14 0000000000000100 -140737488355328 13 ffff800000000000 -549755813888 12 ffffff8000000000 4294967296 11 0000000100000000 32767 10 0000000000007fff 16777215 9 0000000000ffffff 1099511627776 8 0000010000000000 8388607 7 00000000007fffff 65535 6 000000000000ffff 8388608 5 0000000000800000 -129 4 ffffffffffffff7f 0 3 0000000000000000 -8388608 2 ffffffffff800000 549755813887 1 0000007fffffffff} -do_test boundary4-2.11 { - db eval { - SELECT a, rowid, x FROM t1 ORDER BY +x - } -} {0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff -9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff} -do_test boundary4-2.12 { - db eval { - SELECT a, rowid, x FROM t1 ORDER BY x - } -} {0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff -9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff} -do_test boundary4-2.13 { - db eval { - SELECT a, rowid, x FROM t1 ORDER BY +x DESC - } -} {-1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000 9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000} -do_test boundary4-2.14 { - db eval { - SELECT a, rowid, x FROM t1 ORDER BY x DESC - } -} {-1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000 9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000} -do_test boundary4-3.1 { - db eval { - UPDATE t1 SET rowid=a, a=rowid - } -} {} -do_test boundary4-3.2 { - db eval { - ALTER TABLE t1 ADD COLUMN z; UPDATE t1 SET z=zeroblob(600) - } -} {} -do_test boundary4-3.3 { - db eval { - SELECT rowid, a, x FROM t1 ORDER BY +rowid - } -} {-9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff 0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff} -do_test boundary4-3.4 { - db eval { - SELECT rowid, a, x FROM t1 ORDER BY rowid - } -} {-9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff 0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff} -do_test boundary4-3.5 { - db eval { - SELECT rowid, a, x FROM t1 ORDER BY +rowid DESC - } -} {9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000 -1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000} -do_test boundary4-3.6 { - db eval { - SELECT rowid, a, x FROM t1 ORDER BY rowid DESC - } -} {9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000 -1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000} -do_test boundary4-3.7 { - db eval { - SELECT rowid, a, x FROM t1 ORDER BY +a - } -} {549755813887 1 0000007fffffffff -8388608 2 ffffffffff800000 0 3 0000000000000000 -129 4 ffffffffffffff7f 8388608 5 0000000000800000 65535 6 000000000000ffff 8388607 7 00000000007fffff 1099511627776 8 0000010000000000 16777215 9 0000000000ffffff 32767 10 0000000000007fff 4294967296 11 0000000100000000 -549755813888 12 ffffff8000000000 -140737488355328 13 ffff800000000000 256 14 0000000000000100 16777216 15 0000000001000000 72057594037927936 16 0100000000000000 -1 17 ffffffffffffffff 9223372036854775807 18 7fffffffffffffff 281474976710655 19 0000ffffffffffff 1099511627775 20 000000ffffffffff -8388609 21 ffffffffff7fffff 32768 22 0000000000008000 36028797018963968 23 0080000000000000 -32769 24 ffffffffffff7fff 127 25 000000000000007f -9223372036854775808 26 8000000000000000 72057594037927935 27 00ffffffffffffff -549755813889 28 ffffff7fffffffff 255 29 00000000000000ff -36028797018963969 30 ff7fffffffffffff -2147483648 31 ffffffff80000000 281474976710656 32 0001000000000000 65536 33 0000000000010000 140737488355328 34 0000800000000000 549755813888 35 0000008000000000 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 140737488355327 38 00007fffffffffff -2147483649 39 ffffffff7fffffff 36028797018963967 40 007fffffffffffff 128 41 0000000000000080 -32768 42 ffffffffffff8000 -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -128 45 ffffffffffffff80 2147483647 46 000000007fffffff} -do_test boundary4-3.8 { - db eval { - SELECT rowid, a, x FROM t1 ORDER BY a - } -} {549755813887 1 0000007fffffffff -8388608 2 ffffffffff800000 0 3 0000000000000000 -129 4 ffffffffffffff7f 8388608 5 0000000000800000 65535 6 000000000000ffff 8388607 7 00000000007fffff 1099511627776 8 0000010000000000 16777215 9 0000000000ffffff 32767 10 0000000000007fff 4294967296 11 0000000100000000 -549755813888 12 ffffff8000000000 -140737488355328 13 ffff800000000000 256 14 0000000000000100 16777216 15 0000000001000000 72057594037927936 16 0100000000000000 -1 17 ffffffffffffffff 9223372036854775807 18 7fffffffffffffff 281474976710655 19 0000ffffffffffff 1099511627775 20 000000ffffffffff -8388609 21 ffffffffff7fffff 32768 22 0000000000008000 36028797018963968 23 0080000000000000 -32769 24 ffffffffffff7fff 127 25 000000000000007f -9223372036854775808 26 8000000000000000 72057594037927935 27 00ffffffffffffff -549755813889 28 ffffff7fffffffff 255 29 00000000000000ff -36028797018963969 30 ff7fffffffffffff -2147483648 31 ffffffff80000000 281474976710656 32 0001000000000000 65536 33 0000000000010000 140737488355328 34 0000800000000000 549755813888 35 0000008000000000 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 140737488355327 38 00007fffffffffff -2147483649 39 ffffffff7fffffff 36028797018963967 40 007fffffffffffff 128 41 0000000000000080 -32768 42 ffffffffffff8000 -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -128 45 ffffffffffffff80 2147483647 46 000000007fffffff} -do_test boundary4-3.9 { - db eval { - SELECT rowid, a, x FROM t1 ORDER BY +a DESC - } -} {2147483647 46 000000007fffffff -128 45 ffffffffffffff80 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -32768 42 ffffffffffff8000 128 41 0000000000000080 36028797018963967 40 007fffffffffffff -2147483649 39 ffffffff7fffffff 140737488355327 38 00007fffffffffff 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 549755813888 35 0000008000000000 140737488355328 34 0000800000000000 65536 33 0000000000010000 281474976710656 32 0001000000000000 -2147483648 31 ffffffff80000000 -36028797018963969 30 ff7fffffffffffff 255 29 00000000000000ff -549755813889 28 ffffff7fffffffff 72057594037927935 27 00ffffffffffffff -9223372036854775808 26 8000000000000000 127 25 000000000000007f -32769 24 ffffffffffff7fff 36028797018963968 23 0080000000000000 32768 22 0000000000008000 -8388609 21 ffffffffff7fffff 1099511627775 20 000000ffffffffff 281474976710655 19 0000ffffffffffff 9223372036854775807 18 7fffffffffffffff -1 17 ffffffffffffffff 72057594037927936 16 0100000000000000 16777216 15 0000000001000000 256 14 0000000000000100 -140737488355328 13 ffff800000000000 -549755813888 12 ffffff8000000000 4294967296 11 0000000100000000 32767 10 0000000000007fff 16777215 9 0000000000ffffff 1099511627776 8 0000010000000000 8388607 7 00000000007fffff 65535 6 000000000000ffff 8388608 5 0000000000800000 -129 4 ffffffffffffff7f 0 3 0000000000000000 -8388608 2 ffffffffff800000 549755813887 1 0000007fffffffff} -do_test boundary4-3.10 { - db eval { - SELECT rowid, a, x FROM t1 ORDER BY a DESC - } -} {2147483647 46 000000007fffffff -128 45 ffffffffffffff80 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -32768 42 ffffffffffff8000 128 41 0000000000000080 36028797018963967 40 007fffffffffffff -2147483649 39 ffffffff7fffffff 140737488355327 38 00007fffffffffff 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 549755813888 35 0000008000000000 140737488355328 34 0000800000000000 65536 33 0000000000010000 281474976710656 32 0001000000000000 -2147483648 31 ffffffff80000000 -36028797018963969 30 ff7fffffffffffff 255 29 00000000000000ff -549755813889 28 ffffff7fffffffff 72057594037927935 27 00ffffffffffffff -9223372036854775808 26 8000000000000000 127 25 000000000000007f -32769 24 ffffffffffff7fff 36028797018963968 23 0080000000000000 32768 22 0000000000008000 -8388609 21 ffffffffff7fffff 1099511627775 20 000000ffffffffff 281474976710655 19 0000ffffffffffff 9223372036854775807 18 7fffffffffffffff -1 17 ffffffffffffffff 72057594037927936 16 0100000000000000 16777216 15 0000000001000000 256 14 0000000000000100 -140737488355328 13 ffff800000000000 -549755813888 12 ffffff8000000000 4294967296 11 0000000100000000 32767 10 0000000000007fff 16777215 9 0000000000ffffff 1099511627776 8 0000010000000000 8388607 7 00000000007fffff 65535 6 000000000000ffff 8388608 5 0000000000800000 -129 4 ffffffffffffff7f 0 3 0000000000000000 -8388608 2 ffffffffff800000 549755813887 1 0000007fffffffff} -do_test boundary4-3.11 { - db eval { - SELECT rowid, a, x FROM t1 ORDER BY +x - } -} {0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff -9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff} -do_test boundary4-3.12 { - db eval { - SELECT rowid, a, x FROM t1 ORDER BY x - } -} {0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff -9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff} -do_test boundary4-3.13 { - db eval { - SELECT rowid, a, x FROM t1 ORDER BY +x DESC - } -} {-1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000 9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000} -do_test boundary4-3.14 { - db eval { - SELECT rowid, a, x FROM t1 ORDER BY x DESC - } -} {-1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000 9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000} -do_test boundary4-4.1 { - db eval { - UPDATE t1 SET rowid=a, a=rowid, x=z, z=x - } -} {} -do_test boundary4-4.3 { - db eval { - SELECT a, rowid, z FROM t1 ORDER BY +a - } -} {-9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff 0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff} -do_test boundary4-4.4 { - db eval { - SELECT a, rowid, z FROM t1 ORDER BY a - } -} {-9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff 0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff} -do_test boundary4-4.5 { - db eval { - SELECT a, rowid, z FROM t1 ORDER BY +a DESC - } -} {9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000 -1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000} -do_test boundary4-4.6 { - db eval { - SELECT a, rowid, z FROM t1 ORDER BY a DESC - } -} {9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000 -1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000} -do_test boundary4-4.7 { - db eval { - SELECT a, rowid, z FROM t1 ORDER BY +rowid - } -} {549755813887 1 0000007fffffffff -8388608 2 ffffffffff800000 0 3 0000000000000000 -129 4 ffffffffffffff7f 8388608 5 0000000000800000 65535 6 000000000000ffff 8388607 7 00000000007fffff 1099511627776 8 0000010000000000 16777215 9 0000000000ffffff 32767 10 0000000000007fff 4294967296 11 0000000100000000 -549755813888 12 ffffff8000000000 -140737488355328 13 ffff800000000000 256 14 0000000000000100 16777216 15 0000000001000000 72057594037927936 16 0100000000000000 -1 17 ffffffffffffffff 9223372036854775807 18 7fffffffffffffff 281474976710655 19 0000ffffffffffff 1099511627775 20 000000ffffffffff -8388609 21 ffffffffff7fffff 32768 22 0000000000008000 36028797018963968 23 0080000000000000 -32769 24 ffffffffffff7fff 127 25 000000000000007f -9223372036854775808 26 8000000000000000 72057594037927935 27 00ffffffffffffff -549755813889 28 ffffff7fffffffff 255 29 00000000000000ff -36028797018963969 30 ff7fffffffffffff -2147483648 31 ffffffff80000000 281474976710656 32 0001000000000000 65536 33 0000000000010000 140737488355328 34 0000800000000000 549755813888 35 0000008000000000 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 140737488355327 38 00007fffffffffff -2147483649 39 ffffffff7fffffff 36028797018963967 40 007fffffffffffff 128 41 0000000000000080 -32768 42 ffffffffffff8000 -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -128 45 ffffffffffffff80 2147483647 46 000000007fffffff} -do_test boundary4-4.8 { - db eval { - SELECT a, rowid, z FROM t1 ORDER BY rowid - } -} {549755813887 1 0000007fffffffff -8388608 2 ffffffffff800000 0 3 0000000000000000 -129 4 ffffffffffffff7f 8388608 5 0000000000800000 65535 6 000000000000ffff 8388607 7 00000000007fffff 1099511627776 8 0000010000000000 16777215 9 0000000000ffffff 32767 10 0000000000007fff 4294967296 11 0000000100000000 -549755813888 12 ffffff8000000000 -140737488355328 13 ffff800000000000 256 14 0000000000000100 16777216 15 0000000001000000 72057594037927936 16 0100000000000000 -1 17 ffffffffffffffff 9223372036854775807 18 7fffffffffffffff 281474976710655 19 0000ffffffffffff 1099511627775 20 000000ffffffffff -8388609 21 ffffffffff7fffff 32768 22 0000000000008000 36028797018963968 23 0080000000000000 -32769 24 ffffffffffff7fff 127 25 000000000000007f -9223372036854775808 26 8000000000000000 72057594037927935 27 00ffffffffffffff -549755813889 28 ffffff7fffffffff 255 29 00000000000000ff -36028797018963969 30 ff7fffffffffffff -2147483648 31 ffffffff80000000 281474976710656 32 0001000000000000 65536 33 0000000000010000 140737488355328 34 0000800000000000 549755813888 35 0000008000000000 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 140737488355327 38 00007fffffffffff -2147483649 39 ffffffff7fffffff 36028797018963967 40 007fffffffffffff 128 41 0000000000000080 -32768 42 ffffffffffff8000 -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -128 45 ffffffffffffff80 2147483647 46 000000007fffffff} -do_test boundary4-4.9 { - db eval { - SELECT a, rowid, z FROM t1 ORDER BY +rowid DESC - } -} {2147483647 46 000000007fffffff -128 45 ffffffffffffff80 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -32768 42 ffffffffffff8000 128 41 0000000000000080 36028797018963967 40 007fffffffffffff -2147483649 39 ffffffff7fffffff 140737488355327 38 00007fffffffffff 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 549755813888 35 0000008000000000 140737488355328 34 0000800000000000 65536 33 0000000000010000 281474976710656 32 0001000000000000 -2147483648 31 ffffffff80000000 -36028797018963969 30 ff7fffffffffffff 255 29 00000000000000ff -549755813889 28 ffffff7fffffffff 72057594037927935 27 00ffffffffffffff -9223372036854775808 26 8000000000000000 127 25 000000000000007f -32769 24 ffffffffffff7fff 36028797018963968 23 0080000000000000 32768 22 0000000000008000 -8388609 21 ffffffffff7fffff 1099511627775 20 000000ffffffffff 281474976710655 19 0000ffffffffffff 9223372036854775807 18 7fffffffffffffff -1 17 ffffffffffffffff 72057594037927936 16 0100000000000000 16777216 15 0000000001000000 256 14 0000000000000100 -140737488355328 13 ffff800000000000 -549755813888 12 ffffff8000000000 4294967296 11 0000000100000000 32767 10 0000000000007fff 16777215 9 0000000000ffffff 1099511627776 8 0000010000000000 8388607 7 00000000007fffff 65535 6 000000000000ffff 8388608 5 0000000000800000 -129 4 ffffffffffffff7f 0 3 0000000000000000 -8388608 2 ffffffffff800000 549755813887 1 0000007fffffffff} -do_test boundary4-4.10 { - db eval { - SELECT a, rowid, z FROM t1 ORDER BY rowid DESC - } -} {2147483647 46 000000007fffffff -128 45 ffffffffffffff80 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -32768 42 ffffffffffff8000 128 41 0000000000000080 36028797018963967 40 007fffffffffffff -2147483649 39 ffffffff7fffffff 140737488355327 38 00007fffffffffff 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 549755813888 35 0000008000000000 140737488355328 34 0000800000000000 65536 33 0000000000010000 281474976710656 32 0001000000000000 -2147483648 31 ffffffff80000000 -36028797018963969 30 ff7fffffffffffff 255 29 00000000000000ff -549755813889 28 ffffff7fffffffff 72057594037927935 27 00ffffffffffffff -9223372036854775808 26 8000000000000000 127 25 000000000000007f -32769 24 ffffffffffff7fff 36028797018963968 23 0080000000000000 32768 22 0000000000008000 -8388609 21 ffffffffff7fffff 1099511627775 20 000000ffffffffff 281474976710655 19 0000ffffffffffff 9223372036854775807 18 7fffffffffffffff -1 17 ffffffffffffffff 72057594037927936 16 0100000000000000 16777216 15 0000000001000000 256 14 0000000000000100 -140737488355328 13 ffff800000000000 -549755813888 12 ffffff8000000000 4294967296 11 0000000100000000 32767 10 0000000000007fff 16777215 9 0000000000ffffff 1099511627776 8 0000010000000000 8388607 7 00000000007fffff 65535 6 000000000000ffff 8388608 5 0000000000800000 -129 4 ffffffffffffff7f 0 3 0000000000000000 -8388608 2 ffffffffff800000 549755813887 1 0000007fffffffff} -do_test boundary4-4.11 { - db eval { - SELECT a, rowid, z FROM t1 ORDER BY +z - } -} {0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff -9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff} -do_test boundary4-4.12 { - db eval { - SELECT a, rowid, z FROM t1 ORDER BY z - } -} {0 3 0000000000000000 127 25 000000000000007f 128 41 0000000000000080 255 29 00000000000000ff 256 14 0000000000000100 32767 10 0000000000007fff 32768 22 0000000000008000 65535 6 000000000000ffff 65536 33 0000000000010000 8388607 7 00000000007fffff 8388608 5 0000000000800000 16777215 9 0000000000ffffff 16777216 15 0000000001000000 2147483647 46 000000007fffffff 2147483648 36 0000000080000000 4294967295 37 00000000ffffffff 4294967296 11 0000000100000000 549755813887 1 0000007fffffffff 549755813888 35 0000008000000000 1099511627775 20 000000ffffffffff 1099511627776 8 0000010000000000 140737488355327 38 00007fffffffffff 140737488355328 34 0000800000000000 281474976710655 19 0000ffffffffffff 281474976710656 32 0001000000000000 36028797018963967 40 007fffffffffffff 36028797018963968 23 0080000000000000 72057594037927935 27 00ffffffffffffff 72057594037927936 16 0100000000000000 9223372036854775807 18 7fffffffffffffff -9223372036854775808 26 8000000000000000 -36028797018963969 30 ff7fffffffffffff -36028797018963968 43 ff80000000000000 -140737488355329 44 ffff7fffffffffff -140737488355328 13 ffff800000000000 -549755813889 28 ffffff7fffffffff -549755813888 12 ffffff8000000000 -2147483649 39 ffffffff7fffffff -2147483648 31 ffffffff80000000 -8388609 21 ffffffffff7fffff -8388608 2 ffffffffff800000 -32769 24 ffffffffffff7fff -32768 42 ffffffffffff8000 -129 4 ffffffffffffff7f -128 45 ffffffffffffff80 -1 17 ffffffffffffffff} -do_test boundary4-4.13 { - db eval { - SELECT a, rowid, z FROM t1 ORDER BY +z DESC - } -} {-1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000 9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000} -do_test boundary4-4.14 { - db eval { - SELECT a, rowid, z FROM t1 ORDER BY z DESC - } -} {-1 17 ffffffffffffffff -128 45 ffffffffffffff80 -129 4 ffffffffffffff7f -32768 42 ffffffffffff8000 -32769 24 ffffffffffff7fff -8388608 2 ffffffffff800000 -8388609 21 ffffffffff7fffff -2147483648 31 ffffffff80000000 -2147483649 39 ffffffff7fffffff -549755813888 12 ffffff8000000000 -549755813889 28 ffffff7fffffffff -140737488355328 13 ffff800000000000 -140737488355329 44 ffff7fffffffffff -36028797018963968 43 ff80000000000000 -36028797018963969 30 ff7fffffffffffff -9223372036854775808 26 8000000000000000 9223372036854775807 18 7fffffffffffffff 72057594037927936 16 0100000000000000 72057594037927935 27 00ffffffffffffff 36028797018963968 23 0080000000000000 36028797018963967 40 007fffffffffffff 281474976710656 32 0001000000000000 281474976710655 19 0000ffffffffffff 140737488355328 34 0000800000000000 140737488355327 38 00007fffffffffff 1099511627776 8 0000010000000000 1099511627775 20 000000ffffffffff 549755813888 35 0000008000000000 549755813887 1 0000007fffffffff 4294967296 11 0000000100000000 4294967295 37 00000000ffffffff 2147483648 36 0000000080000000 2147483647 46 000000007fffffff 16777216 15 0000000001000000 16777215 9 0000000000ffffff 8388608 5 0000000000800000 8388607 7 00000000007fffff 65536 33 0000000000010000 65535 6 000000000000ffff 32768 22 0000000000008000 32767 10 0000000000007fff 256 14 0000000000000100 255 29 00000000000000ff 128 41 0000000000000080 127 25 000000000000007f 0 3 0000000000000000} -finish_test Index: test/capi2.test ================================================================== --- test/capi2.test +++ test/capi2.test @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script testing the callback-free C/C++ API. # -# $Id: capi2.test,v 1.37 2008/12/30 17:55:00 drh Exp $ +# $Id: capi2.test,v 1.36 2008/09/01 15:52:11 drh Exp $ # set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -720,10 +720,11 @@ } [list {main tab1 col2} {main tab1 col1}] do_test capi2-12.4 { check_origins {SELECT b, a FROM (SELECT col1 AS a, col2 AS b FROM view1)} } [list {main tab1 col2} {main tab1 col1}] do_test capi2-12.5 { +breakpoint check_origins {SELECT (SELECT col2 FROM view1), (SELECT col1 FROM view1)} } [list {main tab1 col2} {main tab1 col1}] do_test capi2-12.6 { check_origins {SELECT (SELECT col2), (SELECT col1) FROM view1} } [list {main tab1 col2} {main tab1 col1}] Index: test/capi3.test ================================================================== --- test/capi3.test +++ test/capi3.test @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script testing the callback-free C/C++ API. # -# $Id: capi3.test,v 1.70 2009/01/09 02:49:32 drh Exp $ +# $Id: capi3.test,v 1.67 2008/07/12 15:55:55 danielk1977 Exp $ # set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -59,16 +59,13 @@ do_test capi3-1.1 { set STMT [sqlite3_prepare $DB {SELECT name FROM sqlite_master} -1 TAIL] sqlite3_finalize $STMT set TAIL } {} -do_test capi3-1.2.1 { +do_test capi3-1.2 { sqlite3_errcode $DB } {SQLITE_OK} -do_test capi3-1.2.2 { - sqlite3_extended_errcode $DB -} {SQLITE_OK} do_test capi3-1.3 { sqlite3_errmsg $DB } {not an error} do_test capi3-1.4 { set sql {SELECT name FROM sqlite_master;SELECT 10} @@ -93,16 +90,13 @@ set sql {SELECT namex FROM sqlite_master} catch { set STMT [sqlite3_prepare $DB $sql -1 TAIL] } } {1} -do_test capi3-1.8.1 { +do_test capi3-1.8 { sqlite3_errcode $DB } {SQLITE_ERROR} -do_test capi3-1.8.2 { - sqlite3_extended_errcode $DB -} {SQLITE_ERROR} do_test capi3-1.9 { sqlite3_errmsg $DB } {no such column: namex} ifcapable {utf16} { @@ -119,28 +113,25 @@ utf8 $TAIL } {SELECT 10} do_test capi3-2.3 { set sql [utf16 {SELECT namex FROM sqlite_master}] catch { - set STMT [sqlite3_prepare16 $DB $sql -1] + set STMT [sqlite3_prepare16 $DB $sql -1 TAIL] } } {1} - do_test capi3-2.4.1 { + do_test capi3-2.4 { sqlite3_errcode $DB } {SQLITE_ERROR} - do_test capi3-2.4.2 { - sqlite3_extended_errcode $DB - } {SQLITE_ERROR} do_test capi3-2.5 { sqlite3_errmsg $DB } {no such column: namex} ifcapable schema_pragmas { do_test capi3-2.6 { execsql {CREATE TABLE tablename(x)} - set sql16 [utf16 {PRAGMA table_info("TableName"); --excess text}] - set STMT [sqlite3_prepare16 $DB $sql16 -1] + set sql16 [utf16 {PRAGMA table_info("TableName")}] + set STMT [sqlite3_prepare16 $DB $sql16 -1 TAIL] sqlite3_step $STMT } SQLITE_ROW do_test capi3-2.7 { sqlite3_step $STMT } SQLITE_DONE @@ -164,11 +155,11 @@ } {SQLITE_OK} do_test capi3-3.3 { catch { set db2 [sqlite3_open /bogus/path/test.db {}] } - sqlite3_extended_errcode $db2 + sqlite3_errcode $db2 } {SQLITE_CANTOPEN} do_test capi3-3.4 { sqlite3_errmsg $db2 } {unable to open database file} do_test capi3-3.5 { @@ -831,29 +822,18 @@ } 0 do_test capi3-11.2 { set STMT [sqlite3_prepare $DB "SELECT func(b, a) FROM t1" -1 TAIL] sqlite3_step $STMT } {SQLITE_ROW} - -# As of 3.6.5 a COMMIT is OK during while a query is still running - -# as long as it is a read-only query and not an incremental BLOB write. -# +do_test capi3-11.3 { + catchsql { + COMMIT; + } +} {1 {cannot commit transaction - SQL statements in progress}} do_test capi3-11.3.1 { - catchsql { - COMMIT; - } -} {0 {}} -do_test capi3-11.3.2 { - sqlite3_extended_errcode $DB -} {SQLITE_OK} -do_test capi3-11.3.3 { sqlite3_get_autocommit $DB -} 1 -do_test capi3-11.3.4 { - db eval {PRAGMA lock_status} -} {main shared temp closed} - +} 0 do_test capi3-11.4 { sqlite3_step $STMT } {SQLITE_ERROR} do_test capi3-11.5 { sqlite3_finalize $STMT @@ -861,11 +841,19 @@ do_test capi3-11.6 { catchsql { SELECT * FROM t1; } } {0 {1 int 2 notatype}} +do_test capi3-11.6.1 { + sqlite3_get_autocommit $DB +} 0 do_test capi3-11.7 { + catchsql { + COMMIT; + } +} {0 {}} +do_test capi3-11.7.1 { sqlite3_get_autocommit $DB } 1 do_test capi3-11.8 { execsql { CREATE TABLE t2(a); @@ -948,17 +936,17 @@ do_test capi3-11.20 { catchsql { BEGIN; COMMIT; } -} {0 {}} +} {1 {cannot commit transaction - SQL statements in progress}} do_test capi3-11.20 { sqlite3_reset $STMT catchsql { COMMIT; } -} {1 {cannot commit - no transaction is active}} +} {0 {}} do_test capi3-11.21 { sqlite3_finalize $STMT } {SQLITE_OK} # The following tests - capi3-12.* - check that its Ok to start a Index: test/capi3c.test ================================================================== --- test/capi3c.test +++ test/capi3c.test @@ -11,11 +11,11 @@ # This file implements regression tests for SQLite library. # # This is a copy of the capi3.test file that has been adapted to # test the new sqlite3_prepare_v2 interface. # -# $Id: capi3c.test,v 1.22 2008/11/05 16:37:35 drh Exp $ +# $Id: capi3c.test,v 1.20 2008/10/12 00:27:54 shane Exp $ # set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -61,16 +61,13 @@ do_test capi3c-1.1 { set STMT [sqlite3_prepare_v2 $DB {SELECT name FROM sqlite_master} -1 TAIL] sqlite3_finalize $STMT set TAIL } {} -do_test capi3c-1.2.1 { +do_test capi3c-1.2 { sqlite3_errcode $DB } {SQLITE_OK} -do_test capi3c-1.2.2 { - sqlite3_extended_errcode $DB -} {SQLITE_OK} do_test capi3c-1.3 { sqlite3_errmsg $DB } {not an error} do_test capi3c-1.4 { set sql {SELECT name FROM sqlite_master;SELECT 10} @@ -82,16 +79,13 @@ set sql {SELECT namex FROM sqlite_master} catch { set STMT [sqlite3_prepare_v2 $DB $sql -1 TAIL] } } {1} -do_test capi3c-1.6.1 { +do_test capi3c-1.6 { sqlite3_errcode $DB } {SQLITE_ERROR} -do_test capi3c-1.6.2 { - sqlite3_extended_errcode $DB -} {SQLITE_ERROR} do_test capi3c-1.7 { sqlite3_errmsg $DB } {no such column: namex} @@ -112,16 +106,13 @@ set sql [utf16 {SELECT namex FROM sqlite_master}] catch { set STMT [sqlite3_prepare16_v2 $DB $sql -1 TAIL] } } {1} - do_test capi3c-2.4.1 { + do_test capi3c-2.4 { sqlite3_errcode $DB } {SQLITE_ERROR} - do_test capi3c-2.4.2 { - sqlite3_extended_errcode $DB - } {SQLITE_ERROR} do_test capi3c-2.5 { sqlite3_errmsg $DB } {no such column: namex} ifcapable schema_pragmas { @@ -786,29 +777,18 @@ } 0 do_test capi3c-11.2 { set STMT [sqlite3_prepare_v2 $DB "SELECT func(b, a) FROM t1" -1 TAIL] sqlite3_step $STMT } {SQLITE_ROW} - -# As of 3.6.5 a COMMIT is OK during while a query is still running - -# as long as it is a read-only query and not an incremental BLOB write. -# -do_test capi3-11.3.1 { +do_test capi3c-11.3 { catchsql { COMMIT; } -} {0 {}} -do_test capi3-11.3.2 { - sqlite3_extended_errcode $DB -} {SQLITE_OK} -do_test capi3-11.3.3 { +} {1 {cannot commit transaction - SQL statements in progress}} +do_test capi3c-11.3.1 { sqlite3_get_autocommit $DB -} 1 -do_test capi3-11.3.4 { - db eval {PRAGMA lock_status} -} {main shared temp closed} - +} 0 do_test capi3c-11.4 { sqlite3_step $STMT } {SQLITE_ERROR} do_test capi3c-11.5 { sqlite3_finalize $STMT @@ -816,11 +796,19 @@ do_test capi3c-11.6 { catchsql { SELECT * FROM t1; } } {0 {1 int 2 notatype}} +do_test capi3c-11.6.1 { + sqlite3_get_autocommit $DB +} 0 do_test capi3c-11.7 { + catchsql { + COMMIT; + } +} {0 {}} +do_test capi3c-11.7.1 { sqlite3_get_autocommit $DB } 1 do_test capi3c-11.8 { execsql { CREATE TABLE t2(a); @@ -903,17 +891,17 @@ do_test capi3c-11.20 { catchsql { BEGIN; COMMIT; } -} {0 {}} +} {1 {cannot commit transaction - SQL statements in progress}} do_test capi3c-11.20 { sqlite3_reset $STMT catchsql { COMMIT; } -} {1 {cannot commit - no transaction is active}} +} {0 {}} do_test capi3c-11.21 { sqlite3_finalize $STMT } {SQLITE_OK} # The following tests - capi3c-12.* - check that its Ok to start a @@ -1241,11 +1229,11 @@ set STMT [sqlite3_prepare_v2 $DB {SELECT * FROM t3} -1 TAIL] db progress 5 "expr 1" sqlite3_step $STMT } {SQLITE_INTERRUPT} do_test capi3c-21.2 { - sqlite3_extended_errcode $DB + sqlite3_errcode $DB } {SQLITE_INTERRUPT} do_test capi3c-21.3 { sqlite3_finalize $STMT } {SQLITE_INTERRUPT} do_test capi3c-21.4 { @@ -1260,13 +1248,10 @@ sqlite3_finalize $STMT } {SQLITE_INTERRUPT} do_test capi3c-21.7 { sqlite3_errcode $DB } {SQLITE_INTERRUPT} - do_test capi3c-21.8 { - sqlite3_extended_errcode $DB - } {SQLITE_INTERRUPT} } # Make sure sqlite3_result_error_code() returns the correct error code. # See ticket #2940 # Index: test/cast.test ================================================================== --- test/cast.test +++ test/cast.test @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the CAST operator. # -# $Id: cast.test,v 1.10 2008/11/06 15:33:04 drh Exp $ +# $Id: cast.test,v 1.9 2008/01/19 20:11:26 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Only run these tests if the build includes the CAST operator @@ -317,30 +317,6 @@ } {12345} do_test cast-3.32.3 { sqlite3_finalize $::STMT } {SQLITE_OK} - -do_test cast-4.1 { - db eval { - CREATE TABLE t1(a); - INSERT INTO t1 VALUES('abc'); - SELECT a, CAST(a AS integer) FROM t1; - } -} {abc 0} -do_test cast-4.2 { - db eval { - SELECT CAST(a AS integer), a FROM t1; - } -} {0 abc} -do_test cast-4.3 { - db eval { - SELECT a, CAST(a AS integer), a FROM t1; - } -} {abc 0 abc} -do_test cast-4.4 { - db eval { - SELECT CAST(a AS integer), a, CAST(a AS real), a FROM t1; - } -} {0 abc 0.0 abc} - finish_test DELETED test/corruptC.test Index: test/corruptC.test ================================================================== --- test/corruptC.test +++ /dev/null @@ -1,373 +0,0 @@ -# 2004 August 30 -# -# 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. -# -# This file implements tests to make sure SQLite does not crash or -# segfault if it sees a corrupt database file. It creates a base -# data base file, then tests that single byte corruptions in -# increasingly larger quantities are handled gracefully. -# -# $Id: corruptC.test,v 1.10 2008/11/19 18:43:07 drh Exp $ - -catch {file delete -force test.db test.db-journal test.bu} - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -# Construct a compact, dense database for testing. -# -do_test corruptC-1.1 { - execsql { - PRAGMA auto_vacuum = 0; - PRAGMA legacy_file_format=1; - BEGIN; - CREATE TABLE t1(x,y); - INSERT INTO t1 VALUES(1,1); - INSERT OR IGNORE INTO t1 SELECT x*2,y FROM t1; - INSERT OR IGNORE INTO t1 SELECT x*3,y FROM t1; - INSERT OR IGNORE INTO t1 SELECT x*5,y FROM t1; - INSERT OR IGNORE INTO t1 SELECT x*7,y FROM t1; - INSERT OR IGNORE INTO t1 SELECT x*11,y FROM t1; - INSERT OR IGNORE INTO t1 SELECT x*13,y FROM t1; - CREATE INDEX t1i1 ON t1(x); - CREATE TABLE t2 AS SELECT x,2 as y FROM t1 WHERE rowid%5!=0; - COMMIT; - } -} {} - -ifcapable {integrityck} { - integrity_check corruptC-1.2 -} - -# Generate random integer -# -proc random {range} { - return [expr {round(rand()*$range)}] -} - -# Copy file $from into $to -# -proc copy_file {from to} { - file copy -force $from $to -} - -# Setup for the tests. Make a backup copy of the good database in test.bu. -# -db close -copy_file test.db test.bu -sqlite3 db test.db -set fsize [file size test.db] - -# Set a quasi-random random seed. -if {[info exists SOAKTEST]} { - # If we are doing SOAK tests, we want a different - # random seed for each run. Ideally we would like - # to use [clock clicks] or something like that here. - set qseed [file mtime test.db] -} else { - # If we are not doing soak tests, - # make it repeatable. - set qseed 0 -} -expr srand($qseed) - -# -# First test some specific corruption tests found from earlier runs -# with specific seeds. -# - -# test that a corrupt content offset size is handled (seed 5577) -do_test corruptC-2.1 { - db close - copy_file test.bu test.db - - # insert corrupt byte(s) - hexio_write test.db 2053 [format %02x 0x04] - - sqlite3 db test.db - catchsql {PRAGMA integrity_check} -} {0 {{*** in database main *** -Corruption detected in header on page 3}}} - -# test that a corrupt content offset size is handled (seed 5649) -do_test corruptC-2.2 { - db close - copy_file test.bu test.db - - # insert corrupt byte(s) - hexio_write test.db 27 [format %02x 0x08] - hexio_write test.db 233 [format %02x 0x6a] - hexio_write test.db 328 [format %02x 0x67] - hexio_write test.db 750 [format %02x 0x1f] - hexio_write test.db 1132 [format %02x 0x52] - hexio_write test.db 1133 [format %02x 0x84] - hexio_write test.db 1220 [format %02x 0x01] - hexio_write test.db 3688 [format %02x 0xc1] - hexio_write test.db 3714 [format %02x 0x58] - hexio_write test.db 3746 [format %02x 0x9a] - - sqlite3 db test.db - catchsql {UPDATE t1 SET y=1} -} {1 {database disk image is malformed}} - -# test that a corrupt free cell size is handled (seed 13329) -do_test corruptC-2.3 { - db close - copy_file test.bu test.db - - # insert corrupt byte(s) - hexio_write test.db 1094 [format %02x 0x76] - - sqlite3 db test.db - catchsql {UPDATE t1 SET y=1} -} {1 {database disk image is malformed}} - -# test that a corrupt free cell size is handled (seed 169571) -do_test corruptC-2.4 { - db close - copy_file test.bu test.db - - # insert corrupt byte(s) - hexio_write test.db 3119 [format %02x 0xdf] - - sqlite3 db test.db - catchsql {UPDATE t2 SET y='abcdef-uvwxyz'} -} {1 {database disk image is malformed}} - -# test that a corrupt free cell size is handled (seed 169571) -do_test corruptC-2.5 { - db close - copy_file test.bu test.db - - # insert corrupt byte(s) - hexio_write test.db 3119 [format %02x 0xdf] - hexio_write test.db 4073 [format %02x 0xbf] - - sqlite3 db test.db - catchsql {BEGIN; UPDATE t2 SET y='abcdef-uvwxyz'; ROLLBACK;} - catchsql {PRAGMA integrity_check} -} {0 {{*** in database main *** -Corruption detected in cell 710 on page 4 -Multiple uses for byte 661 of page 4 -Fragmented space is 249 byte reported as 21 on page 4}}} - -# test that a corrupt free cell size is handled (seed 169595) -do_test corruptC-2.6 { - db close - copy_file test.bu test.db - - # insert corrupt byte(s) - hexio_write test.db 619 [format %02x 0xe2] - hexio_write test.db 3150 [format %02x 0xa8] - - sqlite3 db test.db - catchsql {BEGIN; UPDATE t2 SET y='abcdef-uvwxyz'; ROLLBACK;} -} {1 {database disk image is malformed}} - -# corruption (seed 178692) -do_test corruptC-2.7 { - db close - copy_file test.bu test.db - - # insert corrupt byte(s) - hexio_write test.db 3074 [format %02x 0xa0] - - sqlite3 db test.db - catchsql {BEGIN; UPDATE t2 SET y='abcdef-uvwxyz'; ROLLBACK;} -} {1 {database disk image is malformed}} - -# corruption (seed 179069) -do_test corruptC-2.8 { - db close - copy_file test.bu test.db - - # insert corrupt byte(s) - hexio_write test.db 1393 [format %02x 0x7d] - hexio_write test.db 84 [format %02x 0x19] - hexio_write test.db 3287 [format %02x 0x3b] - hexio_write test.db 2564 [format %02x 0xed] - hexio_write test.db 2139 [format %02x 0x55] - - sqlite3 db test.db - catchsql {BEGIN; DELETE FROM t1 WHERE x>13; ROLLBACK;} -} {1 {database disk image is malformed}} - -# corruption (seed 170434) -do_test corruptC-2.9 { - db close - copy_file test.bu test.db - - # insert corrupt byte(s) - hexio_write test.db 2095 [format %02x 0xd6] - - sqlite3 db test.db - catchsql {BEGIN; DELETE FROM t1 WHERE x>13; ROLLBACK;} -} {1 {database disk image is malformed}} - -# corruption (seed 186504) -do_test corruptC-2.10 { - db close - copy_file test.bu test.db - - # insert corrupt byte(s) - hexio_write test.db 3130 [format %02x 0x02] - - sqlite3 db test.db - catchsql {BEGIN; UPDATE t2 SET y='abcdef-uvwxyz'; ROLLBACK;} -} {1 {database disk image is malformed}} - -# corruption (seed 1589) -do_test corruptC-2.11 { - db close - copy_file test.bu test.db - - # insert corrupt byte(s) - hexio_write test.db 55 [format %02x 0xa7] - - sqlite3 db test.db - catchsql {BEGIN; CREATE TABLE t3 AS SELECT x,3 as y FROM t2 WHERE rowid%5!=0; ROLLBACK;} -} {1 {database disk image is malformed}} - -# corruption (seed 14166) -do_test corruptC-2.12 { - db close - copy_file test.bu test.db - - # insert corrupt byte(s) - hexio_write test.db 974 [format %02x 0x2e] - - sqlite3 db test.db - catchsql {SELECT count(*) FROM sqlite_master;} -} {1 {malformed database schema (t1i1) - corrupt database}} - -# corruption (seed 218803) -do_test corruptC-2.13 { - db close - copy_file test.bu test.db - - # insert corrupt byte(s) - hexio_write test.db 102 [format %02x 0x12] - - sqlite3 db test.db - catchsql {BEGIN; CREATE TABLE t3 AS SELECT x,3 as y FROM t2 WHERE rowid%5!=0; ROLLBACK;} -} {1 {database disk image is malformed}} - - -# -# now test for a series of quasi-random seeds -for {set tn 0} {$tn<1024} {incr tn 1} { - - # setup for test - db close - copy_file test.bu test.db - sqlite3 db test.db - - # Seek to a random location in the file, and write a random single byte - # value. Then do various operations on the file to make sure that - # the database engine can handle the corruption gracefully. - # - set last 0 - for {set i 1} {$i<=512 && !$last} {incr i 1} { - - # insert random byte at random location - db close - set roffset [random $fsize] - set rbyte [format %02x [random 255]] - - # You can uncomment the following to have it trace - # exactly how it's corrupting the file. This is - # useful for generating the "seed specific" tests - # above. - # set rline "$roffset $rbyte" - # puts stdout $rline - - hexio_write test.db $roffset $rbyte - sqlite3 db test.db - - # do a few random operations to make sure that if - # they error, they error gracefully instead of crashing. - do_test corruptC-3.$tn.($qseed).$i.1 { - catchsql {SELECT count(*) FROM sqlite_master} - set x {} - } {} - do_test corruptC-3.$tn.($qseed).$i.2 { - catchsql {SELECT count(*) FROM t1} - set x {} - } {} - do_test corruptC-3.$tn.($qseed).$i.3 { - catchsql {SELECT count(*) FROM t1 WHERE x>13} - set x {} - } {} - do_test corruptC-3.$tn.($qseed).$i.4 { - catchsql {SELECT count(*) FROM t2} - set x {} - } {} - do_test corruptC-3.$tn.($qseed).$i.5 { - catchsql {SELECT count(*) FROM t2 WHERE x<13} - set x {} - } {} - do_test corruptC-3.$tn.($qseed).$i.6 { - catchsql {BEGIN; UPDATE t1 SET y=1; ROLLBACK;} - set x {} - } {} - do_test corruptC-3.$tn.($qseed).$i.7 { - catchsql {BEGIN; UPDATE t2 SET y='abcdef-uvwxyz'; ROLLBACK;} - set x {} - } {} - do_test corruptC-3.$tn.($qseed).$i.8 { - catchsql {BEGIN; DELETE FROM t1 WHERE x>13; ROLLBACK;} - set x {} - } {} - do_test corruptC-3.$tn.($qseed).$i.9 { - catchsql {BEGIN; DELETE FROM t2 WHERE x<13; ROLLBACK;} - set x {} - } {} - do_test corruptC-3.$tn.($qseed).$i.10 { - catchsql {BEGIN; CREATE TABLE t3 AS SELECT x,3 as y FROM t2 WHERE rowid%5!=0; ROLLBACK;} - set x {} - } {} - - # check the integrity of the database. - # once the corruption is detected, we can stop. - ifcapable {integrityck} { - set res [ catchsql {PRAGMA integrity_check} ] - set ans [lindex $res 1] - if { [ string compare $ans "ok" ] != 0 } { - set last -1 - } - } - # if we are not capable of doing an integrity check, - # stop after corrupting 5 bytes. - ifcapable {!integrityck} { - if { $i > 5 } { - set last -1 - } - } - - # Check that no page references were leaked. - # TBD: need to figure out why this doesn't work - # work with ROLLBACKs... - if {0} { - do_test corruptC-3.$tn.($qseed).$i.11 { - set bt [btree_from_db db] - db_enter db - array set stats [btree_pager_stats $bt] - db_leave db - set stats(ref) - } {0} - } - } - # end for i - -} -# end for tn - -finish_test DELETED test/crash8.test Index: test/crash8.test ================================================================== --- test/crash8.test +++ /dev/null @@ -1,343 +0,0 @@ -# 2009 January 8 -# -# 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 test verifies a couple of specific potential data corruption -# scenarios involving crashes or power failures. -# -# Later: Also, some other specific scenarios required for coverage -# testing that do not lead to corruption. -# -# $Id: crash8.test,v 1.4 2009/01/11 00:44:48 drh Exp $ - - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -ifcapable !crashtest { - finish_test - return -} - -do_test crash8-1.1 { - execsql { - PRAGMA auto_vacuum=OFF; - CREATE TABLE t1(a, b); - CREATE INDEX i1 ON t1(a, b); - INSERT INTO t1 VALUES(1, randstr(1000,1000)); - INSERT INTO t1 VALUES(2, randstr(1000,1000)); - INSERT INTO t1 VALUES(3, randstr(1000,1000)); - INSERT INTO t1 VALUES(4, randstr(1000,1000)); - INSERT INTO t1 VALUES(5, randstr(1000,1000)); - INSERT INTO t1 VALUES(6, randstr(1000,1000)); - CREATE TABLE t2(a, b); - CREATE TABLE t3(a, b); - CREATE TABLE t4(a, b); - CREATE TABLE t5(a, b); - CREATE TABLE t6(a, b); - CREATE TABLE t7(a, b); - CREATE TABLE t8(a, b); - CREATE TABLE t9(a, b); - CREATE TABLE t10(a, b); - PRAGMA integrity_check - } -} {ok} - - -# Potential corruption scenario 1. A second process opens the database -# and modifies a large portion of it. It then opens a second transaction -# and modifies a small part of the database, but crashes before it commits -# the transaction. -# -# When the first process accessed the database again, it was rolling back -# the aborted transaction, but was not purging its in-memory cache (which -# was loaded before the second process made its first, successful, -# modification). Producing an inconsistent cache. -# -do_test crash8-1.2 { - crashsql -delay 2 -file test.db { - PRAGMA cache_size = 10; - UPDATE t1 SET b = randstr(1000,1000); - INSERT INTO t9 VALUES(1, 2); - } -} {1 {child process exited abnormally}} -do_test crash8-1.3 { - execsql {PRAGMA integrity_check} -} {ok} - -# Potential corruption scenario 2. The second process, operating in -# persistent-journal mode, makes a large change to the database file -# with a small in-memory cache. Such that more than one journal-header -# was written to the file. It then opens a second transaction and makes -# a smaller change that requires only a single journal-header to be -# written to the journal file. The second change is such that the -# journal content written to the persistent journal file exactly overwrites -# the first journal-header and set of subsequent records written by the -# first, successful, change. The second process crashes before it can -# commit its second change. -# -# When the first process accessed the database again, it was rolling back -# the second aborted transaction, then continuing to rollback the second -# and subsequent journal-headers written by the first, successful, change. -# Database corruption. -# -do_test crash8.2.1 { - crashsql -delay 2 -file test.db { - PRAGMA journal_mode = persist; - PRAGMA cache_size = 10; - UPDATE t1 SET b = randstr(1000,1000); - PRAGMA cache_size = 100; - BEGIN; - INSERT INTO t2 VALUES('a', 'b'); - INSERT INTO t3 VALUES('a', 'b'); - INSERT INTO t4 VALUES('a', 'b'); - INSERT INTO t5 VALUES('a', 'b'); - INSERT INTO t6 VALUES('a', 'b'); - INSERT INTO t7 VALUES('a', 'b'); - INSERT INTO t8 VALUES('a', 'b'); - INSERT INTO t9 VALUES('a', 'b'); - INSERT INTO t10 VALUES('a', 'b'); - COMMIT; - } -} {1 {child process exited abnormally}} - -do_test crash8-2.3 { - execsql {PRAGMA integrity_check} -} {ok} - -proc read_file {zFile} { - set fd [open $zFile] - fconfigure $fd -translation binary - set zData [read $fd] - close $fd - return $zData -} -proc write_file {zFile zData} { - set fd [open $zFile w] - fconfigure $fd -translation binary - puts -nonewline $fd $zData - close $fd -} - -# The following tests check that SQLite will not roll back a hot-journal -# file if the sector-size field in the first journal file header is -# suspect. Definition of suspect: -# -# a) Not a power of 2, or (crash8-3.5) -# b) Greater than 0x01000000 (16MB), or (crash8-3.6) -# c) Less than 512. (crash8-3.7) -# -# Also test that SQLite will not rollback a hot-journal file with a -# suspect page-size. In this case "suspect" means: -# -# a) Not a power of 2, or -# b) Less than 512, or -# c) Greater than SQLITE_MAX_PAGE_SIZE -# -do_test crash8-3.1 { - list [file exists test.db-joural] [file exists test.db] -} {0 1} -do_test crash8-3.2 { - execsql { - PRAGMA synchronous = off; - BEGIN; - DELETE FROM t1; - SELECT count(*) FROM t1; - } -} {0} -do_test crash8-3.3 { - set zJournal [read_file test.db-journal] - execsql { - COMMIT; - SELECT count(*) FROM t1; - } -} {0} -do_test crash8-3.4 { - binary scan [string range $zJournal 20 23] I nSector - set nSector -} {512} - -do_test crash8-3.5 { - set zJournal2 [string replace $zJournal 20 23 [binary format I 513]] - write_file test.db-journal $zJournal2 - - execsql { - SELECT count(*) FROM t1; - PRAGMA integrity_check - } -} {0 ok} -do_test crash8-3.6 { - set zJournal2 [string replace $zJournal 20 23 [binary format I 0x2000000]] - write_file test.db-journal $zJournal2 - execsql { - SELECT count(*) FROM t1; - PRAGMA integrity_check - } -} {0 ok} -do_test crash8-3.7 { - set zJournal2 [string replace $zJournal 20 23 [binary format I 256]] - write_file test.db-journal $zJournal2 - execsql { - SELECT count(*) FROM t1; - PRAGMA integrity_check - } -} {0 ok} - -do_test crash8-3.8 { - set zJournal2 [string replace $zJournal 24 27 [binary format I 513]] - write_file test.db-journal $zJournal2 - - execsql { - SELECT count(*) FROM t1; - PRAGMA integrity_check - } -} {0 ok} -do_test crash8-3.9 { - set big [expr $SQLITE_MAX_PAGE_SIZE * 2] - set zJournal2 [string replace $zJournal 24 27 [binary format I $big]] - write_file test.db-journal $zJournal2 - execsql { - SELECT count(*) FROM t1; - PRAGMA integrity_check - } -} {0 ok} -do_test crash8-3.10 { - set zJournal2 [string replace $zJournal 24 27 [binary format I 256]] - write_file test.db-journal $zJournal2 - execsql { - SELECT count(*) FROM t1; - PRAGMA integrity_check - } -} {0 ok} - -do_test crash8-3.11 { - set fd [open test.db-journal w] - fconfigure $fd -translation binary - puts -nonewline $fd $zJournal - close $fd - execsql { - SELECT count(*) FROM t1; - PRAGMA integrity_check - } -} {6 ok} - - -# If a connection running in persistent-journal mode is part of a -# multi-file transaction, it must ensure that the master-journal name -# appended to the journal file contents during the commit is located -# at the end of the physical journal file. If there was already a -# large journal file allocated at the start of the transaction, this -# may mean truncating the file so that the master journal name really -# is at the physical end of the file. -# -# This block of tests test that SQLite correctly truncates such -# journal files, and that the results behave correctly if a hot-journal -# rollback occurs. -# -ifcapable pragma { - reset_db - file delete -force test2.db - - do_test crash8-4.1 { - execsql { - PRAGMA journal_mode = persist; - CREATE TABLE ab(a, b); - INSERT INTO ab VALUES(0, 'abc'); - INSERT INTO ab VALUES(1, NULL); - INSERT INTO ab VALUES(2, NULL); - INSERT INTO ab VALUES(3, NULL); - INSERT INTO ab VALUES(4, NULL); - INSERT INTO ab VALUES(5, NULL); - INSERT INTO ab VALUES(6, NULL); - UPDATE ab SET b = randstr(1000,1000); - ATTACH 'test2.db' AS aux; - CREATE TABLE aux.ab(a, b); - INSERT INTO aux.ab SELECT * FROM main.ab; - - UPDATE aux.ab SET b = randstr(1000,1000) WHERE a>=1; - UPDATE ab SET b = randstr(1000,1000) WHERE a>=1; - } - list [file exists test.db-journal] [file exists test2.db-journal] - } {1 1} - - do_test crash8-4.2 { - execsql { - BEGIN; - UPDATE aux.ab SET b = 'def' WHERE a = 0; - UPDATE main.ab SET b = 'def' WHERE a = 0; - COMMIT; - } - } {} - - do_test crash8-4.3 { - execsql { - UPDATE aux.ab SET b = randstr(1000,1000) WHERE a>=1; - UPDATE ab SET b = randstr(1000,1000) WHERE a>=1; - } - } {} - - set contents_main [db eval {SELECT b FROM main.ab WHERE a = 1}] - set contents_aux [db eval {SELECT b FROM aux.ab WHERE a = 1}] - - do_test crash8-4.4 { - crashsql -file test2.db -delay 1 { - ATTACH 'test2.db' AS aux; - BEGIN; - UPDATE aux.ab SET b = 'ghi' WHERE a = 0; - UPDATE main.ab SET b = 'ghi' WHERE a = 0; - COMMIT; - } - } {1 {child process exited abnormally}} - - do_test crash8-4.5 { - list [file exists test.db-journal] [file exists test2.db-journal] - } {1 1} - - do_test crash8-4.6 { - execsql { - SELECT b FROM main.ab WHERE a = 0; - SELECT b FROM aux.ab WHERE a = 0; - } - } {def def} - - do_test crash8-4.7 { - crashsql -file test2.db -delay 1 { - ATTACH 'test2.db' AS aux; - BEGIN; - UPDATE aux.ab SET b = 'jkl' WHERE a = 0; - UPDATE main.ab SET b = 'jkl' WHERE a = 0; - COMMIT; - } - } {1 {child process exited abnormally}} - - do_test crash8-4.8 { - set fd [open test.db-journal] - fconfigure $fd -translation binary - seek $fd -16 end - binary scan [read $fd 4] I len - - seek $fd [expr {-1 * ($len + 16)}] end - set zMasterJournal [read $fd $len] - close $fd - - file exists $zMasterJournal - } {1} - - do_test crash8-4.9 { - execsql { SELECT b FROM aux.ab WHERE a = 0 } - } {def} - - do_test crash8-4.10 { - file delete $zMasterJournal - execsql { SELECT b FROM main.ab WHERE a = 0 } - } {jkl} -} - -finish_test Index: test/date.test ================================================================== --- test/date.test +++ test/date.test @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing date and time functions. # -# $Id: date.test,v 1.32 2009/01/30 17:27:44 drh Exp $ +# $Id: date.test,v 1.31 2008/07/08 02:12:37 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Skip this whole file if date and time functions are omitted @@ -452,32 +452,10 @@ datetest 13.6 {strftime('%Y-%m-%d %H:%M:%S', '2007-01-01 23:59:59.6')} \ {2007-01-01 23:59:59} datetest 13.7 {strftime('%Y-%m-%d %H:%M:%f', '2007-01-01 23:59:59.6')} \ {2007-01-01 23:59:59.600} -# Ticket #3618 -datetest 13.11 {julianday(2454832.5,'-1 day')} {2454831.5} -datetest 13.12 {julianday(2454832.5,'+1 day')} {2454833.5} -datetest 13.13 {julianday(2454832.5,'-1.5 day')} {2454831.0} -datetest 13.14 {julianday(2454832.5,'+1.5 day')} {2454834.0} -datetest 13.15 {julianday(2454832.5,'-3 hours')} {2454832.375} -datetest 13.16 {julianday(2454832.5,'+3 hours')} {2454832.625} -datetest 13.17 {julianday(2454832.5,'-45 minutes')} {2454832.46875} -datetest 13.18 {julianday(2454832.5,'+45 minutes')} {2454832.53125} -datetest 13.19 {julianday(2454832.5,'-675 seconds')} {2454832.4921875} -datetest 13.20 {julianday(2454832.5,'+675 seconds')} {2454832.5078125} -datetest 13.21 {julianday(2454832.5,'-1.5 months')} {2454786.5} -datetest 13.22 {julianday(2454832.5,'+1.5 months')} {2454878.5} -datetest 13.23 {julianday(2454832.5,'-1.5 years')} {2454284.0} -datetest 13.24 {julianday(2454832.5,'+1.5 years')} {2455380.0} - -datetest 13.30 {date('2000-01-01','+1.5 years')} {2001-07-02} -datetest 13.31 {date('2001-01-01','+1.5 years')} {2002-07-02} -datetest 13.32 {date('2002-01-01','+1.5 years')} {2003-07-02} -datetest 13.33 {date('2002-01-01','-1.5 years')} {2000-07-02} -datetest 13.34 {date('2001-01-01','-1.5 years')} {1999-07-02} - # Test for issues reported by BareFeet (list.sql at tandb.com.au) # on mailing list on 2008-06-12. # # Put a floating point number in the database so that we can manipulate # raw bits using the hexio interface. Index: test/distinctagg.test ================================================================== --- test/distinctagg.test +++ test/distinctagg.test @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script is the DISTINCT modifier on aggregate functions. # -# $Id: distinctagg.test,v 1.3 2009/02/09 13:19:28 drh Exp $ +# $Id: distinctagg.test,v 1.2 2005/09/12 23:03:17 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -50,13 +50,8 @@ do_test distinctagg-2.1 { catchsql { SELECT count(distinct) FROM t1; } -} {1 {DISTINCT aggregates must have exactly one argument}} -do_test distinctagg-2.2 { - catchsql { - SELECT group_concat(distinct a,b) FROM t1; - } -} {1 {DISTINCT aggregates must have exactly one argument}} +} {1 {DISTINCT in aggregate must be followed by an expression}} finish_test Index: test/exclusive.test ================================================================== --- test/exclusive.test +++ test/exclusive.test @@ -10,11 +10,11 @@ #*********************************************************************** # This file implements regression tests for SQLite library. The focus # of these tests is exclusive access mode (i.e. the thing activated by # "PRAGMA locking_mode = EXCLUSIVE"). # -# $Id: exclusive.test,v 1.11 2008/12/22 11:43:36 danielk1977 Exp $ +# $Id: exclusive.test,v 1.9 2008/09/24 14:03:43 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl ifcapable {!pager_pragmas} { @@ -26,10 +26,19 @@ file delete -force test2.db file delete -force test3.db-journal file delete -force test3.db file delete -force test4.db-journal file delete -force test4.db + +# The locking mode for the TEMP table is always "exclusive" for +# on-disk tables and "normal" for in-memory tables. +# +if {[info exists TEMP_STORE] && $TEMP_STORE>=2} { + set temp_mode normal +} else { + set temp_mode exclusive +} #---------------------------------------------------------------------- # Test cases exclusive-1.X test the PRAGMA logic. # do_test exclusive-1.0 { @@ -36,11 +45,11 @@ execsql { pragma locking_mode; pragma main.locking_mode; pragma temp.locking_mode; } -} [list normal normal exclusive] +} [list normal normal $temp_mode] do_test exclusive-1.1 { execsql { pragma locking_mode = exclusive; } } {exclusive} @@ -48,11 +57,11 @@ execsql { pragma locking_mode; pragma main.locking_mode; pragma temp.locking_mode; } -} [list exclusive exclusive exclusive] +} [list exclusive exclusive $temp_mode] do_test exclusive-1.3 { execsql { pragma locking_mode = normal; } } {normal} @@ -60,11 +69,11 @@ execsql { pragma locking_mode; pragma main.locking_mode; pragma temp.locking_mode; } -} [list normal normal exclusive] +} [list normal normal $temp_mode] do_test exclusive-1.5 { execsql { pragma locking_mode = invalid; } } {normal} @@ -72,11 +81,11 @@ execsql { pragma locking_mode; pragma main.locking_mode; pragma temp.locking_mode; } -} [list normal normal exclusive] +} [list normal normal $temp_mode] ifcapable attach { do_test exclusive-1.7 { execsql { pragma locking_mode = exclusive; ATTACH 'test2.db' as aux; @@ -93,11 +102,11 @@ execsql { pragma main.locking_mode; pragma temp.locking_mode; pragma aux.locking_mode; } - } [list normal exclusive exclusive] + } [list normal $temp_mode exclusive] do_test exclusive-1.9 { execsql { pragma locking_mode; } } {exclusive} @@ -129,11 +138,11 @@ pragma main.locking_mode; pragma temp.locking_mode; pragma aux.locking_mode; pragma aux2.locking_mode; } - } [list normal exclusive normal normal] + } [list normal $temp_mode normal normal] do_test exclusive-1.13 { execsql { ATTACH 'test4.db' as aux3; } execsql { @@ -141,11 +150,11 @@ pragma temp.locking_mode; pragma aux.locking_mode; pragma aux2.locking_mode; pragma aux3.locking_mode; } - } [list normal exclusive normal normal normal] + } [list normal $temp_mode normal normal normal] do_test exclusive-1.99 { execsql { DETACH aux; DETACH aux2; @@ -391,21 +400,10 @@ # longer active. # db close sqlite db test.db -# if we're using proxy locks, we use 3 filedescriptors for a db -# that is open but NOT writing changes, normally -# sqlite uses 1 (proxy locking adds the conch and the local lock) -set using_proxy 0 -foreach {name value} [array get env SQLITE_FORCE_PROXY_LOCKING] { - set using_proxy $value -} -set extrafds 0 -if {$using_proxy!=0} { - set extrafds 2 -} do_test exclusive-5.0 { execsql { CREATE TABLE abc(a UNIQUE, b UNIQUE, c UNIQUE); BEGIN; @@ -414,45 +412,40 @@ } } {} do_test exclusive-5.1 { # Three files are open: The db, journal and statement-journal. set sqlite_open_file_count - expr $sqlite_open_file_count-$extrafds } {3} do_test exclusive-5.2 { execsql { COMMIT; } # One file open: the db. set sqlite_open_file_count - expr $sqlite_open_file_count-$extrafds } {1} do_test exclusive-5.3 { execsql { PRAGMA locking_mode = exclusive; BEGIN; INSERT INTO abc VALUES(5, 6, 7); } # Two files open: the db and journal. set sqlite_open_file_count - expr $sqlite_open_file_count-$extrafds } {2} do_test exclusive-5.4 { execsql { INSERT INTO abc SELECT a+10, b+10, c+10 FROM abc; } # Three files are open: The db, journal and statement-journal. set sqlite_open_file_count - expr $sqlite_open_file_count-$extrafds } {3} do_test exclusive-5.5 { execsql { COMMIT; } # Three files are still open: The db, journal and statement-journal. set sqlite_open_file_count - expr $sqlite_open_file_count-$extrafds } {3} do_test exclusive-5.6 { execsql { PRAGMA locking_mode = normal; SELECT * FROM abc; @@ -459,9 +452,8 @@ } } {normal 1 2 3 2 3 4 5 6 7 11 12 13 12 13 14 15 16 17} do_test exclusive-5.7 { # Just the db open. set sqlite_open_file_count - expr $sqlite_open_file_count-$extrafds } {1} finish_test Index: test/exclusive2.test ================================================================== --- test/exclusive2.test +++ test/exclusive2.test @@ -8,11 +8,11 @@ # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. # -# $Id: exclusive2.test,v 1.10 2008/11/27 02:22:11 drh Exp $ +# $Id: exclusive2.test,v 1.9 2008/08/22 00:25:53 aswift Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl ifcapable {!pager_pragmas} { @@ -177,11 +177,10 @@ # large enough to hold the entire database. With 1024 byte pages, # this means 19 pages. We also need to disable the soft-heap-limit # to prevent memory-induced cache spills. # do_test exclusive2-2.1 { - execsql {PRAGMA cache_size=1000;} execsql {PRAGMA locking_mode = exclusive;} execsql { BEGIN; DELETE FROM t1; INSERT INTO t1(a) VALUES(randstr(10, 400)); Index: test/expr.test ================================================================== --- test/expr.test +++ test/expr.test @@ -9,26 +9,19 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing expressions. # -# $Id: expr.test,v 1.67 2009/02/04 03:59:25 shane Exp $ +# $Id: expr.test,v 1.65 2008/08/22 16:29:51 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Create a table to work with. # -ifcapable floatingpoint { - execsql {CREATE TABLE test1(i1 int, i2 int, r1 real, r2 real, t1 text, t2 text)} - execsql {INSERT INTO test1 VALUES(1,2,1.1,2.2,'hello','world')} -} -ifcapable !floatingpoint { - execsql {CREATE TABLE test1(i1 int, i2 int, t1 text, t2 text)} - execsql {INSERT INTO test1 VALUES(1,2,'hello','world')} -} - +execsql {CREATE TABLE test1(i1 int, i2 int, r1 real, r2 real, t1 text, t2 text)} +execsql {INSERT INTO test1 VALUES(1,2,1.1,2.2,'hello','world')} proc test_expr {name settings expr result} { do_test $name [format { execsql {BEGIN; UPDATE test1 SET %s; SELECT %s FROM test1; ROLLBACK;} } $settings $expr] $result } @@ -52,14 +45,12 @@ test_expr expr-1.17 {i1=20, i2=20} {i2>=i1} 1 test_expr expr-1.18 {i1=20, i2=20} {i2!=i1} 0 test_expr expr-1.19 {i1=20, i2=20} {i2=i1} 1 test_expr expr-1.20 {i1=20, i2=20} {i2<>i1} 0 test_expr expr-1.21 {i1=20, i2=20} {i2==i1} 1 -ifcapable floatingpoint { - test_expr expr-1.22 {i1=1, i2=2, r1=3.0} {i1+i2*r1} {7.0} - test_expr expr-1.23 {i1=1, i2=2, r1=3.0} {(i1+i2)*r1} {9.0} -} +test_expr expr-1.22 {i1=1, i2=2, r1=3.0} {i1+i2*r1} {7.0} +test_expr expr-1.23 {i1=1, i2=2, r1=3.0} {(i1+i2)*r1} {9.0} test_expr expr-1.24 {i1=1, i2=2} {min(i1,i2,i1+i2,i1-i2)} {-1} test_expr expr-1.25 {i1=1, i2=2} {max(i1,i2,i1+i2,i1-i2)} {3} test_expr expr-1.26 {i1=1, i2=2} {max(i1,i2,i1+i2,i1-i2)} {3} test_expr expr-1.27 {i1=1, i2=2} {i1==1 AND i2=2} {1} test_expr expr-1.28 {i1=1, i2=2} {i1=2 AND i2=1} {0} @@ -141,66 +132,52 @@ test_expr expr-1.100 {i1=1, i2=''} {i1=i2} 0 test_expr expr-1.101 {i1=0, i2=''} {i1=i2} 0 # Check for proper handling of 64-bit integer values. # -if {[working_64bit_int]} { - test_expr expr-1.102 {i1=40, i2=1} {i2<1} 1 -} - -if {[working_64bit_int]} { - test_expr expr-1.106 {i1=0} {(1<<63)/-1} -9223372036854775808 -} - +test_expr expr-1.102 {i1=40, i2=1} {i2<1} 1 + +test_expr expr-1.106 {i1=0} {(1<<63)/-1} -9223372036854775808 test_expr expr-1.107 {i1=0} {(1<<63)%-1} 0 test_expr expr-1.108 {i1=0} {1%0} {{}} test_expr expr-1.109 {i1=0} {1/0} {{}} - -if {[working_64bit_int]} { - test_expr expr-1.110 {i1=0} {-9223372036854775807/-1} 9223372036854775807 -} - -ifcapable floatingpoint { - test_expr expr-2.1 {r1=1.23, r2=2.34} {r1+r2} 3.57 - test_expr expr-2.2 {r1=1.23, r2=2.34} {r1-r2} -1.11 - test_expr expr-2.3 {r1=1.23, r2=2.34} {r1*r2} 2.8782 -} +test_expr expr-1.110 {i1=0} {-9223372036854775807/-1} 9223372036854775807 + +test_expr expr-2.1 {r1=1.23, r2=2.34} {r1+r2} 3.57 +test_expr expr-2.2 {r1=1.23, r2=2.34} {r1-r2} -1.11 +test_expr expr-2.3 {r1=1.23, r2=2.34} {r1*r2} 2.8782 set tcl_precision 15 -ifcapable floatingpoint { - test_expr expr-2.4 {r1=1.23, r2=2.34} {r1/r2} 0.525641025641026 - test_expr expr-2.5 {r1=1.23, r2=2.34} {r2/r1} 1.90243902439024 - test_expr expr-2.6 {r1=1.23, r2=2.34} {r2r1} 1 - test_expr expr-2.9 {r1=1.23, r2=2.34} {r2>=r1} 1 - test_expr expr-2.10 {r1=1.23, r2=2.34} {r2!=r1} 1 - test_expr expr-2.11 {r1=1.23, r2=2.34} {r2=r1} 0 - test_expr expr-2.12 {r1=1.23, r2=2.34} {r2<>r1} 1 - test_expr expr-2.13 {r1=1.23, r2=2.34} {r2==r1} 0 - test_expr expr-2.14 {r1=2.34, r2=2.34} {r2r1} 0 - test_expr expr-2.17 {r1=2.34, r2=2.34} {r2>=r1} 1 - test_expr expr-2.18 {r1=2.34, r2=2.34} {r2!=r1} 0 - test_expr expr-2.19 {r1=2.34, r2=2.34} {r2=r1} 1 - test_expr expr-2.20 {r1=2.34, r2=2.34} {r2<>r1} 0 - test_expr expr-2.21 {r1=2.34, r2=2.34} {r2==r1} 1 - test_expr expr-2.22 {r1=1.23, r2=2.34} {min(r1,r2,r1+r2,r1-r2)} {-1.11} - test_expr expr-2.23 {r1=1.23, r2=2.34} {max(r1,r2,r1+r2,r1-r2)} {3.57} - test_expr expr-2.24 {r1=25.0, r2=11.0} {r1%r2} 3.0 - test_expr expr-2.25 {r1=1.23, r2=NULL} {coalesce(r1+r2,99.0)} 99.0 - test_expr expr-2.26 {r1=1e300, r2=1e300} {coalesce((r1*r2)*0.0,99.0)} 99.0 - test_expr expr-2.26b {r1=1e300, r2=-1e300} {coalesce((r1*r2)*0.0,99.0)} 99.0 - test_expr expr-2.27 {r1=1.1, r2=0.0} {r1/r2} {{}} - test_expr expr-2.28 {r1=1.1, r2=0.0} {r1%r2} {{}} -} +test_expr expr-2.4 {r1=1.23, r2=2.34} {r1/r2} 0.525641025641026 +test_expr expr-2.5 {r1=1.23, r2=2.34} {r2/r1} 1.90243902439024 +test_expr expr-2.6 {r1=1.23, r2=2.34} {r2r1} 1 +test_expr expr-2.9 {r1=1.23, r2=2.34} {r2>=r1} 1 +test_expr expr-2.10 {r1=1.23, r2=2.34} {r2!=r1} 1 +test_expr expr-2.11 {r1=1.23, r2=2.34} {r2=r1} 0 +test_expr expr-2.12 {r1=1.23, r2=2.34} {r2<>r1} 1 +test_expr expr-2.13 {r1=1.23, r2=2.34} {r2==r1} 0 +test_expr expr-2.14 {r1=2.34, r2=2.34} {r2r1} 0 +test_expr expr-2.17 {r1=2.34, r2=2.34} {r2>=r1} 1 +test_expr expr-2.18 {r1=2.34, r2=2.34} {r2!=r1} 0 +test_expr expr-2.19 {r1=2.34, r2=2.34} {r2=r1} 1 +test_expr expr-2.20 {r1=2.34, r2=2.34} {r2<>r1} 0 +test_expr expr-2.21 {r1=2.34, r2=2.34} {r2==r1} 1 +test_expr expr-2.22 {r1=1.23, r2=2.34} {min(r1,r2,r1+r2,r1-r2)} {-1.11} +test_expr expr-2.23 {r1=1.23, r2=2.34} {max(r1,r2,r1+r2,r1-r2)} {3.57} +test_expr expr-2.24 {r1=25.0, r2=11.0} {r1%r2} 3.0 +test_expr expr-2.25 {r1=1.23, r2=NULL} {coalesce(r1+r2,99.0)} 99.0 +test_expr expr-2.26 {r1=1e300, r2=1e300} {coalesce((r1*r2)*0.0,99.0)} 99.0 +test_expr expr-2.26b {r1=1e300, r2=-1e300} {coalesce((r1*r2)*0.0,99.0)} 99.0 +test_expr expr-2.27 {r1=1.1, r2=0.0} {r1/r2} {{}} +test_expr expr-2.28 {r1=1.1, r2=0.0} {r1%r2} {{}} test_expr expr-3.1 {t1='abc', t2='xyz'} {t1r2} 0 - test_expr expr-4.11 {r1='abc', r2='Abc'} {r1r2} 1 - test_expr expr-4.13 {r1='abc', r2='Bbc'} {r1r2} 1 - test_expr expr-4.15 {r1='0', r2='0.0'} {r1==r2} 1 - test_expr expr-4.16 {r1='0.000', r2='0.0'} {r1==r2} 1 - test_expr expr-4.17 {r1=' 0.000', r2=' 0.0'} {r1==r2} 0 - test_expr expr-4.18 {r1='0.0', r2='abc'} {r1r2} 0 -} +test_expr expr-4.10 {r1='0.0', r2='abc'} {r1>r2} 0 +test_expr expr-4.11 {r1='abc', r2='Abc'} {r1r2} 1 +test_expr expr-4.13 {r1='abc', r2='Bbc'} {r1r2} 1 +test_expr expr-4.15 {r1='0', r2='0.0'} {r1==r2} 1 +test_expr expr-4.16 {r1='0.000', r2='0.0'} {r1==r2} 1 +test_expr expr-4.17 {r1=' 0.000', r2=' 0.0'} {r1==r2} 0 +test_expr expr-4.18 {r1='0.0', r2='abc'} {r1r2} 0 # CSL is true if LIKE is case sensitive and false if not. # NCSL is the opposite. Use these variables as the result # on operations where case makes a difference. set CSL $sqlite_options(casesensitivelike) @@ -599,13 +573,11 @@ test_expr2 expr-7.35 {(b=0 AND a<0) AND a IS NULL} {} test_expr2 expr-7.36 {a<2 OR (a<0 OR b=0)} {{} 1} test_expr2 expr-7.37 {a<2 OR (b=0 OR a<0)} {{} 1} test_expr2 expr-7.38 {a<2 OR (a<0 AND b=0)} {1} test_expr2 expr-7.39 {a<2 OR (b=0 AND a<0)} {1} -ifcapable floatingpoint { - test_expr2 expr-7.40 {((a<2 OR a IS NULL) AND b<3) OR b>1e10} {{} 1} -} +test_expr2 expr-7.40 {((a<2 OR a IS NULL) AND b<3) OR b>1e10} {{} 1} test_expr2 expr-7.41 {a BETWEEN -1 AND 1} {1} test_expr2 expr-7.42 {a NOT BETWEEN 2 AND 100} {1} test_expr2 expr-7.43 {(b+1234)||'this is a string that is at least 32 characters long' BETWEEN 1 AND 2} {} test_expr2 expr-7.44 {123||'xabcdefghijklmnopqrstuvwyxz01234567890'||a BETWEEN '123a' AND '123b'} {} test_expr2 expr-7.45 {((123||'xabcdefghijklmnopqrstuvwyxz01234567890'||a) BETWEEN '123a' AND '123b')<0} {} @@ -632,40 +604,37 @@ test_expr2 expr-7.59 {LIKE('10%',b)} {10 20} test_expr2 expr-7.60 {LIKE('_4',b)} {6} test_expr2 expr-7.61 {GLOB('1?',a)} {10 11 12 13 14 15 16 17 18 19} test_expr2 expr-7.62 {GLOB('1*4',b)} {10 14} test_expr2 expr-7.63 {GLOB('*1[456]',b)} {4} + +breakpoint test_expr2 expr-7.64 {b = abs(-2)} {1} test_expr2 expr-7.65 {b = abs(+-2)} {1} test_expr2 expr-7.66 {b = abs(++-2)} {1} test_expr2 expr-7.67 {b = abs(+-+-2)} {1} test_expr2 expr-7.68 {b = abs(+-++-2)} {1} test_expr2 expr-7.69 {b = abs(++++-2)} {1} test_expr2 expr-7.70 {b = 5 - abs(+3)} {1} test_expr2 expr-7.71 {b = 5 - abs(-3)} {1} -ifcapable floatingpoint { - test_expr2 expr-7.72 {b = abs(-2.0)} {1} -} +test_expr2 expr-7.72 {b = abs(-2.0)} {1} test_expr2 expr-7.73 {b = 6 - abs(-a)} {2} -ifcapable floatingpoint { - test_expr2 expr-7.74 {b = abs(8.0)} {3} -} +test_expr2 expr-7.74 {b = abs(8.0)} {3} + # Test the CURRENT_TIME, CURRENT_DATE, and CURRENT_TIMESTAMP expressions. # -ifcapable {floatingpoint} { - set sqlite_current_time 1157124849 - do_test expr-8.1 { - execsql {SELECT CURRENT_TIME} - } {15:34:09} - do_test expr-8.2 { - execsql {SELECT CURRENT_DATE} - } {2006-09-01} - do_test expr-8.3 { - execsql {SELECT CURRENT_TIMESTAMP} - } {{2006-09-01 15:34:09}} -} +set sqlite_current_time 1157124849 +do_test expr-8.1 { + execsql {SELECT CURRENT_TIME} +} {15:34:09} +do_test expr-8.2 { + execsql {SELECT CURRENT_DATE} +} {2006-09-01} +do_test expr-8.3 { + execsql {SELECT CURRENT_TIMESTAMP} +} {{2006-09-01 15:34:09}} ifcapable datetime { do_test expr-8.4 { execsql {SELECT CURRENT_TIME==time('now');} } 1 do_test expr-8.5 { @@ -675,15 +644,13 @@ execsql {SELECT CURRENT_TIMESTAMP==datetime('now');} } 1 } set sqlite_current_time 0 -ifcapable floatingpoint { - do_test expr-9.1 { - execsql {SELECT round(-('-'||'123'))} - } 123.0 -} +do_test expr-9.1 { + execsql {SELECT round(-('-'||'123'))} +} 123.0 # Test an error message that can be generated by the LIKE expression do_test expr-10.1 { catchsql {SELECT 'abc' LIKE 'abc' ESCAPE ''} } {1 {ESCAPE expression must be a single character}} @@ -722,18 +689,16 @@ execsql {SELECT typeof(-9223372036854775808)} } {integer} do_test expr-11.12 { execsql {SELECT typeof(-00000009223372036854775808)} } {integer} -ifcapable floatingpoint { - do_test expr-11.13 { - execsql {SELECT typeof(-9223372036854775809)} - } {real} - do_test expr-11.14 { - execsql {SELECT typeof(-00000009223372036854775809)} - } {real} -} +do_test expr-11.13 { + execsql {SELECT typeof(-9223372036854775809)} +} {real} +do_test expr-11.14 { + execsql {SELECT typeof(-00000009223372036854775809)} +} {real} # These two statements used to leak memory (because of missing %destructor # directives in parse.y). do_test expr-12.1 { catchsql { @@ -744,47 +709,41 @@ catchsql { SELECT (CASE WHEN a>4 THEN 1 ELSE 0) FROM test1; } } {1 {near ")": syntax error}} -ifcapable floatingpoint { - do_test expr-13.1 { - execsql { - SELECT 12345678901234567890; - } - } {1.23456789012346e+19} -} +do_test expr-13.1 { + execsql { + SELECT 12345678901234567890; + } +} {1.23456789012346e+19} # Implicit String->Integer conversion is used when possible. # -if {[working_64bit_int]} { - do_test expr-13.2 { - execsql { - SELECT 0+'9223372036854775807' - } - } {9223372036854775807} - do_test expr-13.3 { - execsql { - SELECT '9223372036854775807'+0 - } - } {9223372036854775807} -} +do_test expr-13.2 { + execsql { + SELECT 0+'9223372036854775807' + } +} {9223372036854775807} +do_test expr-13.3 { + execsql { + SELECT '9223372036854775807'+0 + } +} {9223372036854775807} # If the value is too large, use String->Float conversion. # -ifcapable floatingpoint { - do_test expr-13.4 { - execsql { - SELECT 0+'9223372036854775808' - } - } {9.22337203685478e+18} - do_test expr-13.5 { - execsql { - SELECT '9223372036854775808'+0 - } - } {9.22337203685478e+18} -} +do_test expr-13.4 { + execsql { + SELECT 0+'9223372036854775808' + } +} {9.22337203685478e+18} +do_test expr-13.5 { + execsql { + SELECT '9223372036854775808'+0 + } +} {9.22337203685478e+18} # Use String->float conversion if the value is explicitly a floating # point value. # do_test expr-13.6 { Index: test/filectrl.test ================================================================== --- test/filectrl.test +++ test/filectrl.test @@ -7,11 +7,11 @@ # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # -# $Id: filectrl.test,v 1.2 2008/11/21 00:10:35 aswift Exp $ +# $Id: filectrl.test,v 1.1 2008/01/22 14:50:17 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -25,17 +25,7 @@ do_test filectrl-1.3 { db close sqlite3 db :memory: file_control_test db } {} -do_test filectrl-1.4 { - sqlite3 db test.db - file_control_lasterrno_test db -} {} -do_test filectrl-1.5 { - db close - sqlite3 db test_control_lockproxy.db - file_control_lockproxy_test db -} {} -db close -file delete -force .test_control_lockproxy.db-conch test.proxy + finish_test Index: test/fkey1.test ================================================================== --- test/fkey1.test +++ test/fkey1.test @@ -104,18 +104,7 @@ } } [concat \ {0 0 t5 d {} {SET NULL} CASCADE NONE} \ {0 1 t5 e {} {SET NULL} CASCADE NONE} \ ] -do_test fkey1-3.4 { - execsql { - CREATE TABLE t9(d, e, f, - FOREIGN KEY (d, e) REFERENCES t5 ON DELETE CASCADE ON UPDATE SET DEFAULT - ); - PRAGMA foreign_key_list(t9); - } -} [concat \ - {0 0 t5 d {} {SET DEFAULT} CASCADE NONE} \ - {0 1 t5 e {} {SET DEFAULT} CASCADE NONE} \ -] finish_test DELETED test/fts3expr.test Index: test/fts3expr.test ================================================================== --- test/fts3expr.test +++ /dev/null @@ -1,472 +0,0 @@ -# 2006 September 9 -# -# The author disclaims copyright to this source code. In place of -# a legal notice, here is a blessing: -# -# May you do good and not evil. -# May you find forgiveness for yourself and forgive others. -# May you share freely, never taking more than you give. -# -#************************************************************************* -# This file implements regression tests for SQLite library. The -# focus of this script is testing the FTS3 module. -# -# $Id: fts3expr.test,v 1.6 2009/01/01 14:06:13 danielk1977 Exp $ -# - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -# If SQLITE_ENABLE_FTS3 is defined, omit this file. -ifcapable !fts3 { - finish_test - return -} - -set sqlite_fts3_enable_parentheses 1 - -proc test_fts3expr {expr} { - db one {SELECT fts3_exprtest('simple', $expr, 'a', 'b', 'c')} -} -do_test fts3expr-1.0 { - test_fts3expr "abcd" -} {PHRASE 3 0 abcd} -do_test fts3expr-1.1 { - test_fts3expr " tag " -} {PHRASE 3 0 tag} - -do_test fts3expr-1.2 { - test_fts3expr "ab AND cd" -} {AND {PHRASE 3 0 ab} {PHRASE 3 0 cd}} -do_test fts3expr-1.2.1 { - test_fts3expr "ab cd" -} {AND {PHRASE 3 0 ab} {PHRASE 3 0 cd}} -do_test fts3expr-1.3 { - test_fts3expr "ab OR cd" -} {OR {PHRASE 3 0 ab} {PHRASE 3 0 cd}} -do_test fts3expr-1.4 { - test_fts3expr "ab NOT cd" -} {NOT {PHRASE 3 0 ab} {PHRASE 3 0 cd}} -do_test fts3expr-1.5 { - test_fts3expr "ab NEAR cd" -} {NEAR/10 {PHRASE 3 0 ab} {PHRASE 3 0 cd}} -do_test fts3expr-1.6.1 { - test_fts3expr "ab NEAR/5 cd" -} {NEAR/5 {PHRASE 3 0 ab} {PHRASE 3 0 cd}} -do_test fts3expr-1.6.2 { - test_fts3expr "ab NEAR/87654321 cd" -} {NEAR/87654321 {PHRASE 3 0 ab} {PHRASE 3 0 cd}} -do_test fts3expr-1.6.3 { - test_fts3expr "ab NEAR/7654321 cd" -} {NEAR/7654321 {PHRASE 3 0 ab} {PHRASE 3 0 cd}} -do_test fts3expr-1.6.4 { - test_fts3expr "ab NEAR/654321 cd" -} {NEAR/654321 {PHRASE 3 0 ab} {PHRASE 3 0 cd}} -do_test fts3expr-1.6.5 { - test_fts3expr "ab NEAR/54321 cd" -} {NEAR/54321 {PHRASE 3 0 ab} {PHRASE 3 0 cd}} -do_test fts3expr-1.6.6 { - test_fts3expr "ab NEAR/4321 cd" -} {NEAR/4321 {PHRASE 3 0 ab} {PHRASE 3 0 cd}} -do_test fts3expr-1.6.7 { - test_fts3expr "ab NEAR/321 cd" -} {NEAR/321 {PHRASE 3 0 ab} {PHRASE 3 0 cd}} -do_test fts3expr-1.6.8 { - test_fts3expr "ab NEAR/21 cd" -} {NEAR/21 {PHRASE 3 0 ab} {PHRASE 3 0 cd}} - -do_test fts3expr-1.7 { - test_fts3expr {"one two three"} -} {PHRASE 3 0 one two three} -do_test fts3expr-1.8.1 { - test_fts3expr {zero "one two three" four} -} {AND {AND {PHRASE 3 0 zero} {PHRASE 3 0 one two three}} {PHRASE 3 0 four}} -do_test fts3expr-1.8.2 { - test_fts3expr {zero AND "one two three" four} -} {AND {AND {PHRASE 3 0 zero} {PHRASE 3 0 one two three}} {PHRASE 3 0 four}} -do_test fts3expr-1.8.3 { - test_fts3expr {zero "one two three" AND four} -} {AND {AND {PHRASE 3 0 zero} {PHRASE 3 0 one two three}} {PHRASE 3 0 four}} -do_test fts3expr-1.8.4 { - test_fts3expr {zero AND "one two three" AND four} -} {AND {AND {PHRASE 3 0 zero} {PHRASE 3 0 one two three}} {PHRASE 3 0 four}} -do_test fts3expr-1.9.1 { - test_fts3expr {"one* two three"} -} {PHRASE 3 0 one+ two three} -do_test fts3expr-1.9.2 { - test_fts3expr {"one two* three"} -} {PHRASE 3 0 one two+ three} -do_test fts3expr-1.9.3 { - test_fts3expr {"one* two* three"} -} {PHRASE 3 0 one+ two+ three} -do_test fts3expr-1.9.4 { - test_fts3expr {"one two three*"} -} {PHRASE 3 0 one two three+} -do_test fts3expr-1.9.5 { - test_fts3expr {"one* two three*"} -} {PHRASE 3 0 one+ two three+} -do_test fts3expr-1.9.6 { - test_fts3expr {"one two* three*"} -} {PHRASE 3 0 one two+ three+} -do_test fts3expr-1.9.7 { - test_fts3expr {"one* two* three*"} -} {PHRASE 3 0 one+ two+ three+} - -do_test fts3expr-1.10 { - test_fts3expr {one* two} -} {AND {PHRASE 3 0 one+} {PHRASE 3 0 two}} -do_test fts3expr-1.11 { - test_fts3expr {one two*} -} {AND {PHRASE 3 0 one} {PHRASE 3 0 two+}} - -do_test fts3expr-1.14 { - test_fts3expr {a:one two} -} {AND {PHRASE 0 0 one} {PHRASE 3 0 two}} -do_test fts3expr-1.15 { - test_fts3expr {one b:two} -} {AND {PHRASE 3 0 one} {PHRASE 1 0 two}} - -do_test fts3expr-1.16 { - test_fts3expr {one AND two AND three AND four AND five} -} [list AND \ - [list AND \ - [list AND \ - [list AND {PHRASE 3 0 one} {PHRASE 3 0 two}] \ - {PHRASE 3 0 three} \ - ] \ - {PHRASE 3 0 four} \ - ] \ - {PHRASE 3 0 five} \ - ] -do_test fts3expr-1.17 { - test_fts3expr {(one AND two) AND ((three AND four) AND five)} -} [list AND \ - [list AND {PHRASE 3 0 one} {PHRASE 3 0 two}] \ - [list AND \ - [list AND {PHRASE 3 0 three} {PHRASE 3 0 four}] \ - {PHRASE 3 0 five} \ - ] \ - ] -do_test fts3expr-1.18 { - test_fts3expr {(one AND two) OR ((three AND four) AND five)} -} [list OR \ - [list AND {PHRASE 3 0 one} {PHRASE 3 0 two}] \ - [list AND \ - [list AND {PHRASE 3 0 three} {PHRASE 3 0 four}] \ - {PHRASE 3 0 five} \ - ] \ - ] -do_test fts3expr-1.19 { - test_fts3expr {(one AND two) AND ((three AND four) OR five)} -} [list AND \ - [list AND {PHRASE 3 0 one} {PHRASE 3 0 two}] \ - [list OR \ - [list AND {PHRASE 3 0 three} {PHRASE 3 0 four}] \ - {PHRASE 3 0 five} \ - ] \ - ] -do_test fts3expr-1.20 { - test_fts3expr {(one OR two) AND ((three OR four) AND five)} -} [list AND \ - [list OR {PHRASE 3 0 one} {PHRASE 3 0 two}] \ - [list AND \ - [list OR {PHRASE 3 0 three} {PHRASE 3 0 four}] \ - {PHRASE 3 0 five} \ - ] \ - ] -do_test fts3expr-1.21 { - test_fts3expr {(one OR two) AND ((three NOT four) AND five)} -} [list AND \ - [list OR {PHRASE 3 0 one} {PHRASE 3 0 two}] \ - [list AND \ - [list NOT {PHRASE 3 0 three} {PHRASE 3 0 four}] \ - {PHRASE 3 0 five} \ - ] \ - ] -do_test fts3expr-1.22 { - test_fts3expr {(one OR two) NOT ((three OR four) AND five)} -} [list NOT \ - [list OR {PHRASE 3 0 one} {PHRASE 3 0 two}] \ - [list AND \ - [list OR {PHRASE 3 0 three} {PHRASE 3 0 four}] \ - {PHRASE 3 0 five} \ - ] \ - ] -do_test fts3expr-1.23 { - test_fts3expr {(((((one OR two))))) NOT (((((three OR four))) AND five))} -} [list NOT \ - [list OR {PHRASE 3 0 one} {PHRASE 3 0 two}] \ - [list AND \ - [list OR {PHRASE 3 0 three} {PHRASE 3 0 four}] \ - {PHRASE 3 0 five} \ - ] \ - ] -do_test fts3expr-1.24 { - test_fts3expr {one NEAR two} -} [list NEAR/10 {PHRASE 3 0 one} {PHRASE 3 0 two}] -do_test fts3expr-1.25 { - test_fts3expr {(one NEAR two)} -} [list NEAR/10 {PHRASE 3 0 one} {PHRASE 3 0 two}] -do_test fts3expr-1.26 { - test_fts3expr {((((((one NEAR two))))))} -} [list NEAR/10 {PHRASE 3 0 one} {PHRASE 3 0 two}] -do_test fts3expr-1.27 { - test_fts3expr {(one NEAR two) OR ((three OR four) AND five)} -} [list OR \ - [list NEAR/10 {PHRASE 3 0 one} {PHRASE 3 0 two}] \ - [list AND \ - [list OR {PHRASE 3 0 three} {PHRASE 3 0 four}] \ - {PHRASE 3 0 five} \ - ] \ - ] -do_test fts3expr-1.28 { - test_fts3expr {(one NEAR/321 two) OR ((three OR four) AND five)} -} [list OR \ - [list NEAR/321 {PHRASE 3 0 one} {PHRASE 3 0 two}] \ - [list AND \ - [list OR {PHRASE 3 0 three} {PHRASE 3 0 four}] \ - {PHRASE 3 0 five} \ - ] \ - ] - -proc strip_phrase_data {L} { - if {[lindex $L 0] eq "PHRASE"} { - return [lrange $L 3 end] - } - return [list \ - [lindex $L 0] \ - [strip_phrase_data [lindex $L 1]] \ - [strip_phrase_data [lindex $L 2]] \ - ] -} -proc test_fts3expr2 {expr} { - strip_phrase_data [ - db one {SELECT fts3_exprtest('simple', $expr, 'a', 'b', 'c')} - ] -} -do_test fts3expr-2.1 { - test_fts3expr2 "ab OR cd AND ef" -} {OR ab {AND cd ef}} -do_test fts3expr-2.2 { - test_fts3expr2 "cd AND ef OR ab" -} {OR {AND cd ef} ab} -do_test fts3expr-2.3 { - test_fts3expr2 "ab AND cd AND ef OR gh" -} {OR {AND {AND ab cd} ef} gh} -do_test fts3expr-2.4 { - test_fts3expr2 "ab AND cd OR ef AND gh" -} {OR {AND ab cd} {AND ef gh}} -do_test fts3expr-2.5 { - test_fts3expr2 "ab cd" -} {AND ab cd} - -do_test fts3expr-3.1 { - test_fts3expr2 "(ab OR cd) AND ef" -} {AND {OR ab cd} ef} -do_test fts3expr-3.2 { - test_fts3expr2 "ef AND (ab OR cd)" -} {AND ef {OR ab cd}} -do_test fts3expr-3.3 { - test_fts3expr2 "(ab OR cd)" -} {OR ab cd} -do_test fts3expr-3.4 { - test_fts3expr2 "(((ab OR cd)))" -} {OR ab cd} - -do_test fts3expr-3.5 { - test_fts3expr2 "one AND (two NEAR three)" -} {AND one {NEAR/10 two three}} -do_test fts3expr-3.6 { - test_fts3expr2 "one (two NEAR three)" -} {AND one {NEAR/10 two three}} -do_test fts3expr-3.7 { - test_fts3expr2 "(two NEAR three) one" -} {AND {NEAR/10 two three} one} -do_test fts3expr-3.8 { - test_fts3expr2 "(two NEAR three) AND one" -} {AND {NEAR/10 two three} one} -do_test fts3expr-3.9 { - test_fts3expr2 "(two NEAR three) (four five)" -} {AND {NEAR/10 two three} {AND four five}} -do_test fts3expr-3.10 { - test_fts3expr2 "(two NEAR three) AND (four five)" -} {AND {NEAR/10 two three} {AND four five}} -do_test fts3expr-3.11 { - test_fts3expr2 "(two NEAR three) (four NEAR five)" -} {AND {NEAR/10 two three} {NEAR/10 four five}} -do_test fts3expr-3.12 { - test_fts3expr2 "(two NEAR three) OR (four NEAR five)" -} {OR {NEAR/10 two three} {NEAR/10 four five}} - -do_test fts3expr-3.13 { - test_fts3expr2 "(two NEAR/1a three)" -} {AND {AND {AND two near} 1a} three} - -do_test fts3expr-3.14 { - test_fts3expr2 "(two NEAR// three)" -} {AND {AND two near} three} -do_test fts3expr-3.15 { - test_fts3expr2 "(two NEAR/: three)" -} {AND {AND two near} three} - -do_test fts3expr-3.16 { - test_fts3expr2 "(two NEAR three)OR(four NEAR five)" -} {OR {NEAR/10 two three} {NEAR/10 four five}} -do_test fts3expr-3.17 { - test_fts3expr2 "(two NEAR three)OR\"four five\"" -} {OR {NEAR/10 two three} {four five}} -do_test fts3expr-3.18 { - test_fts3expr2 "one \u0080wo" -} "AND one \u0080wo" - - - -#------------------------------------------------------------------------ -# The following tests, fts3expr-4.*, test the parsers response to syntax -# errors in query expressions. This is done using a real fts3 table and -# MATCH clauses, not the parser test interface. -# -do_test fts3expr-4.1 { - execsql { CREATE VIRTUAL TABLE t1 USING fts3(a, b, c) } -} {} - -# Mismatched parenthesis: -do_test fts3expr-4.2.1 { - catchsql { SELECT * FROM t1 WHERE t1 MATCH 'example AND (hello OR world))' } -} {1 {SQL logic error or missing database}} -do_test fts3expr-4.2.2 { - catchsql { SELECT * FROM t1 WHERE t1 MATCH 'example AND (hello OR world' } -} {1 {SQL logic error or missing database}} -do_test fts3expr-4.2.3 { - catchsql { SELECT * FROM t1 WHERE t1 MATCH '(hello' } -} {1 {SQL logic error or missing database}} -do_test fts3expr-4.2.4 { - catchsql { SELECT * FROM t1 WHERE t1 MATCH '(' } -} {1 {SQL logic error or missing database}} -do_test fts3expr-4.2.5 { - catchsql { SELECT * FROM t1 WHERE t1 MATCH ')' } -} {1 {SQL logic error or missing database}} - -do_test fts3expr-4.2.6 { - catchsql { SELECT * FROM t1 WHERE t1 MATCH 'example (hello world' } -} {1 {SQL logic error or missing database}} - -# Unterminated quotation marks: -do_test fts3expr-4.3.1 { - catchsql { SELECT * FROM t1 WHERE t1 MATCH 'example OR "hello world' } -} {1 {SQL logic error or missing database}} -do_test fts3expr-4.3.2 { - catchsql { SELECT * FROM t1 WHERE t1 MATCH 'example OR hello world"' } -} {1 {SQL logic error or missing database}} - -# Binary operators without the required operands. -do_test fts3expr-4.4.1 { - catchsql { SELECT * FROM t1 WHERE t1 MATCH 'OR hello world' } -} {1 {SQL logic error or missing database}} -do_test fts3expr-4.4.2 { - catchsql { SELECT * FROM t1 WHERE t1 MATCH 'hello world OR' } -} {1 {SQL logic error or missing database}} -do_test fts3expr-4.4.3 { - catchsql { SELECT * FROM t1 WHERE t1 MATCH 'one (hello world OR) two' } -} {1 {SQL logic error or missing database}} -do_test fts3expr-4.4.4 { - catchsql { SELECT * FROM t1 WHERE t1 MATCH 'one (OR hello world) two' } -} {1 {SQL logic error or missing database}} - -# NEAR operators with something other than phrases as arguments. -do_test fts3expr-4.5.1 { - catchsql { SELECT * FROM t1 WHERE t1 MATCH '(hello OR world) NEAR one' } -} {1 {SQL logic error or missing database}} -do_test fts3expr-4.5.2 { - catchsql { SELECT * FROM t1 WHERE t1 MATCH 'one NEAR (hello OR world)' } -} {1 {SQL logic error or missing database}} - -#------------------------------------------------------------------------ -# The following OOM tests are designed to cover cases in fts3_expr.c. -# -source $testdir/malloc_common.tcl -do_malloc_test fts3expr-malloc-1 -sqlbody { - SELECT fts3_exprtest('simple', 'a b c "d e f"', 'a', 'b', 'c') -} -do_malloc_test fts3expr-malloc-2 -tclprep { - set sqlite_fts3_enable_parentheses 0 -} -sqlbody { - SELECT fts3_exprtest('simple', 'a -b', 'a', 'b', 'c') -} -cleanup { - set sqlite_fts3_enable_parentheses 1 -} - -#------------------------------------------------------------------------ -# The following tests are not very important. They cover error handling -# cases in the test code, which makes test coverage easier to measure. -# -do_test fts3expr-5.1 { - catchsql { SELECT fts3_exprtest('simple', 'a b') } -} {1 {Usage: fts3_exprtest(tokenizer, expr, col1, ...}} -do_test fts3expr-5.2 { - catchsql { SELECT fts3_exprtest('doesnotexist', 'a b', 'c') } -} {1 {No such tokenizer module}} -do_test fts3expr-5.3 { - catchsql { SELECT fts3_exprtest('simple', 'a b OR', 'c') } -} {1 {Error parsing expression}} - -#------------------------------------------------------------------------ -# The next set of tests verifies that things actually work as they are -# supposed to when using the new syntax. -# -do_test fts3expr-6.1 { - execsql { - CREATE VIRTUAL TABLE t1 USING fts3(a); - } - for {set ii 1} {$ii < 32} {incr ii} { - set v [list] - if {$ii & 1} { lappend v one } - if {$ii & 2} { lappend v two } - if {$ii & 4} { lappend v three } - if {$ii & 8} { lappend v four } - if {$ii & 16} { lappend v five } - execsql { INSERT INTO t1 VALUES($v) } - } - - execsql {SELECT rowid FROM t1 WHERE t1 MATCH 'five four one' ORDER BY rowid} -} {25 27 29 31} - -foreach {id expr res} { - - 2 "five four NOT one" {24 26 28 30} - - 3 "five AND four OR one" - {1 3 5 7 9 11 13 15 17 19 21 23 24 25 26 27 28 29 30 31} - - 4 "five AND (four OR one)" {17 19 21 23 24 25 26 27 28 29 30 31} - - 5 "five NOT (four OR one)" {16 18 20 22} - - 6 "(five NOT (four OR one)) OR (five AND (four OR one))" - {16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31} - - 7 "(five OR one) AND two AND three" {7 15 22 23 30 31} - - 8 "five OR one AND two AND three" - {7 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31} - - 9 "five OR one two three" - {7 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31} - - 10 "five OR \"one two three\"" - {7 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31} - - 11 "one two OR four five NOT three" {3 7 11 15 19 23 24 25 26 27 31} - - 12 "(one two OR four five) NOT three" {3 11 19 24 25 26 27} - - 13 "((((((one two OR four five)))))) NOT three" {3 11 19 24 25 26 27} - -} { - do_test fts3expr-6.$id { - execsql { SELECT rowid FROM t1 WHERE t1 MATCH $expr ORDER BY rowid } - } $res -} - -set sqlite_fts3_enable_parentheses 0 -finish_test DELETED test/fts3expr2.test Index: test/fts3expr2.test ================================================================== --- test/fts3expr2.test +++ /dev/null @@ -1,167 +0,0 @@ -# 2009 January 1 -# -# The author disclaims copyright to this source code. In place of -# a legal notice, here is a blessing: -# -# May you do good and not evil. -# May you find forgiveness for yourself and forgive others. -# May you share freely, never taking more than you give. -# -#************************************************************************* -# This file implements regression tests for SQLite library. The -# focus of this script is testing the FTS3 module syntax parser. -# -# $Id: fts3expr2.test,v 1.1 2009/01/01 07:08:55 danielk1977 Exp $ -# - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -# If SQLITE_ENABLE_FTS3 is defined, omit this file. -ifcapable !fts3 { - finish_test - return -} - -# Test overview: -# -# The tests in this file are pseudo-randomly generated. They test -# the fts3 match expression parser via the test interface -# SQL function "fts3_exprtest" (see comments in fts3_expr.c). -# -# Each test case works as follows: -# -# 1. A random expression tree is generated using proc [random_expr_tree]. -# 2. The expression tree is converted to the text of an equivalent -# fts3 expression using proc [tree_to_expr]. -# 3. The test SQL function "fts3_exprtest" is used to parse the -# expression text generated in step (2), returning a parsed expression -# tree. -# 4. Test that the tree returned in step (3) matches that generated in -# step (1). -# -# In step (2), 4 different fts3 expressions are created from each -# expression tree by varying the following boolean properties: -# -# * Whether or not superflous parenthesis are included. i.e. if -# "a OR b AND (c OR d)" or "a OR (b AND (c OR d))" is generated. -# -# * Whether or not explict AND operators are used. i.e. if -# "a OR b AND c" or "a OR b c" is generated. -# - -set sqlite_fts3_enable_parentheses 1 - -proc strip_phrase_data {L} { - if {[lindex $L 0] eq "PHRASE"} { - return [list P [lrange $L 3 end]] - } - return [list \ - [lindex $L 0] \ - [strip_phrase_data [lindex $L 1]] \ - [strip_phrase_data [lindex $L 2]] \ - ] -} -proc test_fts3expr2 {expr} { - strip_phrase_data [ - db one {SELECT fts3_exprtest('simple', $expr, 'a', 'b', 'c')} - ] -} - -proc rnd {nMax} { expr {int(rand()*$nMax)} } - -proc random_phrase {} { - set phrases [list one two three four "one two" "three four"] - list P [lindex $phrases [rnd [llength $phrases]]] -} - -# Generate and return a pseudo-random expression tree. Using the same -# format returned by the [test_fts3expr2] proc. -# -proc random_expr_tree {iHeight} { - if {$iHeight==0 || [rnd 3]==0} { - return [random_phrase] - } - - set operators [list NEAR NOT AND OR] - set op [lindex $operators [rnd 4]] - - if {$op eq "NEAR"} { - set iDistance [rnd 15] - return [list $op/$iDistance [random_phrase] [random_phrase]] - } - - set iNH [expr {$iHeight - 1}] - return [list $op [random_expr_tree $iNH] [random_expr_tree $iNH]] -} - -# Given an expression tree, generate a corresponding expression. -# -proc tree_to_expr {tree all_brackets implicit_and} { - set prec(NOT) 2 - set prec(AND) 3 - set prec() 3 - set prec(OR) 4 - - set op [lindex $tree 0] - - if {$op eq "P"} { - set phrase [lindex $tree 1] - if {[llength $phrase]>1} { - return "\"$phrase\"" - } else { - return $phrase - } - } - - if {$op eq "NEAR/10"} { - set op "NEAR" - } - if {$op eq "AND" && $implicit_and} { - set op "" - } - - set lhs [lindex $tree 1] - set rhs [lindex $tree 2] - set zLeft [tree_to_expr $lhs $all_brackets $implicit_and] - set zRight [tree_to_expr $rhs $all_brackets $implicit_and] - - set iPrec 5 - set iLeftPrec 0 - set iRightPrec 0 - - catch {set iPrec $prec($op)} - catch {set iLeftPrec $prec([lindex $lhs 0])} - catch {set iRightPrec $prec([lindex $rhs 0])} - - if {$iLeftPrec > $iPrec || $all_brackets} { - set zLeft "($zLeft)" - } - if {$iRightPrec >= $iPrec || $all_brackets} { - set zRight "($zRight)" - } - - return "$zLeft $op $zRight" -} - -proc do_exprparse_test {name expr tree} { - uplevel do_test $name [list "test_fts3expr2 {$expr}"] [list $tree] -} - -for {set iTest 1} {$iTest<500} {incr iTest} { - set t [random_expr_tree 4] - - set e1 [tree_to_expr $t 0 0] - set e2 [tree_to_expr $t 0 1] - set e3 [tree_to_expr $t 1 0] - set e4 [tree_to_expr $t 1 1] - - do_exprparse_test fts3expr2-$iTest.1 $e1 $t - do_exprparse_test fts3expr2-$iTest.2 $e2 $t - do_exprparse_test fts3expr2-$iTest.3 $e3 $t - do_exprparse_test fts3expr2-$iTest.4 $e4 $t -} - -set sqlite_fts3_enable_parentheses 0 -finish_test - Index: test/fts3near.test ================================================================== --- test/fts3near.test +++ test/fts3near.test @@ -8,11 +8,11 @@ # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #************************************************************************* # -# $Id: fts3near.test,v 1.3 2009/01/02 17:33:46 danielk1977 Exp $ +# $Id: fts3near.test,v 1.2 2008/09/12 18:25:31 drh Exp $ # set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -67,17 +67,10 @@ } {2 3} do_test fts3near-1.13 { execsql {SELECT docid FROM t1 WHERE content MATCH 'one NEAR five'} } {1 3} -do_test fts3near-1.14 { - execsql {SELECT docid FROM t1 WHERE content MATCH 'four NEAR four'} -} {} -do_test fts3near-1.15 { - execsql {SELECT docid FROM t1 WHERE content MATCH 'one NEAR two NEAR one'} -} {3} - # Output format of the offsets() function: # # # Index: test/func.test ================================================================== --- test/func.test +++ test/func.test @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing built-in functions. # -# $Id: func.test,v 1.91 2009/02/04 03:59:25 shane Exp $ +# $Id: func.test,v 1.87 2008/10/12 00:27:54 shane Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Create a table to work with. @@ -147,98 +147,69 @@ } ;# End \u1234!=u1234 # Test the abs() and round() functions. # -ifcapable !floatingpoint { - do_test func-4.1 { - execsql { - CREATE TABLE t1(a,b,c); - INSERT INTO t1 VALUES(1,2,3); - INSERT INTO t1 VALUES(2,12345678901234,-1234567890); - INSERT INTO t1 VALUES(3,-2,-5); - } - catchsql {SELECT abs(a,b) FROM t1} - } {1 {wrong number of arguments to function abs()}} -} -ifcapable floatingpoint { - do_test func-4.1 { - execsql { - CREATE TABLE t1(a,b,c); - INSERT INTO t1 VALUES(1,2,3); - INSERT INTO t1 VALUES(2,1.2345678901234,-12345.67890); - INSERT INTO t1 VALUES(3,-2,-5); - } - catchsql {SELECT abs(a,b) FROM t1} - } {1 {wrong number of arguments to function abs()}} -} +do_test func-4.1 { + execsql { + CREATE TABLE t1(a,b,c); + INSERT INTO t1 VALUES(1,2,3); + INSERT INTO t1 VALUES(2,1.2345678901234,-12345.67890); + INSERT INTO t1 VALUES(3,-2,-5); + } + catchsql {SELECT abs(a,b) FROM t1} +} {1 {wrong number of arguments to function abs()}} do_test func-4.2 { catchsql {SELECT abs() FROM t1} } {1 {wrong number of arguments to function abs()}} -ifcapable floatingpoint { - do_test func-4.3 { - catchsql {SELECT abs(b) FROM t1 ORDER BY a} - } {0 {2 1.2345678901234 2}} - do_test func-4.4 { - catchsql {SELECT abs(c) FROM t1 ORDER BY a} - } {0 {3 12345.6789 5}} -} -ifcapable !floatingpoint { - if {[working_64bit_int]} { - do_test func-4.3 { - catchsql {SELECT abs(b) FROM t1 ORDER BY a} - } {0 {2 12345678901234 2}} - } - do_test func-4.4 { - catchsql {SELECT abs(c) FROM t1 ORDER BY a} - } {0 {3 1234567890 5}} -} +do_test func-4.3 { + catchsql {SELECT abs(b) FROM t1 ORDER BY a} +} {0 {2 1.2345678901234 2}} +do_test func-4.4 { + catchsql {SELECT abs(c) FROM t1 ORDER BY a} +} {0 {3 12345.6789 5}} do_test func-4.4.1 { execsql {SELECT abs(a) FROM t2} } {1 {} 345 {} 67890} do_test func-4.4.2 { execsql {SELECT abs(t1) FROM tbl1} } {0.0 0.0 0.0 0.0 0.0} -ifcapable floatingpoint { - do_test func-4.5 { - catchsql {SELECT round(a,b,c) FROM t1} - } {1 {wrong number of arguments to function round()}} - do_test func-4.6 { - catchsql {SELECT round(b,2) FROM t1 ORDER BY b} - } {0 {-2.0 1.23 2.0}} - do_test func-4.7 { - catchsql {SELECT round(b,0) FROM t1 ORDER BY a} - } {0 {2.0 1.0 -2.0}} - do_test func-4.8 { - catchsql {SELECT round(c) FROM t1 ORDER BY a} - } {0 {3.0 -12346.0 -5.0}} - do_test func-4.9 { - catchsql {SELECT round(c,a) FROM t1 ORDER BY a} - } {0 {3.0 -12345.68 -5.0}} - do_test func-4.10 { - catchsql {SELECT 'x' || round(c,a) || 'y' FROM t1 ORDER BY a} - } {0 {x3.0y x-12345.68y x-5.0y}} - do_test func-4.11 { - catchsql {SELECT round() FROM t1 ORDER BY a} - } {1 {wrong number of arguments to function round()}} - do_test func-4.12 { - execsql {SELECT coalesce(round(a,2),'nil') FROM t2} - } {1.0 nil 345.0 nil 67890.0} - do_test func-4.13 { - execsql {SELECT round(t1,2) FROM tbl1} - } {0.0 0.0 0.0 0.0 0.0} - do_test func-4.14 { - execsql {SELECT typeof(round(5.1,1));} - } {real} - do_test func-4.15 { - execsql {SELECT typeof(round(5.1));} - } {real} - do_test func-4.16 { - catchsql {SELECT round(b,2.0) FROM t1 ORDER BY b} - } {0 {-2.0 1.23 2.0}} -} +do_test func-4.5 { + catchsql {SELECT round(a,b,c) FROM t1} +} {1 {wrong number of arguments to function round()}} +do_test func-4.6 { + catchsql {SELECT round(b,2) FROM t1 ORDER BY b} +} {0 {-2.0 1.23 2.0}} +do_test func-4.7 { + catchsql {SELECT round(b,0) FROM t1 ORDER BY a} +} {0 {2.0 1.0 -2.0}} +do_test func-4.8 { + catchsql {SELECT round(c) FROM t1 ORDER BY a} +} {0 {3.0 -12346.0 -5.0}} +do_test func-4.9 { + catchsql {SELECT round(c,a) FROM t1 ORDER BY a} +} {0 {3.0 -12345.68 -5.0}} +do_test func-4.10 { + catchsql {SELECT 'x' || round(c,a) || 'y' FROM t1 ORDER BY a} +} {0 {x3.0y x-12345.68y x-5.0y}} +do_test func-4.11 { + catchsql {SELECT round() FROM t1 ORDER BY a} +} {1 {wrong number of arguments to function round()}} +do_test func-4.12 { + execsql {SELECT coalesce(round(a,2),'nil') FROM t2} +} {1.0 nil 345.0 nil 67890.0} +do_test func-4.13 { + execsql {SELECT round(t1,2) FROM tbl1} +} {0.0 0.0 0.0 0.0 0.0} +do_test func-4.14 { + execsql {SELECT typeof(round(5.1,1));} +} {real} +do_test func-4.15 { + execsql {SELECT typeof(round(5.1));} +} {real} + # Test the upper() and lower() functions # do_test func-5.1 { execsql {SELECT upper(t1) FROM tbl1} @@ -283,30 +254,18 @@ execsql {SELECT last_insert_rowid()} } [db last_insert_rowid] # Tests for aggregate functions and how they handle NULLs. # -ifcapable floatingpoint { - do_test func-8.1 { - ifcapable explain { - execsql {EXPLAIN SELECT sum(a) FROM t2;} - } - execsql { - SELECT sum(a), count(a), round(avg(a),2), min(a), max(a), count(*) FROM t2; - } - } {68236 3 22745.33 1 67890 5} -} -ifcapable !floatingpoint { - do_test func-8.1 { - ifcapable explain { - execsql {EXPLAIN SELECT sum(a) FROM t2;} - } - execsql { - SELECT sum(a), count(a), avg(a), min(a), max(a), count(*) FROM t2; - } - } {68236 3 22745.0 1 67890 5} -} +do_test func-8.1 { + ifcapable explain { + execsql {EXPLAIN SELECT sum(a) FROM t2;} + } + execsql { + SELECT sum(a), count(a), round(avg(a),2), min(a), max(a), count(*) FROM t2; + } +} {68236 3 22745.33 1 67890 5} do_test func-8.2 { execsql { SELECT max('z+'||a||'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP') FROM t2; } } {z+67890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOP} @@ -348,26 +307,16 @@ execsql { SELECT typeof(sum(x)) FROM (SELECT '9223372036' || '854775808' AS x UNION ALL SELECT -9223372036854775807) } } {real} -ifcapable floatingpoint { do_test func-8.8 { execsql { SELECT sum(x)>0.0 FROM (SELECT '9223372036' || '854775808' AS x UNION ALL SELECT -9223372036850000000) } } {1} -} -ifcapable !floatingpoint { - do_test func-8.8 { - execsql { - SELECT sum(x)>0 FROM (SELECT '9223372036' || '854775808' AS x - UNION ALL SELECT -9223372036850000000) - } - } {1} -} } # How do you test the random() function in a meaningful, deterministic way? # do_test func-9.1 { @@ -411,21 +360,21 @@ do_test func-9.11-utf16le { execsql {SELECT hex(replace('abcdefg','ef','12'))} } {6100620063006400310032006700} do_test func-9.12-utf16le { execsql {SELECT hex(replace('abcdefg','','12'))} - } {6100620063006400650066006700} + } {{}} do_test func-9.13-utf16le { execsql {SELECT hex(replace('aabcdefg','a','aaa'))} } {610061006100610061006100620063006400650066006700} } elseif {$encoding=="UTF-8"} { do_test func-9.11-utf8 { execsql {SELECT hex(replace('abcdefg','ef','12'))} } {61626364313267} do_test func-9.12-utf8 { execsql {SELECT hex(replace('abcdefg','','12'))} - } {61626364656667} + } {{}} do_test func-9.13-utf8 { execsql {SELECT hex(replace('aabcdefg','a','aaa'))} } {616161616161626364656667} } @@ -455,39 +404,36 @@ 'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', 'string', NULL ); } } {{}} - -ifcapable floatingpoint { - do_test func-10.4 { - execsql { - SELECT testfunc( - 'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', - 'double', 1.234 - ); - } - } {1.234} - do_test func-10.5 { - execsql { - SELECT testfunc( - 'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', - 'int', 1234, - 'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', - 'string', NULL, - 'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', - 'double', 1.234, - 'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', - 'int', 1234, - 'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', - 'string', NULL, - 'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', - 'double', 1.234 - ); - } - } {1.234} -} +do_test func-10.4 { + execsql { + SELECT testfunc( + 'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', + 'double', 1.234 + ); + } +} {1.234} +do_test func-10.5 { + execsql { + SELECT testfunc( + 'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', + 'int', 1234, + 'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', + 'string', NULL, + 'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', + 'double', 1.234, + 'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', + 'int', 1234, + 'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', + 'string', NULL, + 'string', 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', + 'double', 1.234 + ); + } +} {1.234} # Test the built-in sqlite_version(*) SQL function. # do_test func-11.1 { execsql { @@ -662,18 +608,16 @@ INSERT INTO t5 VALUES(-99); INSERT INTO t5 VALUES(10000); SELECT sum(x) FROM t5; } } {9902} -ifcapable floatingpoint { - do_test func-18.2 { - execsql { - INSERT INTO t5 VALUES(0.0); - SELECT sum(x) FROM t5; - } - } {9902.0} -} +do_test func-18.2 { + execsql { + INSERT INTO t5 VALUES(0.0); + SELECT sum(x) FROM t5; + } +} {9902.0} # The sum of nothing is NULL. But the sum of all NULLs is NULL. # # The TOTAL of nothing is 0.0. # @@ -717,68 +661,50 @@ do_test func-18.11 { execsql { SELECT typeof(sum(x)) FROM t6 } } integer -ifcapable floatingpoint { - do_test func-18.12 { - catchsql { - INSERT INTO t6 VALUES(1<<62); - SELECT sum(x) - ((1<<62)*2.0+1) from t6; - } - } {1 {integer overflow}} - do_test func-18.13 { - execsql { - SELECT total(x) - ((1<<62)*2.0+1) FROM t6 - } - } 0.0 -} -ifcapable !floatingpoint { - do_test func-18.12 { - catchsql { - INSERT INTO t6 VALUES(1<<62); - SELECT sum(x) - ((1<<62)*2+1) from t6; - } - } {1 {integer overflow}} - do_test func-18.13 { - execsql { - SELECT total(x) - ((1<<62)*2+1) FROM t6 - } - } 0.0 -} -if {[working_64bit_int]} { - do_test func-18.14 { - execsql { - SELECT sum(-9223372036854775805); - } - } -9223372036854775805 -} +do_test func-18.12 { + catchsql { + INSERT INTO t6 VALUES(1<<62); + SELECT sum(x) - ((1<<62)*2.0+1) from t6; + } +} {1 {integer overflow}} +do_test func-18.13 { + execsql { + SELECT total(x) - ((1<<62)*2.0+1) FROM t6 + } +} 0.0 +do_test func-18.14 { + execsql { + SELECT sum(-9223372036854775805); + } +} -9223372036854775805 + ifcapable compound&&subquery { do_test func-18.15 { catchsql { SELECT sum(x) FROM (SELECT 9223372036854775807 AS x UNION ALL SELECT 10 AS x); } } {1 {integer overflow}} -if {[working_64bit_int]} { - do_test func-18.16 { - catchsql { - SELECT sum(x) FROM - (SELECT 9223372036854775807 AS x UNION ALL - SELECT -10 AS x); - } - } {0 9223372036854775797} - do_test func-18.17 { - catchsql { - SELECT sum(x) FROM - (SELECT -9223372036854775807 AS x UNION ALL - SELECT 10 AS x); - } - } {0 -9223372036854775797} -} +do_test func-18.16 { + catchsql { + SELECT sum(x) FROM + (SELECT 9223372036854775807 AS x UNION ALL + SELECT -10 AS x); + } +} {0 9223372036854775797} +do_test func-18.17 { + catchsql { + SELECT sum(x) FROM + (SELECT -9223372036854775807 AS x UNION ALL + SELECT 10 AS x); + } +} {0 -9223372036854775797} do_test func-18.18 { catchsql { SELECT sum(x) FROM (SELECT -9223372036854775807 AS x UNION ALL SELECT -10 AS x); @@ -807,17 +733,15 @@ } ;# ifcapable compound&&subquery # Integer overflow on abs() # -if {[working_64bit_int]} { - do_test func-18.31 { - catchsql { - SELECT abs(-9223372036854775807); - } - } {0 9223372036854775807} -} +do_test func-18.31 { + catchsql { + SELECT abs(-9223372036854775807); + } +} {0 9223372036854775807} do_test func-18.32 { catchsql { SELECT abs(-9223372036854775807-1); } } {1 {integer overflow}} @@ -1033,26 +957,21 @@ do_test func-24.6 { execsql { SELECT 'BEGIN-'||group_concat(t1) FROM tbl1 } } {BEGIN-this,program,is,free,software} - -# Ticket #3179: Make sure aggregate functions can take many arguments. -# None of the built-in aggregates do this, so use the md5sum() from the -# test extensions. -# unset -nocomplain midargs set midargs {} unset -nocomplain midres set midres {} unset -nocomplain result -for {set i 1} {$i<[sqlite3_limit db SQLITE_LIMIT_FUNCTION_ARG -1]} {incr i} { +for {set i 1} {$i<[sqlite3_limit db SQLITE_LIMIT_FUNCTION_ARG -1]-1} {incr i} { append midargs ,'/$i' append midres /$i - set result [md5 \ - "this${midres}program${midres}is${midres}free${midres}software${midres}"] - set sql "SELECT md5sum(t1$midargs) FROM tbl1" + set result \ + "this$midres:program$midres:is$midres:free$midres:software$midres" + set sql "SELECT group_concat(t1$midargs,':') FROM tbl1" do_test func-24.7.$i { db eval $::sql } $result } @@ -1110,16 +1029,6 @@ catchsql " SELECT nullx_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789a(0); " } {1 {no such function: nullx_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789a}} -do_test func-27.1 { - catchsql {SELECT coalesce()} -} {1 {wrong number of arguments to function coalesce()}} -do_test func-27.2 { - catchsql {SELECT coalesce(1)} -} {1 {wrong number of arguments to function coalesce()}} -do_test func-27.3 { - catchsql {SELECT coalesce(1,2)} -} {0 1} - finish_test Index: test/fuzz.test ================================================================== --- test/fuzz.test +++ test/fuzz.test @@ -17,11 +17,11 @@ # SQL parse-trees. The majority of the fuzzily generated SQL is # valid as far as the parser is concerned. # # The most complicated trees are for SELECT statements. # -# $Id: fuzz.test,v 1.18 2009/01/06 00:11:26 drh Exp $ +# $Id: fuzz.test,v 1.14 2007/05/30 10:36:47 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl set ::REPEATS 5000 @@ -30,11 +30,10 @@ if {[info exists ::ISQUICK]} { if {$::ISQUICK} { set ::REPEATS 20 } } source $testdir/fuzz_common.tcl -expr srand(0) #---------------------------------------------------------------- # These tests caused errors that were first caught by the tests # in this file. They are still here. do_test fuzz-1.1 { @@ -172,123 +171,10 @@ execsql { DROP TABLE abc; } } {} -# Making sure previously discovered errors have been fixed. -# -do_test fuzz-1.15 { - execsql { - SELECT hex(CAST(zeroblob(1000) AS integer)) - } -} {30} - -do_test fuzz-1.16.1 { - execsql { - CREATE TABLE abc(a, b, c); - CREATE TABLE def(a, b, c); - CREATE TABLE ghi(a, b, c); - } -} {} -do_test fuzz-1.16.2 { - catchsql { - SELECT DISTINCT EXISTS( - SELECT 1 - FROM ( - SELECT C FROM (SELECT 1) - ) - WHERE (SELECT c) - ) - FROM abc - } -} {0 {}} -do_test fuzz-1.16.3 { - catchsql { - SELECT DISTINCT substr(-456 ISNULL,zeroblob(1000), EXISTS( - SELECT DISTINCT EXISTS( - SELECT DISTINCT b FROM abc - ORDER BY EXISTS ( - SELECT DISTINCT 2147483647 UNION ALL SELECT -2147483648 - ) ASC - ) - FROM ( - SELECT c, c FROM ( - SELECT 456, 'injection' ORDER BY 56.1 ASC, -56.1 DESC - ) - ) - GROUP BY (SELECT ALL (SELECT DISTINCT 'hardware')) - HAVING ( - SELECT DISTINCT c - FROM ( - SELECT ALL -2147483648, 'experiments' - ORDER BY -56.1 ASC, -56.1 DESC - ) - GROUP BY (SELECT DISTINCT 456) IN - (SELECT DISTINCT 'injection') NOT IN (SELECT ALL -456) - HAVING EXISTS ( - SELECT ALL 'injection' - ) - ) - UNION ALL - SELECT a IN ( - SELECT -2147483647 - UNION ALL - SELECT ALL 'injection' - ) - FROM sqlite_master - ) -- end EXISTS - ) /* end SUBSTR() */, c NOTNULL ISNULL - FROM abc - ORDER BY CAST(-56.1 AS blob) ASC - } -} {0 {}} -do_test fuzz-1.16.4 { - execsql { - DROP TABLE abc; DROP TABLE def; DROP TABLE ghi; - } -} {} - -do_test fuzz-1.17 { - catchsql { - SELECT 'hardware', 56.1 NOTNULL, random()&0 - FROM ( - SELECT ALL lower(~ EXISTS ( - SELECT 1 NOT IN (SELECT ALL 1) - )), CAST(456 AS integer), -2147483647 - FROM ( - SELECT DISTINCT -456, CAST(1 AS integer) ISNULL - FROM (SELECT ALL 2147483647, typeof(2147483649)) - ) - ) - GROUP BY CAST(CAST('experiments' AS blob) AS blob) - HAVING random() - } -} {0 {hardware 1 0}} - -do_test fuzz-1.18 { - catchsql { - SELECT -2147483649 << upper('fault' NOT IN ( - SELECT ALL ( - SELECT ALL -1 - ORDER BY -2147483649 - LIMIT ( - SELECT ALL ( - SELECT 0 EXCEPT SELECT DISTINCT 'experiments' ORDER BY 1 ASC - ) - ) - OFFSET EXISTS ( - SELECT ALL - (SELECT ALL -2147483648) NOT IN ( - SELECT ALL 123456789.1234567899 - ) IN (SELECT 2147483649) - FROM sqlite_master - ) NOT IN (SELECT ALL 'The') - ) - )) - } -} {0 -4294967298} - #---------------------------------------------------------------- # Test some fuzzily generated expressions. # do_fuzzy_test fuzz-2 -template { SELECT [Expr] } Index: test/fuzz3.test ================================================================== --- test/fuzz3.test +++ test/fuzz3.test @@ -11,11 +11,11 @@ # This file implements regression tests for SQLite library. The focus # of this file is checking the libraries response to subtly corrupting # the database file by changing the values of pseudo-randomly selected # bytes. # -# $Id: fuzz3.test,v 1.3 2009/01/05 17:19:03 drh Exp $ +# $Id: fuzz3.test,v 1.2 2008/09/10 17:53:36 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -143,11 +143,10 @@ {PRAGMA integrity_check} } { do_test fuzz3-$ii.$iNew.[incr iTest] { foreach {rc msg} [catchsql $sql] {} if {$rc == 0 - || $msg eq "database or disk is full" || $msg eq "database disk image is malformed" || $msg eq "file is encrypted or is not a database" || [string match "malformed database schema*" $msg] } { set msg ok @@ -165,5 +164,6 @@ db_checksum } $::cksum } finish_test + Index: test/fuzz_common.tcl ================================================================== --- test/fuzz_common.tcl +++ test/fuzz_common.tcl @@ -7,11 +7,11 @@ # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # -# $Id: fuzz_common.tcl,v 1.2 2009/01/05 19:36:30 drh Exp $ +# $Id: fuzz_common.tcl,v 1.1 2007/05/30 10:36:47 danielk1977 Exp $ proc fuzz {TemplateList} { set n [llength $TemplateList] set i [expr {int(rand()*$n)}] set r [uplevel 1 subst -novar [list [lindex $TemplateList $i]]] @@ -372,11 +372,11 @@ set rc [catch {execsql $::sql} msg] set e 1 if {$rc} { set e 0 foreach error $::fuzzyopts(-errorlist) { - if {[string first $error $msg]>=0} { + if {0 == [string first $error $msg]} { set e 1 break } } } @@ -387,5 +387,6 @@ } set e } {1} } } + Index: test/hook.test ================================================================== --- test/hook.test +++ test/hook.test @@ -15,11 +15,11 @@ # # sqlite_commit_hook (tests hook-1..hook-3 inclusive) # sqlite_update_hook (tests hook-4-*) # sqlite_rollback_hook (tests hook-5.*) # -# $Id: hook.test,v 1.14 2009/01/03 14:04:39 drh Exp $ +# $Id: hook.test,v 1.13 2008/01/19 20:11:26 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl do_test hook-1.2 { @@ -89,31 +89,10 @@ execsql { INSERT INTO t2 VALUES(7,8); } set ::commit_cnt } {} - -# Ticket #3564. -# -do_test hook-3.10 { - file delete -force test2.db test2.db-journal - sqlite3 db2 test2.db - proc commit_hook {} { - set y [db2 one {SELECT y FROM t3 WHERE y>10}] - return [expr {$y>10}] - } - db2 eval {CREATE TABLE t3(x,y)} - db2 commit_hook commit_hook - catchsql {INSERT INTO t3 VALUES(1,2)} db2 - catchsql {INSERT INTO t3 VALUES(11,12)} db2 - catchsql {INSERT INTO t3 VALUES(3,4)} db2 - db2 eval { - SELECT * FROM t3 ORDER BY x; - } -} {1 2 3 4} -db2 close - #---------------------------------------------------------------------------- # Tests for the update-hook. # # 4.1.* - Very simple tests. Test that the update hook is invoked correctly Index: test/in4.test ================================================================== --- test/in4.test +++ test/in4.test @@ -7,11 +7,11 @@ # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # -# $Id: in4.test,v 1.3 2009/01/24 09:56:15 danielk1977 Exp $ +# $Id: in4.test,v 1.1 2008/10/02 13:50:56 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl do_test in4-1.1 { @@ -87,77 +87,7 @@ do_test in4-2.8 { execsql { SELECT b FROM t2 WHERE a IN ('', '0.0.0', '2') } } {two} -# The following block of tests test expressions of the form: -# -# IN () -# -# i.e. IN expressions with a literal empty set. -# -# This has led to crashes on more than one occasion. Test case in4-3.2 -# was added in reponse to a bug reported on the mailing list on 11/7/2008. -# See also tickets #3602 and #185. -# -do_test in4-3.1 { - execsql { - DROP TABLE IF EXISTS t1; - DROP TABLE IF EXISTS t2; - CREATE TABLE t1(x, id); - CREATE TABLE t2(x, id); - INSERT INTO t1 VALUES(NULL, NULL); - INSERT INTO t1 VALUES(0, NULL); - INSERT INTO t1 VALUES(1, 3); - INSERT INTO t1 VALUES(2, 4); - INSERT INTO t1 VALUES(3, 5); - INSERT INTO t1 VALUES(4, 6); - INSERT INTO t2 VALUES(0, NULL); - INSERT INTO t2 VALUES(4, 1); - INSERT INTO t2 VALUES(NULL, 1); - INSERT INTO t2 VALUES(NULL, NULL); - } -} {} -do_test in4-3.2 { - execsql { - SELECT x FROM t1 WHERE id IN () AND x IN (SELECT x FROM t2 WHERE id=1) - } -} {} -do_test in4-3.3 { - execsql { - CREATE TABLE t3(x, y, z); - CREATE INDEX t3i1 ON t3(x, y); - INSERT INTO t3 VALUES(1, 1, 1); - INSERT INTO t3 VALUES(10, 10, 10); - } - execsql { SELECT * FROM t3 WHERE x IN () } -} {} -do_test in4-3.4 { - execsql { SELECT * FROM t3 WHERE x = 10 AND y IN () } -} {} -do_test in4-3.5 { - execsql { SELECT * FROM t3 WHERE x IN () AND y = 10 } -} {} -do_test in4-3.6 { - execsql { SELECT * FROM t3 WHERE x IN () OR x = 10 } -} {10 10 10} -do_test in4-3.7 { - execsql { SELECT * FROM t3 WHERE y IN () } -} {} -do_test in4-3.8 { - execsql { SELECT x IN() AS a FROM t3 WHERE a } -} {} -do_test in4-3.9 { - execsql { SELECT x IN() AS a FROM t3 WHERE NOT a } -} {0 0} -do_test in4-3.10 { - execsql { SELECT * FROM t3 WHERE oid IN () } -} {} -do_test in4-3.11 { - execsql { SELECT * FROM t3 WHERE x IN (1, 2) OR y IN ()} -} {1 1 1} -do_test in4-3.12 { - execsql { SELECT * FROM t3 WHERE x IN (1, 2) AND y IN ()} -} {} - finish_test Index: test/incrblob.test ================================================================== --- test/incrblob.test +++ test/incrblob.test @@ -7,11 +7,11 @@ # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # -# $Id: incrblob.test,v 1.23 2008/11/05 16:37:35 drh Exp $ +# $Id: incrblob.test,v 1.22 2008/10/02 14:49:02 danielk1977 Exp $ # set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -448,32 +448,33 @@ seek $::blob 0 puts -nonewline $::blob "invocation" flush $::blob } {} -# At this point rollback should be illegal (because -# there is an open blob channel). But commit is allowed because -# the blob is read-only. -# +# At this point rollback or commit should be illegal (because +# there is an open blob channel). do_test incrblob-6.10 { catchsql { ROLLBACK; } db2 } {1 {cannot rollback transaction - SQL statements in progress}} do_test incrblob-6.11 { catchsql { COMMIT; } db2 -} {0 {}} +} {1 {cannot commit transaction - SQL statements in progress}} do_test incrblob-6.12 { execsql { SELECT * FROM blobs WHERE rowid = 4; } } {} do_test incrblob-6.13 { close $::blob + execsql { + COMMIT; + } db2 } {} do_test incrblob-6.14 { execsql { SELECT * FROM blobs WHERE rowid = 4; } Index: test/incrvacuum.test ================================================================== --- test/incrvacuum.test +++ test/incrvacuum.test @@ -12,11 +12,11 @@ # focus of this file is testing the incremental vacuum feature. # # Note: There are also some tests for incremental vacuum and IO # errors in incrvacuum_ioerr.test. # -# $Id: incrvacuum.test,v 1.22 2009/01/30 05:47:15 shane Exp $ +# $Id: incrvacuum.test,v 1.20 2008/09/10 10:57:28 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # If this build of the library does not support auto-vacuum, omit this @@ -730,50 +730,8 @@ catchsql { PRAGMA incremental_vacuum(10); } db3 } {1 {file is encrypted or is not a database}} -do_test incrvacuum-15.1 { - db close - db2 close - file delete -force test.db - sqlite3 db test.db - - set str [string repeat "abcdefghij" 500] - - execsql { - PRAGMA cache_size = 10; - PRAGMA auto_vacuum = incremental; - CREATE TABLE t1(x, y); - INSERT INTO t1 VALUES('a', $str); - INSERT INTO t1 VALUES('b', $str); - INSERT INTO t1 VALUES('c', $str); - INSERT INTO t1 VALUES('d', $str); - INSERT INTO t1 VALUES('e', $str); - INSERT INTO t1 VALUES('f', $str); - INSERT INTO t1 VALUES('g', $str); - INSERT INTO t1 VALUES('h', $str); - INSERT INTO t1 VALUES('i', $str); - INSERT INTO t1 VALUES('j', $str); - INSERT INTO t1 VALUES('j', $str); - - CREATE TABLE t2(x PRIMARY KEY, y); - INSERT INTO t2 VALUES('a', $str); - INSERT INTO t2 VALUES('b', $str); - INSERT INTO t2 VALUES('c', $str); - INSERT INTO t2 VALUES('d', $str); - - BEGIN; - DELETE FROM t2; - PRAGMA incremental_vacuum; - } - - catchsql {INSERT INTO t2 SELECT * FROM t1} - - execsql { - COMMIT; - PRAGMA integrity_check; - } -} {ok} - +db2 close db3 close finish_test Index: test/indexedby.test ================================================================== --- test/indexedby.test +++ test/indexedby.test @@ -7,11 +7,11 @@ # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # -# $Id: indexedby.test,v 1.4 2008/12/30 09:45:46 danielk1977 Exp $ +# $Id: indexedby.test,v 1.3 2008/10/06 16:18:40 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Create a schema with some indexes. @@ -202,28 +202,7 @@ } {0 0 {TABLE t1 WITH INDEX i2}} do_test indexedby-8.6 { catchsql { UPDATE t1 INDEXED BY i2 SET rowid=rowid+1 WHERE a = 5} } {1 {cannot use index: i2}} -# Test that bug #3560 is fixed. -# -do_test indexedby-9.1 { - execsql { - CREATE TABLE maintable( id integer); - CREATE TABLE joinme(id_int integer, id_text text); - CREATE INDEX joinme_id_text_idx on joinme(id_text); - CREATE INDEX joinme_id_int_idx on joinme(id_int); - } -} {} -do_test indexedby-9.2 { - catchsql { - select * from maintable as m inner join - joinme as j indexed by joinme_id_text_idx - on ( m.id = j.id_int) - } -} {1 {cannot use index: joinme_id_text_idx}} -do_test indexedby-9.3 { - catchsql { select * from maintable, joinme INDEXED by joinme_id_text_idx } -} {1 {cannot use index: joinme_id_text_idx}} - finish_test Index: test/insert3.test ================================================================== --- test/insert3.test +++ test/insert3.test @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing corner cases of the INSERT statement. # -# $Id: insert3.test,v 1.8 2008/12/23 10:37:47 danielk1977 Exp $ +# $Id: insert3.test,v 1.7 2007/09/12 17:01:45 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # All the tests in this file require trigger support @@ -166,38 +166,6 @@ } } {{} 4.3 hi} } db close -file delete -force test.db -sqlite3 db test.db - -#------------------------------------------------------------------------- -# While developing tests for a different feature (savepoint) the following -# sequence was found to cause an assert() in btree.c to fail. These -# tests are included to ensure that that bug is fixed. -# -do_test insert3-4.1 { - execsql { - CREATE TABLE t1(a, b, c); - CREATE INDEX i1 ON t1(a, b); - BEGIN; - INSERT INTO t1 VALUES(randstr(10,400),randstr(10,400),randstr(10,400)); - } - set r "randstr(10,400)" - for {set ii 0} {$ii < 10} {incr ii} { - execsql "INSERT INTO t1 SELECT $r, $r, $r FROM t1" - } - execsql { COMMIT } -} {} -do_test insert3-4.2 { - execsql { - PRAGMA cache_size = 10; - BEGIN; - UPDATE t1 SET a = randstr(10,10) WHERE (rowid%4)==0; - DELETE FROM t1 WHERE rowid%2; - INSERT INTO t1 SELECT randstr(10,400), randstr(10,400), c FROM t1; - COMMIT; - } -} {} - finish_test Index: test/io.test ================================================================== --- test/io.test +++ test/io.test @@ -11,11 +11,11 @@ # # The focus of this file is testing some specific characteristics of the # IO traffic generated by SQLite (making sure SQLite is not writing out # more database pages than it has to, stuff like that). # -# $Id: io.test,v 1.20 2009/01/11 00:42:02 drh Exp $ +# $Id: io.test,v 1.19 2008/09/18 11:18:41 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl db close @@ -223,10 +223,11 @@ catchsql { COMMIT } } {1 {cannot commit - no transaction is active}} do_test io-2.6.4 { execsql { SELECT * FROM abc } } {1 2 3 4 5 6 7 8} + # Test that if the database modification is part of multi-file commit, # the journal file is always created. In this case, the journal file # is created during execution of the COMMIT statement, so we have to # use the same technique to check that it is created as in the above @@ -286,12 +287,10 @@ # Test that the atomic write optimisation is not enabled if the sector # size is larger than the page-size. # do_test io-2.9.1 { - db close - sqlite3 db test.db sqlite3_simulate_device -char atomic -sectorsize 2048 execsql { BEGIN; INSERT INTO abc VALUES(9, 10); } Index: test/ioerr.test ================================================================== --- test/ioerr.test +++ test/ioerr.test @@ -13,11 +13,11 @@ # such as writes failing because the disk is full. # # The tests in this file use special facilities that are only # available in the SQLite test fixture. # -# $Id: ioerr.test,v 1.42 2008/11/26 07:40:30 danielk1977 Exp $ +# $Id: ioerr.test,v 1.41 2008/07/12 14:52:20 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # If SQLITE_DEFAULT_AUTOVACUUM is set to true, then a simulated IO error @@ -402,29 +402,6 @@ INSERT INTO t1 VALUES(randomblob(100)); INSERT INTO t1 VALUES(randomblob(100)); COMMIT; } -do_ioerr_test ioerr-15 -tclprep { - db eval { - BEGIN; - PRAGMA cache_size = 10; - CREATE TABLE t1(a); - CREATE INDEX i1 ON t1(a); - CREATE TABLE t2(a); - } - for {set ii 1} {$ii < 100} {incr ii} { - set v [string range [string repeat [format %.3d $ii] 200] 0 220] - db eval {INSERT INTO t1 VALUES($v)} - } - db eval { - DELETE FROM t1 WHERE oid > 85; - COMMIT; - } -} -sqlbody { - BEGIN; - INSERT INTO t2 VALUES(randstr(22000,22000)); - DELETE FROM t1 WHERE oid = 83; - COMMIT; -} - finish_test Index: test/join.test ================================================================== --- test/join.test +++ test/join.test @@ -10,11 +10,11 @@ #*********************************************************************** # This file implements regression tests for SQLite library. # # This file implements tests for joins, including outer joins. # -# $Id: join.test,v 1.26 2008/12/05 00:00:07 drh Exp $ +# $Id: join.test,v 1.25 2008/08/14 00:19:49 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl do_test join-1.1 { @@ -59,44 +59,10 @@ do_test join-1.3.4 { execsql { SELECT b FROM t1 NATURAL JOIN t2; } } {2 3} - -# ticket #3522 -do_test join-1.3.5 { - execsql2 { - SELECT t2.* FROM t2 NATURAL JOIN t1 - } -} {b 2 c 3 d 4 b 3 c 4 d 5} -do_test join-1.3.6 { - execsql2 { - SELECT xyzzy.* FROM t2 AS xyzzy NATURAL JOIN t1 - } -} {b 2 c 3 d 4 b 3 c 4 d 5} -do_test join-1.3.7 { - execsql2 { - SELECT t1.* FROM t2 NATURAL JOIN t1 - } -} {a 1 b 2 c 3 a 2 b 3 c 4} -do_test join-1.3.8 { - execsql2 { - SELECT xyzzy.* FROM t2 NATURAL JOIN t1 AS xyzzy - } -} {a 1 b 2 c 3 a 2 b 3 c 4} -do_test join-1.3.9 { - execsql2 { - SELECT aaa.*, bbb.* FROM t2 AS aaa NATURAL JOIN t1 AS bbb - } -} {b 2 c 3 d 4 a 1 b 2 c 3 b 3 c 4 d 5 a 2 b 3 c 4} -do_test join-1.3.10 { - execsql2 { - SELECT t1.*, t2.* FROM t2 NATURAL JOIN t1 - } -} {a 1 b 2 c 3 b 2 c 3 d 4 a 2 b 3 c 4 b 3 c 4 d 5} - - do_test join-1.4.1 { execsql2 { SELECT * FROM t1 INNER JOIN t2 USING(b,c); } } {a 1 b 2 c 3 d 4 a 2 b 3 c 4 d 5} @@ -118,23 +84,10 @@ do_test join-1.4.5 { execsql { SELECT b FROM t1 JOIN t2 USING(b); } } {2 3} - -# Ticket #3522 -do_test join-1.4.6 { - execsql2 { - SELECT t1.* FROM t1 JOIN t2 USING(b); - } -} {a 1 b 2 c 3 a 2 b 3 c 4} -do_test join-1.4.7 { - execsql2 { - SELECT t2.* FROM t1 JOIN t2 USING(b); - } -} {b 2 c 3 d 4 b 3 c 4 d 5} - do_test join-1.5 { execsql2 { SELECT * FROM t1 INNER JOIN t2 USING(b); } } {a 1 b 2 c 3 c 3 d 4 a 2 b 3 c 4 c 4 d 5} @@ -237,28 +190,10 @@ do_test join-2.1 { execsql { SELECT * FROM t1 NATURAL LEFT JOIN t2; } } {1 2 3 4 2 3 4 5 3 4 5 {}} - -# ticket #3522 -do_test join-2.1.1 { - execsql2 { - SELECT * FROM t1 NATURAL LEFT JOIN t2; - } -} {a 1 b 2 c 3 d 4 a 2 b 3 c 4 d 5 a 3 b 4 c 5 d {}} -do_test join-2.1.2 { - execsql2 { - SELECT t1.* FROM t1 NATURAL LEFT JOIN t2; - } -} {a 1 b 2 c 3 a 2 b 3 c 4 a 3 b 4 c 5} -do_test join-2.1.3 { - execsql2 { - SELECT t2.* FROM t1 NATURAL LEFT JOIN t2; - } -} {b 2 c 3 d 4 b 3 c 4 d 5 b {} c {} d {}} - do_test join-2.2 { execsql { SELECT * FROM t2 NATURAL LEFT OUTER JOIN t1; } } {1 2 3 {} 2 3 4 1 3 4 5 2} Index: test/jrnlmode.test ================================================================== --- test/jrnlmode.test +++ test/jrnlmode.test @@ -9,42 +9,30 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The focus # of these tests is the journal mode pragma. # -# $Id: jrnlmode.test,v 1.12 2009/01/11 05:54:40 danielk1977 Exp $ +# $Id: jrnlmode.test,v 1.6 2008/09/26 21:08:08 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl ifcapable {!pager_pragmas} { finish_test return } -if {[info exists TEMP_STORE] && $TEMP_STORE>=2} { - set temp_persist memory - set temp_delete memory - set temp_truncate memory - set temp_off memory -} else { - set temp_persist persist - set temp_delete delete - set temp_truncate truncate - set temp_off off -} - #---------------------------------------------------------------------- # Test cases jrnlmode-1.X test the PRAGMA logic. # do_test jrnlmode-1.0 { execsql { PRAGMA journal_mode; PRAGMA main.journal_mode; PRAGMA temp.journal_mode; } -} [list delete delete $temp_delete] +} [list delete delete delete] do_test jrnlmode-1.1 { execsql { PRAGMA journal_mode = persist; } } {persist} @@ -52,11 +40,11 @@ execsql { PRAGMA journal_mode; PRAGMA main.journal_mode; PRAGMA temp.journal_mode; } -} [list persist persist $temp_persist] +} [list persist persist persist] do_test jrnlmode-1.4 { execsql { PRAGMA journal_mode = off; } } {off} @@ -64,11 +52,11 @@ execsql { PRAGMA journal_mode; PRAGMA main.journal_mode; PRAGMA temp.journal_mode; } -} [list off off $temp_off] +} {off off off} do_test jrnlmode-1.6 { execsql { PRAGMA journal_mode = delete; } } {delete} @@ -76,11 +64,11 @@ execsql { PRAGMA journal_mode; PRAGMA main.journal_mode; PRAGMA temp.journal_mode; } -} [list delete delete $temp_delete] +} {delete delete delete} do_test jrnlmode-1.7.1 { execsql { PRAGMA journal_mode = truncate; } } {truncate} @@ -88,11 +76,11 @@ execsql { PRAGMA journal_mode; PRAGMA main.journal_mode; PRAGMA temp.journal_mode; } -} [list truncate truncate $temp_truncate] +} {truncate truncate truncate} do_test jrnlmode-1.8 { execsql { PRAGMA journal_mode = off; PRAGMA journal_mode = invalid; } @@ -105,21 +93,21 @@ } execsql { PRAGMA main.journal_mode; PRAGMA aux1.journal_mode; } - } {persist memory} + } {persist persist} do_test jrnlmode-1.10 { execsql { PRAGMA main.journal_mode = OFF; } execsql { PRAGMA main.journal_mode; PRAGMA temp.journal_mode; PRAGMA aux1.journal_mode; } - } [list off $temp_persist memory] + } {off persist persist} do_test jrnlmode-1.11 { execsql { PRAGMA journal_mode; } } {persist} @@ -130,34 +118,33 @@ execsql { PRAGMA main.journal_mode; PRAGMA aux1.journal_mode; PRAGMA aux2.journal_mode; } - } {off memory memory} - do_test jrnlmode-1.13 { - # The journal-mode used by in-memory databases cannot be changed. + } {off persist persist} + do_test jrnlmode-1.11 { execsql { PRAGMA aux1.journal_mode = DELETE; } execsql { PRAGMA main.journal_mode; PRAGMA aux1.journal_mode; PRAGMA aux2.journal_mode; } - } {off memory memory} - do_test jrnlmode-1.14 { + } {off delete persist} + do_test jrnlmode-1.12 { execsql { PRAGMA journal_mode = delete; } execsql { PRAGMA main.journal_mode; PRAGMA temp.journal_mode; PRAGMA aux1.journal_mode; PRAGMA aux2.journal_mode; } - } [list delete $temp_delete memory memory] - do_test jrnlmode-1.15 { + } {delete delete delete delete} + do_test jrnlmode-1.13 { execsql { ATTACH ':memory:' as aux3; } execsql { PRAGMA main.journal_mode; @@ -164,12 +151,12 @@ PRAGMA temp.journal_mode; PRAGMA aux1.journal_mode; PRAGMA aux2.journal_mode; PRAGMA aux3.journal_mode; } - } [list delete $temp_delete memory memory memory] - do_test jrnlmode-1.16 { + } {delete delete delete delete delete} + do_test jrnlmode-1.14 { execsql { PRAGMA journal_mode = TRUNCATE; } execsql { PRAGMA main.journal_mode; @@ -176,12 +163,12 @@ PRAGMA temp.journal_mode; PRAGMA aux1.journal_mode; PRAGMA aux2.journal_mode; PRAGMA aux3.journal_mode; } - } [list truncate $temp_truncate memory memory memory] - + } {truncate truncate truncate truncate truncate} + do_test jrnlmode-1.99 { execsql { DETACH aux1; DETACH aux2; DETACH aux3; @@ -417,71 +404,8 @@ do_test jrnlmode-5.19 { execsql COMMIT set sz [file size test.db-journal] expr {$sz>=$journalsize} } {1} - - # Test a size-limit of 0. - # - do_test jrnlmode-5.20 { - execsql { - PRAGMA journal_size_limit = 0; - BEGIN; - UPDATE t1 SET a = randomblob(1000); - } - } {0} - do_test jrnlmode-5.21 { - expr {[file size test.db-journal] > 1024} - } {1} - do_test jrnlmode-5.22 { - execsql COMMIT - list [file exists test.db-journal] [file size test.db-journal] - } {1 0} -} - -ifcapable pragma { - # These tests are not run as part of the "journaltest" permutation, - # as the test_journal.c layer is incompatible with in-memory journaling. - if {[catch {set ::permutations_test_prefix} z] || $z ne "journaltest"} { - - do_test jrnlmode-6.1 { - execsql { - PRAGMA journal_mode = truncate; - CREATE TABLE t4(a, b); - BEGIN; - INSERT INTO t4 VALUES(1, 2); - PRAGMA journal_mode = memory; - } - } {truncate memory} - do_test jrnlmode-6.2 { - file exists test.db-journal - } {1} - do_test jrnlmode-6.3 { - execsql { - COMMIT; - SELECT * FROM t4; - } - } {1 2} - do_test jrnlmode-6.4 { - file exists test.db-journal - } {0} - do_test jrnlmode-6.5 { - execsql { - BEGIN; - INSERT INTO t4 VALUES(3, 4); - } - file exists test.db-journal - } {0} - do_test jrnlmode-6.7 { - execsql { - COMMIT; - SELECT * FROM t4; - } - } {1 2 3 4} - do_test jrnlmode-6.8 { - file exists test.db-journal - } {0} - } } finish_test - Index: test/laststmtchanges.test ================================================================== --- test/laststmtchanges.test +++ test/laststmtchanges.test @@ -1,6 +1,5 @@ -# # 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. @@ -18,11 +17,10 @@ # last_insert_rowid() (see lastinsert.test), but is restored once # the trigger exits. # Note 3: changes() is not changed by a change to a view (since everything # is done within instead of trigger context). # -# $Id: laststmtchanges.test,v 1.7 2008/10/27 13:59:34 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # ---------------------------------------------------------------------------- @@ -278,54 +276,6 @@ } } {0 {0 1 0 3}} } ;# ifcapable view - -# ---------------------------------------------------------------------------- -# 6.x - Test "DELETE FROM " in the absence of triggers -# -do_test laststmtchanges-6.1 { - execsql { - CREATE TABLE t3(a, b, c); - INSERT INTO t3 VALUES(1, 2, 3); - INSERT INTO t3 VALUES(4, 5, 6); - } -} {} -do_test laststmtchanges-6.2 { - execsql { - BEGIN; - DELETE FROM t3; - SELECT changes(); - } -} {2} -do_test laststmtchanges-6.3 { - execsql { - ROLLBACK; - BEGIN; - DELETE FROM t3 WHERE a IS NOT NULL; - SELECT changes(); - } -} {2} -do_test laststmtchanges-6.4 { - execsql { - ROLLBACK; - CREATE INDEX t3_i1 ON t3(a); - BEGIN; - DELETE FROM t3; - SELECT changes(); - } -} {2} -do_test laststmtchanges-6.5 { - execsql { ROLLBACK } - set nTotalChange [execsql {SELECT total_changes()}] - expr 0 -} {0} -do_test laststmtchanges-6.6 { - execsql { - SELECT total_changes(); - DELETE FROM t3; - SELECT total_changes(); - } -} [list $nTotalChange [expr $nTotalChange+2]] - finish_test Index: test/like.test ================================================================== --- test/like.test +++ test/like.test @@ -11,11 +11,11 @@ # This file implements regression tests for SQLite library. The # focus of this file is testing the LIKE and GLOB operators and # in particular the optimizations that occur to help those operators # run faster. # -# $Id: like.test,v 1.12 2009/01/09 21:41:17 drh Exp $ +# $Id: like.test,v 1.10 2008/09/09 12:31:34 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Create some sample data to work with. @@ -67,21 +67,15 @@ do_test like-1.4 { execsql { SELECT x FROM t1 WHERE x LIKE 'aBc' ORDER BY 1; } } {ABC abc} -do_test like-1.5.1 { +do_test like-1.5 { execsql { PRAGMA case_sensitive_like=on; SELECT x FROM t1 WHERE x LIKE 'abc' ORDER BY 1; } -} {abc} -do_test like-1.5.2 { - execsql { - PRAGMA case_sensitive_like; -- no argument; does not change setting - SELECT x FROM t1 WHERE x LIKE 'abc' ORDER BY 1; - } } {abc} do_test like-1.6 { execsql { SELECT x FROM t1 WHERE x GLOB 'abc' ORDER BY 1; } @@ -99,16 +93,10 @@ do_test like-1.9 { execsql { PRAGMA case_sensitive_like=off; SELECT x FROM t1 WHERE x LIKE 'abc' ORDER BY 1; } -} {ABC abc} -do_test like-1.10 { - execsql { - PRAGMA case_sensitive_like; -- No argument, does not change setting. - SELECT x FROM t1 WHERE x LIKE 'abc' ORDER BY 1; - } } {ABC abc} # Tests of the REGEXP operator # do_test like-2.1 { @@ -560,75 +548,7 @@ SELECT 1, x FROM t8 WHERE x LIKE '%h%'; SELECT 2, x FROM t8 WHERE x LIKE '%h%' ESCAPE 'x'; } } {1 abcdef 1 ghijkl 1 mnopqr 2 abcdef 2 ghijkl 2 mnopqr} - -ifcapable like_opt { - # Evaluate SQL. Return the result set followed by the - # and the number of full-scan steps. - # - db close - sqlite3 db test.db - proc count_steps {sql} { - set r [db eval $sql] - lappend r scan [db status step] sort [db status sort] - } - do_test like-9.1 { - count_steps { - SELECT x FROM t2 WHERE x LIKE 'x%' - } - } {xyz scan 0 sort 0} - do_test like-9.2 { - count_steps { - SELECT x FROM t2 WHERE x LIKE '_y%' - } - } {xyz scan 19 sort 0} - do_test like-9.3.1 { - set res [sqlite3_exec_hex db { - SELECT x FROM t2 WHERE x LIKE '%78%25' - }] - } {0 {x xyz}} - ifcapable explain { - do_test like-9.3.2 { - set res [sqlite3_exec_hex db { - EXPLAIN QUERY PLAN SELECT x FROM t2 WHERE x LIKE '%78%25' - }] - regexp {INDEX i2} $res - } {1} - } - do_test like-9.4.1 { - sqlite3_exec_hex db {INSERT INTO t2 VALUES('%ffhello')} - set res [sqlite3_exec_hex db { - SELECT substr(x,2) AS x FROM t2 WHERE +x LIKE '%ff%25' - }] - } {0 {x hello}} - do_test like-9.4.2 { - set res [sqlite3_exec_hex db { - SELECT substr(x,2) AS x FROM t2 WHERE x LIKE '%ff%25' - }] - } {0 {x hello}} - ifcapable explain { - do_test like-9.4.3 { - set res [sqlite3_exec_hex db { - EXPLAIN QUERY PLAN SELECT x FROM t2 WHERE x LIKE '%ff%25' - }] - regexp {INDEX i2} $res - } {0} - } - do_test like-9.5.1 { - set res [sqlite3_exec_hex db { - SELECT x FROM t2 WHERE x LIKE '%fe%25' - }] - } {0 {}} - ifcapable explain { - do_test like-9.5.2 { - set res [sqlite3_exec_hex db { - EXPLAIN QUERY PLAN SELECT x FROM t2 WHERE x LIKE '%fe%25' - }] - regexp {INDEX i2} $res - } {1} - } -} - finish_test Index: test/lock.test ================================================================== --- test/lock.test +++ test/lock.test @@ -9,23 +9,20 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script is database locks. # -# $Id: lock.test,v 1.36 2009/01/17 16:59:41 danielk1977 Exp $ +# $Id: lock.test,v 1.33 2006/08/16 16:42:48 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Create an alternative connection to the database # do_test lock-1.0 { - # Give a complex pathnme to stress the path simplification logic in - # the vxworks driver. - file mkdir tempdir/t1/t2 - sqlite3 db2 ./tempdir/../tempdir/t1/.//t2/../../..//test.db + sqlite3 db2 ./test.db set dummy {} } {} do_test lock-1.1 { execsql {SELECT name FROM sqlite_master WHERE type='table' ORDER BY name} } {} @@ -348,77 +345,10 @@ SELECT * FROM t3; } } {9} } -do_test lock-6.1 { - execsql { - CREATE TABLE t4(a PRIMARY KEY, b); - INSERT INTO t4 VALUES(1, 'one'); - INSERT INTO t4 VALUES(2, 'two'); - INSERT INTO t4 VALUES(3, 'three'); - } - - set STMT [sqlite3_prepare $DB "SELECT * FROM sqlite_master" -1 TAIL] - sqlite3_step $STMT - - execsql { DELETE FROM t4 } - execsql { SELECT * FROM sqlite_master } db2 - execsql { SELECT * FROM t4 } db2 -} {} - -do_test lock-6.2 { - execsql { - BEGIN; - INSERT INTO t4 VALUES(1, 'one'); - INSERT INTO t4 VALUES(2, 'two'); - INSERT INTO t4 VALUES(3, 'three'); - COMMIT; - } - - execsql { SELECT * FROM t4 } db2 -} {1 one 2 two 3 three} - -do_test lock-6.3 { - execsql { SELECT a FROM t4 ORDER BY a } db2 -} {1 2 3} - -do_test lock-6.4 { - execsql { PRAGMA integrity_check } db2 -} {ok} - -do_test lock-6.5 { - sqlite3_finalize $STMT -} {SQLITE_OK} - -# At one point the following set of conditions would cause SQLite to -# retain a RESERVED or EXCLUSIVE lock after the transaction was committed: -# -# * The journal-mode is set to something other than 'delete', and -# * there exists one or more active read-only statements, and -# * a transaction that modified zero database pages is committed. -# -do_test lock-7.1 { - set STMT [sqlite3_prepare $DB "SELECT * FROM sqlite_master" -1 TAIL] - sqlite3_step $STMT -} {SQLITE_ROW} -do_test lock-7.2 { - execsql { PRAGMA lock_status } -} {main shared temp unlocked} -do_test lock-7.3 { - execsql { - PRAGMA journal_mode = truncate; - BEGIN; - UPDATE t4 SET a = 10 WHERE 0; - COMMIT; - } - execsql { PRAGMA lock_status } -} {main shared temp unlocked} -do_test lock-7.4 { - sqlite3_finalize $STMT -} {SQLITE_OK} - do_test lock-999.1 { rename db2 {} } {} finish_test Index: test/lock2.test ================================================================== --- test/lock2.test +++ test/lock2.test @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script is database locks between competing processes. # -# $Id: lock2.test,v 1.10 2009/02/05 16:31:46 drh Exp $ +# $Id: lock2.test,v 1.9 2007/12/13 21:54:11 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -90,11 +90,11 @@ # this fails due to the PENDING lock. # lock2-1.8: Ensure the first process can now upgrade to EXCLUSIVE. # do_test lock2-1.1 { set ::tf1 [launch_testfixture] - testfixture $::tf1 "sqlite3_test_control_pending_byte $::sqlite_pending_byte" + testfixture $::tf1 "set sqlite_pending_byte $::sqlite_pending_byte" testfixture $::tf1 { sqlite3 db test.db -key xyzzy db eval {select * from sqlite_master} } } {} Index: test/lock3.test ================================================================== --- test/lock3.test +++ test/lock3.test @@ -11,22 +11,21 @@ # This file implements regression tests for SQLite library. The # focus of this script is database locks and the operation of the # DEFERRED, IMMEDIATE, and EXCLUSIVE keywords as modifiers to the # BEGIN command. # -# $Id: lock3.test,v 1.2 2008/11/21 22:21:51 drh Exp $ +# $Id: lock3.test,v 1.1 2004/10/05 02:41:43 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Establish two connections to the same database. Put some # sample data into the database. # do_test lock3-1.1 { - file mkdir tempdir/t1/t2/t3 - sqlite3 db2 ./tempdir/t1//t2/./t3//./../..//./../../tempdir/..//test.db// + sqlite3 db2 test.db execsql { CREATE TABLE t1(a); INSERT INTO t1 VALUES(1); } execsql { Index: test/lock4.test ================================================================== --- test/lock4.test +++ test/lock4.test @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script is database locks. # -# $Id: lock4.test,v 1.9 2009/02/05 16:31:46 drh Exp $ +# $Id: lock4.test,v 1.8 2008/03/14 08:57:42 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -51,11 +51,11 @@ do_test lock4-1.2 { # Create a script for the second process to run. # set out [open test2-script.tcl w] - puts $out "sqlite3_test_control_pending_byte [set sqlite_pending_byte]" + puts $out "set sqlite_pending_byte [set sqlite_pending_byte]" puts $out { sqlite3 db2 test2.db db2 eval { BEGIN; INSERT INTO t2 VALUES(2); Index: test/lock5.test ================================================================== --- test/lock5.test +++ test/lock5.test @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script is database locks. # -# $Id: lock5.test,v 1.6 2008/12/04 12:34:16 drh Exp $ +# $Id: lock5.test,v 1.3 2008/09/24 09:12:47 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # This file is only run if using the unix backend compiled with the @@ -22,21 +22,10 @@ if {[catch {sqlite3 db test.db -vfs unix-none} msg]} { finish_test return } db close -file delete -force test.db.lock - -ifcapable lock_proxy_pragmas { - set ::using_proxy 0 - foreach {name value} [array get env SQLITE_FORCE_PROXY_LOCKING] { - set ::using_proxy $value - } - # Disable the proxy locking for these tests - set env(SQLITE_FORCE_PROXY_LOCKING) "0" -} - do_test lock5-dotfile.1 { sqlite3 db test.db -vfs unix-dotfile execsql { BEGIN; @@ -99,14 +88,10 @@ } {0} ##################################################################### file delete -force test.db -if {[catch {sqlite3 db test.db -vfs unix-flock} msg]} { - finish_test - return -} do_test lock5-flock.1 { sqlite3 db test.db -vfs unix-flock execsql { CREATE TABLE t1(a, b); @@ -186,10 +171,6 @@ do_test lock5-flock.X { db close db2 close } {} -ifcapable lock_proxy_pragmas { - set env(SQLITE_FORCE_PROXY_LOCKING) $::using_proxy -} - finish_test DELETED test/lock6.test Index: test/lock6.test ================================================================== --- test/lock6.test +++ /dev/null @@ -1,168 +0,0 @@ -# 2008 October 6 -# -# The author disclaims copyright to this source code. In place of -# a legal notice, here is a blessing: -# -# May you do good and not evil. -# May you find forgiveness for yourself and forgive others. -# May you share freely, never taking more than you give. -# -#*********************************************************************** -# This file implements regression tests for SQLite library. The -# focus of this script is database locks. -# -# $Id: lock6.test,v 1.3 2009/02/05 16:31:46 drh Exp $ - - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -# Launch another testfixture process to be controlled by this one. A -# channel name is returned that may be passed as the first argument to proc -# 'testfixture' to execute a command. The child testfixture process is shut -# down by closing the channel. -proc launch_testfixture {} { - set prg [info nameofexec] - if {$prg eq ""} { - set prg [file join . testfixture] - } - set chan [open "|$prg tf_main2.tcl" r+] - fconfigure $chan -buffering line - return $chan -} - -# Execute a command in a child testfixture process, connected by two-way -# channel $chan. Return the result of the command, or an error message. -proc testfixture {chan cmd} { - puts $chan $cmd - puts $chan OVER - set r "" - while { 1 } { - set line [gets $chan] - if { $line == "OVER" } { - return $r - } - append r $line - } -} - -# Write the main loop for the child testfixture processes into file -# tf_main2.tcl. The parent (this script) interacts with the child processes -# via a two way pipe. The parent writes a script to the stdin of the child -# process, followed by the word "OVER" on a line of its own. The child -# process evaluates the script and writes the results to stdout, followed -# by an "OVER" of its own. -set f [open tf_main2.tcl w] -puts $f { - set l [open log w] - set script "" - while {![eof stdin]} { - flush stdout - set line [gets stdin] - puts $l "READ $line" - if { $line == "OVER" } { - catch {eval $script} result - puts $result - puts $l "WRITE $result" - puts OVER - puts $l "WRITE OVER" - flush stdout - set script "" - } else { - append script $line - append script " ; " - } - } - close $l -} -close $f - - -ifcapable lock_proxy_pragmas&&prefer_proxy_locking { - set sqlite_hostid_num 1 - - set using_proxy 0 - foreach {name value} [array get env SQLITE_FORCE_PROXY_LOCKING] { - set using_proxy $value - } - - # Test the lock_proxy_file pragmas. - # - set env(SQLITE_FORCE_PROXY_LOCKING) "1" - - do_test lock6-1.1 { - set ::tf1 [launch_testfixture] - testfixture $::tf1 "sqlite3_test_control_pending_byte $::sqlite_pending_byte" - testfixture $::tf1 { - set sqlite_hostid_num 2 - sqlite3 db test.db -key xyzzy - set lockpath [db eval { - PRAGMA lock_proxy_file=":auto:"; - select * from sqlite_master; - PRAGMA lock_proxy_file; - }] - string match "*test.db:auto:" $lockpath - } - } {1} - - set sqlite_hostid_num 3 - do_test lock6-1.2 { - execsql {pragma lock_status} - } {main unlocked temp closed} - - sqlite3_soft_heap_limit 0 - do_test lock6-1.3 { - sqlite3 db test.db - catchsql { - select * from sqlite_master; - } - } {1 {database is locked}} - - do_test lock6-1.4 { - set lockpath [execsql { - PRAGMA lock_proxy_file=":auto:"; - PRAGMA lock_proxy_file; - } db] - set lockpath - } {{:auto: (not held)}} - - do_test lock6-1.4.1 { - catchsql { - PRAGMA lock_proxy_file="notmine"; - select * from sqlite_master; - } db - } {1 {database is locked}} - - do_test lock6-1.4.2 { - execsql { - PRAGMA lock_proxy_file; - } db - } {notmine} - - do_test lock6-1.5 { - testfixture $::tf1 { - db eval { - BEGIN; - SELECT * FROM sqlite_master; - } - } - } {} - - catch {testfixture $::tf1 {db close}} - - do_test lock6-1.6 { - execsql { - PRAGMA lock_proxy_file="mine"; - select * from sqlite_master; - } db - } {} - - catch {close $::tf1} - set env(SQLITE_FORCE_PROXY_LOCKING) $using_proxy - set sqlite_hostid_num 0 - - sqlite3_soft_heap_limit $soft_limit - -} - -finish_test DELETED test/make-where7.tcl Index: test/make-where7.tcl ================================================================== --- test/make-where7.tcl +++ /dev/null @@ -1,122 +0,0 @@ -#!/usr/bin/tclsh -# -# Run this script to generate randomized test cases for the where7.test -# script. The output will need to be manually copied and pasted into -# the where7.test script. -# -puts "do_test where7-2.1 \173" -puts " db eval \173" -puts " CREATE TABLE t2(a INTEGER PRIMARY KEY,b,c,d,e,f,g);" -set NA 100 -for {set a 1} {$a<=$NA} {incr a} { - set b [expr {$a*11}] - set div3 [expr {int(($a+2)/3)}] - set c [expr {$div3*1001}] - set d [expr {$a*1.001}] - set e [expr {$div3*100.1}] - set x [expr {$a%26}] - set f [string range {abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz} \ - $x [expr {$x+8}]] - set div5 [expr {int(($a+7)/5)}] - set x [expr {$div5%26}] - set g [string range {zyxwvutsrqponmlkjihgfedcbazyxwvutsrqponmlkjihgfedcba} \ - $x [expr {$x+6}]] - puts " INSERT INTO t2 VALUES($a,$b,$c,$d,$e,'$f','$g');" - lappend fidx($f) $a - lappend gidx($g) $a - set gof($a) $g - set fof($a) $f - - set expr "a=$a" - set term($expr) $a - set expr "((a BETWEEN [expr {$a-1}] AND [expr {$a+1}]) AND a!=$a)" - set x {} - if {$a>1} {set x [expr {$a-1}]} - if {$a<$NA} {lappend x [expr {$a+1}]} - set term($expr) $x - set expr "b=$b" - set term($expr) $a - set expr "b=[expr {$a*11+3}]" - set term($expr) {} - set expr "c=$c" - lappend term($expr) $a - set expr "(d>=$a.0 AND d<[expr {$a+1.0}] AND d NOT NULL)" - lappend term($expr) $a - set expr "f='$f'" - lappend term($expr) $a - set expr \ - "(f GLOB '?[string range $f 1 4]*' AND f GLOB '[string range $f 0 3]*')" - lappend term($expr) $a - set expr "(g='$g' AND f GLOB '[string range $f 0 4]*')" - lappend term($expr) $a -} -puts " CREATE INDEX t2b ON t2(b);" -puts " CREATE INDEX t2c ON t2(c);" -puts " CREATE INDEX t2d ON t2(d);" -puts " CREATE INDEX t2e ON t2(e);" -puts " CREATE INDEX t2f ON t2(f);" -puts " CREATE INDEX t2g ON t2(g);" -puts " CREATE TABLE t3(a INTEGER PRIMARY KEY,b,c,d,e,f,g);" -puts " INSERT INTO t3 SELECT * FROM t2;" -puts " CREATE INDEX t3b ON t3(b,c);" -puts " CREATE INDEX t3c ON t3(c,e);" -puts " CREATE INDEX t3d ON t3(d,g);" -puts " CREATE INDEX t3e ON t3(e,f,g);" -puts " CREATE INDEX t3f ON t3(f,b,d,c);" -puts " CREATE INDEX t3g ON t3(g,f);" - -puts " \175" -puts "\175 {}" - -set term(b<0) {} -set term(1000000=[expr {int(($NA+2)/3)*1001+1}]) {} -set term(d<0.0) {} -set term(d>1e10) {} -set expr {e IS NULL} -set term($expr) {} -set expr {f IS NULL} -set term($expr) {} -set expr {g IS NULL} -set term($expr) {} - -set NT 1000 -set termlist [array names term] -set nterm [llength $termlist] -for {set i 2} {$i<=$NT+1} {incr i} { - set n [expr {int(rand()*10)+2}] - set w {} - unset -nocomplain r - for {set j 0} {$j<$n} {incr j} { - set k [expr {int(rand()*$nterm)}] - set t [lindex $termlist $k] - lappend w $t - foreach a $term($t) { - set r($a) 1 - } - } - if {[info exists seen($w)]} { - incr i -1 - continue - } - set seen($w) 1 - set result [lsort -int [array names r]] - puts "do_test where7-2.$i.1 \173" - puts " count_steps \173" - puts " SELECT a FROM t2" - set wc [join $w "\n OR "] - puts " WHERE $wc" - puts " ORDER BY a" - puts " \175" - puts "\175 {$result scan 0 sort 0}" - puts "do_test where7-2.$i.2 \173" - puts " count_steps \173" - puts " SELECT a FROM t3" - set wc [join $w "\n OR "] - puts " WHERE $wc" - puts " ORDER BY a" - puts " \175" - puts "\175 {$result scan 0 sort 0}" -} -puts "finish_test" Index: test/malloc.test ================================================================== --- test/malloc.test +++ test/malloc.test @@ -14,11 +14,11 @@ # the SQLite library accepts a special command (sqlite3_memdebug_fail N C) # which causes the N-th malloc to fail. This special feature is used # to see what happens in the library if a malloc were to really fail # due to an out-of-memory situation. # -# $Id: malloc.test,v 1.75 2009/02/04 08:17:57 danielk1977 Exp $ +# $Id: malloc.test,v 1.68 2008/10/06 05:32:19 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -669,133 +669,13 @@ } -sqlbody { SELECT * FROM t1 INDEXED BY i1 ORDER BY a; SELECT * FROM v1; } -do_malloc_test 29 -sqlprep { - CREATE TABLE t1(a TEXT, b TEXT); -} -sqlbody { - INSERT INTO t1 VALUES(1, -234); - INSERT INTO t1 SELECT * FROM t1 UNION ALL SELECT * FROM t1; -} - -do_malloc_test 30 -tclprep { - db eval { - CREATE TABLE t1(x PRIMARY KEY); - INSERT INTO t1 VALUES(randstr(500,500)); - INSERT INTO t1 VALUES(randstr(500,500)); - INSERT INTO t1 VALUES(randstr(500,500)); - } - db close - sqlite3 db test.db - - # The DELETE command in the following block moves the overflow pages that - # are part of the primary key index to the free-list. But it does not - # actually load the content of the pages. This leads to the peculiar - # situation where cache entries exist, but are not populated with data. - # They are populated next time they are requested by the b-tree layer. - # - db eval { - BEGIN; - DELETE FROM t1; - ROLLBACK; - } -} -sqlbody { - -- This statement requires the 'no-content' pages loaded by the DELETE - -- statement above. When requesting the pages, the content is loaded - -- from the database file. The point of this test case is to test handling - -- of malloc errors (including SQLITE_IOERR_NOMEM errors) when loading - -- the content. - SELECT * FROM t1 ORDER BY x; -} - -# After committing a transaction in persistent-journal mode, if a journal -# size limit is configured SQLite may attempt to truncate the journal file. -# This test verifies the libraries response to a malloc() failure during -# this operation. -# -do_malloc_test 31 -sqlprep { - PRAGMA journal_mode = persist; - PRAGMA journal_size_limit = 1024; - CREATE TABLE t1(a PRIMARY KEY, b); -} -sqlbody { - INSERT INTO t1 VALUES(1, 2); -} - -# When written, this test provoked an obscure change-counter bug. -# -# If, when running in exclusive mode, a malloc() failure occurs -# after the database file change-counter has been written but -# before the transaction has been committed, then the transaction -# is automatically rolled back. However, internally the -# Pager.changeCounterDone flag was being left set. This means -# that if the same connection attempts another transaction following -# the malloc failure and rollback, the change counter will not -# be updated. This could corrupt another processes cache. -# -do_malloc_test 32 -tclprep { - # Build a small database containing an indexed table. - # - db eval { - PRAGMA locking_mode = normal; - BEGIN; - CREATE TABLE t1(a PRIMARY KEY, b); - INSERT INTO t1 VALUES(1, 'one'); - INSERT INTO t1 VALUES(2, 'two'); - INSERT INTO t1 VALUES(3, 'three'); - COMMIT; - PRAGMA locking_mode = exclusive; - } - - # Open a second database connection. Load the table (but not index) - # into the second connections pager cache. - # - sqlite3 db2 test.db - db2 eval { - PRAGMA locking_mode = normal; - SELECT b FROM t1; - } - -} -tclbody { - # Running in exclusive mode, perform a database transaction that - # modifies both the database table and index. For iterations where - # the malloc failure occurs after updating the change counter but - # before committing the transaction, this should result in the - # transaction being rolled back but the changeCounterDone flag - # left set. - # - db eval { UPDATE t1 SET a = a + 3 } -} -cleanup { - - # Perform another transaction using the first connection. Unlock - # the database after doing so. If this is one of the right iterations, - # then this should result in the database contents being updated but - # the change-counter left as it is. - # - db eval { - PRAGMA locking_mode = normal; - UPDATE t1 SET a = a + 3; - } - - # Now do an integrity check with the second connection. The second - # connection still has the database table in its cache. If this is - # one of the magic iterations and the change counter was not modified, - # then it won't realize that the cached data is out of date. Since - # the cached data won't match the up to date index data read from - # the database file, the integrity check should fail. - # - set zRepeat "transient" - if {$::iRepeat} {set zRepeat "persistent"} - do_test malloc-32.$zRepeat.${::n}.integrity { - execsql {PRAGMA integrity_check} db2 - } {ok} - db2 close -} - # Ensure that no file descriptors were leaked. do_test malloc-99.X { catch {db close} set sqlite_open_file_count } {0} puts open-file-count=$sqlite_open_file_count finish_test Index: test/malloc5.test ================================================================== --- test/malloc5.test +++ test/malloc5.test @@ -16,11 +16,11 @@ # the configured soft heap limit could cause sqlite to upgrade database # locks and flush dirty pages to the file system. As of 3.6.2, this is # no longer the case. In version 3.6.2, sqlite3_release_memory() only # reclaims clean pages. This test file has been updated accordingly. # -# $Id: malloc5.test,v 1.21 2008/12/30 17:55:00 drh Exp $ +# $Id: malloc5.test,v 1.20 2008/08/27 16:38:57 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl source $testdir/malloc_common.tcl db close @@ -312,10 +312,11 @@ do_test malloc5-6.1.2 { list [execsql {PRAGMA cache_size}] [execsql {PRAGMA cache_size} db2] } {10 10} do_test malloc5-6.2.1 { +breakpoint execsql {SELECT * FROM abc} db2 execsql {SELECT * FROM abc} db expr [nPage db] + [nPage db2] } {20} Index: test/mallocJ.test ================================================================== --- test/mallocJ.test +++ test/mallocJ.test @@ -10,19 +10,19 @@ #*********************************************************************** # # This test script checks malloc failures in LIMIT operations for # UPDATE/DELETE statements. # -# $Id: mallocJ.test,v 1.6 2009/01/09 02:49:32 drh Exp $ +# $Id: mallocJ.test,v 1.1 2008/10/10 13:34:30 shane Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl source $testdir/malloc_common.tcl ifcapable {update_delete_limit} { - do_malloc_test mallocJ-1 -sqlprep { + do_malloc_test mallocJ-4 -sqlprep { DROP TABLE IF EXISTS t1; CREATE TABLE t1(x int, y int); INSERT INTO t1 VALUES(1,1); INSERT INTO t1 VALUES(1,2); INSERT INTO t1 VALUES(1,2); @@ -36,38 +36,6 @@ DELETE FROM t1 ORDER BY y LIMIT 2 OFFSET 2; } } -# ticket #3467 -do_malloc_test mallocJ-2 -sqlprep { - CREATE TABLE t1(a,b); - INSERT INTO t1 VALUES(1,2); - PRAGMA vdbe_trace=ON; -} -sqlbody { - SELECT a, b, 'abc' FROM t1 - UNION - SELECT b, a, 'xyz' FROM t1 - ORDER BY 2, 3; -} - -# ticket #3478 -do_malloc_test mallocJ-3 -sqlbody { - EXPLAIN COMMIT -} - -# ticket #3485 -do_malloc_test mallocJ-4 -sqlprep { - CREATE TABLE t1(a,b,c); - CREATE TABLE t2(x,y,z); -} -sqlbody { - SELECT * FROM (SELECT a,b FROM t1 UNION ALL SELECT x, y FROM t2) ORDER BY 1 -} - -# coverage testing -do_malloc_test mallocJ-5 -sqlprep { - CREATE TABLE t1(["a"]); -} -sqlbody { - SELECT * FROM t1 -} - finish_test DELETED test/mallocK.test Index: test/mallocK.test ================================================================== --- test/mallocK.test +++ /dev/null @@ -1,72 +0,0 @@ -# 2008 August 01 -# -# 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 test script checks malloc failures in WHERE clause analysis. -# -# $Id: mallocK.test,v 1.3 2009/01/08 21:00:03 drh Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl -source $testdir/malloc_common.tcl - -set sql {SELECT * FROM t1, t2 WHERE (a=1 OR a=2)} -for {set x 1} {$x<5} {incr x} { - append sql " AND b=y" - do_malloc_test mallocK-1.$x -sqlbody $sql -sqlprep { - CREATE TABLE t1(a,b); - CREATE TABLE t2(x,y); - } -} - -set sql {SELECT * FROM t1 WHERE a GLOB 'xyz*' AND (a=1 OR a=2)} -for {set x 1} {$x<5} {incr x} { - append sql " AND b!=$x" - do_malloc_test mallocK-2.$x -sqlbody $sql -sqlprep { - CREATE TABLE t1(a,b); - } -} - -set sql {SELECT * FROM t1 WHERE a BETWEEN 5 AND 10} -for {set x 1} {$x<5} {incr x} { - append sql " AND b=$x" - do_malloc_test mallocK-3.$x -sqlbody $sql -sqlprep { - CREATE TABLE t1(a,b); - } -} - -set sql {SELECT * FROM t1 WHERE b=0} -for {set x 1} {$x<5} {incr x} { - set term "(b=$x" - for {set y 0} {$y<$x} {incr y} { - append term " AND a!=$y" - } - append sql " OR $term)" - do_malloc_test mallocK-4.$x -sqlbody $sql -sqlprep { - CREATE TABLE t1(a,b); - } -} - -ifcapable vtab { - set sql {SELECT * FROM t2 WHERE a MATCH 'xyz'} - for {set x 1} {$x<5} {incr x} { - append sql " AND b!=$x" - do_malloc_test mallocK-5.$x -sqlbody $sql -tclprep { - register_echo_module [sqlite3_connection_pointer db] - db eval { - CREATE TABLE t1(a,b); - CREATE VIRTUAL TABLE t2 USING echo(t1); - } - } - } -} - - -finish_test Index: test/manydb.test ================================================================== --- test/manydb.test +++ test/manydb.test @@ -11,27 +11,16 @@ # This file implements regression tests for SQLite library. # # This file implements tests the ability of the library to open # many different databases at the same time without leaking memory. # -# $Id: manydb.test,v 1.4 2008/11/21 00:10:35 aswift Exp $ +# $Id: manydb.test,v 1.3 2006/01/11 01:08:34 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl set N 300 -# if we're using proxy locks, we use 5 filedescriptors for a db -# that is open and in the middle of writing changes, normally -# sqlite uses 3 (proxy locking adds the conch and the local lock) -set using_proxy 0 -foreach {name value} [array get env SQLITE_FORCE_PROXY_LOCKING] { - set using_proxy value -} -set num_fd_per_openwrite_db 3 -if {$using_proxy>0} { - set num_fd_per_openwrite_db 5 -} # First test how many file descriptors are available for use. To open a # database for writing SQLite requires 3 file descriptors (the database, the # journal and the directory). set filehandles {} @@ -44,11 +33,11 @@ close $fd } catch { file delete -force testfile.1 } -set N [expr $i / $num_fd_per_openwrite_db] +set N [expr $i / 3] # Create a bunch of random database names # unset -nocomplain dbname unset -nocomplain used Index: test/memdb.test ================================================================== --- test/memdb.test +++ test/memdb.test @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script is in-memory database backend. # -# $Id: memdb.test,v 1.17 2009/01/09 14:29:35 drh Exp $ +# $Id: memdb.test,v 1.15 2006/01/30 22:48:44 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -409,29 +409,9 @@ DELETE FROM t1; SELECT count(*) FROM t1; } } 0 -# Test that auto-vacuum works with in-memory databases. -# -do_test memdb-9.1 { - db close - sqlite3 db test.db - db cache size 0 - execsql { - PRAGMA auto_vacuum = full; - CREATE TABLE t1(a); - INSERT INTO t1 VALUES(randstr(1000,1000)); - INSERT INTO t1 VALUES(randstr(1000,1000)); - INSERT INTO t1 VALUES(randstr(1000,1000)); - } - set memused [lindex [sqlite3_status SQLITE_STATUS_MEMORY_USED 0] 1] - set pgovfl [lindex [sqlite3_status SQLITE_STATUS_PAGECACHE_OVERFLOW 0] 1] - execsql { DELETE FROM t1 } - set memused2 [lindex [sqlite3_status SQLITE_STATUS_MEMORY_USED 0] 1] - expr {($memused2 + 2048 < $memused) || $pgovfl==0} -} {1} - } ;# ifcapable memorydb finish_test Index: test/misc7.test ================================================================== --- test/misc7.test +++ test/misc7.test @@ -8,11 +8,11 @@ # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. # -# $Id: misc7.test,v 1.28 2009/02/10 05:45:42 danielk1977 Exp $ +# $Id: misc7.test,v 1.24 2008/08/22 13:57:39 pweilbacher Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl do_test misc7-1-misuse { @@ -164,26 +164,10 @@ do_test misc7-7.2 { execsql { DETACH aux; } } {} -do_test misc7-7.3 { - db close - sqlite3 db test.db -readonly 1 - execsql { - PRAGMA omit_readlock = 1; - ATTACH 'test2.db' AS aux; - SELECT name FROM aux.sqlite_master; - SELECT name FROM aux.sqlite_master; - } -} {hello hello} -do_test misc7-7.3 { - db close - sqlite3 db test.db - set ::DB [sqlite3_connection_pointer db] - list -} {} # Test the UTF-16 version of the "out of memory" message (used when # malloc fails during sqlite3_open() ). # ifcapable utf16 { @@ -411,11 +395,11 @@ catch {file attributes test.db-journal -permissions r--------} catch {file attributes test.db-journal -readonly 1} catchsql { SELECT count(*) FROM t3; } - } {1 {unable to open database file}} + } {1 {database is locked}} do_test misc7-17.2 { # Note that the -readonly flag must be cleared before the -permissions # are set. Otherwise, when using tcl 8.5 on mac, the fact that the # -readonly flag is set causes the attempt to set the permissions # to fail. @@ -424,13 +408,11 @@ catchsql { SELECT count(*) FROM t3; } } {0 32} - # sqlite3_test_control_pending_page [expr ($::sqlite_pending_byte / 1024) + 1] set ::pending_byte_page [expr ($::sqlite_pending_byte / 1024) + 1] - sqlite3_test_control_pending_byte $::sqlite_pending_byte do_test misc7-17.3 { db eval { pragma writable_schema = true; UPDATE sqlite_master SET rootpage = $pending_byte_page @@ -484,18 +466,10 @@ # do_test misc7-20.1 { sqlite3_global_recover } {SQLITE_OK} -# Try to open a really long file name. -# -do_test misc7-21.1 { - set zFile [file join [pwd] "[string repeat abcde 104].db"] - set rc [catch {sqlite3 db2 $zFile} msg] - list $rc $msg -} {1 {unable to open database file}} - db close file delete -force test.db finish_test Index: test/mutex1.test ================================================================== --- test/mutex1.test +++ test/mutex1.test @@ -7,11 +7,11 @@ # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # -# $Id: mutex1.test,v 1.17 2009/01/09 14:29:35 drh Exp $ +# $Id: mutex1.test,v 1.15 2008/10/07 15:25:49 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl ifcapable !mutex { @@ -22,11 +22,10 @@ finish_test return } sqlite3_reset_auto_extension -clear_mutex_counters proc mutex_counters {varname} { upvar $varname var set var(total) 0 foreach {name value} [read_mutex_counters] { @@ -149,33 +148,10 @@ mutex_counters counters set counters(recursive) } {0} } -# Test the sqlite3_db_mutex() function. -# -do_test mutex1.4.1 { - catch {db close} - sqlite3 db test.db - enter_db_mutex db - db eval {SELECT 1, 2, 3} -} {1 2 3} -do_test mutex1.4.2 { - leave_db_mutex db - db eval {SELECT 1, 2, 3} -} {1 2 3} -do_test mutex1.4.3 { - catch {db close} - sqlite3 db test.db -nomutex 1 - enter_db_mutex db - db eval {SELECT 1, 2, 3} -} {1 2 3} -do_test mutex1.4.4 { - leave_db_mutex db - db eval {SELECT 1, 2, 3} -} {1 2 3} - do_test mutex1-X { catch {db close} sqlite3_shutdown clear_mutex_counters install_mutex_counters 0 Index: test/pager.test ================================================================== --- test/pager.test +++ test/pager.test @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script is page cache subsystem. # -# $Id: pager.test,v 1.34 2009/01/07 15:18:21 danielk1977 Exp $ +# $Id: pager.test,v 1.31 2008/08/20 14:49:25 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -212,11 +212,10 @@ for {set i 2} {$i<=20} {incr i} { set gx [page_get $::p1 $i] page_write $gx "Page-$i" page_unref $gx } -breakpoint pager_commit $::p1 page_unref $::g(1) } {} for {set i 2} {$i<=20} {incr i} { do_test pager-3.6.[expr {$i-1}] [subst { @@ -411,22 +410,20 @@ # Test truncate on an in-memory database is Ok. ifcapable memorydb { do_test pager-4.6.2 { set ::p2 [pager_open :memory: 10] - pager_truncate $::p2 0 + pager_truncate $::p2 5 } {} do_test pager-4.6.3 { - set page1 [page_get $::p2 1] for {set i 1} {$i<5} {incr i} { set p [page_get $::p2 $i] page_write $p "Page $i" pager_commit $::p2 page_unref $p } - page_unref $page1 - pager_truncate $::p2 3 + # pager_truncate $::p2 3 } {} do_test pager-4.6.4 { pager_close $::p2 } {} } @@ -458,18 +455,12 @@ } # The following tests cover rolling back hot journal files. # They can't be run on windows because the windows version of # SQLite holds a mandatory exclusive lock on journal files it has open. -# -# They cannot be run during the journaltest permutation because -# "PRAGMA synchronous = 0" is used. -# -if {$tcl_platform(platform)!="windows" && ( - 0 == [info exists ::permutations_test_prefix] - || $::permutations_test_prefix ne "journaltest" -)} { +# +if {$tcl_platform(platform)!="windows"} { do_test pager-6.1 { file delete -force test2.db file delete -force test2.db-journal sqlite3 db2 test2.db execsql { Index: test/pager2.test ================================================================== --- test/pager2.test +++ test/pager2.test @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script is page cache subsystem. # -# $Id: pager2.test,v 1.9 2008/12/30 17:55:00 drh Exp $ +# $Id: pager2.test,v 1.7 2008/08/20 14:49:25 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -31,17 +31,17 @@ set ::p1 [pager_open :memory: 10] } msg] } {0} do_test pager2-1.1 { pager_stats $::p1 -} {ref 0 page 0 max 10 size 0 state 4 err 0 hit 0 miss 0 ovfl 0} +} {ref 0 page 0 max 10 size 0 state 0 err 0 hit 0 miss 0 ovfl 0} do_test pager2-1.2 { pager_pagecount $::p1 } {0} do_test pager2-1.3 { pager_stats $::p1 -} {ref 0 page 0 max 10 size 0 state 4 err 0 hit 0 miss 0 ovfl 0} +} {ref 0 page 0 max 10 size 0 state 0 err 0 hit 0 miss 0 ovfl 0} do_test pager2-1.4 { pager_close $::p1 } {} # Try to write a few pages. @@ -60,44 +60,44 @@ do_test pager2-2.3.1 { set ::gx [page_lookup $::p1 1] } {} do_test pager2-2.3.2 { pager_stats $::p1 -} {ref 0 page 0 max 10 size 0 state 4 err 0 hit 0 miss 0 ovfl 0} +} {ref 0 page 0 max 10 size 0 state 0 err 0 hit 0 miss 0 ovfl 0} do_test pager2-2.3.3 { set v [catch { set ::g1 [page_get $::p1 1] } msg] if {$v} {lappend v $msg} set v } {0} do_test pager2-2.3.3 { pager_stats $::p1 -} {ref 1 page 1 max 10 size 0 state 4 err 0 hit 0 miss 1 ovfl 0} +} {ref 1 page 1 max 10 size 0 state 1 err 0 hit 0 miss 1 ovfl 0} do_test pager2-2.3.4 { set ::gx [page_lookup $::p1 1] page_unref $::gx expr {$::gx!=""} } {1} do_test pager2-2.3.5 { pager_stats $::p1 -} {ref 1 page 1 max 10 size 0 state 4 err 0 hit 0 miss 1 ovfl 0} +} {ref 1 page 1 max 10 size 0 state 1 err 0 hit 0 miss 1 ovfl 0} do_test pager2-2.3.6 { expr {$::g1==$::gx} } {1} do_test pager2-2.3.7 { pager_stats $::p1 -} {ref 1 page 1 max 10 size 0 state 4 err 0 hit 0 miss 1 ovfl 0} +} {ref 1 page 1 max 10 size 0 state 1 err 0 hit 0 miss 1 ovfl 0} do_test pager2-2.4 { pager_stats $::p1 -} {ref 1 page 1 max 10 size 0 state 4 err 0 hit 0 miss 1 ovfl 0} +} {ref 1 page 1 max 10 size 0 state 1 err 0 hit 0 miss 1 ovfl 0} do_test pager2-2.5 { pager_pagecount $::p1 } {0} do_test pager2-2.6 { pager_stats $::p1 -} {ref 1 page 1 max 10 size 0 state 4 err 0 hit 0 miss 1 ovfl 0} +} {ref 1 page 1 max 10 size 0 state 1 err 0 hit 0 miss 1 ovfl 0} do_test pager2-2.7 { page_number $::g1 } {1} do_test pager2-2.8 { page_read $::g1 @@ -105,21 +105,21 @@ do_test pager2-2.9 { page_unref $::g1 } {} do_test pager2-2.10 { pager_stats $::p1 -} {ref 0 page 1 max 10 size 0 state 4 err 0 hit 0 miss 1 ovfl 0} +} {ref 0 page 1 max 10 size 0 state 0 err 0 hit 0 miss 1 ovfl 0} do_test pager2-2.11 { set ::g1 [page_get $::p1 1] expr {$::g1!=0} } {1} do_test pager2-2.12 { page_number $::g1 } {1} do_test pager2-2.13 { pager_stats $::p1 -} {ref 1 page 1 max 10 size 0 state 4 err 0 hit 1 miss 1 ovfl 0} +} {ref 1 page 1 max 10 size 0 state 1 err 0 hit 1 miss 1 ovfl 0} do_test pager2-2.14 { set v [catch { page_write $::g1 "Page-One" } msg] lappend v $msg @@ -136,23 +136,23 @@ } msg] lappend v $msg } {0 {}} do_test pager2-2.20 { pager_stats $::p1 -} {ref 1 page 1 max 10 size 1 state 4 err 0 hit 1 miss 1 ovfl 0} +} {ref 1 page 1 max 10 size 1 state 1 err 0 hit 1 miss 1 ovfl 0} do_test pager2-2.19 { pager_pagecount $::p1 } {1} do_test pager2-2.21 { pager_stats $::p1 -} {ref 1 page 1 max 10 size 1 state 4 err 0 hit 1 miss 1 ovfl 0} +} {ref 1 page 1 max 10 size 1 state 1 err 0 hit 1 miss 1 ovfl 0} do_test pager2-2.22 { page_unref $::g1 } {} do_test pager2-2.23 { pager_stats $::p1 -} {ref 0 page 1 max 10 size 1 state 4 err 0 hit 1 miss 1 ovfl 0} +} {ref 0 page 1 max 10 size 1 state 0 err 0 hit 1 miss 1 ovfl 0} do_test pager2-2.24 { set v [catch { page_get $::p1 1 } ::g1] if {$v} {lappend v $::g1} @@ -213,21 +213,18 @@ } pager_commit $::p1 page_unref $::g(1) } {} for {set i 2} {$i<=20} {incr i} { - set page1 [page_get $::p1 1] do_test pager2-3.6.[expr {$i-1}] [subst { set gx \[page_get $::p1 $i\] set v \[page_read \$gx\] page_unref \$gx set v }] "Page-$i" - page_unref $page1 } for {set i 1} {$i<=20} {incr i} { - set page1 [page_get $::p1 1] regsub -all CNT { set ::g1 [page_get $::p1 CNT] set ::g2 [page_get $::p1 CNT] set ::vx [page_read $::g2] expr {$::g1==$::g2} @@ -245,11 +242,10 @@ set vy [page_read $gx] page_unref $gx expr {$vy==$::vx} } $i body; do_test pager2-3.7.$i.3 $body {1} - page_unref $page1 } do_test pager2-3.99 { pager_close $::p1 } {} @@ -283,11 +279,11 @@ do_test pager2-4.3 { lrange [pager_stats $::p1] 0 1 } {ref 1} do_test pager2-4.4 { lrange [pager_stats $::p1] 8 9 -} {state 4} +} {state 1} for {set i 1} {$i<20} {incr i} { do_test pager2-4.5.$i.0 { set res {} for {set j 2} {$j<=20} {incr j} { @@ -340,10 +336,11 @@ lappend res $value $shouldbe } } set res } {} +breakpoint do_test pager2-4.5.$i.5 { page_write $g1 "Page-1 v$i" lrange [pager_stats $p1] 8 9 } {state 4} do_test pager2-4.5.$i.6 { @@ -397,11 +394,11 @@ set res } {} do_test pager2-4.5.$i.10 { pager_commit $p1 lrange [pager_stats $p1] 8 9 - } {state 4} + } {state 1} } do_test pager2-4.99 { page_unref $::g1 pager_close $::p1 Index: test/pcache.test ================================================================== --- test/pcache.test +++ test/pcache.test @@ -9,11 +9,11 @@ # #*********************************************************************** # # This file is focused on testing the pcache module. # -# $Id: pcache.test,v 1.3 2009/01/07 15:33:46 drh Exp $ +# $Id: pcache.test,v 1.2 2008/09/05 05:29:09 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -62,11 +62,11 @@ sqlite3 db2 test.db execsql "PRAGMA cache_size=10" db2 pcache_stats } {current 11 max 20 min 20 recyclable 1} -do_test pcache-1.6.1 { +do_test pcache-1.6 { execsql { BEGIN; SELECT * FROM sqlite_master; } db2 pcache_stats @@ -74,11 +74,11 @@ # At this point connection db2 has a read lock on the database file and a # single pinned page in its cache. Connection [db] is holding 10 dirty # pages. It cannot recycle them because of the read lock held by db2. # -do_test pcache-1.6.2 { +do_test pcache-1.6 { execsql { CREATE INDEX i1 ON t1(a, b); CREATE INDEX i2 ON t2(a, b); CREATE INDEX i3 ON t3(a, b); CREATE INDEX i4 ON t4(a, b); @@ -142,5 +142,6 @@ execsql { PRAGMA cache_size = 15 } pcache_stats } {current 15 max 15 min 10 recyclable 15} finish_test + Index: test/pcache2.test ================================================================== --- test/pcache2.test +++ test/pcache2.test @@ -9,11 +9,11 @@ # #*********************************************************************** # # This file is focused on testing the pcache module. # -# $Id: pcache2.test,v 1.3 2008/11/13 16:21:50 danielk1977 Exp $ +# $Id: pcache2.test,v 1.2 2008/10/14 19:21:52 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -20,15 +20,13 @@ # Set up a pcache memory pool so that we can easily track how many # pages are being used for cache. # do_test pcache2-1.1 { db close - sqlite3_reset_auto_extension sqlite3_shutdown sqlite3_config_pagecache 6000 100 sqlite3_initialize - autoinstall_test_functions sqlite3_status SQLITE_STATUS_PAGECACHE_USED 1 sqlite3_status SQLITE_STATUS_PAGECACHE_USED 0 } {0 0 0} # Open up two database connections to separate files. @@ -68,12 +66,8 @@ sqlite3_status SQLITE_STATUS_PAGECACHE_USED 0 } {0 13 13} db close catch {db2 close} -sqlite3_reset_auto_extension sqlite3_shutdown sqlite3_config_pagecache 0 0 -sqlite3_initialize -autoinstall_test_functions - finish_test Index: test/permutations.test ================================================================== --- test/permutations.test +++ test/permutations.test @@ -7,11 +7,11 @@ # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # -# $Id: permutations.test,v 1.45 2009/01/10 18:51:40 danielk1977 Exp $ +# $Id: permutations.test,v 1.35 2008/10/11 17:04:04 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Argument processing. @@ -37,11 +37,11 @@ } if {$::perm::testmode eq "all" || $::perm::testmode eq ""} { set ::perm::testmode { memsubsys1 memsubsys2 singlethread multithread onefile utf16 exclusive persistent_journal persistent_journal_error no_journal no_journal_error - autovacuum_ioerr no_mutex_try fullmutex journaltest + autovacuum_ioerr no_mutex_try fullmutex } } if {$::perm::testmode eq "targets"} { puts "" puts -nonewline "veryquick " @@ -69,12 +69,11 @@ crash.test memsubsys1.test thread001.test exclusive3.test memsubsys2.test thread002.test fts3.test misc7.test utf16.test fuzz_malloc.test misuse.test veryquick.test fuzz.test mutex2.test vtab_err.test - lookaside.test fuzz3.test savepoint4.test - savepoint6.test + lookaside.test fuzz3.test } set ALLTESTS [list] foreach filename [glob $testdir/*.test] { set filename [file tail $filename] if {[lsearch $EXCLUDE $filename] < 0} { lappend ALLTESTS $filename } @@ -232,21 +231,25 @@ # Run some tests in SQLITE_CONFIG_SINGLETHREAD mode. # run_tests "singlethread" -description { Tests run in SQLITE_CONFIG_SINGLETHREAD mode } -initialize { - catch {db close} - sqlite3_shutdown - catch {sqlite3_config singlethread} + do_test mutex2-singlethread.0 { + catch {db close} + sqlite3_shutdown + sqlite3_config singlethread + } SQLITE_OK } -include { delete.test delete2.test insert.test rollback.test select1.test select2.test trans.test update.test vacuum.test types.test types2.test types3.test } -shutdown { - catch {db close} - sqlite3_shutdown - catch {sqlite3_config serialized} + do_test mutex2-X { + catch {db close} + sqlite3_shutdown + sqlite3_config serialized + } SQLITE_OK } run_tests "nomutex" -description { Tests run with the SQLITE_OPEN_MULTITHREADED flag passed to sqlite3_open(). } -initialize { @@ -269,21 +272,25 @@ # Run some tests in SQLITE_CONFIG_MULTITHREAD mode. # run_tests "multithread" -description { Tests run in SQLITE_CONFIG_MULTITHREAD mode } -initialize { - catch {db close} - sqlite3_shutdown - catch {sqlite3_config multithread} + do_test mutex2-multithread.0 { + catch {db close} + sqlite3_shutdown + sqlite3_config multithread + } SQLITE_OK } -include { delete.test delete2.test insert.test rollback.test select1.test select2.test trans.test update.test vacuum.test types.test types2.test types3.test } -shutdown { - catch {db close} - sqlite3_shutdown - catch {sqlite3_config serialized} + do_test mutex2-X { + catch {db close} + sqlite3_shutdown + sqlite3_config serialized + } SQLITE_OK } # Run some tests in SQLITE_OPEN_FULLMUTEX mode. # run_tests "fullmutex" -description { @@ -439,28 +446,10 @@ Run ioerr.test in autovacuum mode. } -presql { pragma auto_vacuum = 1 } -include ioerr.test -# Run tests with an in-memory journal. -# -run_tests "inmemory_journal" -description { - Run tests with an in-memory journal file. -} -presql { - pragma journal_mode = 'memory' -} -exclude { - # Exclude all tests that simulate IO errors. - autovacuum_ioerr2.test incrvacuum_ioerr.test ioerr.test - ioerr.test ioerr2.test ioerr3.test ioerr4.test ioerr5.test - vacuum3.test incrblob_err.test diskfull.test - - # Exclude test scripts that use tcl IO to access journal files or count - # the number of fsync() calls. - pager.test exclusive.test jrnlmode.test sync.test misc1.test - journal1.test conflict.test -} - ifcapable mem3 { run_tests "memsys3" -description { Run tests using the allocator in mem3.c. } -exclude { autovacuum.test delete3.test manydb.test @@ -496,11 +485,11 @@ autovacuum.test delete3.test manydb.test bigrow.test incrblob2.test memdb.test bitvec.test index2.test memsubsys1.test capi3c.test ioerr.test memsubsys2.test capi3.test join3.test pagesize.test - collate5.test limit.test zeroblob.test + collate5.test limit.test } -initialize { catch {db close} sqlite3_reset_auto_extension sqlite3_shutdown sqlite3_config_heap 25000000 64 @@ -555,10 +544,31 @@ catch {db close} sqlite3_shutdown install_mutex_counters 0 } } + +run_tests "memsys6" -description { + Run tests using the allocator in mem6.c. +} -exclude { + capi3.test capi3c.test +} -initialize { + catch {db close} + sqlite3_reset_auto_extension + sqlite3_shutdown + sqlite3_config_chunkalloc 0 + install_malloc_faultsim 1 + sqlite3_initialize + autoinstall_test_functions +} -shutdown { + catch {db close} + sqlite3_reset_auto_extension + sqlite3_shutdown + sqlite3_config_heap 0 0 + install_malloc_faultsim 1 + sqlite3_initialize +} # run_tests "crash_safe_append" -description { # Run crash.test with persistent journals on a SAFE_APPEND file-system. # } -initialize { # rename crashsql sa_crashsql @@ -595,129 +605,10 @@ rename sqlite3 {} rename sqlite3_shutdown sqlite3 } -include [lsort [concat shared_err.test $ALLTESTS]] \ -exclude async3.test -# The set of tests to run on the alternative-pcache -set perm-alt-pcache-testset { - async.test - attach.test - delete.test delete2.test - index.test - insert.test insert2.test - join.test join2.test - rollback.test - select1.test select2.test - trans.test - update.test -} - -run_tests "pcache0" -description { - Alternative pcache implementation without random discard -} -initialize { - catch {db close} - sqlite3_reset_auto_extension - sqlite3_shutdown - sqlite3_config_alt_pcache 1 0 1 - sqlite3_initialize - autoinstall_test_functions -} -shutdown { - catch {db close} - sqlite3_reset_auto_extension - sqlite3_shutdown - sqlite3_config_alt_pcache 0 0 0 - sqlite3_config_lookaside 100 500 - install_malloc_faultsim 1 - sqlite3_initialize -} -include ${perm-alt-pcache-testset} - -run_tests "pcache10" -description { - Alternative pcache implementation without 10% random discard -} -initialize { - catch {db close} - sqlite3_reset_auto_extension - sqlite3_shutdown - sqlite3_config_alt_pcache 1 50 1 - sqlite3_initialize - autoinstall_test_functions -} -shutdown { - catch {db close} - sqlite3_reset_auto_extension - sqlite3_shutdown - sqlite3_config_alt_pcache 0 0 0 - sqlite3_initialize -} -include ${perm-alt-pcache-testset} - -run_tests "pcache50" -description { - Alternative pcache implementation without 50% random discard -} -initialize { - catch {db close} - sqlite3_reset_auto_extension - sqlite3_shutdown - sqlite3_config_alt_pcache 1 50 1 - sqlite3_initialize - autoinstall_test_functions -} -shutdown { - catch {db close} - sqlite3_reset_auto_extension - sqlite3_shutdown - sqlite3_config_alt_pcache 0 0 0 - sqlite3_initialize -} -include ${perm-alt-pcache-testset} - -run_tests "pcache90" -description { - Alternative pcache implementation without 90% random discard -} -initialize { - catch {db close} - sqlite3_reset_auto_extension - sqlite3_shutdown - sqlite3_config_alt_pcache 1 50 1 - sqlite3_initialize - autoinstall_test_functions -} -shutdown { - catch {db close} - sqlite3_reset_auto_extension - sqlite3_shutdown - sqlite3_config_alt_pcache 0 0 0 - sqlite3_initialize -} -include ${perm-alt-pcache-testset} - -run_tests "pcache100" -description { - Alternative pcache implementation that always discards when unpinning -} -initialize { - catch {db close} - sqlite3_reset_auto_extension - sqlite3_shutdown - sqlite3_config_alt_pcache 1 100 1 - sqlite3_initialize - autoinstall_test_functions -} -shutdown { - catch {db close} - sqlite3_reset_auto_extension - sqlite3_shutdown - sqlite3_config_alt_pcache 0 0 0 - sqlite3_initialize -} -include ${perm-alt-pcache-testset} - -run_tests "journaltest" -description { - Check that pages are synced before being written (test_journal.c). -} -initialize { - set ISQUICK 1 - catch {db close} - register_jt_vfs -default "" - #sqlite3_instvfs binarylog -default binarylog ostrace.bin -} -shutdown { - #sqlite3_instvfs destroy binarylog - unregister_jt_vfs -} -include [concat $::ALLTESTS savepoint6.test -] -exclude { - incrvacuum.test - ioerr.test - corrupt4.test - io.test - crash8.test -} # End of tests ############################################################################# if {$::perm::testmode eq "targets"} { puts "" ; exit } Index: test/pragma.test ================================================================== --- test/pragma.test +++ test/pragma.test @@ -10,11 +10,11 @@ #*********************************************************************** # This file implements regression tests for SQLite library. # # This file implements tests for the PRAGMA command. # -# $Id: pragma.test,v 1.73 2009/01/12 14:01:45 danielk1977 Exp $ +# $Id: pragma.test,v 1.68 2008/10/10 17:47:21 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Test organization: @@ -32,11 +32,10 @@ # pragma-10.*: Test the count_changes pragma in the presence of triggers. # pragma-11.*: Test the collation_list pragma. # pragma-14.*: Test the page_count pragma. # pragma-15.*: Test that the value set using the cache_size pragma is not # reset when the schema is reloaded. -# pragma-16.*: Test proxy locking # ifcapable !pragma { finish_test return @@ -87,11 +86,11 @@ PRAGMA synchronous; } } [list $DFLT_CACHE_SZ $DFLT_CACHE_SZ 0] do_test pragma-1.5 { execsql { - PRAGMA cache_size=-4321; + PRAGMA cache_size=4321; PRAGMA cache_size; PRAGMA default_cache_size; PRAGMA synchronous; } } [list 4321 $DFLT_CACHE_SZ 0] @@ -112,11 +111,11 @@ PRAGMA synchronous; } } [list $DFLT_CACHE_SZ $DFLT_CACHE_SZ 2] do_test pragma-1.8 { execsql { - PRAGMA default_cache_size=-123; + PRAGMA default_cache_size=123; PRAGMA cache_size; PRAGMA default_cache_size; PRAGMA synchronous; } } {123 123 2} @@ -409,18 +408,17 @@ } {{*** in database t2 *** Page 4 is never used Page 5 is never used Page 6 is never used} {rowid 1 missing from index i2}} } - do_test pragma-3.19 { - catch {db close} - file delete -force test.db test.db-journal - sqlite3 db test.db - db eval {PRAGMA integrity_check} - } {ok} -} -#exit + do_test pragma-3.99 { + catchsql {DETACH t3} + catchsql {DETACH t2} + file delete -force testerr.db testerr.db-journal + catchsql {DROP INDEX i2} + } {0 {}} +} # Test modifying the cache_size of an attached database. ifcapable pager_pragmas&&attach { do_test pragma-4.1 { execsql { @@ -502,19 +500,13 @@ set res } {0 main 1 temp 2 aux} } do_test pragma-6.2 { execsql { - CREATE TABLE t2(a,b,c); pragma table_info(t2) } } {0 a {} 0 {} 0 1 b {} 0 {} 0 2 c {} 0 {} 0} -do_test pragma-6.2.1 { - execsql { - pragma table_info; - } -} {} db nullvalue <> do_test pragma-6.2.2 { execsql { CREATE TABLE t5( a TEXT DEFAULT CURRENT_TIMESTAMP, @@ -526,51 +518,31 @@ PRAGMA table_info(t5); } } {0 a TEXT 0 CURRENT_TIMESTAMP 0 1 b {} 0 5+3 0 2 c TEXT 0 <> 0 3 d INTEGER 0 NULL 0 4 e TEXT 0 '' 0} db nullvalue {} ifcapable {foreignkey} { - do_test pragma-6.3.1 { + do_test pragma-6.3 { execsql { CREATE TABLE t3(a int references t2(b), b UNIQUE); pragma foreign_key_list(t3); } } {0 0 t2 a b RESTRICT RESTRICT NONE} - do_test pragma-6.3.2 { - execsql { - pragma foreign_key_list; - } - } {} - do_test pragma-6.3.3 { - execsql { - pragma foreign_key_list(t3_bogus); - } - } {} - do_test pragma-6.3.4 { - execsql { - pragma foreign_key_list(t5); - } - } {} do_test pragma-6.4 { execsql { pragma index_list(t3); } } {0 sqlite_autoindex_t3_1 1} } ifcapable {!foreignkey} { execsql {CREATE TABLE t3(a,b UNIQUE)} } -do_test pragma-6.5.1 { +do_test pragma-6.5 { execsql { CREATE INDEX t3i1 ON t3(a,b); pragma index_info(t3i1); } } {0 0 a 1 1 b} -do_test pragma-6.5.2 { - execsql { - pragma index_info(t3i1_bogus); - } -} {} ifcapable tempdb { # Test for ticket #3320. When a temp table of the same name exists, make # sure the schema of the main table can still be queried using # "pragma table_info": @@ -594,46 +566,22 @@ execsql { PRAGMA main.table_info(trial); } } {0 col_main {} 0 {} 0} } - -do_test pragma-6.7 { - execsql { - CREATE TABLE test_table( - one INT NOT NULL DEFAULT -1, - two text, - three VARCHAR(45, 65) DEFAULT 'abcde', - four REAL DEFAULT X'abcdef', - five DEFAULT CURRENT_TIME - ); - PRAGMA table_info(test_table); - } -} [concat \ - {0 one INT 1 -1 0} \ - {1 two text 0 {} 0} \ - {2 three {VARCHAR(45, 65)} 0 'abcde' 0} \ - {3 four REAL 0 X'abcdef' 0} \ - {4 five {} 0 CURRENT_TIME 0} \ -] } ;# ifcapable schema_pragmas # Miscellaneous tests # ifcapable schema_pragmas { -do_test pragma-7.1.1 { +do_test pragma-7.1 { # Make sure a pragma knows to read the schema if it needs to db close sqlite3 db test.db execsql { pragma index_list(t3); } } {0 t3i1 0 1 sqlite_autoindex_t3_1 1} -do_test pragma-7.1.2 { - execsql { - pragma index_list(t3_bogus); - } -} {} } ;# ifcapable schema_pragmas ifcapable {utf16} { do_test pragma-7.2 { db close sqlite3 db test.db @@ -1282,191 +1230,6 @@ # Reset the sqlite3_temp_directory variable for the next run of tests: sqlite3 dbX :memory: dbX eval {PRAGMA temp_store_directory = ""} dbX close -ifcapable lock_proxy_pragmas&&prefer_proxy_locking { - set sqlite_hostid_num 1 - - set using_proxy 0 - foreach {name value} [array get env SQLITE_FORCE_PROXY_LOCKING] { - set using_proxy $value - } - - # Test the lock_proxy_file pragmas. - # - db close - set env(SQLITE_FORCE_PROXY_LOCKING) "0" - - sqlite3 db test.db - do_test pragma-16.1 { - execsql { - PRAGMA lock_proxy_file="mylittleproxy"; - select * from sqlite_master; - } - execsql { - PRAGMA lock_proxy_file; - } - } {mylittleproxy} - - do_test pragma-16.2 { - sqlite3 db2 test.db - execsql { - PRAGMA lock_proxy_file="mylittleproxy"; - } db2 - } {} - - db2 close - do_test pragma-16.2.1 { - sqlite3 db2 test.db - execsql { - PRAGMA lock_proxy_file=":auto:"; - select * from sqlite_master; - } db2 - execsql { - PRAGMA lock_proxy_file; - } db2 - } {mylittleproxy} - - db2 close - do_test pragma-16.3 { - sqlite3 db2 test.db - execsql { - PRAGMA lock_proxy_file="myotherproxy"; - } db2 - catchsql { - select * from sqlite_master; - } db2 - } {1 {database is locked}} - - do_test pragma-16.4 { - db2 close - db close - sqlite3 db2 test.db - execsql { - PRAGMA lock_proxy_file="myoriginalproxy"; - PRAGMA lock_proxy_file="myotherproxy"; - PRAGMA lock_proxy_file; - } db2 - } {myotherproxy} - - db2 close - set env(SQLITE_FORCE_PROXY_LOCKING) "1" - do_test pragma-16.5 { - sqlite3 db2 test.db - execsql { - PRAGMA lock_proxy_file=":auto:"; - PRAGMA lock_proxy_file; - } db2 - } {myotherproxy} - - do_test pragma-16.6 { - db2 close - sqlite3 db2 test2.db - set lockpath [execsql { - PRAGMA lock_proxy_file=":auto:"; - PRAGMA lock_proxy_file; - } db2] - string match "*test2.db:auto:" $lockpath - } {1} - - set sqlite_hostid_num 2 - do_test pragma-16.7 { - sqlite3 db test2.db - execsql { - PRAGMA lock_proxy_file=":auto:"; - } - catchsql { - select * from sqlite_master; - } - } {1 {database is locked}} - db close - - do_test pragma-16.8 { - sqlite3 db test2.db - catchsql { - select * from sqlite_master; - } - } {1 {database is locked}} - - db2 close - do_test pragma-16.8.1 { - execsql { - PRAGMA lock_proxy_file="yetanotherproxy"; - PRAGMA lock_proxy_file; - } - } {yetanotherproxy} - do_test pragma-16.8.2 { - execsql { - create table mine(x); - } - } {} - - db close - do_test pragma-16.9 { - sqlite3 db proxytest.db - set lockpath2 [execsql { - PRAGMA lock_proxy_file=":auto:"; - PRAGMA lock_proxy_file; - } db] - string match "*proxytest.db:auto:" $lockpath2 - } {1} - - set env(SQLITE_FORCE_PROXY_LOCKING) $using_proxy - set sqlite_hostid_num 0 -} - -# Parsing of auto_vacuum settings. -# -foreach {autovac_setting val} { - 0 0 - 1 1 - 2 2 - 3 0 - -1 0 - none 0 - NONE 0 - NoNe 0 - full 1 - FULL 1 - incremental 2 - INCREMENTAL 2 - -1234 0 - 1234 0 -} { - do_test pragma-17.1.$autovac_setting { - catch {db close} - sqlite3 db :memory: - execsql " - PRAGMA auto_vacuum=$::autovac_setting; - PRAGMA auto_vacuum; - " - } $val -} - -# Parsing of temp_store settings. -# -foreach {temp_setting val} { - 0 0 - 1 1 - 2 2 - 3 0 - -1 0 - file 1 - FILE 1 - fIlE 1 - memory 2 - MEMORY 2 - MeMoRy 2 -} { - do_test pragma-18.1.$temp_setting { - catch {db close} - sqlite3 db :memory: - execsql " - PRAGMA temp_store=$::temp_setting; - PRAGMA temp_store=$::temp_setting; - PRAGMA temp_store; - " - } $val -} - finish_test Index: test/printf.test ================================================================== --- test/printf.test +++ test/printf.test @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the sqlite_*_printf() interface. # -# $Id: printf.test,v 1.31 2009/02/01 00:21:10 drh Exp $ +# $Id: printf.test,v 1.30 2008/07/09 16:51:52 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -3538,11 +3538,11 @@ do_test printf-8.1 { sqlite3_mprintf_int {%u %u %u} 0x7fffffff 0x80000000 0xffffffff } {2147483647 2147483648 4294967295} do_test printf-8.2 { - sqlite3_mprintf_long {%lu %lu %lu} 0x7fffffff 0x80000000 0xffffffff + sqlite3_mprintf_int {%lu %lu %lu} 0x7fffffff 0x80000000 0xffffffff } {2147483647 2147483648 4294967295} do_test printf-8.3 { sqlite3_mprintf_int64 {%llu %llu %llu} 2147483647 2147483648 4294967296 } {2147483647 2147483648 4294967296} do_test printf-8.4 { Index: test/quick.test ================================================================== --- test/quick.test +++ test/quick.test @@ -4,11 +4,11 @@ # May you share freely, never taking more than you give. # #*********************************************************************** # This file runs all tests. # -# $Id: quick.test,v 1.92 2009/02/03 16:51:25 danielk1977 Exp $ +# $Id: quick.test,v 1.88 2008/10/13 14:16:11 drh Exp $ proc lshift {lvar} { upvar $lvar l set ret [lindex $l 0] set l [lrange $l 1 end] @@ -44,13 +44,11 @@ set EXCLUDE { all.test async.test async2.test async3.test - backup_ioerr.test corrupt.test - corruptC.test crash.test crash2.test crash3.test crash4.test crash5.test @@ -68,12 +66,10 @@ misuse.test mutex2.test onefile.test permutations.test quick.test - savepoint4.test - savepoint6.test select9.test soak.test speed1.test speed1p.test speed2.test DELETED test/randexpr1.tcl Index: test/randexpr1.tcl ================================================================== --- test/randexpr1.tcl +++ /dev/null @@ -1,342 +0,0 @@ -# Run this TCL script to generate thousands of test cases containing -# complicated expressions. -# -# The generated tests are intended to verify expression evaluation -# in SQLite against expression evaluation TCL. -# - -# Terms of the $intexpr list each contain two sub-terms. -# -# * An SQL expression template -# * The equivalent TCL expression -# -# EXPR is replaced by an integer subexpression. BOOL is replaced -# by a boolean subexpression. -# -set intexpr { - {11 wide(11)} - {13 wide(13)} - {17 wide(17)} - {19 wide(19)} - {a $a} - {b $b} - {c $c} - {d $d} - {e $e} - {f $f} - {t1.a $a} - {t1.b $b} - {t1.c $c} - {t1.d $d} - {t1.e $e} - {t1.f $f} - {(EXPR) (EXPR)} - {{ -EXPR} {-EXPR}} - {+EXPR +EXPR} - {~EXPR ~EXPR} - {EXPR+EXPR EXPR+EXPR} - {EXPR-EXPR EXPR-EXPR} - {EXPR*EXPR EXPR*EXPR} - {EXPR+EXPR EXPR+EXPR} - {EXPR-EXPR EXPR-EXPR} - {EXPR*EXPR EXPR*EXPR} - {EXPR+EXPR EXPR+EXPR} - {EXPR-EXPR EXPR-EXPR} - {EXPR*EXPR EXPR*EXPR} - {{EXPR | EXPR} {EXPR | EXPR}} - {(abs(EXPR)/abs(EXPR)) (abs(EXPR)/abs(EXPR))} - { - {case when BOOL then EXPR else EXPR end} - {((BOOL)?EXPR:EXPR)} - } - { - {case when BOOL then EXPR when BOOL then EXPR else EXPR end} - {((BOOL)?EXPR:((BOOL)?EXPR:EXPR))} - } - { - {case EXPR when EXPR then EXPR else EXPR end} - {(((EXPR)==(EXPR))?EXPR:EXPR)} - } - { - {(select AGG from t1)} - {(AGG)} - } - { - {coalesce((select max(EXPR) from t1 where BOOL),EXPR)} - {[coalesce_subquery [expr {EXPR}] [expr {BOOL}] [expr {EXPR}]]} - } - { - {coalesce((select EXPR from t1 where BOOL),EXPR)} - {[coalesce_subquery [expr {EXPR}] [expr {BOOL}] [expr {EXPR}]]} - } -} - -# The $boolexpr list contains terms that show both an SQL boolean -# expression and its equivalent TCL. -# -set boolexpr { - {EXPR=EXPR ((EXPR)==(EXPR))} - {EXPREXPR ((EXPR)>(EXPR))} - {EXPR<=EXPR ((EXPR)<=(EXPR))} - {EXPR>=EXPR ((EXPR)>=(EXPR))} - {EXPR<>EXPR ((EXPR)!=(EXPR))} - { - {EXPR between EXPR and EXPR} - {[betweenop [expr {EXPR}] [expr {EXPR}] [expr {EXPR}]]} - } - { - {EXPR not between EXPR and EXPR} - {(![betweenop [expr {EXPR}] [expr {EXPR}] [expr {EXPR}]])} - } - { - {EXPR in (EXPR,EXPR,EXPR)} - {([inop [expr {EXPR}] [expr {EXPR}] [expr {EXPR}] [expr {EXPR}]])} - } - { - {EXPR not in (EXPR,EXPR,EXPR)} - {(![inop [expr {EXPR}] [expr {EXPR}] [expr {EXPR}] [expr {EXPR}]])} - } - { - {EXPR in (select EXPR from t1 union select EXPR from t1)} - {[inop [expr {EXPR}] [expr {EXPR}] [expr {EXPR}]]} - } - { - {EXPR in (select AGG from t1 union select AGG from t1)} - {[inop [expr {EXPR}] [expr {AGG}] [expr {AGG}]]} - } - { - {exists(select 1 from t1 where BOOL)} - {(BOOL)} - } - { - {not exists(select 1 from t1 where BOOL)} - {!(BOOL)} - } - {{not BOOL} !BOOL} - {{BOOL and BOOL} {BOOL tcland BOOL}} - {{BOOL or BOOL} {BOOL || BOOL}} - {{BOOL and BOOL} {BOOL tcland BOOL}} - {{BOOL or BOOL} {BOOL || BOOL}} - {(BOOL) (BOOL)} - {(BOOL) (BOOL)} -} - -# Aggregate expressions -# -set aggexpr { - {count(*) wide(1)} - {{count(distinct EXPR)} {[one {EXPR}]}} - {{cast(avg(EXPR) AS integer)} (EXPR)} - {min(EXPR) (EXPR)} - {max(EXPR) (EXPR)} - {(AGG) (AGG)} - {{ -AGG} {-AGG}} - {+AGG +AGG} - {~AGG ~AGG} - {abs(AGG) abs(AGG)} - {AGG+AGG AGG+AGG} - {AGG-AGG AGG-AGG} - {AGG*AGG AGG*AGG} - {{AGG | AGG} {AGG | AGG}} - { - {case AGG when AGG then AGG else AGG end} - {(((AGG)==(AGG))?AGG:AGG)} - } -} - -# Convert a string containing EXPR, AGG, and BOOL into a string -# that contains nothing but X, Y, and Z. -# -proc extract_vars {a} { - regsub -all {EXPR} $a X a - regsub -all {AGG} $a Y a - regsub -all {BOOL} $a Z a - regsub -all {[^XYZ]} $a {} a - return $a -} - - -# Test all templates to make sure the number of EXPR, AGG, and BOOL -# expressions match. -# -foreach term [concat $aggexpr $intexpr $boolexpr] { - foreach {a b} $term break - if {[extract_vars $a]!=[extract_vars $b]} { - error "mismatch: $term" - } -} - -# Generate a random expression according to the templates given above. -# If the argument is EXPR or omitted, then an integer expression is -# generated. If the argument is BOOL then a boolean expression is -# produced. -# -proc generate_expr {{e EXPR}} { - set tcle $e - set ne [llength $::intexpr] - set nb [llength $::boolexpr] - set na [llength $::aggexpr] - set div 2 - set mx 50 - set i 0 - while {1} { - set cnt 0 - set re [lindex $::intexpr [expr {int(rand()*$ne)}]] - incr cnt [regsub {EXPR} $e [lindex $re 0] e] - regsub {EXPR} $tcle [lindex $re 1] tcle - set rb [lindex $::boolexpr [expr {int(rand()*$nb)}]] - incr cnt [regsub {BOOL} $e [lindex $rb 0] e] - regsub {BOOL} $tcle [lindex $rb 1] tcle - set ra [lindex $::aggexpr [expr {int(rand()*$na)}]] - incr cnt [regsub {AGG} $e [lindex $ra 0] e] - regsub {AGG} $tcle [lindex $ra 1] tcle - - if {$cnt==0} break - incr i $cnt - - set v1 [extract_vars $e] - if {$v1!=[extract_vars $tcle]} { - exit - } - - if {$i+[string length $v1]>=$mx} { - set ne [expr {$ne/$div}] - set nb [expr {$nb/$div}] - set na [expr {$na/$div}] - set div 1 - set mx [expr {$mx*1000}] - } - } - regsub -all { tcland } $tcle { \&\& } tcle - return [list $e $tcle] -} - -# Implementation of routines used to implement the IN and BETWEEN -# operators. -proc inop {lhs args} { - foreach a $args { - if {$a==$lhs} {return 1} - } - return 0 -} -proc betweenop {lhs first second} { - return [expr {$lhs>=$first && $lhs<=$second}] -} -proc coalesce_subquery {a b e} { - if {$b} { - return $a - } else { - return $e - } -} -proc one {args} { - return 1 -} - -# Begin generating the test script: -# -puts {# 2008 December 16 -# -# 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. -# -# This file tests randomly generated SQL expressions. The expressions -# are generated by a TCL script. The same TCL script also computes the -# correct value of the expression. So, from one point of view, this -# file verifies the expression evaluation logic of SQLite against the -# expression evaluation logic of TCL. -# -# An early version of this script is how bug #3541 was detected. -# -# $Id: randexpr1.tcl,v 1.1 2008/12/15 16:33:30 drh Exp $ -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -# Create test data -# -do_test randexpr1-1.1 { - db eval { - CREATE TABLE t1(a,b,c,d,e,f); - INSERT INTO t1 VALUES(100,200,300,400,500,600); - SELECT * FROM t1 - } -} {100 200 300 400 500 600} -} - -# Test data for TCL evaluation. -# -set a [expr {wide(100)}] -set b [expr {wide(200)}] -set c [expr {wide(300)}] -set d [expr {wide(400)}] -set e [expr {wide(500)}] -set f [expr {wide(600)}] - -# A procedure to generate a test case. -# -set tn 0 -proc make_test_case {sql result} { - global tn - incr tn - puts "do_test randexpr-2.$tn {\n db eval {$sql}\n} {$result}" -} - -# Generate many random test cases. -# -expr srand(0) -for {set i 0} {$i<1000} {incr i} { - while {1} { - foreach {sqle tcle} [generate_expr EXPR] break; - if {[catch {expr $tcle} ans]} { - #puts stderr [list $tcle] - #puts stderr ans=$ans - if {![regexp {divide by zero} $ans]} exit - continue - } - set len [string length $sqle] - if {$len<100 || $len>2000} continue - if {[info exists seen($sqle)]} continue - set seen($sqle) 1 - break - } - while {1} { - foreach {sqlb tclb} [generate_expr BOOL] break; - if {[catch {expr $tclb} bans]} { - #puts stderr [list $tclb] - #puts stderr bans=$bans - if {![regexp {divide by zero} $bans]} exit - continue - } - break - } - if {$bans} { - make_test_case "SELECT $sqle FROM t1 WHERE $sqlb" $ans - make_test_case "SELECT $sqle FROM t1 WHERE NOT ($sqlb)" {} - } else { - make_test_case "SELECT $sqle FROM t1 WHERE $sqlb" {} - make_test_case "SELECT $sqle FROM t1 WHERE NOT ($sqlb)" $ans - } - if {[regexp { \| } $sqle]} { - regsub -all { \| } $sqle { \& } sqle - regsub -all { \| } $tcle { \& } tcle - if {[catch {expr $tcle} ans]==0} { - if {$bans} { - make_test_case "SELECT $sqle FROM t1 WHERE $sqlb" $ans - } else { - make_test_case "SELECT $sqle FROM t1 WHERE NOT ($sqlb)" $ans - } - } - } -} - -# Terminate the test script -# -puts {finish_test} DELETED test/randexpr1.test Index: test/randexpr1.test ================================================================== --- test/randexpr1.test +++ /dev/null @@ -1,7832 +0,0 @@ -# 2008 December 16 -# -# 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. -# -# This file tests randomly generated SQL expressions. The expressions -# are generated by a TCL script. The same TCL script also computes the -# correct value of the expression. So, from one point of view, this -# file verifies the expression evaluation logic of SQLite against the -# expression evaluation logic of TCL. -# -# An early version of this script is how bug #3541 was detected. -# -# $Id: randexpr1.test,v 1.1 2008/12/15 16:33:30 drh Exp $ -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -# Create test data -# -do_test randexpr1-1.1 { - db eval { - CREATE TABLE t1(a,b,c,d,e,f); - INSERT INTO t1 VALUES(100,200,300,400,500,600); - SELECT * FROM t1 - } -} {100 200 300 400 500 600} - -do_test randexpr-2.1 { - db eval {SELECT coalesce((select 11 from t1 where 19 in (t1.b,+11,coalesce((select max((abs(17)/abs(t1.f))) from t1 where ((abs(t1.f)/abs(t1.b)) in (select case (min(t1.a | d*d)+(abs(count(*)-count(*)+ -count(*)*max( -t1.c))-max(f))) when -count(distinct 19) then ((count(*))) else max(13) end from t1 union select count(distinct b) from t1)) or 19 in (t1.a,t1.c,17)),17) | 17)),13) FROM t1 WHERE not not c=a-+(select case ~case -~+count(distinct (select count(distinct t1.a)*max(13) from t1))+max( -19*f)*max(f)*max(f)* -count(distinct d)-(count(distinct 11)) | max(t1.f)*count(*) when count(distinct b) then count(distinct t1.b) else -min(t1.f) end*cast(avg(11) AS integer) when max(t1.f) then max(c) else count(*) end from t1)+d} -} {} -do_test randexpr-2.2 { - db eval {SELECT coalesce((select 11 from t1 where 19 in (t1.b,+11,coalesce((select max((abs(17)/abs(t1.f))) from t1 where ((abs(t1.f)/abs(t1.b)) in (select case (min(t1.a | d*d)+(abs(count(*)-count(*)+ -count(*)*max( -t1.c))-max(f))) when -count(distinct 19) then ((count(*))) else max(13) end from t1 union select count(distinct b) from t1)) or 19 in (t1.a,t1.c,17)),17) | 17)),13) FROM t1 WHERE NOT (not not c=a-+(select case ~case -~+count(distinct (select count(distinct t1.a)*max(13) from t1))+max( -19*f)*max(f)*max(f)* -count(distinct d)-(count(distinct 11)) | max(t1.f)*count(*) when count(distinct b) then count(distinct t1.b) else -min(t1.f) end*cast(avg(11) AS integer) when max(t1.f) then max(c) else count(*) end from t1)+d)} -} {13} -do_test randexpr-2.3 { - db eval {SELECT coalesce((select 11 from t1 where 19 in (t1.b,+11,coalesce((select max((abs(17)/abs(t1.f))) from t1 where ((abs(t1.f)/abs(t1.b)) in (select case (min(t1.a & d*d)+(abs(count(*)-count(*)+ -count(*)*max( -t1.c))-max(f))) when -count(distinct 19) then ((count(*))) else max(13) end from t1 union select count(distinct b) from t1)) or 19 in (t1.a,t1.c,17)),17) & 17)),13) FROM t1 WHERE NOT (not not c=a-+(select case ~case -~+count(distinct (select count(distinct t1.a)*max(13) from t1))+max( -19*f)*max(f)*max(f)* -count(distinct d)-(count(distinct 11)) | max(t1.f)*count(*) when count(distinct b) then count(distinct t1.b) else -min(t1.f) end*cast(avg(11) AS integer) when max(t1.f) then max(c) else count(*) end from t1)+d)} -} {13} -do_test randexpr-2.4 { - db eval {SELECT t1.c*19-t1.f*19+coalesce((select 17 from t1 where e in (f,case (select cast(avg(t1.a) AS integer) from t1)-t1.d when coalesce((select +case when not exists(select 1 from t1 where 17<>t1.f and ((a))=a) and t1.b between f and 13),t1.a))+case abs(+(max(19))) | count(distinct t1.e) | count(distinct 19) when count(*) then (max(a)) else count(distinct d) end from t1 union select (count(*)) from t1) and t1.b>=19 then d when t1.b in (select d from t1 union select c from t1) then t1.e else a end} -} {-2900} -do_test randexpr-2.5 { - db eval {SELECT t1.c*19-t1.f*19+coalesce((select 17 from t1 where e in (f,case (select cast(avg(t1.a) AS integer) from t1)-t1.d when coalesce((select +case when not exists(select 1 from t1 where 17<>t1.f and ((a))=a) and t1.b between f and 13),t1.a))+case abs(+(max(19))) | count(distinct t1.e) | count(distinct 19) when count(*) then (max(a)) else count(distinct d) end from t1 union select (count(*)) from t1) and t1.b>=19 then d when t1.b in (select d from t1 union select c from t1) then t1.e else a end)} -} {} -do_test randexpr-2.6 { - db eval {SELECT case when case when not exists(select 1 from t1 where e not in (~t1.d,+case when t1.cd) then 17 else t1.e end in (a,t1.e,17) or (not exists(select 1 from t1 where a in (f,t1.c,t1.a))) then 11 else 13 end FROM t1 WHERE t1.bd) then 17 else t1.e end in (a,t1.e,17) or (not exists(select 1 from t1 where a in (f,t1.c,t1.a))) then 11 else 13 end FROM t1 WHERE NOT (t1.bd) then 17 else t1.e end in (a,t1.e,17) or (not exists(select 1 from t1 where a in (f,t1.c,t1.a))) then 11 else 13 end FROM t1 WHERE t1.bb), -11) | f+t1.f not in (((c)),b,13))),f) FROM t1 WHERE case when 19+c>=t1.a then t1.c when not case when not exists(select 1 from t1 where +f | b*b*19+19*13-a | case when t1.e not in (t1.f,t1.c,b) then 11 when 17>t1.c then a else e end<>e) then b when 17=t1.e then b else e end<>t1.b then a else d end-t1.b=(13)} -} {} -do_test randexpr-2.10 { - db eval {SELECT coalesce((select max(11- -19-f-t1.b+a) from t1 where exists(select 1 from t1 where 11-~(d)-c*a*~t1.a-t1.e-t1.e+coalesce((select coalesce((select t1.c from t1 where case (c) when d then e else 11 end=t1.f),t1.d) from t1 where (t1.d)>b), -11) | f+t1.f not in (((c)),b,13))),f) FROM t1 WHERE NOT (case when 19+c>=t1.a then t1.c when not case when not exists(select 1 from t1 where +f | b*b*19+19*13-a | case when t1.e not in (t1.f,t1.c,b) then 11 when 17>t1.c then a else e end<>e) then b when 17=t1.e then b else e end<>t1.b then a else d end-t1.b=(13))} -} {-670} -do_test randexpr-2.11 { - db eval {SELECT coalesce((select max(11- -19-f-t1.b+a) from t1 where exists(select 1 from t1 where 11-~(d)-c*a*~t1.a-t1.e-t1.e+coalesce((select coalesce((select t1.c from t1 where case (c) when d then e else 11 end=t1.f),t1.d) from t1 where (t1.d)>b), -11) & f+t1.f not in (((c)),b,13))),f) FROM t1 WHERE NOT (case when 19+c>=t1.a then t1.c when not case when not exists(select 1 from t1 where +f | b*b*19+19*13-a | case when t1.e not in (t1.f,t1.c,b) then 11 when 17>t1.c then a else e end<>e) then b when 17=t1.e then b else e end<>t1.b then a else d end-t1.b=(13))} -} {-670} -do_test randexpr-2.12 { - db eval {SELECT (abs(17)/abs(~case when (abs(t1.c* -(abs(case b | coalesce((select max(17*e*case when 11 in (select t1.b from t1 union select t1.c from t1) then 19 when d between f and t1.e then t1.e else t1.e end | b) from t1 where (13 not in (11,t1.d,e))),e)*a*d when 11 then e else d end*17)/abs(19)))/abs(t1.e))<>e then t1.b else t1.d end*(19))) FROM t1 WHERE exists(select 1 from t1 where t1.d+11 in (case t1.b++c when +a*(+case (select count(*) from t1) when 19 then t1.c else a end) then t1.a else case when (t1.b> -d) and not exists(select 1 from t1 where not exists(select 1 from t1 where (abs(f)/abs( -f*a+c*11))<>a)) then 13 else 19 end end,17,a)) or c=t1.d} -} {} -do_test randexpr-2.13 { - db eval {SELECT (abs(17)/abs(~case when (abs(t1.c* -(abs(case b | coalesce((select max(17*e*case when 11 in (select t1.b from t1 union select t1.c from t1) then 19 when d between f and t1.e then t1.e else t1.e end | b) from t1 where (13 not in (11,t1.d,e))),e)*a*d when 11 then e else d end*17)/abs(19)))/abs(t1.e))<>e then t1.b else t1.d end*(19))) FROM t1 WHERE NOT (exists(select 1 from t1 where t1.d+11 in (case t1.b++c when +a*(+case (select count(*) from t1) when 19 then t1.c else a end) then t1.a else case when (t1.b> -d) and not exists(select 1 from t1 where not exists(select 1 from t1 where (abs(f)/abs( -f*a+c*11))<>a)) then 13 else 19 end end,17,a)) or c=t1.d)} -} {0} -do_test randexpr-2.14 { - db eval {SELECT (abs(17)/abs(~case when (abs(t1.c* -(abs(case b & coalesce((select max(17*e*case when 11 in (select t1.b from t1 union select t1.c from t1) then 19 when d between f and t1.e then t1.e else t1.e end & b) from t1 where (13 not in (11,t1.d,e))),e)*a*d when 11 then e else d end*17)/abs(19)))/abs(t1.e))<>e then t1.b else t1.d end*(19))) FROM t1 WHERE NOT (exists(select 1 from t1 where t1.d+11 in (case t1.b++c when +a*(+case (select count(*) from t1) when 19 then t1.c else a end) then t1.a else case when (t1.b> -d) and not exists(select 1 from t1 where not exists(select 1 from t1 where (abs(f)/abs( -f*a+c*11))<>a)) then 13 else 19 end end,17,a)) or c=t1.d)} -} {0} -do_test randexpr-2.15 { - db eval {SELECT coalesce((select t1.c from t1 where e not between 19 and b*d or not exists(select 1 from t1 where t1.a not in (case when d not between b+~(t1.d)-case when ((t1.f<=t1.e) and -11e),17))/abs( - -17)) then 17 else t1.d end-t1.b-d) | -f,c)) then 11-t1.f when ( -1313 or t1.e in (select (count(*)) from t1 union select cast(avg(t1.e) AS integer) from t1) or 19>17 and 13 not between 19 and 17 then (t1.f) when not t1.b<>t1.f or d<>b then t1.e else a end and c} -} {} -do_test randexpr-2.20 { - db eval {SELECT case when (a not in (t1.e,(+case when t1.b<=(abs(coalesce((select max(a+(select count(distinct (select max(((abs( -t1.d)/abs(a))) | t1.c)*min(t1.e) from t1)) from t1)) from t1 where +t1.f>e),17))/abs( - -17)) then 17 else t1.d end-t1.b-d) | -f,c)) then 11-t1.f when ( -1313 or t1.e in (select (count(*)) from t1 union select cast(avg(t1.e) AS integer) from t1) or 19>17 and 13 not between 19 and 17 then (t1.f) when not t1.b<>t1.f or d<>b then t1.e else a end and c)} -} {-589} -do_test randexpr-2.21 { - db eval {SELECT case when (a not in (t1.e,(+case when t1.b<=(abs(coalesce((select max(a+(select count(distinct (select max(((abs( -t1.d)/abs(a))) & t1.c)*min(t1.e) from t1)) from t1)) from t1 where +t1.f>e),17))/abs( - -17)) then 17 else t1.d end-t1.b-d) & -f,c)) then 11-t1.f when ( -1313 or t1.e in (select (count(*)) from t1 union select cast(avg(t1.e) AS integer) from t1) or 19>17 and 13 not between 19 and 17 then (t1.f) when not t1.b<>t1.f or d<>b then t1.e else a end and c)} -} {-589} -do_test randexpr-2.22 { - db eval {SELECT t1.a | case when e in (select (13) from t1 union select d from t1) then (17) when c*~case (17) when coalesce((select max(case when case when 19 in (13,t1.f,11) then t1.b else t1.b end | 11>t1.a then 11 else t1.b end-b) from t1 where (13 not in (a,19,b)) and t1.a not between -11 and t1.f),f) then e else t1.c end | a in (select 11 from t1 union select t1.d from t1) then 17 else t1.a end | f FROM t1 WHERE coalesce((select t1.a*t1.a from t1 where ~ -(abs((select abs(count(*))-count(distinct t1.d*11) from t1)*+b)/abs(~t1.c))+c not in (coalesce((select ~13*t1.a from t1 where f+(abs(d* -t1.f)/abs(t1.c))<=t1.b or not t1.a<=t1.c),t1.c),e,(t1.e))),(a))+11<>11} -} {636} -do_test randexpr-2.23 { - db eval {SELECT t1.a | case when e in (select (13) from t1 union select d from t1) then (17) when c*~case (17) when coalesce((select max(case when case when 19 in (13,t1.f,11) then t1.b else t1.b end | 11>t1.a then 11 else t1.b end-b) from t1 where (13 not in (a,19,b)) and t1.a not between -11 and t1.f),f) then e else t1.c end | a in (select 11 from t1 union select t1.d from t1) then 17 else t1.a end | f FROM t1 WHERE NOT (coalesce((select t1.a*t1.a from t1 where ~ -(abs((select abs(count(*))-count(distinct t1.d*11) from t1)*+b)/abs(~t1.c))+c not in (coalesce((select ~13*t1.a from t1 where f+(abs(d* -t1.f)/abs(t1.c))<=t1.b or not t1.a<=t1.c),t1.c),e,(t1.e))),(a))+11<>11)} -} {} -do_test randexpr-2.24 { - db eval {SELECT t1.a & case when e in (select (13) from t1 union select d from t1) then (17) when c*~case (17) when coalesce((select max(case when case when 19 in (13,t1.f,11) then t1.b else t1.b end & 11>t1.a then 11 else t1.b end-b) from t1 where (13 not in (a,19,b)) and t1.a not between -11 and t1.f),f) then e else t1.c end & a in (select 11 from t1 union select t1.d from t1) then 17 else t1.a end & f FROM t1 WHERE coalesce((select t1.a*t1.a from t1 where ~ -(abs((select abs(count(*))-count(distinct t1.d*11) from t1)*+b)/abs(~t1.c))+c not in (coalesce((select ~13*t1.a from t1 where f+(abs(d* -t1.f)/abs(t1.c))<=t1.b or not t1.a<=t1.c),t1.c),e,(t1.e))),(a))+11<>11} -} {64} -do_test randexpr-2.25 { - db eval {SELECT c*coalesce((select ~19-e from t1 where not exists(select 1 from t1 where case when t1.b<>(d) then case when exists(select 1 from t1 where not exists(select 1 from t1 where case t1.e when e*(11) then 13 else 11 end in (select t1.a from t1 union select 13 from t1))) then coalesce((select case when f in (select t1.c from t1 union select (t1.b) from t1) then f else a end from t1 where t1.f not between 17 and f), -f) else 11 end else (a) end*d not in (e,t1.c,t1.e))),t1.e)-a FROM t1 WHERE 19+(select cast(avg((abs(t1.d)/abs(coalesce((select max(+b-(t1.e+b+ -c)*19) from t1 where 11 not between t1.b and f), -17)))*(11)) AS integer) from t1)*f in (select count(*) from t1 union select case max(t1.d)-( -min(t1.d)*(+max(e))) when max(t1.a) then cast(avg(t1.d) AS integer)-(count(distinct t1.f))-( -cast(avg(f) AS integer)) else max(t1.e) end from t1)} -} {} -do_test randexpr-2.26 { - db eval {SELECT c*coalesce((select ~19-e from t1 where not exists(select 1 from t1 where case when t1.b<>(d) then case when exists(select 1 from t1 where not exists(select 1 from t1 where case t1.e when e*(11) then 13 else 11 end in (select t1.a from t1 union select 13 from t1))) then coalesce((select case when f in (select t1.c from t1 union select (t1.b) from t1) then f else a end from t1 where t1.f not between 17 and f), -f) else 11 end else (a) end*d not in (e,t1.c,t1.e))),t1.e)-a FROM t1 WHERE NOT (19+(select cast(avg((abs(t1.d)/abs(coalesce((select max(+b-(t1.e+b+ -c)*19) from t1 where 11 not between t1.b and f), -17)))*(11)) AS integer) from t1)*f in (select count(*) from t1 union select case max(t1.d)-( -min(t1.d)*(+max(e))) when max(t1.a) then cast(avg(t1.d) AS integer)-(count(distinct t1.f))-( -cast(avg(f) AS integer)) else max(t1.e) end from t1))} -} {149900} -do_test randexpr-2.27 { - db eval {SELECT (abs((select (case abs(min(t1.f)) | count(distinct e) when (~+count(*)+max(e)++abs(cast(avg(~19) AS integer))) then +cast(avg(c) AS integer) else ~ -max(+t1.b)+~max(19)*count(distinct a)*min(17) | max(t1.d) end) from t1))/abs(~c+(select -(count(distinct t1.e)) from t1)-11+t1.e)) FROM t1 WHERE 11>=t1.f} -} {} -do_test randexpr-2.28 { - db eval {SELECT (abs((select (case abs(min(t1.f)) | count(distinct e) when (~+count(*)+max(e)++abs(cast(avg(~19) AS integer))) then +cast(avg(c) AS integer) else ~ -max(+t1.b)+~max(19)*count(distinct a)*min(17) | max(t1.d) end) from t1))/abs(~c+(select -(count(distinct t1.e)) from t1)-11+t1.e)) FROM t1 WHERE NOT (11>=t1.f)} -} {0} -do_test randexpr-2.29 { - db eval {SELECT (abs((select (case abs(min(t1.f)) & count(distinct e) when (~+count(*)+max(e)++abs(cast(avg(~19) AS integer))) then +cast(avg(c) AS integer) else ~ -max(+t1.b)+~max(19)*count(distinct a)*min(17) & max(t1.d) end) from t1))/abs(~c+(select -(count(distinct t1.e)) from t1)-11+t1.e)) FROM t1 WHERE NOT (11>=t1.f)} -} {1} -do_test randexpr-2.30 { - db eval {SELECT (select +count(distinct case when 11=a or e<+t1.f+t1.c and not exists(select 1 from t1 where not t1.a-t1.b=~a and f<=coalesce((select max((e)) from t1 where +t1.f>=b),t1.d)*13) and t1.c>t1.e and t1.a<17 then f when a=b),t1.d)*13) and t1.c>t1.e and t1.a<17 then f when a(c)),b)*t1.b-t1.b) then d else t1.e end | f* -13-c) from t1) from t1 where not ~aa} -} {} -do_test randexpr-2.33 { - db eval {SELECT coalesce((select (select max(t1.a)*(max(a))*max(t1.f*~11*case when b not in ((select min(19) from t1),b,coalesce((select max((t1.f)) from t1 where t1.c in (c,t1.b,(t1.f)) or t1.a<>(c)),b)*t1.b-t1.b) then d else t1.e end | f* -13-c) from t1) from t1 where not ~aa)} -} {581} -do_test randexpr-2.34 { - db eval {SELECT coalesce((select (select max(t1.a)*(max(a))*max(t1.f*~11*case when b not in ((select min(19) from t1),b,coalesce((select max((t1.f)) from t1 where t1.c in (c,t1.b,(t1.f)) or t1.a<>(c)),b)*t1.b-t1.b) then d else t1.e end & f* -13-c) from t1) from t1 where not ~aa)} -} {581} -do_test randexpr-2.35 { - db eval {SELECT case when t1.d not in (t1.d,coalesce((select max(11) from t1 where f not between 13 and c-coalesce((select max(d) from t1 where 19 not in ((t1.f),f,11)),t1.d)*t1.e | a),13), -(t1.e)) then t1.b when t1.f=t1.a and exists(select 1 from t1 where b in (select c from t1 union select 11 from t1) and t1.c=b and not -d in (t1.d,t1.d,t1.b) and d between 11 and c) or d<=17 or a not in (e,19,(t1.b)) then 17 else 11 end FROM t1 WHERE a<>f+f} -} {17} -do_test randexpr-2.36 { - db eval {SELECT case when t1.d not in (t1.d,coalesce((select max(11) from t1 where f not between 13 and c-coalesce((select max(d) from t1 where 19 not in ((t1.f),f,11)),t1.d)*t1.e | a),13), -(t1.e)) then t1.b when t1.f=t1.a and exists(select 1 from t1 where b in (select c from t1 union select 11 from t1) and t1.c=b and not -d in (t1.d,t1.d,t1.b) and d between 11 and c) or d<=17 or a not in (e,19,(t1.b)) then 17 else 11 end FROM t1 WHERE NOT (a<>f+f)} -} {} -do_test randexpr-2.37 { - db eval {SELECT case when t1.d not in (t1.d,coalesce((select max(11) from t1 where f not between 13 and c-coalesce((select max(d) from t1 where 19 not in ((t1.f),f,11)),t1.d)*t1.e & a),13), -(t1.e)) then t1.b when t1.f=t1.a and exists(select 1 from t1 where b in (select c from t1 union select 11 from t1) and t1.c=b and not -d in (t1.d,t1.d,t1.b) and d between 11 and c) or d<=17 or a not in (e,19,(t1.b)) then 17 else 11 end FROM t1 WHERE a<>f+f} -} {17} -do_test randexpr-2.38 { - db eval {SELECT case 13 when coalesce((select t1.a*d+++b | b+(abs(t1.e)/abs(c))+(select count(*) from t1) from t1 where not exists(select 1 from t1 where 17 in (select d from t1 union select t1.f from t1))),t1.b) then ~t1.c-(select case min(case when 17 not in (19,19,t1.c) then c when 13 between (19) and t1.e then e else 19 end-19) when cast(avg( -11) AS integer) then max(t1.c)* -min(t1.d) else (count(distinct t1.f)) end from t1) | +t1.f else t1.c end FROM t1 WHERE coalesce((select max(t1.c) from t1 where (abs(t1.b)/abs(a))>=(e)),+ -case when (11<17) then t1.a when t1.a*e=19* -11 and not exists(select 1 from t1 where -t1.d not between coalesce((select a from t1 where -t1.c>t1.e), -19) and t1.d and not exists(select 1 from t1 where (t1.e) in (select d from t1 union select t1.c from t1))) then c else a end*a)-t1.b* -(b) in (e,d,b)} -} {} -do_test randexpr-2.39 { - db eval {SELECT case 13 when coalesce((select t1.a*d+++b | b+(abs(t1.e)/abs(c))+(select count(*) from t1) from t1 where not exists(select 1 from t1 where 17 in (select d from t1 union select t1.f from t1))),t1.b) then ~t1.c-(select case min(case when 17 not in (19,19,t1.c) then c when 13 between (19) and t1.e then e else 19 end-19) when cast(avg( -11) AS integer) then max(t1.c)* -min(t1.d) else (count(distinct t1.f)) end from t1) | +t1.f else t1.c end FROM t1 WHERE NOT (coalesce((select max(t1.c) from t1 where (abs(t1.b)/abs(a))>=(e)),+ -case when (11<17) then t1.a when t1.a*e=19* -11 and not exists(select 1 from t1 where -t1.d not between coalesce((select a from t1 where -t1.c>t1.e), -19) and t1.d and not exists(select 1 from t1 where (t1.e) in (select d from t1 union select t1.c from t1))) then c else a end*a)-t1.b* -(b) in (e,d,b))} -} {300} -do_test randexpr-2.40 { - db eval {SELECT case 13 when coalesce((select t1.a*d+++b & b+(abs(t1.e)/abs(c))+(select count(*) from t1) from t1 where not exists(select 1 from t1 where 17 in (select d from t1 union select t1.f from t1))),t1.b) then ~t1.c-(select case min(case when 17 not in (19,19,t1.c) then c when 13 between (19) and t1.e then e else 19 end-19) when cast(avg( -11) AS integer) then max(t1.c)* -min(t1.d) else (count(distinct t1.f)) end from t1) & +t1.f else t1.c end FROM t1 WHERE NOT (coalesce((select max(t1.c) from t1 where (abs(t1.b)/abs(a))>=(e)),+ -case when (11<17) then t1.a when t1.a*e=19* -11 and not exists(select 1 from t1 where -t1.d not between coalesce((select a from t1 where -t1.c>t1.e), -19) and t1.d and not exists(select 1 from t1 where (t1.e) in (select d from t1 union select t1.c from t1))) then c else a end*a)-t1.b* -(b) in (e,d,b))} -} {300} -do_test randexpr-2.41 { - db eval {SELECT case when not exists(select 1 from t1 where ( -case when b in ((11),coalesce((select f from t1 where (not exists(select 1 from t1 where coalesce((select (t1.a) from t1 where e<=a),11) in (select t1.f from t1 union select 13 from t1)) or t1.a>d)),t1.a),t1.e) or not not exists(select 1 from t1 where (t1.f<=(t1.a))) then e*t1.a else t1.c end)<=d and not (t1.e)>=t1.e) then coalesce((select max( -t1.e) from t1 where t1.d between t1.b and t1.c),t1.d) else t1.c end+13*13 FROM t1 WHERE t1.b=t1.f | 19+coalesce((select max(a) from t1 where case t1.e when case when (11<=11 | t1.f and b>=b or t1.f<=a) then case when c between t1.e and b then e else +t1.f end else -t1.c end then t1.b else 13 end*13 between t1.f and c and exists(select 1 from t1 where (b not between 11 and a)) and f>=t1.b), -t1.b)-c} -} {} -do_test randexpr-2.42 { - db eval {SELECT case when not exists(select 1 from t1 where ( -case when b in ((11),coalesce((select f from t1 where (not exists(select 1 from t1 where coalesce((select (t1.a) from t1 where e<=a),11) in (select t1.f from t1 union select 13 from t1)) or t1.a>d)),t1.a),t1.e) or not not exists(select 1 from t1 where (t1.f<=(t1.a))) then e*t1.a else t1.c end)<=d and not (t1.e)>=t1.e) then coalesce((select max( -t1.e) from t1 where t1.d between t1.b and t1.c),t1.d) else t1.c end+13*13 FROM t1 WHERE NOT (t1.b=t1.f | 19+coalesce((select max(a) from t1 where case t1.e when case when (11<=11 | t1.f and b>=b or t1.f<=a) then case when c between t1.e and b then e else +t1.f end else -t1.c end then t1.b else 13 end*13 between t1.f and c and exists(select 1 from t1 where (b not between 11 and a)) and f>=t1.b), -t1.b)-c)} -} {569} -do_test randexpr-2.43 { - db eval {SELECT coalesce((select c from t1 where t1.a=case when a=t1.b+~(select case cast(avg( -b*13) AS integer) when max(f*13* -c) then (cast(avg(t1.d) AS integer)) else count(distinct t1.e*c) end from t1) then t1.d | t1.a else case when t1.a-b not between e and -t1.c* -13 then 19 else d end end),d) | t1.d FROM t1 WHERE +13 in (f,t1.f+t1.f, -coalesce((select max(t1.f) from t1 where (t1.a-13)<=(case (select count(*) from t1) when 13 then -+t1.e | -(coalesce((select max(~coalesce((select ( -13) from t1 where -c<(11) or 11 between a and t1.d),13)*t1.d) from t1 where d not between b and 13),19))*t1.a else 13 end-b-c)),t1.e)-19)} -} {} -do_test randexpr-2.44 { - db eval {SELECT coalesce((select c from t1 where t1.a=case when a=t1.b+~(select case cast(avg( -b*13) AS integer) when max(f*13* -c) then (cast(avg(t1.d) AS integer)) else count(distinct t1.e*c) end from t1) then t1.d | t1.a else case when t1.a-b not between e and -t1.c* -13 then 19 else d end end),d) | t1.d FROM t1 WHERE NOT (+13 in (f,t1.f+t1.f, -coalesce((select max(t1.f) from t1 where (t1.a-13)<=(case (select count(*) from t1) when 13 then -+t1.e | -(coalesce((select max(~coalesce((select ( -13) from t1 where -c<(11) or 11 between a and t1.d),13)*t1.d) from t1 where d not between b and 13),19))*t1.a else 13 end-b-c)),t1.e)-19))} -} {400} -do_test randexpr-2.45 { - db eval {SELECT coalesce((select c from t1 where t1.a=case when a=t1.b+~(select case cast(avg( -b*13) AS integer) when max(f*13* -c) then (cast(avg(t1.d) AS integer)) else count(distinct t1.e*c) end from t1) then t1.d & t1.a else case when t1.a-b not between e and -t1.c* -13 then 19 else d end end),d) & t1.d FROM t1 WHERE NOT (+13 in (f,t1.f+t1.f, -coalesce((select max(t1.f) from t1 where (t1.a-13)<=(case (select count(*) from t1) when 13 then -+t1.e | -(coalesce((select max(~coalesce((select ( -13) from t1 where -c<(11) or 11 between a and t1.d),13)*t1.d) from t1 where d not between b and 13),19))*t1.a else 13 end-b-c)),t1.e)-19))} -} {400} -do_test randexpr-2.46 { - db eval {SELECT case ~11-13 when 11-d-case when t1.f*+a-t1.a-t1.f=t1.a then a when t1.f between 19-t1.a+coalesce((select a from t1 where e in (select case -max(t1.c) when count(*) then max(t1.d) else -(cast(avg((t1.e)) AS integer)) end from t1 union select (max(t1.b)) from t1)), -b) and e or ((11=t1.d then t1.b else a end+13+(t1.c) then a else -d end FROM t1 WHERE exists(select 1 from t1 where not exists(select 1 from t1 where (not +t1.b-~a*(d*t1.e | + -coalesce((select t1.c from t1 where t1.b*case t1.b when f then -a*b else e end<>a+t1.a),17))+e*t1.e*11 | t1.a not between 13 and -t1.a and b between d and -f)))} -} {-400} -do_test randexpr-2.47 { - db eval {SELECT case ~11-13 when 11-d-case when t1.f*+a-t1.a-t1.f=t1.a then a when t1.f between 19-t1.a+coalesce((select a from t1 where e in (select case -max(t1.c) when count(*) then max(t1.d) else -(cast(avg((t1.e)) AS integer)) end from t1 union select (max(t1.b)) from t1)), -b) and e or ((11=t1.d then t1.b else a end+13+(t1.c) then a else -d end FROM t1 WHERE NOT (exists(select 1 from t1 where not exists(select 1 from t1 where (not +t1.b-~a*(d*t1.e | + -coalesce((select t1.c from t1 where t1.b*case t1.b when f then -a*b else e end<>a+t1.a),17))+e*t1.e*11 | t1.a not between 13 and -t1.a and b between d and -f))))} -} {} -do_test randexpr-2.48 { - db eval {SELECT 11++(case 19 when t1.c-19-coalesce((select t1.b from t1 where e*19-t1.e<=+case when c in (select 19 | 17 from t1 union select 11 from t1) then (abs(a)/abs(19)) when a*t1.d>19 or (11) not in (b,t1.a,t1.a) then b else b end-11),f) then 13 else 11 end-t1.e*a) FROM t1 WHERE f in (17,t1.f | coalesce((select max(t1.e) from t1 where not 17 in (select f from t1 union select +17 from t1)),b+coalesce((select max(b) from t1 where 19 in (select case min(t1.d) when (count(*)) then min(d) else -min(d) end from t1 union select max(d) from t1)),f)*f-17+19),b) or d<=f or t1.f>=11 or t1.b<=11 or t1.c<=11 or t1.b<=b} -} {-49978} -do_test randexpr-2.49 { - db eval {SELECT 11++(case 19 when t1.c-19-coalesce((select t1.b from t1 where e*19-t1.e<=+case when c in (select 19 | 17 from t1 union select 11 from t1) then (abs(a)/abs(19)) when a*t1.d>19 or (11) not in (b,t1.a,t1.a) then b else b end-11),f) then 13 else 11 end-t1.e*a) FROM t1 WHERE NOT (f in (17,t1.f | coalesce((select max(t1.e) from t1 where not 17 in (select f from t1 union select +17 from t1)),b+coalesce((select max(b) from t1 where 19 in (select case min(t1.d) when (count(*)) then min(d) else -min(d) end from t1 union select max(d) from t1)),f)*f-17+19),b) or d<=f or t1.f>=11 or t1.b<=11 or t1.c<=11 or t1.b<=b)} -} {} -do_test randexpr-2.50 { - db eval {SELECT 11++(case 19 when t1.c-19-coalesce((select t1.b from t1 where e*19-t1.e<=+case when c in (select 19 & 17 from t1 union select 11 from t1) then (abs(a)/abs(19)) when a*t1.d>19 or (11) not in (b,t1.a,t1.a) then b else b end-11),f) then 13 else 11 end-t1.e*a) FROM t1 WHERE f in (17,t1.f | coalesce((select max(t1.e) from t1 where not 17 in (select f from t1 union select +17 from t1)),b+coalesce((select max(b) from t1 where 19 in (select case min(t1.d) when (count(*)) then min(d) else -min(d) end from t1 union select max(d) from t1)),f)*f-17+19),b) or d<=f or t1.f>=11 or t1.b<=11 or t1.c<=11 or t1.b<=b} -} {-49978} -do_test randexpr-2.51 { - db eval {SELECT -c-coalesce((select max(t1.a) from t1 where (a>17-t1.a) and (select abs(min(t1.a))*case abs(case (((min((t1.c))))+min(a)) when count(distinct f) then min(11) else count(distinct b) end) when min(t1.f) then (count(distinct t1.b)) else -count(*) end from t1)<>case d when +(select ((min(t1.a))) from t1)-(abs(c)/abs(f)) then b else 17 end+t1.c),coalesce((select t1.d from t1 where d>19),t1.a)) FROM t1 WHERE b+(coalesce((select max(a) from t1 where exists(select 1 from t1 where t1.b<=c-(select ~~max((abs(e)/abs(13 | (t1.e)-c-19))) from t1) or d in (select t1.b from t1 union select d from t1)) or 13 in (select cast(avg(19) AS integer) from t1 union select ( -cast(avg(19) AS integer) | count(*)*min(19)) from t1) or 19<=11),t1.c))-t1.d-c>f} -} {} -do_test randexpr-2.52 { - db eval {SELECT -c-coalesce((select max(t1.a) from t1 where (a>17-t1.a) and (select abs(min(t1.a))*case abs(case (((min((t1.c))))+min(a)) when count(distinct f) then min(11) else count(distinct b) end) when min(t1.f) then (count(distinct t1.b)) else -count(*) end from t1)<>case d when +(select ((min(t1.a))) from t1)-(abs(c)/abs(f)) then b else 17 end+t1.c),coalesce((select t1.d from t1 where d>19),t1.a)) FROM t1 WHERE NOT (b+(coalesce((select max(a) from t1 where exists(select 1 from t1 where t1.b<=c-(select ~~max((abs(e)/abs(13 | (t1.e)-c-19))) from t1) or d in (select t1.b from t1 union select d from t1)) or 13 in (select cast(avg(19) AS integer) from t1 union select ( -cast(avg(19) AS integer) | count(*)*min(19)) from t1) or 19<=11),t1.c))-t1.d-c>f)} -} {-400} -do_test randexpr-2.53 { - db eval {SELECT case when t1.b+coalesce((select max(a) from t1 where exists(select 1 from t1 where not not t1.d>19)),13) | case when f in (select a from t1 union select case when (a)<>t1.c then c when not exists(select 1 from t1 where t1.c not between 17 and -(t1.d)) then f else (11) end from t1) then t1.c when (not exists(select 1 from t1 where 17 not between t1.f and a)) and d=b then t1.c else d end<=19 and (t1.c<>c and (13) not between t1.d and t1.c) and a>= -b or 11>13 and c<>13 then -f else d end FROM t1 WHERE (case when (17 not in (f*11,+coalesce((select max(b-b) from t1 where t1.c+f not between 11 and t1.d),13),c)) or (t1.e in (select ~min(t1.f) from t1 union select ~count(*) from t1) and exists(select 1 from t1 where (not f>=19 and 17 not between a and t1.e)) or (e) not in (e,d,13) or t1.d>=f) then e when 17 between t1.c and 13 then case when 11<>19 then t1.d else t1.a end else b end in (select -t1.a from t1 union select a from t1))} -} {} -do_test randexpr-2.54 { - db eval {SELECT case when t1.b+coalesce((select max(a) from t1 where exists(select 1 from t1 where not not t1.d>19)),13) | case when f in (select a from t1 union select case when (a)<>t1.c then c when not exists(select 1 from t1 where t1.c not between 17 and -(t1.d)) then f else (11) end from t1) then t1.c when (not exists(select 1 from t1 where 17 not between t1.f and a)) and d=b then t1.c else d end<=19 and (t1.c<>c and (13) not between t1.d and t1.c) and a>= -b or 11>13 and c<>13 then -f else d end FROM t1 WHERE NOT ((case when (17 not in (f*11,+coalesce((select max(b-b) from t1 where t1.c+f not between 11 and t1.d),13),c)) or (t1.e in (select ~min(t1.f) from t1 union select ~count(*) from t1) and exists(select 1 from t1 where (not f>=19 and 17 not between a and t1.e)) or (e) not in (e,d,13) or t1.d>=f) then e when 17 between t1.c and 13 then case when 11<>19 then t1.d else t1.a end else b end in (select -t1.a from t1 union select a from t1)))} -} {400} -do_test randexpr-2.55 { - db eval {SELECT case when t1.b+coalesce((select max(a) from t1 where exists(select 1 from t1 where not not t1.d>19)),13) & case when f in (select a from t1 union select case when (a)<>t1.c then c when not exists(select 1 from t1 where t1.c not between 17 and -(t1.d)) then f else (11) end from t1) then t1.c when (not exists(select 1 from t1 where 17 not between t1.f and a)) and d=b then t1.c else d end<=19 and (t1.c<>c and (13) not between t1.d and t1.c) and a>= -b or 11>13 and c<>13 then -f else d end FROM t1 WHERE NOT ((case when (17 not in (f*11,+coalesce((select max(b-b) from t1 where t1.c+f not between 11 and t1.d),13),c)) or (t1.e in (select ~min(t1.f) from t1 union select ~count(*) from t1) and exists(select 1 from t1 where (not f>=19 and 17 not between a and t1.e)) or (e) not in (e,d,13) or t1.d>=f) then e when 17 between t1.c and 13 then case when 11<>19 then t1.d else t1.a end else b end in (select -t1.a from t1 union select a from t1)))} -} {400} -do_test randexpr-2.56 { - db eval {SELECT t1.e+case when d not between f and case when a in (select t1.c from t1 union select t1.e from t1) or coalesce((select 19 from t1 where 17<=t1.d or 19*t1.f*t1.b<>t1.d | t1.d | t1.a),t1.b)*case when (t1.a) in (t1.d,t1.a,a) then -c when 17<13 then t1.f else 17 end-t1.f*e not in (19,t1.d,17) then 19 else t1.e end then -b else t1.b end FROM t1 WHERE (coalesce((select t1.d-coalesce((select max(coalesce((select max(c+13) from t1 where ~13*t1.b in (select abs(abs(abs((cast(avg( -e) AS integer)))))- -count(distinct (13))*max(13) from t1 union select count(distinct 19) from t1)), -t1.f)) from t1 where exists(select 1 from t1 where 17 in (t1.b,13,b))),b)+d+t1.a from t1 where d not in (13,t1.b,b)),17) not between 11 and e or not 17 between d and d)} -} {300} -do_test randexpr-2.57 { - db eval {SELECT t1.e+case when d not between f and case when a in (select t1.c from t1 union select t1.e from t1) or coalesce((select 19 from t1 where 17<=t1.d or 19*t1.f*t1.b<>t1.d | t1.d | t1.a),t1.b)*case when (t1.a) in (t1.d,t1.a,a) then -c when 17<13 then t1.f else 17 end-t1.f*e not in (19,t1.d,17) then 19 else t1.e end then -b else t1.b end FROM t1 WHERE NOT ((coalesce((select t1.d-coalesce((select max(coalesce((select max(c+13) from t1 where ~13*t1.b in (select abs(abs(abs((cast(avg( -e) AS integer)))))- -count(distinct (13))*max(13) from t1 union select count(distinct 19) from t1)), -t1.f)) from t1 where exists(select 1 from t1 where 17 in (t1.b,13,b))),b)+d+t1.a from t1 where d not in (13,t1.b,b)),17) not between 11 and e or not 17 between d and d))} -} {} -do_test randexpr-2.58 { - db eval {SELECT t1.e+case when d not between f and case when a in (select t1.c from t1 union select t1.e from t1) or coalesce((select 19 from t1 where 17<=t1.d or 19*t1.f*t1.b<>t1.d & t1.d & t1.a),t1.b)*case when (t1.a) in (t1.d,t1.a,a) then -c when 17<13 then t1.f else 17 end-t1.f*e not in (19,t1.d,17) then 19 else t1.e end then -b else t1.b end FROM t1 WHERE (coalesce((select t1.d-coalesce((select max(coalesce((select max(c+13) from t1 where ~13*t1.b in (select abs(abs(abs((cast(avg( -e) AS integer)))))- -count(distinct (13))*max(13) from t1 union select count(distinct 19) from t1)), -t1.f)) from t1 where exists(select 1 from t1 where 17 in (t1.b,13,b))),b)+d+t1.a from t1 where d not in (13,t1.b,b)),17) not between 11 and e or not 17 between d and d)} -} {300} -do_test randexpr-2.59 { - db eval {SELECT coalesce((select max(t1.f*case when not exists(select 1 from t1 where exists(select 1 from t1 where (select count(distinct 11) from t1) between coalesce((select max(c) from t1 where t1.e=t1.a+17),a) and t1.b) or c not in (t1.e,19,t1.e)) then 13 when exists(select 1 from t1 where t1.a between 19 and -c) then coalesce((select coalesce((select max((( -d))) from t1 where 17 not in (t1.d,e,t1.e)),e) from t1 where c= -f),( -c)) else t1.f end) from t1 where not (11 between a and t1.e)),19) FROM t1 WHERE case c when case when (exists(select 1 from t1 where t1.d<>coalesce((select 13 from t1 where (t1.b>+e)),(17))+coalesce((select 13 from t1 where exists(select 1 from t1 where 13 in (t1.b+c,case when f between t1.f and b then t1.b else f end,(11)))),f)-17-17)) then -c-(c) when 11 in (b,f,(t1.d)) then t1.c else t1.b end then t1.d else 11 end in (select -count(*) from t1 union select count(*) from t1)} -} {} -do_test randexpr-2.60 { - db eval {SELECT coalesce((select max(t1.f*case when not exists(select 1 from t1 where exists(select 1 from t1 where (select count(distinct 11) from t1) between coalesce((select max(c) from t1 where t1.e=t1.a+17),a) and t1.b) or c not in (t1.e,19,t1.e)) then 13 when exists(select 1 from t1 where t1.a between 19 and -c) then coalesce((select coalesce((select max((( -d))) from t1 where 17 not in (t1.d,e,t1.e)),e) from t1 where c= -f),( -c)) else t1.f end) from t1 where not (11 between a and t1.e)),19) FROM t1 WHERE NOT (case c when case when (exists(select 1 from t1 where t1.d<>coalesce((select 13 from t1 where (t1.b>+e)),(17))+coalesce((select 13 from t1 where exists(select 1 from t1 where 13 in (t1.b+c,case when f between t1.f and b then t1.b else f end,(11)))),f)-17-17)) then -c-(c) when 11 in (b,f,(t1.d)) then t1.c else t1.b end then t1.d else 11 end in (select -count(*) from t1 union select count(*) from t1))} -} {360000} -do_test randexpr-2.61 { - db eval {SELECT case when t1.a-coalesce((select t1.b from t1 where (d<=~a)),t1.b+t1.d | 19+13)-t1.a | ~coalesce((select ~17 from t1 where not exists(select 1 from t1 where ~case when 13 in (select +(cast(avg(b) AS integer)) from t1 union select count(*) from t1) then 17 when 11 not in (c,t1.a,t1.a) then e else e end*a not between 11 and c)),t1.c) in (11,t1.a,e) then t1.f when 19 in (select ~count(distinct d) from t1 union select cast(avg(19) AS integer) from t1) then t1.d else 19 end FROM t1 WHERE not exists(select 1 from t1 where (select count(*) from t1)+coalesce((select max(a) from t1 where t1.a between (abs(case when exists(select 1 from t1 where case when t1.e=case when 19 between 11 and e then t1.f else a end then t1.e else t1.b end in (select count(distinct d) | max(11)*abs(case count(*) when max(f) then cast(avg(e) AS integer) else count(distinct t1.e) end) from t1 union select -cast(avg(c) AS integer) from t1)) then (select -min(e) from t1) when (c>e) then t1.d else f end)/abs(b)) and (17)),e) not between t1.a and d)} -} {} -do_test randexpr-2.62 { - db eval {SELECT case when t1.a-coalesce((select t1.b from t1 where (d<=~a)),t1.b+t1.d | 19+13)-t1.a | ~coalesce((select ~17 from t1 where not exists(select 1 from t1 where ~case when 13 in (select +(cast(avg(b) AS integer)) from t1 union select count(*) from t1) then 17 when 11 not in (c,t1.a,t1.a) then e else e end*a not between 11 and c)),t1.c) in (11,t1.a,e) then t1.f when 19 in (select ~count(distinct d) from t1 union select cast(avg(19) AS integer) from t1) then t1.d else 19 end FROM t1 WHERE NOT (not exists(select 1 from t1 where (select count(*) from t1)+coalesce((select max(a) from t1 where t1.a between (abs(case when exists(select 1 from t1 where case when t1.e=case when 19 between 11 and e then t1.f else a end then t1.e else t1.b end in (select count(distinct d) | max(11)*abs(case count(*) when max(f) then cast(avg(e) AS integer) else count(distinct t1.e) end) from t1 union select -cast(avg(c) AS integer) from t1)) then (select -min(e) from t1) when (c>e) then t1.d else f end)/abs(b)) and (17)),e) not between t1.a and d))} -} {400} -do_test randexpr-2.63 { - db eval {SELECT case when t1.a-coalesce((select t1.b from t1 where (d<=~a)),t1.b+t1.d & 19+13)-t1.a & ~coalesce((select ~17 from t1 where not exists(select 1 from t1 where ~case when 13 in (select +(cast(avg(b) AS integer)) from t1 union select count(*) from t1) then 17 when 11 not in (c,t1.a,t1.a) then e else e end*a not between 11 and c)),t1.c) in (11,t1.a,e) then t1.f when 19 in (select ~count(distinct d) from t1 union select cast(avg(19) AS integer) from t1) then t1.d else 19 end FROM t1 WHERE NOT (not exists(select 1 from t1 where (select count(*) from t1)+coalesce((select max(a) from t1 where t1.a between (abs(case when exists(select 1 from t1 where case when t1.e=case when 19 between 11 and e then t1.f else a end then t1.e else t1.b end in (select count(distinct d) | max(11)*abs(case count(*) when max(f) then cast(avg(e) AS integer) else count(distinct t1.e) end) from t1 union select -cast(avg(c) AS integer) from t1)) then (select -min(e) from t1) when (c>e) then t1.d else f end)/abs(b)) and (17)),e) not between t1.a and d))} -} {400} -do_test randexpr-2.64 { - db eval {SELECT case when 11 in (select max(f) from t1 union select min(19++13) | min(t1.c) from t1) and (e in (select t1.d from t1 union select t1.a | 17*case e when coalesce((select max(a) from t1 where b not in (b,f,d) or t1.a<=f),11) then t1.a else t1.b end from t1) and -a not between b and d) then d when -t1.f=b or t1.b between -f and -d then 19 else d end+d FROM t1 WHERE case when (coalesce((select case (select max(t1.b) from t1) when (b* -t1.e+e*e-t1.a) then c else a end from t1 where 17 in (select min(t1.d)-abs(count(*)) from t1 union select count(distinct c) from t1)),t1.d)=(t1.d)) and e in (select -min(t1.b) from t1 union select count(distinct 11) from t1) and a< - -17 then t1.d | 11 else 19 end in (select 17 from t1 union select d from t1)} -} {} -do_test randexpr-2.65 { - db eval {SELECT case when 11 in (select max(f) from t1 union select min(19++13) | min(t1.c) from t1) and (e in (select t1.d from t1 union select t1.a | 17*case e when coalesce((select max(a) from t1 where b not in (b,f,d) or t1.a<=f),11) then t1.a else t1.b end from t1) and -a not between b and d) then d when -t1.f=b or t1.b between -f and -d then 19 else d end+d FROM t1 WHERE NOT (case when (coalesce((select case (select max(t1.b) from t1) when (b* -t1.e+e*e-t1.a) then c else a end from t1 where 17 in (select min(t1.d)-abs(count(*)) from t1 union select count(distinct c) from t1)),t1.d)=(t1.d)) and e in (select -min(t1.b) from t1 union select count(distinct 11) from t1) and a< - -17 then t1.d | 11 else 19 end in (select 17 from t1 union select d from t1))} -} {800} -do_test randexpr-2.66 { - db eval {SELECT case when 11 in (select max(f) from t1 union select min(19++13) & min(t1.c) from t1) and (e in (select t1.d from t1 union select t1.a & 17*case e when coalesce((select max(a) from t1 where b not in (b,f,d) or t1.a<=f),11) then t1.a else t1.b end from t1) and -a not between b and d) then d when -t1.f=b or t1.b between -f and -d then 19 else d end+d FROM t1 WHERE NOT (case when (coalesce((select case (select max(t1.b) from t1) when (b* -t1.e+e*e-t1.a) then c else a end from t1 where 17 in (select min(t1.d)-abs(count(*)) from t1 union select count(distinct c) from t1)),t1.d)=(t1.d)) and e in (select -min(t1.b) from t1 union select count(distinct 11) from t1) and a< - -17 then t1.d | 11 else 19 end in (select 17 from t1 union select d from t1))} -} {800} -do_test randexpr-2.67 { - db eval {SELECT (abs((select min(13) from t1))/abs(coalesce((select t1.e from t1 where coalesce((select t1.f from t1 where -11<=b-t1.c*case when (d)-t1.f+t1.e-13<>t1.b then 11 when exists(select 1 from t1 where t1.d<>((t1.b)) or t1.a not between d and 13) or t1.b<>t1.c then t1.e else -t1.d end+t1.a or t1.c not between f and d),e)<>e), -f))) FROM t1 WHERE t1.c<>(select min((abs(( -19-t1.b*13- -++~t1.f*d-17*19*11))/abs(17))) from t1)} -} {0} -do_test randexpr-2.68 { - db eval {SELECT (abs((select min(13) from t1))/abs(coalesce((select t1.e from t1 where coalesce((select t1.f from t1 where -11<=b-t1.c*case when (d)-t1.f+t1.e-13<>t1.b then 11 when exists(select 1 from t1 where t1.d<>((t1.b)) or t1.a not between d and 13) or t1.b<>t1.c then t1.e else -t1.d end+t1.a or t1.c not between f and d),e)<>e), -f))) FROM t1 WHERE NOT (t1.c<>(select min((abs(( -19-t1.b*13- -++~t1.f*d-17*19*11))/abs(17))) from t1))} -} {} -do_test randexpr-2.69 { - db eval {SELECT case d-case when c< -case when b<=f or coalesce((select t1.e from t1 where 11e then 19 when not exists(select 1 from t1 where not exists(select 1 from t1 where t1.d>=d)) then t1.f else 17 end then e when not exists(select 1 from t1 where d=b) then t1.c else f end when 17 then 19 else t1.f end FROM t1 WHERE coalesce((select max(+t1.d) from t1 where e<>e or not exists(select 1 from t1 where not exists(select 1 from t1 where (abs(f)/abs(f))++t1.b in (select case abs(cast(avg(e) AS integer)) when cast(avg(17) AS integer) | max(d) | cast(avg(t1.e) AS integer) | min(t1.e) then (cast(avg(19) AS integer)) else cast(avg(c) AS integer) end from t1 union select cast(avg(t1.f) AS integer) from t1))) and t1.a between t1.f and b or not 17<13 or -11= -t1.f or t1.f between c and 19),d)+(t1.d) not between b and e} -} {600} -do_test randexpr-2.70 { - db eval {SELECT case d-case when c< -case when b<=f or coalesce((select t1.e from t1 where 11e then 19 when not exists(select 1 from t1 where not exists(select 1 from t1 where t1.d>=d)) then t1.f else 17 end then e when not exists(select 1 from t1 where d=b) then t1.c else f end when 17 then 19 else t1.f end FROM t1 WHERE NOT (coalesce((select max(+t1.d) from t1 where e<>e or not exists(select 1 from t1 where not exists(select 1 from t1 where (abs(f)/abs(f))++t1.b in (select case abs(cast(avg(e) AS integer)) when cast(avg(17) AS integer) | max(d) | cast(avg(t1.e) AS integer) | min(t1.e) then (cast(avg(19) AS integer)) else cast(avg(c) AS integer) end from t1 union select cast(avg(t1.f) AS integer) from t1))) and t1.a between t1.f and b or not 17<13 or -11= -t1.f or t1.f between c and 19),d)+(t1.d) not between b and e)} -} {} -do_test randexpr-2.71 { - db eval {SELECT case when t1.e in (select abs(max(case a+case when t1.a>=e+ -c then a else t1.b end+t1.a when t1.f then 19 else -19 end)+abs( -count(distinct t1.c))+~(count(distinct t1.b)))-min(b) from t1 union select max(f) from t1) and case t1.e when -t1.c then 19 else b end=t1.e))) or c in (select f from t1 union select 13 from t1) and (b)< -t1.c and f in (select max(13) from t1 union select ~+abs(count(distinct e)*abs(((count(*)))*((max(f))))) from t1)} -} {} -do_test randexpr-2.72 { - db eval {SELECT case when t1.e in (select abs(max(case a+case when t1.a>=e+ -c then a else t1.b end+t1.a when t1.f then 19 else -19 end)+abs( -count(distinct t1.c))+~(count(distinct t1.b)))-min(b) from t1 union select max(f) from t1) and case t1.e when -t1.c then 19 else b end=t1.e))) or c in (select f from t1 union select 13 from t1) and (b)< -t1.c and f in (select max(13) from t1 union select ~+abs(count(distinct e)*abs(((count(*)))*((max(f))))) from t1))} -} {-19} -do_test randexpr-2.73 { - db eval {SELECT c*case when t1.a in (select ~count(*) from t1 union select -count(distinct ~case (abs(11)/abs(b-(coalesce((select 17-t1.a from t1 where not t1.d=t1.d),(abs(11)/abs(a)))))) when case when t1.d between 19 and c and t1.b between 11 and t1.a then 13 else (13) end then (13) else 19 end-19*13+11) from t1) then t1.a when t1.f<=t1.e then f else b end-19-c+f FROM t1 WHERE t1.b>=c+case when exists(select 1 from t1 where a>=+f- -c*e+coalesce((select max(b) from t1 where (b not between (t1.b) and 19) or t1.f<11),d)*f | t1.e+t1.b) then ( -t1.e)-19 when ((t1.a in (select 19 from t1 union select t1.f from t1) or b -17)) then f else f end | d} -} {} -do_test randexpr-2.74 { - db eval {SELECT c*case when t1.a in (select ~count(*) from t1 union select -count(distinct ~case (abs(11)/abs(b-(coalesce((select 17-t1.a from t1 where not t1.d=t1.d),(abs(11)/abs(a)))))) when case when t1.d between 19 and c and t1.b between 11 and t1.a then 13 else (13) end then (13) else 19 end-19*13+11) from t1) then t1.a when t1.f<=t1.e then f else b end-19-c+f FROM t1 WHERE NOT (t1.b>=c+case when exists(select 1 from t1 where a>=+f- -c*e+coalesce((select max(b) from t1 where (b not between (t1.b) and 19) or t1.f<11),d)*f | t1.e+t1.b) then ( -t1.e)-19 when ((t1.a in (select 19 from t1 union select t1.f from t1) or b -17)) then f else f end | d)} -} {60281} -do_test randexpr-2.75 { - db eval {SELECT (abs(case when a>=b then t1.c-case when not exists(select 1 from t1 where case d when +17 then 19+c else 11 end-(abs((select - -cast(avg(case when (11- -(abs(e)/abs(13))-t1.f11} -} {0} -do_test randexpr-2.76 { - db eval {SELECT (abs(case when a>=b then t1.c-case when not exists(select 1 from t1 where case d when +17 then 19+c else 11 end-(abs((select - -cast(avg(case when (11- -(abs(e)/abs(13))-t1.f11)} -} {} -do_test randexpr-2.77 { - db eval {SELECT -coalesce((select max(e-t1.b) from t1 where t1.e<11 and t1.b | e in ((abs(13)/abs(t1.b)),(abs((+17-case when t1.c | 13*(d) | b<>a or ((t1.e)>=a) then t1.b-t1.e when not exists(select 1 from t1 where 17<13) then -(13) else 17 end*13))/abs(13)),t1.c)),t1.e) | c FROM t1 WHERE not exists(select 1 from t1 where 17<=(select (case (~+abs(cast(avg((t1.e)-17 | b) AS integer))-((case -cast(avg(case when ~t1.b in (select d from t1 union select 19 from t1) then b when 13 in (t1.f,c,t1.b) then c else f end) AS integer)+count(distinct t1.f)+count(distinct t1.d) when count(*) then ((max(c))) else count(*) end)*cast(avg(t1.e) AS integer))) when ((cast(avg(a) AS integer))) then -max(d) else ((count(*))) end) from t1))} -} {-212} -do_test randexpr-2.78 { - db eval {SELECT -coalesce((select max(e-t1.b) from t1 where t1.e<11 and t1.b | e in ((abs(13)/abs(t1.b)),(abs((+17-case when t1.c | 13*(d) | b<>a or ((t1.e)>=a) then t1.b-t1.e when not exists(select 1 from t1 where 17<13) then -(13) else 17 end*13))/abs(13)),t1.c)),t1.e) | c FROM t1 WHERE NOT (not exists(select 1 from t1 where 17<=(select (case (~+abs(cast(avg((t1.e)-17 | b) AS integer))-((case -cast(avg(case when ~t1.b in (select d from t1 union select 19 from t1) then b when 13 in (t1.f,c,t1.b) then c else f end) AS integer)+count(distinct t1.f)+count(distinct t1.d) when count(*) then ((max(c))) else count(*) end)*cast(avg(t1.e) AS integer))) when ((cast(avg(a) AS integer))) then -max(d) else ((count(*))) end) from t1)))} -} {} -do_test randexpr-2.79 { - db eval {SELECT -coalesce((select max(e-t1.b) from t1 where t1.e<11 and t1.b & e in ((abs(13)/abs(t1.b)),(abs((+17-case when t1.c & 13*(d) & b<>a or ((t1.e)>=a) then t1.b-t1.e when not exists(select 1 from t1 where 17<13) then -(13) else 17 end*13))/abs(13)),t1.c)),t1.e) & c FROM t1 WHERE not exists(select 1 from t1 where 17<=(select (case (~+abs(cast(avg((t1.e)-17 | b) AS integer))-((case -cast(avg(case when ~t1.b in (select d from t1 union select 19 from t1) then b when 13 in (t1.f,c,t1.b) then c else f end) AS integer)+count(distinct t1.f)+count(distinct t1.d) when count(*) then ((max(c))) else count(*) end)*cast(avg(t1.e) AS integer))) when ((cast(avg(a) AS integer))) then -max(d) else ((count(*))) end) from t1))} -} {12} -do_test randexpr-2.80 { - db eval {SELECT 17-coalesce((select c+t1.f from t1 where (select count(distinct d)-abs(min((select case - -count(*) when -max(19) then -count(*) else count(*) end from t1))-count(*)) from t1)-t1.a+case when (abs(t1.e)/abs(t1.e)) not in (a,t1.a,19) and (b between 19 and -t1.c) then 17 else c end-19+t1.e*13<= -(t1.a)),11)-t1.d-c FROM t1 WHERE ((t1.d in ((select +cast(avg(coalesce((select max(coalesce((select max(a) from t1 where not a in (b,~(select ~count(*) from t1),case (select +max(11) | -count(*) from t1) when 17*t1.f*17 then b else (t1.b) end+f | 17)),e)) from t1 where not exists(select 1 from t1 where 17 between a and a)),(19))) AS integer) from t1),coalesce((select max(e) from t1 where t1.e<>11),b),t1.d)))} -} {-694} -do_test randexpr-2.81 { - db eval {SELECT 17-coalesce((select c+t1.f from t1 where (select count(distinct d)-abs(min((select case - -count(*) when -max(19) then -count(*) else count(*) end from t1))-count(*)) from t1)-t1.a+case when (abs(t1.e)/abs(t1.e)) not in (a,t1.a,19) and (b between 19 and -t1.c) then 17 else c end-19+t1.e*13<= -(t1.a)),11)-t1.d-c FROM t1 WHERE NOT (((t1.d in ((select +cast(avg(coalesce((select max(coalesce((select max(a) from t1 where not a in (b,~(select ~count(*) from t1),case (select +max(11) | -count(*) from t1) when 17*t1.f*17 then b else (t1.b) end+f | 17)),e)) from t1 where not exists(select 1 from t1 where 17 between a and a)),(19))) AS integer) from t1),coalesce((select max(e) from t1 where t1.e<>11),b),t1.d))))} -} {} -do_test randexpr-2.82 { - db eval {SELECT case (t1.a) when e then t1.a else t1.d end+(b)*t1.c | (select ~count(distinct (select count(distinct t1.f) from t1)) from t1)* -case c*t1.b when 19 then t1.d else (t1.b) | case when not (e)*f in (select count(distinct a)-count(distinct c) | min(a) from t1 union select -count(*) from t1) and (t1.f in (d, -t1.c,f)) then e when t1.c not in (t1.b,t1.e,b) then t1.e else f end end FROM t1 WHERE t1.d<>coalesce((select max(case when exists(select 1 from t1 where f<=e | b) then (select min(+t1.f) from t1) else 11 end) from t1 where +case when t1.e=c then -t1.c else t1.a end-t1.a-11-f in (select (case -min(a) when count(*)*(( -+abs(cast(avg(a) AS integer))*max((17))) | max(19)) then min(11) else min(a) end | count(distinct -d)) from t1 union select min(t1.e) from t1)),t1.c)} -} {60408} -do_test randexpr-2.83 { - db eval {SELECT case (t1.a) when e then t1.a else t1.d end+(b)*t1.c | (select ~count(distinct (select count(distinct t1.f) from t1)) from t1)* -case c*t1.b when 19 then t1.d else (t1.b) | case when not (e)*f in (select count(distinct a)-count(distinct c) | min(a) from t1 union select -count(*) from t1) and (t1.f in (d, -t1.c,f)) then e when t1.c not in (t1.b,t1.e,b) then t1.e else f end end FROM t1 WHERE NOT (t1.d<>coalesce((select max(case when exists(select 1 from t1 where f<=e | b) then (select min(+t1.f) from t1) else 11 end) from t1 where +case when t1.e=c then -t1.c else t1.a end-t1.a-11-f in (select (case -min(a) when count(*)*(( -+abs(cast(avg(a) AS integer))*max((17))) | max(19)) then min(11) else min(a) end | count(distinct -d)) from t1 union select min(t1.e) from t1)),t1.c))} -} {} -do_test randexpr-2.84 { - db eval {SELECT case (t1.a) when e then t1.a else t1.d end+(b)*t1.c & (select ~count(distinct (select count(distinct t1.f) from t1)) from t1)* -case c*t1.b when 19 then t1.d else (t1.b) & case when not (e)*f in (select count(distinct a)-count(distinct c) & min(a) from t1 union select -count(*) from t1) and (t1.f in (d, -t1.c,f)) then e when t1.c not in (t1.b,t1.e,b) then t1.e else f end end FROM t1 WHERE t1.d<>coalesce((select max(case when exists(select 1 from t1 where f<=e | b) then (select min(+t1.f) from t1) else 11 end) from t1 where +case when t1.e=c then -t1.c else t1.a end-t1.a-11-f in (select (case -min(a) when count(*)*(( -+abs(cast(avg(a) AS integer))*max((17))) | max(19)) then min(11) else min(a) end | count(distinct -d)) from t1 union select min(t1.e) from t1)),t1.c)} -} {384} -do_test randexpr-2.85 { - db eval {SELECT (select abs(max((select (case cast(avg(t1.a) AS integer) when +~abs(cast(avg( -17+case when t1.a in (c,(e),t1.f) and f in (c,t1.d,t1.a) then d when d between c and t1.d then f else e end) AS integer))-(abs(~max((b)))-min(t1.f)) then cast(avg(t1.f) AS integer) else count(*) end) from t1)+case when (exists(select 1 from t1 where t1.a in (select -max(e) from t1 union select -count(*) from t1)) or e in (t1.b*d,a, - -d)) then 17*t1.c else c end)) from t1) FROM t1 WHERE ~t1.e>case 13 when e then a else coalesce((select ~t1.d from t1 where exists(select 1 from t1 where t1.f between coalesce((select t1.a from t1 where ((select min(d-d- -t1.d+a) from t1)) not between f and t1.c or exists(select 1 from t1 where b<>17)),(a)) and -d) or not exists(select 1 from t1 where e in (select min(19)*(count(*))*cast(avg(11) AS integer) | min(b) from t1 union select (cast(avg(t1.e) AS integer)) from t1))),c) end-t1.c} -} {} -do_test randexpr-2.86 { - db eval {SELECT (select abs(max((select (case cast(avg(t1.a) AS integer) when +~abs(cast(avg( -17+case when t1.a in (c,(e),t1.f) and f in (c,t1.d,t1.a) then d when d between c and t1.d then f else e end) AS integer))-(abs(~max((b)))-min(t1.f)) then cast(avg(t1.f) AS integer) else count(*) end) from t1)+case when (exists(select 1 from t1 where t1.a in (select -max(e) from t1 union select -count(*) from t1)) or e in (t1.b*d,a, - -d)) then 17*t1.c else c end)) from t1) FROM t1 WHERE NOT (~t1.e>case 13 when e then a else coalesce((select ~t1.d from t1 where exists(select 1 from t1 where t1.f between coalesce((select t1.a from t1 where ((select min(d-d- -t1.d+a) from t1)) not between f and t1.c or exists(select 1 from t1 where b<>17)),(a)) and -d) or not exists(select 1 from t1 where e in (select min(19)*(count(*))*cast(avg(11) AS integer) | min(b) from t1 union select (cast(avg(t1.e) AS integer)) from t1))),c) end-t1.c)} -} {301} -do_test randexpr-2.87 { - db eval {SELECT t1.c+(abs(t1.b*t1.b)/abs(++t1.a-t1.e-(abs(t1.b)/abs(d))*11*t1.f)) | 19-b-t1.e | t1.e-+~t1.d*13+a+case case when (d)+17-c=d then a else t1.b end when e then t1.a else 19 end FROM t1 WHERE not coalesce((select (abs(case t1.b when coalesce((select case when exists(select 1 from t1 where f between 17 and f) then 11 else f end from t1 where not exists(select 1 from t1 where c>=t1.d)),17)*t1.a then t1.e else 13 end)/abs(17)) from t1 where ((13 in (select abs(~min(d)*count(distinct -(f)) | count(*)*cast(avg(11) AS integer)) from t1 union select count(*) from t1) and a<=13) and c<> -(t1.c))), -t1.a)*t1.e*f+d not in (11,d,t1.c)} -} {} -do_test randexpr-2.88 { - db eval {SELECT t1.c+(abs(t1.b*t1.b)/abs(++t1.a-t1.e-(abs(t1.b)/abs(d))*11*t1.f)) | 19-b-t1.e | t1.e-+~t1.d*13+a+case case when (d)+17-c=d then a else t1.b end when e then t1.a else 19 end FROM t1 WHERE NOT (not coalesce((select (abs(case t1.b when coalesce((select case when exists(select 1 from t1 where f between 17 and f) then 11 else f end from t1 where not exists(select 1 from t1 where c>=t1.d)),17)*t1.a then t1.e else 13 end)/abs(17)) from t1 where ((13 in (select abs(~min(d)*count(distinct -(f)) | count(*)*cast(avg(11) AS integer)) from t1 union select count(*) from t1) and a<=13) and c<> -(t1.c))), -t1.a)*t1.e*f+d not in (11,d,t1.c))} -} {-33} -do_test randexpr-2.89 { - db eval {SELECT t1.c+(abs(t1.b*t1.b)/abs(++t1.a-t1.e-(abs(t1.b)/abs(d))*11*t1.f)) & 19-b-t1.e & t1.e-+~t1.d*13+a+case case when (d)+17-c=d then a else t1.b end when e then t1.a else 19 end FROM t1 WHERE NOT (not coalesce((select (abs(case t1.b when coalesce((select case when exists(select 1 from t1 where f between 17 and f) then 11 else f end from t1 where not exists(select 1 from t1 where c>=t1.d)),17)*t1.a then t1.e else 13 end)/abs(17)) from t1 where ((13 in (select abs(~min(d)*count(distinct -(f)) | count(*)*cast(avg(11) AS integer)) from t1 union select count(*) from t1) and a<=13) and c<> -(t1.c))), -t1.a)*t1.e*f+d not in (11,d,t1.c))} -} {0} -do_test randexpr-2.90 { - db eval {SELECT case when t1.f>t1.d then (select abs(+count(distinct c)+(abs(min((abs(+11)/abs(b)))* -count(*)))) from t1)-t1.a when d+case when (select cast(avg(t1.f) AS integer)-count(distinct 19) from t1)<>17 then c when t1.e in (select cast(avg(t1.a) AS integer) from t1 union select count(distinct f) from t1) and d>t1.c and t1.f not in (11,19,t1.b) then a else (c) end+(17)=c then t1.d else t1.c end-c FROM t1 WHERE 13 not in (e,t1.b,+coalesce((select max(b) from t1 where 13*b-t1.d-case when 11>=a then t1.a-t1.d else (t1.d)*e+19 end*t1.a+19+(11) | t1.c*t1.a-17t1.d then (select abs(+count(distinct c)+(abs(min((abs(+11)/abs(b)))* -count(*)))) from t1)-t1.a when d+case when (select cast(avg(t1.f) AS integer)-count(distinct 19) from t1)<>17 then c when t1.e in (select cast(avg(t1.a) AS integer) from t1 union select count(distinct f) from t1) and d>t1.c and t1.f not in (11,19,t1.b) then a else (c) end+(17)=c then t1.d else t1.c end-c FROM t1 WHERE NOT (13 not in (e,t1.b,+coalesce((select max(b) from t1 where 13*b-t1.d-case when 11>=a then t1.a-t1.d else (t1.d)*e+19 end*t1.a+19+(11) | t1.c*t1.a-17(abs(t1.a)/abs(e)) then d else ~(t1.e)-e+d+13-t1.b+b*19 end) from t1 where (select max(19)-cast(avg(a) AS integer) from t1)> -t1.e),17)+e+t1.e-t1.c+(c))*17) from t1) between -17 and t1.c} -} {} -do_test randexpr-2.93 { - db eval {SELECT coalesce((select +19 from t1 where 19-c+t1.c-f not in (coalesce((select 19 from t1 where (t1.b between t1.c*t1.a*t1.b | a-e | 13-(abs(19)/abs((select max(t1.d | coalesce((select max( -t1.c) from t1 where b in (select e from t1 union select (f) from t1)),t1.d)+(e)) from t1)+c)) and f)),11),f,17)),f) FROM t1 WHERE NOT ((select count(distinct 11)+min((coalesce((select max(case when t1.d<>(abs(t1.a)/abs(e)) then d else ~(t1.e)-e+d+13-t1.b+b*19 end) from t1 where (select max(19)-cast(avg(a) AS integer) from t1)> -t1.e),17)+e+t1.e-t1.c+(c))*17) from t1) between -17 and t1.c)} -} {19} -do_test randexpr-2.94 { - db eval {SELECT coalesce((select +19 from t1 where 19-c+t1.c-f not in (coalesce((select 19 from t1 where (t1.b between t1.c*t1.a*t1.b & a-e & 13-(abs(19)/abs((select max(t1.d & coalesce((select max( -t1.c) from t1 where b in (select e from t1 union select (f) from t1)),t1.d)+(e)) from t1)+c)) and f)),11),f,17)),f) FROM t1 WHERE NOT ((select count(distinct 11)+min((coalesce((select max(case when t1.d<>(abs(t1.a)/abs(e)) then d else ~(t1.e)-e+d+13-t1.b+b*19 end) from t1 where (select max(19)-cast(avg(a) AS integer) from t1)> -t1.e),17)+e+t1.e-t1.c+(c))*17) from t1) between -17 and t1.c)} -} {19} -do_test randexpr-2.95 { - db eval {SELECT (case t1.a when (select (count(distinct t1.f)) from t1)-e then 11 else t1.c+17-f*~f | f+~e-a*t1.b+13 end | 13) FROM t1 WHERE (coalesce((select max(f) from t1 where (c+t1.f | (select count(distinct t1.d) from t1)>=coalesce((select b+(abs(case when t1.f>=(select case max(f) when max(19) then cast(avg(t1.a) AS integer) else count(distinct 13) end from t1) | t1.b and (a in (select (b) from t1 union select t1.b from t1)) then (a)-b when not exists(select 1 from t1 where c between t1.c and t1.a) then a else t1.a end)/abs(t1.b))- -f from t1 where b not in (t1.b,t1.f,c)),t1.d)-t1.d)), -17) between 13 and t1.f)} -} {-19491} -do_test randexpr-2.96 { - db eval {SELECT (case t1.a when (select (count(distinct t1.f)) from t1)-e then 11 else t1.c+17-f*~f | f+~e-a*t1.b+13 end | 13) FROM t1 WHERE NOT ((coalesce((select max(f) from t1 where (c+t1.f | (select count(distinct t1.d) from t1)>=coalesce((select b+(abs(case when t1.f>=(select case max(f) when max(19) then cast(avg(t1.a) AS integer) else count(distinct 13) end from t1) | t1.b and (a in (select (b) from t1 union select t1.b from t1)) then (a)-b when not exists(select 1 from t1 where c between t1.c and t1.a) then a else t1.a end)/abs(t1.b))- -f from t1 where b not in (t1.b,t1.f,c)),t1.d)-t1.d)), -17) between 13 and t1.f))} -} {} -do_test randexpr-2.97 { - db eval {SELECT (case t1.a when (select (count(distinct t1.f)) from t1)-e then 11 else t1.c+17-f*~f & f+~e-a*t1.b+13 end & 13) FROM t1 WHERE (coalesce((select max(f) from t1 where (c+t1.f | (select count(distinct t1.d) from t1)>=coalesce((select b+(abs(case when t1.f>=(select case max(f) when max(19) then cast(avg(t1.a) AS integer) else count(distinct 13) end from t1) | t1.b and (a in (select (b) from t1 union select t1.b from t1)) then (a)-b when not exists(select 1 from t1 where c between t1.c and t1.a) then a else t1.a end)/abs(t1.b))- -f from t1 where b not in (t1.b,t1.f,c)),t1.d)-t1.d)), -17) between 13 and t1.f)} -} {0} -do_test randexpr-2.98 { - db eval {SELECT case when ((select -abs(min(coalesce((select max(11 | t1.f) from t1 where coalesce((select f from t1 where e+c in (select 19 from t1 union select f from t1)),b) not in (t1.a,+case when 13>=t1.e then t1.a when 17 not in (t1.d,b,t1.e) then 13 else t1.b end-t1.e,t1.f)),t1.f))*count(*)*min(t1.c)) from t1)<17) and 13* -f+a not between (a) and f then c-11+b else 19 end FROM t1 WHERE e+case case when a<>c then (abs(case when coalesce((select (abs( -19+11)/abs(t1.c)) from t1 where (17) in (a,13,11) and 17 in (select 11 from t1 union select t1.f from t1)),t1.a) between t1.f and c then t1.d when not exists(select 1 from t1 where not exists(select 1 from t1 where 19=f)) then f else (b) end-19)/abs(e)) else 11 end when 17 then a else t1.f end-13 | e between -t1.e and 13} -} {} -do_test randexpr-2.99 { - db eval {SELECT case when ((select -abs(min(coalesce((select max(11 | t1.f) from t1 where coalesce((select f from t1 where e+c in (select 19 from t1 union select f from t1)),b) not in (t1.a,+case when 13>=t1.e then t1.a when 17 not in (t1.d,b,t1.e) then 13 else t1.b end-t1.e,t1.f)),t1.f))*count(*)*min(t1.c)) from t1)<17) and 13* -f+a not between (a) and f then c-11+b else 19 end FROM t1 WHERE NOT (e+case case when a<>c then (abs(case when coalesce((select (abs( -19+11)/abs(t1.c)) from t1 where (17) in (a,13,11) and 17 in (select 11 from t1 union select t1.f from t1)),t1.a) between t1.f and c then t1.d when not exists(select 1 from t1 where not exists(select 1 from t1 where 19=f)) then f else (b) end-19)/abs(e)) else 11 end when 17 then a else t1.f end-13 | e between -t1.e and 13)} -} {489} -do_test randexpr-2.100 { - db eval {SELECT case when ((select -abs(min(coalesce((select max(11 & t1.f) from t1 where coalesce((select f from t1 where e+c in (select 19 from t1 union select f from t1)),b) not in (t1.a,+case when 13>=t1.e then t1.a when 17 not in (t1.d,b,t1.e) then 13 else t1.b end-t1.e,t1.f)),t1.f))*count(*)*min(t1.c)) from t1)<17) and 13* -f+a not between (a) and f then c-11+b else 19 end FROM t1 WHERE NOT (e+case case when a<>c then (abs(case when coalesce((select (abs( -19+11)/abs(t1.c)) from t1 where (17) in (a,13,11) and 17 in (select 11 from t1 union select t1.f from t1)),t1.a) between t1.f and c then t1.d when not exists(select 1 from t1 where not exists(select 1 from t1 where 19=f)) then f else (b) end-19)/abs(e)) else 11 end when 17 then a else t1.f end-13 | e between -t1.e and 13)} -} {489} -do_test randexpr-2.101 { - db eval {SELECT case when t1.b-t1.e*c<>c then coalesce((select -17 from t1 where (t1.f+((select case count(*) when -cast(avg(19) AS integer)+count(distinct (t1.c)) | (cast(avg(19) AS integer))*max(t1.c)*count(*)-((count(*))) then cast(avg(b) AS integer) else (count(*)) end-min(a) from t1)) | case when t1.b | a in (select t1.a from t1 union select (select count(distinct e) from t1) from t1) then t1.e else b end+t1.a)c then coalesce((select -17 from t1 where (t1.f+((select case count(*) when -cast(avg(19) AS integer)+count(distinct (t1.c)) | (cast(avg(19) AS integer))*max(t1.c)*count(*)-((count(*))) then cast(avg(b) AS integer) else (count(*)) end-min(a) from t1)) | case when t1.b | a in (select t1.a from t1 union select (select count(distinct e) from t1) from t1) then t1.e else b end+t1.a)c then coalesce((select -17 from t1 where (t1.f+((select case count(*) when -cast(avg(19) AS integer)+count(distinct (t1.c)) & (cast(avg(19) AS integer))*max(t1.c)*count(*)-((count(*))) then cast(avg(b) AS integer) else (count(*)) end-min(a) from t1)) & case when t1.b & a in (select t1.a from t1 union select (select count(distinct e) from t1) from t1) then t1.e else b end+t1.a)~t1.a then f else +~11 end) from t1 where ((select case ~abs(count(distinct t1.e)+(count(*)+count(*)+(abs( -~count(*) | max((t1.b))))))*(cast(avg(t1.a) AS integer)) when (count(*)) then min(19) else -(min(b)) end from t1))+11<>t1.f), -c-f) FROM t1 WHERE ~e>coalesce((select max(case case case coalesce((select max(coalesce((select c from t1 where t1.a-t1.c>13),13)) from t1 where -b not in (case d when ~t1.f | t1.c then 13 else 11 end,19,19)),t1.d) when c then t1.a else t1.b end+f-e*b when f then 19 else -t1.b end when t1.b then 11 else 13 end) from t1 where c in (select 19 from t1 union select e from t1)),t1.d)} -} {} -do_test randexpr-2.105 { - db eval {SELECT coalesce((select max(case when (select ~cast(avg(a) AS integer) from t1)>~t1.a then f else +~11 end) from t1 where ((select case ~abs(count(distinct t1.e)+(count(*)+count(*)+(abs( -~count(*) | max((t1.b))))))*(cast(avg(t1.a) AS integer)) when (count(*)) then min(19) else -(min(b)) end from t1))+11<>t1.f), -c-f) FROM t1 WHERE NOT (~e>coalesce((select max(case case case coalesce((select max(coalesce((select c from t1 where t1.a-t1.c>13),13)) from t1 where -b not in (case d when ~t1.f | t1.c then 13 else 11 end,19,19)),t1.d) when c then t1.a else t1.b end+f-e*b when f then 19 else -t1.b end when t1.b then 11 else 13 end) from t1 where c in (select 19 from t1 union select e from t1)),t1.d))} -} {-12} -do_test randexpr-2.106 { - db eval {SELECT coalesce((select max(case when (select ~cast(avg(a) AS integer) from t1)>~t1.a then f else +~11 end) from t1 where ((select case ~abs(count(distinct t1.e)+(count(*)+count(*)+(abs( -~count(*) & max((t1.b))))))*(cast(avg(t1.a) AS integer)) when (count(*)) then min(19) else -(min(b)) end from t1))+11<>t1.f), -c-f) FROM t1 WHERE NOT (~e>coalesce((select max(case case case coalesce((select max(coalesce((select c from t1 where t1.a-t1.c>13),13)) from t1 where -b not in (case d when ~t1.f | t1.c then 13 else 11 end,19,19)),t1.d) when c then t1.a else t1.b end+f-e*b when f then 19 else -t1.b end when t1.b then 11 else 13 end) from t1 where c in (select 19 from t1 union select e from t1)),t1.d))} -} {-12} -do_test randexpr-2.107 { - db eval {SELECT coalesce((select a from t1 where b>=~11-coalesce((select max((abs(19)/abs(t1.e))+19+t1.d) from t1 where (select abs(count(*) | count(*) | case count(*) when cast(avg(17) AS integer) then -cast(avg(b) AS integer) else count(*) end*min(b))*(min(t1.e)) from t1) in (11*(select count(*) from t1)*17*t1.e-e*t1.b,t1.e,t1.f)),a)*t1.d),13)-f FROM t1 WHERE ~((case when not 13-+t1.c>=17 then -~ -b+t1.f+case when t1.ct1.d then 11 else t1.e end)) else t1.b end when d>a then (a) else t1.b end))+t1.c in (13,t1.a,13) or t1.e>c} -} {-500} -do_test randexpr-2.108 { - db eval {SELECT coalesce((select a from t1 where b>=~11-coalesce((select max((abs(19)/abs(t1.e))+19+t1.d) from t1 where (select abs(count(*) | count(*) | case count(*) when cast(avg(17) AS integer) then -cast(avg(b) AS integer) else count(*) end*min(b))*(min(t1.e)) from t1) in (11*(select count(*) from t1)*17*t1.e-e*t1.b,t1.e,t1.f)),a)*t1.d),13)-f FROM t1 WHERE NOT (~((case when not 13-+t1.c>=17 then -~ -b+t1.f+case when t1.ct1.d then 11 else t1.e end)) else t1.b end when d>a then (a) else t1.b end))+t1.c in (13,t1.a,13) or t1.e>c)} -} {} -do_test randexpr-2.109 { - db eval {SELECT coalesce((select a from t1 where b>=~11-coalesce((select max((abs(19)/abs(t1.e))+19+t1.d) from t1 where (select abs(count(*) & count(*) & case count(*) when cast(avg(17) AS integer) then -cast(avg(b) AS integer) else count(*) end*min(b))*(min(t1.e)) from t1) in (11*(select count(*) from t1)*17*t1.e-e*t1.b,t1.e,t1.f)),a)*t1.d),13)-f FROM t1 WHERE ~((case when not 13-+t1.c>=17 then -~ -b+t1.f+case when t1.ct1.d then 11 else t1.e end)) else t1.b end when d>a then (a) else t1.b end))+t1.c in (13,t1.a,13) or t1.e>c} -} {-500} -do_test randexpr-2.110 { - db eval {SELECT case when 13>=~t1.a or (exists(select 1 from t1 where 11 not in (17,t1.f,17))) then f when not exists(select 1 from t1 where exists(select 1 from t1 where 13 not between e and ~+case b when t1.f then case -case f when 11 then -17 else 19 end+17 when b then b else 13 end else 13 end- -t1.a and t1.c not in (t1.f,a,c) or t1.f<11)) then t1.c else 11 end FROM t1 WHERE +t1.e in (select cast(avg(t1.c*t1.a*(abs(13)/abs(t1.e))) AS integer) from t1 union select min(c+13) from t1)} -} {} -do_test randexpr-2.111 { - db eval {SELECT case when 13>=~t1.a or (exists(select 1 from t1 where 11 not in (17,t1.f,17))) then f when not exists(select 1 from t1 where exists(select 1 from t1 where 13 not between e and ~+case b when t1.f then case -case f when 11 then -17 else 19 end+17 when b then b else 13 end else 13 end- -t1.a and t1.c not in (t1.f,a,c) or t1.f<11)) then t1.c else 11 end FROM t1 WHERE NOT (+t1.e in (select cast(avg(t1.c*t1.a*(abs(13)/abs(t1.e))) AS integer) from t1 union select min(c+13) from t1))} -} {600} -do_test randexpr-2.112 { - db eval {SELECT case when coalesce((select max(13) from t1 where coalesce((select max(c) from t1 where coalesce((select max(17) from t1 where 11 in (select ~d | case when t1.a>+19 then 11 when t1.d not in ( -e,e,c) or 13d or t1.e<>b),t1.b)*13<=f then -t1.e when 19 between -t1.f and t1.a then -t1.b else t1.f end FROM t1 WHERE exists(select 1 from t1 where t1.f between a and coalesce((select max(t1.f) from t1 where exists(select 1 from t1 where coalesce((select 19 from t1 where t1.c=b),a)= -t1.b and not exists(select 1 from t1 where b between e and b) and a<= -17 or exists(select 1 from t1 where 17<=f)) or t1.a>=t1.c),13)*~13*t1.c*13 or t1.d>13 and 11>=t1.d and 11 not between c and c and t1.f>=17 and (d)=f)} -} {} -do_test randexpr-2.113 { - db eval {SELECT case when coalesce((select max(13) from t1 where coalesce((select max(c) from t1 where coalesce((select max(17) from t1 where 11 in (select ~d | case when t1.a>+19 then 11 when t1.d not in ( -e,e,c) or 13d or t1.e<>b),t1.b)*13<=f then -t1.e when 19 between -t1.f and t1.a then -t1.b else t1.f end FROM t1 WHERE NOT (exists(select 1 from t1 where t1.f between a and coalesce((select max(t1.f) from t1 where exists(select 1 from t1 where coalesce((select 19 from t1 where t1.c=b),a)= -t1.b and not exists(select 1 from t1 where b between e and b) and a<= -17 or exists(select 1 from t1 where 17<=f)) or t1.a>=t1.c),13)*~13*t1.c*13 or t1.d>13 and 11>=t1.d and 11 not between c and c and t1.f>=17 and (d)=f))} -} {-500} -do_test randexpr-2.114 { - db eval {SELECT case when coalesce((select max(13) from t1 where coalesce((select max(c) from t1 where coalesce((select max(17) from t1 where 11 in (select ~d & case when t1.a>+19 then 11 when t1.d not in ( -e,e,c) or 13d or t1.e<>b),t1.b)*13<=f then -t1.e when 19 between -t1.f and t1.a then -t1.b else t1.f end FROM t1 WHERE NOT (exists(select 1 from t1 where t1.f between a and coalesce((select max(t1.f) from t1 where exists(select 1 from t1 where coalesce((select 19 from t1 where t1.c=b),a)= -t1.b and not exists(select 1 from t1 where b between e and b) and a<= -17 or exists(select 1 from t1 where 17<=f)) or t1.a>=t1.c),13)*~13*t1.c*13 or t1.d>13 and 11>=t1.d and 11 not between c and c and t1.f>=17 and (d)=f))} -} {-500} -do_test randexpr-2.115 { - db eval {SELECT case when coalesce((select +case when not exists(select 1 from t1 where 19*t1.e< -~11*a or t1.b>=t1.c and t1.a<>e) then coalesce((select max(13) from t1 where 11>11), -(e)) | t1.a when (t1.d) in (select f from t1 union select b from t1) then a else e end from t1 where t1.f<> -t1.d),t1.b) not in (d,t1.d,t1.c) then 19 when (t1.b<>t1.e or -t1.b>=t1.b) then (f) else d end FROM t1 WHERE t1.e=a and b>=(abs(case when 19 not between ~+17 and +case when ((b+e-f=t1.d or b not in (t1.a,t1.f,t1.b) or t1.a not between 19 and e or b>=(t1.d) or t1.b not in (d,t1.a,t1.b))) then e-f else t1.e*t1.f end | f then d else -d end)/abs(11))} -} {} -do_test randexpr-2.116 { - db eval {SELECT case when coalesce((select +case when not exists(select 1 from t1 where 19*t1.e< -~11*a or t1.b>=t1.c and t1.a<>e) then coalesce((select max(13) from t1 where 11>11), -(e)) | t1.a when (t1.d) in (select f from t1 union select b from t1) then a else e end from t1 where t1.f<> -t1.d),t1.b) not in (d,t1.d,t1.c) then 19 when (t1.b<>t1.e or -t1.b>=t1.b) then (f) else d end FROM t1 WHERE NOT (t1.e=a and b>=(abs(case when 19 not between ~+17 and +case when ((b+e-f=t1.d or b not in (t1.a,t1.f,t1.b) or t1.a not between 19 and e or b>=(t1.d) or t1.b not in (d,t1.a,t1.b))) then e-f else t1.e*t1.f end | f then d else -d end)/abs(11)))} -} {19} -do_test randexpr-2.117 { - db eval {SELECT case when coalesce((select +case when not exists(select 1 from t1 where 19*t1.e< -~11*a or t1.b>=t1.c and t1.a<>e) then coalesce((select max(13) from t1 where 11>11), -(e)) & t1.a when (t1.d) in (select f from t1 union select b from t1) then a else e end from t1 where t1.f<> -t1.d),t1.b) not in (d,t1.d,t1.c) then 19 when (t1.b<>t1.e or -t1.b>=t1.b) then (f) else d end FROM t1 WHERE NOT (t1.e=a and b>=(abs(case when 19 not between ~+17 and +case when ((b+e-f=t1.d or b not in (t1.a,t1.f,t1.b) or t1.a not between 19 and e or b>=(t1.d) or t1.b not in (d,t1.a,t1.b))) then e-f else t1.e*t1.f end | f then d else -d end)/abs(11)))} -} {19} -do_test randexpr-2.118 { - db eval {SELECT (select (cast(avg(b) AS integer) | count(distinct case when coalesce((select 13 from t1 where (+(abs(e)/abs(t1.b))) in ( -b, -(a),13)),t1.e)>=b then 11 else - -19 end-17+19) | abs(~case count(distinct t1.b) when +min(e) then +abs(~ - -count(distinct 11)-count(distinct t1.b))-count(distinct a) else -min(b) end)*count(distinct 19)-count(distinct t1.b)) from t1) FROM t1 WHERE 11<=t1.a-t1.f-19*t1.b+19+coalesce((select e from t1 where d not between (select count(distinct coalesce((select t1.a from t1 where (select cast(avg(t1.e) AS integer)-+count(distinct c)+max((abs(t1.c)/abs(t1.f))-a)-(count(*)-cast(avg((17)) AS integer)) from t1) in (t1.e, -e | d,b)),c)) from t1) and t1.a),t1.d)-t1.d} -} {} -do_test randexpr-2.119 { - db eval {SELECT (select (cast(avg(b) AS integer) | count(distinct case when coalesce((select 13 from t1 where (+(abs(e)/abs(t1.b))) in ( -b, -(a),13)),t1.e)>=b then 11 else - -19 end-17+19) | abs(~case count(distinct t1.b) when +min(e) then +abs(~ - -count(distinct 11)-count(distinct t1.b))-count(distinct a) else -min(b) end)*count(distinct 19)-count(distinct t1.b)) from t1) FROM t1 WHERE NOT (11<=t1.a-t1.f-19*t1.b+19+coalesce((select e from t1 where d not between (select count(distinct coalesce((select t1.a from t1 where (select cast(avg(t1.e) AS integer)-+count(distinct c)+max((abs(t1.c)/abs(t1.f))-a)-(count(*)-cast(avg((17)) AS integer)) from t1) in (t1.e, -e | d,b)),c)) from t1) and t1.a),t1.d)-t1.d)} -} {207} -do_test randexpr-2.120 { - db eval {SELECT (select (cast(avg(b) AS integer) & count(distinct case when coalesce((select 13 from t1 where (+(abs(e)/abs(t1.b))) in ( -b, -(a),13)),t1.e)>=b then 11 else - -19 end-17+19) & abs(~case count(distinct t1.b) when +min(e) then +abs(~ - -count(distinct 11)-count(distinct t1.b))-count(distinct a) else -min(b) end)*count(distinct 19)-count(distinct t1.b)) from t1) FROM t1 WHERE NOT (11<=t1.a-t1.f-19*t1.b+19+coalesce((select e from t1 where d not between (select count(distinct coalesce((select t1.a from t1 where (select cast(avg(t1.e) AS integer)-+count(distinct c)+max((abs(t1.c)/abs(t1.f))-a)-(count(*)-cast(avg((17)) AS integer)) from t1) in (t1.e, -e | d,b)),c)) from t1) and t1.a),t1.d)-t1.d)} -} {0} -do_test randexpr-2.121 { - db eval {SELECT 11+a*case t1.a*t1.e when 17 then coalesce((select +t1.b from t1 where t1.c<>t1.c and e between +(abs(case b+f*coalesce((select c from t1 where t1.d>17), -t1.c)+(19) when b then t1.f else t1.d end)/abs(t1.d)) and t1.c and t1.a>b or t1.fc or t1.d | 11 in (select t1.e from t1 union select d from t1))) then 17 else (abs(coalesce((select max(f) from t1 where not (c)t1.c and e between +(abs(case b+f*coalesce((select c from t1 where t1.d>17), -t1.c)+(19) when b then t1.f else t1.d end)/abs(t1.d)) and t1.c and t1.a>b or t1.fc or t1.d | 11 in (select t1.e from t1 union select d from t1))) then 17 else (abs(coalesce((select max(f) from t1 where not (c)e then t1.f else t1.b+case when b between coalesce((select max(t1.d-~(abs(a)/abs(c))+t1.c) from t1 where f in (select -min(t1.f)-+cast(avg(e) AS integer) from t1 union select -(cast(avg(13) AS integer)) from t1) and f<=a and not exists(select 1 from t1 where f not between t1.d and t1.d or (f)<=a) and (t1.f) between 11 and d),t1.a) and t1.f then e when (1113),case when c<=11 then t1.e when t1.e<=b then t1.d else t1.e end)-11,11,17)} -} {} -do_test randexpr-2.124 { - db eval {SELECT (e)+case when t1.a>e then t1.f else t1.b+case when b between coalesce((select max(t1.d-~(abs(a)/abs(c))+t1.c) from t1 where f in (select -min(t1.f)-+cast(avg(e) AS integer) from t1 union select -(cast(avg(13) AS integer)) from t1) and f<=a and not exists(select 1 from t1 where f not between t1.d and t1.d or (f)<=a) and (t1.f) between 11 and d),t1.a) and t1.f then e when (1113),case when c<=11 then t1.e when t1.e<=b then t1.d else t1.e end)-11,11,17))} -} {1524} -do_test randexpr-2.125 { - db eval {SELECT (e)+case when t1.a>e then t1.f else t1.b+case when b between coalesce((select max(t1.d-~(abs(a)/abs(c))+t1.c) from t1 where f in (select -min(t1.f)-+cast(avg(e) AS integer) from t1 union select -(cast(avg(13) AS integer)) from t1) and f<=a and not exists(select 1 from t1 where f not between t1.d and t1.d or (f)<=a) and (t1.f) between 11 and d),t1.a) and t1.f then e when (1113),case when c<=11 then t1.e when t1.e<=b then t1.d else t1.e end)-11,11,17))} -} {176} -do_test randexpr-2.126 { - db eval {SELECT coalesce((select max(~d-t1.f+b-13) from t1 where t1.c not between case when +f=t1.b then 13 when ~f not in (~t1.a,coalesce((select max(t1.b) from t1 where b between c-t1.c+e and (t1.b)),coalesce((select max(t1.d) from t1 where not e in (select 17 from t1 union select t1.c+e | a from t1)),b)),t1.e) then t1.b else a end and c),t1.a) FROM t1 WHERE (select (++ -count(*) | cast(avg(t1.b) AS integer) | ++(max(t1.d))+count(*)+max(t1.b)-count(distinct t1.e)-+abs( -+~max((abs(t1.c)/abs((select min(a) from t1)))))+count(distinct t1.a-t1.b)) from t1) between e and c} -} {} -do_test randexpr-2.127 { - db eval {SELECT coalesce((select max(~d-t1.f+b-13) from t1 where t1.c not between case when +f=t1.b then 13 when ~f not in (~t1.a,coalesce((select max(t1.b) from t1 where b between c-t1.c+e and (t1.b)),coalesce((select max(t1.d) from t1 where not e in (select 17 from t1 union select t1.c+e | a from t1)),b)),t1.e) then t1.b else a end and c),t1.a) FROM t1 WHERE NOT ((select (++ -count(*) | cast(avg(t1.b) AS integer) | ++(max(t1.d))+count(*)+max(t1.b)-count(distinct t1.e)-+abs( -+~max((abs(t1.c)/abs((select min(a) from t1)))))+count(distinct t1.a-t1.b)) from t1) between e and c)} -} {100} -do_test randexpr-2.128 { - db eval {SELECT coalesce((select max(~d-t1.f+b-13) from t1 where t1.c not between case when +f=t1.b then 13 when ~f not in (~t1.a,coalesce((select max(t1.b) from t1 where b between c-t1.c+e and (t1.b)),coalesce((select max(t1.d) from t1 where not e in (select 17 from t1 union select t1.c+e & a from t1)),b)),t1.e) then t1.b else a end and c),t1.a) FROM t1 WHERE NOT ((select (++ -count(*) | cast(avg(t1.b) AS integer) | ++(max(t1.d))+count(*)+max(t1.b)-count(distinct t1.e)-+abs( -+~max((abs(t1.c)/abs((select min(a) from t1)))))+count(distinct t1.a-t1.b)) from t1) between e and c)} -} {100} -do_test randexpr-2.129 { - db eval {SELECT a+case when exists(select 1 from t1 where 19>=e) then b*b+coalesce((select max( -coalesce((select max(19 | t1.e) from t1 where exists(select 1 from t1 where exists(select 1 from t1 where +case t1.a when a then a else (17) end*19 in (select max(d) from t1 union select max(t1.a) from t1) and not exists(select 1 from t1 where t1.a<=11)) or 11>(19))),11* -a)) from t1 where t1.e<>17),f) else t1.e end-11 FROM t1 WHERE (t1.a>=(abs(coalesce((select +13*t1.a | c from t1 where 11+case when exists(select 1 from t1 where case when +t1.d in (select case +count(*) when count(distinct 11) then count(*) else (min(11)) end from t1 union select max( -11) from t1) or 11<> -t1.f then t1.d when t1.b in (13,a,d) then c else c end+t1.b=b) then e-c else (t1.d) end>t1.d),d))/abs(t1.f)) and 11 in (select -t1.a from t1 union select 13 from t1))} -} {} -do_test randexpr-2.130 { - db eval {SELECT a+case when exists(select 1 from t1 where 19>=e) then b*b+coalesce((select max( -coalesce((select max(19 | t1.e) from t1 where exists(select 1 from t1 where exists(select 1 from t1 where +case t1.a when a then a else (17) end*19 in (select max(d) from t1 union select max(t1.a) from t1) and not exists(select 1 from t1 where t1.a<=11)) or 11>(19))),11* -a)) from t1 where t1.e<>17),f) else t1.e end-11 FROM t1 WHERE NOT ((t1.a>=(abs(coalesce((select +13*t1.a | c from t1 where 11+case when exists(select 1 from t1 where case when +t1.d in (select case +count(*) when count(distinct 11) then count(*) else (min(11)) end from t1 union select max( -11) from t1) or 11<> -t1.f then t1.d when t1.b in (13,a,d) then c else c end+t1.b=b) then e-c else (t1.d) end>t1.d),d))/abs(t1.f)) and 11 in (select -t1.a from t1 union select 13 from t1)))} -} {589} -do_test randexpr-2.131 { - db eval {SELECT a+case when exists(select 1 from t1 where 19>=e) then b*b+coalesce((select max( -coalesce((select max(19 & t1.e) from t1 where exists(select 1 from t1 where exists(select 1 from t1 where +case t1.a when a then a else (17) end*19 in (select max(d) from t1 union select max(t1.a) from t1) and not exists(select 1 from t1 where t1.a<=11)) or 11>(19))),11* -a)) from t1 where t1.e<>17),f) else t1.e end-11 FROM t1 WHERE NOT ((t1.a>=(abs(coalesce((select +13*t1.a | c from t1 where 11+case when exists(select 1 from t1 where case when +t1.d in (select case +count(*) when count(distinct 11) then count(*) else (min(11)) end from t1 union select max( -11) from t1) or 11<> -t1.f then t1.d when t1.b in (13,a,d) then c else c end+t1.b=b) then e-c else (t1.d) end>t1.d),d))/abs(t1.f)) and 11 in (select -t1.a from t1 union select 13 from t1)))} -} {589} -do_test randexpr-2.132 { - db eval {SELECT case ~13 when t1.e then e else (select case case (abs(count(*))-~count(*)+count(*) | count(*)-count(*)+max(t1.b)* -(cast(avg(13) AS integer)) | -(count(distinct t1.c))) when min(e) then (min(13)) else count(*) end*count(*) when max(e) then count(distinct -d) else count(*) end from t1) end-t1.d*case (abs(e | t1.b)/abs((select cast(avg(t1.c) AS integer) from t1))) when (select cast(avg(a) AS integer) from t1) then t1.c else f+13 end FROM t1 WHERE not exists(select 1 from t1 where coalesce((select case when t1.a>t1.f-~case when ~t1.d+c+t1.f>11 then t1.a when (f between t1.f and t1.c) then t1.f else 13 end*t1.a then t1.d when c19 then c else t1.e end from t1 where e<>a and 19<>t1.f),t1.b)+t1.f-t1.et1.f-~case when ~t1.d+c+t1.f>11 then t1.a when (f between t1.f and t1.c) then t1.f else 13 end*t1.a then t1.d when c19 then c else t1.e end from t1 where e<>a and 19<>t1.f),t1.b)+t1.f-t1.et1.f-~case when ~t1.d+c+t1.f>11 then t1.a when (f between t1.f and t1.c) then t1.f else 13 end*t1.a then t1.d when c19 then c else t1.e end from t1 where e<>a and 19<>t1.f),t1.b)+t1.f-t1.et1.c and 11<>e then 13 else a end-(a))-max(t1.e)*count(distinct t1.f) | case max((f)) when (count(distinct f)) then count(*) else min(t1.c) end+min(19) from t1) not in (11,19,t1.e)),t1.f*17))/abs(a)))/abs(c)) in (select t1.c from t1 union select t1.a from t1)) or ( -t1.f=e)} -} {} -do_test randexpr-2.136 { - db eval {SELECT 11-case when 17<=c and (select ( -abs(case count(*)+~case -min(e) when count(distinct t1.a) then -count(*) else min(a) end+max(t1.c) when count(*) then max(b) else -count(distinct 19) end)*cast(avg(17) AS integer)) from t1) not in (case f when e then 19 | 11 else (t1.d) end,d, -t1.b) then +t1.c when t1.d not in (11,c,t1.a) then 13 else a end-t1.d*t1.d FROM t1 WHERE NOT (((abs((abs(coalesce((select a from t1 where (select max(case when t1.f=b then e when 11>t1.c and 11<>e then 13 else a end-(a))-max(t1.e)*count(distinct t1.f) | case max((f)) when (count(distinct f)) then count(*) else min(t1.c) end+min(19) from t1) not in (11,19,t1.e)),t1.f*17))/abs(a)))/abs(c)) in (select t1.c from t1 union select t1.a from t1)) or ( -t1.f=e))} -} {-160289} -do_test randexpr-2.137 { - db eval {SELECT 11-case when 17<=c and (select ( -abs(case count(*)+~case -min(e) when count(distinct t1.a) then -count(*) else min(a) end+max(t1.c) when count(*) then max(b) else -count(distinct 19) end)*cast(avg(17) AS integer)) from t1) not in (case f when e then 19 & 11 else (t1.d) end,d, -t1.b) then +t1.c when t1.d not in (11,c,t1.a) then 13 else a end-t1.d*t1.d FROM t1 WHERE NOT (((abs((abs(coalesce((select a from t1 where (select max(case when t1.f=b then e when 11>t1.c and 11<>e then 13 else a end-(a))-max(t1.e)*count(distinct t1.f) | case max((f)) when (count(distinct f)) then count(*) else min(t1.c) end+min(19) from t1) not in (11,19,t1.e)),t1.f*17))/abs(a)))/abs(c)) in (select t1.c from t1 union select t1.a from t1)) or ( -t1.f=e))} -} {-160289} -do_test randexpr-2.138 { - db eval {SELECT (f+case +t1.e when t1.d then 17 else f*19 end | -(abs( -coalesce((select 17* -c+19 from t1 where (abs(case 19*e*d when (select +(cast(avg( -11) AS integer)) | -count(*)*max( -13) from t1) then 11 | case t1.b when a then a else t1.f end else t1.a end)/abs(a)) in (select t1.b from t1 union select (a) from t1)),t1.b))/abs( -13))) FROM t1 WHERE +b in (select case case case when not ((~coalesce((select t1.e+d from t1 where (19 between f and t1.b)),(select cast(avg(c+t1.b) AS integer)++cast(avg(b) AS integer) from t1))) not in (t1.c+c,b,e)) or (13 not between d and t1.d) then 13 else b end when -11 then 13 else 19 end*t1.e when (f) then 19 else 19 end from t1 union select f from t1)} -} {} -do_test randexpr-2.139 { - db eval {SELECT (f+case +t1.e when t1.d then 17 else f*19 end | -(abs( -coalesce((select 17* -c+19 from t1 where (abs(case 19*e*d when (select +(cast(avg( -11) AS integer)) | -count(*)*max( -13) from t1) then 11 | case t1.b when a then a else t1.f end else t1.a end)/abs(a)) in (select t1.b from t1 union select (a) from t1)),t1.b))/abs( -13))) FROM t1 WHERE NOT (+b in (select case case case when not ((~coalesce((select t1.e+d from t1 where (19 between f and t1.b)),(select cast(avg(c+t1.b) AS integer)++cast(avg(b) AS integer) from t1))) not in (t1.c+c,b,e)) or (13 not between d and t1.d) then 13 else b end when -11 then 13 else 19 end*t1.e when (f) then 19 else 19 end from t1 union select f from t1))} -} {-15} -do_test randexpr-2.140 { - db eval {SELECT (f+case +t1.e when t1.d then 17 else f*19 end & -(abs( -coalesce((select 17* -c+19 from t1 where (abs(case 19*e*d when (select +(cast(avg( -11) AS integer)) & -count(*)*max( -13) from t1) then 11 & case t1.b when a then a else t1.f end else t1.a end)/abs(a)) in (select t1.b from t1 union select (a) from t1)),t1.b))/abs( -13))) FROM t1 WHERE NOT (+b in (select case case case when not ((~coalesce((select t1.e+d from t1 where (19 between f and t1.b)),(select cast(avg(c+t1.b) AS integer)++cast(avg(b) AS integer) from t1))) not in (t1.c+c,b,e)) or (13 not between d and t1.d) then 13 else b end when -11 then 13 else 19 end*t1.e when (f) then 19 else 19 end from t1 union select f from t1))} -} {12000} -do_test randexpr-2.141 { - db eval {SELECT 11*coalesce((select max(t1.f) from t1 where a-case t1.c when +coalesce((select t1.a-t1.b from t1 where (abs(19)/abs(b)) in (17-case when a17),d)*(t1.e) FROM t1 WHERE (coalesce((select max(~t1.b) from t1 where t1.c in (select ~+case count(distinct a) when (max(t1.a)) then (count(*)) else ~+abs(cast(avg(d | t1.a) AS integer)+case (cast(avg(13) AS integer)) when cast(avg(b) AS integer) then cast(avg(t1.f) AS integer) else min(t1.a) end) | count(distinct c)*( -( -max(t1.f)))*count(*) end from t1 union select count(distinct -e) from t1)),~a-11)<19 or t1.a*13<>t1.d and not exists(select 1 from t1 where t1.e=e))} -} {3300000} -do_test randexpr-2.142 { - db eval {SELECT 11*coalesce((select max(t1.f) from t1 where a-case t1.c when +coalesce((select t1.a-t1.b from t1 where (abs(19)/abs(b)) in (17-case when a17),d)*(t1.e) FROM t1 WHERE NOT ((coalesce((select max(~t1.b) from t1 where t1.c in (select ~+case count(distinct a) when (max(t1.a)) then (count(*)) else ~+abs(cast(avg(d | t1.a) AS integer)+case (cast(avg(13) AS integer)) when cast(avg(b) AS integer) then cast(avg(t1.f) AS integer) else min(t1.a) end) | count(distinct c)*( -( -max(t1.f)))*count(*) end from t1 union select count(distinct -e) from t1)),~a-11)<19 or t1.a*13<>t1.d and not exists(select 1 from t1 where t1.e=e)))} -} {} -do_test randexpr-2.143 { - db eval {SELECT 11+t1.b+17+case when 13 not between t1.d*(17)+d-t1.f and 13 then t1.d when case when case when t1.f not in (t1.b,c,t1.f) and -d between d and 11 then d else 19 end not between a and e then t1.b when t1.d in (17,13,11) then 19 else t1.e end*a>e then t1.a else t1.d end*f*e FROM t1 WHERE not exists(select 1 from t1 where (t1.f) in (b-b,(select +(max( -13*t1.c*c+t1.e+case t1.a when +t1.d-(c) then -t1.a else t1.c end | 19* -17)*count(distinct a) | (count(distinct t1.f)))++cast(avg(f) AS integer)-max(13) | cast(avg(b) AS integer) from t1),t1.f))} -} {} -do_test randexpr-2.144 { - db eval {SELECT 11+t1.b+17+case when 13 not between t1.d*(17)+d-t1.f and 13 then t1.d when case when case when t1.f not in (t1.b,c,t1.f) and -d between d and 11 then d else 19 end not between a and e then t1.b when t1.d in (17,13,11) then 19 else t1.e end*a>e then t1.a else t1.d end*f*e FROM t1 WHERE NOT (not exists(select 1 from t1 where (t1.f) in (b-b,(select +(max( -13*t1.c*c+t1.e+case t1.a when +t1.d-(c) then -t1.a else t1.c end | 19* -17)*count(distinct a) | (count(distinct t1.f)))++cast(avg(f) AS integer)-max(13) | cast(avg(b) AS integer) from t1),t1.f)))} -} {120000228} -do_test randexpr-2.145 { - db eval {SELECT ((abs(+((select count(*)*abs(min((abs(case (abs(c)/abs(f)) | e when case when 19>=d then 13 when a=f then 13 else f end then b else a end+t1.a)/abs(11))*t1.c*17))-cast(avg(e) AS integer)*count(*) from t1)))/abs(coalesce((select max(case when t1.a in (select t1.c from t1 union select 19 from t1) then e else t1.e end) from t1 where (t1.a<= -t1.e)),17)+c*13))) FROM t1 WHERE exists(select 1 from t1 where ~coalesce((select max(c) from t1 where exists(select 1 from t1 where case when not case coalesce((select max(coalesce((select d from t1 where exists(select 1 from t1 where a<(t1.c))),19)) from t1 where e=t1.e),13) when t1.e then t1.b else f end in (select abs((min(e))*(max(t1.d))+min(t1.e)*(( -((max(t1.a)))))) from t1 union select count(distinct t1.a) from t1) then coalesce((select t1.c from t1 where t1.a< -t1.c and a in (t1.b,t1.f,t1.c)),17) else 17 end>=t1.f)),t1.f)+t1.a*b in (select c from t1 union select 19 from t1)) or exists(select 1 from t1 where not t1.f not in (t1.f,11,t1.d) and 19<=19)} -} {23} -do_test randexpr-2.146 { - db eval {SELECT ((abs(+((select count(*)*abs(min((abs(case (abs(c)/abs(f)) | e when case when 19>=d then 13 when a=f then 13 else f end then b else a end+t1.a)/abs(11))*t1.c*17))-cast(avg(e) AS integer)*count(*) from t1)))/abs(coalesce((select max(case when t1.a in (select t1.c from t1 union select 19 from t1) then e else t1.e end) from t1 where (t1.a<= -t1.e)),17)+c*13))) FROM t1 WHERE NOT (exists(select 1 from t1 where ~coalesce((select max(c) from t1 where exists(select 1 from t1 where case when not case coalesce((select max(coalesce((select d from t1 where exists(select 1 from t1 where a<(t1.c))),19)) from t1 where e=t1.e),13) when t1.e then t1.b else f end in (select abs((min(e))*(max(t1.d))+min(t1.e)*(( -((max(t1.a)))))) from t1 union select count(distinct t1.a) from t1) then coalesce((select t1.c from t1 where t1.a< -t1.c and a in (t1.b,t1.f,t1.c)),17) else 17 end>=t1.f)),t1.f)+t1.a*b in (select c from t1 union select 19 from t1)) or exists(select 1 from t1 where not t1.f not in (t1.f,11,t1.d) and 19<=19))} -} {} -do_test randexpr-2.147 { - db eval {SELECT ((abs(+((select count(*)*abs(min((abs(case (abs(c)/abs(f)) & e when case when 19>=d then 13 when a=f then 13 else f end then b else a end+t1.a)/abs(11))*t1.c*17))-cast(avg(e) AS integer)*count(*) from t1)))/abs(coalesce((select max(case when t1.a in (select t1.c from t1 union select 19 from t1) then e else t1.e end) from t1 where (t1.a<= -t1.e)),17)+c*13))) FROM t1 WHERE exists(select 1 from t1 where ~coalesce((select max(c) from t1 where exists(select 1 from t1 where case when not case coalesce((select max(coalesce((select d from t1 where exists(select 1 from t1 where a<(t1.c))),19)) from t1 where e=t1.e),13) when t1.e then t1.b else f end in (select abs((min(e))*(max(t1.d))+min(t1.e)*(( -((max(t1.a)))))) from t1 union select count(distinct t1.a) from t1) then coalesce((select t1.c from t1 where t1.a< -t1.c and a in (t1.b,t1.f,t1.c)),17) else 17 end>=t1.f)),t1.f)+t1.a*b in (select c from t1 union select 19 from t1)) or exists(select 1 from t1 where not t1.f not in (t1.f,11,t1.d) and 19<=19)} -} {23} -do_test randexpr-2.148 { - db eval {SELECT coalesce((select max(case when t1.f between 17 and 11+case when not coalesce((select max(11) from t1 where t1.f in (select max(t1.d) from t1 union select -count(*) from t1) or 17=(13) or f in (( -t1.b),13,a)),case when d>13 then 13 else 11 end) between 19 and 19 then 19 when t1.c=d then e else 17 end then t1.e else t1.d end) from t1 where e in (select -(+max(11)-max((t1.a))+ -count(distinct d) | cast(avg(t1.a) AS integer)*count(distinct b))-count(*)* -count(distinct t1.e) from t1 union select cast(avg(d) AS integer) from t1)),d)+b FROM t1 WHERE (select +~abs( -min(t1.a)-abs(count(*)))+ -abs(+ -+case (cast(avg(a) AS integer)) when min(e+t1.d) then +case cast(avg(coalesce((select max(t1.f+ -t1.e) from t1 where t1.c between 13 and t1.b),19)) AS integer) when ~~min(t1.f) then count(distinct 13) else cast(avg(t1.b) AS integer) end+count(distinct t1.e) else -count(*) end | max(a)+max(t1.e)) from t1)+e13 then 13 else 11 end) between 19 and 19 then 19 when t1.c=d then e else 17 end then t1.e else t1.d end) from t1 where e in (select -(+max(11)-max((t1.a))+ -count(distinct d) | cast(avg(t1.a) AS integer)*count(distinct b))-count(*)* -count(distinct t1.e) from t1 union select cast(avg(d) AS integer) from t1)),d)+b FROM t1 WHERE NOT ((select +~abs( -min(t1.a)-abs(count(*)))+ -abs(+ -+case (cast(avg(a) AS integer)) when min(e+t1.d) then +case cast(avg(coalesce((select max(t1.f+ -t1.e) from t1 where t1.c between 13 and t1.b),19)) AS integer) when ~~min(t1.f) then count(distinct 13) else cast(avg(t1.b) AS integer) end+count(distinct t1.e) else -count(*) end | max(a)+max(t1.e)) from t1)+e13 then 13 else 11 end) between 19 and 19 then 19 when t1.c=d then e else 17 end then t1.e else t1.d end) from t1 where e in (select -(+max(11)-max((t1.a))+ -count(distinct d) & cast(avg(t1.a) AS integer)*count(distinct b))-count(*)* -count(distinct t1.e) from t1 union select cast(avg(d) AS integer) from t1)),d)+b FROM t1 WHERE (select +~abs( -min(t1.a)-abs(count(*)))+ -abs(+ -+case (cast(avg(a) AS integer)) when min(e+t1.d) then +case cast(avg(coalesce((select max(t1.f+ -t1.e) from t1 where t1.c between 13 and t1.b),19)) AS integer) when ~~min(t1.f) then count(distinct 13) else cast(avg(t1.b) AS integer) end+count(distinct t1.e) else -count(*) end | max(a)+max(t1.e)) from t1)+ed or t1.a not between b and 13 or f<> -19 and t1.b>a} -} {11} -do_test randexpr-2.152 { - db eval {SELECT case when ((+b in (select min(coalesce((select c from t1 where t1.b-t1.c+coalesce((select max(case when 13 in (select -count(distinct b)*max(c) from t1 union select (( - -cast(avg(d) AS integer))) from t1) then b else t1.f end) from t1 where t1.fd or t1.a not between b and 13 or f<> -19 and t1.b>a)} -} {} -do_test randexpr-2.153 { - db eval {SELECT case when ((+b in (select min(coalesce((select c from t1 where t1.b-t1.c+coalesce((select max(case when 13 in (select -count(distinct b)*max(c) from t1 union select (( - -cast(avg(d) AS integer))) from t1) then b else t1.f end) from t1 where t1.fd or t1.a not between b and 13 or f<> -19 and t1.b>a} -} {11} -do_test randexpr-2.154 { - db eval {SELECT case when t1.a | (abs(case when -t1.e in (17,11,(abs(t1.b)/abs(b+case when (17 in (select f-c from t1 union select -a from t1)) or t1.b<=a then d when t1.e in (select -(count(*)) from t1 union select max(t1.b) from t1) then c else c end*a-t1.f))) then t1.b else t1.e end)/abs(t1.f))>=11 and not exists(select 1 from t1 where exists(select 1 from t1 where t1.d in (select t1.d from t1 union select 17 from t1))) then c else t1.c end FROM t1 WHERE (coalesce((select f from t1 where case a-e+a when (abs(t1.d)/abs((coalesce((select ~t1.e*+t1.a+b*a*(abs(19)/abs(a))*a+e from t1 where 13=13 or t1.b<= -19),t1.f)+17* -t1.c=11 and not exists(select 1 from t1 where exists(select 1 from t1 where t1.d in (select t1.d from t1 union select 17 from t1))) then c else t1.c end FROM t1 WHERE NOT ((coalesce((select f from t1 where case a-e+a when (abs(t1.d)/abs((coalesce((select ~t1.e*+t1.a+b*a*(abs(19)/abs(a))*a+e from t1 where 13=13 or t1.b<= -19),t1.f)+17* -t1.c=11 and not exists(select 1 from t1 where exists(select 1 from t1 where t1.d in (select t1.d from t1 union select 17 from t1))) then c else t1.c end FROM t1 WHERE (coalesce((select f from t1 where case a-e+a when (abs(t1.d)/abs((coalesce((select ~t1.e*+t1.a+b*a*(abs(19)/abs(a))*a+e from t1 where 13=13 or t1.b<= -19),t1.f)+17* -t1.c~a-11),t1.f) end)} -} {100} -do_test randexpr-2.158 { - db eval {SELECT coalesce((select max(~t1.b) from t1 where b in (select count(distinct b) from t1 union select max(case coalesce((select max(b) from t1 where d in (select t1.f from t1 union select d from t1) and t1.a=d),t1.a) when -t1.a then d*t1.e+t1.c-11+b | e-t1.a+e+t1.f else c end) from t1)),t1.a) FROM t1 WHERE NOT ((e~a-11),t1.f) end))} -} {} -do_test randexpr-2.159 { - db eval {SELECT coalesce((select max(~t1.b) from t1 where b in (select count(distinct b) from t1 union select max(case coalesce((select max(b) from t1 where d in (select t1.f from t1 union select d from t1) and t1.a=d),t1.a) when -t1.a then d*t1.e+t1.c-11+b & e-t1.a+e+t1.f else c end) from t1)),t1.a) FROM t1 WHERE (e~a-11),t1.f) end)} -} {100} -do_test randexpr-2.160 { - db eval {SELECT case when not t1.c not in (13,d,~case when coalesce((select max((abs(t1.c)/abs(t1.e))) from t1 where b-t1.d+b+t1.f>a),t1.a) in (select 19 from t1 union select t1.a from t1) then -b else a end*b | d) and -(t1.b)>=e and 11 -t1.c then t1.f else t1.f end+(t1.b)+a FROM t1 WHERE e>e} -} {} -do_test randexpr-2.161 { - db eval {SELECT case when not t1.c not in (13,d,~case when coalesce((select max((abs(t1.c)/abs(t1.e))) from t1 where b-t1.d+b+t1.f>a),t1.a) in (select 19 from t1 union select t1.a from t1) then -b else a end*b | d) and -(t1.b)>=e and 11 -t1.c then t1.f else t1.f end+(t1.b)+a FROM t1 WHERE NOT (e>e)} -} {900} -do_test randexpr-2.162 { - db eval {SELECT case when not t1.c not in (13,d,~case when coalesce((select max((abs(t1.c)/abs(t1.e))) from t1 where b-t1.d+b+t1.f>a),t1.a) in (select 19 from t1 union select t1.a from t1) then -b else a end*b & d) and -(t1.b)>=e and 11 -t1.c then t1.f else t1.f end+(t1.b)+a FROM t1 WHERE NOT (e>e)} -} {900} -do_test randexpr-2.163 { - db eval {SELECT coalesce((select t1.c*c from t1 where (select (abs(cast(avg(b*13) AS integer))) from t1) in (select 11 from t1 union select e | a-17 from t1)), -case t1.c when t1.b++(select cast(avg(e) AS integer) from t1) then 17 else t1.b end)-d FROM t1 WHERE b<=t1.d} -} {-600} -do_test randexpr-2.164 { - db eval {SELECT coalesce((select t1.c*c from t1 where (select (abs(cast(avg(b*13) AS integer))) from t1) in (select 11 from t1 union select e | a-17 from t1)), -case t1.c when t1.b++(select cast(avg(e) AS integer) from t1) then 17 else t1.b end)-d FROM t1 WHERE NOT (b<=t1.d)} -} {} -do_test randexpr-2.165 { - db eval {SELECT coalesce((select t1.c*c from t1 where (select (abs(cast(avg(b*13) AS integer))) from t1) in (select 11 from t1 union select e & a-17 from t1)), -case t1.c when t1.b++(select cast(avg(e) AS integer) from t1) then 17 else t1.b end)-d FROM t1 WHERE b<=t1.d} -} {-600} -do_test randexpr-2.166 { - db eval {SELECT coalesce((select max((case (abs(t1.b)/abs(e)) when 13 then ((select +case count(*)*count(distinct coalesce((select max((11)+b) from t1 where exists(select 1 from t1 where t1.e=(t1.b))), -13)) when count(distinct -c) then count(*)*max( -d) else max((a)) end+min(c) from t1)) else t1.a end-(abs(case when a=17 and e<=b then a when a>=e then t1.c else t1.c end+13)/abs(e))*(e))) from t1 where t1.a in (select d from t1 union select -t1.e from t1)),13) FROM t1 WHERE not coalesce((select max(case when f<=d | b | case when case when (t1.c in (f,19,c)) then t1.f when d>t1.b then t1.f else t1.f end<=c then 11 else c end- -t1.c-13 and t1.c in (select b from t1 union select -17 from t1) then t1.b else a end) from t1 where 11 between d and a), -17) not between t1.f and t1.f and t1.f>11 or (not exists(select 1 from t1 where t1.b in (select min(t1.d) from t1 union select min(c) from t1)))} -} {13} -do_test randexpr-2.167 { - db eval {SELECT coalesce((select max((case (abs(t1.b)/abs(e)) when 13 then ((select +case count(*)*count(distinct coalesce((select max((11)+b) from t1 where exists(select 1 from t1 where t1.e=(t1.b))), -13)) when count(distinct -c) then count(*)*max( -d) else max((a)) end+min(c) from t1)) else t1.a end-(abs(case when a=17 and e<=b then a when a>=e then t1.c else t1.c end+13)/abs(e))*(e))) from t1 where t1.a in (select d from t1 union select -t1.e from t1)),13) FROM t1 WHERE NOT (not coalesce((select max(case when f<=d | b | case when case when (t1.c in (f,19,c)) then t1.f when d>t1.b then t1.f else t1.f end<=c then 11 else c end- -t1.c-13 and t1.c in (select b from t1 union select -17 from t1) then t1.b else a end) from t1 where 11 between d and a), -17) not between t1.f and t1.f and t1.f>11 or (not exists(select 1 from t1 where t1.b in (select min(t1.d) from t1 union select min(c) from t1))))} -} {} -do_test randexpr-2.168 { - db eval {SELECT case when ((t1.e | (select min( -t1.f) from t1)*((abs(b)/abs(19)))-b<=t1.b and not e>13 or -f in (select count(distinct e)-min(t1.a) from t1 union select count(distinct f) from t1))) then 13 when 17 between f and 19 or 11 between b and 19 or not t1.f>e then t1.d else d | f end FROM t1 WHERE not case when t1.a=t1.a then c when ~case when case when t1.e in (select + -count(distinct t1.d) from t1 union select cast(avg(t1.a) AS integer) from t1) then (t1.e) when 17 in (13, -f,a) then t1.d else d end<17 then e else f end+17+a* -e+b+b>t1.e then t1.e else t1.a end13 or -f in (select count(distinct e)-min(t1.a) from t1 union select count(distinct f) from t1))) then 13 when 17 between f and 19 or 11 between b and 19 or not t1.f>e then t1.d else d | f end FROM t1 WHERE NOT (not case when t1.a=t1.a then c when ~case when case when t1.e in (select + -count(distinct t1.d) from t1 union select cast(avg(t1.a) AS integer) from t1) then (t1.e) when 17 in (13, -f,a) then t1.d else d end<17 then e else f end+17+a* -e+b+b>t1.e then t1.e else t1.a end13 or -f in (select count(distinct e)-min(t1.a) from t1 union select count(distinct f) from t1))) then 13 when 17 between f and 19 or 11 between b and 19 or not t1.f>e then t1.d else d & f end FROM t1 WHERE NOT (not case when t1.a=t1.a then c when ~case when case when t1.e in (select + -count(distinct t1.d) from t1 union select cast(avg(t1.a) AS integer) from t1) then (t1.e) when 17 in (13, -f,a) then t1.d else d end<17 then e else f end+17+a* -e+b+b>t1.e then t1.e else t1.a enda and 19 between 11 and b and 11 between a and b)),t1.f) | c in ( -t1.c,13,b) then 11 when f in (select min(t1.d) from t1 union select cast(avg(f) AS integer) from t1) then t1.b else a end and t1.a),t1.c))/abs(11))+ -f} -} {} -do_test randexpr-2.172 { - db eval {SELECT coalesce((select (select cast(avg(~13) AS integer)-count(distinct ~19-coalesce((select d-17 from t1 where case when (case 17 when b then d else (select min(11) | min(17) from t1)++t1.a end in (d, -c,t1.d)) then b else t1.c end between t1.a and (t1.e)),19)-t1.f) from t1) | (abs(t1.e)/abs(t1.e)) from t1 where (t1.c not in (( -t1.d),(t1.b),(d)))),t1.e) FROM t1 WHERE NOT (13 between 19 and ~ -(abs( -t1.d | coalesce((select t1.f from t1 where 19 not between + -case when ~~b+coalesce((select max(t1.d) from t1 where exists(select 1 from t1 where (select cast(avg(19) AS integer)-cast(avg(b) AS integer) from t1)<>a and 19 between 11 and b and 11 between a and b)),t1.f) | c in ( -t1.c,13,b) then 11 when f in (select min(t1.d) from t1 union select cast(avg(f) AS integer) from t1) then t1.b else a end and t1.a),t1.c))/abs(11))+ -f)} -} {-15} -do_test randexpr-2.173 { - db eval {SELECT coalesce((select (select cast(avg(~13) AS integer)-count(distinct ~19-coalesce((select d-17 from t1 where case when (case 17 when b then d else (select min(11) & min(17) from t1)++t1.a end in (d, -c,t1.d)) then b else t1.c end between t1.a and (t1.e)),19)-t1.f) from t1) & (abs(t1.e)/abs(t1.e)) from t1 where (t1.c not in (( -t1.d),(t1.b),(d)))),t1.e) FROM t1 WHERE NOT (13 between 19 and ~ -(abs( -t1.d | coalesce((select t1.f from t1 where 19 not between + -case when ~~b+coalesce((select max(t1.d) from t1 where exists(select 1 from t1 where (select cast(avg(19) AS integer)-cast(avg(b) AS integer) from t1)<>a and 19 between 11 and b and 11 between a and b)),t1.f) | c in ( -t1.c,13,b) then 11 when f in (select min(t1.d) from t1 union select cast(avg(f) AS integer) from t1) then t1.b else a end and t1.a),t1.c))/abs(11))+ -f)} -} {1} -do_test randexpr-2.174 { - db eval {SELECT coalesce((select max(+(d+a)*b) from t1 where (case e-t1.b when 17+11*13 then t1.a else 17 end-(17)<>(select cast(avg(t1.f) AS integer) from t1))),case when case when 11+13<>19 then 13 else t1.f end*e in (a,t1.f,t1.c) and not exists(select 1 from t1 where t1.b in (select - -count(distinct t1.b)*( -count(*)) from t1 union select count(distinct t1.e) from t1)) then t1.c else a end) FROM t1 WHERE case when t1.d in (select count(*)-count(*)+ -min(case d when t1.c then 19 else 11 end)*count(*) | min(19)-(max((e))) from t1 union select count(*) from t1) then c when exists(select 1 from t1 where exists(select 1 from t1 where not exists(select 1 from t1 where (abs(b)/abs(t1.c))>coalesce((select max(f) from t1 where f<=t1.a),t1.d)))) then f*t1.c+11 else t1.f end+e-e*t1.f<=17} -} {100000} -do_test randexpr-2.175 { - db eval {SELECT coalesce((select max(+(d+a)*b) from t1 where (case e-t1.b when 17+11*13 then t1.a else 17 end-(17)<>(select cast(avg(t1.f) AS integer) from t1))),case when case when 11+13<>19 then 13 else t1.f end*e in (a,t1.f,t1.c) and not exists(select 1 from t1 where t1.b in (select - -count(distinct t1.b)*( -count(*)) from t1 union select count(distinct t1.e) from t1)) then t1.c else a end) FROM t1 WHERE NOT (case when t1.d in (select count(*)-count(*)+ -min(case d when t1.c then 19 else 11 end)*count(*) | min(19)-(max((e))) from t1 union select count(*) from t1) then c when exists(select 1 from t1 where exists(select 1 from t1 where not exists(select 1 from t1 where (abs(b)/abs(t1.c))>coalesce((select max(f) from t1 where f<=t1.a),t1.d)))) then f*t1.c+11 else t1.f end+e-e*t1.f<=17)} -} {} -do_test randexpr-2.176 { - db eval {SELECT t1.c*case when t1.e>(select +cast(avg(13) AS integer)*min((11)* - -d | - -coalesce((select max(b) from t1 where (select cast(avg((abs(a)/abs(b-(e)))) AS integer) from t1)+11*c=a then t1.b else t1.b end | 19+a-c)*count(distinct t1.d)-+count(distinct t1.d) from t1) not in (19,d,b) and t1.f not between b and t1.f)))))} -} {} -do_test randexpr-2.177 { - db eval {SELECT t1.c*case when t1.e>(select +cast(avg(13) AS integer)*min((11)* - -d | - -coalesce((select max(b) from t1 where (select cast(avg((abs(a)/abs(b-(e)))) AS integer) from t1)+11*c=a then t1.b else t1.b end | 19+a-c)*count(distinct t1.d)-+count(distinct t1.d) from t1) not in (19,d,b) and t1.f not between b and t1.f))))))} -} {90000} -do_test randexpr-2.178 { - db eval {SELECT t1.c*case when t1.e>(select +cast(avg(13) AS integer)*min((11)* - -d & - -coalesce((select max(b) from t1 where (select cast(avg((abs(a)/abs(b-(e)))) AS integer) from t1)+11*c=a then t1.b else t1.b end | 19+a-c)*count(distinct t1.d)-+count(distinct t1.d) from t1) not in (19,d,b) and t1.f not between b and t1.f))))))} -} {120000} -do_test randexpr-2.179 { - db eval {SELECT case when not exists(select 1 from t1 where (not exists(select 1 from t1 where not exists(select 1 from t1 where not d*19=b))) or t1.a-a-t1.d*t1.f in (select ~case cast(avg(t1.d) AS integer) | count(*)+max(t1.c) when max(17) then cast(avg( -f) AS integer) else -min(e) end from t1 union select max( -13) from t1)) then (select abs((+ -min(a)) | min(t1.a)-cast(avg(t1.f) AS integer)) | max(e) from t1) else 11 end*a | t1.a*f FROM t1 WHERE t1.c in (c,t1.b,~e) and 13+19-t1.b | coalesce((select max(case d when +t1.e+13*13 then coalesce((select case when f=e or -f<=e and t1.d<>19),d) else d end) from t1 where t1.d=e or -f<=e and t1.d<>19),d) else d end) from t1 where t1.d=e or -f<=e and t1.d<>19),d) else d end) from t1 where t1.dt1.b then d*t1.f*17 else (b) end)+t1.f*13 when c then t1.a else t1.e end- -t1.f FROM t1 WHERE b-case when t1.b=t1.b and (coalesce((select max(t1.e) from t1 where t1.b in (select ~cast(avg(19) AS integer)+max(t1.b)+min(t1.e) from t1 union select max(t1.a) from t1) or exists(select 1 from t1 where 11 in (select max(t1.e) from t1 union select max(t1.f) from t1))),(abs(17)/abs(17)))) not between c and t1.a then 13 else 13 end | t1.c in (select ++cast(avg(f) AS integer)-(+(count(distinct 13) | max(19))-count(*) | -max(t1.e)) from t1 union select count(*) from t1)} -} {} -do_test randexpr-2.185 { - db eval {SELECT ~case +~c+(case when not exists(select 1 from t1 where t1.d in (select abs( -abs(max(t1.f)-count(distinct e)* -cast(avg(11) AS integer) | count(*))+min(f)*min( -17)*cast(avg(19) AS integer)) from t1 union select count(*) from t1)) or (t1.f)<>t1.b then d*t1.f*17 else (b) end)+t1.f*13 when c then t1.a else t1.e end- -t1.f FROM t1 WHERE NOT (b-case when t1.b=t1.b and (coalesce((select max(t1.e) from t1 where t1.b in (select ~cast(avg(19) AS integer)+max(t1.b)+min(t1.e) from t1 union select max(t1.a) from t1) or exists(select 1 from t1 where 11 in (select max(t1.e) from t1 union select max(t1.f) from t1))),(abs(17)/abs(17)))) not between c and t1.a then 13 else 13 end | t1.c in (select ++cast(avg(f) AS integer)-(+(count(distinct 13) | max(19))-count(*) | -max(t1.e)) from t1 union select count(*) from t1))} -} {99} -do_test randexpr-2.186 { - db eval {SELECT ~case +~c+(case when not exists(select 1 from t1 where t1.d in (select abs( -abs(max(t1.f)-count(distinct e)* -cast(avg(11) AS integer) & count(*))+min(f)*min( -17)*cast(avg(19) AS integer)) from t1 union select count(*) from t1)) or (t1.f)<>t1.b then d*t1.f*17 else (b) end)+t1.f*13 when c then t1.a else t1.e end- -t1.f FROM t1 WHERE NOT (b-case when t1.b=t1.b and (coalesce((select max(t1.e) from t1 where t1.b in (select ~cast(avg(19) AS integer)+max(t1.b)+min(t1.e) from t1 union select max(t1.a) from t1) or exists(select 1 from t1 where 11 in (select max(t1.e) from t1 union select max(t1.f) from t1))),(abs(17)/abs(17)))) not between c and t1.a then 13 else 13 end | t1.c in (select ++cast(avg(f) AS integer)-(+(count(distinct 13) | max(19))-count(*) | -max(t1.e)) from t1 union select count(*) from t1))} -} {99} -do_test randexpr-2.187 { - db eval {SELECT case when t1.c in (select c from t1 union select a from t1) then 11 when ((select max(19) from t1) | t1.a+e not between (case -19 when b*e-b-case when b<>~d*t1.d+t1.c*d then t1.d when t1.c=19 then f else d end-f*t1.d then t1.d else 13 end) and 13) then 11 else t1.b end FROM t1 WHERE t1.b*coalesce((select max(t1.d) from t1 where -f<=(select max(t1.e) from t1)*e),case when case when t1.e- -13>t1.b+t1.f+c then 13 else -d end in (select 19 from t1 union select t1.f from t1) then e when t1.b in (select ~count(distinct t1.a)+count(*) from t1 union select abs( - -((cast(avg(c) AS integer)))*(cast(avg(t1.b) AS integer))) from t1) then 17 else d end)+ -17 | t1.a-t1.d in (t1.e,f,f)} -} {} -do_test randexpr-2.188 { - db eval {SELECT case when t1.c in (select c from t1 union select a from t1) then 11 when ((select max(19) from t1) | t1.a+e not between (case -19 when b*e-b-case when b<>~d*t1.d+t1.c*d then t1.d when t1.c=19 then f else d end-f*t1.d then t1.d else 13 end) and 13) then 11 else t1.b end FROM t1 WHERE NOT (t1.b*coalesce((select max(t1.d) from t1 where -f<=(select max(t1.e) from t1)*e),case when case when t1.e- -13>t1.b+t1.f+c then 13 else -d end in (select 19 from t1 union select t1.f from t1) then e when t1.b in (select ~count(distinct t1.a)+count(*) from t1 union select abs( - -((cast(avg(c) AS integer)))*(cast(avg(t1.b) AS integer))) from t1) then 17 else d end)+ -17 | t1.a-t1.d in (t1.e,f,f))} -} {11} -do_test randexpr-2.189 { - db eval {SELECT case when t1.c in (select c from t1 union select a from t1) then 11 when ((select max(19) from t1) & t1.a+e not between (case -19 when b*e-b-case when b<>~d*t1.d+t1.c*d then t1.d when t1.c=19 then f else d end-f*t1.d then t1.d else 13 end) and 13) then 11 else t1.b end FROM t1 WHERE NOT (t1.b*coalesce((select max(t1.d) from t1 where -f<=(select max(t1.e) from t1)*e),case when case when t1.e- -13>t1.b+t1.f+c then 13 else -d end in (select 19 from t1 union select t1.f from t1) then e when t1.b in (select ~count(distinct t1.a)+count(*) from t1 union select abs( - -((cast(avg(c) AS integer)))*(cast(avg(t1.b) AS integer))) from t1) then 17 else d end)+ -17 | t1.a-t1.d in (t1.e,f,f))} -} {11} -do_test randexpr-2.190 { - db eval {SELECT ~(d)-(select case case cast(avg(t1.b- -~b) AS integer) when max(coalesce((select e from t1 where 11<>e),coalesce((select c from t1 where c not in (t1.e,a,(17)) or t1.b in ((b),t1.c,t1.f)),13))) then +cast(avg(d) AS integer) | case max(t1.c) when min((e)) then max(e)+cast(avg(t1.d) AS integer) else min(t1.f) end+max(d) else count(*) end | -cast(avg(t1.f) AS integer) | - -count(distinct c)*max(b) when count(distinct t1.d) then - -min(a) else count(*) end from t1) FROM t1 WHERE t1.c+a=t1.e+t1.c*t1.e | case t1.d when case when 13 in (select min(c) from t1 union select max(d) from t1) or t1.f>=13 then 19 when t1.c<=11 then -t1.b else 13 end then 13 else t1.e end or f in (select t1.a from t1 union select t1.f from t1) or (t1.at1.b and (((t1.d not between -a and t1.f))) or t1.a not in ( -t1.d,13,a) and de),coalesce((select c from t1 where c not in (t1.e,a,(17)) or t1.b in ((b),t1.c,t1.f)),13))) then +cast(avg(d) AS integer) | case max(t1.c) when min((e)) then max(e)+cast(avg(t1.d) AS integer) else min(t1.f) end+max(d) else count(*) end | -cast(avg(t1.f) AS integer) | - -count(distinct c)*max(b) when count(distinct t1.d) then - -min(a) else count(*) end from t1) FROM t1 WHERE NOT (t1.c+a=t1.e+t1.c*t1.e | case t1.d when case when 13 in (select min(c) from t1 union select max(d) from t1) or t1.f>=13 then 19 when t1.c<=11 then -t1.b else 13 end then 13 else t1.e end or f in (select t1.a from t1 union select t1.f from t1) or (t1.at1.b and (((t1.d not between -a and t1.f))) or t1.a not in ( -t1.d,13,a) and de),coalesce((select c from t1 where c not in (t1.e,a,(17)) or t1.b in ((b),t1.c,t1.f)),13))) then +cast(avg(d) AS integer) & case max(t1.c) when min((e)) then max(e)+cast(avg(t1.d) AS integer) else min(t1.f) end+max(d) else count(*) end & -cast(avg(t1.f) AS integer) & - -count(distinct c)*max(b) when count(distinct t1.d) then - -min(a) else count(*) end from t1) FROM t1 WHERE t1.c+a=t1.e+t1.c*t1.e | case t1.d when case when 13 in (select min(c) from t1 union select max(d) from t1) or t1.f>=13 then 19 when t1.c<=11 then -t1.b else 13 end then 13 else t1.e end or f in (select t1.a from t1 union select t1.f from t1) or (t1.at1.b and (((t1.d not between -a and t1.f))) or t1.a not in ( -t1.d,13,a) and dt1.c or ((t1.f>e)) and t1.e-19+c+ -d*t1.d+11<>17+coalesce((select max(t1.d) from t1 where 17+t1.c11))),11) | case e when c then a else t1.b end+a FROM t1 WHERE case when d not in (a,11,(13)) then a when exists(select 1 from t1 where case when case when case when (t1.c) in (c,e,b) then f else (19) end-t1.f=t1.a then 11 else t1.c end in (select abs(~~max(t1.c)) from t1 union select cast(avg(c) AS integer) from t1)) then 11 else t1.f end in (select (~~count(*)*cast(avg(19) AS integer)) from t1 union select min(t1.d)+ -count(distinct f) from t1)} -} {} -do_test randexpr-2.197 { - db eval {SELECT coalesce((select max(~t1.d) from t1 where not exists(select 1 from t1 where exists(select 1 from t1 where c>t1.c or ((t1.f>e)) and t1.e-19+c+ -d*t1.d+11<>17+coalesce((select max(t1.d) from t1 where 17+t1.c11))),11) | case e when c then a else t1.b end+a FROM t1 WHERE NOT (case when d not in (a,11,(13)) then a when exists(select 1 from t1 where case when case when case when (t1.c) in (c,e,b) then f else (19) end-t1.f=t1.a then 11 else t1.c end in (select abs(~~max(t1.c)) from t1 union select cast(avg(c) AS integer) from t1)) then 11 else t1.f end in (select (~~count(*)*cast(avg(19) AS integer)) from t1 union select min(t1.d)+ -count(distinct f) from t1))} -} {303} -do_test randexpr-2.198 { - db eval {SELECT coalesce((select max(~t1.d) from t1 where not exists(select 1 from t1 where exists(select 1 from t1 where c>t1.c or ((t1.f>e)) and t1.e-19+c+ -d*t1.d+11<>17+coalesce((select max(t1.d) from t1 where 17+t1.c11))),11) & case e when c then a else t1.b end+a FROM t1 WHERE NOT (case when d not in (a,11,(13)) then a when exists(select 1 from t1 where case when case when case when (t1.c) in (c,e,b) then f else (19) end-t1.f=t1.a then 11 else t1.c end in (select abs(~~max(t1.c)) from t1 union select cast(avg(c) AS integer) from t1)) then 11 else t1.f end in (select (~~count(*)*cast(avg(19) AS integer)) from t1 union select min(t1.d)+ -count(distinct f) from t1))} -} {8} -do_test randexpr-2.199 { - db eval {SELECT case when t1.e*t1.b<>e then 19 else -11-b+coalesce((select max(t1.e+t1.f) from t1 where 11+f*t1.c<>t1.a*(~f+case when t1.f in (t1.f, -((13)),19) then t1.a when t1.e>17 then a else a end+b-t1.e-(f))),13)+d end+t1.b* -c FROM t1 WHERE exists(select 1 from t1 where coalesce((select max(t1.a*t1.e+13) from t1 where 13 in ((abs(e)/abs(t1.a)),a+t1.c,17*t1.c)),(select -case max(c) | cast(avg(e) AS integer) when ~+ -count(distinct coalesce((select d from t1 where exists(select 1 from t1 where -17e then 19 else -11-b+coalesce((select max(t1.e+t1.f) from t1 where 11+f*t1.c<>t1.a*(~f+case when t1.f in (t1.f, -((13)),19) then t1.a when t1.e>17 then a else a end+b-t1.e-(f))),13)+d end+t1.b* -c FROM t1 WHERE NOT (exists(select 1 from t1 where coalesce((select max(t1.a*t1.e+13) from t1 where 13 in ((abs(e)/abs(t1.a)),a+t1.c,17*t1.c)),(select -case max(c) | cast(avg(e) AS integer) when ~+ -count(distinct coalesce((select d from t1 where exists(select 1 from t1 where -17c then t1.b when 17 not between t1.e and c then 11 else f end in (select a from t1 union select 13 from t1))),11)) from t1 where not exists(select 1 from t1 where f=17)),e) FROM t1 WHERE ( -13 in (13,b,case when 19=11 then t1.d else case when (d | b-case when t1.f-(select +abs(cast(avg( -17* -17) AS integer)*count(*)+max(t1.e)) from t1)*t1.f not in (f,a,c) then t1.a else t1.b end between 19 and e) then a else 13 end end-t1.a) or t1.c<19)} -} {} -do_test randexpr-2.202 { - db eval {SELECT coalesce((select max(coalesce((select 19 from t1 where (case when ((abs(coalesce((select max(case when t1.a between (t1.c)+ -b and d then e else d end) from t1 where t1.e in (select (count(*)) from t1 union select max( -a)-count(distinct t1.c)-((min(13))) | max((t1.f)) from t1)),11))/abs(19)))+d>c then t1.b when 17 not between t1.e and c then 11 else f end in (select a from t1 union select 13 from t1))),11)) from t1 where not exists(select 1 from t1 where f=17)),e) FROM t1 WHERE NOT (( -13 in (13,b,case when 19=11 then t1.d else case when (d | b-case when t1.f-(select +abs(cast(avg( -17* -17) AS integer)*count(*)+max(t1.e)) from t1)*t1.f not in (f,a,c) then t1.a else t1.b end between 19 and e) then a else 13 end end-t1.a) or t1.c<19))} -} {11} -do_test randexpr-2.203 { - db eval {SELECT coalesce((select max(coalesce((select 19 from t1 where (case when ((abs(coalesce((select max(case when t1.a between (t1.c)+ -b and d then e else d end) from t1 where t1.e in (select (count(*)) from t1 union select max( -a)-count(distinct t1.c)-((min(13))) & max((t1.f)) from t1)),11))/abs(19)))+d>c then t1.b when 17 not between t1.e and c then 11 else f end in (select a from t1 union select 13 from t1))),11)) from t1 where not exists(select 1 from t1 where f=17)),e) FROM t1 WHERE NOT (( -13 in (13,b,case when 19=11 then t1.d else case when (d | b-case when t1.f-(select +abs(cast(avg( -17* -17) AS integer)*count(*)+max(t1.e)) from t1)*t1.f not in (f,a,c) then t1.a else t1.b end between 19 and e) then a else 13 end end-t1.a) or t1.c<19))} -} {11} -do_test randexpr-2.204 { - db eval {SELECT -~d*19-a-c | t1.c+(abs(case -19 | ~case t1.d when c then t1.f else c end when +t1.d then 17 else case case when b>case case when t1.c=d or -t1.a=17 then ((a)) when t1.a<>d then (t1.c) else a end+19+11 when 19 then t1.a else b end-(t1.e) then f else t1.c end when 17 then t1.b else a end end)/abs(d))+t1.b FROM t1 WHERE t1.f+13<>19} -} {7671} -do_test randexpr-2.205 { - db eval {SELECT -~d*19-a-c | t1.c+(abs(case -19 | ~case t1.d when c then t1.f else c end when +t1.d then 17 else case case when b>case case when t1.c=d or -t1.a=17 then ((a)) when t1.a<>d then (t1.c) else a end+19+11 when 19 then t1.a else b end-(t1.e) then f else t1.c end when 17 then t1.b else a end end)/abs(d))+t1.b FROM t1 WHERE NOT (t1.f+13<>19)} -} {} -do_test randexpr-2.206 { - db eval {SELECT -~d*19-a-c & t1.c+(abs(case -19 & ~case t1.d when c then t1.f else c end when +t1.d then 17 else case case when b>case case when t1.c=d or -t1.a=17 then ((a)) when t1.a<>d then (t1.c) else a end+19+11 when 19 then t1.a else b end-(t1.e) then f else t1.c end when 17 then t1.b else a end end)/abs(d))+t1.b FROM t1 WHERE t1.f+13<>19} -} {48} -do_test randexpr-2.207 { - db eval {SELECT (abs(coalesce((select b from t1 where t1.a>(abs(t1.f)/abs(coalesce((select 13 from t1 where not coalesce((select (select cast(avg(case when case when t1.e not between t1.c and 19 then t1.d when d in (11,t1.b,13) then e else 17 end*b between 13 and (t1.b) then t1.f when a<>19 and t1.c not in (a,t1.f,b) then t1.e else t1.f end) AS integer) from t1)+t1.c-b* -a*f from t1 where (t1.d in (select c from t1 union select t1.b from t1))),t1.e)-c<>c),t1.c)))),e))/abs(t1.e)) FROM t1 WHERE (t1.a-t1.c-case when eb then f else d end | t1.d) AS integer) from t1 union select count(distinct 11) from t1)),c) else t1.f end when f then 19 else t1.b end(abs(t1.f)/abs(coalesce((select 13 from t1 where not coalesce((select (select cast(avg(case when case when t1.e not between t1.c and 19 then t1.d when d in (11,t1.b,13) then e else 17 end*b between 13 and (t1.b) then t1.f when a<>19 and t1.c not in (a,t1.f,b) then t1.e else t1.f end) AS integer) from t1)+t1.c-b* -a*f from t1 where (t1.d in (select c from t1 union select t1.b from t1))),t1.e)-c<>c),t1.c)))),e))/abs(t1.e)) FROM t1 WHERE NOT ((t1.a-t1.c-case when eb then f else d end | t1.d) AS integer) from t1 union select count(distinct 11) from t1)),c) else t1.f end when f then 19 else t1.b endd then case 11 when ~+case t1.a when (abs(t1.a)/abs( -c))*t1.c+ -a+coalesce((select t1.c from t1 where ((abs(e)/abs((case when (11>=e) then -17 when (11)<=a then e else b end)+t1.f))>19)),b)-d then c else 17 end+ -b then ( -t1.a) else c end when 11<=t1.f then 11 else 17 end FROM t1 WHERE (coalesce((select max(17) from t1 where ~case ((select min( -e-a)*+cast(avg(11) AS integer)*count(*)-(count(*))*max(b)*min( -13)+count(*)-min( -13) from t1)+19)+a when e then (select min(f) from t1) else coalesce((select t1.f from t1 where 17>t1.c),19) end=11 and f=t1.b),19) not between -a and t1.a)} -} {} -do_test randexpr-2.210 { - db eval {SELECT case when t1.d<>d then case 11 when ~+case t1.a when (abs(t1.a)/abs( -c))*t1.c+ -a+coalesce((select t1.c from t1 where ((abs(e)/abs((case when (11>=e) then -17 when (11)<=a then e else b end)+t1.f))>19)),b)-d then c else 17 end+ -b then ( -t1.a) else c end when 11<=t1.f then 11 else 17 end FROM t1 WHERE NOT ((coalesce((select max(17) from t1 where ~case ((select min( -e-a)*+cast(avg(11) AS integer)*count(*)-(count(*))*max(b)*min( -13)+count(*)-min( -13) from t1)+19)+a when e then (select min(f) from t1) else coalesce((select t1.f from t1 where 17>t1.c),19) end=11 and f=t1.b),19) not between -a and t1.a))} -} {11} -do_test randexpr-2.211 { - db eval {SELECT coalesce((select max(t1.e) from t1 where not d in (select (abs(t1.f)/abs(~case when (abs(t1.e)/abs( -t1.a))+t1.b-t1.e*t1.a-t1.c between b and t1.e then f else a end+19)) from t1 union select 13 from t1) or (t1.e=(a)) and -11 in (select t1.f from t1 union select c from t1)),a)*coalesce((select max(f) from t1 where d=f),f)*c+(t1.c) FROM t1 WHERE case when +(abs(19)/abs(13*t1.e))<>11 then 19 when coalesce((select max(c) from t1 where t1.e+t1.a between t1.f and f),t1.a)=(a) then d else -19 end<=f or (((e in (b,t1.b,13)))) or b<(f) and t1.a<>11 or exists(select 1 from t1 where t1.d=d) or (t1.a)<>a or t1.a<>e} -} {90000300} -do_test randexpr-2.212 { - db eval {SELECT coalesce((select max(t1.e) from t1 where not d in (select (abs(t1.f)/abs(~case when (abs(t1.e)/abs( -t1.a))+t1.b-t1.e*t1.a-t1.c between b and t1.e then f else a end+19)) from t1 union select 13 from t1) or (t1.e=(a)) and -11 in (select t1.f from t1 union select c from t1)),a)*coalesce((select max(f) from t1 where d=f),f)*c+(t1.c) FROM t1 WHERE NOT (case when +(abs(19)/abs(13*t1.e))<>11 then 19 when coalesce((select max(c) from t1 where t1.e+t1.a between t1.f and f),t1.a)=(a) then d else -19 end<=f or (((e in (b,t1.b,13)))) or b<(f) and t1.a<>11 or exists(select 1 from t1 where t1.d=d) or (t1.a)<>a or t1.a<>e)} -} {} -do_test randexpr-2.213 { - db eval {SELECT case (select abs(count(distinct -17+(abs(c)/abs(case when exists(select 1 from t1 where (17<>(f))) then e when t1.c not between 11 and t1.d then +11 else t1.e end | b))+d)*+ -(min(f)*max(t1.e))*+cast(avg(t1.f) AS integer) | count(distinct (f))- - -count(*)-cast(avg((e)) AS integer)) from t1) when (abs(11)/abs(t1.e)) then 13 else b end FROM t1 WHERE case when t1.e not between coalesce((select (select count(*)+case max(17) when count(distinct 19-t1.c*t1.c-e) then -min(b)-cast(avg((13)) AS integer)*count(*) else min(19) end from t1)*a*t1.d-17*a+17 from t1 where t1.d not in (13,t1.f, -c)),t1.c) and e then ( -b) when (13)>=(e) then t1.c else e end in (t1.d,t1.c, -11)} -} {} -do_test randexpr-2.214 { - db eval {SELECT case (select abs(count(distinct -17+(abs(c)/abs(case when exists(select 1 from t1 where (17<>(f))) then e when t1.c not between 11 and t1.d then +11 else t1.e end | b))+d)*+ -(min(f)*max(t1.e))*+cast(avg(t1.f) AS integer) | count(distinct (f))- - -count(*)-cast(avg((e)) AS integer)) from t1) when (abs(11)/abs(t1.e)) then 13 else b end FROM t1 WHERE NOT (case when t1.e not between coalesce((select (select count(*)+case max(17) when count(distinct 19-t1.c*t1.c-e) then -min(b)-cast(avg((13)) AS integer)*count(*) else min(19) end from t1)*a*t1.d-17*a+17 from t1 where t1.d not in (13,t1.f, -c)),t1.c) and e then ( -b) when (13)>=(e) then t1.c else e end in (t1.d,t1.c, -11))} -} {200} -do_test randexpr-2.215 { - db eval {SELECT case (select abs(count(distinct -17+(abs(c)/abs(case when exists(select 1 from t1 where (17<>(f))) then e when t1.c not between 11 and t1.d then +11 else t1.e end & b))+d)*+ -(min(f)*max(t1.e))*+cast(avg(t1.f) AS integer) & count(distinct (f))- - -count(*)-cast(avg((e)) AS integer)) from t1) when (abs(11)/abs(t1.e)) then 13 else b end FROM t1 WHERE NOT (case when t1.e not between coalesce((select (select count(*)+case max(17) when count(distinct 19-t1.c*t1.c-e) then -min(b)-cast(avg((13)) AS integer)*count(*) else min(19) end from t1)*a*t1.d-17*a+17 from t1 where t1.d not in (13,t1.f, -c)),t1.c) and e then ( -b) when (13)>=(e) then t1.c else e end in (t1.d,t1.c, -11))} -} {200} -do_test randexpr-2.216 { - db eval {SELECT -case when dt1.d))) then case +coalesce((select case when 13>t1.b then 17+t1.d+d when 17 in (t1.b,b,b) and 17<=t1.e then (c) else t1.d end from t1 where 17b+t1.a*t1.a-coalesce((select max(d) from t1 where (17 between (t1.d) and (f))),t1.e)-t1.c and t1.d>11)} -} {} -do_test randexpr-2.217 { - db eval {SELECT -case when dt1.d))) then case +coalesce((select case when 13>t1.b then 17+t1.d+d when 17 in (t1.b,b,b) and 17<=t1.e then (c) else t1.d end from t1 where 17b+t1.a*t1.a-coalesce((select max(d) from t1 where (17 between (t1.d) and (f))),t1.e)-t1.c and t1.d>11))} -} {-447} -do_test randexpr-2.218 { - db eval {SELECT (select + -max(t1.c)*abs(min(t1.b) | case (abs(min(13)))+count(*)-max(t1.a) when max(~13) then abs( -~min(t1.b)+abs(count(distinct (select +++cast(avg(t1.b) AS integer)-case -count(*) when -count(*) then -count(distinct b) else count(distinct c) end from t1)))) else count(*) end-max((e))) | -cast(avg(t1.e) AS integer) from t1) FROM t1 WHERE exists(select 1 from t1 where -f-d*t1.f-c-coalesce((select max(t1.a) from t1 where 11 not in ((select count(*) from t1),coalesce((select max(t1.f+e) from t1 where t1.b in (select count(distinct t1.c) from t1 union select -case abs(abs(count(distinct 13))) when max(t1.b) then abs(cast(avg(11) AS integer)) else -cast(avg(17) AS integer) end from t1)),case t1.f when -b then 17 else 17 end)- -t1.f,b)),a)+f+c-t1.ce then 19 else t1.c-t1.d end else b end),(e))-t1.a+(13)-19)) FROM t1 WHERE (not t1.e not in (case when exists(select 1 from t1 where 17<=t1.f*17*t1.b) then f+coalesce((select max(t1.b-c-11+t1.c-a) from t1 where 13 in (select t1.e from t1 union select case when a not between t1.f and d or fe then 19 else t1.c-t1.d end else b end),(e))-t1.a+(13)-19)) FROM t1 WHERE NOT ((not t1.e not in (case when exists(select 1 from t1 where 17<=t1.f*17*t1.b) then f+coalesce((select max(t1.b-c-11+t1.c-a) from t1 where 13 in (select t1.e from t1 union select case when a not between t1.f and d or f=t1.b) and (t1.e<>( -t1.d)) and (t1.c<=13)) then c else d+11 end<=case when (t1.c)>=19 then (t1.e) when (f) not between 11 and f then coalesce((select 13 from t1 where -t1.b>=d),13) else b end} -} {203} -do_test randexpr-2.227 { - db eval {SELECT (select min(b) | case case cast(avg(c) AS integer) when ~+~count(distinct -19*f*f) then count(distinct (select cast(avg(d-case when t1.a<=19 then 19 else 11 end+f+a) AS integer) from t1))+count(distinct t1.c)+ -+ -count(*) | - -max((17))*min(t1.b)*min((e)) else max(t1.c) end when ( - - -min(a)) then ( -min(c)) else max((11)) end from t1) FROM t1 WHERE NOT (case when (((exists(select 1 from t1 where ~t1.d-t1.f between -+t1.f*c and f and not t1.e in (19,a,13))) or -e>=t1.b) and (t1.e<>( -t1.d)) and (t1.c<=13)) then c else d+11 end<=case when (t1.c)>=19 then (t1.e) when (f) not between 11 and f then coalesce((select 13 from t1 where -t1.b>=d),13) else b end)} -} {} -do_test randexpr-2.228 { - db eval {SELECT (select min(b) & case case cast(avg(c) AS integer) when ~+~count(distinct -19*f*f) then count(distinct (select cast(avg(d-case when t1.a<=19 then 19 else 11 end+f+a) AS integer) from t1))+count(distinct t1.c)+ -+ -count(*) & - -max((17))*min(t1.b)*min((e)) else max(t1.c) end when ( - - -min(a)) then ( -min(c)) else max((11)) end from t1) FROM t1 WHERE case when (((exists(select 1 from t1 where ~t1.d-t1.f between -+t1.f*c and f and not t1.e in (19,a,13))) or -e>=t1.b) and (t1.e<>( -t1.d)) and (t1.c<=13)) then c else d+11 end<=case when (t1.c)>=19 then (t1.e) when (f) not between 11 and f then coalesce((select 13 from t1 where -t1.b>=d),13) else b end} -} {8} -do_test randexpr-2.229 { - db eval {SELECT case when 19-b in (select (min(case coalesce((select e from t1 where (c not between c and e)),(select abs(count(distinct coalesce((select max( -coalesce((select max(17) from t1 where (d)>17 and c not between d and b),11)-d) from t1 where ((11)) not in (d,d,e)), - -e))) from t1)+t1.e+t1.a) when f then t1.e else t1.a end)) from t1 union select max(11) from t1) then c else f end+t1.e FROM t1 WHERE coalesce((select max(d) from t1 where coalesce((select max(case when (a++19=case t1.d when t1.e then t1.b else t1.a end*f) and -13=a then case t1.d+13 when t1.f then 17 else t1.f end when (11 not in (d,17,t1.f)) then e else 11 end+b*t1.b) from t1 where exists(select 1 from t1 where exists(select 1 from t1 where t1.f in (select t1.e from t1 union select b from t1)))),(d))<=c),a) between t1.f and d} -} {} -do_test randexpr-2.230 { - db eval {SELECT case when 19-b in (select (min(case coalesce((select e from t1 where (c not between c and e)),(select abs(count(distinct coalesce((select max( -coalesce((select max(17) from t1 where (d)>17 and c not between d and b),11)-d) from t1 where ((11)) not in (d,d,e)), - -e))) from t1)+t1.e+t1.a) when f then t1.e else t1.a end)) from t1 union select max(11) from t1) then c else f end+t1.e FROM t1 WHERE NOT (coalesce((select max(d) from t1 where coalesce((select max(case when (a++19=case t1.d when t1.e then t1.b else t1.a end*f) and -13=a then case t1.d+13 when t1.f then 17 else t1.f end when (11 not in (d,17,t1.f)) then e else 11 end+b*t1.b) from t1 where exists(select 1 from t1 where exists(select 1 from t1 where t1.f in (select t1.e from t1 union select b from t1)))),(d))<=c),a) between t1.f and d)} -} {1100} -do_test randexpr-2.231 { - db eval {SELECT -t1.e*coalesce((select max(17) from t1 where (11*(select case -abs( -+count(*)) when -case +(cast(avg( -f) AS integer)) | (abs(cast(avg(c) AS integer))) when min(d) then -max(t1.f) else count(*) end then cast(avg( -t1.f) AS integer) else max(b) end from t1)*~t1.e*case (select min(e) from t1) when 17-t1.b then (e) else t1.f+t1.f end) in (select t1.d from t1 union select 19 from t1)), -t1.a) FROM t1 WHERE (select min(19) from t1) in (select 17 from t1 union select -11+t1.d+t1.c from t1)} -} {} -do_test randexpr-2.232 { - db eval {SELECT -t1.e*coalesce((select max(17) from t1 where (11*(select case -abs( -+count(*)) when -case +(cast(avg( -f) AS integer)) | (abs(cast(avg(c) AS integer))) when min(d) then -max(t1.f) else count(*) end then cast(avg( -t1.f) AS integer) else max(b) end from t1)*~t1.e*case (select min(e) from t1) when 17-t1.b then (e) else t1.f+t1.f end) in (select t1.d from t1 union select 19 from t1)), -t1.a) FROM t1 WHERE NOT ((select min(19) from t1) in (select 17 from t1 union select -11+t1.d+t1.c from t1))} -} {50000} -do_test randexpr-2.233 { - db eval {SELECT -t1.e*coalesce((select max(17) from t1 where (11*(select case -abs( -+count(*)) when -case +(cast(avg( -f) AS integer)) & (abs(cast(avg(c) AS integer))) when min(d) then -max(t1.f) else count(*) end then cast(avg( -t1.f) AS integer) else max(b) end from t1)*~t1.e*case (select min(e) from t1) when 17-t1.b then (e) else t1.f+t1.f end) in (select t1.d from t1 union select 19 from t1)), -t1.a) FROM t1 WHERE NOT ((select min(19) from t1) in (select 17 from t1 union select -11+t1.d+t1.c from t1))} -} {50000} -do_test randexpr-2.234 { - db eval {SELECT (coalesce((select max(case when t1.e>= -e | 13-19*d then case when c not in (+(select count(*) from t1),coalesce((select max(t1.a) from t1 where 13 in (select case count(distinct t1.a) | count(*) when cast(avg(t1.b) AS integer) then count(distinct a) else min(11) end from t1 union select count(*) from t1)),19),t1.a) then t1.c else c end when t1.f in (select t1.f from t1 union select t1.e from t1) then t1.e else -t1.e end) from t1 where (17 in (e,d,a))),t1.d)* -19) FROM t1 WHERE (((abs(t1.f)/abs(d)) in (select case (case max(coalesce((select max(e*(t1.d*13+t1.b)-t1.b) from t1 where t1.a=13),(t1.c))) when (case max(t1.a) when -abs(max(17))-count(distinct 19) then cast(avg(t1.d) AS integer) else max(13) end)*count(distinct t1.c) then (max((t1.b))) else min(19) end) when max(f) then -(count(distinct t1.f)) else min(t1.b) end from t1 union select cast(avg(13) AS integer) from t1) and (13 in (select ((min(b))) from t1 union select - -count(*) from t1))))} -} {} -do_test randexpr-2.235 { - db eval {SELECT (coalesce((select max(case when t1.e>= -e | 13-19*d then case when c not in (+(select count(*) from t1),coalesce((select max(t1.a) from t1 where 13 in (select case count(distinct t1.a) | count(*) when cast(avg(t1.b) AS integer) then count(distinct a) else min(11) end from t1 union select count(*) from t1)),19),t1.a) then t1.c else c end when t1.f in (select t1.f from t1 union select t1.e from t1) then t1.e else -t1.e end) from t1 where (17 in (e,d,a))),t1.d)* -19) FROM t1 WHERE NOT ((((abs(t1.f)/abs(d)) in (select case (case max(coalesce((select max(e*(t1.d*13+t1.b)-t1.b) from t1 where t1.a=13),(t1.c))) when (case max(t1.a) when -abs(max(17))-count(distinct 19) then cast(avg(t1.d) AS integer) else max(13) end)*count(distinct t1.c) then (max((t1.b))) else min(19) end) when max(f) then -(count(distinct t1.f)) else min(t1.b) end from t1 union select cast(avg(13) AS integer) from t1) and (13 in (select ((min(b))) from t1 union select - -count(*) from t1)))))} -} {-7600} -do_test randexpr-2.236 { - db eval {SELECT (coalesce((select max(case when t1.e>= -e & 13-19*d then case when c not in (+(select count(*) from t1),coalesce((select max(t1.a) from t1 where 13 in (select case count(distinct t1.a) & count(*) when cast(avg(t1.b) AS integer) then count(distinct a) else min(11) end from t1 union select count(*) from t1)),19),t1.a) then t1.c else c end when t1.f in (select t1.f from t1 union select t1.e from t1) then t1.e else -t1.e end) from t1 where (17 in (e,d,a))),t1.d)* -19) FROM t1 WHERE NOT ((((abs(t1.f)/abs(d)) in (select case (case max(coalesce((select max(e*(t1.d*13+t1.b)-t1.b) from t1 where t1.a=13),(t1.c))) when (case max(t1.a) when -abs(max(17))-count(distinct 19) then cast(avg(t1.d) AS integer) else max(13) end)*count(distinct t1.c) then (max((t1.b))) else min(19) end) when max(f) then -(count(distinct t1.f)) else min(t1.b) end from t1 union select cast(avg(13) AS integer) from t1) and (13 in (select ((min(b))) from t1 union select - -count(*) from t1)))))} -} {-7600} -do_test randexpr-2.237 { - db eval {SELECT case when case when b in (select abs(abs( -max(case c+d when f then f else 19 end | c)-( -case min(c) when -(cast(avg((t1.f)) AS integer)) then count(*) else ((cast(avg(t1.b) AS integer))) end))+count(*)+(max(17))) from t1 union select count(*) from t1) then t1.a when ~13*t1.a- -c not in (b,e,19) then t1.c else (t1.d) end<=(b) and 13 between t1.f and 11 then t1.f else -19 end FROM t1 WHERE d>=case when t1.d+case when ( -17)-c>11 or b in ((select min(13)+ -cast(avg(11) AS integer) from t1)+~t1.f, -c,(13)) and e in (select (d) from t1 union select f from t1) then t1.a when d= -t1.d then a- -17 else 17 end-t1.c>d then 11 when exists(select 1 from t1 where 17 not between t1.b and t1.b) then t1.b else (t1.a) end} -} {-19} -do_test randexpr-2.238 { - db eval {SELECT case when case when b in (select abs(abs( -max(case c+d when f then f else 19 end | c)-( -case min(c) when -(cast(avg((t1.f)) AS integer)) then count(*) else ((cast(avg(t1.b) AS integer))) end))+count(*)+(max(17))) from t1 union select count(*) from t1) then t1.a when ~13*t1.a- -c not in (b,e,19) then t1.c else (t1.d) end<=(b) and 13 between t1.f and 11 then t1.f else -19 end FROM t1 WHERE NOT (d>=case when t1.d+case when ( -17)-c>11 or b in ((select min(13)+ -cast(avg(11) AS integer) from t1)+~t1.f, -c,(13)) and e in (select (d) from t1 union select f from t1) then t1.a when d= -t1.d then a- -17 else 17 end-t1.c>d then 11 when exists(select 1 from t1 where 17 not between t1.b and t1.b) then t1.b else (t1.a) end)} -} {} -do_test randexpr-2.239 { - db eval {SELECT case when case when b in (select abs(abs( -max(case c+d when f then f else 19 end & c)-( -case min(c) when -(cast(avg((t1.f)) AS integer)) then count(*) else ((cast(avg(t1.b) AS integer))) end))+count(*)+(max(17))) from t1 union select count(*) from t1) then t1.a when ~13*t1.a- -c not in (b,e,19) then t1.c else (t1.d) end<=(b) and 13 between t1.f and 11 then t1.f else -19 end FROM t1 WHERE d>=case when t1.d+case when ( -17)-c>11 or b in ((select min(13)+ -cast(avg(11) AS integer) from t1)+~t1.f, -c,(13)) and e in (select (d) from t1 union select f from t1) then t1.a when d= -t1.d then a- -17 else 17 end-t1.c>d then 11 when exists(select 1 from t1 where 17 not between t1.b and t1.b) then t1.b else (t1.a) end} -} {-19} -do_test randexpr-2.240 { - db eval {SELECT e-coalesce((select coalesce((select max(19) from t1 where (coalesce((select max(case 11 when b then 13 else t1.a end) from t1 where 19 not in (c,t1.f,b)),t1.a)+t1.d in (select 17 from t1 union select 19 from t1) and 11 in (13,t1.c,17) or 19 not in (t1.f,a,17) or t1.e not between 13 and f and a>=d)),(a)-17+t1.f)+t1.a+17 from t1 where not exists(select 1 from t1 where a>t1.f)),t1.b) FROM t1 WHERE t1.a-17 in (select (abs(count(*)))-case case case abs(abs(count(*))) when min(t1.f) then count(*) else cast(avg(+t1.a+(e) | 19*e+t1.f) AS integer) end when abs(+cast(avg(b) AS integer) | count(distinct (13))*+~ -(min(e)) | cast(avg(19) AS integer)) then cast(avg(19) AS integer) else count(distinct t1.c) end | min(t1.d) when count(*) then (count(distinct d)) else (min(11)) end from t1 union select (cast(avg(t1.a) AS integer)) from t1)} -} {} -do_test randexpr-2.241 { - db eval {SELECT e-coalesce((select coalesce((select max(19) from t1 where (coalesce((select max(case 11 when b then 13 else t1.a end) from t1 where 19 not in (c,t1.f,b)),t1.a)+t1.d in (select 17 from t1 union select 19 from t1) and 11 in (13,t1.c,17) or 19 not in (t1.f,a,17) or t1.e not between 13 and f and a>=d)),(a)-17+t1.f)+t1.a+17 from t1 where not exists(select 1 from t1 where a>t1.f)),t1.b) FROM t1 WHERE NOT (t1.a-17 in (select (abs(count(*)))-case case case abs(abs(count(*))) when min(t1.f) then count(*) else cast(avg(+t1.a+(e) | 19*e+t1.f) AS integer) end when abs(+cast(avg(b) AS integer) | count(distinct (13))*+~ -(min(e)) | cast(avg(19) AS integer)) then cast(avg(19) AS integer) else count(distinct t1.c) end | min(t1.d) when count(*) then (count(distinct d)) else (min(11)) end from t1 union select (cast(avg(t1.a) AS integer)) from t1))} -} {364} -do_test randexpr-2.242 { - db eval {SELECT -coalesce((select case when b>19 | f-(select abs(max(t1.b+case when e>17 then 11 else f end)+count(*)) from t1) and case when (19<11*t1.d*t1.b) then 13 else t1.e end not between c and b then d+17 else c end-f from t1 where t1.b>=f),t1.c)+17-a FROM t1 WHERE +c in (+~a+case when ((case t1.d when coalesce((select f from t1 where e in (select count(distinct t1.e) from t1 union select min((abs(t1.c)/abs(e | b)) | d* -t1.d) from t1)),t1.e)+a then c else b end in (select -cast(avg(t1.c) AS integer)-~cast(avg(11) AS integer) from t1 union select -count(distinct 19) from t1))) then -e*19 else 13 end,t1.a,d)} -} {} -do_test randexpr-2.243 { - db eval {SELECT -coalesce((select case when b>19 | f-(select abs(max(t1.b+case when e>17 then 11 else f end)+count(*)) from t1) and case when (19<11*t1.d*t1.b) then 13 else t1.e end not between c and b then d+17 else c end-f from t1 where t1.b>=f),t1.c)+17-a FROM t1 WHERE NOT (+c in (+~a+case when ((case t1.d when coalesce((select f from t1 where e in (select count(distinct t1.e) from t1 union select min((abs(t1.c)/abs(e | b)) | d* -t1.d) from t1)),t1.e)+a then c else b end in (select -cast(avg(t1.c) AS integer)-~cast(avg(11) AS integer) from t1 union select -count(distinct 19) from t1))) then -e*19 else 13 end,t1.a,d))} -} {-383} -do_test randexpr-2.244 { - db eval {SELECT -coalesce((select case when b>19 & f-(select abs(max(t1.b+case when e>17 then 11 else f end)+count(*)) from t1) and case when (19<11*t1.d*t1.b) then 13 else t1.e end not between c and b then d+17 else c end-f from t1 where t1.b>=f),t1.c)+17-a FROM t1 WHERE NOT (+c in (+~a+case when ((case t1.d when coalesce((select f from t1 where e in (select count(distinct t1.e) from t1 union select min((abs(t1.c)/abs(e | b)) | d* -t1.d) from t1)),t1.e)+a then c else b end in (select -cast(avg(t1.c) AS integer)-~cast(avg(11) AS integer) from t1 union select -count(distinct 19) from t1))) then -e*19 else 13 end,t1.a,d))} -} {-383} -do_test randexpr-2.245 { - db eval {SELECT case when t1.b>=+(abs(t1.e)/abs(coalesce((select c from t1 where 17<=+(e)),(e)-+~11*17+t1.d-e | +coalesce((select max(t1.d) from t1 where f>e),t1.a)*b | (e))))-t1.a and c>=t1.d or (17 not between e and b) then t1.e else d end FROM t1 WHERE exists(select 1 from t1 where (19-((17))+(b) in (select d*e*a from t1 union select ~19 from t1)) and case b-(abs(case a when coalesce((select max(19) from t1 where exists(select 1 from t1 where exists(select 1 from t1 where b not between e and (t1.f) or a not in (t1.c,17,t1.d)))),case t1.b when -d then 13 else 13 end)*a+t1.c then e else a end)/abs(t1.d))*t1.e when -13 then t1.c else 19 end in (select +count(distinct e) from t1 union select count(*) from t1))} -} {} -do_test randexpr-2.246 { - db eval {SELECT case when t1.b>=+(abs(t1.e)/abs(coalesce((select c from t1 where 17<=+(e)),(e)-+~11*17+t1.d-e | +coalesce((select max(t1.d) from t1 where f>e),t1.a)*b | (e))))-t1.a and c>=t1.d or (17 not between e and b) then t1.e else d end FROM t1 WHERE NOT (exists(select 1 from t1 where (19-((17))+(b) in (select d*e*a from t1 union select ~19 from t1)) and case b-(abs(case a when coalesce((select max(19) from t1 where exists(select 1 from t1 where exists(select 1 from t1 where b not between e and (t1.f) or a not in (t1.c,17,t1.d)))),case t1.b when -d then 13 else 13 end)*a+t1.c then e else a end)/abs(t1.d))*t1.e when -13 then t1.c else 19 end in (select +count(distinct e) from t1 union select count(*) from t1)))} -} {500} -do_test randexpr-2.247 { - db eval {SELECT case when t1.b>=+(abs(t1.e)/abs(coalesce((select c from t1 where 17<=+(e)),(e)-+~11*17+t1.d-e & +coalesce((select max(t1.d) from t1 where f>e),t1.a)*b & (e))))-t1.a and c>=t1.d or (17 not between e and b) then t1.e else d end FROM t1 WHERE NOT (exists(select 1 from t1 where (19-((17))+(b) in (select d*e*a from t1 union select ~19 from t1)) and case b-(abs(case a when coalesce((select max(19) from t1 where exists(select 1 from t1 where exists(select 1 from t1 where b not between e and (t1.f) or a not in (t1.c,17,t1.d)))),case t1.b when -d then 13 else 13 end)*a+t1.c then e else a end)/abs(t1.d))*t1.e when -13 then t1.c else 19 end in (select +count(distinct e) from t1 union select count(*) from t1)))} -} {500} -do_test randexpr-2.248 { - db eval {SELECT case when 11 in (select min(+t1.e)* -max(a)+count(distinct d*11*c)*(count(distinct (e))) | ( -min(t1.b)) | count(distinct 19) | (max(t1.f))-max(t1.b) from t1 union select (min(19)) from t1) then coalesce((select max(17) from t1 where -17=13 or c in (select t1.d from t1 union select d from t1)),b)*t1.b-a+19 when t1.d<(d) then (d) else 19 end FROM t1 WHERE case when case when t1.c not in (f,19,b) then t1.d-t1.c-case when 17<>t1.a then -(abs((select cast(avg(b) AS integer)- -max(t1.c) from t1))/abs(t1.c)) else t1.f end-17 | 19 when exists(select 1 from t1 where exists(select 1 from t1 where (e between 13 and (t1.a))) and e<=t1.c) then f else t1.a end>=11 then c when ft1.a then -(abs((select cast(avg(b) AS integer)- -max(t1.c) from t1))/abs(t1.c)) else t1.f end-17 | 19 when exists(select 1 from t1 where exists(select 1 from t1 where (e between 13 and (t1.a))) and e<=t1.c) then f else t1.a end>=11 then c when ft1.a then -(abs((select cast(avg(b) AS integer)- -max(t1.c) from t1))/abs(t1.c)) else t1.f end-17 | 19 when exists(select 1 from t1 where exists(select 1 from t1 where (e between 13 and (t1.a))) and e<=t1.c) then f else t1.a end>=11 then c when f=c then t1.b else t1.f end)) and 17<>f) then case when (e) not in (t1.a,t1.f,e) then case case t1.c when 13 then 19 else t1.d end-19 when t1.d then -t1.b else t1.f end when t1.d not in (17,t1.a,t1.d) or c in (d,(19),t1.b) then -t1.b else c end else 19 end+t1.b-f+t1.e FROM t1 WHERE t1.f-case when (coalesce((select 13*(abs(~11)/abs(t1.b)) from t1 where ~a between +f+~+17 and t1.e),e) not between coalesce((select 19-(abs(11)/abs(t1.b)) from t1 where f<>c),t1.b) and t1.f or t1.d between (select case min(a) when cast(avg(e) AS integer) then -((count(*))) else cast(avg(t1.a) AS integer) end | count(*) from t1) and (t1.a)) then 19 else f end=f} -} {} -do_test randexpr-2.252 { - db eval {SELECT c*~17+~case when (exists(select 1 from t1 where not exists(select 1 from t1 where (abs(e)/abs(c))=case when t1.c not in (a,13,11) and t1.b>=c then t1.b else t1.f end)) and 17<>f) then case when (e) not in (t1.a,t1.f,e) then case case t1.c when 13 then 19 else t1.d end-19 when t1.d then -t1.b else t1.f end when t1.d not in (17,t1.a,t1.d) or c in (d,(19),t1.b) then -t1.b else c end else 19 end+t1.b-f+t1.e FROM t1 WHERE NOT (t1.f-case when (coalesce((select 13*(abs(~11)/abs(t1.b)) from t1 where ~a between +f+~+17 and t1.e),e) not between coalesce((select 19-(abs(11)/abs(t1.b)) from t1 where f<>c),t1.b) and t1.f or t1.d between (select case min(a) when cast(avg(e) AS integer) then -((count(*))) else cast(avg(t1.a) AS integer) end | count(*) from t1) and (t1.a)) then 19 else f end=f)} -} {-5601} -do_test randexpr-2.253 { - db eval {SELECT coalesce((select c-t1.a | 17 | b-~t1.e-11 from t1 where not exists(select 1 from t1 where t1.c<=t1.b)),17) FROM t1 WHERE (((coalesce((select max((abs(b-t1.d-19*t1.a*e+~case when t1.e=t1.f-e then (select abs(abs(cast(avg((f)) AS integer))) from t1) else ((abs(t1.b)/abs(t1.a))) end-t1.b-t1.c)/abs(t1.b))) from t1 where not t1.c in (select count(distinct c) from t1 union select count(*) from t1) and 17< -t1.e),(c)) | -(c))<>e))} -} {763} -do_test randexpr-2.254 { - db eval {SELECT coalesce((select c-t1.a | 17 | b-~t1.e-11 from t1 where not exists(select 1 from t1 where t1.c<=t1.b)),17) FROM t1 WHERE NOT ((((coalesce((select max((abs(b-t1.d-19*t1.a*e+~case when t1.e=t1.f-e then (select abs(abs(cast(avg((f)) AS integer))) from t1) else ((abs(t1.b)/abs(t1.a))) end-t1.b-t1.c)/abs(t1.b))) from t1 where not t1.c in (select count(distinct c) from t1 union select count(*) from t1) and 17< -t1.e),(c)) | -(c))<>e)))} -} {} -do_test randexpr-2.255 { - db eval {SELECT coalesce((select c-t1.a & 17 & b-~t1.e-11 from t1 where not exists(select 1 from t1 where t1.c<=t1.b)),17) FROM t1 WHERE (((coalesce((select max((abs(b-t1.d-19*t1.a*e+~case when t1.e=t1.f-e then (select abs(abs(cast(avg((f)) AS integer))) from t1) else ((abs(t1.b)/abs(t1.a))) end-t1.b-t1.c)/abs(t1.b))) from t1 where not t1.c in (select count(distinct c) from t1 union select count(*) from t1) and 17< -t1.e),(c)) | -(c))<>e))} -} {0} -do_test randexpr-2.256 { - db eval {SELECT case case +(select case count(distinct case when case when (abs(f | t1.d)/abs(13))<= -c then t1.a else t1.b end+t1.b<=19 then c when 19=a then 17 else 11 end+13) when ~+case (cast(avg(t1.b) AS integer) | ((count(*)))-max(t1.d)) when count(distinct d) then count(*) else cast(avg(t1.c) AS integer) end then count(*) else count(*) end from t1) when c*t1.a then 13 else t1.a end when a then -f else t1.a end+d FROM t1 WHERE case when coalesce((select t1.c | c*t1.e-11 from t1 where exists(select 1 from t1 where t1.d-t1.d*d between - -t1.e and a)), -13)<=e and 11 not in (d,t1.a,f) and t1.a not between 11 and 19 or t1.e<>t1.e and t1.e=t1.a or -t1.e>=b then b when 17 not between t1.f and t1.b then a else b end in (select 11 from t1 union select f from t1)} -} {} -do_test randexpr-2.257 { - db eval {SELECT case case +(select case count(distinct case when case when (abs(f | t1.d)/abs(13))<= -c then t1.a else t1.b end+t1.b<=19 then c when 19=a then 17 else 11 end+13) when ~+case (cast(avg(t1.b) AS integer) | ((count(*)))-max(t1.d)) when count(distinct d) then count(*) else cast(avg(t1.c) AS integer) end then count(*) else count(*) end from t1) when c*t1.a then 13 else t1.a end when a then -f else t1.a end+d FROM t1 WHERE NOT (case when coalesce((select t1.c | c*t1.e-11 from t1 where exists(select 1 from t1 where t1.d-t1.d*d between - -t1.e and a)), -13)<=e and 11 not in (d,t1.a,f) and t1.a not between 11 and 19 or t1.e<>t1.e and t1.e=t1.a or -t1.e>=b then b when 17 not between t1.f and t1.b then a else b end in (select 11 from t1 union select f from t1))} -} {-200} -do_test randexpr-2.258 { - db eval {SELECT case case +(select case count(distinct case when case when (abs(f & t1.d)/abs(13))<= -c then t1.a else t1.b end+t1.b<=19 then c when 19=a then 17 else 11 end+13) when ~+case (cast(avg(t1.b) AS integer) & ((count(*)))-max(t1.d)) when count(distinct d) then count(*) else cast(avg(t1.c) AS integer) end then count(*) else count(*) end from t1) when c*t1.a then 13 else t1.a end when a then -f else t1.a end+d FROM t1 WHERE NOT (case when coalesce((select t1.c | c*t1.e-11 from t1 where exists(select 1 from t1 where t1.d-t1.d*d between - -t1.e and a)), -13)<=e and 11 not in (d,t1.a,f) and t1.a not between 11 and 19 or t1.e<>t1.e and t1.e=t1.a or -t1.e>=b then b when 17 not between t1.f and t1.b then a else b end in (select 11 from t1 union select f from t1))} -} {-200} -do_test randexpr-2.259 { - db eval {SELECT f*coalesce((select max((select count(*) from t1)) from t1 where ~case when t1.e<=case when 17>=+case when c*a in (c,t1.b,13) then t1.e when a>t1.b and a<=19 then c else t1.e end then t1.c else 17 end-f*17 or a between b and 19 then t1.c when -f<=11 then c else -11 end*t1.c+d>=e),17) FROM t1 WHERE (19 not between t1.b and ~e)} -} {10200} -do_test randexpr-2.260 { - db eval {SELECT f*coalesce((select max((select count(*) from t1)) from t1 where ~case when t1.e<=case when 17>=+case when c*a in (c,t1.b,13) then t1.e when a>t1.b and a<=19 then c else t1.e end then t1.c else 17 end-f*17 or a between b and 19 then t1.c when -f<=11 then c else -11 end*t1.c+d>=e),17) FROM t1 WHERE NOT ((19 not between t1.b and ~e))} -} {} -do_test randexpr-2.261 { - db eval {SELECT coalesce((select max(t1.c- -case when (~(select max(b*t1.a)*~((min(t1.e))-min((a))) | -cast(avg(t1.e+t1.a) AS integer) from t1))c or (t1.b)> -(11)),11)) from t1 where -11 in ((d),f,t1.d)),t1.a) FROM t1 WHERE c<>e+t1.c} -} {100} -do_test randexpr-2.262 { - db eval {SELECT coalesce((select max(t1.c- -case when (~(select max(b*t1.a)*~((min(t1.e))-min((a))) | -cast(avg(t1.e+t1.a) AS integer) from t1))c or (t1.b)> -(11)),11)) from t1 where -11 in ((d),f,t1.d)),t1.a) FROM t1 WHERE NOT (c<>e+t1.c)} -} {} -do_test randexpr-2.263 { - db eval {SELECT coalesce((select max(t1.c- -case when (~(select max(b*t1.a)*~((min(t1.e))-min((a))) & -cast(avg(t1.e+t1.a) AS integer) from t1))c or (t1.b)> -(11)),11)) from t1 where -11 in ((d),f,t1.d)),t1.a) FROM t1 WHERE c<>e+t1.c} -} {100} -do_test randexpr-2.264 { - db eval {SELECT -case when (not exists(select 1 from t1 where e*d*case 17 when case t1.c-t1.f when t1.a then t1.a else 11 end then t1.c else t1.b end-e+(t1.a)-e not in (e,e,t1.a) and (t1.f not between 19 and t1.e))) and t1.be),c) between t1.e and f then t1.e when -f> - -b then c else t1.c end) from t1 where not 11 in (select f from t1 union select a from t1)),t1.d)-t1.a-13 from t1 where t1.d between -t1.e and t1.a),f) FROM t1 WHERE exists(select 1 from t1 where not exists(select 1 from t1 where c in (select (abs(f)/abs(13)) from t1 union select t1.a+b from t1)))} -} {} -do_test randexpr-2.267 { - db eval {SELECT coalesce((select 17+coalesce((select max(case when -coalesce((select max((abs( -(abs(t1.a)/abs(t1.d))+11)/abs(e))-b) from t1 where t1.b not between f and t1.c and t1.f<>e),c) between t1.e and f then t1.e when -f> - -b then c else t1.c end) from t1 where not 11 in (select f from t1 union select a from t1)),t1.d)-t1.a-13 from t1 where t1.d between -t1.e and t1.a),f) FROM t1 WHERE NOT (exists(select 1 from t1 where not exists(select 1 from t1 where c in (select (abs(f)/abs(13)) from t1 union select t1.a+b from t1))))} -} {600} -do_test randexpr-2.268 { - db eval {SELECT coalesce((select max(t1.d) from t1 where exists(select 1 from t1 where t1.d in (select case (abs(((count(distinct t1.d-c))* -cast(avg(11) AS integer)+max(t1.c)))) when (cast(avg(t1.c+a) AS integer)*+min(a)*max(c)-max(t1.a)+cast(avg(f) AS integer))+cast(avg(t1.e) AS integer) then min(11) else (((min(11)))) end from t1 union select count(*) from t1))),coalesce((select max(b+13) from t1 where exists(select 1 from t1 where f in (select 11 from t1 union select t1.b from t1))),t1.e)) FROM t1 WHERE b>11} -} {500} -do_test randexpr-2.269 { - db eval {SELECT coalesce((select max(t1.d) from t1 where exists(select 1 from t1 where t1.d in (select case (abs(((count(distinct t1.d-c))* -cast(avg(11) AS integer)+max(t1.c)))) when (cast(avg(t1.c+a) AS integer)*+min(a)*max(c)-max(t1.a)+cast(avg(f) AS integer))+cast(avg(t1.e) AS integer) then min(11) else (((min(11)))) end from t1 union select count(*) from t1))),coalesce((select max(b+13) from t1 where exists(select 1 from t1 where f in (select 11 from t1 union select t1.b from t1))),t1.e)) FROM t1 WHERE NOT (b>11)} -} {} -do_test randexpr-2.270 { - db eval {SELECT coalesce((select max( -(select count(*)-case min(19)-abs(count(*))+(max( -b)-+count(distinct (t1.e))) when max(a) then (count(distinct 19)) else count(*) end from t1)) from t1 where exists(select 1 from t1 where a<(abs(case when a-t1.c+ -19+t1.d between 11 and f then t1.f else d end+t1.a+d)/abs(c))) or t1.c>t1.c),17)*f FROM t1 WHERE not f<>t1.b} -} {} -do_test randexpr-2.271 { - db eval {SELECT coalesce((select max( -(select count(*)-case min(19)-abs(count(*))+(max( -b)-+count(distinct (t1.e))) when max(a) then (count(distinct 19)) else count(*) end from t1)) from t1 where exists(select 1 from t1 where a<(abs(case when a-t1.c+ -19+t1.d between 11 and f then t1.f else d end+t1.a+d)/abs(c))) or t1.c>t1.c),17)*f FROM t1 WHERE NOT (not f<>t1.b)} -} {10200} -do_test randexpr-2.272 { - db eval {SELECT case when coalesce((select f-coalesce((select +coalesce((select t1.c from t1 where (t1.c=(abs(t1.e)/abs(+t1.c+f+(f))))),13+17)+t1.b | t1.c from t1 where case when t1.a not in (d,17,t1.c) then f else f end | -13 in (select cast(avg(t1.e) AS integer) from t1 union select min(t1.a) from t1)),c) from t1 where 17>c), -t1.b)>t1.c then 17 when t1.b<>11 then e else t1.f end FROM t1 WHERE case when t1.f in (t1.a+(abs(17)/abs((t1.d))),coalesce((select max(c) from t1 where (not (d- -case f when 17 then d else (17) end+e*t1.d) not in ((t1.d),t1.f,f))),coalesce((select c from t1 where 13 not in (19,d,b)),f)),17) then t1.b when e<=f then 17 else c end -19} -} {500} -do_test randexpr-2.273 { - db eval {SELECT case when coalesce((select f-coalesce((select +coalesce((select t1.c from t1 where (t1.c=(abs(t1.e)/abs(+t1.c+f+(f))))),13+17)+t1.b | t1.c from t1 where case when t1.a not in (d,17,t1.c) then f else f end | -13 in (select cast(avg(t1.e) AS integer) from t1 union select min(t1.a) from t1)),c) from t1 where 17>c), -t1.b)>t1.c then 17 when t1.b<>11 then e else t1.f end FROM t1 WHERE NOT (case when t1.f in (t1.a+(abs(17)/abs((t1.d))),coalesce((select max(c) from t1 where (not (d- -case f when 17 then d else (17) end+e*t1.d) not in ((t1.d),t1.f,f))),coalesce((select c from t1 where 13 not in (19,d,b)),f)),17) then t1.b when e<=f then 17 else c end -19)} -} {} -do_test randexpr-2.274 { - db eval {SELECT case when coalesce((select f-coalesce((select +coalesce((select t1.c from t1 where (t1.c=(abs(t1.e)/abs(+t1.c+f+(f))))),13+17)+t1.b & t1.c from t1 where case when t1.a not in (d,17,t1.c) then f else f end & -13 in (select cast(avg(t1.e) AS integer) from t1 union select min(t1.a) from t1)),c) from t1 where 17>c), -t1.b)>t1.c then 17 when t1.b<>11 then e else t1.f end FROM t1 WHERE case when t1.f in (t1.a+(abs(17)/abs((t1.d))),coalesce((select max(c) from t1 where (not (d- -case f when 17 then d else (17) end+e*t1.d) not in ((t1.d),t1.f,f))),coalesce((select c from t1 where 13 not in (19,d,b)),f)),17) then t1.b when e<=f then 17 else c end -19} -} {500} -do_test randexpr-2.275 { - db eval {SELECT case when d*t1.c*a<>t1.b*~t1.b*t1.f-b then e else 17 end*t1.e+case when a not between t1.a and t1.d or (select - -cast(avg(c) AS integer) from t1)<>17+c then case 11 when t1.f then -t1.b else t1.b end when 13 not in (c,t1.f,19) or not exists(select 1 from t1 where 13=t1.d or t1.e<>a) then (17) else -t1.f end FROM t1 WHERE (not (case e when e then +case when e>=a and 13<>e*t1.e or t1.d<>11 then t1.c else t1.b end else 17 end) in (select cast(avg( -t1.c) AS integer) from t1 union select case min(13) when -+count(distinct 13) then case (+(cast(avg(e) AS integer))+((cast(avg(13) AS integer)))* - -count(distinct c)*count(*)) | count(*) when min(t1.c) then (min(11)) else max(f) end else cast(avg(17) AS integer) end from t1))} -} {250200} -do_test randexpr-2.276 { - db eval {SELECT case when d*t1.c*a<>t1.b*~t1.b*t1.f-b then e else 17 end*t1.e+case when a not between t1.a and t1.d or (select - -cast(avg(c) AS integer) from t1)<>17+c then case 11 when t1.f then -t1.b else t1.b end when 13 not in (c,t1.f,19) or not exists(select 1 from t1 where 13=t1.d or t1.e<>a) then (17) else -t1.f end FROM t1 WHERE NOT ((not (case e when e then +case when e>=a and 13<>e*t1.e or t1.d<>11 then t1.c else t1.b end else 17 end) in (select cast(avg( -t1.c) AS integer) from t1 union select case min(13) when -+count(distinct 13) then case (+(cast(avg(e) AS integer))+((cast(avg(13) AS integer)))* - -count(distinct c)*count(*)) | count(*) when min(t1.c) then (min(11)) else max(f) end else cast(avg(17) AS integer) end from t1)))} -} {} -do_test randexpr-2.277 { - db eval {SELECT (select max(t1.a)*abs(count(distinct f-t1.a-(abs(t1.a)/abs(case e when case t1.f when e*(b)-19 then 11 else t1.d end then t1.f else 11 end)))) | case +~cast(avg(t1.a) AS integer)-+abs(count(distinct 17)) when case count(distinct t1.b)*cast(avg(t1.a) AS integer)+count(distinct t1.c) when count(*) then min(t1.f) else count(distinct e) end then max((t1.e)) else max(d) end-count(*) from t1) FROM t1 WHERE e not between (select min(t1.a) from t1) and d+t1.d} -} {} -do_test randexpr-2.278 { - db eval {SELECT (select max(t1.a)*abs(count(distinct f-t1.a-(abs(t1.a)/abs(case e when case t1.f when e*(b)-19 then 11 else t1.d end then t1.f else 11 end)))) | case +~cast(avg(t1.a) AS integer)-+abs(count(distinct 17)) when case count(distinct t1.b)*cast(avg(t1.a) AS integer)+count(distinct t1.c) when count(*) then min(t1.f) else count(distinct e) end then max((t1.e)) else max(d) end-count(*) from t1) FROM t1 WHERE NOT (e not between (select min(t1.a) from t1) and d+t1.d)} -} {495} -do_test randexpr-2.279 { - db eval {SELECT (select max(t1.a)*abs(count(distinct f-t1.a-(abs(t1.a)/abs(case e when case t1.f when e*(b)-19 then 11 else t1.d end then t1.f else 11 end)))) & case +~cast(avg(t1.a) AS integer)-+abs(count(distinct 17)) when case count(distinct t1.b)*cast(avg(t1.a) AS integer)+count(distinct t1.c) when count(*) then min(t1.f) else count(distinct e) end then max((t1.e)) else max(d) end-count(*) from t1) FROM t1 WHERE NOT (e not between (select min(t1.a) from t1) and d+t1.d)} -} {4} -do_test randexpr-2.280 { - db eval {SELECT e*c-t1.e*t1.c++(select abs(case abs(max(coalesce((select f from t1 where (b*coalesce((select max(b) from t1 where 17>f),t1.e) not between c and f or t1.a>d and t1.a<11 or a<> -f)),(t1.a)))) when -+count(distinct e) then -+(count(distinct 19))+min(t1.c) else -min(t1.f) end) from t1)+t1.b-19 FROM t1 WHERE d-coalesce((select max(t1.d*c+c) from t1 where t1.f between (select count(distinct t1.b-e)+abs(~case case ~cast(avg(t1.f) AS integer)-count(distinct t1.a) when count(*) then count(distinct e) else count(*) end when min(e) then min( -t1.c) else max(a) end) from t1)+17 and -case when d>=d-11 then t1.c else t1.a end),t1.a)*t1.a not in (t1.f,t1.f,d)} -} {781} -do_test randexpr-2.281 { - db eval {SELECT e*c-t1.e*t1.c++(select abs(case abs(max(coalesce((select f from t1 where (b*coalesce((select max(b) from t1 where 17>f),t1.e) not between c and f or t1.a>d and t1.a<11 or a<> -f)),(t1.a)))) when -+count(distinct e) then -+(count(distinct 19))+min(t1.c) else -min(t1.f) end) from t1)+t1.b-19 FROM t1 WHERE NOT (d-coalesce((select max(t1.d*c+c) from t1 where t1.f between (select count(distinct t1.b-e)+abs(~case case ~cast(avg(t1.f) AS integer)-count(distinct t1.a) when count(*) then count(distinct e) else count(*) end when min(e) then min( -t1.c) else max(a) end) from t1)+17 and -case when d>=d-11 then t1.c else t1.a end),t1.a)*t1.a not in (t1.f,t1.f,d))} -} {} -do_test randexpr-2.282 { - db eval {SELECT coalesce((select a from t1 where (exists(select 1 from t1 where 11-case when ((select count(distinct t1.e+d) from t1))<>t1.d*f then -13 when t1.b in (select abs(cast(avg(c) AS integer)) from t1 union select count(distinct e)*count(distinct c)-cast(avg(e) AS integer) from t1) or c in (select t1.d from t1 union select 17 from t1) then a else t1.b end>=t1.c) and f>=d and d>=t1.f)),case when 11=19 and t1.a between t1.d and e then t1.d-b else t1.b end) FROM t1 WHERE 19 not in ( -t1.f,+19,t1.b)} -} {} -do_test randexpr-2.283 { - db eval {SELECT coalesce((select a from t1 where (exists(select 1 from t1 where 11-case when ((select count(distinct t1.e+d) from t1))<>t1.d*f then -13 when t1.b in (select abs(cast(avg(c) AS integer)) from t1 union select count(distinct e)*count(distinct c)-cast(avg(e) AS integer) from t1) or c in (select t1.d from t1 union select 17 from t1) then a else t1.b end>=t1.c) and f>=d and d>=t1.f)),case when 11=19 and t1.a between t1.d and e then t1.d-b else t1.b end) FROM t1 WHERE NOT (19 not in ( -t1.f,+19,t1.b))} -} {200} -do_test randexpr-2.284 { - db eval {SELECT (~case when t1.f>(abs(t1.c)/abs(13-coalesce((select max(t1.a) from t1 where case when e not in (c,t1.a,~11) then 19+( -c) else a end in (select (19) from t1 union select t1.c from t1)),t1.b)+a)) and e>d and (t1.a)=e then t1.e when (not exists(select 1 from t1 where -t1.d=e) and -d in (select d from t1 union select e from t1)) then t1.b else a end) FROM t1 WHERE (t1.f in (select coalesce((select max(coalesce((select c from t1 where coalesce((select max(coalesce((select max(++13*t1.d) from t1 where case when case when e<>13 or b<= -t1.a then t1.c when t1.a not in ( - -13,t1.a,13) then a else c end not in ( -e,d,(11)) or t1.d -b then t1.e else t1.d endt1.b),c) not in (t1.e,c,b)),13)) from t1 where ((t1.f) in (select max(a) from t1 union select abs(abs(min(13))) from t1))),11) from t1 union select b from t1))} -} {} -do_test randexpr-2.285 { - db eval {SELECT (~case when t1.f>(abs(t1.c)/abs(13-coalesce((select max(t1.a) from t1 where case when e not in (c,t1.a,~11) then 19+( -c) else a end in (select (19) from t1 union select t1.c from t1)),t1.b)+a)) and e>d and (t1.a)=e then t1.e when (not exists(select 1 from t1 where -t1.d=e) and -d in (select d from t1 union select e from t1)) then t1.b else a end) FROM t1 WHERE NOT ((t1.f in (select coalesce((select max(coalesce((select c from t1 where coalesce((select max(coalesce((select max(++13*t1.d) from t1 where case when case when e<>13 or b<= -t1.a then t1.c when t1.a not in ( - -13,t1.a,13) then a else c end not in ( -e,d,(11)) or t1.d -b then t1.e else t1.d endt1.b),c) not in (t1.e,c,b)),13)) from t1 where ((t1.f) in (select max(a) from t1 union select abs(abs(min(13))) from t1))),11) from t1 union select b from t1)))} -} {-101} -do_test randexpr-2.286 { - db eval {SELECT (select count(distinct case b when 13 then (select (+(cast(avg(+(d)*case t1.f-c*(abs(case when case when not exists(select 1 from t1 where not exists(select 1 from t1 where (d<=t1.e) or d between c and t1.b)) then 11 else 19 end in ((t1.d),t1.a,t1.f) then t1.f when c<=t1.e then t1.c else b end | a)/abs(c))+t1.b when t1.c then a else d end) AS integer))) from t1) else t1.b*(e) end) from t1) FROM t1 WHERE not t1.a+t1.b | t1.f-11*(select max(+case when case ~e-(abs(d*t1.d+t1.d)/abs( -f)) when t1.a then t1.e else t1.c end in (select cast(avg((f)) AS integer) from t1 union select +~(min(t1.d)) from t1) then (t1.d) when not exists(select 1 from t1 where a not in (17,a,d)) then 19 else -t1.a end* -t1.d) from t1)* -17>13} -} {1} -do_test randexpr-2.287 { - db eval {SELECT (select count(distinct case b when 13 then (select (+(cast(avg(+(d)*case t1.f-c*(abs(case when case when not exists(select 1 from t1 where not exists(select 1 from t1 where (d<=t1.e) or d between c and t1.b)) then 11 else 19 end in ((t1.d),t1.a,t1.f) then t1.f when c<=t1.e then t1.c else b end | a)/abs(c))+t1.b when t1.c then a else d end) AS integer))) from t1) else t1.b*(e) end) from t1) FROM t1 WHERE NOT (not t1.a+t1.b | t1.f-11*(select max(+case when case ~e-(abs(d*t1.d+t1.d)/abs( -f)) when t1.a then t1.e else t1.c end in (select cast(avg((f)) AS integer) from t1 union select +~(min(t1.d)) from t1) then (t1.d) when not exists(select 1 from t1 where a not in (17,a,d)) then 19 else -t1.a end* -t1.d) from t1)* -17>13)} -} {} -do_test randexpr-2.288 { - db eval {SELECT (select count(distinct case b when 13 then (select (+(cast(avg(+(d)*case t1.f-c*(abs(case when case when not exists(select 1 from t1 where not exists(select 1 from t1 where (d<=t1.e) or d between c and t1.b)) then 11 else 19 end in ((t1.d),t1.a,t1.f) then t1.f when c<=t1.e then t1.c else b end & a)/abs(c))+t1.b when t1.c then a else d end) AS integer))) from t1) else t1.b*(e) end) from t1) FROM t1 WHERE not t1.a+t1.b | t1.f-11*(select max(+case when case ~e-(abs(d*t1.d+t1.d)/abs( -f)) when t1.a then t1.e else t1.c end in (select cast(avg((f)) AS integer) from t1 union select +~(min(t1.d)) from t1) then (t1.d) when not exists(select 1 from t1 where a not in (17,a,d)) then 19 else -t1.a end* -t1.d) from t1)* -17>13} -} {1} -do_test randexpr-2.289 { - db eval {SELECT coalesce((select max(coalesce((select max(13) from t1 where ((~t1.f) between b and (abs(e)/abs(f)))),13+(select case abs((+count(*)*max(19))) when (~min(b)) then -min(a) | min( -a) else (max(t1.c)) end from t1)+17*f+11)) from t1 where not 19<=coalesce((select e from t1 where t1.d-d not between 19 and 19),11)),13) FROM t1 WHERE t1.f+t1.d=t1.f+17-case when (abs(t1.a*(case when not exists(select 1 from t1 where not exists(select 1 from t1 where (b) between d and t1.f)) then (t1.b | -(t1.c)) | 19 when d=t1.a then 13 else d end)+ -t1.d)/abs(d)) not in (d,e,t1.d) then t1.f when 19 in (select t1.f from t1 union select t1.e from t1) then e else -t1.a end- - -t1.e*17-t1.d-t1.d} -} {} -do_test randexpr-2.290 { - db eval {SELECT coalesce((select max(coalesce((select max(13) from t1 where ((~t1.f) between b and (abs(e)/abs(f)))),13+(select case abs((+count(*)*max(19))) when (~min(b)) then -min(a) | min( -a) else (max(t1.c)) end from t1)+17*f+11)) from t1 where not 19<=coalesce((select e from t1 where t1.d-d not between 19 and 19),11)),13) FROM t1 WHERE NOT (t1.f+t1.d=t1.f+17-case when (abs(t1.a*(case when not exists(select 1 from t1 where not exists(select 1 from t1 where (b) between d and t1.f)) then (t1.b | -(t1.c)) | 19 when d=t1.a then 13 else d end)+ -t1.d)/abs(d)) not in (d,e,t1.d) then t1.f when 19 in (select t1.f from t1 union select t1.e from t1) then e else -t1.a end- - -t1.e*17-t1.d-t1.d)} -} {13} -do_test randexpr-2.291 { - db eval {SELECT coalesce((select max(coalesce((select max(13) from t1 where ((~t1.f) between b and (abs(e)/abs(f)))),13+(select case abs((+count(*)*max(19))) when (~min(b)) then -min(a) & min( -a) else (max(t1.c)) end from t1)+17*f+11)) from t1 where not 19<=coalesce((select e from t1 where t1.d-d not between 19 and 19),11)),13) FROM t1 WHERE NOT (t1.f+t1.d=t1.f+17-case when (abs(t1.a*(case when not exists(select 1 from t1 where not exists(select 1 from t1 where (b) between d and t1.f)) then (t1.b | -(t1.c)) | 19 when d=t1.a then 13 else d end)+ -t1.d)/abs(d)) not in (d,e,t1.d) then t1.f when 19 in (select t1.f from t1 union select t1.e from t1) then e else -t1.a end- - -t1.e*17-t1.d-t1.d)} -} {13} -do_test randexpr-2.292 { - db eval {SELECT case when -t1.b=c and ((t1.c>t1.b)) and not exists(select 1 from t1 where (abs((select max(t1.d) from t1))/abs((abs(c+t1.b)/abs(t1.d))-t1.e))+c in (select cast(avg((t1.a)) AS integer) | abs(count(distinct t1.d))+count(*) | count(*)+count(*) from t1 union select (min(t1.d)) from t1)) then (abs(t1.b)/abs(t1.f)) when t1.b not in (a,t1.f,(a)) then t1.b else t1.d end-11 FROM t1 WHERE case when ~e in (coalesce((select 13 from t1 where 17 between t1.a and b or not exists(select 1 from t1 where (c in (11,e,a)))),t1.e),c,e) then e else t1.f end in (select ++abs(case case count(*) when (max(t1.d)) then cast(avg(t1.c) AS integer) else count(distinct b) end | count(*) when max(e) then min(c) else max(13) end | count(*)*count(*)) | max(t1.a) from t1 union select count(distinct t1.c) from t1) or b in (select cast(avg(t1.b) AS integer) from t1 union select cast(avg( -t1.a) AS integer) from t1)} -} {189} -do_test randexpr-2.293 { - db eval {SELECT case when -t1.b=c and ((t1.c>t1.b)) and not exists(select 1 from t1 where (abs((select max(t1.d) from t1))/abs((abs(c+t1.b)/abs(t1.d))-t1.e))+c in (select cast(avg((t1.a)) AS integer) | abs(count(distinct t1.d))+count(*) | count(*)+count(*) from t1 union select (min(t1.d)) from t1)) then (abs(t1.b)/abs(t1.f)) when t1.b not in (a,t1.f,(a)) then t1.b else t1.d end-11 FROM t1 WHERE NOT (case when ~e in (coalesce((select 13 from t1 where 17 between t1.a and b or not exists(select 1 from t1 where (c in (11,e,a)))),t1.e),c,e) then e else t1.f end in (select ++abs(case case count(*) when (max(t1.d)) then cast(avg(t1.c) AS integer) else count(distinct b) end | count(*) when max(e) then min(c) else max(13) end | count(*)*count(*)) | max(t1.a) from t1 union select count(distinct t1.c) from t1) or b in (select cast(avg(t1.b) AS integer) from t1 union select cast(avg( -t1.a) AS integer) from t1))} -} {} -do_test randexpr-2.294 { - db eval {SELECT case when -t1.b=c and ((t1.c>t1.b)) and not exists(select 1 from t1 where (abs((select max(t1.d) from t1))/abs((abs(c+t1.b)/abs(t1.d))-t1.e))+c in (select cast(avg((t1.a)) AS integer) & abs(count(distinct t1.d))+count(*) & count(*)+count(*) from t1 union select (min(t1.d)) from t1)) then (abs(t1.b)/abs(t1.f)) when t1.b not in (a,t1.f,(a)) then t1.b else t1.d end-11 FROM t1 WHERE case when ~e in (coalesce((select 13 from t1 where 17 between t1.a and b or not exists(select 1 from t1 where (c in (11,e,a)))),t1.e),c,e) then e else t1.f end in (select ++abs(case case count(*) when (max(t1.d)) then cast(avg(t1.c) AS integer) else count(distinct b) end | count(*) when max(e) then min(c) else max(13) end | count(*)*count(*)) | max(t1.a) from t1 union select count(distinct t1.c) from t1) or b in (select cast(avg(t1.b) AS integer) from t1 union select cast(avg( -t1.a) AS integer) from t1)} -} {189} -do_test randexpr-2.295 { - db eval {SELECT case when (((abs(11 | e)/abs(17-d))+t1.b | a<>11)) and t1.d in (13,t1.c,11) or 17 between t1.f and b or not f in (select 19 from t1 union select t1.e from t1) and b<>19 or e between 19 and t1.d or b<=d or d<17 or t1.a<>t1.f then 17 when t1.e=t1.b then 11 else coalesce((select t1.e from t1 where (b) between - -d and e),t1.b) end FROM t1 WHERE t1.a between d and +17-17*coalesce((select ~ -19-13-19 from t1 where 19>(select abs(count(distinct t1.d-17))+count(distinct case when 19>17 then t1.f else t1.e end+b) | max(t1.b)+count(distinct 13) from t1)-coalesce((select 13 from t1 where t1.e not in (19,17,e) and 11<=t1.d),c)),t1.f)} -} {} -do_test randexpr-2.296 { - db eval {SELECT case when (((abs(11 | e)/abs(17-d))+t1.b | a<>11)) and t1.d in (13,t1.c,11) or 17 between t1.f and b or not f in (select 19 from t1 union select t1.e from t1) and b<>19 or e between 19 and t1.d or b<=d or d<17 or t1.a<>t1.f then 17 when t1.e=t1.b then 11 else coalesce((select t1.e from t1 where (b) between - -d and e),t1.b) end FROM t1 WHERE NOT (t1.a between d and +17-17*coalesce((select ~ -19-13-19 from t1 where 19>(select abs(count(distinct t1.d-17))+count(distinct case when 19>17 then t1.f else t1.e end+b) | max(t1.b)+count(distinct 13) from t1)-coalesce((select 13 from t1 where t1.e not in (19,17,e) and 11<=t1.d),c)),t1.f))} -} {17} -do_test randexpr-2.297 { - db eval {SELECT case when (((abs(11 & e)/abs(17-d))+t1.b & a<>11)) and t1.d in (13,t1.c,11) or 17 between t1.f and b or not f in (select 19 from t1 union select t1.e from t1) and b<>19 or e between 19 and t1.d or b<=d or d<17 or t1.a<>t1.f then 17 when t1.e=t1.b then 11 else coalesce((select t1.e from t1 where (b) between - -d and e),t1.b) end FROM t1 WHERE NOT (t1.a between d and +17-17*coalesce((select ~ -19-13-19 from t1 where 19>(select abs(count(distinct t1.d-17))+count(distinct case when 19>17 then t1.f else t1.e end+b) | max(t1.b)+count(distinct 13) from t1)-coalesce((select 13 from t1 where t1.e not in (19,17,e) and 11<=t1.d),c)),t1.f))} -} {17} -do_test randexpr-2.298 { - db eval {SELECT case when 19=13 or 13+a | 19*11+b<>b and ((19<=b+(select count(*) from t1))) then t1.d when t1.e<= -19 then d-t1.e+(select ~max(19)*+(count(distinct b)) from t1)+t1.d*t1.d+f else t1.c end FROM t1 WHERE (13*case when 19*case when 19 not between 17 and t1.e then t1.e when ((case when case case when e<>11 or t1.b not in (t1.a, -c,17) then b else a end when -e then b else a end*a in (select 19 from t1 union select 13 from t1) then e else t1.c end in (select -abs(+count(*)) from t1 union select count(distinct f) from t1))) then 19 else d end>=f then t1.a when t1.e>=b then a else c end>=t1.d)} -} {400} -do_test randexpr-2.299 { - db eval {SELECT case when 19=13 or 13+a | 19*11+b<>b and ((19<=b+(select count(*) from t1))) then t1.d when t1.e<= -19 then d-t1.e+(select ~max(19)*+(count(distinct b)) from t1)+t1.d*t1.d+f else t1.c end FROM t1 WHERE NOT ((13*case when 19*case when 19 not between 17 and t1.e then t1.e when ((case when case case when e<>11 or t1.b not in (t1.a, -c,17) then b else a end when -e then b else a end*a in (select 19 from t1 union select 13 from t1) then e else t1.c end in (select -abs(+count(*)) from t1 union select count(distinct f) from t1))) then 19 else d end>=f then t1.a when t1.e>=b then a else c end>=t1.d))} -} {} -do_test randexpr-2.300 { - db eval {SELECT case when 19=13 or 13+a & 19*11+b<>b and ((19<=b+(select count(*) from t1))) then t1.d when t1.e<= -19 then d-t1.e+(select ~max(19)*+(count(distinct b)) from t1)+t1.d*t1.d+f else t1.c end FROM t1 WHERE (13*case when 19*case when 19 not between 17 and t1.e then t1.e when ((case when case case when e<>11 or t1.b not in (t1.a, -c,17) then b else a end when -e then b else a end*a in (select 19 from t1 union select 13 from t1) then e else t1.c end in (select -abs(+count(*)) from t1 union select count(distinct f) from t1))) then 19 else d end>=f then t1.a when t1.e>=b then a else c end>=t1.d)} -} {400} -do_test randexpr-2.301 { - db eval {SELECT +coalesce((select t1.d from t1 where coalesce((select t1.c+t1.b-case (19) when t1.c then 13+13+17 else t1.e end from t1 where (not exists(select 1 from t1 where t1.f<13)) and d not in (t1.e,11,19) and not 19>=t1.f or e in (select min(t1.c) from t1 union select cast(avg(t1.c) AS integer) from t1)), -a)-b*(13)(+b))} -} {500} -do_test randexpr-2.302 { - db eval {SELECT +coalesce((select t1.d from t1 where coalesce((select t1.c+t1.b-case (19) when t1.c then 13+13+17 else t1.e end from t1 where (not exists(select 1 from t1 where t1.f<13)) and d not in (t1.e,11,19) and not 19>=t1.f or e in (select min(t1.c) from t1 union select cast(avg(t1.c) AS integer) from t1)), -a)-b*(13)(+b)))} -} {} -do_test randexpr-2.303 { - db eval {SELECT +coalesce((select t1.d from t1 where coalesce((select t1.c+t1.b-case (19) when t1.c then 13+13+17 else t1.e end from t1 where (not exists(select 1 from t1 where t1.f<13)) and d not in (t1.e,11,19) and not 19>=t1.f or e in (select min(t1.c) from t1 union select cast(avg(t1.c) AS integer) from t1)), -a)-b*(13)(+b))} -} {400} -do_test randexpr-2.304 { - db eval {SELECT case when (((t1.c)<=a-11*t1.e)) then t1.b else a end | ((abs(b*(abs(t1.e | +c)/abs(11)))/abs(t1.a))) FROM t1 WHERE case when t1.e in (select t1.a-e from t1 union select t1.e from t1) then 19*coalesce((select a*t1.c-19+f+t1.d-case case when 11>=d then f when not f<>17 then t1.d else t1.f end+t1.e-t1.c when d then b else t1.f end from t1 where t1.f>a), -t1.a)- -(t1.c)-t1.e+b else 11 end=d then f when not f<>17 then t1.d else t1.f end+t1.e-t1.c when d then b else t1.f end from t1 where t1.f>a), -t1.a)- -(t1.c)-t1.e+b else 11 end=d then f when not f<>17 then t1.d else t1.f end+t1.e-t1.c when d then b else t1.f end from t1 where t1.f>a), -t1.a)- -(t1.c)-t1.e+b else 11 enda),13)*11)-t1.c from t1 where 11 between t1.a and -13+t1.f*~coalesce((select max(b-f) from t1 where t1.a<=13 or a not in (13,f,17)),b) or (t1.d<19 or b> -t1.c)),b) FROM t1 WHERE 11 not between d and coalesce((select -(select (cast(avg(d) AS integer)) from t1) from t1 where case when 1713 then e when 19 between t1.a and t1.b then b else b end end*13<=c),t1.c) end in (select t1.e from t1 union select d from t1)),t1.b)} -} {300} -do_test randexpr-2.311 { - db eval {SELECT t1.f+coalesce((select t1.b-13-(coalesce((select 17 from t1 where b>a),13)*11)-t1.c from t1 where 11 between t1.a and -13+t1.f*~coalesce((select max(b-f) from t1 where t1.a<=13 or a not in (13,f,17)),b) or (t1.d<19 or b> -t1.c)),b) FROM t1 WHERE NOT (11 not between d and coalesce((select -(select (cast(avg(d) AS integer)) from t1) from t1 where case when 1713 then e when 19 between t1.a and t1.b then b else b end end*13<=c),t1.c) end in (select t1.e from t1 union select d from t1)),t1.b))} -} {} -do_test randexpr-2.312 { - db eval {SELECT (abs(13)/abs((select min(case when case when exists(select 1 from t1 where not exists(select 1 from t1 where (select count(distinct (t1.e)) from t1)+t1.f>t1.e) and t1.a>=13 or f in (select t1.e from t1 union select t1.e from t1)) then b when f not in (13,13,13) then coalesce((select max(d*f) from t1 where t1.e in (t1.d,t1.e,(e))),t1.e) else a end>=t1.f then b when t1.c in (e,f,t1.e) then b else t1.c end)*abs(count(*))-abs(~count(*)-min(e))-cast(avg(17) AS integer) from t1))) FROM t1 WHERE t1.b not in (a*17-17-case when -17-t1.f in (select coalesce((select t1.a from t1 where (d)=t1.a),d) from t1 union select 19 from t1) or 13 not between 17 and 13 and (19 between (t1.e) and t1.f) or ( -t1.e)>=17 then b when t1.d not in (19,f,t1.f) then a else case when t1.a=t1.d then e when 17 in (t1.e,t1.b,t1.d) then t1.a else a end end,e,11)} -} {0} -do_test randexpr-2.313 { - db eval {SELECT (abs(13)/abs((select min(case when case when exists(select 1 from t1 where not exists(select 1 from t1 where (select count(distinct (t1.e)) from t1)+t1.f>t1.e) and t1.a>=13 or f in (select t1.e from t1 union select t1.e from t1)) then b when f not in (13,13,13) then coalesce((select max(d*f) from t1 where t1.e in (t1.d,t1.e,(e))),t1.e) else a end>=t1.f then b when t1.c in (e,f,t1.e) then b else t1.c end)*abs(count(*))-abs(~count(*)-min(e))-cast(avg(17) AS integer) from t1))) FROM t1 WHERE NOT (t1.b not in (a*17-17-case when -17-t1.f in (select coalesce((select t1.a from t1 where (d)=t1.a),d) from t1 union select 19 from t1) or 13 not between 17 and 13 and (19 between (t1.e) and t1.f) or ( -t1.e)>=17 then b when t1.d not in (19,f,t1.f) then a else case when t1.a=t1.d then e when 17 in (t1.e,t1.b,t1.d) then t1.a else a end end,e,11))} -} {} -do_test randexpr-2.314 { - db eval {SELECT (abs(case coalesce((select t1.d* -case when d in (select cast(avg(13) AS integer)*abs(((cast(avg(d) AS integer)))+ -count(distinct c))-max(t1.c) from t1 union select min(e) from t1) then (abs(19)/abs(case when b not in (19,d,13) or t1.b not in (b,17,17) then e else b end)) else 19 end from t1 where a>=t1.c and 17 not in (t1.c,17,t1.f)),13)*t1.f when e then (11) else 17 end+19 | b)/abs(f))-t1.e FROM t1 WHERE not exists(select 1 from t1 where case a when coalesce((select max(case 19 when 17 then b-d else t1.e end) from t1 where ( -coalesce((select max(t1.a) from t1 where e between t1.b and (abs(e)/abs(17))),(abs(case when case when 13 between e and (t1.b) and 11 not in (t1.f,t1.e,c) then (t1.d) else -c end< -e then 11 when 13>t1.b then 11 else t1.a end*13)/abs((f)))-t1.a) not in (e,(b),t1.c))),19) then t1.b else 13 end not between t1.b and 11)} -} {} -do_test randexpr-2.315 { - db eval {SELECT (abs(case coalesce((select t1.d* -case when d in (select cast(avg(13) AS integer)*abs(((cast(avg(d) AS integer)))+ -count(distinct c))-max(t1.c) from t1 union select min(e) from t1) then (abs(19)/abs(case when b not in (19,d,13) or t1.b not in (b,17,17) then e else b end)) else 19 end from t1 where a>=t1.c and 17 not in (t1.c,17,t1.f)),13)*t1.f when e then (11) else 17 end+19 | b)/abs(f))-t1.e FROM t1 WHERE NOT (not exists(select 1 from t1 where case a when coalesce((select max(case 19 when 17 then b-d else t1.e end) from t1 where ( -coalesce((select max(t1.a) from t1 where e between t1.b and (abs(e)/abs(17))),(abs(case when case when 13 between e and (t1.b) and 11 not in (t1.f,t1.e,c) then (t1.d) else -c end< -e then 11 when 13>t1.b then 11 else t1.a end*13)/abs((f)))-t1.a) not in (e,(b),t1.c))),19) then t1.b else 13 end not between t1.b and 11))} -} {-500} -do_test randexpr-2.316 { - db eval {SELECT (abs(case coalesce((select t1.d* -case when d in (select cast(avg(13) AS integer)*abs(((cast(avg(d) AS integer)))+ -count(distinct c))-max(t1.c) from t1 union select min(e) from t1) then (abs(19)/abs(case when b not in (19,d,13) or t1.b not in (b,17,17) then e else b end)) else 19 end from t1 where a>=t1.c and 17 not in (t1.c,17,t1.f)),13)*t1.f when e then (11) else 17 end+19 & b)/abs(f))-t1.e FROM t1 WHERE NOT (not exists(select 1 from t1 where case a when coalesce((select max(case 19 when 17 then b-d else t1.e end) from t1 where ( -coalesce((select max(t1.a) from t1 where e between t1.b and (abs(e)/abs(17))),(abs(case when case when 13 between e and (t1.b) and 11 not in (t1.f,t1.e,c) then (t1.d) else -c end< -e then 11 when 13>t1.b then 11 else t1.a end*13)/abs((f)))-t1.a) not in (e,(b),t1.c))),19) then t1.b else 13 end not between t1.b and 11))} -} {-500} -do_test randexpr-2.317 { - db eval {SELECT -(+case when ~t1.d-f-case coalesce((select max((select (min((abs(t1.f)/abs(t1.b))-17)) from t1)) from t1 where e<=17),f) when t1.f then (select case -( -count(distinct b)) when cast(avg( -13) AS integer) then cast(avg(13) AS integer) else max(19) end from t1)-t1.e else 13 end*b between t1.c and t1.d then t1.d when et1.f),d)*t1.e)+max(t1.f)+cast(avg(e) AS integer) | (abs((count(distinct 17)))) from t1 union select max(t1.b) from t1) or 17 in (select -t1.b from t1 union select t1.a from t1) and exists(select 1 from t1 where t1.e=t1.c))),f+(t1.e)) FROM t1 WHERE exists(select 1 from t1 where +t1.d between (abs((abs(t1.c)/abs(case when not exists(select 1 from t1 where d*~(select abs(min(13))-( -(max(t1.f))*( -(count(distinct a)))-max(17)*min(t1.a) | (cast(avg(t1.b) AS integer))) from t1)>case when a in (select max(c) from t1 union select count(distinct -t1.a) from t1) or +17 in (select -count(distinct t1.f) from t1 union select cast(avg(t1.f) AS integer) from t1) then c else t1.a end) then -t1.f else t1.f end)))/abs(c+a)) and d)} -} {17} -do_test randexpr-2.323 { - db eval {SELECT coalesce((select 17 from t1 where not exists(select 1 from t1 where 11 in (select count(distinct d-coalesce((select t1.c-t1.f from t1 where 13 in (19,e,t1.b) and e in (select ( -count(*)) from t1 union select max(e) from t1) or t1.a>t1.f),d)*t1.e)+max(t1.f)+cast(avg(e) AS integer) | (abs((count(distinct 17)))) from t1 union select max(t1.b) from t1) or 17 in (select -t1.b from t1 union select t1.a from t1) and exists(select 1 from t1 where t1.e=t1.c))),f+(t1.e)) FROM t1 WHERE NOT (exists(select 1 from t1 where +t1.d between (abs((abs(t1.c)/abs(case when not exists(select 1 from t1 where d*~(select abs(min(13))-( -(max(t1.f))*( -(count(distinct a)))-max(17)*min(t1.a) | (cast(avg(t1.b) AS integer))) from t1)>case when a in (select max(c) from t1 union select count(distinct -t1.a) from t1) or +17 in (select -count(distinct t1.f) from t1 union select cast(avg(t1.f) AS integer) from t1) then c else t1.a end) then -t1.f else t1.f end)))/abs(c+a)) and d))} -} {} -do_test randexpr-2.324 { - db eval {SELECT coalesce((select 17 from t1 where not exists(select 1 from t1 where 11 in (select count(distinct d-coalesce((select t1.c-t1.f from t1 where 13 in (19,e,t1.b) and e in (select ( -count(*)) from t1 union select max(e) from t1) or t1.a>t1.f),d)*t1.e)+max(t1.f)+cast(avg(e) AS integer) & (abs((count(distinct 17)))) from t1 union select max(t1.b) from t1) or 17 in (select -t1.b from t1 union select t1.a from t1) and exists(select 1 from t1 where t1.e=t1.c))),f+(t1.e)) FROM t1 WHERE exists(select 1 from t1 where +t1.d between (abs((abs(t1.c)/abs(case when not exists(select 1 from t1 where d*~(select abs(min(13))-( -(max(t1.f))*( -(count(distinct a)))-max(17)*min(t1.a) | (cast(avg(t1.b) AS integer))) from t1)>case when a in (select max(c) from t1 union select count(distinct -t1.a) from t1) or +17 in (select -count(distinct t1.f) from t1 union select cast(avg(t1.f) AS integer) from t1) then c else t1.a end) then -t1.f else t1.f end)))/abs(c+a)) and d)} -} {17} -do_test randexpr-2.325 { - db eval {SELECT t1.d*17- -case when case (b) when t1.c then (abs(t1.f)/abs((select + -~abs(min(f) | +cast(avg(++t1.e+t1.d) AS integer) | ((count(distinct t1.a)-count(*)))) from t1))) else c*case t1.b when t1.d then (t1.c) else t1.c end*(b)-c end=t1.d then t1.c when -17=c then t1.e else t1.c end FROM t1 WHERE t1.b in (f,b,a)} -} {7100} -do_test randexpr-2.326 { - db eval {SELECT t1.d*17- -case when case (b) when t1.c then (abs(t1.f)/abs((select + -~abs(min(f) | +cast(avg(++t1.e+t1.d) AS integer) | ((count(distinct t1.a)-count(*)))) from t1))) else c*case t1.b when t1.d then (t1.c) else t1.c end*(b)-c end=t1.d then t1.c when -17=c then t1.e else t1.c end FROM t1 WHERE NOT (t1.b in (f,b,a))} -} {} -do_test randexpr-2.327 { - db eval {SELECT t1.d*17- -case when case (b) when t1.c then (abs(t1.f)/abs((select + -~abs(min(f) & +cast(avg(++t1.e+t1.d) AS integer) & ((count(distinct t1.a)-count(*)))) from t1))) else c*case t1.b when t1.d then (t1.c) else t1.c end*(b)-c end=t1.d then t1.c when -17=c then t1.e else t1.c end FROM t1 WHERE t1.b in (f,b,a)} -} {7100} -do_test randexpr-2.328 { - db eval {SELECT coalesce((select e-t1.d-+b*coalesce((select 11 from t1 where (t1.a<=coalesce((select - -coalesce((select max(case case 19 when t1.d then t1.e else t1.a end when b then 13 else t1.e end) from t1 where (c)>=(b)),t1.c)+t1.b from t1 where t1.e>e and exists(select 1 from t1 where b in (t1.b,e,t1.c) or e not between a and d) and 13(coalesce((select (f)+t1.c from t1 where a>t1.c),b))),t1.e)) then 19 else e end when t1.d then t1.e else b end from t1 where t1.b>=f),13)-b*17) from t1 where 11<>e),t1.b)<(c))} -} {500} -do_test randexpr-2.329 { - db eval {SELECT coalesce((select e-t1.d-+b*coalesce((select 11 from t1 where (t1.a<=coalesce((select - -coalesce((select max(case case 19 when t1.d then t1.e else t1.a end when b then 13 else t1.e end) from t1 where (c)>=(b)),t1.c)+t1.b from t1 where t1.e>e and exists(select 1 from t1 where b in (t1.b,e,t1.c) or e not between a and d) and 13(coalesce((select (f)+t1.c from t1 where a>t1.c),b))),t1.e)) then 19 else e end when t1.d then t1.e else b end from t1 where t1.b>=f),13)-b*17) from t1 where 11<>e),t1.b)<(c)))} -} {} -do_test randexpr-2.330 { - db eval {SELECT (abs(case when ++e not in (~c-(19)*+case t1.c when t1.d-coalesce((select max(t1.f) from t1 where (select count(*) from t1)>case when exists(select 1 from t1 where not exists(select 1 from t1 where (not not exists(select 1 from t1 where 19e),t1.e) when 13 then b else t1.c end end+f),c)*t1.c then t1.e else t1.b end,11,b) then -(t1.b) else a end)/abs(13)) FROM t1 WHERE a*t1.a<=17 and exists(select 1 from t1 where (+case coalesce((select max(f) from t1 where d in (select ((+count(*)-( -max(b))))*min(t1.c)* -max(11) from t1 union select count(distinct (19)) from t1)),t1.c) when 13 then 19 else coalesce((select t1.a from t1 where t1.c not in (t1.c,f,13)),b) end)>t1.c) and ( -( -19) between 13 and b or b in (select 11 from t1 union select a from t1) and 19 in (t1.d,t1.d,19))} -} {} -do_test randexpr-2.331 { - db eval {SELECT (abs(case when ++e not in (~c-(19)*+case t1.c when t1.d-coalesce((select max(t1.f) from t1 where (select count(*) from t1)>case when exists(select 1 from t1 where not exists(select 1 from t1 where (not not exists(select 1 from t1 where 19e),t1.e) when 13 then b else t1.c end end+f),c)*t1.c then t1.e else t1.b end,11,b) then -(t1.b) else a end)/abs(13)) FROM t1 WHERE NOT (a*t1.a<=17 and exists(select 1 from t1 where (+case coalesce((select max(f) from t1 where d in (select ((+count(*)-( -max(b))))*min(t1.c)* -max(11) from t1 union select count(distinct (19)) from t1)),t1.c) when 13 then 19 else coalesce((select t1.a from t1 where t1.c not in (t1.c,f,13)),b) end)>t1.c) and ( -( -19) between 13 and b or b in (select 11 from t1 union select a from t1) and 19 in (t1.d,t1.d,19)))} -} {15} -do_test randexpr-2.332 { - db eval {SELECT case when a>=f then -t1.a-11*t1.c when ((t1.e-t1.e+17 between (select max(c) from t1)-13 and coalesce((select t1.d from t1 where ((coalesce((select max(case when (not b>17) then t1.b-b when -e in (c,a,13) then 11 else t1.a end) from t1 where 19<=11),t1.e)>=e))),t1.a))) then c else t1.b end | 17 FROM t1 WHERE 11-t1.d+d-13+(t1.f*case when exists(select 1 from t1 where ( -coalesce((select max(t1.d) from t1 where (exists(select 1 from t1 where 19 in (select d from t1 union select t1.f from t1)))),t1.d)<=case when 13*11+11 in (select abs(+~abs( -min(c))) from t1 union select (min(t1.e)) from t1) then t1.f else 19 end)) then t1.c else (abs(e)/abs(19)) end*t1.f*f)<(t1.d)} -} {} -do_test randexpr-2.333 { - db eval {SELECT case when a>=f then -t1.a-11*t1.c when ((t1.e-t1.e+17 between (select max(c) from t1)-13 and coalesce((select t1.d from t1 where ((coalesce((select max(case when (not b>17) then t1.b-b when -e in (c,a,13) then 11 else t1.a end) from t1 where 19<=11),t1.e)>=e))),t1.a))) then c else t1.b end | 17 FROM t1 WHERE NOT (11-t1.d+d-13+(t1.f*case when exists(select 1 from t1 where ( -coalesce((select max(t1.d) from t1 where (exists(select 1 from t1 where 19 in (select d from t1 union select t1.f from t1)))),t1.d)<=case when 13*11+11 in (select abs(+~abs( -min(c))) from t1 union select (min(t1.e)) from t1) then t1.f else 19 end)) then t1.c else (abs(e)/abs(19)) end*t1.f*f)<(t1.d))} -} {217} -do_test randexpr-2.334 { - db eval {SELECT case when a>=f then -t1.a-11*t1.c when ((t1.e-t1.e+17 between (select max(c) from t1)-13 and coalesce((select t1.d from t1 where ((coalesce((select max(case when (not b>17) then t1.b-b when -e in (c,a,13) then 11 else t1.a end) from t1 where 19<=11),t1.e)>=e))),t1.a))) then c else t1.b end & 17 FROM t1 WHERE NOT (11-t1.d+d-13+(t1.f*case when exists(select 1 from t1 where ( -coalesce((select max(t1.d) from t1 where (exists(select 1 from t1 where 19 in (select d from t1 union select t1.f from t1)))),t1.d)<=case when 13*11+11 in (select abs(+~abs( -min(c))) from t1 union select (min(t1.e)) from t1) then t1.f else 19 end)) then t1.c else (abs(e)/abs(19)) end*t1.f*f)<(t1.d))} -} {0} -do_test randexpr-2.335 { - db eval {SELECT case ~13*c-t1.f- -t1.f when coalesce((select max(coalesce((select max(t1.c) from t1 where coalesce((select t1.d from t1 where 11*f-a=a),t1.e) in (select case ~count(distinct 11) | min(c) when (count(*))-count(*) then max( -17) else (min(13)) end from t1 union select - -cast(avg(b) AS integer) from t1)),19)-t1.c) from t1 where exists(select 1 from t1 where t1.b not between t1.e and 11 and ((a<>t1.f)) and (t1.a)=t1.d)),17) then t1.d else -b end FROM t1 WHERE case when ~13+t1.e-19>=13 then 17 else t1.c end>=a*19 and (f in (select case min(t1.e*+(abs(11)/abs(13))) when count(distinct t1.c) | abs((min(t1.b)-(max(t1.d)))+abs(max(a))+count(*)) | cast(avg(e) AS integer) then max(c) else max(c) end from t1 union select min(t1.c) from t1))} -} {} -do_test randexpr-2.336 { - db eval {SELECT case ~13*c-t1.f- -t1.f when coalesce((select max(coalesce((select max(t1.c) from t1 where coalesce((select t1.d from t1 where 11*f-a=a),t1.e) in (select case ~count(distinct 11) | min(c) when (count(*))-count(*) then max( -17) else (min(13)) end from t1 union select - -cast(avg(b) AS integer) from t1)),19)-t1.c) from t1 where exists(select 1 from t1 where t1.b not between t1.e and 11 and ((a<>t1.f)) and (t1.a)=t1.d)),17) then t1.d else -b end FROM t1 WHERE NOT (case when ~13+t1.e-19>=13 then 17 else t1.c end>=a*19 and (f in (select case min(t1.e*+(abs(11)/abs(13))) when count(distinct t1.c) | abs((min(t1.b)-(max(t1.d)))+abs(max(a))+count(*)) | cast(avg(e) AS integer) then max(c) else max(c) end from t1 union select min(t1.c) from t1)))} -} {-200} -do_test randexpr-2.337 { - db eval {SELECT case ~13*c-t1.f- -t1.f when coalesce((select max(coalesce((select max(t1.c) from t1 where coalesce((select t1.d from t1 where 11*f-a=a),t1.e) in (select case ~count(distinct 11) & min(c) when (count(*))-count(*) then max( -17) else (min(13)) end from t1 union select - -cast(avg(b) AS integer) from t1)),19)-t1.c) from t1 where exists(select 1 from t1 where t1.b not between t1.e and 11 and ((a<>t1.f)) and (t1.a)=t1.d)),17) then t1.d else -b end FROM t1 WHERE NOT (case when ~13+t1.e-19>=13 then 17 else t1.c end>=a*19 and (f in (select case min(t1.e*+(abs(11)/abs(13))) when count(distinct t1.c) | abs((min(t1.b)-(max(t1.d)))+abs(max(a))+count(*)) | cast(avg(e) AS integer) then max(c) else max(c) end from t1 union select min(t1.c) from t1)))} -} {-200} -do_test randexpr-2.338 { - db eval {SELECT f*13-t1.f*(abs(19*t1.a*c-(select ~max(t1.c)- -( -cast(avg(f) AS integer))+(max(d))*cast(avg(t1.d) AS integer)*(count(*)) from t1))/abs(case when coalesce((select (coalesce((select max(t1.c) from t1 where -(b)<> -t1.a),b)+11) from t1 where not (11)<=t1.e and c not between 17 and t1.e and b not in (f,(t1.a),t1.e)),t1.f) in (select t1.d from t1 union select 19 from t1) then t1.a when f>13 then t1.e else a end)) FROM t1 WHERE -b<>b*t1.e} -} {-484800} -do_test randexpr-2.339 { - db eval {SELECT f*13-t1.f*(abs(19*t1.a*c-(select ~max(t1.c)- -( -cast(avg(f) AS integer))+(max(d))*cast(avg(t1.d) AS integer)*(count(*)) from t1))/abs(case when coalesce((select (coalesce((select max(t1.c) from t1 where -(b)<> -t1.a),b)+11) from t1 where not (11)<=t1.e and c not between 17 and t1.e and b not in (f,(t1.a),t1.e)),t1.f) in (select t1.d from t1 union select 19 from t1) then t1.a when f>13 then t1.e else a end)) FROM t1 WHERE NOT ( -b<>b*t1.e)} -} {} -do_test randexpr-2.340 { - db eval {SELECT case when coalesce((select c from t1 where (13-(11-t1.e | t1.b) in (select +min(c)*+case +min(t1.e) when min(coalesce((select t1.e*t1.a from t1 where t1.f in (t1.d,11,t1.d) or t1.e>11 or t1.d>=c),17))+max(11)-count(distinct -a) | max(11)+min(t1.c)-max(13) then count(distinct c) else (max(13)) end from t1 union select (( -cast(avg(11) AS integer))) from t1))),d) in (select f from t1 union select t1.a from t1) then 17 else 19 end FROM t1 WHERE not exists(select 1 from t1 where (select +min(case when not (f*e between (select min(~~t1.d) from t1)*(abs(c)/abs(d)) and case when f=b then t1.f when not c>=17 then ~t1.b else 11 end else 19 end) from t1)-19 not in (d,t1.a,d))} -} {} -do_test randexpr-2.341 { - db eval {SELECT case when coalesce((select c from t1 where (13-(11-t1.e | t1.b) in (select +min(c)*+case +min(t1.e) when min(coalesce((select t1.e*t1.a from t1 where t1.f in (t1.d,11,t1.d) or t1.e>11 or t1.d>=c),17))+max(11)-count(distinct -a) | max(11)+min(t1.c)-max(13) then count(distinct c) else (max(13)) end from t1 union select (( -cast(avg(11) AS integer))) from t1))),d) in (select f from t1 union select t1.a from t1) then 17 else 19 end FROM t1 WHERE NOT (not exists(select 1 from t1 where (select +min(case when not (f*e between (select min(~~t1.d) from t1)*(abs(c)/abs(d)) and case when f=b then t1.f when not c>=17 then ~t1.b else 11 end else 19 end) from t1)-19 not in (d,t1.a,d)))} -} {19} -do_test randexpr-2.342 { - db eval {SELECT case when coalesce((select c from t1 where (13-(11-t1.e & t1.b) in (select +min(c)*+case +min(t1.e) when min(coalesce((select t1.e*t1.a from t1 where t1.f in (t1.d,11,t1.d) or t1.e>11 or t1.d>=c),17))+max(11)-count(distinct -a) & max(11)+min(t1.c)-max(13) then count(distinct c) else (max(13)) end from t1 union select (( -cast(avg(11) AS integer))) from t1))),d) in (select f from t1 union select t1.a from t1) then 17 else 19 end FROM t1 WHERE NOT (not exists(select 1 from t1 where (select +min(case when not (f*e between (select min(~~t1.d) from t1)*(abs(c)/abs(d)) and case when f=b then t1.f when not c>=17 then ~t1.b else 11 end else 19 end) from t1)-19 not in (d,t1.a,d)))} -} {19} -do_test randexpr-2.343 { - db eval {SELECT t1.c*a+(case when t1.b+11 | case when exists(select 1 from t1 where b<>17 or not exists(select 1 from t1 where t1.f in (19,t1.f,c)) or (t1.d)<>b) then e else d end+t1.b+t1.a*b=t1.d or d=b then t1.e when not exists(select 1 from t1 where b>t1.c or 17 between t1.f and e and d>=t1.c) then t1.d else c end) FROM t1 WHERE exists(select 1 from t1 where not exists(select 1 from t1 where (abs(c)/abs(b)) in (t1.a, -e*~e*17,17)))} -} {30400} -do_test randexpr-2.344 { - db eval {SELECT t1.c*a+(case when t1.b+11 | case when exists(select 1 from t1 where b<>17 or not exists(select 1 from t1 where t1.f in (19,t1.f,c)) or (t1.d)<>b) then e else d end+t1.b+t1.a*b=t1.d or d=b then t1.e when not exists(select 1 from t1 where b>t1.c or 17 between t1.f and e and d>=t1.c) then t1.d else c end) FROM t1 WHERE NOT (exists(select 1 from t1 where not exists(select 1 from t1 where (abs(c)/abs(b)) in (t1.a, -e*~e*17,17))))} -} {} -do_test randexpr-2.345 { - db eval {SELECT t1.c*a+(case when t1.b+11 & case when exists(select 1 from t1 where b<>17 or not exists(select 1 from t1 where t1.f in (19,t1.f,c)) or (t1.d)<>b) then e else d end+t1.b+t1.a*b=t1.d or d=b then t1.e when not exists(select 1 from t1 where b>t1.c or 17 between t1.f and e and d>=t1.c) then t1.d else c end) FROM t1 WHERE exists(select 1 from t1 where not exists(select 1 from t1 where (abs(c)/abs(b)) in (t1.a, -e*~e*17,17)))} -} {30400} -do_test randexpr-2.346 { - db eval {SELECT coalesce((select -b from t1 where t1.f=d),case when case -17-t1.b*t1.d+d when b then t1.a else t1.e end not in (t1.c,13,19) and e>f and 13 not between 17 and -f and e not between d and a then 13 when c<=a then 13 else 19 | e end)*a-d*t1.e FROM t1 WHERE (abs(+t1.f)/abs(coalesce((select max(coalesce((select max(e) from t1 where t1.a in (select (abs( -t1.b)/abs(a)) from t1 union select e from t1)),(abs(case t1.f when c then (select (~cast(avg(b*d) AS integer))*abs(min(11)) from t1) else coalesce((select f from t1 where d in (select ( -min(e)) from t1 union select -count(*) from t1)),t1.c) end*t1.b)/abs(c))+17)) from t1 where exists(select 1 from t1 where d not between t1.f and t1.b)),(t1.c))))*t1.d between t1.f and t1.a} -} {} -do_test randexpr-2.347 { - db eval {SELECT coalesce((select -b from t1 where t1.f=d),case when case -17-t1.b*t1.d+d when b then t1.a else t1.e end not in (t1.c,13,19) and e>f and 13 not between 17 and -f and e not between d and a then 13 when c<=a then 13 else 19 | e end)*a-d*t1.e FROM t1 WHERE NOT ((abs(+t1.f)/abs(coalesce((select max(coalesce((select max(e) from t1 where t1.a in (select (abs( -t1.b)/abs(a)) from t1 union select e from t1)),(abs(case t1.f when c then (select (~cast(avg(b*d) AS integer))*abs(min(11)) from t1) else coalesce((select f from t1 where d in (select ( -min(e)) from t1 union select -count(*) from t1)),t1.c) end*t1.b)/abs(c))+17)) from t1 where exists(select 1 from t1 where d not between t1.f and t1.b)),(t1.c))))*t1.d between t1.f and t1.a)} -} {-149700} -do_test randexpr-2.348 { - db eval {SELECT coalesce((select -b from t1 where t1.f=d),case when case -17-t1.b*t1.d+d when b then t1.a else t1.e end not in (t1.c,13,19) and e>f and 13 not between 17 and -f and e not between d and a then 13 when c<=a then 13 else 19 & e end)*a-d*t1.e FROM t1 WHERE NOT ((abs(+t1.f)/abs(coalesce((select max(coalesce((select max(e) from t1 where t1.a in (select (abs( -t1.b)/abs(a)) from t1 union select e from t1)),(abs(case t1.f when c then (select (~cast(avg(b*d) AS integer))*abs(min(11)) from t1) else coalesce((select f from t1 where d in (select ( -min(e)) from t1 union select -count(*) from t1)),t1.c) end*t1.b)/abs(c))+17)) from t1 where exists(select 1 from t1 where d not between t1.f and t1.b)),(t1.c))))*t1.d between t1.f and t1.a)} -} {-198400} -do_test randexpr-2.349 { - db eval {SELECT coalesce((select t1.b*19 from t1 where ~f in (select 19 from t1 union select ~b-+case 13 when coalesce((select max(a) from t1 where (abs(d)/abs(t1.d)) | t1.e-c-t1.d-t1.c+11*f-c+t1.a>17), -a) then f else t1.d end+17 | a*f | t1.c-d from t1)),19) FROM t1 WHERE t1.e*t1.c>coalesce((select 13 from t1 where ~t1.a<>case when exists(select 1 from t1 where e<>~d and not +17 not between a+case 13 when d then case t1.d when t1.a then b else 13 end else 13 end and 13) or 13 not in (t1.e,t1.f,t1.c) then 19-e+19 when f<=t1.f then b else 11 end),e)-13} -} {19} -do_test randexpr-2.350 { - db eval {SELECT coalesce((select t1.b*19 from t1 where ~f in (select 19 from t1 union select ~b-+case 13 when coalesce((select max(a) from t1 where (abs(d)/abs(t1.d)) | t1.e-c-t1.d-t1.c+11*f-c+t1.a>17), -a) then f else t1.d end+17 | a*f | t1.c-d from t1)),19) FROM t1 WHERE NOT (t1.e*t1.c>coalesce((select 13 from t1 where ~t1.a<>case when exists(select 1 from t1 where e<>~d and not +17 not between a+case 13 when d then case t1.d when t1.a then b else 13 end else 13 end and 13) or 13 not in (t1.e,t1.f,t1.c) then 19-e+19 when f<=t1.f then b else 11 end),e)-13)} -} {} -do_test randexpr-2.351 { - db eval {SELECT coalesce((select t1.b*19 from t1 where ~f in (select 19 from t1 union select ~b-+case 13 when coalesce((select max(a) from t1 where (abs(d)/abs(t1.d)) & t1.e-c-t1.d-t1.c+11*f-c+t1.a>17), -a) then f else t1.d end+17 & a*f & t1.c-d from t1)),19) FROM t1 WHERE t1.e*t1.c>coalesce((select 13 from t1 where ~t1.a<>case when exists(select 1 from t1 where e<>~d and not +17 not between a+case 13 when d then case t1.d when t1.a then b else 13 end else 13 end and 13) or 13 not in (t1.e,t1.f,t1.c) then 19-e+19 when f<=t1.f then b else 11 end),e)-13} -} {19} -do_test randexpr-2.352 { - db eval {SELECT (abs( -coalesce((select max((t1.f)) from t1 where not exists(select 1 from t1 where -b-~b not between t1.c and f and t1.d*( -(select abs(+count(*)) from t1))-d>=a) and case when +case when ((f)) in (select -count(distinct t1.a) from t1 union select count(*) from t1) then t1.b else d end in (select min(17) from t1 union select min(t1.e) from t1) then d else 17 end+c not between 11 and a),f)*11)/abs(a)) FROM t1 WHERE t1.f*t1.a*(+c)+case case when t1.d=f and (t1.a<>~+a*a*e*t1.e+case when t1.c between 11 and b and t1.a<>e then 13 when ( -t1.e)<>(t1.a) then (t1.b) else 13 end-t1.b-e+f) then t1.f+a else 17 end when d then 17 else d end-t1.e not in (13,t1.a,11)} -} {66} -do_test randexpr-2.353 { - db eval {SELECT (abs( -coalesce((select max((t1.f)) from t1 where not exists(select 1 from t1 where -b-~b not between t1.c and f and t1.d*( -(select abs(+count(*)) from t1))-d>=a) and case when +case when ((f)) in (select -count(distinct t1.a) from t1 union select count(*) from t1) then t1.b else d end in (select min(17) from t1 union select min(t1.e) from t1) then d else 17 end+c not between 11 and a),f)*11)/abs(a)) FROM t1 WHERE NOT (t1.f*t1.a*(+c)+case case when t1.d=f and (t1.a<>~+a*a*e*t1.e+case when t1.c between 11 and b and t1.a<>e then 13 when ( -t1.e)<>(t1.a) then (t1.b) else 13 end-t1.b-e+f) then t1.f+a else 17 end when d then 17 else d end-t1.e not in (13,t1.a,11))} -} {} -do_test randexpr-2.354 { - db eval {SELECT case t1.b- -t1.d+t1.d+t1.f when t1.f then 19+~13 else d end-case when not exists(select 1 from t1 where (f not between coalesce((select b from t1 where d in (17,13,t1.a) and 13 between c and 13 and 19>=f),13) and e or d not between 13 and f) or f>=d) then t1.f else coalesce((select max(~e-11) from t1 where t1.b in (f,13,13)),t1.a) end FROM t1 WHERE a=f),13) and e or d not between 13 and f) or f>=d) then t1.f else coalesce((select max(~e-11) from t1 where t1.b in (f,13,13)),t1.a) end FROM t1 WHERE NOT (a=t1.c and exists(select 1 from t1 where t1.f>=13) then t1.d when d between t1.d and t1.a then 19 else a end | e when (a) then e else a end between b and t1.c and not exists(select 1 from t1 where 13 in (t1.d,t1.a,13)) or t1.a>= -13),c) FROM t1 WHERE t1.e not in ( -coalesce((select max(13) from t1 where exists(select 1 from t1 where not t1.d>a) and t1.a not in (d*+case when t1.b in (select max(e*11+t1.a)+ -count(*)-( -max(t1.e))-min(11)-count(distinct t1.a) from t1 union select - -min(t1.b) from t1) then t1.e when e in (select count(distinct t1.a) from t1 union select (max(d)) from t1) then e else -(19) end+ -t1.d, -17,f)),case c when a then f else 17 end),d,11)} -} {-13} -do_test randexpr-2.357 { - db eval {SELECT -coalesce((select max(13) from t1 where case case when f in (select e from t1 union select coalesce((select max(e) from t1 where (select -max(e) from t1)*t1.e=t1.c and exists(select 1 from t1 where t1.f>=13) then t1.d when d between t1.d and t1.a then 19 else a end | e when (a) then e else a end between b and t1.c and not exists(select 1 from t1 where 13 in (t1.d,t1.a,13)) or t1.a>= -13),c) FROM t1 WHERE NOT (t1.e not in ( -coalesce((select max(13) from t1 where exists(select 1 from t1 where not t1.d>a) and t1.a not in (d*+case when t1.b in (select max(e*11+t1.a)+ -count(*)-( -max(t1.e))-min(11)-count(distinct t1.a) from t1 union select - -min(t1.b) from t1) then t1.e when e in (select count(distinct t1.a) from t1 union select (max(d)) from t1) then e else -(19) end+ -t1.d, -17,f)),case c when a then f else 17 end),d,11))} -} {} -do_test randexpr-2.358 { - db eval {SELECT -coalesce((select max(13) from t1 where case case when f in (select e from t1 union select coalesce((select max(e) from t1 where (select -max(e) from t1)*t1.e=t1.c and exists(select 1 from t1 where t1.f>=13) then t1.d when d between t1.d and t1.a then 19 else a end & e when (a) then e else a end between b and t1.c and not exists(select 1 from t1 where 13 in (t1.d,t1.a,13)) or t1.a>= -13),c) FROM t1 WHERE t1.e not in ( -coalesce((select max(13) from t1 where exists(select 1 from t1 where not t1.d>a) and t1.a not in (d*+case when t1.b in (select max(e*11+t1.a)+ -count(*)-( -max(t1.e))-min(11)-count(distinct t1.a) from t1 union select - -min(t1.b) from t1) then t1.e when e in (select count(distinct t1.a) from t1 union select (max(d)) from t1) then e else -(19) end+ -t1.d, -17,f)),case c when a then f else 17 end),d,11)} -} {-13} -do_test randexpr-2.359 { - db eval {SELECT case d when -e+coalesce((select max(case (select +abs((~case case count(distinct b) when -count(*) then count(*) else max(t1.e) end when max(e) then min(t1.c) else count(*) end-min(c))) from t1) when t1.c then t1.a else -11 end) from t1 where case ~t1.b when e then d else 11 end in (b,t1.e,t1.b) or not t1.f>=b or (t1.f in (a,e,t1.e)) or f=b or (t1.f in (a,e,t1.e)) or ft1.b) or t1.a not in (f,t1.b,t1.e) or t1.d<=t1.b and 19 not in (t1.d,11,t1.f) then t1.d else 19 end+e+17 end | -t1.c*d end-13 FROM t1 WHERE e not in (e,t1.b,t1.d)} -} {} -do_test randexpr-2.362 { - db eval {SELECT case a when ~c then e+17-d else case t1.a when c then t1.b else case when ((case t1.e when c then d-11 else t1.f end not in (e,(17),t1.d))) or not exists(select 1 from t1 where e not in (d,t1.f,11) and -t1.a>t1.b) or t1.a not in (f,t1.b,t1.e) or t1.d<=t1.b and 19 not in (t1.d,11,t1.f) then t1.d else 19 end+e+17 end | -t1.c*d end-13 FROM t1 WHERE NOT (e not in (e,t1.b,t1.d))} -} {-119864} -do_test randexpr-2.363 { - db eval {SELECT case a when ~c then e+17-d else case t1.a when c then t1.b else case when ((case t1.e when c then d-11 else t1.f end not in (e,(17),t1.d))) or not exists(select 1 from t1 where e not in (d,t1.f,11) and -t1.a>t1.b) or t1.a not in (f,t1.b,t1.e) or t1.d<=t1.b and 19 not in (t1.d,11,t1.f) then t1.d else 19 end+e+17 end & -t1.c*d end-13 FROM t1 WHERE NOT (e not in (e,t1.b,t1.d))} -} {755} -do_test randexpr-2.364 { - db eval {SELECT coalesce((select max(case t1.a when d then ~11 else t1.e end) from t1 where (t1.f*17=a or t1.e=t1.a and -c>=t1.b)),t1.b) FROM t1 WHERE a+( -t1.c) between case when case a when t1.f then ~t1.b*t1.c+17 else -case when f not in (e,f,17) then a when 11=13 then t1.c else t1.d end end>=t1.b then b when t1.d in (select +max(19) from t1 union select abs(cast(avg(t1.f) AS integer))+case ~count(*)-max(t1.a)+max(11) when (max(a)) then (max(t1.d)) else count(distinct 11) end from t1) and e in (t1.d,17,11) then (11) else b end and a} -} {} -do_test randexpr-2.365 { - db eval {SELECT coalesce((select max(case t1.a when d then ~11 else t1.e end) from t1 where (t1.f*17=a or t1.e=t1.a and -c>=t1.b)),t1.b) FROM t1 WHERE NOT (a+( -t1.c) between case when case a when t1.f then ~t1.b*t1.c+17 else -case when f not in (e,f,17) then a when 11=13 then t1.c else t1.d end end>=t1.b then b when t1.d in (select +max(19) from t1 union select abs(cast(avg(t1.f) AS integer))+case ~count(*)-max(t1.a)+max(11) when (max(a)) then (max(t1.d)) else count(distinct 11) end from t1) and e in (t1.d,17,11) then (11) else b end and a)} -} {200} -do_test randexpr-2.366 { - db eval {SELECT t1.f+case when c*f | (t1.a) in (select b*f from t1 union select -case when d not between ~13 | 13+case a when a then e else a end and f then 11 else e-t1.d end from t1) then -(abs(case when ((case t1.f when t1.b then t1.f else a end*f+t1.c)) in (select d from t1 union select (t1.e) from t1) then d else (t1.f) end)/abs(b)) else t1.a end FROM t1 WHERE ~(f+17-(select +max(t1.f)-case count(distinct d-19) when ~count(distinct (abs(b)/abs(a))) then cast(avg(17) AS integer) else ~count(distinct e)*count(*) end from t1)-f-coalesce((select t1.f from t1 where t1.a>=t1.c or t1.b between -t1.a and 19 or exists(select 1 from t1 where t1.e not in (13,t1.c,e)) and d>a),t1.d)) not between d and c} -} {700} -do_test randexpr-2.367 { - db eval {SELECT t1.f+case when c*f | (t1.a) in (select b*f from t1 union select -case when d not between ~13 | 13+case a when a then e else a end and f then 11 else e-t1.d end from t1) then -(abs(case when ((case t1.f when t1.b then t1.f else a end*f+t1.c)) in (select d from t1 union select (t1.e) from t1) then d else (t1.f) end)/abs(b)) else t1.a end FROM t1 WHERE NOT (~(f+17-(select +max(t1.f)-case count(distinct d-19) when ~count(distinct (abs(b)/abs(a))) then cast(avg(17) AS integer) else ~count(distinct e)*count(*) end from t1)-f-coalesce((select t1.f from t1 where t1.a>=t1.c or t1.b between -t1.a and 19 or exists(select 1 from t1 where t1.e not in (13,t1.c,e)) and d>a),t1.d)) not between d and c)} -} {} -do_test randexpr-2.368 { - db eval {SELECT t1.f+case when c*f & (t1.a) in (select b*f from t1 union select -case when d not between ~13 & 13+case a when a then e else a end and f then 11 else e-t1.d end from t1) then -(abs(case when ((case t1.f when t1.b then t1.f else a end*f+t1.c)) in (select d from t1 union select (t1.e) from t1) then d else (t1.f) end)/abs(b)) else t1.a end FROM t1 WHERE ~(f+17-(select +max(t1.f)-case count(distinct d-19) when ~count(distinct (abs(b)/abs(a))) then cast(avg(17) AS integer) else ~count(distinct e)*count(*) end from t1)-f-coalesce((select t1.f from t1 where t1.a>=t1.c or t1.b between -t1.a and 19 or exists(select 1 from t1 where t1.e not in (13,t1.c,e)) and d>a),t1.d)) not between d and c} -} {700} -do_test randexpr-2.369 { - db eval {SELECT case when coalesce((select d from t1 where not coalesce((select f*t1.b from t1 where exists(select 1 from t1 where (t1.f*t1.a)-19-13 in (select ~(cast(avg(t1.b) AS integer)) from t1 union select min(t1.a)+case min( -t1.a) when cast(avg(19) AS integer) then cast(avg(19) AS integer) else min(13) end+( -min(a)) from t1))),(t1.f)) between 17 and d),11)=19 then t1.b when 17<11 or exists(select 1 from t1 where d in (select 13 from t1 union select f from t1)) then 11 else t1.c end FROM t1 WHERE case c when 13 then +t1.d else t1.a end in (select abs(case + -count(*)+count(distinct coalesce((select (abs(~case when t1.c=19 | 13 then t1.c when not e>(13) then f else d end)/abs(a)) from t1 where 17>=t1.b),t1.b))+min(t1.a)*count(*) | (((max(a)))-cast(avg((17)) AS integer)) when max(d) then count(*) else cast(avg(t1.e) AS integer) end) from t1 union select count(*) from t1)} -} {} -do_test randexpr-2.370 { - db eval {SELECT case when coalesce((select d from t1 where not coalesce((select f*t1.b from t1 where exists(select 1 from t1 where (t1.f*t1.a)-19-13 in (select ~(cast(avg(t1.b) AS integer)) from t1 union select min(t1.a)+case min( -t1.a) when cast(avg(19) AS integer) then cast(avg(19) AS integer) else min(13) end+( -min(a)) from t1))),(t1.f)) between 17 and d),11)=19 then t1.b when 17<11 or exists(select 1 from t1 where d in (select 13 from t1 union select f from t1)) then 11 else t1.c end FROM t1 WHERE NOT (case c when 13 then +t1.d else t1.a end in (select abs(case + -count(*)+count(distinct coalesce((select (abs(~case when t1.c=19 | 13 then t1.c when not e>(13) then f else d end)/abs(a)) from t1 where 17>=t1.b),t1.b))+min(t1.a)*count(*) | (((max(a)))-cast(avg((17)) AS integer)) when max(d) then count(*) else cast(avg(t1.e) AS integer) end) from t1 union select count(*) from t1))} -} {300} -do_test randexpr-2.371 { - db eval {SELECT -(select count(*) from t1)*(select (+(cast(avg(+f) AS integer))+++case +max(t1.b-case when t1.e+t1.e>=11 then -a else t1.e end)-abs(min(e)+ -max(c) | ((max(11)))) when max(11) then (min(b)) else cast(avg( -b) AS integer) end-cast(avg(b) AS integer)-count(*)+count(*)) from t1)+~17- -t1.a FROM t1 WHERE f between 19*t1.d and 19} -} {} -do_test randexpr-2.372 { - db eval {SELECT -(select count(*) from t1)*(select (+(cast(avg(+f) AS integer))+++case +max(t1.b-case when t1.e+t1.e>=11 then -a else t1.e end)-abs(min(e)+ -max(c) | ((max(11)))) when max(11) then (min(b)) else cast(avg( -b) AS integer) end-cast(avg(b) AS integer)-count(*)+count(*)) from t1)+~17- -t1.a FROM t1 WHERE NOT (f between 19*t1.d and 19)} -} {-118} -do_test randexpr-2.373 { - db eval {SELECT -(select count(*) from t1)*(select (+(cast(avg(+f) AS integer))+++case +max(t1.b-case when t1.e+t1.e>=11 then -a else t1.e end)-abs(min(e)+ -max(c) & ((max(11)))) when max(11) then (min(b)) else cast(avg( -b) AS integer) end-cast(avg(b) AS integer)-count(*)+count(*)) from t1)+~17- -t1.a FROM t1 WHERE NOT (f between 19*t1.d and 19)} -} {-118} -do_test randexpr-2.374 { - db eval {SELECT case when not t1.a< -~~e then b when c*(select +case max((abs( -a)/abs(a))) when min(t1.b) then case ~min(t1.d)-cast(avg(e) AS integer) | max(e) when count(distinct 11) then count(*) else max(b) end else count(*) end from t1) not between 13 and case when exists(select 1 from t1 where exists(select 1 from t1 where f not in (19,t1.f,19)) and 11 between t1.b and t1.b) then (13) else -t1.d end then f else e end FROM t1 WHERE d>11} -} {200} -do_test randexpr-2.375 { - db eval {SELECT case when not t1.a< -~~e then b when c*(select +case max((abs( -a)/abs(a))) when min(t1.b) then case ~min(t1.d)-cast(avg(e) AS integer) | max(e) when count(distinct 11) then count(*) else max(b) end else count(*) end from t1) not between 13 and case when exists(select 1 from t1 where exists(select 1 from t1 where f not in (19,t1.f,19)) and 11 between t1.b and t1.b) then (13) else -t1.d end then f else e end FROM t1 WHERE NOT (d>11)} -} {} -do_test randexpr-2.376 { - db eval {SELECT case when not t1.a< -~~e then b when c*(select +case max((abs( -a)/abs(a))) when min(t1.b) then case ~min(t1.d)-cast(avg(e) AS integer) & max(e) when count(distinct 11) then count(*) else max(b) end else count(*) end from t1) not between 13 and case when exists(select 1 from t1 where exists(select 1 from t1 where f not in (19,t1.f,19)) and 11 between t1.b and t1.b) then (13) else -t1.d end then f else e end FROM t1 WHERE d>11} -} {200} -do_test randexpr-2.377 { - db eval {SELECT coalesce((select max(t1.c | ~17) from t1 where exists(select 1 from t1 where t1.f<>b-(abs(13)/abs(e)))),13) FROM t1 WHERE case when case (abs(c+a+19+coalesce((select max(t1.a) from t1 where coalesce((select coalesce((select (f) from t1 where t1.d between 19 and b),t1.a) from t1 where 13=(c)),f) in (select ~case count(*) when max(t1.b) then ((count(distinct 11))) else count(*) end- -count(distinct a) from t1 union select count(distinct 13) from t1)),t1.c) | t1.b+t1.d)/abs(e)) when t1.d then a else 17 end not between 19 and t1.f then t1.b else d end in (select t1.c from t1 union select (t1.a) from t1)} -} {} -do_test randexpr-2.378 { - db eval {SELECT coalesce((select max(t1.c | ~17) from t1 where exists(select 1 from t1 where t1.f<>b-(abs(13)/abs(e)))),13) FROM t1 WHERE NOT (case when case (abs(c+a+19+coalesce((select max(t1.a) from t1 where coalesce((select coalesce((select (f) from t1 where t1.d between 19 and b),t1.a) from t1 where 13=(c)),f) in (select ~case count(*) when max(t1.b) then ((count(distinct 11))) else count(*) end- -count(distinct a) from t1 union select count(distinct 13) from t1)),t1.c) | t1.b+t1.d)/abs(e)) when t1.d then a else 17 end not between 19 and t1.f then t1.b else d end in (select t1.c from t1 union select (t1.a) from t1))} -} {-18} -do_test randexpr-2.379 { - db eval {SELECT coalesce((select max(t1.c & ~17) from t1 where exists(select 1 from t1 where t1.f<>b-(abs(13)/abs(e)))),13) FROM t1 WHERE NOT (case when case (abs(c+a+19+coalesce((select max(t1.a) from t1 where coalesce((select coalesce((select (f) from t1 where t1.d between 19 and b),t1.a) from t1 where 13=(c)),f) in (select ~case count(*) when max(t1.b) then ((count(distinct 11))) else count(*) end- -count(distinct a) from t1 union select count(distinct 13) from t1)),t1.c) | t1.b+t1.d)/abs(e)) when t1.d then a else 17 end not between 19 and t1.f then t1.b else d end in (select t1.c from t1 union select (t1.a) from t1))} -} {300} -do_test randexpr-2.380 { - db eval {SELECT (coalesce((select (coalesce((select d from t1 where not exists(select 1 from t1 where 17>t1.c)),d))*c from t1 where t1.b between t1.d | (select count(distinct coalesce((select max(t1.e) from t1 where case when -e>t1.b then f when t1.a(abs(19*case when coalesce((select b*case when 11 not between 19 and (abs(13)/abs(t1.b-t1.d-e+b-f+19*t1.a)) then -t1.a else f end from t1 where (b=17)),f)= -t1.d then 17 when 11<>19 then f else t1.d end)/abs(t1.b)) then d else 19 end} -} {} -do_test randexpr-2.381 { - db eval {SELECT (coalesce((select (coalesce((select d from t1 where not exists(select 1 from t1 where 17>t1.c)),d))*c from t1 where t1.b between t1.d | (select count(distinct coalesce((select max(t1.e) from t1 where case when -e>t1.b then f when t1.a(abs(19*case when coalesce((select b*case when 11 not between 19 and (abs(13)/abs(t1.b-t1.d-e+b-f+19*t1.a)) then -t1.a else f end from t1 where (b=17)),f)= -t1.d then 17 when 11<>19 then f else t1.d end)/abs(t1.b)) then d else 19 end)} -} {-120289} -do_test randexpr-2.382 { - db eval {SELECT (coalesce((select (coalesce((select d from t1 where not exists(select 1 from t1 where 17>t1.c)),d))*c from t1 where t1.b between t1.d & (select count(distinct coalesce((select max(t1.e) from t1 where case when -e>t1.b then f when t1.a(abs(19*case when coalesce((select b*case when 11 not between 19 and (abs(13)/abs(t1.b-t1.d-e+b-f+19*t1.a)) then -t1.a else f end from t1 where (b=17)),f)= -t1.d then 17 when 11<>19 then f else t1.d end)/abs(t1.b)) then d else 19 end)} -} {-489} -do_test randexpr-2.383 { - db eval {SELECT 19*case when coalesce((select max(t1.e-c) from t1 where f=(abs(coalesce((select t1.c from t1 where not (not exists(select 1 from t1 where a in (select b from t1 union select c from t1)))),13))/abs(coalesce((select 13 from t1 where t1.b in (d,t1.d,a)), -t1.b)))),c) in (select ~min(t1.c) from t1 union select count(*) from t1) and -f<>t1.c then t1.a-t1.e when not t1.a in (select cast(avg(a) AS integer) from t1 union select min(13) from t1) then -19 else f end FROM t1 WHERE 11<>13} -} {11400} -do_test randexpr-2.384 { - db eval {SELECT 19*case when coalesce((select max(t1.e-c) from t1 where f=(abs(coalesce((select t1.c from t1 where not (not exists(select 1 from t1 where a in (select b from t1 union select c from t1)))),13))/abs(coalesce((select 13 from t1 where t1.b in (d,t1.d,a)), -t1.b)))),c) in (select ~min(t1.c) from t1 union select count(*) from t1) and -f<>t1.c then t1.a-t1.e when not t1.a in (select cast(avg(a) AS integer) from t1 union select min(13) from t1) then -19 else f end FROM t1 WHERE NOT (11<>13)} -} {} -do_test randexpr-2.385 { - db eval {SELECT t1.b*(select max(t1.b*coalesce((select max(t1.f*(t1.b)) from t1 where 17 not in (d,(a),(t1.b)+13)),t1.c)-t1.a) | cast(avg(t1.d) AS integer) | ~+case abs(abs(count(distinct t1.b))) when ~count(distinct e)-(count(*)) then max(t1.e) else max(d) end | max((19)) | min(19) from t1)-t1.d-t1.d*17 FROM t1 WHERE t1.f-case t1.d+19+13*case when (abs(e)/abs((select count(*)+cast(avg(a) AS integer)*count(*) from t1)-c*(abs(d)/abs(c*t1.e-19)))) not in (17,17,t1.a) then t1.f when t1.d<>t1.f then b else d end+ - -f*t1.b*d when b then 11 else -13 end<=(t1.b)} -} {} -do_test randexpr-2.386 { - db eval {SELECT t1.b*(select max(t1.b*coalesce((select max(t1.f*(t1.b)) from t1 where 17 not in (d,(a),(t1.b)+13)),t1.c)-t1.a) | cast(avg(t1.d) AS integer) | ~+case abs(abs(count(distinct t1.b))) when ~count(distinct e)-(count(*)) then max(t1.e) else max(d) end | max((19)) | min(19) from t1)-t1.d-t1.d*17 FROM t1 WHERE NOT (t1.f-case t1.d+19+13*case when (abs(e)/abs((select count(*)+cast(avg(a) AS integer)*count(*) from t1)-c*(abs(d)/abs(c*t1.e-19)))) not in (17,17,t1.a) then t1.f when t1.d<>t1.f then b else d end+ - -f*t1.b*d when b then 11 else -13 end<=(t1.b))} -} {-7400} -do_test randexpr-2.387 { - db eval {SELECT t1.b*(select max(t1.b*coalesce((select max(t1.f*(t1.b)) from t1 where 17 not in (d,(a),(t1.b)+13)),t1.c)-t1.a) & cast(avg(t1.d) AS integer) & ~+case abs(abs(count(distinct t1.b))) when ~count(distinct e)-(count(*)) then max(t1.e) else max(d) end & max((19)) & min(19) from t1)-t1.d-t1.d*17 FROM t1 WHERE NOT (t1.f-case t1.d+19+13*case when (abs(e)/abs((select count(*)+cast(avg(a) AS integer)*count(*) from t1)-c*(abs(d)/abs(c*t1.e-19)))) not in (17,17,t1.a) then t1.f when t1.d<>t1.f then b else d end+ - -f*t1.b*d when b then 11 else -13 end<=(t1.b))} -} {-7200} -do_test randexpr-2.388 { - db eval {SELECT (select abs(count(distinct t1.e) | min(b))-cast(avg(c) AS integer) | case +~+max(t1.a)*abs(+~ - -+cast(avg(19*f) AS integer) | count(*) | ~max(b) | ((max(t1.e)))-count(distinct t1.d)+ -(count(distinct t1.c)))* -count(distinct 17) | count(distinct a) when ((count(distinct t1.d))) then -min(t1.c) else count(distinct t1.c) end- -min(d) from t1) FROM t1 WHERE ((not exists(select 1 from t1 where c=f)) and case when not 19+t1.c- -11+11+e>=a or t1.d>b then f else t1.e end<> -t1.c) or (t1.a in (select +count(*) from t1 union select abs((case max(d) when count(distinct d) then min( -t1.e) else count(distinct a) end-count(distinct -t1.f)))*count(*) from t1) or not exists(select 1 from t1 where t1.d not in (c,17,e)))} -} {-99} -do_test randexpr-2.389 { - db eval {SELECT (select abs(count(distinct t1.e) | min(b))-cast(avg(c) AS integer) | case +~+max(t1.a)*abs(+~ - -+cast(avg(19*f) AS integer) | count(*) | ~max(b) | ((max(t1.e)))-count(distinct t1.d)+ -(count(distinct t1.c)))* -count(distinct 17) | count(distinct a) when ((count(distinct t1.d))) then -min(t1.c) else count(distinct t1.c) end- -min(d) from t1) FROM t1 WHERE NOT (((not exists(select 1 from t1 where c=f)) and case when not 19+t1.c- -11+11+e>=a or t1.d>b then f else t1.e end<> -t1.c) or (t1.a in (select +count(*) from t1 union select abs((case max(d) when count(distinct d) then min( -t1.e) else count(distinct a) end-count(distinct -t1.f)))*count(*) from t1) or not exists(select 1 from t1 where t1.d not in (c,17,e))))} -} {} -do_test randexpr-2.390 { - db eval {SELECT (select abs(count(distinct t1.e) & min(b))-cast(avg(c) AS integer) & case +~+max(t1.a)*abs(+~ - -+cast(avg(19*f) AS integer) & count(*) & ~max(b) & ((max(t1.e)))-count(distinct t1.d)+ -(count(distinct t1.c)))* -count(distinct 17) & count(distinct a) when ((count(distinct t1.d))) then -min(t1.c) else count(distinct t1.c) end- -min(d) from t1) FROM t1 WHERE ((not exists(select 1 from t1 where c=f)) and case when not 19+t1.c- -11+11+e>=a or t1.d>b then f else t1.e end<> -t1.c) or (t1.a in (select +count(*) from t1 union select abs((case max(d) when count(distinct d) then min( -t1.e) else count(distinct a) end-count(distinct -t1.f)))*count(*) from t1) or not exists(select 1 from t1 where t1.d not in (c,17,e)))} -} {144} -do_test randexpr-2.391 { - db eval {SELECT case when exists(select 1 from t1 where coalesce((select b from t1 where case when (b -11 then -t1.c else -b end then d else t1.a end) not in (t1.b,d,t1.b)} -} {300} -do_test randexpr-2.392 { - db eval {SELECT case when exists(select 1 from t1 where coalesce((select b from t1 where case when (b -11 then -t1.c else -b end then d else t1.a end) not in (t1.b,d,t1.b))} -} {} -do_test randexpr-2.393 { - db eval {SELECT t1.f+coalesce((select t1.a-t1.d*f-coalesce((select max(coalesce((select max(t1.c) from t1 where exists(select 1 from t1 where a=~t1.d+case when (c in (select abs(~( -cast(avg(e) AS integer))) from t1 union select -min(19) from t1)) and 19<>t1.e or t1.e<11 and c in (t1.b,t1.b,t1.d) or 17 between -t1.d and t1.d then 11 else d end)),c-f)) from t1 where t1.a<=t1.c),11)-t1.c from t1 where f between t1.a and d),19) FROM t1 WHERE exists(select 1 from t1 where case +t1.d when d then f else t1.e end in (t1.e,17,11) or 13*e-t1.b in (select t1.e from t1 union select 17 from t1)) and 11<=case -case when not exists(select 1 from t1 where (17 | t1.e in (11,11,11) and b<(19))) then case t1.c+t1.f+c when t1.b then c else 19 end else 17 end when d then t1.b else t1.a end} -} {} -do_test randexpr-2.394 { - db eval {SELECT t1.f+coalesce((select t1.a-t1.d*f-coalesce((select max(coalesce((select max(t1.c) from t1 where exists(select 1 from t1 where a=~t1.d+case when (c in (select abs(~( -cast(avg(e) AS integer))) from t1 union select -min(19) from t1)) and 19<>t1.e or t1.e<11 and c in (t1.b,t1.b,t1.d) or 17 between -t1.d and t1.d then 11 else d end)),c-f)) from t1 where t1.a<=t1.c),11)-t1.c from t1 where f between t1.a and d),19) FROM t1 WHERE NOT (exists(select 1 from t1 where case +t1.d when d then f else t1.e end in (t1.e,17,11) or 13*e-t1.b in (select t1.e from t1 union select 17 from t1)) and 11<=case -case when not exists(select 1 from t1 where (17 | t1.e in (11,11,11) and b<(19))) then case t1.c+t1.f+c when t1.b then c else 19 end else 17 end when d then t1.b else t1.a end)} -} {619} -do_test randexpr-2.395 { - db eval {SELECT case when (coalesce((select coalesce((select max( -11) from t1 where not case t1.c*case when exists(select 1 from t1 where (t1.d) in (select case count(*) when count(distinct t1.c) then count(*) else count(*) end from t1 union select cast(avg(t1.c) AS integer) from t1)) then +e when f=19 then 17 else t1.e end when t1.a then 19 else c end=e),t1.a)- -d*f-a from t1 where (t1.e)<>13),19)*(a)=19) then (c) when (exists(select 1 from t1 where 17=t1.d)) then 19 else c end FROM t1 WHERE t1.d*c*(select cast(avg(((abs(t1.d*13)/abs(f)))) AS integer) from t1)+t1.d=case when +(coalesce((select t1.a from t1 where case when not exists(select 1 from t1 where not exists(select 1 from t1 where c=t1.e)) then 19 | -17 else 13 end not in (t1.f,b,t1.b)),t1.f))*t1.a-t1.c-13 in (e,11,t1.c) then t1.a when (d between -t1.f and f) then t1.d else t1.a end} -} {} -do_test randexpr-2.396 { - db eval {SELECT case when (coalesce((select coalesce((select max( -11) from t1 where not case t1.c*case when exists(select 1 from t1 where (t1.d) in (select case count(*) when count(distinct t1.c) then count(*) else count(*) end from t1 union select cast(avg(t1.c) AS integer) from t1)) then +e when f=19 then 17 else t1.e end when t1.a then 19 else c end=e),t1.a)- -d*f-a from t1 where (t1.e)<>13),19)*(a)=19) then (c) when (exists(select 1 from t1 where 17=t1.d)) then 19 else c end FROM t1 WHERE NOT (t1.d*c*(select cast(avg(((abs(t1.d*13)/abs(f)))) AS integer) from t1)+t1.d=case when +(coalesce((select t1.a from t1 where case when not exists(select 1 from t1 where not exists(select 1 from t1 where c=t1.e)) then 19 | -17 else 13 end not in (t1.f,b,t1.b)),t1.f))*t1.a-t1.c-13 in (e,11,t1.c) then t1.a when (d between -t1.f and f) then t1.d else t1.a end)} -} {300} -do_test randexpr-2.397 { - db eval {SELECT coalesce((select d from t1 where f in (select max(19) from t1 union select ~+max(t1.e) from t1)),b-case -11 when 13 then t1.a-e else case when not exists(select 1 from t1 where c not in ( -t1.c,(t1.e),19)) and d+t1.b-t1.b in (select t1.a from t1 union select t1.d from t1) then 19+19*(t1.f) when t1.b<=a then 17 else t1.a end end+t1.b)*t1.a FROM t1 WHERE (select +cast(avg(~13+(select count(*) from t1)) AS integer)++min(case when (not d<>a) then coalesce((select t1.b from t1 where t1.f not between e and t1.d),13)+13 when t1.d not between 11 and t1.d then 17 else f end) | count(*) | ~count(distinct t1.e) | cast(avg(e) AS integer)-max(t1.d) from t1) not between coalesce((select case t1.a when a then e else 17 end from t1 where t1.a in (t1.e,11,( -t1.d))), -(b)) and t1.a} -} {} -do_test randexpr-2.398 { - db eval {SELECT coalesce((select d from t1 where f in (select max(19) from t1 union select ~+max(t1.e) from t1)),b-case -11 when 13 then t1.a-e else case when not exists(select 1 from t1 where c not in ( -t1.c,(t1.e),19)) and d+t1.b-t1.b in (select t1.a from t1 union select t1.d from t1) then 19+19*(t1.f) when t1.b<=a then 17 else t1.a end end+t1.b)*t1.a FROM t1 WHERE NOT ((select +cast(avg(~13+(select count(*) from t1)) AS integer)++min(case when (not d<>a) then coalesce((select t1.b from t1 where t1.f not between e and t1.d),13)+13 when t1.d not between 11 and t1.d then 17 else f end) | count(*) | ~count(distinct t1.e) | cast(avg(e) AS integer)-max(t1.d) from t1) not between coalesce((select case t1.a when a then e else 17 end from t1 where t1.a in (t1.e,11,( -t1.d))), -(b)) and t1.a)} -} {30000} -do_test randexpr-2.399 { - db eval {SELECT (abs(c)/abs((coalesce((select t1.d from t1 where ((19) in (select count(distinct - -(abs(coalesce((select max(t1.e) from t1 where t1.c*t1.a | t1.d=t1.d or t1.f in (select min(t1.f)-cast(avg(e) AS integer) from t1 union select -count(*) from t1)),c))/abs(a))) from t1 union select case cast(avg(c) AS integer)-abs( -((count(*))))*(count(*))*min(d) when cast(avg(a) AS integer) then count(distinct 11) else count(*) end-(count(distinct 17)) from t1))),a))))*t1.e FROM t1 WHERE case when a between -t1.a+(t1.c) and c-case when (~+t1.b-~case when t1.a not between 19*11 and 11 then t1.a when 11=f and -t1.d not between t1.a and d then e else b end in (select min(19) from t1 union select case count(distinct 17) when count(*) then count(distinct t1.f) else min(c) end from t1)) then t1.f else 17 end then 17 else 13 end in (t1.a,t1.d,a)} -} {} -do_test randexpr-2.400 { - db eval {SELECT (abs(c)/abs((coalesce((select t1.d from t1 where ((19) in (select count(distinct - -(abs(coalesce((select max(t1.e) from t1 where t1.c*t1.a | t1.d=t1.d or t1.f in (select min(t1.f)-cast(avg(e) AS integer) from t1 union select -count(*) from t1)),c))/abs(a))) from t1 union select case cast(avg(c) AS integer)-abs( -((count(*))))*(count(*))*min(d) when cast(avg(a) AS integer) then count(distinct 11) else count(*) end-(count(distinct 17)) from t1))),a))))*t1.e FROM t1 WHERE NOT (case when a between -t1.a+(t1.c) and c-case when (~+t1.b-~case when t1.a not between 19*11 and 11 then t1.a when 11=f and -t1.d not between t1.a and d then e else b end in (select min(19) from t1 union select case count(distinct 17) when count(*) then count(distinct t1.f) else min(c) end from t1)) then t1.f else 17 end then 17 else 13 end in (t1.a,t1.d,a))} -} {1500} -do_test randexpr-2.401 { - db eval {SELECT (abs(c)/abs((coalesce((select t1.d from t1 where ((19) in (select count(distinct - -(abs(coalesce((select max(t1.e) from t1 where t1.c*t1.a & t1.d=t1.d or t1.f in (select min(t1.f)-cast(avg(e) AS integer) from t1 union select -count(*) from t1)),c))/abs(a))) from t1 union select case cast(avg(c) AS integer)-abs( -((count(*))))*(count(*))*min(d) when cast(avg(a) AS integer) then count(distinct 11) else count(*) end-(count(distinct 17)) from t1))),a))))*t1.e FROM t1 WHERE NOT (case when a between -t1.a+(t1.c) and c-case when (~+t1.b-~case when t1.a not between 19*11 and 11 then t1.a when 11=f and -t1.d not between t1.a and d then e else b end in (select min(19) from t1 union select case count(distinct 17) when count(*) then count(distinct t1.f) else min(c) end from t1)) then t1.f else 17 end then 17 else 13 end in (t1.a,t1.d,a))} -} {1500} -do_test randexpr-2.402 { - db eval {SELECT case when d=c-(select (~max(t1.f*t1.c-11)) from t1) then coalesce((select max(19) from t1 where 13d then t1.e when not not exists(select 1 from t1 where t1.c not in (a,a,t1.d) and d not between b and 19) then t1.a else 11 end*f-f from t1 where t1.f between e and e and d between 19 and t1.e or 11<>t1.a),t1.c)),d) else 17 end FROM t1 WHERE (t1.e=11)} -} {} -do_test randexpr-2.403 { - db eval {SELECT case when d=c-(select (~max(t1.f*t1.c-11)) from t1) then coalesce((select max(19) from t1 where 13d then t1.e when not not exists(select 1 from t1 where t1.c not in (a,a,t1.d) and d not between b and 19) then t1.a else 11 end*f-f from t1 where t1.f between e and e and d between 19 and t1.e or 11<>t1.a),t1.c)),d) else 17 end FROM t1 WHERE NOT ((t1.e=11))} -} {17} -do_test randexpr-2.404 { - db eval {SELECT case when t1.a-t1.a | case when (abs(t1.d)/abs(t1.c | t1.a))<>t1.e then e*+t1.c-t1.d*coalesce((select t1.b from t1 where b>=+d+ -e*11),11)+t1.b | t1.f when not exists(select 1 from t1 where d not in (17,e,d)) then 11 else t1.d end>=13 then 11 when d=c then a else f end FROM t1 WHERE (abs(case when not t1.d<=t1.f and not t1.d not between -f and -17-11*t1.d and (13d then t1.d*coalesce((select max(t1.a) from t1 where (17) not between (t1.b) and 11),d) else t1.d end)/abs(f)) not between 13 and 19} -} {11} -do_test randexpr-2.405 { - db eval {SELECT case when t1.a-t1.a | case when (abs(t1.d)/abs(t1.c | t1.a))<>t1.e then e*+t1.c-t1.d*coalesce((select t1.b from t1 where b>=+d+ -e*11),11)+t1.b | t1.f when not exists(select 1 from t1 where d not in (17,e,d)) then 11 else t1.d end>=13 then 11 when d=c then a else f end FROM t1 WHERE NOT ((abs(case when not t1.d<=t1.f and not t1.d not between -f and -17-11*t1.d and (13d then t1.d*coalesce((select max(t1.a) from t1 where (17) not between (t1.b) and 11),d) else t1.d end)/abs(f)) not between 13 and 19)} -} {} -do_test randexpr-2.406 { - db eval {SELECT case when t1.a-t1.a & case when (abs(t1.d)/abs(t1.c & t1.a))<>t1.e then e*+t1.c-t1.d*coalesce((select t1.b from t1 where b>=+d+ -e*11),11)+t1.b & t1.f when not exists(select 1 from t1 where d not in (17,e,d)) then 11 else t1.d end>=13 then 11 when d=c then a else f end FROM t1 WHERE (abs(case when not t1.d<=t1.f and not t1.d not between -f and -17-11*t1.d and (13d then t1.d*coalesce((select max(t1.a) from t1 where (17) not between (t1.b) and 11),d) else t1.d end)/abs(f)) not between 13 and 19} -} {600} -do_test randexpr-2.407 { - db eval {SELECT coalesce((select t1.f*13 from t1 where exists(select 1 from t1 where 13<=t1.e)),(abs(+ -17)/abs(c))) FROM t1 WHERE coalesce((select 17 from t1 where 11>++a-~t1.a+d | (19)),(abs(t1.c)/abs(case when case t1.c*17-case when b not between t1.b and f then t1.a when f>=a then 19 else 13 end when 19 then 13 else t1.f end not between c and a then c else 13 end)))> -e or 13 between f and c and t1.e>=b} -} {7800} -do_test randexpr-2.408 { - db eval {SELECT coalesce((select t1.f*13 from t1 where exists(select 1 from t1 where 13<=t1.e)),(abs(+ -17)/abs(c))) FROM t1 WHERE NOT (coalesce((select 17 from t1 where 11>++a-~t1.a+d | (19)),(abs(t1.c)/abs(case when case t1.c*17-case when b not between t1.b and f then t1.a when f>=a then 19 else 13 end when 19 then 13 else t1.f end not between c and a then c else 13 end)))> -e or 13 between f and c and t1.e>=b)} -} {} -do_test randexpr-2.409 { - db eval {SELECT ~+coalesce((select (select count(distinct +coalesce((select c from t1 where e>=13),+c)-t1.c) from t1) from t1 where case a when t1.d*(select cast(avg(case when t1.b*coalesce((select 17 from t1 where case -a when t1.b then d else (t1.f) end not in ((t1.e),a,t1.f)),t1.c)-c in (d,a,t1.c) then c else b end) AS integer) from t1)+t1.d then 13 else t1.e end not in (19,a,17)),13) FROM t1 WHERE +c in (a,17,t1.d)} -} {} -do_test randexpr-2.410 { - db eval {SELECT ~+coalesce((select (select count(distinct +coalesce((select c from t1 where e>=13),+c)-t1.c) from t1) from t1 where case a when t1.d*(select cast(avg(case when t1.b*coalesce((select 17 from t1 where case -a when t1.b then d else (t1.f) end not in ((t1.e),a,t1.f)),t1.c)-c in (d,a,t1.c) then c else b end) AS integer) from t1)+t1.d then 13 else t1.e end not in (19,a,17)),13) FROM t1 WHERE NOT (+c in (a,17,t1.d))} -} {-2} -do_test randexpr-2.411 { - db eval {SELECT f-coalesce((select t1.d from t1 where t1.a>11+t1.d),coalesce((select coalesce((select t1.d from t1 where 17>=d or (case c when t1.c then (t1.c) else t1.e end in (b,17,17) or t1.b>=t1.a) or t1.b<=e),case d when (19) then t1.d else t1.a end)-t1.d from t1 where 13 in (select ( -count(distinct (e)) | cast(avg(t1.d) AS integer)*count(*))+max( -11) | max( -c) from t1 union select count(distinct 11) from t1)),a)) FROM t1 WHERE not b<=13 or (coalesce((select max(t1.b) from t1 where b in (case when not a<>13 then 17 when -(select ~abs( -(max(f))+count(distinct t1.a)) from t1)+13>=t1.b then case c when t1.a then d else f end-c else t1.d end-19, -t1.d,f)),19)) not in (t1.a,c,t1.d) or t1.e>t1.f} -} {500} -do_test randexpr-2.412 { - db eval {SELECT f-coalesce((select t1.d from t1 where t1.a>11+t1.d),coalesce((select coalesce((select t1.d from t1 where 17>=d or (case c when t1.c then (t1.c) else t1.e end in (b,17,17) or t1.b>=t1.a) or t1.b<=e),case d when (19) then t1.d else t1.a end)-t1.d from t1 where 13 in (select ( -count(distinct (e)) | cast(avg(t1.d) AS integer)*count(*))+max( -11) | max( -c) from t1 union select count(distinct 11) from t1)),a)) FROM t1 WHERE NOT (not b<=13 or (coalesce((select max(t1.b) from t1 where b in (case when not a<>13 then 17 when -(select ~abs( -(max(f))+count(distinct t1.a)) from t1)+13>=t1.b then case c when t1.a then d else f end-c else t1.d end-19, -t1.d,f)),19)) not in (t1.a,c,t1.d) or t1.e>t1.f)} -} {} -do_test randexpr-2.413 { - db eval {SELECT f-coalesce((select t1.d from t1 where t1.a>11+t1.d),coalesce((select coalesce((select t1.d from t1 where 17>=d or (case c when t1.c then (t1.c) else t1.e end in (b,17,17) or t1.b>=t1.a) or t1.b<=e),case d when (19) then t1.d else t1.a end)-t1.d from t1 where 13 in (select ( -count(distinct (e)) & cast(avg(t1.d) AS integer)*count(*))+max( -11) & max( -c) from t1 union select count(distinct 11) from t1)),a)) FROM t1 WHERE not b<=13 or (coalesce((select max(t1.b) from t1 where b in (case when not a<>13 then 17 when -(select ~abs( -(max(f))+count(distinct t1.a)) from t1)+13>=t1.b then case c when t1.a then d else f end-c else t1.d end-19, -t1.d,f)),19)) not in (t1.a,c,t1.d) or t1.e>t1.f} -} {500} -do_test randexpr-2.414 { - db eval {SELECT coalesce((select e from t1 where (coalesce((select max(+e+e*11*t1.c-e) from t1 where exists(select 1 from t1 where (19<=~t1.f))),case (abs(t1.c)/abs(case t1.c when 19 then f*~case when t1.e+t1.d between -t1.f and (d) then b when (d=a) then t1.e else e end else c end*t1.a)) | f when (d) then 17 else t1.f end)coalesce((select coalesce((select e from t1 where case when -d+t1.e>e then coalesce((select d+b from t1 where exists(select 1 from t1 where not 13-b not in (f,a,d)) and (t1.b between (a) and t1.c)),c) when a=13 then t1.e else a end in (select t1.d from t1 union select t1.d from t1) and e not in (d, -19,11)),d) from t1 where not f in (t1.a,19,t1.d)),t1.d)} -} {} -do_test randexpr-2.415 { - db eval {SELECT coalesce((select e from t1 where (coalesce((select max(+e+e*11*t1.c-e) from t1 where exists(select 1 from t1 where (19<=~t1.f))),case (abs(t1.c)/abs(case t1.c when 19 then f*~case when t1.e+t1.d between -t1.f and (d) then b when (d=a) then t1.e else e end else c end*t1.a)) | f when (d) then 17 else t1.f end)coalesce((select coalesce((select e from t1 where case when -d+t1.e>e then coalesce((select d+b from t1 where exists(select 1 from t1 where not 13-b not in (f,a,d)) and (t1.b between (a) and t1.c)),c) when a=13 then t1.e else a end in (select t1.d from t1 union select t1.d from t1) and e not in (d, -19,11)),d) from t1 where not f in (t1.a,19,t1.d)),t1.d))} -} {13} -do_test randexpr-2.416 { - db eval {SELECT coalesce((select e from t1 where (coalesce((select max(+e+e*11*t1.c-e) from t1 where exists(select 1 from t1 where (19<=~t1.f))),case (abs(t1.c)/abs(case t1.c when 19 then f*~case when t1.e+t1.d between -t1.f and (d) then b when (d=a) then t1.e else e end else c end*t1.a)) & f when (d) then 17 else t1.f end)coalesce((select coalesce((select e from t1 where case when -d+t1.e>e then coalesce((select d+b from t1 where exists(select 1 from t1 where not 13-b not in (f,a,d)) and (t1.b between (a) and t1.c)),c) when a=13 then t1.e else a end in (select t1.d from t1 union select t1.d from t1) and e not in (d, -19,11)),d) from t1 where not f in (t1.a,19,t1.d)),t1.d))} -} {13} -do_test randexpr-2.417 { - db eval {SELECT (select count(distinct 11-17-11) from t1)-coalesce((select (abs(13)/abs(t1.b-c*11+coalesce((select max(f) from t1 where t1.a>t1.a),(e))*case when (abs(e)/abs(t1.b)) not between ~f and t1.e then c else (abs(t1.b)/abs(t1.d)) end | 13+b | b+t1.e)) from t1 where t1.c in (select t1.c from t1 union select (a) from t1)),19) FROM t1 WHERE t1.f>=19} -} {1} -do_test randexpr-2.418 { - db eval {SELECT (select count(distinct 11-17-11) from t1)-coalesce((select (abs(13)/abs(t1.b-c*11+coalesce((select max(f) from t1 where t1.a>t1.a),(e))*case when (abs(e)/abs(t1.b)) not between ~f and t1.e then c else (abs(t1.b)/abs(t1.d)) end | 13+b | b+t1.e)) from t1 where t1.c in (select t1.c from t1 union select (a) from t1)),19) FROM t1 WHERE NOT (t1.f>=19)} -} {} -do_test randexpr-2.419 { - db eval {SELECT (select count(distinct 11-17-11) from t1)-coalesce((select (abs(13)/abs(t1.b-c*11+coalesce((select max(f) from t1 where t1.a>t1.a),(e))*case when (abs(e)/abs(t1.b)) not between ~f and t1.e then c else (abs(t1.b)/abs(t1.d)) end & 13+b & b+t1.e)) from t1 where t1.c in (select t1.c from t1 union select (a) from t1)),19) FROM t1 WHERE t1.f>=19} -} {1} -do_test randexpr-2.420 { - db eval {SELECT coalesce((select max(case when 11+(select +abs(count(*)) from t1) not in (case when (case when not exists(select 1 from t1 where t1.d=f) then a else a end+11 in (select ((13)) from t1 union select t1.d from t1)) then (abs(t1.c)/abs(t1.b)) when a>=t1.c then b else f end,t1.a,c) then t1.a when b in (select cast(avg(t1.a) AS integer) | ~ -count(distinct 17) from t1 union select min(c) from t1) then b else -t1.e end) from t1 where d not between c and -t1.b and b=d and b between 13 and t1.c),(17)) FROM t1 WHERE t1.a in (coalesce((select max(e) from t1 where case case (select count(*) from t1)-~19 when t1.f*t1.d+coalesce((select max((select + -(((min(t1.b)))) | -(count(distinct t1.c)) | count(*) from t1)*11) from t1 where f>=case when d in ((d),t1.d,13) then 19 when 17=17 then 11 else a end),t1.e) then c else t1.f end when t1.e then f else t1.d end in (13,(13),c)),t1.d),t1.e,a)} -} {17} -do_test randexpr-2.421 { - db eval {SELECT coalesce((select max(case when 11+(select +abs(count(*)) from t1) not in (case when (case when not exists(select 1 from t1 where t1.d=f) then a else a end+11 in (select ((13)) from t1 union select t1.d from t1)) then (abs(t1.c)/abs(t1.b)) when a>=t1.c then b else f end,t1.a,c) then t1.a when b in (select cast(avg(t1.a) AS integer) | ~ -count(distinct 17) from t1 union select min(c) from t1) then b else -t1.e end) from t1 where d not between c and -t1.b and b=d and b between 13 and t1.c),(17)) FROM t1 WHERE NOT (t1.a in (coalesce((select max(e) from t1 where case case (select count(*) from t1)-~19 when t1.f*t1.d+coalesce((select max((select + -(((min(t1.b)))) | -(count(distinct t1.c)) | count(*) from t1)*11) from t1 where f>=case when d in ((d),t1.d,13) then 19 when 17=17 then 11 else a end),t1.e) then c else t1.f end when t1.e then f else t1.d end in (13,(13),c)),t1.d),t1.e,a))} -} {} -do_test randexpr-2.422 { - db eval {SELECT coalesce((select max(case when 11+(select +abs(count(*)) from t1) not in (case when (case when not exists(select 1 from t1 where t1.d=f) then a else a end+11 in (select ((13)) from t1 union select t1.d from t1)) then (abs(t1.c)/abs(t1.b)) when a>=t1.c then b else f end,t1.a,c) then t1.a when b in (select cast(avg(t1.a) AS integer) & ~ -count(distinct 17) from t1 union select min(c) from t1) then b else -t1.e end) from t1 where d not between c and -t1.b and b=d and b between 13 and t1.c),(17)) FROM t1 WHERE t1.a in (coalesce((select max(e) from t1 where case case (select count(*) from t1)-~19 when t1.f*t1.d+coalesce((select max((select + -(((min(t1.b)))) | -(count(distinct t1.c)) | count(*) from t1)*11) from t1 where f>=case when d in ((d),t1.d,13) then 19 when 17=17 then 11 else a end),t1.e) then c else t1.f end when t1.e then f else t1.d end in (13,(13),c)),t1.d),t1.e,a)} -} {17} -do_test randexpr-2.423 { - db eval {SELECT coalesce((select t1.a-case t1.a when c then coalesce((select case (abs(11-(abs(t1.b)/abs(t1.a)))/abs((abs(t1.c)/abs(t1.a))))-t1.f when t1.d then f else 19 end from t1 where +t1.b*a in (select t1.e from t1 union select c from t1) and e between d and 11),t1.b) else a end from t1 where exists(select 1 from t1 where ((a in (13,c,d)))) and -t1.e in ((t1.d),t1.a,t1.b)),t1.c) FROM t1 WHERE ++e*19 in (case when case when not (d<>case when -case when (t1.a not between b and -e) then 17 when f<>a then -t1.d else t1.a end not in (a,a,c) then b when b<=c then e else b end) then 19 when (t1.b not in ( -13,t1.a,a)) then t1.b | 13 else e end* -19*t1.acase when -case when (t1.a not between b and -e) then 17 when f<>a then -t1.d else t1.a end not in (a,a,c) then b when b<=c then e else b end) then 19 when (t1.b not in ( -13,t1.a,a)) then t1.b | 13 else e end* -19*t1.a~19)),f) when a- -t1.a | t1.f then t1.a*11-t1.e else coalesce((select max(t1.b) from t1 where not exists(select 1 from t1 where 17=t1.a or b>=f)),c) | t1.b end>19),t1.a))+c)-t1.c*e)/abs(t1.d)) FROM t1 WHERE a-t1.b not in (a,a-19-c | t1.d-d | e*t1.c*b,t1.e+t1.a)} -} {375} -do_test randexpr-2.426 { - db eval {SELECT (abs(e-((coalesce((select max(t1.c) from t1 where t1.f-a-case coalesce((select max(d) from t1 where (13<>~19)),f) when a- -t1.a | t1.f then t1.a*11-t1.e else coalesce((select max(t1.b) from t1 where not exists(select 1 from t1 where 17=t1.a or b>=f)),c) | t1.b end>19),t1.a))+c)-t1.c*e)/abs(t1.d)) FROM t1 WHERE NOT (a-t1.b not in (a,a-19-c | t1.d-d | e*t1.c*b,t1.e+t1.a))} -} {} -do_test randexpr-2.427 { - db eval {SELECT (abs(e-((coalesce((select max(t1.c) from t1 where t1.f-a-case coalesce((select max(d) from t1 where (13<>~19)),f) when a- -t1.a & t1.f then t1.a*11-t1.e else coalesce((select max(t1.b) from t1 where not exists(select 1 from t1 where 17=t1.a or b>=f)),c) & t1.b end>19),t1.a))+c)-t1.c*e)/abs(t1.d)) FROM t1 WHERE a-t1.b not in (a,a-19-c | t1.d-d | e*t1.c*b,t1.e+t1.a)} -} {375} -do_test randexpr-2.428 { - db eval {SELECT t1.b-coalesce((select t1.a from t1 where (d<=f)),~~case b when coalesce((select coalesce((select t1.c from t1 where a+~+~(abs(t1.d)/abs(17)) | -d*a*(b++ -13)*b>=b),17) | a from t1 where a=coalesce((select t1.d+(select case min(a) | max(t1.b) when max(e) then count(*) else -count(distinct f) end from t1)-t1.f+( - - -19) from t1 where t1.c in (select 19 from t1 union select 17 from t1)),11))),19)+11 not in ((b),e,e) or t1.e in (select min(t1.f) from t1 union select count(*)- -(cast(avg(17) AS integer)) from t1) or e>=t1.c} -} {100} -do_test randexpr-2.429 { - db eval {SELECT t1.b-coalesce((select t1.a from t1 where (d<=f)),~~case b when coalesce((select coalesce((select t1.c from t1 where a+~+~(abs(t1.d)/abs(17)) | -d*a*(b++ -13)*b>=b),17) | a from t1 where a=coalesce((select t1.d+(select case min(a) | max(t1.b) when max(e) then count(*) else -count(distinct f) end from t1)-t1.f+( - - -19) from t1 where t1.c in (select 19 from t1 union select 17 from t1)),11))),19)+11 not in ((b),e,e) or t1.e in (select min(t1.f) from t1 union select count(*)- -(cast(avg(17) AS integer)) from t1) or e>=t1.c)} -} {} -do_test randexpr-2.430 { - db eval {SELECT t1.b-coalesce((select t1.a from t1 where (d<=f)),~~case b when coalesce((select coalesce((select t1.c from t1 where a+~+~(abs(t1.d)/abs(17)) & -d*a*(b++ -13)*b>=b),17) & a from t1 where a=coalesce((select t1.d+(select case min(a) | max(t1.b) when max(e) then count(*) else -count(distinct f) end from t1)-t1.f+( - - -19) from t1 where t1.c in (select 19 from t1 union select 17 from t1)),11))),19)+11 not in ((b),e,e) or t1.e in (select min(t1.f) from t1 union select count(*)- -(cast(avg(17) AS integer)) from t1) or e>=t1.c} -} {100} -do_test randexpr-2.431 { - db eval {SELECT coalesce((select max(case when e<=t1.d then f*+case 17 when 17 then (abs((select abs(cast(avg(13) AS integer)+min(t1.b)) from t1))/abs(t1.c)) else d end*t1.c else a end) from t1 where coalesce((select t1.c from t1 where a<>t1.e+f-t1.c-a),+t1.a)+t1.d*case when d in (select t1.c from t1 union select 11 from t1) then a when 19 not in (d,e,b) then 11 else 19 end | t1.b in (select 19 from t1 union select t1.a from t1)),17)*11 FROM t1 WHERE 17>=t1.b} -} {} -do_test randexpr-2.432 { - db eval {SELECT coalesce((select max(case when e<=t1.d then f*+case 17 when 17 then (abs((select abs(cast(avg(13) AS integer)+min(t1.b)) from t1))/abs(t1.c)) else d end*t1.c else a end) from t1 where coalesce((select t1.c from t1 where a<>t1.e+f-t1.c-a),+t1.a)+t1.d*case when d in (select t1.c from t1 union select 11 from t1) then a when 19 not in (d,e,b) then 11 else 19 end | t1.b in (select 19 from t1 union select t1.a from t1)),17)*11 FROM t1 WHERE NOT (17>=t1.b)} -} {187} -do_test randexpr-2.433 { - db eval {SELECT coalesce((select max(case when e<=t1.d then f*+case 17 when 17 then (abs((select abs(cast(avg(13) AS integer)+min(t1.b)) from t1))/abs(t1.c)) else d end*t1.c else a end) from t1 where coalesce((select t1.c from t1 where a<>t1.e+f-t1.c-a),+t1.a)+t1.d*case when d in (select t1.c from t1 union select 11 from t1) then a when 19 not in (d,e,b) then 11 else 19 end & t1.b in (select 19 from t1 union select t1.a from t1)),17)*11 FROM t1 WHERE NOT (17>=t1.b)} -} {187} -do_test randexpr-2.434 { - db eval {SELECT case when coalesce((select max(case f when (abs(t1.d)/abs(case when +~e not in (t1.d,c,t1.a) or 17 in (select count(distinct -b) from t1 union select count(distinct d) from t1) and d<=t1.b or b>(f) then coalesce((select c from t1 where t1.ff or t1.b<> -t1.c), -t1.d)<11 then c else f end FROM t1 WHERE not exists(select 1 from t1 where exists(select 1 from t1 where case -case when case t1.c-t1.b-e when t1.b then t1.e else -t1.c+~17 | coalesce((select max(t1.c) from t1 where 19 not between -(a)-t1.c and 17),t1.c) end in (select (t1.f) from t1 union select b from t1) then e when c<>19 then t1.b else f end when -11 then 11 else 19 end in ( -19,t1.a,d)) and not 17(f) then coalesce((select c from t1 where t1.ff or t1.b<> -t1.c), -t1.d)<11 then c else f end FROM t1 WHERE NOT (not exists(select 1 from t1 where exists(select 1 from t1 where case -case when case t1.c-t1.b-e when t1.b then t1.e else -t1.c+~17 | coalesce((select max(t1.c) from t1 where 19 not between -(a)-t1.c and 17),t1.c) end in (select (t1.f) from t1 union select b from t1) then e when c<>19 then t1.b else f end when -11 then 11 else 19 end in ( -19,t1.a,d)) and not 17a) then t1.f else t1.c end FROM t1 WHERE case when (((case coalesce((select -t1.b-t1.b*19*c | 19 from t1 where (exists(select 1 from t1 where e>=t1.a))),t1.a)+11 when d then t1.e else t1.c end=t1.d))) then t1.b when not not exists(select 1 from t1 where t1.f<(t1.a)) and t1.d>=f or t1.c>t1.a or t1.b between t1.f and 19 then t1.c else ~t1.c end=11 or (t1.e) not between 13 and t1.c} -} {600} -do_test randexpr-2.440 { - db eval {SELECT case when (ba) then t1.f else t1.c end FROM t1 WHERE NOT (case when (((case coalesce((select -t1.b-t1.b*19*c | 19 from t1 where (exists(select 1 from t1 where e>=t1.a))),t1.a)+11 when d then t1.e else t1.c end=t1.d))) then t1.b when not not exists(select 1 from t1 where t1.f<(t1.a)) and t1.d>=f or t1.c>t1.a or t1.b between t1.f and 19 then t1.c else ~t1.c end=11 or (t1.e) not between 13 and t1.c)} -} {} -do_test randexpr-2.441 { - db eval {SELECT case when (ba) then t1.f else t1.c end FROM t1 WHERE case when (((case coalesce((select -t1.b-t1.b*19*c | 19 from t1 where (exists(select 1 from t1 where e>=t1.a))),t1.a)+11 when d then t1.e else t1.c end=t1.d))) then t1.b when not not exists(select 1 from t1 where t1.f<(t1.a)) and t1.d>=f or t1.c>t1.a or t1.b between t1.f and 19 then t1.c else ~t1.c end=11 or (t1.e) not between 13 and t1.c} -} {300} -do_test randexpr-2.442 { - db eval {SELECT case when not t1.d not in (coalesce((select 17 | -coalesce((select (select min(a-t1.a+t1.a-t1.c*t1.e) from t1) from t1 where t1.d<=a),11) | 19 from t1 where not ( -13 in ( -t1.d,t1.d,19))),e)+11,11,13) then e when ((t1.bt1.f and a>=17))} -} {} -do_test randexpr-2.443 { - db eval {SELECT case when not t1.d not in (coalesce((select 17 | -coalesce((select (select min(a-t1.a+t1.a-t1.c*t1.e) from t1) from t1 where t1.d<=a),11) | 19 from t1 where not ( -13 in ( -t1.d,t1.d,19))),e)+11,11,13) then e when ((t1.bt1.f and a>=17)))} -} {100} -do_test randexpr-2.444 { - db eval {SELECT case when not t1.d not in (coalesce((select 17 & -coalesce((select (select min(a-t1.a+t1.a-t1.c*t1.e) from t1) from t1 where t1.d<=a),11) & 19 from t1 where not ( -13 in ( -t1.d,t1.d,19))),e)+11,11,13) then e when ((t1.bt1.f and a>=17)))} -} {100} -do_test randexpr-2.445 { - db eval {SELECT e+c-(c)+t1.e*(abs(case when 13 in (select abs(max(17)*case -count(*) when cast(avg(a) AS integer) then count(distinct b) else -max(f) end | (cast(avg(t1.e) AS integer)) | -min(f)) from t1 union select count(distinct d) from t1) and case when (t1.e+a> -(a)) then e when not c=e)),coalesce((select max(case t1.e when t1.c then t1.a else a end) from t1 where b>=t1.c and b<>t1.c),13)) then t1.b else a end<11 then b when (11 in (select a from t1 union select t1.b from t1)) or t1.b=e or a between a and 13 then t1.b else b end>19} -} {1500} -do_test randexpr-2.446 { - db eval {SELECT e+c-(c)+t1.e*(abs(case when 13 in (select abs(max(17)*case -count(*) when cast(avg(a) AS integer) then count(distinct b) else -max(f) end | (cast(avg(t1.e) AS integer)) | -min(f)) from t1 union select count(distinct d) from t1) and case when (t1.e+a> -(a)) then e when not c=e)),coalesce((select max(case t1.e when t1.c then t1.a else a end) from t1 where b>=t1.c and b<>t1.c),13)) then t1.b else a end<11 then b when (11 in (select a from t1 union select t1.b from t1)) or t1.b=e or a between a and 13 then t1.b else b end>19)} -} {} -do_test randexpr-2.447 { - db eval {SELECT e+c-(c)+t1.e*(abs(case when 13 in (select abs(max(17)*case -count(*) when cast(avg(a) AS integer) then count(distinct b) else -max(f) end & (cast(avg(t1.e) AS integer)) & -min(f)) from t1 union select count(distinct d) from t1) and case when (t1.e+a> -(a)) then e when not c=e)),coalesce((select max(case t1.e when t1.c then t1.a else a end) from t1 where b>=t1.c and b<>t1.c),13)) then t1.b else a end<11 then b when (11 in (select a from t1 union select t1.b from t1)) or t1.b=e or a between a and 13 then t1.b else b end>19} -} {1500} -do_test randexpr-2.448 { - db eval {SELECT 13-coalesce((select t1.a*a from t1 where not exists(select 1 from t1 where 17 not between case +coalesce((select -case 19 when a*b then 19 else f end from t1 where (t1.d-t1.e between case f when (select abs(case abs( -min(13)) when min(t1.b) then -(count(distinct f)) else min(t1.b) end) from t1) then 17*( -13) | f else t1.e end and -t1.a)),d)*c when 13 then 11 else t1.a end and c)),t1.a)*19 FROM t1 WHERE ((not f-c<=(abs(a)/abs(+t1.a)) or t1.e not between coalesce((select 11 from t1 where - -a*t1.d*case coalesce((select max(d) from t1 where ((t1.b<=t1.c))),case when f>t1.d or t1.d=t1.a or t1.c<=c then a else -c end*t1.b) when (f) then 11 else 19 end-t1.a<=b),c) and 13))} -} {-1887} -do_test randexpr-2.449 { - db eval {SELECT 13-coalesce((select t1.a*a from t1 where not exists(select 1 from t1 where 17 not between case +coalesce((select -case 19 when a*b then 19 else f end from t1 where (t1.d-t1.e between case f when (select abs(case abs( -min(13)) when min(t1.b) then -(count(distinct f)) else min(t1.b) end) from t1) then 17*( -13) | f else t1.e end and -t1.a)),d)*c when 13 then 11 else t1.a end and c)),t1.a)*19 FROM t1 WHERE NOT (((not f-c<=(abs(a)/abs(+t1.a)) or t1.e not between coalesce((select 11 from t1 where - -a*t1.d*case coalesce((select max(d) from t1 where ((t1.b<=t1.c))),case when f>t1.d or t1.d=t1.a or t1.c<=c then a else -c end*t1.b) when (f) then 11 else 19 end-t1.a<=b),c) and 13)))} -} {} -do_test randexpr-2.450 { - db eval {SELECT 13-coalesce((select t1.a*a from t1 where not exists(select 1 from t1 where 17 not between case +coalesce((select -case 19 when a*b then 19 else f end from t1 where (t1.d-t1.e between case f when (select abs(case abs( -min(13)) when min(t1.b) then -(count(distinct f)) else min(t1.b) end) from t1) then 17*( -13) & f else t1.e end and -t1.a)),d)*c when 13 then 11 else t1.a end and c)),t1.a)*19 FROM t1 WHERE ((not f-c<=(abs(a)/abs(+t1.a)) or t1.e not between coalesce((select 11 from t1 where - -a*t1.d*case coalesce((select max(d) from t1 where ((t1.b<=t1.c))),case when f>t1.d or t1.d=t1.a or t1.c<=c then a else -c end*t1.b) when (f) then 11 else 19 end-t1.a<=b),c) and 13))} -} {-1887} -do_test randexpr-2.451 { - db eval {SELECT ~case when (t1.d | 17 in (b*t1.e,19*case when t1.d<= -a then t1.d*~t1.c*e*t1.c-19 else ~t1.b+17 end-d,(t1.c))) then +t1.d else (abs( -case t1.e when t1.c then (t1.b) else t1.f end-11+ -a)/abs(f))+a end FROM t1 WHERE not exists(select 1 from t1 where not c in (select case count(distinct (f)-19) when ~( -+~cast(avg(c) AS integer) | count(distinct 11)-max(d)+min(t1.a)+ -( -count(distinct b))+(count(*)))-count(*)+cast(avg(c) AS integer) then count(distinct d) else ((max(t1.b))) end-min(b) from t1 union select min(t1.c) from t1)) and t1.c in (select +d from t1 union select case when c+b=17 then a else 13 end+11 from t1)} -} {} -do_test randexpr-2.452 { - db eval {SELECT ~case when (t1.d | 17 in (b*t1.e,19*case when t1.d<= -a then t1.d*~t1.c*e*t1.c-19 else ~t1.b+17 end-d,(t1.c))) then +t1.d else (abs( -case t1.e when t1.c then (t1.b) else t1.f end-11+ -a)/abs(f))+a end FROM t1 WHERE NOT (not exists(select 1 from t1 where not c in (select case count(distinct (f)-19) when ~( -+~cast(avg(c) AS integer) | count(distinct 11)-max(d)+min(t1.a)+ -( -count(distinct b))+(count(*)))-count(*)+cast(avg(c) AS integer) then count(distinct d) else ((max(t1.b))) end-min(b) from t1 union select min(t1.c) from t1)) and t1.c in (select +d from t1 union select case when c+b=17 then a else 13 end+11 from t1))} -} {-102} -do_test randexpr-2.453 { - db eval {SELECT ~case when (t1.d & 17 in (b*t1.e,19*case when t1.d<= -a then t1.d*~t1.c*e*t1.c-19 else ~t1.b+17 end-d,(t1.c))) then +t1.d else (abs( -case t1.e when t1.c then (t1.b) else t1.f end-11+ -a)/abs(f))+a end FROM t1 WHERE NOT (not exists(select 1 from t1 where not c in (select case count(distinct (f)-19) when ~( -+~cast(avg(c) AS integer) | count(distinct 11)-max(d)+min(t1.a)+ -( -count(distinct b))+(count(*)))-count(*)+cast(avg(c) AS integer) then count(distinct d) else ((max(t1.b))) end-min(b) from t1 union select min(t1.c) from t1)) and t1.c in (select +d from t1 union select case when c+b=17 then a else 13 end+11 from t1))} -} {-102} -do_test randexpr-2.454 { - db eval {SELECT (select case case min(d) when abs(cast(avg((abs(a)/abs(coalesce((select (select abs(cast(avg(t1.f) AS integer)) from t1) from t1 where (case when t1.e in (select 11 from t1 union select 17 from t1) then -t1.e- -t1.e else a end<>a) and not not exists(select 1 from t1 where t1.b in (select ~+max( -t1.b) | max(t1.c) from t1 union select count(distinct -t1.a) from t1))),t1.a)))) AS integer)) then (count(*) | ((count(distinct b)))-count(*)) else min(11) end when max(a) then count(distinct f) else (min(17)) end from t1) FROM t1 WHERE coalesce((select max(13) from t1 where t1.b not in ( -case when 13 not between 17 and b then f when t1.e+~+e between coalesce((select max(case 19 when e then 17 else coalesce((select coalesce((select max(f) from t1 where exists(select 1 from t1 where t1.b not between t1.a and a)),e)*b*t1.f from t1 where t1.f>=t1.c),c) end) from t1 where e>b),t1.f) | f and f then c else 11 end,(c),t1.e)),19)-t1.c in (select t1.a from t1 union select e from t1)} -} {} -do_test randexpr-2.455 { - db eval {SELECT (select case case min(d) when abs(cast(avg((abs(a)/abs(coalesce((select (select abs(cast(avg(t1.f) AS integer)) from t1) from t1 where (case when t1.e in (select 11 from t1 union select 17 from t1) then -t1.e- -t1.e else a end<>a) and not not exists(select 1 from t1 where t1.b in (select ~+max( -t1.b) | max(t1.c) from t1 union select count(distinct -t1.a) from t1))),t1.a)))) AS integer)) then (count(*) | ((count(distinct b)))-count(*)) else min(11) end when max(a) then count(distinct f) else (min(17)) end from t1) FROM t1 WHERE NOT (coalesce((select max(13) from t1 where t1.b not in ( -case when 13 not between 17 and b then f when t1.e+~+e between coalesce((select max(case 19 when e then 17 else coalesce((select coalesce((select max(f) from t1 where exists(select 1 from t1 where t1.b not between t1.a and a)),e)*b*t1.f from t1 where t1.f>=t1.c),c) end) from t1 where e>b),t1.f) | f and f then c else 11 end,(c),t1.e)),19)-t1.c in (select t1.a from t1 union select e from t1))} -} {17} -do_test randexpr-2.456 { - db eval {SELECT (select case case min(d) when abs(cast(avg((abs(a)/abs(coalesce((select (select abs(cast(avg(t1.f) AS integer)) from t1) from t1 where (case when t1.e in (select 11 from t1 union select 17 from t1) then -t1.e- -t1.e else a end<>a) and not not exists(select 1 from t1 where t1.b in (select ~+max( -t1.b) & max(t1.c) from t1 union select count(distinct -t1.a) from t1))),t1.a)))) AS integer)) then (count(*) & ((count(distinct b)))-count(*)) else min(11) end when max(a) then count(distinct f) else (min(17)) end from t1) FROM t1 WHERE NOT (coalesce((select max(13) from t1 where t1.b not in ( -case when 13 not between 17 and b then f when t1.e+~+e between coalesce((select max(case 19 when e then 17 else coalesce((select coalesce((select max(f) from t1 where exists(select 1 from t1 where t1.b not between t1.a and a)),e)*b*t1.f from t1 where t1.f>=t1.c),c) end) from t1 where e>b),t1.f) | f and f then c else 11 end,(c),t1.e)),19)-t1.c in (select t1.a from t1 union select e from t1))} -} {17} -do_test randexpr-2.457 { - db eval {SELECT (a*f+c | ~b*(select cast(avg(19) AS integer) from t1)+17*(select max(a*b-d) from t1)+(abs((select count(distinct b) from t1))/abs(case when -13*c between t1.f and t1.c then c when not 17 between 17 and 11 and 17<=((t1.c)) then c else a end*t1.c))-a*a)-c FROM t1 WHERE exists(select 1 from t1 where t1.e-11+t1.d*e+(abs(coalesce((select max(t1.b) from t1 where 19-13- -coalesce((select c*t1.e+t1.f*f from t1 where not exists(select 1 from t1 where not exists(select 1 from t1 where (17<=d or -11 in (select cast(avg(c) AS integer) from t1 union select +count(*) from t1))))),t1.b)=t1.c or t1.b>t1.c or 19 not between c and t1.e then 17 else t1.b end) from t1 where (e<=t1.b)),11) FROM t1 WHERE t1.a in (f,t1.d*+a,t1.c* -(select (abs(case +(max(coalesce((select max((select count(*)-cast(avg(b) AS integer) from t1)) from t1 where (c=t1.c or t1.b>t1.c or 19 not between c and t1.e then 17 else t1.b end) from t1 where (e<=t1.b)),11) FROM t1 WHERE NOT (t1.a in (f,t1.d*+a,t1.c* -(select (abs(case +(max(coalesce((select max((select count(*)-cast(avg(b) AS integer) from t1)) from t1 where (ce then case t1.d when 13 then t1.c else 19 end-13 else t1.e+coalesce((select max(19) from t1 where case when e in (+b,coalesce((select a+(11) from t1 where b not between c and d or t1.b not in (a,11,17)),b),11) then 19 when (c) not in (t1.c,t1.b,d) then t1.c else t1.d end*f not between t1.a and d),13) end when c then 11 else c end) FROM t1 WHERE 19 not between coalesce((select max(d*t1.c) from t1 where (select cast(avg((b)) AS integer) from t1) in (select ( - -(abs(case max(b) when cast(avg( -13-11) AS integer) then count(distinct a-e) else ~ -cast(avg((c)) AS integer)-min(17)+count(*) end) | (min(e)))-min((19))) from t1 union select count(distinct 13) from t1)),case when -e | 19 between -11 and f then 19 else 19 end) and (f)} -} {} -do_test randexpr-2.463 { - db eval {SELECT (case case when +c>e then case t1.d when 13 then t1.c else 19 end-13 else t1.e+coalesce((select max(19) from t1 where case when e in (+b,coalesce((select a+(11) from t1 where b not between c and d or t1.b not in (a,11,17)),b),11) then 19 when (c) not in (t1.c,t1.b,d) then t1.c else t1.d end*f not between t1.a and d),13) end when c then 11 else c end) FROM t1 WHERE NOT (19 not between coalesce((select max(d*t1.c) from t1 where (select cast(avg((b)) AS integer) from t1) in (select ( - -(abs(case max(b) when cast(avg( -13-11) AS integer) then count(distinct a-e) else ~ -cast(avg((c)) AS integer)-min(17)+count(*) end) | (min(e)))-min((19))) from t1 union select count(distinct 13) from t1)),case when -e | 19 between -11 and f then 19 else 19 end) and (f))} -} {300} -do_test randexpr-2.464 { - db eval {SELECT (abs((select abs(case -max(e)+max(t1.f)+(count(*)* -count(distinct case e when 19 then c else 13 end))*~min(t1.a) when cast(avg(t1.a) AS integer) then -min(e) else -count(*) end) from t1)*coalesce((select (t1.a) from t1 where case when c+t1.b-b | d in (select max(d) from t1 union select -max(19) from t1) then t1.b else f end=t1.d),t1.b)*(t1.d) | e+t1.a)/abs(t1.d)) FROM t1 WHERE t1.f in (19,d*t1.d,(select min((select count(*)*min((17)+(abs(11)/abs(+~coalesce((select max(f) from t1 where 13 not between t1.c and t1.a),t1.e)-11))) from t1)) from t1)+17)} -} {} -do_test randexpr-2.465 { - db eval {SELECT (abs((select abs(case -max(e)+max(t1.f)+(count(*)* -count(distinct case e when 19 then c else 13 end))*~min(t1.a) when cast(avg(t1.a) AS integer) then -min(e) else -count(*) end) from t1)*coalesce((select (t1.a) from t1 where case when c+t1.b-b | d in (select max(d) from t1 union select -max(19) from t1) then t1.b else f end=t1.d),t1.b)*(t1.d) | e+t1.a)/abs(t1.d)) FROM t1 WHERE NOT (t1.f in (19,d*t1.d,(select min((select count(*)*min((17)+(abs(11)/abs(+~coalesce((select max(f) from t1 where 13 not between t1.c and t1.a),t1.e)-11))) from t1)) from t1)+17))} -} {201} -do_test randexpr-2.466 { - db eval {SELECT (abs((select abs(case -max(e)+max(t1.f)+(count(*)* -count(distinct case e when 19 then c else 13 end))*~min(t1.a) when cast(avg(t1.a) AS integer) then -min(e) else -count(*) end) from t1)*coalesce((select (t1.a) from t1 where case when c+t1.b-b & d in (select max(d) from t1 union select -max(19) from t1) then t1.b else f end=t1.d),t1.b)*(t1.d) & e+t1.a)/abs(t1.d)) FROM t1 WHERE NOT (t1.f in (19,d*t1.d,(select min((select count(*)*min((17)+(abs(11)/abs(+~coalesce((select max(f) from t1 where 13 not between t1.c and t1.a),t1.e)-11))) from t1)) from t1)+17))} -} {0} -do_test randexpr-2.467 { - db eval {SELECT d+case when (coalesce((select max(t1.a) from t1 where t1.a not in (t1.d,f*(select count(distinct t1.d) from t1)+t1.f,c)),b)-c-17-t1.c)-case when 13*t1.a-19*e<>11 then f when t1.f not between 11 and t1.d then b else f end=t1.d then t1.f when not e>t1.f then 17 else b end FROM t1 WHERE exists(select 1 from t1 where 11* -d>=e) or t1.c<+ -e*11 or (17 not between t1.d and case t1.a when t1.a then t1.d+f-b else 11 end | t1.e)} -} {417} -do_test randexpr-2.468 { - db eval {SELECT d+case when (coalesce((select max(t1.a) from t1 where t1.a not in (t1.d,f*(select count(distinct t1.d) from t1)+t1.f,c)),b)-c-17-t1.c)-case when 13*t1.a-19*e<>11 then f when t1.f not between 11 and t1.d then b else f end=t1.d then t1.f when not e>t1.f then 17 else b end FROM t1 WHERE NOT (exists(select 1 from t1 where 11* -d>=e) or t1.c<+ -e*11 or (17 not between t1.d and case t1.a when t1.a then t1.d+f-b else 11 end | t1.e))} -} {} -do_test randexpr-2.469 { - db eval {SELECT t1.f-coalesce((select max(+e | b) from t1 where case when -(abs(11)/abs(~(19 | t1.d)))-~c*e not in (19,b*t1.b,b) then 11 when f<=13 then d else t1.d end in (select (count(*))-cast(avg(11 | 17*t1.b) AS integer) from t1 union select count(distinct a-17) from t1)),t1.c)-c FROM t1 WHERE case when (t1.f*a<=11+d+coalesce((select max(19+19) from t1 where 13 in (select min(f)+cast(avg((abs(t1.e)/abs((select count(distinct c) from t1)))) AS integer)+(~cast(avg(e) AS integer))-min(c) from t1 union select count(*) from t1)),b)) then (a) else t1.b end-t1.b<=t1.b and 13 in (select t1.e from t1 union select t1.e from t1) and a=t1.d or (exists(select 1 from t1 where (t1.e=t1.c)))),t1.c)-11 FROM t1 WHERE (not exists(select 1 from t1 where 11+t1.c-13>=t1.c or not exists(select 1 from t1 where a in (select b from t1 union select 19-d from t1) and ((abs(a+(abs(coalesce((select t1.d from t1 where exists(select 1 from t1 where case when t1.e>= -13 or -e<>f then d when t1.c=13 then (b) else t1.c end not between 13 and b)),d))/abs(t1.d))-b)/abs(t1.a))<> -13 and exists(select 1 from t1 where 19<>e) or 13>=19))))} -} {} -do_test randexpr-2.473 { - db eval {SELECT coalesce((select max(t1.c) from t1 where case when (t1.e*19*f-t1.b in (select cast(avg(d-~d) AS integer) from t1 union select +( -case +~count(*)*count(distinct (c)) when cast(avg(19) AS integer) then min(c) else count(distinct 17) end*cast(avg((13)) AS integer)-max(11)+(count(distinct b))) from t1)) then +11 else t1.b end>=t1.d or (exists(select 1 from t1 where (t1.e=t1.c)))),t1.c)-11 FROM t1 WHERE NOT ((not exists(select 1 from t1 where 11+t1.c-13>=t1.c or not exists(select 1 from t1 where a in (select b from t1 union select 19-d from t1) and ((abs(a+(abs(coalesce((select t1.d from t1 where exists(select 1 from t1 where case when t1.e>= -13 or -e<>f then d when t1.c=13 then (b) else t1.c end not between 13 and b)),d))/abs(t1.d))-b)/abs(t1.a))<> -13 and exists(select 1 from t1 where 19<>e) or 13>=19)))))} -} {289} -do_test randexpr-2.474 { - db eval {SELECT +coalesce((select max(11) from t1 where not case d+t1.c*coalesce((select max(coalesce((select d | e from t1 where 17 not between coalesce((select (t1.d) from t1 where t1.a between (select max(t1.b+d+t1.a) from t1)-t1.e and 17),t1.a) and 11),19)) from t1 where t1.dt1.d*a) then (abs(~a)/abs(+11))*f when (c-(coalesce((select 11 from t1 where t1.d in (case when (19)+11>=c then 19 when e<>b then 13 else c end,a,13)),17))+13) not between 11 and t1.c then (t1.b) else 17 end+b FROM t1 WHERE a*b*11 in (select case when not coalesce((select max(~13 | (select abs((count(distinct t1.f))*cast(avg(t1.f) AS integer)+(max(t1.e))) from t1)) from t1 where coalesce((select max(11) from t1 where t1.b=19),b) in (f,11,19) and t1.f between a and t1.c or 19=t1.a and d=17 or c>=t1.f or t1.d<>t1.c),11)*c in (select f from t1 union select -t1.b from t1) then t1.c when c not between f and 13 then e else -e end from t1 union select e from t1)} -} {} -do_test randexpr-2.478 { - db eval {SELECT case when ((select -min(e)+cast(avg(t1.a) AS integer) from t1)>t1.d*a) then (abs(~a)/abs(+11))*f when (c-(coalesce((select 11 from t1 where t1.d in (case when (19)+11>=c then 19 when e<>b then 13 else c end,a,13)),17))+13) not between 11 and t1.c then (t1.b) else 17 end+b FROM t1 WHERE NOT (a*b*11 in (select case when not coalesce((select max(~13 | (select abs((count(distinct t1.f))*cast(avg(t1.f) AS integer)+(max(t1.e))) from t1)) from t1 where coalesce((select max(11) from t1 where t1.b=19),b) in (f,11,19) and t1.f between a and t1.c or 19=t1.a and d=17 or c>=t1.f or t1.d<>t1.c),11)*c in (select f from t1 union select -t1.b from t1) then t1.c when c not between f and 13 then e else -e end from t1 union select e from t1))} -} {217} -do_test randexpr-2.479 { - db eval {SELECT t1.d-coalesce((select -t1.c from t1 where not exists(select 1 from t1 where not exists(select 1 from t1 where t1.d<=case t1.d+e when case when d>19 then 11+t1.c else t1.b end-t1.f-t1.e then (abs(t1.d-19*t1.b)/abs(13+case when t1.f in (select count(*)-count(distinct t1.b) from t1 union select (max((t1.f))) from t1) then (((t1.d))) when t1.b not in (t1.d,13,a) then t1.d else 19 end*t1.c))-t1.d else e end))),13)+c*t1.a FROM t1 WHERE exists(select 1 from t1 where ~coalesce((select a+t1.a from t1 where ~(abs(c)/abs(17 | +13))-t1.f in (select f from t1 union select case when t1.b between 11*e and f then e when a in (e* -t1.f-f,coalesce((select 17 from t1 where t1.e in (select (cast(avg(e) AS integer)) from t1 union select max(b) from t1)),a),d) then t1.c else (f) end from t1)),f) between -19 and (13) or t1.f<>t1.a)} -} {30700} -do_test randexpr-2.480 { - db eval {SELECT t1.d-coalesce((select -t1.c from t1 where not exists(select 1 from t1 where not exists(select 1 from t1 where t1.d<=case t1.d+e when case when d>19 then 11+t1.c else t1.b end-t1.f-t1.e then (abs(t1.d-19*t1.b)/abs(13+case when t1.f in (select count(*)-count(distinct t1.b) from t1 union select (max((t1.f))) from t1) then (((t1.d))) when t1.b not in (t1.d,13,a) then t1.d else 19 end*t1.c))-t1.d else e end))),13)+c*t1.a FROM t1 WHERE NOT (exists(select 1 from t1 where ~coalesce((select a+t1.a from t1 where ~(abs(c)/abs(17 | +13))-t1.f in (select f from t1 union select case when t1.b between 11*e and f then e when a in (e* -t1.f-f,coalesce((select 17 from t1 where t1.e in (select (cast(avg(e) AS integer)) from t1 union select max(b) from t1)),a),d) then t1.c else (f) end from t1)),f) between -19 and (13) or t1.f<>t1.a))} -} {} -do_test randexpr-2.481 { - db eval {SELECT (abs((abs(t1.b*t1.b*t1.f+a)/abs(t1.f))*t1.a-case -(abs(coalesce((select (case when 11*19 in (select count(*) from t1 union select -min(13)-(max(t1.a)) from t1) then 19 else -17 end) from t1 where t1.e between 13 and (a)),t1.b)+d)/abs(t1.f))-t1.b-t1.c | d when -t1.f then c else 17 end)/abs(13))-b*t1.d FROM t1 WHERE 13 in (t1.b,17*e+c*a,coalesce((select max(d) from t1 where +f+b not in (a,t1.a*~t1.c | t1.b-case when t1.a<=case when t1.f in (b,11,e) then d else t1.e end+f then 19 else (f) end-b*13- -t1.f-17,t1.c)),17))} -} {} -do_test randexpr-2.482 { - db eval {SELECT (abs((abs(t1.b*t1.b*t1.f+a)/abs(t1.f))*t1.a-case -(abs(coalesce((select (case when 11*19 in (select count(*) from t1 union select -min(13)-(max(t1.a)) from t1) then 19 else -17 end) from t1 where t1.e between 13 and (a)),t1.b)+d)/abs(t1.f))-t1.b-t1.c | d when -t1.f then c else 17 end)/abs(13))-b*t1.d FROM t1 WHERE NOT (13 in (t1.b,17*e+c*a,coalesce((select max(d) from t1 where +f+b not in (a,t1.a*~t1.c | t1.b-case when t1.a<=case when t1.f in (b,11,e) then d else t1.e end+f then 19 else (f) end-b*13- -t1.f-17,t1.c)),17)))} -} {227691} -do_test randexpr-2.483 { - db eval {SELECT (abs((abs(t1.b*t1.b*t1.f+a)/abs(t1.f))*t1.a-case -(abs(coalesce((select (case when 11*19 in (select count(*) from t1 union select -min(13)-(max(t1.a)) from t1) then 19 else -17 end) from t1 where t1.e between 13 and (a)),t1.b)+d)/abs(t1.f))-t1.b-t1.c & d when -t1.f then c else 17 end)/abs(13))-b*t1.d FROM t1 WHERE NOT (13 in (t1.b,17*e+c*a,coalesce((select max(d) from t1 where +f+b not in (a,t1.a*~t1.c | t1.b-case when t1.a<=case when t1.f in (b,11,e) then d else t1.e end+f then 19 else (f) end-b*13- -t1.f-17,t1.c)),17)))} -} {227691} -do_test randexpr-2.484 { - db eval {SELECT coalesce((select t1.c*f from t1 where t1.f-+coalesce((select max(t1.d) from t1 where - -t1.e in (select f from t1 union select t1.e from t1)),a)+case when 19 not in (t1.e,case when ~t1.a<>e+a then -t1.d else t1.e end,f) then t1.b when -(t1.e) in (e,(19),t1.c) then t1.f else e end+17*t1.c+d>b),t1.c)+a FROM t1 WHERE t1.b>=~b} -} {180100} -do_test randexpr-2.485 { - db eval {SELECT coalesce((select t1.c*f from t1 where t1.f-+coalesce((select max(t1.d) from t1 where - -t1.e in (select f from t1 union select t1.e from t1)),a)+case when 19 not in (t1.e,case when ~t1.a<>e+a then -t1.d else t1.e end,f) then t1.b when -(t1.e) in (e,(19),t1.c) then t1.f else e end+17*t1.c+d>b),t1.c)+a FROM t1 WHERE NOT (t1.b>=~b)} -} {} -do_test randexpr-2.486 { - db eval {SELECT case case when case when 13 between coalesce((select max(t1.f) from t1 where b+f in (b+(coalesce((select t1.f from t1 where (t1.c)>=17 or 19 not in (11,t1.e,c)),13)),b,t1.e) and c<=e and not t1.b<>13 and 19 not between t1.c and a or c between f and f),t1.c) and b then t1.b when 13<>t1.a then 11 else d end in (select 13 from t1 union select 19 from t1) then t1.c when t1.f not in (17,b,b) then t1.f else e end when t1.e then t1.e else -d end FROM t1 WHERE case when not exists(select 1 from t1 where t1.f not between coalesce((select coalesce((select max(+case t1.a when f then t1.a else t1.e end+case when t1.f>t1.d or 11 in (t1.e,11,b) then b else a end) from t1 where t1.f in (select a from t1 union select d from t1)),t1.d) from t1 where t1.a=b),(t1.c)) and d) then (select case max(t1.a) when ~min((11)) | min(e) then max(t1.e) else abs(max(t1.c)*count(distinct 19)) end from t1) else t1.b end<>b} -} {} -do_test randexpr-2.487 { - db eval {SELECT case case when case when 13 between coalesce((select max(t1.f) from t1 where b+f in (b+(coalesce((select t1.f from t1 where (t1.c)>=17 or 19 not in (11,t1.e,c)),13)),b,t1.e) and c<=e and not t1.b<>13 and 19 not between t1.c and a or c between f and f),t1.c) and b then t1.b when 13<>t1.a then 11 else d end in (select 13 from t1 union select 19 from t1) then t1.c when t1.f not in (17,b,b) then t1.f else e end when t1.e then t1.e else -d end FROM t1 WHERE NOT (case when not exists(select 1 from t1 where t1.f not between coalesce((select coalesce((select max(+case t1.a when f then t1.a else t1.e end+case when t1.f>t1.d or 11 in (t1.e,11,b) then b else a end) from t1 where t1.f in (select a from t1 union select d from t1)),t1.d) from t1 where t1.a=b),(t1.c)) and d) then (select case max(t1.a) when ~min((11)) | min(e) then max(t1.e) else abs(max(t1.c)*count(distinct 19)) end from t1) else t1.b end<>b)} -} {-400} -do_test randexpr-2.488 { - db eval {SELECT case -coalesce((select max(case when case when t1.e in (11*t1.e*17,(select (min(b) | - -+cast(avg(17) AS integer)*max((t1.c))+cast(avg(t1.a) AS integer))+(( -(min(t1.c))))*count(*) from t1), -~b*t1.d+t1.d) then d else t1.a end<(t1.c) then t1.f else e end) from t1 where 13<>c),e)-(t1.b) when t1.a then 17 else t1.f end FROM t1 WHERE coalesce((select max(t1.e) from t1 where (not exists(select 1 from t1 where b<+c))),case when b | ~case t1.a when -t1.b then -t1.f else t1.f end*f+f in (select t1.b from t1 union select t1.c from t1) then -(t1.f) when a<>11 then (d) else 11 end) in (select abs(~(abs(case (min(t1.b)*abs(count(distinct a)+count(*) | -count(distinct a)))- -max(19) when max(t1.e) then min(d) else (max(a)) end))) from t1 union select count(*) from t1)} -} {} -do_test randexpr-2.489 { - db eval {SELECT case -coalesce((select max(case when case when t1.e in (11*t1.e*17,(select (min(b) | - -+cast(avg(17) AS integer)*max((t1.c))+cast(avg(t1.a) AS integer))+(( -(min(t1.c))))*count(*) from t1), -~b*t1.d+t1.d) then d else t1.a end<(t1.c) then t1.f else e end) from t1 where 13<>c),e)-(t1.b) when t1.a then 17 else t1.f end FROM t1 WHERE NOT (coalesce((select max(t1.e) from t1 where (not exists(select 1 from t1 where b<+c))),case when b | ~case t1.a when -t1.b then -t1.f else t1.f end*f+f in (select t1.b from t1 union select t1.c from t1) then -(t1.f) when a<>11 then (d) else 11 end) in (select abs(~(abs(case (min(t1.b)*abs(count(distinct a)+count(*) | -count(distinct a)))- -max(19) when max(t1.e) then min(d) else (max(a)) end))) from t1 union select count(*) from t1))} -} {600} -do_test randexpr-2.490 { - db eval {SELECT case -coalesce((select max(case when case when t1.e in (11*t1.e*17,(select (min(b) & - -+cast(avg(17) AS integer)*max((t1.c))+cast(avg(t1.a) AS integer))+(( -(min(t1.c))))*count(*) from t1), -~b*t1.d+t1.d) then d else t1.a end<(t1.c) then t1.f else e end) from t1 where 13<>c),e)-(t1.b) when t1.a then 17 else t1.f end FROM t1 WHERE NOT (coalesce((select max(t1.e) from t1 where (not exists(select 1 from t1 where b<+c))),case when b | ~case t1.a when -t1.b then -t1.f else t1.f end*f+f in (select t1.b from t1 union select t1.c from t1) then -(t1.f) when a<>11 then (d) else 11 end) in (select abs(~(abs(case (min(t1.b)*abs(count(distinct a)+count(*) | -count(distinct a)))- -max(19) when max(t1.e) then min(d) else (max(a)) end))) from t1 union select count(*) from t1))} -} {600} -do_test randexpr-2.491 { - db eval {SELECT +case when case when ~t1.b<=case when ~17*19 | 11*11*f between t1.c and b then t1.a when e in (t1.a,t1.e,e) then t1.c else 19 end-t1.c-17+a then (t1.d) when 13 not between 13 and 19 then c else c end=(f) or d -coalesce((select t1.b from t1 where c*13+c<>t1.f),a)),t1.e)+t1.f=t1.f then - - -f else b end then -11 else -d end from t1 where ( -t1.c -coalesce((select t1.b from t1 where c*13+c<>t1.f),a)),t1.e)+t1.f=t1.f then - - -f else b end then -11 else -d end from t1 where ( -t1.c -coalesce((select t1.b from t1 where c*13+c<>t1.f),a)),t1.e)+t1.f=t1.f then - - -f else b end then -11 else -d end from t1 where ( -t1.ccase when b between ~11 and (abs(case when (coalesce((select max(+13) from t1 where not not exists(select 1 from t1 where t1.b+e in (b,t1.b,t1.d)) and 13 not in (d,f,17)),t1.a) not in (t1.f,17,17)) then coalesce((select max(19) from t1 where (17) in (t1.a,17,a)),t1.b) when b in (13,t1.a,b) then t1.c else d end)/abs(11)) then t1.f when t1.d>19 then d else d end)} -} {39800} -do_test randexpr-2.495 { - db eval {SELECT case when case when 19 in (select abs(abs(count(distinct f))*~~~count(*)-abs(+abs(count(*))* -cast(avg(17) AS integer) | cast(avg(t1.d) AS integer))+count(distinct -t1.a)+count(*)) from t1 union select -cast(avg(19) AS integer) from t1) then b* -b-c else t1.e*c end=17 then d else coalesce((select -11 from t1 where ecase when b between ~11 and (abs(case when (coalesce((select max(+13) from t1 where not not exists(select 1 from t1 where t1.b+e in (b,t1.b,t1.d)) and 13 not in (d,f,17)),t1.a) not in (t1.f,17,17)) then coalesce((select max(19) from t1 where (17) in (t1.a,17,a)),t1.b) when b in (13,t1.a,b) then t1.c else d end)/abs(11)) then t1.f when t1.d>19 then d else d end))} -} {} -do_test randexpr-2.496 { - db eval {SELECT case when case when 19 in (select abs(abs(count(distinct f))*~~~count(*)-abs(+abs(count(*))* -cast(avg(17) AS integer) & cast(avg(t1.d) AS integer))+count(distinct -t1.a)+count(*)) from t1 union select -cast(avg(19) AS integer) from t1) then b* -b-c else t1.e*c end=17 then d else coalesce((select -11 from t1 where ecase when b between ~11 and (abs(case when (coalesce((select max(+13) from t1 where not not exists(select 1 from t1 where t1.b+e in (b,t1.b,t1.d)) and 13 not in (d,f,17)),t1.a) not in (t1.f,17,17)) then coalesce((select max(19) from t1 where (17) in (t1.a,17,a)),t1.b) when b in (13,t1.a,b) then t1.c else d end)/abs(11)) then t1.f when t1.d>19 then d else d end)} -} {39800} -do_test randexpr-2.497 { - db eval {SELECT t1.a-coalesce((select t1.e from t1 where not exists(select 1 from t1 where a in (select min(d-11) | cast(avg((select -case count(*) when count(*) then +abs(+case ~min((abs(13- -a)/abs(t1.c))) when ~~count(*)+min((13)) then max(t1.e) else cast(avg(t1.a) AS integer) end | max(c))+count(*) else count(*) end*max(t1.d) from t1)) AS integer)+max(t1.c)*count(distinct f) from t1 union select -count(*) from t1))),~17) FROM t1 WHERE case 11 when coalesce((select coalesce((select 19 from t1 where t1.b not between t1.e and e and not not exists(select 1 from t1 where (e in ((abs(c)/abs(17)),(d) | e,(select count(distinct t1.b) from t1)-b)))),case d when a then f else t1.c end) | (t1.d) | b from t1 where t1.c not in (t1.a,19,11)),t1.b)-d then t1.e else t1.d end*t1.d<>f} -} {-400} -do_test randexpr-2.498 { - db eval {SELECT t1.a-coalesce((select t1.e from t1 where not exists(select 1 from t1 where a in (select min(d-11) | cast(avg((select -case count(*) when count(*) then +abs(+case ~min((abs(13- -a)/abs(t1.c))) when ~~count(*)+min((13)) then max(t1.e) else cast(avg(t1.a) AS integer) end | max(c))+count(*) else count(*) end*max(t1.d) from t1)) AS integer)+max(t1.c)*count(distinct f) from t1 union select -count(*) from t1))),~17) FROM t1 WHERE NOT (case 11 when coalesce((select coalesce((select 19 from t1 where t1.b not between t1.e and e and not not exists(select 1 from t1 where (e in ((abs(c)/abs(17)),(d) | e,(select count(distinct t1.b) from t1)-b)))),case d when a then f else t1.c end) | (t1.d) | b from t1 where t1.c not in (t1.a,19,11)),t1.b)-d then t1.e else t1.d end*t1.d<>f)} -} {} -do_test randexpr-2.499 { - db eval {SELECT t1.a-coalesce((select t1.e from t1 where not exists(select 1 from t1 where a in (select min(d-11) & cast(avg((select -case count(*) when count(*) then +abs(+case ~min((abs(13- -a)/abs(t1.c))) when ~~count(*)+min((13)) then max(t1.e) else cast(avg(t1.a) AS integer) end & max(c))+count(*) else count(*) end*max(t1.d) from t1)) AS integer)+max(t1.c)*count(distinct f) from t1 union select -count(*) from t1))),~17) FROM t1 WHERE case 11 when coalesce((select coalesce((select 19 from t1 where t1.b not between t1.e and e and not not exists(select 1 from t1 where (e in ((abs(c)/abs(17)),(d) | e,(select count(distinct t1.b) from t1)-b)))),case d when a then f else t1.c end) | (t1.d) | b from t1 where t1.c not in (t1.a,19,11)),t1.b)-d then t1.e else t1.d end*t1.d<>f} -} {-400} -do_test randexpr-2.500 { - db eval {SELECT case b*coalesce((select coalesce((select max(coalesce((select t1.b from t1 where t1.a<>11),17+~19)) from t1 where (t1.e<>e)),case 13 when 17 then 13 else c-coalesce((select max(case when (select min(d) from t1) in (select max(13) from t1 union select min(t1.f) from t1) then 13 else t1.a end*c) from t1 where t1.b<(t1.b)),f) end) from t1 where 19<=t1.e),(t1.b)) when t1.b then e else t1.d end+t1.c FROM t1 WHERE b+coalesce((select max((d)) from t1 where e=b),t1.c)*((select -(min(coalesce((select 19+(abs((abs((t1.a)*case f when c then t1.b else t1.d end-e)/abs((t1.f))))/abs( -t1.e))+b from t1 where 13 not between d and t1.c),t1.f))) from t1))*case e when 19 then t1.d else t1.b end+t1.e not in (t1.d,t1.a,17)} -} {700} -do_test randexpr-2.501 { - db eval {SELECT case b*coalesce((select coalesce((select max(coalesce((select t1.b from t1 where t1.a<>11),17+~19)) from t1 where (t1.e<>e)),case 13 when 17 then 13 else c-coalesce((select max(case when (select min(d) from t1) in (select max(13) from t1 union select min(t1.f) from t1) then 13 else t1.a end*c) from t1 where t1.b<(t1.b)),f) end) from t1 where 19<=t1.e),(t1.b)) when t1.b then e else t1.d end+t1.c FROM t1 WHERE NOT (b+coalesce((select max((d)) from t1 where e=b),t1.c)*((select -(min(coalesce((select 19+(abs((abs((t1.a)*case f when c then t1.b else t1.d end-e)/abs((t1.f))))/abs( -t1.e))+b from t1 where 13 not between d and t1.c),t1.f))) from t1))*case e when 19 then t1.d else t1.b end+t1.e not in (t1.d,t1.a,17))} -} {} -do_test randexpr-2.502 { - db eval {SELECT case when case when exists(select 1 from t1 where 17 in (select b from t1 union select 13 from t1)) and 19+a in (select count(distinct -(select min(t1.a-f) from t1)) from t1 union select min(case when 11 between coalesce((select max(t1.b) from t1 where case when t1.d<>c or t1.b>=t1.a then ( -11) else t1.d end>=t1.a),t1.c) and -17 then -t1.f else e end) from t1) then a else 19 end+t1.e in (select e from t1 union select -t1.b from t1) then t1.b when not (f) between f and t1.c then t1.e else e end FROM t1 WHERE 17>coalesce((select t1.b from t1 where t1.a+case when b in (19,t1.c,case t1.e when d-(b) then t1.f else 13 end) then 13 when d in (select count(distinct t1.a) from t1 union select case ~max(f) when cast(avg(b) AS integer) then max(d) else min(t1.f) end*min(e) from t1) or (t1.c=t1.e} -} {} -do_test randexpr-2.503 { - db eval {SELECT case when case when exists(select 1 from t1 where 17 in (select b from t1 union select 13 from t1)) and 19+a in (select count(distinct -(select min(t1.a-f) from t1)) from t1 union select min(case when 11 between coalesce((select max(t1.b) from t1 where case when t1.d<>c or t1.b>=t1.a then ( -11) else t1.d end>=t1.a),t1.c) and -17 then -t1.f else e end) from t1) then a else 19 end+t1.e in (select e from t1 union select -t1.b from t1) then t1.b when not (f) between f and t1.c then t1.e else e end FROM t1 WHERE NOT (17>coalesce((select t1.b from t1 where t1.a+case when b in (19,t1.c,case t1.e when d-(b) then t1.f else 13 end) then 13 when d in (select count(distinct t1.a) from t1 union select case ~max(f) when cast(avg(b) AS integer) then max(d) else min(t1.f) end*min(e) from t1) or (t1.c=t1.e)} -} {500} -do_test randexpr-2.504 { - db eval {SELECT c*(select (count(distinct (abs(case when t1.c<>e then e else 19 end)/abs(case when case when +case when a | t1.e+t1.e in (select -count(*) from t1 union select (max(case when 11 not in (t1.f,11,f) then c when c not in (d,t1.f,t1.f) then -t1.a else 13 end)) from t1) then 17 else 13 end>=t1.e then -11 when (t1.f)>c then 11 else 11 end<=11 and not exists(select 1 from t1 where t1.a between t1.e and e) then 19 else (17) end)))) from t1) FROM t1 WHERE ((select -case min(a-13*17+c*coalesce((select 19 from t1 where 19>=t1.d),(t1.b))+t1.e) when +(min(17)) then min(17) else +min(b) end* -cast(avg(19) AS integer)*count(*) from t1) not between a and d) and +c in (c,t1.d,d) or d<>t1.f} -} {300} -do_test randexpr-2.505 { - db eval {SELECT c*(select (count(distinct (abs(case when t1.c<>e then e else 19 end)/abs(case when case when +case when a | t1.e+t1.e in (select -count(*) from t1 union select (max(case when 11 not in (t1.f,11,f) then c when c not in (d,t1.f,t1.f) then -t1.a else 13 end)) from t1) then 17 else 13 end>=t1.e then -11 when (t1.f)>c then 11 else 11 end<=11 and not exists(select 1 from t1 where t1.a between t1.e and e) then 19 else (17) end)))) from t1) FROM t1 WHERE NOT (((select -case min(a-13*17+c*coalesce((select 19 from t1 where 19>=t1.d),(t1.b))+t1.e) when +(min(17)) then min(17) else +min(b) end* -cast(avg(19) AS integer)*count(*) from t1) not between a and d) and +c in (c,t1.d,d) or d<>t1.f)} -} {} -do_test randexpr-2.506 { - db eval {SELECT c*(select (count(distinct (abs(case when t1.c<>e then e else 19 end)/abs(case when case when +case when a & t1.e+t1.e in (select -count(*) from t1 union select (max(case when 11 not in (t1.f,11,f) then c when c not in (d,t1.f,t1.f) then -t1.a else 13 end)) from t1) then 17 else 13 end>=t1.e then -11 when (t1.f)>c then 11 else 11 end<=11 and not exists(select 1 from t1 where t1.a between t1.e and e) then 19 else (17) end)))) from t1) FROM t1 WHERE ((select -case min(a-13*17+c*coalesce((select 19 from t1 where 19>=t1.d),(t1.b))+t1.e) when +(min(17)) then min(17) else +min(b) end* -cast(avg(19) AS integer)*count(*) from t1) not between a and d) and +c in (c,t1.d,d) or d<>t1.f} -} {300} -do_test randexpr-2.507 { - db eval {SELECT a*coalesce((select t1.d+17 from t1 where 13*case a when t1.a then 11 else -t1.a-d-11-coalesce((select max(e-coalesce((select d from t1 where a<=t1.d*(coalesce((select max( -t1.d) from t1 where t1.f not in (11, -t1.d,17) and t1.a between (13) and c and e not in (t1.b,t1.b,b)),b))), -17)) from t1 where t1.b<>a),19)+t1.d+t1.c end<13),t1.e) FROM t1 WHERE t1.e not between f and 19} -} {50000} -do_test randexpr-2.508 { - db eval {SELECT a*coalesce((select t1.d+17 from t1 where 13*case a when t1.a then 11 else -t1.a-d-11-coalesce((select max(e-coalesce((select d from t1 where a<=t1.d*(coalesce((select max( -t1.d) from t1 where t1.f not in (11, -t1.d,17) and t1.a between (13) and c and e not in (t1.b,t1.b,b)),b))), -17)) from t1 where t1.b<>a),19)+t1.d+t1.c end<13),t1.e) FROM t1 WHERE NOT (t1.e not between f and 19)} -} {} -do_test randexpr-2.509 { - db eval {SELECT 17 | case case when exists(select 1 from t1 where (not t1.d between a and f)) then t1.e when not (b=coalesce((select ~t1.c-case when (select (count(*))*(count(distinct t1.f)) from t1)>=11 then b else 19 end from t1 where not not (13<=e) and t1.b=t1.b),13)) then coalesce((select max((abs(11)/abs(t1.b))) from t1 where t1.a not between t1.e and t1.b),(t1.a)) else t1.a end when c then 13 else 19 end+b FROM t1 WHERE ~t1.a+t1.d+c*17 | (select max(t1.d)*abs(case (max(t1.f)+count(distinct t1.b))*(count(distinct f)) when count(distinct e) then -min(t1.e) else min(t1.f) end)+max(b)+count(distinct t1.d) from t1) in (select max(t1.d*(19)) from t1 union select count(distinct case when t1.c+b in (select max(e) from t1 union select cast(avg(f) AS integer) from t1) then (17) when e not in (c,d,19) or 11=19 then (19) else t1.e end+t1.a) from t1)} -} {} -do_test randexpr-2.510 { - db eval {SELECT 17 | case case when exists(select 1 from t1 where (not t1.d between a and f)) then t1.e when not (b=coalesce((select ~t1.c-case when (select (count(*))*(count(distinct t1.f)) from t1)>=11 then b else 19 end from t1 where not not (13<=e) and t1.b=t1.b),13)) then coalesce((select max((abs(11)/abs(t1.b))) from t1 where t1.a not between t1.e and t1.b),(t1.a)) else t1.a end when c then 13 else 19 end+b FROM t1 WHERE NOT (~t1.a+t1.d+c*17 | (select max(t1.d)*abs(case (max(t1.f)+count(distinct t1.b))*(count(distinct f)) when count(distinct e) then -min(t1.e) else min(t1.f) end)+max(b)+count(distinct t1.d) from t1) in (select max(t1.d*(19)) from t1 union select count(distinct case when t1.c+b in (select max(e) from t1 union select cast(avg(f) AS integer) from t1) then (17) when e not in (c,d,19) or 11=19 then (19) else t1.e end+t1.a) from t1))} -} {219} -do_test randexpr-2.511 { - db eval {SELECT 17 & case case when exists(select 1 from t1 where (not t1.d between a and f)) then t1.e when not (b=coalesce((select ~t1.c-case when (select (count(*))*(count(distinct t1.f)) from t1)>=11 then b else 19 end from t1 where not not (13<=e) and t1.b=t1.b),13)) then coalesce((select max((abs(11)/abs(t1.b))) from t1 where t1.a not between t1.e and t1.b),(t1.a)) else t1.a end when c then 13 else 19 end+b FROM t1 WHERE NOT (~t1.a+t1.d+c*17 | (select max(t1.d)*abs(case (max(t1.f)+count(distinct t1.b))*(count(distinct f)) when count(distinct e) then -min(t1.e) else min(t1.f) end)+max(b)+count(distinct t1.d) from t1) in (select max(t1.d*(19)) from t1 union select count(distinct case when t1.c+b in (select max(e) from t1 union select cast(avg(f) AS integer) from t1) then (17) when e not in (c,d,19) or 11=19 then (19) else t1.e end+t1.a) from t1))} -} {17} -do_test randexpr-2.512 { - db eval {SELECT case when coalesce((select max((+t1.a+17+11+case when (abs(19)/abs(t1.a)) in (select ~(case count(*) when min( -c) then count(distinct b) else count(*) end) from t1 union select -min(t1.e) from t1) or 13>=t1.a then case c when 13 then t1.d else e end when -t1.e<=t1.a then t1.c else t1.c end)) from t1 where not t1.c= -t1.f),b)=f and t1.e<=(t1.f) then ~(t1.a) when 17=e then 19 else t1.b end FROM t1 WHERE case when -t1.f in (select (13) from t1 union select coalesce((select max(coalesce((select (~13) from t1 where t1.b>(11)),e*t1.c)) from t1 where (not (abs(t1.c)/abs(a))>=c)),t1.d) from t1) then -t1.e+ -a-coalesce((select t1.d from t1 where not exists(select 1 from t1 where -b=t1.f-f)),t1.c)*17 when 19<=11 then 19 else t1.d end>=b} -} {200} -do_test randexpr-2.513 { - db eval {SELECT case when coalesce((select max((+t1.a+17+11+case when (abs(19)/abs(t1.a)) in (select ~(case count(*) when min( -c) then count(distinct b) else count(*) end) from t1 union select -min(t1.e) from t1) or 13>=t1.a then case c when 13 then t1.d else e end when -t1.e<=t1.a then t1.c else t1.c end)) from t1 where not t1.c= -t1.f),b)=f and t1.e<=(t1.f) then ~(t1.a) when 17=e then 19 else t1.b end FROM t1 WHERE NOT (case when -t1.f in (select (13) from t1 union select coalesce((select max(coalesce((select (~13) from t1 where t1.b>(11)),e*t1.c)) from t1 where (not (abs(t1.c)/abs(a))>=c)),t1.d) from t1) then -t1.e+ -a-coalesce((select t1.d from t1 where not exists(select 1 from t1 where -b=t1.f-f)),t1.c)*17 when 19<=11 then 19 else t1.d end>=b)} -} {} -do_test randexpr-2.514 { - db eval {SELECT +(case when t1.a<=a then t1.d when ((abs(t1.a)/abs((coalesce((select t1.e from t1 where t1.f>=t1.c),e))))) between coalesce((select case when not 19> -11 then (case when t1.d in (select e from t1 union select f from t1) then -d when t1.b not between 11 and t1.d then (19) else c end) else t1.e end from t1 where not exists(select 1 from t1 where e not in (t1.d,a, -a)) and t1.d>t1.b),a) and t1.a then d else b end)-17 FROM t1 WHERE (+e*t1.d in (select (+abs(abs(min(~+b)-min(a)-case -case abs(max(t1.c)) when max(e) then count(*) else count(distinct 19) end- -max(t1.a) when count(distinct t1.a) then (count(*)) else min(t1.f) end)))-(count(*)) from t1 union select max(t1.f) from t1) or ~c*case when not exists(select 1 from t1 where t1.f in (t1.f,t1.a,d)) then t1.c when t1.c=t1.c),e))))) between coalesce((select case when not 19> -11 then (case when t1.d in (select e from t1 union select f from t1) then -d when t1.b not between 11 and t1.d then (19) else c end) else t1.e end from t1 where not exists(select 1 from t1 where e not in (t1.d,a, -a)) and t1.d>t1.b),a) and t1.a then d else b end)-17 FROM t1 WHERE NOT ((+e*t1.d in (select (+abs(abs(min(~+b)-min(a)-case -case abs(max(t1.c)) when max(e) then count(*) else count(distinct 19) end- -max(t1.a) when count(distinct t1.a) then (count(*)) else min(t1.f) end)))-(count(*)) from t1 union select max(t1.f) from t1) or ~c*case when not exists(select 1 from t1 where t1.f in (t1.f,t1.a,d)) then t1.c when t1.ct1.e then t1.a when -d=t1.e or t1.c not between t1.c and e then c else t1.d end)- -17 in (select a from t1 union select -t1.e from t1) then 19 else a end) from t1 where t1.a in (select -a from t1 union select 19 from t1)),t1.a)<>t1.d then 13 when a in (19,d,c) and a<11 then t1.a else b end+t1.a-t1.b FROM t1 WHERE c>=t1.e} -} {} -do_test randexpr-2.517 { - db eval {SELECT -case when coalesce((select max(case when ~(+case when t1.b*t1.b>t1.e then t1.a when -d=t1.e or t1.c not between t1.c and e then c else t1.d end)- -17 in (select a from t1 union select -t1.e from t1) then 19 else a end) from t1 where t1.a in (select -a from t1 union select 19 from t1)),t1.a)<>t1.d then 13 when a in (19,d,c) and a<11 then t1.a else b end+t1.a-t1.b FROM t1 WHERE NOT (c>=t1.e)} -} {-113} -do_test randexpr-2.518 { - db eval {SELECT coalesce((select case coalesce((select max(19) from t1 where +case when exists(select 1 from t1 where not exists(select 1 from t1 where not c in (case when e>=c then b else t1.b end,t1.b,t1.e))) then a-f+13-t1.f+19 when f>=t1.e then t1.e else t1.c end+17 in (select count(distinct 19) from t1 union select cast(avg(b) AS integer) | count(distinct 11)-count(*) from t1)),a) when b then 17 else c end from t1 where t1.f<=t1.e),t1.e) FROM t1 WHERE ~~+d-d*19*case ~(select count(*) from t1)-11 when 19 then -+(abs(t1.a)/abs(a)) | (f)-(abs(+t1.c)/abs((select ~+max(13*e)+min(f)*count(distinct 13) from t1)))*t1.a else -t1.f-t1.b end*t1.a not between -e and t1.e} -} {500} -do_test randexpr-2.519 { - db eval {SELECT coalesce((select case coalesce((select max(19) from t1 where +case when exists(select 1 from t1 where not exists(select 1 from t1 where not c in (case when e>=c then b else t1.b end,t1.b,t1.e))) then a-f+13-t1.f+19 when f>=t1.e then t1.e else t1.c end+17 in (select count(distinct 19) from t1 union select cast(avg(b) AS integer) | count(distinct 11)-count(*) from t1)),a) when b then 17 else c end from t1 where t1.f<=t1.e),t1.e) FROM t1 WHERE NOT (~~+d-d*19*case ~(select count(*) from t1)-11 when 19 then -+(abs(t1.a)/abs(a)) | (f)-(abs(+t1.c)/abs((select ~+max(13*e)+min(f)*count(distinct 13) from t1)))*t1.a else -t1.f-t1.b end*t1.a not between -e and t1.e)} -} {} -do_test randexpr-2.520 { - db eval {SELECT coalesce((select case coalesce((select max(19) from t1 where +case when exists(select 1 from t1 where not exists(select 1 from t1 where not c in (case when e>=c then b else t1.b end,t1.b,t1.e))) then a-f+13-t1.f+19 when f>=t1.e then t1.e else t1.c end+17 in (select count(distinct 19) from t1 union select cast(avg(b) AS integer) & count(distinct 11)-count(*) from t1)),a) when b then 17 else c end from t1 where t1.f<=t1.e),t1.e) FROM t1 WHERE ~~+d-d*19*case ~(select count(*) from t1)-11 when 19 then -+(abs(t1.a)/abs(a)) | (f)-(abs(+t1.c)/abs((select ~+max(13*e)+min(f)*count(distinct 13) from t1)))*t1.a else -t1.f-t1.b end*t1.a not between -e and t1.e} -} {500} -do_test randexpr-2.521 { - db eval {SELECT a*17+ -case when not exists(select 1 from t1 where 11=t1.d) then 11-b when case when t1.c<>t1.c++t1.a or t1.c*t1.a+d-f between 19 and case when not t1.e>=11 and t1.b<=t1.c then coalesce((select max(a) from t1 where 19=11),f) when f not in (t1.b,13,b) then f else -d end then d else t1.c end in (select 17 from t1 union select d from t1) then 17 else b end FROM t1 WHERE -(+~ -d++c+b)>=t1.a-case when coalesce((select t1.a-(select max(t1.e) from t1)-(abs(11)/abs(17))+t1.d from t1 where not (not exists(select 1 from t1 where c=t1.c)) or t1.b in (select abs(max(11)+count(*)) from t1 union select ((max(a))) from t1)),f)>=a then t1.f when d not in (11,c,17) then a else 19 end} -} {} -do_test randexpr-2.522 { - db eval {SELECT a*17+ -case when not exists(select 1 from t1 where 11=t1.d) then 11-b when case when t1.c<>t1.c++t1.a or t1.c*t1.a+d-f between 19 and case when not t1.e>=11 and t1.b<=t1.c then coalesce((select max(a) from t1 where 19=11),f) when f not in (t1.b,13,b) then f else -d end then d else t1.c end in (select 17 from t1 union select d from t1) then 17 else b end FROM t1 WHERE NOT ( -(+~ -d++c+b)>=t1.a-case when coalesce((select t1.a-(select max(t1.e) from t1)-(abs(11)/abs(17))+t1.d from t1 where not (not exists(select 1 from t1 where c=t1.c)) or t1.b in (select abs(max(11)+count(*)) from t1 union select ((max(a))) from t1)),f)>=a then t1.f when d not in (11,c,17) then a else 19 end)} -} {1889} -do_test randexpr-2.523 { - db eval {SELECT coalesce((select max(t1.b+a) from t1 where case (select count(distinct b*case when t1.f*+~a | b+17*13+a+11 in (select c from t1 union select d from t1) then t1.f else t1.b end) from t1) when t1.a then f else t1.c end+ -f between 17 and d and b in (13,t1.e,t1.e) and d not between t1.f and d),13) FROM t1 WHERE coalesce((select max(t1.d) from t1 where (coalesce((select ~t1.c from t1 where -t1.a<=c*+d or not (case when (t1.b)>=t1.d then t1.e when 17a and a<>e and t1.e=19)),19)<>t1.c} -} {13} -do_test randexpr-2.524 { - db eval {SELECT coalesce((select max(t1.b+a) from t1 where case (select count(distinct b*case when t1.f*+~a | b+17*13+a+11 in (select c from t1 union select d from t1) then t1.f else t1.b end) from t1) when t1.a then f else t1.c end+ -f between 17 and d and b in (13,t1.e,t1.e) and d not between t1.f and d),13) FROM t1 WHERE NOT (coalesce((select max(t1.d) from t1 where (coalesce((select ~t1.c from t1 where -t1.a<=c*+d or not (case when (t1.b)>=t1.d then t1.e when 17a and a<>e and t1.e=19)),19)<>t1.c)} -} {} -do_test randexpr-2.525 { - db eval {SELECT coalesce((select max(t1.b+a) from t1 where case (select count(distinct b*case when t1.f*+~a & b+17*13+a+11 in (select c from t1 union select d from t1) then t1.f else t1.b end) from t1) when t1.a then f else t1.c end+ -f between 17 and d and b in (13,t1.e,t1.e) and d not between t1.f and d),13) FROM t1 WHERE coalesce((select max(t1.d) from t1 where (coalesce((select ~t1.c from t1 where -t1.a<=c*+d or not (case when (t1.b)>=t1.d then t1.e when 17a and a<>e and t1.e=19)),19)<>t1.c} -} {13} -do_test randexpr-2.526 { - db eval {SELECT coalesce((select (t1.b-(abs(t1.b-~17 | 13+13)/abs(t1.e))* -t1.a- -19+t1.d) from t1 where exists(select 1 from t1 where 19 in (select t1.a from t1 union select -19 from t1) and a in (c,e,13) and 19 in (select t1.a from t1 union select b from t1) or 13 in (select 19 from t1 union select d from t1) and not t1.c=t1.f or ( -t1.d between e and 19) or -((17))<>c)),e) FROM t1 WHERE ((abs(a)/abs(f-a)) between -(abs(++t1.b)/abs(13)) and t1.c)} -} {619} -do_test randexpr-2.527 { - db eval {SELECT coalesce((select (t1.b-(abs(t1.b-~17 | 13+13)/abs(t1.e))* -t1.a- -19+t1.d) from t1 where exists(select 1 from t1 where 19 in (select t1.a from t1 union select -19 from t1) and a in (c,e,13) and 19 in (select t1.a from t1 union select b from t1) or 13 in (select 19 from t1 union select d from t1) and not t1.c=t1.f or ( -t1.d between e and 19) or -((17))<>c)),e) FROM t1 WHERE NOT (((abs(a)/abs(f-a)) between -(abs(++t1.b)/abs(13)) and t1.c))} -} {} -do_test randexpr-2.528 { - db eval {SELECT coalesce((select (t1.b-(abs(t1.b-~17 & 13+13)/abs(t1.e))* -t1.a- -19+t1.d) from t1 where exists(select 1 from t1 where 19 in (select t1.a from t1 union select -19 from t1) and a in (c,e,13) and 19 in (select t1.a from t1 union select b from t1) or 13 in (select 19 from t1 union select d from t1) and not t1.c=t1.f or ( -t1.d between e and 19) or -((17))<>c)),e) FROM t1 WHERE ((abs(a)/abs(f-a)) between -(abs(++t1.b)/abs(13)) and t1.c)} -} {619} -do_test randexpr-2.529 { - db eval {SELECT case when coalesce((select max(c- -b-t1.c) from t1 where t1.d between 11 and case when b | ~t1.e*(t1.f)>t1.f then a when (19<13) and not exists(select 1 from t1 where f not in (t1.a,((b)),17)) or d in ((a),t1.c,19) or (f)>13 then t1.e else f end*t1.a),t1.a)>=e then t1.d when t1.e>=c then 13 else f end FROM t1 WHERE +11 between case when t1.f>t1.c then t1.b else t1.b end and ((select count(distinct case when t1.a between (abs(coalesce((select t1.b from t1 where case when t1.d<=(abs((c))/abs(coalesce((select max(17) from t1 where 11=b),13))) then 17 when b=t1.e then d else e end-13>=(e)), -d))/abs(b)) and b then t1.d when (b) in (13,t1.b,t1.a) then f else 19 end) from t1))-d} -} {} -do_test randexpr-2.530 { - db eval {SELECT case when coalesce((select max(c- -b-t1.c) from t1 where t1.d between 11 and case when b | ~t1.e*(t1.f)>t1.f then a when (19<13) and not exists(select 1 from t1 where f not in (t1.a,((b)),17)) or d in ((a),t1.c,19) or (f)>13 then t1.e else f end*t1.a),t1.a)>=e then t1.d when t1.e>=c then 13 else f end FROM t1 WHERE NOT (+11 between case when t1.f>t1.c then t1.b else t1.b end and ((select count(distinct case when t1.a between (abs(coalesce((select t1.b from t1 where case when t1.d<=(abs((c))/abs(coalesce((select max(17) from t1 where 11=b),13))) then 17 when b=t1.e then d else e end-13>=(e)), -d))/abs(b)) and b then t1.d when (b) in (13,t1.b,t1.a) then f else 19 end) from t1))-d)} -} {13} -do_test randexpr-2.531 { - db eval {SELECT case when coalesce((select max(c- -b-t1.c) from t1 where t1.d between 11 and case when b & ~t1.e*(t1.f)>t1.f then a when (19<13) and not exists(select 1 from t1 where f not in (t1.a,((b)),17)) or d in ((a),t1.c,19) or (f)>13 then t1.e else f end*t1.a),t1.a)>=e then t1.d when t1.e>=c then 13 else f end FROM t1 WHERE NOT (+11 between case when t1.f>t1.c then t1.b else t1.b end and ((select count(distinct case when t1.a between (abs(coalesce((select t1.b from t1 where case when t1.d<=(abs((c))/abs(coalesce((select max(17) from t1 where 11=b),13))) then 17 when b=t1.e then d else e end-13>=(e)), -d))/abs(b)) and b then t1.d when (b) in (13,t1.b,t1.a) then f else 19 end) from t1))-d)} -} {13} -do_test randexpr-2.532 { - db eval {SELECT (select ~abs(max(case when (case when ( -t1.a>e) then t1.a else (select (~count(*) | max(case when t1.d<>c then -+13 else case when b between 19 and 17 or (t1.a)>=13 then 19 else t1.c end end)) from t1) end<>t1.e) then 19 when c*e+t1.b<=19 then f else (t1.d) end | b)) from t1)+c FROM t1 WHERE f | t1.a+b>=t1.d} -} {80} -do_test randexpr-2.533 { - db eval {SELECT (select ~abs(max(case when (case when ( -t1.a>e) then t1.a else (select (~count(*) | max(case when t1.d<>c then -+13 else case when b between 19 and 17 or (t1.a)>=13 then 19 else t1.c end end)) from t1) end<>t1.e) then 19 when c*e+t1.b<=19 then f else (t1.d) end | b)) from t1)+c FROM t1 WHERE NOT (f | t1.a+b>=t1.d)} -} {} -do_test randexpr-2.534 { - db eval {SELECT (select ~abs(max(case when (case when ( -t1.a>e) then t1.a else (select (~count(*) & max(case when t1.d<>c then -+13 else case when b between 19 and 17 or (t1.a)>=13 then 19 else t1.c end end)) from t1) end<>t1.e) then 19 when c*e+t1.b<=19 then f else (t1.d) end & b)) from t1)+c FROM t1 WHERE f | t1.a+b>=t1.d} -} {299} -do_test randexpr-2.535 { - db eval {SELECT -case when ~case t1.f+13+t1.a when coalesce((select max(17) from t1 where coalesce((select max(( -11)) from t1 where not exists(select 1 from t1 where case case when not exists(select 1 from t1 where (a in (select f from t1 union select b from t1))) then d when (a) in (f,t1.a, -f) then t1.a else b end when t1.d then c else t1.b end<>a and 11= -t1.a and 19=a)),11) in (select c from t1 union select 17 from t1)),t1.c) then e else 11 end=t1.d then 17 else 17 end FROM t1 WHERE not exists(select 1 from t1 where fa and 11= -t1.a and 19=a)),11) in (select c from t1 union select 17 from t1)),t1.c) then e else 11 end=t1.d then 17 else 17 end FROM t1 WHERE NOT (not exists(select 1 from t1 where fcoalesce((select max(case when (17> -t1.e) then f when 19=t1.a then t1.a else a end) from t1 where t1.c<=t1.e or (t1.d)>=t1.d),t1.a)+a then f when b not in (e,t1.e,t1.b) or t1.f not in (f,t1.c, -d) or e<=13 then f else (17) end-t1.d+t1.f*13 when (t1.c) then b else -t1.e end) from t1)) from t1 where t1.b in (t1.b,t1.f,(t1.e))),t1.e)*(a) FROM t1 WHERE t1.f<=a} -} {} -do_test randexpr-2.538 { - db eval {SELECT t1.f-t1.b | coalesce((select max((select max(case -case when t1.f>coalesce((select max(case when (17> -t1.e) then f when 19=t1.a then t1.a else a end) from t1 where t1.c<=t1.e or (t1.d)>=t1.d),t1.a)+a then f when b not in (e,t1.e,t1.b) or t1.f not in (f,t1.c, -d) or e<=13 then f else (17) end-t1.d+t1.f*13 when (t1.c) then b else -t1.e end) from t1)) from t1 where t1.b in (t1.b,t1.f,(t1.e))),t1.e)*(a) FROM t1 WHERE NOT (t1.f<=a)} -} {-49744} -do_test randexpr-2.539 { - db eval {SELECT t1.f-t1.b & coalesce((select max((select max(case -case when t1.f>coalesce((select max(case when (17> -t1.e) then f when 19=t1.a then t1.a else a end) from t1 where t1.c<=t1.e or (t1.d)>=t1.d),t1.a)+a then f when b not in (e,t1.e,t1.b) or t1.f not in (f,t1.c, -d) or e<=13 then f else (17) end-t1.d+t1.f*13 when (t1.c) then b else -t1.e end) from t1)) from t1 where t1.b in (t1.b,t1.f,(t1.e))),t1.e)*(a) FROM t1 WHERE NOT (t1.f<=a)} -} {144} -do_test randexpr-2.540 { - db eval {SELECT t1.e+t1.a*case when not t1.f<=d-(c)*13 then t1.e+13*(abs(case when exists(select 1 from t1 where (select -count(*)* -max(t1.a) | ((((cast(avg((e)) AS integer))))) from t1)>=+c+b) then +11 when t1.a not between t1.c and c then t1.b else -19 end)/abs(b)) | (19) when not exists(select 1 from t1 where t1.c between t1.e and t1.c) then d else t1.f end FROM t1 WHERE b in (+c,case b when f*~19-t1.b*t1.f then t1.f else a end,a | t1.a)} -} {} -do_test randexpr-2.541 { - db eval {SELECT t1.e+t1.a*case when not t1.f<=d-(c)*13 then t1.e+13*(abs(case when exists(select 1 from t1 where (select -count(*)* -max(t1.a) | ((((cast(avg((e)) AS integer))))) from t1)>=+c+b) then +11 when t1.a not between t1.c and c then t1.b else -19 end)/abs(b)) | (19) when not exists(select 1 from t1 where t1.c between t1.e and t1.c) then d else t1.f end FROM t1 WHERE NOT (b in (+c,case b when f*~19-t1.b*t1.f then t1.f else a end,a | t1.a))} -} {50800} -do_test randexpr-2.542 { - db eval {SELECT t1.e+t1.a*case when not t1.f<=d-(c)*13 then t1.e+13*(abs(case when exists(select 1 from t1 where (select -count(*)* -max(t1.a) & ((((cast(avg((e)) AS integer))))) from t1)>=+c+b) then +11 when t1.a not between t1.c and c then t1.b else -19 end)/abs(b)) & (19) when not exists(select 1 from t1 where t1.c between t1.e and t1.c) then d else t1.f end FROM t1 WHERE NOT (b in (+c,case b when f*~19-t1.b*t1.f then t1.f else a end,a | t1.a))} -} {600} -do_test randexpr-2.543 { - db eval {SELECT t1.e++a-c-a+coalesce((select t1.e from t1 where 11=case when t1.f not between 13 and t1.b+a*t1.c then 17 when (select min((select cast(avg(17) AS integer)*max(d)-(cast(avg(c) AS integer))*count(distinct t1.b) from t1)) from t1)>=case coalesce((select t1.b | e from t1 where t1.d in (t1.c,17,t1.c)),a) when 13 then t1.a else 19 end then t1.a else e end),t1.d) FROM t1 WHERE +t1.a*t1.c between case when case coalesce((select max(+t1.f-t1.b*(select min((b))+count(distinct c) from t1)) from t1 where -b between 11 and t1.b or b in (select -max(19) from t1 union select -count(*)+ -count(*) from t1) and 17=d),13)-t1.b*a when t1.b then (17) else c end>b then e else 11 end and ( -b) or t1.e not between a and 11} -} {600} -do_test randexpr-2.544 { - db eval {SELECT t1.e++a-c-a+coalesce((select t1.e from t1 where 11=case when t1.f not between 13 and t1.b+a*t1.c then 17 when (select min((select cast(avg(17) AS integer)*max(d)-(cast(avg(c) AS integer))*count(distinct t1.b) from t1)) from t1)>=case coalesce((select t1.b | e from t1 where t1.d in (t1.c,17,t1.c)),a) when 13 then t1.a else 19 end then t1.a else e end),t1.d) FROM t1 WHERE NOT (+t1.a*t1.c between case when case coalesce((select max(+t1.f-t1.b*(select min((b))+count(distinct c) from t1)) from t1 where -b between 11 and t1.b or b in (select -max(19) from t1 union select -count(*)+ -count(*) from t1) and 17=d),13)-t1.b*a when t1.b then (17) else c end>b then e else 11 end and ( -b) or t1.e not between a and 11)} -} {} -do_test randexpr-2.545 { - db eval {SELECT t1.e++a-c-a+coalesce((select t1.e from t1 where 11=case when t1.f not between 13 and t1.b+a*t1.c then 17 when (select min((select cast(avg(17) AS integer)*max(d)-(cast(avg(c) AS integer))*count(distinct t1.b) from t1)) from t1)>=case coalesce((select t1.b & e from t1 where t1.d in (t1.c,17,t1.c)),a) when 13 then t1.a else 19 end then t1.a else e end),t1.d) FROM t1 WHERE +t1.a*t1.c between case when case coalesce((select max(+t1.f-t1.b*(select min((b))+count(distinct c) from t1)) from t1 where -b between 11 and t1.b or b in (select -max(19) from t1 union select -count(*)+ -count(*) from t1) and 17=d),13)-t1.b*a when t1.b then (17) else c end>b then e else 11 end and ( -b) or t1.e not between a and 11} -} {600} -do_test randexpr-2.546 { - db eval {SELECT (select case ~case count(*) when (count(distinct d)*min(17)+min(13)+min(11))-max(t1.a) then count(distinct -13) else min(t1.c) end-max( - -t1.d)*count(*) when -count(*) then count(*) else (cast(avg(e) AS integer)) end from t1)-case when a>b then t1.d+case when (e= -t1.a) and c=(13) and t1.e<=c then 11 else t1.f end | t1.a)))-abs(abs(count(*)))-+~min(t1.e)+~count(distinct 11)* -count(*) | max(t1.d)-( -cast(avg(13) AS integer))*(min(e)) else -min(t1.a) end from t1 union select max(t1.f) from t1)} -} {} -do_test randexpr-2.547 { - db eval {SELECT (select case ~case count(*) when (count(distinct d)*min(17)+min(13)+min(11))-max(t1.a) then count(distinct -13) else min(t1.c) end-max( - -t1.d)*count(*) when -count(*) then count(*) else (cast(avg(e) AS integer)) end from t1)-case when a>b then t1.d+case when (e= -t1.a) and c=(13) and t1.e<=c then 11 else t1.f end | t1.a)))-abs(abs(count(*)))-+~min(t1.e)+~count(distinct 11)* -count(*) | max(t1.d)-( -cast(avg(13) AS integer))*(min(e)) else -min(t1.a) end from t1 union select max(t1.f) from t1))} -} {481} -do_test randexpr-2.548 { - db eval {SELECT case ~case 19 when t1.e then f else 19*f end*case when exists(select 1 from t1 where t1.e not between t1.f-~case case -e when f then t1.d else case when t1.b in (t1.e,f,11) then e when 11<=d then -t1.d else 17 end end when 13 then 19 else c end and 19) then coalesce((select t1.b from t1 where not exists(select 1 from t1 where (a<>b))),b) else t1.c end | e+t1.b when a then f else 19 end FROM t1 WHERE 17 in (select count(distinct t1.f)+~min(coalesce((select max(e*f-case when case when 11<>e and t1.e<=t1.d or (t1.d)<=t1.e then d when ( -17) not between -t1.c and t1.a then coalesce((select max((19)) from t1 where -b between e and 11), -a) else d end in (b,t1.d,a) and 19 in (13,13,t1.c) or b not in (f,(t1.e),19) then t1.c when 17 not in ((19),(t1.b),f) then +t1.d else f end) from t1 where (not a between 19 and d and (d>a))),d)) from t1 union select cast(avg(f) AS integer) from t1)} -} {} -do_test randexpr-2.549 { - db eval {SELECT case ~case 19 when t1.e then f else 19*f end*case when exists(select 1 from t1 where t1.e not between t1.f-~case case -e when f then t1.d else case when t1.b in (t1.e,f,11) then e when 11<=d then -t1.d else 17 end end when 13 then 19 else c end and 19) then coalesce((select t1.b from t1 where not exists(select 1 from t1 where (a<>b))),b) else t1.c end | e+t1.b when a then f else 19 end FROM t1 WHERE NOT (17 in (select count(distinct t1.f)+~min(coalesce((select max(e*f-case when case when 11<>e and t1.e<=t1.d or (t1.d)<=t1.e then d when ( -17) not between -t1.c and t1.a then coalesce((select max((19)) from t1 where -b between e and 11), -a) else d end in (b,t1.d,a) and 19 in (13,13,t1.c) or b not in (f,(t1.e),19) then t1.c when 17 not in ((19),(t1.b),f) then +t1.d else f end) from t1 where (not a between 19 and d and (d>a))),d)) from t1 union select cast(avg(f) AS integer) from t1))} -} {19} -do_test randexpr-2.550 { - db eval {SELECT case ~case 19 when t1.e then f else 19*f end*case when exists(select 1 from t1 where t1.e not between t1.f-~case case -e when f then t1.d else case when t1.b in (t1.e,f,11) then e when 11<=d then -t1.d else 17 end end when 13 then 19 else c end and 19) then coalesce((select t1.b from t1 where not exists(select 1 from t1 where (a<>b))),b) else t1.c end & e+t1.b when a then f else 19 end FROM t1 WHERE NOT (17 in (select count(distinct t1.f)+~min(coalesce((select max(e*f-case when case when 11<>e and t1.e<=t1.d or (t1.d)<=t1.e then d when ( -17) not between -t1.c and t1.a then coalesce((select max((19)) from t1 where -b between e and 11), -a) else d end in (b,t1.d,a) and 19 in (13,13,t1.c) or b not in (f,(t1.e),19) then t1.c when 17 not in ((19),(t1.b),f) then +t1.d else f end) from t1 where (not a between 19 and d and (d>a))),d)) from t1 union select cast(avg(f) AS integer) from t1))} -} {19} -do_test randexpr-2.551 { - db eval {SELECT (abs(11*coalesce((select max(t1.a) from t1 where d>=case when coalesce((select case when not exists(select 1 from t1 where -d in (select b-(abs(13)/abs(t1.e)) from t1 union select e from t1)) then ~c when not exists(select 1 from t1 where not exists(select 1 from t1 where -t1.d in (select cast(avg(c) AS integer) | count(distinct e)+max( -t1.d)-(max(f)) from t1 union select count(*) from t1))) then t1.a else e end from t1 where exists(select 1 from t1 where t1.f between d and t1.b) or 17 in (11,17,d)),11) not between t1.c and t1.d then 17 when 13=t1.a then 19 else (13) end), -t1.b)-e)/abs(a)) FROM t1 WHERE t1.c+t1.c=t1.f} -} {6} -do_test randexpr-2.552 { - db eval {SELECT (abs(11*coalesce((select max(t1.a) from t1 where d>=case when coalesce((select case when not exists(select 1 from t1 where -d in (select b-(abs(13)/abs(t1.e)) from t1 union select e from t1)) then ~c when not exists(select 1 from t1 where not exists(select 1 from t1 where -t1.d in (select cast(avg(c) AS integer) | count(distinct e)+max( -t1.d)-(max(f)) from t1 union select count(*) from t1))) then t1.a else e end from t1 where exists(select 1 from t1 where t1.f between d and t1.b) or 17 in (11,17,d)),11) not between t1.c and t1.d then 17 when 13=t1.a then 19 else (13) end), -t1.b)-e)/abs(a)) FROM t1 WHERE NOT (t1.c+t1.c=t1.f)} -} {} -do_test randexpr-2.553 { - db eval {SELECT (abs(11*coalesce((select max(t1.a) from t1 where d>=case when coalesce((select case when not exists(select 1 from t1 where -d in (select b-(abs(13)/abs(t1.e)) from t1 union select e from t1)) then ~c when not exists(select 1 from t1 where not exists(select 1 from t1 where -t1.d in (select cast(avg(c) AS integer) & count(distinct e)+max( -t1.d)-(max(f)) from t1 union select count(*) from t1))) then t1.a else e end from t1 where exists(select 1 from t1 where t1.f between d and t1.b) or 17 in (11,17,d)),11) not between t1.c and t1.d then 17 when 13=t1.a then 19 else (13) end), -t1.b)-e)/abs(a)) FROM t1 WHERE t1.c+t1.c=t1.f} -} {6} -do_test randexpr-2.554 { - db eval {SELECT -t1.a*coalesce((select max(c) from t1 where -(17 | case when (select cast(avg(17+coalesce((select max(c) from t1 where exists(select 1 from t1 where (coalesce((select max( -f) from t1 where (t1.b<=t1.b)),t1.e)<>e))),f | -t1.a)) AS integer) from t1) in (13,e,t1.c) then f when (f>e) then b else t1.a end)*c*e not between 19 and t1.b),11)+13-19*(19) FROM t1 WHERE (c<=t1.e)} -} {-30348} -do_test randexpr-2.555 { - db eval {SELECT -t1.a*coalesce((select max(c) from t1 where -(17 | case when (select cast(avg(17+coalesce((select max(c) from t1 where exists(select 1 from t1 where (coalesce((select max( -f) from t1 where (t1.b<=t1.b)),t1.e)<>e))),f | -t1.a)) AS integer) from t1) in (13,e,t1.c) then f when (f>e) then b else t1.a end)*c*e not between 19 and t1.b),11)+13-19*(19) FROM t1 WHERE NOT ((c<=t1.e))} -} {} -do_test randexpr-2.556 { - db eval {SELECT -t1.a*coalesce((select max(c) from t1 where -(17 & case when (select cast(avg(17+coalesce((select max(c) from t1 where exists(select 1 from t1 where (coalesce((select max( -f) from t1 where (t1.b<=t1.b)),t1.e)<>e))),f & -t1.a)) AS integer) from t1) in (13,e,t1.c) then f when (f>e) then b else t1.a end)*c*e not between 19 and t1.b),11)+13-19*(19) FROM t1 WHERE (c<=t1.e)} -} {-30348} -do_test randexpr-2.557 { - db eval {SELECT 19-coalesce((select max(case when 17 | t1.a in (select case case coalesce((select max(t1.b) from t1 where t1.f not between case when -b in (13,f,a) then a else a end and t1.f or (a not in (d,d,t1.c))),c) when a then t1.e else f end when 13 then 13 else b end from t1 union select 17 from t1) then c when not b not in (d, -t1.e,c) then 17 else b end) from t1 where e not in (17,t1.e,b)),t1.e) FROM t1 WHERE t1.a in (select -count(*) from t1 union select min((select (cast(avg((select +max(t1.b) from t1)) AS integer)) from t1)+17*c) from t1)} -} {} -do_test randexpr-2.558 { - db eval {SELECT 19-coalesce((select max(case when 17 | t1.a in (select case case coalesce((select max(t1.b) from t1 where t1.f not between case when -b in (13,f,a) then a else a end and t1.f or (a not in (d,d,t1.c))),c) when a then t1.e else f end when 13 then 13 else b end from t1 union select 17 from t1) then c when not b not in (d, -t1.e,c) then 17 else b end) from t1 where e not in (17,t1.e,b)),t1.e) FROM t1 WHERE NOT (t1.a in (select -count(*) from t1 union select min((select (cast(avg((select +max(t1.b) from t1)) AS integer)) from t1)+17*c) from t1))} -} {-481} -do_test randexpr-2.559 { - db eval {SELECT 19-coalesce((select max(case when 17 & t1.a in (select case case coalesce((select max(t1.b) from t1 where t1.f not between case when -b in (13,f,a) then a else a end and t1.f or (a not in (d,d,t1.c))),c) when a then t1.e else f end when 13 then 13 else b end from t1 union select 17 from t1) then c when not b not in (d, -t1.e,c) then 17 else b end) from t1 where e not in (17,t1.e,b)),t1.e) FROM t1 WHERE NOT (t1.a in (select -count(*) from t1 union select min((select (cast(avg((select +max(t1.b) from t1)) AS integer)) from t1)+17*c) from t1))} -} {-481} -do_test randexpr-2.560 { - db eval {SELECT -f-coalesce((select max(case a-t1.a when t1.f then 13 else +t1.a-t1.f end) from t1 where (select count(distinct a) from t1)>d),( -~t1.a+17+case when (not exists(select 1 from t1 where c=t1.b and c>t1.d)) then ~coalesce((select t1.f from t1 where t1.e not between t1.b and t1.e),11)+a when b<=t1.d then t1.c else 11 end+t1.b)*d)*17+d FROM t1 WHERE +t1.c in (select max(~case when 17>t1.f then 19 else -case when d=11 or t1.b> -t1.e or d not in (b,t1.a,t1.e) then e-( -13)+d else 11 end end-t1.d) from t1 union select max(17)+case min(t1.a) | case + -case abs(cast(avg(t1.d) AS integer)) when -count(*) then count(*) else max(19) end when min(e) then count(*) else cast(avg(t1.c) AS integer) end when min(t1.f) then count(*) else min(b) end from t1)} -} {} -do_test randexpr-2.561 { - db eval {SELECT -f-coalesce((select max(case a-t1.a when t1.f then 13 else +t1.a-t1.f end) from t1 where (select count(distinct a) from t1)>d),( -~t1.a+17+case when (not exists(select 1 from t1 where c=t1.b and c>t1.d)) then ~coalesce((select t1.f from t1 where t1.e not between t1.b and t1.e),11)+a when b<=t1.d then t1.c else 11 end+t1.b)*d)*17+d FROM t1 WHERE NOT (+t1.c in (select max(~case when 17>t1.f then 19 else -case when d=11 or t1.b> -t1.e or d not in (b,t1.a,t1.e) then e-( -13)+d else 11 end end-t1.d) from t1 union select max(17)+case min(t1.a) | case + -case abs(cast(avg(t1.d) AS integer)) when -count(*) then count(*) else max(19) end when min(e) then count(*) else cast(avg(t1.c) AS integer) end when min(t1.f) then count(*) else min(b) end from t1))} -} {-2761000} -do_test randexpr-2.562 { - db eval {SELECT coalesce((select 11 from t1 where exists(select 1 from t1 where not exists(select 1 from t1 where not (select +count(*)* -count(distinct case when exists(select 1 from t1 where 13+a=t1.b) then d else 13 end-t1.b) from t1)<=17 | e-13)) or not exists(select 1 from t1 where not t1.e in ((13),17,19) and not t1.d>a and t1.e not between t1.e and b)),coalesce((select max(coalesce((select max(b) from t1 where (b)>11),d)) from t1 where 11> -19),f)-c) FROM t1 WHERE case when -13 not in (b,(abs(coalesce((select max(case when -17<>t1.f then b when coalesce((select t1.b from t1 where t1.c in (select (a) from t1 union select c from t1)),17)<=t1.e then b else f end) from t1 where b<=11),t1.c))/abs((d))),19) then t1.b when (exists(select 1 from t1 where not exists(select 1 from t1 where ((13)=e and t1.f between 17 and t1.a) or t1.f between (a) and -(t1.f)))) and t1.e between b and 13 or b<>(f) then t1.f else d end>=a or d>=13} -} {11} -do_test randexpr-2.563 { - db eval {SELECT coalesce((select 11 from t1 where exists(select 1 from t1 where not exists(select 1 from t1 where not (select +count(*)* -count(distinct case when exists(select 1 from t1 where 13+a=t1.b) then d else 13 end-t1.b) from t1)<=17 | e-13)) or not exists(select 1 from t1 where not t1.e in ((13),17,19) and not t1.d>a and t1.e not between t1.e and b)),coalesce((select max(coalesce((select max(b) from t1 where (b)>11),d)) from t1 where 11> -19),f)-c) FROM t1 WHERE NOT (case when -13 not in (b,(abs(coalesce((select max(case when -17<>t1.f then b when coalesce((select t1.b from t1 where t1.c in (select (a) from t1 union select c from t1)),17)<=t1.e then b else f end) from t1 where b<=11),t1.c))/abs((d))),19) then t1.b when (exists(select 1 from t1 where not exists(select 1 from t1 where ((13)=e and t1.f between 17 and t1.a) or t1.f between (a) and -(t1.f)))) and t1.e between b and 13 or b<>(f) then t1.f else d end>=a or d>=13)} -} {} -do_test randexpr-2.564 { - db eval {SELECT coalesce((select 11 from t1 where exists(select 1 from t1 where not exists(select 1 from t1 where not (select +count(*)* -count(distinct case when exists(select 1 from t1 where 13+a=t1.b) then d else 13 end-t1.b) from t1)<=17 & e-13)) or not exists(select 1 from t1 where not t1.e in ((13),17,19) and not t1.d>a and t1.e not between t1.e and b)),coalesce((select max(coalesce((select max(b) from t1 where (b)>11),d)) from t1 where 11> -19),f)-c) FROM t1 WHERE case when -13 not in (b,(abs(coalesce((select max(case when -17<>t1.f then b when coalesce((select t1.b from t1 where t1.c in (select (a) from t1 union select c from t1)),17)<=t1.e then b else f end) from t1 where b<=11),t1.c))/abs((d))),19) then t1.b when (exists(select 1 from t1 where not exists(select 1 from t1 where ((13)=e and t1.f between 17 and t1.a) or t1.f between (a) and -(t1.f)))) and t1.e between b and 13 or b<>(f) then t1.f else d end>=a or d>=13} -} {11} -do_test randexpr-2.565 { - db eval {SELECT coalesce((select max(coalesce((select max(13+f | c+a) from t1 where 17d then 13 else c end-c then e else t1.e end),c) FROM t1 WHERE exists(select 1 from t1 where t1.a+( -case when exists(select 1 from t1 where exists(select 1 from t1 where b | c-c+t1.d not between 19 and 11)) then coalesce((select t1.c from t1 where c+17 in (f,13,c) or t1.e*coalesce((select case when (not exists(select 1 from t1 where 17>e)) then t1.d else ~t1.e end from t1 where (t1.f not in (19,a,t1.b) or c=f)),c)=c), -11) else e end)<=t1.b)} -} {300} -do_test randexpr-2.566 { - db eval {SELECT coalesce((select max(coalesce((select max(13+f | c+a) from t1 where 17d then 13 else c end-c then e else t1.e end),c) FROM t1 WHERE NOT (exists(select 1 from t1 where t1.a+( -case when exists(select 1 from t1 where exists(select 1 from t1 where b | c-c+t1.d not between 19 and 11)) then coalesce((select t1.c from t1 where c+17 in (f,13,c) or t1.e*coalesce((select case when (not exists(select 1 from t1 where 17>e)) then t1.d else ~t1.e end from t1 where (t1.f not in (19,a,t1.b) or c=f)),c)=c), -11) else e end)<=t1.b))} -} {} -do_test randexpr-2.567 { - db eval {SELECT coalesce((select max(coalesce((select max(13+f & c+a) from t1 where 17d then 13 else c end-c then e else t1.e end),c) FROM t1 WHERE exists(select 1 from t1 where t1.a+( -case when exists(select 1 from t1 where exists(select 1 from t1 where b | c-c+t1.d not between 19 and 11)) then coalesce((select t1.c from t1 where c+17 in (f,13,c) or t1.e*coalesce((select case when (not exists(select 1 from t1 where 17>e)) then t1.d else ~t1.e end from t1 where (t1.f not in (19,a,t1.b) or c=f)),c)=c), -11) else e end)<=t1.b)} -} {300} -do_test randexpr-2.568 { - db eval {SELECT case when ((coalesce((select max((select ~cast(avg((~d*f)) AS integer) from t1)) from t1 where - -t1.f<>d),e) in (select cast(avg(+13) AS integer)*~count(*) | case count(*) when -abs(abs(max(f))) then cast(avg(e) AS integer) else (count(distinct b)) end from t1 union select count(*) from t1) and b>= -t1.d)) then (17) when b between 13 and t1.d then -e+t1.a else t1.f end FROM t1 WHERE (case when +t1.f-(select abs(count(distinct d)) from t1)*case when c in (select min(b) from t1 union select max(c+f*case 11*t1.b when b then t1.c else c end | t1.a) from t1) then d else f end | t1.a*b in (t1.d,17,a) then -t1.a else t1.d end) in (e,t1.c,f) and -((t1.c)) in (11,t1.e,t1.c)} -} {} -do_test randexpr-2.569 { - db eval {SELECT case when ((coalesce((select max((select ~cast(avg((~d*f)) AS integer) from t1)) from t1 where - -t1.f<>d),e) in (select cast(avg(+13) AS integer)*~count(*) | case count(*) when -abs(abs(max(f))) then cast(avg(e) AS integer) else (count(distinct b)) end from t1 union select count(*) from t1) and b>= -t1.d)) then (17) when b between 13 and t1.d then -e+t1.a else t1.f end FROM t1 WHERE NOT ((case when +t1.f-(select abs(count(distinct d)) from t1)*case when c in (select min(b) from t1 union select max(c+f*case 11*t1.b when b then t1.c else c end | t1.a) from t1) then d else f end | t1.a*b in (t1.d,17,a) then -t1.a else t1.d end) in (e,t1.c,f) and -((t1.c)) in (11,t1.e,t1.c))} -} {-400} -do_test randexpr-2.570 { - db eval {SELECT case when ((coalesce((select max((select ~cast(avg((~d*f)) AS integer) from t1)) from t1 where - -t1.f<>d),e) in (select cast(avg(+13) AS integer)*~count(*) & case count(*) when -abs(abs(max(f))) then cast(avg(e) AS integer) else (count(distinct b)) end from t1 union select count(*) from t1) and b>= -t1.d)) then (17) when b between 13 and t1.d then -e+t1.a else t1.f end FROM t1 WHERE NOT ((case when +t1.f-(select abs(count(distinct d)) from t1)*case when c in (select min(b) from t1 union select max(c+f*case 11*t1.b when b then t1.c else c end | t1.a) from t1) then d else f end | t1.a*b in (t1.d,17,a) then -t1.a else t1.d end) in (e,t1.c,f) and -((t1.c)) in (11,t1.e,t1.c))} -} {-400} -do_test randexpr-2.571 { - db eval {SELECT t1.d-case when e in (17,coalesce((select max((select count(*) from t1)) from t1 where (~t1.f++19*t1.f+b in (a,t1.b, -t1.e)) and b in (select count(distinct t1.a) from t1 union select (abs(abs(abs(max(t1.e)*max(t1.d))-min(11)* -count(*)))) from t1)),17),13) and t1.f in (select t1.b from t1 union select f from t1) then t1.c else c end+f FROM t1 WHERE not (select (abs(abs((+count(*)*~ -cast(avg(+t1.f-c) AS integer)*count(distinct +coalesce((select max((abs(c)/abs(t1.e))) from t1 where coalesce((select coalesce((select max(f) from t1 where t1.d<=t1.d),e)*c from t1 where t1.f<>f),c) not between t1.a and c),t1.e)+13)-count(distinct f) | abs(cast(avg(t1.b) AS integer)))))) from t1)-13f),c) not between t1.a and c),t1.e)+13)-count(distinct f) | abs(cast(avg(t1.b) AS integer)))))) from t1)-13=c or f<>e),+d))) | t1.c*b+t1.d)- -f)/abs(13))<>t1.e then -t1.e when t1.e not between f and t1.a then t1.c else t1.c end)/abs(t1.e)) FROM t1 WHERE (abs(b*t1.e+t1.a)/abs(t1.c))=c or f<>e),+d))) | t1.c*b+t1.d)- -f)/abs(13))<>t1.e then -t1.e when t1.e not between f and t1.a then t1.c else t1.c end)/abs(t1.e)) FROM t1 WHERE NOT ((abs(b*t1.e+t1.a)/abs(t1.c))=c or f<>e),+d))) & t1.c*b+t1.d)- -f)/abs(13))<>t1.e then -t1.e when t1.e not between f and t1.a then t1.c else t1.c end)/abs(t1.e)) FROM t1 WHERE NOT ((abs(b*t1.e+t1.a)/abs(t1.c))case when (17) in (select + -abs(count(distinct t1.e*17*c+f)-max(19)) from t1 union select count(*)-max(case t1.f when a then (11+19*t1.b+t1.f) else (19) end*t1.c) from t1) then (abs(b- -f)/abs(f)) else t1.f end} -} {0} -do_test randexpr-2.577 { - db eval {SELECT (abs(t1.c-case when +coalesce((select max(coalesce((select max(a-a*t1.f) from t1 where ~t1.a*t1.a-t1.b+f* -19 not in (t1.d,e,b)),11)*t1.a) from t1 where not exists(select 1 from t1 where not exists(select 1 from t1 where (c) in (b,c,t1.c))) or t1.e between -b and b),a)+a<=e then t1.d else 17 end)/abs(f)) FROM t1 WHERE NOT (t1.d-t1.c+~t1.c<>case when (17) in (select + -abs(count(distinct t1.e*17*c+f)-max(19)) from t1 union select count(*)-max(case t1.f when a then (11+19*t1.b+t1.f) else (19) end*t1.c) from t1) then (abs(b- -f)/abs(f)) else t1.f end)} -} {} -do_test randexpr-2.578 { - db eval {SELECT (abs( -coalesce((select 11 from t1 where (case f when (19+ -(select count(*) from t1)) then (select ++~count(distinct 17+t1.f*(17)) | cast(avg(c) AS integer) from t1) else 13-t1.b*t1.b end*t1.c*(select max(e)*cast(avg(t1.b) AS integer) from t1) | 13) | 17 between 11 and 17),(e))+d)/abs(t1.b))-t1.d FROM t1 WHERE 11<>t1.b} -} {-400} -do_test randexpr-2.579 { - db eval {SELECT (abs( -coalesce((select 11 from t1 where (case f when (19+ -(select count(*) from t1)) then (select ++~count(distinct 17+t1.f*(17)) | cast(avg(c) AS integer) from t1) else 13-t1.b*t1.b end*t1.c*(select max(e)*cast(avg(t1.b) AS integer) from t1) | 13) | 17 between 11 and 17),(e))+d)/abs(t1.b))-t1.d FROM t1 WHERE NOT (11<>t1.b)} -} {} -do_test randexpr-2.580 { - db eval {SELECT (abs( -coalesce((select 11 from t1 where (case f when (19+ -(select count(*) from t1)) then (select ++~count(distinct 17+t1.f*(17)) & cast(avg(c) AS integer) from t1) else 13-t1.b*t1.b end*t1.c*(select max(e)*cast(avg(t1.b) AS integer) from t1) & 13) & 17 between 11 and 17),(e))+d)/abs(t1.b))-t1.d FROM t1 WHERE 11<>t1.b} -} {-400} -do_test randexpr-2.581 { - db eval {SELECT ( -13)-case when (13)+19 between (select cast(avg(11+coalesce((select d from t1 where t1.a in (select b from t1 union select c from t1)),11)+t1.e*d) AS integer)*+(max(t1.c))+cast(avg((c)) AS integer)*count(*) | max( -t1.b) from t1)-t1.d and t1.a then t1.b when b<>t1.f then t1.c else a end-b-t1.b FROM t1 WHERE 11<=t1.e+19*+t1.d} -} {-613} -do_test randexpr-2.582 { - db eval {SELECT ( -13)-case when (13)+19 between (select cast(avg(11+coalesce((select d from t1 where t1.a in (select b from t1 union select c from t1)),11)+t1.e*d) AS integer)*+(max(t1.c))+cast(avg((c)) AS integer)*count(*) | max( -t1.b) from t1)-t1.d and t1.a then t1.b when b<>t1.f then t1.c else a end-b-t1.b FROM t1 WHERE NOT (11<=t1.e+19*+t1.d)} -} {} -do_test randexpr-2.583 { - db eval {SELECT ( -13)-case when (13)+19 between (select cast(avg(11+coalesce((select d from t1 where t1.a in (select b from t1 union select c from t1)),11)+t1.e*d) AS integer)*+(max(t1.c))+cast(avg((c)) AS integer)*count(*) & max( -t1.b) from t1)-t1.d and t1.a then t1.b when b<>t1.f then t1.c else a end-b-t1.b FROM t1 WHERE 11<=t1.e+19*+t1.d} -} {-713} -do_test randexpr-2.584 { - db eval {SELECT coalesce((select max(t1.e++case ~t1.c when t1.f-c then t1.b*+coalesce((select max(+t1.c) from t1 where 19-19-13 | t1.d+(select ~min(17) from t1) not in (case when t1.a<>b then e else -e end,(t1.d),t1.a)),b)+((e))* -t1.e else t1.d end | b) from t1 where a not between 13 and c),t1.e) FROM t1 WHERE not case when (exists(select 1 from t1 where (((abs(19)/abs((case when exists(select 1 from t1 where +t1.f>c) then 19 when f in (t1.d,t1.a,13) and b=t1.e then t1.f else t1.a end))) in (e, -t1.c,t1.b))))) then -t1.f when b in (d,11, -d) then t1.e*t1.a else a end+d<>t1.f and (t1.f=( -17))} -} {} -do_test randexpr-2.585 { - db eval {SELECT coalesce((select max(t1.e++case ~t1.c when t1.f-c then t1.b*+coalesce((select max(+t1.c) from t1 where 19-19-13 | t1.d+(select ~min(17) from t1) not in (case when t1.a<>b then e else -e end,(t1.d),t1.a)),b)+((e))* -t1.e else t1.d end | b) from t1 where a not between 13 and c),t1.e) FROM t1 WHERE NOT (not case when (exists(select 1 from t1 where (((abs(19)/abs((case when exists(select 1 from t1 where +t1.f>c) then 19 when f in (t1.d,t1.a,13) and b=t1.e then t1.f else t1.a end))) in (e, -t1.c,t1.b))))) then -t1.f when b in (d,11, -d) then t1.e*t1.a else a end+d<>t1.f and (t1.f=( -17)))} -} {500} -do_test randexpr-2.586 { - db eval {SELECT coalesce((select max(t1.e++case ~t1.c when t1.f-c then t1.b*+coalesce((select max(+t1.c) from t1 where 19-19-13 & t1.d+(select ~min(17) from t1) not in (case when t1.a<>b then e else -e end,(t1.d),t1.a)),b)+((e))* -t1.e else t1.d end & b) from t1 where a not between 13 and c),t1.e) FROM t1 WHERE NOT (not case when (exists(select 1 from t1 where (((abs(19)/abs((case when exists(select 1 from t1 where +t1.f>c) then 19 when f in (t1.d,t1.a,13) and b=t1.e then t1.f else t1.a end))) in (e, -t1.c,t1.b))))) then -t1.f when b in (d,11, -d) then t1.e*t1.a else a end+d<>t1.f and (t1.f=( -17)))} -} {500} -do_test randexpr-2.587 { - db eval {SELECT case when t1.d-~case t1.b when coalesce((select max(b) from t1 where exists(select 1 from t1 where t1.c<>b)),case when 17 in (select min(c+17) from t1 union select ~ -count(distinct 11) | max(d) from t1) then d when ((t1.a not between t1.f and t1.f)) then t1.a else t1.b end) then (c) else (t1.c) end=d then -13 when b in (select cast(avg((a)) AS integer) from t1 union select -~abs(count(*))*min(t1.f) from t1) then d else 19 end)/abs(19)) when 11 then 11 else t1.f end+13-t1.d else t1.b end+b>=d and not exists(select 1 from t1 where e>=19)} -} {} -do_test randexpr-2.588 { - db eval {SELECT case when t1.d-~case t1.b when coalesce((select max(b) from t1 where exists(select 1 from t1 where t1.c<>b)),case when 17 in (select min(c+17) from t1 union select ~ -count(distinct 11) | max(d) from t1) then d when ((t1.a not between t1.f and t1.f)) then t1.a else t1.b end) then (c) else (t1.c) end=d then -13 when b in (select cast(avg((a)) AS integer) from t1 union select -~abs(count(*))*min(t1.f) from t1) then d else 19 end)/abs(19)) when 11 then 11 else t1.f end+13-t1.d else t1.b end+b>=d and not exists(select 1 from t1 where e>=19))} -} {-5489} -do_test randexpr-2.589 { - db eval {SELECT case when t1.d-~case t1.b when coalesce((select max(b) from t1 where exists(select 1 from t1 where t1.c<>b)),case when 17 in (select min(c+17) from t1 union select ~ -count(distinct 11) & max(d) from t1) then d when ((t1.a not between t1.f and t1.f)) then t1.a else t1.b end) then (c) else (t1.c) end=d then -13 when b in (select cast(avg((a)) AS integer) from t1 union select -~abs(count(*))*min(t1.f) from t1) then d else 19 end)/abs(19)) when 11 then 11 else t1.f end+13-t1.d else t1.b end+b>=d and not exists(select 1 from t1 where e>=19))} -} {-5489} -do_test randexpr-2.590 { - db eval {SELECT b+coalesce((select (t1.e) from t1 where coalesce((select max((select abs(cast(avg( -t1.f*17) AS integer))+count(*) from t1)-19*coalesce((select b*+~(t1.c)*(abs(c)/abs(a))+t1.e from t1 where 11 in (t1.a,17,b* -t1.f)),t1.e)*t1.b) from t1 where t1.f<>17),17) in (11,11, -t1.f)),t1.e) FROM t1 WHERE coalesce((select max(coalesce((select 19-e from t1 where t1.b not in (coalesce((select max(t1.e+coalesce((select 11+ -coalesce((select max(t1.a) from t1 where t1.a in (select cast(avg( -11) AS integer) from t1 union select -max(c) from t1)),11)*t1.a from t1 where exists(select 1 from t1 where a= -e)),e)-t1.c | t1.d) from t1 where t1.e=t1.a),17),(t1.e),c)),t1.b)) from t1 where not exists(select 1 from t1 where (13>=a) or exists(select 1 from t1 where d<>11))), -19)<=t1.b} -} {700} -do_test randexpr-2.591 { - db eval {SELECT b+coalesce((select (t1.e) from t1 where coalesce((select max((select abs(cast(avg( -t1.f*17) AS integer))+count(*) from t1)-19*coalesce((select b*+~(t1.c)*(abs(c)/abs(a))+t1.e from t1 where 11 in (t1.a,17,b* -t1.f)),t1.e)*t1.b) from t1 where t1.f<>17),17) in (11,11, -t1.f)),t1.e) FROM t1 WHERE NOT (coalesce((select max(coalesce((select 19-e from t1 where t1.b not in (coalesce((select max(t1.e+coalesce((select 11+ -coalesce((select max(t1.a) from t1 where t1.a in (select cast(avg( -11) AS integer) from t1 union select -max(c) from t1)),11)*t1.a from t1 where exists(select 1 from t1 where a= -e)),e)-t1.c | t1.d) from t1 where t1.e=t1.a),17),(t1.e),c)),t1.b)) from t1 where not exists(select 1 from t1 where (13>=a) or exists(select 1 from t1 where d<>11))), -19)<=t1.b)} -} {} -do_test randexpr-2.592 { - db eval {SELECT (select count(distinct t1.a)-cast(avg(~c+coalesce((select e from t1 where e in (select t1.f from t1 union select d from t1) or t1.d not in (case when a not in (t1.d,t1.c,t1.b) then a-case when ~t1.b+t1.e | -t1.e not in (a,(b),19) then t1.d else 11 end*b when 13 in (c,13,t1.a) then -t1.a else 17 end,c,d)),t1.e)) AS integer) from t1) FROM t1 WHERE ~e<=(a-(select count(*) from t1)+c+(select -abs(abs( -(max((abs(coalesce((select a*(abs(b-b)/abs((c*a*b)-11+coalesce((select max(b) from t1 where ae),e))/abs(11))*t1.e)))) | abs((count(*))) from t1))} -} {-198} -do_test randexpr-2.593 { - db eval {SELECT (select count(distinct t1.a)-cast(avg(~c+coalesce((select e from t1 where e in (select t1.f from t1 union select d from t1) or t1.d not in (case when a not in (t1.d,t1.c,t1.b) then a-case when ~t1.b+t1.e | -t1.e not in (a,(b),19) then t1.d else 11 end*b when 13 in (c,13,t1.a) then -t1.a else 17 end,c,d)),t1.e)) AS integer) from t1) FROM t1 WHERE NOT (~e<=(a-(select count(*) from t1)+c+(select -abs(abs( -(max((abs(coalesce((select a*(abs(b-b)/abs((c*a*b)-11+coalesce((select max(b) from t1 where ae),e))/abs(11))*t1.e)))) | abs((count(*))) from t1)))} -} {} -do_test randexpr-2.594 { - db eval {SELECT (select count(distinct t1.a)-cast(avg(~c+coalesce((select e from t1 where e in (select t1.f from t1 union select d from t1) or t1.d not in (case when a not in (t1.d,t1.c,t1.b) then a-case when ~t1.b+t1.e & -t1.e not in (a,(b),19) then t1.d else 11 end*b when 13 in (c,13,t1.a) then -t1.a else 17 end,c,d)),t1.e)) AS integer) from t1) FROM t1 WHERE ~e<=(a-(select count(*) from t1)+c+(select -abs(abs( -(max((abs(coalesce((select a*(abs(b-b)/abs((c*a*b)-11+coalesce((select max(b) from t1 where ae),e))/abs(11))*t1.e)))) | abs((count(*))) from t1))} -} {-198} -do_test randexpr-2.595 { - db eval {SELECT 13-(select cast(avg(t1.c-13) AS integer) from t1) | 11+t1.b | coalesce((select max(case when b in (select case -case max(17) when ~cast(avg(13-t1.a) AS integer) then count(distinct 13) else - -((cast(avg(e) AS integer))) end when cast(avg(t1.c) AS integer) then count(distinct d) else count(*) end from t1 union select count(*) from t1) then case when t1.d<>~13 then b when t1.c<>13 then t1.a else a end else t1.a end) from t1 where t1.f<>( -(17))),t1.e)+c FROM t1 WHERE (~coalesce((select (11+t1.d) from t1 where 17 in (select f+a from t1 union select case when 11>coalesce((select -case when (11 not in (t1.f,(abs(t1.a)/abs((select count(distinct -case when 13<=e then c when d between (t1.d) and t1.d then a else 11 end) from t1)-f)),c)) then f when (t1.f>t1.d) then 17 else 13 end from t1 where t1.e>a),17) then f else t1.b end from t1)),b)*13>e)} -} {} -do_test randexpr-2.596 { - db eval {SELECT 13-(select cast(avg(t1.c-13) AS integer) from t1) | 11+t1.b | coalesce((select max(case when b in (select case -case max(17) when ~cast(avg(13-t1.a) AS integer) then count(distinct 13) else - -((cast(avg(e) AS integer))) end when cast(avg(t1.c) AS integer) then count(distinct d) else count(*) end from t1 union select count(*) from t1) then case when t1.d<>~13 then b when t1.c<>13 then t1.a else a end else t1.a end) from t1 where t1.f<>( -(17))),t1.e)+c FROM t1 WHERE NOT ((~coalesce((select (11+t1.d) from t1 where 17 in (select f+a from t1 union select case when 11>coalesce((select -case when (11 not in (t1.f,(abs(t1.a)/abs((select count(distinct -case when 13<=e then c when d between (t1.d) and t1.d then a else 11 end) from t1)-f)),c)) then f when (t1.f>t1.d) then 17 else 13 end from t1 where t1.e>a),17) then f else t1.b end from t1)),b)*13>e))} -} {-1} -do_test randexpr-2.597 { - db eval {SELECT 13-(select cast(avg(t1.c-13) AS integer) from t1) & 11+t1.b & coalesce((select max(case when b in (select case -case max(17) when ~cast(avg(13-t1.a) AS integer) then count(distinct 13) else - -((cast(avg(e) AS integer))) end when cast(avg(t1.c) AS integer) then count(distinct d) else count(*) end from t1 union select count(*) from t1) then case when t1.d<>~13 then b when t1.c<>13 then t1.a else a end else t1.a end) from t1 where t1.f<>( -(17))),t1.e)+c FROM t1 WHERE NOT ((~coalesce((select (11+t1.d) from t1 where 17 in (select f+a from t1 union select case when 11>coalesce((select -case when (11 not in (t1.f,(abs(t1.a)/abs((select count(distinct -case when 13<=e then c when d between (t1.d) and t1.d then a else 11 end) from t1)-f)),c)) then f when (t1.f>t1.d) then 17 else 13 end from t1 where t1.e>a),17) then f else t1.b end from t1)),b)*13>e))} -} {128} -do_test randexpr-2.598 { - db eval {SELECT f+coalesce((select case when ~case when coalesce((select max(b) from t1 where not exists(select 1 from t1 where 11*t1.b>case t1.b when 13 then 11 else b end)),t1.b) not in (a,b,+t1.e | case when t1.a<>17 then 17 else t1.e end) then c when (t1.e)<>d then 11 else f end*(e) not between d and e then 17 else 17 end from t1 where 13 not between 19 and f),t1.b)*11 FROM t1 WHERE not exists(select 1 from t1 where 11 between c and b and -case when 13 between -f | case when t1.b<+c then b when t1.f>13 then a else (d) end and d then t1.d when t1.a in (select 19 from t1 union select 11 from t1) or not exists(select 1 from t1 where exists(select 1 from t1 where not b=t1.b)) then -19 else t1.b end in (select max(17) from t1 union select count(distinct a)+count(distinct 11) from t1) and t1.fcase t1.b when 13 then 11 else b end)),t1.b) not in (a,b,+t1.e | case when t1.a<>17 then 17 else t1.e end) then c when (t1.e)<>d then 11 else f end*(e) not between d and e then 17 else 17 end from t1 where 13 not between 19 and f),t1.b)*11 FROM t1 WHERE NOT (not exists(select 1 from t1 where 11 between c and b and -case when 13 between -f | case when t1.b<+c then b when t1.f>13 then a else (d) end and d then t1.d when t1.a in (select 19 from t1 union select 11 from t1) or not exists(select 1 from t1 where exists(select 1 from t1 where not b=t1.b)) then -19 else t1.b end in (select max(17) from t1 union select count(distinct a)+count(distinct 11) from t1) and t1.fcase t1.b when 13 then 11 else b end)),t1.b) not in (a,b,+t1.e & case when t1.a<>17 then 17 else t1.e end) then c when (t1.e)<>d then 11 else f end*(e) not between d and e then 17 else 17 end from t1 where 13 not between 19 and f),t1.b)*11 FROM t1 WHERE NOT (not exists(select 1 from t1 where 11 between c and b and -case when 13 between -f | case when t1.b<+c then b when t1.f>13 then a else (d) end and d then t1.d when t1.a in (select 19 from t1 union select 11 from t1) or not exists(select 1 from t1 where exists(select 1 from t1 where not b=t1.b)) then -19 else t1.b end in (select max(17) from t1 union select count(distinct a)+count(distinct 11) from t1) and t1.f=t1.a-11),11))/abs(17))=t1.f and ((t1.f)=t1.e) then t1.a+t1.d when not exists(select 1 from t1 where -b>c) or t1.a>=11 then t1.e else e end*13*t1.f | d>=19),t1.b)+t1.a FROM t1 WHERE t1.e not in (t1.f+case when f-d not between coalesce((select max(d) from t1 where (coalesce((select max(17) from t1 where not 19 in (select cast(avg(c) AS integer)-~count(distinct f- -e)+cast(avg(19) AS integer) from t1 union select cast(avg(d) AS integer) from t1)),b) not in (13,t1.c,13))),17)+ -e+t1.f and -(t1.b) then (t1.d) when t1.b in (select min(a) from t1 union select min(17) from t1) then c else 11 end,c, -13)} -} {600} -do_test randexpr-2.602 { - db eval {SELECT coalesce((select max(e) from t1 where e*~t1.b*e+c*case when +(abs(coalesce((select max(t1.b) from t1 where t1.b>=t1.a-11),11))/abs(17))=t1.f and ((t1.f)=t1.e) then t1.a+t1.d when not exists(select 1 from t1 where -b>c) or t1.a>=11 then t1.e else e end*13*t1.f | d>=19),t1.b)+t1.a FROM t1 WHERE NOT (t1.e not in (t1.f+case when f-d not between coalesce((select max(d) from t1 where (coalesce((select max(17) from t1 where not 19 in (select cast(avg(c) AS integer)-~count(distinct f- -e)+cast(avg(19) AS integer) from t1 union select cast(avg(d) AS integer) from t1)),b) not in (13,t1.c,13))),17)+ -e+t1.f and -(t1.b) then (t1.d) when t1.b in (select min(a) from t1 union select min(17) from t1) then c else 11 end,c, -13))} -} {} -do_test randexpr-2.603 { - db eval {SELECT coalesce((select max(e) from t1 where e*~t1.b*e+c*case when +(abs(coalesce((select max(t1.b) from t1 where t1.b>=t1.a-11),11))/abs(17))=t1.f and ((t1.f)=t1.e) then t1.a+t1.d when not exists(select 1 from t1 where -b>c) or t1.a>=11 then t1.e else e end*13*t1.f & d>=19),t1.b)+t1.a FROM t1 WHERE t1.e not in (t1.f+case when f-d not between coalesce((select max(d) from t1 where (coalesce((select max(17) from t1 where not 19 in (select cast(avg(c) AS integer)-~count(distinct f- -e)+cast(avg(19) AS integer) from t1 union select cast(avg(d) AS integer) from t1)),b) not in (13,t1.c,13))),17)+ -e+t1.f and -(t1.b) then (t1.d) when t1.b in (select min(a) from t1 union select min(17) from t1) then c else 11 end,c, -13)} -} {600} -do_test randexpr-2.604 { - db eval {SELECT case when exists(select 1 from t1 where f in (select cast(avg(t1.c) AS integer) from t1 union select min(t1.b) from t1)) then c+d-d when (coalesce((select a from t1 where a<(select abs(count(*)) from t1)),(select count(distinct t1.e) | abs(+ -count(distinct t1.e)*min(t1.b) | count(distinct 11)) from t1))) not in (17,(abs(t1.d)/abs(coalesce((select max(t1.f) from t1 where t1.a*t1.f>=t1.c),t1.f))),t1.e) then t1.c else t1.e end-f FROM t1 WHERE 13*~~(abs(b)/abs(coalesce((select max(t1.a) from t1 where t1.e in ( -(13-17)-b+(e | (abs(t1.e)/abs(case when ~t1.d between t1.e and c and t1.b in (select t1.c from t1 union select b from t1) then 11+t1.b when a=t1.d then b else c end)))*17,t1.c, -17)),13)))-e+b-19>19} -} {} -do_test randexpr-2.605 { - db eval {SELECT case when exists(select 1 from t1 where f in (select cast(avg(t1.c) AS integer) from t1 union select min(t1.b) from t1)) then c+d-d when (coalesce((select a from t1 where a<(select abs(count(*)) from t1)),(select count(distinct t1.e) | abs(+ -count(distinct t1.e)*min(t1.b) | count(distinct 11)) from t1))) not in (17,(abs(t1.d)/abs(coalesce((select max(t1.f) from t1 where t1.a*t1.f>=t1.c),t1.f))),t1.e) then t1.c else t1.e end-f FROM t1 WHERE NOT (13*~~(abs(b)/abs(coalesce((select max(t1.a) from t1 where t1.e in ( -(13-17)-b+(e | (abs(t1.e)/abs(case when ~t1.d between t1.e and c and t1.b in (select t1.c from t1 union select b from t1) then 11+t1.b when a=t1.d then b else c end)))*17,t1.c, -17)),13)))-e+b-19>19)} -} {-300} -do_test randexpr-2.606 { - db eval {SELECT case when exists(select 1 from t1 where f in (select cast(avg(t1.c) AS integer) from t1 union select min(t1.b) from t1)) then c+d-d when (coalesce((select a from t1 where a<(select abs(count(*)) from t1)),(select count(distinct t1.e) & abs(+ -count(distinct t1.e)*min(t1.b) & count(distinct 11)) from t1))) not in (17,(abs(t1.d)/abs(coalesce((select max(t1.f) from t1 where t1.a*t1.f>=t1.c),t1.f))),t1.e) then t1.c else t1.e end-f FROM t1 WHERE NOT (13*~~(abs(b)/abs(coalesce((select max(t1.a) from t1 where t1.e in ( -(13-17)-b+(e | (abs(t1.e)/abs(case when ~t1.d between t1.e and c and t1.b in (select t1.c from t1 union select b from t1) then 11+t1.b when a=t1.d then b else c end)))*17,t1.c, -17)),13)))-e+b-19>19)} -} {-100} -do_test randexpr-2.607 { - db eval {SELECT case when t1.f=17 then t1.d-19-11*f*t1.a*t1.b-case (select +cast(avg(a) AS integer) from t1) when 19 then 17 else a end when t1.a between case t1.c when t1.c*t1.c then (d) else t1.c end and c then e else t1.a end FROM t1 WHERE not exists(select 1 from t1 where exists(select 1 from t1 where (abs(+f-( -~(select count(distinct ~a*e | (select max(f)*count(distinct t1.f) from t1)) | -max(17)+(count(*))+max(11)+count(distinct t1.e)- - -count(distinct f) from t1)+b*b-t1.c) | t1.e)/abs(17))*c*b in (17,19,t1.e)))} -} {-131999719} -do_test randexpr-2.608 { - db eval {SELECT case when t1.f=17 then t1.d-19-11*f*t1.a*t1.b-case (select +cast(avg(a) AS integer) from t1) when 19 then 17 else a end when t1.a between case t1.c when t1.c*t1.c then (d) else t1.c end and c then e else t1.a end FROM t1 WHERE NOT (not exists(select 1 from t1 where exists(select 1 from t1 where (abs(+f-( -~(select count(distinct ~a*e | (select max(f)*count(distinct t1.f) from t1)) | -max(17)+(count(*))+max(11)+count(distinct t1.e)- - -count(distinct f) from t1)+b*b-t1.c) | t1.e)/abs(17))*c*b in (17,19,t1.e))))} -} {} -do_test randexpr-2.609 { - db eval {SELECT f-~+17*(abs(t1.f)/abs(a*case when case when (case when d>=t1.b or t1.b>=11 then t1.c when t1.b>t1.d then t1.d else t1.a end+17) not in (11,t1.e,17) then c when (t1.b>=a and b>b) then t1.d else d end in (select +abs( -max(t1.e)) from t1 union select count(*) | max(17) from t1) then (t1.a) else a end+(t1.e)))*(11)-f | t1.a-f FROM t1 WHERE ((t1.d>=t1.c))} -} {-500} -do_test randexpr-2.610 { - db eval {SELECT f-~+17*(abs(t1.f)/abs(a*case when case when (case when d>=t1.b or t1.b>=11 then t1.c when t1.b>t1.d then t1.d else t1.a end+17) not in (11,t1.e,17) then c when (t1.b>=a and b>b) then t1.d else d end in (select +abs( -max(t1.e)) from t1 union select count(*) | max(17) from t1) then (t1.a) else a end+(t1.e)))*(11)-f | t1.a-f FROM t1 WHERE NOT (((t1.d>=t1.c)))} -} {} -do_test randexpr-2.611 { - db eval {SELECT f-~+17*(abs(t1.f)/abs(a*case when case when (case when d>=t1.b or t1.b>=11 then t1.c when t1.b>t1.d then t1.d else t1.a end+17) not in (11,t1.e,17) then c when (t1.b>=a and b>b) then t1.d else d end in (select +abs( -max(t1.e)) from t1 union select count(*) & max(17) from t1) then (t1.a) else a end+(t1.e)))*(11)-f & t1.a-f FROM t1 WHERE ((t1.d>=t1.c))} -} {0} -do_test randexpr-2.612 { - db eval {SELECT e+ -((abs(f)/abs(17))) | t1.e*11-coalesce((select max(f) from t1 where ((abs(~+t1.b-coalesce((select coalesce((select max(t1.d) from t1 where not exists(select 1 from t1 where ((f) not in (11,19,t1.b)))),11* -t1.b) from t1 where -a<=c),t1.f))/abs( -b)) between t1.c and e and not exists(select 1 from t1 where f not in ( -t1.f,19,t1.e)))),case t1.c when 19 then (11) else (t1.a) end) | (13) FROM t1 WHERE d<>13 or t1.c in (select count(distinct -c*11-( -e)-t1.e)-( -case +max(t1.c)-min((select +cast(avg(19*17) AS integer) from t1)* -t1.f)+~(~count(distinct f))+count(*)-cast(avg(t1.c) AS integer) when count(distinct t1.f) then count(distinct e) else -count(*) end-count(*)) from t1 union select count(distinct 11) from t1)} -} {5597} -do_test randexpr-2.613 { - db eval {SELECT e+ -((abs(f)/abs(17))) | t1.e*11-coalesce((select max(f) from t1 where ((abs(~+t1.b-coalesce((select coalesce((select max(t1.d) from t1 where not exists(select 1 from t1 where ((f) not in (11,19,t1.b)))),11* -t1.b) from t1 where -a<=c),t1.f))/abs( -b)) between t1.c and e and not exists(select 1 from t1 where f not in ( -t1.f,19,t1.e)))),case t1.c when 19 then (11) else (t1.a) end) | (13) FROM t1 WHERE NOT (d<>13 or t1.c in (select count(distinct -c*11-( -e)-t1.e)-( -case +max(t1.c)-min((select +cast(avg(19*17) AS integer) from t1)* -t1.f)+~(~count(distinct f))+count(*)-cast(avg(t1.c) AS integer) when count(distinct t1.f) then count(distinct e) else -count(*) end-count(*)) from t1 union select count(distinct 11) from t1))} -} {} -do_test randexpr-2.614 { - db eval {SELECT e+ -((abs(f)/abs(17))) & t1.e*11-coalesce((select max(f) from t1 where ((abs(~+t1.b-coalesce((select coalesce((select max(t1.d) from t1 where not exists(select 1 from t1 where ((f) not in (11,19,t1.b)))),11* -t1.b) from t1 where -a<=c),t1.f))/abs( -b)) between t1.c and e and not exists(select 1 from t1 where f not in ( -t1.f,19,t1.e)))),case t1.c when 19 then (11) else (t1.a) end) & (13) FROM t1 WHERE d<>13 or t1.c in (select count(distinct -c*11-( -e)-t1.e)-( -case +max(t1.c)-min((select +cast(avg(19*17) AS integer) from t1)* -t1.f)+~(~count(distinct f))+count(*)-cast(avg(t1.c) AS integer) when count(distinct t1.f) then count(distinct e) else -count(*) end-count(*)) from t1 union select count(distinct 11) from t1)} -} {0} -do_test randexpr-2.615 { - db eval {SELECT coalesce((select case t1.e when t1.d then -t1.b else b | t1.f end from t1 where case e when case 11 when t1.f then 13 else c end-19 then case -(select count(distinct 19+ - -d*t1.f+d) from t1)*(abs(c)/abs(coalesce((select max(e) from t1 where not t1.c>t1.d),(17-t1.a)))) when 11 then t1.f else t1.a end else a end<>t1.c),t1.e) FROM t1 WHERE (select case count(*)* -+abs(+count(*)+min(t1.d)) | max(+(17)) when ~count(*)*(count(*))-(count(distinct t1.b)) then count(distinct 11) else max(t1.e) end from t1)>=(abs(coalesce((select t1.b from t1 where (at1.d),(17-t1.a)))) when 11 then t1.f else t1.a end else a end<>t1.c),t1.e) FROM t1 WHERE NOT ((select case count(*)* -+abs(+count(*)+min(t1.d)) | max(+(17)) when ~count(*)*(count(*))-(count(distinct t1.b)) then count(distinct 11) else max(t1.e) end from t1)>=(abs(coalesce((select t1.b from t1 where (at1.d),(17-t1.a)))) when 11 then t1.f else t1.a end else a end<>t1.c),t1.e) FROM t1 WHERE (select case count(*)* -+abs(+count(*)+min(t1.d)) | max(+(17)) when ~count(*)*(count(*))-(count(distinct t1.b)) then count(distinct 11) else max(t1.e) end from t1)>=(abs(coalesce((select t1.b from t1 where (a(t1.c) then t1.d else t1.d end FROM t1 WHERE case when 17-t1.f in (select case -~max(c-~e+19)*max(c)*count(*)+~count(distinct f)+case count(distinct d) when max(t1.b) then cast(avg(t1.d) AS integer) else count(distinct d) end-count(distinct d)*max(f)+ -count(distinct 13) when count(*) then ( -min(t1.c)) else min(( -d)) end from t1 union select -min(c) from t1) then 13 else case t1.c when t1.c then f else d end end-e-(17) in (select c from t1 union select c from t1)} -} {} -do_test randexpr-2.619 { - db eval {SELECT case when 13<11 then 19 when -(abs(f)/abs(13))*17-13 | case t1.b when ~((select (count(*)-abs(case cast(avg(19) AS integer) when count(distinct 19)*(count(*))-count(*) then count(distinct t1.d) else -count(distinct 17) end)+max(17)) from t1)) then t1.c else d end+11*t1.e*t1.a | e>(t1.c) then t1.d else t1.d end FROM t1 WHERE NOT (case when 17-t1.f in (select case -~max(c-~e+19)*max(c)*count(*)+~count(distinct f)+case count(distinct d) when max(t1.b) then cast(avg(t1.d) AS integer) else count(distinct d) end-count(distinct d)*max(f)+ -count(distinct 13) when count(*) then ( -min(t1.c)) else min(( -d)) end from t1 union select -min(c) from t1) then 13 else case t1.c when t1.c then f else d end end-e-(17) in (select c from t1 union select c from t1))} -} {400} -do_test randexpr-2.620 { - db eval {SELECT case when 13<11 then 19 when -(abs(f)/abs(13))*17-13 & case t1.b when ~((select (count(*)-abs(case cast(avg(19) AS integer) when count(distinct 19)*(count(*))-count(*) then count(distinct t1.d) else -count(distinct 17) end)+max(17)) from t1)) then t1.c else d end+11*t1.e*t1.a & e>(t1.c) then t1.d else t1.d end FROM t1 WHERE NOT (case when 17-t1.f in (select case -~max(c-~e+19)*max(c)*count(*)+~count(distinct f)+case count(distinct d) when max(t1.b) then cast(avg(t1.d) AS integer) else count(distinct d) end-count(distinct d)*max(f)+ -count(distinct 13) when count(*) then ( -min(t1.c)) else min(( -d)) end from t1 union select -min(c) from t1) then 13 else case t1.c when t1.c then f else d end end-e-(17) in (select c from t1 union select c from t1))} -} {400} -do_test randexpr-2.621 { - db eval {SELECT coalesce((select case ~(case when -f between t1.e and f then coalesce((select max(t1.a-t1.d) from t1 where d=b),case when (f*11-a-t1.d-c>t1.e and b>=19) then -+d when t1.b>= -13 then 17 else t1.f end) else (19) end) when 11 then b else f end from t1 where -t1.e<=t1.d),a) FROM t1 WHERE (+coalesce((select max((abs(19*a-t1.b+t1.a*a)/abs(19))) from t1 where not t1.f in (select case -count(*)-cast(avg(c) AS integer)+cast(avg(e) AS integer)*count(*) when min(t1.d) then -(cast(avg(t1.f) AS integer)) else max(13) end+min(t1.d)+count(*) | count(*) | min(11) | count(distinct f) from t1 union select -count(*) from t1)),e))-t1.e*d | f in (t1.d,e,e)} -} {} -do_test randexpr-2.622 { - db eval {SELECT coalesce((select case ~(case when -f between t1.e and f then coalesce((select max(t1.a-t1.d) from t1 where d=b),case when (f*11-a-t1.d-c>t1.e and b>=19) then -+d when t1.b>= -13 then 17 else t1.f end) else (19) end) when 11 then b else f end from t1 where -t1.e<=t1.d),a) FROM t1 WHERE NOT ((+coalesce((select max((abs(19*a-t1.b+t1.a*a)/abs(19))) from t1 where not t1.f in (select case -count(*)-cast(avg(c) AS integer)+cast(avg(e) AS integer)*count(*) when min(t1.d) then -(cast(avg(t1.f) AS integer)) else max(13) end+min(t1.d)+count(*) | count(*) | min(11) | count(distinct f) from t1 union select -count(*) from t1)),e))-t1.e*d | f in (t1.d,e,e))} -} {600} -do_test randexpr-2.623 { - db eval {SELECT case d*t1.f when -t1.a then t1.c+(coalesce((select max(13+case when -t1.d*13*c*d | case t1.e when t1.e then t1.b+t1.d else (abs(t1.b)/abs(case when c>b or d in (t1.e,a,d) then d else e end))+f end=t1.f then a when t1.a<=19 then 17 else d end) from t1 where (t1.f>t1.b)),(f))) else f end+t1.a FROM t1 WHERE t1.f+case d when 19 then +t1.c else 19-(abs((t1.b)*~coalesce((select f from t1 where (case when +case when t1.d>13 then t1.e else (t1.a) end<13 then f when t1.c<=e then d else t1.a end*t1.d in (select +case ~min(b) when -max(13) then cast(avg( -(11)) AS integer) else -cast(avg(17) AS integer) end+count(distinct t1.a) from t1 union select min(t1.f) from t1))),t1.a))/abs(f)) end+(a) in (b,t1.c,t1.a)} -} {} -do_test randexpr-2.624 { - db eval {SELECT case d*t1.f when -t1.a then t1.c+(coalesce((select max(13+case when -t1.d*13*c*d | case t1.e when t1.e then t1.b+t1.d else (abs(t1.b)/abs(case when c>b or d in (t1.e,a,d) then d else e end))+f end=t1.f then a when t1.a<=19 then 17 else d end) from t1 where (t1.f>t1.b)),(f))) else f end+t1.a FROM t1 WHERE NOT (t1.f+case d when 19 then +t1.c else 19-(abs((t1.b)*~coalesce((select f from t1 where (case when +case when t1.d>13 then t1.e else (t1.a) end<13 then f when t1.c<=e then d else t1.a end*t1.d in (select +case ~min(b) when -max(13) then cast(avg( -(11)) AS integer) else -cast(avg(17) AS integer) end+count(distinct t1.a) from t1 union select min(t1.f) from t1))),t1.a))/abs(f)) end+(a) in (b,t1.c,t1.a))} -} {700} -do_test randexpr-2.625 { - db eval {SELECT case d*t1.f when -t1.a then t1.c+(coalesce((select max(13+case when -t1.d*13*c*d & case t1.e when t1.e then t1.b+t1.d else (abs(t1.b)/abs(case when c>b or d in (t1.e,a,d) then d else e end))+f end=t1.f then a when t1.a<=19 then 17 else d end) from t1 where (t1.f>t1.b)),(f))) else f end+t1.a FROM t1 WHERE NOT (t1.f+case d when 19 then +t1.c else 19-(abs((t1.b)*~coalesce((select f from t1 where (case when +case when t1.d>13 then t1.e else (t1.a) end<13 then f when t1.c<=e then d else t1.a end*t1.d in (select +case ~min(b) when -max(13) then cast(avg( -(11)) AS integer) else -cast(avg(17) AS integer) end+count(distinct t1.a) from t1 union select min(t1.f) from t1))),t1.a))/abs(f)) end+(a) in (b,t1.c,t1.a))} -} {700} -do_test randexpr-2.626 { - db eval {SELECT case case when (not exists(select 1 from t1 where -e in (select t1.c from t1 union select b from t1))) then coalesce((select max(t1.d) from t1 where (17+~t1.c in (select min(t1.b) from t1 union select min(13) from t1))),t1.d)*t1.a+d when not a=a and t1.b not in (b,13,d) or d<13 or t1.f not between t1.c and f or t1.c<>c then t1.e else t1.d end when t1.c then (t1.d) else -f end FROM t1 WHERE (abs(case when (t1.e in (17,19+t1.b,t1.a)) or (t1.d-19)+(t1.d)+t1.d in (select t1.f from t1 union select t1.e from t1) and 13 in (select t1.c from t1 union select c from t1) or 11 not between e and 17 then -17-a else d end*13)/abs((b)))*d-f-13 between t1.d and (b)} -} {} -do_test randexpr-2.627 { - db eval {SELECT case case when (not exists(select 1 from t1 where -e in (select t1.c from t1 union select b from t1))) then coalesce((select max(t1.d) from t1 where (17+~t1.c in (select min(t1.b) from t1 union select min(13) from t1))),t1.d)*t1.a+d when not a=a and t1.b not in (b,13,d) or d<13 or t1.f not between t1.c and f or t1.c<>c then t1.e else t1.d end when t1.c then (t1.d) else -f end FROM t1 WHERE NOT ((abs(case when (t1.e in (17,19+t1.b,t1.a)) or (t1.d-19)+(t1.d)+t1.d in (select t1.f from t1 union select t1.e from t1) and 13 in (select t1.c from t1 union select c from t1) or 11 not between e and 17 then -17-a else d end*13)/abs((b)))*d-f-13 between t1.d and (b))} -} {-600} -do_test randexpr-2.628 { - db eval {SELECT a+a+(f)-(t1.f+d+t1.e | case when case (13) when t1.c then case coalesce((select -t1.b-t1.f-13 from t1 where t1.f between t1.d and (a)),t1.b) when b then 13 else t1.f end-f else t1.d end>=e then 19 else t1.c end*t1.c)*f-(t1.d)-b FROM t1 WHERE (t1.b)=t1.a+t1.d-13 | +~f+13 | e+t1.c+coalesce((select t1.a+e from t1 where b in (select (~max(b-t1.b-coalesce((select ((a)) from t1 where e=d or b not between b and t1.e),t1.b)))++~case case count(*) when -max(t1.c) then min(b) else min(17) end when max( -t1.a) then (min(t1.f)) else max((a)) end*cast(avg(f) AS integer)+max(19) from t1 union select count(distinct f) from t1)),(t1.e)) | t1.b} -} {} -do_test randexpr-2.629 { - db eval {SELECT a+a+(f)-(t1.f+d+t1.e | case when case (13) when t1.c then case coalesce((select -t1.b-t1.f-13 from t1 where t1.f between t1.d and (a)),t1.b) when b then 13 else t1.f end-f else t1.d end>=e then 19 else t1.c end*t1.c)*f-(t1.d)-b FROM t1 WHERE NOT ((t1.b)=t1.a+t1.d-13 | +~f+13 | e+t1.c+coalesce((select t1.a+e from t1 where b in (select (~max(b-t1.b-coalesce((select ((a)) from t1 where e=d or b not between b and t1.e),t1.b)))++~case case count(*) when -max(t1.c) then min(b) else min(17) end when max( -t1.a) then (min(t1.f)) else max((a)) end*cast(avg(f) AS integer)+max(19) from t1 union select count(distinct f) from t1)),(t1.e)) | t1.b)} -} {-54045400} -do_test randexpr-2.630 { - db eval {SELECT a+a+(f)-(t1.f+d+t1.e & case when case (13) when t1.c then case coalesce((select -t1.b-t1.f-13 from t1 where t1.f between t1.d and (a)),t1.b) when b then 13 else t1.f end-f else t1.d end>=e then 19 else t1.c end*t1.c)*f-(t1.d)-b FROM t1 WHERE NOT ((t1.b)=t1.a+t1.d-13 | +~f+13 | e+t1.c+coalesce((select t1.a+e from t1 where b in (select (~max(b-t1.b-coalesce((select ((a)) from t1 where e=d or b not between b and t1.e),t1.b)))++~case case count(*) when -max(t1.c) then min(b) else min(17) end when max( -t1.a) then (min(t1.f)) else max((a)) end*cast(avg(f) AS integer)+max(19) from t1 union select count(distinct f) from t1)),(t1.e)) | t1.b)} -} {-854200} -do_test randexpr-2.631 { - db eval {SELECT 19-e+t1.d | 19-(abs(11)/abs(t1.b-(select case cast(avg(t1.f) AS integer)-count(*)-count(distinct t1.c)-abs(count(*))-(cast(avg(case when 11b),t1.d) else ~11 end+t1.b,11,19) then t1.a else -t1.d-case d*a when t1.d then t1.e else 13 end end+e+b>19 then t1.a else t1.f end not between t1.d and e} -} {-1} -do_test randexpr-2.632 { - db eval {SELECT 19-e+t1.d | 19-(abs(11)/abs(t1.b-(select case cast(avg(t1.f) AS integer)-count(*)-count(distinct t1.c)-abs(count(*))-(cast(avg(case when 11b),t1.d) else ~11 end+t1.b,11,19) then t1.a else -t1.d-case d*a when t1.d then t1.e else 13 end end+e+b>19 then t1.a else t1.f end not between t1.d and e)} -} {} -do_test randexpr-2.633 { - db eval {SELECT 19-e+t1.d & 19-(abs(11)/abs(t1.b-(select case cast(avg(t1.f) AS integer)-count(*)-count(distinct t1.c)-abs(count(*))-(cast(avg(case when 11b),t1.d) else ~11 end+t1.b,11,19) then t1.a else -t1.d-case d*a when t1.d then t1.e else 13 end end+e+b>19 then t1.a else t1.f end not between t1.d and e} -} {-348} -do_test randexpr-2.634 { - db eval {SELECT (select abs(abs(~ -min(case t1.a-d when (abs(f)/abs(f+t1.b)) then ~e-11-+ -13*t1.a else 13 end)-count(*)*case + -count(*) when (count(distinct t1.e)) then max(t1.f) else (count(*)* - -+count(*) | min(17)) end+(cast(avg(t1.f) AS integer))+min(d))) from t1) FROM t1 WHERE not t1.f>=t1.a or not exists(select 1 from t1 where 19=17) and 13 in (select abs(count(*) | ((count(*)))) from t1 union select count(distinct -t1.c | t1.a) | abs(abs(min(d+c))) from t1)} -} {} -do_test randexpr-2.635 { - db eval {SELECT (select abs(abs(~ -min(case t1.a-d when (abs(f)/abs(f+t1.b)) then ~e-11-+ -13*t1.a else 13 end)-count(*)*case + -count(*) when (count(distinct t1.e)) then max(t1.f) else (count(*)* - -+count(*) | min(17)) end+(cast(avg(t1.f) AS integer))+min(d))) from t1) FROM t1 WHERE NOT (not t1.f>=t1.a or not exists(select 1 from t1 where 19=17) and 13 in (select abs(count(*) | ((count(*)))) from t1 union select count(distinct -t1.c | t1.a) | abs(abs(min(d+c))) from t1))} -} {995} -do_test randexpr-2.636 { - db eval {SELECT (select abs(abs(~ -min(case t1.a-d when (abs(f)/abs(f+t1.b)) then ~e-11-+ -13*t1.a else 13 end)-count(*)*case + -count(*) when (count(distinct t1.e)) then max(t1.f) else (count(*)* - -+count(*) & min(17)) end+(cast(avg(t1.f) AS integer))+min(d))) from t1) FROM t1 WHERE NOT (not t1.f>=t1.a or not exists(select 1 from t1 where 19=17) and 13 in (select abs(count(*) | ((count(*)))) from t1 union select count(distinct -t1.c | t1.a) | abs(abs(min(d+c))) from t1))} -} {1011} -do_test randexpr-2.637 { - db eval {SELECT (case when not exists(select 1 from t1 where ((not t1.f in (b,17-d,t1.a) and f=t1.a))} -} {} -do_test randexpr-2.638 { - db eval {SELECT (case when not exists(select 1 from t1 where ((not t1.f in (b,17-d,t1.a) and f=t1.a)))} -} {-12} -do_test randexpr-2.639 { - db eval {SELECT (case when not exists(select 1 from t1 where ((not t1.f in (b,17-d,t1.a) and f=t1.a)))} -} {6212} -do_test randexpr-2.640 { - db eval {SELECT coalesce((select t1.a from t1 where case when +(abs(e)/abs(19))+(abs(coalesce((select max(b) from t1 where 19 not in (f,(c),11) or -c not in (t1.f,e,d)),13)*e+t1.f)/abs((d)))<>t1.b then t1.e when t1.d not in (t1.f,17,t1.b) or t1.f not between t1.d and 13 then t1.a else t1.e end>e or not exists(select 1 from t1 where a>=e or not exists(select 1 from t1 where d<>t1.b))),f)+19 FROM t1 WHERE 13 in (case when (select +max( -t1.b+a*case when not 13*13t1.f and ~e>= -t1.b then t1.c when 11 not between t1.d and e and (dt1.b then t1.e when t1.d not in (t1.f,17,t1.b) or t1.f not between t1.d and 13 then t1.a else t1.e end>e or not exists(select 1 from t1 where a>=e or not exists(select 1 from t1 where d<>t1.b))),f)+19 FROM t1 WHERE NOT (13 in (case when (select +max( -t1.b+a*case when not 13*13t1.f and ~e>= -t1.b then t1.c when 11 not between t1.d and e and (d+(t1.e*(d))-t1.d then t1.f else 11 end,17,f)),e) | 19-13=t1.b) then (select max(11)-(count(distinct f)) from t1) else t1.a end+c in (t1.d,e,f) or e in (11,11,11)))),b)*t1.b*11))) and t1.b>=a} -} {} -do_test randexpr-2.643 { - db eval {SELECT +coalesce((select case when coalesce((select f+t1.e from t1 where b not in (case when not exists(select 1 from t1 where (f not in (t1.f-t1.b,t1.d,t1.d))) then t1.a when t1.f*t1.c*17>+(t1.e*(d))-t1.d then t1.f else 11 end,17,f)),e) | 19-13=t1.b) then (select max(11)-(count(distinct f)) from t1) else t1.a end+c in (t1.d,e,f) or e in (11,11,11)))),b)*t1.b*11))) and t1.b>=a)} -} {19} -do_test randexpr-2.644 { - db eval {SELECT +coalesce((select case when coalesce((select f+t1.e from t1 where b not in (case when not exists(select 1 from t1 where (f not in (t1.f-t1.b,t1.d,t1.d))) then t1.a when t1.f*t1.c*17>+(t1.e*(d))-t1.d then t1.f else 11 end,17,f)),e) & 19-13=t1.b) then (select max(11)-(count(distinct f)) from t1) else t1.a end+c in (t1.d,e,f) or e in (11,11,11)))),b)*t1.b*11))) and t1.b>=a)} -} {19} -do_test randexpr-2.645 { - db eval {SELECT (case when case 19 when b then 13 else t1.e end in (select (c) from t1 union select a from t1) then 11 else (d*coalesce((select t1.b from t1 where 19 | (t1.c)+case when -17>t1.a then t1.a when (19>=13) then t1.a else t1.e end=f and (e)>a or 11 in (select e from t1 union select t1.b from t1)),t1.d*t1.e))+c+a end) FROM t1 WHERE case case when case when not (abs(t1.d | f)/abs(a)) in (d,a,t1.c) then -d when (not exists(select 1 from t1 where f>=c)) then t1.a else e end+t1.d not in (t1.b,(t1.f),11) or not exists(select 1 from t1 where not exists(select 1 from t1 where t1.b in (19,t1.c,13))) then b+t1.c when t1.d>=t1.a then t1.c else (c) end when (13) then t1.e else b end in (t1.a,t1.b,13)} -} {80000400} -do_test randexpr-2.646 { - db eval {SELECT (case when case 19 when b then 13 else t1.e end in (select (c) from t1 union select a from t1) then 11 else (d*coalesce((select t1.b from t1 where 19 | (t1.c)+case when -17>t1.a then t1.a when (19>=13) then t1.a else t1.e end=f and (e)>a or 11 in (select e from t1 union select t1.b from t1)),t1.d*t1.e))+c+a end) FROM t1 WHERE NOT (case case when case when not (abs(t1.d | f)/abs(a)) in (d,a,t1.c) then -d when (not exists(select 1 from t1 where f>=c)) then t1.a else e end+t1.d not in (t1.b,(t1.f),11) or not exists(select 1 from t1 where not exists(select 1 from t1 where t1.b in (19,t1.c,13))) then b+t1.c when t1.d>=t1.a then t1.c else (c) end when (13) then t1.e else b end in (t1.a,t1.b,13))} -} {} -do_test randexpr-2.647 { - db eval {SELECT (case when case 19 when b then 13 else t1.e end in (select (c) from t1 union select a from t1) then 11 else (d*coalesce((select t1.b from t1 where 19 & (t1.c)+case when -17>t1.a then t1.a when (19>=13) then t1.a else t1.e end=f and (e)>a or 11 in (select e from t1 union select t1.b from t1)),t1.d*t1.e))+c+a end) FROM t1 WHERE case case when case when not (abs(t1.d | f)/abs(a)) in (d,a,t1.c) then -d when (not exists(select 1 from t1 where f>=c)) then t1.a else e end+t1.d not in (t1.b,(t1.f),11) or not exists(select 1 from t1 where not exists(select 1 from t1 where t1.b in (19,t1.c,13))) then b+t1.c when t1.d>=t1.a then t1.c else (c) end when (13) then t1.e else b end in (t1.a,t1.b,13)} -} {80000400} -do_test randexpr-2.648 { - db eval {SELECT case when 19<=19 then d when not exists(select 1 from t1 where case case when case when (select -min(((t1.f)))*((cast(avg(t1.d) AS integer))) from t1) in (select t1.a-b from t1 union select 17 from t1) then f when (19 not between t1.c and 13 and f>13) then d else a end | b-t1.b in (t1.e,t1.f, -d) then t1.e when c=17) then t1.e else t1.e end FROM t1 WHERE coalesce((select +a- -t1.d*b*coalesce((select t1.c from t1 where t1.a in (select (abs(11)/abs(case when not exists(select 1 from t1 where +e=t1.e) then case t1.b when a-c then b else b end when (not exists(select 1 from t1 where 19 in (select 13 from t1 union select t1.b from t1))) and e in (t1.e, -f,e) then 19 else t1.a end)) from t1 union select b from t1)),17)*d from t1 where t1.f not in (t1.a,(t1.b),t1.d)),13)<=(13)} -} {} -do_test randexpr-2.649 { - db eval {SELECT case when 19<=19 then d when not exists(select 1 from t1 where case case when case when (select -min(((t1.f)))*((cast(avg(t1.d) AS integer))) from t1) in (select t1.a-b from t1 union select 17 from t1) then f when (19 not between t1.c and 13 and f>13) then d else a end | b-t1.b in (t1.e,t1.f, -d) then t1.e when c=17) then t1.e else t1.e end FROM t1 WHERE NOT (coalesce((select +a- -t1.d*b*coalesce((select t1.c from t1 where t1.a in (select (abs(11)/abs(case when not exists(select 1 from t1 where +e=t1.e) then case t1.b when a-c then b else b end when (not exists(select 1 from t1 where 19 in (select 13 from t1 union select t1.b from t1))) and e in (t1.e, -f,e) then 19 else t1.a end)) from t1 union select b from t1)),17)*d from t1 where t1.f not in (t1.a,(t1.b),t1.d)),13)<=(13))} -} {400} -do_test randexpr-2.650 { - db eval {SELECT case when 19<=19 then d when not exists(select 1 from t1 where case case when case when (select -min(((t1.f)))*((cast(avg(t1.d) AS integer))) from t1) in (select t1.a-b from t1 union select 17 from t1) then f when (19 not between t1.c and 13 and f>13) then d else a end & b-t1.b in (t1.e,t1.f, -d) then t1.e when c=17) then t1.e else t1.e end FROM t1 WHERE NOT (coalesce((select +a- -t1.d*b*coalesce((select t1.c from t1 where t1.a in (select (abs(11)/abs(case when not exists(select 1 from t1 where +e=t1.e) then case t1.b when a-c then b else b end when (not exists(select 1 from t1 where 19 in (select 13 from t1 union select t1.b from t1))) and e in (t1.e, -f,e) then 19 else t1.a end)) from t1 union select b from t1)),17)*d from t1 where t1.f not in (t1.a,(t1.b),t1.d)),13)<=(13))} -} {400} -do_test randexpr-2.651 { - db eval {SELECT case when c<=t1.b*e+case when not exists(select 1 from t1 where a+ -t1.f= -t1.e*(17)+f and 19 in (select -13 from t1 union select t1.f from t1) and 19>=t1.a or -11 in (select a from t1 union select 17 from t1)) then t1.f else 19 end+t1.d or ((c))<>a then t1.f-t1.c when c not between ((t1.b)) and f then a else d end FROM t1 WHERE coalesce((select t1.e from t1 where t1.c in (t1.a,f,coalesce((select max( -f) from t1 where t1.f=(abs(13)/abs(~19+(abs((select count(distinct t1.f) from t1))/abs(coalesce((select 13 from t1 where d | 17*c*a*b+d<>t1.a),b)-(b)))))),b)),19))),t1.e)*c<>t1.e} -} {300} -do_test randexpr-2.652 { - db eval {SELECT case when c<=t1.b*e+case when not exists(select 1 from t1 where a+ -t1.f= -t1.e*(17)+f and 19 in (select -13 from t1 union select t1.f from t1) and 19>=t1.a or -11 in (select a from t1 union select 17 from t1)) then t1.f else 19 end+t1.d or ((c))<>a then t1.f-t1.c when c not between ((t1.b)) and f then a else d end FROM t1 WHERE NOT (coalesce((select t1.e from t1 where t1.c in (t1.a,f,coalesce((select max( -f) from t1 where t1.f=(abs(13)/abs(~19+(abs((select count(distinct t1.f) from t1))/abs(coalesce((select 13 from t1 where d | 17*c*a*b+d<>t1.a),b)-(b)))))),b)),19))),t1.e)*c<>t1.e)} -} {} -do_test randexpr-2.653 { - db eval {SELECT case when t1.c>=13 or d in (select case ((case min(t1.f)+min(f) when max( -11) then min(19) else cast(avg( -t1.d) AS integer) end | count(*))) when count(distinct 13) then -cast(avg( -t1.e) AS integer) else min(e) end from t1 union select max( -a) from t1) then case when +c-11+(t1.d)13 then d when not exists(select 1 from t1 where t1.c in (f,t1.b,t1.b)) then a else 19 end*t1.c and t1.d>=19)} -} {600} -do_test randexpr-2.654 { - db eval {SELECT case when t1.c>=13 or d in (select case ((case min(t1.f)+min(f) when max( -11) then min(19) else cast(avg( -t1.d) AS integer) end | count(*))) when count(distinct 13) then -cast(avg( -t1.e) AS integer) else min(e) end from t1 union select max( -a) from t1) then case when +c-11+(t1.d)13 then d when not exists(select 1 from t1 where t1.c in (f,t1.b,t1.b)) then a else 19 end*t1.c and t1.d>=19))} -} {} -do_test randexpr-2.655 { - db eval {SELECT case when t1.c>=13 or d in (select case ((case min(t1.f)+min(f) when max( -11) then min(19) else cast(avg( -t1.d) AS integer) end & count(*))) when count(distinct 13) then -cast(avg( -t1.e) AS integer) else min(e) end from t1 union select max( -a) from t1) then case when +c-11+(t1.d)13 then d when not exists(select 1 from t1 where t1.c in (f,t1.b,t1.b)) then a else 19 end*t1.c and t1.d>=19)} -} {600} -do_test randexpr-2.656 { - db eval {SELECT t1.a+(e*a)*t1.d+(abs(d)/abs(case when case f when t1.a then t1.f else d end*t1.f*t1.e*c*17+coalesce((select t1.d from t1 where c<=~t1.f | 13),e)*t1.a=t1.d then t1.d when (t1.b)<>17 or t1.b<=t1.c then a else (e) end in (select min(t1.e) from t1 union select abs( -max((17))) from t1) then c when 19<>17 then 13 else -d end>t1.d))) then 17 when t1.a<=13 then coalesce((select (17) | t1.c from t1 where t1.e>d),b) else 13 end in (select min(f) from t1 union select count(*) from t1) then 19 else t1.f end)) then t1.f else f end FROM t1 WHERE coalesce((select max(11 | e+case c*t1.b+13 when 19 | ~t1.f+case when d>11 then t1.f-(case t1.d when a then 19+t1.f else t1.b end) else d-case e when c+t1.a then 13 else case when not exists(select 1 from t1 where (t1.d)<>17) then d when b in ( -f,11,17) then 11 else t1.f end end end+d then e else t1.a end) from t1 where t1.a>= -11),b)>t1.c} -} {600} -do_test randexpr-2.660 { - db eval {SELECT case f when (abs(t1.f)/abs(case when d+case when exists(select 1 from t1 where exists(select 1 from t1 where exists(select 1 from t1 where case when not case when +11>=t1.d then t1.d when (t1.b)<>17 or t1.b<=t1.c then a else (e) end in (select min(t1.e) from t1 union select abs( -max((17))) from t1) then c when 19<>17 then 13 else -d end>t1.d))) then 17 when t1.a<=13 then coalesce((select (17) | t1.c from t1 where t1.e>d),b) else 13 end in (select min(f) from t1 union select count(*) from t1) then 19 else t1.f end)) then t1.f else f end FROM t1 WHERE NOT (coalesce((select max(11 | e+case c*t1.b+13 when 19 | ~t1.f+case when d>11 then t1.f-(case t1.d when a then 19+t1.f else t1.b end) else d-case e when c+t1.a then 13 else case when not exists(select 1 from t1 where (t1.d)<>17) then d when b in ( -f,11,17) then 11 else t1.f end end end+d then e else t1.a end) from t1 where t1.a>= -11),b)>t1.c)} -} {} -do_test randexpr-2.661 { - db eval {SELECT case f when (abs(t1.f)/abs(case when d+case when exists(select 1 from t1 where exists(select 1 from t1 where exists(select 1 from t1 where case when not case when +11>=t1.d then t1.d when (t1.b)<>17 or t1.b<=t1.c then a else (e) end in (select min(t1.e) from t1 union select abs( -max((17))) from t1) then c when 19<>17 then 13 else -d end>t1.d))) then 17 when t1.a<=13 then coalesce((select (17) & t1.c from t1 where t1.e>d),b) else 13 end in (select min(f) from t1 union select count(*) from t1) then 19 else t1.f end)) then t1.f else f end FROM t1 WHERE coalesce((select max(11 | e+case c*t1.b+13 when 19 | ~t1.f+case when d>11 then t1.f-(case t1.d when a then 19+t1.f else t1.b end) else d-case e when c+t1.a then 13 else case when not exists(select 1 from t1 where (t1.d)<>17) then d when b in ( -f,11,17) then 11 else t1.f end end end+d then e else t1.a end) from t1 where t1.a>= -11),b)>t1.c} -} {600} -do_test randexpr-2.662 { - db eval {SELECT (select abs(case max(t1.b)-(min(17))* -count(distinct case when case t1.f when t1.b then case e when c then t1.c else c end else t1.b end>=t1.e then d else e end) | ~+count(distinct t1.c)-(abs( -count(*))- -max(c)) | count(distinct t1.c) when count(distinct ( -t1.c)) then count(*) else max(t1.b) end* -count(*))-cast(avg( -11) AS integer)*min(19)+max(e) from t1) FROM t1 WHERE t1.a+t1.a>13} -} {909} -do_test randexpr-2.663 { - db eval {SELECT (select abs(case max(t1.b)-(min(17))* -count(distinct case when case t1.f when t1.b then case e when c then t1.c else c end else t1.b end>=t1.e then d else e end) | ~+count(distinct t1.c)-(abs( -count(*))- -max(c)) | count(distinct t1.c) when count(distinct ( -t1.c)) then count(*) else max(t1.b) end* -count(*))-cast(avg( -11) AS integer)*min(19)+max(e) from t1) FROM t1 WHERE NOT (t1.a+t1.a>13)} -} {} -do_test randexpr-2.664 { - db eval {SELECT (select abs(case max(t1.b)-(min(17))* -count(distinct case when case t1.f when t1.b then case e when c then t1.c else c end else t1.b end>=t1.e then d else e end) & ~+count(distinct t1.c)-(abs( -count(*))- -max(c)) & count(distinct t1.c) when count(distinct ( -t1.c)) then count(*) else max(t1.b) end* -count(*))-cast(avg( -11) AS integer)*min(19)+max(e) from t1) FROM t1 WHERE t1.a+t1.a>13} -} {710} -do_test randexpr-2.665 { - db eval {SELECT (t1.d- -c+e-f++case when a between case f when case when ~~~11-coalesce((select b from t1 where coalesce((select max(e) from t1 where not t1.d>= -11),a)+a between 11 and t1.a), -d)*17-a-13 | 13>=17 then a else 11 end then t1.a else t1.d end and t1.f then 19 else t1.a end) FROM t1 WHERE t1.f<> -13} -} {700} -do_test randexpr-2.666 { - db eval {SELECT (t1.d- -c+e-f++case when a between case f when case when ~~~11-coalesce((select b from t1 where coalesce((select max(e) from t1 where not t1.d>= -11),a)+a between 11 and t1.a), -d)*17-a-13 | 13>=17 then a else 11 end then t1.a else t1.d end and t1.f then 19 else t1.a end) FROM t1 WHERE NOT (t1.f<> -13)} -} {} -do_test randexpr-2.667 { - db eval {SELECT (t1.d- -c+e-f++case when a between case f when case when ~~~11-coalesce((select b from t1 where coalesce((select max(e) from t1 where not t1.d>= -11),a)+a between 11 and t1.a), -d)*17-a-13 & 13>=17 then a else 11 end then t1.a else t1.d end and t1.f then 19 else t1.a end) FROM t1 WHERE t1.f<> -13} -} {700} -do_test randexpr-2.668 { - db eval {SELECT (abs(case when (c<=b+t1.b) then -11+t1.a-d when b*(select count(distinct e)*+max(~t1.a*case when (select count(*)*+min(t1.b)+max(t1.a) from t1) in (c,t1.d,t1.d) then (select -(count(*)) from t1) else e end) from t1)<=a-11 then 11 else t1.e end)/abs(t1.e))+c FROM t1 WHERE a<+coalesce((select t1.f from t1 where exists(select 1 from t1 where ~case when (e not between t1.a-~case d when b then -c else 13 end and d) then 11 else a end+17-f-a*19*t1.f not in (f, -t1.d,11))),c)-t1.f and (t1.d<17) and t1.f=c or f<= -e} -} {} -do_test randexpr-2.669 { - db eval {SELECT (abs(case when (c<=b+t1.b) then -11+t1.a-d when b*(select count(distinct e)*+max(~t1.a*case when (select count(*)*+min(t1.b)+max(t1.a) from t1) in (c,t1.d,t1.d) then (select -(count(*)) from t1) else e end) from t1)<=a-11 then 11 else t1.e end)/abs(t1.e))+c FROM t1 WHERE NOT (a<+coalesce((select t1.f from t1 where exists(select 1 from t1 where ~case when (e not between t1.a-~case d when b then -c else 13 end and d) then 11 else a end+17-f-a*19*t1.f not in (f, -t1.d,11))),c)-t1.f and (t1.d<17) and t1.f=c or f<= -e)} -} {300} -do_test randexpr-2.670 { - db eval {SELECT case when case when c in (select abs((max(d*case t1.b when t1.b+t1.f then d else b end+d))- - -~count(*)*cast(avg(t1.b) AS integer)-min(d)*cast(avg(b) AS integer)*count(*)) from t1 union select -count(distinct t1.f) from t1) then case when 17 between t1.f and 11 then c else d end when t1.c>=13 then a else a end<=c then t1.d else 13 end+e FROM t1 WHERE t1.f between -11 and b} -} {} -do_test randexpr-2.671 { - db eval {SELECT case when case when c in (select abs((max(d*case t1.b when t1.b+t1.f then d else b end+d))- - -~count(*)*cast(avg(t1.b) AS integer)-min(d)*cast(avg(b) AS integer)*count(*)) from t1 union select -count(distinct t1.f) from t1) then case when 17 between t1.f and 11 then c else d end when t1.c>=13 then a else a end<=c then t1.d else 13 end+e FROM t1 WHERE NOT (t1.f between -11 and b)} -} {900} -do_test randexpr-2.672 { - db eval {SELECT b*~~t1.b*(a-t1.c+t1.b)+13-+~case t1.b when d then case 17*13 when t1.e then case when case when t1.c<>~(11) then t1.e else coalesce((select max( -c) from t1 where (f<>e)),t1.f) end<=a then (t1.c) else t1.c end else -f end else 13 end*t1.e-t1.f | 13 FROM t1 WHERE b between (d) and t1.c*(abs(t1.c-13 | t1.d+t1.a)/abs(13))} -} {} -do_test randexpr-2.673 { - db eval {SELECT b*~~t1.b*(a-t1.c+t1.b)+13-+~case t1.b when d then case 17*13 when t1.e then case when case when t1.c<>~(11) then t1.e else coalesce((select max( -c) from t1 where (f<>e)),t1.f) end<=a then (t1.c) else t1.c end else -f end else 13 end*t1.e-t1.f | 13 FROM t1 WHERE NOT (b between (d) and t1.c*(abs(t1.c-13 | t1.d+t1.a)/abs(13)))} -} {6413} -do_test randexpr-2.674 { - db eval {SELECT b*~~t1.b*(a-t1.c+t1.b)+13-+~case t1.b when d then case 17*13 when t1.e then case when case when t1.c<>~(11) then t1.e else coalesce((select max( -c) from t1 where (f<>e)),t1.f) end<=a then (t1.c) else t1.c end else -f end else 13 end*t1.e-t1.f & 13 FROM t1 WHERE NOT (b between (d) and t1.c*(abs(t1.c-13 | t1.d+t1.a)/abs(13)))} -} {13} -do_test randexpr-2.675 { - db eval {SELECT case when t1.b in (select case 13 when 13 | t1.e then case +(select (min((e)))-case count(*) | max(t1.b*d+17+e) when abs(count(distinct (11))*count(*)-cast(avg(a) AS integer) | max( -t1.a)) then (count(distinct 13)) else -(cast(avg(t1.b) AS integer)) end from t1) when (select count(distinct e) from t1) then t1.e else a+(t1.b) end-d-t1.d else t1.e end from t1 union select (f) from t1) then t1.b else (b) end FROM t1 WHERE b in (select a from t1 union select 11+t1.e from t1)} -} {} -do_test randexpr-2.676 { - db eval {SELECT case when t1.b in (select case 13 when 13 | t1.e then case +(select (min((e)))-case count(*) | max(t1.b*d+17+e) when abs(count(distinct (11))*count(*)-cast(avg(a) AS integer) | max( -t1.a)) then (count(distinct 13)) else -(cast(avg(t1.b) AS integer)) end from t1) when (select count(distinct e) from t1) then t1.e else a+(t1.b) end-d-t1.d else t1.e end from t1 union select (f) from t1) then t1.b else (b) end FROM t1 WHERE NOT (b in (select a from t1 union select 11+t1.e from t1))} -} {200} -do_test randexpr-2.677 { - db eval {SELECT case when t1.b in (select case 13 when 13 & t1.e then case +(select (min((e)))-case count(*) & max(t1.b*d+17+e) when abs(count(distinct (11))*count(*)-cast(avg(a) AS integer) & max( -t1.a)) then (count(distinct 13)) else -(cast(avg(t1.b) AS integer)) end from t1) when (select count(distinct e) from t1) then t1.e else a+(t1.b) end-d-t1.d else t1.e end from t1 union select (f) from t1) then t1.b else (b) end FROM t1 WHERE NOT (b in (select a from t1 union select 11+t1.e from t1))} -} {200} -do_test randexpr-2.678 { - db eval {SELECT coalesce((select 17 from t1 where d between 17 and 13),case when t1.f in (select c+a from t1 union select a from t1) and (abs(f)/abs(t1.b))-t1.e>=case when not exists(select 1 from t1 where t1.e>(select count(distinct t1.f) from t1)) then t1.f when (11)-~t1.fe),b)) from t1 where (t1.f) in (13,e,t1.c) or t1.c>13),t1.b))/abs(13)) then t1.b else d end)/abs(13)) in (t1.f,t1.e,t1.a) or 17 between 13 and f or (f>11 and t1.f=t1.e} -} {} -do_test randexpr-2.679 { - db eval {SELECT coalesce((select 17 from t1 where d between 17 and 13),case when t1.f in (select c+a from t1 union select a from t1) and (abs(f)/abs(t1.b))-t1.e>=case when not exists(select 1 from t1 where t1.e>(select count(distinct t1.f) from t1)) then t1.f when (11)-~t1.fe),b)) from t1 where (t1.f) in (13,e,t1.c) or t1.c>13),t1.b))/abs(13)) then t1.b else d end)/abs(13)) in (t1.f,t1.e,t1.a) or 17 between 13 and f or (f>11 and t1.f=t1.e)} -} {200} -do_test randexpr-2.680 { - db eval {SELECT (select min(19-case 19 when -t1.a+13 then coalesce((select c from t1 where (abs(13)/abs(11))>=coalesce((select f+b*+t1.c from t1 where t1.c=+11+t1.e),11) or (e in (a,a,13) and t1.a=f or t1.a=t1.e),t1.f)*t1.a+t1.f)*19)) end*f-t1.f in (select d from t1 union select t1.c from t1) and b in (t1.f,t1.d,c)} -} {} -do_test randexpr-2.681 { - db eval {SELECT (select min(19-case 19 when -t1.a+13 then coalesce((select c from t1 where (abs(13)/abs(11))>=coalesce((select f+b*+t1.c from t1 where t1.c=+11+t1.e),11) or (e in (a,a,13) and t1.a=f or t1.a=t1.e),t1.f)*t1.a+t1.f)*19)) end*f-t1.f in (select d from t1 union select t1.c from t1) and b in (t1.f,t1.d,c))} -} {-165} -do_test randexpr-2.682 { - db eval {SELECT (select min(19-case 19 when -t1.a+13 then coalesce((select c from t1 where (abs(13)/abs(11))>=coalesce((select f+b*+t1.c from t1 where t1.c=+11+t1.e),11) or (e in (a,a,13) and t1.a=f or t1.a=t1.e),t1.f)*t1.a+t1.f)*19)) end*f-t1.f in (select d from t1 union select t1.c from t1) and b in (t1.f,t1.d,c))} -} {584} -do_test randexpr-2.683 { - db eval {SELECT ~case when exists(select 1 from t1 where t1.c not between case case ~t1.b*19 when b then t1.c*t1.e else t1.d end when c then case ++13 when case when a+d+~~11 not between e and -19 then 19 else b end then t1.d else 19 end else t1.a end and d) then 19 when c in (select abs(count(distinct 17)) from t1 union select max(t1.b) from t1) then (d) else t1.e end | 19 FROM t1 WHERE t1.d between 11 and ~19-coalesce((select d from t1 where (d>=c)),t1.d)*+t1.e+t1.e} -} {} -do_test randexpr-2.684 { - db eval {SELECT ~case when exists(select 1 from t1 where t1.c not between case case ~t1.b*19 when b then t1.c*t1.e else t1.d end when c then case ++13 when case when a+d+~~11 not between e and -19 then 19 else b end then t1.d else 19 end else t1.a end and d) then 19 when c in (select abs(count(distinct 17)) from t1 union select max(t1.b) from t1) then (d) else t1.e end | 19 FROM t1 WHERE NOT (t1.d between 11 and ~19-coalesce((select d from t1 where (d>=c)),t1.d)*+t1.e+t1.e)} -} {-485} -do_test randexpr-2.685 { - db eval {SELECT ~case when exists(select 1 from t1 where t1.c not between case case ~t1.b*19 when b then t1.c*t1.e else t1.d end when c then case ++13 when case when a+d+~~11 not between e and -19 then 19 else b end then t1.d else 19 end else t1.a end and d) then 19 when c in (select abs(count(distinct 17)) from t1 union select max(t1.b) from t1) then (d) else t1.e end & 19 FROM t1 WHERE NOT (t1.d between 11 and ~19-coalesce((select d from t1 where (d>=c)),t1.d)*+t1.e+t1.e)} -} {3} -do_test randexpr-2.686 { - db eval {SELECT +t1.b-17*11-coalesce((select coalesce((select max(t1.f+a-t1.c+b) from t1 where 17* -b+t1.e=13),coalesce((select +t1.f*coalesce((select b from t1 where 19 between -a and c),t1.d) from t1 where 17<>b),17)*11) from t1 where fb),17)*11) from t1 where fb),17)*11) from t1 where f=case when b not between -t1.f and c then e else f end or a<=11 or t1.e between a and 11 or t1.d not in (b,d,d) then case when f>=c then t1.c else 19 end when t1.e=a then e else t1.e end) | f)/abs(t1.a))) from t1)+e* -t1.a+f+d FROM t1 WHERE t1.b<=t1.c+ -(abs(t1.b)/abs(case t1.b+t1.e when 11 then t1.c else 17 end))*coalesce((select coalesce((select coalesce((select 13 from t1 where b=t1.b),f) | t1.f-11 from t1 where (t1.c) in (select +min(19)*(~max(b)-max(11))*max(11) from t1 union select min(f) from t1)),t1.f) from t1 where f in (select case count(distinct 19) when max(t1.b) then -cast(avg(t1.e) AS integer) else cast(avg(b) AS integer) end from t1 union select count(*) from t1)),t1.a)} -} {} -do_test randexpr-2.690 { - db eval {SELECT -d+t1.d-t1.a-+t1.c-(select +min((abs(+(case when b>=case when b not between -t1.f and c then e else f end or a<=11 or t1.e between a and 11 or t1.d not in (b,d,d) then case when f>=c then t1.c else 19 end when t1.e=a then e else t1.e end) | f)/abs(t1.a))) from t1)+e* -t1.a+f+d FROM t1 WHERE NOT (t1.b<=t1.c+ -(abs(t1.b)/abs(case t1.b+t1.e when 11 then t1.c else 17 end))*coalesce((select coalesce((select coalesce((select 13 from t1 where b=t1.b),f) | t1.f-11 from t1 where (t1.c) in (select +min(19)*(~max(b)-max(11))*max(11) from t1 union select min(f) from t1)),t1.f) from t1 where f in (select case count(distinct 19) when max(t1.b) then -cast(avg(t1.e) AS integer) else cast(avg(b) AS integer) end from t1 union select count(*) from t1)),t1.a))} -} {-49410} -do_test randexpr-2.691 { - db eval {SELECT -d+t1.d-t1.a-+t1.c-(select +min((abs(+(case when b>=case when b not between -t1.f and c then e else f end or a<=11 or t1.e between a and 11 or t1.d not in (b,d,d) then case when f>=c then t1.c else 19 end when t1.e=a then e else t1.e end) & f)/abs(t1.a))) from t1)+e* -t1.a+f+d FROM t1 WHERE NOT (t1.b<=t1.c+ -(abs(t1.b)/abs(case t1.b+t1.e when 11 then t1.c else 17 end))*coalesce((select coalesce((select coalesce((select 13 from t1 where b=t1.b),f) | t1.f-11 from t1 where (t1.c) in (select +min(19)*(~max(b)-max(11))*max(11) from t1 union select min(f) from t1)),t1.f) from t1 where f in (select case count(distinct 19) when max(t1.b) then -cast(avg(t1.e) AS integer) else cast(avg(b) AS integer) end from t1 union select count(*) from t1)),t1.a))} -} {-49400} -do_test randexpr-2.692 { - db eval {SELECT ~case +t1.a when t1.a then 19 else coalesce((select max(t1.d) from t1 where not exists(select 1 from t1 where t1.b*f<>e and e not in (17,t1.c-case when t1.e<19 then t1.c else (abs(t1.c)/abs(d*coalesce((select t1.e from t1 where exists(select 1 from t1 where t1.c in (select t1.f from t1 union select 11 from t1)) or t1.a<=t1.d),a))) end*t1.e,t1.e))),coalesce((select max(a) from t1 where (b) in ((11),e,b)),17)) end FROM t1 WHERE not (c)+c*d>t1.e and exists(select 1 from t1 where d*coalesce((select +case when ((select cast(avg((c)) AS integer)- -cast(avg(a) AS integer) from t1) in (select min(b)-count(*) from t1 union select count(distinct 19) from t1)) or not t1.b between 19 and 19 then t1.c else coalesce((select e from t1 where t1.e>=e),c) end from t1 where ( -f)19) and 17<> -t1.e and b>=a} -} {} -do_test randexpr-2.693 { - db eval {SELECT ~case +t1.a when t1.a then 19 else coalesce((select max(t1.d) from t1 where not exists(select 1 from t1 where t1.b*f<>e and e not in (17,t1.c-case when t1.e<19 then t1.c else (abs(t1.c)/abs(d*coalesce((select t1.e from t1 where exists(select 1 from t1 where t1.c in (select t1.f from t1 union select 11 from t1)) or t1.a<=t1.d),a))) end*t1.e,t1.e))),coalesce((select max(a) from t1 where (b) in ((11),e,b)),17)) end FROM t1 WHERE NOT (not (c)+c*d>t1.e and exists(select 1 from t1 where d*coalesce((select +case when ((select cast(avg((c)) AS integer)- -cast(avg(a) AS integer) from t1) in (select min(b)-count(*) from t1 union select count(distinct 19) from t1)) or not t1.b between 19 and 19 then t1.c else coalesce((select e from t1 where t1.e>=e),c) end from t1 where ( -f)19) and 17<> -t1.e and b>=a)} -} {-20} -do_test randexpr-2.694 { - db eval {SELECT coalesce((select max(t1.d-t1.e) from t1 where not exists(select 1 from t1 where c*+19<=(d)) or c+e not between a and ~f*t1.f*case when t1.e<> -coalesce((select case when ((e between t1.d and f)) then -(17) | b else t1.d end from t1 where b in (select t1.c from t1 union select 11 from t1)),d) then t1.d when e not in ( -t1.b,t1.c,(t1.e)) then t1.c else d end), -b) FROM t1 WHERE t1.d<>d} -} {} -do_test randexpr-2.695 { - db eval {SELECT coalesce((select max(t1.d-t1.e) from t1 where not exists(select 1 from t1 where c*+19<=(d)) or c+e not between a and ~f*t1.f*case when t1.e<> -coalesce((select case when ((e between t1.d and f)) then -(17) | b else t1.d end from t1 where b in (select t1.c from t1 union select 11 from t1)),d) then t1.d when e not in ( -t1.b,t1.c,(t1.e)) then t1.c else d end), -b) FROM t1 WHERE NOT (t1.d<>d)} -} {-100} -do_test randexpr-2.696 { - db eval {SELECT coalesce((select max(t1.d-t1.e) from t1 where not exists(select 1 from t1 where c*+19<=(d)) or c+e not between a and ~f*t1.f*case when t1.e<> -coalesce((select case when ((e between t1.d and f)) then -(17) & b else t1.d end from t1 where b in (select t1.c from t1 union select 11 from t1)),d) then t1.d when e not in ( -t1.b,t1.c,(t1.e)) then t1.c else d end), -b) FROM t1 WHERE NOT (t1.d<>d)} -} {-100} -do_test randexpr-2.697 { - db eval {SELECT case when a in (select max(17) from t1 union select abs(count(*)) from t1) then t1.a- -e-t1.d | e- -t1.f*19+(select -abs(max(a))*count(distinct e)*max(19) from t1)-11-13-d*11+t1.a else d end-b FROM t1 WHERE t1.e in (select (abs(case when (abs(f)/abs((select ~min(a) from t1)+coalesce((select t1.f from t1 where 11<>t1.b),19)))*t1.e+ -t1.d | e<=t1.f then -e when (b)>t1.a then t1.d else t1.a end)/abs(11)) from t1 union select 13 from t1) and f not between t1.b and e or not exists(select 1 from t1 where not exists(select 1 from t1 where 19t1.b),19)))*t1.e+ -t1.d | e<=t1.f then -e when (b)>t1.a then t1.d else t1.a end)/abs(11)) from t1 union select 13 from t1) and f not between t1.b and e or not exists(select 1 from t1 where not exists(select 1 from t1 where 19t1.b),19)))*t1.e+ -t1.d | e<=t1.f then -e when (b)>t1.a then t1.d else t1.a end)/abs(11)) from t1 union select 13 from t1) and f not between t1.b and e or not exists(select 1 from t1 where not exists(select 1 from t1 where 19t1.d),c) then 19 else 17 end between t1.b and t1.f and t1.d not in (c,e,(17)))),11) FROM t1 WHERE (((select min(t1.f) from t1)<=e))} -} {} -do_test randexpr-2.701 { - db eval {SELECT coalesce((select f from t1 where (case t1.a*t1.b*c when t1.d*coalesce((select max(coalesce((select 19 from t1 where t1.b in (select max(~case -e when c+coalesce((select max(e) from t1 where (t1.d) not between c and t1.f),17) then c else 13 end) from t1 union select count(distinct a) from t1)),t1.f)) from t1 where f>t1.d),c) then 19 else 17 end between t1.b and t1.f and t1.d not in (c,e,(17)))),11) FROM t1 WHERE NOT ((((select min(t1.f) from t1)<=e)))} -} {11} -do_test randexpr-2.702 { - db eval {SELECT case t1.a when e*t1.e then case when exists(select 1 from t1 where (coalesce((select max(17) from t1 where (not (case when not a>=13*c then t1.f else (11)*t1.b end between 11 and t1.f or t1.c>(t1.c)))),t1.b*~t1.c)*b*d>=13)) then (abs(17)/abs(e)) else b end else t1.f end | t1.c+t1.f FROM t1 WHERE coalesce((select max(11) from t1 where c-d not between ~case when (select +~count(distinct t1.f)*cast(avg(t1.e) AS integer) from t1)+19 not in (t1.e,t1.f,t1.a) then t1.a when a in (e,t1.d,d) then t1.b else t1.e end and t1.b and c>=e or (t1.d<>b) and not exists(select 1 from t1 where (t1.f between 13 and a))),t1.a)-e<=t1.e} -} {988} -do_test randexpr-2.703 { - db eval {SELECT case t1.a when e*t1.e then case when exists(select 1 from t1 where (coalesce((select max(17) from t1 where (not (case when not a>=13*c then t1.f else (11)*t1.b end between 11 and t1.f or t1.c>(t1.c)))),t1.b*~t1.c)*b*d>=13)) then (abs(17)/abs(e)) else b end else t1.f end | t1.c+t1.f FROM t1 WHERE NOT (coalesce((select max(11) from t1 where c-d not between ~case when (select +~count(distinct t1.f)*cast(avg(t1.e) AS integer) from t1)+19 not in (t1.e,t1.f,t1.a) then t1.a when a in (e,t1.d,d) then t1.b else t1.e end and t1.b and c>=e or (t1.d<>b) and not exists(select 1 from t1 where (t1.f between 13 and a))),t1.a)-e<=t1.e)} -} {} -do_test randexpr-2.704 { - db eval {SELECT case t1.a when e*t1.e then case when exists(select 1 from t1 where (coalesce((select max(17) from t1 where (not (case when not a>=13*c then t1.f else (11)*t1.b end between 11 and t1.f or t1.c>(t1.c)))),t1.b*~t1.c)*b*d>=13)) then (abs(17)/abs(e)) else b end else t1.f end & t1.c+t1.f FROM t1 WHERE coalesce((select max(11) from t1 where c-d not between ~case when (select +~count(distinct t1.f)*cast(avg(t1.e) AS integer) from t1)+19 not in (t1.e,t1.f,t1.a) then t1.a when a in (e,t1.d,d) then t1.b else t1.e end and t1.b and c>=e or (t1.d<>b) and not exists(select 1 from t1 where (t1.f between 13 and a))),t1.a)-e<=t1.e} -} {512} -do_test randexpr-2.705 { - db eval {SELECT coalesce((select max(t1.e+(t1.b)) from t1 where 17<=t1.d-(select ~+cast(avg(b) AS integer) | case -case cast(avg(t1.e) AS integer) when min((abs((a))/abs(t1.e))) then cast(avg(t1.c) AS integer)+count(*) else min(d) end when max(t1.e) then count(*) else ( -count(*)) end-min(t1.b)-count(distinct -a)*count(*) from t1) | c+coalesce((select f from t1 where (19=t1.c-t1.b)),t1.f+17)),f) FROM t1 WHERE c not between (abs(t1.f)/abs(case when t1.f+e<=t1.c+t1.d then case when d in (select +count(distinct case when -t1.a*19-t1.c not between 11 and c then t1.e when (19<>19) then t1.d else d end) from t1 union select cast(avg(e) AS integer) from t1) then t1.e when c in (select count(*) from t1 union select cast(avg(f) AS integer)* - - -cast(avg(t1.e) AS integer) from t1) then b else (t1.b) end when not (11>=11) then -t1.e else b end)) and t1.f} -} {} -do_test randexpr-2.706 { - db eval {SELECT coalesce((select max(t1.e+(t1.b)) from t1 where 17<=t1.d-(select ~+cast(avg(b) AS integer) | case -case cast(avg(t1.e) AS integer) when min((abs((a))/abs(t1.e))) then cast(avg(t1.c) AS integer)+count(*) else min(d) end when max(t1.e) then count(*) else ( -count(*)) end-min(t1.b)-count(distinct -a)*count(*) from t1) | c+coalesce((select f from t1 where (19=t1.c-t1.b)),t1.f+17)),f) FROM t1 WHERE NOT (c not between (abs(t1.f)/abs(case when t1.f+e<=t1.c+t1.d then case when d in (select +count(distinct case when -t1.a*19-t1.c not between 11 and c then t1.e when (19<>19) then t1.d else d end) from t1 union select cast(avg(e) AS integer) from t1) then t1.e when c in (select count(*) from t1 union select cast(avg(f) AS integer)* - - -cast(avg(t1.e) AS integer) from t1) then b else (t1.b) end when not (11>=11) then -t1.e else b end)) and t1.f)} -} {700} -do_test randexpr-2.707 { - db eval {SELECT coalesce((select max(t1.e+(t1.b)) from t1 where 17<=t1.d-(select ~+cast(avg(b) AS integer) & case -case cast(avg(t1.e) AS integer) when min((abs((a))/abs(t1.e))) then cast(avg(t1.c) AS integer)+count(*) else min(d) end when max(t1.e) then count(*) else ( -count(*)) end-min(t1.b)-count(distinct -a)*count(*) from t1) & c+coalesce((select f from t1 where (19=t1.c-t1.b)),t1.f+17)),f) FROM t1 WHERE NOT (c not between (abs(t1.f)/abs(case when t1.f+e<=t1.c+t1.d then case when d in (select +count(distinct case when -t1.a*19-t1.c not between 11 and c then t1.e when (19<>19) then t1.d else d end) from t1 union select cast(avg(e) AS integer) from t1) then t1.e when c in (select count(*) from t1 union select cast(avg(f) AS integer)* - - -cast(avg(t1.e) AS integer) from t1) then b else (t1.b) end when not (11>=11) then -t1.e else b end)) and t1.f)} -} {700} -do_test randexpr-2.708 { - db eval {SELECT 17-(abs(case when t1.e<+(select count(distinct -f) from t1)+t1.b then +case when t1.b not in (coalesce((select max(coalesce((select case when 17=a and 13 not in (b,t1.f,d)),b),t1.d, -13) then (e) else (13) end-19 when not exists(select 1 from t1 where 19<>f) then c else t1.e end | t1.d)/abs((13)))*f FROM t1 WHERE coalesce((select f from t1 where coalesce((select ~d*19-d*~case c when case a when t1.e*19 then (select - -( -max(t1.f))*cast(avg(t1.c) AS integer) from t1) else 13 end*13-11 then -11 else t1.f end | t1.e | t1.f*19 from t1 where t1.f>t1.a),b)*b not in (17,17,t1.e)),t1.a)-b*d>=11} -} {} -do_test randexpr-2.709 { - db eval {SELECT 17-(abs(case when t1.e<+(select count(distinct -f) from t1)+t1.b then +case when t1.b not in (coalesce((select max(coalesce((select case when 17=a and 13 not in (b,t1.f,d)),b),t1.d, -13) then (e) else (13) end-19 when not exists(select 1 from t1 where 19<>f) then c else t1.e end | t1.d)/abs((13)))*f FROM t1 WHERE NOT (coalesce((select f from t1 where coalesce((select ~d*19-d*~case c when case a when t1.e*19 then (select - -( -max(t1.f))*cast(avg(t1.c) AS integer) from t1) else 13 end*13-11 then -11 else t1.f end | t1.e | t1.f*19 from t1 where t1.f>t1.a),b)*b not in (17,17,t1.e)),t1.a)-b*d>=11)} -} {-22783} -do_test randexpr-2.710 { - db eval {SELECT 17-(abs(case when t1.e<+(select count(distinct -f) from t1)+t1.b then +case when t1.b not in (coalesce((select max(coalesce((select case when 17=a and 13 not in (b,t1.f,d)),b),t1.d, -13) then (e) else (13) end-19 when not exists(select 1 from t1 where 19<>f) then c else t1.e end & t1.d)/abs((13)))*f FROM t1 WHERE NOT (coalesce((select f from t1 where coalesce((select ~d*19-d*~case c when case a when t1.e*19 then (select - -( -max(t1.f))*cast(avg(t1.c) AS integer) from t1) else 13 end*13-11 then -11 else t1.f end | t1.e | t1.f*19 from t1 where t1.f>t1.a),b)*b not in (17,17,t1.e)),t1.a)-b*d>=11)} -} {-17983} -do_test randexpr-2.711 { - db eval {SELECT (select cast(avg(case when (e=case when e>d and case coalesce((select ((t1.b)) from t1 where 17<=t1.c),a) when t1.b then f else d end*b>t1.d then (t1.a) else 11 end or 17 not in (19,f,d) or not not exists(select 1 from t1 where - -e>=13)) and 17 in ( -t1.b,c,t1.f) then t1.c when t1.c not between t1.f and 17 then t1.c else d end) AS integer) from t1)+b+a FROM t1 WHERE (((coalesce((select coalesce((select max(19) from t1 where d between ~t1.a and 11),c+d-coalesce((select e from t1 where (abs(b)/abs(coalesce((select 13 from t1 where case when (17) not in (19,t1.c,t1.b) or 17 not in (t1.b,t1.f,t1.e) then 11 else 19 end<>t1.c),11)*17))=t1.b),d)) from t1 where d not in (b,b,d)),t1.a) not between b and b) and d>=t1.d) and t1.d in (13,c,t1.b))} -} {} -do_test randexpr-2.712 { - db eval {SELECT (select cast(avg(case when (e=case when e>d and case coalesce((select ((t1.b)) from t1 where 17<=t1.c),a) when t1.b then f else d end*b>t1.d then (t1.a) else 11 end or 17 not in (19,f,d) or not not exists(select 1 from t1 where - -e>=13)) and 17 in ( -t1.b,c,t1.f) then t1.c when t1.c not between t1.f and 17 then t1.c else d end) AS integer) from t1)+b+a FROM t1 WHERE NOT ((((coalesce((select coalesce((select max(19) from t1 where d between ~t1.a and 11),c+d-coalesce((select e from t1 where (abs(b)/abs(coalesce((select 13 from t1 where case when (17) not in (19,t1.c,t1.b) or 17 not in (t1.b,t1.f,t1.e) then 11 else 19 end<>t1.c),11)*17))=t1.b),d)) from t1 where d not in (b,b,d)),t1.a) not between b and b) and d>=t1.d) and t1.d in (13,c,t1.b)))} -} {600} -do_test randexpr-2.713 { - db eval {SELECT (abs((select +abs(+max(b) | abs(~~count(distinct -19))) from t1))/abs(coalesce((select max(19*11*d) from t1 where (t1.e<=t1.e)),t1.f)))+case e when (t1.e) then d else c*13 | 11 end FROM t1 WHERE t1.d>=(case when (select count(*) from t1)*t1.c*t1.e+e<>t1.e*13 | f+(select (min(13+t1.b) | ~+~count(*)) from t1)*e*coalesce((select max(19+t1.a) from t1 where t1.e in (select +(count(distinct b))+count(*) from t1 union select ( -min(17)) from t1)),t1.a)-t1.d* -t1.e then e else -a end)} -} {} -do_test randexpr-2.714 { - db eval {SELECT (abs((select +abs(+max(b) | abs(~~count(distinct -19))) from t1))/abs(coalesce((select max(19*11*d) from t1 where (t1.e<=t1.e)),t1.f)))+case e when (t1.e) then d else c*13 | 11 end FROM t1 WHERE NOT (t1.d>=(case when (select count(*) from t1)*t1.c*t1.e+e<>t1.e*13 | f+(select (min(13+t1.b) | ~+~count(*)) from t1)*e*coalesce((select max(19+t1.a) from t1 where t1.e in (select +(count(distinct b))+count(*) from t1 union select ( -min(17)) from t1)),t1.a)-t1.d* -t1.e then e else -a end))} -} {400} -do_test randexpr-2.715 { - db eval {SELECT (abs((select +abs(+max(b) & abs(~~count(distinct -19))) from t1))/abs(coalesce((select max(19*11*d) from t1 where (t1.e<=t1.e)),t1.f)))+case e when (t1.e) then d else c*13 & 11 end FROM t1 WHERE NOT (t1.d>=(case when (select count(*) from t1)*t1.c*t1.e+e<>t1.e*13 | f+(select (min(13+t1.b) | ~+~count(*)) from t1)*e*coalesce((select max(19+t1.a) from t1 where t1.e in (select +(count(distinct b))+count(*) from t1 union select ( -min(17)) from t1)),t1.a)-t1.d* -t1.e then e else -a end))} -} {400} -do_test randexpr-2.716 { - db eval {SELECT -17+c-(abs(t1.a)/abs(t1.c))-case when t1.a<>c then case when exists(select 1 from t1 where 11 not between + -d and d and 13 not between 13 and 17 or not -f<=19 or (t1.a)(11)) and 11=t1.f then b else a end from t1 where t1.e in (e,t1.c,b)),11) end else -17 end FROM t1 WHERE not exists(select 1 from t1 where t1.a>=coalesce((select t1.f from t1 where + -19*t1.c<~+t1.a*13),a))} -} {-217} -do_test randexpr-2.717 { - db eval {SELECT -17+c-(abs(t1.a)/abs(t1.c))-case when t1.a<>c then case when exists(select 1 from t1 where 11 not between + -d and d and 13 not between 13 and 17 or not -f<=19 or (t1.a)(11)) and 11=t1.f then b else a end from t1 where t1.e in (e,t1.c,b)),11) end else -17 end FROM t1 WHERE NOT (not exists(select 1 from t1 where t1.a>=coalesce((select t1.f from t1 where + -19*t1.c<~+t1.a*13),a)))} -} {} -do_test randexpr-2.718 { - db eval {SELECT f*19+17*(select max(b)+count(*)- -~count(*)-min(case when (e<=b-t1.b) then case when t1.b>t1.a or f not in (c, -c,f) or f in (e,13,13) then t1.b else t1.b end else a end*a) from t1)+t1.f*(abs(case b | t1.c+t1.a when ((f)) then f else c end+b)/abs(17))-(c) FROM t1 WHERE t1.e>11} -} {-138117} -do_test randexpr-2.719 { - db eval {SELECT f*19+17*(select max(b)+count(*)- -~count(*)-min(case when (e<=b-t1.b) then case when t1.b>t1.a or f not in (c, -c,f) or f in (e,13,13) then t1.b else t1.b end else a end*a) from t1)+t1.f*(abs(case b | t1.c+t1.a when ((f)) then f else c end+b)/abs(17))-(c) FROM t1 WHERE NOT (t1.e>11)} -} {} -do_test randexpr-2.720 { - db eval {SELECT f*19+17*(select max(b)+count(*)- -~count(*)-min(case when (e<=b-t1.b) then case when t1.b>t1.a or f not in (c, -c,f) or f in (e,13,13) then t1.b else t1.b end else a end*a) from t1)+t1.f*(abs(case b & t1.c+t1.a when ((f)) then f else c end+b)/abs(17))-(c) FROM t1 WHERE t1.e>11} -} {-138117} -do_test randexpr-2.721 { - db eval {SELECT -case when case when (case (abs(13)/abs(t1.e-13*t1.f)) when b- -13+t1.d then 11 else a end) not between t1.b and b then t1.c when d not between t1.e and t1.c or t1.f in (select 11 from t1 union select f from t1) and 17=d then 13 else t1.a end+11>=f then a when f>b then t1.d else 17 end-t1.e FROM t1 WHERE (case when not exists(select 1 from t1 where exists(select 1 from t1 where (abs(b*d-t1.e)/abs(t1.b))>c)) and t1.d in (13,t1.f,17) then e else ( - -t1.a)+11+c end*t1.b in (select (case -+min(17) when +count(*) | min(t1.a) | cast(avg(11) AS integer) then cast(avg(11) AS integer) else cast(avg(a) AS integer) end)-cast(avg(t1.a) AS integer) from t1 union select (min(t1.e)) from t1) or not t1.c in ((f),t1.c,(t1.e)))} -} {} -do_test randexpr-2.722 { - db eval {SELECT -case when case when (case (abs(13)/abs(t1.e-13*t1.f)) when b- -13+t1.d then 11 else a end) not between t1.b and b then t1.c when d not between t1.e and t1.c or t1.f in (select 11 from t1 union select f from t1) and 17=d then 13 else t1.a end+11>=f then a when f>b then t1.d else 17 end-t1.e FROM t1 WHERE NOT ((case when not exists(select 1 from t1 where exists(select 1 from t1 where (abs(b*d-t1.e)/abs(t1.b))>c)) and t1.d in (13,t1.f,17) then e else ( - -t1.a)+11+c end*t1.b in (select (case -+min(17) when +count(*) | min(t1.a) | cast(avg(11) AS integer) then cast(avg(11) AS integer) else cast(avg(a) AS integer) end)-cast(avg(t1.a) AS integer) from t1 union select (min(t1.e)) from t1) or not t1.c in ((f),t1.c,(t1.e))))} -} {-900} -do_test randexpr-2.723 { - db eval {SELECT case t1.a when a then t1.c else -case coalesce((select t1.e from t1 where (abs(case when not (a*case when f>=f*13-19 then t1.e else +t1.a end=t1.a) then (select min(a)+min(+19) from t1) else case when t1.a=(f) then c else c end+17 end)/abs(t1.e)) between 17 and 13),e) when 17 then 13 else t1.d end end FROM t1 WHERE 17 in (select case cast(avg(b+b) AS integer) when abs(abs(count(*))) then min(case t1.c+t1.b+t1.e+17+case case when t1.b<>17 and t1.e>=t1.b then b else -t1.f end when 11 then 13 else f end*t1.f*b when 19 then -11 else t1.d end- -t1.f) else min(t1.c) end from t1 union select abs(abs(count(distinct b)*max(t1.d))+count(distinct 13)-count(*)) from t1)} -} {} -do_test randexpr-2.724 { - db eval {SELECT case t1.a when a then t1.c else -case coalesce((select t1.e from t1 where (abs(case when not (a*case when f>=f*13-19 then t1.e else +t1.a end=t1.a) then (select min(a)+min(+19) from t1) else case when t1.a=(f) then c else c end+17 end)/abs(t1.e)) between 17 and 13),e) when 17 then 13 else t1.d end end FROM t1 WHERE NOT (17 in (select case cast(avg(b+b) AS integer) when abs(abs(count(*))) then min(case t1.c+t1.b+t1.e+17+case case when t1.b<>17 and t1.e>=t1.b then b else -t1.f end when 11 then 13 else f end*t1.f*b when 19 then -11 else t1.d end- -t1.f) else min(t1.c) end from t1 union select abs(abs(count(distinct b)*max(t1.d))+count(distinct 13)-count(*)) from t1))} -} {300} -do_test randexpr-2.725 { - db eval {SELECT case when coalesce((select e from t1 where coalesce((select coalesce((select max( -coalesce((select max(case when exists(select 1 from t1 where not exists(select 1 from t1 where b in (select e+d from t1 union select t1.e from t1))) then t1.d else t1.f end) from t1 where exists(select 1 from t1 where f not in ((c),a,11))),e)) from t1 where t1.b=t1.f and et1.b),t1.b) from t1 where t1.a in (select a from t1 union select -f from t1)),17)>=17),((b))) not in (t1.e,b,e) then 19 when not -a<=f then t1.f else t1.b end FROM t1 WHERE 13=t1.d} -} {} -do_test randexpr-2.726 { - db eval {SELECT case when coalesce((select e from t1 where coalesce((select coalesce((select max( -coalesce((select max(case when exists(select 1 from t1 where not exists(select 1 from t1 where b in (select e+d from t1 union select t1.e from t1))) then t1.d else t1.f end) from t1 where exists(select 1 from t1 where f not in ((c),a,11))),e)) from t1 where t1.b=t1.f and et1.b),t1.b) from t1 where t1.a in (select a from t1 union select -f from t1)),17)>=17),((b))) not in (t1.e,b,e) then 19 when not -a<=f then t1.f else t1.b end FROM t1 WHERE NOT (13=t1.d)} -} {200} -do_test randexpr-2.727 { - db eval {SELECT 19*13+((abs(case when 17*d in ((abs((case (abs((abs((select abs(min(d))+cast(avg(19) AS integer) from t1) | t1.d | 11 | b)/abs(19)))/abs(b)) when 11 then a else e end))/abs(13)),t1.f,b) then t1.b when t1.c>=t1.d then (t1.c) else c end*d)/abs(f))) | t1.a-a-17 FROM t1 WHERE ( -t1.d+coalesce((select max(11) from t1 where t1.c between 13 and t1.d and case d when b then 13+ -~t1.a else +case when coalesce((select max((select +case (cast(avg(e) AS integer)) when count(distinct t1.a) then count(*) else min(( -d)) end from t1)-+a+d) from t1 where (e in (17,t1.e, -a))),b)<>f then a else 11 end end<(t1.e)),t1.d) in (select t1.a from t1 union select b from t1))} -} {} -do_test randexpr-2.728 { - db eval {SELECT 19*13+((abs(case when 17*d in ((abs((case (abs((abs((select abs(min(d))+cast(avg(19) AS integer) from t1) | t1.d | 11 | b)/abs(19)))/abs(b)) when 11 then a else e end))/abs(13)),t1.f,b) then t1.b when t1.c>=t1.d then (t1.c) else c end*d)/abs(f))) | t1.a-a-17 FROM t1 WHERE NOT (( -t1.d+coalesce((select max(11) from t1 where t1.c between 13 and t1.d and case d when b then 13+ -~t1.a else +case when coalesce((select max((select +case (cast(avg(e) AS integer)) when count(distinct t1.a) then count(*) else min(( -d)) end from t1)-+a+d) from t1 where (e in (17,t1.e, -a))),b)<>f then a else 11 end end<(t1.e)),t1.d) in (select t1.a from t1 union select b from t1)))} -} {-1} -do_test randexpr-2.729 { - db eval {SELECT 19*13+((abs(case when 17*d in ((abs((case (abs((abs((select abs(min(d))+cast(avg(19) AS integer) from t1) & t1.d & 11 & b)/abs(19)))/abs(b)) when 11 then a else e end))/abs(13)),t1.f,b) then t1.b when t1.c>=t1.d then (t1.c) else c end*d)/abs(f))) & t1.a-a-17 FROM t1 WHERE NOT (( -t1.d+coalesce((select max(11) from t1 where t1.c between 13 and t1.d and case d when b then 13+ -~t1.a else +case when coalesce((select max((select +case (cast(avg(e) AS integer)) when count(distinct t1.a) then count(*) else min(( -d)) end from t1)-+a+d) from t1 where (e in (17,t1.e, -a))),b)<>f then a else 11 end end<(t1.e)),t1.d) in (select t1.a from t1 union select b from t1)))} -} {431} -do_test randexpr-2.730 { - db eval {SELECT case when (19*b)+11*~f-coalesce((select max(11) from t1 where f<>case when case 17 when 11 then 17 else c end-11 in (t1.c,c,t1.e) and 19=t1.a or 17<=e or e<=19 then 19 | c when t1.b=t1.f then d else 19 end or t1.e not in (13,19,c)),b) | -c not between -e and -a then (t1.c) else t1.d end FROM t1 WHERE c in (select case abs((count(*))) when -max(t1.c) | abs(abs(+count(*)))-~case (case -max(e) when max(11)- -count(*) then ((max(t1.e))) else count(*) end) when count(distinct t1.e) then cast(avg(f) AS integer) else cast(avg(t1.c) AS integer) end* -cast(avg(f) AS integer) then max(f) else (max(b)) end from t1 union select (max(13)) from t1) and not exists(select 1 from t1 where case when t1.e<=19-b then c else c end in (select c from t1 union select (select -((count(distinct t1.d))) from t1)-t1.b from t1))} -} {} -do_test randexpr-2.731 { - db eval {SELECT case when (19*b)+11*~f-coalesce((select max(11) from t1 where f<>case when case 17 when 11 then 17 else c end-11 in (t1.c,c,t1.e) and 19=t1.a or 17<=e or e<=19 then 19 | c when t1.b=t1.f then d else 19 end or t1.e not in (13,19,c)),b) | -c not between -e and -a then (t1.c) else t1.d end FROM t1 WHERE NOT (c in (select case abs((count(*))) when -max(t1.c) | abs(abs(+count(*)))-~case (case -max(e) when max(11)- -count(*) then ((max(t1.e))) else count(*) end) when count(distinct t1.e) then cast(avg(f) AS integer) else cast(avg(t1.c) AS integer) end* -cast(avg(f) AS integer) then max(f) else (max(b)) end from t1 union select (max(13)) from t1) and not exists(select 1 from t1 where case when t1.e<=19-b then c else c end in (select c from t1 union select (select -((count(distinct t1.d))) from t1)-t1.b from t1)))} -} {400} -do_test randexpr-2.732 { - db eval {SELECT case when (19*b)+11*~f-coalesce((select max(11) from t1 where f<>case when case 17 when 11 then 17 else c end-11 in (t1.c,c,t1.e) and 19=t1.a or 17<=e or e<=19 then 19 & c when t1.b=t1.f then d else 19 end or t1.e not in (13,19,c)),b) & -c not between -e and -a then (t1.c) else t1.d end FROM t1 WHERE NOT (c in (select case abs((count(*))) when -max(t1.c) | abs(abs(+count(*)))-~case (case -max(e) when max(11)- -count(*) then ((max(t1.e))) else count(*) end) when count(distinct t1.e) then cast(avg(f) AS integer) else cast(avg(t1.c) AS integer) end* -cast(avg(f) AS integer) then max(f) else (max(b)) end from t1 union select (max(13)) from t1) and not exists(select 1 from t1 where case when t1.e<=19-b then c else c end in (select c from t1 union select (select -((count(distinct t1.d))) from t1)-t1.b from t1)))} -} {300} -do_test randexpr-2.733 { - db eval {SELECT case when t1.e not between e and 13 then (select count(*) from t1) when f>=case when c in (select a from t1 union select t1.e+coalesce((select 11 from t1 where (select count(distinct t1.b) from t1)+17 not in (b,t1.c,t1.f-(select ~count(distinct 17) from t1)+ -e)),13) from t1) or 19 between d and t1.f then (select min(19) from t1) when not (e not between c and a) then d else a end then d else (t1.c) end FROM t1 WHERE f not in (17,f+d | f+case when -f=19 then (select max((select +abs(abs(max(((select ((max(t1.d))+count(distinct t1.e))-min(t1.a) from t1))+t1.e)-abs(count(distinct -t1.b)-count(distinct 11)))*min(a)-count(*))-min(t1.a) from t1)) from t1) else t1.f end,c-a) and c<>11} -} {1} -do_test randexpr-2.734 { - db eval {SELECT case when t1.e not between e and 13 then (select count(*) from t1) when f>=case when c in (select a from t1 union select t1.e+coalesce((select 11 from t1 where (select count(distinct t1.b) from t1)+17 not in (b,t1.c,t1.f-(select ~count(distinct 17) from t1)+ -e)),13) from t1) or 19 between d and t1.f then (select min(19) from t1) when not (e not between c and a) then d else a end then d else (t1.c) end FROM t1 WHERE NOT (f not in (17,f+d | f+case when -f=19 then (select max((select +abs(abs(max(((select ((max(t1.d))+count(distinct t1.e))-min(t1.a) from t1))+t1.e)-abs(count(distinct -t1.b)-count(distinct 11)))*min(a)-count(*))-min(t1.a) from t1)) from t1) else t1.f end,c-a) and c<>11)} -} {} -do_test randexpr-2.735 { - db eval {SELECT case c-+case when t1.f in (t1.a,t1.e,19) then t1.b else case when a<>t1.a then case ~(t1.d) when t1.e then (select max(t1.f) from t1)-(select +(cast(avg(b) AS integer))*cast(avg(t1.a) AS integer)+max(d)*count(*)+count(*) from t1)* -t1.f else 13 end else t1.a+a end*t1.f-t1.b*(e) end when d then d else 17 end FROM t1 WHERE case when not exists(select 1 from t1 where not exists(select 1 from t1 where c in (select t1.a*t1.b from t1 union select t1.d | e from t1))) and (coalesce((select (abs(11)/abs(13-17*c)) from t1 where b in (select 13 from t1 union select (t1.c) from t1)),11) not in (17,b,b)) then (abs(+t1.f)/abs(c)) when exists(select 1 from t1 where not exists(select 1 from t1 where not (not exists(select 1 from t1 where e<=19 and e>19)))) then c else t1.e end not between t1.f and c} -} {17} -do_test randexpr-2.736 { - db eval {SELECT case c-+case when t1.f in (t1.a,t1.e,19) then t1.b else case when a<>t1.a then case ~(t1.d) when t1.e then (select max(t1.f) from t1)-(select +(cast(avg(b) AS integer))*cast(avg(t1.a) AS integer)+max(d)*count(*)+count(*) from t1)* -t1.f else 13 end else t1.a+a end*t1.f-t1.b*(e) end when d then d else 17 end FROM t1 WHERE NOT (case when not exists(select 1 from t1 where not exists(select 1 from t1 where c in (select t1.a*t1.b from t1 union select t1.d | e from t1))) and (coalesce((select (abs(11)/abs(13-17*c)) from t1 where b in (select 13 from t1 union select (t1.c) from t1)),11) not in (17,b,b)) then (abs(+t1.f)/abs(c)) when exists(select 1 from t1 where not exists(select 1 from t1 where not (not exists(select 1 from t1 where e<=19 and e>19)))) then c else t1.e end not between t1.f and c)} -} {} -do_test randexpr-2.737 { - db eval {SELECT 11+a+(select count(distinct coalesce((select -coalesce((select case when (t1.a<=a) then (case when 17=t1.c then (select count(distinct e)-min(11) from t1) else f end) when f>=t1.f and t1.c not in (t1.e,a,17) and 17=t1.f then -t1.d else 11 end*t1.d from t1 where t1.a<=t1.b),t1.b) from t1 where t1.e not between d and 13),t1.a)) | +max(t1.c) from t1) FROM t1 WHERE 11 in (t1.a,+t1.c* -t1.f | t1.d*+t1.c-b-(abs((select min(case when 19 in (select abs(count(distinct c)) from t1 union select ~ -min(t1.c) from t1) then case (11) when a then t1.c else t1.d end when (f)<=t1.b then t1.b else t1.a end)+min((t1.d)) | min(b) from t1))/abs(t1.e))+case 13 when t1.b then b else - -t1.b end*b-11, -f)} -} {} -do_test randexpr-2.738 { - db eval {SELECT 11+a+(select count(distinct coalesce((select -coalesce((select case when (t1.a<=a) then (case when 17=t1.c then (select count(distinct e)-min(11) from t1) else f end) when f>=t1.f and t1.c not in (t1.e,a,17) and 17=t1.f then -t1.d else 11 end*t1.d from t1 where t1.a<=t1.b),t1.b) from t1 where t1.e not between d and 13),t1.a)) | +max(t1.c) from t1) FROM t1 WHERE NOT (11 in (t1.a,+t1.c* -t1.f | t1.d*+t1.c-b-(abs((select min(case when 19 in (select abs(count(distinct c)) from t1 union select ~ -min(t1.c) from t1) then case (11) when a then t1.c else t1.d end when (f)<=t1.b then t1.b else t1.a end)+min((t1.d)) | min(b) from t1))/abs(t1.e))+case 13 when t1.b then b else - -t1.b end*b-11, -f))} -} {412} -do_test randexpr-2.739 { - db eval {SELECT 11+a+(select count(distinct coalesce((select -coalesce((select case when (t1.a<=a) then (case when 17=t1.c then (select count(distinct e)-min(11) from t1) else f end) when f>=t1.f and t1.c not in (t1.e,a,17) and 17=t1.f then -t1.d else 11 end*t1.d from t1 where t1.a<=t1.b),t1.b) from t1 where t1.e not between d and 13),t1.a)) & +max(t1.c) from t1) FROM t1 WHERE NOT (11 in (t1.a,+t1.c* -t1.f | t1.d*+t1.c-b-(abs((select min(case when 19 in (select abs(count(distinct c)) from t1 union select ~ -min(t1.c) from t1) then case (11) when a then t1.c else t1.d end when (f)<=t1.b then t1.b else t1.a end)+min((t1.d)) | min(b) from t1))/abs(t1.e))+case 13 when t1.b then b else - -t1.b end*b-11, -f))} -} {111} -do_test randexpr-2.740 { - db eval {SELECT -c-case 11 when ++e*(select cast(avg( -t1.f+case when case when 19=t1.e+((select min(17 | a) from t1)) then t1.f else t1.b end>=t1.e then t1.e when (((exists(select 1 from t1 where b in (select case -count(*) when (count(distinct d)) then count(*) else (cast(avg(t1.b) AS integer)) end from t1 union select -count(*) from t1))))) then t1.a else a end+t1.a*d) AS integer) from t1) then 13 else f end*e FROM t1 WHERE (select cast(avg(case when +d>=e+17 and (not case when 13>=(select case -count(distinct t1.e) when cast(avg(c) AS integer) then cast(avg(19) AS integer) else count(distinct t1.a) end from t1) then t1.e else t1.f end in (select t1.b from t1 union select 13 from t1)) or t1.a<=e and e in (select count(*) from t1 union select -count(*) from t1) and b>=t1.b or t1.e between c and 19 then c when f between 19 and b then coalesce((select max(t1.d) from t1 where a<>t1.b),13)* -(d) else t1.e end) AS integer) from t1)<=19} -} {} -do_test randexpr-2.741 { - db eval {SELECT -c-case 11 when ++e*(select cast(avg( -t1.f+case when case when 19=t1.e+((select min(17 | a) from t1)) then t1.f else t1.b end>=t1.e then t1.e when (((exists(select 1 from t1 where b in (select case -count(*) when (count(distinct d)) then count(*) else (cast(avg(t1.b) AS integer)) end from t1 union select -count(*) from t1))))) then t1.a else a end+t1.a*d) AS integer) from t1) then 13 else f end*e FROM t1 WHERE NOT ((select cast(avg(case when +d>=e+17 and (not case when 13>=(select case -count(distinct t1.e) when cast(avg(c) AS integer) then cast(avg(19) AS integer) else count(distinct t1.a) end from t1) then t1.e else t1.f end in (select t1.b from t1 union select 13 from t1)) or t1.a<=e and e in (select count(*) from t1 union select -count(*) from t1) and b>=t1.b or t1.e between c and 19 then c when f between 19 and b then coalesce((select max(t1.d) from t1 where a<>t1.b),13)* -(d) else t1.e end) AS integer) from t1)<=19)} -} {-300300} -do_test randexpr-2.742 { - db eval {SELECT -c-case 11 when ++e*(select cast(avg( -t1.f+case when case when 19=t1.e+((select min(17 & a) from t1)) then t1.f else t1.b end>=t1.e then t1.e when (((exists(select 1 from t1 where b in (select case -count(*) when (count(distinct d)) then count(*) else (cast(avg(t1.b) AS integer)) end from t1 union select -count(*) from t1))))) then t1.a else a end+t1.a*d) AS integer) from t1) then 13 else f end*e FROM t1 WHERE NOT ((select cast(avg(case when +d>=e+17 and (not case when 13>=(select case -count(distinct t1.e) when cast(avg(c) AS integer) then cast(avg(19) AS integer) else count(distinct t1.a) end from t1) then t1.e else t1.f end in (select t1.b from t1 union select 13 from t1)) or t1.a<=e and e in (select count(*) from t1 union select -count(*) from t1) and b>=t1.b or t1.e between c and 19 then c when f between 19 and b then coalesce((select max(t1.d) from t1 where a<>t1.b),13)* -(d) else t1.e end) AS integer) from t1)<=19)} -} {-300300} -do_test randexpr-2.743 { - db eval {SELECT case d when 11 then t1.d-(abs(t1.d)/abs(19))+coalesce((select d*d from t1 where (select cast(avg(case when f | c+case when e in (select min(coalesce((select t1.f from t1 where 11 not between t1.b and 19),t1.f)) from t1 union select (max(t1.b)) from t1) then 19 when t1.b=b or t1.c>=c then 13 else e end*19 in (select 17 from t1 union select 11 from t1) then -c else t1.d end) AS integer) from t1)<13),d) else 11 end FROM t1 WHERE (b>~t1.c-+(abs(case when 11>(c) and t1.a>13 then t1.d else (b) end)/abs(t1.d))-13 or t1.f between t1.a and 19 and 11 in (select (min(t1.e))-~( -+count(*)) from t1 union select count(distinct t1.c) from t1)) and 17 not in (f,(t1.b),t1.c) and (t1.f<>t1.e) or d in (f,t1.a,t1.d) or (d)<=t1.e} -} {11} -do_test randexpr-2.744 { - db eval {SELECT case d when 11 then t1.d-(abs(t1.d)/abs(19))+coalesce((select d*d from t1 where (select cast(avg(case when f | c+case when e in (select min(coalesce((select t1.f from t1 where 11 not between t1.b and 19),t1.f)) from t1 union select (max(t1.b)) from t1) then 19 when t1.b=b or t1.c>=c then 13 else e end*19 in (select 17 from t1 union select 11 from t1) then -c else t1.d end) AS integer) from t1)<13),d) else 11 end FROM t1 WHERE NOT ((b>~t1.c-+(abs(case when 11>(c) and t1.a>13 then t1.d else (b) end)/abs(t1.d))-13 or t1.f between t1.a and 19 and 11 in (select (min(t1.e))-~( -+count(*)) from t1 union select count(distinct t1.c) from t1)) and 17 not in (f,(t1.b),t1.c) and (t1.f<>t1.e) or d in (f,t1.a,t1.d) or (d)<=t1.e)} -} {} -do_test randexpr-2.745 { - db eval {SELECT case d when 11 then t1.d-(abs(t1.d)/abs(19))+coalesce((select d*d from t1 where (select cast(avg(case when f & c+case when e in (select min(coalesce((select t1.f from t1 where 11 not between t1.b and 19),t1.f)) from t1 union select (max(t1.b)) from t1) then 19 when t1.b=b or t1.c>=c then 13 else e end*19 in (select 17 from t1 union select 11 from t1) then -c else t1.d end) AS integer) from t1)<13),d) else 11 end FROM t1 WHERE (b>~t1.c-+(abs(case when 11>(c) and t1.a>13 then t1.d else (b) end)/abs(t1.d))-13 or t1.f between t1.a and 19 and 11 in (select (min(t1.e))-~( -+count(*)) from t1 union select count(distinct t1.c) from t1)) and 17 not in (f,(t1.b),t1.c) and (t1.f<>t1.e) or d in (f,t1.a,t1.d) or (d)<=t1.e} -} {11} -do_test randexpr-2.746 { - db eval {SELECT (select -~count(distinct ~+case when c<>coalesce((select max(case when ~13 in (t1.a,t1.f,13+t1.d+(19)*t1.d*f-e) then 13 else a end) from t1 where -t1.d<>19),(a))*d+a then t1.d when exists(select 1 from t1 where b=d) then t1.f else 17 end*11) | count(*)-max(t1.e) from t1) FROM t1 WHERE 19 in (select max(b) from t1 union select count(*) from t1) and +t1.b+c*d+coalesce((select max(17) from t1 where case when t1.a=coalesce((select max((select (min(t1.f)) from t1)) from t1 where not case when not exists(select 1 from t1 where ( -t1.b)=13 and d in (f,c,e)) or 17 between 17 and e then t1.e-t1.c else 11 end>=d),19)-11 then 11 else 17 end<=t1.a),t1.f)+t1.f-f<>17} -} {} -do_test randexpr-2.747 { - db eval {SELECT (select -~count(distinct ~+case when c<>coalesce((select max(case when ~13 in (t1.a,t1.f,13+t1.d+(19)*t1.d*f-e) then 13 else a end) from t1 where -t1.d<>19),(a))*d+a then t1.d when exists(select 1 from t1 where b=d) then t1.f else 17 end*11) | count(*)-max(t1.e) from t1) FROM t1 WHERE NOT (19 in (select max(b) from t1 union select count(*) from t1) and +t1.b+c*d+coalesce((select max(17) from t1 where case when t1.a=coalesce((select max((select (min(t1.f)) from t1)) from t1 where not case when not exists(select 1 from t1 where ( -t1.b)=13 and d in (f,c,e)) or 17 between 17 and e then t1.e-t1.c else 11 end>=d),19)-11 then 11 else 17 end<=t1.a),t1.f)+t1.f-f<>17)} -} {-497} -do_test randexpr-2.748 { - db eval {SELECT (select -~count(distinct ~+case when c<>coalesce((select max(case when ~13 in (t1.a,t1.f,13+t1.d+(19)*t1.d*f-e) then 13 else a end) from t1 where -t1.d<>19),(a))*d+a then t1.d when exists(select 1 from t1 where b=d) then t1.f else 17 end*11) & count(*)-max(t1.e) from t1) FROM t1 WHERE NOT (19 in (select max(b) from t1 union select count(*) from t1) and +t1.b+c*d+coalesce((select max(17) from t1 where case when t1.a=coalesce((select max((select (min(t1.f)) from t1)) from t1 where not case when not exists(select 1 from t1 where ( -t1.b)=13 and d in (f,c,e)) or 17 between 17 and e then t1.e-t1.c else 11 end>=d),19)-11 then 11 else 17 end<=t1.a),t1.f)+t1.f-f<>17)} -} {0} -do_test randexpr-2.749 { - db eval {SELECT coalesce((select max(a) from t1 where exists(select 1 from t1 where (abs(t1.f)/abs(case when (t1.a+case when exists(select 1 from t1 where t1.e>=(abs(coalesce((select f from t1 where (((b>=t1.d) or t1.e= -a) or 17=a)),case when t1.d between t1.a and b then t1.b when e in (e,t1.a,t1.e) then 13 else (f) end))/abs(13))) then 11 else t1.d end* - -t1.f)<=c then d else t1.d end))-t1.c-19>=t1.a)),((t1.b))) FROM t1 WHERE case when t1.f in (e,19,(abs(t1.e)/abs(t1.e))) and (17 between 11+(select +max(case case when f=(t1.b) then e when t1.e in (13,19,c) then c else -t1.b end- -c when (13) then d else t1.f end) from t1) and 17 and (19 in (b,t1.d,11))) and f not between 19 and b then e when 13 not between (t1.e) and t1.a then 11 else 11 end not between d and t1.a} -} {200} -do_test randexpr-2.750 { - db eval {SELECT coalesce((select max(a) from t1 where exists(select 1 from t1 where (abs(t1.f)/abs(case when (t1.a+case when exists(select 1 from t1 where t1.e>=(abs(coalesce((select f from t1 where (((b>=t1.d) or t1.e= -a) or 17=a)),case when t1.d between t1.a and b then t1.b when e in (e,t1.a,t1.e) then 13 else (f) end))/abs(13))) then 11 else t1.d end* - -t1.f)<=c then d else t1.d end))-t1.c-19>=t1.a)),((t1.b))) FROM t1 WHERE NOT (case when t1.f in (e,19,(abs(t1.e)/abs(t1.e))) and (17 between 11+(select +max(case case when f=(t1.b) then e when t1.e in (13,19,c) then c else -t1.b end- -c when (13) then d else t1.f end) from t1) and 17 and (19 in (b,t1.d,11))) and f not between 19 and b then e when 13 not between (t1.e) and t1.a then 11 else 11 end not between d and t1.a)} -} {} -do_test randexpr-2.751 { - db eval {SELECT 11-17 | case when 11=c or 11 in (select cast(avg(t1.c) AS integer)-case cast(avg(t1.b) AS integer) when count(distinct e) then min(t1.a) else -count(distinct 19) end from t1 union select count(*) from t1) or e in (t1.e,t1.b,b) or 13=t1.f and e>=t1.a then e else e end when ( -19<=e) then 13 else e end+a FROM t1 WHERE t1.c*d not in ( -t1.a,coalesce((select d from t1 where coalesce((select c from t1 where ((d<=11))),(17)+(abs(coalesce((select (select ( -+count(*))+count(distinct d) from t1) from t1 where (coalesce((select b from t1 where ~a<>13),(t1.c))) not between d and t1.d),17))/abs(d)))*f17),e),t1.b)} -} {-1} -do_test randexpr-2.752 { - db eval {SELECT 11-17 | case when 11=c or 11 in (select cast(avg(t1.c) AS integer)-case cast(avg(t1.b) AS integer) when count(distinct e) then min(t1.a) else -count(distinct 19) end from t1 union select count(*) from t1) or e in (t1.e,t1.b,b) or 13=t1.f and e>=t1.a then e else e end when ( -19<=e) then 13 else e end+a FROM t1 WHERE NOT (t1.c*d not in ( -t1.a,coalesce((select d from t1 where coalesce((select c from t1 where ((d<=11))),(17)+(abs(coalesce((select (select ( -+count(*))+count(distinct d) from t1) from t1 where (coalesce((select b from t1 where ~a<>13),(t1.c))) not between d and t1.d),17))/abs(d)))*f17),e),t1.b))} -} {} -do_test randexpr-2.753 { - db eval {SELECT 11-17 & case when 11=c or 11 in (select cast(avg(t1.c) AS integer)-case cast(avg(t1.b) AS integer) when count(distinct e) then min(t1.a) else -count(distinct 19) end from t1 union select count(*) from t1) or e in (t1.e,t1.b,b) or 13=t1.f and e>=t1.a then e else e end when ( -19<=e) then 13 else e end+a FROM t1 WHERE t1.c*d not in ( -t1.a,coalesce((select d from t1 where coalesce((select c from t1 where ((d<=11))),(17)+(abs(coalesce((select (select ( -+count(*))+count(distinct d) from t1) from t1 where (coalesce((select b from t1 where ~a<>13),(t1.c))) not between d and t1.d),17))/abs(d)))*f17),e),t1.b)} -} {112} -do_test randexpr-2.754 { - db eval {SELECT (abs(f-case when +(t1.f)-c13 and -ft1.c then 11 else -11 end<>t1.c and t1.f not between (11) and (t1.f) then b else 11 end)*b+t1.f,a,t1.d)) then 11 else t1.d end=e) or e<(t1.f)} -} {99} -do_test randexpr-2.755 { - db eval {SELECT (abs(f-case when +(t1.f)-c13 and -ft1.c then 11 else -11 end<>t1.c and t1.f not between (11) and (t1.f) then b else 11 end)*b+t1.f,a,t1.d)) then 11 else t1.d end=e) or e<(t1.f))} -} {} -do_test randexpr-2.756 { - db eval {SELECT (abs(f-case when +(t1.f)-c13 and -ft1.c then 11 else -11 end<>t1.c and t1.f not between (11) and (t1.f) then b else 11 end)*b+t1.f,a,t1.d)) then 11 else t1.d end=e) or e<(t1.f)} -} {99} -do_test randexpr-2.757 { - db eval {SELECT +(select (max(case when not (((exists(select 1 from t1 where b not between t1.a and t1.d) or t1.a>=coalesce((select max(17) from t1 where -t1.e between t1.e and a),f)-11) or 11<=t1.c)) then b when 19 between 19 and b then t1.f else +d+ -t1.a-t1.f-e end | f-t1.b+ -t1.b)+min(t1.b)) from t1)*t1.c FROM t1 WHERE b in (t1.b-b,coalesce((select max(e) from t1 where t1.d not between 11 and case when d>=+13 then case when t1.a between e and a then t1.c else (t1.f)+(t1.b) end else case (d)*e when b then f else a end end or t1.d in (select cast(avg(d) AS integer) from t1 union select +abs( -max(e))*max(19) | max(d) from t1)),11),t1.c)} -} {} -do_test randexpr-2.758 { - db eval {SELECT +(select (max(case when not (((exists(select 1 from t1 where b not between t1.a and t1.d) or t1.a>=coalesce((select max(17) from t1 where -t1.e between t1.e and a),f)-11) or 11<=t1.c)) then b when 19 between 19 and b then t1.f else +d+ -t1.a-t1.f-e end | f-t1.b+ -t1.b)+min(t1.b)) from t1)*t1.c FROM t1 WHERE NOT (b in (t1.b-b,coalesce((select max(e) from t1 where t1.d not between 11 and case when d>=+13 then case when t1.a between e and a then t1.c else (t1.f)+(t1.b) end else case (d)*e when b then f else a end end or t1.d in (select cast(avg(d) AS integer) from t1 union select +abs( -max(e))*max(19) | max(d) from t1)),11),t1.c))} -} {278400} -do_test randexpr-2.759 { - db eval {SELECT +(select (max(case when not (((exists(select 1 from t1 where b not between t1.a and t1.d) or t1.a>=coalesce((select max(17) from t1 where -t1.e between t1.e and a),f)-11) or 11<=t1.c)) then b when 19 between 19 and b then t1.f else +d+ -t1.a-t1.f-e end & f-t1.b+ -t1.b)+min(t1.b)) from t1)*t1.c FROM t1 WHERE NOT (b in (t1.b-b,coalesce((select max(e) from t1 where t1.d not between 11 and case when d>=+13 then case when t1.a between e and a then t1.c else (t1.f)+(t1.b) end else case (d)*e when b then f else a end end or t1.d in (select cast(avg(d) AS integer) from t1 union select +abs( -max(e))*max(19) | max(d) from t1)),11),t1.c))} -} {81600} -do_test randexpr-2.760 { - db eval {SELECT t1.e*t1.c*(select count(*)+abs(cast(avg(case t1.a when (select -count(*)-(min(t1.a)) | +(abs(case max(a) when abs(min(17)) then +cast(avg(a) AS integer) | count(distinct d) else count(*) end)) from t1) then a else -+b-coalesce((select max(f*19) from t1 where ~~c in (a,13,t1.a)),t1.b) end) AS integer)) from t1) FROM t1 WHERE 19-(abs(b)/abs(t1.b)) | case when t1.e in (select case (+cast(avg(t1.c+a) AS integer) | (cast(avg(t1.d) AS integer) | -cast(avg( -d) AS integer)* -( -count(*))+min(17))) when min(13) then max( -11) else count(*) end from t1 union select min(17) from t1) or 13 in (case when t1.e between e and coalesce((select c from t1 where not exists(select 1 from t1 where (b)>=t1.e)),t1.b) then 19 else 11 end,17,f) then 11 else b end in (select c from t1 union select 19 from t1)} -} {} -do_test randexpr-2.761 { - db eval {SELECT t1.e*t1.c*(select count(*)+abs(cast(avg(case t1.a when (select -count(*)-(min(t1.a)) | +(abs(case max(a) when abs(min(17)) then +cast(avg(a) AS integer) | count(distinct d) else count(*) end)) from t1) then a else -+b-coalesce((select max(f*19) from t1 where ~~c in (a,13,t1.a)),t1.b) end) AS integer)) from t1) FROM t1 WHERE NOT (19-(abs(b)/abs(t1.b)) | case when t1.e in (select case (+cast(avg(t1.c+a) AS integer) | (cast(avg(t1.d) AS integer) | -cast(avg( -d) AS integer)* -( -count(*))+min(17))) when min(13) then max( -11) else count(*) end from t1 union select min(17) from t1) or 13 in (case when t1.e between e and coalesce((select c from t1 where not exists(select 1 from t1 where (b)>=t1.e)),t1.b) then 19 else 11 end,17,f) then 11 else b end in (select c from t1 union select 19 from t1))} -} {60150000} -do_test randexpr-2.762 { - db eval {SELECT t1.e*t1.c*(select count(*)+abs(cast(avg(case t1.a when (select -count(*)-(min(t1.a)) & +(abs(case max(a) when abs(min(17)) then +cast(avg(a) AS integer) & count(distinct d) else count(*) end)) from t1) then a else -+b-coalesce((select max(f*19) from t1 where ~~c in (a,13,t1.a)),t1.b) end) AS integer)) from t1) FROM t1 WHERE NOT (19-(abs(b)/abs(t1.b)) | case when t1.e in (select case (+cast(avg(t1.c+a) AS integer) | (cast(avg(t1.d) AS integer) | -cast(avg( -d) AS integer)* -( -count(*))+min(17))) when min(13) then max( -11) else count(*) end from t1 union select min(17) from t1) or 13 in (case when t1.e between e and coalesce((select c from t1 where not exists(select 1 from t1 where (b)>=t1.e)),t1.b) then 19 else 11 end,17,f) then 11 else b end in (select c from t1 union select 19 from t1))} -} {60150000} -do_test randexpr-2.763 { - db eval {SELECT t1.b+case when e+(select abs(abs(min(d+case 11 when t1.d+19 | b | case when e<=b+coalesce((select 11 from t1 where 11<>13),17)-17 then t1.d else d end+19 then 11 else d end))) from t1)- -d-(t1.e) in (select 17 from t1 union select 11 from t1) then t1.e when exists(select 1 from t1 where e>t1.c) then t1.b else 13 end FROM t1 WHERE e in (select count(*) from t1 union select min(case when (select abs(cast(avg(+17) AS integer)) from t1) not between t1.e and 17+t1.f then f when ((case when ((select cast(avg(t1.d) AS integer) from t1)=17) then 19 else t1.f end)<>t1.c or t1.a in (select -+abs(cast(avg(t1.b) AS integer)) from t1 union select +((cast(avg(11) AS integer)))+ -min(b) from t1)) or not exists(select 1 from t1 where ((t1.d in (b,a,17)) and f<=t1.a)) and t1.f<> - -t1.a then d else - -t1.d end) from t1)} -} {} -do_test randexpr-2.764 { - db eval {SELECT t1.b+case when e+(select abs(abs(min(d+case 11 when t1.d+19 | b | case when e<=b+coalesce((select 11 from t1 where 11<>13),17)-17 then t1.d else d end+19 then 11 else d end))) from t1)- -d-(t1.e) in (select 17 from t1 union select 11 from t1) then t1.e when exists(select 1 from t1 where e>t1.c) then t1.b else 13 end FROM t1 WHERE NOT (e in (select count(*) from t1 union select min(case when (select abs(cast(avg(+17) AS integer)) from t1) not between t1.e and 17+t1.f then f when ((case when ((select cast(avg(t1.d) AS integer) from t1)=17) then 19 else t1.f end)<>t1.c or t1.a in (select -+abs(cast(avg(t1.b) AS integer)) from t1 union select +((cast(avg(11) AS integer)))+ -min(b) from t1)) or not exists(select 1 from t1 where ((t1.d in (b,a,17)) and f<=t1.a)) and t1.f<> - -t1.a then d else - -t1.d end) from t1))} -} {400} -do_test randexpr-2.765 { - db eval {SELECT t1.b+case when e+(select abs(abs(min(d+case 11 when t1.d+19 & b & case when e<=b+coalesce((select 11 from t1 where 11<>13),17)-17 then t1.d else d end+19 then 11 else d end))) from t1)- -d-(t1.e) in (select 17 from t1 union select 11 from t1) then t1.e when exists(select 1 from t1 where e>t1.c) then t1.b else 13 end FROM t1 WHERE NOT (e in (select count(*) from t1 union select min(case when (select abs(cast(avg(+17) AS integer)) from t1) not between t1.e and 17+t1.f then f when ((case when ((select cast(avg(t1.d) AS integer) from t1)=17) then 19 else t1.f end)<>t1.c or t1.a in (select -+abs(cast(avg(t1.b) AS integer)) from t1 union select +((cast(avg(11) AS integer)))+ -min(b) from t1)) or not exists(select 1 from t1 where ((t1.d in (b,a,17)) and f<=t1.a)) and t1.f<> - -t1.a then d else - -t1.d end) from t1))} -} {400} -do_test randexpr-2.766 { - db eval {SELECT (select cast(avg( -coalesce((select max(+(abs(t1.d)/abs(~d))*+c*t1.c) from t1 where e in (select coalesce((select f from t1 where t1.f<> -11),17)+c*19 from t1 union select f from t1)),t1.c)) AS integer)-~case ~count(distinct 17)*count(distinct 19) when count(distinct t1.c)*count(*)-count(distinct 19) then +(max(a)+case - - - -min(t1.f) when max(c) then count(distinct (f)) else min(13) end) else ( -cast(avg( -t1.b) AS integer)) end from t1) FROM t1 WHERE exists(select 1 from t1 where (abs(e*coalesce((select (abs(b*(t1.b)+f)/abs(d)) from t1 where t1.c in (select min(a | t1.b) from t1 union select abs(case -case ~ -~cast(avg(e) AS integer) when ++min(17)+( -cast(avg(a) AS integer))-max(t1.c) then cast(avg(t1.b) AS integer) else cast(avg(f) AS integer) end when - -max((t1.d)) then -min(t1.b) else cast(avg(t1.c) AS integer) end) from t1)),b))/abs(t1.d)) in (select min(t1.c)-cast(avg( -e) AS integer)- -cast(avg(t1.f) AS integer) from t1 union select (max((19))) from t1))} -} {} -do_test randexpr-2.767 { - db eval {SELECT (select cast(avg( -coalesce((select max(+(abs(t1.d)/abs(~d))*+c*t1.c) from t1 where e in (select coalesce((select f from t1 where t1.f<> -11),17)+c*19 from t1 union select f from t1)),t1.c)) AS integer)-~case ~count(distinct 17)*count(distinct 19) when count(distinct t1.c)*count(*)-count(distinct 19) then +(max(a)+case - - - -min(t1.f) when max(c) then count(distinct (f)) else min(13) end) else ( -cast(avg( -t1.b) AS integer)) end from t1) FROM t1 WHERE NOT (exists(select 1 from t1 where (abs(e*coalesce((select (abs(b*(t1.b)+f)/abs(d)) from t1 where t1.c in (select min(a | t1.b) from t1 union select abs(case -case ~ -~cast(avg(e) AS integer) when ++min(17)+( -cast(avg(a) AS integer))-max(t1.c) then cast(avg(t1.b) AS integer) else cast(avg(f) AS integer) end when - -max((t1.d)) then -min(t1.b) else cast(avg(t1.c) AS integer) end) from t1)),b))/abs(t1.d)) in (select min(t1.c)-cast(avg( -e) AS integer)- -cast(avg(t1.f) AS integer) from t1 union select (max((19))) from t1)))} -} {-99} -do_test randexpr-2.768 { - db eval {SELECT t1.a+11*coalesce((select max( -t1.e-coalesce((select max((abs(t1.c)/abs((13*e+t1.c)-t1.f))) from t1 where exists(select 1 from t1 where d<>a) or ~(select case abs(count(distinct f)) when (count(*)) then count(*) else min(t1.f) end from t1)+coalesce((select f from t1 where d in (select min(t1.d) from t1 union select count(*) from t1)),c) in (11,t1.a,t1.b)),11)- -11) from t1 where 13<11),t1.b) FROM t1 WHERE not ++coalesce((select t1.f from t1 where not exists(select 1 from t1 where ((select min(b) from t1)<>case t1.d when coalesce((select max(case e-t1.c when 19-t1.c+f+(t1.c*coalesce((select max(17) from t1 where 17 between 11 and t1.a),t1.d)+b) then -17 else d end-a) from t1 where t1.d>11),b) then 11 else c end))),b | t1.d)*17 not between t1.e and 17} -} {} -do_test randexpr-2.769 { - db eval {SELECT t1.a+11*coalesce((select max( -t1.e-coalesce((select max((abs(t1.c)/abs((13*e+t1.c)-t1.f))) from t1 where exists(select 1 from t1 where d<>a) or ~(select case abs(count(distinct f)) when (count(*)) then count(*) else min(t1.f) end from t1)+coalesce((select f from t1 where d in (select min(t1.d) from t1 union select count(*) from t1)),c) in (11,t1.a,t1.b)),11)- -11) from t1 where 13<11),t1.b) FROM t1 WHERE NOT (not ++coalesce((select t1.f from t1 where not exists(select 1 from t1 where ((select min(b) from t1)<>case t1.d when coalesce((select max(case e-t1.c when 19-t1.c+f+(t1.c*coalesce((select max(17) from t1 where 17 between 11 and t1.a),t1.d)+b) then -17 else d end-a) from t1 where t1.d>11),b) then 11 else c end))),b | t1.d)*17 not between t1.e and 17)} -} {2300} -do_test randexpr-2.770 { - db eval {SELECT coalesce((select max(coalesce((select ((abs(coalesce((select max((select ~(count(distinct e-11)-cast(avg(t1.a) AS integer) | count(*)) from t1)) from t1 where t1.fb or t1.c in (select c from t1 union select 19 from t1)),e | b))/abs(t1.f))) from t1 where e in (select -(b) from t1 union select 13 from t1)),t1.a)) from t1 where f<>11),t1.e) FROM t1 WHERE -11 in (a,case when exists(select 1 from t1 where 11 in (select 13 from t1 union select t1.d from t1)) and exists(select 1 from t1 where exists(select 1 from t1 where (t1.a) not between t1.c and t1.c)) then ~case when ~t1.f not between +t1.b-11 and e or not b in (c,17,e) and (not exists(select 1 from t1 where b in (( -t1.e), -t1.c,t1.c))) or 17 not in (t1.e,t1.c,t1.f) then c when 19= - -11 then t1.b else t1.c end when (13) between t1.f and ( -t1.e) then t1.d else -t1.d end*c,d)} -} {} -do_test randexpr-2.771 { - db eval {SELECT coalesce((select max(coalesce((select ((abs(coalesce((select max((select ~(count(distinct e-11)-cast(avg(t1.a) AS integer) | count(*)) from t1)) from t1 where t1.fb or t1.c in (select c from t1 union select 19 from t1)),e | b))/abs(t1.f))) from t1 where e in (select -(b) from t1 union select 13 from t1)),t1.a)) from t1 where f<>11),t1.e) FROM t1 WHERE NOT ( -11 in (a,case when exists(select 1 from t1 where 11 in (select 13 from t1 union select t1.d from t1)) and exists(select 1 from t1 where exists(select 1 from t1 where (t1.a) not between t1.c and t1.c)) then ~case when ~t1.f not between +t1.b-11 and e or not b in (c,17,e) and (not exists(select 1 from t1 where b in (( -t1.e), -t1.c,t1.c))) or 17 not in (t1.e,t1.c,t1.f) then c when 19= - -11 then t1.b else t1.c end when (13) between t1.f and ( -t1.e) then t1.d else -t1.d end*c,d))} -} {100} -do_test randexpr-2.772 { - db eval {SELECT coalesce((select max(coalesce((select ((abs(coalesce((select max((select ~(count(distinct e-11)-cast(avg(t1.a) AS integer) & count(*)) from t1)) from t1 where t1.fb or t1.c in (select c from t1 union select 19 from t1)),e & b))/abs(t1.f))) from t1 where e in (select -(b) from t1 union select 13 from t1)),t1.a)) from t1 where f<>11),t1.e) FROM t1 WHERE NOT ( -11 in (a,case when exists(select 1 from t1 where 11 in (select 13 from t1 union select t1.d from t1)) and exists(select 1 from t1 where exists(select 1 from t1 where (t1.a) not between t1.c and t1.c)) then ~case when ~t1.f not between +t1.b-11 and e or not b in (c,17,e) and (not exists(select 1 from t1 where b in (( -t1.e), -t1.c,t1.c))) or 17 not in (t1.e,t1.c,t1.f) then c when 19= - -11 then t1.b else t1.c end when (13) between t1.f and ( -t1.e) then t1.d else -t1.d end*c,d))} -} {100} -do_test randexpr-2.773 { - db eval {SELECT 17-13-case 19 when 17+case case t1.b when t1.b then coalesce((select coalesce((select 11 from t1 where (coalesce((select t1.a from t1 where (abs(f)/abs(case t1.e when 11 then a else t1.c end))19 or d not between f and t1.e),(t1.c)) else 11 end when -a then 13 else e end then t1.b else b end+t1.c FROM t1 WHERE not exists(select 1 from t1 where coalesce((select e from t1 where case when not exists(select 1 from t1 where not not exists(select 1 from t1 where f<> -t1.e-t1.c)) or coalesce((select max(17+t1.c) from t1 where t1.f in (select cast(avg(17) AS integer) from t1 union select cast(avg(t1.c) AS integer) from t1)),t1.d)<>19 then 19 else t1.a+ -(b)+t1.c end<=t1.c),t1.b)>t1.d) or (e) in (t1.c,f,13) or d in (select +count(*) from t1 union select count(*) from t1)} -} {} -do_test randexpr-2.774 { - db eval {SELECT 17-13-case 19 when 17+case case t1.b when t1.b then coalesce((select coalesce((select 11 from t1 where (coalesce((select t1.a from t1 where (abs(f)/abs(case t1.e when 11 then a else t1.c end))19 or d not between f and t1.e),(t1.c)) else 11 end when -a then 13 else e end then t1.b else b end+t1.c FROM t1 WHERE NOT (not exists(select 1 from t1 where coalesce((select e from t1 where case when not exists(select 1 from t1 where not not exists(select 1 from t1 where f<> -t1.e-t1.c)) or coalesce((select max(17+t1.c) from t1 where t1.f in (select cast(avg(17) AS integer) from t1 union select cast(avg(t1.c) AS integer) from t1)),t1.d)<>19 then 19 else t1.a+ -(b)+t1.c end<=t1.c),t1.b)>t1.d) or (e) in (t1.c,f,13) or d in (select +count(*) from t1 union select count(*) from t1))} -} {104} -do_test randexpr-2.775 { - db eval {SELECT t1.e*(abs(coalesce((select max(case when t1.c in (select (case when d>13 then t1.c else 11 end+e) from t1 union select t1.a from t1) or t1.a between 17 and c then c when t1.d>=a then t1.c else t1.e end-t1.e*t1.b-d) from t1 where b<>(t1.c) or not exists(select 1 from t1 where b in (t1.d,13,a))),11)*t1.a)/abs(t1.a))+t1.c FROM t1 WHERE a>c} -} {} -do_test randexpr-2.776 { - db eval {SELECT t1.e*(abs(coalesce((select max(case when t1.c in (select (case when d>13 then t1.c else 11 end+e) from t1 union select t1.a from t1) or t1.a between 17 and c then c when t1.d>=a then t1.c else t1.e end-t1.e*t1.b-d) from t1 where b<>(t1.c) or not exists(select 1 from t1 where b in (t1.d,13,a))),11)*t1.a)/abs(t1.a))+t1.c FROM t1 WHERE NOT (a>c)} -} {50050300} -do_test randexpr-2.777 { - db eval {SELECT t1.d*(+coalesce((select max(case when coalesce((select (abs(f)/abs((abs(d)/abs((select cast(avg(19+11) AS integer) from t1)))+t1.b)) from t1 where exists(select 1 from t1 where t1.d not between t1.f and t1.e)),17) not in (17,t1.f, -t1.b) then 19 else -19 end) from t1 where exists(select 1 from t1 where 11 in (select abs(count(distinct t1.f)) from t1 union select cast(avg(t1.e) AS integer) from t1) and exists(select 1 from t1 where t1.f -11),(17)) | b-19*d FROM t1 WHERE b>coalesce((select max(13+d) from t1 where 17>=11),t1.b)} -} {} -do_test randexpr-2.780 { - db eval {SELECT coalesce((select max(coalesce((select (select cast(avg(d) AS integer) | case max(~f) | count(distinct t1.d) when count(*) then count(*) else -min(17) end from t1) from t1 where b=t1.e+ -e or t1.a not in (t1.f,t1.d,t1.d) or f not in (t1.a, -t1.b,f)),t1.c)+b | 13-d) from t1 where t1.b> -11),(17)) | b-19*d FROM t1 WHERE NOT (b>coalesce((select max(13+d) from t1 where 17>=11),t1.b))} -} {-1} -do_test randexpr-2.781 { - db eval {SELECT coalesce((select max(coalesce((select (select cast(avg(d) AS integer) & case max(~f) & count(distinct t1.d) when count(*) then count(*) else -min(17) end from t1) from t1 where b=t1.e+ -e or t1.a not in (t1.f,t1.d,t1.d) or f not in (t1.a, -t1.b,f)),t1.c)+b & 13-d) from t1 where t1.b> -11),(17)) & b-19*d FROM t1 WHERE NOT (b>coalesce((select max(13+d) from t1 where 17>=11),t1.b))} -} {8} -do_test randexpr-2.782 { - db eval {SELECT (d+f*t1.c-t1.e+coalesce((select c from t1 where c>=a),case when (c in (select e from t1 union select 13 from t1)) then 11+a else f end))-13 FROM t1 WHERE c not between c and b+coalesce((select c from t1 where t1.d=a),case when (c in (select e from t1 union select 13 from t1)) then 11+a else f end))-13 FROM t1 WHERE NOT (c not between c and b+coalesce((select c from t1 where t1.d=d then (abs(13)/abs(t1.f)) when (d in ((select abs(min(19)) from t1), -(select count(*)-abs( -count(*)) from t1),t1.e)) then coalesce((select max(19) from t1 where (c)>t1.f),17) else 13 end<>a then 11 when b<(d) then b else c end,d) then 17 when (17 in (13,t1.a,t1.c)) then e else c end+t1.c FROM t1 WHERE t1.a+t1.e in (select 19 from t1 union select t1.c from t1)} -} {} -do_test randexpr-2.785 { - db eval {SELECT case when t1.e not in (t1.a,~case when case when 17>=d then (abs(13)/abs(t1.f)) when (d in ((select abs(min(19)) from t1), -(select count(*)-abs( -count(*)) from t1),t1.e)) then coalesce((select max(19) from t1 where (c)>t1.f),17) else 13 end<>a then 11 when b<(d) then b else c end,d) then 17 when (17 in (13,t1.a,t1.c)) then e else c end+t1.c FROM t1 WHERE NOT (t1.a+t1.e in (select 19 from t1 union select t1.c from t1))} -} {317} -do_test randexpr-2.786 { - db eval {SELECT (select ~cast(avg(t1.c) AS integer)*case count(*) | +min(case +case when a<13 or case t1.f when c then 17 else t1.d end in (11,a,(t1.a)) and a<>a then t1.b+f when f not in (d,t1.a,c) then t1.f else t1.e end when t1.f then 17 else f end)+abs(++count(distinct 19))*(count(distinct 13))-count(distinct t1.e)-(count(*))*max(19) when max(11) then cast(avg(a) AS integer) else min(t1.f) end from t1) FROM t1 WHERE t1.a not between 17 and d} -} {} -do_test randexpr-2.787 { - db eval {SELECT (select ~cast(avg(t1.c) AS integer)*case count(*) | +min(case +case when a<13 or case t1.f when c then 17 else t1.d end in (11,a,(t1.a)) and a<>a then t1.b+f when f not in (d,t1.a,c) then t1.f else t1.e end when t1.f then 17 else f end)+abs(++count(distinct 19))*(count(distinct 13))-count(distinct t1.e)-(count(*))*max(19) when max(11) then cast(avg(a) AS integer) else min(t1.f) end from t1) FROM t1 WHERE NOT (t1.a not between 17 and d)} -} {-180600} -do_test randexpr-2.788 { - db eval {SELECT (select ~cast(avg(t1.c) AS integer)*case count(*) & +min(case +case when a<13 or case t1.f when c then 17 else t1.d end in (11,a,(t1.a)) and a<>a then t1.b+f when f not in (d,t1.a,c) then t1.f else t1.e end when t1.f then 17 else f end)+abs(++count(distinct 19))*(count(distinct 13))-count(distinct t1.e)-(count(*))*max(19) when max(11) then cast(avg(a) AS integer) else min(t1.f) end from t1) FROM t1 WHERE NOT (t1.a not between 17 and d)} -} {-180600} -do_test randexpr-2.789 { - db eval {SELECT case t1.a when c then -~t1.d*t1.e-coalesce((select max((abs(d+e+d)/abs(case when 11-t1.d in (select t1.d from t1 union select coalesce((select t1.c from t1 where 17<=t1.d and e between 11 and a),c) from t1) or 11 in (select ( -+(count(*))) from t1 union select count(distinct -t1.a) from t1) then (f) when b=a then c else t1.b end))) from t1 where t1.c not between 17 and t1.b),13)+t1.f else d end FROM t1 WHERE not exists(select 1 from t1 where f<=a)} -} {400} -do_test randexpr-2.790 { - db eval {SELECT case t1.a when c then -~t1.d*t1.e-coalesce((select max((abs(d+e+d)/abs(case when 11-t1.d in (select t1.d from t1 union select coalesce((select t1.c from t1 where 17<=t1.d and e between 11 and a),c) from t1) or 11 in (select ( -+(count(*))) from t1 union select count(distinct -t1.a) from t1) then (f) when b=a then c else t1.b end))) from t1 where t1.c not between 17 and t1.b),13)+t1.f else d end FROM t1 WHERE NOT (not exists(select 1 from t1 where f<=a))} -} {} -do_test randexpr-2.791 { - db eval {SELECT (select -max(d) from t1)+coalesce((select max(t1.e*t1.d*f) from t1 where t1.b-coalesce((select -a*d from t1 where t1.c not in (t1.f,coalesce((select b+t1.b from t1 where t1.a not between f and t1.b),coalesce((select -b from t1 where (t1.d>=t1.c) and 19<>t1.f),t1.a))-e*a,e)),(t1.a))+t1.f between 19 and e),t1.a)*a FROM t1 WHERE exists(select 1 from t1 where not exists(select 1 from t1 where case when t1.d-t1.b-t1.d*(case when t1.b>= -t1.d then c when t1.d not between c and t1.d then (19) else d end*e)+t1.d | 19>t1.c then e when exists(select 1 from t1 where t1.e not between d and t1.b or (17 in (t1.e, - -a,t1.d))) then t1.f else (e) end between 13 and e or 11>t1.b))} -} {9600} -do_test randexpr-2.792 { - db eval {SELECT (select -max(d) from t1)+coalesce((select max(t1.e*t1.d*f) from t1 where t1.b-coalesce((select -a*d from t1 where t1.c not in (t1.f,coalesce((select b+t1.b from t1 where t1.a not between f and t1.b),coalesce((select -b from t1 where (t1.d>=t1.c) and 19<>t1.f),t1.a))-e*a,e)),(t1.a))+t1.f between 19 and e),t1.a)*a FROM t1 WHERE NOT (exists(select 1 from t1 where not exists(select 1 from t1 where case when t1.d-t1.b-t1.d*(case when t1.b>= -t1.d then c when t1.d not between c and t1.d then (19) else d end*e)+t1.d | 19>t1.c then e when exists(select 1 from t1 where t1.e not between d and t1.b or (17 in (t1.e, - -a,t1.d))) then t1.f else (e) end between 13 and e or 11>t1.b)))} -} {} -do_test randexpr-2.793 { - db eval {SELECT 11-t1.d-t1.e-case when (select count(distinct t1.b+coalesce((select max((abs(19)/abs(case when coalesce((select t1.f from t1 where e not between t1.f and t1.f),f)*( -11)=((e)) then 11 else d end))) from t1 where e in (17,t1.b,t1.b)), -t1.a)-(t1.c)) from t1)>t1.f then t1.b when 11>13 and a>=f then 11 else d end-t1.f FROM t1 WHERE (select min(d)-case cast(avg(case (d-~t1.c+~(select max(+d-coalesce((select max(t1.f) from t1 where c<>e),t1.a))-(( - -(cast(avg(13) AS integer)))-count(distinct e))*max(17) from t1) | 19-13*b) when -t1.d then 13 else -13 end) AS integer) when min(t1.c) then cast(avg(e) AS integer) else ~count(*) end from t1)t1.f then t1.b when 11>13 and a>=f then 11 else d end-t1.f FROM t1 WHERE NOT ((select min(d)-case cast(avg(case (d-~t1.c+~(select max(+d-coalesce((select max(t1.f) from t1 where c<>e),t1.a))-(( - -(cast(avg(13) AS integer)))-count(distinct e))*max(17) from t1) | 19-13*b) when -t1.d then 13 else -13 end) AS integer) when min(t1.c) then cast(avg(e) AS integer) else ~count(*) end from t1)(c) then t1.d else 13 end end FROM t1 WHERE not ((abs(f)/abs(t1.b))<=(select min(+t1.d)+~+case count(distinct (abs(case d when 11 then coalesce((select coalesce((select max(t1.a) from t1 where t1.b=t1.e),t1.f) | a from t1 where 13<>(a)),d) else 17 end*f)/abs(t1.f))) when cast(avg(t1.c) AS integer) then case count(*) when min(t1.b) | cast(avg(t1.c) AS integer) then count(distinct f) else max(17) end else cast(avg((c)) AS integer) end from t1))} -} {} -do_test randexpr-2.796 { - db eval {SELECT case f when 13 then 19 else case when (case when c not between b and d then t1.c when +~t1.d+(select -+cast(avg(t1.a) AS integer) | ((max(t1.d)))*(max(e)) from t1)-19+t1.a*t1.d in (select ~max(c) from t1 union select count(distinct d)-count(distinct b) from t1) then f else -11 end not between 11 and 11) or 17>(c) then t1.d else 13 end end FROM t1 WHERE NOT (not ((abs(f)/abs(t1.b))<=(select min(+t1.d)+~+case count(distinct (abs(case d when 11 then coalesce((select coalesce((select max(t1.a) from t1 where t1.b=t1.e),t1.f) | a from t1 where 13<>(a)),d) else 17 end*f)/abs(t1.f))) when cast(avg(t1.c) AS integer) then case count(*) when min(t1.b) | cast(avg(t1.c) AS integer) then count(distinct f) else max(17) end else cast(avg((c)) AS integer) end from t1)))} -} {400} -do_test randexpr-2.797 { - db eval {SELECT case f when 13 then 19 else case when (case when c not between b and d then t1.c when +~t1.d+(select -+cast(avg(t1.a) AS integer) & ((max(t1.d)))*(max(e)) from t1)-19+t1.a*t1.d in (select ~max(c) from t1 union select count(distinct d)-count(distinct b) from t1) then f else -11 end not between 11 and 11) or 17>(c) then t1.d else 13 end end FROM t1 WHERE NOT (not ((abs(f)/abs(t1.b))<=(select min(+t1.d)+~+case count(distinct (abs(case d when 11 then coalesce((select coalesce((select max(t1.a) from t1 where t1.b=t1.e),t1.f) | a from t1 where 13<>(a)),d) else 17 end*f)/abs(t1.f))) when cast(avg(t1.c) AS integer) then case count(*) when min(t1.b) | cast(avg(t1.c) AS integer) then count(distinct f) else max(17) end else cast(avg((c)) AS integer) end from t1)))} -} {400} -do_test randexpr-2.798 { - db eval {SELECT f+case when (not exists(select 1 from t1 where ((17<>+t1.b+t1.f or b between t1.e and t1.e)))) then (abs( -(abs(case when exists(select 1 from t1 where not exists(select 1 from t1 where d in (select (select cast(avg((t1.b)) AS integer)-count(*) from t1) from t1 union select t1.e+(11) from t1))) then c when not t1.d between f and 11 or d>a then (a) else 13 end+t1.e+e)/abs(d)))/abs(t1.b)) else f end-13 FROM t1 WHERE case when 17< - -t1.b-case when not exists(select 1 from t1 where 19<>t1.d) then 13+coalesce((select max((abs((case case when - -t1.c*11 in (select +max(t1.d)*count(distinct -t1.c) from t1 union select max(t1.b) from t1) then 13 else 19 end when f then 19 else (t1.d) end)+e)/abs(f))) from t1 where (13 between t1.d and 19)),t1.b) else 13 end then a else t1.a end-13 not in (t1.d,d,(t1.f))} -} {1187} -do_test randexpr-2.799 { - db eval {SELECT f+case when (not exists(select 1 from t1 where ((17<>+t1.b+t1.f or b between t1.e and t1.e)))) then (abs( -(abs(case when exists(select 1 from t1 where not exists(select 1 from t1 where d in (select (select cast(avg((t1.b)) AS integer)-count(*) from t1) from t1 union select t1.e+(11) from t1))) then c when not t1.d between f and 11 or d>a then (a) else 13 end+t1.e+e)/abs(d)))/abs(t1.b)) else f end-13 FROM t1 WHERE NOT (case when 17< - -t1.b-case when not exists(select 1 from t1 where 19<>t1.d) then 13+coalesce((select max((abs((case case when - -t1.c*11 in (select +max(t1.d)*count(distinct -t1.c) from t1 union select max(t1.b) from t1) then 13 else 19 end when f then 19 else (t1.d) end)+e)/abs(f))) from t1 where (13 between t1.d and 19)),t1.b) else 13 end then a else t1.a end-13 not in (t1.d,d,(t1.f)))} -} {} -do_test randexpr-2.800 { - db eval {SELECT +~t1.a-(abs(+case when (((t1.d*t1.c+11 in (select cast(avg(17) AS integer) from t1 union select -(count(*)) from t1)))) then -coalesce((select t1.e-b from t1 where not exists(select 1 from t1 where t1.c in (select max(f) from t1 union select max(e) | max( -t1.e)-count(*) from t1))),f) else f end)/abs(t1.f))-e+11+t1.b+t1.a- -17 FROM t1 WHERE +b between case when c<=t1.a then t1.b when case when -t1.a*d-17+17*~e- -13 in (select + -max(19) | +cast(avg(19) AS integer) from t1 union select (count(distinct -19)*case max((13)) when max(e)*count(*) then min(t1.d) else count(*) end) from t1) then t1.f else (d) end in (select e from t1 union select d from t1) then f else -t1.b end and b} -} {} -do_test randexpr-2.801 { - db eval {SELECT +~t1.a-(abs(+case when (((t1.d*t1.c+11 in (select cast(avg(17) AS integer) from t1 union select -(count(*)) from t1)))) then -coalesce((select t1.e-b from t1 where not exists(select 1 from t1 where t1.c in (select max(f) from t1 union select max(e) | max( -t1.e)-count(*) from t1))),f) else f end)/abs(t1.f))-e+11+t1.b+t1.a- -17 FROM t1 WHERE NOT (+b between case when c<=t1.a then t1.b when case when -t1.a*d-17+17*~e- -13 in (select + -max(19) | +cast(avg(19) AS integer) from t1 union select (count(distinct -19)*case max((13)) when max(e)*count(*) then min(t1.d) else count(*) end) from t1) then t1.f else (d) end in (select e from t1 union select d from t1) then f else -t1.b end and b)} -} {-274} -do_test randexpr-2.802 { - db eval {SELECT +~t1.a-(abs(+case when (((t1.d*t1.c+11 in (select cast(avg(17) AS integer) from t1 union select -(count(*)) from t1)))) then -coalesce((select t1.e-b from t1 where not exists(select 1 from t1 where t1.c in (select max(f) from t1 union select max(e) & max( -t1.e)-count(*) from t1))),f) else f end)/abs(t1.f))-e+11+t1.b+t1.a- -17 FROM t1 WHERE NOT (+b between case when c<=t1.a then t1.b when case when -t1.a*d-17+17*~e- -13 in (select + -max(19) | +cast(avg(19) AS integer) from t1 union select (count(distinct -19)*case max((13)) when max(e)*count(*) then min(t1.d) else count(*) end) from t1) then t1.f else (d) end in (select e from t1 union select d from t1) then f else -t1.b end and b)} -} {-274} -do_test randexpr-2.803 { - db eval {SELECT case when 19=(select ( -count(*)* -(cast(avg(t1.e) AS integer))+count(distinct 13)*min(t1.f)) | cast(avg(t1.e) AS integer) | -cast(avg(13) AS integer)-(min(d)) from t1) then 13*a when t1.a+((select min((t1.d)) from t1)) in (select t1.b from t1 union select 11 from t1) or not exists(select 1 from t1 where not exists(select 1 from t1 where - -e in (select t1.e from t1 union select t1.d from t1) or t1.d in (select count(distinct t1.a) from t1 union select count(*) from t1)) or -b=(19) and 1117 and t1.a>= -t1.b),t1.f) when t1.d then c else t1.d end end in (select count(*) from t1 union select ~abs(min(t1.a)) | count(*) from t1) then 17 when t1.f not between (e) and t1.c then f else b end+c+a end FROM t1 WHERE t1.f in (case when ~(select max(d) from t1)*t1.f>=case when 17*d17 and t1.a>= -t1.b),t1.f) when t1.d then c else t1.d end end in (select count(*) from t1 union select ~abs(min(t1.a)) | count(*) from t1) then 17 when t1.f not between (e) and t1.c then f else b end+c+a end FROM t1 WHERE NOT (t1.f in (case when ~(select max(d) from t1)*t1.f>=case when 17*d17 and t1.a>= -t1.b),t1.f) when t1.d then c else t1.d end end in (select count(*) from t1 union select ~abs(min(t1.a)) & count(*) from t1) then 17 when t1.f not between (e) and t1.c then f else b end+c+a end FROM t1 WHERE NOT (t1.f in (case when ~(select max(d) from t1)*t1.f>=case when 17*d=(select cast(avg(13) AS integer) from t1)) and (exists(select 1 from t1 where not exists(select 1 from t1 where coalesce((select t1.c from t1 where (b between d and 13)),t1.e)>13))) then case when b not between 19 and t1.c then a else 13 end+t1.b when t1.c>11 then c else b end then 13 else t1.d end*t1.f)/abs(17)) FROM t1 WHERE c not in (coalesce((select max(d) from t1 where (select min(t1.e) from t1)-17<=coalesce((select t1.c from t1 where exists(select 1 from t1 where 17<19 or coalesce((select 13 from t1 where t1.e not in (a+t1.c,t1.e*t1.a+t1.d* -a*(a)*f,((b)))),19) not in (c,t1.f,t1.b))),(select abs( -max(19)) from t1))),t1.f)-t1.b, -f,17)} -} {458} -do_test randexpr-2.812 { - db eval {SELECT (abs(case when a*case when e<+(t1.e) then e else d end+t1.f=(select cast(avg(13) AS integer) from t1)) and (exists(select 1 from t1 where not exists(select 1 from t1 where coalesce((select t1.c from t1 where (b between d and 13)),t1.e)>13))) then case when b not between 19 and t1.c then a else 13 end+t1.b when t1.c>11 then c else b end then 13 else t1.d end*t1.f)/abs(17)) FROM t1 WHERE NOT (c not in (coalesce((select max(d) from t1 where (select min(t1.e) from t1)-17<=coalesce((select t1.c from t1 where exists(select 1 from t1 where 17<19 or coalesce((select 13 from t1 where t1.e not in (a+t1.c,t1.e*t1.a+t1.d* -a*(a)*f,((b)))),19) not in (c,t1.f,t1.b))),(select abs( -max(19)) from t1))),t1.f)-t1.b, -f,17))} -} {} -do_test randexpr-2.813 { - db eval {SELECT t1.c*case when (t1.f in (select case (coalesce((select t1.d from t1 where not (coalesce((select d from t1 where f<=(11)),19)*e in (select ((min((17)) | -min(t1.b))) from t1 union select -cast(avg(t1.f) AS integer) from t1))),19)+11)*t1.a when t1.d then t1.a else f end-e-t1.a*( -17) from t1 union select c from t1) or 13 not between t1.e and b) then d+19-t1.f else t1.c end-e FROM t1 WHERE t1.f in (~t1.b,13,+e) and 11<>d-case when t1.e<>t1.b or f>t1.f and 19 not between 17 and case when (b not in (b,t1.d,a)) then e else (abs(11)/abs(d)) end and not exists(select 1 from t1 where t1.a<>c) then t1.f when not (t1.b) in (select t1.d from t1 union select t1.c from t1) then 13 else t1.b+a end} -} {} -do_test randexpr-2.814 { - db eval {SELECT t1.c*case when (t1.f in (select case (coalesce((select t1.d from t1 where not (coalesce((select d from t1 where f<=(11)),19)*e in (select ((min((17)) | -min(t1.b))) from t1 union select -cast(avg(t1.f) AS integer) from t1))),19)+11)*t1.a when t1.d then t1.a else f end-e-t1.a*( -17) from t1 union select c from t1) or 13 not between t1.e and b) then d+19-t1.f else t1.c end-e FROM t1 WHERE NOT (t1.f in (~t1.b,13,+e) and 11<>d-case when t1.e<>t1.b or f>t1.f and 19 not between 17 and case when (b not in (b,t1.d,a)) then e else (abs(11)/abs(d)) end and not exists(select 1 from t1 where t1.a<>c) then t1.f when not (t1.b) in (select t1.d from t1 union select t1.c from t1) then 13 else t1.b+a end)} -} {-54800} -do_test randexpr-2.815 { - db eval {SELECT t1.c*case when (t1.f in (select case (coalesce((select t1.d from t1 where not (coalesce((select d from t1 where f<=(11)),19)*e in (select ((min((17)) & -min(t1.b))) from t1 union select -cast(avg(t1.f) AS integer) from t1))),19)+11)*t1.a when t1.d then t1.a else f end-e-t1.a*( -17) from t1 union select c from t1) or 13 not between t1.e and b) then d+19-t1.f else t1.c end-e FROM t1 WHERE NOT (t1.f in (~t1.b,13,+e) and 11<>d-case when t1.e<>t1.b or f>t1.f and 19 not between 17 and case when (b not in (b,t1.d,a)) then e else (abs(11)/abs(d)) end and not exists(select 1 from t1 where t1.a<>c) then t1.f when not (t1.b) in (select t1.d from t1 union select t1.c from t1) then 13 else t1.b+a end)} -} {-54800} -do_test randexpr-2.816 { - db eval {SELECT e-t1.e+a*f*11*c*case when ~f*t1.d-t1.c*b-13*19+(abs(t1.d)/abs(case when t1.c=13 then 17 else 19 end))*a between b*(select abs(cast(avg(( -13)) AS integer)) from t1)-19+19 and t1.b then t1.d else t1.d end+13 FROM t1 WHERE t1.b not between a and e} -} {} -do_test randexpr-2.817 { - db eval {SELECT e-t1.e+a*f*11*c*case when ~f*t1.d-t1.c*b-13*19+(abs(t1.d)/abs(case when t1.c=13 then 17 else 19 end))*a between b*(select abs(cast(avg(( -13)) AS integer)) from t1)-19+19 and t1.b then t1.d else t1.d end+13 FROM t1 WHERE NOT (t1.b not between a and e)} -} {79200000013} -do_test randexpr-2.818 { - db eval {SELECT case case when coalesce((select b from t1 where not exists(select 1 from t1 where d-e+coalesce((select max(b) from t1 where case case when t1.d-t1.e not between t1.f and e then 11 else t1.d end when t1.e then f else b end+t1.e=13),t1.c) not in (( -c),c,t1.d))),t1.f)<>a and c not in (t1.b,c,t1.a) then (select count(*) from t1) else c end-11 when t1.d then t1.e else c end FROM t1 WHERE ~b | coalesce((select case (select +count(distinct b) from t1) when coalesce((select case when coalesce((select e from t1 where c>b),t1.c) between 11 and (b) then t1.d else t1.b end-e from t1 where t1.d in (13,t1.a,f)),17) then e else 17 end from t1 where not b=t1.c or t1.d in (select abs(abs( -min(13)*(cast(avg(t1.c) AS integer)))) from t1 union select (max(c)) from t1) and b>t1.a),t1.f) in (select 11 from t1 union select c from t1)} -} {} -do_test randexpr-2.819 { - db eval {SELECT case case when coalesce((select b from t1 where not exists(select 1 from t1 where d-e+coalesce((select max(b) from t1 where case case when t1.d-t1.e not between t1.f and e then 11 else t1.d end when t1.e then f else b end+t1.e=13),t1.c) not in (( -c),c,t1.d))),t1.f)<>a and c not in (t1.b,c,t1.a) then (select count(*) from t1) else c end-11 when t1.d then t1.e else c end FROM t1 WHERE NOT (~b | coalesce((select case (select +count(distinct b) from t1) when coalesce((select case when coalesce((select e from t1 where c>b),t1.c) between 11 and (b) then t1.d else t1.b end-e from t1 where t1.d in (13,t1.a,f)),17) then e else 17 end from t1 where not b=t1.c or t1.d in (select abs(abs( -min(13)*(cast(avg(t1.c) AS integer)))) from t1 union select (max(c)) from t1) and b>t1.a),t1.f) in (select 11 from t1 union select c from t1))} -} {300} -do_test randexpr-2.820 { - db eval {SELECT case t1.c when t1.e then 19 else -case when not exists(select 1 from t1 where t1.b in (select (t1.b) from t1 union select +13 from t1)) then coalesce((select max(c*t1.b) from t1 where 17>=19*e),coalesce((select (select abs(~min(coalesce((select max(t1.a) from t1 where -19 in (f,a,13)),f)))+min(e) | ( -(min(13))) from t1) from t1 where f between -a and t1.c),t1.e)) when 19<>a then 13 else c end end FROM t1 WHERE t1.e<>f} -} {-13} -do_test randexpr-2.821 { - db eval {SELECT case t1.c when t1.e then 19 else -case when not exists(select 1 from t1 where t1.b in (select (t1.b) from t1 union select +13 from t1)) then coalesce((select max(c*t1.b) from t1 where 17>=19*e),coalesce((select (select abs(~min(coalesce((select max(t1.a) from t1 where -19 in (f,a,13)),f)))+min(e) | ( -(min(13))) from t1) from t1 where f between -a and t1.c),t1.e)) when 19<>a then 13 else c end end FROM t1 WHERE NOT (t1.e<>f)} -} {} -do_test randexpr-2.822 { - db eval {SELECT case t1.c when t1.e then 19 else -case when not exists(select 1 from t1 where t1.b in (select (t1.b) from t1 union select +13 from t1)) then coalesce((select max(c*t1.b) from t1 where 17>=19*e),coalesce((select (select abs(~min(coalesce((select max(t1.a) from t1 where -19 in (f,a,13)),f)))+min(e) & ( -(min(13))) from t1) from t1 where f between -a and t1.c),t1.e)) when 19<>a then 13 else c end end FROM t1 WHERE t1.e<>f} -} {-13} -do_test randexpr-2.823 { - db eval {SELECT 13- -(abs(coalesce((select max(17) from t1 where f*b in (select count(*)*case -min(~t1.f)+min(coalesce((select -(select min(17) from t1) from t1 where (t1.b in (select abs(min(t1.f)) from t1 union select -max(t1.e) from t1))),17)+d) when count(distinct a) then abs(count(*)) else count(*) end from t1 union select min(t1.c) from t1)),coalesce((select max(f) from t1 where d in (select t1.b from t1 union select t1.e from t1)),17)) | t1.a)/abs(c)) | t1.f FROM t1 WHERE (abs(t1.f*11++ -f)/abs(19 | (abs(((abs(f)/abs(17))))/abs(case when a not in (t1.d,(c)-~c*f | -13-t1.b+ -d,13) then t1.f when 11=11 then c else d end))*d+t1.c))+e+ -(t1.d) in (select t1.a from t1 union select 19 from t1)} -} {} -do_test randexpr-2.824 { - db eval {SELECT 13- -(abs(coalesce((select max(17) from t1 where f*b in (select count(*)*case -min(~t1.f)+min(coalesce((select -(select min(17) from t1) from t1 where (t1.b in (select abs(min(t1.f)) from t1 union select -max(t1.e) from t1))),17)+d) when count(distinct a) then abs(count(*)) else count(*) end from t1 union select min(t1.c) from t1)),coalesce((select max(f) from t1 where d in (select t1.b from t1 union select t1.e from t1)),17)) | t1.a)/abs(c)) | t1.f FROM t1 WHERE NOT ((abs(t1.f*11++ -f)/abs(19 | (abs(((abs(f)/abs(17))))/abs(case when a not in (t1.d,(c)-~c*f | -13-t1.b+ -d,13) then t1.f when 11=11 then c else d end))*d+t1.c))+e+ -(t1.d) in (select t1.a from t1 union select 19 from t1))} -} {605} -do_test randexpr-2.825 { - db eval {SELECT 13- -(abs(coalesce((select max(17) from t1 where f*b in (select count(*)*case -min(~t1.f)+min(coalesce((select -(select min(17) from t1) from t1 where (t1.b in (select abs(min(t1.f)) from t1 union select -max(t1.e) from t1))),17)+d) when count(distinct a) then abs(count(*)) else count(*) end from t1 union select min(t1.c) from t1)),coalesce((select max(f) from t1 where d in (select t1.b from t1 union select t1.e from t1)),17)) & t1.a)/abs(c)) & t1.f FROM t1 WHERE NOT ((abs(t1.f*11++ -f)/abs(19 | (abs(((abs(f)/abs(17))))/abs(case when a not in (t1.d,(c)-~c*f | -13-t1.b+ -d,13) then t1.f when 11=11 then c else d end))*d+t1.c))+e+ -(t1.d) in (select t1.a from t1 union select 19 from t1))} -} {8} -do_test randexpr-2.826 { - db eval {SELECT (a+case when (exists(select 1 from t1 where not exists(select 1 from t1 where not t1.e*13=13-f or (e)=t1.c or -d not between t1.b and t1.a or e not between 17 and (a) and 11 not in (a,(t1.f),a) or t1.e<>13 or t1.d between t1.e and t1.c or t1.d=17 or a>=b))) and a between t1.e and t1.b then case when e not between (17) and t1.d then ~c*coalesce((select t1.a | 13+d from t1 where t1.e not between b and 11),t1.a) else t1.f end else t1.f end-11) FROM t1 WHERE case when case case when case when -(select +min(11) from t1)*(13)>11 then t1.e when 13t1.a then t1.d else -t1.e end when (a) then a else t1.e end>t1.a then 13 when t1.a not in (t1.f,t1.b,t1.a) then a else t1.c end in (select cast(avg(13) AS integer) from t1 union select (max(t1.e)+min(17)) from t1)} -} {689} -do_test randexpr-2.827 { - db eval {SELECT (a+case when (exists(select 1 from t1 where not exists(select 1 from t1 where not t1.e*13=13-f or (e)=t1.c or -d not between t1.b and t1.a or e not between 17 and (a) and 11 not in (a,(t1.f),a) or t1.e<>13 or t1.d between t1.e and t1.c or t1.d=17 or a>=b))) and a between t1.e and t1.b then case when e not between (17) and t1.d then ~c*coalesce((select t1.a | 13+d from t1 where t1.e not between b and 11),t1.a) else t1.f end else t1.f end-11) FROM t1 WHERE NOT (case when case case when case when -(select +min(11) from t1)*(13)>11 then t1.e when 13t1.a then t1.d else -t1.e end when (a) then a else t1.e end>t1.a then 13 when t1.a not in (t1.f,t1.b,t1.a) then a else t1.c end in (select cast(avg(13) AS integer) from t1 union select (max(t1.e)+min(17)) from t1))} -} {} -do_test randexpr-2.828 { - db eval {SELECT (a+case when (exists(select 1 from t1 where not exists(select 1 from t1 where not t1.e*13=13-f or (e)=t1.c or -d not between t1.b and t1.a or e not between 17 and (a) and 11 not in (a,(t1.f),a) or t1.e<>13 or t1.d between t1.e and t1.c or t1.d=17 or a>=b))) and a between t1.e and t1.b then case when e not between (17) and t1.d then ~c*coalesce((select t1.a & 13+d from t1 where t1.e not between b and 11),t1.a) else t1.f end else t1.f end-11) FROM t1 WHERE case when case case when case when -(select +min(11) from t1)*(13)>11 then t1.e when 13t1.a then t1.d else -t1.e end when (a) then a else t1.e end>t1.a then 13 when t1.a not in (t1.f,t1.b,t1.a) then a else t1.c end in (select cast(avg(13) AS integer) from t1 union select (max(t1.e)+min(17)) from t1)} -} {689} -do_test randexpr-2.829 { - db eval {SELECT ~b-t1.a-f*+case when exists(select 1 from t1 where 17<>t1.d-f or not exists(select 1 from t1 where (select (min(a)+count(distinct d)) from t1)+( -f)- -cf and not exists(select 1 from t1 where t1.ct1.d-f or not exists(select 1 from t1 where (select (min(a)+count(distinct d)) from t1)+( -f)- -cf and not exists(select 1 from t1 where t1.c19 then 13 else c end*d+t1.c then f else 17 end) from t1 where d<=e), -d) then 19 else 17 end in (t1.b,19,c) then 19 when t1.a in (select a from t1 union select 13 from t1) then t1.d else t1.d end FROM t1 WHERE (select abs(cast(avg(t1.d*t1.f) AS integer))-cast(avg(b) AS integer) from t1)-~coalesce((select max(t1.a+t1.d-coalesce((select max(a*case when t1.e<=e then f when t1.d<>a then 11 else 11 end*t1.a*11) from t1 where t1.d>=d),t1.f)) from t1 where 11 not between (13) and 17),f)*t1.b+17-e not in (t1.d,t1.f,t1.f)} -} {400} -do_test randexpr-2.834 { - db eval {SELECT case when case ~( -t1.e)-a when coalesce((select max(case +t1.e when t1.b*~19 | t1.a*case when c-c<>19 then 13 else c end*d+t1.c then f else 17 end) from t1 where d<=e), -d) then 19 else 17 end in (t1.b,19,c) then 19 when t1.a in (select a from t1 union select 13 from t1) then t1.d else t1.d end FROM t1 WHERE NOT ((select abs(cast(avg(t1.d*t1.f) AS integer))-cast(avg(b) AS integer) from t1)-~coalesce((select max(t1.a+t1.d-coalesce((select max(a*case when t1.e<=e then f when t1.d<>a then 11 else 11 end*t1.a*11) from t1 where t1.d>=d),t1.f)) from t1 where 11 not between (13) and 17),f)*t1.b+17-e not in (t1.d,t1.f,t1.f))} -} {} -do_test randexpr-2.835 { - db eval {SELECT case when case ~( -t1.e)-a when coalesce((select max(case +t1.e when t1.b*~19 & t1.a*case when c-c<>19 then 13 else c end*d+t1.c then f else 17 end) from t1 where d<=e), -d) then 19 else 17 end in (t1.b,19,c) then 19 when t1.a in (select a from t1 union select 13 from t1) then t1.d else t1.d end FROM t1 WHERE (select abs(cast(avg(t1.d*t1.f) AS integer))-cast(avg(b) AS integer) from t1)-~coalesce((select max(t1.a+t1.d-coalesce((select max(a*case when t1.e<=e then f when t1.d<>a then 11 else 11 end*t1.a*11) from t1 where t1.d>=d),t1.f)) from t1 where 11 not between (13) and 17),f)*t1.b+17-e not in (t1.d,t1.f,t1.f)} -} {400} -do_test randexpr-2.836 { - db eval {SELECT t1.d+case when case when case when (19 not between ~(t1.a)*b and t1.c) then (select (abs(case count(distinct t1.e) when min( -f) then -max(t1.d) else cast(avg(19) AS integer) end-(count(distinct t1.e)))) from t1) when a<>t1.f then -19 else 11 end>f or b in ((13),f,11) then t1.a when t1.e in (e,f,t1.f) then (t1.d) else t1.d end in (17,t1.c,17) then 13 when b not between t1.a and (19) then t1.e else -11 end+a+((f)) FROM t1 WHERE t1.f in (select case +cast(avg(t1.f+c) AS integer)++count(*) when count(*) then ~~(count(distinct 11+t1.a)) else +(case max(e-f) | ~ -max(t1.f) | -abs(abs(min(e-19+e))-abs(count(*)))-abs(cast(avg(f) AS integer)) when (min(f)) then cast(avg(a) AS integer) else min(13) end) end from t1 union select -count(distinct 13) from t1)} -} {} -do_test randexpr-2.837 { - db eval {SELECT t1.d+case when case when case when (19 not between ~(t1.a)*b and t1.c) then (select (abs(case count(distinct t1.e) when min( -f) then -max(t1.d) else cast(avg(19) AS integer) end-(count(distinct t1.e)))) from t1) when a<>t1.f then -19 else 11 end>f or b in ((13),f,11) then t1.a when t1.e in (e,f,t1.f) then (t1.d) else t1.d end in (17,t1.c,17) then 13 when b not between t1.a and (19) then t1.e else -11 end+a+((f)) FROM t1 WHERE NOT (t1.f in (select case +cast(avg(t1.f+c) AS integer)++count(*) when count(*) then ~~(count(distinct 11+t1.a)) else +(case max(e-f) | ~ -max(t1.f) | -abs(abs(min(e-19+e))-abs(count(*)))-abs(cast(avg(f) AS integer)) when (min(f)) then cast(avg(a) AS integer) else min(13) end) end from t1 union select -count(distinct 13) from t1))} -} {1600} -do_test randexpr-2.838 { - db eval {SELECT (select (min(case when b+b*(select cast(avg(e+19-t1.f*case when case when not (c) in (select (e) from t1 union select f from t1) or t1.b not in (t1.e,t1.b,11) or 19= -t1.a then 17 else -d end13 then 13 else t1.f end+11*19) AS integer) from t1)+d not between 11 and c then t1.c else t1.c end)) from t1) FROM t1 WHERE 13 not between +b* -f and coalesce((select f*19-case when not a=~f+t1.d then case when d*b not in (case when d not between -c and t1.d then e else 13 end+17,c,t1.a) then b when t1.e>t1.f then b else -d end else f end-e+(d) from t1 where 17 between t1.a and t1.e),t1.d) | t1.b} -} {} -do_test randexpr-2.839 { - db eval {SELECT (select (min(case when b+b*(select cast(avg(e+19-t1.f*case when case when not (c) in (select (e) from t1 union select f from t1) or t1.b not in (t1.e,t1.b,11) or 19= -t1.a then 17 else -d end13 then 13 else t1.f end+11*19) AS integer) from t1)+d not between 11 and c then t1.c else t1.c end)) from t1) FROM t1 WHERE NOT (13 not between +b* -f and coalesce((select f*19-case when not a=~f+t1.d then case when d*b not in (case when d not between -c and t1.d then e else 13 end+17,c,t1.a) then b when t1.e>t1.f then b else -d end else f end-e+(d) from t1 where 17 between t1.a and t1.e),t1.d) | t1.b)} -} {300} -do_test randexpr-2.840 { - db eval {SELECT t1.c-(abs((select (case abs(count(distinct 11-c*11)) when count(*) then count(*) else -min(+e+~e+coalesce((select d-a*t1.d+t1.e from t1 where (t1.f>=17) and t1.e in (11,a,e)),13)*t1.d) end) from t1)-(a-t1.f)-t1.d)/abs(d)) FROM t1 WHERE t1.c in (select d from t1 union select ( -t1.e) from t1)} -} {} -do_test randexpr-2.841 { - db eval {SELECT t1.c-(abs((select (case abs(count(distinct 11-c*11)) when count(*) then count(*) else -min(+e+~e+coalesce((select d-a*t1.d+t1.e from t1 where (t1.f>=17) and t1.e in (11,a,e)),13)*t1.d) end) from t1)-(a-t1.f)-t1.d)/abs(d)) FROM t1 WHERE NOT (t1.c in (select d from t1 union select ( -t1.e) from t1))} -} {300} -do_test randexpr-2.842 { - db eval {SELECT case when coalesce((select max(t1.a-case when not (coalesce((select d+c from t1 where c between ( -(a)) and b or 17 between 11 and (c)),(t1.f)))=f then b | d when f not in (t1.b,f,a) then t1.a else f end-t1.f) from t1 where 19<=11 and t1.c between 19 and t1.a or t1.f>11), -t1.e)*e between b and 17 then -t1.f when -a<=19 or -11<>t1.f then -19 else d end FROM t1 WHERE ((13 in (t1.b,f,b)))} -} {} -do_test randexpr-2.843 { - db eval {SELECT case when coalesce((select max(t1.a-case when not (coalesce((select d+c from t1 where c between ( -(a)) and b or 17 between 11 and (c)),(t1.f)))=f then b | d when f not in (t1.b,f,a) then t1.a else f end-t1.f) from t1 where 19<=11 and t1.c between 19 and t1.a or t1.f>11), -t1.e)*e between b and 17 then -t1.f when -a<=19 or -11<>t1.f then -19 else d end FROM t1 WHERE NOT (((13 in (t1.b,f,b))))} -} {-19} -do_test randexpr-2.844 { - db eval {SELECT case when coalesce((select max(t1.a-case when not (coalesce((select d+c from t1 where c between ( -(a)) and b or 17 between 11 and (c)),(t1.f)))=f then b & d when f not in (t1.b,f,a) then t1.a else f end-t1.f) from t1 where 19<=11 and t1.c between 19 and t1.a or t1.f>11), -t1.e)*e between b and 17 then -t1.f when -a<=19 or -11<>t1.f then -19 else d end FROM t1 WHERE NOT (((13 in (t1.b,f,b))))} -} {-19} -do_test randexpr-2.845 { - db eval {SELECT case -(abs(t1.b-13*d*b*t1.e- -11)/abs(+d-t1.f*(11+ -13)-t1.c))+c+(e*t1.c)+f*17*a | t1.e-13+f when t1.d then t1.e else f end-t1.f FROM t1 WHERE -b*t1.c>13} -} {} -do_test randexpr-2.846 { - db eval {SELECT case -(abs(t1.b-13*d*b*t1.e- -11)/abs(+d-t1.f*(11+ -13)-t1.c))+c+(e*t1.c)+f*17*a | t1.e-13+f when t1.d then t1.e else f end-t1.f FROM t1 WHERE NOT ( -b*t1.c>13)} -} {0} -do_test randexpr-2.847 { - db eval {SELECT case -(abs(t1.b-13*d*b*t1.e- -11)/abs(+d-t1.f*(11+ -13)-t1.c))+c+(e*t1.c)+f*17*a & t1.e-13+f when t1.d then t1.e else f end-t1.f FROM t1 WHERE NOT ( -b*t1.c>13)} -} {0} -do_test randexpr-2.848 { - db eval {SELECT case when t1.c between t1.e and ~t1.d+(abs(~d*case t1.b-19 when t1.e then e else e end)/abs(case case t1.b when c then t1.d else 13+17 | e end when (select abs(abs(min(11) | max((a)))) from t1) then d else ~t1.f end)) | t1.b then t1.c when (not (11>=b)) then 13 else e end-a FROM t1 WHERE +13*case when +11*t1.f=f+t1.b then t1.f else t1.b end not between coalesce((select max(f) from t1 where (not exists(select 1 from t1 where exists(select 1 from t1 where not not exists(select 1 from t1 where t1.c in (select abs(min(e)) from t1 union select ~ -case cast(avg(~17) AS integer) when min(e | 17) then min(e) else cast(avg(c) AS integer) end from t1)))) or f>e*t1.a+e)),t1.c) and 17} -} {-87} -do_test randexpr-2.849 { - db eval {SELECT case when t1.c between t1.e and ~t1.d+(abs(~d*case t1.b-19 when t1.e then e else e end)/abs(case case t1.b when c then t1.d else 13+17 | e end when (select abs(abs(min(11) | max((a)))) from t1) then d else ~t1.f end)) | t1.b then t1.c when (not (11>=b)) then 13 else e end-a FROM t1 WHERE NOT (+13*case when +11*t1.f=f+t1.b then t1.f else t1.b end not between coalesce((select max(f) from t1 where (not exists(select 1 from t1 where exists(select 1 from t1 where not not exists(select 1 from t1 where t1.c in (select abs(min(e)) from t1 union select ~ -case cast(avg(~17) AS integer) when min(e | 17) then min(e) else cast(avg(c) AS integer) end from t1)))) or f>e*t1.a+e)),t1.c) and 17)} -} {} -do_test randexpr-2.850 { - db eval {SELECT case when t1.c between t1.e and ~t1.d+(abs(~d*case t1.b-19 when t1.e then e else e end)/abs(case case t1.b when c then t1.d else 13+17 & e end when (select abs(abs(min(11) & max((a)))) from t1) then d else ~t1.f end)) & t1.b then t1.c when (not (11>=b)) then 13 else e end-a FROM t1 WHERE +13*case when +11*t1.f=f+t1.b then t1.f else t1.b end not between coalesce((select max(f) from t1 where (not exists(select 1 from t1 where exists(select 1 from t1 where not not exists(select 1 from t1 where t1.c in (select abs(min(e)) from t1 union select ~ -case cast(avg(~17) AS integer) when min(e | 17) then min(e) else cast(avg(c) AS integer) end from t1)))) or f>e*t1.a+e)),t1.c) and 17} -} {-87} -do_test randexpr-2.851 { - db eval {SELECT coalesce((select +case when case d when b then e else (select min(case b when 17 then b else t1.c end)+ -+ -(abs(max(t1.e))-min(t1.d)+max( -d)) | count(distinct t1.e)+( -cast(avg(13) AS integer)) | max(t1.f)+min(e)+count(*) from t1) end<>b then t1.a else 19*~t1.e-c | t1.c end from t1 where b in ( -c,t1.f,t1.c)),19) FROM t1 WHERE (abs(d)/abs(coalesce((select max(coalesce((select d*c from t1 where ((abs(t1.b)/abs(t1.d))-(abs(t1.f)/abs(t1.c))+(t1.a)*13-t1.e not between t1.e and ~f*11+t1.f-11 | t1.a+13+d)),19)) from t1 where c not in (+ -11,a,c)),t1.c))) in (b,b,a)} -} {} -do_test randexpr-2.852 { - db eval {SELECT coalesce((select +case when case d when b then e else (select min(case b when 17 then b else t1.c end)+ -+ -(abs(max(t1.e))-min(t1.d)+max( -d)) | count(distinct t1.e)+( -cast(avg(13) AS integer)) | max(t1.f)+min(e)+count(*) from t1) end<>b then t1.a else 19*~t1.e-c | t1.c end from t1 where b in ( -c,t1.f,t1.c)),19) FROM t1 WHERE NOT ((abs(d)/abs(coalesce((select max(coalesce((select d*c from t1 where ((abs(t1.b)/abs(t1.d))-(abs(t1.f)/abs(t1.c))+(t1.a)*13-t1.e not between t1.e and ~f*11+t1.f-11 | t1.a+13+d)),19)) from t1 where c not in (+ -11,a,c)),t1.c))) in (b,b,a))} -} {19} -do_test randexpr-2.853 { - db eval {SELECT coalesce((select +case when case d when b then e else (select min(case b when 17 then b else t1.c end)+ -+ -(abs(max(t1.e))-min(t1.d)+max( -d)) & count(distinct t1.e)+( -cast(avg(13) AS integer)) & max(t1.f)+min(e)+count(*) from t1) end<>b then t1.a else 19*~t1.e-c & t1.c end from t1 where b in ( -c,t1.f,t1.c)),19) FROM t1 WHERE NOT ((abs(d)/abs(coalesce((select max(coalesce((select d*c from t1 where ((abs(t1.b)/abs(t1.d))-(abs(t1.f)/abs(t1.c))+(t1.a)*13-t1.e not between t1.e and ~f*11+t1.f-11 | t1.a+13+d)),19)) from t1 where c not in (+ -11,a,c)),t1.c))) in (b,b,a))} -} {19} -do_test randexpr-2.854 { - db eval {SELECT a-a-(abs(f)/abs(coalesce((select 17+19 from t1 where (select min(t1.e*e) from t1)>t1.b+case when not exists(select 1 from t1 where e not between 11 and t1.f-e) then coalesce((select max(f*case when t1.f not in (19,t1.c,(t1.a)) and c<=17 then 11 when 17 not between 11 and 17 then c else 17 end) from t1 where d not between t1.a and 13),t1.c) else t1.b end-13 and a=t1.e),17)+t1.c))-f FROM t1 WHERE +(select cast(avg(13-t1.a-t1.b++t1.a-(select count(*) from t1)+case b-(select +~ -min(case when exists(select 1 from t1 where ((select count(*)+ -(min(13)) from t1)) not between 13 and 13) then d else e end) from t1) when f*t1.b*t1.b then t1.a else b end*t1.a) AS integer) from t1)*t1.b in (t1.f,17,f)} -} {} -do_test randexpr-2.855 { - db eval {SELECT a-a-(abs(f)/abs(coalesce((select 17+19 from t1 where (select min(t1.e*e) from t1)>t1.b+case when not exists(select 1 from t1 where e not between 11 and t1.f-e) then coalesce((select max(f*case when t1.f not in (19,t1.c,(t1.a)) and c<=17 then 11 when 17 not between 11 and 17 then c else 17 end) from t1 where d not between t1.a and 13),t1.c) else t1.b end-13 and a=t1.e),17)+t1.c))-f FROM t1 WHERE NOT (+(select cast(avg(13-t1.a-t1.b++t1.a-(select count(*) from t1)+case b-(select +~ -min(case when exists(select 1 from t1 where ((select count(*)+ -(min(13)) from t1)) not between 13 and 13) then d else e end) from t1) when f*t1.b*t1.b then t1.a else b end*t1.a) AS integer) from t1)*t1.b in (t1.f,17,f))} -} {-601} -do_test randexpr-2.856 { - db eval {SELECT case when (11+19 | t1.e-e*17=t1.e*~d+t1.a+ -d | a-~(abs((abs((case when 13 not in (b,((t1.a)),f) then t1.d else t1.a end+e))/abs(t1.f))*b+t1.b)/abs(17))+t1.e+t1.a) then 11 else t1.a end FROM t1 WHERE case (case when (select +~ -~ -cast(avg(b*e*case when t1.a between t1.c and a and d<13 then b else 19 end* -f*d) AS integer) | count(*)++~+min((11))*max(19)-min((b)) from t1) in (select 13 from t1 union select (select min(19) from t1) from t1) then t1.f+t1.d else 13 end-t1.e) when t1.e then t1.f else a end -t1.b then t1.f else t1.e end)*min(t1.a)+ -count(*) | +max(e)*(min(t1.e)) | count(distinct t1.d) | (count(*)) when count(distinct ((19))) then count(*) else max(t1.f) end from t1)} -} {} -do_test randexpr-2.860 { - db eval {SELECT coalesce((select max(+t1.a) from t1 where c in (select -max(d | coalesce((select max(t1.b) from t1 where (abs(case d when t1.f then t1.e else t1.c end-t1.f)/abs(13))<=11), -a)) | min(t1.c) | (max(f))++abs(case max(b) when (count(distinct e)) then count(*) else min(17) end) from t1 union select (min(19)) from t1) or not exists(select 1 from t1 where coalesce((select c from t1 where b in (select - - - -count(*) from t1 union select -min((a)) from t1)),13) -t1.b then t1.f else t1.e end)*min(t1.a)+ -count(*) | +max(e)*(min(t1.e)) | count(distinct t1.d) | (count(*)) when count(distinct ((19))) then count(*) else max(t1.f) end from t1))} -} {17} -do_test randexpr-2.861 { - db eval {SELECT coalesce((select max(+t1.a) from t1 where c in (select -max(d & coalesce((select max(t1.b) from t1 where (abs(case d when t1.f then t1.e else t1.c end-t1.f)/abs(13))<=11), -a)) & min(t1.c) & (max(f))++abs(case max(b) when (count(distinct e)) then count(*) else min(17) end) from t1 union select (min(19)) from t1) or not exists(select 1 from t1 where coalesce((select c from t1 where b in (select - - - -count(*) from t1 union select -min((a)) from t1)),13) -t1.b then t1.f else t1.e end)*min(t1.a)+ -count(*) | +max(e)*(min(t1.e)) | count(distinct t1.d) | (count(*)) when count(distinct ((19))) then count(*) else max(t1.f) end from t1))} -} {17} -do_test randexpr-2.862 { - db eval {SELECT case 17 when (select ~count(distinct t1.d) from t1) then e else case when not not exists(select 1 from t1 where (abs(~coalesce((select (coalesce((select max(13) from t1 where e>a),19)) from t1 where (not exists(select 1 from t1 where t1.c in (f,b,c)))),c)*t1.c | 17-(e))/abs(t1.f)) | 17*17*a in (select e from t1 union select f from t1)) then 13 when t1.a not between (b) and t1.c then (abs(17)/abs(17)) else t1.d end*f end FROM t1 WHERE t1.a>t1.c-19} -} {} -do_test randexpr-2.863 { - db eval {SELECT case 17 when (select ~count(distinct t1.d) from t1) then e else case when not not exists(select 1 from t1 where (abs(~coalesce((select (coalesce((select max(13) from t1 where e>a),19)) from t1 where (not exists(select 1 from t1 where t1.c in (f,b,c)))),c)*t1.c | 17-(e))/abs(t1.f)) | 17*17*a in (select e from t1 union select f from t1)) then 13 when t1.a not between (b) and t1.c then (abs(17)/abs(17)) else t1.d end*f end FROM t1 WHERE NOT (t1.a>t1.c-19)} -} {600} -do_test randexpr-2.864 { - db eval {SELECT case 17 when (select ~count(distinct t1.d) from t1) then e else case when not not exists(select 1 from t1 where (abs(~coalesce((select (coalesce((select max(13) from t1 where e>a),19)) from t1 where (not exists(select 1 from t1 where t1.c in (f,b,c)))),c)*t1.c & 17-(e))/abs(t1.f)) & 17*17*a in (select e from t1 union select f from t1)) then 13 when t1.a not between (b) and t1.c then (abs(17)/abs(17)) else t1.d end*f end FROM t1 WHERE NOT (t1.a>t1.c-19)} -} {600} -do_test randexpr-2.865 { - db eval {SELECT case when f>=t1.c then t1.d when coalesce((select max(+11-b) from t1 where a-t1.d in (select +case when f in (13,b | 11,t1.b) then -t1.d when f in (select ~count(distinct 17) from t1 union select count(distinct t1.a) from t1) then 19 else c end-d+b from t1 union select a from t1) and (17) in (t1.f,11,t1.c)),f)< -a then d else t1.c end-11 FROM t1 WHERE a<(select count(distinct +11*coalesce((select max(coalesce((select max(t1.d) from t1 where t1.e>t1.b),b)*t1.f) from t1 where case 11 when t1.a then -t1.e else a end<=17),e)-11+c-19) | count(distinct 19)*count(*)* -(count(distinct t1.f))+cast(avg(17) AS integer)-(~~(count(*)))-cast(avg(11) AS integer) | cast(avg((19)) AS integer) from t1)-t1.c} -} {} -do_test randexpr-2.866 { - db eval {SELECT case when f>=t1.c then t1.d when coalesce((select max(+11-b) from t1 where a-t1.d in (select +case when f in (13,b | 11,t1.b) then -t1.d when f in (select ~count(distinct 17) from t1 union select count(distinct t1.a) from t1) then 19 else c end-d+b from t1 union select a from t1) and (17) in (t1.f,11,t1.c)),f)< -a then d else t1.c end-11 FROM t1 WHERE NOT (a<(select count(distinct +11*coalesce((select max(coalesce((select max(t1.d) from t1 where t1.e>t1.b),b)*t1.f) from t1 where case 11 when t1.a then -t1.e else a end<=17),e)-11+c-19) | count(distinct 19)*count(*)* -(count(distinct t1.f))+cast(avg(17) AS integer)-(~~(count(*)))-cast(avg(11) AS integer) | cast(avg((19)) AS integer) from t1)-t1.c)} -} {389} -do_test randexpr-2.867 { - db eval {SELECT case when f>=t1.c then t1.d when coalesce((select max(+11-b) from t1 where a-t1.d in (select +case when f in (13,b & 11,t1.b) then -t1.d when f in (select ~count(distinct 17) from t1 union select count(distinct t1.a) from t1) then 19 else c end-d+b from t1 union select a from t1) and (17) in (t1.f,11,t1.c)),f)< -a then d else t1.c end-11 FROM t1 WHERE NOT (a<(select count(distinct +11*coalesce((select max(coalesce((select max(t1.d) from t1 where t1.e>t1.b),b)*t1.f) from t1 where case 11 when t1.a then -t1.e else a end<=17),e)-11+c-19) | count(distinct 19)*count(*)* -(count(distinct t1.f))+cast(avg(17) AS integer)-(~~(count(*)))-cast(avg(11) AS integer) | cast(avg((19)) AS integer) from t1)-t1.c)} -} {389} -do_test randexpr-2.868 { - db eval {SELECT coalesce((select max(17) from t1 where -coalesce((select t1.b+coalesce((select case when case t1.f when c then (e) else a end+t1.c+(f)>17 and e>=f and (13>t1.f) then (select ~(cast(avg(t1.e) AS integer)) | min(t1.a) from t1) when -c>c then 19 else t1.f end from t1 where (1717 and e>=f and (13>t1.f) then (select ~(cast(avg(t1.e) AS integer)) | min(t1.a) from t1) when -c>c then 19 else t1.f end from t1 where (1717 and e>=f and (13>t1.f) then (select ~(cast(avg(t1.e) AS integer)) & min(t1.a) from t1) when -c>c then 19 else t1.f end from t1 where (17=a then 13 when ((case when t1.d=a)) then 19 else t1.b end-t1.f) when 19 then - -13 else 17 end from t1 union select -17 from t1) and 19 in (select d from t1 union select e from t1) then (select abs(min(t1.f)) from t1) else c end FROM t1 WHERE case coalesce((select 19 from t1 where 13=e then d when (case when not exists(select 1 from t1 where (a>d and d not between e and ((19)) and c in (e,t1.b,(b)) and e not in (t1.f,t1.a,t1.b))) then t1.b when f not between 11 and d then t1.d else d end<=11) then (abs(13)/abs(11)) else -11 end from t1 where (t1.b)=a then 13 when ((case when t1.d=a)) then 19 else t1.b end-t1.f) when 19 then - -13 else 17 end from t1 union select -17 from t1) and 19 in (select d from t1 union select e from t1) then (select abs(min(t1.f)) from t1) else c end FROM t1 WHERE NOT (case coalesce((select 19 from t1 where 13=e then d when (case when not exists(select 1 from t1 where (a>d and d not between e and ((19)) and c in (e,t1.b,(b)) and e not in (t1.f,t1.a,t1.b))) then t1.b when f not between 11 and d then t1.d else d end<=11) then (abs(13)/abs(11)) else -11 end from t1 where (t1.b)t1.c and e not between 13 and t1.d and t1.e in (t1.d,17,t1.c) then c+t1.e*t1.d when t1.f>=t1.d then t1.a else t1.c end else t1.e end-e) from t1 where t1.b not in (t1.b,t1.d,d)), -c)*13 FROM t1 WHERE (abs(e+17)/abs((select count(distinct 11-t1.b)*cast(avg(case c when coalesce((select max(19-coalesce((select max(f) from t1 where 19 in (17,t1.f,11)),t1.d)) from t1 where c in (t1.a,11,13) and t1.a<=t1.c),t1.c) then t1.c else e end) AS integer) | max(e) | (+~case case cast(avg(t1.d) AS integer) when -min(13) then count(*) else count(*) end when max(t1.c) then count(distinct f) else count(*) end-count(distinct 19)) from t1)))>=t1.e | f} -} {} -do_test randexpr-2.876 { - db eval {SELECT +17+(11)-coalesce((select max(case (11) when f then +e+case when +11< -13-f or b between (b) and t1.b and e<>t1.c and e not between 13 and t1.d and t1.e in (t1.d,17,t1.c) then c+t1.e*t1.d when t1.f>=t1.d then t1.a else t1.c end else t1.e end-e) from t1 where t1.b not in (t1.b,t1.d,d)), -c)*13 FROM t1 WHERE NOT ((abs(e+17)/abs((select count(distinct 11-t1.b)*cast(avg(case c when coalesce((select max(19-coalesce((select max(f) from t1 where 19 in (17,t1.f,11)),t1.d)) from t1 where c in (t1.a,11,13) and t1.a<=t1.c),t1.c) then t1.c else e end) AS integer) | max(e) | (+~case case cast(avg(t1.d) AS integer) when -min(13) then count(*) else count(*) end when max(t1.c) then count(distinct f) else count(*) end-count(distinct 19)) from t1)))>=t1.e | f)} -} {3928} -do_test randexpr-2.877 { - db eval {SELECT case when case when d*c not in (13,a,d) then (t1.b-f)+coalesce((select max((select count(distinct 13)-case max(11) when count(*) then count(*) else min(t1.b) end*min(17)+(min(t1.c)) from t1)) from t1 where not exists(select 1 from t1 where t1.c between 17-d | d and t1.e)),b) else t1.e end<=d then e when f in (a,13,d) or t1.b between f and -b then c else t1.a end FROM t1 WHERE t1.d<>t1.a} -} {500} -do_test randexpr-2.878 { - db eval {SELECT case when case when d*c not in (13,a,d) then (t1.b-f)+coalesce((select max((select count(distinct 13)-case max(11) when count(*) then count(*) else min(t1.b) end*min(17)+(min(t1.c)) from t1)) from t1 where not exists(select 1 from t1 where t1.c between 17-d | d and t1.e)),b) else t1.e end<=d then e when f in (a,13,d) or t1.b between f and -b then c else t1.a end FROM t1 WHERE NOT (t1.d<>t1.a)} -} {} -do_test randexpr-2.879 { - db eval {SELECT case when case when d*c not in (13,a,d) then (t1.b-f)+coalesce((select max((select count(distinct 13)-case max(11) when count(*) then count(*) else min(t1.b) end*min(17)+(min(t1.c)) from t1)) from t1 where not exists(select 1 from t1 where t1.c between 17-d & d and t1.e)),b) else t1.e end<=d then e when f in (a,13,d) or t1.b between f and -b then c else t1.a end FROM t1 WHERE t1.d<>t1.a} -} {500} -do_test randexpr-2.880 { - db eval {SELECT case case c when -b then (abs(b)/abs(c)) else (select count(distinct f) | (~abs(min(c-+case 11 when case when t1.a between b and t1.e-case when (13<=b) then (select -count(*) from t1) else a end then t1.e when e>=11 then (19) else b end then d else 17 end | e))) from t1) end when -13 then t1.f else +17 end FROM t1 WHERE 17 in (select +(count(*) | case abs( -abs(abs( -min(d)))) | max(+11) when -+~count(distinct -(abs(coalesce((select max(f) from t1 where t1.e in (select e from t1 union select t1.a from t1)),f) | t1.c-t1.b)/abs(13))) | +abs(case max(b) when count(*) then -min(t1.e) else (cast(avg(t1.f) AS integer)) end)- -count(*) then -count(*) else max(19) end* -cast(avg(t1.b) AS integer))+(max(t1.f)) from t1 union select count(distinct b) from t1)} -} {} -do_test randexpr-2.881 { - db eval {SELECT case case c when -b then (abs(b)/abs(c)) else (select count(distinct f) | (~abs(min(c-+case 11 when case when t1.a between b and t1.e-case when (13<=b) then (select -count(*) from t1) else a end then t1.e when e>=11 then (19) else b end then d else 17 end | e))) from t1) end when -13 then t1.f else +17 end FROM t1 WHERE NOT (17 in (select +(count(*) | case abs( -abs(abs( -min(d)))) | max(+11) when -+~count(distinct -(abs(coalesce((select max(f) from t1 where t1.e in (select e from t1 union select t1.a from t1)),f) | t1.c-t1.b)/abs(13))) | +abs(case max(b) when count(*) then -min(t1.e) else (cast(avg(t1.f) AS integer)) end)- -count(*) then -count(*) else max(19) end* -cast(avg(t1.b) AS integer))+(max(t1.f)) from t1 union select count(distinct b) from t1))} -} {17} -do_test randexpr-2.882 { - db eval {SELECT case case c when -b then (abs(b)/abs(c)) else (select count(distinct f) & (~abs(min(c-+case 11 when case when t1.a between b and t1.e-case when (13<=b) then (select -count(*) from t1) else a end then t1.e when e>=11 then (19) else b end then d else 17 end & e))) from t1) end when -13 then t1.f else +17 end FROM t1 WHERE NOT (17 in (select +(count(*) | case abs( -abs(abs( -min(d)))) | max(+11) when -+~count(distinct -(abs(coalesce((select max(f) from t1 where t1.e in (select e from t1 union select t1.a from t1)),f) | t1.c-t1.b)/abs(13))) | +abs(case max(b) when count(*) then -min(t1.e) else (cast(avg(t1.f) AS integer)) end)- -count(*) then -count(*) else max(19) end* -cast(avg(t1.b) AS integer))+(max(t1.f)) from t1 union select count(distinct b) from t1))} -} {17} -do_test randexpr-2.883 { - db eval {SELECT case 11 when (case when t1.e in (select +cast(avg(coalesce((select max(13) from t1 where case when exists(select 1 from t1 where t1.b in ((a),d,(t1.e))) then case when 19 in (select -max(17) from t1 union select min(t1.f) from t1) then t1.b else 17 end when a not in ((t1.f),11,t1.e) then 17 else t1.c end(19)),c)) and c and (11 in (select t1.b from t1 union select 13 from t1) and ( -t1.d)=d)),e | 19*t1.a))) and t1.a then t1.a when 19>=t1.a then e else c end> -e} -} {500} -do_test randexpr-2.884 { - db eval {SELECT case 11 when (case when t1.e in (select +cast(avg(coalesce((select max(13) from t1 where case when exists(select 1 from t1 where t1.b in ((a),d,(t1.e))) then case when 19 in (select -max(17) from t1 union select min(t1.f) from t1) then t1.b else 17 end when a not in ((t1.f),11,t1.e) then 17 else t1.c end(19)),c)) and c and (11 in (select t1.b from t1 union select 13 from t1) and ( -t1.d)=d)),e | 19*t1.a))) and t1.a then t1.a when 19>=t1.a then e else c end> -e)} -} {} -do_test randexpr-2.885 { - db eval {SELECT case 11 when (case when t1.e in (select +cast(avg(coalesce((select max(13) from t1 where case when exists(select 1 from t1 where t1.b in ((a),d,(t1.e))) then case when 19 in (select -max(17) from t1 union select min(t1.f) from t1) then t1.b else 17 end when a not in ((t1.f),11,t1.e) then 17 else t1.c end(19)),c)) and c and (11 in (select t1.b from t1 union select 13 from t1) and ( -t1.d)=d)),e | 19*t1.a))) and t1.a then t1.a when 19>=t1.a then e else c end> -e} -} {500} -do_test randexpr-2.886 { - db eval {SELECT case a*t1.a when ~++a*(abs(e)/abs(19)) | t1.d+(select count(*) from t1) then b else t1.a end*coalesce((select max(f) from t1 where f<>t1.d),b) FROM t1 WHERE (abs(c-~t1.b)/abs(d))-((+coalesce((select max(c) from t1 where -+(select ~ -(cast(avg((13+case 11*t1.c when t1.b then f else ~e-coalesce((select max((f)) from t1 where t1.ft1.d),b) FROM t1 WHERE NOT ((abs(c-~t1.b)/abs(d))-((+coalesce((select max(c) from t1 where -+(select ~ -(cast(avg((13+case 11*t1.c when t1.b then f else ~e-coalesce((select max((f)) from t1 where t1.ft1.d),b) FROM t1 WHERE NOT ((abs(c-~t1.b)/abs(d))-((+coalesce((select max(c) from t1 where -+(select ~ -(cast(avg((13+case 11*t1.c when t1.b then f else ~e-coalesce((select max((f)) from t1 where t1.f=+t1.b then f when t1.c+f13 then t1.d else t1.a end)/abs(t1.d))) from t1 where t1.c not between t1.c and 11 and e>d),f)*t1.e+d,a,13)),e) | t1.b FROM t1 WHERE (abs(+(+t1.a)+case a-case when c>=d then 13 when t1.c not in (17,17,e) then a else t1.d end when c then -f else b end*d)/abs(17))<=11 and 11 in (select cast(avg(17) AS integer) from t1 union select min( -19)+(case max(a) when abs(count(*)) then -abs(count(*)*min(t1.e)+max(11)) else min(c) end) from t1)} -} {} -do_test randexpr-2.890 { - db eval {SELECT t1.c-t1.f-coalesce((select max(a) from t1 where e in ((abs(a)/abs(t1.d))*coalesce((select max((abs(case when e>=+t1.b then f when t1.c+f13 then t1.d else t1.a end)/abs(t1.d))) from t1 where t1.c not between t1.c and 11 and e>d),f)*t1.e+d,a,13)),e) | t1.b FROM t1 WHERE NOT ((abs(+(+t1.a)+case a-case when c>=d then 13 when t1.c not in (17,17,e) then a else t1.d end when c then -f else b end*d)/abs(17))<=11 and 11 in (select cast(avg(17) AS integer) from t1 union select min( -19)+(case max(a) when abs(count(*)) then -abs(count(*)*min(t1.e)+max(11)) else min(c) end) from t1))} -} {-792} -do_test randexpr-2.891 { - db eval {SELECT t1.c-t1.f-coalesce((select max(a) from t1 where e in ((abs(a)/abs(t1.d))*coalesce((select max((abs(case when e>=+t1.b then f when t1.c+f13 then t1.d else t1.a end)/abs(t1.d))) from t1 where t1.c not between t1.c and 11 and e>d),f)*t1.e+d,a,13)),e) & t1.b FROM t1 WHERE NOT ((abs(+(+t1.a)+case a-case when c>=d then 13 when t1.c not in (17,17,e) then a else t1.d end when c then -f else b end*d)/abs(17))<=11 and 11 in (select cast(avg(17) AS integer) from t1 union select min( -19)+(case max(a) when abs(count(*)) then -abs(count(*)*min(t1.e)+max(11)) else min(c) end) from t1))} -} {192} -do_test randexpr-2.892 { - db eval {SELECT coalesce((select (select count(*) from t1)*a*b from t1 where ((~b*a-t1.d+11*e-(select -count(*) | count(*) | count(*) from t1)*(select min((abs(coalesce((select max(t1.c) from t1 where not exists(select 1 from t1 where -17 in (t1.b,t1.f,t1.d))),11))/abs(t1.d))) from t1)-17+(abs(11)/abs(11)) | b+d | 11 in (select t1.a from t1 union select 13 from t1)))),t1.a) FROM t1 WHERE f>case when f-case when not exists(select 1 from t1 where case when b in (select abs(max(coalesce((select max(~t1.c) from t1 where t1.f<=13),17))) from t1 union select cast(avg(t1.c) AS integer) from t1) then t1.e else (13) end> -t1.e) or d<>19 then coalesce((select max((select abs(max(d)+cast(avg(d) AS integer)) from t1)) from t1 where t1.e19 then b when t1.a<=11 then 11 else t1.d end} -} {100} -do_test randexpr-2.893 { - db eval {SELECT coalesce((select (select count(*) from t1)*a*b from t1 where ((~b*a-t1.d+11*e-(select -count(*) | count(*) | count(*) from t1)*(select min((abs(coalesce((select max(t1.c) from t1 where not exists(select 1 from t1 where -17 in (t1.b,t1.f,t1.d))),11))/abs(t1.d))) from t1)-17+(abs(11)/abs(11)) | b+d | 11 in (select t1.a from t1 union select 13 from t1)))),t1.a) FROM t1 WHERE NOT (f>case when f-case when not exists(select 1 from t1 where case when b in (select abs(max(coalesce((select max(~t1.c) from t1 where t1.f<=13),17))) from t1 union select cast(avg(t1.c) AS integer) from t1) then t1.e else (13) end> -t1.e) or d<>19 then coalesce((select max((select abs(max(d)+cast(avg(d) AS integer)) from t1)) from t1 where t1.e19 then b when t1.a<=11 then 11 else t1.d end)} -} {} -do_test randexpr-2.894 { - db eval {SELECT coalesce((select (select count(*) from t1)*a*b from t1 where ((~b*a-t1.d+11*e-(select -count(*) & count(*) & count(*) from t1)*(select min((abs(coalesce((select max(t1.c) from t1 where not exists(select 1 from t1 where -17 in (t1.b,t1.f,t1.d))),11))/abs(t1.d))) from t1)-17+(abs(11)/abs(11)) & b+d & 11 in (select t1.a from t1 union select 13 from t1)))),t1.a) FROM t1 WHERE f>case when f-case when not exists(select 1 from t1 where case when b in (select abs(max(coalesce((select max(~t1.c) from t1 where t1.f<=13),17))) from t1 union select cast(avg(t1.c) AS integer) from t1) then t1.e else (13) end> -t1.e) or d<>19 then coalesce((select max((select abs(max(d)+cast(avg(d) AS integer)) from t1)) from t1 where t1.e19 then b when t1.a<=11 then 11 else t1.d end} -} {100} -do_test randexpr-2.895 { - db eval {SELECT coalesce((select e from t1 where ((abs((select case (~max(f) | ~max(19-t1.d) | cast(avg(11) AS integer)) when min(+t1.d*c) then max(case when 19+13 not between 13 and t1.c or t1.c not in ((b),11,(e)) then d else t1.d end+ -t1.d) else min(a) end from t1))/abs(11)))<17),t1.b)+17 FROM t1 WHERE (13 in (a,t1.a,~+(e)+t1.c*t1.c | t1.c- -t1.b-t1.b+e*b | t1.e-t1.e-e*coalesce((select max(t1.b) from t1 where t1.a*d<>coalesce((select max(t1.e-t1.b) from t1 where exists(select 1 from t1 where coalesce((select e from t1 where (17 not between 13 and t1.c)),t1.c)>=t1.c)),b)),t1.f)+17))} -} {} -do_test randexpr-2.896 { - db eval {SELECT coalesce((select e from t1 where ((abs((select case (~max(f) | ~max(19-t1.d) | cast(avg(11) AS integer)) when min(+t1.d*c) then max(case when 19+13 not between 13 and t1.c or t1.c not in ((b),11,(e)) then d else t1.d end+ -t1.d) else min(a) end from t1))/abs(11)))<17),t1.b)+17 FROM t1 WHERE NOT ((13 in (a,t1.a,~+(e)+t1.c*t1.c | t1.c- -t1.b-t1.b+e*b | t1.e-t1.e-e*coalesce((select max(t1.b) from t1 where t1.a*d<>coalesce((select max(t1.e-t1.b) from t1 where exists(select 1 from t1 where coalesce((select e from t1 where (17 not between 13 and t1.c)),t1.c)>=t1.c)),b)),t1.f)+17)))} -} {517} -do_test randexpr-2.897 { - db eval {SELECT coalesce((select e from t1 where ((abs((select case (~max(f) & ~max(19-t1.d) & cast(avg(11) AS integer)) when min(+t1.d*c) then max(case when 19+13 not between 13 and t1.c or t1.c not in ((b),11,(e)) then d else t1.d end+ -t1.d) else min(a) end from t1))/abs(11)))<17),t1.b)+17 FROM t1 WHERE NOT ((13 in (a,t1.a,~+(e)+t1.c*t1.c | t1.c- -t1.b-t1.b+e*b | t1.e-t1.e-e*coalesce((select max(t1.b) from t1 where t1.a*d<>coalesce((select max(t1.e-t1.b) from t1 where exists(select 1 from t1 where coalesce((select e from t1 where (17 not between 13 and t1.c)),t1.c)>=t1.c)),b)),t1.f)+17)))} -} {517} -do_test randexpr-2.898 { - db eval {SELECT c | coalesce((select max(~b*case +coalesce((select max( -(abs(c)/abs(11))+case when t1.c*17 not in (a,a,c) then t1.e when t1.b in (select 13 from t1 union select (c) from t1) then -(t1.c) else d end* -t1.c+a) from t1 where t1.f>=11),17) | t1.b when t1.b then c else t1.a end) from t1 where t1.f>t1.a),t1.c)+13*17 FROM t1 WHERE t1.e=11),17) | t1.b when t1.b then c else t1.a end) from t1 where t1.f>t1.a),t1.c)+13*17 FROM t1 WHERE NOT (t1.e=11),17) & t1.b when t1.b then c else t1.a end) from t1 where t1.f>t1.a),t1.c)+13*17 FROM t1 WHERE t1.ee) and not exists(select 1 from t1 where (19)=t1.e))),19*t1.e)-t1.c)) | 17))*t1.b)/abs(17))) from t1 where (t1.b) between d and t1.b),t1.c)) | t1.f-c-d) FROM t1 WHERE 13 not in (f,t1.c+11*c,coalesce((select e from t1 where case t1.b when c- -case (select cast(avg(+t1.c*t1.f) AS integer) from t1) when 13*case when not case when -17 in (select (t1.c) from t1 union select t1.c from t1) or t1.f in (t1.b,t1.d,t1.b) then t1.a when 11<>t1.c then e else a end>=(11) and a=d or -t1.f between c and b then e else t1.f end then 19 else t1.d end then t1.c else t1.b end<>13),d))} -} {-35} -do_test randexpr-2.902 { - db eval {SELECT coalesce((select max(a) from t1 where t1.be) and not exists(select 1 from t1 where (19)=t1.e))),19*t1.e)-t1.c)) | 17))*t1.b)/abs(17))) from t1 where (t1.b) between d and t1.b),t1.c)) | t1.f-c-d) FROM t1 WHERE NOT (13 not in (f,t1.c+11*c,coalesce((select e from t1 where case t1.b when c- -case (select cast(avg(+t1.c*t1.f) AS integer) from t1) when 13*case when not case when -17 in (select (t1.c) from t1 union select t1.c from t1) or t1.f in (t1.b,t1.d,t1.b) then t1.a when 11<>t1.c then e else a end>=(11) and a=d or -t1.f between c and b then e else t1.f end then 19 else t1.d end then t1.c else t1.b end<>13),d)))} -} {} -do_test randexpr-2.903 { - db eval {SELECT f+b+(t1.a+c)+(case when (select (cast(avg(coalesce((select max(t1.b) from t1 where case -(select +cast(avg(b-t1.e) AS integer)-abs(cast(avg(~(abs(f)/abs(f))) AS integer)) from t1)+d when 11 then d else 13 end+t1.e<>t1.e),(t1.e))-13+13) AS integer)) from t1)-t1.b<>a then t1.e else e end) FROM t1 WHERE c in (select abs((max(t1.d))) from t1 union select count(*) from t1) and (coalesce((select max(+ -(t1.f-d)* -b) from t1 where not exists(select 1 from t1 where (b not in (coalesce((select t1.e-a from t1 where not t1.a between 13 and f or t1.b in (t1.e,e,17)),11),17,t1.a) and (b<>d)))),b) in (select -min(17) from t1 union select abs(max(e)) from t1))} -} {} -do_test randexpr-2.904 { - db eval {SELECT f+b+(t1.a+c)+(case when (select (cast(avg(coalesce((select max(t1.b) from t1 where case -(select +cast(avg(b-t1.e) AS integer)-abs(cast(avg(~(abs(f)/abs(f))) AS integer)) from t1)+d when 11 then d else 13 end+t1.e<>t1.e),(t1.e))-13+13) AS integer)) from t1)-t1.b<>a then t1.e else e end) FROM t1 WHERE NOT (c in (select abs((max(t1.d))) from t1 union select count(*) from t1) and (coalesce((select max(+ -(t1.f-d)* -b) from t1 where not exists(select 1 from t1 where (b not in (coalesce((select t1.e-a from t1 where not t1.a between 13 and f or t1.b in (t1.e,e,17)),11),17,t1.a) and (b<>d)))),b) in (select -min(17) from t1 union select abs(max(e)) from t1)))} -} {1700} -do_test randexpr-2.905 { - db eval {SELECT case when case when not exists(select 1 from t1 where not exists(select 1 from t1 where (case when (select -min(t1.e) from t1) in (select f from t1 union select d from t1) then +e else d end | t1.e not between t1.a and t1.b))) and not exists(select 1 from t1 where a>=t1.e) and b=e then 13 else coalesce((select 19 from t1 where t1.d>=t1.e),13) end<11*t1.b then 17 when 17 in (19,t1.e, -t1.c) or 17=t1.e) and b=e then 13 else coalesce((select 19 from t1 where t1.d>=t1.e),13) end<11*t1.b then 17 when 17 in (19,t1.e, -t1.c) or 17=t1.e) and b=e then 13 else coalesce((select 19 from t1 where t1.d>=t1.e),13) end<11*t1.b then 17 when 17 in (19,t1.e, -t1.c) or 17t1.a then c else 19 end when t1.c then e else t1.d end when 17 then t1.d else -d end between e and t1.e then 13 when (13<>13) then t1.c else 17 end when exists(select 1 from t1 where (t1.c between b and 11)) then e else f end FROM t1 WHERE ~a* -b+11-case when coalesce((select max(case when (t1.c in (case t1.b when t1.c then 13 else 17 end,17,19)) then case e when a then c else 13 end else c end) from t1 where a between b and t1.c),t1.a)=c or (17>d) then case when f= -t1.a then t1.b when (t1.d)t1.a then c else 19 end when t1.c then e else t1.d end when 17 then t1.d else -d end between e and t1.e then 13 when (13<>13) then t1.c else 17 end when exists(select 1 from t1 where (t1.c between b and 11)) then e else f end FROM t1 WHERE NOT (~a* -b+11-case when coalesce((select max(case when (t1.c in (case t1.b when t1.c then 13 else 17 end,17,19)) then case e when a then c else 13 end else c end) from t1 where a between b and t1.c),t1.a)=c or (17>d) then case when f= -t1.a then t1.b when (t1.d)=t1.f)) and t1.f>t1.a or e<>c then 17 else d end)/abs(a))) from t1 where exists(select 1 from t1 where not exists(select 1 from t1 where (t1.f) in (t1.c,(t1.e),17)))),t1.a) end+e FROM t1 WHERE exists(select 1 from t1 where 17>(case coalesce((select max((abs(+t1.f-case when 11=(abs((select count(*) from t1)-13*13)/abs(t1.d)) then coalesce((select max(t1.c) from t1 where 19 in (select ((max(19))) from t1 union select min(t1.d) from t1) or -t1.a=t1.a and f<17),t1.e-d) when not exists(select 1 from t1 where t1.b not between (d) and -t1.f) then 11 else t1.a end)/abs(t1.a))) from t1 where t1.e not in ((f),11,t1.f)),t1.c) when b then -t1.a else 13 end)-t1.c)} -} {947} -do_test randexpr-2.911 { - db eval {SELECT +case when e in (13, -b,11) then d else coalesce((select max(13 | d | d+19+(abs(case when (19) between (abs(case f when t1.f then (13) else 17 end)/abs(a)) and d then 19 when (not exists(select 1 from t1 where t1.a>=t1.f)) and t1.f>t1.a or e<>c then 17 else d end)/abs(a))) from t1 where exists(select 1 from t1 where not exists(select 1 from t1 where (t1.f) in (t1.c,(t1.e),17)))),t1.a) end+e FROM t1 WHERE NOT (exists(select 1 from t1 where 17>(case coalesce((select max((abs(+t1.f-case when 11=(abs((select count(*) from t1)-13*13)/abs(t1.d)) then coalesce((select max(t1.c) from t1 where 19 in (select ((max(19))) from t1 union select min(t1.d) from t1) or -t1.a=t1.a and f<17),t1.e-d) when not exists(select 1 from t1 where t1.b not between (d) and -t1.f) then 11 else t1.a end)/abs(t1.a))) from t1 where t1.e not in ((f),11,t1.f)),t1.c) when b then -t1.a else 13 end)-t1.c))} -} {} -do_test randexpr-2.912 { - db eval {SELECT +case when e in (13, -b,11) then d else coalesce((select max(13 & d & d+19+(abs(case when (19) between (abs(case f when t1.f then (13) else 17 end)/abs(a)) and d then 19 when (not exists(select 1 from t1 where t1.a>=t1.f)) and t1.f>t1.a or e<>c then 17 else d end)/abs(a))) from t1 where exists(select 1 from t1 where not exists(select 1 from t1 where (t1.f) in (t1.c,(t1.e),17)))),t1.a) end+e FROM t1 WHERE exists(select 1 from t1 where 17>(case coalesce((select max((abs(+t1.f-case when 11=(abs((select count(*) from t1)-13*13)/abs(t1.d)) then coalesce((select max(t1.c) from t1 where 19 in (select ((max(19))) from t1 union select min(t1.d) from t1) or -t1.a=t1.a and f<17),t1.e-d) when not exists(select 1 from t1 where t1.b not between (d) and -t1.f) then 11 else t1.a end)/abs(t1.a))) from t1 where t1.e not in ((f),11,t1.f)),t1.c) when b then -t1.a else 13 end)-t1.c)} -} {500} -do_test randexpr-2.913 { - db eval {SELECT (13*case when exists(select 1 from t1 where exists(select 1 from t1 where coalesce((select max(b) from t1 where t1.b=e),a)<(b-a)+13)) then 11 else t1.e end*coalesce((select 17 from t1 where not ((select cast(avg(13) AS integer) from t1)< -t1.c) and 17 between 13 and 13),case when f=case when exists(select 1 from t1 where (13 in ( -(b)*(select count(*)* -cast(avg(case t1.e when t1.b then (f)-f-f else e end) AS integer)*cast(avg(17) AS integer) | cast(avg((17)) AS integer) | min(d) | count(distinct e) from t1),19+(abs(19)/abs(17))*f,t1.b))) then 11 when 17>t1.f then +a else t1.d end)} -} {28600411} -do_test randexpr-2.914 { - db eval {SELECT (13*case when exists(select 1 from t1 where exists(select 1 from t1 where coalesce((select max(b) from t1 where t1.b=e),a)<(b-a)+13)) then 11 else t1.e end*coalesce((select 17 from t1 where not ((select cast(avg(13) AS integer) from t1)< -t1.c) and 17 between 13 and 13),case when f=case when exists(select 1 from t1 where (13 in ( -(b)*(select count(*)* -cast(avg(case t1.e when t1.b then (f)-f-f else e end) AS integer)*cast(avg(17) AS integer) | cast(avg((17)) AS integer) | min(d) | count(distinct e) from t1),19+(abs(19)/abs(17))*f,t1.b))) then 11 when 17>t1.f then +a else t1.d end))} -} {} -do_test randexpr-2.915 { - db eval {SELECT case when +11 | (select min(case 13+a when e then d else 17-t1.b-~b*a end) from t1)-f*t1.f=(coalesce((select e from t1 where a<=f and not exists(select 1 from t1 where d-case 19 when 11 then (b) else t1.e end not between -t1.a and (t1.c))),e)) then t1.e when -17>=d then t1.f else t1.b end*t1.a FROM t1 WHERE e<=19} -} {} -do_test randexpr-2.916 { - db eval {SELECT case when +11 | (select min(case 13+a when e then d else 17-t1.b-~b*a end) from t1)-f*t1.f=(coalesce((select e from t1 where a<=f and not exists(select 1 from t1 where d-case 19 when 11 then (b) else t1.e end not between -t1.a and (t1.c))),e)) then t1.e when -17>=d then t1.f else t1.b end*t1.a FROM t1 WHERE NOT (e<=19)} -} {20000} -do_test randexpr-2.917 { - db eval {SELECT case when +11 & (select min(case 13+a when e then d else 17-t1.b-~b*a end) from t1)-f*t1.f=(coalesce((select e from t1 where a<=f and not exists(select 1 from t1 where d-case 19 when 11 then (b) else t1.e end not between -t1.a and (t1.c))),e)) then t1.e when -17>=d then t1.f else t1.b end*t1.a FROM t1 WHERE NOT (e<=19)} -} {20000} -do_test randexpr-2.918 { - db eval {SELECT 11-coalesce((select max(coalesce((select max((select abs(case +max((e)) when abs(abs( -count(distinct e))) then +cast(avg(f) AS integer) else count(*) end+count(*)+min( -e)) from t1)) from t1 where t1.b in (select count(distinct (17 | case case when e in (13,t1.a,e) or t1.d>=t1.e then 17 else a end when t1.e then 17 else t1.d end*t1.c)) from t1 union select cast(avg(t1.a) AS integer) from t1)),17)) from t1 where t1.c in (select ~cast(avg(t1.b) AS integer) from t1 union select -(cast(avg(t1.c) AS integer)) from t1)),(t1.c)) FROM t1 WHERE t1.b not in (case when 11 in (select case +min(t1.f) when (+cast(avg((case t1.c when a then f else a end-f)) AS integer)) then +count(distinct (t1.f))-count(distinct t1.f) else count(*) end-count(*) | count(*) from t1 union select min(e) from t1) then (abs(b | 13-f | c)/abs(t1.f)) else t1.c end,f,t1.b) or not -t1.a=11} -} {-289} -do_test randexpr-2.919 { - db eval {SELECT 11-coalesce((select max(coalesce((select max((select abs(case +max((e)) when abs(abs( -count(distinct e))) then +cast(avg(f) AS integer) else count(*) end+count(*)+min( -e)) from t1)) from t1 where t1.b in (select count(distinct (17 | case case when e in (13,t1.a,e) or t1.d>=t1.e then 17 else a end when t1.e then 17 else t1.d end*t1.c)) from t1 union select cast(avg(t1.a) AS integer) from t1)),17)) from t1 where t1.c in (select ~cast(avg(t1.b) AS integer) from t1 union select -(cast(avg(t1.c) AS integer)) from t1)),(t1.c)) FROM t1 WHERE NOT (t1.b not in (case when 11 in (select case +min(t1.f) when (+cast(avg((case t1.c when a then f else a end-f)) AS integer)) then +count(distinct (t1.f))-count(distinct t1.f) else count(*) end-count(*) | count(*) from t1 union select min(e) from t1) then (abs(b | 13-f | c)/abs(t1.f)) else t1.c end,f,t1.b) or not -t1.a=11)} -} {} -do_test randexpr-2.920 { - db eval {SELECT 11-coalesce((select max(coalesce((select max((select abs(case +max((e)) when abs(abs( -count(distinct e))) then +cast(avg(f) AS integer) else count(*) end+count(*)+min( -e)) from t1)) from t1 where t1.b in (select count(distinct (17 & case case when e in (13,t1.a,e) or t1.d>=t1.e then 17 else a end when t1.e then 17 else t1.d end*t1.c)) from t1 union select cast(avg(t1.a) AS integer) from t1)),17)) from t1 where t1.c in (select ~cast(avg(t1.b) AS integer) from t1 union select -(cast(avg(t1.c) AS integer)) from t1)),(t1.c)) FROM t1 WHERE t1.b not in (case when 11 in (select case +min(t1.f) when (+cast(avg((case t1.c when a then f else a end-f)) AS integer)) then +count(distinct (t1.f))-count(distinct t1.f) else count(*) end-count(*) | count(*) from t1 union select min(e) from t1) then (abs(b | 13-f | c)/abs(t1.f)) else t1.c end,f,t1.b) or not -t1.a=11} -} {-289} -do_test randexpr-2.921 { - db eval {SELECT (select -abs(max(+(select +count(*) from t1)))-max(case when b in (select (abs(13)/abs(b)) from t1 union select case when exists(select 1 from t1 where not exists(select 1 from t1 where (abs(17)/abs(coalesce((select max(+19*t1.e+case t1.f when (abs(f)/abs(t1.f)) then t1.f else e end) from t1 where 19<17),t1.a)))+11 in (select b from t1 union select t1.e from t1))) then d else t1.c end from t1) then f when 13=d then -a else t1.a end) from t1) FROM t1 WHERE ~(select ~ -(min(f)- -cast(avg(f) AS integer)-abs(count(distinct case when t1.d=b then d when e in (select +cast(avg(e) AS integer) from t1 union select count(*) from t1) then t1.f else c end*17*f))) | (count(*)) from t1)-f<>case when (select + -max(t1.e) from t1)+(select -min(17) from t1)*13 between 17 and 19 then t1.b else t1.d end} -} {-101} -do_test randexpr-2.922 { - db eval {SELECT (select -abs(max(+(select +count(*) from t1)))-max(case when b in (select (abs(13)/abs(b)) from t1 union select case when exists(select 1 from t1 where not exists(select 1 from t1 where (abs(17)/abs(coalesce((select max(+19*t1.e+case t1.f when (abs(f)/abs(t1.f)) then t1.f else e end) from t1 where 19<17),t1.a)))+11 in (select b from t1 union select t1.e from t1))) then d else t1.c end from t1) then f when 13=d then -a else t1.a end) from t1) FROM t1 WHERE NOT (~(select ~ -(min(f)- -cast(avg(f) AS integer)-abs(count(distinct case when t1.d=b then d when e in (select +cast(avg(e) AS integer) from t1 union select count(*) from t1) then t1.f else c end*17*f))) | (count(*)) from t1)-f<>case when (select + -max(t1.e) from t1)+(select -min(17) from t1)*13 between 17 and 19 then t1.b else t1.d end)} -} {} -do_test randexpr-2.923 { - db eval {SELECT case (select ( - - -(+max(c))+min(e)-(count(*))+cast(avg(t1.e) AS integer)-min(t1.a)*(cast(avg(11) AS integer))) from t1) when t1.d then t1.c else case (select max(a) from t1) when -t1.b then case when not 17<>case when t1.e<=t1.d or ((t1.e))=t1.e then t1.f when e>=t1.b then 11 else t1.d end or d in (t1.f,t1.a,t1.a) then c | 17 when t1.f between t1.a and -t1.e then d else t1.c end else t1.c end end-t1.c FROM t1 WHERE not (exists(select 1 from t1 where a<>11+t1.d-t1.a+(select count(distinct t1.d)++max(case e when coalesce((select 11 from t1 where a>=case when coalesce((select f from t1 where exists(select 1 from t1 where 13 in (t1.c,13,t1.a))),(d))+f not between d and t1.e then d else (t1.c) end-13),(d))-t1.d then t1.a else 17 end) from t1)) and not a<(d)*19)} -} {0} -do_test randexpr-2.924 { - db eval {SELECT case (select ( - - -(+max(c))+min(e)-(count(*))+cast(avg(t1.e) AS integer)-min(t1.a)*(cast(avg(11) AS integer))) from t1) when t1.d then t1.c else case (select max(a) from t1) when -t1.b then case when not 17<>case when t1.e<=t1.d or ((t1.e))=t1.e then t1.f when e>=t1.b then 11 else t1.d end or d in (t1.f,t1.a,t1.a) then c | 17 when t1.f between t1.a and -t1.e then d else t1.c end else t1.c end end-t1.c FROM t1 WHERE NOT (not (exists(select 1 from t1 where a<>11+t1.d-t1.a+(select count(distinct t1.d)++max(case e when coalesce((select 11 from t1 where a>=case when coalesce((select f from t1 where exists(select 1 from t1 where 13 in (t1.c,13,t1.a))),(d))+f not between d and t1.e then d else (t1.c) end-13),(d))-t1.d then t1.a else 17 end) from t1)) and not a<(d)*19))} -} {} -do_test randexpr-2.925 { - db eval {SELECT case (select ( - - -(+max(c))+min(e)-(count(*))+cast(avg(t1.e) AS integer)-min(t1.a)*(cast(avg(11) AS integer))) from t1) when t1.d then t1.c else case (select max(a) from t1) when -t1.b then case when not 17<>case when t1.e<=t1.d or ((t1.e))=t1.e then t1.f when e>=t1.b then 11 else t1.d end or d in (t1.f,t1.a,t1.a) then c & 17 when t1.f between t1.a and -t1.e then d else t1.c end else t1.c end end-t1.c FROM t1 WHERE not (exists(select 1 from t1 where a<>11+t1.d-t1.a+(select count(distinct t1.d)++max(case e when coalesce((select 11 from t1 where a>=case when coalesce((select f from t1 where exists(select 1 from t1 where 13 in (t1.c,13,t1.a))),(d))+f not between d and t1.e then d else (t1.c) end-13),(d))-t1.d then t1.a else 17 end) from t1)) and not a<(d)*19)} -} {0} -do_test randexpr-2.926 { - db eval {SELECT case t1.b when c*(case when ((select ++case abs(cast(avg(a) AS integer))*min(c) when min(t1.c) then cast(avg(t1.b) AS integer) else count(*) end | (count(distinct t1.c)) | ((max(t1.a))) | count(distinct b) from t1) not between t1.e and 11 and coalesce((select max(e) from t1 where a between t1.c and c+b),e) in (select t1.d from t1 union select t1.b from t1) or (not exists(select 1 from t1 where 13<>t1.a))) then 11*b else t1.b end) then t1.c else e end FROM t1 WHERE exists(select 1 from t1 where t1.d>=f)} -} {} -do_test randexpr-2.927 { - db eval {SELECT case t1.b when c*(case when ((select ++case abs(cast(avg(a) AS integer))*min(c) when min(t1.c) then cast(avg(t1.b) AS integer) else count(*) end | (count(distinct t1.c)) | ((max(t1.a))) | count(distinct b) from t1) not between t1.e and 11 and coalesce((select max(e) from t1 where a between t1.c and c+b),e) in (select t1.d from t1 union select t1.b from t1) or (not exists(select 1 from t1 where 13<>t1.a))) then 11*b else t1.b end) then t1.c else e end FROM t1 WHERE NOT (exists(select 1 from t1 where t1.d>=f))} -} {500} -do_test randexpr-2.928 { - db eval {SELECT case t1.b when c*(case when ((select ++case abs(cast(avg(a) AS integer))*min(c) when min(t1.c) then cast(avg(t1.b) AS integer) else count(*) end & (count(distinct t1.c)) & ((max(t1.a))) & count(distinct b) from t1) not between t1.e and 11 and coalesce((select max(e) from t1 where a between t1.c and c+b),e) in (select t1.d from t1 union select t1.b from t1) or (not exists(select 1 from t1 where 13<>t1.a))) then 11*b else t1.b end) then t1.c else e end FROM t1 WHERE NOT (exists(select 1 from t1 where t1.d>=f))} -} {500} -do_test randexpr-2.929 { - db eval {SELECT d-coalesce((select d from t1 where case when ~11*a*c>=17 then coalesce((select (abs(t1.e+c+(abs(f*(select abs((min(e))) from t1)-t1.f)/abs( - -a))-a)/abs(t1.d)) from t1 where f not in (e,b,t1.f) and c<>f),f)*19 else f end in (b,e,17)),13)-19 FROM t1 WHERE not f>=11} -} {} -do_test randexpr-2.930 { - db eval {SELECT d-coalesce((select d from t1 where case when ~11*a*c>=17 then coalesce((select (abs(t1.e+c+(abs(f*(select abs((min(e))) from t1)-t1.f)/abs( - -a))-a)/abs(t1.d)) from t1 where f not in (e,b,t1.f) and c<>f),f)*19 else f end in (b,e,17)),13)-19 FROM t1 WHERE NOT (not f>=11)} -} {368} -do_test randexpr-2.931 { - db eval {SELECT f*t1.d+coalesce((select a+17-t1.e from t1 where 13=t1.f and not (t1.f | b*t1.d-t1.c*coalesce((select max(coalesce((select t1.f from t1 where f not in (13,a,d)),d)) from t1 where t1.a in (select cast(avg(c) AS integer) from t1 union select count(distinct b)*count(distinct t1.c) from t1)),((17)))+ -b+19+13)=t1.f and 19>=t1.a or - -a>=t1.b),a) FROM t1 WHERE f not in (coalesce((select max(19) from t1 where (t1.e<=+t1.f*case when ~(abs(b)/abs(b)) in (f,t1.d,17) then (abs(t1.e-11 | d)/abs(coalesce((select d from t1 where not coalesce((select t1.a from t1 where not exists(select 1 from t1 where c>=t1.c)),d) in (select count(distinct f)*cast(avg(19) AS integer) from t1 union select count(distinct d) from t1)),13))) when not 11<=t1.a then t1.f else 19 end-19)),f)-17, -a,e)} -} {240100} -do_test randexpr-2.932 { - db eval {SELECT f*t1.d+coalesce((select a+17-t1.e from t1 where 13=t1.f and not (t1.f | b*t1.d-t1.c*coalesce((select max(coalesce((select t1.f from t1 where f not in (13,a,d)),d)) from t1 where t1.a in (select cast(avg(c) AS integer) from t1 union select count(distinct b)*count(distinct t1.c) from t1)),((17)))+ -b+19+13)=t1.f and 19>=t1.a or - -a>=t1.b),a) FROM t1 WHERE NOT (f not in (coalesce((select max(19) from t1 where (t1.e<=+t1.f*case when ~(abs(b)/abs(b)) in (f,t1.d,17) then (abs(t1.e-11 | d)/abs(coalesce((select d from t1 where not coalesce((select t1.a from t1 where not exists(select 1 from t1 where c>=t1.c)),d) in (select count(distinct f)*cast(avg(19) AS integer) from t1 union select count(distinct d) from t1)),13))) when not 11<=t1.a then t1.f else 19 end-19)),f)-17, -a,e))} -} {} -do_test randexpr-2.933 { - db eval {SELECT f*t1.d+coalesce((select a+17-t1.e from t1 where 13=t1.f and not (t1.f & b*t1.d-t1.c*coalesce((select max(coalesce((select t1.f from t1 where f not in (13,a,d)),d)) from t1 where t1.a in (select cast(avg(c) AS integer) from t1 union select count(distinct b)*count(distinct t1.c) from t1)),((17)))+ -b+19+13)=t1.f and 19>=t1.a or - -a>=t1.b),a) FROM t1 WHERE f not in (coalesce((select max(19) from t1 where (t1.e<=+t1.f*case when ~(abs(b)/abs(b)) in (f,t1.d,17) then (abs(t1.e-11 | d)/abs(coalesce((select d from t1 where not coalesce((select t1.a from t1 where not exists(select 1 from t1 where c>=t1.c)),d) in (select count(distinct f)*cast(avg(19) AS integer) from t1 union select count(distinct d) from t1)),13))) when not 11<=t1.a then t1.f else 19 end-19)),f)-17, -a,e)} -} {240100} -do_test randexpr-2.934 { - db eval {SELECT coalesce((select case e*+(abs(t1.f-t1.b)/abs(e))-d when coalesce((select t1.e from t1 where exists(select 1 from t1 where +d+ -t1.e not between case when (abs(b)/abs(t1.b)) between a and 17 then t1.b when not 11 not between b and d then 19 else 19 end and t1.f and t1.a between 17 and b)), -13) then (t1.a) else 13 end from t1 where 17 between b and 13), -19) | c FROM t1 WHERE case when t1.e*t1.b | f+d | f+11+(a)-+a+ -t1.c-t1.f | coalesce((select case t1.e when 17 then e else t1.a end from t1 where t1.ab then e else t1.d end end-11>=13),e) | 13 FROM t1 WHERE not exists(select 1 from t1 where t1.c< -d or t1.e between c and -t1.d or d<=17)} -} {10143} -do_test randexpr-2.940 { - db eval {SELECT d*(select - - -max( -(abs(e)/abs(~t1.c))) from t1)-13 | coalesce((select max(+t1.a*a) from t1 where t1.e+case e when a then t1.f+(select case ~ -max(d)* - -cast(avg(c) AS integer) when -min( -t1.b) then min(t1.b) else count(distinct 13) end from t1)-a else ~case when t1.f not in (b,b,a) or c between d and t1.a then c when t1.b>b then e else t1.d end end-11>=13),e) | 13 FROM t1 WHERE NOT (not exists(select 1 from t1 where t1.c< -d or t1.e between c and -t1.d or d<=17))} -} {} -do_test randexpr-2.941 { - db eval {SELECT d*(select - - -max( -(abs(e)/abs(~t1.c))) from t1)-13 & coalesce((select max(+t1.a*a) from t1 where t1.e+case e when a then t1.f+(select case ~ -max(d)* - -cast(avg(c) AS integer) when -min( -t1.b) then min(t1.b) else count(distinct 13) end from t1)-a else ~case when t1.f not in (b,b,a) or c between d and t1.a then c when t1.b>b then e else t1.d end end-11>=13),e) & 13 FROM t1 WHERE not exists(select 1 from t1 where t1.c< -d or t1.e between c and -t1.d or d<=17)} -} {0} -do_test randexpr-2.942 { - db eval {SELECT t1.c*+case when a<>+case when b>t1.e or exists(select 1 from t1 where not exists(select 1 from t1 where t1.e in (select coalesce((select b from t1 where (d( -t1.d)),(( -b))) from t1 union select t1.d from t1))) then (select -max(t1.e)-count(*) from t1) else (t1.c) end+b+(t1.f) | f | e then t1.d when t1.f not in (19,13,e) then 13 else 11 end FROM t1 WHERE (f<>coalesce((select max(a) from t1 where (exists(select 1 from t1 where c between t1.b and case when (abs(19)/abs(t1.f)) in (t1.f,17,t1.a) then t1.b when t1.d<=t1.a then t1.a else c end or c=b and c>=t1.d and t1.d between c and t1.c)),e+case (select count(distinct case 19 when 13 then t1.b else 11 end) from t1) when 13 then b else t1.b end)-17-17)} -} {120000} -do_test randexpr-2.943 { - db eval {SELECT t1.c*+case when a<>+case when b>t1.e or exists(select 1 from t1 where not exists(select 1 from t1 where t1.e in (select coalesce((select b from t1 where (d( -t1.d)),(( -b))) from t1 union select t1.d from t1))) then (select -max(t1.e)-count(*) from t1) else (t1.c) end+b+(t1.f) | f | e then t1.d when t1.f not in (19,13,e) then 13 else 11 end FROM t1 WHERE NOT ((f<>coalesce((select max(a) from t1 where (exists(select 1 from t1 where c between t1.b and case when (abs(19)/abs(t1.f)) in (t1.f,17,t1.a) then t1.b when t1.d<=t1.a then t1.a else c end or c=b and c>=t1.d and t1.d between c and t1.c)),e+case (select count(distinct case 19 when 13 then t1.b else 11 end) from t1) when 13 then b else t1.b end)-17-17))} -} {} -do_test randexpr-2.944 { - db eval {SELECT t1.c*+case when a<>+case when b>t1.e or exists(select 1 from t1 where not exists(select 1 from t1 where t1.e in (select coalesce((select b from t1 where (d( -t1.d)),(( -b))) from t1 union select t1.d from t1))) then (select -max(t1.e)-count(*) from t1) else (t1.c) end+b+(t1.f) & f & e then t1.d when t1.f not in (19,13,e) then 13 else 11 end FROM t1 WHERE (f<>coalesce((select max(a) from t1 where (exists(select 1 from t1 where c between t1.b and case when (abs(19)/abs(t1.f)) in (t1.f,17,t1.a) then t1.b when t1.d<=t1.a then t1.a else c end or c=b and c>=t1.d and t1.d between c and t1.c)),e+case (select count(distinct case 19 when 13 then t1.b else 11 end) from t1) when 13 then b else t1.b end)-17-17)} -} {120000} -do_test randexpr-2.945 { - db eval {SELECT case when (e)- -((select case min(case when e in (select coalesce((select max(d) from t1 where 13<>(t1.d-e)),e) from t1 union select c from t1) then d else -11 end+a) when count(distinct -f) then count(*) else -(case cast(avg(17) AS integer)- -count(distinct t1.c)+cast(avg(b) AS integer) when -max(11) then count(*) else cast(avg(t1.e) AS integer) end+max(t1.f)) end from t1))<=t1.b | t1.e then t1.d when not exists(select 1 from t1 where c<>13) then 11 else d end FROM t1 WHERE (select max(t1.a*case f when b then ~case when not exists(select 1 from t1 where f-d>(select abs(cast(avg(~17+b+d) AS integer)) from t1) or f-e in (select b from t1 union select t1.d from t1) or exists(select 1 from t1 where 13<>b)) then (abs(a)/abs( -d)) when (d(t1.d-e)),e) from t1 union select c from t1) then d else -11 end+a) when count(distinct -f) then count(*) else -(case cast(avg(17) AS integer)- -count(distinct t1.c)+cast(avg(b) AS integer) when -max(11) then count(*) else cast(avg(t1.e) AS integer) end+max(t1.f)) end from t1))<=t1.b | t1.e then t1.d when not exists(select 1 from t1 where c<>13) then 11 else d end FROM t1 WHERE NOT ((select max(t1.a*case f when b then ~case when not exists(select 1 from t1 where f-d>(select abs(cast(avg(~17+b+d) AS integer)) from t1) or f-e in (select b from t1 union select t1.d from t1) or exists(select 1 from t1 where 13<>b)) then (abs(a)/abs( -d)) when (d(t1.d-e)),e) from t1 union select c from t1) then d else -11 end+a) when count(distinct -f) then count(*) else -(case cast(avg(17) AS integer)- -count(distinct t1.c)+cast(avg(b) AS integer) when -max(11) then count(*) else cast(avg(t1.e) AS integer) end+max(t1.f)) end from t1))<=t1.b & t1.e then t1.d when not exists(select 1 from t1 where c<>13) then 11 else d end FROM t1 WHERE NOT ((select max(t1.a*case f when b then ~case when not exists(select 1 from t1 where f-d>(select abs(cast(avg(~17+b+d) AS integer)) from t1) or f-e in (select b from t1 union select t1.d from t1) or exists(select 1 from t1 where 13<>b)) then (abs(a)/abs( -d)) when (d=e and d between d and a then t1.c when (t1.c>19) then -11 else a end from t1 where ac then t1.e else -d end-t1.e) between b and 11 then b when exists(select 1 from t1 where a<=d) then 11 else 13 end) then cast(avg(t1.b) AS integer)-(cast(avg(11) AS integer)-min(a))-count(distinct -e) else cast(avg(13) AS integer) end*max(b) from t1) or (t1.f not between t1.d and 17 | 19*e)} -} {} -do_test randexpr-2.949 { - db eval {SELECT (t1.b+coalesce((select case when e-13+11 | f+case when not t1.b not between t1.f and t1.f then e else (t1.e) end-c-b+c>=e and d between d and a then t1.c when (t1.c>19) then -11 else a end from t1 where ac then t1.e else -d end-t1.e) between b and 11 then b when exists(select 1 from t1 where a<=d) then 11 else 13 end) then cast(avg(t1.b) AS integer)-(cast(avg(11) AS integer)-min(a))-count(distinct -e) else cast(avg(13) AS integer) end*max(b) from t1) or (t1.f not between t1.d and 17 | 19*e))} -} {3413413} -do_test randexpr-2.950 { - db eval {SELECT (t1.b+coalesce((select case when e-13+11 & f+case when not t1.b not between t1.f and t1.f then e else (t1.e) end-c-b+c>=e and d between d and a then t1.c when (t1.c>19) then -11 else a end from t1 where ac then t1.e else -d end-t1.e) between b and 11 then b when exists(select 1 from t1 where a<=d) then 11 else 13 end) then cast(avg(t1.b) AS integer)-(cast(avg(11) AS integer)-min(a))-count(distinct -e) else cast(avg(13) AS integer) end*max(b) from t1) or (t1.f not between t1.d and 17 | 19*e))} -} {3413413} -do_test randexpr-2.951 { - db eval {SELECT coalesce((select max(+19) from t1 where t1.f>=(abs(19)/abs(t1.c*(select count(distinct (abs(t1.f)/abs(t1.c))*coalesce((select max(case when (select count(*) from t1)*t1.f in (t1.b,17,t1.f) then d when t1.e not in (t1.b,t1.a,t1.b) then -17 else t1.d end) from t1 where (11 not in (t1.b,(f),t1.c)) and t1.c>=t1.f),e)) from t1))) or ((t1.d<=t1.b))),13) FROM t1 WHERE t1.a<>(coalesce((select coalesce((select max(t1.a) from t1 where case -t1.c when t1.b then coalesce((select t1.b from t1 where not exists(select 1 from t1 where not exists(select 1 from t1 where ((select count(*)++count(distinct a) from t1) not between b and +(17))))),19)*t1.e else f end<=(t1.b)),t1.c) from t1 where d<>b),13)-17+a)+d+(19)+a or d between 11 and -11} -} {19} -do_test randexpr-2.952 { - db eval {SELECT coalesce((select max(+19) from t1 where t1.f>=(abs(19)/abs(t1.c*(select count(distinct (abs(t1.f)/abs(t1.c))*coalesce((select max(case when (select count(*) from t1)*t1.f in (t1.b,17,t1.f) then d when t1.e not in (t1.b,t1.a,t1.b) then -17 else t1.d end) from t1 where (11 not in (t1.b,(f),t1.c)) and t1.c>=t1.f),e)) from t1))) or ((t1.d<=t1.b))),13) FROM t1 WHERE NOT (t1.a<>(coalesce((select coalesce((select max(t1.a) from t1 where case -t1.c when t1.b then coalesce((select t1.b from t1 where not exists(select 1 from t1 where not exists(select 1 from t1 where ((select count(*)++count(distinct a) from t1) not between b and +(17))))),19)*t1.e else f end<=(t1.b)),t1.c) from t1 where d<>b),13)-17+a)+d+(19)+a or d between 11 and -11)} -} {} -do_test randexpr-2.953 { - db eval {SELECT t1.b-coalesce((select max(~t1.a) from t1 where coalesce((select max(t1.d) from t1 where coalesce((select max(coalesce((select t1.c*t1.d from t1 where not f>=a-t1.c+ -coalesce((select t1.f*e from t1 where (not exists(select 1 from t1 where d<=19))),b)-d),13)* -e) from t1 where (d<19 or 13 not between t1.f and t1.d)),11) between 17 and 19),t1.c)< -b),d) FROM t1 WHERE +case when b in (b+~b+t1.f,coalesce((select max(13) from t1 where exists(select 1 from t1 where 17<>+a or not exists(select 1 from t1 where e+19=f))),(e)),case when c>case when coalesce((select 13 from t1 where f>=t1.b and c not between t1.e and t1.d),11) in (select (case max(11) when (min(b)) then min( -d) else cast(avg(t1.e) AS integer) end) from t1 union select max(19) from t1) then t1.d else 13 end then t1.f else t1.e end) or b>=(t1.f) then t1.e else t1.e end*b>f} -} {-200} -do_test randexpr-2.954 { - db eval {SELECT t1.b-coalesce((select max(~t1.a) from t1 where coalesce((select max(t1.d) from t1 where coalesce((select max(coalesce((select t1.c*t1.d from t1 where not f>=a-t1.c+ -coalesce((select t1.f*e from t1 where (not exists(select 1 from t1 where d<=19))),b)-d),13)* -e) from t1 where (d<19 or 13 not between t1.f and t1.d)),11) between 17 and 19),t1.c)< -b),d) FROM t1 WHERE NOT (+case when b in (b+~b+t1.f,coalesce((select max(13) from t1 where exists(select 1 from t1 where 17<>+a or not exists(select 1 from t1 where e+19=f))),(e)),case when c>case when coalesce((select 13 from t1 where f>=t1.b and c not between t1.e and t1.d),11) in (select (case max(11) when (min(b)) then min( -d) else cast(avg(t1.e) AS integer) end) from t1 union select max(19) from t1) then t1.d else 13 end then t1.f else t1.e end) or b>=(t1.f) then t1.e else t1.e end*b>f)} -} {} -do_test randexpr-2.955 { - db eval {SELECT (select count(distinct + - -f-c-17*a+(t1.d)-+((select abs( - - -count(distinct 13)-count(*)*count(distinct t1.d)*count(*))-cast(avg(f) AS integer) from t1))-~19+13- -d*t1.e*(19)+ -f- -b) from t1)-e FROM t1 WHERE not t1.c between t1.f and coalesce((select coalesce((select case when exists(select 1 from t1 where +~f=case when d<>t1.d then t1.f else -d end and d between 17 and t1.c) then ~case when a in (d,c,t1.d) then 17 else t1.f end when f=f then d else -b end from t1 where c>f),e) from t1 where not exists(select 1 from t1 where t1.d<=c) and 19=(11) and t1.e<>19),a)} -} {-499} -do_test randexpr-2.956 { - db eval {SELECT (select count(distinct + - -f-c-17*a+(t1.d)-+((select abs( - - -count(distinct 13)-count(*)*count(distinct t1.d)*count(*))-cast(avg(f) AS integer) from t1))-~19+13- -d*t1.e*(19)+ -f- -b) from t1)-e FROM t1 WHERE NOT (not t1.c between t1.f and coalesce((select coalesce((select case when exists(select 1 from t1 where +~f=case when d<>t1.d then t1.f else -d end and d between 17 and t1.c) then ~case when a in (d,c,t1.d) then 17 else t1.f end when f=f then d else -b end from t1 where c>f),e) from t1 where not exists(select 1 from t1 where t1.d<=c) and 19=(11) and t1.e<>19),a))} -} {} -do_test randexpr-2.957 { - db eval {SELECT case when f-t1.b*coalesce((select max(11) from t1 where exists(select 1 from t1 where (abs(t1.b)/abs(13-11))=(19+c))),coalesce((select t1.c | f from t1 where (abs(c*19)/abs(17))=t1.e),19))-e between t1.f and -((19)) and 13 not between t1.c and 11 and not exists(select 1 from t1 where t1.b>b) then t1.d when t1.c>=13 then c else f end FROM t1 WHERE e-t1.c=+e*~coalesce((select max(t1.f) from t1 where (t1.f in (coalesce((select max(11) from t1 where -13<>(13)-(select (count(*)) from t1)*t1.f and ( -11+t1.b+b*b-(select max(13) from t1)) in (t1.f,a,f)),d),17,13))),t1.f)-e} -} {} -do_test randexpr-2.958 { - db eval {SELECT case when f-t1.b*coalesce((select max(11) from t1 where exists(select 1 from t1 where (abs(t1.b)/abs(13-11))=(19+c))),coalesce((select t1.c | f from t1 where (abs(c*19)/abs(17))=t1.e),19))-e between t1.f and -((19)) and 13 not between t1.c and 11 and not exists(select 1 from t1 where t1.b>b) then t1.d when t1.c>=13 then c else f end FROM t1 WHERE NOT (e-t1.c=+e*~coalesce((select max(t1.f) from t1 where (t1.f in (coalesce((select max(11) from t1 where -13<>(13)-(select (count(*)) from t1)*t1.f and ( -11+t1.b+b*b-(select max(13) from t1)) in (t1.f,a,f)),d),17,13))),t1.f)-e)} -} {300} -do_test randexpr-2.959 { - db eval {SELECT case when f-t1.b*coalesce((select max(11) from t1 where exists(select 1 from t1 where (abs(t1.b)/abs(13-11))=(19+c))),coalesce((select t1.c & f from t1 where (abs(c*19)/abs(17))=t1.e),19))-e between t1.f and -((19)) and 13 not between t1.c and 11 and not exists(select 1 from t1 where t1.b>b) then t1.d when t1.c>=13 then c else f end FROM t1 WHERE NOT (e-t1.c=+e*~coalesce((select max(t1.f) from t1 where (t1.f in (coalesce((select max(11) from t1 where -13<>(13)-(select (count(*)) from t1)*t1.f and ( -11+t1.b+b*b-(select max(13) from t1)) in (t1.f,a,f)),d),17,13))),t1.f)-e)} -} {300} -do_test randexpr-2.960 { - db eval {SELECT t1.e+case when coalesce((select -(abs(t1.e)/abs(t1.c-t1.e)) from t1 where d | d between -t1.d and ~case t1.d when t1.f then ((abs((select ((min(b)+abs(cast(avg(t1.a) AS integer)*(max(19))))-(cast(avg(t1.d) AS integer))) from t1)*~f)/abs(t1.a*t1.c)))*17 else 19 end),f)- -c<>t1.c then f else t1.f end FROM t1 WHERE 19*coalesce((select max(a) from t1 where not (select count(distinct ~t1.b | t1.d) from t1)t1.e then c when -b<11 then t1.c else -t1.e end and not d in ( -t1.d,t1.a,f) and c=t1.f and f<>t1.a),t1.b) between t1.a and b} -} {} -do_test randexpr-2.961 { - db eval {SELECT t1.e+case when coalesce((select -(abs(t1.e)/abs(t1.c-t1.e)) from t1 where d | d between -t1.d and ~case t1.d when t1.f then ((abs((select ((min(b)+abs(cast(avg(t1.a) AS integer)*(max(19))))-(cast(avg(t1.d) AS integer))) from t1)*~f)/abs(t1.a*t1.c)))*17 else 19 end),f)- -c<>t1.c then f else t1.f end FROM t1 WHERE NOT (19*coalesce((select max(a) from t1 where not (select count(distinct ~t1.b | t1.d) from t1)t1.e then c when -b<11 then t1.c else -t1.e end and not d in ( -t1.d,t1.a,f) and c=t1.f and f<>t1.a),t1.b) between t1.a and b)} -} {1100} -do_test randexpr-2.962 { - db eval {SELECT t1.e+case when coalesce((select -(abs(t1.e)/abs(t1.c-t1.e)) from t1 where d & d between -t1.d and ~case t1.d when t1.f then ((abs((select ((min(b)+abs(cast(avg(t1.a) AS integer)*(max(19))))-(cast(avg(t1.d) AS integer))) from t1)*~f)/abs(t1.a*t1.c)))*17 else 19 end),f)- -c<>t1.c then f else t1.f end FROM t1 WHERE NOT (19*coalesce((select max(a) from t1 where not (select count(distinct ~t1.b | t1.d) from t1)t1.e then c when -b<11 then t1.c else -t1.e end and not d in ( -t1.d,t1.a,f) and c=t1.f and f<>t1.a),t1.b) between t1.a and b)} -} {1100} -do_test randexpr-2.963 { - db eval {SELECT t1.b*coalesce((select max(e) from t1 where ((t1.d))<=case case when +coalesce((select (abs(t1.a)/abs(c))-(abs( -e)/abs(11* -t1.b+t1.d* -c))-t1.c from t1 where not exists(select 1 from t1 where t1.c=(11))), -11) between 17 and t1.a then t1.a when t1.b>t1.e then (b) else b end-c when d then d else t1.f end),((t1.e))) FROM t1 WHERE ~ -case when not exists(select 1 from t1 where t1.b between b and 11 | d) then -(abs(17+d)/abs(e)) else case when not (t1.d>=case when case a when case t1.f when (e) then 17 else 19 end then 13 else 19 end in (t1.e,b,((t1.b))) then d when t1.d not in (19,t1.a, -c) then 11 else -a end) then 11 else c end end*17*t1.b not in (a,b,13)} -} {100000} -do_test randexpr-2.964 { - db eval {SELECT t1.b*coalesce((select max(e) from t1 where ((t1.d))<=case case when +coalesce((select (abs(t1.a)/abs(c))-(abs( -e)/abs(11* -t1.b+t1.d* -c))-t1.c from t1 where not exists(select 1 from t1 where t1.c=(11))), -11) between 17 and t1.a then t1.a when t1.b>t1.e then (b) else b end-c when d then d else t1.f end),((t1.e))) FROM t1 WHERE NOT (~ -case when not exists(select 1 from t1 where t1.b between b and 11 | d) then -(abs(17+d)/abs(e)) else case when not (t1.d>=case when case a when case t1.f when (e) then 17 else 19 end then 13 else 19 end in (t1.e,b,((t1.b))) then d when t1.d not in (19,t1.a, -c) then 11 else -a end) then 11 else c end end*17*t1.b not in (a,b,13))} -} {} -do_test randexpr-2.965 { - db eval {SELECT e*case +case when not (select max(17) from t1)>=case when not d=c+t1.c then 11 else 11 end or (c in (select t1.c from t1 union select c from t1) or 11<=t1.a) or d<=11 or 19 in ( -13,d,19) or a not between 13 and (t1.c) then case when t1.f<=(t1.a) then t1.e+13*e when (t1.b) not between f and a then c else 11 end*11 else a end when 19 then t1.a else 17 end FROM t1 WHERE b<>17} -} {8500} -do_test randexpr-2.966 { - db eval {SELECT e*case +case when not (select max(17) from t1)>=case when not d=c+t1.c then 11 else 11 end or (c in (select t1.c from t1 union select c from t1) or 11<=t1.a) or d<=11 or 19 in ( -13,d,19) or a not between 13 and (t1.c) then case when t1.f<=(t1.a) then t1.e+13*e when (t1.b) not between f and a then c else 11 end*11 else a end when 19 then t1.a else 17 end FROM t1 WHERE NOT (b<>17)} -} {} -do_test randexpr-2.967 { - db eval {SELECT (abs(case when (13+e in (select min(a) | case abs(min(case when t1.e in (select b from t1 union select a from t1) then t1.e when t1.b=t1.c then t1.b else c end-f)) when ~(cast(avg(c) AS integer)) then min(t1.e) else count(*) end from t1 union select min(f) from t1)) and t1.d not between c and 13 then coalesce((select t1.d from t1 where t1.e<>a),19)-t1.d else 19 end)/abs(c))-c+11+c FROM t1 WHERE t1.ea),19)-t1.d else 19 end)/abs(c))-c+11+c FROM t1 WHERE NOT (t1.ea),19)-t1.d else 19 end)/abs(c))-c+11+c FROM t1 WHERE NOT (t1.e=t1.f)} -} {600} -do_test randexpr-2.971 { - db eval {SELECT case when case when not exists(select 1 from t1 where (11 not between ~~t1.d-case c when coalesce((select case f when coalesce((select max(t1.f) from t1 where 11 not in (((13)),d,t1.d)),11) then f else a end from t1 where 11 not between (t1.a) and 17),t1.c)-c*17 then (17) else t1.b end+t1.d+t1.a and d)) then t1.e-11+19 else (d) end*d<=11 then t1.b else f end FROM t1 WHERE NOT (not exists(select 1 from t1 where d>=t1.f))} -} {} -do_test randexpr-2.972 { - db eval {SELECT 13 | t1.c+case when (not t1.d-c between +t1.b and -coalesce((select (select count(distinct 17) from t1)*a from t1 where -case when not t1.f in (select count(distinct 13) from t1 union select min( -t1.a) from t1) then case when (t1.e)< -11 then -c else t1.a end else d end-c*t1.a-d+ -e-t1.a not in (17,e,t1.a)),b) | t1.f) then c else 11 end FROM t1 WHERE case when (+e | (t1.e) | 11)<>b then t1.b when t1.e<>~(case when (t1.a*b) in (select d from t1 union select b from t1) or t1.c not in (t1.a,t1.d,13) and t1.f in (select case min(19) when min(17) then min(19) else count(distinct t1.e) end from t1 union select (count(*)) from t1) then t1.f else b end)+11 then b else 13 end+t1.d between b and 17} -} {} -do_test randexpr-2.973 { - db eval {SELECT 13 | t1.c+case when (not t1.d-c between +t1.b and -coalesce((select (select count(distinct 17) from t1)*a from t1 where -case when not t1.f in (select count(distinct 13) from t1 union select min( -t1.a) from t1) then case when (t1.e)< -11 then -c else t1.a end else d end-c*t1.a-d+ -e-t1.a not in (17,e,t1.a)),b) | t1.f) then c else 11 end FROM t1 WHERE NOT (case when (+e | (t1.e) | 11)<>b then t1.b when t1.e<>~(case when (t1.a*b) in (select d from t1 union select b from t1) or t1.c not in (t1.a,t1.d,13) and t1.f in (select case min(19) when min(17) then min(19) else count(distinct t1.e) end from t1 union select (count(*)) from t1) then t1.f else b end)+11 then b else 13 end+t1.d between b and 17)} -} {605} -do_test randexpr-2.974 { - db eval {SELECT 13 & t1.c+case when (not t1.d-c between +t1.b and -coalesce((select (select count(distinct 17) from t1)*a from t1 where -case when not t1.f in (select count(distinct 13) from t1 union select min( -t1.a) from t1) then case when (t1.e)< -11 then -c else t1.a end else d end-c*t1.a-d+ -e-t1.a not in (17,e,t1.a)),b) & t1.f) then c else 11 end FROM t1 WHERE NOT (case when (+e | (t1.e) | 11)<>b then t1.b when t1.e<>~(case when (t1.a*b) in (select d from t1 union select b from t1) or t1.c not in (t1.a,t1.d,13) and t1.f in (select case min(19) when min(17) then min(19) else count(distinct t1.e) end from t1 union select (count(*)) from t1) then t1.f else b end)+11 then b else 13 end+t1.d between b and 17)} -} {8} -do_test randexpr-2.975 { - db eval {SELECT case when case when t1.a<>t1.d then d*t1.a*11-e-(+11+d)-e else (select case -count(distinct t1.e) when cast(avg(b) AS integer) then count(distinct t1.d) else cast(avg(13) AS integer) end*cast(avg(19) AS integer) from t1) end<>case e when e then t1.e else (t1.f) end or not exists(select 1 from t1 where 19=f) and -t1.d>t1.e then t1.e+e*e when 11=t1.c then e else c end FROM t1 WHERE ~c>(case when t1.e<=e then case when case when 17+f in (d,t1.d | t1.c,t1.b) and 13<>19 or not t1.ct1.d then d*t1.a*11-e-(+11+d)-e else (select case -count(distinct t1.e) when cast(avg(b) AS integer) then count(distinct t1.d) else cast(avg(13) AS integer) end*cast(avg(19) AS integer) from t1) end<>case e when e then t1.e else (t1.f) end or not exists(select 1 from t1 where 19=f) and -t1.d>t1.e then t1.e+e*e when 11=t1.c then e else c end FROM t1 WHERE NOT (~c>(case when t1.e<=e then case when case when 17+f in (d,t1.d | t1.c,t1.b) and 13<>19 or not t1.c=t1.f))) and t1.c not in (17,b,e) then a else (select count(distinct t1.d) from t1) end FROM t1 WHERE (select (count(*)) from t1) between 11 and t1.d} -} {} -do_test randexpr-2.981 { - db eval {SELECT ~case when exists(select 1 from t1 where ((coalesce((select d from t1 where t1.e-f | +t1.d between t1.c and t1.a or exists(select 1 from t1 where 19 in (11,11,13)) and 17 in (select case min(d) when count(*) then (min(13)) else -(cast(avg( -c) AS integer)) end*count(distinct 19) from t1 union select count(distinct e) from t1)),f) | c*b<= -b or not not t1.c<13 or (t1.f)>=t1.f))) and t1.c not in (17,b,e) then a else (select count(distinct t1.d) from t1) end FROM t1 WHERE NOT ((select (count(*)) from t1) between 11 and t1.d)} -} {-101} -do_test randexpr-2.982 { - db eval {SELECT ~case when exists(select 1 from t1 where ((coalesce((select d from t1 where t1.e-f & +t1.d between t1.c and t1.a or exists(select 1 from t1 where 19 in (11,11,13)) and 17 in (select case min(d) when count(*) then (min(13)) else -(cast(avg( -c) AS integer)) end*count(distinct 19) from t1 union select count(distinct e) from t1)),f) & c*b<= -b or not not t1.c<13 or (t1.f)>=t1.f))) and t1.c not in (17,b,e) then a else (select count(distinct t1.d) from t1) end FROM t1 WHERE NOT ((select (count(*)) from t1) between 11 and t1.d)} -} {-101} -do_test randexpr-2.983 { - db eval {SELECT coalesce((select max(b) from t1 where not not c*t1.e>=19 or case when 17<=t1.b and case when 13 not between d and -f then case e when 11 then case when e in (select ( -d) from t1 union select e from t1) and 19<=(a) then t1.a else (19) end else f end else t1.a end+t1.a<19 then ~d when e in (a,11, -b) then b else e end not between f and 13),a) FROM t1 WHERE t1.a>=+a} -} {200} -do_test randexpr-2.984 { - db eval {SELECT coalesce((select max(b) from t1 where not not c*t1.e>=19 or case when 17<=t1.b and case when 13 not between d and -f then case e when 11 then case when e in (select ( -d) from t1 union select e from t1) and 19<=(a) then t1.a else (19) end else f end else t1.a end+t1.a<19 then ~d when e in (a,11, -b) then b else e end not between f and 13),a) FROM t1 WHERE NOT (t1.a>=+a)} -} {} -do_test randexpr-2.985 { - db eval {SELECT case when case when 11 between a+a+t1.b and b then c*e-t1.c*t1.a when +b<= -t1.c-t1.e-19*t1.b+c*t1.b then e else d end-(11)-e=11) or t1.c not between t1.d and - -11 then t1.a when 11 not between -t1.e and t1.a then 11 else t1.b end when (d not in (a,c,19)) then f else c end*17 from t1 where -11<=t1.c),t1.c)+f not in (t1.f, -d,19))} -} {} -do_test randexpr-2.988 { - db eval {SELECT c-case 17 when c+b-t1.a-a*coalesce((select max(t1.c) from t1 where t1.b- -(abs(13)/abs(t1.e)) in (case t1.f when f then coalesce((select max(coalesce((select 13 from t1 where exists(select 1 from t1 where f not between e and c)),e)) from t1 where d not between t1.a and 13),d)-b else a end, -13,(t1.f)) and 13 between e and 17),a) | a then t1.d else e end+ -t1.e FROM t1 WHERE NOT (not exists(select 1 from t1 where coalesce((select -+t1.c | case when a in (select case max(+b) when ~count(*) then count(*) else (abs((max(f)))) end from t1 union select -max(e) from t1) then case when (t1.d>=11) or t1.c not between t1.d and - -11 then t1.a when 11 not between -t1.e and t1.a then 11 else t1.b end when (d not in (a,c,19)) then f else c end*17 from t1 where -11<=t1.c),t1.c)+f not in (t1.f, -d,19)))} -} {-700} -do_test randexpr-2.989 { - db eval {SELECT c-case 17 when c+b-t1.a-a*coalesce((select max(t1.c) from t1 where t1.b- -(abs(13)/abs(t1.e)) in (case t1.f when f then coalesce((select max(coalesce((select 13 from t1 where exists(select 1 from t1 where f not between e and c)),e)) from t1 where d not between t1.a and 13),d)-b else a end, -13,(t1.f)) and 13 between e and 17),a) & a then t1.d else e end+ -t1.e FROM t1 WHERE NOT (not exists(select 1 from t1 where coalesce((select -+t1.c | case when a in (select case max(+b) when ~count(*) then count(*) else (abs((max(f)))) end from t1 union select -max(e) from t1) then case when (t1.d>=11) or t1.c not between t1.d and - -11 then t1.a when 11 not between -t1.e and t1.a then 11 else t1.b end when (d not in (a,c,19)) then f else c end*17 from t1 where -11<=t1.c),t1.c)+f not in (t1.f, -d,19)))} -} {-700} -do_test randexpr-2.990 { - db eval {SELECT (select ( -count(distinct case case a when e then c*case when e<=t1.d+b then a when (abs(t1.f)/abs(case when b-coalesce((select max(t1.f-t1.b) from t1 where not exists(select 1 from t1 where 17 in (b,13,(b)) or b in (d,c,t1.e))),t1.b) not in (d,((c)),t1.b) then -19 when c between a and 13 then 19 else t1.f end))=13 then f else 13 end else 17 end when 13 then t1.f else t1.b end-t1.c)) from t1) FROM t1 WHERE coalesce((select max(t1.d) from t1 where t1.c<>t1.c-13),t1.a)>=d or b*coalesce((select max((d)) from t1 where c not between +coalesce((select max(13) from t1 where e between -(abs(( -coalesce((select max(case f when t1.f then e else -t1.c end) from t1 where 11>e and t1.bt1.c-13),t1.a)>=d or b*coalesce((select max((d)) from t1 where c not between +coalesce((select max(13) from t1 where e between -(abs(( -coalesce((select max(case f when t1.f then e else -t1.c end) from t1 where 11>e and t1.bb then t1.a else e end | f from t1 where 13 in (select abs(~max((17))) from t1 union select cast(avg(t1.b) AS integer)-min(19) from t1)), -t1.a) when c+case ~e+~t1.d | 13 when case when t1.c<=t1.c or (11)=t1.a then 11 when -11 in (17,11, -d) then t1.a else t1.b end then 19 else 13 end* -t1.c} -} {100500} -do_test randexpr-2.993 { - db eval {SELECT case when (11=(t1.b)) then t1.c-coalesce((select case when t1.f*c-b<>b then t1.a else e end | f from t1 where 13 in (select abs(~max((17))) from t1 union select cast(avg(t1.b) AS integer)-min(19) from t1)), -t1.a) when c+case ~e+~t1.d | 13 when case when t1.c<=t1.c or (11)=t1.a then 11 when -11 in (17,11, -d) then t1.a else t1.b end then 19 else 13 end* -t1.c)} -} {} -do_test randexpr-2.994 { - db eval {SELECT case when (11=(t1.b)) then t1.c-coalesce((select case when t1.f*c-b<>b then t1.a else e end & f from t1 where 13 in (select abs(~max((17))) from t1 union select cast(avg(t1.b) AS integer)-min(19) from t1)), -t1.a) when c+case ~e+~t1.d | 13 when case when t1.c<=t1.c or (11)=t1.a then 11 when -11 in (17,11, -d) then t1.a else t1.b end then 19 else 13 end* -t1.c} -} {100500} -do_test randexpr-2.995 { - db eval {SELECT case when (f in (select count(distinct 17) from t1 union select count(distinct t1.b) from t1)) then d when e in (coalesce((select max(e+e) from t1 where exists(select 1 from t1 where not exists(select 1 from t1 where 11-t1.a in (select case -max(11)-max(b) when min(t1.f) then count(distinct f) else count(distinct t1.c) end | count(*) from t1 union select min( -a) from t1)) and t1.e in (select count(distinct -t1.e) from t1 union select count(distinct a) from t1) and d not in (b,f,t1.d)) and a between t1.c and t1.e),f),c,11) then c else t1.f end | a FROM t1 WHERE coalesce((select a from t1 where t1.a | (17-coalesce((select t1.b from t1 where ~t1.f | t1.e=d and a<=19+(select (cast(avg(c) AS integer)) from t1)),t1.c))+t1.e*t1.d+t1.c not between t1.d and 19), -t1.d) in (select (count(*)) from t1 union select (++~min(c)*+max(t1.a)+cast(avg( -(t1.e)) AS integer)) from t1)} -} {} -do_test randexpr-2.996 { - db eval {SELECT case when (f in (select count(distinct 17) from t1 union select count(distinct t1.b) from t1)) then d when e in (coalesce((select max(e+e) from t1 where exists(select 1 from t1 where not exists(select 1 from t1 where 11-t1.a in (select case -max(11)-max(b) when min(t1.f) then count(distinct f) else count(distinct t1.c) end | count(*) from t1 union select min( -a) from t1)) and t1.e in (select count(distinct -t1.e) from t1 union select count(distinct a) from t1) and d not in (b,f,t1.d)) and a between t1.c and t1.e),f),c,11) then c else t1.f end | a FROM t1 WHERE NOT (coalesce((select a from t1 where t1.a | (17-coalesce((select t1.b from t1 where ~t1.f | t1.e=d and a<=19+(select (cast(avg(c) AS integer)) from t1)),t1.c))+t1.e*t1.d+t1.c not between t1.d and 19), -t1.d) in (select (count(*)) from t1 union select (++~min(c)*+max(t1.a)+cast(avg( -(t1.e)) AS integer)) from t1))} -} {636} -do_test randexpr-2.997 { - db eval {SELECT case when (f in (select count(distinct 17) from t1 union select count(distinct t1.b) from t1)) then d when e in (coalesce((select max(e+e) from t1 where exists(select 1 from t1 where not exists(select 1 from t1 where 11-t1.a in (select case -max(11)-max(b) when min(t1.f) then count(distinct f) else count(distinct t1.c) end & count(*) from t1 union select min( -a) from t1)) and t1.e in (select count(distinct -t1.e) from t1 union select count(distinct a) from t1) and d not in (b,f,t1.d)) and a between t1.c and t1.e),f),c,11) then c else t1.f end & a FROM t1 WHERE NOT (coalesce((select a from t1 where t1.a | (17-coalesce((select t1.b from t1 where ~t1.f | t1.e=d and a<=19+(select (cast(avg(c) AS integer)) from t1)),t1.c))+t1.e*t1.d+t1.c not between t1.d and 19), -t1.d) in (select (count(*)) from t1 union select (++~min(c)*+max(t1.a)+cast(avg( -(t1.e)) AS integer)) from t1))} -} {64} -do_test randexpr-2.998 { - db eval {SELECT case when coalesce((select t1.b from t1 where a not in (19,coalesce((select max(t1.f) from t1 where (select count(distinct t1.b) from t1) in (t1.e,t1.f*13-11,d)),(t1.f))-17*c,c) or t1.c<=11),19)>13 and f not in (t1.a,11,t1.d) then (((e))) when f=11 or f not in (a,19,17) then 13 else e end FROM t1 WHERE c in (select min(t1.a*a+(select count(distinct t1.b+(t1.a)- - -c) from t1)-t1.e) from t1 union select count(*) from t1) and c in (select min(t1.d) from t1 union select cast(avg(d) AS integer)+abs(case count(*) when count(distinct 11) then -count(distinct 19) else count(distinct (t1.b)) end) | cast(avg((t1.c)) AS integer)+count(*) from t1) and e=13 and t1.d>c or 13 not in (17,(t1.f),t1.a) or (11)=t1.b and t1.e>=a or 11<=t1.b or d<=17} -} {500} -do_test randexpr-2.999 { - db eval {SELECT case when coalesce((select t1.b from t1 where a not in (19,coalesce((select max(t1.f) from t1 where (select count(distinct t1.b) from t1) in (t1.e,t1.f*13-11,d)),(t1.f))-17*c,c) or t1.c<=11),19)>13 and f not in (t1.a,11,t1.d) then (((e))) when f=11 or f not in (a,19,17) then 13 else e end FROM t1 WHERE NOT (c in (select min(t1.a*a+(select count(distinct t1.b+(t1.a)- - -c) from t1)-t1.e) from t1 union select count(*) from t1) and c in (select min(t1.d) from t1 union select cast(avg(d) AS integer)+abs(case count(*) when count(distinct 11) then -count(distinct 19) else count(distinct (t1.b)) end) | cast(avg((t1.c)) AS integer)+count(*) from t1) and e=13 and t1.d>c or 13 not in (17,(t1.f),t1.a) or (11)=t1.b and t1.e>=a or 11<=t1.b or d<=17)} -} {} -do_test randexpr-2.1000 { - db eval {SELECT case when t1.d not between (abs(d)/abs(t1.e))+t1.f*t1.a*a and 17*e then case when 11 between a and coalesce((select max(t1.b) from t1 where (case when t1.e+(t1.b) not in (t1.e,d,f) or 13<>17 then 17 when a>e then 11 else a end in (select count(*) from t1 union select min(a) from t1))),17) then 19 when -11 in (select t1.c from t1 union select -19 from t1) or - - -t1.e=t1.a then 17 else t1.a end else t1.e end FROM t1 WHERE (select +count(distinct f) from t1)-t1.f between t1.f and c} -} {} -do_test randexpr-2.1001 { - db eval {SELECT case when t1.d not between (abs(d)/abs(t1.e))+t1.f*t1.a*a and 17*e then case when 11 between a and coalesce((select max(t1.b) from t1 where (case when t1.e+(t1.b) not in (t1.e,d,f) or 13<>17 then 17 when a>e then 11 else a end in (select count(*) from t1 union select min(a) from t1))),17) then 19 when -11 in (select t1.c from t1 union select -19 from t1) or - - -t1.e=t1.a then 17 else t1.a end else t1.e end FROM t1 WHERE NOT ((select +count(distinct f) from t1)-t1.f between t1.f and c)} -} {100} -do_test randexpr-2.1002 { - db eval {SELECT case when (case when e between t1.b and c+(select cast(avg( -case c when a then t1.f+c else 17 end) AS integer) from t1) then t1.e when not 19>=t1.a then 17 else d end in (select cast(avg(13) AS integer)-max(11) | +count(*) from t1 union select case (cast(avg(d) AS integer)) when min(a) then abs( -max(19)) else count(*) end from t1)) then (t1.a) else c end | -e*a FROM t1 WHERE f*t1.d*(abs(case d when coalesce((select max((abs(t1.e)/abs(t1.f))) from t1 where ((e between (b) and 13) or t1.d=(c)) and t1.f between 17 and t1.e),a) then -b else -e end+ -t1.e)/abs(t1.c))+f<=17 or t1.f not between f and t1.e or (t1.c in (select 17 from t1 union select f from t1)) or exists(select 1 from t1 where (a not in (d,t1.a,t1.e) and t1.a in (t1.a,c,19))) and f not in (t1.d,t1.c,c)} -} {-49732} -do_test randexpr-2.1003 { - db eval {SELECT case when (case when e between t1.b and c+(select cast(avg( -case c when a then t1.f+c else 17 end) AS integer) from t1) then t1.e when not 19>=t1.a then 17 else d end in (select cast(avg(13) AS integer)-max(11) | +count(*) from t1 union select case (cast(avg(d) AS integer)) when min(a) then abs( -max(19)) else count(*) end from t1)) then (t1.a) else c end | -e*a FROM t1 WHERE NOT (f*t1.d*(abs(case d when coalesce((select max((abs(t1.e)/abs(t1.f))) from t1 where ((e between (b) and 13) or t1.d=(c)) and t1.f between 17 and t1.e),a) then -b else -e end+ -t1.e)/abs(t1.c))+f<=17 or t1.f not between f and t1.e or (t1.c in (select 17 from t1 union select f from t1)) or exists(select 1 from t1 where (a not in (d,t1.a,t1.e) and t1.a in (t1.a,c,19))) and f not in (t1.d,t1.c,c))} -} {} -do_test randexpr-2.1004 { - db eval {SELECT case when (case when e between t1.b and c+(select cast(avg( -case c when a then t1.f+c else 17 end) AS integer) from t1) then t1.e when not 19>=t1.a then 17 else d end in (select cast(avg(13) AS integer)-max(11) & +count(*) from t1 union select case (cast(avg(d) AS integer)) when min(a) then abs( -max(19)) else count(*) end from t1)) then (t1.a) else c end & -e*a FROM t1 WHERE f*t1.d*(abs(case d when coalesce((select max((abs(t1.e)/abs(t1.f))) from t1 where ((e between (b) and 13) or t1.d=(c)) and t1.f between 17 and t1.e),a) then -b else -e end+ -t1.e)/abs(t1.c))+f<=17 or t1.f not between f and t1.e or (t1.c in (select 17 from t1 union select f from t1)) or exists(select 1 from t1 where (a not in (d,t1.a,t1.e) and t1.a in (t1.a,c,19))) and f not in (t1.d,t1.c,c)} -} {32} -do_test randexpr-2.1005 { - db eval {SELECT -case coalesce((select case when f<>t1.d | c-(e)*t1.b and 17 in (select t1.b from t1 union select -(t1.c) from t1) or t1.e>=11 and t1.f not between b and f or e not in (11,19,t1.e) and t1.c<=a then coalesce((select max(t1.f+t1.f) from t1 where -t1.a=13),e) when t1.e then c else t1.a end FROM t1 WHERE coalesce((select t1.f from t1 where (t1.e>=case (abs(11)/abs(t1.a)) when 11 then case t1.c when t1.a then t1.e else a end else t1.f end+t1.d) and (exists(select 1 from t1 where t1.b not in (t1.b,a,19))) or t1.a>=11),(select abs((~cast(avg(t1.b) AS integer)-~cast(avg((t1.b)) AS integer)* -count(*))+ -count(distinct t1.b)) from t1)*19)<=f and b in (select count(*) from t1 union select -min(d) from t1)} -} {} -do_test randexpr-2.1006 { - db eval {SELECT -case coalesce((select case when f<>t1.d | c-(e)*t1.b and 17 in (select t1.b from t1 union select -(t1.c) from t1) or t1.e>=11 and t1.f not between b and f or e not in (11,19,t1.e) and t1.c<=a then coalesce((select max(t1.f+t1.f) from t1 where -t1.a=13),e) when t1.e then c else t1.a end FROM t1 WHERE NOT (coalesce((select t1.f from t1 where (t1.e>=case (abs(11)/abs(t1.a)) when 11 then case t1.c when t1.a then t1.e else a end else t1.f end+t1.d) and (exists(select 1 from t1 where t1.b not in (t1.b,a,19))) or t1.a>=11),(select abs((~cast(avg(t1.b) AS integer)-~cast(avg((t1.b)) AS integer)* -count(*))+ -count(distinct t1.b)) from t1)*19)<=f and b in (select count(*) from t1 union select -min(d) from t1))} -} {-100} -do_test randexpr-2.1007 { - db eval {SELECT -case coalesce((select case when f<>t1.d & c-(e)*t1.b and 17 in (select t1.b from t1 union select -(t1.c) from t1) or t1.e>=11 and t1.f not between b and f or e not in (11,19,t1.e) and t1.c<=a then coalesce((select max(t1.f+t1.f) from t1 where -t1.a=13),e) when t1.e then c else t1.a end FROM t1 WHERE NOT (coalesce((select t1.f from t1 where (t1.e>=case (abs(11)/abs(t1.a)) when 11 then case t1.c when t1.a then t1.e else a end else t1.f end+t1.d) and (exists(select 1 from t1 where t1.b not in (t1.b,a,19))) or t1.a>=11),(select abs((~cast(avg(t1.b) AS integer)-~cast(avg((t1.b)) AS integer)* -count(*))+ -count(distinct t1.b)) from t1)*19)<=f and b in (select count(*) from t1 union select -min(d) from t1))} -} {-100} -do_test randexpr-2.1008 { - db eval {SELECT case when exists(select 1 from t1 where exists(select 1 from t1 where -case when t1.d<=coalesce((select t1.d | (f)*t1.a from t1 where not exists(select 1 from t1 where t1.f not in ((e),t1.e,13) or t1.a not between a and -t1.d or (f) not between f and 13)),19) then e when (t1.f)<19 or e<=d then b else d end in (select case ~ -(cast(avg(b) AS integer)*cast(avg(t1.b) AS integer)*min(t1.f)) | count(*) when min(t1.c) then ( - -count(distinct -d)) else count(*) end from t1 union select cast(avg(f) AS integer) from t1) and bt1.b or 19<>t1.f} -} {400} -do_test randexpr-2.1009 { - db eval {SELECT case when exists(select 1 from t1 where exists(select 1 from t1 where -case when t1.d<=coalesce((select t1.d | (f)*t1.a from t1 where not exists(select 1 from t1 where t1.f not in ((e),t1.e,13) or t1.a not between a and -t1.d or (f) not between f and 13)),19) then e when (t1.f)<19 or e<=d then b else d end in (select case ~ -(cast(avg(b) AS integer)*cast(avg(t1.b) AS integer)*min(t1.f)) | count(*) when min(t1.c) then ( - -count(distinct -d)) else count(*) end from t1 union select cast(avg(f) AS integer) from t1) and bt1.b or 19<>t1.f)} -} {} -do_test randexpr-2.1010 { - db eval {SELECT case when exists(select 1 from t1 where exists(select 1 from t1 where -case when t1.d<=coalesce((select t1.d & (f)*t1.a from t1 where not exists(select 1 from t1 where t1.f not in ((e),t1.e,13) or t1.a not between a and -t1.d or (f) not between f and 13)),19) then e when (t1.f)<19 or e<=d then b else d end in (select case ~ -(cast(avg(b) AS integer)*cast(avg(t1.b) AS integer)*min(t1.f)) & count(*) when min(t1.c) then ( - -count(distinct -d)) else count(*) end from t1 union select cast(avg(f) AS integer) from t1) and bt1.b or 19<>t1.f} -} {400} -do_test randexpr-2.1011 { - db eval {SELECT case when ~+11<>f then case e when 11 then coalesce((select case d when t1.e-coalesce((select a+t1.c from t1 where (d) in (select +min(t1.f)+count(*) from t1 union select count(distinct t1.e) from t1)),t1.f) then t1.c else d end from t1 where t1.f in (select t1.f from t1 union select b from t1) or (t1.a not in ( -a,t1.a,t1.b))),t1.c) else t1.f end-t1.f when not exists(select 1 from t1 where b between f and t1.a) then t1.c else t1.f end FROM t1 WHERE t1.a<=coalesce((select max(b) from t1 where coalesce((select t1.c*case when coalesce((select max((select count(*) from t1)) from t1 where not not exists(select 1 from t1 where case t1.b | a when t1.f then c else 11 end<>f and 13>=13 and f between t1.b and c)),13)=case e when a then 19 else d end then t1.b when t1.a not in (a,t1.b,a) then e else b end-d from t1 where t1.f between t1.d and t1.e),e)>t1.f),17)+t1.f} -} {0} -do_test randexpr-2.1012 { - db eval {SELECT case when ~+11<>f then case e when 11 then coalesce((select case d when t1.e-coalesce((select a+t1.c from t1 where (d) in (select +min(t1.f)+count(*) from t1 union select count(distinct t1.e) from t1)),t1.f) then t1.c else d end from t1 where t1.f in (select t1.f from t1 union select b from t1) or (t1.a not in ( -a,t1.a,t1.b))),t1.c) else t1.f end-t1.f when not exists(select 1 from t1 where b between f and t1.a) then t1.c else t1.f end FROM t1 WHERE NOT (t1.a<=coalesce((select max(b) from t1 where coalesce((select t1.c*case when coalesce((select max((select count(*) from t1)) from t1 where not not exists(select 1 from t1 where case t1.b | a when t1.f then c else 11 end<>f and 13>=13 and f between t1.b and c)),13)=case e when a then 19 else d end then t1.b when t1.a not in (a,t1.b,a) then e else b end-d from t1 where t1.f between t1.d and t1.e),e)>t1.f),17)+t1.f)} -} {} -do_test randexpr-2.1013 { - db eval {SELECT (abs(d)/abs(t1.f++(select cast(avg(coalesce((select max(b) from t1 where case when t1.a*+(abs( -t1.b)/abs((select cast(avg(13) AS integer) from t1)))<=(t1.c-t1.d- -t1.c) then case d when 17 then -t1.d else f end when t1.b between t1.b and t1.b then a else t1.d end in (select count(*) from t1 union select abs(cast(avg(13) AS integer)) | min(t1.c) from t1) or ((13))>=b),17)) AS integer) from t1)+13)) FROM t1 WHERE coalesce((select +t1.a from t1 where not exists(select 1 from t1 where (select cast(avg(13) AS integer) from t1)<=(abs( -11)/abs(t1.f))*coalesce((select t1.e from t1 where not t1.f in (select max(+b-t1.d) from t1 union select + -(abs(cast(avg((t1.b)) AS integer)))-+count(*)-(min(13)) from t1)),d+t1.d*t1.d) | (17)-t1.b)),f) in (select max(t1.c) from t1 union select count(distinct f) from t1)} -} {} -do_test randexpr-2.1014 { - db eval {SELECT (abs(d)/abs(t1.f++(select cast(avg(coalesce((select max(b) from t1 where case when t1.a*+(abs( -t1.b)/abs((select cast(avg(13) AS integer) from t1)))<=(t1.c-t1.d- -t1.c) then case d when 17 then -t1.d else f end when t1.b between t1.b and t1.b then a else t1.d end in (select count(*) from t1 union select abs(cast(avg(13) AS integer)) | min(t1.c) from t1) or ((13))>=b),17)) AS integer) from t1)+13)) FROM t1 WHERE NOT (coalesce((select +t1.a from t1 where not exists(select 1 from t1 where (select cast(avg(13) AS integer) from t1)<=(abs( -11)/abs(t1.f))*coalesce((select t1.e from t1 where not t1.f in (select max(+b-t1.d) from t1 union select + -(abs(cast(avg((t1.b)) AS integer)))-+count(*)-(min(13)) from t1)),d+t1.d*t1.d) | (17)-t1.b)),f) in (select max(t1.c) from t1 union select count(distinct f) from t1))} -} {0} -do_test randexpr-2.1015 { - db eval {SELECT (abs(d)/abs(t1.f++(select cast(avg(coalesce((select max(b) from t1 where case when t1.a*+(abs( -t1.b)/abs((select cast(avg(13) AS integer) from t1)))<=(t1.c-t1.d- -t1.c) then case d when 17 then -t1.d else f end when t1.b between t1.b and t1.b then a else t1.d end in (select count(*) from t1 union select abs(cast(avg(13) AS integer)) & min(t1.c) from t1) or ((13))>=b),17)) AS integer) from t1)+13)) FROM t1 WHERE NOT (coalesce((select +t1.a from t1 where not exists(select 1 from t1 where (select cast(avg(13) AS integer) from t1)<=(abs( -11)/abs(t1.f))*coalesce((select t1.e from t1 where not t1.f in (select max(+b-t1.d) from t1 union select + -(abs(cast(avg((t1.b)) AS integer)))-+count(*)-(min(13)) from t1)),d+t1.d*t1.d) | (17)-t1.b)),f) in (select max(t1.c) from t1 union select count(distinct f) from t1))} -} {0} -do_test randexpr-2.1016 { - db eval {SELECT case t1.a when (select ~max(coalesce((select (t1.b-a*+t1.c-t1.e) from t1 where not 11*t1.f++t1.f-t1.a*f*+t1.e*t1.b>17 and 19+e not in (t1.c,t1.b,a)),19)) from t1) then 19*11 else d end | (17) | t1.d FROM t1 WHERE exists(select 1 from t1 where coalesce((select max(13) from t1 where t1.e not in (d,13-19,17) or e*19=d or ((t1.a< -t1.a or 11- -t1.d-case when 13<( -t1.e) then a else e end*t1.b+t1.e in (select t1.d from t1 union select t1.e from t1) and 19<>d))),b)+11*11=t1.e)} -} {} -do_test randexpr-2.1017 { - db eval {SELECT case t1.a when (select ~max(coalesce((select (t1.b-a*+t1.c-t1.e) from t1 where not 11*t1.f++t1.f-t1.a*f*+t1.e*t1.b>17 and 19+e not in (t1.c,t1.b,a)),19)) from t1) then 19*11 else d end | (17) | t1.d FROM t1 WHERE NOT (exists(select 1 from t1 where coalesce((select max(13) from t1 where t1.e not in (d,13-19,17) or e*19=d or ((t1.a< -t1.a or 11- -t1.d-case when 13<( -t1.e) then a else e end*t1.b+t1.e in (select t1.d from t1 union select t1.e from t1) and 19<>d))),b)+11*11=t1.e))} -} {401} -do_test randexpr-2.1018 { - db eval {SELECT case t1.a when (select ~max(coalesce((select (t1.b-a*+t1.c-t1.e) from t1 where not 11*t1.f++t1.f-t1.a*f*+t1.e*t1.b>17 and 19+e not in (t1.c,t1.b,a)),19)) from t1) then 19*11 else d end & (17) & t1.d FROM t1 WHERE NOT (exists(select 1 from t1 where coalesce((select max(13) from t1 where t1.e not in (d,13-19,17) or e*19=d or ((t1.a< -t1.a or 11- -t1.d-case when 13<( -t1.e) then a else e end*t1.b+t1.e in (select t1.d from t1 union select t1.e from t1) and 19<>d))),b)+11*11=t1.e))} -} {16} -do_test randexpr-2.1019 { - db eval {SELECT t1.a-coalesce((select 11-case when 11<19-f+t1.a then a | (t1.a+++(select cast(avg((abs(t1.d | e)/abs((abs(t1.a)/abs(13))))) AS integer)-max(a) from t1)+e+13*19+t1.a-c) else 13 end+t1.e-19 from t1 where 13>t1.f),e) FROM t1 WHERE ~(abs((select max( -case when d+(11)*d between coalesce((select 11 from t1 where (t1.f)=e),d*f) and t1.e then d-case when a<> -17+(abs(t1.d)/abs(t1.f)) then t1.f else t1.e end*11+c-(c) else d end) from t1)*t1.e)/abs((t1.f)))-f<>11} -} {-400} -do_test randexpr-2.1020 { - db eval {SELECT t1.a-coalesce((select 11-case when 11<19-f+t1.a then a | (t1.a+++(select cast(avg((abs(t1.d | e)/abs((abs(t1.a)/abs(13))))) AS integer)-max(a) from t1)+e+13*19+t1.a-c) else 13 end+t1.e-19 from t1 where 13>t1.f),e) FROM t1 WHERE NOT (~(abs((select max( -case when d+(11)*d between coalesce((select 11 from t1 where (t1.f)=e),d*f) and t1.e then d-case when a<> -17+(abs(t1.d)/abs(t1.f)) then t1.f else t1.e end*11+c-(c) else d end) from t1)*t1.e)/abs((t1.f)))-f<>11)} -} {} -do_test randexpr-2.1021 { - db eval {SELECT t1.a-coalesce((select 11-case when 11<19-f+t1.a then a & (t1.a+++(select cast(avg((abs(t1.d & e)/abs((abs(t1.a)/abs(13))))) AS integer)-max(a) from t1)+e+13*19+t1.a-c) else 13 end+t1.e-19 from t1 where 13>t1.f),e) FROM t1 WHERE ~(abs((select max( -case when d+(11)*d between coalesce((select 11 from t1 where (t1.f)=e),d*f) and t1.e then d-case when a<> -17+(abs(t1.d)/abs(t1.f)) then t1.f else t1.e end*11+c-(c) else d end) from t1)*t1.e)/abs((t1.f)))-f<>11} -} {-400} -do_test randexpr-2.1022 { - db eval {SELECT d | (select (cast(avg((abs(case when b*(abs((abs(case f when 17 then t1.e else t1.c end)/abs( -d)))/abs(t1.c)) in (d,a,a) then 19 when (exists(select 1 from t1 where t1.c=t1.a) or a<>d) then a else c end)/abs(t1.e))-17) AS integer)* -min(19)-count(distinct a)-+count(distinct 17)*min(t1.a)+ -cast(avg(t1.a) AS integer)- -max(17) | max(e)) from t1) FROM t1 WHERE -f-t1.f++e+case when not (((select abs(count(*)) from t1)) not in ((case when (t1.b>t1.c) then t1.b else f end),e,13)) and not exists(select 1 from t1 where 11 in (select t1.f from t1 union select ((t1.f)) from t1)) then (t1.e)+c-c+c when -b in (13,19,t1.c) then 17 else 13 end-d | t1.a not in (a,b,b)} -} {511} -do_test randexpr-2.1023 { - db eval {SELECT d | (select (cast(avg((abs(case when b*(abs((abs(case f when 17 then t1.e else t1.c end)/abs( -d)))/abs(t1.c)) in (d,a,a) then 19 when (exists(select 1 from t1 where t1.c=t1.a) or a<>d) then a else c end)/abs(t1.e))-17) AS integer)* -min(19)-count(distinct a)-+count(distinct 17)*min(t1.a)+ -cast(avg(t1.a) AS integer)- -max(17) | max(e)) from t1) FROM t1 WHERE NOT ( -f-t1.f++e+case when not (((select abs(count(*)) from t1)) not in ((case when (t1.b>t1.c) then t1.b else f end),e,13)) and not exists(select 1 from t1 where 11 in (select t1.f from t1 union select ((t1.f)) from t1)) then (t1.e)+c-c+c when -b in (13,19,t1.c) then 17 else 13 end-d | t1.a not in (a,b,b))} -} {} -do_test randexpr-2.1024 { - db eval {SELECT d & (select (cast(avg((abs(case when b*(abs((abs(case f when 17 then t1.e else t1.c end)/abs( -d)))/abs(t1.c)) in (d,a,a) then 19 when (exists(select 1 from t1 where t1.c=t1.a) or a<>d) then a else c end)/abs(t1.e))-17) AS integer)* -min(19)-count(distinct a)-+count(distinct 17)*min(t1.a)+ -cast(avg(t1.a) AS integer)- -max(17) & max(e)) from t1) FROM t1 WHERE -f-t1.f++e+case when not (((select abs(count(*)) from t1)) not in ((case when (t1.b>t1.c) then t1.b else f end),e,13)) and not exists(select 1 from t1 where 11 in (select t1.f from t1 union select ((t1.f)) from t1)) then (t1.e)+c-c+c when -b in (13,19,t1.c) then 17 else 13 end-d | t1.a not in (a,b,b)} -} {128} -do_test randexpr-2.1025 { - db eval {SELECT 11-(select min((abs(e)/abs(f*t1.e*c+17+~case when f | 11 between (select case -max(19) when (cast(avg(t1.a) AS integer)) then count(distinct t1.f) else count(*) end from t1) and coalesce((select 13 from t1 where a<=(t1.d)),f)-a then t1.a when f in (select 17 from t1 union select -b from t1) and t1.d(17) or 19>=d then (f) else 11 end))) from t1) FROM t1 WHERE e in (e, -17*t1.c*17,e)} -} {11} -do_test randexpr-2.1026 { - db eval {SELECT 11-(select min((abs(e)/abs(f*t1.e*c+17+~case when f | 11 between (select case -max(19) when (cast(avg(t1.a) AS integer)) then count(distinct t1.f) else count(*) end from t1) and coalesce((select 13 from t1 where a<=(t1.d)),f)-a then t1.a when f in (select 17 from t1 union select -b from t1) and t1.d(17) or 19>=d then (f) else 11 end))) from t1) FROM t1 WHERE NOT (e in (e, -17*t1.c*17,e))} -} {} -do_test randexpr-2.1027 { - db eval {SELECT 11-(select min((abs(e)/abs(f*t1.e*c+17+~case when f & 11 between (select case -max(19) when (cast(avg(t1.a) AS integer)) then count(distinct t1.f) else count(*) end from t1) and coalesce((select 13 from t1 where a<=(t1.d)),f)-a then t1.a when f in (select 17 from t1 union select -b from t1) and t1.d(17) or 19>=d then (f) else 11 end))) from t1) FROM t1 WHERE e in (e, -17*t1.c*17,e)} -} {11} -do_test randexpr-2.1028 { - db eval {SELECT coalesce((select max( -t1.d-f+~t1.d*t1.b) from t1 where (select ~+min(t1.f)+abs(min(+(select cast(avg((b)) AS integer) from t1)-d*d))-max(f)-count(distinct 19) | count(*)*count(*) from t1)>c),case 13 when +t1.c-t1.c-t1.a then c else c end*d) FROM t1 WHERE ((t1.b>=case when not exists(select 1 from t1 where not exists(select 1 from t1 where not exists(select 1 from t1 where e>=t1.a or (coalesce((select max(coalesce((select case when a in (select t1.d from t1 union select t1.c from t1) then a when -b in (17,c,t1.f) then f else b end from t1 where not exists(select 1 from t1 where f<=13)),17)) from t1 where t1.f>=t1.b),d) between t1.f and 11) or t1.b between 13 and t1.b))) then a when e<=17 then t1.b+ -~11 else a end and not e>= - -b or 13 not in (c,f,11)) and d not between 11 and t1.a)} -} {-81200} -do_test randexpr-2.1029 { - db eval {SELECT coalesce((select max( -t1.d-f+~t1.d*t1.b) from t1 where (select ~+min(t1.f)+abs(min(+(select cast(avg((b)) AS integer) from t1)-d*d))-max(f)-count(distinct 19) | count(*)*count(*) from t1)>c),case 13 when +t1.c-t1.c-t1.a then c else c end*d) FROM t1 WHERE NOT (((t1.b>=case when not exists(select 1 from t1 where not exists(select 1 from t1 where not exists(select 1 from t1 where e>=t1.a or (coalesce((select max(coalesce((select case when a in (select t1.d from t1 union select t1.c from t1) then a when -b in (17,c,t1.f) then f else b end from t1 where not exists(select 1 from t1 where f<=13)),17)) from t1 where t1.f>=t1.b),d) between t1.f and 11) or t1.b between 13 and t1.b))) then a when e<=17 then t1.b+ -~11 else a end and not e>= - -b or 13 not in (c,f,11)) and d not between 11 and t1.a))} -} {} -do_test randexpr-2.1030 { - db eval {SELECT coalesce((select max( -t1.d-f+~t1.d*t1.b) from t1 where (select ~+min(t1.f)+abs(min(+(select cast(avg((b)) AS integer) from t1)-d*d))-max(f)-count(distinct 19) & count(*)*count(*) from t1)>c),case 13 when +t1.c-t1.c-t1.a then c else c end*d) FROM t1 WHERE ((t1.b>=case when not exists(select 1 from t1 where not exists(select 1 from t1 where not exists(select 1 from t1 where e>=t1.a or (coalesce((select max(coalesce((select case when a in (select t1.d from t1 union select t1.c from t1) then a when -b in (17,c,t1.f) then f else b end from t1 where not exists(select 1 from t1 where f<=13)),17)) from t1 where t1.f>=t1.b),d) between t1.f and 11) or t1.b between 13 and t1.b))) then a when e<=17 then t1.b+ -~11 else a end and not e>= - -b or 13 not in (c,f,11)) and d not between 11 and t1.a)} -} {120000} -do_test randexpr-2.1031 { - db eval {SELECT case when t1.d<>coalesce((select 13 from t1 where (d in (select case when (13<>t1.a*d-19-+11*13-t1.c) then case when t1.c=d then e else t1.b end when not exists(select 1 from t1 where 17<>t1.b) then t1.e else t1.e end | t1.a+t1.e from t1 union select t1.d from t1))),t1.f) or a> -t1.e then 11 else 17 end*d FROM t1 WHERE t1.a-d<=d-(abs(coalesce((select b from t1 where ~e=13 then t1.d else (t1.c) end not between t1.a and 13 then a when (17) not between 11 and t1.c then a else a end) not between 13 and t1.d then 13 else a end),19))/abs(t1.e))+t1.c+t1.e*b+c or ((17 in (select f from t1 union select t1.e from t1)))} -} {4400} -do_test randexpr-2.1032 { - db eval {SELECT case when t1.d<>coalesce((select 13 from t1 where (d in (select case when (13<>t1.a*d-19-+11*13-t1.c) then case when t1.c=d then e else t1.b end when not exists(select 1 from t1 where 17<>t1.b) then t1.e else t1.e end | t1.a+t1.e from t1 union select t1.d from t1))),t1.f) or a> -t1.e then 11 else 17 end*d FROM t1 WHERE NOT (t1.a-d<=d-(abs(coalesce((select b from t1 where ~e=13 then t1.d else (t1.c) end not between t1.a and 13 then a when (17) not between 11 and t1.c then a else a end) not between 13 and t1.d then 13 else a end),19))/abs(t1.e))+t1.c+t1.e*b+c or ((17 in (select f from t1 union select t1.e from t1))))} -} {} -do_test randexpr-2.1033 { - db eval {SELECT case when t1.d<>coalesce((select 13 from t1 where (d in (select case when (13<>t1.a*d-19-+11*13-t1.c) then case when t1.c=d then e else t1.b end when not exists(select 1 from t1 where 17<>t1.b) then t1.e else t1.e end & t1.a+t1.e from t1 union select t1.d from t1))),t1.f) or a> -t1.e then 11 else 17 end*d FROM t1 WHERE t1.a-d<=d-(abs(coalesce((select b from t1 where ~e=13 then t1.d else (t1.c) end not between t1.a and 13 then a when (17) not between 11 and t1.c then a else a end) not between 13 and t1.d then 13 else a end),19))/abs(t1.e))+t1.c+t1.e*b+c or ((17 in (select f from t1 union select t1.e from t1)))} -} {4400} -do_test randexpr-2.1034 { - db eval {SELECT coalesce((select (abs(c)/abs(case when 13<=11 then t1.a when case t1.d when (11) then coalesce((select coalesce((select d-17 from t1 where t1.e=a),11) from t1 where 13 in (select t1.e from t1 union select c from t1)),19) else d end>=t1.f or 11 in (select cast(avg(t1.f) AS integer) from t1 union select ( - -count(*)) from t1) and t1.c between 13 and -b then f else e end)) from t1 where d<=(19)),d)-t1.b FROM t1 WHERE 17>=case when t1.c not in (f,t1.a,c*17*a | t1.c-~t1.d+(+coalesce((select max(case when exists(select 1 from t1 where (t1.e in (select -t1.e from t1 union select t1.c from t1))) then t1.b else t1.b*t1.b end) from t1 where not exists(select 1 from t1 where 17=t1.a)),d))+t1.e | (13)*t1.e+c) and e in (select -c from t1 union select 17 from t1) then t1.d*13 else c end- -e} -} {} -do_test randexpr-2.1035 { - db eval {SELECT coalesce((select (abs(c)/abs(case when 13<=11 then t1.a when case t1.d when (11) then coalesce((select coalesce((select d-17 from t1 where t1.e=a),11) from t1 where 13 in (select t1.e from t1 union select c from t1)),19) else d end>=t1.f or 11 in (select cast(avg(t1.f) AS integer) from t1 union select ( - -count(*)) from t1) and t1.c between 13 and -b then f else e end)) from t1 where d<=(19)),d)-t1.b FROM t1 WHERE NOT (17>=case when t1.c not in (f,t1.a,c*17*a | t1.c-~t1.d+(+coalesce((select max(case when exists(select 1 from t1 where (t1.e in (select -t1.e from t1 union select t1.c from t1))) then t1.b else t1.b*t1.b end) from t1 where not exists(select 1 from t1 where 17=t1.a)),d))+t1.e | (13)*t1.e+c) and e in (select -c from t1 union select 17 from t1) then t1.d*13 else c end- -e)} -} {200} -do_test randexpr-2.1036 { - db eval {SELECT (abs(case when t1.a in (select case when d=(select ~cast(avg(t1.a) AS integer) | ~+min(17*(abs(19)/abs(t1.a))) from t1) or 13 in (select count(distinct t1.b | 11) from t1 union select count(*) | count(distinct c) | count(distinct 17) from t1) and not b<=17 then t1.a when 11=t1.f then (abs(t1.c)/abs(11)) else f end from t1 union select c from t1) then t1.c else a end)/abs(t1.d))-t1.d FROM t1 WHERE ((abs(e)/abs(t1.a* -(coalesce((select max(t1.b-t1.d) from t1 where f>=13),~a+ -a)) | case when not exists(select 1 from t1 where coalesce((select max(c) from t1 where 19-t1.a | e<=17),~( -t1.a)) in (select f from t1 union select t1.d from t1)) then t1.d else (t1.c) end)) in (17,f,t1.a)) or 19=13 or 19=17} -} {} -do_test randexpr-2.1037 { - db eval {SELECT (abs(case when t1.a in (select case when d=(select ~cast(avg(t1.a) AS integer) | ~+min(17*(abs(19)/abs(t1.a))) from t1) or 13 in (select count(distinct t1.b | 11) from t1 union select count(*) | count(distinct c) | count(distinct 17) from t1) and not b<=17 then t1.a when 11=t1.f then (abs(t1.c)/abs(11)) else f end from t1 union select c from t1) then t1.c else a end)/abs(t1.d))-t1.d FROM t1 WHERE NOT (((abs(e)/abs(t1.a* -(coalesce((select max(t1.b-t1.d) from t1 where f>=13),~a+ -a)) | case when not exists(select 1 from t1 where coalesce((select max(c) from t1 where 19-t1.a | e<=17),~( -t1.a)) in (select f from t1 union select t1.d from t1)) then t1.d else (t1.c) end)) in (17,f,t1.a)) or 19=13 or 19=17)} -} {-400} -do_test randexpr-2.1038 { - db eval {SELECT (abs(case when t1.a in (select case when d=(select ~cast(avg(t1.a) AS integer) & ~+min(17*(abs(19)/abs(t1.a))) from t1) or 13 in (select count(distinct t1.b & 11) from t1 union select count(*) & count(distinct c) & count(distinct 17) from t1) and not b<=17 then t1.a when 11=t1.f then (abs(t1.c)/abs(11)) else f end from t1 union select c from t1) then t1.c else a end)/abs(t1.d))-t1.d FROM t1 WHERE NOT (((abs(e)/abs(t1.a* -(coalesce((select max(t1.b-t1.d) from t1 where f>=13),~a+ -a)) | case when not exists(select 1 from t1 where coalesce((select max(c) from t1 where 19-t1.a | e<=17),~( -t1.a)) in (select f from t1 union select t1.d from t1)) then t1.d else (t1.c) end)) in (17,f,t1.a)) or 19=13 or 19=17)} -} {-400} -do_test randexpr-2.1039 { - db eval {SELECT case when f>coalesce((select c from t1 where coalesce((select max(c+c) from t1 where t1.f in (select - -abs(max(19))+(min(a)) from t1 union select count(distinct -t1.d) from t1)),e)>=e),t1.f) | t1.a | 19 or (t1.c) not in (19, - -t1.f,t1.c) or exists(select 1 from t1 where t1.b not between t1.a and -11) then coalesce((select -b from t1 where -t1.a in (select c from t1 union select 17 from t1)),t1.d) when t1.a=c then c else t1.e end FROM t1 WHERE t1.e in (select +cast(avg(f) AS integer) from t1 union select case +max(19) | count(*) when count(*)*+count(*) then ~+count(*) else count(*) end from t1)} -} {} -do_test randexpr-2.1040 { - db eval {SELECT case when f>coalesce((select c from t1 where coalesce((select max(c+c) from t1 where t1.f in (select - -abs(max(19))+(min(a)) from t1 union select count(distinct -t1.d) from t1)),e)>=e),t1.f) | t1.a | 19 or (t1.c) not in (19, - -t1.f,t1.c) or exists(select 1 from t1 where t1.b not between t1.a and -11) then coalesce((select -b from t1 where -t1.a in (select c from t1 union select 17 from t1)),t1.d) when t1.a=c then c else t1.e end FROM t1 WHERE NOT (t1.e in (select +cast(avg(f) AS integer) from t1 union select case +max(19) | count(*) when count(*)*+count(*) then ~+count(*) else count(*) end from t1))} -} {400} -do_test randexpr-2.1041 { - db eval {SELECT case when f>coalesce((select c from t1 where coalesce((select max(c+c) from t1 where t1.f in (select - -abs(max(19))+(min(a)) from t1 union select count(distinct -t1.d) from t1)),e)>=e),t1.f) & t1.a & 19 or (t1.c) not in (19, - -t1.f,t1.c) or exists(select 1 from t1 where t1.b not between t1.a and -11) then coalesce((select -b from t1 where -t1.a in (select c from t1 union select 17 from t1)),t1.d) when t1.a=c then c else t1.e end FROM t1 WHERE NOT (t1.e in (select +cast(avg(f) AS integer) from t1 union select case +max(19) | count(*) when count(*)*+count(*) then ~+count(*) else count(*) end from t1))} -} {400} -do_test randexpr-2.1042 { - db eval {SELECT +case t1.d when d then t1.f else +t1.b+(select -count(distinct coalesce((select max(c) from t1 where exists(select 1 from t1 where 17 not between d and e)),case when t1.f+f-~17<>d then case when exists(select 1 from t1 where t1.d=(13)) then t1.e when c=t1.e then -a else f end when not 17>11 then t1.b else e end))-max(t1.d) from t1)+ -e-(t1.d) end-11-b FROM t1 WHERE e-case +t1.e when e*e then t1.d else case (abs(case when (abs(case when t1.a+11+t1.a>11-t1.e then +t1.f when e<=a then (c) else b end)/abs(13))*b between b and t1.f then -a else t1.c end+d)/abs(a)) when d then 13 else t1.e end end+e+t1.d<=c} -} {} -do_test randexpr-2.1043 { - db eval {SELECT +case t1.d when d then t1.f else +t1.b+(select -count(distinct coalesce((select max(c) from t1 where exists(select 1 from t1 where 17 not between d and e)),case when t1.f+f-~17<>d then case when exists(select 1 from t1 where t1.d=(13)) then t1.e when c=t1.e then -a else f end when not 17>11 then t1.b else e end))-max(t1.d) from t1)+ -e-(t1.d) end-11-b FROM t1 WHERE NOT (e-case +t1.e when e*e then t1.d else case (abs(case when (abs(case when t1.a+11+t1.a>11-t1.e then +t1.f when e<=a then (c) else b end)/abs(13))*b between b and t1.f then -a else t1.c end+d)/abs(a)) when d then 13 else t1.e end end+e+t1.d<=c)} -} {389} -do_test randexpr-2.1044 { - db eval {SELECT + -(select count(*) from t1)*(t1.b)-a-t1.e+17*coalesce((select max(13) from t1 where not exists(select 1 from t1 where case when t1.ft1.d then 17 else -17 end* -(t1.f)=(t1.a))), -d)*t1.f*t1.a* -e FROM t1 WHERE not exists(select 1 from t1 where ~case when d+ -t1.c+11*t1.e-t1.c*a*(t1.b)<=~~t1.b then f else case b when t1.b*t1.c-t1.d then c-b else -t1.c end end-13+f>=case when d not between t1.c and (t1.b) then t1.e else t1.c end) or t1.d in (d,t1.c,t1.c)} -} {-6630000800} -do_test randexpr-2.1045 { - db eval {SELECT + -(select count(*) from t1)*(t1.b)-a-t1.e+17*coalesce((select max(13) from t1 where not exists(select 1 from t1 where case when t1.ft1.d then 17 else -17 end* -(t1.f)=(t1.a))), -d)*t1.f*t1.a* -e FROM t1 WHERE NOT (not exists(select 1 from t1 where ~case when d+ -t1.c+11*t1.e-t1.c*a*(t1.b)<=~~t1.b then f else case b when t1.b*t1.c-t1.d then c-b else -t1.c end end-13+f>=case when d not between t1.c and (t1.b) then t1.e else t1.c end) or t1.d in (d,t1.c,t1.c))} -} {} -do_test randexpr-2.1046 { - db eval {SELECT (abs((select -~~ -count(*)+++count(distinct c) from t1))/abs(coalesce((select e from t1 where (case when case when b not between case t1.d when f then -t1.c else t1.e end and c then d when b=19 then t1.c else d end in (select max(13) from t1 union select count(distinct b) from t1) and t1.d not in (a,t1.b,a) or -t1.d between 13 and e then 17+t1.e when 19 not between t1.f and 17 then t1.b else t1.a end in (17,(t1.e),t1.a))),b) | 17)) FROM t1 WHERE 11>t1.b} -} {} -do_test randexpr-2.1047 { - db eval {SELECT (abs((select -~~ -count(*)+++count(distinct c) from t1))/abs(coalesce((select e from t1 where (case when case when b not between case t1.d when f then -t1.c else t1.e end and c then d when b=19 then t1.c else d end in (select max(13) from t1 union select count(distinct b) from t1) and t1.d not in (a,t1.b,a) or -t1.d between 13 and e then 17+t1.e when 19 not between t1.f and 17 then t1.b else t1.a end in (17,(t1.e),t1.a))),b) | 17)) FROM t1 WHERE NOT (11>t1.b)} -} {0} -do_test randexpr-2.1048 { - db eval {SELECT coalesce((select max(t1.d) from t1 where coalesce((select e from t1 where case when (c)<>11+case f when t1.a then (select abs( -cast(avg(t1.c) AS integer)) | max((17)) | cast(avg(t1.d) AS integer)-count(distinct e) from t1) else 17*(abs(case t1.d when t1.b then a else b end)/abs(b)) end- -c-17+c*t1.c- -t1.d then t1.c else e end>=f),d)<>t1.a), -t1.f) FROM t1 WHERE not a<=17-t1.f} -} {400} -do_test randexpr-2.1049 { - db eval {SELECT coalesce((select max(t1.d) from t1 where coalesce((select e from t1 where case when (c)<>11+case f when t1.a then (select abs( -cast(avg(t1.c) AS integer)) | max((17)) | cast(avg(t1.d) AS integer)-count(distinct e) from t1) else 17*(abs(case t1.d when t1.b then a else b end)/abs(b)) end- -c-17+c*t1.c- -t1.d then t1.c else e end>=f),d)<>t1.a), -t1.f) FROM t1 WHERE NOT (not a<=17-t1.f)} -} {} -do_test randexpr-2.1050 { - db eval {SELECT coalesce((select max(t1.d) from t1 where coalesce((select e from t1 where case when (c)<>11+case f when t1.a then (select abs( -cast(avg(t1.c) AS integer)) & max((17)) & cast(avg(t1.d) AS integer)-count(distinct e) from t1) else 17*(abs(case t1.d when t1.b then a else b end)/abs(b)) end- -c-17+c*t1.c- -t1.d then t1.c else e end>=f),d)<>t1.a), -t1.f) FROM t1 WHERE not a<=17-t1.f} -} {400} -do_test randexpr-2.1051 { - db eval {SELECT coalesce((select coalesce((select ~d from t1 where t1.b-t1.c+13 not between t1.b and (abs(t1.a-case t1.c when t1.c | (select max((abs(case when (select count(*) from t1)<>(~t1.e-13*+d+d) then -t1.e else -t1.f end*13)/abs(f))-t1.f) from t1) then t1.f else t1.c end)/abs(c))),t1.e) from t1 where t1.f=f), - -11) FROM t1 WHERE case ((abs(t1.e)/abs(case b when ~17 then 19+(t1.d)+13 else case t1.a*17 when c then 19*case when c<>coalesce((select max(~a) from t1 where 19<>case case when t1.d in (select +count(distinct 11) from t1 union select ( -max(a)) from t1) then t1.f else b end when t1.f then d else t1.a end-t1.b),11) then t1.b else t1.d end else 11 end end))) when t1.b then 11 else t1.d end*t1.c= -t1.f} -} {} -do_test randexpr-2.1052 { - db eval {SELECT coalesce((select coalesce((select ~d from t1 where t1.b-t1.c+13 not between t1.b and (abs(t1.a-case t1.c when t1.c | (select max((abs(case when (select count(*) from t1)<>(~t1.e-13*+d+d) then -t1.e else -t1.f end*13)/abs(f))-t1.f) from t1) then t1.f else t1.c end)/abs(c))),t1.e) from t1 where t1.f=f), - -11) FROM t1 WHERE NOT (case ((abs(t1.e)/abs(case b when ~17 then 19+(t1.d)+13 else case t1.a*17 when c then 19*case when c<>coalesce((select max(~a) from t1 where 19<>case case when t1.d in (select +count(distinct 11) from t1 union select ( -max(a)) from t1) then t1.f else b end when t1.f then d else t1.a end-t1.b),11) then t1.b else t1.d end else 11 end end))) when t1.b then 11 else t1.d end*t1.c= -t1.f)} -} {-401} -do_test randexpr-2.1053 { - db eval {SELECT coalesce((select coalesce((select ~d from t1 where t1.b-t1.c+13 not between t1.b and (abs(t1.a-case t1.c when t1.c & (select max((abs(case when (select count(*) from t1)<>(~t1.e-13*+d+d) then -t1.e else -t1.f end*13)/abs(f))-t1.f) from t1) then t1.f else t1.c end)/abs(c))),t1.e) from t1 where t1.f=f), - -11) FROM t1 WHERE NOT (case ((abs(t1.e)/abs(case b when ~17 then 19+(t1.d)+13 else case t1.a*17 when c then 19*case when c<>coalesce((select max(~a) from t1 where 19<>case case when t1.d in (select +count(distinct 11) from t1 union select ( -max(a)) from t1) then t1.f else b end when t1.f then d else t1.a end-t1.b),11) then t1.b else t1.d end else 11 end end))) when t1.b then 11 else t1.d end*t1.c= -t1.f)} -} {-401} -do_test randexpr-2.1054 { - db eval {SELECT -13-case when (not d<=11-t1.c*t1.e+t1.b) then case when t1.f | coalesce((select +d from t1 where t1.d= -c),(t1.a)) not between b and t1.a then t1.f+a when t1.a<11 and exists(select 1 from t1 where t1.f in (t1.b,17,11)) then b else 19 end when (t1.b between t1.d and e) then b else -t1.c end FROM t1 WHERE case when b between case when coalesce((select t1.c-t1.c from t1 where 13*(select case min(11) when cast(avg(t1.c) AS integer) then (count(*)) else count(distinct 11) end+cast(avg( -f) AS integer) from t1)>=t1.a),t1.c) in ( -t1.c,d,b) then t1.e when f in (select e from t1 union select t1.d from t1) then f else c end and a and 13<>c and exists(select 1 from t1 where f<>c) then case when c in (11,b, -11) then t1.e else e end else 13 end<=t1.c} -} {-713} -do_test randexpr-2.1055 { - db eval {SELECT -13-case when (not d<=11-t1.c*t1.e+t1.b) then case when t1.f | coalesce((select +d from t1 where t1.d= -c),(t1.a)) not between b and t1.a then t1.f+a when t1.a<11 and exists(select 1 from t1 where t1.f in (t1.b,17,11)) then b else 19 end when (t1.b between t1.d and e) then b else -t1.c end FROM t1 WHERE NOT (case when b between case when coalesce((select t1.c-t1.c from t1 where 13*(select case min(11) when cast(avg(t1.c) AS integer) then (count(*)) else count(distinct 11) end+cast(avg( -f) AS integer) from t1)>=t1.a),t1.c) in ( -t1.c,d,b) then t1.e when f in (select e from t1 union select t1.d from t1) then f else c end and a and 13<>c and exists(select 1 from t1 where f<>c) then case when c in (11,b, -11) then t1.e else e end else 13 end<=t1.c)} -} {} -do_test randexpr-2.1056 { - db eval {SELECT -13-case when (not d<=11-t1.c*t1.e+t1.b) then case when t1.f & coalesce((select +d from t1 where t1.d= -c),(t1.a)) not between b and t1.a then t1.f+a when t1.a<11 and exists(select 1 from t1 where t1.f in (t1.b,17,11)) then b else 19 end when (t1.b between t1.d and e) then b else -t1.c end FROM t1 WHERE case when b between case when coalesce((select t1.c-t1.c from t1 where 13*(select case min(11) when cast(avg(t1.c) AS integer) then (count(*)) else count(distinct 11) end+cast(avg( -f) AS integer) from t1)>=t1.a),t1.c) in ( -t1.c,d,b) then t1.e when f in (select e from t1 union select t1.d from t1) then f else c end and a and 13<>c and exists(select 1 from t1 where f<>c) then case when c in (11,b, -11) then t1.e else e end else 13 end<=t1.c} -} {-713} -do_test randexpr-2.1057 { - db eval {SELECT t1.b | (abs( -(select ~ -~abs(case ~min((c* -b+c))+min(f) when ~abs(count(distinct 13))+(min(13)) then max(11) else count(*) end) from t1)-11 | +(abs(t1.d-t1.e)/abs(t1.b))-t1.f*19+t1.c*17)/abs(f))+t1.b FROM t1 WHERE (a between t1.e and -13)} -} {} -do_test randexpr-2.1058 { - db eval {SELECT t1.b | (abs( -(select ~ -~abs(case ~min((c* -b+c))+min(f) when ~abs(count(distinct 13))+(min(13)) then max(11) else count(*) end) from t1)-11 | +(abs(t1.d-t1.e)/abs(t1.b))-t1.f*19+t1.c*17)/abs(f))+t1.b FROM t1 WHERE NOT ((a between t1.e and -13))} -} {200} -do_test randexpr-2.1059 { - db eval {SELECT t1.b & (abs( -(select ~ -~abs(case ~min((c* -b+c))+min(f) when ~abs(count(distinct 13))+(min(13)) then max(11) else count(*) end) from t1)-11 & +(abs(t1.d-t1.e)/abs(t1.b))-t1.f*19+t1.c*17)/abs(f))+t1.b FROM t1 WHERE NOT ((a between t1.e and -13))} -} {192} -do_test randexpr-2.1060 { - db eval {SELECT t1.c-case t1.b when t1.f-t1.b-f then +coalesce((select b from t1 where (t1.d in (select (select count(*)+abs(count(*)) | ~cast(avg(b | case when 11 between b and (f) then b when (19)>19 then 17 else t1.e end) AS integer) | min(d) from t1) from t1 union select 19 from t1))),(abs(c*c)/abs(11))-a-t1.c+t1.f-t1.c)+b else b end FROM t1 WHERE (t1.d)+t1.b<( -t1.b)} -} {} -do_test randexpr-2.1061 { - db eval {SELECT t1.c-case t1.b when t1.f-t1.b-f then +coalesce((select b from t1 where (t1.d in (select (select count(*)+abs(count(*)) | ~cast(avg(b | case when 11 between b and (f) then b when (19)>19 then 17 else t1.e end) AS integer) | min(d) from t1) from t1 union select 19 from t1))),(abs(c*c)/abs(11))-a-t1.c+t1.f-t1.c)+b else b end FROM t1 WHERE NOT ((t1.d)+t1.b<( -t1.b))} -} {100} -do_test randexpr-2.1062 { - db eval {SELECT t1.c-case t1.b when t1.f-t1.b-f then +coalesce((select b from t1 where (t1.d in (select (select count(*)+abs(count(*)) & ~cast(avg(b & case when 11 between b and (f) then b when (19)>19 then 17 else t1.e end) AS integer) & min(d) from t1) from t1 union select 19 from t1))),(abs(c*c)/abs(11))-a-t1.c+t1.f-t1.c)+b else b end FROM t1 WHERE NOT ((t1.d)+t1.b<( -t1.b))} -} {100} -do_test randexpr-2.1063 { - db eval {SELECT 17*(select (case case min(t1.d+( -d | case 11* -11*11 when 13 then t1.c else -17 end)-d*t1.d)-count(*)-abs( -max(17)+~max(t1.b)) | +abs(cast(avg((a)) AS integer))+(count(*)) when -max(17) then -max(19) else (cast(avg(d) AS integer)) end when count(distinct t1.c) then min(b) else count(*) end) from t1) FROM t1 WHERE d>=(abs(coalesce((select max(d) from t1 where not not case when a in (select count(*)* -case +min(case when t1.e=(abs(coalesce((select max(d) from t1 where not not case when a in (select count(*)* -case +min(case when t1.e=(abs(coalesce((select max(d) from t1 where not not case when a in (select count(*)* -case +min(case when t1.ef),t1.f) and 11 not between 13 and 13 and ( -11<>c and t1.b>c) or 19<>t1.e and t1.b<=t1.f then +f*b when t1.d>=e then -13 else t1.c end when b then (17) else t1.d end+a+f*a FROM t1 WHERE not exists(select 1 from t1 where a between t1.f and 17 or e>=(d)*19+t1.e*c)} -} {59707} -do_test randexpr-2.1067 { - db eval {SELECT 11 | ~case case when e between 17 and coalesce((select max(((f-t1.f))) from t1 where d<>f),t1.f) and 11 not between 13 and 13 and ( -11<>c and t1.b>c) or 19<>t1.e and t1.b<=t1.f then +f*b when t1.d>=e then -13 else t1.c end when b then (17) else t1.d end+a+f*a FROM t1 WHERE NOT (not exists(select 1 from t1 where a between t1.f and 17 or e>=(d)*19+t1.e*c))} -} {} -do_test randexpr-2.1068 { - db eval {SELECT 11 & ~case case when e between 17 and coalesce((select max(((f-t1.f))) from t1 where d<>f),t1.f) and 11 not between 13 and 13 and ( -11<>c and t1.b>c) or 19<>t1.e and t1.b<=t1.f then +f*b when t1.d>=e then -13 else t1.c end when b then (17) else t1.d end+a+f*a FROM t1 WHERE not exists(select 1 from t1 where a between t1.f and 17 or e>=(d)*19+t1.e*c)} -} {3} -do_test randexpr-2.1069 { - db eval {SELECT -case when t1.d | ~b<>coalesce((select max(t1.c) from t1 where t1.c not between coalesce((select max(coalesce((select max(e) from t1 where 11 not in (case when 13 not between d and c then 17 when (t1.a) not in (e,b,b) then 19 else c end,a,t1.d)),b)+f) from t1 where t1.d not in (11,f,t1.e)),t1.b) and f),11) or 11<>(d) then -f* -d else (e) end*f FROM t1 WHERE case f when 11 then coalesce((select b from t1 where 19+case when 17*t1.d-t1.f+t1.f between t1.d-case when +d=coalesce((select max(f) from t1 where e>t1.f),17) and c=t1.e and b not in (17,11,(t1.f)) then -17 else t1.c end and c then -t1.a else t1.d end+11*e not between t1.f and d),13)+t1.d else -13 end=c} -} {} -do_test randexpr-2.1070 { - db eval {SELECT -case when t1.d | ~b<>coalesce((select max(t1.c) from t1 where t1.c not between coalesce((select max(coalesce((select max(e) from t1 where 11 not in (case when 13 not between d and c then 17 when (t1.a) not in (e,b,b) then 19 else c end,a,t1.d)),b)+f) from t1 where t1.d not in (11,f,t1.e)),t1.b) and f),11) or 11<>(d) then -f* -d else (e) end*f FROM t1 WHERE NOT (case f when 11 then coalesce((select b from t1 where 19+case when 17*t1.d-t1.f+t1.f between t1.d-case when +d=coalesce((select max(f) from t1 where e>t1.f),17) and c=t1.e and b not in (17,11,(t1.f)) then -17 else t1.c end and c then -t1.a else t1.d end+11*e not between t1.f and d),13)+t1.d else -13 end=c)} -} {-144000000} -do_test randexpr-2.1071 { - db eval {SELECT -case when t1.d & ~b<>coalesce((select max(t1.c) from t1 where t1.c not between coalesce((select max(coalesce((select max(e) from t1 where 11 not in (case when 13 not between d and c then 17 when (t1.a) not in (e,b,b) then 19 else c end,a,t1.d)),b)+f) from t1 where t1.d not in (11,f,t1.e)),t1.b) and f),11) or 11<>(d) then -f* -d else (e) end*f FROM t1 WHERE NOT (case f when 11 then coalesce((select b from t1 where 19+case when 17*t1.d-t1.f+t1.f between t1.d-case when +d=coalesce((select max(f) from t1 where e>t1.f),17) and c=t1.e and b not in (17,11,(t1.f)) then -17 else t1.c end and c then -t1.a else t1.d end+11*e not between t1.f and d),13)+t1.d else -13 end=c)} -} {-144000000} -do_test randexpr-2.1072 { - db eval {SELECT coalesce((select t1.b from t1 where not (t1.c>19) and 11<=+(abs(t1.b-19)/abs(a))+case when ((coalesce((select 13 from t1 where c in (b,t1.b,t1.d)),e))<>13) or f in ((t1.b),t1.e, -b) then 11+(c) else b end or b<>d),t1.f+t1.f+13) | - -a FROM t1 WHERE 13 between t1.c and 13+~19+c+(select min(f-(abs(17)/abs((t1.e)))) from t1)} -} {} -do_test randexpr-2.1073 { - db eval {SELECT coalesce((select t1.b from t1 where not (t1.c>19) and 11<=+(abs(t1.b-19)/abs(a))+case when ((coalesce((select 13 from t1 where c in (b,t1.b,t1.d)),e))<>13) or f in ((t1.b),t1.e, -b) then 11+(c) else b end or b<>d),t1.f+t1.f+13) | - -a FROM t1 WHERE NOT (13 between t1.c and 13+~19+c+(select min(f-(abs(17)/abs((t1.e)))) from t1))} -} {236} -do_test randexpr-2.1074 { - db eval {SELECT coalesce((select t1.b from t1 where not (t1.c>19) and 11<=+(abs(t1.b-19)/abs(a))+case when ((coalesce((select 13 from t1 where c in (b,t1.b,t1.d)),e))<>13) or f in ((t1.b),t1.e, -b) then 11+(c) else b end or b<>d),t1.f+t1.f+13) & - -a FROM t1 WHERE NOT (13 between t1.c and 13+~19+c+(select min(f-(abs(17)/abs((t1.e)))) from t1))} -} {64} -do_test randexpr-2.1075 { - db eval {SELECT -(coalesce((select max(coalesce((select t1.f from t1 where not exists(select 1 from t1 where (abs(+b+19+19)/abs(t1.b))=(select -max(19) from t1)+t1.f),t1.e+t1.f)* -t1.e+19-f) from t1 where (( -t1.c<19) or d>=c)),t1.c))*c*((t1.b))-17 FROM t1 WHERE t1.e not between t1.f*c and t1.f+ -d} -} {18034859983} -do_test randexpr-2.1076 { - db eval {SELECT -(coalesce((select max(coalesce((select t1.f from t1 where not exists(select 1 from t1 where (abs(+b+19+19)/abs(t1.b))=(select -max(19) from t1)+t1.f),t1.e+t1.f)* -t1.e+19-f) from t1 where (( -t1.c<19) or d>=c)),t1.c))*c*((t1.b))-17 FROM t1 WHERE NOT (t1.e not between t1.f*c and t1.f+ -d)} -} {} -do_test randexpr-2.1077 { - db eval {SELECT case 17 when (t1.d)*coalesce((select (select case (cast(avg(c) AS integer)+max(case when (not d+ -t1.e not between 11 and -f) then f when b<(11) then t1.b else 11 end))+count(distinct t1.c)*max(b) when -min(e) | -count(distinct t1.c) then cast(avg(e) AS integer) else count(*) end from t1) from t1 where case c when a then a else t1.d end-11<>19),t1.a)+t1.b then f else t1.f end FROM t1 WHERE not exists(select 1 from t1 where exists(select 1 from t1 where (abs(d)/abs((f*+coalesce((select -~case when exists(select 1 from t1 where bt1.c or ((t1.c))<>e),(t1.e)))) from t1)*17 when e then a else t1.e end-t1.b-19 from t1 where t1.e in (select abs(+min(f)+cast(avg( -a) AS integer)) from t1 union select count(distinct c) from t1)),d))))<>f))} -} {} -do_test randexpr-2.1078 { - db eval {SELECT case 17 when (t1.d)*coalesce((select (select case (cast(avg(c) AS integer)+max(case when (not d+ -t1.e not between 11 and -f) then f when b<(11) then t1.b else 11 end))+count(distinct t1.c)*max(b) when -min(e) | -count(distinct t1.c) then cast(avg(e) AS integer) else count(*) end from t1) from t1 where case c when a then a else t1.d end-11<>19),t1.a)+t1.b then f else t1.f end FROM t1 WHERE NOT (not exists(select 1 from t1 where exists(select 1 from t1 where (abs(d)/abs((f*+coalesce((select -~case when exists(select 1 from t1 where bt1.c or ((t1.c))<>e),(t1.e)))) from t1)*17 when e then a else t1.e end-t1.b-19 from t1 where t1.e in (select abs(+min(f)+cast(avg( -a) AS integer)) from t1 union select count(distinct c) from t1)),d))))<>f)))} -} {600} -do_test randexpr-2.1079 { - db eval {SELECT case 17 when (t1.d)*coalesce((select (select case (cast(avg(c) AS integer)+max(case when (not d+ -t1.e not between 11 and -f) then f when b<(11) then t1.b else 11 end))+count(distinct t1.c)*max(b) when -min(e) & -count(distinct t1.c) then cast(avg(e) AS integer) else count(*) end from t1) from t1 where case c when a then a else t1.d end-11<>19),t1.a)+t1.b then f else t1.f end FROM t1 WHERE NOT (not exists(select 1 from t1 where exists(select 1 from t1 where (abs(d)/abs((f*+coalesce((select -~case when exists(select 1 from t1 where bt1.c or ((t1.c))<>e),(t1.e)))) from t1)*17 when e then a else t1.e end-t1.b-19 from t1 where t1.e in (select abs(+min(f)+cast(avg( -a) AS integer)) from t1 union select count(distinct c) from t1)),d))))<>f)))} -} {600} -do_test randexpr-2.1080 { - db eval {SELECT ((select -case min(17 | (abs(a)/abs(case (select max(a) from t1)+13+t1.c when c then (abs(case when 17<>a and t1.c=d then ((17)) else e end)/abs(t1.b)) else 17 end)) | f*a) when abs(~(count(distinct t1.e))-abs((~max(c)))-count(*) | min(t1.f)+max(11)) then -cast(avg((b)) AS integer) else min(b) end from t1))*a FROM t1 WHERE (13)-(t1.a*17-t1.b)-coalesce((select (select -cast(avg(t1.c) AS integer)+case - -count(*) | (count(distinct t1.a)) when -min(t1.e) then (max(t1.d)) else count(distinct t1.b) end from t1)-e+(abs(17)/abs(e)) from t1 where not exists(select 1 from t1 where not exists(select 1 from t1 where (d)>=13 and (t1.b not in (c,a, -t1.d) or t1.e in (select c from t1 union select t1.c from t1)) or 11<=t1.d))),17) in (select e from t1 union select e from t1)} -} {} -do_test randexpr-2.1081 { - db eval {SELECT ((select -case min(17 | (abs(a)/abs(case (select max(a) from t1)+13+t1.c when c then (abs(case when 17<>a and t1.c=d then ((17)) else e end)/abs(t1.b)) else 17 end)) | f*a) when abs(~(count(distinct t1.e))-abs((~max(c)))-count(*) | min(t1.f)+max(11)) then -cast(avg((b)) AS integer) else min(b) end from t1))*a FROM t1 WHERE NOT ((13)-(t1.a*17-t1.b)-coalesce((select (select -cast(avg(t1.c) AS integer)+case - -count(*) | (count(distinct t1.a)) when -min(t1.e) then (max(t1.d)) else count(distinct t1.b) end from t1)-e+(abs(17)/abs(e)) from t1 where not exists(select 1 from t1 where not exists(select 1 from t1 where (d)>=13 and (t1.b not in (c,a, -t1.d) or t1.e in (select c from t1 union select t1.c from t1)) or 11<=t1.d))),17) in (select e from t1 union select e from t1))} -} {-20000} -do_test randexpr-2.1082 { - db eval {SELECT ((select -case min(17 & (abs(a)/abs(case (select max(a) from t1)+13+t1.c when c then (abs(case when 17<>a and t1.c=d then ((17)) else e end)/abs(t1.b)) else 17 end)) & f*a) when abs(~(count(distinct t1.e))-abs((~max(c)))-count(*) & min(t1.f)+max(11)) then -cast(avg((b)) AS integer) else min(b) end from t1))*a FROM t1 WHERE NOT ((13)-(t1.a*17-t1.b)-coalesce((select (select -cast(avg(t1.c) AS integer)+case - -count(*) | (count(distinct t1.a)) when -min(t1.e) then (max(t1.d)) else count(distinct t1.b) end from t1)-e+(abs(17)/abs(e)) from t1 where not exists(select 1 from t1 where not exists(select 1 from t1 where (d)>=13 and (t1.b not in (c,a, -t1.d) or t1.e in (select c from t1 union select t1.c from t1)) or 11<=t1.d))),17) in (select e from t1 union select e from t1))} -} {-20000} -do_test randexpr-2.1083 { - db eval {SELECT case when (select -min(11) from t1)<>(abs(17)/abs(t1.d | e)) then case 11+case 11 when b | e-e then 19+e else b end*(abs(t1.a)/abs(b | a)) | coalesce((select case when a in (select cast(avg(d) AS integer) from t1 union select - - -max(c) from t1) or e not in (c,d,a) then +13 when t1.a>a then 19 else f end from t1 where t1.c=13 or f<>t1.e),a) when f then f else c end else t1.e end FROM t1 WHERE ~17 in (11,t1.c,19)} -} {} -do_test randexpr-2.1084 { - db eval {SELECT case when (select -min(11) from t1)<>(abs(17)/abs(t1.d | e)) then case 11+case 11 when b | e-e then 19+e else b end*(abs(t1.a)/abs(b | a)) | coalesce((select case when a in (select cast(avg(d) AS integer) from t1 union select - - -max(c) from t1) or e not in (c,d,a) then +13 when t1.a>a then 19 else f end from t1 where t1.c=13 or f<>t1.e),a) when f then f else c end else t1.e end FROM t1 WHERE NOT (~17 in (11,t1.c,19))} -} {300} -do_test randexpr-2.1085 { - db eval {SELECT case when (select -min(11) from t1)<>(abs(17)/abs(t1.d & e)) then case 11+case 11 when b & e-e then 19+e else b end*(abs(t1.a)/abs(b & a)) & coalesce((select case when a in (select cast(avg(d) AS integer) from t1 union select - - -max(c) from t1) or e not in (c,d,a) then +13 when t1.a>a then 19 else f end from t1 where t1.c=13 or f<>t1.e),a) when f then f else c end else t1.e end FROM t1 WHERE NOT (~17 in (11,t1.c,19))} -} {300} -do_test randexpr-2.1086 { - db eval {SELECT (select case +cast(avg(+19) AS integer) when (abs(count(*))) then (cast(avg(e*t1.b) AS integer)) else cast(avg(t1.a) AS integer) end+count(*) | +max(f-t1.e*t1.e | (f)* -19+ -b*d) | count(*)*count(*)* -count(*) | ~count(distinct -b)*cast(avg(t1.f) AS integer)+count(*) from t1)-t1.c+t1.b FROM t1 WHERE ((select -count(*)+min(case ~coalesce((select max(d) from t1 where (not not exists(select 1 from t1 where t1.b not in ((select -max(a)+(count(*)) from t1) | c+case when t1.e not in (13,e,c) then (t1.f) else t1.c end+17*c+19,c,e)))),t1.f) when (f) then t1.a else t1.f end | b | t1.a) from t1) in (c,t1.c+ -a,f))} -} {} -do_test randexpr-2.1087 { - db eval {SELECT (select case +cast(avg(+19) AS integer) when (abs(count(*))) then (cast(avg(e*t1.b) AS integer)) else cast(avg(t1.a) AS integer) end+count(*) | +max(f-t1.e*t1.e | (f)* -19+ -b*d) | count(*)*count(*)* -count(*) | ~count(distinct -b)*cast(avg(t1.f) AS integer)+count(*) from t1)-t1.c+t1.b FROM t1 WHERE NOT (((select -count(*)+min(case ~coalesce((select max(d) from t1 where (not not exists(select 1 from t1 where t1.b not in ((select -max(a)+(count(*)) from t1) | c+case when t1.e not in (13,e,c) then (t1.f) else t1.c end+17*c+19,c,e)))),t1.f) when (f) then t1.a else t1.f end | b | t1.a) from t1) in (c,t1.c+ -a,f)))} -} {-101} -do_test randexpr-2.1088 { - db eval {SELECT (select case +cast(avg(+19) AS integer) when (abs(count(*))) then (cast(avg(e*t1.b) AS integer)) else cast(avg(t1.a) AS integer) end+count(*) & +max(f-t1.e*t1.e & (f)* -19+ -b*d) & count(*)*count(*)* -count(*) & ~count(distinct -b)*cast(avg(t1.f) AS integer)+count(*) from t1)-t1.c+t1.b FROM t1 WHERE NOT (((select -count(*)+min(case ~coalesce((select max(d) from t1 where (not not exists(select 1 from t1 where t1.b not in ((select -max(a)+(count(*)) from t1) | c+case when t1.e not in (13,e,c) then (t1.f) else t1.c end+17*c+19,c,e)))),t1.f) when (f) then t1.a else t1.f end | b | t1.a) from t1) in (c,t1.c+ -a,f)))} -} {-36} -do_test randexpr-2.1089 { - db eval {SELECT (coalesce((select (select -~+ -abs(case cast(avg(a*t1.d) AS integer) when case ~case count(distinct ((abs(t1.a)/abs(d)))) when case cast(avg(17) AS integer)-count(*) when -count(*) then count(distinct d) else (max(t1.d)) end*count(*) then count(distinct t1.c) else min(19) end-count(*) when cast(avg(t1.a) AS integer) then ((count(*))) else min(a) end then (count(*)) else max(e) end)*(count(*))*max(a) from t1) from t1 where (19>=(17))),d)) FROM t1 WHERE exists(select 1 from t1 where 19 in (t1.a*coalesce((select a from t1 where (11t1.b),t1.e)) from t1 where e not between 13 and t1.c),(a))-t1.d and 13),13*b)-17, -b,17))} -} {} -do_test randexpr-2.1090 { - db eval {SELECT (coalesce((select (select -~+ -abs(case cast(avg(a*t1.d) AS integer) when case ~case count(distinct ((abs(t1.a)/abs(d)))) when case cast(avg(17) AS integer)-count(*) when -count(*) then count(distinct d) else (max(t1.d)) end*count(*) then count(distinct t1.c) else min(19) end-count(*) when cast(avg(t1.a) AS integer) then ((count(*))) else min(a) end then (count(*)) else max(e) end)*(count(*))*max(a) from t1) from t1 where (19>=(17))),d)) FROM t1 WHERE NOT (exists(select 1 from t1 where 19 in (t1.a*coalesce((select a from t1 where (11t1.b),t1.e)) from t1 where e not between 13 and t1.c),(a))-t1.d and 13),13*b)-17, -b,17)))} -} {-49900} -do_test randexpr-2.1091 { - db eval {SELECT case when (coalesce((select max((select +max(c) from t1)) from t1 where t1.c<>t1.a),d) not in (t1.d,+case when 17>19 then e when t1.b<>+(select count(*) from t1) then t1.e else t1.d end,t1.c)) then (select count(*)-count(distinct t1.d)+ -max( -t1.c-a)*case cast(avg((f)) AS integer) when count(distinct d) then max((13)) else max(t1.d) end from t1)*t1.b else t1.c end | -13*t1.d*t1.c FROM t1 WHERE c in (select case count(distinct ~(abs( -a)/abs(d))) when ~count(*) then ~min(coalesce((select max((abs(e)/abs(d))) from t1 where not exists(select 1 from t1 where t1.e>( -+t1.a-t1.e*17))),19))+count(*) else case ~ -cast(avg((11)) AS integer) | +cast(avg(d) AS integer) | (cast(avg(c) AS integer))+min(t1.e) when min(t1.c) then max(11) else -count(*) end end+max(t1.c) from t1 union select -count(*) from t1)} -} {} -do_test randexpr-2.1092 { - db eval {SELECT case when (coalesce((select max((select +max(c) from t1)) from t1 where t1.c<>t1.a),d) not in (t1.d,+case when 17>19 then e when t1.b<>+(select count(*) from t1) then t1.e else t1.d end,t1.c)) then (select count(*)-count(distinct t1.d)+ -max( -t1.c-a)*case cast(avg((f)) AS integer) when count(distinct d) then max((13)) else max(t1.d) end from t1)*t1.b else t1.c end | -13*t1.d*t1.c FROM t1 WHERE NOT (c in (select case count(distinct ~(abs( -a)/abs(d))) when ~count(*) then ~min(coalesce((select max((abs(e)/abs(d))) from t1 where not exists(select 1 from t1 where t1.e>( -+t1.a-t1.e*17))),19))+count(*) else case ~ -cast(avg((11)) AS integer) | +cast(avg(d) AS integer) | (cast(avg(c) AS integer))+min(t1.e) when min(t1.c) then max(11) else -count(*) end end+max(t1.c) from t1 union select -count(*) from t1))} -} {-1559700} -do_test randexpr-2.1093 { - db eval {SELECT case when (coalesce((select max((select +max(c) from t1)) from t1 where t1.c<>t1.a),d) not in (t1.d,+case when 17>19 then e when t1.b<>+(select count(*) from t1) then t1.e else t1.d end,t1.c)) then (select count(*)-count(distinct t1.d)+ -max( -t1.c-a)*case cast(avg((f)) AS integer) when count(distinct d) then max((13)) else max(t1.d) end from t1)*t1.b else t1.c end & -13*t1.d*t1.c FROM t1 WHERE NOT (c in (select case count(distinct ~(abs( -a)/abs(d))) when ~count(*) then ~min(coalesce((select max((abs(e)/abs(d))) from t1 where not exists(select 1 from t1 where t1.e>( -+t1.a-t1.e*17))),19))+count(*) else case ~ -cast(avg((11)) AS integer) | +cast(avg(d) AS integer) | (cast(avg(c) AS integer))+min(t1.e) when min(t1.c) then max(11) else -count(*) end end+max(t1.c) from t1 union select -count(*) from t1))} -} {0} -do_test randexpr-2.1094 { - db eval {SELECT coalesce((select max(t1.c+t1.b-t1.b+(abs(d++t1.f)/abs(t1.a)) | 13*17) from t1 where coalesce((select 11 from t1 where case case case c when d then t1.d else 13 end when b then -11 else t1.b end when 13 then (t1.a) else d end not in (c,13,a)),t1.c) | f not in (t1.a,t1.c,13) and not exists(select 1 from t1 where t1.c in (select e from t1 union select -11 from t1))),t1.f) FROM t1 WHERE (((13+coalesce((select max(13) from t1 where not exists(select 1 from t1 where ((abs(c-case when not exists(select 1 from t1 where ((f) between c and 13)) then (select case min(f) when max(17) then min(13) else min(b) end from t1) when 17 in (t1.e,13,f) then -13 else 11 end)/abs(t1.f)) in (select min(c) from t1 union select -count(*) | + -min(19) from t1))) and f<13),t1.e+t1.c) in (select count(distinct c)-count(*) from t1 union select -case min((e))+cast(avg(t1.a) AS integer) when ((min(t1.c))) then count(distinct e) else -cast(avg(t1.d) AS integer) end from t1))))} -} {} -do_test randexpr-2.1095 { - db eval {SELECT coalesce((select max(t1.c+t1.b-t1.b+(abs(d++t1.f)/abs(t1.a)) | 13*17) from t1 where coalesce((select 11 from t1 where case case case c when d then t1.d else 13 end when b then -11 else t1.b end when 13 then (t1.a) else d end not in (c,13,a)),t1.c) | f not in (t1.a,t1.c,13) and not exists(select 1 from t1 where t1.c in (select e from t1 union select -11 from t1))),t1.f) FROM t1 WHERE NOT ((((13+coalesce((select max(13) from t1 where not exists(select 1 from t1 where ((abs(c-case when not exists(select 1 from t1 where ((f) between c and 13)) then (select case min(f) when max(17) then min(13) else min(b) end from t1) when 17 in (t1.e,13,f) then -13 else 11 end)/abs(t1.f)) in (select min(c) from t1 union select -count(*) | + -min(19) from t1))) and f<13),t1.e+t1.c) in (select count(distinct c)-count(*) from t1 union select -case min((e))+cast(avg(t1.a) AS integer) when ((min(t1.c))) then count(distinct e) else -cast(avg(t1.d) AS integer) end from t1)))))} -} {511} -do_test randexpr-2.1096 { - db eval {SELECT coalesce((select max(t1.c+t1.b-t1.b+(abs(d++t1.f)/abs(t1.a)) & 13*17) from t1 where coalesce((select 11 from t1 where case case case c when d then t1.d else 13 end when b then -11 else t1.b end when 13 then (t1.a) else d end not in (c,13,a)),t1.c) & f not in (t1.a,t1.c,13) and not exists(select 1 from t1 where t1.c in (select e from t1 union select -11 from t1))),t1.f) FROM t1 WHERE NOT ((((13+coalesce((select max(13) from t1 where not exists(select 1 from t1 where ((abs(c-case when not exists(select 1 from t1 where ((f) between c and 13)) then (select case min(f) when max(17) then min(13) else min(b) end from t1) when 17 in (t1.e,13,f) then -13 else 11 end)/abs(t1.f)) in (select min(c) from t1 union select -count(*) | + -min(19) from t1))) and f<13),t1.e+t1.c) in (select count(distinct c)-count(*) from t1 union select -case min((e))+cast(avg(t1.a) AS integer) when ((min(t1.c))) then count(distinct e) else -cast(avg(t1.d) AS integer) end from t1)))))} -} {20} -do_test randexpr-2.1097 { - db eval {SELECT case when t1.a in (select t1.e*case when t1.b between t1.d and 11 or c-case when (t1.e=13) then ~e when e<>a then t1.d else t1.f end in (11,t1.e,t1.c) and 11 not between t1.a and 13 and 19<11 then 11 else t1.e end*t1.d from t1 union select t1.c from t1) then a when e between e and b then ((19)) else 11 end FROM t1 WHERE coalesce((select (select count(distinct t1.f) from t1) from t1 where case coalesce((select max(t1.d) from t1 where 17<>19),t1.d) when a then coalesce((select ~t1.f- - -c-c*17-f-c-t1.a from t1 where (t1.f) in (select max(11) from t1 union select ~cast(avg(17) AS integer) | ~count(*)+max(f)- -cast(avg(11) AS integer) from t1)),13) else e end in (a,t1.c,11)),c)>=t1.e} -} {} -do_test randexpr-2.1098 { - db eval {SELECT case when t1.a in (select t1.e*case when t1.b between t1.d and 11 or c-case when (t1.e=13) then ~e when e<>a then t1.d else t1.f end in (11,t1.e,t1.c) and 11 not between t1.a and 13 and 19<11 then 11 else t1.e end*t1.d from t1 union select t1.c from t1) then a when e between e and b then ((19)) else 11 end FROM t1 WHERE NOT (coalesce((select (select count(distinct t1.f) from t1) from t1 where case coalesce((select max(t1.d) from t1 where 17<>19),t1.d) when a then coalesce((select ~t1.f- - -c-c*17-f-c-t1.a from t1 where (t1.f) in (select max(11) from t1 union select ~cast(avg(17) AS integer) | ~count(*)+max(f)- -cast(avg(11) AS integer) from t1)),13) else e end in (a,t1.c,11)),c)>=t1.e)} -} {11} -do_test randexpr-2.1099 { - db eval {SELECT coalesce((select max(case t1.b+(select ~((cast(avg(17) AS integer)))*min(a)+ -count(distinct b)*cast(avg(t1.b) AS integer)-count(*)+max(19) from t1)-(e) when d then 13 else 13*c end+t1.c) from t1 where t1.b in (select +cast(avg(e) AS integer)*case count(*) when cast(avg(13) AS integer) then count(distinct t1.b) else count(*) end-(count(distinct 19))*min(t1.d) from t1 union select max(a) from t1)),(f))*e+t1.f*19 FROM t1 WHERE 17 not between -t1.e and d} -} {} -do_test randexpr-2.1100 { - db eval {SELECT coalesce((select max(case t1.b+(select ~((cast(avg(17) AS integer)))*min(a)+ -count(distinct b)*cast(avg(t1.b) AS integer)-count(*)+max(19) from t1)-(e) when d then 13 else 13*c end+t1.c) from t1 where t1.b in (select +cast(avg(e) AS integer)*case count(*) when cast(avg(13) AS integer) then count(distinct t1.b) else count(*) end-(count(distinct 19))*min(t1.d) from t1 union select max(a) from t1)),(f))*e+t1.f*19 FROM t1 WHERE NOT (17 not between -t1.e and d)} -} {311400} -do_test randexpr-2.1101 { - db eval {SELECT coalesce((select max(~19) from t1 where 11 in (select t1.b-11*coalesce((select max(b) from t1 where coalesce((select max(e) from t1 where c*case 19*19+coalesce((select 19 from t1 where (11 not in (13+t1.d,b,(11)))),13)*d when t1.e then t1.b else t1.b end+t1.e between d and t1.b),t1.b) | (f)<>13), - -17)+c from t1 union select -19 from t1)),17) FROM t1 WHERE ~t1.d not between 11*13-+t1.d-11-f and t1.d} -} {} -do_test randexpr-2.1102 { - db eval {SELECT coalesce((select max(~19) from t1 where 11 in (select t1.b-11*coalesce((select max(b) from t1 where coalesce((select max(e) from t1 where c*case 19*19+coalesce((select 19 from t1 where (11 not in (13+t1.d,b,(11)))),13)*d when t1.e then t1.b else t1.b end+t1.e between d and t1.b),t1.b) | (f)<>13), - -17)+c from t1 union select -19 from t1)),17) FROM t1 WHERE NOT (~t1.d not between 11*13-+t1.d-11-f and t1.d)} -} {17} -do_test randexpr-2.1103 { - db eval {SELECT coalesce((select max(~19) from t1 where 11 in (select t1.b-11*coalesce((select max(b) from t1 where coalesce((select max(e) from t1 where c*case 19*19+coalesce((select 19 from t1 where (11 not in (13+t1.d,b,(11)))),13)*d when t1.e then t1.b else t1.b end+t1.e between d and t1.b),t1.b) & (f)<>13), - -17)+c from t1 union select -19 from t1)),17) FROM t1 WHERE NOT (~t1.d not between 11*13-+t1.d-11-f and t1.d)} -} {17} -do_test randexpr-2.1104 { - db eval {SELECT case t1.b when coalesce((select max(17+coalesce((select max(coalesce((select (select count(distinct case f when 19 then coalesce((select coalesce((select max(11-(abs(d)/abs(11))) from t1 where not -a in (19,t1.b,17)),17) from t1 where (f in (b,f,t1.a))),b) else b end) from t1) from t1 where 17 between e and t1.f),t1.a)) from t1 where 13>=e),b)) from t1 where t1.f>t1.f),t1.b) then 17 else t1.f end FROM t1 WHERE not exists(select 1 from t1 where 13 between a+17 and (t1.c))} -} {17} -do_test randexpr-2.1105 { - db eval {SELECT case t1.b when coalesce((select max(17+coalesce((select max(coalesce((select (select count(distinct case f when 19 then coalesce((select coalesce((select max(11-(abs(d)/abs(11))) from t1 where not -a in (19,t1.b,17)),17) from t1 where (f in (b,f,t1.a))),b) else b end) from t1) from t1 where 17 between e and t1.f),t1.a)) from t1 where 13>=e),b)) from t1 where t1.f>t1.f),t1.b) then 17 else t1.f end FROM t1 WHERE NOT (not exists(select 1 from t1 where 13 between a+17 and (t1.c)))} -} {} -do_test randexpr-2.1106 { - db eval {SELECT case when coalesce((select max(d) from t1 where t1.a in (select a-a from t1 union select a from t1)),t1.b)*(select max(t1.b) from t1)>=case when t1.b=t1.a} -} {300} -do_test randexpr-2.1107 { - db eval {SELECT case when coalesce((select max(d) from t1 where t1.a in (select a-a from t1 union select a from t1)),t1.b)*(select max(t1.b) from t1)>=case when t1.b=t1.a)} -} {} -do_test randexpr-2.1108 { - db eval {SELECT case when case when f*~case when t1.c*t1.f in (c,t1.b,(17)) then 17 when 11>t1.c then 13 else t1.e end+t1.f in (select +max(e)+case (count(distinct a)*count(*))+max(19) when -max(11) then count(distinct a) else ((count(distinct t1.d))) end from t1 union select count(distinct c) from t1) then 17 else d end+(t1.c)<17 then b when not exists(select 1 from t1 where 11>t1.b) then t1.d else t1.a end FROM t1 WHERE t1.b< -f} -} {} -do_test randexpr-2.1109 { - db eval {SELECT case when case when f*~case when t1.c*t1.f in (c,t1.b,(17)) then 17 when 11>t1.c then 13 else t1.e end+t1.f in (select +max(e)+case (count(distinct a)*count(*))+max(19) when -max(11) then count(distinct a) else ((count(distinct t1.d))) end from t1 union select count(distinct c) from t1) then 17 else d end+(t1.c)<17 then b when not exists(select 1 from t1 where 11>t1.b) then t1.d else t1.a end FROM t1 WHERE NOT (t1.b< -f)} -} {400} -do_test randexpr-2.1110 { - db eval {SELECT (select cast(avg(f) AS integer) | ~++cast(avg((abs(17)/abs( -f+(c-coalesce((select case when c=d and t1.e=t1.b then e when e in (t1.b,19,t1.c) then 17 else d end from t1 where e between t1.a and t1.c),a))+a))) AS integer)-abs( -min(t1.c))-abs(max((t1.b)) | -~(count(*))+max(17))+cast(avg(t1.a) AS integer) | min(a)*(count(*))*min(17) from t1) FROM t1 WHERE b-(t1.e*t1.e)-t1.d=t1.c} -} {} -do_test randexpr-2.1111 { - db eval {SELECT (select cast(avg(f) AS integer) | ~++cast(avg((abs(17)/abs( -f+(c-coalesce((select case when c=d and t1.e=t1.b then e when e in (t1.b,19,t1.c) then 17 else d end from t1 where e between t1.a and t1.c),a))+a))) AS integer)-abs( -min(t1.c))-abs(max((t1.b)) | -~(count(*))+max(17))+cast(avg(t1.a) AS integer) | min(a)*(count(*))*min(17) from t1) FROM t1 WHERE NOT (b-(t1.e*t1.e)-t1.d=t1.c)} -} {-260} -do_test randexpr-2.1112 { - db eval {SELECT (select cast(avg(f) AS integer) & ~++cast(avg((abs(17)/abs( -f+(c-coalesce((select case when c=d and t1.e=t1.b then e when e in (t1.b,19,t1.c) then 17 else d end from t1 where e between t1.a and t1.c),a))+a))) AS integer)-abs( -min(t1.c))-abs(max((t1.b)) & -~(count(*))+max(17))+cast(avg(t1.a) AS integer) & min(a)*(count(*))*min(17) from t1) FROM t1 WHERE NOT (b-(t1.e*t1.e)-t1.d=t1.c)} -} {512} -do_test randexpr-2.1113 { - db eval {SELECT ~+coalesce((select case when t1.f>d then b when (abs(t1.a)/abs((abs(f)/abs(t1.c))))*case ~b when e then (select cast(avg( -+t1.f) AS integer) from t1) else c end+coalesce((select max(17*case t1.a+b when t1.b then t1.d else t1.f end) from t1 where d=e),t1.f)+13>=17 then 19 else f end from t1 where t1.a in (select d from t1 union select e from t1)),b) FROM t1 WHERE 17<>f-~t1.a-case when -b in (t1.b,(select min( -coalesce((select max(coalesce((select a- -t1.b from t1 where 11 in (t1.b,13, -t1.e) and f not between -13 and t1.b),c)) from t1 where b not in (a,11,17)),t1.e)) from t1),e) or not exists(select 1 from t1 where t1.c in (select t1.b from t1 union select t1.b from t1)) then coalesce((select -t1.e from t1 where e<>t1.e),f) when not t1.e<>t1.c then 19 else e end} -} {-201} -do_test randexpr-2.1114 { - db eval {SELECT ~+coalesce((select case when t1.f>d then b when (abs(t1.a)/abs((abs(f)/abs(t1.c))))*case ~b when e then (select cast(avg( -+t1.f) AS integer) from t1) else c end+coalesce((select max(17*case t1.a+b when t1.b then t1.d else t1.f end) from t1 where d=e),t1.f)+13>=17 then 19 else f end from t1 where t1.a in (select d from t1 union select e from t1)),b) FROM t1 WHERE NOT (17<>f-~t1.a-case when -b in (t1.b,(select min( -coalesce((select max(coalesce((select a- -t1.b from t1 where 11 in (t1.b,13, -t1.e) and f not between -13 and t1.b),c)) from t1 where b not in (a,11,17)),t1.e)) from t1),e) or not exists(select 1 from t1 where t1.c in (select t1.b from t1 union select t1.b from t1)) then coalesce((select -t1.e from t1 where e<>t1.e),f) when not t1.e<>t1.c then 19 else e end)} -} {} -do_test randexpr-2.1115 { - db eval {SELECT d- -e*(abs(t1.c)/abs(d)) | t1.a+ -coalesce((select max(t1.e) from t1 where case when case when (a in (13,b,t1.b)) and d in (t1.c,17,a) then 17+t1.e when 19>=t1.b then a else 11 end=t1.f and d between c and (d) then (abs(17)/abs(d)) else t1.d end*f>e and not f<=13 and -t1.f>=t1.e and t1.be then t1.b else c end FROM t1 WHERE b-coalesce((select (coalesce((select max((coalesce((select d from t1 where not -case when case 13 when +~(select case count(*) when -max(t1.b) then max(a) else min(c) end from t1) then c else -a end in (17,t1.b,(b)) then f else b end-f+17<=t1.a),t1.f)-d)) from t1 where t1.e=b),t1.b)) from t1 where (t1.a=t1.c)), -t1.a) not between 19 and 19} -} {-584} -do_test randexpr-2.1116 { - db eval {SELECT d- -e*(abs(t1.c)/abs(d)) | t1.a+ -coalesce((select max(t1.e) from t1 where case when case when (a in (13,b,t1.b)) and d in (t1.c,17,a) then 17+t1.e when 19>=t1.b then a else 11 end=t1.f and d between c and (d) then (abs(17)/abs(d)) else t1.d end*f>e and not f<=13 and -t1.f>=t1.e and t1.be then t1.b else c end FROM t1 WHERE NOT (b-coalesce((select (coalesce((select max((coalesce((select d from t1 where not -case when case 13 when +~(select case count(*) when -max(t1.b) then max(a) else min(c) end from t1) then c else -a end in (17,t1.b,(b)) then f else b end-f+17<=t1.a),t1.f)-d)) from t1 where t1.e=b),t1.b)) from t1 where (t1.a=t1.c)), -t1.a) not between 19 and 19)} -} {} -do_test randexpr-2.1117 { - db eval {SELECT d- -e*(abs(t1.c)/abs(d)) & t1.a+ -coalesce((select max(t1.e) from t1 where case when case when (a in (13,b,t1.b)) and d in (t1.c,17,a) then 17+t1.e when 19>=t1.b then a else 11 end=t1.f and d between c and (d) then (abs(17)/abs(d)) else t1.d end*f>e and not f<=13 and -t1.f>=t1.e and t1.be then t1.b else c end FROM t1 WHERE b-coalesce((select (coalesce((select max((coalesce((select d from t1 where not -case when case 13 when +~(select case count(*) when -max(t1.b) then max(a) else min(c) end from t1) then c else -a end in (17,t1.b,(b)) then f else b end-f+17<=t1.a),t1.f)-d)) from t1 where t1.e=b),t1.b)) from t1 where (t1.a=t1.c)), -t1.a) not between 19 and 19} -} {384} -do_test randexpr-2.1118 { - db eval {SELECT 19-case 13-f when b then t1.a*11-t1.d-+17*t1.b-coalesce((select 17 from t1 where 13<=f),+coalesce((select (abs(17+~coalesce((select a from t1 where 11<>t1.b and 11 not between t1.e and 19),17)+t1.e+t1.d | b)/abs(c))+f from t1 where 19 not between 19 and c),d)) else 19 end*t1.e+b FROM t1 WHERE 11+11 not in (t1.c,t1.e,19) and f+19*19*case when ~t1.a+19*b between t1.a-case case when f=(t1.d) then ((t1.d)) else -d end*e when c then e else t1.a end*t1.e and c then t1.e else b end in (select d from t1 union select t1.a from t1) or t1.d>=t1.f or not exists(select 1 from t1 where a<=13)} -} {-9281} -do_test randexpr-2.1119 { - db eval {SELECT 19-case 13-f when b then t1.a*11-t1.d-+17*t1.b-coalesce((select 17 from t1 where 13<=f),+coalesce((select (abs(17+~coalesce((select a from t1 where 11<>t1.b and 11 not between t1.e and 19),17)+t1.e+t1.d | b)/abs(c))+f from t1 where 19 not between 19 and c),d)) else 19 end*t1.e+b FROM t1 WHERE NOT (11+11 not in (t1.c,t1.e,19) and f+19*19*case when ~t1.a+19*b between t1.a-case case when f=(t1.d) then ((t1.d)) else -d end*e when c then e else t1.a end*t1.e and c then t1.e else b end in (select d from t1 union select t1.a from t1) or t1.d>=t1.f or not exists(select 1 from t1 where a<=13))} -} {} -do_test randexpr-2.1120 { - db eval {SELECT 19-case 13-f when b then t1.a*11-t1.d-+17*t1.b-coalesce((select 17 from t1 where 13<=f),+coalesce((select (abs(17+~coalesce((select a from t1 where 11<>t1.b and 11 not between t1.e and 19),17)+t1.e+t1.d & b)/abs(c))+f from t1 where 19 not between 19 and c),d)) else 19 end*t1.e+b FROM t1 WHERE 11+11 not in (t1.c,t1.e,19) and f+19*19*case when ~t1.a+19*b between t1.a-case case when f=(t1.d) then ((t1.d)) else -d end*e when c then e else t1.a end*t1.e and c then t1.e else b end in (select d from t1 union select t1.a from t1) or t1.d>=t1.f or not exists(select 1 from t1 where a<=13)} -} {-9281} -do_test randexpr-2.1121 { - db eval {SELECT case 19 when e then t1.b-t1.d else 11+coalesce((select 19 from t1 where not (t1.a)+(abs(case coalesce((select coalesce((select t1.e from t1 where 11=d),a) from t1 where t1.d<=13),a) when 17 then 13 else t1.a end)/abs(t1.b))-t1.d*e+t1.d not between b and b or e in (select -min(c) from t1 union select min(t1.b) from t1)),(abs(e)/abs(t1.b)))+t1.c end FROM t1 WHERE exists(select 1 from t1 where c in (select t1.a from t1 union select f from t1))} -} {} -do_test randexpr-2.1122 { - db eval {SELECT case 19 when e then t1.b-t1.d else 11+coalesce((select 19 from t1 where not (t1.a)+(abs(case coalesce((select coalesce((select t1.e from t1 where 11=d),a) from t1 where t1.d<=13),a) when 17 then 13 else t1.a end)/abs(t1.b))-t1.d*e+t1.d not between b and b or e in (select -min(c) from t1 union select min(t1.b) from t1)),(abs(e)/abs(t1.b)))+t1.c end FROM t1 WHERE NOT (exists(select 1 from t1 where c in (select t1.a from t1 union select f from t1)))} -} {313} -do_test randexpr-2.1123 { - db eval {SELECT 17 | t1.d-(select +max(case when not exists(select 1 from t1 where (a<=t1.f)) then -19 else -t1.d end)- -min(t1.f+t1.f-(select (count(*)) from t1)) from t1)- -19 | b-d+coalesce((select max(d) from t1 where e-t1.a in (19,b,11) or e in (19,t1.b,c)),11) FROM t1 WHERE (11<=11 and case coalesce((select max((f)) from t1 where t1.b | case 11 when t1.e*t1.e then e else case when ~b-case when 19 not in (t1.d,13,e) then 13 when c between t1.e and b then 19 else t1.c end-(c) in (select -t1.f from t1 union select d from t1) then c else t1.b end end*t1.a in (19,e,c)),t1.a) when t1.d then t1.a else -a end not in (t1.c,b,t1.f))} -} {-41} -do_test randexpr-2.1124 { - db eval {SELECT 17 | t1.d-(select +max(case when not exists(select 1 from t1 where (a<=t1.f)) then -19 else -t1.d end)- -min(t1.f+t1.f-(select (count(*)) from t1)) from t1)- -19 | b-d+coalesce((select max(d) from t1 where e-t1.a in (19,b,11) or e in (19,t1.b,c)),11) FROM t1 WHERE NOT ((11<=11 and case coalesce((select max((f)) from t1 where t1.b | case 11 when t1.e*t1.e then e else case when ~b-case when 19 not in (t1.d,13,e) then 13 when c between t1.e and b then 19 else t1.c end-(c) in (select -t1.f from t1 union select d from t1) then c else t1.b end end*t1.a in (19,e,c)),t1.a) when t1.d then t1.a else -a end not in (t1.c,b,t1.f)))} -} {} -do_test randexpr-2.1125 { - db eval {SELECT 17 & t1.d-(select +max(case when not exists(select 1 from t1 where (a<=t1.f)) then -19 else -t1.d end)- -min(t1.f+t1.f-(select (count(*)) from t1)) from t1)- -19 & b-d+coalesce((select max(d) from t1 where e-t1.a in (19,b,11) or e in (19,t1.b,c)),11) FROM t1 WHERE (11<=11 and case coalesce((select max((f)) from t1 where t1.b | case 11 when t1.e*t1.e then e else case when ~b-case when 19 not in (t1.d,13,e) then 13 when c between t1.e and b then 19 else t1.c end-(c) in (select -t1.f from t1 union select d from t1) then c else t1.b end end*t1.a in (19,e,c)),t1.a) when t1.d then t1.a else -a end not in (t1.c,b,t1.f))} -} {0} -do_test randexpr-2.1126 { - db eval {SELECT case t1.e-d+b when coalesce((select (select max(t1.a | a | -(select (count(*))+( - - -count(*)) from t1)*19+ -f+t1.e) from t1) from t1 where not exists(select 1 from t1 where (d not between a and 11) or not d>=11 and exists(select 1 from t1 where not t1.a<>13)) or 19 not in (17,t1.c,t1.c)),19)*t1.c+d then b else c end-b FROM t1 WHERE c<17} -} {} -do_test randexpr-2.1127 { - db eval {SELECT case t1.e-d+b when coalesce((select (select max(t1.a | a | -(select (count(*))+( - - -count(*)) from t1)*19+ -f+t1.e) from t1) from t1 where not exists(select 1 from t1 where (d not between a and 11) or not d>=11 and exists(select 1 from t1 where not t1.a<>13)) or 19 not in (17,t1.c,t1.c)),19)*t1.c+d then b else c end-b FROM t1 WHERE NOT (c<17)} -} {100} -do_test randexpr-2.1128 { - db eval {SELECT case t1.e-d+b when coalesce((select (select max(t1.a & a & -(select (count(*))+( - - -count(*)) from t1)*19+ -f+t1.e) from t1) from t1 where not exists(select 1 from t1 where (d not between a and 11) or not d>=11 and exists(select 1 from t1 where not t1.a<>13)) or 19 not in (17,t1.c,t1.c)),19)*t1.c+d then b else c end-b FROM t1 WHERE NOT (c<17)} -} {100} -do_test randexpr-2.1129 { - db eval {SELECT f*f*(abs(case when (17-coalesce((select max(11) from t1 where coalesce((select max(t1.c-11*t1.a) from t1 where +e=(abs(d)/abs(11))+ -13),t1.b)t1.e) then e else 17 end)/abs(c)) FROM t1 WHERE (t1.a in ((t1.f-t1.c)+b,11,t1.a+f))} -} {} -do_test randexpr-2.1130 { - db eval {SELECT f*f*(abs(case when (17-coalesce((select max(11) from t1 where coalesce((select max(t1.c-11*t1.a) from t1 where +e=(abs(d)/abs(11))+ -13),t1.b)t1.e) then e else 17 end)/abs(c)) FROM t1 WHERE NOT ((t1.a in ((t1.f-t1.c)+b,11,t1.a+f)))} -} {0} -do_test randexpr-2.1131 { - db eval {SELECT f*f*(abs(case when (17-coalesce((select max(11) from t1 where coalesce((select max(t1.c-11*t1.a) from t1 where +e=(abs(d)/abs(11))+ -13),t1.b)t1.e) then e else 17 end)/abs(c)) FROM t1 WHERE NOT ((t1.a in ((t1.f-t1.c)+b,11,t1.a+f)))} -} {0} -do_test randexpr-2.1132 { - db eval {SELECT ( -19-f+coalesce((select max( -~case when case 11 when ~coalesce((select max(13) from t1 where not (e)<>(t1.c)),19)+11 | -19-f then -13 else t1.c end-e<=t1.a then 11 when not exists(select 1 from t1 where (not t1.c<19) and not (13<>17)) then -e else f end) from t1 where (b)<=t1.e),t1.d)+ -t1.c) | b FROM t1 WHERE (~(select (max(f)-count(distinct c)) from t1) | case when e>=t1.c then t1.b+(select abs(count(*)+max(c)*abs(count(distinct e)+max(t1.f))+cast(avg(c) AS integer)) | cast(avg(t1.d) AS integer)*min(11) from t1)-t1.c else c end in (select case -t1.b when 17 then 17 else -case when not t1.c not in (17,t1.d,17) then 19 else a end end from t1 union select a from t1)) or (11)<=t1.b} -} {-771} -do_test randexpr-2.1133 { - db eval {SELECT ( -19-f+coalesce((select max( -~case when case 11 when ~coalesce((select max(13) from t1 where not (e)<>(t1.c)),19)+11 | -19-f then -13 else t1.c end-e<=t1.a then 11 when not exists(select 1 from t1 where (not t1.c<19) and not (13<>17)) then -e else f end) from t1 where (b)<=t1.e),t1.d)+ -t1.c) | b FROM t1 WHERE NOT ((~(select (max(f)-count(distinct c)) from t1) | case when e>=t1.c then t1.b+(select abs(count(*)+max(c)*abs(count(distinct e)+max(t1.f))+cast(avg(c) AS integer)) | cast(avg(t1.d) AS integer)*min(11) from t1)-t1.c else c end in (select case -t1.b when 17 then 17 else -case when not t1.c not in (17,t1.d,17) then 19 else a end end from t1 union select a from t1)) or (11)<=t1.b)} -} {} -do_test randexpr-2.1134 { - db eval {SELECT ( -19-f+coalesce((select max( -~case when case 11 when ~coalesce((select max(13) from t1 where not (e)<>(t1.c)),19)+11 & -19-f then -13 else t1.c end-e<=t1.a then 11 when not exists(select 1 from t1 where (not t1.c<19) and not (13<>17)) then -e else f end) from t1 where (b)<=t1.e),t1.d)+ -t1.c) & b FROM t1 WHERE (~(select (max(f)-count(distinct c)) from t1) | case when e>=t1.c then t1.b+(select abs(count(*)+max(c)*abs(count(distinct e)+max(t1.f))+cast(avg(c) AS integer)) | cast(avg(t1.d) AS integer)*min(11) from t1)-t1.c else c end in (select case -t1.b when 17 then 17 else -case when not t1.c not in (17,t1.d,17) then 19 else a end end from t1 union select a from t1)) or (11)<=t1.b} -} {64} -do_test randexpr-2.1135 { - db eval {SELECT +case when (not exists(select 1 from t1 where (abs(t1.a+coalesce((select max(b+ -case when e=t1.f then (abs(d)/abs(t1.e)) when not exists(select 1 from t1 where 17t1.c) then e else e end FROM t1 WHERE not t1.d-d+case b when t1.a+t1.a then t1.f+ -t1.e else 11+b*coalesce((select max(t1.f) from t1 where 11>= -f+t1.d),t1.c)*19 end not between d and t1.c-(11)+17} -} {} -do_test randexpr-2.1136 { - db eval {SELECT +case when (not exists(select 1 from t1 where (abs(t1.a+coalesce((select max(b+ -case when e=t1.f then (abs(d)/abs(t1.e)) when not exists(select 1 from t1 where 17t1.c) then e else e end FROM t1 WHERE NOT (not t1.d-d+case b when t1.a+t1.a then t1.f+ -t1.e else 11+b*coalesce((select max(t1.f) from t1 where 11>= -f+t1.d),t1.c)*19 end not between d and t1.c-(11)+17)} -} {500} -do_test randexpr-2.1137 { - db eval {SELECT +case when (not exists(select 1 from t1 where (abs(t1.a+coalesce((select max(b+ -case when e=t1.f then (abs(d)/abs(t1.e)) when not exists(select 1 from t1 where 17t1.c) then e else e end FROM t1 WHERE NOT (not t1.d-d+case b when t1.a+t1.a then t1.f+ -t1.e else 11+b*coalesce((select max(t1.f) from t1 where 11>= -f+t1.d),t1.c)*19 end not between d and t1.c-(11)+17)} -} {500} -do_test randexpr-2.1138 { - db eval {SELECT t1.d+case when (t1.a)<=11 then ~t1.a else ~19 end-+~ -coalesce((select t1.d from t1 where ~t1.f in (select (cast(avg(t1.e+c) AS integer)) from t1 union select count(distinct (abs(coalesce((select max(19) from t1 where not ~11-t1.a=t1.c+case when t1.d between c and t1.d then 11 when t1.f>=17 then f else 19 end*t1.c),17)+f)/abs(f))) from t1)),11) FROM t1 WHERE e>c} -} {370} -do_test randexpr-2.1139 { - db eval {SELECT t1.d+case when (t1.a)<=11 then ~t1.a else ~19 end-+~ -coalesce((select t1.d from t1 where ~t1.f in (select (cast(avg(t1.e+c) AS integer)) from t1 union select count(distinct (abs(coalesce((select max(19) from t1 where not ~11-t1.a=t1.c+case when t1.d between c and t1.d then 11 when t1.f>=17 then f else 19 end*t1.c),17)+f)/abs(f))) from t1)),11) FROM t1 WHERE NOT (e>c)} -} {} -do_test randexpr-2.1140 { - db eval {SELECT case when coalesce((select max(case b | d*(abs(t1.e)/abs(a))-f | t1.b when t1.e then coalesce((select max(t1.e) from t1 where t1.e between (select ~count(*)*cast(avg(19) AS integer) from t1) and case c when a then 13 else a end),t1.f)+e*c else t1.d end) from t1 where t1.a in (select t1.d from t1 union select 17 from t1)),e)+17<19 then t1.a else 19 end | 11+e-17*19 FROM t1 WHERE d*t1.c-case when case when ((13 in (17+e,b,11)) or 19>(13)) then (abs(coalesce((select t1.a from t1 where t1.a not in (13,c,t1.f)),11))/abs(t1.e))-f when t1.b not between t1.b and f then t1.d else t1.a end in (a,e,t1.d) then t1.f else t1.f end+f+t1.e in (t1.d,e,b)} -} {} -do_test randexpr-2.1141 { - db eval {SELECT case when coalesce((select max(case b | d*(abs(t1.e)/abs(a))-f | t1.b when t1.e then coalesce((select max(t1.e) from t1 where t1.e between (select ~count(*)*cast(avg(19) AS integer) from t1) and case c when a then 13 else a end),t1.f)+e*c else t1.d end) from t1 where t1.a in (select t1.d from t1 union select 17 from t1)),e)+17<19 then t1.a else 19 end | 11+e-17*19 FROM t1 WHERE NOT (d*t1.c-case when case when ((13 in (17+e,b,11)) or 19>(13)) then (abs(coalesce((select t1.a from t1 where t1.a not in (13,c,t1.f)),11))/abs(t1.e))-f when t1.b not between t1.b and f then t1.d else t1.a end in (a,e,t1.d) then t1.f else t1.f end+f+t1.e in (t1.d,e,b))} -} {191} -do_test randexpr-2.1142 { - db eval {SELECT case when coalesce((select max(case b & d*(abs(t1.e)/abs(a))-f & t1.b when t1.e then coalesce((select max(t1.e) from t1 where t1.e between (select ~count(*)*cast(avg(19) AS integer) from t1) and case c when a then 13 else a end),t1.f)+e*c else t1.d end) from t1 where t1.a in (select t1.d from t1 union select 17 from t1)),e)+17<19 then t1.a else 19 end & 11+e-17*19 FROM t1 WHERE NOT (d*t1.c-case when case when ((13 in (17+e,b,11)) or 19>(13)) then (abs(coalesce((select t1.a from t1 where t1.a not in (13,c,t1.f)),11))/abs(t1.e))-f when t1.b not between t1.b and f then t1.d else t1.a end in (a,e,t1.d) then t1.f else t1.f end+f+t1.e in (t1.d,e,b))} -} {16} -do_test randexpr-2.1143 { - db eval {SELECT ((select (count(*) | +~(case ++(min(t1.f+17+(11-case when b between d and d and t1.a not in (13,c,t1.c) and e< -t1.b then 17+(11) else t1.e end+ -b))) when case min(e) when min( -13) | ~max(t1.f) then count(distinct t1.f) | ~count(distinct t1.d) else count(*) end then min(t1.c) else -cast(avg(11) AS integer) end)+count(distinct (f))) from t1)+e) FROM t1 WHERE (a in (11*a-t1.a | t1.b+e*13,(f | a | (select min((select min(13)-min(17)*((count(distinct t1.d))) from t1)) from t1)+t1.a- -11)+(11),t1.c) and (a) between t1.d and t1.f or t1.d not between t1.c and f or d not in (t1.c,t1.f,c))} -} {511} -do_test randexpr-2.1144 { - db eval {SELECT ((select (count(*) | +~(case ++(min(t1.f+17+(11-case when b between d and d and t1.a not in (13,c,t1.c) and e< -t1.b then 17+(11) else t1.e end+ -b))) when case min(e) when min( -13) | ~max(t1.f) then count(distinct t1.f) | ~count(distinct t1.d) else count(*) end then min(t1.c) else -cast(avg(11) AS integer) end)+count(distinct (f))) from t1)+e) FROM t1 WHERE NOT ((a in (11*a-t1.a | t1.b+e*13,(f | a | (select min((select min(13)-min(17)*((count(distinct t1.d))) from t1)) from t1)+t1.a- -11)+(11),t1.c) and (a) between t1.d and t1.f or t1.d not between t1.c and f or d not in (t1.c,t1.f,c)))} -} {} -do_test randexpr-2.1145 { - db eval {SELECT ((select (count(*) & +~(case ++(min(t1.f+17+(11-case when b between d and d and t1.a not in (13,c,t1.c) and e< -t1.b then 17+(11) else t1.e end+ -b))) when case min(e) when min( -13) & ~max(t1.f) then count(distinct t1.f) & ~count(distinct t1.d) else count(*) end then min(t1.c) else -cast(avg(11) AS integer) end)+count(distinct (f))) from t1)+e) FROM t1 WHERE (a in (11*a-t1.a | t1.b+e*13,(f | a | (select min((select min(13)-min(17)*((count(distinct t1.d))) from t1)) from t1)+t1.a- -11)+(11),t1.c) and (a) between t1.d and t1.f or t1.d not between t1.c and f or d not in (t1.c,t1.f,c))} -} {501} -do_test randexpr-2.1146 { - db eval {SELECT coalesce((select max(13) from t1 where d in (select (max(19)*count(distinct case when t1.f between ~e and -b-t1.f then b else d end)-count(distinct f)) from t1 union select cast(avg(case e when case t1.b when -a | t1.e*19 then t1.a else -t1.c end then -d else t1.e end) AS integer) from t1)),case when t1.d in (select t1.e from t1 union select b from t1) then t1.f when t1.f between 13 and f then f else f end) FROM t1 WHERE c in (select (t1.a) from t1 union select e from t1)} -} {} -do_test randexpr-2.1147 { - db eval {SELECT coalesce((select max(13) from t1 where d in (select (max(19)*count(distinct case when t1.f between ~e and -b-t1.f then b else d end)-count(distinct f)) from t1 union select cast(avg(case e when case t1.b when -a | t1.e*19 then t1.a else -t1.c end then -d else t1.e end) AS integer) from t1)),case when t1.d in (select t1.e from t1 union select b from t1) then t1.f when t1.f between 13 and f then f else f end) FROM t1 WHERE NOT (c in (select (t1.a) from t1 union select e from t1))} -} {600} -do_test randexpr-2.1148 { - db eval {SELECT coalesce((select max(13) from t1 where d in (select (max(19)*count(distinct case when t1.f between ~e and -b-t1.f then b else d end)-count(distinct f)) from t1 union select cast(avg(case e when case t1.b when -a & t1.e*19 then t1.a else -t1.c end then -d else t1.e end) AS integer) from t1)),case when t1.d in (select t1.e from t1 union select b from t1) then t1.f when t1.f between 13 and f then f else f end) FROM t1 WHERE NOT (c in (select (t1.a) from t1 union select e from t1))} -} {600} -do_test randexpr-2.1149 { - db eval {SELECT (abs(t1.d+b)/abs(~t1.f+case when t1.f=t1.c or exists(select 1 from t1 where c>=+~t1.c*17) or exists(select 1 from t1 where (select -cast(avg(case when 19<>t1.f then -c when c<>b then t1.e else t1.d end) AS integer) from t1) in (d-t1.f,b,19)) then d+b when 11(19) then c else -case when 11>b or t1.c<=c then f when t1.f>t1.a then t1.a else t1.e end*d-11 end+d*t1.b>t1.e),d)>t1.b and c<>d and not exists(select 1 from t1 where 17>=(t1.f)) and t1.e not in (f,t1.b,t1.b))} -} {} -do_test randexpr-2.1150 { - db eval {SELECT (abs(t1.d+b)/abs(~t1.f+case when t1.f=t1.c or exists(select 1 from t1 where c>=+~t1.c*17) or exists(select 1 from t1 where (select -cast(avg(case when 19<>t1.f then -c when c<>b then t1.e else t1.d end) AS integer) from t1) in (d-t1.f,b,19)) then d+b when 11(19) then c else -case when 11>b or t1.c<=c then f when t1.f>t1.a then t1.a else t1.e end*d-11 end+d*t1.b>t1.e),d)>t1.b and c<>d and not exists(select 1 from t1 where 17>=(t1.f)) and t1.e not in (f,t1.b,t1.b)))} -} {0} -do_test randexpr-2.1151 { - db eval {SELECT t1.b-~case when +a in (select ~min(11) from t1 union select -count(*)+count(distinct ~coalesce((select coalesce((select t1.b-19+c from t1 where a<>13 or 13 in (t1.b,d,t1.e)),11) from t1 where 19 in (19,e,17)),e)) from t1) then (select -min(19)+cast(avg(t1.d) AS integer) from t1) else d end | 17 | t1.e FROM t1 WHERE c-b+e*11+(c+13+11)+(13)+(select cast(avg((abs(e-d+a)/abs(t1.f))) AS integer) from t1)-t1.d+~13<=t1.e-c-17} -} {} -do_test randexpr-2.1152 { - db eval {SELECT t1.b-~case when +a in (select ~min(11) from t1 union select -count(*)+count(distinct ~coalesce((select coalesce((select t1.b-19+c from t1 where a<>13 or 13 in (t1.b,d,t1.e)),11) from t1 where 19 in (19,e,17)),e)) from t1) then (select -min(19)+cast(avg(t1.d) AS integer) from t1) else d end | 17 | t1.e FROM t1 WHERE NOT (c-b+e*11+(c+13+11)+(13)+(select cast(avg((abs(e-d+a)/abs(t1.f))) AS integer) from t1)-t1.d+~13<=t1.e-c-17)} -} {1021} -do_test randexpr-2.1153 { - db eval {SELECT t1.b-~case when +a in (select ~min(11) from t1 union select -count(*)+count(distinct ~coalesce((select coalesce((select t1.b-19+c from t1 where a<>13 or 13 in (t1.b,d,t1.e)),11) from t1 where 19 in (19,e,17)),e)) from t1) then (select -min(19)+cast(avg(t1.d) AS integer) from t1) else d end & 17 & t1.e FROM t1 WHERE NOT (c-b+e*11+(c+13+11)+(13)+(select cast(avg((abs(e-d+a)/abs(t1.f))) AS integer) from t1)-t1.d+~13<=t1.e-c-17)} -} {16} -do_test randexpr-2.1154 { - db eval {SELECT coalesce((select max(b) from t1 where t1.et1.e then 17 when 19 not between 11 and b then t1.e else 19 end*t1.c),t1.c) FROM t1 WHERE not t1.f*(abs(case when ~19-17*e>=t1.d then t1.b when (select cast(avg(t1.e) AS integer) from t1) in ((abs(t1.e)/abs(t1.e))-case when f not in (t1.d,13,c) then c else t1.e end-t1.b-t1.a | b-(t1.c), -a,e) then t1.e else e end+a)/abs(t1.d)) | b not between b and t1.d} -} {} -do_test randexpr-2.1155 { - db eval {SELECT coalesce((select max(b) from t1 where t1.et1.e then 17 when 19 not between 11 and b then t1.e else 19 end*t1.c),t1.c) FROM t1 WHERE NOT (not t1.f*(abs(case when ~19-17*e>=t1.d then t1.b when (select cast(avg(t1.e) AS integer) from t1) in ((abs(t1.e)/abs(t1.e))-case when f not in (t1.d,13,c) then c else t1.e end-t1.b-t1.a | b-(t1.c), -a,e) then t1.e else e end+a)/abs(t1.d)) | b not between b and t1.d)} -} {300} -do_test randexpr-2.1156 { - db eval {SELECT -f+( - -case when 13-b not between case when (a<>t1.f or case when not exists(select 1 from t1 where 11<>t1.a) then b when c<=t1.b then t1.f else 11 end in (select 17 from t1 union select t1.b from t1)) then b-c-b when t1.f=13 then a else 19 end | t1.d and t1.e and not exists(select 1 from t1 where 19=t1.f) then -c else 19 end+17) FROM t1 WHERE not not exists(select 1 from t1 where ~(select cast(avg(t1.d) AS integer) from t1) | +~~case case when f-case when exists(select 1 from t1 where 13 not in (d,11,case when not exists(select 1 from t1 where f between t1.d and e) then 13 when t1.e<>19 then f else 11 end) or b in ( -d,t1.c,17)) then b else f end-(t1.d) in (t1.c,t1.c,b) then t1.b else e end when 11 then t1.e else -c end-c<>t1.b)} -} {-883} -do_test randexpr-2.1157 { - db eval {SELECT -f+( - -case when 13-b not between case when (a<>t1.f or case when not exists(select 1 from t1 where 11<>t1.a) then b when c<=t1.b then t1.f else 11 end in (select 17 from t1 union select t1.b from t1)) then b-c-b when t1.f=13 then a else 19 end | t1.d and t1.e and not exists(select 1 from t1 where 19=t1.f) then -c else 19 end+17) FROM t1 WHERE NOT (not not exists(select 1 from t1 where ~(select cast(avg(t1.d) AS integer) from t1) | +~~case case when f-case when exists(select 1 from t1 where 13 not in (d,11,case when not exists(select 1 from t1 where f between t1.d and e) then 13 when t1.e<>19 then f else 11 end) or b in ( -d,t1.c,17)) then b else f end-(t1.d) in (t1.c,t1.c,b) then t1.b else e end when 11 then t1.e else -c end-c<>t1.b))} -} {} -do_test randexpr-2.1158 { - db eval {SELECT -f+( - -case when 13-b not between case when (a<>t1.f or case when not exists(select 1 from t1 where 11<>t1.a) then b when c<=t1.b then t1.f else 11 end in (select 17 from t1 union select t1.b from t1)) then b-c-b when t1.f=13 then a else 19 end & t1.d and t1.e and not exists(select 1 from t1 where 19=t1.f) then -c else 19 end+17) FROM t1 WHERE not not exists(select 1 from t1 where ~(select cast(avg(t1.d) AS integer) from t1) | +~~case case when f-case when exists(select 1 from t1 where 13 not in (d,11,case when not exists(select 1 from t1 where f between t1.d and e) then 13 when t1.e<>19 then f else 11 end) or b in ( -d,t1.c,17)) then b else f end-(t1.d) in (t1.c,t1.c,b) then t1.b else e end when 11 then t1.e else -c end-c<>t1.b)} -} {-883} -do_test randexpr-2.1159 { - db eval {SELECT +(abs(d+d+a+b+t1.d)/abs(coalesce((select (select abs(cast(avg(17-11+e*t1.d) AS integer)++cast(avg(coalesce((select max(11-+t1.f- -e-a* -19+t1.a) from t1 where -a in (select 11 from t1 union select -11 from t1)),e)) AS integer)) from t1) from t1 where f=17),t1.b)*a)) FROM t1 WHERE t1.b in (select t1.e from t1 union select coalesce((select max(11) from t1 where dt1.e then t1.a+e-a when 19>t1.c then c else t1.c end+c not between b and t1.d),t1.f) and -(t1.b) between t1.e and -t1.d or b<>19 then (select ~(min(13))+max(f) from t1) else (t1.b) end*t1.b FROM t1 WHERE b in (b,e,case coalesce((select max(t1.b) from t1 where e>13 or ( -(select case -~count(distinct 17)-cast(avg((t1.f)) AS integer)*cast(avg(d) AS integer) when -cast(avg(f) AS integer) then max(17) else -(count(*)) end from t1)-(coalesce((select (b) from t1 where t1.b>=t1.e),t1.c)) in (17,t1.e,b)) or (exists(select 1 from t1 where (t1.d=(d))))),t1.c) when b then c else (e) end)} -} {117200} -do_test randexpr-2.1162 { - db eval {SELECT case when t1.b*t1.c=coalesce((select t1.f from t1 where case when exists(select 1 from t1 where t1.d in (select e from t1 union select 19 from t1)) or t1.e>t1.e then t1.a+e-a when 19>t1.c then c else t1.c end+c not between b and t1.d),t1.f) and -(t1.b) between t1.e and -t1.d or b<>19 then (select ~(min(13))+max(f) from t1) else (t1.b) end*t1.b FROM t1 WHERE NOT (b in (b,e,case coalesce((select max(t1.b) from t1 where e>13 or ( -(select case -~count(distinct 17)-cast(avg((t1.f)) AS integer)*cast(avg(d) AS integer) when -cast(avg(f) AS integer) then max(17) else -(count(*)) end from t1)-(coalesce((select (b) from t1 where t1.b>=t1.e),t1.c)) in (17,t1.e,b)) or (exists(select 1 from t1 where (t1.d=(d))))),t1.c) when b then c else (e) end))} -} {} -do_test randexpr-2.1163 { - db eval {SELECT +t1.c+case when t1.e not in ((e)-(case when 17<11 then 19 when (t1.d in (d,coalesce((select max(t1.a) from t1 where not b<>t1.b),case t1.b when coalesce((select max(t1.a) from t1 where exists(select 1 from t1 where e not in (t1.f,11,17))),(19))*t1.f then c else t1.c end+ -t1.d)-t1.b+t1.e,d)) then 19 else b end)-e,t1.c, -13) then e else 17 end FROM t1 WHERE t1.e*t1.b | t1.b<>17*+coalesce((select max(t1.b) from t1 where case when coalesce((select max(b) from t1 where case when (b between 17 and d) then t1.f when t1.c between b and t1.a then t1.e else t1.a end not in (11,19,13)),11) in (t1.d,17,17) then t1.f when d<>13 then 11 else t1.a end+a<17),t1.a)-17+t1.f*d-a} -} {800} -do_test randexpr-2.1164 { - db eval {SELECT +t1.c+case when t1.e not in ((e)-(case when 17<11 then 19 when (t1.d in (d,coalesce((select max(t1.a) from t1 where not b<>t1.b),case t1.b when coalesce((select max(t1.a) from t1 where exists(select 1 from t1 where e not in (t1.f,11,17))),(19))*t1.f then c else t1.c end+ -t1.d)-t1.b+t1.e,d)) then 19 else b end)-e,t1.c, -13) then e else 17 end FROM t1 WHERE NOT (t1.e*t1.b | t1.b<>17*+coalesce((select max(t1.b) from t1 where case when coalesce((select max(b) from t1 where case when (b between 17 and d) then t1.f when t1.c between b and t1.a then t1.e else t1.a end not in (11,19,13)),11) in (t1.d,17,17) then t1.f when d<>13 then 11 else t1.a end+a<17),t1.a)-17+t1.f*d-a)} -} {} -do_test randexpr-2.1165 { - db eval {SELECT 11+case when case case f when (abs(t1.a)/abs(19))+t1.e then (abs(19)/abs(b+e)) else 13 end | 11 when (select ~~+min(t1.e) from t1) then t1.c else -e end<>case t1.a when 17 then case when (c not between 19 and t1.b) and t1.b<>t1.d then coalesce((select a from t1 where t1.d in (t1.e,t1.f,f)),t1.e) else 13 end else d end or t1.cf)} -} {} -do_test randexpr-2.1166 { - db eval {SELECT 11+case when case case f when (abs(t1.a)/abs(19))+t1.e then (abs(19)/abs(b+e)) else 13 end | 11 when (select ~~+min(t1.e) from t1) then t1.c else -e end<>case t1.a when 17 then case when (c not between 19 and t1.b) and t1.b<>t1.d then coalesce((select a from t1 where t1.d in (t1.e,t1.f,f)),t1.e) else 13 end else d end or t1.cf))} -} {11} -do_test randexpr-2.1167 { - db eval {SELECT 11+case when case case f when (abs(t1.a)/abs(19))+t1.e then (abs(19)/abs(b+e)) else 13 end & 11 when (select ~~+min(t1.e) from t1) then t1.c else -e end<>case t1.a when 17 then case when (c not between 19 and t1.b) and t1.b<>t1.d then coalesce((select a from t1 where t1.d in (t1.e,t1.f,f)),t1.e) else 13 end else d end or t1.cf))} -} {11} -do_test randexpr-2.1168 { - db eval {SELECT d-case when ~c<>case when not exists(select 1 from t1 where -t1.b<>19) then coalesce((select max(t1.f) from t1 where exists(select 1 from t1 where (t1.c in (select ~~+~max(~case when 13 not between t1.d and t1.d or c between c and f then t1.f else t1.a end)*abs(count(*)+(min( -t1.e))) from t1 union select cast(avg(e) AS integer) from t1) and (abs(t1.f*f-t1.a)/abs(d))>t1.b)) and (17) not in ( -t1.f,13,17)),19) else a end then b else f end FROM t1 WHERE f=(select case ~ -~count(distinct t1.b)+count(distinct d) | -count(distinct t1.e)*count(*)* -cast(avg(b) AS integer)*(cast(avg(13) AS integer)) when -min(19) then min(t1.e) else ((cast(avg(17) AS integer))) end from t1) or 19>=(19) and not exists(select 1 from t1 where (select count(*) from t1)*t1.d not between 19+11 and d) and -t1.e not in (e,t1.a, -a) and t1.e between t1.f and (t1.b) or c in ( -11,17,t1.c) or t1.a in (a,11,t1.d)} -} {200} -do_test randexpr-2.1169 { - db eval {SELECT d-case when ~c<>case when not exists(select 1 from t1 where -t1.b<>19) then coalesce((select max(t1.f) from t1 where exists(select 1 from t1 where (t1.c in (select ~~+~max(~case when 13 not between t1.d and t1.d or c between c and f then t1.f else t1.a end)*abs(count(*)+(min( -t1.e))) from t1 union select cast(avg(e) AS integer) from t1) and (abs(t1.f*f-t1.a)/abs(d))>t1.b)) and (17) not in ( -t1.f,13,17)),19) else a end then b else f end FROM t1 WHERE NOT (f=(select case ~ -~count(distinct t1.b)+count(distinct d) | -count(distinct t1.e)*count(*)* -cast(avg(b) AS integer)*(cast(avg(13) AS integer)) when -min(19) then min(t1.e) else ((cast(avg(17) AS integer))) end from t1) or 19>=(19) and not exists(select 1 from t1 where (select count(*) from t1)*t1.d not between 19+11 and d) and -t1.e not in (e,t1.a, -a) and t1.e between t1.f and (t1.b) or c in ( -11,17,t1.c) or t1.a in (a,11,t1.d))} -} {} -do_test randexpr-2.1170 { - db eval {SELECT case when a in (select t1.b from t1 union select coalesce((select ~19 from t1 where e>13*t1.d or c in (select b from t1 union select case a*t1.f when e then (t1.c) else (t1.b) end from t1)),t1.a) from t1) and t1.d>b or not exists(select 1 from t1 where t1.e in (select count(*)*min(t1.b)*~count(*) from t1 union select case -min((19)) when -max(b) then (min(t1.a)) else (count(distinct t1.d)) end from t1)) then (t1.c) when exists(select 1 from t1 where f not between 19 and f) then 19 else t1.c end-a FROM t1 WHERE a=coalesce((select f from t1 where t1.c in (11,(abs(coalesce((select max(t1.d) from t1 where (abs(t1.c | 13)/abs(11)) not in (b+case when coalesce((select max(b) from t1 where 11 between d and t1.a),b)=t1.b))),c) and f between 19 and t1.d or c>(f)} -} {} -do_test randexpr-2.1171 { - db eval {SELECT case when a in (select t1.b from t1 union select coalesce((select ~19 from t1 where e>13*t1.d or c in (select b from t1 union select case a*t1.f when e then (t1.c) else (t1.b) end from t1)),t1.a) from t1) and t1.d>b or not exists(select 1 from t1 where t1.e in (select count(*)*min(t1.b)*~count(*) from t1 union select case -min((19)) when -max(b) then (min(t1.a)) else (count(distinct t1.d)) end from t1)) then (t1.c) when exists(select 1 from t1 where f not between 19 and f) then 19 else t1.c end-a FROM t1 WHERE NOT (a=coalesce((select f from t1 where t1.c in (11,(abs(coalesce((select max(t1.d) from t1 where (abs(t1.c | 13)/abs(11)) not in (b+case when coalesce((select max(b) from t1 where 11 between d and t1.a),b)=t1.b))),c) and f between 19 and t1.d or c>(f))} -} {200} -do_test randexpr-2.1172 { - db eval {SELECT case when -(t1.f)- -case when t1.e not in ((t1.d)+a-t1.a,t1.c, - -a) then t1.b when (not exists(select 1 from t1 where t1.d>= -t1.f)) then -19 else f end-t1.f in (select cast(avg(19) AS integer)*case count(*) when abs((++min( -11))*max(13)-count(distinct 13)) then min(t1.a) else count(distinct 17) end from t1 union select count(distinct t1.a) from t1) then t1.c when b not between t1.f and 13 then e else t1.a end FROM t1 WHERE 11 not between ~17+d and ~case when t1.b in (c*((abs(case 13 when -(select abs(count(distinct coalesce((select max(coalesce((select t1.b from t1 where not exists(select 1 from t1 where (t1.c) in (t1.a,e,13))),t1.d)) from t1 where not t1.d>c),b))) from t1) then t1.f else t1.b end- -t1.c)/abs(c))+a),t1.d,t1.a) then (t1.c) else (d) end-13 or -t1.a in (17,a,f)} -} {500} -do_test randexpr-2.1173 { - db eval {SELECT case when -(t1.f)- -case when t1.e not in ((t1.d)+a-t1.a,t1.c, - -a) then t1.b when (not exists(select 1 from t1 where t1.d>= -t1.f)) then -19 else f end-t1.f in (select cast(avg(19) AS integer)*case count(*) when abs((++min( -11))*max(13)-count(distinct 13)) then min(t1.a) else count(distinct 17) end from t1 union select count(distinct t1.a) from t1) then t1.c when b not between t1.f and 13 then e else t1.a end FROM t1 WHERE NOT (11 not between ~17+d and ~case when t1.b in (c*((abs(case 13 when -(select abs(count(distinct coalesce((select max(coalesce((select t1.b from t1 where not exists(select 1 from t1 where (t1.c) in (t1.a,e,13))),t1.d)) from t1 where not t1.d>c),b))) from t1) then t1.f else t1.b end- -t1.c)/abs(c))+a),t1.d,t1.a) then (t1.c) else (d) end-13 or -t1.a in (17,a,f))} -} {} -do_test randexpr-2.1174 { - db eval {SELECT coalesce((select 17 from t1 where not exists(select 1 from t1 where (t1.b- -b+(select +case max(b)-~count(distinct e*(select case max(c) when abs((count(*))) then max(t1.f) else max(t1.c) end+cast(avg(t1.b) AS integer) from t1)) when abs(count(distinct e*19)) then max(b) else max(t1.c) end | count(distinct t1.e) from t1)-b*+t1.b not in ((11),17,13)))),t1.e) FROM t1 WHERE t1.c in (select min(coalesce((select 17 from t1 where t1.c | 17>=(abs(t1.a)/abs(case when t1.e not in (19,t1.d,19) then a when 13<=case when not exists(select 1 from t1 where (abs(e)/abs(t1.c)) in (select 19 from t1 union select d from t1) and t1.c>=17 or 19=t1.a) then f else a end then t1.d else e end))-f),e))*min(f) | ++min(a) from t1 union select cast(avg(f) AS integer) from t1)} -} {} -do_test randexpr-2.1175 { - db eval {SELECT coalesce((select 17 from t1 where not exists(select 1 from t1 where (t1.b- -b+(select +case max(b)-~count(distinct e*(select case max(c) when abs((count(*))) then max(t1.f) else max(t1.c) end+cast(avg(t1.b) AS integer) from t1)) when abs(count(distinct e*19)) then max(b) else max(t1.c) end | count(distinct t1.e) from t1)-b*+t1.b not in ((11),17,13)))),t1.e) FROM t1 WHERE NOT (t1.c in (select min(coalesce((select 17 from t1 where t1.c | 17>=(abs(t1.a)/abs(case when t1.e not in (19,t1.d,19) then a when 13<=case when not exists(select 1 from t1 where (abs(e)/abs(t1.c)) in (select 19 from t1 union select d from t1) and t1.c>=17 or 19=t1.a) then f else a end then t1.d else e end))-f),e))*min(f) | ++min(a) from t1 union select cast(avg(f) AS integer) from t1))} -} {500} -do_test randexpr-2.1176 { - db eval {SELECT coalesce((select 17 from t1 where not exists(select 1 from t1 where (t1.b- -b+(select +case max(b)-~count(distinct e*(select case max(c) when abs((count(*))) then max(t1.f) else max(t1.c) end+cast(avg(t1.b) AS integer) from t1)) when abs(count(distinct e*19)) then max(b) else max(t1.c) end & count(distinct t1.e) from t1)-b*+t1.b not in ((11),17,13)))),t1.e) FROM t1 WHERE NOT (t1.c in (select min(coalesce((select 17 from t1 where t1.c | 17>=(abs(t1.a)/abs(case when t1.e not in (19,t1.d,19) then a when 13<=case when not exists(select 1 from t1 where (abs(e)/abs(t1.c)) in (select 19 from t1 union select d from t1) and t1.c>=17 or 19=t1.a) then f else a end then t1.d else e end))-f),e))*min(f) | ++min(a) from t1 union select cast(avg(f) AS integer) from t1))} -} {500} -do_test randexpr-2.1177 { - db eval {SELECT case coalesce((select t1.e from t1 where +coalesce((select a from t1 where 13 | b | t1.b<=11*a*case when exists(select 1 from t1 where (a-t1.d+t1.e-f<17 and -17 between 19 and a)) then c when 17 between f and t1.c then a*11 else t1.d end),t1.e) not in (b,t1.f,t1.d)),a) when c then -c else t1.b end FROM t1 WHERE (exists(select 1 from t1 where case when not exists(select 1 from t1 where (select cast(avg(d) AS integer) from t1) in (select a from t1 union select case case when t1.e>t1.d or t1.b in (select c from t1 union select e from t1) or t1.a>=f and b>=11 then t1.c-(t1.c)*19 when b not in (e,c,t1.d) then t1.b else t1.c end when 13 then f else -t1.f end from t1)) then 17 when not exists(select 1 from t1 where not exists(select 1 from t1 where f not in (t1.d,f, -t1.b)) or -19<=t1.c) or t1.e between 13 and t1.a then f else d end<>t1.f) and f between 11 and t1.c and t1.e not in (t1.d,c,t1.e)) or d not between t1.b and t1.d} -} {} -do_test randexpr-2.1178 { - db eval {SELECT case coalesce((select t1.e from t1 where +coalesce((select a from t1 where 13 | b | t1.b<=11*a*case when exists(select 1 from t1 where (a-t1.d+t1.e-f<17 and -17 between 19 and a)) then c when 17 between f and t1.c then a*11 else t1.d end),t1.e) not in (b,t1.f,t1.d)),a) when c then -c else t1.b end FROM t1 WHERE NOT ((exists(select 1 from t1 where case when not exists(select 1 from t1 where (select cast(avg(d) AS integer) from t1) in (select a from t1 union select case case when t1.e>t1.d or t1.b in (select c from t1 union select e from t1) or t1.a>=f and b>=11 then t1.c-(t1.c)*19 when b not in (e,c,t1.d) then t1.b else t1.c end when 13 then f else -t1.f end from t1)) then 17 when not exists(select 1 from t1 where not exists(select 1 from t1 where f not in (t1.d,f, -t1.b)) or -19<=t1.c) or t1.e between 13 and t1.a then f else d end<>t1.f) and f between 11 and t1.c and t1.e not in (t1.d,c,t1.e)) or d not between t1.b and t1.d)} -} {200} -do_test randexpr-2.1179 { - db eval {SELECT case coalesce((select t1.e from t1 where +coalesce((select a from t1 where 13 & b & t1.b<=11*a*case when exists(select 1 from t1 where (a-t1.d+t1.e-f<17 and -17 between 19 and a)) then c when 17 between f and t1.c then a*11 else t1.d end),t1.e) not in (b,t1.f,t1.d)),a) when c then -c else t1.b end FROM t1 WHERE NOT ((exists(select 1 from t1 where case when not exists(select 1 from t1 where (select cast(avg(d) AS integer) from t1) in (select a from t1 union select case case when t1.e>t1.d or t1.b in (select c from t1 union select e from t1) or t1.a>=f and b>=11 then t1.c-(t1.c)*19 when b not in (e,c,t1.d) then t1.b else t1.c end when 13 then f else -t1.f end from t1)) then 17 when not exists(select 1 from t1 where not exists(select 1 from t1 where f not in (t1.d,f, -t1.b)) or -19<=t1.c) or t1.e between 13 and t1.a then f else d end<>t1.f) and f between 11 and t1.c and t1.e not in (t1.d,c,t1.e)) or d not between t1.b and t1.d)} -} {200} -do_test randexpr-2.1180 { - db eval {SELECT case when exists(select 1 from t1 where b<>coalesce((select (select + - -count(*)-~count(*)+~+case - -count(distinct (t1.d)) when max(t1.d) then count(*) else max(a) end+(cast(avg(17) AS integer)) from t1) | d from t1 where not exists(select 1 from t1 where (abs(f)/abs(t1.c)) between 13+a and -t1.d)),19) or (coalesce((select t1.d from t1 where (( - -19)>a)),t1.f) in (e,e,t1.e))) then t1.b*t1.f when t1.d not between (a) and a then e else b end FROM t1 WHERE not exists(select 1 from t1 where a in (select 13 from t1 union select 17 from t1))} -} {120000} -do_test randexpr-2.1181 { - db eval {SELECT case when exists(select 1 from t1 where b<>coalesce((select (select + - -count(*)-~count(*)+~+case - -count(distinct (t1.d)) when max(t1.d) then count(*) else max(a) end+(cast(avg(17) AS integer)) from t1) | d from t1 where not exists(select 1 from t1 where (abs(f)/abs(t1.c)) between 13+a and -t1.d)),19) or (coalesce((select t1.d from t1 where (( - -19)>a)),t1.f) in (e,e,t1.e))) then t1.b*t1.f when t1.d not between (a) and a then e else b end FROM t1 WHERE NOT (not exists(select 1 from t1 where a in (select 13 from t1 union select 17 from t1)))} -} {} -do_test randexpr-2.1182 { - db eval {SELECT case when exists(select 1 from t1 where b<>coalesce((select (select + - -count(*)-~count(*)+~+case - -count(distinct (t1.d)) when max(t1.d) then count(*) else max(a) end+(cast(avg(17) AS integer)) from t1) & d from t1 where not exists(select 1 from t1 where (abs(f)/abs(t1.c)) between 13+a and -t1.d)),19) or (coalesce((select t1.d from t1 where (( - -19)>a)),t1.f) in (e,e,t1.e))) then t1.b*t1.f when t1.d not between (a) and a then e else b end FROM t1 WHERE not exists(select 1 from t1 where a in (select 13 from t1 union select 17 from t1))} -} {120000} -do_test randexpr-2.1183 { - db eval {SELECT coalesce((select case when f>17-t1.f then (select +max(coalesce((select +11 from t1 where coalesce((select max(d) from t1 where +t1.c between (f) and c),t1.f) not in (c, -f,t1.e)),d)) from t1) else 17+19 end from t1 where not not exists(select 1 from t1 where t1.a in (select a from t1 union select t1.a from t1) and 17=d or (17)<=(( -19)) and t1.f in (select d from t1 union select 13 from t1) or 19>13 or t1.b not in (t1.b,17,d))), -(t1.c)) FROM t1 WHERE +t1.a-13+(select count(distinct a) from t1)-e*e*case when coalesce((select max(coalesce((select a from t1 where ((case b+t1.c-t1.c*d*17 when t1.a then t1.a else f end<>c))),t1.b+13)) from t1 where t1.f between 17 and t1.d),t1.c)<=(b) then f else t1.e end-13<>t1.f} -} {11} -do_test randexpr-2.1184 { - db eval {SELECT coalesce((select case when f>17-t1.f then (select +max(coalesce((select +11 from t1 where coalesce((select max(d) from t1 where +t1.c between (f) and c),t1.f) not in (c, -f,t1.e)),d)) from t1) else 17+19 end from t1 where not not exists(select 1 from t1 where t1.a in (select a from t1 union select t1.a from t1) and 17=d or (17)<=(( -19)) and t1.f in (select d from t1 union select 13 from t1) or 19>13 or t1.b not in (t1.b,17,d))), -(t1.c)) FROM t1 WHERE NOT (+t1.a-13+(select count(distinct a) from t1)-e*e*case when coalesce((select max(coalesce((select a from t1 where ((case b+t1.c-t1.c*d*17 when t1.a then t1.a else f end<>c))),t1.b+13)) from t1 where t1.f between 17 and t1.d),t1.c)<=(b) then f else t1.e end-13<>t1.f)} -} {} -do_test randexpr-2.1185 { - db eval {SELECT coalesce((select 13 from t1 where ~(select max(b) from t1)<= -+d*f+t1.b*f or coalesce((select max(case when d=(abs(19)/abs(t1.f)) then case b+d when (abs(coalesce((select 11 from t1 where t1.f between -d and c),t1.f))/abs(t1.a)) then b else t1.d end when a=t1.e),17)+ -c FROM t1 WHERE t1.b-+(t1.b) in (select a from t1 union select 19 from t1)} -} {} -do_test randexpr-2.1186 { - db eval {SELECT coalesce((select 13 from t1 where ~(select max(b) from t1)<= -+d*f+t1.b*f or coalesce((select max(case when d=(abs(19)/abs(t1.f)) then case b+d when (abs(coalesce((select 11 from t1 where t1.f between -d and c),t1.f))/abs(t1.a)) then b else t1.d end when a=t1.e),17)+ -c FROM t1 WHERE NOT (t1.b-+(t1.b) in (select a from t1 union select 19 from t1))} -} {-283} -do_test randexpr-2.1187 { - db eval {SELECT case when (abs((abs(d)/abs(t1.f-c)))/abs( -t1.f))*case when (t1.c not in (case when t1.b>case t1.d when t1.b then e else 11 end then t1.a when ( -t1.d in (select -count(*)-cast(avg(f) AS integer) from t1 union select count(*) from t1)) or 11 in (e,t1.e,c) then a else b end,t1.a,11) or t1.a in (17,t1.a,t1.d) and b>(t1.a)) then 11 when ct1.b then t1.c else 17 end FROM t1 WHERE t1.b>f} -} {} -do_test randexpr-2.1188 { - db eval {SELECT case when (abs((abs(d)/abs(t1.f-c)))/abs( -t1.f))*case when (t1.c not in (case when t1.b>case t1.d when t1.b then e else 11 end then t1.a when ( -t1.d in (select -count(*)-cast(avg(f) AS integer) from t1 union select count(*) from t1)) or 11 in (e,t1.e,c) then a else b end,t1.a,11) or t1.a in (17,t1.a,t1.d) and b>(t1.a)) then 11 when ct1.b then t1.c else 17 end FROM t1 WHERE NOT (t1.b>f)} -} {17} -do_test randexpr-2.1189 { - db eval {SELECT t1.e-case when case when ((exists(select 1 from t1 where not exists(select 1 from t1 where case when not 13<=13 or (t1.c<>t1.e) then t1.d else +13 end+13 in (select max(13) | max((t1.b)) from t1 union select max(f) from t1))))) then t1.f else ~t1.e | t1.d*t1.b end+11 not between t1.c and 13 then b when (t1.f not in (19,t1.f,t1.d)) then c else -b end FROM t1 WHERE ( -(select -min(13-t1.b) from t1)-coalesce((select case when -d>=t1.e or 11 between 17 and -t1.e then 19+f when t1.f=11 then -t1.c else t1.b end from t1 where t1.a not in (11,t1.e,t1.a)),t1.c)*11 in (select -case abs((abs(min(t1.d)))) when max(19) then cast(avg(f) AS integer) else case count(*) when count(*) then (count(distinct t1.f)) else cast(avg(11) AS integer) end end from t1 union select min(d) from t1)) or b in (select (count(*)) from t1 union select max(t1.a) from t1)} -} {} -do_test randexpr-2.1190 { - db eval {SELECT t1.e-case when case when ((exists(select 1 from t1 where not exists(select 1 from t1 where case when not 13<=13 or (t1.c<>t1.e) then t1.d else +13 end+13 in (select max(13) | max((t1.b)) from t1 union select max(f) from t1))))) then t1.f else ~t1.e | t1.d*t1.b end+11 not between t1.c and 13 then b when (t1.f not in (19,t1.f,t1.d)) then c else -b end FROM t1 WHERE NOT (( -(select -min(13-t1.b) from t1)-coalesce((select case when -d>=t1.e or 11 between 17 and -t1.e then 19+f when t1.f=11 then -t1.c else t1.b end from t1 where t1.a not in (11,t1.e,t1.a)),t1.c)*11 in (select -case abs((abs(min(t1.d)))) when max(19) then cast(avg(f) AS integer) else case count(*) when count(*) then (count(distinct t1.f)) else cast(avg(11) AS integer) end end from t1 union select min(d) from t1)) or b in (select (count(*)) from t1 union select max(t1.a) from t1))} -} {300} -do_test randexpr-2.1191 { - db eval {SELECT t1.e-case when case when ((exists(select 1 from t1 where not exists(select 1 from t1 where case when not 13<=13 or (t1.c<>t1.e) then t1.d else +13 end+13 in (select max(13) & max((t1.b)) from t1 union select max(f) from t1))))) then t1.f else ~t1.e & t1.d*t1.b end+11 not between t1.c and 13 then b when (t1.f not in (19,t1.f,t1.d)) then c else -b end FROM t1 WHERE NOT (( -(select -min(13-t1.b) from t1)-coalesce((select case when -d>=t1.e or 11 between 17 and -t1.e then 19+f when t1.f=11 then -t1.c else t1.b end from t1 where t1.a not in (11,t1.e,t1.a)),t1.c)*11 in (select -case abs((abs(min(t1.d)))) when max(19) then cast(avg(f) AS integer) else case count(*) when count(*) then (count(distinct t1.f)) else cast(avg(11) AS integer) end end from t1 union select min(d) from t1)) or b in (select (count(*)) from t1 union select max(t1.a) from t1))} -} {300} -do_test randexpr-2.1192 { - db eval {SELECT (coalesce((select c*(select +~count(distinct 19)-cast(avg(~ -c) AS integer)-max( -f)-cast(avg(t1.d) AS integer) from t1)+t1.a*t1.f+t1.e-a*b from t1 where not t1.ed and 11<=t1.e and (not exists(select 1 from t1 where exists(select 1 from t1 where (13=a)) or t1.e>t1.b))),19)) FROM t1 WHERE coalesce((select max(t1.f*11) from t1 where not exists(select 1 from t1 where t1.a<>17) and t1.b>case (abs(b* -t1.a)/abs(11)) when b*case case when f>=t1.e then 11 when t1.b<=d then 17 else a end* -a when e then 11 else c end then (t1.b) else 19 end or t1.f<13), -b)>=e and ((d in (select f from t1 union select f from t1)))} -} {} -do_test randexpr-2.1193 { - db eval {SELECT (coalesce((select c*(select +~count(distinct 19)-cast(avg(~ -c) AS integer)-max( -f)-cast(avg(t1.d) AS integer) from t1)+t1.a*t1.f+t1.e-a*b from t1 where not t1.ed and 11<=t1.e and (not exists(select 1 from t1 where exists(select 1 from t1 where (13=a)) or t1.e>t1.b))),19)) FROM t1 WHERE NOT (coalesce((select max(t1.f*11) from t1 where not exists(select 1 from t1 where t1.a<>17) and t1.b>case (abs(b* -t1.a)/abs(11)) when b*case case when f>=t1.e then 11 when t1.b<=d then 17 else a end* -a when e then 11 else c end then (t1.b) else 19 end or t1.f<13), -b)>=e and ((d in (select f from t1 union select f from t1))))} -} {10200} -do_test randexpr-2.1194 { - db eval {SELECT b-b+case when d+e between 17 and case when exists(select 1 from t1 where coalesce((select max(coalesce((select 11 from t1 where t1.e not between 13 and case when t1.e<>c then c | 19+t1.a else 17 end),t1.a)) from t1 where t1.d<=17 or a not in (b,11,a)),(t1.b))+b>=t1.a) then 11 else a end then d else a end+11*f FROM t1 WHERE (t1.b*19<=17)} -} {} -do_test randexpr-2.1195 { - db eval {SELECT b-b+case when d+e between 17 and case when exists(select 1 from t1 where coalesce((select max(coalesce((select 11 from t1 where t1.e not between 13 and case when t1.e<>c then c | 19+t1.a else 17 end),t1.a)) from t1 where t1.d<=17 or a not in (b,11,a)),(t1.b))+b>=t1.a) then 11 else a end then d else a end+11*f FROM t1 WHERE NOT ((t1.b*19<=17))} -} {6700} -do_test randexpr-2.1196 { - db eval {SELECT b-b+case when d+e between 17 and case when exists(select 1 from t1 where coalesce((select max(coalesce((select 11 from t1 where t1.e not between 13 and case when t1.e<>c then c & 19+t1.a else 17 end),t1.a)) from t1 where t1.d<=17 or a not in (b,11,a)),(t1.b))+b>=t1.a) then 11 else a end then d else a end+11*f FROM t1 WHERE NOT ((t1.b*19<=17))} -} {6700} -do_test randexpr-2.1197 { - db eval {SELECT +(abs(13)/abs(+~~case t1.e | +11-b-coalesce((select max(c) from t1 where 19 in (select cast(avg(coalesce((select max(case when t1.ae*c then 11 else 13 end from t1 where -t1.c not between t1.f and 11),t1.e)) AS integer) when case max( -d) when ((min(17))) then cast(avg(t1.a) AS integer) else min(e) end+cast(avg((t1.b)) AS integer) then cast(avg(t1.d) AS integer) else -(max(c)) end from t1)-f | b*13+e when t1.b then (f) else t1.a end in (select d from t1 union select 17 from t1)),d) FROM t1 WHERE t1.e*c>13-+t1.f | (abs((select abs(min(b)-abs( - -count(distinct 17-d-13+ -e-(t1.d)*e)+max(t1.e)) | (~abs((max(c)))+cast(avg(17) AS integer)-count(*)*cast(avg(11) AS integer))) from t1))/abs(t1.f))} -} {400} -do_test randexpr-2.1201 { - db eval {SELECT coalesce((select t1.f from t1 where case d-(select case cast(avg(coalesce((select case when not 11<>e*c then 11 else 13 end from t1 where -t1.c not between t1.f and 11),t1.e)) AS integer) when case max( -d) when ((min(17))) then cast(avg(t1.a) AS integer) else min(e) end+cast(avg((t1.b)) AS integer) then cast(avg(t1.d) AS integer) else -(max(c)) end from t1)-f | b*13+e when t1.b then (f) else t1.a end in (select d from t1 union select 17 from t1)),d) FROM t1 WHERE NOT (t1.e*c>13-+t1.f | (abs((select abs(min(b)-abs( - -count(distinct 17-d-13+ -e-(t1.d)*e)+max(t1.e)) | (~abs((max(c)))+cast(avg(17) AS integer)-count(*)*cast(avg(11) AS integer))) from t1))/abs(t1.f)))} -} {} -do_test randexpr-2.1202 { - db eval {SELECT coalesce((select t1.f from t1 where case d-(select case cast(avg(coalesce((select case when not 11<>e*c then 11 else 13 end from t1 where -t1.c not between t1.f and 11),t1.e)) AS integer) when case max( -d) when ((min(17))) then cast(avg(t1.a) AS integer) else min(e) end+cast(avg((t1.b)) AS integer) then cast(avg(t1.d) AS integer) else -(max(c)) end from t1)-f & b*13+e when t1.b then (f) else t1.a end in (select d from t1 union select 17 from t1)),d) FROM t1 WHERE t1.e*c>13-+t1.f | (abs((select abs(min(b)-abs( - -count(distinct 17-d-13+ -e-(t1.d)*e)+max(t1.e)) | (~abs((max(c)))+cast(avg(17) AS integer)-count(*)*cast(avg(11) AS integer))) from t1))/abs(t1.f))} -} {400} -do_test randexpr-2.1203 { - db eval {SELECT t1.b-~case when ~(abs(17)/abs(t1.a))+17+t1.b in (select count(distinct d) | count(*) from t1 union select case count(*) | count(distinct e) when count(*) then -count(*) else cast(avg(11) AS integer) end from t1) and t1.e>b or e not between (e) and c and 17 in (t1.c,b,b) and t1.a not between a and (t1.f) then coalesce((select t1.a*t1.c from t1 where -11 in (t1.a,(t1.f), -f)),13)*t1.c else t1.f end FROM t1 WHERE (t1.e<>t1.a+~~c-t1.a+13*e-17+t1.b)} -} {801} -do_test randexpr-2.1204 { - db eval {SELECT t1.b-~case when ~(abs(17)/abs(t1.a))+17+t1.b in (select count(distinct d) | count(*) from t1 union select case count(*) | count(distinct e) when count(*) then -count(*) else cast(avg(11) AS integer) end from t1) and t1.e>b or e not between (e) and c and 17 in (t1.c,b,b) and t1.a not between a and (t1.f) then coalesce((select t1.a*t1.c from t1 where -11 in (t1.a,(t1.f), -f)),13)*t1.c else t1.f end FROM t1 WHERE NOT ((t1.e<>t1.a+~~c-t1.a+13*e-17+t1.b))} -} {} -do_test randexpr-2.1205 { - db eval {SELECT t1.b-~case when ~(abs(17)/abs(t1.a))+17+t1.b in (select count(distinct d) & count(*) from t1 union select case count(*) & count(distinct e) when count(*) then -count(*) else cast(avg(11) AS integer) end from t1) and t1.e>b or e not between (e) and c and 17 in (t1.c,b,b) and t1.a not between a and (t1.f) then coalesce((select t1.a*t1.c from t1 where -11 in (t1.a,(t1.f), -f)),13)*t1.c else t1.f end FROM t1 WHERE (t1.e<>t1.a+~~c-t1.a+13*e-17+t1.b)} -} {801} -do_test randexpr-2.1206 { - db eval {SELECT ((abs(b)/abs(t1.e+coalesce((select max((abs(coalesce((select max(11) from t1 where t1.a<=coalesce((select case when t1.a in (case t1.b when t1.d then t1.d else a end,17,11) then 13 when t1.a>b then 19 else d end from t1 where c in (select (~case count(*) when min(f) then -min(d) else count(distinct (t1.f)) end)*(count(*)) from t1 union select -min((t1.c)) from t1)),11) and (b<=t1.c)),t1.f))/abs(e))-13) from t1 where b not in (d,( -e),e)),c)-t1.c))) FROM t1 WHERE (exists(select 1 from t1 where b in (select +( -abs(max(19+((select case -+cast(avg(e) AS integer) when -max(19)-min(t1.c) | count(*) then count(distinct t1.e) else min(f) end-cast(avg( -19) AS integer)*count(*) | count(*) from t1))-17)) | +cast(avg((select cast(avg(a) AS integer) from t1)*f) AS integer)-cast(avg(13-t1.a+b) AS integer))+ -max(t1.a) from t1 union select cast(avg( -f) AS integer) from t1)))} -} {} -do_test randexpr-2.1207 { - db eval {SELECT ((abs(b)/abs(t1.e+coalesce((select max((abs(coalesce((select max(11) from t1 where t1.a<=coalesce((select case when t1.a in (case t1.b when t1.d then t1.d else a end,17,11) then 13 when t1.a>b then 19 else d end from t1 where c in (select (~case count(*) when min(f) then -min(d) else count(distinct (t1.f)) end)*(count(*)) from t1 union select -min((t1.c)) from t1)),11) and (b<=t1.c)),t1.f))/abs(e))-13) from t1 where b not in (d,( -e),e)),c)-t1.c))) FROM t1 WHERE NOT ((exists(select 1 from t1 where b in (select +( -abs(max(19+((select case -+cast(avg(e) AS integer) when -max(19)-min(t1.c) | count(*) then count(distinct t1.e) else min(f) end-cast(avg( -19) AS integer)*count(*) | count(*) from t1))-17)) | +cast(avg((select cast(avg(a) AS integer) from t1)*f) AS integer)-cast(avg(13-t1.a+b) AS integer))+ -max(t1.a) from t1 union select cast(avg( -f) AS integer) from t1))))} -} {1} -do_test randexpr-2.1208 { - db eval {SELECT t1.f-17+(abs(case when ~e*coalesce((select max(coalesce((select d from t1 where not -(19*t1.d*17) not in (t1.a*t1.c,b,b)),f)) from t1 where 13 between t1.d and 19),11* -t1.e)-(t1.a)>d then 17 when (e in (select -(t1.d) from t1 union select -(t1.b) from t1)) then e else -t1.d end)/abs(17))*a FROM t1 WHERE 17 in (select 19 from t1 union select -17 | d from t1)} -} {} -do_test randexpr-2.1209 { - db eval {SELECT t1.f-17+(abs(case when ~e*coalesce((select max(coalesce((select d from t1 where not -(19*t1.d*17) not in (t1.a*t1.c,b,b)),f)) from t1 where 13 between t1.d and 19),11* -t1.e)-(t1.a)>d then 17 when (e in (select -(t1.d) from t1 union select -(t1.b) from t1)) then e else -t1.d end)/abs(17))*a FROM t1 WHERE NOT (17 in (select 19 from t1 union select -17 | d from t1))} -} {683} -do_test randexpr-2.1210 { - db eval {SELECT case t1.a when case when 13+( -f-b)*c-t1.d-t1.c | c+d>=d*case when not ++c+t1.d<>+b- -a*t1.e then -f else 17 end+t1.f then t1.e when 11<>19 then c else 11 end then e else f end FROM t1 WHERE (case when (abs(t1.f+case f-case when exists(select 1 from t1 where t1.c>13) then t1.e when t1.f>= -f then b else e end when 13 then t1.e else t1.c end)/abs(c)) in (select max(f)*max(f)*( -max( -17)) | min(t1.a) | cast(avg(13) AS integer)+count(*) from t1 union select ( -max(e)) from t1) then ( -d) when c not between f and ( -c) then 13 else b end between t1.a and e) and 19 not between 19 and c} -} {} -do_test randexpr-2.1211 { - db eval {SELECT case t1.a when case when 13+( -f-b)*c-t1.d-t1.c | c+d>=d*case when not ++c+t1.d<>+b- -a*t1.e then -f else 17 end+t1.f then t1.e when 11<>19 then c else 11 end then e else f end FROM t1 WHERE NOT ((case when (abs(t1.f+case f-case when exists(select 1 from t1 where t1.c>13) then t1.e when t1.f>= -f then b else e end when 13 then t1.e else t1.c end)/abs(c)) in (select max(f)*max(f)*( -max( -17)) | min(t1.a) | cast(avg(13) AS integer)+count(*) from t1 union select ( -max(e)) from t1) then ( -d) when c not between f and ( -c) then 13 else b end between t1.a and e) and 19 not between 19 and c)} -} {600} -do_test randexpr-2.1212 { - db eval {SELECT case t1.a when case when 13+( -f-b)*c-t1.d-t1.c & c+d>=d*case when not ++c+t1.d<>+b- -a*t1.e then -f else 17 end+t1.f then t1.e when 11<>19 then c else 11 end then e else f end FROM t1 WHERE NOT ((case when (abs(t1.f+case f-case when exists(select 1 from t1 where t1.c>13) then t1.e when t1.f>= -f then b else e end when 13 then t1.e else t1.c end)/abs(c)) in (select max(f)*max(f)*( -max( -17)) | min(t1.a) | cast(avg(13) AS integer)+count(*) from t1 union select ( -max(e)) from t1) then ( -d) when c not between f and ( -c) then 13 else b end between t1.a and e) and 19 not between 19 and c)} -} {600} -do_test randexpr-2.1213 { - db eval {SELECT case when 19=t1.e or (abs(t1.f)/abs(((select -count(distinct f+~t1.e-t1.b-coalesce((select max(b*c) from t1 where 17<>b),b))+~cast(avg(d) AS integer) from t1)))) not between f and d then coalesce((select max( -a) from t1 where 13<=11 or t1.d>=f),t1.d) when 17 in (select 11 from t1 union select t1.a from t1) then t1.d else t1.c end | 19 FROM t1 WHERE (case t1.d when ~a then coalesce((select max((abs( -~+b)/abs(t1.c))) from t1 where case t1.e when (abs((abs(case t1.a++t1.d | 19-coalesce((select e from t1 where b not between t1.f+b+c and t1.b), -t1.f) when t1.e then t1.a else f end)/abs(t1.b)))/abs(t1.e)) then t1.d else t1.d end>t1.f),t1.d)*t1.b else t1.f end not between a and e)} -} {403} -do_test randexpr-2.1214 { - db eval {SELECT case when 19=t1.e or (abs(t1.f)/abs(((select -count(distinct f+~t1.e-t1.b-coalesce((select max(b*c) from t1 where 17<>b),b))+~cast(avg(d) AS integer) from t1)))) not between f and d then coalesce((select max( -a) from t1 where 13<=11 or t1.d>=f),t1.d) when 17 in (select 11 from t1 union select t1.a from t1) then t1.d else t1.c end | 19 FROM t1 WHERE NOT ((case t1.d when ~a then coalesce((select max((abs( -~+b)/abs(t1.c))) from t1 where case t1.e when (abs((abs(case t1.a++t1.d | 19-coalesce((select e from t1 where b not between t1.f+b+c and t1.b), -t1.f) when t1.e then t1.a else f end)/abs(t1.b)))/abs(t1.e)) then t1.d else t1.d end>t1.f),t1.d)*t1.b else t1.f end not between a and e))} -} {} -do_test randexpr-2.1215 { - db eval {SELECT case when 19=t1.e or (abs(t1.f)/abs(((select -count(distinct f+~t1.e-t1.b-coalesce((select max(b*c) from t1 where 17<>b),b))+~cast(avg(d) AS integer) from t1)))) not between f and d then coalesce((select max( -a) from t1 where 13<=11 or t1.d>=f),t1.d) when 17 in (select 11 from t1 union select t1.a from t1) then t1.d else t1.c end & 19 FROM t1 WHERE (case t1.d when ~a then coalesce((select max((abs( -~+b)/abs(t1.c))) from t1 where case t1.e when (abs((abs(case t1.a++t1.d | 19-coalesce((select e from t1 where b not between t1.f+b+c and t1.b), -t1.f) when t1.e then t1.a else f end)/abs(t1.b)))/abs(t1.e)) then t1.d else t1.d end>t1.f),t1.d)*t1.b else t1.f end not between a and e)} -} {16} -do_test randexpr-2.1216 { - db eval {SELECT coalesce((select t1.c from t1 where -a in (select e from t1 union select 13 from t1)),(select count(distinct coalesce((select max((17)) from t1 where c not between case 19-t1.b when a then ~+(abs((select count(distinct (t1.a)) from t1)+(t1.b))/abs((t1.a)*a+13 | t1.d | t1.a)) else a end and 13 or d in (a,a,t1.f)),d)) from t1) | t1.d) FROM t1 WHERE et1.a then (select +abs(count(distinct t1.f)*max(13)) from t1) else +d end>=b+t1.c and b not in (f,13,b) then t1.d when b>b then d else t1.d end*11 FROM t1 WHERE d<>b} -} {4400} -do_test randexpr-2.1220 { - db eval {SELECT case when case when t1.b<=f+coalesce((select max(11) from t1 where not e in (select count(distinct f) from t1 union select count(*) from t1)),t1.d) or 19 between (e) and 19 and f not in (t1.d,(19),t1.e) and exists(select 1 from t1 where t1.e<=19) or t1.e>t1.a then (select +abs(count(distinct t1.f)*max(13)) from t1) else +d end>=b+t1.c and b not in (f,13,b) then t1.d when b>b then d else t1.d end*11 FROM t1 WHERE NOT (d<>b)} -} {} -do_test randexpr-2.1221 { - db eval {SELECT ~(abs(case when t1.a not between -t1.d*(b) and 17 then f when e<=t1.f then b*t1.d else 13*(a) end)/abs((coalesce((select d from t1 where +(abs((select (min(a)) from t1))/abs((select count(distinct a) from t1)))- -t1.a in (select -case max(e)+count(distinct d) when cast(avg(( -t1.e)) AS integer) then ( -(count(*))) else -min(d) end+max(t1.f) from t1 union select max(t1.a) from t1)),t1.d)))) FROM t1 WHERE (t1.a=13 then 11 else a end then -17 else a end and (t1.c) and (b=17)) then (+(t1.c)) when t1.a<=t1.f then t1.d else 11 end FROM t1 WHERE c<>~13} -} {1000} -do_test randexpr-2.1224 { - db eval {SELECT f+case when (~t1.c between case when +d between (select -abs(count(distinct t1.a+17+t1.f))+case min(19)*count(distinct -t1.a) when (count(*)) then ((count(*))) else ((max(t1.e))) end from t1) and case when -t1.b>=13 then 11 else a end then -17 else a end and (t1.c) and (b=17)) then (+(t1.c)) when t1.a<=t1.f then t1.d else 11 end FROM t1 WHERE NOT (c<>~13)} -} {} -do_test randexpr-2.1225 { - db eval {SELECT case when ~(abs((select count(*) from t1))/abs(c))<>case when 17*case when coalesce((select max(f) from t1 where exists(select 1 from t1 where t1.f=t1.e)),t1.a) in (select min(t1.f) from t1 union select -min(t1.d) from t1) then 11 when 11<=(a) then f else -e end | -t1.b< -c then d else f end then ((t1.a)) when t1.f in (select ~(++(count(*))+cast(avg(t1.f) AS integer))+max(( -t1.d)) from t1 union select cast(avg(e) AS integer) from t1) then 11 else d end FROM t1 WHERE t1.a between case when t1.d=t1.a*11 | (select (cast(avg(t1.a) AS integer)+abs( -count(distinct e)) | ~count(distinct coalesce((select max(b) from t1 where not exists(select 1 from t1 where -e>=13)),(t1.e)))- -( -max(d))* -count(*)) from t1)+(abs(t1.f)/abs((select cast(avg(11) AS integer) from t1))) then t1.a else coalesce((select max(c) from t1 where 11>=t1.e or 11 in (t1.b,t1.b,t1.d) or t1.a>=t1.a),13)*a end and t1.c} -} {} -do_test randexpr-2.1226 { - db eval {SELECT case when ~(abs((select count(*) from t1))/abs(c))<>case when 17*case when coalesce((select max(f) from t1 where exists(select 1 from t1 where t1.f=t1.e)),t1.a) in (select min(t1.f) from t1 union select -min(t1.d) from t1) then 11 when 11<=(a) then f else -e end | -t1.b< -c then d else f end then ((t1.a)) when t1.f in (select ~(++(count(*))+cast(avg(t1.f) AS integer))+max(( -t1.d)) from t1 union select cast(avg(e) AS integer) from t1) then 11 else d end FROM t1 WHERE NOT (t1.a between case when t1.d=t1.a*11 | (select (cast(avg(t1.a) AS integer)+abs( -count(distinct e)) | ~count(distinct coalesce((select max(b) from t1 where not exists(select 1 from t1 where -e>=13)),(t1.e)))- -( -max(d))* -count(*)) from t1)+(abs(t1.f)/abs((select cast(avg(11) AS integer) from t1))) then t1.a else coalesce((select max(c) from t1 where 11>=t1.e or 11 in (t1.b,t1.b,t1.d) or t1.a>=t1.a),13)*a end and t1.c)} -} {100} -do_test randexpr-2.1227 { - db eval {SELECT case when ~(abs((select count(*) from t1))/abs(c))<>case when 17*case when coalesce((select max(f) from t1 where exists(select 1 from t1 where t1.f=t1.e)),t1.a) in (select min(t1.f) from t1 union select -min(t1.d) from t1) then 11 when 11<=(a) then f else -e end & -t1.b< -c then d else f end then ((t1.a)) when t1.f in (select ~(++(count(*))+cast(avg(t1.f) AS integer))+max(( -t1.d)) from t1 union select cast(avg(e) AS integer) from t1) then 11 else d end FROM t1 WHERE NOT (t1.a between case when t1.d=t1.a*11 | (select (cast(avg(t1.a) AS integer)+abs( -count(distinct e)) | ~count(distinct coalesce((select max(b) from t1 where not exists(select 1 from t1 where -e>=13)),(t1.e)))- -( -max(d))* -count(*)) from t1)+(abs(t1.f)/abs((select cast(avg(11) AS integer) from t1))) then t1.a else coalesce((select max(c) from t1 where 11>=t1.e or 11 in (t1.b,t1.b,t1.d) or t1.a>=t1.a),13)*a end and t1.c)} -} {100} -do_test randexpr-2.1228 { - db eval {SELECT (coalesce((select 19 from t1 where - -t1.d | t1.c+~(select max(11) | -~count(*)+count(*)-cast(avg(case when t1.e in (select a from t1 union select f from t1) then c else 11 end) AS integer) from t1)*coalesce((select t1.b from t1 where ((abs(t1.b)/abs(coalesce((select (b)-f from t1 where t1.f not in ( -e, -t1.b, -t1.d) and t1.d>=a or 19 not in (a,13,t1.f)),b))))=a or 19 not in (a,13,t1.f)),b))))=a or 19 not in (a,13,t1.f)),b))))t1.d then (17) else e end+t1.d-19 FROM t1 WHERE not -t1.e+t1.c not between case when -case case when exists(select 1 from t1 where 17 in (select min(19) from t1 union select -min(19) from t1) and 13 not in (17,a,t1.e)) then case when f>=19 then (c) when t1.f>13 then 19 else 19 end | t1.a else e end when b then t1.c else b end in (select -max(13) from t1 union select count(distinct 17) from t1) and 11 not in (11,t1.a,f) and t1.c=f then ~(abs(t1.e)/abs(t1.d)) when f<13 then 17 else 19 end*b and t1.e} -} {} -do_test randexpr-2.1234 { - db eval {SELECT ~case when exists(select 1 from t1 where t1.c in (t1.a,e+t1.b+e-19 | coalesce((select max(t1.f | t1.a+11*a) from t1 where (abs((abs(f)/abs(d)))/abs(coalesce((select max(t1.a) from t1 where (13 between (f) and f and t1.e between e and t1.b)),t1.c)))<=(f)),e)+f+13, -t1.c)) then t1.b when t1.d<>t1.d then (17) else e end+t1.d-19 FROM t1 WHERE NOT (not -t1.e+t1.c not between case when -case case when exists(select 1 from t1 where 17 in (select min(19) from t1 union select -min(19) from t1) and 13 not in (17,a,t1.e)) then case when f>=19 then (c) when t1.f>13 then 19 else 19 end | t1.a else e end when b then t1.c else b end in (select -max(13) from t1 union select count(distinct 17) from t1) and 11 not in (11,t1.a,f) and t1.c=f then ~(abs(t1.e)/abs(t1.d)) when f<13 then 17 else 19 end*b and t1.e)} -} {-120} -do_test randexpr-2.1235 { - db eval {SELECT ~case when exists(select 1 from t1 where t1.c in (t1.a,e+t1.b+e-19 & coalesce((select max(t1.f & t1.a+11*a) from t1 where (abs((abs(f)/abs(d)))/abs(coalesce((select max(t1.a) from t1 where (13 between (f) and f and t1.e between e and t1.b)),t1.c)))<=(f)),e)+f+13, -t1.c)) then t1.b when t1.d<>t1.d then (17) else e end+t1.d-19 FROM t1 WHERE NOT (not -t1.e+t1.c not between case when -case case when exists(select 1 from t1 where 17 in (select min(19) from t1 union select -min(19) from t1) and 13 not in (17,a,t1.e)) then case when f>=19 then (c) when t1.f>13 then 19 else 19 end | t1.a else e end when b then t1.c else b end in (select -max(13) from t1 union select count(distinct 17) from t1) and 11 not in (11,t1.a,f) and t1.c=f then ~(abs(t1.e)/abs(t1.d)) when f<13 then 17 else 19 end*b and t1.e)} -} {-120} -do_test randexpr-2.1236 { - db eval {SELECT ((select min(e+case when b not between coalesce((select t1.d | b from t1 where not exists(select 1 from t1 where 17>11)), -c) and (t1.a) or ed then a when 19>11 then -13 else t1.b end+13)+count(distinct d)+count(*)* -count(distinct t1.f)-((count(distinct t1.c)))+min(a) | max(c) from t1)*t1.e*19*11) FROM t1 WHERE b<>(select count(distinct f) from t1)} -} {104918000} -do_test randexpr-2.1237 { - db eval {SELECT ((select min(e+case when b not between coalesce((select t1.d | b from t1 where not exists(select 1 from t1 where 17>11)), -c) and (t1.a) or ed then a when 19>11 then -13 else t1.b end+13)+count(distinct d)+count(*)* -count(distinct t1.f)-((count(distinct t1.c)))+min(a) | max(c) from t1)*t1.e*19*11) FROM t1 WHERE NOT (b<>(select count(distinct f) from t1))} -} {} -do_test randexpr-2.1238 { - db eval {SELECT ((select min(e+case when b not between coalesce((select t1.d & b from t1 where not exists(select 1 from t1 where 17>11)), -c) and (t1.a) or ed then a when 19>11 then -13 else t1.b end+13)+count(distinct d)+count(*)* -count(distinct t1.f)-((count(distinct t1.c)))+min(a) & max(c) from t1)*t1.e*19*11) FROM t1 WHERE b<>(select count(distinct f) from t1)} -} {836000} -do_test randexpr-2.1239 { - db eval {SELECT coalesce((select max(t1.a) from t1 where +b-b+t1.e<>(case when (case when ((select case -cast(avg(17) AS integer) when max(17) then count(*) else count(distinct t1.d) end from t1))-case 19 when 11 then e else t1.f end<=e then 19 when b not between t1.c and 13 then e else 17 end+t1.c in (select 19 from t1 union select a from t1)) then e-t1.c else t1.f end*t1.b)-e),a) FROM t1 WHERE coalesce((select 13 from t1 where t1.c<>t1.b | t1.e*19-e),f+t1.d) not in (13,(c)*a,e)} -} {} -do_test randexpr-2.1240 { - db eval {SELECT coalesce((select max(t1.a) from t1 where +b-b+t1.e<>(case when (case when ((select case -cast(avg(17) AS integer) when max(17) then count(*) else count(distinct t1.d) end from t1))-case 19 when 11 then e else t1.f end<=e then 19 when b not between t1.c and 13 then e else 17 end+t1.c in (select 19 from t1 union select a from t1)) then e-t1.c else t1.f end*t1.b)-e),a) FROM t1 WHERE NOT (coalesce((select 13 from t1 where t1.c<>t1.b | t1.e*19-e),f+t1.d) not in (13,(c)*a,e))} -} {100} -do_test randexpr-2.1241 { - db eval {SELECT t1.d-case when (11) not between coalesce((select max(a) from t1 where f in (select cast(avg(t1.c+(select case case case max(a) when -count(*) then min(b) else - -(min((t1.a))) end when (max((19))) then max(t1.f) else count(*) end when max(t1.a) then -min(t1.c) else count(*) end from t1)+c+t1.d) AS integer)-min(a) | -cast(avg(f) AS integer)*(cast(avg(f) AS integer))-( -count(*)) from t1 union select min( -c) from t1)),t1.a) and -c then (d) when t1.f<=((t1.c)) then - -13 else c end FROM t1 WHERE 13-e>(abs(t1.f)/abs((t1.d)*d))} -} {} -do_test randexpr-2.1242 { - db eval {SELECT t1.d-case when (11) not between coalesce((select max(a) from t1 where f in (select cast(avg(t1.c+(select case case case max(a) when -count(*) then min(b) else - -(min((t1.a))) end when (max((19))) then max(t1.f) else count(*) end when max(t1.a) then -min(t1.c) else count(*) end from t1)+c+t1.d) AS integer)-min(a) | -cast(avg(f) AS integer)*(cast(avg(f) AS integer))-( -count(*)) from t1 union select min( -c) from t1)),t1.a) and -c then (d) when t1.f<=((t1.c)) then - -13 else c end FROM t1 WHERE NOT (13-e>(abs(t1.f)/abs((t1.d)*d)))} -} {0} -do_test randexpr-2.1243 { - db eval {SELECT t1.d-case when (11) not between coalesce((select max(a) from t1 where f in (select cast(avg(t1.c+(select case case case max(a) when -count(*) then min(b) else - -(min((t1.a))) end when (max((19))) then max(t1.f) else count(*) end when max(t1.a) then -min(t1.c) else count(*) end from t1)+c+t1.d) AS integer)-min(a) & -cast(avg(f) AS integer)*(cast(avg(f) AS integer))-( -count(*)) from t1 union select min( -c) from t1)),t1.a) and -c then (d) when t1.f<=((t1.c)) then - -13 else c end FROM t1 WHERE NOT (13-e>(abs(t1.f)/abs((t1.d)*d)))} -} {0} -do_test randexpr-2.1244 { - db eval {SELECT (abs(coalesce((select max(b) from t1 where not exists(select 1 from t1 where 19>(t1.c))),(11+(abs(c)/abs(19)))+b)+coalesce((select max(t1.c) from t1 where t1.a<=13),t1.d+t1.b+case when exists(select 1 from t1 where -t1.b in (select min(t1.a-+13) from t1 union select max(t1.c) from t1)) then (select ++(cast(avg(11) AS integer)) | cast(avg(b) AS integer)*cast(avg(d) AS integer) from t1) when f>=b then 19 else 19 end))/abs(b)) FROM t1 WHERE not b in (select case when t1.e in (select +cast(avg(d) AS integer)-count(*)*count(*)-(case ~count(distinct d)*cast(avg(t1.b) AS integer) when count(distinct t1.e) then max(19) else cast(avg(t1.b) AS integer) end+(count(distinct t1.c))) from t1 union select -min(t1.f) from t1) or 19<=+11 then ((select (min(t1.b)) from t1)*a-19+17*13) | a when (11 in (select d from t1 union select t1.e from t1)) then 19 else t1.b end from t1 union select t1.c from t1)} -} {} -do_test randexpr-2.1245 { - db eval {SELECT (abs(coalesce((select max(b) from t1 where not exists(select 1 from t1 where 19>(t1.c))),(11+(abs(c)/abs(19)))+b)+coalesce((select max(t1.c) from t1 where t1.a<=13),t1.d+t1.b+case when exists(select 1 from t1 where -t1.b in (select min(t1.a-+13) from t1 union select max(t1.c) from t1)) then (select ++(cast(avg(11) AS integer)) | cast(avg(b) AS integer)*cast(avg(d) AS integer) from t1) when f>=b then 19 else 19 end))/abs(b)) FROM t1 WHERE NOT (not b in (select case when t1.e in (select +cast(avg(d) AS integer)-count(*)*count(*)-(case ~count(distinct d)*cast(avg(t1.b) AS integer) when count(distinct t1.e) then max(19) else cast(avg(t1.b) AS integer) end+(count(distinct t1.c))) from t1 union select -min(t1.f) from t1) or 19<=+11 then ((select (min(t1.b)) from t1)*a-19+17*13) | a when (11 in (select d from t1 union select t1.e from t1)) then 19 else t1.b end from t1 union select t1.c from t1))} -} {4} -do_test randexpr-2.1246 { - db eval {SELECT (abs(coalesce((select max(b) from t1 where not exists(select 1 from t1 where 19>(t1.c))),(11+(abs(c)/abs(19)))+b)+coalesce((select max(t1.c) from t1 where t1.a<=13),t1.d+t1.b+case when exists(select 1 from t1 where -t1.b in (select min(t1.a-+13) from t1 union select max(t1.c) from t1)) then (select ++(cast(avg(11) AS integer)) & cast(avg(b) AS integer)*cast(avg(d) AS integer) from t1) when f>=b then 19 else 19 end))/abs(b)) FROM t1 WHERE NOT (not b in (select case when t1.e in (select +cast(avg(d) AS integer)-count(*)*count(*)-(case ~count(distinct d)*cast(avg(t1.b) AS integer) when count(distinct t1.e) then max(19) else cast(avg(t1.b) AS integer) end+(count(distinct t1.c))) from t1 union select -min(t1.f) from t1) or 19<=+11 then ((select (min(t1.b)) from t1)*a-19+17*13) | a when (11 in (select d from t1 union select t1.e from t1)) then 19 else t1.b end from t1 union select t1.c from t1))} -} {4} -do_test randexpr-2.1247 { - db eval {SELECT +case ~t1.d when case when b*f in (select b from t1 union select 17 from t1) and ((case when t1.f | e in (select ~abs(~(case cast(avg(t1.f) AS integer) when min(b) then min(t1.d) else - -count(distinct e) end | count(*)*( -cast(avg(t1.b) AS integer)))) from t1 union select (count(distinct t1.b)) from t1) then t1.f else t1.f*17+a end-13+e<>t1.c)) then d else t1.c end then t1.f else t1.e end+19 FROM t1 WHERE b>=+t1.e or f<=t1.b and -c*17-t1.d*19 not in (c+coalesce((select (abs(~+d*t1.f)/abs(11)) from t1 where +case when t1.d+ -t1.e in (select max(t1.d)*count(distinct b) from t1 union select count(distinct 11) from t1) then (17) when (t1.e>t1.a) then e else e end not in (e,f,t1.a)),t1.f),t1.a,b)} -} {} -do_test randexpr-2.1248 { - db eval {SELECT +case ~t1.d when case when b*f in (select b from t1 union select 17 from t1) and ((case when t1.f | e in (select ~abs(~(case cast(avg(t1.f) AS integer) when min(b) then min(t1.d) else - -count(distinct e) end | count(*)*( -cast(avg(t1.b) AS integer)))) from t1 union select (count(distinct t1.b)) from t1) then t1.f else t1.f*17+a end-13+e<>t1.c)) then d else t1.c end then t1.f else t1.e end+19 FROM t1 WHERE NOT (b>=+t1.e or f<=t1.b and -c*17-t1.d*19 not in (c+coalesce((select (abs(~+d*t1.f)/abs(11)) from t1 where +case when t1.d+ -t1.e in (select max(t1.d)*count(distinct b) from t1 union select count(distinct 11) from t1) then (17) when (t1.e>t1.a) then e else e end not in (e,f,t1.a)),t1.f),t1.a,b))} -} {519} -do_test randexpr-2.1249 { - db eval {SELECT +case ~t1.d when case when b*f in (select b from t1 union select 17 from t1) and ((case when t1.f & e in (select ~abs(~(case cast(avg(t1.f) AS integer) when min(b) then min(t1.d) else - -count(distinct e) end & count(*)*( -cast(avg(t1.b) AS integer)))) from t1 union select (count(distinct t1.b)) from t1) then t1.f else t1.f*17+a end-13+e<>t1.c)) then d else t1.c end then t1.f else t1.e end+19 FROM t1 WHERE NOT (b>=+t1.e or f<=t1.b and -c*17-t1.d*19 not in (c+coalesce((select (abs(~+d*t1.f)/abs(11)) from t1 where +case when t1.d+ -t1.e in (select max(t1.d)*count(distinct b) from t1 union select count(distinct 11) from t1) then (17) when (t1.e>t1.a) then e else e end not in (e,f,t1.a)),t1.f),t1.a,b))} -} {519} -do_test randexpr-2.1250 { - db eval {SELECT (abs((abs(t1.a)/abs(~17 | coalesce((select ~coalesce((select (d) from t1 where t1.b>=t1.a),case when t1.e-(select ~max( -19*c | e+t1.c) from t1) not between (abs(c)/abs(e)) and t1.e then a else 17 end*17)+13 from t1 where a in (select max(t1.f) from t1 union select ~count(distinct b) from t1)),b) | 13)))/abs(e)) FROM t1 WHERE exists(select 1 from t1 where t1.a+t1.d-11<=t1.e)} -} {0} -do_test randexpr-2.1251 { - db eval {SELECT (abs((abs(t1.a)/abs(~17 | coalesce((select ~coalesce((select (d) from t1 where t1.b>=t1.a),case when t1.e-(select ~max( -19*c | e+t1.c) from t1) not between (abs(c)/abs(e)) and t1.e then a else 17 end*17)+13 from t1 where a in (select max(t1.f) from t1 union select ~count(distinct b) from t1)),b) | 13)))/abs(e)) FROM t1 WHERE NOT (exists(select 1 from t1 where t1.a+t1.d-11<=t1.e))} -} {} -do_test randexpr-2.1252 { - db eval {SELECT (abs((abs(t1.a)/abs(~17 & coalesce((select ~coalesce((select (d) from t1 where t1.b>=t1.a),case when t1.e-(select ~max( -19*c & e+t1.c) from t1) not between (abs(c)/abs(e)) and t1.e then a else 17 end*17)+13 from t1 where a in (select max(t1.f) from t1 union select ~count(distinct b) from t1)),b) & 13)))/abs(e)) FROM t1 WHERE exists(select 1 from t1 where t1.a+t1.d-11<=t1.e)} -} {0} -do_test randexpr-2.1253 { - db eval {SELECT coalesce((select max(d) from t1 where not exists(select 1 from t1 where t1.e not in (13,e,coalesce((select f from t1 where (abs(case -t1.e when ~f then (t1.c)*13-t1.b+a-d+ -t1.a else a end)/abs(11))*19*t1.d>=a),(t1.b)))) or d not in (f,e,19)),coalesce((select max(17) from t1 where e in (select t1.e from t1 union select 17 from t1)),t1.c)) | t1.f FROM t1 WHERE t1.e not in (13,(select +count(*)+abs(cast(avg(case t1.d when 17 then -t1.e+13 else (abs( -c)/abs(case when t1.e*+coalesce((select max(13) from t1 where a>t1.b),t1.f)>=(13) then -f else t1.a end)) end) AS integer)) from t1)*(13),(select ((max(t1.d))) from t1)) and not exists(select 1 from t1 where e+b not in (b,t1.c,t1.e))} -} {} -do_test randexpr-2.1254 { - db eval {SELECT coalesce((select max(d) from t1 where not exists(select 1 from t1 where t1.e not in (13,e,coalesce((select f from t1 where (abs(case -t1.e when ~f then (t1.c)*13-t1.b+a-d+ -t1.a else a end)/abs(11))*19*t1.d>=a),(t1.b)))) or d not in (f,e,19)),coalesce((select max(17) from t1 where e in (select t1.e from t1 union select 17 from t1)),t1.c)) | t1.f FROM t1 WHERE NOT (t1.e not in (13,(select +count(*)+abs(cast(avg(case t1.d when 17 then -t1.e+13 else (abs( -c)/abs(case when t1.e*+coalesce((select max(13) from t1 where a>t1.b),t1.f)>=(13) then -f else t1.a end)) end) AS integer)) from t1)*(13),(select ((max(t1.d))) from t1)) and not exists(select 1 from t1 where e+b not in (b,t1.c,t1.e)))} -} {984} -do_test randexpr-2.1255 { - db eval {SELECT coalesce((select max(d) from t1 where not exists(select 1 from t1 where t1.e not in (13,e,coalesce((select f from t1 where (abs(case -t1.e when ~f then (t1.c)*13-t1.b+a-d+ -t1.a else a end)/abs(11))*19*t1.d>=a),(t1.b)))) or d not in (f,e,19)),coalesce((select max(17) from t1 where e in (select t1.e from t1 union select 17 from t1)),t1.c)) & t1.f FROM t1 WHERE NOT (t1.e not in (13,(select +count(*)+abs(cast(avg(case t1.d when 17 then -t1.e+13 else (abs( -c)/abs(case when t1.e*+coalesce((select max(13) from t1 where a>t1.b),t1.f)>=(13) then -f else t1.a end)) end) AS integer)) from t1)*(13),(select ((max(t1.d))) from t1)) and not exists(select 1 from t1 where e+b not in (b,t1.c,t1.e)))} -} {16} -do_test randexpr-2.1256 { - db eval {SELECT (abs(case when (t1.d*coalesce((select max(case coalesce((select max(e) from t1 where t1.a not in (coalesce((select (select count(distinct t1.e) from t1) from t1 where c>=t1.c),f),19,a)),t1.a) when t1.c then t1.a else b end-a) from t1 where c>t1.d),b)<= -11) then t1.a when not exists(select 1 from t1 where not (t1.d=e) or t1.f between t1.a and -e and (t1.c)=f and a not in (t1.c,a,c)) then t1.a else t1.a end)/abs( -13))+e-d FROM t1 WHERE 17 not in (13,19,t1.c)} -} {107} -do_test randexpr-2.1257 { - db eval {SELECT (abs(case when (t1.d*coalesce((select max(case coalesce((select max(e) from t1 where t1.a not in (coalesce((select (select count(distinct t1.e) from t1) from t1 where c>=t1.c),f),19,a)),t1.a) when t1.c then t1.a else b end-a) from t1 where c>t1.d),b)<= -11) then t1.a when not exists(select 1 from t1 where not (t1.d=e) or t1.f between t1.a and -e and (t1.c)=f and a not in (t1.c,a,c)) then t1.a else t1.a end)/abs( -13))+e-d FROM t1 WHERE NOT (17 not in (13,19,t1.c))} -} {} -do_test randexpr-2.1258 { - db eval {SELECT ~ -coalesce((select c from t1 where (case when b<= -e*t1.f then +coalesce((select case when (select count(*) from t1)=e then t1.f | c else f end from t1 where e>=(select ~case count(*) when -abs(max(11)-count(distinct -t1.d)) then count(distinct e) else max(f) end*count(*) from t1)),13) else 19 end>=t1.e)),case when t1.c=(select ~case count(*) when -abs(max(11)-count(distinct -t1.d)) then count(distinct e) else max(f) end*count(*) from t1)),13) else 19 end>=t1.e)),case when t1.c=(select ~case count(*) when -abs(max(11)-count(distinct -t1.d)) then count(distinct e) else max(f) end*count(*) from t1)),13) else 19 end>=t1.e)),case when t1.ct1.e | case when exists(select 1 from t1 where not ~+11<=coalesce((select max(a) from t1 where ~17*case when a=+(select cast(avg(t1.a*e) AS integer) from t1) then t1.e when c<11 then b else f end+c not between t1.e and -17), -t1.c)) then e+c when not exists(select 1 from t1 where t1.c not between 13 and -f) then 17 else -t1.d end or (f)<=c} -} {300} -do_test randexpr-2.1262 { - db eval {SELECT case t1.b when coalesce((select t1.b from t1 where not exists(select 1 from t1 where +case ( -case f when 13 then (abs(t1.b+f)/abs(c)) else t1.d end) when f*t1.f+t1.d then e else coalesce((select coalesce((select max(b) from t1 where t1.a<=t1.a or t1.d+f<=19 or t1.b in (select (11) from t1 union select (19) from t1)),t1.d) from t1 where not exists(select 1 from t1 where 17=b)),c)+e end between t1.c and b)),d) then c else t1.d end FROM t1 WHERE NOT (b>t1.e | case when exists(select 1 from t1 where not ~+11<=coalesce((select max(a) from t1 where ~17*case when a=+(select cast(avg(t1.a*e) AS integer) from t1) then t1.e when c<11 then b else f end+c not between t1.e and -17), -t1.c)) then e+c when not exists(select 1 from t1 where t1.c not between 13 and -f) then 17 else -t1.d end or (f)<=c)} -} {} -do_test randexpr-2.1263 { - db eval {SELECT case when case when case when exists(select 1 from t1 where exists(select 1 from t1 where t1.a+t1.a | case when t1.b between f and 19 and t1.c=t1.e then t1.e else 19 end | a FROM t1 WHERE t1.b not in ((a),t1.d,b)} -} {} -do_test randexpr-2.1264 { - db eval {SELECT case when case when case when exists(select 1 from t1 where exists(select 1 from t1 where t1.a+t1.a | case when t1.b between f and 19 and t1.c=t1.e then t1.e else 19 end | a FROM t1 WHERE NOT (t1.b not in ((a),t1.d,b))} -} {500} -do_test randexpr-2.1265 { - db eval {SELECT case when case when case when exists(select 1 from t1 where exists(select 1 from t1 where t1.a+t1.a & case when t1.b between f and 19 and t1.c=t1.e then t1.e else 19 end & a FROM t1 WHERE NOT (t1.b not in ((a),t1.d,b))} -} {100} -do_test randexpr-2.1266 { - db eval {SELECT case when exists(select 1 from t1 where a between 13+t1.e and t1.e and (abs((abs(case when not 19 between t1.e and b and not exists(select 1 from t1 where (abs(17)/abs(f-c)) not between (d) and t1.e) then t1.e else 19 end)/abs(11)))/abs(19))=f) or t1.e<= -a then t1.b when exists(select 1 from t1 where t1.d>t1.c) and t1.b<19 then a else 11 end*d FROM t1 WHERE exists(select 1 from t1 where t1.e<>(select count(distinct ((coalesce((select coalesce((select max( -coalesce((select max( -e) from t1 where ((abs(t1.a)/abs(d)) in (select ~~count(*) from t1 union select count(*) from t1) or a in (d,t1.f,d) and -c in (b,e,t1.d))),t1.c)-19 | 11-t1.e) from t1 where exists(select 1 from t1 where a<=e) and f not in (17,t1.b,t1.c) or (t1.a)>=t1.d),e)-t1.c from t1 where bt1.c) and t1.b<19 then a else 11 end*d FROM t1 WHERE NOT (exists(select 1 from t1 where t1.e<>(select count(distinct ((coalesce((select coalesce((select max( -coalesce((select max( -e) from t1 where ((abs(t1.a)/abs(d)) in (select ~~count(*) from t1 union select count(*) from t1) or a in (d,t1.f,d) and -c in (b,e,t1.d))),t1.c)-19 | 11-t1.e) from t1 where exists(select 1 from t1 where a<=e) and f not in (17,t1.b,t1.c) or (t1.a)>=t1.d),e)-t1.c from t1 where b=t1.f) or 11+t1.a between (select -cast(avg( -t1.b | 19) AS integer)+case min(t1.d) when -max(t1.e) then -count(distinct 11) else - -max((t1.c)) end from t1) and f),(e)),13) then t1.a else d end* -t1.f,13)),d)>=e then 17 else -11 end FROM t1 WHERE t1.d*b<=+~t1.c-t1.d+d*~b | e} -} {} -do_test randexpr-2.1272 { - db eval {SELECT case when coalesce((select b from t1 where t1.d not in (t1.c,case when t1.d not in (d,coalesce((select (select count(distinct d) from t1)*e from t1 where not exists(select 1 from t1 where t1.d>=t1.f) or 11+t1.a between (select -cast(avg( -t1.b | 19) AS integer)+case min(t1.d) when -max(t1.e) then -count(distinct 11) else - -max((t1.c)) end from t1) and f),(e)),13) then t1.a else d end* -t1.f,13)),d)>=e then 17 else -11 end FROM t1 WHERE NOT (t1.d*b<=+~t1.c-t1.d+d*~b | e)} -} {-11} -do_test randexpr-2.1273 { - db eval {SELECT case when coalesce((select b from t1 where t1.d not in (t1.c,case when t1.d not in (d,coalesce((select (select count(distinct d) from t1)*e from t1 where not exists(select 1 from t1 where t1.d>=t1.f) or 11+t1.a between (select -cast(avg( -t1.b & 19) AS integer)+case min(t1.d) when -max(t1.e) then -count(distinct 11) else - -max((t1.c)) end from t1) and f),(e)),13) then t1.a else d end* -t1.f,13)),d)>=e then 17 else -11 end FROM t1 WHERE NOT (t1.d*b<=+~t1.c-t1.d+d*~b | e)} -} {-11} -do_test randexpr-2.1274 { - db eval {SELECT t1.a*a+11-case when exists(select 1 from t1 where (t1.d)b) and (19 not in ((t1.a),11,a)) then ~t1.b when t1.c -coalesce((select (select max(e) | min(coalesce((select coalesce((select t1.d from t1 where ab) and (19 not in ((t1.a),11,a)) then ~t1.b when t1.c -coalesce((select (select max(e) | min(coalesce((select coalesce((select t1.d from t1 where ac then 19 else b end- -11 in (select case case count(distinct t1.f) | (max(17)) when (count(*)) then count(distinct b) else count(distinct 19) end when min(t1.f) then (count(distinct t1.f)) else count(*) end-min(13) from t1 union select cast(avg( -t1.c) AS integer) from t1) or f<>t1.a then coalesce((select max(t1.b) from t1 where exists(select 1 from t1 where t1.e>=t1.e)), -t1.a) when exists(select 1 from t1 where 17 between t1.f and t1.d) then t1.c else c end FROM t1 WHERE t1.b=t1.b} -} {200} -do_test randexpr-2.1277 { - db eval {SELECT case when case when case (abs(t1.b)/abs(t1.a)) when e then f else t1.a end>c then 19 else b end- -11 in (select case case count(distinct t1.f) | (max(17)) when (count(*)) then count(distinct b) else count(distinct 19) end when min(t1.f) then (count(distinct t1.f)) else count(*) end-min(13) from t1 union select cast(avg( -t1.c) AS integer) from t1) or f<>t1.a then coalesce((select max(t1.b) from t1 where exists(select 1 from t1 where t1.e>=t1.e)), -t1.a) when exists(select 1 from t1 where 17 between t1.f and t1.d) then t1.c else c end FROM t1 WHERE NOT (t1.b=t1.b)} -} {} -do_test randexpr-2.1278 { - db eval {SELECT case when case when case (abs(t1.b)/abs(t1.a)) when e then f else t1.a end>c then 19 else b end- -11 in (select case case count(distinct t1.f) & (max(17)) when (count(*)) then count(distinct b) else count(distinct 19) end when min(t1.f) then (count(distinct t1.f)) else count(*) end-min(13) from t1 union select cast(avg( -t1.c) AS integer) from t1) or f<>t1.a then coalesce((select max(t1.b) from t1 where exists(select 1 from t1 where t1.e>=t1.e)), -t1.a) when exists(select 1 from t1 where 17 between t1.f and t1.d) then t1.c else c end FROM t1 WHERE t1.b=t1.b} -} {200} -do_test randexpr-2.1279 { - db eval {SELECT (abs(b)/abs(case 19 when case e+13*~t1.c*11 when case when (select ~min(t1.a) from t1)>t1.c then (case when 11 between (a) and (19) then d else d+t1.c end) else f end then (abs((e+t1.d)*e*19-t1.d)/abs(c)) else t1.b end then 11 else ( -t1.b) end*13)) FROM t1 WHERE case when ((select min( -case when b in (d-t1.e,case when e in (select d from t1 union select 17 from t1) then 11 else c end,( -t1.d)) then t1.b when b>e then c else -t1.f end)+ -((min(t1.f)))-+min(f) | ( -(cast(avg(a) AS integer))) from t1)) in (select 11 from t1 union select 19 from t1) then 19 when not exists(select 1 from t1 where -17>t1.f and t1.e in (select t1.e from t1 union select d from t1)) then 11 else d end=t1.d} -} {} -do_test randexpr-2.1280 { - db eval {SELECT (abs(b)/abs(case 19 when case e+13*~t1.c*11 when case when (select ~min(t1.a) from t1)>t1.c then (case when 11 between (a) and (19) then d else d+t1.c end) else f end then (abs((e+t1.d)*e*19-t1.d)/abs(c)) else t1.b end then 11 else ( -t1.b) end*13)) FROM t1 WHERE NOT (case when ((select min( -case when b in (d-t1.e,case when e in (select d from t1 union select 17 from t1) then 11 else c end,( -t1.d)) then t1.b when b>e then c else -t1.f end)+ -((min(t1.f)))-+min(f) | ( -(cast(avg(a) AS integer))) from t1)) in (select 11 from t1 union select 19 from t1) then 19 when not exists(select 1 from t1 where -17>t1.f and t1.e in (select t1.e from t1 union select d from t1)) then 11 else d end=t1.d)} -} {0} -do_test randexpr-2.1281 { - db eval {SELECT coalesce((select max(11) from t1 where not not exists(select 1 from t1 where ((abs(b)/abs(t1.f))-19+f-case ~11 when 19 then c else t1.a end)> -c+t1.a)),(11))- -b FROM t1 WHERE b*case when 19 not in (t1.e,a*+t1.d,(abs(+c)/abs(case 11 when b then +case when (not exists(select 1 from t1 where d<=c or c -c+t1.a)),(11))- -b FROM t1 WHERE NOT (b*case when 19 not in (t1.e,a*+t1.d,(abs(+c)/abs(case 11 when b then +case when (not exists(select 1 from t1 where d<=c or c=11*t1.d} -} {} -do_test randexpr-2.1287 { - db eval {SELECT case coalesce((select t1.e from t1 where 19 in (select 13 from t1 union select 11 | coalesce((select -(t1.c) from t1 where t1.a<=t1.c),case when ~case when t1.e not between 11 and t1.e then d else 19 end+t1.a+f in (select -(count(distinct -c))-max(d)+count(distinct t1.d) from t1 union select cast(avg((b)) AS integer) from t1) then (t1.d) when not (t1.a not in ( -t1.e,t1.b,17) and 11=11*t1.d)} -} {-100} -do_test randexpr-2.1288 { - db eval {SELECT case coalesce((select t1.e from t1 where 19 in (select 13 from t1 union select 11 & coalesce((select -(t1.c) from t1 where t1.a<=t1.c),case when ~case when t1.e not between 11 and t1.e then d else 19 end+t1.a+f in (select -(count(distinct -c))-max(d)+count(distinct t1.d) from t1 union select cast(avg((b)) AS integer) from t1) then (t1.d) when not (t1.a not in ( -t1.e,t1.b,17) and 11=11*t1.d)} -} {-100} -do_test randexpr-2.1289 { - db eval {SELECT (select min(coalesce((select max(case (b | case -e when 11 then +(abs(17)/abs((19))) else 13 end) when t1.f then 17 else a end) from t1 where 17 not between e and -a and 19=13 or t1.f=19 and t1.ct1.b} -} {149900} -do_test randexpr-2.1290 { - db eval {SELECT (select min(coalesce((select max(case (b | case -e when 11 then +(abs(17)/abs((19))) else 13 end) when t1.f then 17 else a end) from t1 where 17 not between e and -a and 19=13 or t1.f=19 and t1.ct1.b)} -} {} -do_test randexpr-2.1291 { - db eval {SELECT (select min(coalesce((select max(case (b & case -e when 11 then +(abs(17)/abs((19))) else 13 end) when t1.f then 17 else a end) from t1 where 17 not between e and -a and 19=13 or t1.f=19 and t1.ct1.b} -} {149900} -do_test randexpr-2.1292 { - db eval {SELECT t1.f*b | coalesce((select max(t1.f) from t1 where (case when (select cast(avg((select (count(distinct e+t1.c)) from t1)) AS integer) from t1)=t1.d then case when not exists(select 1 from t1 where (b)+t1.e+t1.f in (select min(e) from t1 union select case count(distinct t1.c) when count(distinct f) then cast(avg((t1.f)) AS integer) else (cast(avg(13) AS integer)) end from t1)) and not exists(select 1 from t1 where (d=b)) then t1.d when 13 in (f,c,c) then case t1.c when 11 then -a else t1.b end else 13 end else 19 end)<17),19)-t1.a FROM t1 WHERE c>=case when d=case when d=case when d=t1.a),t1.e))/abs(13)) when t1.b then b else -a end=11 then 13 else a end<>t1.f or 19 not in (b,(t1.b), -19) then b else e end<>e) then t1.f else c end | t1.a+d- -f+f FROM t1 WHERE a in (13+17,case when (t1.a>t1.e) then ~t1.c+d*case coalesce((select coalesce((select d from t1 where 11 not between t1.e and coalesce((select t1.b from t1 where -coalesce((select max(t1.b) from t1 where t1.d in (a,11,d) and b=c),c) between b and d),(t1.e))),t1.f) from t1 where t1.e=a),t1.a) when 17 then (t1.f) else t1.d end+b+c when a>=t1.d then t1.a else f end,b)} -} {} -do_test randexpr-2.1296 { - db eval {SELECT +case when b in (13,(t1.f),19+a) and not exists(select 1 from t1 where -case when case when case (abs(coalesce((select b from t1 where t1.b>=t1.a),t1.e))/abs(13)) when t1.b then b else -a end=11 then 13 else a end<>t1.f or 19 not in (b,(t1.b), -19) then b else e end<>e) then t1.f else c end | t1.a+d- -f+f FROM t1 WHERE NOT (a in (13+17,case when (t1.a>t1.e) then ~t1.c+d*case coalesce((select coalesce((select d from t1 where 11 not between t1.e and coalesce((select t1.b from t1 where -coalesce((select max(t1.b) from t1 where t1.d in (a,11,d) and b=c),c) between b and d),(t1.e))),t1.f) from t1 where t1.e=a),t1.a) when 17 then (t1.f) else t1.d end+b+c when a>=t1.d then t1.a else f end,b))} -} {1964} -do_test randexpr-2.1297 { - db eval {SELECT +case when b in (13,(t1.f),19+a) and not exists(select 1 from t1 where -case when case when case (abs(coalesce((select b from t1 where t1.b>=t1.a),t1.e))/abs(13)) when t1.b then b else -a end=11 then 13 else a end<>t1.f or 19 not in (b,(t1.b), -19) then b else e end<>e) then t1.f else c end & t1.a+d- -f+f FROM t1 WHERE NOT (a in (13+17,case when (t1.a>t1.e) then ~t1.c+d*case coalesce((select coalesce((select d from t1 where 11 not between t1.e and coalesce((select t1.b from t1 where -coalesce((select max(t1.b) from t1 where t1.d in (a,11,d) and b=c),c) between b and d),(t1.e))),t1.f) from t1 where t1.e=a),t1.a) when 17 then (t1.f) else t1.d end+b+c when a>=t1.d then t1.a else f end,b))} -} {36} -do_test randexpr-2.1298 { - db eval {SELECT coalesce((select t1.b from t1 where 17+13+t1.b in (e,19,case when 17 in (select case max(b*17-d*t1.b*t1.d)+case max((19)) when ~ -max(t1.f) then +count(*) else cast(avg(13) AS integer) end when count(distinct 11) then min(e) else max(t1.c) end from t1 union select min(d) from t1) then t1.a* -(t1.a) when t1.c=19 then (t1.c) else t1.f end) and t1.f<=13),17) FROM t1 WHERE t1.e<>~t1.b} -} {17} -do_test randexpr-2.1299 { - db eval {SELECT coalesce((select t1.b from t1 where 17+13+t1.b in (e,19,case when 17 in (select case max(b*17-d*t1.b*t1.d)+case max((19)) when ~ -max(t1.f) then +count(*) else cast(avg(13) AS integer) end when count(distinct 11) then min(e) else max(t1.c) end from t1 union select min(d) from t1) then t1.a* -(t1.a) when t1.c=19 then (t1.c) else t1.f end) and t1.f<=13),17) FROM t1 WHERE NOT (t1.e<>~t1.b)} -} {} -do_test randexpr-2.1300 { - db eval {SELECT (abs(coalesce((select -~(abs(t1.d)/abs(a)) from t1 where case when f in (select ~~(+abs( - -count(*)) | cast(avg(d) AS integer)) from t1 union select (min(f)) from t1) then (abs(t1.c)/abs( -13)) | f-13+d*17 when a in (t1.f,t1.c,11) then f else -(f) end*c not in (13,d,d) and 19 in (t1.d,t1.d,b)),13))/abs(17)) FROM t1 WHERE exists(select 1 from t1 where t1.d<>case case when not exists(select 1 from t1 where t1.b(abs(c)/abs(t1.a))) then t1.b else 17 end when +~(e- -coalesce((select e from t1 where not (b) in (select max(t1.b) from t1 union select case max(t1.e)-max(17)-count(distinct (13)) when -cast(avg( -t1.b) AS integer) then count(distinct d) else min(t1.f) end from t1)),c*d))*a*13 | f then (13) else c end)} -} {0} -do_test randexpr-2.1301 { - db eval {SELECT (abs(coalesce((select -~(abs(t1.d)/abs(a)) from t1 where case when f in (select ~~(+abs( - -count(*)) | cast(avg(d) AS integer)) from t1 union select (min(f)) from t1) then (abs(t1.c)/abs( -13)) | f-13+d*17 when a in (t1.f,t1.c,11) then f else -(f) end*c not in (13,d,d) and 19 in (t1.d,t1.d,b)),13))/abs(17)) FROM t1 WHERE NOT (exists(select 1 from t1 where t1.d<>case case when not exists(select 1 from t1 where t1.b(abs(c)/abs(t1.a))) then t1.b else 17 end when +~(e- -coalesce((select e from t1 where not (b) in (select max(t1.b) from t1 union select case max(t1.e)-max(17)-count(distinct (13)) when -cast(avg( -t1.b) AS integer) then count(distinct d) else min(t1.f) end from t1)),c*d))*a*13 | f then (13) else c end))} -} {} -do_test randexpr-2.1302 { - db eval {SELECT (abs(coalesce((select -~(abs(t1.d)/abs(a)) from t1 where case when f in (select ~~(+abs( - -count(*)) & cast(avg(d) AS integer)) from t1 union select (min(f)) from t1) then (abs(t1.c)/abs( -13)) & f-13+d*17 when a in (t1.f,t1.c,11) then f else -(f) end*c not in (13,d,d) and 19 in (t1.d,t1.d,b)),13))/abs(17)) FROM t1 WHERE exists(select 1 from t1 where t1.d<>case case when not exists(select 1 from t1 where t1.b(abs(c)/abs(t1.a))) then t1.b else 17 end when +~(e- -coalesce((select e from t1 where not (b) in (select max(t1.b) from t1 union select case max(t1.e)-max(17)-count(distinct (13)) when -cast(avg( -t1.b) AS integer) then count(distinct d) else min(t1.f) end from t1)),c*d))*a*13 | f then (13) else c end)} -} {0} -do_test randexpr-2.1303 { - db eval {SELECT t1.f*+case when ( -17-a*t1.f | case when (coalesce((select max((case a when +13*19* -b then a else 17 end)) from t1 where (t1.b) not between 13 and t1.a),e))-t1.b=t1.f then f else 17 end-b*a*d)<>11 then f else t1.c end-t1.c*e FROM t1 WHERE (select +cast(avg(case when 13*a in (select 11 from t1 union select b from t1) then e when t1.f in (select ~count(distinct f) | count(*) from t1 union select count(distinct 13*t1.a+coalesce((select max(e) from t1 where ~(abs(t1.e)/abs(a)) not in (t1.a+e-c,t1.e,case when t1.f>t1.c or f>t1.c then 13 when t1.c>c then t1.a else -t1.d end)),f)*19) from t1) then d else d end) AS integer) from t1)=d} -} {210000} -do_test randexpr-2.1304 { - db eval {SELECT t1.f*+case when ( -17-a*t1.f | case when (coalesce((select max((case a when +13*19* -b then a else 17 end)) from t1 where (t1.b) not between 13 and t1.a),e))-t1.b=t1.f then f else 17 end-b*a*d)<>11 then f else t1.c end-t1.c*e FROM t1 WHERE NOT ((select +cast(avg(case when 13*a in (select 11 from t1 union select b from t1) then e when t1.f in (select ~count(distinct f) | count(*) from t1 union select count(distinct 13*t1.a+coalesce((select max(e) from t1 where ~(abs(t1.e)/abs(a)) not in (t1.a+e-c,t1.e,case when t1.f>t1.c or f>t1.c then 13 when t1.c>c then t1.a else -t1.d end)),f)*19) from t1) then d else d end) AS integer) from t1)=d)} -} {} -do_test randexpr-2.1305 { - db eval {SELECT t1.f*+case when ( -17-a*t1.f & case when (coalesce((select max((case a when +13*19* -b then a else 17 end)) from t1 where (t1.b) not between 13 and t1.a),e))-t1.b=t1.f then f else 17 end-b*a*d)<>11 then f else t1.c end-t1.c*e FROM t1 WHERE (select +cast(avg(case when 13*a in (select 11 from t1 union select b from t1) then e when t1.f in (select ~count(distinct f) | count(*) from t1 union select count(distinct 13*t1.a+coalesce((select max(e) from t1 where ~(abs(t1.e)/abs(a)) not in (t1.a+e-c,t1.e,case when t1.f>t1.c or f>t1.c then 13 when t1.c>c then t1.a else -t1.d end)),f)*19) from t1) then d else d end) AS integer) from t1)=d} -} {210000} -do_test randexpr-2.1306 { - db eval {SELECT t1.c+case when t1.a in (select max(coalesce((select coalesce((select coalesce((select max(19+case t1.f when a then e else t1.d end) from t1 where t1.d> -c),b) from t1 where (t1.c=e) and t1.f=17), -a) from t1 where (e not between e and 11)),t1.f)) | cast(avg(t1.a) AS integer)*max(t1.c) from t1 union select count(distinct c)-max(a) | min(t1.b) | (count(*))* -min(f) from t1) then t1.a when exists(select 1 from t1 where not exists(select 1 from t1 where -17>11)) then (13) else 13 end FROM t1 WHERE 19=case when exists(select 1 from t1 where t1.f not between 11 and ~c+b-t1.c*case when t1.f<13+(t1.d) and -t1.f<17 or (b<>b) then ~d else t1.b end) or exists(select 1 from t1 where not exists(select 1 from t1 where t1.e=19)) then c+f*17 else t1.a end and t1.e<13} -} {} -do_test randexpr-2.1307 { - db eval {SELECT t1.c+case when t1.a in (select max(coalesce((select coalesce((select coalesce((select max(19+case t1.f when a then e else t1.d end) from t1 where t1.d> -c),b) from t1 where (t1.c=e) and t1.f=17), -a) from t1 where (e not between e and 11)),t1.f)) | cast(avg(t1.a) AS integer)*max(t1.c) from t1 union select count(distinct c)-max(a) | min(t1.b) | (count(*))* -min(f) from t1) then t1.a when exists(select 1 from t1 where not exists(select 1 from t1 where -17>11)) then (13) else 13 end FROM t1 WHERE NOT (19=case when exists(select 1 from t1 where t1.f not between 11 and ~c+b-t1.c*case when t1.f<13+(t1.d) and -t1.f<17 or (b<>b) then ~d else t1.b end) or exists(select 1 from t1 where not exists(select 1 from t1 where t1.e=19)) then c+f*17 else t1.a end and t1.e<13)} -} {313} -do_test randexpr-2.1308 { - db eval {SELECT t1.c+case when t1.a in (select max(coalesce((select coalesce((select coalesce((select max(19+case t1.f when a then e else t1.d end) from t1 where t1.d> -c),b) from t1 where (t1.c=e) and t1.f=17), -a) from t1 where (e not between e and 11)),t1.f)) & cast(avg(t1.a) AS integer)*max(t1.c) from t1 union select count(distinct c)-max(a) & min(t1.b) & (count(*))* -min(f) from t1) then t1.a when exists(select 1 from t1 where not exists(select 1 from t1 where -17>11)) then (13) else 13 end FROM t1 WHERE NOT (19=case when exists(select 1 from t1 where t1.f not between 11 and ~c+b-t1.c*case when t1.f<13+(t1.d) and -t1.f<17 or (b<>b) then ~d else t1.b end) or exists(select 1 from t1 where not exists(select 1 from t1 where t1.e=19)) then c+f*17 else t1.a end and t1.e<13)} -} {313} -do_test randexpr-2.1309 { - db eval {SELECT 13-case when exists(select 1 from t1 where f+b>t1.f+t1.c) or +17 | -coalesce((select case coalesce((select 13-(select (cast(avg(13) AS integer))-max(t1.b) from t1) from t1 where -c in (select max(17) from t1 union select max(t1.b) from t1)),t1.a) when t1.d then 19 else d end from t1 where d>=11),b) between 13 and 11 and 17<=13 then a | t1.c+t1.f else c end FROM t1 WHERE (case when a not in (t1.d+t1.f,b,t1.b) then case when case f | t1.c when t1.e then e else (t1.a)-d | 13 end<>f then t1.e when (((13) in (select min(t1.a) from t1 union select max( -e) from t1) or t1.f between 13 and -t1.b or (f>=f) or 19t1.f+t1.c) or +17 | -coalesce((select case coalesce((select 13-(select (cast(avg(13) AS integer))-max(t1.b) from t1) from t1 where -c in (select max(17) from t1 union select max(t1.b) from t1)),t1.a) when t1.d then 19 else d end from t1 where d>=11),b) between 13 and 11 and 17<=13 then a | t1.c+t1.f else c end FROM t1 WHERE NOT ((case when a not in (t1.d+t1.f,b,t1.b) then case when case f | t1.c when t1.e then e else (t1.a)-d | 13 end<>f then t1.e when (((13) in (select min(t1.a) from t1 union select max( -e) from t1) or t1.f between 13 and -t1.b or (f>=f) or 19t1.f+t1.c) or +17 & -coalesce((select case coalesce((select 13-(select (cast(avg(13) AS integer))-max(t1.b) from t1) from t1 where -c in (select max(17) from t1 union select max(t1.b) from t1)),t1.a) when t1.d then 19 else d end from t1 where d>=11),b) between 13 and 11 and 17<=13 then a & t1.c+t1.f else c end FROM t1 WHERE NOT ((case when a not in (t1.d+t1.f,b,t1.b) then case when case f | t1.c when t1.e then e else (t1.a)-d | 13 end<>f then t1.e when (((13) in (select min(t1.a) from t1 union select max( -e) from t1) or t1.f between 13 and -t1.b or (f>=f) or 19t1.e or f between b and 13 then t1.c else c end | -b from t1 where 17<=17),t1.e) from t1 where 11=d) and t1.e>17))) then t1.a | (select ~ - -cast(avg( -c) AS integer) from t1) else c end FROM t1 WHERE t1.f>=e and t1.f in (select 17 from t1 union select case when (not exists(select 1 from t1 where case when coalesce((select max(19+t1.c) from t1 where 17>=t1.f),c)+19+t1.c< -d then t1.d when t1.c not in (c,t1.f,e) then 17 else t1.d end11 then d else 13 end from t1)} -} {} -do_test randexpr-2.1313 { - db eval {SELECT a+case when ((~t1.d*13<=e or (coalesce((select coalesce((select case when -t1.e<>t1.e or f between b and 13 then t1.c else c end | -b from t1 where 17<=17),t1.e) from t1 where 11=d) and t1.e>17))) then t1.a | (select ~ - -cast(avg( -c) AS integer) from t1) else c end FROM t1 WHERE NOT (t1.f>=e and t1.f in (select 17 from t1 union select case when (not exists(select 1 from t1 where case when coalesce((select max(19+t1.c) from t1 where 17>=t1.f),c)+19+t1.c< -d then t1.d when t1.c not in (c,t1.f,e) then 17 else t1.d end11 then d else 13 end from t1))} -} {467} -do_test randexpr-2.1314 { - db eval {SELECT a+case when ((~t1.d*13<=e or (coalesce((select coalesce((select case when -t1.e<>t1.e or f between b and 13 then t1.c else c end & -b from t1 where 17<=17),t1.e) from t1 where 11=d) and t1.e>17))) then t1.a & (select ~ - -cast(avg( -c) AS integer) from t1) else c end FROM t1 WHERE NOT (t1.f>=e and t1.f in (select 17 from t1 union select case when (not exists(select 1 from t1 where case when coalesce((select max(19+t1.c) from t1 where 17>=t1.f),c)+19+t1.c< -d then t1.d when t1.c not in (c,t1.f,e) then 17 else t1.d end11 then d else 13 end from t1))} -} {132} -do_test randexpr-2.1315 { - db eval {SELECT case when t1.b not in (17 | t1.e*t1.a,11,(select +case max((select -+case (max(t1.f)) when count(*) then count(distinct d) else -( -(cast(avg(f) AS integer))) end-count(distinct t1.a) from t1)) | count(distinct (t1.e)) when -min(c) then count(*) else -count(distinct e) end | cast(avg(17) AS integer) from t1)) then case when d<=t1.c and (exists(select 1 from t1 where (select count(distinct (e)) from t1)=(abs(17)/abs(d)))) then (abs(t1.f)/abs(t1.c)) when t1.f<>e or t1.c<=d and t1.e<=t1.d then 19 else - -d end-t1.e else (t1.f) end FROM t1 WHERE not t1.b=coalesce((select (abs(c)/abs(11)) from t1 where exists(select 1 from t1 where -coalesce((select max(((abs(coalesce((select max(case (select min((abs(19)/abs(19))+19)*count(*)- -cast(avg(t1.d) AS integer)-max(17)+min( -11) from t1) when e then t1.e else f end) from t1 where t1.d<=t1.f), -f)- -t1.e)/abs(d))-t1.b)) from t1 where c<11),t1.b)*a not in (d,d,f))),c)} -} {-481} -do_test randexpr-2.1316 { - db eval {SELECT case when t1.b not in (17 | t1.e*t1.a,11,(select +case max((select -+case (max(t1.f)) when count(*) then count(distinct d) else -( -(cast(avg(f) AS integer))) end-count(distinct t1.a) from t1)) | count(distinct (t1.e)) when -min(c) then count(*) else -count(distinct e) end | cast(avg(17) AS integer) from t1)) then case when d<=t1.c and (exists(select 1 from t1 where (select count(distinct (e)) from t1)=(abs(17)/abs(d)))) then (abs(t1.f)/abs(t1.c)) when t1.f<>e or t1.c<=d and t1.e<=t1.d then 19 else - -d end-t1.e else (t1.f) end FROM t1 WHERE NOT (not t1.b=coalesce((select (abs(c)/abs(11)) from t1 where exists(select 1 from t1 where -coalesce((select max(((abs(coalesce((select max(case (select min((abs(19)/abs(19))+19)*count(*)- -cast(avg(t1.d) AS integer)-max(17)+min( -11) from t1) when e then t1.e else f end) from t1 where t1.d<=t1.f), -f)- -t1.e)/abs(d))-t1.b)) from t1 where c<11),t1.b)*a not in (d,d,f))),c))} -} {} -do_test randexpr-2.1317 { - db eval {SELECT case when t1.b not in (17 & t1.e*t1.a,11,(select +case max((select -+case (max(t1.f)) when count(*) then count(distinct d) else -( -(cast(avg(f) AS integer))) end-count(distinct t1.a) from t1)) & count(distinct (t1.e)) when -min(c) then count(*) else -count(distinct e) end & cast(avg(17) AS integer) from t1)) then case when d<=t1.c and (exists(select 1 from t1 where (select count(distinct (e)) from t1)=(abs(17)/abs(d)))) then (abs(t1.f)/abs(t1.c)) when t1.f<>e or t1.c<=d and t1.e<=t1.d then 19 else - -d end-t1.e else (t1.f) end FROM t1 WHERE not t1.b=coalesce((select (abs(c)/abs(11)) from t1 where exists(select 1 from t1 where -coalesce((select max(((abs(coalesce((select max(case (select min((abs(19)/abs(19))+19)*count(*)- -cast(avg(t1.d) AS integer)-max(17)+min( -11) from t1) when e then t1.e else f end) from t1 where t1.d<=t1.f), -f)- -t1.e)/abs(d))-t1.b)) from t1 where c<11),t1.b)*a not in (d,d,f))),c)} -} {-481} -do_test randexpr-2.1318 { - db eval {SELECT -t1.a*(select (cast(avg((select count(*)-abs(count(*)*count(*)) from t1)) AS integer)++max(t1.d))*cast(avg(t1.a) AS integer) from t1)+t1.c+t1.c+d-e | 11+t1.b-coalesce((select max(case when exists(select 1 from t1 where t1.a+11=t1.b) then c when t1.a not between t1.f and t1.d or 13<11 then -b else 19 end) from t1 where c>=t1.f),t1.f) FROM t1 WHERE exists(select 1 from t1 where (f=(d)*e))} -} {} -do_test randexpr-2.1319 { - db eval {SELECT -t1.a*(select (cast(avg((select count(*)-abs(count(*)*count(*)) from t1)) AS integer)++max(t1.d))*cast(avg(t1.a) AS integer) from t1)+t1.c+t1.c+d-e | 11+t1.b-coalesce((select max(case when exists(select 1 from t1 where t1.a+11=t1.b) then c when t1.a not between t1.f and t1.d or 13<11 then -b else 19 end) from t1 where c>=t1.f),t1.f) FROM t1 WHERE NOT (exists(select 1 from t1 where (f=(d)*e)))} -} {-257} -do_test randexpr-2.1320 { - db eval {SELECT -t1.a*(select (cast(avg((select count(*)-abs(count(*)*count(*)) from t1)) AS integer)++max(t1.d))*cast(avg(t1.a) AS integer) from t1)+t1.c+t1.c+d-e & 11+t1.b-coalesce((select max(case when exists(select 1 from t1 where t1.a+11=t1.b) then c when t1.a not between t1.f and t1.d or 13<11 then -b else 19 end) from t1 where c>=t1.f),t1.f) FROM t1 WHERE NOT (exists(select 1 from t1 where (f=(d)*e)))} -} {-3999632} -do_test randexpr-2.1321 { - db eval {SELECT -case when t1.a+ -c+coalesce((select d from t1 where (t1.d between a and case when t1.c*t1.b*a between a and 13 then t1.d else 11 end) or not t1.e in (select max(d) from t1 union select max(t1.e)-( -count(distinct t1.e)) from t1) or t1.c>=t1.b or a not in (c,t1.f,t1.d) and b<=t1.c),13)+d-(17) | t1.c*17<=t1.a then t1.c else d end FROM t1 WHERE case a when e then f else case when -t1.c not between e*f | b and t1.d then case (select max((b)) from t1)+coalesce((select max(case when 19 in (b,e,17) then 13 when 11 in (t1.a,t1.a,t1.a) then t1.e else 19 end) from t1 where a<=e and 13 between t1.e and -t1.f),13) when 17 then a else t1.d end when e in (select f from t1 union select -t1.d from t1) then t1.a else c end*d end-13*a not in (19,t1.d,19)} -} {-400} -do_test randexpr-2.1322 { - db eval {SELECT -case when t1.a+ -c+coalesce((select d from t1 where (t1.d between a and case when t1.c*t1.b*a between a and 13 then t1.d else 11 end) or not t1.e in (select max(d) from t1 union select max(t1.e)-( -count(distinct t1.e)) from t1) or t1.c>=t1.b or a not in (c,t1.f,t1.d) and b<=t1.c),13)+d-(17) | t1.c*17<=t1.a then t1.c else d end FROM t1 WHERE NOT (case a when e then f else case when -t1.c not between e*f | b and t1.d then case (select max((b)) from t1)+coalesce((select max(case when 19 in (b,e,17) then 13 when 11 in (t1.a,t1.a,t1.a) then t1.e else 19 end) from t1 where a<=e and 13 between t1.e and -t1.f),13) when 17 then a else t1.d end when e in (select f from t1 union select -t1.d from t1) then t1.a else c end*d end-13*a not in (19,t1.d,19))} -} {} -do_test randexpr-2.1323 { - db eval {SELECT -case when t1.a+ -c+coalesce((select d from t1 where (t1.d between a and case when t1.c*t1.b*a between a and 13 then t1.d else 11 end) or not t1.e in (select max(d) from t1 union select max(t1.e)-( -count(distinct t1.e)) from t1) or t1.c>=t1.b or a not in (c,t1.f,t1.d) and b<=t1.c),13)+d-(17) & t1.c*17<=t1.a then t1.c else d end FROM t1 WHERE case a when e then f else case when -t1.c not between e*f | b and t1.d then case (select max((b)) from t1)+coalesce((select max(case when 19 in (b,e,17) then 13 when 11 in (t1.a,t1.a,t1.a) then t1.e else 19 end) from t1 where a<=e and 13 between t1.e and -t1.f),13) when 17 then a else t1.d end when e in (select f from t1 union select -t1.d from t1) then t1.a else c end*d end-13*a not in (19,t1.d,19)} -} {-400} -do_test randexpr-2.1324 { - db eval {SELECT coalesce((select (abs(t1.a)/abs(13)) from t1 where a<>(select max(b)-abs(+min(f+13*17+~coalesce((select case when 11-t1.c<>19 then t1.c when (c) not between t1.e and d and 11 in (t1.f,13,((c))) then 19 else 11 end from t1 where ( -d)f),11)+c-t1.c)) | - - -+max(19) from t1)-f),b) FROM t1 WHERE t1.b-t1.a+case ((t1.a)) when t1.f then (abs(e*e-(e)*c)/abs(t1.f)) else (abs(t1.a)/abs(t1.b)) end between f and (select case cast(avg(13) AS integer) when (count(*)) then (~abs( -case count(*) when abs((count(*))) then count(distinct 13) else count(*) end)-(count(distinct 11)))-count(distinct 19)*((max(t1.c)))-cast(avg(11) AS integer) else (max(19)) end from t1)} -} {} -do_test randexpr-2.1325 { - db eval {SELECT coalesce((select (abs(t1.a)/abs(13)) from t1 where a<>(select max(b)-abs(+min(f+13*17+~coalesce((select case when 11-t1.c<>19 then t1.c when (c) not between t1.e and d and 11 in (t1.f,13,((c))) then 19 else 11 end from t1 where ( -d)f),11)+c-t1.c)) | - - -+max(19) from t1)-f),b) FROM t1 WHERE NOT (t1.b-t1.a+case ((t1.a)) when t1.f then (abs(e*e-(e)*c)/abs(t1.f)) else (abs(t1.a)/abs(t1.b)) end between f and (select case cast(avg(13) AS integer) when (count(*)) then (~abs( -case count(*) when abs((count(*))) then count(distinct 13) else count(*) end)-(count(distinct 11)))-count(distinct 19)*((max(t1.c)))-cast(avg(11) AS integer) else (max(19)) end from t1))} -} {7} -do_test randexpr-2.1326 { - db eval {SELECT coalesce((select (abs(t1.a)/abs(13)) from t1 where a<>(select max(b)-abs(+min(f+13*17+~coalesce((select case when 11-t1.c<>19 then t1.c when (c) not between t1.e and d and 11 in (t1.f,13,((c))) then 19 else 11 end from t1 where ( -d)f),11)+c-t1.c)) & - - -+max(19) from t1)-f),b) FROM t1 WHERE NOT (t1.b-t1.a+case ((t1.a)) when t1.f then (abs(e*e-(e)*c)/abs(t1.f)) else (abs(t1.a)/abs(t1.b)) end between f and (select case cast(avg(13) AS integer) when (count(*)) then (~abs( -case count(*) when abs((count(*))) then count(distinct 13) else count(*) end)-(count(distinct 11)))-count(distinct 19)*((max(t1.c)))-cast(avg(11) AS integer) else (max(19)) end from t1))} -} {7} -do_test randexpr-2.1327 { - db eval {SELECT t1.d*coalesce((select d from t1 where coalesce((select max(t1.c) from t1 where 11<>13),e)<=(select ~min(13) from t1)*t1.a),c)-coalesce((select (t1.b+17) | (abs( -~17)/abs(t1.d)) from t1 where not exists(select 1 from t1 where case t1.d when case when t1.f not in (t1.e,e,17) then f when t1.c not between 11 and -t1.a then b else 17 end+13 then t1.f else t1.b end+13+t1.b between 17 and 13)),t1.b)+t1.a FROM t1 WHERE (not d in (t1.d,(select max(e) from t1),case d*case when not exists(select 1 from t1 where not exists(select 1 from t1 where coalesce((select max(t1.c) from t1 where t1.b<=11-d+(select -max(13-t1.f) from t1)*t1.a),19)>t1.c) and c not between d and 19) then 11+~ -t1.a when t1.e13),e)<=(select ~min(13) from t1)*t1.a),c)-coalesce((select (t1.b+17) | (abs( -~17)/abs(t1.d)) from t1 where not exists(select 1 from t1 where case t1.d when case when t1.f not in (t1.e,e,17) then f when t1.c not between 11 and -t1.a then b else 17 end+13 then t1.f else t1.b end+13+t1.b between 17 and 13)),t1.b)+t1.a FROM t1 WHERE NOT ((not d in (t1.d,(select max(e) from t1),case d*case when not exists(select 1 from t1 where not exists(select 1 from t1 where coalesce((select max(t1.c) from t1 where t1.b<=11-d+(select -max(13-t1.f) from t1)*t1.a),19)>t1.c) and c not between d and 19) then 11+~ -t1.a when t1.e13),e)<=(select ~min(13) from t1)*t1.a),c)-coalesce((select (t1.b+17) & (abs( -~17)/abs(t1.d)) from t1 where not exists(select 1 from t1 where case t1.d when case when t1.f not in (t1.e,e,17) then f when t1.c not between 11 and -t1.a then b else 17 end+13 then t1.f else t1.b end+13+t1.b between 17 and 13)),t1.b)+t1.a FROM t1 WHERE NOT ((not d in (t1.d,(select max(e) from t1),case d*case when not exists(select 1 from t1 where not exists(select 1 from t1 where coalesce((select max(t1.c) from t1 where t1.b<=11-d+(select -max(13-t1.f) from t1)*t1.a),19)>t1.c) and c not between d and 19) then 11+~ -t1.a when t1.e=f then t1.b else t1.a end*a+19-13 FROM t1 WHERE not exists(select 1 from t1 where exists(select 1 from t1 where (select min(case when 13 not in (19,e-t1.a*17,17- -case 19 when 17+17 then a else t1.d end+f-t1.a*11) then 17 else t1.b end*17+11-b) from t1) between 11 and f or t1.e<>t1.d)) or c not in (t1.c,17,d)} -} {} -do_test randexpr-2.1331 { - db eval {SELECT d+~e-case when exists(select 1 from t1 where -a in (select max( -(select -count(*)-min(e)++cast(avg(case when d in (select +max(c) from t1 union select ((count(distinct (e)))) from t1) then (c) when t1.c=f then t1.b else t1.a end*a+19-13 FROM t1 WHERE NOT (not exists(select 1 from t1 where exists(select 1 from t1 where (select min(case when 13 not in (19,e-t1.a*17,17- -case 19 when 17+17 then a else t1.d end+f-t1.a*11) then 17 else t1.b end*17+11-b) from t1) between 11 and f or t1.e<>t1.d)) or c not in (t1.c,17,d))} -} {-20095} -do_test randexpr-2.1332 { - db eval {SELECT case coalesce((select 11*19*t1.a+(abs(t1.e*(select count(distinct -d) from t1)*case t1.f when +c then d else c end+b)/abs(d)) from t1 where t1.b*13=(e)),13) when (t1.d)*b-19*(e)*e-19+(t1.d) then 13 else b end*a FROM t1 WHERE not d=19 and (abs(t1.c)/abs(17))-ab))) then case when 13 not between t1.e and t1.a then c when t1.c>t1.c then 13 else a end | 19 else (19) end*f*13) from t1 where 17=t1.d and (b<>11)),t1.b)+t1.a | d} -} {20000} -do_test randexpr-2.1333 { - db eval {SELECT case coalesce((select 11*19*t1.a+(abs(t1.e*(select count(distinct -d) from t1)*case t1.f when +c then d else c end+b)/abs(d)) from t1 where t1.b*13=(e)),13) when (t1.d)*b-19*(e)*e-19+(t1.d) then 13 else b end*a FROM t1 WHERE NOT (not d=19 and (abs(t1.c)/abs(17))-ab))) then case when 13 not between t1.e and t1.a then c when t1.c>t1.c then 13 else a end | 19 else (19) end*f*13) from t1 where 17=t1.d and (b<>11)),t1.b)+t1.a | d)} -} {} -do_test randexpr-2.1334 { - db eval {SELECT (c*(abs(coalesce((select t1.b from t1 where (select ~~count(*)+ -count(distinct coalesce((select max(case coalesce((select max(a+(t1.e)) from t1 where -(a)>=t1.e or t1.e<17),c) when t1.d then t1.a else 17 end) from t1 where t1.b not in (e,(c),t1.a)),f)) from t1) between t1.a and b),case when exists(select 1 from t1 where t1.c>=t1.a) then 19 else t1.e end+t1.c))/abs(b))-11 | 19) FROM t1 WHERE not t1.e<=d or not exists(select 1 from t1 where exists(select 1 from t1 where ( -t1.c+d)>t1.a+case when f | -b not between 17 and e then -t1.d else (19) end) or 11 not between 17 and t1.f) or a in (select -cast(avg(13) AS integer)*count(distinct 17)-min(b)- -max(11) | (count(*)) from t1 union select ((((max(b))))) from t1) and t1.e in (13,(13),b)} -} {307} -do_test randexpr-2.1335 { - db eval {SELECT (c*(abs(coalesce((select t1.b from t1 where (select ~~count(*)+ -count(distinct coalesce((select max(case coalesce((select max(a+(t1.e)) from t1 where -(a)>=t1.e or t1.e<17),c) when t1.d then t1.a else 17 end) from t1 where t1.b not in (e,(c),t1.a)),f)) from t1) between t1.a and b),case when exists(select 1 from t1 where t1.c>=t1.a) then 19 else t1.e end+t1.c))/abs(b))-11 | 19) FROM t1 WHERE NOT (not t1.e<=d or not exists(select 1 from t1 where exists(select 1 from t1 where ( -t1.c+d)>t1.a+case when f | -b not between 17 and e then -t1.d else (19) end) or 11 not between 17 and t1.f) or a in (select -cast(avg(13) AS integer)*count(distinct 17)-min(b)- -max(11) | (count(*)) from t1 union select ((((max(b))))) from t1) and t1.e in (13,(13),b))} -} {} -do_test randexpr-2.1336 { - db eval {SELECT (c*(abs(coalesce((select t1.b from t1 where (select ~~count(*)+ -count(distinct coalesce((select max(case coalesce((select max(a+(t1.e)) from t1 where -(a)>=t1.e or t1.e<17),c) when t1.d then t1.a else 17 end) from t1 where t1.b not in (e,(c),t1.a)),f)) from t1) between t1.a and b),case when exists(select 1 from t1 where t1.c>=t1.a) then 19 else t1.e end+t1.c))/abs(b))-11 & 19) FROM t1 WHERE not t1.e<=d or not exists(select 1 from t1 where exists(select 1 from t1 where ( -t1.c+d)>t1.a+case when f | -b not between 17 and e then -t1.d else (19) end) or 11 not between 17 and t1.f) or a in (select -cast(avg(13) AS integer)*count(distinct 17)-min(b)- -max(11) | (count(*)) from t1 union select ((((max(b))))) from t1) and t1.e in (13,(13),b)} -} {1} -do_test randexpr-2.1337 { - db eval {SELECT (select cast(avg(13*13* -coalesce((select b from t1 where case +(abs(17)/abs(d))*e+c-case -case when not a in (d,13,t1.b) then t1.b when t1.f<=b then e else -f end-17 when t1.e then t1.d else a end when c then b else f end<>e or ee or et1.d) or (t1.f in (select 11 from t1 union select t1.c from t1) or c>t1.e and b not in (t1.b, -t1.e,t1.a)) or c<>b),(a))-19*t1.c-c*t1.d and exists(select 1 from t1 where not exists(select 1 from t1 where t1.a in (t1.b,e,19) or not exists(select 1 from t1 where t1.c=19)))} -} {} -do_test randexpr-2.1340 { - db eval {SELECT b | t1.d- -coalesce((select case coalesce((select max((select (abs(cast(avg(coalesce((select max(coalesce((select 17 from t1 where -11=t1.e),a)) from t1 where not exists(select 1 from t1 where 13 between t1.f and 13)),11)-c) AS integer)))+min( -b) from t1)+b) from t1 where t1.d not in (b*19,t1.a,a)),t1.e) when t1.e then t1.b else t1.d end from t1 where (e not in (b,t1.a,(a)))),13) FROM t1 WHERE NOT (t1.c=coalesce((select t1.d*(select count(*) from t1) from t1 where ((abs(e)/abs(case 13 when t1.d then t1.e else 11 end+13))>t1.d) or (t1.f in (select 11 from t1 union select t1.c from t1) or c>t1.e and b not in (t1.b, -t1.e,t1.a)) or c<>b),(a))-19*t1.c-c*t1.d and exists(select 1 from t1 where not exists(select 1 from t1 where t1.a in (t1.b,e,19) or not exists(select 1 from t1 where t1.c=19))))} -} {1000} -do_test randexpr-2.1341 { - db eval {SELECT b & t1.d- -coalesce((select case coalesce((select max((select (abs(cast(avg(coalesce((select max(coalesce((select 17 from t1 where -11=t1.e),a)) from t1 where not exists(select 1 from t1 where 13 between t1.f and 13)),11)-c) AS integer)))+min( -b) from t1)+b) from t1 where t1.d not in (b*19,t1.a,a)),t1.e) when t1.e then t1.b else t1.d end from t1 where (e not in (b,t1.a,(a)))),13) FROM t1 WHERE NOT (t1.c=coalesce((select t1.d*(select count(*) from t1) from t1 where ((abs(e)/abs(case 13 when t1.d then t1.e else 11 end+13))>t1.d) or (t1.f in (select 11 from t1 union select t1.c from t1) or c>t1.e and b not in (t1.b, -t1.e,t1.a)) or c<>b),(a))-19*t1.c-c*t1.d and exists(select 1 from t1 where not exists(select 1 from t1 where t1.a in (t1.b,e,19) or not exists(select 1 from t1 where t1.c=19))))} -} {0} -do_test randexpr-2.1342 { - db eval {SELECT coalesce((select 19 from t1 where not exists(select 1 from t1 where 11+d between b and 19-case when t1.e>e*f+case when 13 in (select count(*) from t1 union select ~min(a*t1.d)+count(*) from t1) then c when (select min(d) from t1) in (select cast(avg(17) AS integer) from t1 union select min(t1.a) from t1) and 11<>(f) then -f else 19 end | c then 13 else 19 end*b*t1.b)),a) FROM t1 WHERE (coalesce((select d from t1 where coalesce((select ~(coalesce((select max(t1.a) from t1 where 13+t1.c-c*coalesce((select t1.a from t1 where ( -t1.d not between a and d)),t1.e)+t1.e- - -11-t1.d*11<17),d)) from t1 where f between t1.a and t1.a),t1.c)<>e),t1.d)*(19)-t1.e- -17-a>=d or t1.c between f and a)} -} {19} -do_test randexpr-2.1343 { - db eval {SELECT coalesce((select 19 from t1 where not exists(select 1 from t1 where 11+d between b and 19-case when t1.e>e*f+case when 13 in (select count(*) from t1 union select ~min(a*t1.d)+count(*) from t1) then c when (select min(d) from t1) in (select cast(avg(17) AS integer) from t1 union select min(t1.a) from t1) and 11<>(f) then -f else 19 end | c then 13 else 19 end*b*t1.b)),a) FROM t1 WHERE NOT ((coalesce((select d from t1 where coalesce((select ~(coalesce((select max(t1.a) from t1 where 13+t1.c-c*coalesce((select t1.a from t1 where ( -t1.d not between a and d)),t1.e)+t1.e- - -11-t1.d*11<17),d)) from t1 where f between t1.a and t1.a),t1.c)<>e),t1.d)*(19)-t1.e- -17-a>=d or t1.c between f and a))} -} {} -do_test randexpr-2.1344 { - db eval {SELECT coalesce((select 19 from t1 where not exists(select 1 from t1 where 11+d between b and 19-case when t1.e>e*f+case when 13 in (select count(*) from t1 union select ~min(a*t1.d)+count(*) from t1) then c when (select min(d) from t1) in (select cast(avg(17) AS integer) from t1 union select min(t1.a) from t1) and 11<>(f) then -f else 19 end & c then 13 else 19 end*b*t1.b)),a) FROM t1 WHERE (coalesce((select d from t1 where coalesce((select ~(coalesce((select max(t1.a) from t1 where 13+t1.c-c*coalesce((select t1.a from t1 where ( -t1.d not between a and d)),t1.e)+t1.e- - -11-t1.d*11<17),d)) from t1 where f between t1.a and t1.a),t1.c)<>e),t1.d)*(19)-t1.e- -17-a>=d or t1.c between f and a)} -} {19} -do_test randexpr-2.1345 { - db eval {SELECT coalesce((select +case case when f>t1.d then a+t1.b-f when coalesce((select max(t1.b-case f when 13*t1.a then 11 else 11 end*c) from t1 where f in (select min(t1.d) from t1 union select +count(distinct f) from t1)),17) not in (e,b,t1.a) then f else t1.b end-e*t1.a when -11 then 19 else (t1.d) end from t1 where 17 not between -13 and t1.e),19) FROM t1 WHERE not t1.b*coalesce((select max(17 | coalesce((select coalesce((select +coalesce((select max(case when (b not in (a,t1.b, -t1.a)) and t1.f=t1.b then t1.c-t1.f when 11>d then 17 else 11 end+f) from t1 where t1.e<>b), -t1.e) from t1 where t1.f in (select min(b) from t1 union select max(19)+count(distinct e)+(count(distinct e)) | - -count(distinct 17)*count(*) from t1)),13) from t1 where t1.f>=t1.f),t1.f)) from t1 where t1.f>=b),c)t1.d then a+t1.b-f when coalesce((select max(t1.b-case f when 13*t1.a then 11 else 11 end*c) from t1 where f in (select min(t1.d) from t1 union select +count(distinct f) from t1)),17) not in (e,b,t1.a) then f else t1.b end-e*t1.a when -11 then 19 else (t1.d) end from t1 where 17 not between -13 and t1.e),19) FROM t1 WHERE NOT (not t1.b*coalesce((select max(17 | coalesce((select coalesce((select +coalesce((select max(case when (b not in (a,t1.b, -t1.a)) and t1.f=t1.b then t1.c-t1.f when 11>d then 17 else 11 end+f) from t1 where t1.e<>b), -t1.e) from t1 where t1.f in (select min(b) from t1 union select max(19)+count(distinct e)+(count(distinct e)) | - -count(distinct 17)*count(*) from t1)),13) from t1 where t1.f>=t1.f),t1.f)) from t1 where t1.f>=b),c)11 then t1.a when 17 not between d and 13 or t1.f in (b,b,t1.a) then t1.d else c end)) then -t1.e else b end*t1.a FROM t1 WHERE a in ((abs(t1.c*+(abs(17-(abs(19)/abs(b-coalesce((select max(t1.c) from t1 where c>t1.f),t1.e))))/abs(t1.e))+t1.b | t1.d*t1.a)/abs(coalesce((select case when t1.f in (case when -e<=t1.a then f else 17 end,f,b) then b else t1.c end from t1 where not a in (t1.d,t1.a,c)),t1.f))),b,t1.b) and e in (select f from t1 union select e from t1)} -} {} -do_test randexpr-2.1348 { - db eval {SELECT -11* -t1.b-t1.b+ -case when t1.e-(select max((select abs((cast(avg(t1.f) AS integer)+++ -cast(avg(a | a) AS integer))) from t1))+(( -max( -b))) from t1)<=(abs(11)/abs((select count(distinct t1.e) from t1)-b*case when t1.a<>11 then t1.a when 17 not between d and 13 or t1.f in (b,b,t1.a) then t1.d else c end)) then -t1.e else b end*t1.a FROM t1 WHERE NOT (a in ((abs(t1.c*+(abs(17-(abs(19)/abs(b-coalesce((select max(t1.c) from t1 where c>t1.f),t1.e))))/abs(t1.e))+t1.b | t1.d*t1.a)/abs(coalesce((select case when t1.f in (case when -e<=t1.a then f else 17 end,f,b) then b else t1.c end from t1 where not a in (t1.d,t1.a,c)),t1.f))),b,t1.b) and e in (select f from t1 union select e from t1))} -} {52000} -do_test randexpr-2.1349 { - db eval {SELECT -11* -t1.b-t1.b+ -case when t1.e-(select max((select abs((cast(avg(t1.f) AS integer)+++ -cast(avg(a & a) AS integer))) from t1))+(( -max( -b))) from t1)<=(abs(11)/abs((select count(distinct t1.e) from t1)-b*case when t1.a<>11 then t1.a when 17 not between d and 13 or t1.f in (b,b,t1.a) then t1.d else c end)) then -t1.e else b end*t1.a FROM t1 WHERE NOT (a in ((abs(t1.c*+(abs(17-(abs(19)/abs(b-coalesce((select max(t1.c) from t1 where c>t1.f),t1.e))))/abs(t1.e))+t1.b | t1.d*t1.a)/abs(coalesce((select case when t1.f in (case when -e<=t1.a then f else 17 end,f,b) then b else t1.c end from t1 where not a in (t1.d,t1.a,c)),t1.f))),b,t1.b) and e in (select f from t1 union select e from t1))} -} {52000} -do_test randexpr-2.1350 { - db eval {SELECT case when ((select count(*) | min(case when (a*e in (select -+ -min(a) | cast(avg(11) AS integer) from t1 union select count(distinct t1.e) from t1) and exists(select 1 from t1 where not 13 in (select count(distinct 11) from t1 union select (max(19)) from t1) or (t1.f) between t1.e and (t1.e)) or t1.a<=f) or t1.et1.c then t1.e else t1.b end FROM t1 WHERE (c not between +(select + -~~max(coalesce((select case when t1.b<=t1.d*a then t1.c else t1.e end*t1.e from t1 where t1.d>=t1.b and c=(f) or t1.e>t1.d and bt1.c then t1.e else t1.b end FROM t1 WHERE NOT ((c not between +(select + -~~max(coalesce((select case when t1.b<=t1.d*a then t1.c else t1.e end*t1.e from t1 where t1.d>=t1.b and c=(f) or t1.e>t1.d and bt1.c then t1.e else t1.b end FROM t1 WHERE NOT ((c not between +(select + -~~max(coalesce((select case when t1.b<=t1.d*a then t1.c else t1.e end*t1.e from t1 where t1.d>=t1.b and c=(f) or t1.e>t1.d and bt1.c),t1.d)) from t1 where b not in (t1.e, -13,f)),f) FROM t1 WHERE d*a | 19<> -t1.d} -} {-500} -do_test randexpr-2.1354 { - db eval {SELECT coalesce((select max(coalesce((select max((abs((11))/abs(13))-e) from t1 where 11 not in (c,f,(select count(distinct -17+t1.a) from t1)) or (d*coalesce((select b | coalesce((select max(17) from t1 where e in (d,t1.c,t1.c)),+b) from t1 where d in (d-13,t1.c,f)),13))<>t1.c),t1.d)) from t1 where b not in (t1.e, -13,f)),f) FROM t1 WHERE NOT (d*a | 19<> -t1.d)} -} {} -do_test randexpr-2.1355 { - db eval {SELECT coalesce((select max(coalesce((select max((abs((11))/abs(13))-e) from t1 where 11 not in (c,f,(select count(distinct -17+t1.a) from t1)) or (d*coalesce((select b & coalesce((select max(17) from t1 where e in (d,t1.c,t1.c)),+b) from t1 where d in (d-13,t1.c,f)),13))<>t1.c),t1.d)) from t1 where b not in (t1.e, -13,f)),f) FROM t1 WHERE d*a | 19<> -t1.d} -} {-500} -do_test randexpr-2.1356 { - db eval {SELECT coalesce((select t1.f from t1 where case when 19<>(c*case when 19 | -t1.e in (select ~+(max(c)) from t1 union select min(19) from t1) then -t1.f else 13 end-f) then ( -17) else -19 end-b in (t1.b,t1.f,b) or c in (select ~case max( -t1.d) | count(*)*cast(avg(b) AS integer) when count(distinct t1.f) then cast(avg(t1.f) AS integer) else cast(avg(f) AS integer) end | (cast(avg( -t1.e) AS integer)) from t1 union select max(c) from t1) and t1.f in (select max(17) from t1 union select max(11) from t1)),e) FROM t1 WHERE not 13 in (select (t1.b)*(coalesce((select (abs(t1.f)/abs( -t1.f-d))-coalesce((select 19 from t1 where not exists(select 1 from t1 where (select count(distinct t1.f+19-(abs(e)/abs(e))) from t1)- -e<>d)),t1.e)* -t1.a-t1.a-(t1.f)*t1.e*t1.d-t1.b from t1 where t1.e between t1.a and b),11)) from t1 union select d from t1)} -} {500} -do_test randexpr-2.1357 { - db eval {SELECT coalesce((select t1.f from t1 where case when 19<>(c*case when 19 | -t1.e in (select ~+(max(c)) from t1 union select min(19) from t1) then -t1.f else 13 end-f) then ( -17) else -19 end-b in (t1.b,t1.f,b) or c in (select ~case max( -t1.d) | count(*)*cast(avg(b) AS integer) when count(distinct t1.f) then cast(avg(t1.f) AS integer) else cast(avg(f) AS integer) end | (cast(avg( -t1.e) AS integer)) from t1 union select max(c) from t1) and t1.f in (select max(17) from t1 union select max(11) from t1)),e) FROM t1 WHERE NOT (not 13 in (select (t1.b)*(coalesce((select (abs(t1.f)/abs( -t1.f-d))-coalesce((select 19 from t1 where not exists(select 1 from t1 where (select count(distinct t1.f+19-(abs(e)/abs(e))) from t1)- -e<>d)),t1.e)* -t1.a-t1.a-(t1.f)*t1.e*t1.d-t1.b from t1 where t1.e between t1.a and b),11)) from t1 union select d from t1))} -} {} -do_test randexpr-2.1358 { - db eval {SELECT coalesce((select t1.f from t1 where case when 19<>(c*case when 19 & -t1.e in (select ~+(max(c)) from t1 union select min(19) from t1) then -t1.f else 13 end-f) then ( -17) else -19 end-b in (t1.b,t1.f,b) or c in (select ~case max( -t1.d) & count(*)*cast(avg(b) AS integer) when count(distinct t1.f) then cast(avg(t1.f) AS integer) else cast(avg(f) AS integer) end & (cast(avg( -t1.e) AS integer)) from t1 union select max(c) from t1) and t1.f in (select max(17) from t1 union select max(11) from t1)),e) FROM t1 WHERE not 13 in (select (t1.b)*(coalesce((select (abs(t1.f)/abs( -t1.f-d))-coalesce((select 19 from t1 where not exists(select 1 from t1 where (select count(distinct t1.f+19-(abs(e)/abs(e))) from t1)- -e<>d)),t1.e)* -t1.a-t1.a-(t1.f)*t1.e*t1.d-t1.b from t1 where t1.e between t1.a and b),11)) from t1 union select d from t1)} -} {500} -do_test randexpr-2.1359 { - db eval {SELECT ~ -case when t1.d in (17,t1.e,case t1.b*c when -c+f-11 | coalesce((select 11 from t1 where (select (min(13)-max(t1.c))+count(*) from t1)+13<=(( -(t1.f)))),b)+17 then t1.d else b end) then c when c between 13 and f and b>17 then f else t1.a end-t1.f FROM t1 WHERE t1.e>= -f} -} {-1} -do_test randexpr-2.1360 { - db eval {SELECT ~ -case when t1.d in (17,t1.e,case t1.b*c when -c+f-11 | coalesce((select 11 from t1 where (select (min(13)-max(t1.c))+count(*) from t1)+13<=(( -(t1.f)))),b)+17 then t1.d else b end) then c when c between 13 and f and b>17 then f else t1.a end-t1.f FROM t1 WHERE NOT (t1.e>= -f)} -} {} -do_test randexpr-2.1361 { - db eval {SELECT ~ -case when t1.d in (17,t1.e,case t1.b*c when -c+f-11 & coalesce((select 11 from t1 where (select (min(13)-max(t1.c))+count(*) from t1)+13<=(( -(t1.f)))),b)+17 then t1.d else b end) then c when c between 13 and f and b>17 then f else t1.a end-t1.f FROM t1 WHERE t1.e>= -f} -} {-1} -do_test randexpr-2.1362 { - db eval {SELECT ((abs(13)/abs( -b | coalesce((select 17 | t1.e from t1 where (d in (select coalesce((select 17 | (a) | c*case when case when t1.c in (select max(13) | cast(avg(t1.b) AS integer) from t1 union select count(*) from t1) then t1.c when 13>=17 then (11) else t1.e end>t1.d and t1.b>=t1.f then 13 when 11 not in (t1.d, -f,13) then f else 11 end from t1 where b<>11),d) from t1 union select t1.e from t1) or b not in (t1.e,b,e))),t1.e)))) FROM t1 WHERE 11<=coalesce((select max(t1.d) from t1 where coalesce((select ~d+t1.d-case when c not in (t1.b-f,19+~coalesce((select t1.a from t1 where t1.f<=b),case when not (e not between f and t1.e) then (t1.e)-d else b end), -t1.d) then 17 when t1.d not between 13 and t1.d then d else (c) end from t1 where c>t1.a),t1.b)=17 then (11) else t1.e end>t1.d and t1.b>=t1.f then 13 when 11 not in (t1.d, -f,13) then f else 11 end from t1 where b<>11),d) from t1 union select t1.e from t1) or b not in (t1.e,b,e))),t1.e)))) FROM t1 WHERE NOT (11<=coalesce((select max(t1.d) from t1 where coalesce((select ~d+t1.d-case when c not in (t1.b-f,19+~coalesce((select t1.a from t1 where t1.f<=b),case when not (e not between f and t1.e) then (t1.e)-d else b end), -t1.d) then 17 when t1.d not between 13 and t1.d then d else (c) end from t1 where c>t1.a),t1.b)=17 then (11) else t1.e end>t1.d and t1.b>=t1.f then 13 when 11 not in (t1.d, -f,13) then f else 11 end from t1 where b<>11),d) from t1 union select t1.e from t1) or b not in (t1.e,b,e))),t1.e)))) FROM t1 WHERE 11<=coalesce((select max(t1.d) from t1 where coalesce((select ~d+t1.d-case when c not in (t1.b-f,19+~coalesce((select t1.a from t1 where t1.f<=b),case when not (e not between f and t1.e) then (t1.e)-d else b end), -t1.d) then 17 when t1.d not between 13 and t1.d then d else (c) end from t1 where c>t1.a),t1.b)t1.d and a between d and d) then c else d end when exists(select 1 from t1 where (11)>19) or a in (t1.b,(t1.c),(a)) and - -11<>13 and t1.b not between -b and d then 19 else a end FROM t1 WHERE 19 | t1.d not between (select ~case case count(distinct t1.c) when (count(*)) then ~~~count(*) else -count(*)- -max(coalesce((select max(19) from t1 where (abs(t1.b-b)/abs(d))+11=t1.a),11))*max(t1.e) | count(*)-abs(max((c)))*max(t1.d) end when -count(*) then cast(avg(f) AS integer) else -(max(c)) end from t1) and t1.c} -} {400} -do_test randexpr-2.1366 { - db eval {SELECT case when (c between 11 and t1.e*t1.a | c) then case when (case when (b=(select max((t1.c))-min(t1.d) from t1)*b) then t1.c else 17 end-e>t1.d and a between d and d) then c else d end when exists(select 1 from t1 where (11)>19) or a in (t1.b,(t1.c),(a)) and - -11<>13 and t1.b not between -b and d then 19 else a end FROM t1 WHERE NOT (19 | t1.d not between (select ~case case count(distinct t1.c) when (count(*)) then ~~~count(*) else -count(*)- -max(coalesce((select max(19) from t1 where (abs(t1.b-b)/abs(d))+11=t1.a),11))*max(t1.e) | count(*)-abs(max((c)))*max(t1.d) end when -count(*) then cast(avg(f) AS integer) else -(max(c)) end from t1) and t1.c)} -} {} -do_test randexpr-2.1367 { - db eval {SELECT case when (c between 11 and t1.e*t1.a & c) then case when (case when (b=(select max((t1.c))-min(t1.d) from t1)*b) then t1.c else 17 end-e>t1.d and a between d and d) then c else d end when exists(select 1 from t1 where (11)>19) or a in (t1.b,(t1.c),(a)) and - -11<>13 and t1.b not between -b and d then 19 else a end FROM t1 WHERE 19 | t1.d not between (select ~case case count(distinct t1.c) when (count(*)) then ~~~count(*) else -count(*)- -max(coalesce((select max(19) from t1 where (abs(t1.b-b)/abs(d))+11=t1.a),11))*max(t1.e) | count(*)-abs(max((c)))*max(t1.d) end when -count(*) then cast(avg(f) AS integer) else -(max(c)) end from t1) and t1.c} -} {100} -do_test randexpr-2.1368 { - db eval {SELECT case when not exists(select 1 from t1 where t1.c not in (t1.d,17,t1.c | coalesce((select t1.f from t1 where t1.c*t1.c-t1.e not in (t1.e*(case when (f) not between c and +f then (a) else t1.e end)+17,13, -((t1.a))) and f not between f and t1.d), -t1.e))) then (abs(e)/abs(a)) when 17<17 or 13<>a then f else (f) end FROM t1 WHERE t1.f in (e,(19),case when not exists(select 1 from t1 where coalesce((select max( -(abs(case -t1.d when t1.d*13+coalesce((select a from t1 where d>19),t1.c) then f else b end)/abs(t1.b))) from t1 where f in (t1.a,t1.d,(c))),t1.d)+c+17a then f else (f) end FROM t1 WHERE NOT (t1.f in (e,(19),case when not exists(select 1 from t1 where coalesce((select max( -(abs(case -t1.d when t1.d*13+coalesce((select a from t1 where d>19),t1.c) then f else b end)/abs(t1.b))) from t1 where f in (t1.a,t1.d,(c))),t1.d)+c+17a then f else (f) end FROM t1 WHERE NOT (t1.f in (e,(19),case when not exists(select 1 from t1 where coalesce((select max( -(abs(case -t1.d when t1.d*13+coalesce((select a from t1 where d>19),t1.c) then f else b end)/abs(t1.b))) from t1 where f in (t1.a,t1.d,(c))),t1.d)+c+17coalesce((select max(coalesce((select max(case when case case when 19 in (select case min(11) when - -cast(avg(c) AS integer) then count(*) else count(*) end-cast(avg(19) AS integer) | cast(avg(17) AS integer) from t1 union select min(t1.d) from t1) then t1.b*t1.a else -t1.a end when t1.f then e else t1.d endd),t1.d)) from t1 where t1.c<>e and -17<=a),t1.d))} -} {413} -do_test randexpr-2.1372 { - db eval {SELECT case +b when coalesce((select max(b) from t1 where exists(select 1 from t1 where (((+~13) in (select case cast(avg(t1.e+(11)+t1.b*e) AS integer) when max(((t1.e))) then min(b)-case -cast(avg(17) AS integer) when min(e) then cast(avg(t1.c) AS integer) else (max(d)) end-count(distinct t1.f) else count(distinct d) end+count(*) from t1 union select max(d) from t1))))),(abs(~d)/abs(11))) then -e else - -13 end+d | t1.d FROM t1 WHERE NOT (((a)>coalesce((select max(coalesce((select max(case when case case when 19 in (select case min(11) when - -cast(avg(c) AS integer) then count(*) else count(*) end-cast(avg(19) AS integer) | cast(avg(17) AS integer) from t1 union select min(t1.d) from t1) then t1.b*t1.a else -t1.a end when t1.f then e else t1.d endd),t1.d)) from t1 where t1.c<>e and -17<=a),t1.d)))} -} {} -do_test randexpr-2.1373 { - db eval {SELECT case +b when coalesce((select max(b) from t1 where exists(select 1 from t1 where (((+~13) in (select case cast(avg(t1.e+(11)+t1.b*e) AS integer) when max(((t1.e))) then min(b)-case -cast(avg(17) AS integer) when min(e) then cast(avg(t1.c) AS integer) else (max(d)) end-count(distinct t1.f) else count(distinct d) end+count(*) from t1 union select max(d) from t1))))),(abs(~d)/abs(11))) then -e else - -13 end+d & t1.d FROM t1 WHERE ((a)>coalesce((select max(coalesce((select max(case when case case when 19 in (select case min(11) when - -cast(avg(c) AS integer) then count(*) else count(*) end-cast(avg(19) AS integer) | cast(avg(17) AS integer) from t1 union select min(t1.d) from t1) then t1.b*t1.a else -t1.a end when t1.f then e else t1.d endd),t1.d)) from t1 where t1.c<>e and -17<=a),t1.d))} -} {400} -do_test randexpr-2.1374 { - db eval {SELECT +c+case when (~t1.e in (+(select case cast(avg(17) AS integer)+min(19)+count(*) when -max(c) then count(distinct t1.c) else - - -(max(13)) end*count(distinct ( -17)) from t1)-case when d+case when f<>d or t1.d<=t1.e then t1.a else -11 end in (select cast(avg(t1.e) AS integer) from t1 union select cast(avg(b) AS integer) from t1) then 19 when ((t1.c) between e and a and -13 not in (d,f,e)) then t1.e else d end,a,t1.b)) then case when t1.b<19 then 13 else 19 end else t1.c end FROM t1 WHERE not exists(select 1 from t1 where 19>t1.f+coalesce((select 13 from t1 where t1.d in (coalesce((select max(e) from t1 where c=t1.c),t1.d) between t1.b and c))) then -f+(t1.b)-t1.e-t1.c+t1.c when c in (select -( -f) from t1 union select 13 from t1) then t1.e else t1.a end),t1.b,a)),11))} -} {600} -do_test randexpr-2.1375 { - db eval {SELECT +c+case when (~t1.e in (+(select case cast(avg(17) AS integer)+min(19)+count(*) when -max(c) then count(distinct t1.c) else - - -(max(13)) end*count(distinct ( -17)) from t1)-case when d+case when f<>d or t1.d<=t1.e then t1.a else -11 end in (select cast(avg(t1.e) AS integer) from t1 union select cast(avg(b) AS integer) from t1) then 19 when ((t1.c) between e and a and -13 not in (d,f,e)) then t1.e else d end,a,t1.b)) then case when t1.b<19 then 13 else 19 end else t1.c end FROM t1 WHERE NOT (not exists(select 1 from t1 where 19>t1.f+coalesce((select 13 from t1 where t1.d in (coalesce((select max(e) from t1 where c=t1.c),t1.d) between t1.b and c))) then -f+(t1.b)-t1.e-t1.c+t1.c when c in (select -( -f) from t1 union select 13 from t1) then t1.e else t1.a end),t1.b,a)),11)))} -} {} -do_test randexpr-2.1376 { - db eval {SELECT (17-t1.e-17*t1.d+coalesce((select -(abs(t1.a)/abs(t1.e))-t1.e*13*c*c-c from t1 where coalesce((select max(t1.a) from t1 where +case when t1.a not in (e,(t1.b),t1.f) then 11 when t1.b not between t1.c and t1.c then d else b end not in (13,t1.c,b)),f) between f and 11),d)-t1.d)-f+13 FROM t1 WHERE t1.f<>case when 11 in (coalesce((select e from t1 where not exists(select 1 from t1 where not case when t1.c between 11 and f then +t1.d else (((abs(coalesce((select -t1.c from t1 where (c in (b,b,t1.e))),13) | t1.e*t1.d)/abs(c))-t1.f)) end-t1.d=c)),t1.e),d,t1.e) or t1.bcase when 11 in (coalesce((select e from t1 where not exists(select 1 from t1 where not case when t1.c between 11 and f then +t1.d else (((abs(coalesce((select -t1.c from t1 where (c in (b,b,t1.e))),13) | t1.e*t1.d)/abs(c))-t1.f)) end-t1.d=c)),t1.e),d,t1.e) or t1.b=e or t1.a not in (t1.c,e,t1.f)),t1.b)+19<=t1.a) then ((b)) when d>=b or d not between 19 and t1.e then t1.c else t1.b end-t1.a*f) from t1 where 13 between t1.f and t1.b or e not in (t1.e,b,19)),t1.a) then d else t1.a end FROM t1 WHERE -b>=(select max(19) from t1)} -} {} -do_test randexpr-2.1379 { - db eval {SELECT case +c when 19*t1.b*coalesce((select t1.b-(19* -case when (coalesce((select t1.a from t1 where c>=e or t1.a not in (t1.c,e,t1.f)),t1.b)+19<=t1.a) then ((b)) when d>=b or d not between 19 and t1.e then t1.c else t1.b end-t1.a*f) from t1 where 13 between t1.f and t1.b or e not in (t1.e,b,19)),t1.a) then d else t1.a end FROM t1 WHERE NOT ( -b>=(select max(19) from t1))} -} {100} -do_test randexpr-2.1380 { - db eval {SELECT d+(abs(case t1.e when e*(abs(17)/abs(b)) then f else case when not not 13=c then coalesce((select t1.b from t1 where ((e-11 in (select 19 from t1 union select 17 from t1))) or f>=f),d) else case when c in (t1.a,t1.c,d) then t1.e when -11 in (t1.a,e,t1.d) then t1.a else 19 end end-t1.e end*19)/abs(t1.c))-t1.e+d*t1.f FROM t1 WHERE t1.d+t1.c*coalesce((select e from t1 where coalesce((select max(t1.f) from t1 where not f in (select abs(case min(case when a not between a and f then 17 when e>17 then t1.d else 13 end) when abs(case cast(avg(t1.a) AS integer) when -min(t1.b) then count(distinct 17) else (count(distinct t1.a)) end)-count(distinct -b) then count(distinct d) else max(t1.f) end)+count(*)*max(e) from t1 union select (cast(avg(t1.c) AS integer)) from t1)),b*case 19 when t1.a then 11 else e end)<=f),17)=c} -} {} -do_test randexpr-2.1381 { - db eval {SELECT d+(abs(case t1.e when e*(abs(17)/abs(b)) then f else case when not not 13=c then coalesce((select t1.b from t1 where ((e-11 in (select 19 from t1 union select 17 from t1))) or f>=f),d) else case when c in (t1.a,t1.c,d) then t1.e when -11 in (t1.a,e,t1.d) then t1.a else 19 end end-t1.e end*19)/abs(t1.c))-t1.e+d*t1.f FROM t1 WHERE NOT (t1.d+t1.c*coalesce((select e from t1 where coalesce((select max(t1.f) from t1 where not f in (select abs(case min(case when a not between a and f then 17 when e>17 then t1.d else 13 end) when abs(case cast(avg(t1.a) AS integer) when -min(t1.b) then count(distinct 17) else (count(distinct t1.a)) end)-count(distinct -b) then count(distinct d) else max(t1.f) end)+count(*)*max(e) from t1 union select (cast(avg(t1.c) AS integer)) from t1)),b*case 19 when t1.a then 11 else e end)<=f),17)=c)} -} {239900} -do_test randexpr-2.1382 { - db eval {SELECT case when ~t1.b=t1.b-coalesce((select 17 from t1 where t1.d-a>=(abs(case when c*11 between 19+(select cast(avg(13*b) AS integer) from t1) and case t1.e-t1.f when t1.a then 11 else a end then 19 else 17 end-c+a)/abs(t1.a))),e) then (f) when exists(select 1 from t1 where (11) in (c,t1.c,t1.b)) then f else 19 end*t1.f FROM t1 WHERE case 19 when t1.b then b*case t1.a when +t1.f then e else 17+t1.a end-11++(select ~~abs(~count(*))+count(distinct 13) from t1)*t1.b-t1.c- -a else 17 end>=t1.e} -} {} -do_test randexpr-2.1383 { - db eval {SELECT case when ~t1.b=t1.b-coalesce((select 17 from t1 where t1.d-a>=(abs(case when c*11 between 19+(select cast(avg(13*b) AS integer) from t1) and case t1.e-t1.f when t1.a then 11 else a end then 19 else 17 end-c+a)/abs(t1.a))),e) then (f) when exists(select 1 from t1 where (11) in (c,t1.c,t1.b)) then f else 19 end*t1.f FROM t1 WHERE NOT (case 19 when t1.b then b*case t1.a when +t1.f then e else 17+t1.a end-11++(select ~~abs(~count(*))+count(distinct 13) from t1)*t1.b-t1.c- -a else 17 end>=t1.e)} -} {11400} -do_test randexpr-2.1384 { - db eval {SELECT case when t1.a<=e and d*(t1.d)+t1.d++a-t1.f-a<=e or c not between b and d and 19 not between t1.e and 11 or -t1.b in (select b from t1 union select 17 from t1) and t1.d<>t1.e or t1.d in (select t1.c from t1 union select t1.d from t1) then t1.e else 17 end+f+t1.b FROM t1 WHERE t1.c*~case 19+coalesce((select 19 from t1 where e>11-d),t1.e) when coalesce((select max(11) from t1 where not t1.f in (select ~abs(cast(avg(coalesce((select max(b+f) from t1 where -f=(t1.b) and a between t1.c and t1.b),a)) AS integer))+ -count(distinct t1.b)- -max(f)*max((f)) from t1 union select min(t1.e) from t1) or a in (select +d*d from t1 union select t1.c from t1)),t1.e) then t1.d else t1.c end*t1.bt1.e or t1.d in (select t1.c from t1 union select t1.d from t1) then t1.e else 17 end+f+t1.b FROM t1 WHERE NOT (t1.c*~case 19+coalesce((select 19 from t1 where e>11-d),t1.e) when coalesce((select max(11) from t1 where not t1.f in (select ~abs(cast(avg(coalesce((select max(b+f) from t1 where -f=(t1.b) and a between t1.c and t1.b),a)) AS integer))+ -count(distinct t1.b)- -max(f)*max((f)) from t1 union select min(t1.e) from t1) or a in (select +d*d from t1 union select t1.c from t1)),t1.e) then t1.d else t1.c end*t1.bb)),e)-13)/abs(t1.e))+17)),t1.a)*t1.d+b FROM t1 WHERE not exists(select 1 from t1 where t1.b=case 19 when f then d+case when t1.c not between 13 and d | (select abs((min(17) | (min(t1.f)))) from t1) and coalesce((select max(11*19) from t1 where not exists(select 1 from t1 where (e>=t1.b))),11) not in (t1.c,19,t1.c) or t1.a in (select count(*) from t1 union select max(c)+cast(avg(11) AS integer) from t1) and (c) not between t1.a and t1.d and t1.b between 11 and a then t1.d else c end else (t1.f) end)} -} {40200} -do_test randexpr-2.1387 { - db eval {SELECT coalesce((select 17 from t1 where (~f=(abs(coalesce((select t1.d from t1 where case (select count(distinct c | 13)- -(cast(avg(11) AS integer)) from t1)+coalesce((select 19 from t1 where d in (select t1.c from t1 union select 17 from t1)),t1.f) when e then t1.c else t1.d end*d<=19 and not exists(select 1 from t1 where (e)<>b)),e)-13)/abs(t1.e))+17)),t1.a)*t1.d+b FROM t1 WHERE NOT (not exists(select 1 from t1 where t1.b=case 19 when f then d+case when t1.c not between 13 and d | (select abs((min(17) | (min(t1.f)))) from t1) and coalesce((select max(11*19) from t1 where not exists(select 1 from t1 where (e>=t1.b))),11) not in (t1.c,19,t1.c) or t1.a in (select count(*) from t1 union select max(c)+cast(avg(11) AS integer) from t1) and (c) not between t1.a and t1.d and t1.b between 11 and a then t1.d else c end else (t1.f) end))} -} {} -do_test randexpr-2.1388 { - db eval {SELECT coalesce((select 17 from t1 where (~f=(abs(coalesce((select t1.d from t1 where case (select count(distinct c & 13)- -(cast(avg(11) AS integer)) from t1)+coalesce((select 19 from t1 where d in (select t1.c from t1 union select 17 from t1)),t1.f) when e then t1.c else t1.d end*d<=19 and not exists(select 1 from t1 where (e)<>b)),e)-13)/abs(t1.e))+17)),t1.a)*t1.d+b FROM t1 WHERE not exists(select 1 from t1 where t1.b=case 19 when f then d+case when t1.c not between 13 and d | (select abs((min(17) | (min(t1.f)))) from t1) and coalesce((select max(11*19) from t1 where not exists(select 1 from t1 where (e>=t1.b))),11) not in (t1.c,19,t1.c) or t1.a in (select count(*) from t1 union select max(c)+cast(avg(11) AS integer) from t1) and (c) not between t1.a and t1.d and t1.b between 11 and a then t1.d else c end else (t1.f) end)} -} {40200} -do_test randexpr-2.1389 { - db eval {SELECT coalesce((select max(t1.f+19+case -d when t1.f then t1.e else e end+case when +d in (select case when exists(select 1 from t1 where coalesce((select max( -17-d+t1.b-t1.d) from t1 where e not in (f,t1.e,11)),c) | t1.e>=c) then b else d end from t1 union select c from t1) then t1.b else d end-e*b+11) from t1 where f<>t1.b),d) FROM t1 WHERE (exists(select 1 from t1 where f> -t1.a*11 or e in (a-~ -t1.e,+a | e*case when coalesce((select t1.c from t1 where t1.f in (select (count(*)) from t1 union select ((count(*))) from t1)),a)-t1.e not in (e,t1.a,d) or 19 in (t1.b,t1.c,13) and c>19 then b*d else ( -t1.d) end-t1.a*t1.b*19,b)))} -} {-98470} -do_test randexpr-2.1390 { - db eval {SELECT coalesce((select max(t1.f+19+case -d when t1.f then t1.e else e end+case when +d in (select case when exists(select 1 from t1 where coalesce((select max( -17-d+t1.b-t1.d) from t1 where e not in (f,t1.e,11)),c) | t1.e>=c) then b else d end from t1 union select c from t1) then t1.b else d end-e*b+11) from t1 where f<>t1.b),d) FROM t1 WHERE NOT ((exists(select 1 from t1 where f> -t1.a*11 or e in (a-~ -t1.e,+a | e*case when coalesce((select t1.c from t1 where t1.f in (select (count(*)) from t1 union select ((count(*))) from t1)),a)-t1.e not in (e,t1.a,d) or 19 in (t1.b,t1.c,13) and c>19 then b*d else ( -t1.d) end-t1.a*t1.b*19,b))))} -} {} -do_test randexpr-2.1391 { - db eval {SELECT coalesce((select max(t1.f+19+case -d when t1.f then t1.e else e end+case when +d in (select case when exists(select 1 from t1 where coalesce((select max( -17-d+t1.b-t1.d) from t1 where e not in (f,t1.e,11)),c) & t1.e>=c) then b else d end from t1 union select c from t1) then t1.b else d end-e*b+11) from t1 where f<>t1.b),d) FROM t1 WHERE (exists(select 1 from t1 where f> -t1.a*11 or e in (a-~ -t1.e,+a | e*case when coalesce((select t1.c from t1 where t1.f in (select (count(*)) from t1 union select ((count(*))) from t1)),a)-t1.e not in (e,t1.a,d) or 19 in (t1.b,t1.c,13) and c>19 then b*d else ( -t1.d) end-t1.a*t1.b*19,b)))} -} {-98670} -do_test randexpr-2.1392 { - db eval {SELECT case t1.b* -(abs(e)/abs(d+b)) when ~a-11 then coalesce((select max(case when (~~19- -t1.d=f) then +(abs(t1.c)/abs(t1.e)) when (t1.d>e or t1.a>=t1.a) then 19 else t1.a end*b-(19)-a-t1.c) from t1 where t1.f>=11),13) else b end FROM t1 WHERE (not exists(select 1 from t1 where t1.e<=t1.f) or c- -e*17 in (t1.c+c, -b-17, -coalesce((select case when +coalesce((select max(coalesce((select t1.f from t1 where t1.d in (select max(t1.d)-count(*) from t1 union select max( -t1.a) from t1)),e)+11) from t1 where ( -19)>=t1.a),t1.e)-13 not between t1.a and d then t1.d else 19 end+t1.b from t1 where t1.d<>19),11)))} -} {} -do_test randexpr-2.1393 { - db eval {SELECT case t1.b* -(abs(e)/abs(d+b)) when ~a-11 then coalesce((select max(case when (~~19- -t1.d=f) then +(abs(t1.c)/abs(t1.e)) when (t1.d>e or t1.a>=t1.a) then 19 else t1.a end*b-(19)-a-t1.c) from t1 where t1.f>=11),13) else b end FROM t1 WHERE NOT ((not exists(select 1 from t1 where t1.e<=t1.f) or c- -e*17 in (t1.c+c, -b-17, -coalesce((select case when +coalesce((select max(coalesce((select t1.f from t1 where t1.d in (select max(t1.d)-count(*) from t1 union select max( -t1.a) from t1)),e)+11) from t1 where ( -19)>=t1.a),t1.e)-13 not between t1.a and d then t1.d else 19 end+t1.b from t1 where t1.d<>19),11))))} -} {200} -do_test randexpr-2.1394 { - db eval {SELECT (select case case min(d-t1.c)-max(t1.a) when ~count(distinct d+case -f*t1.d+11 when b then b else b end)-min(c) then case +max(t1.a)*~abs(count(*)) when -min(13) then max(17) else count(*) end else -max(e) end when max(t1.a) then max(d) else max(17) end-count(distinct t1.b) from t1)-(d) FROM t1 WHERE +19 between b*11 and (select max(d-13) | ~+~+~((count(*)))*cast(avg(b) AS integer) from t1)+b} -} {} -do_test randexpr-2.1395 { - db eval {SELECT (select case case min(d-t1.c)-max(t1.a) when ~count(distinct d+case -f*t1.d+11 when b then b else b end)-min(c) then case +max(t1.a)*~abs(count(*)) when -min(13) then max(17) else count(*) end else -max(e) end when max(t1.a) then max(d) else max(17) end-count(distinct t1.b) from t1)-(d) FROM t1 WHERE NOT (+19 between b*11 and (select max(d-13) | ~+~+~((count(*)))*cast(avg(b) AS integer) from t1)+b)} -} {-384} -do_test randexpr-2.1396 { - db eval {SELECT (abs(case when +a*t1.e+(abs(t1.e | 11+coalesce((select max(d) from t1 where (not not b19),17)) and t1.b>13 and d=t1.a and 13 in (d,t1.a,11)),t1.e)*d)/abs(11+t1.a-19))=c or b<>c then t1.e when b<>19 then 17 else b end)/abs(11)) FROM t1 WHERE (coalesce((select max(case when exists(select 1 from t1 where coalesce((select a from t1 where not 19-~(coalesce((select t1.d from t1 where d between e and 17),t1.a)-t1.a-17) in (t1.d,t1.e,19)),19)*11*d in (select d from t1 union select t1.b from t1)) then c when d between t1.a and -19 then t1.e else 19 end-d*c) from t1 where (t1.f>=t1.c)),11)) not in (17,17,a)} -} {45} -do_test randexpr-2.1397 { - db eval {SELECT (abs(case when +a*t1.e+(abs(t1.e | 11+coalesce((select max(d) from t1 where (not not b19),17)) and t1.b>13 and d=t1.a and 13 in (d,t1.a,11)),t1.e)*d)/abs(11+t1.a-19))=c or b<>c then t1.e when b<>19 then 17 else b end)/abs(11)) FROM t1 WHERE NOT ((coalesce((select max(case when exists(select 1 from t1 where coalesce((select a from t1 where not 19-~(coalesce((select t1.d from t1 where d between e and 17),t1.a)-t1.a-17) in (t1.d,t1.e,19)),19)*11*d in (select d from t1 union select t1.b from t1)) then c when d between t1.a and -19 then t1.e else 19 end-d*c) from t1 where (t1.f>=t1.c)),11)) not in (17,17,a))} -} {} -do_test randexpr-2.1398 { - db eval {SELECT (abs(case when +a*t1.e+(abs(t1.e & 11+coalesce((select max(d) from t1 where (not not b19),17)) and t1.b>13 and d=t1.a and 13 in (d,t1.a,11)),t1.e)*d)/abs(11+t1.a-19))=c or b<>c then t1.e when b<>19 then 17 else b end)/abs(11)) FROM t1 WHERE (coalesce((select max(case when exists(select 1 from t1 where coalesce((select a from t1 where not 19-~(coalesce((select t1.d from t1 where d between e and 17),t1.a)-t1.a-17) in (t1.d,t1.e,19)),19)*11*d in (select d from t1 union select t1.b from t1)) then c when d between t1.a and -19 then t1.e else 19 end-d*c) from t1 where (t1.f>=t1.c)),11)) not in (17,17,a)} -} {45} -do_test randexpr-2.1399 { - db eval {SELECT 19+(t1.f)*case coalesce((select max(b) from t1 where not f not between coalesce((select (select (count(distinct t1.c))+ -max( -(f)) from t1)+t1.c from t1 where t1.c<=d),17)-c-19 and 17 or f<>13),case when not exists(select 1 from t1 where ((a)) between b and t1.f) then c when not ( -f not in (t1.b,t1.a,t1.c)) then -t1.b else 19 end)-t1.d-t1.e when t1.e then 11 else 19 end FROM t1 WHERE not not exists(select 1 from t1 where not 11=c and a*e between coalesce((select max(t1.e) from t1 where f=t1.b*19+case when (e not in (t1.d,t1.d, -c) or t1.a13),case when not exists(select 1 from t1 where ((a)) between b and t1.f) then c when not ( -f not in (t1.b,t1.a,t1.c)) then -t1.b else 19 end)-t1.d-t1.e when t1.e then 11 else 19 end FROM t1 WHERE NOT (not not exists(select 1 from t1 where not 11=c and a*e between coalesce((select max(t1.e) from t1 where f=t1.b*19+case when (e not in (t1.d,t1.d, -c) or t1.a19) or t1.d=a)),19) FROM t1 WHERE t1.c not between f and d} -} {19} -do_test randexpr-2.1402 { - db eval {SELECT coalesce((select max(19) from t1 where e-coalesce((select 13 from t1 where exists(select 1 from t1 where ((+(case when d*t1.b not in (t1.d,t1.f,e) then 11 else t1.c end))+19*11+e<=11))),19+t1.d) between t1.c and -e and exists(select 1 from t1 where t1.d=c and exists(select 1 from t1 where exists(select 1 from t1 where t1.f=b and a in (19,t1.b,d) or t1.b=11) or t1.c>19) or t1.d=a)),19) FROM t1 WHERE NOT (t1.c not between f and d)} -} {} -do_test randexpr-2.1403 { - db eval {SELECT case e when (t1.e+case when t1.e not between t1.c and case when d+coalesce((select t1.d+13+case case a when t1.a then t1.b else t1.c end when 17 then t1.b else f end+19 from t1 where exists(select 1 from t1 where t1.f< -17)),11)>=d then 13 else 13 end*(t1.c) then -c when t1.e not between t1.f and t1.d then t1.a else ( - -t1.a) end-d) then t1.a else t1.d end FROM t1 WHERE t1.d between case when -(t1.e-c)+a between -+coalesce((select max(+t1.c) from t1 where (coalesce((select max(case when d>~t1.e then t1.c when t1.f in (select t1.d from t1 union select t1.e from t1) then (19) else t1.e end) from t1 where not exists(select 1 from t1 where t1.e< -(11))),t1.f) in (select min(t1.f) from t1 union select count(distinct 13) from t1))),t1.e) and t1.d then a when 13<=c then b else t1.c end-c and f} -} {400} -do_test randexpr-2.1404 { - db eval {SELECT case e when (t1.e+case when t1.e not between t1.c and case when d+coalesce((select t1.d+13+case case a when t1.a then t1.b else t1.c end when 17 then t1.b else f end+19 from t1 where exists(select 1 from t1 where t1.f< -17)),11)>=d then 13 else 13 end*(t1.c) then -c when t1.e not between t1.f and t1.d then t1.a else ( - -t1.a) end-d) then t1.a else t1.d end FROM t1 WHERE NOT (t1.d between case when -(t1.e-c)+a between -+coalesce((select max(+t1.c) from t1 where (coalesce((select max(case when d>~t1.e then t1.c when t1.f in (select t1.d from t1 union select t1.e from t1) then (19) else t1.e end) from t1 where not exists(select 1 from t1 where t1.e< -(11))),t1.f) in (select min(t1.f) from t1 union select count(distinct 13) from t1))),t1.e) and t1.d then a when 13<=c then b else t1.c end-c and f)} -} {} -do_test randexpr-2.1405 { - db eval {SELECT (select abs(min(case when d not between coalesce((select max(case case t1.e when e-t1.f-a then case when (not exists(select 1 from t1 where coalesce((select max(t1.f) from t1 where 19<>17 and e not between -13 and t1.a),t1.c)>=t1.e)) then (select abs(cast(avg(17) AS integer)) from t1) when c between e and 17 then (select (count(*)) from t1) else 11 end else 11 end when e then 11 else a end) from t1 where t1.b>t1.b),t1.e) and 13 then t1.d else 17 end))*min(b) | -count(distinct t1.f) from t1) FROM t1 WHERE (e) in (select +t1.f from t1 union select t1.f+coalesce((select t1.d+e from t1 where t1.f not in (t1.b,t1.f,e)),(19))*case when t1.a<=a and t1.e<=e then t1.d else t1.c end from t1) and (t1.c not between 11 and e) or d in (select count(*)-cast(avg(t1.a) AS integer) from t1 union select max(19) from t1) and not t1.a not in (11,t1.d,b) or 17>=t1.a} -} {} -do_test randexpr-2.1406 { - db eval {SELECT (select abs(min(case when d not between coalesce((select max(case case t1.e when e-t1.f-a then case when (not exists(select 1 from t1 where coalesce((select max(t1.f) from t1 where 19<>17 and e not between -13 and t1.a),t1.c)>=t1.e)) then (select abs(cast(avg(17) AS integer)) from t1) when c between e and 17 then (select (count(*)) from t1) else 11 end else 11 end when e then 11 else a end) from t1 where t1.b>t1.b),t1.e) and 13 then t1.d else 17 end))*min(b) | -count(distinct t1.f) from t1) FROM t1 WHERE NOT ((e) in (select +t1.f from t1 union select t1.f+coalesce((select t1.d+e from t1 where t1.f not in (t1.b,t1.f,e)),(19))*case when t1.a<=a and t1.e<=e then t1.d else t1.c end from t1) and (t1.c not between 11 and e) or d in (select count(*)-cast(avg(t1.a) AS integer) from t1 union select max(19) from t1) and not t1.a not in (11,t1.d,b) or 17>=t1.a)} -} {-1} -do_test randexpr-2.1407 { - db eval {SELECT (select abs(min(case when d not between coalesce((select max(case case t1.e when e-t1.f-a then case when (not exists(select 1 from t1 where coalesce((select max(t1.f) from t1 where 19<>17 and e not between -13 and t1.a),t1.c)>=t1.e)) then (select abs(cast(avg(17) AS integer)) from t1) when c between e and 17 then (select (count(*)) from t1) else 11 end else 11 end when e then 11 else a end) from t1 where t1.b>t1.b),t1.e) and 13 then t1.d else 17 end))*min(b) & -count(distinct t1.f) from t1) FROM t1 WHERE NOT ((e) in (select +t1.f from t1 union select t1.f+coalesce((select t1.d+e from t1 where t1.f not in (t1.b,t1.f,e)),(19))*case when t1.a<=a and t1.e<=e then t1.d else t1.c end from t1) and (t1.c not between 11 and e) or d in (select count(*)-cast(avg(t1.a) AS integer) from t1 union select max(19) from t1) and not t1.a not in (11,t1.d,b) or 17>=t1.a)} -} {80000} -do_test randexpr-2.1408 { - db eval {SELECT case when ++coalesce((select (abs(a)/abs((select max((abs(13*f)/abs(t1.d))-t1.d*t1.e) from t1)))+b-t1.c+(select +(cast(avg(c) AS integer))*count(*) from t1)-t1.d-b*t1.e+19 from t1 where t1.c not between 11 and t1.d),19)<=t1.d then t1.d when not exists(select 1 from t1 where -11=t1.a) then e else 11 end FROM t1 WHERE (coalesce((select max(coalesce((select a-19 | ~~t1.b from t1 where (abs(t1.f)/abs(b)) not between case when t1.d<=case when not exists(select 1 from t1 where 19<=t1.d) then case when t1.a<=c then f else t1.d end when d>=17 then t1.c else (b) end*t1.c then - -t1.c when c<>t1.a then t1.f else 11 end and e),t1.e)-(t1.a)) from t1 where e<=a),17)<=t1.e) and t1.d=(f)} -} {} -do_test randexpr-2.1409 { - db eval {SELECT case when ++coalesce((select (abs(a)/abs((select max((abs(13*f)/abs(t1.d))-t1.d*t1.e) from t1)))+b-t1.c+(select +(cast(avg(c) AS integer))*count(*) from t1)-t1.d-b*t1.e+19 from t1 where t1.c not between 11 and t1.d),19)<=t1.d then t1.d when not exists(select 1 from t1 where -11=t1.a) then e else 11 end FROM t1 WHERE NOT ((coalesce((select max(coalesce((select a-19 | ~~t1.b from t1 where (abs(t1.f)/abs(b)) not between case when t1.d<=case when not exists(select 1 from t1 where 19<=t1.d) then case when t1.a<=c then f else t1.d end when d>=17 then t1.c else (b) end*t1.c then - -t1.c when c<>t1.a then t1.f else 11 end and e),t1.e)-(t1.a)) from t1 where e<=a),17)<=t1.e) and t1.d=(f))} -} {400} -do_test randexpr-2.1410 { - db eval {SELECT c*t1.c*(abs(case 11 when case when 11*11 not between b and t1.a then t1.d else -coalesce((select t1.c from t1 where (not exists(select 1 from t1 where e*~13 not in (a*t1.c, -t1.a,case when 13=t1.c or 13 between 11 and a then - -a when e<=t1.e then 13 else 11 end)))),t1.b+t1.b) end then t1.c else ((e)) end)/abs(t1.a))+t1.a-e-13 FROM t1 WHERE t1.a*13+case when (select count(distinct b++(select case count(distinct 19*(select -+min((13*f))-count(distinct t1.c)-max(t1.e) | (count(distinct 11)) from t1)*(f)) when count(*) then min(a)+(cast(avg(t1.d) AS integer)) else -min(17) end from t1) | t1.c-f) from t1)>t1.b then 19 else c end+17t1.b then 19 else c end+17=t1.c and e between d and t1.f),case when (13)<>(t1.e) then d when t1.a<=t1.e then 13 else d end) not in (17,b,17) then t1.d else t1.a end+a),t1.d) FROM t1 WHERE case t1.f when 11 then t1.e | f*case when ((select max(17) from t1) | 11>17+~coalesce((select max(t1.b) from t1 where (coalesce((select max(t1.e) from t1 where t1.e in (select (cast(avg( -t1.a) AS integer)) from t1 union select count(*) from t1)),a)) in (t1.f,a,t1.e)),f)+17) then t1.a when 19 in (t1.c, -e,11) or not exists(select 1 from t1 where t1.e between d and a) then 13 else 19 end+t1.f else 11 end<17} -} {-401} -do_test randexpr-2.1413 { - db eval {SELECT ~coalesce((select b from t1 where b between e and case when t1.c+coalesce((select 11 from t1 where (a in (+d-11,t1.f-a,b)) and t1.c in (select t1.f from t1 union select c from t1) or b between 13 and t1.b and t1.e<(c) and a>=t1.c and e between d and t1.f),case when (13)<>(t1.e) then d when t1.a<=t1.e then 13 else d end) not in (17,b,17) then t1.d else t1.a end+a),t1.d) FROM t1 WHERE NOT (case t1.f when 11 then t1.e | f*case when ((select max(17) from t1) | 11>17+~coalesce((select max(t1.b) from t1 where (coalesce((select max(t1.e) from t1 where t1.e in (select (cast(avg( -t1.a) AS integer)) from t1 union select count(*) from t1)),a)) in (t1.f,a,t1.e)),f)+17) then t1.a when 19 in (t1.c, -e,11) or not exists(select 1 from t1 where t1.e between d and a) then 13 else 19 end+t1.f else 11 end<17)} -} {} -do_test randexpr-2.1414 { - db eval {SELECT ~case when (a<> -++ -11) then e+case when c*t1.ad then t1.a else b end else a end | case when not exists(select 1 from t1 where not exists(select 1 from t1 where 13 | d in (select a from t1 union select d from t1))) or t1.f not between c and 19 then +t1.a else c-a end-17*c FROM t1 WHERE (case when (case when b in (select 11*coalesce((select 11 from t1 where (d not between 13 and 13+17)),coalesce((select max(13) from t1 where t1.c in (select max(e) from t1 union select count(*) from t1)),t1.b)) from t1 union select -t1.e from t1) then 13 when t1.f in ( -f, -(f),c) then 19 else f end in (select t1.a from t1 union select (t1.c) from t1)) then (abs(19)/abs(t1.b)) when (e in (b,11,19)) and t1.a -++ -11) then e+case when c*t1.ad then t1.a else b end else a end | case when not exists(select 1 from t1 where not exists(select 1 from t1 where 13 | d in (select a from t1 union select d from t1))) or t1.f not between c and 19 then +t1.a else c-a end-17*c FROM t1 WHERE NOT ((case when (case when b in (select 11*coalesce((select 11 from t1 where (d not between 13 and 13+17)),coalesce((select max(13) from t1 where t1.c in (select max(e) from t1 union select count(*) from t1)),t1.b)) from t1 union select -t1.e from t1) then 13 when t1.f in ( -f, -(f),c) then 19 else f end in (select t1.a from t1 union select (t1.c) from t1)) then (abs(19)/abs(t1.b)) when (e in (b,11,19)) and t1.a -++ -11) then e+case when c*t1.ad then t1.a else b end else a end & case when not exists(select 1 from t1 where not exists(select 1 from t1 where 13 & d in (select a from t1 union select d from t1))) or t1.f not between c and 19 then +t1.a else c-a end-17*c FROM t1 WHERE NOT ((case when (case when b in (select 11*coalesce((select 11 from t1 where (d not between 13 and 13+17)),coalesce((select max(13) from t1 where t1.c in (select max(e) from t1 union select count(*) from t1)),t1.b)) from t1 union select -t1.e from t1) then 13 when t1.f in ( -f, -(f),c) then 19 else f end in (select t1.a from t1 union select (t1.c) from t1)) then (abs(19)/abs(t1.b)) when (e in (b,11,19)) and t1.a19) then -d when ~c in (select min(e) from t1 union select cast(avg(case when c not between b and t1.a then b else 13-e+t1.e end) AS integer) from t1) then 13-coalesce((select max(coalesce((select max(19) from t1 where (17=a)),13)) from t1 where t1.a>=c),a) else t1.d end*(t1.c) from t1 union select (11) from t1) then a when b not in (e,t1.f,13) then t1.f else 13 end FROM t1 WHERE 13<>e or t1.a in (select f from t1 union select f from t1)} -} {600} -do_test randexpr-2.1418 { - db eval {SELECT case when t1.d in (select case when exists(select 1 from t1 where 13>19) then -d when ~c in (select min(e) from t1 union select cast(avg(case when c not between b and t1.a then b else 13-e+t1.e end) AS integer) from t1) then 13-coalesce((select max(coalesce((select max(19) from t1 where (17=a)),13)) from t1 where t1.a>=c),a) else t1.d end*(t1.c) from t1 union select (11) from t1) then a when b not in (e,t1.f,13) then t1.f else 13 end FROM t1 WHERE NOT (13<>e or t1.a in (select f from t1 union select f from t1))} -} {} -do_test randexpr-2.1419 { - db eval {SELECT 17-(select case max(t1.f*~case when 17>=b then t1.d else t1.a end) when (count(distinct t1.c)) then count(distinct t1.d+~13*19) else -min((select +case abs(count(*)) when abs(+count(*)) then ~case count(distinct a) when max(t1.c) then max(t1.c) else min(t1.f) end+max(17) else count(*) end from t1))- -cast(avg(f) AS integer)-min(a) end from t1) FROM t1 WHERE (select count(*) from t1) in (select abs(min(coalesce((select t1.d from t1 where coalesce((select max((t1.d)) from t1 where not b+t1.e*(select min(t1.a+t1.e) from t1)<=(abs(t1.d)/abs(t1.c))+t1.d),f*17+d+case when f between e and d and t1.c= -c then ~13 when b not between 11 and e then (11) else e end+t1.d)=13),t1.e))) from t1 union select (cast(avg(b) AS integer)) from t1)} -} {} -do_test randexpr-2.1420 { - db eval {SELECT 17-(select case max(t1.f*~case when 17>=b then t1.d else t1.a end) when (count(distinct t1.c)) then count(distinct t1.d+~13*19) else -min((select +case abs(count(*)) when abs(+count(*)) then ~case count(distinct a) when max(t1.c) then max(t1.c) else min(t1.f) end+max(17) else count(*) end from t1))- -cast(avg(f) AS integer)-min(a) end from t1) FROM t1 WHERE NOT ((select count(*) from t1) in (select abs(min(coalesce((select t1.d from t1 where coalesce((select max((t1.d)) from t1 where not b+t1.e*(select min(t1.a+t1.e) from t1)<=(abs(t1.d)/abs(t1.c))+t1.d),f*17+d+case when f between e and d and t1.c= -c then ~13 when b not between 11 and e then (11) else e end+t1.d)=13),t1.e))) from t1 union select (cast(avg(b) AS integer)) from t1))} -} {-1067} -do_test randexpr-2.1421 { - db eval {SELECT case when +coalesce((select 19 from t1 where c between f and 13),t1.f)<>t1.c*t1.d then coalesce((select max(d) from t1 where t1.d between t1.a and t1.a),t1.f-f)-(13 | case when 11 in (select abs(max(t1.b)*cast(avg(t1.c) AS integer))+count(*) from t1 union select count(distinct b) from t1) and t1.a not in (b,t1.a,e) or a not in (e,19,(t1.e)) then t1.b else 17+t1.a end*t1.a) when 13 in (select e from t1 union select c from t1) then a else e end FROM t1 WHERE (select -count(*) from t1)*case when not coalesce((select max(11) from t1 where t1.f<>a),t1.a)<>b then c else ~case when not 19+13-t1.d=t1.d or c>c or (t1.a=t1.d) or 13>=a then a when t1.c not between 13 and 17 then (abs(13+t1.d-t1.a)/abs(b)) else d end end+a | 11<=e} -} {-20013} -do_test randexpr-2.1422 { - db eval {SELECT case when +coalesce((select 19 from t1 where c between f and 13),t1.f)<>t1.c*t1.d then coalesce((select max(d) from t1 where t1.d between t1.a and t1.a),t1.f-f)-(13 | case when 11 in (select abs(max(t1.b)*cast(avg(t1.c) AS integer))+count(*) from t1 union select count(distinct b) from t1) and t1.a not in (b,t1.a,e) or a not in (e,19,(t1.e)) then t1.b else 17+t1.a end*t1.a) when 13 in (select e from t1 union select c from t1) then a else e end FROM t1 WHERE NOT ((select -count(*) from t1)*case when not coalesce((select max(11) from t1 where t1.f<>a),t1.a)<>b then c else ~case when not 19+13-t1.d=t1.d or c>c or (t1.a=t1.d) or 13>=a then a when t1.c not between 13 and 17 then (abs(13+t1.d-t1.a)/abs(b)) else d end end+a | 11<=e)} -} {} -do_test randexpr-2.1423 { - db eval {SELECT case when +coalesce((select 19 from t1 where c between f and 13),t1.f)<>t1.c*t1.d then coalesce((select max(d) from t1 where t1.d between t1.a and t1.a),t1.f-f)-(13 & case when 11 in (select abs(max(t1.b)*cast(avg(t1.c) AS integer))+count(*) from t1 union select count(distinct b) from t1) and t1.a not in (b,t1.a,e) or a not in (e,19,(t1.e)) then t1.b else 17+t1.a end*t1.a) when 13 in (select e from t1 union select c from t1) then a else e end FROM t1 WHERE (select -count(*) from t1)*case when not coalesce((select max(11) from t1 where t1.f<>a),t1.a)<>b then c else ~case when not 19+13-t1.d=t1.d or c>c or (t1.a=t1.d) or 13>=a then a when t1.c not between 13 and 17 then (abs(13+t1.d-t1.a)/abs(b)) else d end end+a | 11<=e} -} {0} -do_test randexpr-2.1424 { - db eval {SELECT case t1.d | t1.f+(e)+case when +t1.e-d*t1.a+17-b*(abs(t1.f)/abs( -a))-case when 19>=e then ~t1.a*case when t1.e>19 and t1.f<>d then t1.a else t1.d end | b*e else 17 end+t1.a=17 then t1.c else t1.b end when 17 then t1.b else t1.b end FROM t1 WHERE case when c<=13*t1.a then 11 else -case when t1.f*e>= -((19)) then case when a>=t1.c then t1.d*e else b end else coalesce((select t1.b from t1 where 11+d-17-t1.d-t1.b not in (case d-17 when f then t1.d else t1.b end,e,t1.c)),t1.c) end*19 end<>b} -} {200} -do_test randexpr-2.1425 { - db eval {SELECT case t1.d | t1.f+(e)+case when +t1.e-d*t1.a+17-b*(abs(t1.f)/abs( -a))-case when 19>=e then ~t1.a*case when t1.e>19 and t1.f<>d then t1.a else t1.d end | b*e else 17 end+t1.a=17 then t1.c else t1.b end when 17 then t1.b else t1.b end FROM t1 WHERE NOT (case when c<=13*t1.a then 11 else -case when t1.f*e>= -((19)) then case when a>=t1.c then t1.d*e else b end else coalesce((select t1.b from t1 where 11+d-17-t1.d-t1.b not in (case d-17 when f then t1.d else t1.b end,e,t1.c)),t1.c) end*19 end<>b)} -} {} -do_test randexpr-2.1426 { - db eval {SELECT case t1.d & t1.f+(e)+case when +t1.e-d*t1.a+17-b*(abs(t1.f)/abs( -a))-case when 19>=e then ~t1.a*case when t1.e>19 and t1.f<>d then t1.a else t1.d end & b*e else 17 end+t1.a=17 then t1.c else t1.b end when 17 then t1.b else t1.b end FROM t1 WHERE case when c<=13*t1.a then 11 else -case when t1.f*e>= -((19)) then case when a>=t1.c then t1.d*e else b end else coalesce((select t1.b from t1 where 11+d-17-t1.d-t1.b not in (case d-17 when f then t1.d else t1.b end,e,t1.c)),t1.c) end*19 end<>b} -} {200} -do_test randexpr-2.1427 { - db eval {SELECT (coalesce((select max(~t1.d*19*t1.f) from t1 where (abs(17)/abs(t1.f-case when not exists(select 1 from t1 where case when a in (f,t1.a,c) then c when t1.a not in (13,t1.c,a) then e else t1.a end in (select abs(abs(min(t1.e))) from t1 union select cast(avg(11) AS integer) from t1)) or c13 or t1.e in (e,t1.c,d)),t1.e) | 13)-d*e FROM t1 WHERE 11 in (select max(+(select max(d | b) from t1)*17-e) from t1 union select (cast(avg(+a-+((coalesce((select t1.e from t1 where exists(select 1 from t1 where (abs( -case when coalesce((select max(b-17) from t1 where not exists(select 1 from t1 where t1.f not between a and 11)),t1.c) in (select t1.d from t1 union select (17) from t1) then t1.c else ( - -t1.d) end)/abs(t1.f))+11>f)),b)))*19) AS integer))-count(distinct t1.f) from t1)} -} {} -do_test randexpr-2.1428 { - db eval {SELECT (coalesce((select max(~t1.d*19*t1.f) from t1 where (abs(17)/abs(t1.f-case when not exists(select 1 from t1 where case when a in (f,t1.a,c) then c when t1.a not in (13,t1.c,a) then e else t1.a end in (select abs(abs(min(t1.e))) from t1 union select cast(avg(11) AS integer) from t1)) or c13 or t1.e in (e,t1.c,d)),t1.e) | 13)-d*e FROM t1 WHERE NOT (11 in (select max(+(select max(d | b) from t1)*17-e) from t1 union select (cast(avg(+a-+((coalesce((select t1.e from t1 where exists(select 1 from t1 where (abs( -case when coalesce((select max(b-17) from t1 where not exists(select 1 from t1 where t1.f not between a and 11)),t1.c) in (select t1.d from t1 union select (17) from t1) then t1.c else ( - -t1.d) end)/abs(t1.f))+11>f)),b)))*19) AS integer))-count(distinct t1.f) from t1))} -} {-4771395} -do_test randexpr-2.1429 { - db eval {SELECT (coalesce((select max(~t1.d*19*t1.f) from t1 where (abs(17)/abs(t1.f-case when not exists(select 1 from t1 where case when a in (f,t1.a,c) then c when t1.a not in (13,t1.c,a) then e else t1.a end in (select abs(abs(min(t1.e))) from t1 union select cast(avg(11) AS integer) from t1)) or c13 or t1.e in (e,t1.c,d)),t1.e) & 13)-d*e FROM t1 WHERE NOT (11 in (select max(+(select max(d | b) from t1)*17-e) from t1 union select (cast(avg(+a-+((coalesce((select t1.e from t1 where exists(select 1 from t1 where (abs( -case when coalesce((select max(b-17) from t1 where not exists(select 1 from t1 where t1.f not between a and 11)),t1.c) in (select t1.d from t1 union select (17) from t1) then t1.c else ( - -t1.d) end)/abs(t1.f))+11>f)),b)))*19) AS integer))-count(distinct t1.f) from t1))} -} {-199992} -do_test randexpr-2.1430 { - db eval {SELECT coalesce((select t1.e from t1 where +~case when d-(abs(+t1.b)/abs( -19*t1.c-(select (abs( -cast(avg((abs(d)/abs(t1.d))) AS integer))) from t1)))+11<19 then t1.a-19-a-f when not (c in (case f when t1.a then 17 else 11 end-a,t1.d, -e)) then 17 else (t1.b) end(t1.b) then t1.d when (not exists(select 1 from t1 where t1.f<>t1.c)) then t1.b else 17 end-e)-19)} -} {500} -do_test randexpr-2.1431 { - db eval {SELECT coalesce((select t1.e from t1 where +~case when d-(abs(+t1.b)/abs( -19*t1.c-(select (abs( -cast(avg((abs(d)/abs(t1.d))) AS integer))) from t1)))+11<19 then t1.a-19-a-f when not (c in (case f when t1.a then 17 else 11 end-a,t1.d, -e)) then 17 else (t1.b) end(t1.b) then t1.d when (not exists(select 1 from t1 where t1.f<>t1.c)) then t1.b else 17 end-e)-19))} -} {} -do_test randexpr-2.1432 { - db eval {SELECT case when (abs(17)/abs(t1.e))=case when (exists(select 1 from t1 where not exists(select 1 from t1 where t1.f<>19))) then coalesce((select 11 from t1 where not exists(select 1 from t1 where t1.e not in ( -t1.d,(b),t1.d))),t1.a)+t1.f*11 else t1.a end then b else e end)),17)) from t1) not in (13,e,17) then t1.e else 11 end FROM t1 WHERE not (t1.e<>coalesce((select (case t1.c when (coalesce((select 19 from t1 where (case when not exists(select 1 from t1 where e not in (c,e,t1.f)) then t1.f | t1.a else t1.a end in (d,19,t1.a)) or t1.f<=t1.c),+13))*t1.b-t1.d then -t1.c else b end) from t1 where 17=case when (exists(select 1 from t1 where not exists(select 1 from t1 where t1.f<>19))) then coalesce((select 11 from t1 where not exists(select 1 from t1 where t1.e not in ( -t1.d,(b),t1.d))),t1.a)+t1.f*11 else t1.a end then b else e end)),17)) from t1) not in (13,e,17) then t1.e else 11 end FROM t1 WHERE NOT (not (t1.e<>coalesce((select (case t1.c when (coalesce((select 19 from t1 where (case when not exists(select 1 from t1 where e not in (c,e,t1.f)) then t1.f | t1.a else t1.a end in (d,19,t1.a)) or t1.f<=t1.c),+13))*t1.b-t1.d then -t1.c else b end) from t1 where 17 -19 then e when a in (17,d,t1.f) then -t1.f else f end)+count(*)-max(t1.f) | count(distinct t1.a) | cast(avg(t1.c) AS integer)) | -max(a) from t1) end end FROM t1 WHERE a | t1.c in (select f from t1 union select case -t1.c when (abs(c | t1.c)/abs(17)) then (abs(t1.e)/abs(t1.c))+~19 else coalesce((select b from t1 where 11<=case d+coalesce((select max((select ( -(cast(avg(17) AS integer)))*max(t1.e)-max(t1.d)*cast(avg(t1.e) AS integer) from t1)) from t1 where (abs(case t1.f when 19 then b else t1.c end)/abs(t1.e))=b),d)*t1.f when -t1.b then t1.d else 19 end),a) end+d+e from t1)} -} {} -do_test randexpr-2.1435 { - db eval {SELECT (select max(t1.c) from t1) | case when d=(abs(t1.d)/abs(t1.b)) then 19 else case b when a then b+17+c-t1.d+d-a*t1.c else e+t1.f+ -(select abs(~+count(distinct case when b -19 then e when a in (17,d,t1.f) then -t1.f else f end)+count(*)-max(t1.f) | count(distinct t1.a) | cast(avg(t1.c) AS integer)) | -max(a) from t1) end end FROM t1 WHERE NOT (a | t1.c in (select f from t1 union select case -t1.c when (abs(c | t1.c)/abs(17)) then (abs(t1.e)/abs(t1.c))+~19 else coalesce((select b from t1 where 11<=case d+coalesce((select max((select ( -(cast(avg(17) AS integer)))*max(t1.e)-max(t1.d)*cast(avg(t1.e) AS integer) from t1)) from t1 where (abs(case t1.f when 19 then b else t1.c end)/abs(t1.e))=b),d)*t1.f when -t1.b then t1.d else 19 end),a) end+d+e from t1))} -} {1391} -do_test randexpr-2.1436 { - db eval {SELECT (select max(t1.c) from t1) & case when d=(abs(t1.d)/abs(t1.b)) then 19 else case b when a then b+17+c-t1.d+d-a*t1.c else e+t1.f+ -(select abs(~+count(distinct case when b -19 then e when a in (17,d,t1.f) then -t1.f else f end)+count(*)-max(t1.f) & count(distinct t1.a) & cast(avg(t1.c) AS integer)) & -max(a) from t1) end end FROM t1 WHERE NOT (a | t1.c in (select f from t1 union select case -t1.c when (abs(c | t1.c)/abs(17)) then (abs(t1.e)/abs(t1.c))+~19 else coalesce((select b from t1 where 11<=case d+coalesce((select max((select ( -(cast(avg(17) AS integer)))*max(t1.e)-max(t1.d)*cast(avg(t1.e) AS integer) from t1)) from t1 where (abs(case t1.f when 19 then b else t1.c end)/abs(t1.e))=b),d)*t1.f when -t1.b then t1.d else 19 end),a) end+d+e from t1))} -} {12} -do_test randexpr-2.1437 { - db eval {SELECT case e*case when case coalesce((select max(13) from t1 where exists(select 1 from t1 where t1.a in (17,b,17))),t1.e)-t1.c when c then 19 else -t1.d end+17 in (t1.d,c,11) or b<= -( - -a) then ~(a) when f in (select case case (max(e)) when count(*) then max(17) else (max(17)) end+count(distinct e)- -count(distinct d) when -count(*) then -count(distinct d) else ((min(t1.f))) end from t1 union select min( -19) from t1) then c else (13) end when b then t1.b else f end FROM t1 WHERE t1.b17 or (t1.c in (19,c,a))) then 13 else c end-11+11*11) then t1.e when (11)<13 then - -t1.c else t1.d end FROM t1 WHERE ((t1.c+17 not between case b*(11-coalesce((select max(t1.a) from t1 where ~case when (not t1.d*17=f) then t1.c-13+c else t1.d end+t1.c>=(b)),b)*e) when t1.f then b else f end-f- -17 and d or t1.d not in (t1.c,11,b)))} -} {300} -do_test randexpr-2.1440 { - db eval {SELECT case when d in (c,t1.a*19,+++case when exists(select 1 from t1 where case 17 when ~t1.b then f-e*~b-17+ -t1.c else c end<>17 or (t1.c in (19,c,a))) then 13 else c end-11+11*11) then t1.e when (11)<13 then - -t1.c else t1.d end FROM t1 WHERE NOT (((t1.c+17 not between case b*(11-coalesce((select max(t1.a) from t1 where ~case when (not t1.d*17=f) then t1.c-13+c else t1.d end+t1.c>=(b)),b)*e) when t1.f then b else f end-f- -17 and d or t1.d not in (t1.c,11,b))))} -} {} -do_test randexpr-2.1441 { - db eval {SELECT t1.e*coalesce((select 17 from t1 where (19>(abs(case coalesce((select coalesce((select ~11 from t1 where b not between (13) and b),17) from t1 where 19 not between e+b+13 and -t1.d),t1.f) when d then t1.e else t1.d end-e | f)/abs((e)))) and (t1.b<=a and 11<> - -t1.e) and t1.dt1.a | t1.c} -} {} -do_test randexpr-2.1442 { - db eval {SELECT t1.e*coalesce((select 17 from t1 where (19>(abs(case coalesce((select coalesce((select ~11 from t1 where b not between (13) and b),17) from t1 where 19 not between e+b+13 and -t1.d),t1.f) when d then t1.e else t1.d end-e | f)/abs((e)))) and (t1.b<=a and 11<> - -t1.e) and t1.dt1.a | t1.c)} -} {150000} -do_test randexpr-2.1443 { - db eval {SELECT t1.e*coalesce((select 17 from t1 where (19>(abs(case coalesce((select coalesce((select ~11 from t1 where b not between (13) and b),17) from t1 where 19 not between e+b+13 and -t1.d),t1.f) when d then t1.e else t1.d end-e & f)/abs((e)))) and (t1.b<=a and 11<> - -t1.e) and t1.dt1.a | t1.c)} -} {150000} -do_test randexpr-2.1444 { - db eval {SELECT ~coalesce((select max(t1.a) from t1 where ((t1.c)<=case 11-~t1.b++(t1.a+ -c)*t1.d-b | d when ~e then 17 else (abs(f)/abs(t1.f-t1.c)) end-19 | b-~t1.e*a-t1.b | +c)),b)*a FROM t1 WHERE not exists(select 1 from t1 where t1.a=((abs(coalesce((select coalesce((select max(+d) from t1 where not exists(select 1 from t1 where -t1.d in (select -max(13)-(min((t1.a))) from t1 union select count(distinct f) from t1)) and 11 in (select f from t1 union select 17 from t1) and a<>13),case when e>(11) then -c else d end) from t1 where e<>11 and et1.e))))} -} {} -do_test randexpr-2.1445 { - db eval {SELECT ~coalesce((select max(t1.a) from t1 where ((t1.c)<=case 11-~t1.b++(t1.a+ -c)*t1.d-b | d when ~e then 17 else (abs(f)/abs(t1.f-t1.c)) end-19 | b-~t1.e*a-t1.b | +c)),b)*a FROM t1 WHERE NOT (not exists(select 1 from t1 where t1.a=((abs(coalesce((select coalesce((select max(+d) from t1 where not exists(select 1 from t1 where -t1.d in (select -max(13)-(min((t1.a))) from t1 union select count(distinct f) from t1)) and 11 in (select f from t1 union select 17 from t1) and a<>13),case when e>(11) then -c else d end) from t1 where e<>11 and et1.e)))))} -} {-20100} -do_test randexpr-2.1446 { - db eval {SELECT ~coalesce((select max(t1.a) from t1 where ((t1.c)<=case 11-~t1.b++(t1.a+ -c)*t1.d-b & d when ~e then 17 else (abs(f)/abs(t1.f-t1.c)) end-19 & b-~t1.e*a-t1.b & +c)),b)*a FROM t1 WHERE NOT (not exists(select 1 from t1 where t1.a=((abs(coalesce((select coalesce((select max(+d) from t1 where not exists(select 1 from t1 where -t1.d in (select -max(13)-(min((t1.a))) from t1 union select count(distinct f) from t1)) and 11 in (select f from t1 union select 17 from t1) and a<>13),case when e>(11) then -c else d end) from t1 where e<>11 and et1.e)))))} -} {-20100} -do_test randexpr-2.1447 { - db eval {SELECT (select count(distinct ~(((abs(b-a)/abs(case (select min((select case cast(avg(11+t1.e) AS integer) when case min( -~coalesce((select 13 from t1 where case t1.e when f then d else 17 end>=b),e)) when case max(t1.b) when (~ -count(*)+(( -max( -t1.a)))-(count(*))) then -count(distinct (t1.c)) else min( -t1.e) end then count(*) else cast(avg( -(e)) AS integer) end then cast(avg(13) AS integer) else max(17) end from t1)) from t1) when 13 then c else (d) end))))) from t1)*t1.b FROM t1 WHERE not t1.c>=t1.b} -} {} -do_test randexpr-2.1448 { - db eval {SELECT (select count(distinct ~(((abs(b-a)/abs(case (select min((select case cast(avg(11+t1.e) AS integer) when case min( -~coalesce((select 13 from t1 where case t1.e when f then d else 17 end>=b),e)) when case max(t1.b) when (~ -count(*)+(( -max( -t1.a)))-(count(*))) then -count(distinct (t1.c)) else min( -t1.e) end then count(*) else cast(avg( -(e)) AS integer) end then cast(avg(13) AS integer) else max(17) end from t1)) from t1) when 13 then c else (d) end))))) from t1)*t1.b FROM t1 WHERE NOT (not t1.c>=t1.b)} -} {200} -do_test randexpr-2.1449 { - db eval {SELECT coalesce((select max(coalesce((select max(13) from t1 where t1.b in (select e from t1 union select t1.e from t1)),t1.a)) from t1 where case when t1.d=case when d not between t1.a and case when not t1.c in ((t1.e),a,t1.c) then 19 | t1.c when a not between 19 and b then (19) else 13 end then t1.d else b end-11 and not t1.f=t1.c or 19 not in (t1.d,c, -t1.f) and 17< -t1.d then e when t1.b not between 17 and t1.b then f else d end<11),t1.c)*f FROM t1 WHERE t1.b<=(coalesce((select c from t1 where e in (t1.a,t1.c,case when 17 not between 19 and (19)-t1.a-(abs(coalesce((select d from t1 where case (t1.b+e*b*t1.c) when 13 then t1.b else 19 end<>19),17))/abs(a))*t1.a then 17 when exists(select 1 from t1 where ( -e)=a) or 13>=d then 17 else t1.f end)),c))} -} {180000} -do_test randexpr-2.1450 { - db eval {SELECT coalesce((select max(coalesce((select max(13) from t1 where t1.b in (select e from t1 union select t1.e from t1)),t1.a)) from t1 where case when t1.d=case when d not between t1.a and case when not t1.c in ((t1.e),a,t1.c) then 19 | t1.c when a not between 19 and b then (19) else 13 end then t1.d else b end-11 and not t1.f=t1.c or 19 not in (t1.d,c, -t1.f) and 17< -t1.d then e when t1.b not between 17 and t1.b then f else d end<11),t1.c)*f FROM t1 WHERE NOT (t1.b<=(coalesce((select c from t1 where e in (t1.a,t1.c,case when 17 not between 19 and (19)-t1.a-(abs(coalesce((select d from t1 where case (t1.b+e*b*t1.c) when 13 then t1.b else 19 end<>19),17))/abs(a))*t1.a then 17 when exists(select 1 from t1 where ( -e)=a) or 13>=d then 17 else t1.f end)),c)))} -} {} -do_test randexpr-2.1451 { - db eval {SELECT coalesce((select max(coalesce((select max(13) from t1 where t1.b in (select e from t1 union select t1.e from t1)),t1.a)) from t1 where case when t1.d=case when d not between t1.a and case when not t1.c in ((t1.e),a,t1.c) then 19 & t1.c when a not between 19 and b then (19) else 13 end then t1.d else b end-11 and not t1.f=t1.c or 19 not in (t1.d,c, -t1.f) and 17< -t1.d then e when t1.b not between 17 and t1.b then f else d end<11),t1.c)*f FROM t1 WHERE t1.b<=(coalesce((select c from t1 where e in (t1.a,t1.c,case when 17 not between 19 and (19)-t1.a-(abs(coalesce((select d from t1 where case (t1.b+e*b*t1.c) when 13 then t1.b else 19 end<>19),17))/abs(a))*t1.a then 17 when exists(select 1 from t1 where ( -e)=a) or 13>=d then 17 else t1.f end)),c))} -} {180000} -do_test randexpr-2.1452 { - db eval {SELECT (d)+(select -abs(+cast(avg((select max((coalesce((select d from t1 where case when 13>=e then t1.c else 19 end>=d),coalesce((select 19-(select count(distinct 19 | (abs(19)/abs(~13))) from t1) | t1.d from t1 where coalesce((select max(11) from t1 where t1.a in (select t1.d from t1 union select c from t1)),19)>t1.d),e)+t1.b))) from t1)) AS integer)+abs( -max(b))) from t1) FROM t1 WHERE c-t1.c not between t1.c and +case when +case -case when 17 not in (17,(e),t1.c) then a else 19 end-13 when t1.e then b else 13 end>19 or 17 in (select b from t1 union select t1.c from t1) then case c when t1.c then d else c end when not t1.f in (select -cast(avg(a) AS integer)*count(distinct (17))+min(f)* - - -cast(avg(b) AS integer) from t1 union select (count(*)) from t1) then d else a end} -} {-500} -do_test randexpr-2.1453 { - db eval {SELECT (d)+(select -abs(+cast(avg((select max((coalesce((select d from t1 where case when 13>=e then t1.c else 19 end>=d),coalesce((select 19-(select count(distinct 19 | (abs(19)/abs(~13))) from t1) | t1.d from t1 where coalesce((select max(11) from t1 where t1.a in (select t1.d from t1 union select c from t1)),19)>t1.d),e)+t1.b))) from t1)) AS integer)+abs( -max(b))) from t1) FROM t1 WHERE NOT (c-t1.c not between t1.c and +case when +case -case when 17 not in (17,(e),t1.c) then a else 19 end-13 when t1.e then b else 13 end>19 or 17 in (select b from t1 union select t1.c from t1) then case c when t1.c then d else c end when not t1.f in (select -cast(avg(a) AS integer)*count(distinct (17))+min(f)* - - -cast(avg(b) AS integer) from t1 union select (count(*)) from t1) then d else a end)} -} {} -do_test randexpr-2.1454 { - db eval {SELECT (d)+(select -abs(+cast(avg((select max((coalesce((select d from t1 where case when 13>=e then t1.c else 19 end>=d),coalesce((select 19-(select count(distinct 19 & (abs(19)/abs(~13))) from t1) & t1.d from t1 where coalesce((select max(11) from t1 where t1.a in (select t1.d from t1 union select c from t1)),19)>t1.d),e)+t1.b))) from t1)) AS integer)+abs( -max(b))) from t1) FROM t1 WHERE c-t1.c not between t1.c and +case when +case -case when 17 not in (17,(e),t1.c) then a else 19 end-13 when t1.e then b else 13 end>19 or 17 in (select b from t1 union select t1.c from t1) then case c when t1.c then d else c end when not t1.f in (select -cast(avg(a) AS integer)*count(distinct (17))+min(f)* - - -cast(avg(b) AS integer) from t1 union select (count(*)) from t1) then d else a end} -} {-500} -do_test randexpr-2.1455 { - db eval {SELECT case when 19 in (case when coalesce((select max(case when e*t1.b in (coalesce((select t1.a from t1 where (abs(f)/abs(coalesce((select f from t1 where t1.f in (a,b,t1.d)),13))) in (b,b,11)),c),t1.a,17) then b else d end) from t1 where f>=13 and a>=17 and not exists(select 1 from t1 where (b<>f))), -t1.c) between d and 11 then d else t1.f end,t1.c,11) then 13 else 17 end FROM t1 WHERE t1.d in (select (abs(t1.a)/abs(t1.f)) from t1 union select e from t1) and ((b*coalesce((select -11 from t1 where (coalesce((select max( -t1.e+ -coalesce((select d from t1 where t1.c<= - -t1.d),t1.c)) from t1 where b in (select -count(distinct d)+count(distinct d)- -((min(e))) from t1 union select count(*) from t1)),(t1.e))-19*d<>t1.e)),a)*t1.f)=b)} -} {} -do_test randexpr-2.1456 { - db eval {SELECT case when 19 in (case when coalesce((select max(case when e*t1.b in (coalesce((select t1.a from t1 where (abs(f)/abs(coalesce((select f from t1 where t1.f in (a,b,t1.d)),13))) in (b,b,11)),c),t1.a,17) then b else d end) from t1 where f>=13 and a>=17 and not exists(select 1 from t1 where (b<>f))), -t1.c) between d and 11 then d else t1.f end,t1.c,11) then 13 else 17 end FROM t1 WHERE NOT (t1.d in (select (abs(t1.a)/abs(t1.f)) from t1 union select e from t1) and ((b*coalesce((select -11 from t1 where (coalesce((select max( -t1.e+ -coalesce((select d from t1 where t1.c<= - -t1.d),t1.c)) from t1 where b in (select -count(distinct d)+count(distinct d)- -((min(e))) from t1 union select count(*) from t1)),(t1.e))-19*d<>t1.e)),a)*t1.f)=b))} -} {17} -do_test randexpr-2.1457 { - db eval {SELECT coalesce((select max((select count(*) from t1)) from t1 where coalesce((select max(t1.a-coalesce((select t1.d+case when exists(select 1 from t1 where exists(select 1 from t1 where t1.f between t1.a and f)) or d | b between 19 and 19 then f+17 else (t1.b) end from t1 where t1.e not between -t1.d and (19)),(17))) from t1 where not exists(select 1 from t1 where 19 between t1.b and 13 or t1.b>t1.c) or 19>=19),b) between 13 and f), -t1.a) FROM t1 WHERE exists(select 1 from t1 where +t1.f+t1.e<(abs(t1.b)/abs( -f*e))) or case t1.c when case when 19 not between 17 and case when t1.e<>e then t1.b when not exists(select 1 from t1 where coalesce((select max(b) from t1 where (et1.d or (t1.d<>t1.e)) then t1.c else 17 end then t1.c when e<>b then 17 else e end then t1.d else t1.e end between d and b} -} {} -do_test randexpr-2.1458 { - db eval {SELECT coalesce((select max((select count(*) from t1)) from t1 where coalesce((select max(t1.a-coalesce((select t1.d+case when exists(select 1 from t1 where exists(select 1 from t1 where t1.f between t1.a and f)) or d | b between 19 and 19 then f+17 else (t1.b) end from t1 where t1.e not between -t1.d and (19)),(17))) from t1 where not exists(select 1 from t1 where 19 between t1.b and 13 or t1.b>t1.c) or 19>=19),b) between 13 and f), -t1.a) FROM t1 WHERE NOT (exists(select 1 from t1 where +t1.f+t1.e<(abs(t1.b)/abs( -f*e))) or case t1.c when case when 19 not between 17 and case when t1.e<>e then t1.b when not exists(select 1 from t1 where coalesce((select max(b) from t1 where (et1.d or (t1.d<>t1.e)) then t1.c else 17 end then t1.c when e<>b then 17 else e end then t1.d else t1.e end between d and b)} -} {-100} -do_test randexpr-2.1459 { - db eval {SELECT coalesce((select max((select count(*) from t1)) from t1 where coalesce((select max(t1.a-coalesce((select t1.d+case when exists(select 1 from t1 where exists(select 1 from t1 where t1.f between t1.a and f)) or d & b between 19 and 19 then f+17 else (t1.b) end from t1 where t1.e not between -t1.d and (19)),(17))) from t1 where not exists(select 1 from t1 where 19 between t1.b and 13 or t1.b>t1.c) or 19>=19),b) between 13 and f), -t1.a) FROM t1 WHERE NOT (exists(select 1 from t1 where +t1.f+t1.e<(abs(t1.b)/abs( -f*e))) or case t1.c when case when 19 not between 17 and case when t1.e<>e then t1.b when not exists(select 1 from t1 where coalesce((select max(b) from t1 where (et1.d or (t1.d<>t1.e)) then t1.c else 17 end then t1.c when e<>b then 17 else e end then t1.d else t1.e end between d and b)} -} {-100} -do_test randexpr-2.1460 { - db eval {SELECT case when not case 11 when t1.e*coalesce((select max(t1.b) from t1 where (abs(t1.c)/abs(~11)) not between coalesce((select max((abs(a)/abs(c))) from t1 where t1.b>=t1.a or b= -e),t1.f) and e and c not in (t1.a,t1.f,t1.c) and not (a)17 then c else a end | t1.b,a) or not (t1.d<11)),d) from t1 union select t1.a from t1) and f in (select b from t1 union select b from t1))} -} {100} -do_test randexpr-2.1461 { - db eval {SELECT case when not case 11 when t1.e*coalesce((select max(t1.b) from t1 where (abs(t1.c)/abs(~11)) not between coalesce((select max((abs(a)/abs(c))) from t1 where t1.b>=t1.a or b= -e),t1.f) and e and c not in (t1.a,t1.f,t1.c) and not (a)17 then c else a end | t1.b,a) or not (t1.d<11)),d) from t1 union select t1.a from t1) and f in (select b from t1 union select b from t1)))} -} {} -do_test randexpr-2.1462 { - db eval {SELECT case when case when coalesce((select max(case when ((a<=case t1.a+t1.a when t1.d then -c else b end or t1.b<>e)) then 17 else 19*19*a end*13) from t1 where d<>t1.d),d)<=a or 11<=t1.e then t1.c when 17<11 then 17 else e end<=t1.a then t1.d when e= -e then t1.d else 19 end FROM t1 WHERE t1.e<=t1.a or (abs(+a+coalesce((select max(t1.b) from t1 where (select ~count(distinct 17) from t1)-b in (select t1.b+t1.b from t1 union select 19 from t1)), -11))/abs(case when not exists(select 1 from t1 where t1.d not between 17 and c- -c+e) or t1.e>t1.f then t1.d when t1.d not in (17,e,d) then a else 17 end)) in (c,d,11)} -} {} -do_test randexpr-2.1463 { - db eval {SELECT case when case when coalesce((select max(case when ((a<=case t1.a+t1.a when t1.d then -c else b end or t1.b<>e)) then 17 else 19*19*a end*13) from t1 where d<>t1.d),d)<=a or 11<=t1.e then t1.c when 17<11 then 17 else e end<=t1.a then t1.d when e= -e then t1.d else 19 end FROM t1 WHERE NOT (t1.e<=t1.a or (abs(+a+coalesce((select max(t1.b) from t1 where (select ~count(distinct 17) from t1)-b in (select t1.b+t1.b from t1 union select 19 from t1)), -11))/abs(case when not exists(select 1 from t1 where t1.d not between 17 and c- -c+e) or t1.e>t1.f then t1.d when t1.d not in (17,e,d) then a else 17 end)) in (c,d,11))} -} {19} -do_test randexpr-2.1464 { - db eval {SELECT ~case when t1.e<=t1.a then b else (11) end+(select -((cast(avg(coalesce((select a from t1 where (select cast(avg(t1.d) AS integer) | case case min((t1.e)) when cast(avg(t1.b) AS integer) then max(t1.c) else max(19) end*count(*) when -count(distinct e) then count(*) else max( - -17) end from t1) not between c and -t1.e-f+f),11)-11) AS integer)))*max(e) from t1)+e* - -a-t1.d*e FROM t1 WHERE coalesce((select max(case when 11 between d and d then e | b else case (select (case count(distinct coalesce((select -coalesce((select max(t1.f) from t1 where t1.b in (select 11 from t1 union select 19 from t1)),t1.e) from t1 where 13<>17),17)) when (max( -t1.e)) then max(17)+max(11) else ((count(*))) end)*(count(*)) from t1) when 11 then -13+19 else t1.e end end) from t1 where ((t1.a not between d and -t1.c))),t1.a)<11} -} {} -do_test randexpr-2.1465 { - db eval {SELECT ~case when t1.e<=t1.a then b else (11) end+(select -((cast(avg(coalesce((select a from t1 where (select cast(avg(t1.d) AS integer) | case case min((t1.e)) when cast(avg(t1.b) AS integer) then max(t1.c) else max(19) end*count(*) when -count(distinct e) then count(*) else max( - -17) end from t1) not between c and -t1.e-f+f),11)-11) AS integer)))*max(e) from t1)+e* - -a-t1.d*e FROM t1 WHERE NOT (coalesce((select max(case when 11 between d and d then e | b else case (select (case count(distinct coalesce((select -coalesce((select max(t1.f) from t1 where t1.b in (select 11 from t1 union select 19 from t1)),t1.e) from t1 where 13<>17),17)) when (max( -t1.e)) then max(17)+max(11) else ((count(*))) end)*(count(*)) from t1) when 11 then -13+19 else t1.e end end) from t1 where ((t1.a not between d and -t1.c))),t1.a)<11)} -} {-194512} -do_test randexpr-2.1466 { - db eval {SELECT ~case when t1.e<=t1.a then b else (11) end+(select -((cast(avg(coalesce((select a from t1 where (select cast(avg(t1.d) AS integer) & case case min((t1.e)) when cast(avg(t1.b) AS integer) then max(t1.c) else max(19) end*count(*) when -count(distinct e) then count(*) else max( - -17) end from t1) not between c and -t1.e-f+f),11)-11) AS integer)))*max(e) from t1)+e* - -a-t1.d*e FROM t1 WHERE NOT (coalesce((select max(case when 11 between d and d then e | b else case (select (case count(distinct coalesce((select -coalesce((select max(t1.f) from t1 where t1.b in (select 11 from t1 union select 19 from t1)),t1.e) from t1 where 13<>17),17)) when (max( -t1.e)) then max(17)+max(11) else ((count(*))) end)*(count(*)) from t1) when 11 then -13+19 else t1.e end end) from t1 where ((t1.a not between d and -t1.c))),t1.a)<11)} -} {-194512} -do_test randexpr-2.1467 { - db eval {SELECT t1.e*~13-t1.a-~case when (abs(t1.a)/abs(coalesce((select max(t1.a) from t1 where e not between f and e-t1.b+13),case when (a in (select ( -c) from t1 union select 11 from t1) or exists(select 1 from t1 where 11 between f and t1.f)) then t1.b-a else -t1.e end)+13*t1.f)) | 13 -19-a then (a)-coalesce((select max(case when a in (13,t1.b,11) then t1.b else (13) end) from t1 where not exists(select 1 from t1 where t1.b>=b)),t1.c) else -13 end)*(a)<17)} -} {} -do_test randexpr-2.1468 { - db eval {SELECT t1.e*~13-t1.a-~case when (abs(t1.a)/abs(coalesce((select max(t1.a) from t1 where e not between f and e-t1.b+13),case when (a in (select ( -c) from t1 union select 11 from t1) or exists(select 1 from t1 where 11 between f and t1.f)) then t1.b-a else -t1.e end)+13*t1.f)) | 13 -19-a then (a)-coalesce((select max(case when a in (13,t1.b,11) then t1.b else (13) end) from t1 where not exists(select 1 from t1 where t1.b>=b)),t1.c) else -13 end)*(a)<17))} -} {-6499} -do_test randexpr-2.1469 { - db eval {SELECT t1.e*~13-t1.a-~case when (abs(t1.a)/abs(coalesce((select max(t1.a) from t1 where e not between f and e-t1.b+13),case when (a in (select ( -c) from t1 union select 11 from t1) or exists(select 1 from t1 where 11 between f and t1.f)) then t1.b-a else -t1.e end)+13*t1.f)) & 13 -19-a then (a)-coalesce((select max(case when a in (13,t1.b,11) then t1.b else (13) end) from t1 where not exists(select 1 from t1 where t1.b>=b)),t1.c) else -13 end)*(a)<17))} -} {-6499} -do_test randexpr-2.1470 { - db eval {SELECT coalesce((select max(f*b | case when f in (t1.b,t1.b*(select count(*) from t1)+(select -count(*) from t1), -b) and +13<(abs( -~d-case when t1.a in (select -f from t1 union select t1.c from t1) then (t1.a) when t1.a=a),coalesce((select 11 from t1 where 11 not between 19 and t1.c),t1.a))-19 when t1.e then t1.f else e end)) from t1 union select -d from t1) then d when t1.f between 17 and d then t1.d else t1.d end and (f) or d<17} -} {} -do_test randexpr-2.1471 { - db eval {SELECT coalesce((select max(f*b | case when f in (t1.b,t1.b*(select count(*) from t1)+(select -count(*) from t1), -b) and +13<(abs( -~d-case when t1.a in (select -f from t1 union select t1.c from t1) then (t1.a) when t1.a=a),coalesce((select 11 from t1 where 11 not between 19 and t1.c),t1.a))-19 when t1.e then t1.f else e end)) from t1 union select -d from t1) then d when t1.f between 17 and d then t1.d else t1.d end and (f) or d<17)} -} {0} -do_test randexpr-2.1472 { - db eval {SELECT coalesce((select max(f*b & case when f in (t1.b,t1.b*(select count(*) from t1)+(select -count(*) from t1), -b) and +13<(abs( -~d-case when t1.a in (select -f from t1 union select t1.c from t1) then (t1.a) when t1.a=a),coalesce((select 11 from t1 where 11 not between 19 and t1.c),t1.a))-19 when t1.e then t1.f else e end)) from t1 union select -d from t1) then d when t1.f between 17 and d then t1.d else t1.d end and (f) or d<17)} -} {0} -do_test randexpr-2.1473 { - db eval {SELECT case when (t1.b+case when a in (select coalesce((select max(t1.a) from t1 where not exists(select 1 from t1 where 11=case e when (e) then t1.b else t1.c end or c in (t1.f,f,11))),t1.f) from t1 union select t1.d from t1) and t1.e<>e then t1.f when t1.a in (t1.d,a,13) then 17 else t1.d end not in (t1.f,t1.d,17)) or c<> -19 then b when fa-e then b else 19 end from t1 where 11<>t1.b),a) from t1 where not 19 in (select max(19)*count(distinct a) from t1 union select cast(avg(11) AS integer) from t1)),11) from t1 where t1.e<>a),17) then d else 19 end from t1 union select f from t1) and c in (select count(distinct c) from t1 union select -+max(d) | abs(count(*)) from t1)} -} {} -do_test randexpr-2.1474 { - db eval {SELECT case when (t1.b+case when a in (select coalesce((select max(t1.a) from t1 where not exists(select 1 from t1 where 11=case e when (e) then t1.b else t1.c end or c in (t1.f,f,11))),t1.f) from t1 union select t1.d from t1) and t1.e<>e then t1.f when t1.a in (t1.d,a,13) then 17 else t1.d end not in (t1.f,t1.d,17)) or c<> -19 then b when fa-e then b else 19 end from t1 where 11<>t1.b),a) from t1 where not 19 in (select max(19)*count(distinct a) from t1 union select cast(avg(11) AS integer) from t1)),11) from t1 where t1.e<>a),17) then d else 19 end from t1 union select f from t1) and c in (select count(distinct c) from t1 union select -+max(d) | abs(count(*)) from t1))} -} {200} -do_test randexpr-2.1475 { - db eval {SELECT 17+coalesce((select max(19) from t1 where -(select max(t1.d) from t1)>coalesce((select max((13)) from t1 where (coalesce((select 11 from t1 where -e-t1.d-b-(abs(t1.b)/abs(11))*t1.f*b-e not between (f) and t1.e or 11 in (t1.b,t1.e, -e)),t1.a) in (select t1.b from t1 union select 19 from t1)) and exists(select 1 from t1 where 13<19)),t1.e)),e) FROM t1 WHERE t1.a<>t1.d or not exists(select 1 from t1 where t1.a>=coalesce((select case t1.e*d when -case d*11 when t1.f then t1.e else t1.c end then 13*coalesce((select max(f*b*t1.e*t1.c) from t1 where t1.d in (select t1.c from t1 union select f from t1) or ((t1.ecoalesce((select max((13)) from t1 where (coalesce((select 11 from t1 where -e-t1.d-b-(abs(t1.b)/abs(11))*t1.f*b-e not between (f) and t1.e or 11 in (t1.b,t1.e, -e)),t1.a) in (select t1.b from t1 union select 19 from t1)) and exists(select 1 from t1 where 13<19)),t1.e)),e) FROM t1 WHERE NOT (t1.a<>t1.d or not exists(select 1 from t1 where t1.a>=coalesce((select case t1.e*d when -case d*11 when t1.f then t1.e else t1.c end then 13*coalesce((select max(f*b*t1.e*t1.c) from t1 where t1.d in (select t1.c from t1 union select f from t1) or ((t1.e=t1.a then f-coalesce((select -(select max((select min(a)-count(distinct c) from t1)) from t1) from t1 where a between f and d),c) else d end) and c or not exists(select 1 from t1 where 11<=13)),f)) then (e) else t1.b end FROM t1 WHERE not -c between -d+f | 17+t1.a and 11 or 11*e=(+case when c>=d then coalesce((select max(d-t1.f*f) from t1 where 11 in (select count(distinct t1.e) from t1 union select (~case count(*) when -max(t1.f) then count(distinct t1.d) else (cast(avg(t1.f) AS integer)) end) from t1)),t1.c) else d end+t1.b-t1.c+b)+t1.c- -(13)} -} {200} -do_test randexpr-2.1478 { - db eval {SELECT case +a when (coalesce((select d*f*t1.d from t1 where t1.f between (case when e* -13<~ - -t1.e then e when 13>=t1.a then f-coalesce((select -(select max((select min(a)-count(distinct c) from t1)) from t1) from t1 where a between f and d),c) else d end) and c or not exists(select 1 from t1 where 11<=13)),f)) then (e) else t1.b end FROM t1 WHERE NOT (not -c between -d+f | 17+t1.a and 11 or 11*e=(+case when c>=d then coalesce((select max(d-t1.f*f) from t1 where 11 in (select count(distinct t1.e) from t1 union select (~case count(*) when -max(t1.f) then count(distinct t1.d) else (cast(avg(t1.f) AS integer)) end) from t1)),t1.c) else d end+t1.b-t1.c+b)+t1.c- -(13))} -} {} -do_test randexpr-2.1479 { - db eval {SELECT case when case when not exists(select 1 from t1 where a between +d-case when t1.c+e not between case 11 when +t1.b+11 then 19 else -t1.f end+(11) and d and exists(select 1 from t1 where (a)>b) and not exists(select 1 from t1 where 11 in (a,11,t1.c)) then 19 else t1.a end and t1.a) then 17 when t1.d<>e then (t1.a) else e end-a<=e then c else 11 end FROM t1 WHERE coalesce((select a from t1 where not exists(select 1 from t1 where -t1.c not between b and t1.a)),case when t1.d<=19-13 then coalesce((select max((select count(*)*cast(avg(~t1.a-e*~17+t1.e) AS integer) from t1)) from t1 where (exists(select 1 from t1 where + - -e-11*a-t1.d in (11,(t1.b),c)))),19+e)* -b else c end)>=17} -} {300} -do_test randexpr-2.1480 { - db eval {SELECT case when case when not exists(select 1 from t1 where a between +d-case when t1.c+e not between case 11 when +t1.b+11 then 19 else -t1.f end+(11) and d and exists(select 1 from t1 where (a)>b) and not exists(select 1 from t1 where 11 in (a,11,t1.c)) then 19 else t1.a end and t1.a) then 17 when t1.d<>e then (t1.a) else e end-a<=e then c else 11 end FROM t1 WHERE NOT (coalesce((select a from t1 where not exists(select 1 from t1 where -t1.c not between b and t1.a)),case when t1.d<=19-13 then coalesce((select max((select count(*)*cast(avg(~t1.a-e*~17+t1.e) AS integer) from t1)) from t1 where (exists(select 1 from t1 where + - -e-11*a-t1.d in (11,(t1.b),c)))),19+e)* -b else c end)>=17)} -} {} -do_test randexpr-2.1481 { - db eval {SELECT coalesce((select t1.c-~t1.e*19++case t1.b when coalesce((select 17 from t1 where t1.f not between t1.c-+coalesce((select max(a+ -t1.c) from t1 where (select count(distinct 11) from t1) in (select -+case when a not between f and b or b>=t1.d then (t1.d) when a in (t1.e,b,13) then t1.d else t1.c end*a from t1 union select t1.f from t1)),f) and 17),a) | 17*c then 19 else d end+t1.c from t1 where e<>t1.b),19) FROM t1 WHERE not (t1.e not between ~17 and +t1.e*(~b)*e)} -} {} -do_test randexpr-2.1482 { - db eval {SELECT coalesce((select t1.c-~t1.e*19++case t1.b when coalesce((select 17 from t1 where t1.f not between t1.c-+coalesce((select max(a+ -t1.c) from t1 where (select count(distinct 11) from t1) in (select -+case when a not between f and b or b>=t1.d then (t1.d) when a in (t1.e,b,13) then t1.d else t1.c end*a from t1 union select t1.f from t1)),f) and 17),a) | 17*c then 19 else d end+t1.c from t1 where e<>t1.b),19) FROM t1 WHERE NOT (not (t1.e not between ~17 and +t1.e*(~b)*e))} -} {10519} -do_test randexpr-2.1483 { - db eval {SELECT coalesce((select t1.c-~t1.e*19++case t1.b when coalesce((select 17 from t1 where t1.f not between t1.c-+coalesce((select max(a+ -t1.c) from t1 where (select count(distinct 11) from t1) in (select -+case when a not between f and b or b>=t1.d then (t1.d) when a in (t1.e,b,13) then t1.d else t1.c end*a from t1 union select t1.f from t1)),f) and 17),a) & 17*c then 19 else d end+t1.c from t1 where e<>t1.b),19) FROM t1 WHERE NOT (not (t1.e not between ~17 and +t1.e*(~b)*e))} -} {10519} -do_test randexpr-2.1484 { - db eval {SELECT ~case when b<=(t1.c | (abs(d)/abs(a*f)))+case when (13*(t1.b) not in (19,b,t1.d)) and exists(select 1 from t1 where 19 between t1.d and 11) then (select case count(distinct t1.f) when +( -count(distinct c) | cast(avg(t1.d) AS integer)) then cast(avg(t1.c) AS integer) else min(f) end from t1) else 13 end*t1.c or exists(select 1 from t1 where -f in (select e from t1 union select -t1.a from t1)) then t1.d else t1.c end FROM t1 WHERE exists(select 1 from t1 where t1.c+b-t1.d between 11 and 17)} -} {} -do_test randexpr-2.1485 { - db eval {SELECT ~case when b<=(t1.c | (abs(d)/abs(a*f)))+case when (13*(t1.b) not in (19,b,t1.d)) and exists(select 1 from t1 where 19 between t1.d and 11) then (select case count(distinct t1.f) when +( -count(distinct c) | cast(avg(t1.d) AS integer)) then cast(avg(t1.c) AS integer) else min(f) end from t1) else 13 end*t1.c or exists(select 1 from t1 where -f in (select e from t1 union select -t1.a from t1)) then t1.d else t1.c end FROM t1 WHERE NOT (exists(select 1 from t1 where t1.c+b-t1.d between 11 and 17))} -} {-401} -do_test randexpr-2.1486 { - db eval {SELECT ~case when b<=(t1.c & (abs(d)/abs(a*f)))+case when (13*(t1.b) not in (19,b,t1.d)) and exists(select 1 from t1 where 19 between t1.d and 11) then (select case count(distinct t1.f) when +( -count(distinct c) & cast(avg(t1.d) AS integer)) then cast(avg(t1.c) AS integer) else min(f) end from t1) else 13 end*t1.c or exists(select 1 from t1 where -f in (select e from t1 union select -t1.a from t1)) then t1.d else t1.c end FROM t1 WHERE NOT (exists(select 1 from t1 where t1.c+b-t1.d between 11 and 17))} -} {-401} -do_test randexpr-2.1487 { - db eval {SELECT coalesce((select max(~coalesce((select 19+~coalesce((select (abs((19)*c+~t1.a-t1.a*19)/abs(case when t1.d<>t1.b then t1.f when 13<>19 then (11) else t1.c end)) from t1 where f= -t1.a or t1.d not between t1.d and -f),t1.f) from t1 where not exists(select 1 from t1 where -19 not between d and f)),d)*t1.a-f) from t1 where c not in (c,c,c)),t1.b) FROM t1 WHERE (coalesce((select max( -t1.d+19+11+coalesce((select a from t1 where 11 not between e and t1.d),t1.d)) from t1 where not ( -t1.f not between b and f) and t1.e in (b,11,f)),f)+t1.e<=19) or c>t1.d or e in (a,19,11) or t1.f>b or -t1.f<=13 and a between 11 and t1.a} -} {200} -do_test randexpr-2.1488 { - db eval {SELECT coalesce((select max(~coalesce((select 19+~coalesce((select (abs((19)*c+~t1.a-t1.a*19)/abs(case when t1.d<>t1.b then t1.f when 13<>19 then (11) else t1.c end)) from t1 where f= -t1.a or t1.d not between t1.d and -f),t1.f) from t1 where not exists(select 1 from t1 where -19 not between d and f)),d)*t1.a-f) from t1 where c not in (c,c,c)),t1.b) FROM t1 WHERE NOT ((coalesce((select max( -t1.d+19+11+coalesce((select a from t1 where 11 not between e and t1.d),t1.d)) from t1 where not ( -t1.f not between b and f) and t1.e in (b,11,f)),f)+t1.e<=19) or c>t1.d or e in (a,19,11) or t1.f>b or -t1.f<=13 and a between 11 and t1.a)} -} {} -do_test randexpr-2.1489 { - db eval {SELECT case t1.d when 17 then 11 | t1.a-17+13+t1.f*t1.e+t1.e-case when d | t1.e in (t1.b,t1.a,c) then -13 else (b*19) end-(select cast(avg(coalesce((select a from t1 where e in (t1.f,t1.b,f)), -e)) AS integer) from t1)*d-11-t1.e-t1.a else t1.f end FROM t1 WHERE d*13 in (select abs(min(d)) from t1 union select cast(avg(d) AS integer) from t1)} -} {} -do_test randexpr-2.1490 { - db eval {SELECT case t1.d when 17 then 11 | t1.a-17+13+t1.f*t1.e+t1.e-case when d | t1.e in (t1.b,t1.a,c) then -13 else (b*19) end-(select cast(avg(coalesce((select a from t1 where e in (t1.f,t1.b,f)), -e)) AS integer) from t1)*d-11-t1.e-t1.a else t1.f end FROM t1 WHERE NOT (d*13 in (select abs(min(d)) from t1 union select cast(avg(d) AS integer) from t1))} -} {600} -do_test randexpr-2.1491 { - db eval {SELECT case t1.d when 17 then 11 & t1.a-17+13+t1.f*t1.e+t1.e-case when d & t1.e in (t1.b,t1.a,c) then -13 else (b*19) end-(select cast(avg(coalesce((select a from t1 where e in (t1.f,t1.b,f)), -e)) AS integer) from t1)*d-11-t1.e-t1.a else t1.f end FROM t1 WHERE NOT (d*13 in (select abs(min(d)) from t1 union select cast(avg(d) AS integer) from t1))} -} {600} -do_test randexpr-2.1492 { - db eval {SELECT coalesce((select max(19-(abs(t1.c)/abs( -13))-(select count(*)*abs(max(t1.a-b)) from t1)-t1.d) from t1 where (case coalesce((select max(~(select ~count(*) from t1)) from t1 where b=(abs(17)/abs(d))),11*case when not t1.c>=e or 17=c then d else 17*b end*t1.d) when 13 then 11 else t1.c end) in (select c from t1 union select t1.c from t1)),13) FROM t1 WHERE case t1.a*(select -case count(distinct ~(case 13-+t1.d-f when d then c else (19) end)*19)* -max(19) | -count(*)+abs(min(19)) | cast(avg(d) AS integer) when min(a) then count(distinct 11) else count(*) end from t1)*(abs(t1.a)/abs(11))-f-t1.b+(t1.f) when 11 then 17 else 19 end<>d} -} {-504} -do_test randexpr-2.1493 { - db eval {SELECT coalesce((select max(19-(abs(t1.c)/abs( -13))-(select count(*)*abs(max(t1.a-b)) from t1)-t1.d) from t1 where (case coalesce((select max(~(select ~count(*) from t1)) from t1 where b=(abs(17)/abs(d))),11*case when not t1.c>=e or 17=c then d else 17*b end*t1.d) when 13 then 11 else t1.c end) in (select c from t1 union select t1.c from t1)),13) FROM t1 WHERE NOT (case t1.a*(select -case count(distinct ~(case 13-+t1.d-f when d then c else (19) end)*19)* -max(19) | -count(*)+abs(min(19)) | cast(avg(d) AS integer) when min(a) then count(distinct 11) else count(*) end from t1)*(abs(t1.a)/abs(11))-f-t1.b+(t1.f) when 11 then 17 else 19 end<>d)} -} {} -do_test randexpr-2.1494 { - db eval {SELECT +(select abs( -abs(count(distinct case when (abs(t1.f)/abs(t1.a-t1.d)) in (select count(distinct 19) from t1 union select +abs(+ -cast(avg(c) AS integer)) from t1) then -(f) else e end-17)) | case count(distinct b) when count(*) then cast(avg(13) AS integer) else ( -count(distinct d)) end-count(*)* - -cast(avg(a) AS integer)) from t1)+case when t1.f in (select d*b | t1.d from t1 union select d from t1) then t1.f when 19<>t1.e then t1.b else 11 end+11 FROM t1 WHERE ft1.e then t1.b else 11 end+11 FROM t1 WHERE NOT (ft1.e then t1.b else 11 end+11 FROM t1 WHERE f17 or 17 between 13 and a and exists(select 1 from t1 where c not between t1.f and t1.d) then coalesce((select max(d) from t1 where t1.e<>19),17) else a end*(( -f))+t1.d FROM t1 WHERE exists(select 1 from t1 where exists(select 1 from t1 where t1.c between case when (a13 or b>=e or 19 between t1.d and -t1.e then t1.f else f end and f) and c>((t1.c))) and not exists(select 1 from t1 where 1717 or 17 between 13 and a and exists(select 1 from t1 where c not between t1.f and t1.d) then coalesce((select max(d) from t1 where t1.e<>19),17) else a end*(( -f))+t1.d FROM t1 WHERE NOT (exists(select 1 from t1 where exists(select 1 from t1 where t1.c between case when (a13 or b>=e or 19 between t1.d and -t1.e then t1.f else f end and f) and c>((t1.c))) and not exists(select 1 from t1 where 17=13 then t1.e else t1.c end)/abs(19)) | (t1.d) FROM t1 WHERE d>=(case when ((t1.a)) between t1.f and a then case when 11 between 19-case when (~coalesce((select t1.e from t1 where d>t1.c and e<>t1.f),e))>=13 then t1.b when t1.d in (select (count(*)-min(19)) from t1 union select cast(avg(t1.e) AS integer) from t1) then 17 else (t1.d) end*t1.a and (13) then 11 when not exists(select 1 from t1 where not 19<>(t1.e) and t1.a between d and d and t1.c=a) then 17 else t1.a end-17 else e end)} -} {} -do_test randexpr-2.1500 { - db eval {SELECT 17+11+d+t1.d | t1.c+(abs(case when 11 in (select count(distinct 11*+t1.d) from t1 union select ~cast(avg(t1.c) AS integer)*case (count(distinct 19)) when (cast(avg(t1.c) AS integer) | min(t1.a-f)) then cast(avg(a) AS integer) else cast(avg(t1.b) AS integer) end+max( - -d) from t1) then t1.a-13 when (11)>=13 then t1.e else t1.c end)/abs(19)) | (t1.d) FROM t1 WHERE NOT (d>=(case when ((t1.a)) between t1.f and a then case when 11 between 19-case when (~coalesce((select t1.e from t1 where d>t1.c and e<>t1.f),e))>=13 then t1.b when t1.d in (select (count(*)-min(19)) from t1 union select cast(avg(t1.e) AS integer) from t1) then 17 else (t1.d) end*t1.a and (13) then 11 when not exists(select 1 from t1 where not 19<>(t1.e) and t1.a between d and d and t1.c=a) then 17 else t1.a end-17 else e end))} -} {959} -do_test randexpr-2.1501 { - db eval {SELECT 17+11+d+t1.d & t1.c+(abs(case when 11 in (select count(distinct 11*+t1.d) from t1 union select ~cast(avg(t1.c) AS integer)*case (count(distinct 19)) when (cast(avg(t1.c) AS integer) & min(t1.a-f)) then cast(avg(a) AS integer) else cast(avg(t1.b) AS integer) end+max( - -d) from t1) then t1.a-13 when (11)>=13 then t1.e else t1.c end)/abs(19)) & (t1.d) FROM t1 WHERE NOT (d>=(case when ((t1.a)) between t1.f and a then case when 11 between 19-case when (~coalesce((select t1.e from t1 where d>t1.c and e<>t1.f),e))>=13 then t1.b when t1.d in (select (count(*)-min(19)) from t1 union select cast(avg(t1.e) AS integer) from t1) then 17 else (t1.d) end*t1.a and (13) then 11 when not exists(select 1 from t1 where not 19<>(t1.e) and t1.a between d and d and t1.c=a) then 17 else t1.a end-17 else e end))} -} {272} -do_test randexpr-2.1502 { - db eval {SELECT coalesce((select 17 from t1 where ((abs(19)/abs(case when ((f+17<(d))) and (abs(t1.c)/abs((t1.b)))>11 then ~a+11 when (t1.f)>t1.d then 19 else c end))<>t1.b) or (b in (( -t1.d),b,e) and (t1.a)<>c) and (17) not in (t1.f,11,17) or (f) not between t1.c and -t1.c),t1.a) FROM t1 WHERE 17 between -t1.b+f-19 | 17 and t1.e+t1.c} -} {} -do_test randexpr-2.1503 { - db eval {SELECT coalesce((select 17 from t1 where ((abs(19)/abs(case when ((f+17<(d))) and (abs(t1.c)/abs((t1.b)))>11 then ~a+11 when (t1.f)>t1.d then 19 else c end))<>t1.b) or (b in (( -t1.d),b,e) and (t1.a)<>c) and (17) not in (t1.f,11,17) or (f) not between t1.c and -t1.c),t1.a) FROM t1 WHERE NOT (17 between -t1.b+f-19 | 17 and t1.e+t1.c)} -} {17} -do_test randexpr-2.1504 { - db eval {SELECT +(11)-19-case when 19+13-19+f*19*c not in (coalesce((select max((select ~min(t1.b)+(count(distinct t1.d)) | min(13)*count(distinct t1.a)*max(a) from t1)) from t1 where not 19 in (select t1.d from t1 union select 19 from t1) or 19<=t1.c),t1.b | f) | e-f,d,d) then t1.a else d end FROM t1 WHERE t1.d in (select case when t1.e>(case coalesce((select (11)-t1.e from t1 where case t1.e when t1.c then (coalesce((select max(+t1.b) from t1 where (a in (case when 19 in (select cast(avg((t1.b)) AS integer) from t1 union select cast(avg( - -17) AS integer) from t1) then a when 17>=13 then c else t1.e end,11,11) or not 19 between t1.b and t1.a)),t1.e)) else d end<=t1.c),13) when e then a else d end) then a when 19 in (select (11) from t1 union select t1.e from t1) then (e) else t1.d end from t1 union select t1.d from t1)} -} {-108} -do_test randexpr-2.1505 { - db eval {SELECT +(11)-19-case when 19+13-19+f*19*c not in (coalesce((select max((select ~min(t1.b)+(count(distinct t1.d)) | min(13)*count(distinct t1.a)*max(a) from t1)) from t1 where not 19 in (select t1.d from t1 union select 19 from t1) or 19<=t1.c),t1.b | f) | e-f,d,d) then t1.a else d end FROM t1 WHERE NOT (t1.d in (select case when t1.e>(case coalesce((select (11)-t1.e from t1 where case t1.e when t1.c then (coalesce((select max(+t1.b) from t1 where (a in (case when 19 in (select cast(avg((t1.b)) AS integer) from t1 union select cast(avg( - -17) AS integer) from t1) then a when 17>=13 then c else t1.e end,11,11) or not 19 between t1.b and t1.a)),t1.e)) else d end<=t1.c),13) when e then a else d end) then a when 19 in (select (11) from t1 union select t1.e from t1) then (e) else t1.d end from t1 union select t1.d from t1))} -} {} -do_test randexpr-2.1506 { - db eval {SELECT +(11)-19-case when 19+13-19+f*19*c not in (coalesce((select max((select ~min(t1.b)+(count(distinct t1.d)) & min(13)*count(distinct t1.a)*max(a) from t1)) from t1 where not 19 in (select t1.d from t1 union select 19 from t1) or 19<=t1.c),t1.b & f) & e-f,d,d) then t1.a else d end FROM t1 WHERE t1.d in (select case when t1.e>(case coalesce((select (11)-t1.e from t1 where case t1.e when t1.c then (coalesce((select max(+t1.b) from t1 where (a in (case when 19 in (select cast(avg((t1.b)) AS integer) from t1 union select cast(avg( - -17) AS integer) from t1) then a when 17>=13 then c else t1.e end,11,11) or not 19 between t1.b and t1.a)),t1.e)) else d end<=t1.c),13) when e then a else d end) then a when 19 in (select (11) from t1 union select t1.e from t1) then (e) else t1.d end from t1 union select t1.d from t1)} -} {-108} -do_test randexpr-2.1507 { - db eval {SELECT (abs(case t1.f when (abs((abs( -t1.b+t1.f | case when t1.e-b*19<=17 then 13 when t1.d<>c-coalesce((select max(coalesce((select t1.d from t1 where (not exists(select 1 from t1 where (19)<=a) or 11 between t1.e and f)),d | t1.f)) from t1 where (t1.a between 19 and t1.a)),13) then 19 else f end)/abs(t1.f))-t1.a)/abs(e))+t1.e then t1.b else b end)/abs(19))+t1.a FROM t1 WHERE 17 in (select f*f from t1 union select a+d from t1)} -} {} -do_test randexpr-2.1508 { - db eval {SELECT (abs(case t1.f when (abs((abs( -t1.b+t1.f | case when t1.e-b*19<=17 then 13 when t1.d<>c-coalesce((select max(coalesce((select t1.d from t1 where (not exists(select 1 from t1 where (19)<=a) or 11 between t1.e and f)),d | t1.f)) from t1 where (t1.a between 19 and t1.a)),13) then 19 else f end)/abs(t1.f))-t1.a)/abs(e))+t1.e then t1.b else b end)/abs(19))+t1.a FROM t1 WHERE NOT (17 in (select f*f from t1 union select a+d from t1))} -} {110} -do_test randexpr-2.1509 { - db eval {SELECT (abs(case t1.f when (abs((abs( -t1.b+t1.f & case when t1.e-b*19<=17 then 13 when t1.d<>c-coalesce((select max(coalesce((select t1.d from t1 where (not exists(select 1 from t1 where (19)<=a) or 11 between t1.e and f)),d & t1.f)) from t1 where (t1.a between 19 and t1.a)),13) then 19 else f end)/abs(t1.f))-t1.a)/abs(e))+t1.e then t1.b else b end)/abs(19))+t1.a FROM t1 WHERE NOT (17 in (select f*f from t1 union select a+d from t1))} -} {110} -do_test randexpr-2.1510 { - db eval {SELECT (coalesce((select t1.e from t1 where +case when t1.c+f<>d-17 then t1.a when not (abs(t1.c)/abs(case case -f when f then a else t1.b end-t1.e-t1.f when t1.b then -e else t1.c end))>e or t1.b=a or exists(select 1 from t1 where 19>=t1.b) and t1.c< -e then t1.e else 13 end<=t1.b),b)) | d FROM t1 WHERE case 13 when 13 then 17-f else a end=e and (exists(select 1 from t1 where b in (select t1.f from t1 union select coalesce((select case when (abs(t1.c)/abs(17)) in (a,f*c,11) then c when ( -t1.d) in (select ~count(distinct t1.b) from t1 union select min((t1.c)) from t1) then t1.a else t1.e end from t1 where exists(select 1 from t1 where (t1.f) in (t1.d,17, -11))),b)-d*11*c+a from t1)))} -} {} -do_test randexpr-2.1511 { - db eval {SELECT (coalesce((select t1.e from t1 where +case when t1.c+f<>d-17 then t1.a when not (abs(t1.c)/abs(case case -f when f then a else t1.b end-t1.e-t1.f when t1.b then -e else t1.c end))>e or t1.b=a or exists(select 1 from t1 where 19>=t1.b) and t1.c< -e then t1.e else 13 end<=t1.b),b)) | d FROM t1 WHERE NOT (case 13 when 13 then 17-f else a end=e and (exists(select 1 from t1 where b in (select t1.f from t1 union select coalesce((select case when (abs(t1.c)/abs(17)) in (a,f*c,11) then c when ( -t1.d) in (select ~count(distinct t1.b) from t1 union select min((t1.c)) from t1) then t1.a else t1.e end from t1 where exists(select 1 from t1 where (t1.f) in (t1.d,17, -11))),b)-d*11*c+a from t1))))} -} {500} -do_test randexpr-2.1512 { - db eval {SELECT (coalesce((select t1.e from t1 where +case when t1.c+f<>d-17 then t1.a when not (abs(t1.c)/abs(case case -f when f then a else t1.b end-t1.e-t1.f when t1.b then -e else t1.c end))>e or t1.b=a or exists(select 1 from t1 where 19>=t1.b) and t1.c< -e then t1.e else 13 end<=t1.b),b)) & d FROM t1 WHERE NOT (case 13 when 13 then 17-f else a end=e and (exists(select 1 from t1 where b in (select t1.f from t1 union select coalesce((select case when (abs(t1.c)/abs(17)) in (a,f*c,11) then c when ( -t1.d) in (select ~count(distinct t1.b) from t1 union select min((t1.c)) from t1) then t1.a else t1.e end from t1 where exists(select 1 from t1 where (t1.f) in (t1.d,17, -11))),b)-d*11*c+a from t1))))} -} {400} -do_test randexpr-2.1513 { - db eval {SELECT (abs( -case when exists(select 1 from t1 where (abs(e++11-(abs(c)/abs(t1.f)))/abs(19+t1.b))+t1.b-c=(b)) or d in (~d, -f,c) then (select min(13) from t1)+11+~t1.a*t1.a else d end-t1.d)/abs((select (max(d))+count(*)-min(t1.c) from t1))) FROM t1 WHERE (select +min(c+d) | (max(13)+min(case when t1.e not in (t1.d,t1.d,19*t1.d) then t1.a when 17=d then t1.b else a end)+ - -max(t1.a)*count(distinct f) | count(*)+max(t1.d) | count(distinct d))-count(distinct 17)-count(*) from t1) not in (e,d+11,(t1.a+t1.f))} -} {7} -do_test randexpr-2.1514 { - db eval {SELECT (abs( -case when exists(select 1 from t1 where (abs(e++11-(abs(c)/abs(t1.f)))/abs(19+t1.b))+t1.b-c=(b)) or d in (~d, -f,c) then (select min(13) from t1)+11+~t1.a*t1.a else d end-t1.d)/abs((select (max(d))+count(*)-min(t1.c) from t1))) FROM t1 WHERE NOT ((select +min(c+d) | (max(13)+min(case when t1.e not in (t1.d,t1.d,19*t1.d) then t1.a when 17=d then t1.b else a end)+ - -max(t1.a)*count(distinct f) | count(*)+max(t1.d) | count(distinct d))-count(distinct 17)-count(*) from t1) not in (e,d+11,(t1.a+t1.f)))} -} {} -do_test randexpr-2.1515 { - db eval {SELECT case when not exists(select 1 from t1 where (not case t1.b when d then c else coalesce((select max(b+case c+c when t1.c then coalesce((select ((e)) from t1 where c in (e,t1.f,t1.d)),t1.a) else t1.f end+t1.e) from t1 where not t1.e not between t1.f and t1.a),19) end+f<>b)) then e when f in (19,t1.d, -c) then 19 else case when e>=t1.f then 19 else 19 end end FROM t1 WHERE 19 between e+case when d>(select ~max(t1.d)+max(t1.d*t1.c)-~count(distinct c)-count(*)-count(distinct t1.b)* -(count(*)) from t1) then ~a when not exists(select 1 from t1 where t1.c>=13) or (t1.f=t1.a or c in ((f), -c,t1.e)) and b=b and e not between t1.b and -11 or t1.c in (t1.c,17,t1.c) and t1.f=t1.d then t1.a*t1.d*t1.c else d end and e} -} {} -do_test randexpr-2.1516 { - db eval {SELECT case when not exists(select 1 from t1 where (not case t1.b when d then c else coalesce((select max(b+case c+c when t1.c then coalesce((select ((e)) from t1 where c in (e,t1.f,t1.d)),t1.a) else t1.f end+t1.e) from t1 where not t1.e not between t1.f and t1.a),19) end+f<>b)) then e when f in (19,t1.d, -c) then 19 else case when e>=t1.f then 19 else 19 end end FROM t1 WHERE NOT (19 between e+case when d>(select ~max(t1.d)+max(t1.d*t1.c)-~count(distinct c)-count(*)-count(distinct t1.b)* -(count(*)) from t1) then ~a when not exists(select 1 from t1 where t1.c>=13) or (t1.f=t1.a or c in ((f), -c,t1.e)) and b=b and e not between t1.b and -11 or t1.c in (t1.c,17,t1.c) and t1.f=t1.d then t1.a*t1.d*t1.c else d end and e)} -} {500} -do_test randexpr-2.1517 { - db eval {SELECT (select -+case -(case -max(d) when ~+ -+(count(*)) then abs(max(case 17+t1.a-11-t1.c when 19 then f else e end*((t1.c))+b)) else (min(d)*count(distinct t1.e)) end)++abs(count(*))- -cast(avg(c) AS integer)+max(d) when count(distinct c) then min(f) else (count(distinct a)) end from t1) FROM t1 WHERE ((case -a when case when f between 11 and t1.d then d else c+17 end then b else a end+11-c between -a and t1.a) or b>t1.f and t1.at1.f and t1.a=f) or f in (t1.a,(t1.a),a)) then -~c-d else t1.e end)/abs(13))) FROM t1 WHERE (select (+~max(case when t1.e>=coalesce((select max(t1.d) from t1 where +f not in (coalesce((select 11 from t1 where 13 | c in (select c from t1 union select b from t1)),f),t1.c, -a)),13) then e else 19 end)-min(t1.a)) from t1)+((coalesce((select t1.e from t1 where not exists(select 1 from t1 where not exists(select 1 from t1 where t1.c=t1.a))),a)))+13 in (select d from t1 union select t1.a from t1) and e>=b} -} {} -do_test randexpr-2.1520 { - db eval {SELECT -coalesce((select max((select case +count(*)+(case min((abs(d)/abs(b))) when +count(*) | (min(b)) then -min((t1.a)) else max( -t1.a) end*max( -t1.e))+max(f) when (count(*)) then count(distinct 17) else cast(avg((t1.c)) AS integer) end from t1)) from t1 where t1.d in (select 13 from t1 union select t1.c from t1)),(abs(case when ((c>=f) or f in (t1.a,(t1.a),a)) then -~c-d else t1.e end)/abs(13))) FROM t1 WHERE NOT ((select (+~max(case when t1.e>=coalesce((select max(t1.d) from t1 where +f not in (coalesce((select 11 from t1 where 13 | c in (select c from t1 union select b from t1)),f),t1.c, -a)),13) then e else 19 end)-min(t1.a)) from t1)+((coalesce((select t1.e from t1 where not exists(select 1 from t1 where not exists(select 1 from t1 where t1.c=t1.a))),a)))+13 in (select d from t1 union select t1.a from t1) and e>=b)} -} {-38} -do_test randexpr-2.1521 { - db eval {SELECT -coalesce((select max((select case +count(*)+(case min((abs(d)/abs(b))) when +count(*) & (min(b)) then -min((t1.a)) else max( -t1.a) end*max( -t1.e))+max(f) when (count(*)) then count(distinct 17) else cast(avg((t1.c)) AS integer) end from t1)) from t1 where t1.d in (select 13 from t1 union select t1.c from t1)),(abs(case when ((c>=f) or f in (t1.a,(t1.a),a)) then -~c-d else t1.e end)/abs(13))) FROM t1 WHERE NOT ((select (+~max(case when t1.e>=coalesce((select max(t1.d) from t1 where +f not in (coalesce((select 11 from t1 where 13 | c in (select c from t1 union select b from t1)),f),t1.c, -a)),13) then e else 19 end)-min(t1.a)) from t1)+((coalesce((select t1.e from t1 where not exists(select 1 from t1 where not exists(select 1 from t1 where t1.c=t1.a))),a)))+13 in (select d from t1 union select t1.a from t1) and e>=b)} -} {-38} -do_test randexpr-2.1522 { - db eval {SELECT +(select +abs(+cast(avg(t1.b) AS integer)*abs(case -max( -(t1.a*t1.f)+t1.e* -t1.f*13 | 17 | f+t1.c) when abs(cast(avg(d) AS integer))-(++~min(t1.f) | count(*)-cast(avg(f) AS integer)) then count(*) else cast(avg(13) AS integer) end+ -min(b)))+min(a) from t1) FROM t1 WHERE case t1.a-t1.e*+t1.f-(select abs(count(*)) from t1)+coalesce((select max(t1.c) from t1 where not exists(select 1 from t1 where ~t1.b in (select +count(*) | count(distinct case b when t1.a then f else case when (t1.d-t1.b)<11 then t1.d else f end end) from t1 union select +cast(avg(( -d)) AS integer) from t1))),t1.d*t1.a) | e when t1.f then (t1.d) else t1.f end not in (d,f,e)} -} {} -do_test randexpr-2.1523 { - db eval {SELECT +(select +abs(+cast(avg(t1.b) AS integer)*abs(case -max( -(t1.a*t1.f)+t1.e* -t1.f*13 | 17 | f+t1.c) when abs(cast(avg(d) AS integer))-(++~min(t1.f) | count(*)-cast(avg(f) AS integer)) then count(*) else cast(avg(13) AS integer) end+ -min(b)))+min(a) from t1) FROM t1 WHERE NOT (case t1.a-t1.e*+t1.f-(select abs(count(*)) from t1)+coalesce((select max(t1.c) from t1 where not exists(select 1 from t1 where ~t1.b in (select +count(*) | count(distinct case b when t1.a then f else case when (t1.d-t1.b)<11 then t1.d else f end end) from t1 union select +cast(avg(( -d)) AS integer) from t1))),t1.d*t1.a) | e when t1.f then (t1.d) else t1.f end not in (d,f,e))} -} {37500} -do_test randexpr-2.1524 { - db eval {SELECT +(select +abs(+cast(avg(t1.b) AS integer)*abs(case -max( -(t1.a*t1.f)+t1.e* -t1.f*13 & 17 & f+t1.c) when abs(cast(avg(d) AS integer))-(++~min(t1.f) & count(*)-cast(avg(f) AS integer)) then count(*) else cast(avg(13) AS integer) end+ -min(b)))+min(a) from t1) FROM t1 WHERE NOT (case t1.a-t1.e*+t1.f-(select abs(count(*)) from t1)+coalesce((select max(t1.c) from t1 where not exists(select 1 from t1 where ~t1.b in (select +count(*) | count(distinct case b when t1.a then f else case when (t1.d-t1.b)<11 then t1.d else f end end) from t1 union select +cast(avg(( -d)) AS integer) from t1))),t1.d*t1.a) | e when t1.f then (t1.d) else t1.f end not in (d,f,e))} -} {37500} -do_test randexpr-2.1525 { - db eval {SELECT t1.d+case when coalesce((select b from t1 where case when (select max(t1.a*(select case count(distinct c) when max(17+c) then - -max(d)-count(*) else cast(avg((e)) AS integer) end from t1)) from t1) not between t1.d and t1.d then t1.d when t1.c not between c and t1.f then ( -t1.d) else t1.d end not between e and t1.e),d)<>17 then (t1.f) when 11=t1.c then 11 else t1.f end*c*t1.a-c FROM t1 WHERE (case when coalesce((select ~coalesce((select max(a) from t1 where 11 in (select ~case -count(*) when cast(avg(d) AS integer) then -max(t1.f) else (count(distinct 11)) end+cast(avg( - -13) AS integer) | count(*)-min(f) from t1 union select count(*) from t1)),t1.b*t1.f*17) from t1 where not exists(select 1 from t1 where t1.a not between d and 11)),b)-17*t1.d+t1.a in ( -t1.c,t1.e,11) then b else t1.d end in (select 17 from t1 union select 13 from t1)) and -t1.a in (select (d) from t1 union select t1.b from t1)} -} {} -do_test randexpr-2.1526 { - db eval {SELECT t1.d+case when coalesce((select b from t1 where case when (select max(t1.a*(select case count(distinct c) when max(17+c) then - -max(d)-count(*) else cast(avg((e)) AS integer) end from t1)) from t1) not between t1.d and t1.d then t1.d when t1.c not between c and t1.f then ( -t1.d) else t1.d end not between e and t1.e),d)<>17 then (t1.f) when 11=t1.c then 11 else t1.f end*c*t1.a-c FROM t1 WHERE NOT ((case when coalesce((select ~coalesce((select max(a) from t1 where 11 in (select ~case -count(*) when cast(avg(d) AS integer) then -max(t1.f) else (count(distinct 11)) end+cast(avg( - -13) AS integer) | count(*)-min(f) from t1 union select count(*) from t1)),t1.b*t1.f*17) from t1 where not exists(select 1 from t1 where t1.a not between d and 11)),b)-17*t1.d+t1.a in ( -t1.c,t1.e,11) then b else t1.d end in (select 17 from t1 union select 13 from t1)) and -t1.a in (select (d) from t1 union select t1.b from t1))} -} {18000100} -do_test randexpr-2.1527 { - db eval {SELECT coalesce((select (abs(b+t1.c)/abs(coalesce((select max( -~t1.d) from t1 where coalesce((select max(11) from t1 where not t1.d>=(select count(*) from t1)),case b-coalesce((select t1.e-f from t1 where coalesce((select max(case a when t1.e then t1.f else 11 end) from t1 where t1.b>=t1.f),t1.d) not in (f,e,13)),t1.f) when -11 then t1.c else 19 end)-d not in (f,f,b)),f))) from t1 where d<=t1.d),f) FROM t1 WHERE c+case when coalesce((select d from t1 where coalesce((select max(17) from t1 where c>17-11),17)=(select count(*) from t1)),case b-coalesce((select t1.e-f from t1 where coalesce((select max(case a when t1.e then t1.f else 11 end) from t1 where t1.b>=t1.f),t1.d) not in (f,e,13)),t1.f) when -11 then t1.c else 19 end)-d not in (f,f,b)),f))) from t1 where d<=t1.d),f) FROM t1 WHERE NOT (c+case when coalesce((select d from t1 where coalesce((select max(17) from t1 where c>17-11),17)f and (exists(select 1 from t1 where (17 in (e, -t1.f,c)) and t1.f<=19))),d))) FROM t1 WHERE f*t1.c<>t1.b} -} {0} -do_test randexpr-2.1530 { - db eval {SELECT (abs(19)/abs(coalesce((select max((abs((abs(t1.a)/abs(e)))/abs(b))) from t1 where not t1.f<13 and 17-(abs(b-13*f*(abs(+17-f+t1.a)/abs(t1.d)))/abs(t1.e))+e-17>f and (exists(select 1 from t1 where (17 in (e, -t1.f,c)) and t1.f<=19))),d))) FROM t1 WHERE NOT (f*t1.c<>t1.b)} -} {} -do_test randexpr-2.1531 { - db eval {SELECT case when t1.d in (select count(distinct 11) from t1 union select case abs(++cast(avg(t1.b) AS integer)+count(*) | -(count(*))) when count(*) then count(distinct t1.b) else count(distinct -t1.a) end | max(t1.c) from t1) and t1.f<=case when exists(select 1 from t1 where t1.f+t1.f<>17 and t1.b>d) then 19 when t1.e=a then coalesce((select b from t1 where 13 not in (t1.b,t1.a,t1.a)),t1.c) else t1.d end and t1.d>(t1.b) and c in (e,t1.d,t1.b) then b | c when f=t1.e then e else 19 end FROM t1 WHERE t1.f between (c-t1.d+t1.f*t1.f) and 11+t1.e*coalesce((select max(coalesce((select max(t1.e) from t1 where exists(select 1 from t1 where (c-13 between t1.e*a and 11 or (t1.f>f) or t1.c>=t1.f))),t1.b-b-11)) from t1 where (f>t1.f)),11)-t1.b*e} -} {} -do_test randexpr-2.1532 { - db eval {SELECT case when t1.d in (select count(distinct 11) from t1 union select case abs(++cast(avg(t1.b) AS integer)+count(*) | -(count(*))) when count(*) then count(distinct t1.b) else count(distinct -t1.a) end | max(t1.c) from t1) and t1.f<=case when exists(select 1 from t1 where t1.f+t1.f<>17 and t1.b>d) then 19 when t1.e=a then coalesce((select b from t1 where 13 not in (t1.b,t1.a,t1.a)),t1.c) else t1.d end and t1.d>(t1.b) and c in (e,t1.d,t1.b) then b | c when f=t1.e then e else 19 end FROM t1 WHERE NOT (t1.f between (c-t1.d+t1.f*t1.f) and 11+t1.e*coalesce((select max(coalesce((select max(t1.e) from t1 where exists(select 1 from t1 where (c-13 between t1.e*a and 11 or (t1.f>f) or t1.c>=t1.f))),t1.b-b-11)) from t1 where (f>t1.f)),11)-t1.b*e)} -} {19} -do_test randexpr-2.1533 { - db eval {SELECT case when t1.d in (select count(distinct 11) from t1 union select case abs(++cast(avg(t1.b) AS integer)+count(*) & -(count(*))) when count(*) then count(distinct t1.b) else count(distinct -t1.a) end & max(t1.c) from t1) and t1.f<=case when exists(select 1 from t1 where t1.f+t1.f<>17 and t1.b>d) then 19 when t1.e=a then coalesce((select b from t1 where 13 not in (t1.b,t1.a,t1.a)),t1.c) else t1.d end and t1.d>(t1.b) and c in (e,t1.d,t1.b) then b & c when f=t1.e then e else 19 end FROM t1 WHERE NOT (t1.f between (c-t1.d+t1.f*t1.f) and 11+t1.e*coalesce((select max(coalesce((select max(t1.e) from t1 where exists(select 1 from t1 where (c-13 between t1.e*a and 11 or (t1.f>f) or t1.c>=t1.f))),t1.b-b-11)) from t1 where (f>t1.f)),11)-t1.b*e)} -} {19} -do_test randexpr-2.1534 { - db eval {SELECT coalesce((select t1.e from t1 where (case when 19>=t1.c then t1.d else coalesce((select max(11*t1.b) from t1 where case ~t1.c-(select max(11) from t1)*~t1.b+f*~coalesce((select max(d) from t1 where d>=b),d)-t1.a*t1.c*t1.d when -t1.c then 13 else f end in (select b from t1 union select 13 from t1)),t1.f) end | b<>a)),t1.e) FROM t1 WHERE not exists(select 1 from t1 where not (t1.et1.b+case (select count(distinct e)*cast(avg(case c when e then case a when f then b else d end-a-13 else 13 end*t1.a+ -t1.d) AS integer) from t1)+c | (t1.f)*f when -c then d else 19 end) and -17 in (select min(t1.b) from t1 union select count(distinct f) from t1))} -} {500} -do_test randexpr-2.1535 { - db eval {SELECT coalesce((select t1.e from t1 where (case when 19>=t1.c then t1.d else coalesce((select max(11*t1.b) from t1 where case ~t1.c-(select max(11) from t1)*~t1.b+f*~coalesce((select max(d) from t1 where d>=b),d)-t1.a*t1.c*t1.d when -t1.c then 13 else f end in (select b from t1 union select 13 from t1)),t1.f) end | b<>a)),t1.e) FROM t1 WHERE NOT (not exists(select 1 from t1 where not (t1.et1.b+case (select count(distinct e)*cast(avg(case c when e then case a when f then b else d end-a-13 else 13 end*t1.a+ -t1.d) AS integer) from t1)+c | (t1.f)*f when -c then d else 19 end) and -17 in (select min(t1.b) from t1 union select count(distinct f) from t1)))} -} {} -do_test randexpr-2.1536 { - db eval {SELECT coalesce((select t1.e from t1 where (case when 19>=t1.c then t1.d else coalesce((select max(11*t1.b) from t1 where case ~t1.c-(select max(11) from t1)*~t1.b+f*~coalesce((select max(d) from t1 where d>=b),d)-t1.a*t1.c*t1.d when -t1.c then 13 else f end in (select b from t1 union select 13 from t1)),t1.f) end & b<>a)),t1.e) FROM t1 WHERE not exists(select 1 from t1 where not (t1.et1.b+case (select count(distinct e)*cast(avg(case c when e then case a when f then b else d end-a-13 else 13 end*t1.a+ -t1.d) AS integer) from t1)+c | (t1.f)*f when -c then d else 19 end) and -17 in (select min(t1.b) from t1 union select count(distinct f) from t1))} -} {500} -do_test randexpr-2.1537 { - db eval {SELECT coalesce((select t1.c from t1 where f between case when (abs(coalesce((select 11* -~coalesce((select a*case coalesce((select max(a) from t1 where exists(select 1 from t1 where e in (17,t1.b,13))), -t1.e) when -a then d else c end from t1 where t1.a>=t1.e),17)+t1.a-t1.d from t1 where exists(select 1 from t1 where -b>t1.b)),e))/abs(d))<>17 then t1.d when 11< -f then d else d end*d and 17),b)-f-t1.d FROM t1 WHERE case when e=(abs(t1.b)/abs((abs(t1.f)/abs( -case b when 19 then ((abs((case when (+case when f between e and c then t1.f when t1.b>19 then t1.e else t1.f end+11+t1.a in (select t1.c from t1 union select f from t1)) then e-(13) when not exists(select 1 from t1 where not exists(select 1 from t1 where (13)>t1.f)) then t1.c else t1.f end))/abs(t1.d))) else c end)))) then b else (t1.d) end not between t1.a and t1.a} -} {-800} -do_test randexpr-2.1538 { - db eval {SELECT coalesce((select t1.c from t1 where f between case when (abs(coalesce((select 11* -~coalesce((select a*case coalesce((select max(a) from t1 where exists(select 1 from t1 where e in (17,t1.b,13))), -t1.e) when -a then d else c end from t1 where t1.a>=t1.e),17)+t1.a-t1.d from t1 where exists(select 1 from t1 where -b>t1.b)),e))/abs(d))<>17 then t1.d when 11< -f then d else d end*d and 17),b)-f-t1.d FROM t1 WHERE NOT (case when e=(abs(t1.b)/abs((abs(t1.f)/abs( -case b when 19 then ((abs((case when (+case when f between e and c then t1.f when t1.b>19 then t1.e else t1.f end+11+t1.a in (select t1.c from t1 union select f from t1)) then e-(13) when not exists(select 1 from t1 where not exists(select 1 from t1 where (13)>t1.f)) then t1.c else t1.f end))/abs(t1.d))) else c end)))) then b else (t1.d) end not between t1.a and t1.a)} -} {} -do_test randexpr-2.1539 { - db eval {SELECT case when not exists(select 1 from t1 where (coalesce((select max(coalesce((select 11 from t1 where t1.b*t1.d<=+case t1.c when (select max(case when not exists(select 1 from t1 where e=t1.b) then t1.a else f end) from t1)*t1.b | t1.a then 17 else 13 end-f | t1.e),13)) from t1 where a in (t1.b,t1.b,(t1.e))),11)*11 not in (d,t1.a,17))) then 13 when c in (select e from t1 union select t1.d from t1) then 19 else 13 end FROM t1 WHERE not exists(select 1 from t1 where case when -b*13>+d then t1.e else coalesce((select case when not exists(select 1 from t1 where 11 in (c,+case when (case when e between t1.b and f then t1.a when t1.c not in (a,(c),t1.a) then -t1.b else t1.a end<>d or f>e) then t1.e else t1.c end,t1.b)) then 19 else -17 end*t1.d from t1 where (17 in (19,17,t1.f))),(t1.e)) end between 11 and t1.b and t1.a<>b)} -} {13} -do_test randexpr-2.1540 { - db eval {SELECT case when not exists(select 1 from t1 where (coalesce((select max(coalesce((select 11 from t1 where t1.b*t1.d<=+case t1.c when (select max(case when not exists(select 1 from t1 where e=t1.b) then t1.a else f end) from t1)*t1.b | t1.a then 17 else 13 end-f | t1.e),13)) from t1 where a in (t1.b,t1.b,(t1.e))),11)*11 not in (d,t1.a,17))) then 13 when c in (select e from t1 union select t1.d from t1) then 19 else 13 end FROM t1 WHERE NOT (not exists(select 1 from t1 where case when -b*13>+d then t1.e else coalesce((select case when not exists(select 1 from t1 where 11 in (c,+case when (case when e between t1.b and f then t1.a when t1.c not in (a,(c),t1.a) then -t1.b else t1.a end<>d or f>e) then t1.e else t1.c end,t1.b)) then 19 else -17 end*t1.d from t1 where (17 in (19,17,t1.f))),(t1.e)) end between 11 and t1.b and t1.a<>b))} -} {} -do_test randexpr-2.1541 { - db eval {SELECT case when not exists(select 1 from t1 where (coalesce((select max(coalesce((select 11 from t1 where t1.b*t1.d<=+case t1.c when (select max(case when not exists(select 1 from t1 where e=t1.b) then t1.a else f end) from t1)*t1.b & t1.a then 17 else 13 end-f & t1.e),13)) from t1 where a in (t1.b,t1.b,(t1.e))),11)*11 not in (d,t1.a,17))) then 13 when c in (select e from t1 union select t1.d from t1) then 19 else 13 end FROM t1 WHERE not exists(select 1 from t1 where case when -b*13>+d then t1.e else coalesce((select case when not exists(select 1 from t1 where 11 in (c,+case when (case when e between t1.b and f then t1.a when t1.c not in (a,(c),t1.a) then -t1.b else t1.a end<>d or f>e) then t1.e else t1.c end,t1.b)) then 19 else -17 end*t1.d from t1 where (17 in (19,17,t1.f))),(t1.e)) end between 11 and t1.b and t1.a<>b)} -} {13} -do_test randexpr-2.1542 { - db eval {SELECT a-coalesce((select max(++19) from t1 where (select count(distinct coalesce((select max(t1.c) from t1 where not (t1.c+t1.c)-case when (not coalesce((select max(t1.a-t1.a) from t1 where t1.d>t1.b),e) in (t1.d,19,(t1.e))) then b when exists(select 1 from t1 where t1.e> -13) then c else e end<>c),17)) from t1) not between 19 and t1.f),t1.b) | 19-t1.d*f+b FROM t1 WHERE t1.f | coalesce((select case when c>=t1.f then t1.e+t1.e when -19 | (a)+t1.f in (b,coalesce((select t1.c | (f+e)-e*17 from t1 where -c not in (t1.d,c,(13))),19),t1.e) then t1.c else 17 end+b from t1 where t1.a not in (17,d,c)),17) in (select f from t1 union select f from t1)} -} {} -do_test randexpr-2.1543 { - db eval {SELECT a-coalesce((select max(++19) from t1 where (select count(distinct coalesce((select max(t1.c) from t1 where not (t1.c+t1.c)-case when (not coalesce((select max(t1.a-t1.a) from t1 where t1.d>t1.b),e) in (t1.d,19,(t1.e))) then b when exists(select 1 from t1 where t1.e> -13) then c else e end<>c),17)) from t1) not between 19 and t1.f),t1.b) | 19-t1.d*f+b FROM t1 WHERE NOT (t1.f | coalesce((select case when c>=t1.f then t1.e+t1.e when -19 | (a)+t1.f in (b,coalesce((select t1.c | (f+e)-e*17 from t1 where -c not in (t1.d,c,(13))),19),t1.e) then t1.c else 17 end+b from t1 where t1.a not in (17,d,c)),17) in (select f from t1 union select f from t1))} -} {-239781} -do_test randexpr-2.1544 { - db eval {SELECT a-coalesce((select max(++19) from t1 where (select count(distinct coalesce((select max(t1.c) from t1 where not (t1.c+t1.c)-case when (not coalesce((select max(t1.a-t1.a) from t1 where t1.d>t1.b),e) in (t1.d,19,(t1.e))) then b when exists(select 1 from t1 where t1.e> -13) then c else e end<>c),17)) from t1) not between 19 and t1.f),t1.b) & 19-t1.d*f+b FROM t1 WHERE NOT (t1.f | coalesce((select case when c>=t1.f then t1.e+t1.e when -19 | (a)+t1.f in (b,coalesce((select t1.c | (f+e)-e*17 from t1 where -c not in (t1.d,c,(13))),19),t1.e) then t1.c else 17 end+b from t1 where t1.a not in (17,d,c)),17) in (select f from t1 union select f from t1))} -} {81} -do_test randexpr-2.1545 { - db eval {SELECT coalesce((select (t1.d) from t1 where not not case when c=case when f<>( -t1.c) then c when 19<>t1.d then t1.f else d end) then e-f when c in (select d from t1 union select f from t1) then a else t1.b end | t1.a-f from t1 union select -19 from t1)),19) then 19 when 11 between f and t1.f then t1.c else 19 end=a),t1.f) FROM t1 WHERE coalesce((select t1.d from t1 where (case when exists(select 1 from t1 where not - -19 in (17,f,t1.b)) and 19>c or t1.c in (select t1.e from t1 union select 17 from t1) then a when exists(select 1 from t1 where (t1.c<>d)) and -t1.c not between b and e then 11 else (select cast(avg((abs(b)/abs(d))) AS integer) from t1) end+t1.d not in (t1.f,11,b) and f not between 17 and t1.d)),t1.e)=t1.a} -} {} -do_test randexpr-2.1546 { - db eval {SELECT coalesce((select (t1.d) from t1 where not not case when c=case when f<>( -t1.c) then c when 19<>t1.d then t1.f else d end) then e-f when c in (select d from t1 union select f from t1) then a else t1.b end | t1.a-f from t1 union select -19 from t1)),19) then 19 when 11 between f and t1.f then t1.c else 19 end=a),t1.f) FROM t1 WHERE NOT (coalesce((select t1.d from t1 where (case when exists(select 1 from t1 where not - -19 in (17,f,t1.b)) and 19>c or t1.c in (select t1.e from t1 union select 17 from t1) then a when exists(select 1 from t1 where (t1.c<>d)) and -t1.c not between b and e then 11 else (select cast(avg((abs(b)/abs(d))) AS integer) from t1) end+t1.d not in (t1.f,11,b) and f not between 17 and t1.d)),t1.e)=t1.a)} -} {600} -do_test randexpr-2.1547 { - db eval {SELECT coalesce((select (t1.d) from t1 where not not case when c=case when f<>( -t1.c) then c when 19<>t1.d then t1.f else d end) then e-f when c in (select d from t1 union select f from t1) then a else t1.b end & t1.a-f from t1 union select -19 from t1)),19) then 19 when 11 between f and t1.f then t1.c else 19 end=a),t1.f) FROM t1 WHERE NOT (coalesce((select t1.d from t1 where (case when exists(select 1 from t1 where not - -19 in (17,f,t1.b)) and 19>c or t1.c in (select t1.e from t1 union select 17 from t1) then a when exists(select 1 from t1 where (t1.c<>d)) and -t1.c not between b and e then 11 else (select cast(avg((abs(b)/abs(d))) AS integer) from t1) end+t1.d not in (t1.f,11,b) and f not between 17 and t1.d)),t1.e)=t1.a)} -} {600} -do_test randexpr-2.1548 { - db eval {SELECT coalesce((select max(case when -++t1.c++(abs(case when t1.bb then 11 else b end) from t1 where ((t1.b)) between e and e),t1.e) FROM t1 WHERE not ~t1.c-(coalesce((select max(~case t1.e | b*11+d+19 when t1.a then t1.b else t1.d end) from t1 where (13 not in (t1.a,t1.a,13))),e)) not between t1.a and 11 or exists(select 1 from t1 where (t1.d) not in (11,13,t1.a) and (c<>b or -13<>t1.b and c in (t1.f, -c,t1.d)))} -} {500} -do_test randexpr-2.1549 { - db eval {SELECT coalesce((select max(case when -++t1.c++(abs(case when t1.bb then 11 else b end) from t1 where ((t1.b)) between e and e),t1.e) FROM t1 WHERE NOT (not ~t1.c-(coalesce((select max(~case t1.e | b*11+d+19 when t1.a then t1.b else t1.d end) from t1 where (13 not in (t1.a,t1.a,13))),e)) not between t1.a and 11 or exists(select 1 from t1 where (t1.d) not in (11,13,t1.a) and (c<>b or -13<>t1.b and c in (t1.f, -c,t1.d))))} -} {} -do_test randexpr-2.1550 { - db eval {SELECT case 19*d-+t1.a | coalesce((select f from t1 where +b between coalesce((select +t1.f from t1 where not exists(select 1 from t1 where case 17 when b then f else f end>=~13)),t1.f) and t1.d),c+11)- -t1.e | 17+case t1.b when t1.a then 17 else t1.f end*t1.c+a when f then -f else t1.f end | t1.b FROM t1 WHERE t1.f=f and not exists(select 1 from t1 where case when t1.b>e then (abs(13)/abs(t1.f | 17))+(t1.f) else ~t1.a-(~e) end in (select count(distinct coalesce((select max(coalesce((select 11 from t1 where t1.a=~13)),t1.f) and t1.d),c+11)- -t1.e | 17+case t1.b when t1.a then 17 else t1.f end*t1.c+a when f then -f else t1.f end | t1.b FROM t1 WHERE NOT (t1.f=f and not exists(select 1 from t1 where case when t1.b>e then (abs(13)/abs(t1.f | 17))+(t1.f) else ~t1.a-(~e) end in (select count(distinct coalesce((select max(coalesce((select 11 from t1 where t1.a=~13)),t1.f) and t1.d),c+11)- -t1.e & 17+case t1.b when t1.a then 17 else t1.f end*t1.c+a when f then -f else t1.f end & t1.b FROM t1 WHERE t1.f=f and not exists(select 1 from t1 where case when t1.b>e then (abs(13)/abs(t1.f | 17))+(t1.f) else ~t1.a-(~e) end in (select count(distinct coalesce((select max(coalesce((select 11 from t1 where t1.a=t1.e and e>f then 11 | 19 else t1.c end | b in (select a from t1 union select 13 from t1)),b)+t1.b | (d)*11)/abs(e)) from t1 where a=19),t1.e)*13) from t1 where 13>f),t1.f)) FROM t1 WHERE coalesce((select max(~t1.a*t1.f*t1.b+f+a) from t1 where case when d in (select -+count(distinct (t1.c))*max(t1.e+b)-(( -count(distinct 17))) from t1 union select -count(distinct t1.d) from t1) then t1.d else (abs(case when t1.e in (select t1.c from t1 union select c from t1) then c else d end)/abs(f)) end in (select max( -c) from t1 union select abs(count(distinct 19)) from t1)), -a) not in (d,t1.f,13)} -} {600} -do_test randexpr-2.1554 { - db eval {SELECT (coalesce((select max(coalesce((select (abs(t1.e* -b*coalesce((select max( -t1.e*t1.e+t1.f) from t1 where -case when b>=t1.e and e>f then 11 | 19 else t1.c end | b in (select a from t1 union select 13 from t1)),b)+t1.b | (d)*11)/abs(e)) from t1 where a=19),t1.e)*13) from t1 where 13>f),t1.f)) FROM t1 WHERE NOT (coalesce((select max(~t1.a*t1.f*t1.b+f+a) from t1 where case when d in (select -+count(distinct (t1.c))*max(t1.e+b)-(( -count(distinct 17))) from t1 union select -count(distinct t1.d) from t1) then t1.d else (abs(case when t1.e in (select t1.c from t1 union select c from t1) then c else d end)/abs(f)) end in (select max( -c) from t1 union select abs(count(distinct 19)) from t1)), -a) not in (d,t1.f,13))} -} {} -do_test randexpr-2.1555 { - db eval {SELECT (coalesce((select max(coalesce((select (abs(t1.e* -b*coalesce((select max( -t1.e*t1.e+t1.f) from t1 where -case when b>=t1.e and e>f then 11 & 19 else t1.c end & b in (select a from t1 union select 13 from t1)),b)+t1.b & (d)*11)/abs(e)) from t1 where a=19),t1.e)*13) from t1 where 13>f),t1.f)) FROM t1 WHERE coalesce((select max(~t1.a*t1.f*t1.b+f+a) from t1 where case when d in (select -+count(distinct (t1.c))*max(t1.e+b)-(( -count(distinct 17))) from t1 union select -count(distinct t1.d) from t1) then t1.d else (abs(case when t1.e in (select t1.c from t1 union select c from t1) then c else d end)/abs(f)) end in (select max( -c) from t1 union select abs(count(distinct 19)) from t1)), -a) not in (d,t1.f,13)} -} {600} -do_test randexpr-2.1556 { - db eval {SELECT +(abs(17*(abs(a | t1.a)/abs(11)) | f)/abs(coalesce((select +t1.b+~a from t1 where case when a=t1.b then c when t1.d=t1.e then t1.b else 17 end<=t1.f and (b<>13) or t1.a<>a or t1.d>d and 11 between 17 and t1.a and t1.b<> -e and -13<(17)),a)+ -t1.e))*(t1.c) FROM t1 WHERE not a not between t1.a and 11+ -coalesce((select -c*coalesce((select max(~f*a+11-t1.a | -a+t1.a*t1.b*f) from t1 where 11=11),t1.a)+d from t1 where 13>=e),d) | t1.b or t1.a not between -b and f or 17<>13} -} {300} -do_test randexpr-2.1557 { - db eval {SELECT +(abs(17*(abs(a | t1.a)/abs(11)) | f)/abs(coalesce((select +t1.b+~a from t1 where case when a=t1.b then c when t1.d=t1.e then t1.b else 17 end<=t1.f and (b<>13) or t1.a<>a or t1.d>d and 11 between 17 and t1.a and t1.b<> -e and -13<(17)),a)+ -t1.e))*(t1.c) FROM t1 WHERE NOT (not a not between t1.a and 11+ -coalesce((select -c*coalesce((select max(~f*a+11-t1.a | -a+t1.a*t1.b*f) from t1 where 11=11),t1.a)+d from t1 where 13>=e),d) | t1.b or t1.a not between -b and f or 17<>13)} -} {} -do_test randexpr-2.1558 { - db eval {SELECT +(abs(17*(abs(a & t1.a)/abs(11)) & f)/abs(coalesce((select +t1.b+~a from t1 where case when a=t1.b then c when t1.d=t1.e then t1.b else 17 end<=t1.f and (b<>13) or t1.a<>a or t1.d>d and 11 between 17 and t1.a and t1.b<> -e and -13<(17)),a)+ -t1.e))*(t1.c) FROM t1 WHERE not a not between t1.a and 11+ -coalesce((select -c*coalesce((select max(~f*a+11-t1.a | -a+t1.a*t1.b*f) from t1 where 11=11),t1.a)+d from t1 where 13>=e),d) | t1.b or t1.a not between -b and f or 17<>13} -} {0} -do_test randexpr-2.1559 { - db eval {SELECT b-case e*13+case when not not t1.d in (select t1.b from t1 union select f from t1) then t1.c when coalesce((select max(coalesce((select (select ~min(coalesce((select max(a*f) from t1 where t1.f<=t1.b or a<=f),t1.a)) | -(count(distinct 19)) from t1) from t1 where f between (t1.f) and 11),a)) from t1 where 11 not in (f, -11,19)),e)>=d then t1.f else t1.c end when -a then 11 else t1.e end FROM t1 WHERE coalesce((select case case when case when (coalesce((select max(t1.e) from t1 where c>c and -19>= -a),d) not in (11,t1.b,t1.a)) then d else a end between 11 and t1.c then b else a end+13-t1.a when t1.d then (b) else t1.d end from t1 where b between e and t1.f),11) in (select (+abs(count(*)+case -count(distinct t1.e) when -(max(19)) then (count(distinct 19)) else -count(distinct e) end-max(t1.b)) | count(distinct t1.e) | (cast(avg(11) AS integer))) from t1 union select cast(avg(c) AS integer) from t1)} -} {} -do_test randexpr-2.1560 { - db eval {SELECT b-case e*13+case when not not t1.d in (select t1.b from t1 union select f from t1) then t1.c when coalesce((select max(coalesce((select (select ~min(coalesce((select max(a*f) from t1 where t1.f<=t1.b or a<=f),t1.a)) | -(count(distinct 19)) from t1) from t1 where f between (t1.f) and 11),a)) from t1 where 11 not in (f, -11,19)),e)>=d then t1.f else t1.c end when -a then 11 else t1.e end FROM t1 WHERE NOT (coalesce((select case case when case when (coalesce((select max(t1.e) from t1 where c>c and -19>= -a),d) not in (11,t1.b,t1.a)) then d else a end between 11 and t1.c then b else a end+13-t1.a when t1.d then (b) else t1.d end from t1 where b between e and t1.f),11) in (select (+abs(count(*)+case -count(distinct t1.e) when -(max(19)) then (count(distinct 19)) else -count(distinct e) end-max(t1.b)) | count(distinct t1.e) | (cast(avg(11) AS integer))) from t1 union select cast(avg(c) AS integer) from t1))} -} {-300} -do_test randexpr-2.1561 { - db eval {SELECT b-case e*13+case when not not t1.d in (select t1.b from t1 union select f from t1) then t1.c when coalesce((select max(coalesce((select (select ~min(coalesce((select max(a*f) from t1 where t1.f<=t1.b or a<=f),t1.a)) & -(count(distinct 19)) from t1) from t1 where f between (t1.f) and 11),a)) from t1 where 11 not in (f, -11,19)),e)>=d then t1.f else t1.c end when -a then 11 else t1.e end FROM t1 WHERE NOT (coalesce((select case case when case when (coalesce((select max(t1.e) from t1 where c>c and -19>= -a),d) not in (11,t1.b,t1.a)) then d else a end between 11 and t1.c then b else a end+13-t1.a when t1.d then (b) else t1.d end from t1 where b between e and t1.f),11) in (select (+abs(count(*)+case -count(distinct t1.e) when -(max(19)) then (count(distinct 19)) else -count(distinct e) end-max(t1.b)) | count(distinct t1.e) | (cast(avg(11) AS integer))) from t1 union select cast(avg(c) AS integer) from t1))} -} {-300} -do_test randexpr-2.1562 { - db eval {SELECT coalesce((select case when a not in (~17,a,c) then b when t1.c<>t1.f-13 then +f else 11 end+t1.e*t1.a+case when ((a-c)>case when (exists(select 1 from t1 where (c) between d and -t1.b)) then a+t1.f else f end) or e between t1.c and 13 then -t1.c else t1.e end-t1.d from t1 where ( -17=a)),e) FROM t1 WHERE +case when not exists(select 1 from t1 where f+(select ~ -min(b) | abs(+max(+c)) from t1)+b not between 13-a*17 and t1.e-t1.b) then t1.a when b not between ((11)) and 11 then 13 else 17 end+ - -t1.f in (f,t1.d,f) or t1.b>t1.a and not exists(select 1 from t1 where t1.d in (t1.c,d,t1.c))} -} {} -do_test randexpr-2.1563 { - db eval {SELECT coalesce((select case when a not in (~17,a,c) then b when t1.c<>t1.f-13 then +f else 11 end+t1.e*t1.a+case when ((a-c)>case when (exists(select 1 from t1 where (c) between d and -t1.b)) then a+t1.f else f end) or e between t1.c and 13 then -t1.c else t1.e end-t1.d from t1 where ( -17=a)),e) FROM t1 WHERE NOT (+case when not exists(select 1 from t1 where f+(select ~ -min(b) | abs(+max(+c)) from t1)+b not between 13-a*17 and t1.e-t1.b) then t1.a when b not between ((11)) and 11 then 13 else 17 end+ - -t1.f in (f,t1.d,f) or t1.b>t1.a and not exists(select 1 from t1 where t1.d in (t1.c,d,t1.c)))} -} {500} -do_test randexpr-2.1564 { - db eval {SELECT case coalesce((select 19-case when case when f in (select t1.c from t1 union select (select count(*) from t1) from t1) then a+e else 19 end*19-19-13 not in (11,19,a) then f when (13<>(t1.c) or d>e and b=b) then t1.a else 13 end from t1 where (not exists(select 1 from t1 where not exists(select 1 from t1 where t1.a=17)))),a) when t1.d then 19 else e end FROM t1 WHERE 13-coalesce((select (abs(19)/abs(11)) from t1 where case when a in (select d from t1 union select case when -11-11<>d or t1.e between (t1.d) and b then t1.f else f end from t1) then t1.e else -a end not between 13 and 19 or exists(select 1 from t1 where f< -( -t1.d)) and t1.a not between -e and t1.e or t1.f(t1.f)),t1.d)=11} -} {} -do_test randexpr-2.1565 { - db eval {SELECT case coalesce((select 19-case when case when f in (select t1.c from t1 union select (select count(*) from t1) from t1) then a+e else 19 end*19-19-13 not in (11,19,a) then f when (13<>(t1.c) or d>e and b=b) then t1.a else 13 end from t1 where (not exists(select 1 from t1 where not exists(select 1 from t1 where t1.a=17)))),a) when t1.d then 19 else e end FROM t1 WHERE NOT (13-coalesce((select (abs(19)/abs(11)) from t1 where case when a in (select d from t1 union select case when -11-11<>d or t1.e between (t1.d) and b then t1.f else f end from t1) then t1.e else -a end not between 13 and 19 or exists(select 1 from t1 where f< -( -t1.d)) and t1.a not between -e and t1.e or t1.f(t1.f)),t1.d)=11)} -} {500} -do_test randexpr-2.1566 { - db eval {SELECT (select -count(distinct -case (select (max( -c-t1.b+~f)*count(distinct 11) | +cast(avg(11) AS integer)-min(t1.f)+ -(cast(avg(( -11)) AS integer))-count(distinct t1.d)*(max(13))*(max(d))-(count(*))-min(e)) from t1) when + -c then t1.d else t1.b*19 end-a | t1.d+t1.d) from t1) FROM t1 WHERE not 11-t1.a=a+11} -} {-1} -do_test randexpr-2.1567 { - db eval {SELECT (select -count(distinct -case (select (max( -c-t1.b+~f)*count(distinct 11) | +cast(avg(11) AS integer)-min(t1.f)+ -(cast(avg(( -11)) AS integer))-count(distinct t1.d)*(max(13))*(max(d))-(count(*))-min(e)) from t1) when + -c then t1.d else t1.b*19 end-a | t1.d+t1.d) from t1) FROM t1 WHERE NOT (not 11-t1.a=a+11)} -} {} -do_test randexpr-2.1568 { - db eval {SELECT (select -count(distinct -case (select (max( -c-t1.b+~f)*count(distinct 11) & +cast(avg(11) AS integer)-min(t1.f)+ -(cast(avg(( -11)) AS integer))-count(distinct t1.d)*(max(13))*(max(d))-(count(*))-min(e)) from t1) when + -c then t1.d else t1.b*19 end-a & t1.d+t1.d) from t1) FROM t1 WHERE not 11-t1.a=a+11} -} {-1} -do_test randexpr-2.1569 { - db eval {SELECT (select ~count(distinct t1.d*e+19)+abs(+cast(avg((select (count(*)) from t1)) AS integer)-cast(avg(t1.c) AS integer) | min(case when d | f* -19 in (select min(c) from t1 union select ~count(*)-max(17) from t1) then t1.e when (t1.b between 17 and (b)) then t1.d else t1.d end)*cast(avg(e) AS integer))-count(distinct t1.f) | cast(avg( -d) AS integer)*cast(avg(f) AS integer) from t1)*t1.e FROM t1 WHERE coalesce((select 17 from t1 where coalesce((select max(case when 13-b+coalesce((select case when (f>a) then t1.f when t1.c<=19 then a else a end from t1 where c in (select (e) from t1 union select 13 from t1)),13)<13 then 13 else t1.b end) from t1 where (13)<>13),17) in (select +min(b) from t1 union select ~max(t1.d)*max( -t1.b)*min(t1.e) from t1) and e>c),f) between ((t1.f)) and b and t1.a=19} -} {} -do_test randexpr-2.1570 { - db eval {SELECT (select ~count(distinct t1.d*e+19)+abs(+cast(avg((select (count(*)) from t1)) AS integer)-cast(avg(t1.c) AS integer) | min(case when d | f* -19 in (select min(c) from t1 union select ~count(*)-max(17) from t1) then t1.e when (t1.b between 17 and (b)) then t1.d else t1.d end)*cast(avg(e) AS integer))-count(distinct t1.f) | cast(avg( -d) AS integer)*cast(avg(f) AS integer) from t1)*t1.e FROM t1 WHERE NOT (coalesce((select 17 from t1 where coalesce((select max(case when 13-b+coalesce((select case when (f>a) then t1.f when t1.c<=19 then a else a end from t1 where c in (select (e) from t1 union select 13 from t1)),13)<13 then 13 else t1.b end) from t1 where (13)<>13),17) in (select +min(b) from t1 union select ~max(t1.d)*max( -t1.b)*min(t1.e) from t1) and e>c),f) between ((t1.f)) and b and t1.a=19)} -} {-119980000} -do_test randexpr-2.1571 { - db eval {SELECT (select ~count(distinct t1.d*e+19)+abs(+cast(avg((select (count(*)) from t1)) AS integer)-cast(avg(t1.c) AS integer) & min(case when d & f* -19 in (select min(c) from t1 union select ~count(*)-max(17) from t1) then t1.e when (t1.b between 17 and (b)) then t1.d else t1.d end)*cast(avg(e) AS integer))-count(distinct t1.f) & cast(avg( -d) AS integer)*cast(avg(f) AS integer) from t1)*t1.e FROM t1 WHERE NOT (coalesce((select 17 from t1 where coalesce((select max(case when 13-b+coalesce((select case when (f>a) then t1.f when t1.c<=19 then a else a end from t1 where c in (select (e) from t1 union select 13 from t1)),13)<13 then 13 else t1.b end) from t1 where (13)<>13),17) in (select +min(b) from t1 union select ~max(t1.d)*max( -t1.b)*min(t1.e) from t1) and e>c),f) between ((t1.f)) and b and t1.a=19)} -} {512000} -do_test randexpr-2.1572 { - db eval {SELECT coalesce((select d from t1 where case when (17 between c+t1.d-t1.a and b and t1.b in (13,t1.d,19)) then case when t1.c<(a) then t1.c when t1.e not in (a,11,(t1.d)) then t1.d else d end else t1.a end in (select abs(min(a) | ~~count(distinct t1.e)+min(b)-count(*)) from t1 union select count(*) from t1) and not exists(select 1 from t1 where (t1.a) between t1.a and t1.d)),t1.f)-t1.a FROM t1 WHERE case when t1.e not in (coalesce((select max(coalesce((select max(b+t1.c-19*(e)-~11) from t1 where t1.a in (select ~cast(avg(~t1.a) AS integer) from t1 union select abs(~cast(avg(f) AS integer)) from t1)),e)* -c-c-b-t1.d-f) from t1 where t1.f>=t1.c),((t1.d)))- - -19,17,t1.b) then b else t1.f end=t1.c),((t1.d)))- - -19,17,t1.b) then b else t1.f end=t1.c),((t1.d)))- - -19,17,t1.b) then b else t1.f end=(t1.f)+a then t1.d else 19 end and t1.c or exists(select 1 from t1 where (b in (13,13,b)) and (t1.f<>t1.e)) or (13)<>17 and e<=f and e<= -c) and t1.f>f then t1.e*19-t1.e-b else 17 end from t1)} -} {} -do_test randexpr-2.1576 { - db eval {SELECT (abs((select min(t1.a)*~+ -count(*)-max(t1.f) from t1))/abs((abs(13*~t1.c- -e-( -19) | case 17*~13 when t1.c+case when not 19 between 13 and a then t1.c when -11 not between e and 17 then 19 else a end then 19 else 17 end*19)/abs(t1.d)))) FROM t1 WHERE NOT (t1.e in (select d from t1 union select case when not exists(select 1 from t1 where c+a*17 not between case when t1.f>=(t1.f)+a then t1.d else 19 end and t1.c or exists(select 1 from t1 where (b in (13,13,b)) and (t1.f<>t1.e)) or (13)<>17 and e<=f and e<= -c) and t1.f>f then t1.e*19-t1.e-b else 17 end from t1))} -} {85} -do_test randexpr-2.1577 { - db eval {SELECT b-t1.b-coalesce((select (abs(case t1.c+coalesce((select +17*case when b in (select abs(max(19) | count(distinct t1.e)) | cast(avg(t1.d) AS integer) from t1 union select (count(*)) from t1) then +11+t1.a when 11e)),d) FROM t1 WHERE t1.a<> -a} -} {0} -do_test randexpr-2.1578 { - db eval {SELECT b-t1.b-coalesce((select (abs(case t1.c+coalesce((select +17*case when b in (select abs(max(19) | count(distinct t1.e)) | cast(avg(t1.d) AS integer) from t1 union select (count(*)) from t1) then +11+t1.a when 11e)),d) FROM t1 WHERE NOT (t1.a<> -a)} -} {} -do_test randexpr-2.1579 { - db eval {SELECT b-t1.b-coalesce((select (abs(case t1.c+coalesce((select +17*case when b in (select abs(max(19) & count(distinct t1.e)) & cast(avg(t1.d) AS integer) from t1 union select (count(*)) from t1) then +11+t1.a when 11e)),d) FROM t1 WHERE t1.a<> -a} -} {0} -do_test randexpr-2.1580 { - db eval {SELECT ~(abs(b*t1.b)/abs(case when coalesce((select max((abs(a)/abs(case t1.e when t1.e then c*(t1.d) else t1.a end))) from t1 where b in (select min((t1.a)) from t1 union select + -max(b) from t1)),19)+a not between t1.e and -19 and 13<=a then (select case cast(avg((a)) AS integer) when min(e)*max(f) then -(count(distinct 13)) else cast(avg(13) AS integer) end-count(*) | count(distinct d) | -count(*) from t1) else b end)) FROM t1 WHERE f not between t1.d and b} -} {-40001} -do_test randexpr-2.1581 { - db eval {SELECT ~(abs(b*t1.b)/abs(case when coalesce((select max((abs(a)/abs(case t1.e when t1.e then c*(t1.d) else t1.a end))) from t1 where b in (select min((t1.a)) from t1 union select + -max(b) from t1)),19)+a not between t1.e and -19 and 13<=a then (select case cast(avg((a)) AS integer) when min(e)*max(f) then -(count(distinct 13)) else cast(avg(13) AS integer) end-count(*) | count(distinct d) | -count(*) from t1) else b end)) FROM t1 WHERE NOT (f not between t1.d and b)} -} {} -do_test randexpr-2.1582 { - db eval {SELECT +(abs(19)/abs(d | 11*t1.f))*t1.e-coalesce((select t1.b from t1 where not ((f*case when a>=17 then t1.c else (a) end-b not in (t1.b,t1.f,t1.f) or not exists(select 1 from t1 where t1.c>t1.a) and c not in (t1.d,t1.b,c)))),e) | coalesce((select ( - -f) from t1 where 19 not between 17 and 17),(a))-17*d*c FROM t1 WHERE t1.b>=e} -} {} -do_test randexpr-2.1583 { - db eval {SELECT +(abs(19)/abs(d | 11*t1.f))*t1.e-coalesce((select t1.b from t1 where not ((f*case when a>=17 then t1.c else (a) end-b not in (t1.b,t1.f,t1.f) or not exists(select 1 from t1 where t1.c>t1.a) and c not in (t1.d,t1.b,c)))),e) | coalesce((select ( - -f) from t1 where 19 not between 17 and 17),(a))-17*d*c FROM t1 WHERE NOT (t1.b>=e)} -} {-100} -do_test randexpr-2.1584 { - db eval {SELECT +(abs(19)/abs(d & 11*t1.f))*t1.e-coalesce((select t1.b from t1 where not ((f*case when a>=17 then t1.c else (a) end-b not in (t1.b,t1.f,t1.f) or not exists(select 1 from t1 where t1.c>t1.a) and c not in (t1.d,t1.b,c)))),e) & coalesce((select ( - -f) from t1 where 19 not between 17 and 17),(a))-17*d*c FROM t1 WHERE NOT (t1.b>=e)} -} {-2039800} -do_test randexpr-2.1585 { - db eval {SELECT (abs((abs(a)/abs(~17+t1.b-e+(abs(a)/abs(coalesce((select max(13) from t1 where c not in (c-(abs(+coalesce((select max(t1.b-f) from t1 where (abs(13+case ~t1.f when t1.c then t1.b else b end-e)/abs(c))-t1.e>t1.c),t1.c))/abs(11))+t1.b,t1.a,11)),t1.a)))))+19)/abs( - -t1.c)) FROM t1 WHERE ~t1.e+t1.a+(abs(case when d+e+17*~t1.a-t1.a-a*~(abs(~f)/abs( -13))*+(t1.c | a)*t1.b=e then t1.d when ( -e) not between c and -d then -(t1.f) else t1.b end)/abs(19))>t1.f and 11<(11)} -} {} -do_test randexpr-2.1586 { - db eval {SELECT (abs((abs(a)/abs(~17+t1.b-e+(abs(a)/abs(coalesce((select max(13) from t1 where c not in (c-(abs(+coalesce((select max(t1.b-f) from t1 where (abs(13+case ~t1.f when t1.c then t1.b else b end-e)/abs(c))-t1.e>t1.c),t1.c))/abs(11))+t1.b,t1.a,11)),t1.a)))))+19)/abs( - -t1.c)) FROM t1 WHERE NOT (~t1.e+t1.a+(abs(case when d+e+17*~t1.a-t1.a-a*~(abs(~f)/abs( -13))*+(t1.c | a)*t1.b=e then t1.d when ( -e) not between c and -d then -(t1.f) else t1.b end)/abs(19))>t1.f and 11<(11))} -} {0} -do_test randexpr-2.1587 { - db eval {SELECT (abs((abs( -t1.e)/abs(~17+b)))/abs((case 19 when case when t1.b in (select ~cast(avg(19) AS integer) from t1 union select max(t1.b) from t1) then case when case when exists(select 1 from t1 where t1.c not between d and e) then (11) when t1.d<11 then ( -t1.f) else c end in (select count(distinct 17) from t1 union select ~min(a) | max( -t1.a)- -min(b) from t1) then d else 17 end when 13> -t1.b then f else d end then (t1.b) else c end))) FROM t1 WHERE d in (b,+(abs(t1.b | t1.e)/abs(coalesce((select max(t1.b) from t1 where t1.f=(e*+t1.b-t1.d+b-t1.f-t1.a-case case a*t1.b when coalesce((select max(f) from t1 where c<11),(a)) then -t1.b else t1.f end when e then d else 19 end*t1.e+19)*d),t1.b))),t1.b)} -} {} -do_test randexpr-2.1588 { - db eval {SELECT (abs((abs( -t1.e)/abs(~17+b)))/abs((case 19 when case when t1.b in (select ~cast(avg(19) AS integer) from t1 union select max(t1.b) from t1) then case when case when exists(select 1 from t1 where t1.c not between d and e) then (11) when t1.d<11 then ( -t1.f) else c end in (select count(distinct 17) from t1 union select ~min(a) | max( -t1.a)- -min(b) from t1) then d else 17 end when 13> -t1.b then f else d end then (t1.b) else c end))) FROM t1 WHERE NOT (d in (b,+(abs(t1.b | t1.e)/abs(coalesce((select max(t1.b) from t1 where t1.f=(e*+t1.b-t1.d+b-t1.f-t1.a-case case a*t1.b when coalesce((select max(f) from t1 where c<11),(a)) then -t1.b else t1.f end when e then d else 19 end*t1.e+19)*d),t1.b))),t1.b))} -} {0} -do_test randexpr-2.1589 { - db eval {SELECT (abs((abs( -t1.e)/abs(~17+b)))/abs((case 19 when case when t1.b in (select ~cast(avg(19) AS integer) from t1 union select max(t1.b) from t1) then case when case when exists(select 1 from t1 where t1.c not between d and e) then (11) when t1.d<11 then ( -t1.f) else c end in (select count(distinct 17) from t1 union select ~min(a) & max( -t1.a)- -min(b) from t1) then d else 17 end when 13> -t1.b then f else d end then (t1.b) else c end))) FROM t1 WHERE NOT (d in (b,+(abs(t1.b | t1.e)/abs(coalesce((select max(t1.b) from t1 where t1.f=(e*+t1.b-t1.d+b-t1.f-t1.a-case case a*t1.b when coalesce((select max(f) from t1 where c<11),(a)) then -t1.b else t1.f end when e then d else 19 end*t1.e+19)*d),t1.b))),t1.b))} -} {0} -do_test randexpr-2.1590 { - db eval {SELECT c | case when e<=(abs(case when case when not exists(select 1 from t1 where case when t1.f>case when 19>=17 or f in (19,c,t1.d) then t1.b else b end then t1.e else -t1.b end*t1.d in (select t1.e from t1 union select c from t1)) then e else f end<>t1.d then -a when (11 in (select b from t1 union select a from t1)) then 19 else t1.a end-(c))/abs(c))+t1.d | t1.a then -19 else 17 end+t1.d-(t1.a) FROM t1 WHERE coalesce((select 13 from t1 where not exists(select 1 from t1 where t1.e*t1.d*t1.f>=(11) and d in (13,coalesce((select t1.f+t1.b from t1 where coalesce((select max(t1.a) from t1 where not (t1.d)<=t1.c),c) not in (t1.e,t1.d,b)),b)+f,d)) or (t1.f>f) or 11<=t1.d and 17<>13),a)<(t1.a)} -} {317} -do_test randexpr-2.1591 { - db eval {SELECT c | case when e<=(abs(case when case when not exists(select 1 from t1 where case when t1.f>case when 19>=17 or f in (19,c,t1.d) then t1.b else b end then t1.e else -t1.b end*t1.d in (select t1.e from t1 union select c from t1)) then e else f end<>t1.d then -a when (11 in (select b from t1 union select a from t1)) then 19 else t1.a end-(c))/abs(c))+t1.d | t1.a then -19 else 17 end+t1.d-(t1.a) FROM t1 WHERE NOT (coalesce((select 13 from t1 where not exists(select 1 from t1 where t1.e*t1.d*t1.f>=(11) and d in (13,coalesce((select t1.f+t1.b from t1 where coalesce((select max(t1.a) from t1 where not (t1.d)<=t1.c),c) not in (t1.e,t1.d,b)),b)+f,d)) or (t1.f>f) or 11<=t1.d and 17<>13),a)<(t1.a))} -} {} -do_test randexpr-2.1592 { - db eval {SELECT c & case when e<=(abs(case when case when not exists(select 1 from t1 where case when t1.f>case when 19>=17 or f in (19,c,t1.d) then t1.b else b end then t1.e else -t1.b end*t1.d in (select t1.e from t1 union select c from t1)) then e else f end<>t1.d then -a when (11 in (select b from t1 union select a from t1)) then 19 else t1.a end-(c))/abs(c))+t1.d & t1.a then -19 else 17 end+t1.d-(t1.a) FROM t1 WHERE coalesce((select 13 from t1 where not exists(select 1 from t1 where t1.e*t1.d*t1.f>=(11) and d in (13,coalesce((select t1.f+t1.b from t1 where coalesce((select max(t1.a) from t1 where not (t1.d)<=t1.c),c) not in (t1.e,t1.d,b)),b)+f,d)) or (t1.f>f) or 11<=t1.d and 17<>13),a)<(t1.a)} -} {300} -do_test randexpr-2.1593 { - db eval {SELECT -+t1.f*coalesce((select 17 from t1 where b in (coalesce((select f- -11 from t1 where not exists(select 1 from t1 where t1.d*a<=(case when -17=d-coalesce((select a from t1 where coalesce((select max(19) from t1 where case when 13 between coalesce((select max(b) from t1 where t1.e in (c,t1.a,17)),(a)) and ((17)) then t1.b when f=t1.b then t1.f else 17 end>t1.b),e)+b*a>=t1.a),c))} -} {} -do_test randexpr-2.1594 { - db eval {SELECT -+t1.f*coalesce((select 17 from t1 where b in (coalesce((select f- -11 from t1 where not exists(select 1 from t1 where t1.d*a<=(case when -17=d-coalesce((select a from t1 where coalesce((select max(19) from t1 where case when 13 between coalesce((select max(b) from t1 where t1.e in (c,t1.a,17)),(a)) and ((17)) then t1.b when f=t1.b then t1.f else 17 end>t1.b),e)+b*a>=t1.a),c)))} -} {-360489} -do_test randexpr-2.1595 { - db eval {SELECT -+t1.f*coalesce((select 17 from t1 where b in (coalesce((select f- -11 from t1 where not exists(select 1 from t1 where t1.d*a<=(case when -17=d-coalesce((select a from t1 where coalesce((select max(19) from t1 where case when 13 between coalesce((select max(b) from t1 where t1.e in (c,t1.a,17)),(a)) and ((17)) then t1.b when f=t1.b then t1.f else 17 end>t1.b),e)+b*a>=t1.a),c)))} -} {-360489} -do_test randexpr-2.1596 { - db eval {SELECT ~f+coalesce((select max(17+~a+t1.b) from t1 where 17>t1.c),c+case when t1.f*d not between t1.f-13 and ~t1.b then 19 when t1.a between case coalesce((select 17 from t1 where (e in (f,e,t1.b))),13) | t1.a* - -c*t1.f-a+a when e then t1.a else 13 end and b then b else e end)-11 FROM t1 WHERE 17=19*~d-case when (exists(select 1 from t1 where 17-e not between t1.b and f) or -f not in ( -13,b,c) and t1.f not between t1.f and 13) then 13 else coalesce((select t1.f from t1 where 11 not in (a,(e),t1.f)),(t1.c)) end+t1.c or 17 in (select +(count(*)) from t1 union select ~+case -min(t1.b) when case case max(19) when cast(avg((b)) AS integer) then (count(distinct t1.b)) else -cast(avg(t1.b) AS integer) end when ( -max(t1.e)) then max(17) else -count(distinct t1.f) end then cast(avg(19) AS integer) else count(*) end-count(*) | -cast(avg(11) AS integer) from t1)} -} {} -do_test randexpr-2.1597 { - db eval {SELECT ~f+coalesce((select max(17+~a+t1.b) from t1 where 17>t1.c),c+case when t1.f*d not between t1.f-13 and ~t1.b then 19 when t1.a between case coalesce((select 17 from t1 where (e in (f,e,t1.b))),13) | t1.a* - -c*t1.f-a+a when e then t1.a else 13 end and b then b else e end)-11 FROM t1 WHERE NOT (17=19*~d-case when (exists(select 1 from t1 where 17-e not between t1.b and f) or -f not in ( -13,b,c) and t1.f not between t1.f and 13) then 13 else coalesce((select t1.f from t1 where 11 not in (a,(e),t1.f)),(t1.c)) end+t1.c or 17 in (select +(count(*)) from t1 union select ~+case -min(t1.b) when case case max(19) when cast(avg((b)) AS integer) then (count(distinct t1.b)) else -cast(avg(t1.b) AS integer) end when ( -max(t1.e)) then max(17) else -count(distinct t1.f) end then cast(avg(19) AS integer) else count(*) end-count(*) | -cast(avg(11) AS integer) from t1))} -} {-293} -do_test randexpr-2.1598 { - db eval {SELECT ~f+coalesce((select max(17+~a+t1.b) from t1 where 17>t1.c),c+case when t1.f*d not between t1.f-13 and ~t1.b then 19 when t1.a between case coalesce((select 17 from t1 where (e in (f,e,t1.b))),13) & t1.a* - -c*t1.f-a+a when e then t1.a else 13 end and b then b else e end)-11 FROM t1 WHERE NOT (17=19*~d-case when (exists(select 1 from t1 where 17-e not between t1.b and f) or -f not in ( -13,b,c) and t1.f not between t1.f and 13) then 13 else coalesce((select t1.f from t1 where 11 not in (a,(e),t1.f)),(t1.c)) end+t1.c or 17 in (select +(count(*)) from t1 union select ~+case -min(t1.b) when case case max(19) when cast(avg((b)) AS integer) then (count(distinct t1.b)) else -cast(avg(t1.b) AS integer) end when ( -max(t1.e)) then max(17) else -count(distinct t1.f) end then cast(avg(19) AS integer) else count(*) end-count(*) | -cast(avg(11) AS integer) from t1))} -} {-293} -do_test randexpr-2.1599 { - db eval {SELECT (case when (select count(*) from t1)++t1.d+b*t1.e | t1.a+coalesce((select max(t1.d) from t1 where d-19<>c),t1.a)+t1.f in (select coalesce((select max(b) from t1 where t1.c-case when t1.c in (select c from t1 union select t1.f from t1) then f when t1.c not in ( -e,t1.e,11) then (t1.e) else 13 end in (f,t1.e,t1.f) or t1.a not between 19 and 17),t1.c) from t1 union select e from t1) then -t1.e else t1.a end) FROM t1 WHERE 11*b+~ -coalesce((select t1.e from t1 where not exists(select 1 from t1 where 19=t1.f)),t1.d+(abs( -a)/abs(t1.d)))-t1.d-19<=11} -} {} -do_test randexpr-2.1600 { - db eval {SELECT (case when (select count(*) from t1)++t1.d+b*t1.e | t1.a+coalesce((select max(t1.d) from t1 where d-19<>c),t1.a)+t1.f in (select coalesce((select max(b) from t1 where t1.c-case when t1.c in (select c from t1 union select t1.f from t1) then f when t1.c not in ( -e,t1.e,11) then (t1.e) else 13 end in (f,t1.e,t1.f) or t1.a not between 19 and 17),t1.c) from t1 union select e from t1) then -t1.e else t1.a end) FROM t1 WHERE NOT (11*b+~ -coalesce((select t1.e from t1 where not exists(select 1 from t1 where 19=t1.f)),t1.d+(abs( -a)/abs(t1.d)))-t1.d-19<=11)} -} {100} -do_test randexpr-2.1601 { - db eval {SELECT (case when (select count(*) from t1)++t1.d+b*t1.e & t1.a+coalesce((select max(t1.d) from t1 where d-19<>c),t1.a)+t1.f in (select coalesce((select max(b) from t1 where t1.c-case when t1.c in (select c from t1 union select t1.f from t1) then f when t1.c not in ( -e,t1.e,11) then (t1.e) else 13 end in (f,t1.e,t1.f) or t1.a not between 19 and 17),t1.c) from t1 union select e from t1) then -t1.e else t1.a end) FROM t1 WHERE NOT (11*b+~ -coalesce((select t1.e from t1 where not exists(select 1 from t1 where 19=t1.f)),t1.d+(abs( -a)/abs(t1.d)))-t1.d-19<=11)} -} {100} -do_test randexpr-2.1602 { - db eval {SELECT 19+~case when not not (select + - -min(f | f)-count(*)+count(*)-min(b)+count(distinct a) from t1)<=13-case when +13 between t1.a and a then 11 else 11 end and (11 not in (17, -t1.d,(f))) then t1.b | a-t1.f when t1.d<>17 then e else 17 end FROM t1 WHERE +t1.e-c<>case when c in (select d from t1 union select f from t1) then case (case when 13 in (select +c*a*13-11 from t1 union select b from t1) then t1.a when t1.f in ( -t1.f,11,a) or t1.a<=f or (exists(select 1 from t1 where 13>=d)) then t1.c else b end) when t1.d then 11 else e end when t1.b in (19,t1.d,(19)) then c else a end} -} {-482} -do_test randexpr-2.1603 { - db eval {SELECT 19+~case when not not (select + - -min(f | f)-count(*)+count(*)-min(b)+count(distinct a) from t1)<=13-case when +13 between t1.a and a then 11 else 11 end and (11 not in (17, -t1.d,(f))) then t1.b | a-t1.f when t1.d<>17 then e else 17 end FROM t1 WHERE NOT (+t1.e-c<>case when c in (select d from t1 union select f from t1) then case (case when 13 in (select +c*a*13-11 from t1 union select b from t1) then t1.a when t1.f in ( -t1.f,11,a) or t1.a<=f or (exists(select 1 from t1 where 13>=d)) then t1.c else b end) when t1.d then 11 else e end when t1.b in (19,t1.d,(19)) then c else a end)} -} {} -do_test randexpr-2.1604 { - db eval {SELECT 19+~case when not not (select + - -min(f & f)-count(*)+count(*)-min(b)+count(distinct a) from t1)<=13-case when +13 between t1.a and a then 11 else 11 end and (11 not in (17, -t1.d,(f))) then t1.b & a-t1.f when t1.d<>17 then e else 17 end FROM t1 WHERE +t1.e-c<>case when c in (select d from t1 union select f from t1) then case (case when 13 in (select +c*a*13-11 from t1 union select b from t1) then t1.a when t1.f in ( -t1.f,11,a) or t1.a<=f or (exists(select 1 from t1 where 13>=d)) then t1.c else b end) when t1.d then 11 else e end when t1.b in (19,t1.d,(19)) then c else a end} -} {-482} -do_test randexpr-2.1605 { - db eval {SELECT (case when e not between 19 and t1.a then case coalesce((select t1.e from t1 where (exists(select 1 from t1 where c in (select case count(distinct t1.b) when max(b) then min((t1.d)) else count(distinct 11) end+ -count(*) | - -count(distinct t1.e) from t1 union select min(f) from t1))) or (select min(17) from t1) not between 13 and b and - -c=17 and 17 between t1.e and 13 or 13>d or 11>= -t1.d then a else 13 end)+t1.f FROM t1 WHERE b<=13} -} {} -do_test randexpr-2.1606 { - db eval {SELECT (case when e not between 19 and t1.a then case coalesce((select t1.e from t1 where (exists(select 1 from t1 where c in (select case count(distinct t1.b) when max(b) then min((t1.d)) else count(distinct 11) end+ -count(*) | - -count(distinct t1.e) from t1 union select min(f) from t1))) or (select min(17) from t1) not between 13 and b and - -c=17 and 17 between t1.e and 13 or 13>d or 11>= -t1.d then a else 13 end)+t1.f FROM t1 WHERE NOT (b<=13)} -} {619} -do_test randexpr-2.1607 { - db eval {SELECT (case when e not between 19 and t1.a then case coalesce((select t1.e from t1 where (exists(select 1 from t1 where c in (select case count(distinct t1.b) when max(b) then min((t1.d)) else count(distinct 11) end+ -count(*) & - -count(distinct t1.e) from t1 union select min(f) from t1))) or (select min(17) from t1) not between 13 and b and - -c=17 and 17 between t1.e and 13 or 13>d or 11>= -t1.d then a else 13 end)+t1.f FROM t1 WHERE NOT (b<=13)} -} {619} -do_test randexpr-2.1608 { - db eval {SELECT case c when d then +e else 17-e+case when exists(select 1 from t1 where not -f<19) then (a) when t1.a between case when t1.d- -~t1.a+(select case min(t1.a) when count(distinct t1.e) then max(f) else max(t1.f) end-min(t1.b) from t1)*(select max(17) from t1)+e*13-f in (t1.d,f,d) then f else t1.b end and b then t1.d else d end end FROM t1 WHERE b<>c*f} -} {-83} -do_test randexpr-2.1609 { - db eval {SELECT case c when d then +e else 17-e+case when exists(select 1 from t1 where not -f<19) then (a) when t1.a between case when t1.d- -~t1.a+(select case min(t1.a) when count(distinct t1.e) then max(f) else max(t1.f) end-min(t1.b) from t1)*(select max(17) from t1)+e*13-f in (t1.d,f,d) then f else t1.b end and b then t1.d else d end end FROM t1 WHERE NOT (b<>c*f)} -} {} -do_test randexpr-2.1610 { - db eval {SELECT -(select min(coalesce((select max(case when d>=t1.c then f-t1.c else t1.b end) from t1 where case when (17)-13<=(abs(a-e)/abs(19-t1.a)) then (select -max(c++t1.d | +case when 19 in (select b from t1 union select t1.c from t1) then t1.d else f end) from t1) else 11-19 end not in (e,t1.e,17)),c)+t1.b) from t1) FROM t1 WHERE -case when case when e=case when not 17>+t1.d and b*b in (e, -d,13) then -b*c else t1.e end then t1.f when e>=a then c else 19 end+t1.e<> -t1.d then 11 when not 11<>13 then 13 else e end*17*t1.d+t1.f in (select e from t1 union select t1.b from t1)} -} {} -do_test randexpr-2.1611 { - db eval {SELECT -(select min(coalesce((select max(case when d>=t1.c then f-t1.c else t1.b end) from t1 where case when (17)-13<=(abs(a-e)/abs(19-t1.a)) then (select -max(c++t1.d | +case when 19 in (select b from t1 union select t1.c from t1) then t1.d else f end) from t1) else 11-19 end not in (e,t1.e,17)),c)+t1.b) from t1) FROM t1 WHERE NOT ( -case when case when e=case when not 17>+t1.d and b*b in (e, -d,13) then -b*c else t1.e end then t1.f when e>=a then c else 19 end+t1.e<> -t1.d then 11 when not 11<>13 then 13 else e end*17*t1.d+t1.f in (select e from t1 union select t1.b from t1))} -} {-500} -do_test randexpr-2.1612 { - db eval {SELECT -(select min(coalesce((select max(case when d>=t1.c then f-t1.c else t1.b end) from t1 where case when (17)-13<=(abs(a-e)/abs(19-t1.a)) then (select -max(c++t1.d & +case when 19 in (select b from t1 union select t1.c from t1) then t1.d else f end) from t1) else 11-19 end not in (e,t1.e,17)),c)+t1.b) from t1) FROM t1 WHERE NOT ( -case when case when e=case when not 17>+t1.d and b*b in (e, -d,13) then -b*c else t1.e end then t1.f when e>=a then c else 19 end+t1.e<> -t1.d then 11 when not 11<>13 then 13 else e end*17*t1.d+t1.f in (select e from t1 union select t1.b from t1))} -} {-500} -do_test randexpr-2.1613 { - db eval {SELECT case when b<=(abs(19)/abs(t1.a)) | 13-b then +f | ~d else ~case when case case when t1.c in (select 13+19 from t1 union select t1.a from t1) then -c when 13 between t1.a and b then 17 else c end when t1.c then e else 11 end between t1.e and 11 or f in (select 17 from t1 union select (a) from t1) then t1.f-d when t1.b in (select t1.f from t1 union select t1.f from t1) then t1.c else t1.b end end FROM t1 WHERE (t1.e in (select +17 from t1 union select 11 from t1))} -} {} -do_test randexpr-2.1614 { - db eval {SELECT case when b<=(abs(19)/abs(t1.a)) | 13-b then +f | ~d else ~case when case case when t1.c in (select 13+19 from t1 union select t1.a from t1) then -c when 13 between t1.a and b then 17 else c end when t1.c then e else 11 end between t1.e and 11 or f in (select 17 from t1 union select (a) from t1) then t1.f-d when t1.b in (select t1.f from t1 union select t1.f from t1) then t1.c else t1.b end end FROM t1 WHERE NOT ((t1.e in (select +17 from t1 union select 11 from t1)))} -} {-201} -do_test randexpr-2.1615 { - db eval {SELECT case when b<=(abs(19)/abs(t1.a)) & 13-b then +f & ~d else ~case when case case when t1.c in (select 13+19 from t1 union select t1.a from t1) then -c when 13 between t1.a and b then 17 else c end when t1.c then e else 11 end between t1.e and 11 or f in (select 17 from t1 union select (a) from t1) then t1.f-d when t1.b in (select t1.f from t1 union select t1.f from t1) then t1.c else t1.b end end FROM t1 WHERE NOT ((t1.e in (select +17 from t1 union select 11 from t1)))} -} {-201} -do_test randexpr-2.1616 { - db eval {SELECT coalesce((select coalesce((select coalesce((select ~e+coalesce((select -e-+17 from t1 where (select cast(avg(11) AS integer) from t1) between case when +13+13 between 19 and t1.c then t1.d else 13 end and 13),t1.c)* -(19)+17-t1.a+e from t1 where t1.b>=t1.f),t1.b) | t1.f from t1 where f in (select d from t1 union select 11 from t1)),t1.b) from t1 where t1.b=13),t1.d) FROM t1 WHERE t1.f<>(abs(t1.c)/abs(t1.a))} -} {400} -do_test randexpr-2.1617 { - db eval {SELECT coalesce((select coalesce((select coalesce((select ~e+coalesce((select -e-+17 from t1 where (select cast(avg(11) AS integer) from t1) between case when +13+13 between 19 and t1.c then t1.d else 13 end and 13),t1.c)* -(19)+17-t1.a+e from t1 where t1.b>=t1.f),t1.b) | t1.f from t1 where f in (select d from t1 union select 11 from t1)),t1.b) from t1 where t1.b=13),t1.d) FROM t1 WHERE NOT (t1.f<>(abs(t1.c)/abs(t1.a)))} -} {} -do_test randexpr-2.1618 { - db eval {SELECT coalesce((select coalesce((select coalesce((select ~e+coalesce((select -e-+17 from t1 where (select cast(avg(11) AS integer) from t1) between case when +13+13 between 19 and t1.c then t1.d else 13 end and 13),t1.c)* -(19)+17-t1.a+e from t1 where t1.b>=t1.f),t1.b) & t1.f from t1 where f in (select d from t1 union select 11 from t1)),t1.b) from t1 where t1.b=13),t1.d) FROM t1 WHERE t1.f<>(abs(t1.c)/abs(t1.a))} -} {400} -do_test randexpr-2.1619 { - db eval {SELECT (abs(a)/abs(coalesce((select case when coalesce((select d from t1 where d+case (coalesce((select max(e) from t1 where 17+f*13-(case 19 when t1.f then 17 else t1.e end)<>b),17)) when t1.e then t1.e else t1.a end- -13+ -t1.f between b and f),11)+t1.d between 13 and t1.d then b else (19) end-t1.c from t1 where c in (select t1.e from t1 union select f from t1)),b))) FROM t1 WHERE d>t1.a} -} {0} -do_test randexpr-2.1620 { - db eval {SELECT (abs(a)/abs(coalesce((select case when coalesce((select d from t1 where d+case (coalesce((select max(e) from t1 where 17+f*13-(case 19 when t1.f then 17 else t1.e end)<>b),17)) when t1.e then t1.e else t1.a end- -13+ -t1.f between b and f),11)+t1.d between 13 and t1.d then b else (19) end-t1.c from t1 where c in (select t1.e from t1 union select f from t1)),b))) FROM t1 WHERE NOT (d>t1.a)} -} {} -do_test randexpr-2.1621 { - db eval {SELECT coalesce((select case when coalesce((select max(coalesce((select max(e-c-coalesce((select max(c) from t1 where 19 between 13 and 13),(abs(case when c<=17 or f in (t1.a, -17,t1.f) then b else t1.c end)/abs(e))+t1.b)) from t1 where not exists(select 1 from t1 where t1.e>=b)),e)) from t1 where not exists(select 1 from t1 where 13<=t1.b or t1.f in (select d from t1 union select t1.d from t1))),17) in (select 11 from t1 union select t1.d from t1) then c else t1.e end from t1 where t1.c in (select b from t1 union select b from t1)),f) | t1.c FROM t1 WHERE c<=e} -} {892} -do_test randexpr-2.1622 { - db eval {SELECT coalesce((select case when coalesce((select max(coalesce((select max(e-c-coalesce((select max(c) from t1 where 19 between 13 and 13),(abs(case when c<=17 or f in (t1.a, -17,t1.f) then b else t1.c end)/abs(e))+t1.b)) from t1 where not exists(select 1 from t1 where t1.e>=b)),e)) from t1 where not exists(select 1 from t1 where 13<=t1.b or t1.f in (select d from t1 union select t1.d from t1))),17) in (select 11 from t1 union select t1.d from t1) then c else t1.e end from t1 where t1.c in (select b from t1 union select b from t1)),f) | t1.c FROM t1 WHERE NOT (c<=e)} -} {} -do_test randexpr-2.1623 { - db eval {SELECT coalesce((select case when coalesce((select max(coalesce((select max(e-c-coalesce((select max(c) from t1 where 19 between 13 and 13),(abs(case when c<=17 or f in (t1.a, -17,t1.f) then b else t1.c end)/abs(e))+t1.b)) from t1 where not exists(select 1 from t1 where t1.e>=b)),e)) from t1 where not exists(select 1 from t1 where 13<=t1.b or t1.f in (select d from t1 union select t1.d from t1))),17) in (select 11 from t1 union select t1.d from t1) then c else t1.e end from t1 where t1.c in (select b from t1 union select b from t1)),f) & t1.c FROM t1 WHERE c<=e} -} {8} -do_test randexpr-2.1624 { - db eval {SELECT (select +max(case when t1.a in (f,case when f in (t1.b,+ -(select count(*)-min(17) from t1)+19,11) then -19 else 19 end*(abs(b)/abs(a)),a) then t1.b when (case a when 17 then c | t1.d else t1.c end+11)-13 in (b,11,f) then b else 17 end*17) from t1) FROM t1 WHERE c between (abs(case when (abs(d+19)/abs(19))-c*t1.d+t1.e+case when -(abs(case when exists(select 1 from t1 where exists(select 1 from t1 where 13 in (select cast(avg(t1.b) AS integer) from t1 union select max(d) from t1))) then ~c when t1.d not between 13 and d then -t1.b else -f end)/abs(t1.b))+d in (t1.e,(13),e) then e when (b)<>d then t1.b else 19 end in (select 17 from t1 union select e from t1) then t1.e else t1.e end)/abs(t1.f)) and t1.e} -} {3400} -do_test randexpr-2.1625 { - db eval {SELECT (select +max(case when t1.a in (f,case when f in (t1.b,+ -(select count(*)-min(17) from t1)+19,11) then -19 else 19 end*(abs(b)/abs(a)),a) then t1.b when (case a when 17 then c | t1.d else t1.c end+11)-13 in (b,11,f) then b else 17 end*17) from t1) FROM t1 WHERE NOT (c between (abs(case when (abs(d+19)/abs(19))-c*t1.d+t1.e+case when -(abs(case when exists(select 1 from t1 where exists(select 1 from t1 where 13 in (select cast(avg(t1.b) AS integer) from t1 union select max(d) from t1))) then ~c when t1.d not between 13 and d then -t1.b else -f end)/abs(t1.b))+d in (t1.e,(13),e) then e when (b)<>d then t1.b else 19 end in (select 17 from t1 union select e from t1) then t1.e else t1.e end)/abs(t1.f)) and t1.e)} -} {} -do_test randexpr-2.1626 { - db eval {SELECT (select +max(case when t1.a in (f,case when f in (t1.b,+ -(select count(*)-min(17) from t1)+19,11) then -19 else 19 end*(abs(b)/abs(a)),a) then t1.b when (case a when 17 then c & t1.d else t1.c end+11)-13 in (b,11,f) then b else 17 end*17) from t1) FROM t1 WHERE c between (abs(case when (abs(d+19)/abs(19))-c*t1.d+t1.e+case when -(abs(case when exists(select 1 from t1 where exists(select 1 from t1 where 13 in (select cast(avg(t1.b) AS integer) from t1 union select max(d) from t1))) then ~c when t1.d not between 13 and d then -t1.b else -f end)/abs(t1.b))+d in (t1.e,(13),e) then e when (b)<>d then t1.b else 19 end in (select 17 from t1 union select e from t1) then t1.e else t1.e end)/abs(t1.f)) and t1.e} -} {3400} -do_test randexpr-2.1627 { - db eval {SELECT case when c between f and t1.f*t1.f then (coalesce((select max(d | coalesce((select 19+t1.c from t1 where t1.a between d and (b)),(t1.f))*t1.f*t1.b) from t1 where 11>13 or 19 not between 13 and 11 or t1.a>=b or b>t1.e or 11=a and t1.b<=d),f)) when a in (select min(t1.b)-abs(count(distinct 11)) from t1 union select cast(avg(t1.d) AS integer) from t1) then f else c end-t1.e FROM t1 WHERE (t1.f+a)*t1.b+(abs(b)/abs(b)) in (t1.e,case when 11-t1.a+e+case 19 when +11+ -t1.b then case ~t1.f*(f)-b when d then a else ( -c) end*(c) else t1.a end+t1.a not in (17,11,t1.e) then t1.b else (d) end*19,t1.a)} -} {} -do_test randexpr-2.1628 { - db eval {SELECT case when c between f and t1.f*t1.f then (coalesce((select max(d | coalesce((select 19+t1.c from t1 where t1.a between d and (b)),(t1.f))*t1.f*t1.b) from t1 where 11>13 or 19 not between 13 and 11 or t1.a>=b or b>t1.e or 11=a and t1.b<=d),f)) when a in (select min(t1.b)-abs(count(distinct 11)) from t1 union select cast(avg(t1.d) AS integer) from t1) then f else c end-t1.e FROM t1 WHERE NOT ((t1.f+a)*t1.b+(abs(b)/abs(b)) in (t1.e,case when 11-t1.a+e+case 19 when +11+ -t1.b then case ~t1.f*(f)-b when d then a else ( -c) end*(c) else t1.a end+t1.a not in (17,11,t1.e) then t1.b else (d) end*19,t1.a))} -} {-200} -do_test randexpr-2.1629 { - db eval {SELECT case when c between f and t1.f*t1.f then (coalesce((select max(d & coalesce((select 19+t1.c from t1 where t1.a between d and (b)),(t1.f))*t1.f*t1.b) from t1 where 11>13 or 19 not between 13 and 11 or t1.a>=b or b>t1.e or 11=a and t1.b<=d),f)) when a in (select min(t1.b)-abs(count(distinct 11)) from t1 union select cast(avg(t1.d) AS integer) from t1) then f else c end-t1.e FROM t1 WHERE NOT ((t1.f+a)*t1.b+(abs(b)/abs(b)) in (t1.e,case when 11-t1.a+e+case 19 when +11+ -t1.b then case ~t1.f*(f)-b when d then a else ( -c) end*(c) else t1.a end+t1.a not in (17,11,t1.e) then t1.b else (d) end*19,t1.a))} -} {-200} -do_test randexpr-2.1630 { - db eval {SELECT coalesce((select max(f) from t1 where (a+13>19*t1.e+a | a | 17*e or ~c not between 17 and 19*(select +(~count(distinct e)*(cast(avg(t1.b) AS integer))) | count(distinct t1.c) from t1)-f and t1.a*t1.f+c not between t1.f and f)),t1.c*(t1.e)*e) FROM t1 WHERE case case t1.f when ~17 then 11 else t1.d end when a then t1.a else e end>d*11} -} {} -do_test randexpr-2.1631 { - db eval {SELECT coalesce((select max(f) from t1 where (a+13>19*t1.e+a | a | 17*e or ~c not between 17 and 19*(select +(~count(distinct e)*(cast(avg(t1.b) AS integer))) | count(distinct t1.c) from t1)-f and t1.a*t1.f+c not between t1.f and f)),t1.c*(t1.e)*e) FROM t1 WHERE NOT (case case t1.f when ~17 then 11 else t1.d end when a then t1.a else e end>d*11)} -} {600} -do_test randexpr-2.1632 { - db eval {SELECT coalesce((select max(f) from t1 where (a+13>19*t1.e+a & a & 17*e or ~c not between 17 and 19*(select +(~count(distinct e)*(cast(avg(t1.b) AS integer))) & count(distinct t1.c) from t1)-f and t1.a*t1.f+c not between t1.f and f)),t1.c*(t1.e)*e) FROM t1 WHERE NOT (case case t1.f when ~17 then 11 else t1.d end when a then t1.a else e end>d*11)} -} {600} -do_test randexpr-2.1633 { - db eval {SELECT case when e<11 then (case case t1.a when coalesce((select max(11) from t1 where t1.c<=case when exists(select 1 from t1 where 13=e) then case when c not in (t1.f,t1.e,c) then c else ~(c)+d*f end when a>b then 11 else 11 end),(t1.c)) | 11 then b else t1.a end when 11 then t1.f else t1.d end) when db then 11 else 11 end),(t1.c)) | 11 then b else t1.a end when 11 then t1.f else t1.d end) when db then 11 else 11 end),(t1.c)) & 11 then b else t1.a end when 11 then t1.f else t1.d end) when df)),17) when coalesce((select max((b)) from t1 where not case (abs(t1.b)/abs(t1.d+t1.b)) when t1.d then f-coalesce((select max(a) from t1 where case t1.e when c then c else 11 end not between b and -t1.b),t1.e) else t1.a end-17 between t1.e and f and (t1.e17), -e)*19 then t1.b else t1.c end FROM t1 WHERE not -coalesce((select d from t1 where exists(select 1 from t1 where coalesce((select max(case when 11 not in (case when d*11<>17-(t1.e) then 13 else c end,t1.d,t1.c) then e else t1.c end) from t1 where t1.d<= - -d),11) in (select + -case (+ -cast(avg(19) AS integer)+ - -(count(*))* -count(distinct ((t1.e)))*max(d)) when count(*) then max(b) else count(*) end from t1 union select count(*) from t1))),t1.d)+13>a} -} {300} -do_test randexpr-2.1637 { - db eval {SELECT case coalesce((select a from t1 where exists(select 1 from t1 where t1.e>f)),17) when coalesce((select max((b)) from t1 where not case (abs(t1.b)/abs(t1.d+t1.b)) when t1.d then f-coalesce((select max(a) from t1 where case t1.e when c then c else 11 end not between b and -t1.b),t1.e) else t1.a end-17 between t1.e and f and (t1.e17), -e)*19 then t1.b else t1.c end FROM t1 WHERE NOT (not -coalesce((select d from t1 where exists(select 1 from t1 where coalesce((select max(case when 11 not in (case when d*11<>17-(t1.e) then 13 else c end,t1.d,t1.c) then e else t1.c end) from t1 where t1.d<= - -d),11) in (select + -case (+ -cast(avg(19) AS integer)+ - -(count(*))* -count(distinct ((t1.e)))*max(d)) when count(*) then max(b) else count(*) end from t1 union select count(*) from t1))),t1.d)+13>a)} -} {} -do_test randexpr-2.1638 { - db eval {SELECT ~coalesce((select 17 from t1 where not exists(select 1 from t1 where t1.e-t1.e in (select t1.c+case d when case when not case when t1.f between ( -t1.a) and (b) or 11<>19 then (abs(t1.e)/abs(t1.f)) else e end between t1.b and e then t1.d | t1.e when 19>b then 13 else t1.a end*e*13 | 11+t1.f then t1.b else 17 end from t1 union select e from t1))),t1.a-t1.b)*t1.d*e FROM t1 WHERE d in (select 11 from t1 union select +11 from t1) or coalesce((select max(coalesce((select b-e*case when (c) | e | b in (select 19*t1.d from t1 union select t1.e from t1) then t1.d else e end from t1 where t1.a<11),d)) from t1 where (not ((17 not in ( -t1.a,e,d) and 13<11) and f>=11))),t1.b)<11} -} {} -do_test randexpr-2.1639 { - db eval {SELECT ~coalesce((select 17 from t1 where not exists(select 1 from t1 where t1.e-t1.e in (select t1.c+case d when case when not case when t1.f between ( -t1.a) and (b) or 11<>19 then (abs(t1.e)/abs(t1.f)) else e end between t1.b and e then t1.d | t1.e when 19>b then 13 else t1.a end*e*13 | 11+t1.f then t1.b else 17 end from t1 union select e from t1))),t1.a-t1.b)*t1.d*e FROM t1 WHERE NOT (d in (select 11 from t1 union select +11 from t1) or coalesce((select max(coalesce((select b-e*case when (c) | e | b in (select 19*t1.d from t1 union select t1.e from t1) then t1.d else e end from t1 where t1.a<11),d)) from t1 where (not ((17 not in ( -t1.a,e,d) and 13<11) and f>=11))),t1.b)<11)} -} {-3600000} -do_test randexpr-2.1640 { - db eval {SELECT ~coalesce((select 17 from t1 where not exists(select 1 from t1 where t1.e-t1.e in (select t1.c+case d when case when not case when t1.f between ( -t1.a) and (b) or 11<>19 then (abs(t1.e)/abs(t1.f)) else e end between t1.b and e then t1.d & t1.e when 19>b then 13 else t1.a end*e*13 & 11+t1.f then t1.b else 17 end from t1 union select e from t1))),t1.a-t1.b)*t1.d*e FROM t1 WHERE NOT (d in (select 11 from t1 union select +11 from t1) or coalesce((select max(coalesce((select b-e*case when (c) | e | b in (select 19*t1.d from t1 union select t1.e from t1) then t1.d else e end from t1 where t1.a<11),d)) from t1 where (not ((17 not in ( -t1.a,e,d) and 13<11) and f>=11))),t1.b)<11)} -} {-3600000} -do_test randexpr-2.1641 { - db eval {SELECT case b-f when t1.a then -case when not (case t1.a when (select case cast(avg(c) AS integer) when count(distinct t1.f) then +max(t1.e) | -((( -(count(*))))) else cast(avg(f) AS integer) end from t1)-b then a else coalesce((select t1.a from t1 where (e=a and e>c) or c not between a and 19 then 11 when t1.b not between e and t1.a then 17 else 11 end) from t1)) AS integer) from t1 union select cast(avg((abs(b)/abs(t1.f))) AS integer) from t1) then 17 else t1.e end>=a} -} {} -do_test randexpr-2.1642 { - db eval {SELECT case b-f when t1.a then -case when not (case t1.a when (select case cast(avg(c) AS integer) when count(distinct t1.f) then +max(t1.e) | -((( -(count(*))))) else cast(avg(f) AS integer) end from t1)-b then a else coalesce((select t1.a from t1 where (e=a and e>c) or c not between a and 19 then 11 when t1.b not between e and t1.a then 17 else 11 end) from t1)) AS integer) from t1 union select cast(avg((abs(b)/abs(t1.f))) AS integer) from t1) then 17 else t1.e end>=a)} -} {17} -do_test randexpr-2.1643 { - db eval {SELECT case b-f when t1.a then -case when not (case t1.a when (select case cast(avg(c) AS integer) when count(distinct t1.f) then +max(t1.e) & -((( -(count(*))))) else cast(avg(f) AS integer) end from t1)-b then a else coalesce((select t1.a from t1 where (e=a and e>c) or c not between a and 19 then 11 when t1.b not between e and t1.a then 17 else 11 end) from t1)) AS integer) from t1 union select cast(avg((abs(b)/abs(t1.f))) AS integer) from t1) then 17 else t1.e end>=a)} -} {17} -do_test randexpr-2.1644 { - db eval {SELECT coalesce((select max((abs(t1.b*t1.d*case when f*t1.db),t1.d*19)*e+c+t1.d then t1.c when exists(select 1 from t1 where 13>=e) then t1.e else f end-f*e)/abs(13))) from t1 where (a)<=t1.d),13) | e FROM t1 WHERE +t1.c>t1.d} -} {} -do_test randexpr-2.1645 { - db eval {SELECT coalesce((select max((abs(t1.b*t1.d*case when f*t1.db),t1.d*19)*e+c+t1.d then t1.c when exists(select 1 from t1 where 13>=e) then t1.e else f end-f*e)/abs(13))) from t1 where (a)<=t1.d),13) | e FROM t1 WHERE NOT (+t1.c>t1.d)} -} {1823220} -do_test randexpr-2.1646 { - db eval {SELECT coalesce((select max((abs(t1.b*t1.d*case when f*t1.db),t1.d*19)*e+c+t1.d then t1.c when exists(select 1 from t1 where 13>=e) then t1.e else f end-f*e)/abs(13))) from t1 where (a)<=t1.d),13) & e FROM t1 WHERE NOT (+t1.c>t1.d)} -} {356} -do_test randexpr-2.1647 { - db eval {SELECT case when not exists(select 1 from t1 where 17>=19) or t1.c in (select min(19)-(cast(avg(f) AS integer)) from t1 union select cast(avg(19) AS integer) from t1) and e in (select ~+count(distinct 19)*max(13) from t1 union select min(17+d) from t1) or t1.f in (select count(*) from t1 union select (max(a)) from t1) then coalesce((select -d- -t1.d from t1 where b in (select cast(avg(c) AS integer) from t1 union select (count(*)) from t1) or b<=11),e) else t1.e end FROM t1 WHERE a< -13} -} {} -do_test randexpr-2.1648 { - db eval {SELECT case when not exists(select 1 from t1 where 17>=19) or t1.c in (select min(19)-(cast(avg(f) AS integer)) from t1 union select cast(avg(19) AS integer) from t1) and e in (select ~+count(distinct 19)*max(13) from t1 union select min(17+d) from t1) or t1.f in (select count(*) from t1 union select (max(a)) from t1) then coalesce((select -d- -t1.d from t1 where b in (select cast(avg(c) AS integer) from t1 union select (count(*)) from t1) or b<=11),e) else t1.e end FROM t1 WHERE NOT (a< -13)} -} {500} -do_test randexpr-2.1649 { - db eval {SELECT f+case when 17-t1.f in (select ~count(distinct (abs((abs(c)/abs(c)))/abs((abs(11)/abs(+case -t1.a when t1.d then -13 else 17 end))))-t1.c) from t1 union select ~case cast(avg(t1.c) AS integer) when -~ -count(*)*max((t1.f))+count(*) then (min(d)) else max(a) end-count(distinct t1.a)+ -count(*)-count(*) from t1) then d when b not between t1.f and t1.e then a else 11 end+t1.a FROM t1 WHERE (exists(select 1 from t1 where case when exists(select 1 from t1 where case when (t1.e+case (t1.b) when f then case t1.c when 11 | -13-coalesce((select max(d) from t1 where c not in ( -t1.e,t1.c,17) and t1.c<17),e)*17+t1.a then t1.b else 11 end else d end)+t1.f not in (d,13,d) then f else t1.d end not between (c) and f) then t1.e else f end-t1.c in (t1.b,t1.a,f)))} -} {} -do_test randexpr-2.1650 { - db eval {SELECT f+case when 17-t1.f in (select ~count(distinct (abs((abs(c)/abs(c)))/abs((abs(11)/abs(+case -t1.a when t1.d then -13 else 17 end))))-t1.c) from t1 union select ~case cast(avg(t1.c) AS integer) when -~ -count(*)*max((t1.f))+count(*) then (min(d)) else max(a) end-count(distinct t1.a)+ -count(*)-count(*) from t1) then d when b not between t1.f and t1.e then a else 11 end+t1.a FROM t1 WHERE NOT ((exists(select 1 from t1 where case when exists(select 1 from t1 where case when (t1.e+case (t1.b) when f then case t1.c when 11 | -13-coalesce((select max(d) from t1 where c not in ( -t1.e,t1.c,17) and t1.c<17),e)*17+t1.a then t1.b else 11 end else d end)+t1.f not in (d,13,d) then f else t1.d end not between (c) and f) then t1.e else f end-t1.c in (t1.b,t1.a,f))))} -} {800} -do_test randexpr-2.1651 { - db eval {SELECT case ~t1.d when case when c in (select count(*) from t1 union select +(( -min(17)-~cast(avg(t1.c) AS integer)))* -min(t1.f)-max(t1.d)*count(*) | cast(avg(17) AS integer) from t1) then 17*e*t1.f | t1.e else 19-coalesce((select max(t1.f) from t1 where not exists(select 1 from t1 where t1.c>=e)),t1.f) end | 13+13 then 17 else t1.f end FROM t1 WHERE (not exists(select 1 from t1 where +c-19 in (select (~((min(b)))-+count(*) | cast(avg(case when 11 in (select (abs((t1.b))/abs(e)) from t1 union select (17) from t1) then t1.c when -a<=b then t1.a else t1.e end) AS integer)++case max(t1.b) when cast(avg(c) AS integer) then count(*) else cast(avg(f) AS integer) end | -count(*)-(count(*))*max(t1.e)*count(*)*cast(avg(a) AS integer))+min(11) from t1 union select max((d)) from t1)))} -} {600} -do_test randexpr-2.1652 { - db eval {SELECT case ~t1.d when case when c in (select count(*) from t1 union select +(( -min(17)-~cast(avg(t1.c) AS integer)))* -min(t1.f)-max(t1.d)*count(*) | cast(avg(17) AS integer) from t1) then 17*e*t1.f | t1.e else 19-coalesce((select max(t1.f) from t1 where not exists(select 1 from t1 where t1.c>=e)),t1.f) end | 13+13 then 17 else t1.f end FROM t1 WHERE NOT ((not exists(select 1 from t1 where +c-19 in (select (~((min(b)))-+count(*) | cast(avg(case when 11 in (select (abs((t1.b))/abs(e)) from t1 union select (17) from t1) then t1.c when -a<=b then t1.a else t1.e end) AS integer)++case max(t1.b) when cast(avg(c) AS integer) then count(*) else cast(avg(f) AS integer) end | -count(*)-(count(*))*max(t1.e)*count(*)*cast(avg(a) AS integer))+min(11) from t1 union select max((d)) from t1))))} -} {} -do_test randexpr-2.1653 { - db eval {SELECT case ~t1.d when case when c in (select count(*) from t1 union select +(( -min(17)-~cast(avg(t1.c) AS integer)))* -min(t1.f)-max(t1.d)*count(*) & cast(avg(17) AS integer) from t1) then 17*e*t1.f & t1.e else 19-coalesce((select max(t1.f) from t1 where not exists(select 1 from t1 where t1.c>=e)),t1.f) end & 13+13 then 17 else t1.f end FROM t1 WHERE (not exists(select 1 from t1 where +c-19 in (select (~((min(b)))-+count(*) | cast(avg(case when 11 in (select (abs((t1.b))/abs(e)) from t1 union select (17) from t1) then t1.c when -a<=b then t1.a else t1.e end) AS integer)++case max(t1.b) when cast(avg(c) AS integer) then count(*) else cast(avg(f) AS integer) end | -count(*)-(count(*))*max(t1.e)*count(*)*cast(avg(a) AS integer))+min(11) from t1 union select max((d)) from t1)))} -} {600} -do_test randexpr-2.1654 { - db eval {SELECT 19 | case when not (select min(17) from t1)>t1.e then coalesce((select max(coalesce((select b from t1 where (t1.a not in (a | t1.c,t1.d,19) or not exists(select 1 from t1 where t1.b in (select t1.d from t1 union select a from t1)) and (a in (select count(*) from t1 union select max(t1.b) from t1) and t1.c in (t1.b,f,t1.d)))),t1.c)) from t1 where f=d and -b>c),t1.f)-t1.c when c in ((a),11,t1.c) then 13 else 13 end-c FROM t1 WHERE (t1.e)*case when +a*t1.f*t1.e>=+d*a+b-t1.f*~13 | t1.d*11-f-~f+17-coalesce((select max( -f) from t1 where bt1.e then coalesce((select max(coalesce((select b from t1 where (t1.a not in (a | t1.c,t1.d,19) or not exists(select 1 from t1 where t1.b in (select t1.d from t1 union select a from t1)) and (a in (select count(*) from t1 union select max(t1.b) from t1) and t1.c in (t1.b,f,t1.d)))),t1.c)) from t1 where f=d and -b>c),t1.f)-t1.c when c in ((a),11,t1.c) then 13 else 13 end-c FROM t1 WHERE NOT ((t1.e)*case when +a*t1.f*t1.e>=+d*a+b-t1.f*~13 | t1.d*11-f-~f+17-coalesce((select max( -f) from t1 where bt1.e then coalesce((select max(coalesce((select b from t1 where (t1.a not in (a & t1.c,t1.d,19) or not exists(select 1 from t1 where t1.b in (select t1.d from t1 union select a from t1)) and (a in (select count(*) from t1 union select max(t1.b) from t1) and t1.c in (t1.b,f,t1.d)))),t1.c)) from t1 where f=d and -b>c),t1.f)-t1.c when c in ((a),11,t1.c) then 13 else 13 end-c FROM t1 WHERE NOT ((t1.e)*case when +a*t1.f*t1.e>=+d*a+b-t1.f*~13 | t1.d*11-f-~f+17-coalesce((select max( -f) from t1 where bt1.c),11)*e*t1.e from t1 where e<=t1.d),t1.a)*f=11 then e when t1.a in (select e from t1 union select b from t1) then t1.b-t1.a else e end from t1 where a=t1.a), -17) else e end FROM t1 WHERE not exists(select 1 from t1 where t1.e in (select max((abs(~+t1.a-t1.c*a)/abs(17))) from t1 union select min(11*t1.c+t1.f) from t1))} -} {500} -do_test randexpr-2.1658 { - db eval {SELECT case when not exists(select 1 from t1 where not not not d=17) then t1.b when (not coalesce((select coalesce((select max(d) from t1 where c+c>t1.c),11)*e*t1.e from t1 where e<=t1.d),t1.a)*f=11 then e when t1.a in (select e from t1 union select b from t1) then t1.b-t1.a else e end from t1 where a=t1.a), -17) else e end FROM t1 WHERE NOT (not exists(select 1 from t1 where t1.e in (select max((abs(~+t1.a-t1.c*a)/abs(17))) from t1 union select min(11*t1.c+t1.f) from t1)))} -} {} -do_test randexpr-2.1659 { - db eval {SELECT coalesce((select coalesce((select max(case when not a not in ((abs(11)/abs(coalesce((select t1.d from t1 where 17 in (select count(*) from t1 union select count(distinct t1.a) from t1)),b)*t1.e*c)),t1.a,t1.b) or t1.c<=t1.f or (t1.d>= -a) then (select cast(avg(~t1.f-t1.f) AS integer) from t1) else 17 end) from t1 where t1.b<=c and t1.b<=a),11) from t1 where exists(select 1 from t1 where e=(select min(coalesce((select max(19) from t1 where not exists(select 1 from t1 where (select count(distinct +case when coalesce((select max(case when et1.d),t1.d) in (select abs(cast(avg(t1.d) AS integer)-min(t1.c)) from t1 union select -cast(avg(19) AS integer) from t1) then b when t1.e< -t1.c then t1.b else t1.c end-19*e) from t1)<=a)),17))+ -(max(a))- -cast(avg(11) AS integer)+ -count(distinct c) from t1)-11} -} {100} -do_test randexpr-2.1660 { - db eval {SELECT coalesce((select coalesce((select max(case when not a not in ((abs(11)/abs(coalesce((select t1.d from t1 where 17 in (select count(*) from t1 union select count(distinct t1.a) from t1)),b)*t1.e*c)),t1.a,t1.b) or t1.c<=t1.f or (t1.d>= -a) then (select cast(avg(~t1.f-t1.f) AS integer) from t1) else 17 end) from t1 where t1.b<=c and t1.b<=a),11) from t1 where exists(select 1 from t1 where e=(select min(coalesce((select max(19) from t1 where not exists(select 1 from t1 where (select count(distinct +case when coalesce((select max(case when et1.d),t1.d) in (select abs(cast(avg(t1.d) AS integer)-min(t1.c)) from t1 union select -cast(avg(19) AS integer) from t1) then b when t1.e< -t1.c then t1.b else t1.c end-19*e) from t1)<=a)),17))+ -(max(a))- -cast(avg(11) AS integer)+ -count(distinct c) from t1)-11)} -} {} -do_test randexpr-2.1661 { - db eval {SELECT e*(case when +t1.c+t1.e+f<=13 then (select case cast(avg(coalesce((select (t1.f*a)*11 from t1 where c<>t1.a),b)) AS integer)+cast(avg(b) AS integer)+max( -b)-min(e) when max(11) then cast(avg(t1.e) AS integer) else cast(avg(t1.b) AS integer) end from t1) when ~11*t1.d<=t1.b or (t1.e=t1.a) then t1.b else -19 end)+e FROM t1 WHERE a>13*d+t1.e+c} -} {} -do_test randexpr-2.1662 { - db eval {SELECT e*(case when +t1.c+t1.e+f<=13 then (select case cast(avg(coalesce((select (t1.f*a)*11 from t1 where c<>t1.a),b)) AS integer)+cast(avg(b) AS integer)+max( -b)-min(e) when max(11) then cast(avg(t1.e) AS integer) else cast(avg(t1.b) AS integer) end from t1) when ~11*t1.d<=t1.b or (t1.e=t1.a) then t1.b else -19 end)+e FROM t1 WHERE NOT (a>13*d+t1.e+c)} -} {100500} -do_test randexpr-2.1663 { - db eval {SELECT (abs(t1.d-t1.b)/abs(t1.c))+t1.a*coalesce((select max(coalesce((select max(~11+11) from t1 where e-a>=case when 11*t1.d+13+(select cast(avg(t1.d+f) AS integer) from t1)-d+t1.d-b not between a and a then e else coalesce((select e from t1 where d>b and b between 11 and t1.d),t1.b) end), -t1.b)) from t1 where t1.e<=c),17)+ -t1.d FROM t1 WHERE case when (19>b) then case (abs(t1.d+case when not exists(select 1 from t1 where f in (19,d,11) and f not between t1.e and a) then (19) when a<=t1.d then 17 else t1.c end* -c*13)/abs(d))*f when 19 then t1.c else - - -t1.d end when c in (select max(t1.e) from t1 union select ( - -abs(cast(avg(t1.f) AS integer))-case cast(avg(a) AS integer) when (min(t1.f)) then max(13) else max(11) end | -((min(11)))+max((a))) from t1) then c else -b end*t1.d>d} -} {} -do_test randexpr-2.1664 { - db eval {SELECT (abs(t1.d-t1.b)/abs(t1.c))+t1.a*coalesce((select max(coalesce((select max(~11+11) from t1 where e-a>=case when 11*t1.d+13+(select cast(avg(t1.d+f) AS integer) from t1)-d+t1.d-b not between a and a then e else coalesce((select e from t1 where d>b and b between 11 and t1.d),t1.b) end), -t1.b)) from t1 where t1.e<=c),17)+ -t1.d FROM t1 WHERE NOT (case when (19>b) then case (abs(t1.d+case when not exists(select 1 from t1 where f in (19,d,11) and f not between t1.e and a) then (19) when a<=t1.d then 17 else t1.c end* -c*13)/abs(d))*f when 19 then t1.c else - - -t1.d end when c in (select max(t1.e) from t1 union select ( - -abs(cast(avg(t1.f) AS integer))-case cast(avg(a) AS integer) when (min(t1.f)) then max(13) else max(11) end | -((min(11)))+max((a))) from t1) then c else -b end*t1.d>d)} -} {1300} -do_test randexpr-2.1665 { - db eval {SELECT ~t1.a*(case when not not exists(select 1 from t1 where coalesce((select max(t1.c) from t1 where (select count(distinct b | case 13 | case when -11<>a then t1.a else b end when t1.e then t1.b else d end*t1.f) from t1)<>17 or t1.a not between c and t1.a),11) in (t1.e,c,c)) and -11>f then t1.d else f end-17)+ -(t1.b) FROM t1 WHERE (13-coalesce((select -case when 19+c=a then f else 11 end*(e) from t1 where (t1.b in (select t1.a from t1 union select 11 from t1))),(t1.f))*e+f*(t1.f)=a and not 17 in (select max(f) from t1 union select max(19) from t1) or 19<>t1.f) and 13 between f and f and d<>b} -} {} -do_test randexpr-2.1666 { - db eval {SELECT ~t1.a*(case when not not exists(select 1 from t1 where coalesce((select max(t1.c) from t1 where (select count(distinct b | case 13 | case when -11<>a then t1.a else b end when t1.e then t1.b else d end*t1.f) from t1)<>17 or t1.a not between c and t1.a),11) in (t1.e,c,c)) and -11>f then t1.d else f end-17)+ -(t1.b) FROM t1 WHERE NOT ((13-coalesce((select -case when 19+c=a then f else 11 end*(e) from t1 where (t1.b in (select t1.a from t1 union select 11 from t1))),(t1.f))*e+f*(t1.f)=a and not 17 in (select max(f) from t1 union select max(19) from t1) or 19<>t1.f) and 13 between f and f and d<>b)} -} {-59083} -do_test randexpr-2.1667 { - db eval {SELECT ~t1.a*(case when not not exists(select 1 from t1 where coalesce((select max(t1.c) from t1 where (select count(distinct b & case 13 & case when -11<>a then t1.a else b end when t1.e then t1.b else d end*t1.f) from t1)<>17 or t1.a not between c and t1.a),11) in (t1.e,c,c)) and -11>f then t1.d else f end-17)+ -(t1.b) FROM t1 WHERE NOT ((13-coalesce((select -case when 19+c=a then f else 11 end*(e) from t1 where (t1.b in (select t1.a from t1 union select 11 from t1))),(t1.f))*e+f*(t1.f)=a and not 17 in (select max(f) from t1 union select max(19) from t1) or 19<>t1.f) and 13 between f and f and d<>b)} -} {-59083} -do_test randexpr-2.1668 { - db eval {SELECT ~13+case when (t1.e-~b+13*case when b>(select max(case when (19*f in (select ~count(distinct a)+count(distinct (e)) from t1 union select (cast(avg(t1.c) AS integer)) from t1)) then coalesce((select -19 from t1 where t1.f<=c or 19 not in (t1.c, -b,19)),t1.e) when t1.e>c then e else 13 end | f) from t1) then 13 else d end in (select t1.f from t1 union select c from t1)) then t1.f when not exists(select 1 from t1 where a between f and f) then (d) else t1.c end FROM t1 WHERE exists(select 1 from t1 where case when 19 in (19,+(abs(case t1.f when e then case (select +cast(avg(a) AS integer)*min(e) from t1) when case when 19 not between -t1.c and d then 11 else t1.f end then f else t1.c end else e end+17+b)/abs(t1.d))*13,t1.f) then a when t1.d not in (f,d, -c) then t1.c else t1.b end not between d and c and t1.b not between t1.b and f)} -} {} -do_test randexpr-2.1669 { - db eval {SELECT ~13+case when (t1.e-~b+13*case when b>(select max(case when (19*f in (select ~count(distinct a)+count(distinct (e)) from t1 union select (cast(avg(t1.c) AS integer)) from t1)) then coalesce((select -19 from t1 where t1.f<=c or 19 not in (t1.c, -b,19)),t1.e) when t1.e>c then e else 13 end | f) from t1) then 13 else d end in (select t1.f from t1 union select c from t1)) then t1.f when not exists(select 1 from t1 where a between f and f) then (d) else t1.c end FROM t1 WHERE NOT (exists(select 1 from t1 where case when 19 in (19,+(abs(case t1.f when e then case (select +cast(avg(a) AS integer)*min(e) from t1) when case when 19 not between -t1.c and d then 11 else t1.f end then f else t1.c end else e end+17+b)/abs(t1.d))*13,t1.f) then a when t1.d not in (f,d, -c) then t1.c else t1.b end not between d and c and t1.b not between t1.b and f))} -} {386} -do_test randexpr-2.1670 { - db eval {SELECT ~13+case when (t1.e-~b+13*case when b>(select max(case when (19*f in (select ~count(distinct a)+count(distinct (e)) from t1 union select (cast(avg(t1.c) AS integer)) from t1)) then coalesce((select -19 from t1 where t1.f<=c or 19 not in (t1.c, -b,19)),t1.e) when t1.e>c then e else 13 end & f) from t1) then 13 else d end in (select t1.f from t1 union select c from t1)) then t1.f when not exists(select 1 from t1 where a between f and f) then (d) else t1.c end FROM t1 WHERE NOT (exists(select 1 from t1 where case when 19 in (19,+(abs(case t1.f when e then case (select +cast(avg(a) AS integer)*min(e) from t1) when case when 19 not between -t1.c and d then 11 else t1.f end then f else t1.c end else e end+17+b)/abs(t1.d))*13,t1.f) then a when t1.d not in (f,d, -c) then t1.c else t1.b end not between d and c and t1.b not between t1.b and f))} -} {386} -do_test randexpr-2.1671 { - db eval {SELECT -case coalesce((select max((case when a>t1.c | t1.a then (select abs(count(distinct a)) from t1) when (e not in (coalesce((select c from t1 where exists(select 1 from t1 where c<=11) and t1.a>e),e),d,a)) or t1.d<>e then t1.c else c end)- -11*b) from t1 where not exists(select 1 from t1 where not (c in ((t1.e),d,19)))),(t1.c))*b when 17 then t1.b else 19 end FROM t1 WHERE e<=coalesce((select t1.b from t1 where coalesce((select c*19 | (a) from t1 where not exists(select 1 from t1 where 19>=13 or case when coalesce((select max(19) from t1 where t1.e=t1.d or t1.f<>e),t1.f)>19 and t1.f=t1.d then 11+ -t1.d when -t1.f not between f and f then t1.a else d end not in ((t1.a),13,t1.a) and c in (select (13) from t1 union select f from t1) and 17<(f)) and t1.a<>t1.e),t1.d)>=t1.c),t1.f)} -} {} -do_test randexpr-2.1672 { - db eval {SELECT -case coalesce((select max((case when a>t1.c | t1.a then (select abs(count(distinct a)) from t1) when (e not in (coalesce((select c from t1 where exists(select 1 from t1 where c<=11) and t1.a>e),e),d,a)) or t1.d<>e then t1.c else c end)- -11*b) from t1 where not exists(select 1 from t1 where not (c in ((t1.e),d,19)))),(t1.c))*b when 17 then t1.b else 19 end FROM t1 WHERE NOT (e<=coalesce((select t1.b from t1 where coalesce((select c*19 | (a) from t1 where not exists(select 1 from t1 where 19>=13 or case when coalesce((select max(19) from t1 where t1.e=t1.d or t1.f<>e),t1.f)>19 and t1.f=t1.d then 11+ -t1.d when -t1.f not between f and f then t1.a else d end not in ((t1.a),13,t1.a) and c in (select (13) from t1 union select f from t1) and 17<(f)) and t1.a<>t1.e),t1.d)>=t1.c),t1.f))} -} {-19} -do_test randexpr-2.1673 { - db eval {SELECT -case coalesce((select max((case when a>t1.c & t1.a then (select abs(count(distinct a)) from t1) when (e not in (coalesce((select c from t1 where exists(select 1 from t1 where c<=11) and t1.a>e),e),d,a)) or t1.d<>e then t1.c else c end)- -11*b) from t1 where not exists(select 1 from t1 where not (c in ((t1.e),d,19)))),(t1.c))*b when 17 then t1.b else 19 end FROM t1 WHERE NOT (e<=coalesce((select t1.b from t1 where coalesce((select c*19 | (a) from t1 where not exists(select 1 from t1 where 19>=13 or case when coalesce((select max(19) from t1 where t1.e=t1.d or t1.f<>e),t1.f)>19 and t1.f=t1.d then 11+ -t1.d when -t1.f not between f and f then t1.a else d end not in ((t1.a),13,t1.a) and c in (select (13) from t1 union select f from t1) and 17<(f)) and t1.a<>t1.e),t1.d)>=t1.c),t1.f))} -} {-19} -do_test randexpr-2.1674 { - db eval {SELECT coalesce((select (11) from t1 where not e in (select -min(d*13) from t1 union select count(distinct f) from t1)),t1.f*t1.d | t1.f) FROM t1 WHERE -t1.c*d>case d when ~coalesce((select max(e) from t1 where exists(select 1 from t1 where not exists(select 1 from t1 where not e=c))),+coalesce((select +t1.e from t1 where not exists(select 1 from t1 where c>=t1.b)),(abs( -t1.c+case t1.c when ~~t1.c+a-t1.c then coalesce((select max(case when t1.b<=c then 19 else f end) from t1 where 13case d when ~coalesce((select max(e) from t1 where exists(select 1 from t1 where not exists(select 1 from t1 where not e=c))),+coalesce((select +t1.e from t1 where not exists(select 1 from t1 where c>=t1.b)),(abs( -t1.c+case t1.c when ~~t1.c+a-t1.c then coalesce((select max(case when t1.b<=c then 19 else f end) from t1 where 13case d when ~coalesce((select max(e) from t1 where exists(select 1 from t1 where not exists(select 1 from t1 where not e=c))),+coalesce((select +t1.e from t1 where not exists(select 1 from t1 where c>=t1.b)),(abs( -t1.c+case t1.c when ~~t1.c+a-t1.c then coalesce((select max(case when t1.b<=c then 19 else f end) from t1 where 13=(select max(17) from t1) then case 11 when e then coalesce((select 17 from t1 where not exists(select 1 from t1 where t1.d in (select t1.a from t1 union select e from t1) and e=case when 11<19 and t1.e<19 then t1.e when t1.c in (t1.b,t1.e,t1.d) then 13 else 13 end and e<=d or b between 19 and t1.a or t1.a<=(13))),t1.a) else t1.e-t1.d end*t1.a when -11 not in (17,t1.d,a) then t1.c else b end*19 FROM t1 WHERE not t1.b>t1.e or t1.d not in (~t1.f,d+case when (b+(abs(19*~t1.c | t1.b*d*(b)-t1.e-t1.e+a)/abs(t1.c)) not in (17,b,t1.e)) then 13+f else b end-t1.f,t1.e) or t1.e not in (f,a,t1.d)} -} {190000} -do_test randexpr-2.1678 { - db eval {SELECT +case when t1.e>=(select max(17) from t1) then case 11 when e then coalesce((select 17 from t1 where not exists(select 1 from t1 where t1.d in (select t1.a from t1 union select e from t1) and e=case when 11<19 and t1.e<19 then t1.e when t1.c in (t1.b,t1.e,t1.d) then 13 else 13 end and e<=d or b between 19 and t1.a or t1.a<=(13))),t1.a) else t1.e-t1.d end*t1.a when -11 not in (17,t1.d,a) then t1.c else b end*19 FROM t1 WHERE NOT (not t1.b>t1.e or t1.d not in (~t1.f,d+case when (b+(abs(19*~t1.c | t1.b*d*(b)-t1.e-t1.e+a)/abs(t1.c)) not in (17,b,t1.e)) then 13+f else b end-t1.f,t1.e) or t1.e not in (f,a,t1.d))} -} {} -do_test randexpr-2.1679 { - db eval {SELECT t1.e | t1.b+a*coalesce((select t1.a from t1 where ~(d)-f<>e-c or 17+f in (select -(~case max(t1.c) when abs(count(*)) then abs( - -cast(avg(b) AS integer)*count(*)) else cast(avg(t1.c) AS integer) end) from t1 union select count(distinct (11)) from t1) and exists(select 1 from t1 where not 13>t1.e) or t1.ce-c or 17+f in (select -(~case max(t1.c) when abs(count(*)) then abs( - -cast(avg(b) AS integer)*count(*)) else cast(avg(t1.c) AS integer) end) from t1 union select count(distinct (11)) from t1) and exists(select 1 from t1 where not 13>t1.e) or t1.ce-c or 17+f in (select -(~case max(t1.c) when abs(count(*)) then abs( - -cast(avg(b) AS integer)*count(*)) else cast(avg(t1.c) AS integer) end) from t1 union select count(distinct (11)) from t1) and exists(select 1 from t1 where not 13>t1.e) or t1.ct1.b then 19 when case when case (select ( -max(c)) from t1) when 11 then d else e end*t1.d<>d then a else 11 end=t1.b or 17=d then b else t1.e end+11+t1.a*a-e FROM t1 WHERE coalesce((select coalesce((select max(c) from t1 where -+ -e-t1.d*case when coalesce((select d from t1 where (c=a)),f) between t1.b and t1.b or (13)<>c and e in (t1.e,e,(t1.a)) then b*t1.c else b end+t1.c in (select t1.f from t1 union select t1.b from t1)),19) from t1 where t1.f in (select count(*) from t1 union select cast(avg(t1.e) AS integer)*min((a))*+(max(t1.b))+max(17) from t1)),t1.d)< -e} -} {} -do_test randexpr-2.1683 { - db eval {SELECT ~(select +~count(distinct 17)*count(distinct t1.e) from t1)-t1.e+a*11-case when 13<>t1.b then 19 when case when case (select ( -max(c)) from t1) when 11 then d else e end*t1.d<>d then a else 11 end=t1.b or 17=d then b else t1.e end+11+t1.a*a-e FROM t1 WHERE NOT (coalesce((select coalesce((select max(c) from t1 where -+ -e-t1.d*case when coalesce((select d from t1 where (c=a)),f) between t1.b and t1.b or (13)<>c and e in (t1.e,e,(t1.a)) then b*t1.c else b end+t1.c in (select t1.f from t1 union select t1.b from t1)),19) from t1 where t1.f in (select count(*) from t1 union select cast(avg(t1.e) AS integer)*min((a))*+(max(t1.b))+max(17) from t1)),t1.d)< -e)} -} {10093} -do_test randexpr-2.1684 { - db eval {SELECT coalesce((select max(case when f<=(17-coalesce((select ~t1.e+11 from t1 where t1.f in (select c from t1 union select b from t1)),f)) then -case when e>case when 17+ -t1.b in (select cast(avg(f) AS integer) from t1 union select min(c-17+a) from t1) then -17 else t1.d end then a when 19<11 then t1.a else t1.b end | t1.f else a end) from t1 where e between a and d),19) FROM t1 WHERE case 19 when ((select max(f) from t1)) then 13 else t1.d end-t1.c>a-b-t1.d} -} {19} -do_test randexpr-2.1685 { - db eval {SELECT coalesce((select max(case when f<=(17-coalesce((select ~t1.e+11 from t1 where t1.f in (select c from t1 union select b from t1)),f)) then -case when e>case when 17+ -t1.b in (select cast(avg(f) AS integer) from t1 union select min(c-17+a) from t1) then -17 else t1.d end then a when 19<11 then t1.a else t1.b end | t1.f else a end) from t1 where e between a and d),19) FROM t1 WHERE NOT (case 19 when ((select max(f) from t1)) then 13 else t1.d end-t1.c>a-b-t1.d)} -} {} -do_test randexpr-2.1686 { - db eval {SELECT coalesce((select max(case when f<=(17-coalesce((select ~t1.e+11 from t1 where t1.f in (select c from t1 union select b from t1)),f)) then -case when e>case when 17+ -t1.b in (select cast(avg(f) AS integer) from t1 union select min(c-17+a) from t1) then -17 else t1.d end then a when 19<11 then t1.a else t1.b end & t1.f else a end) from t1 where e between a and d),19) FROM t1 WHERE case 19 when ((select max(f) from t1)) then 13 else t1.d end-t1.c>a-b-t1.d} -} {19} -do_test randexpr-2.1687 { - db eval {SELECT case when (select case min(t1.b) when max(13) | +max(t1.e)*max(f) then abs( -+count(*)) else max(t1.f) end from t1)*t1.a+(abs(case 19 when 19 then d else ((13)) end)/abs(13))+(19) between f and 13 or (not not 17~17),t1.e+(select count(*) from t1) | 11-coalesce((select 13 from t1 where 11 not in ( -t1.f,t1.e,t1.f)),t1.b))+ -(t1.c)) from t1) from t1 where t1.a=(13)), -a)*e FROM t1 WHERE not exists(select 1 from t1 where (select count(distinct t1.e) from t1)<=coalesce((select case when not exists(select 1 from t1 where e=t1.b*coalesce((select max(+b) from t1 where exists(select 1 from t1 where not (not not exists(select 1 from t1 where t1.c in (select 11 from t1 union select 19+13 from t1)))) and not t1.b~17),t1.e+(select count(*) from t1) | 11-coalesce((select 13 from t1 where 11 not in ( -t1.f,t1.e,t1.f)),t1.b))+ -(t1.c)) from t1) from t1 where t1.a=(13)), -a)*e FROM t1 WHERE NOT (not exists(select 1 from t1 where (select count(distinct t1.e) from t1)<=coalesce((select case when not exists(select 1 from t1 where e=t1.b*coalesce((select max(+b) from t1 where exists(select 1 from t1 where not (not not exists(select 1 from t1 where t1.c in (select 11 from t1 union select 19+13 from t1)))) and not t1.b~17),t1.e+(select count(*) from t1) & 11-coalesce((select 13 from t1 where 11 not in ( -t1.f,t1.e,t1.f)),t1.b))+ -(t1.c)) from t1) from t1 where t1.a=(13)), -a)*e FROM t1 WHERE not exists(select 1 from t1 where (select count(distinct t1.e) from t1)<=coalesce((select case when not exists(select 1 from t1 where e=t1.b*coalesce((select max(+b) from t1 where exists(select 1 from t1 where not (not not exists(select 1 from t1 where t1.c in (select 11 from t1 union select 19+13 from t1)))) and not t1.be) then t1.e*c else c end-13+t1.a),f)+t1.d- -t1.a)*t1.c<>f) and t1.b not between (e) and t1.c),f)+11*t1.f FROM t1 WHERE (17 in (select 13 from t1 union select case coalesce((select max( -case when not b in ((select -+case max((b)) when cast(avg(13) AS integer) then count(*) else max(a) end+min(b)-max(d) from t1),coalesce((select t1.d from t1 where case when -13 in ( -t1.e,f,t1.e) then t1.c else e end | 11<=(t1.b)),t1.c)-11,t1.e) then t1.f else 13 end) from t1 where b>=t1.e),f) when e then t1.c else c end from t1))} -} {} -do_test randexpr-2.1694 { - db eval {SELECT ~~t1.b | 11+d*coalesce((select max(t1.f-a) from t1 where not exists(select 1 from t1 where (a-coalesce((select b from t1 where t1.fe) then t1.e*c else c end-13+t1.a),f)+t1.d- -t1.a)*t1.c<>f) and t1.b not between (e) and t1.c),f)+11*t1.f FROM t1 WHERE NOT ((17 in (select 13 from t1 union select case coalesce((select max( -case when not b in ((select -+case max((b)) when cast(avg(13) AS integer) then count(*) else max(a) end+min(b)-max(d) from t1),coalesce((select t1.d from t1 where case when -13 in ( -t1.e,f,t1.e) then t1.c else e end | 11<=(t1.b)),t1.c)-11,t1.e) then t1.f else 13 end) from t1 where b>=t1.e),f) when e then t1.c else c end from t1)))} -} {246747} -do_test randexpr-2.1695 { - db eval {SELECT ~~t1.b & 11+d*coalesce((select max(t1.f-a) from t1 where not exists(select 1 from t1 where (a-coalesce((select b from t1 where t1.fe) then t1.e*c else c end-13+t1.a),f)+t1.d- -t1.a)*t1.c<>f) and t1.b not between (e) and t1.c),f)+11*t1.f FROM t1 WHERE NOT ((17 in (select 13 from t1 union select case coalesce((select max( -case when not b in ((select -+case max((b)) when cast(avg(13) AS integer) then count(*) else max(a) end+min(b)-max(d) from t1),coalesce((select t1.d from t1 where case when -13 in ( -t1.e,f,t1.e) then t1.c else e end | 11<=(t1.b)),t1.c)-11,t1.e) then t1.f else 13 end) from t1 where b>=t1.e),f) when e then t1.c else c end from t1)))} -} {64} -do_test randexpr-2.1696 { - db eval {SELECT case case when not ++b+~e-11-d-f*e*case when (t1.f) not between t1.c and t1.e or (13>e) then (abs(17)/abs(d)) when 11 not between 17 and (t1.b) then c else 13 end-(f)-f between t1.c and t1.f then t1.c when a between t1.d and 13 then t1.e else t1.a end when a then f else 13 end FROM t1 WHERE t1.a in (select case when (+e*t1.f not in ( -(select (case max(+t1.e-case when not exists(select 1 from t1 where 19 in (select 13 from t1 union select ((t1.d)) from t1)) then 13-t1.b else 19 end) when count(*)-(cast(avg(t1.b) AS integer)-cast(avg(b) AS integer)) then count(distinct t1.b) else count(distinct t1.c) end | cast(avg((19)) AS integer)) from t1),~17-f,c)) then (select count(*) from t1) when t1.a>t1.a then b else t1.d end+(f) from t1 union select b from t1)} -} {} -do_test randexpr-2.1697 { - db eval {SELECT case case when not ++b+~e-11-d-f*e*case when (t1.f) not between t1.c and t1.e or (13>e) then (abs(17)/abs(d)) when 11 not between 17 and (t1.b) then c else 13 end-(f)-f between t1.c and t1.f then t1.c when a between t1.d and 13 then t1.e else t1.a end when a then f else 13 end FROM t1 WHERE NOT (t1.a in (select case when (+e*t1.f not in ( -(select (case max(+t1.e-case when not exists(select 1 from t1 where 19 in (select 13 from t1 union select ((t1.d)) from t1)) then 13-t1.b else 19 end) when count(*)-(cast(avg(t1.b) AS integer)-cast(avg(b) AS integer)) then count(distinct t1.b) else count(distinct t1.c) end | cast(avg((19)) AS integer)) from t1),~17-f,c)) then (select count(*) from t1) when t1.a>t1.a then b else t1.d end+(f) from t1 union select b from t1))} -} {13} -do_test randexpr-2.1698 { - db eval {SELECT 13-case when a<=case when e not between t1.b*(abs(t1.c)/abs(e | 19-(select -~count(distinct t1.b)+min(t1.a-t1.c-f+t1.d+t1.d+t1.d) from t1)))-t1.e and coalesce((select 11 from t1 where ct1.c)} -} {596} -do_test randexpr-2.1699 { - db eval {SELECT 13-case when a<=case when e not between t1.b*(abs(t1.c)/abs(e | 19-(select -~count(distinct t1.b)+min(t1.a-t1.c-f+t1.d+t1.d+t1.d) from t1)))-t1.e and coalesce((select 11 from t1 where ct1.c))} -} {} -do_test randexpr-2.1700 { - db eval {SELECT 13-case when a<=case when e not between t1.b*(abs(t1.c)/abs(e & 19-(select -~count(distinct t1.b)+min(t1.a-t1.c-f+t1.d+t1.d+t1.d) from t1)))-t1.e and coalesce((select 11 from t1 where ct1.c)} -} {596} -do_test randexpr-2.1701 { - db eval {SELECT (case when coalesce((select max(~case coalesce((select max(b) from t1 where case (select count(distinct 17) from t1)-e when b then d else t1.b end<13),f) when c then (( -c)) else 13 end) from t1 where t1.e between a and b),t1.b) in (select -min(t1.f) from t1 union select case cast(avg(t1.d) AS integer) when count(distinct b) then case +~ -cast(avg(b) AS integer) when max(t1.f) then count(*) else (max(e)) end else count(*) end from t1) then c when 13<=t1.f then ( -17) else t1.b end) FROM t1 WHERE (select min(19*coalesce((select max(t1.e) from t1 where ~coalesce((select t1.a-coalesce((select max((abs(a)/abs(d))) from t1 where -13 not in ((d)*t1.a+t1.e,13,t1.c) or 17 not in (a,b,t1.d)), -t1.a) from t1 where c<>t1.e),a) | 11+17 between b and 17),c))*~ -max(e) from t1)<>11} -} {-17} -do_test randexpr-2.1702 { - db eval {SELECT (case when coalesce((select max(~case coalesce((select max(b) from t1 where case (select count(distinct 17) from t1)-e when b then d else t1.b end<13),f) when c then (( -c)) else 13 end) from t1 where t1.e between a and b),t1.b) in (select -min(t1.f) from t1 union select case cast(avg(t1.d) AS integer) when count(distinct b) then case +~ -cast(avg(b) AS integer) when max(t1.f) then count(*) else (max(e)) end else count(*) end from t1) then c when 13<=t1.f then ( -17) else t1.b end) FROM t1 WHERE NOT ((select min(19*coalesce((select max(t1.e) from t1 where ~coalesce((select t1.a-coalesce((select max((abs(a)/abs(d))) from t1 where -13 not in ((d)*t1.a+t1.e,13,t1.c) or 17 not in (a,b,t1.d)), -t1.a) from t1 where c<>t1.e),a) | 11+17 between b and 17),c))*~ -max(e) from t1)<>11)} -} {} -do_test randexpr-2.1703 { - db eval {SELECT t1.f* -t1.e-c | b++19*(select (case max(t1.c) when +abs(count(distinct case when e=13 then coalesce((select max(t1.c) from t1 where not -c+b-t1.f<>d),a) else b end FROM t1 WHERE d in (select 11 from t1 union select -d*~t1.b from t1)} -} {} -do_test randexpr-2.1704 { - db eval {SELECT t1.f* -t1.e-c | b++19*(select (case max(t1.c) when +abs(count(distinct case when e=13 then coalesce((select max(t1.c) from t1 where not -c+b-t1.f<>d),a) else b end FROM t1 WHERE NOT (d in (select 11 from t1 union select -d*~t1.b from t1))} -} {-295178} -do_test randexpr-2.1705 { - db eval {SELECT t1.f* -t1.e-c & b++19*(select (case max(t1.c) when +abs(count(distinct case when e=13 then coalesce((select max(t1.c) from t1 where not -c+b-t1.f<>d),a) else b end FROM t1 WHERE NOT (d in (select 11 from t1 union select -d*~t1.b from t1))} -} {52} -do_test randexpr-2.1706 { - db eval {SELECT 11-t1.e+d+case case when (b between -+case when f not between case coalesce((select t1.a from t1 where e not between (t1.d) and t1.a or 17<11),t1.d) when 17 then t1.f else t1.e end and d then 17 when e>=t1.f then t1.b else t1.b end and t1.e) then case f when t1.d then t1.c else -e end when (not exists(select 1 from t1 where -(11)>a) or t1.ct1.e} -} {} -do_test randexpr-2.1707 { - db eval {SELECT 11-t1.e+d+case case when (b between -+case when f not between case coalesce((select t1.a from t1 where e not between (t1.d) and t1.a or 17<11),t1.d) when 17 then t1.f else t1.e end and d then 17 when e>=t1.f then t1.b else t1.b end and t1.e) then case f when t1.d then t1.c else -e end when (not exists(select 1 from t1 where -(11)>a) or t1.ct1.e)} -} {411} -do_test randexpr-2.1708 { - db eval {SELECT coalesce((select max(case when f>11 then 13 when 19*e+(select -count(distinct t1.c)-max(c) | count(distinct 13) from t1) between coalesce((select max(case when t1.ae),17) FROM t1 WHERE case case 13+coalesce((select max( -t1.b*t1.c) from t1 where t1.c*c<>(select -(count(distinct e)) from t1)-t1.c | t1.d*t1.e+11*t1.a+11-t1.a*b),d)+t1.d+e when t1.f then e else -11 end-d when t1.e then 11 else f end+f=19} -} {} -do_test randexpr-2.1709 { - db eval {SELECT coalesce((select max(case when f>11 then 13 when 19*e+(select -count(distinct t1.c)-max(c) | count(distinct 13) from t1) between coalesce((select max(case when t1.ae),17) FROM t1 WHERE NOT (case case 13+coalesce((select max( -t1.b*t1.c) from t1 where t1.c*c<>(select -(count(distinct e)) from t1)-t1.c | t1.d*t1.e+11*t1.a+11-t1.a*b),d)+t1.d+e when t1.f then e else -11 end-d when t1.e then 11 else f end+f=19)} -} {17} -do_test randexpr-2.1710 { - db eval {SELECT coalesce((select max(case when f>11 then 13 when 19*e+(select -count(distinct t1.c)-max(c) & count(distinct 13) from t1) between coalesce((select max(case when t1.ae),17) FROM t1 WHERE NOT (case case 13+coalesce((select max( -t1.b*t1.c) from t1 where t1.c*c<>(select -(count(distinct e)) from t1)-t1.c | t1.d*t1.e+11*t1.a+11-t1.a*b),d)+t1.d+e when t1.f then e else -11 end-d when t1.e then 11 else f end+f=19)} -} {17} -do_test randexpr-2.1711 { - db eval {SELECT 13+coalesce((select -(abs(b)/abs(coalesce((select (abs(e+t1.a)/abs(13)) from t1 where a17 and t1.d<>t1.f),17)+a- -t1.d then t1.d else -t1.b end,b)} -} {413} -do_test randexpr-2.1712 { - db eval {SELECT 13+coalesce((select -(abs(b)/abs(coalesce((select (abs(e+t1.a)/abs(13)) from t1 where a17 and t1.d<>t1.f),17)+a- -t1.d then t1.d else -t1.b end,b))} -} {} -do_test randexpr-2.1713 { - db eval {SELECT (~(abs(case when t1.f*17 not in (coalesce((select 13 from t1 where d in (select count(distinct t1.e- -t1.e+t1.e*11) from t1 union select (abs(~~(cast(avg(d) AS integer))* -(min(13))+max(d) | min(13))) from t1)),d),a,t1.e) then c else t1.c end-c)/abs((t1.d)))*t1.c)*t1.d+t1.b-b FROM t1 WHERE (abs(case when (t1.e+case when t1.f+t1.d*t1.c<=t1.f or t1.c>=a and a not between 19 and t1.e then e else b end-t1.c) | t1.b<>19 then t1.f when 19<=t1.d and not -t1.c>=11 and t1.a between t1.f and (19) then b else t1.c end)/abs(b))+11>=t1.f and t1.f not between f and t1.a} -} {} -do_test randexpr-2.1714 { - db eval {SELECT (~(abs(case when t1.f*17 not in (coalesce((select 13 from t1 where d in (select count(distinct t1.e- -t1.e+t1.e*11) from t1 union select (abs(~~(cast(avg(d) AS integer))* -(min(13))+max(d) | min(13))) from t1)),d),a,t1.e) then c else t1.c end-c)/abs((t1.d)))*t1.c)*t1.d+t1.b-b FROM t1 WHERE NOT ((abs(case when (t1.e+case when t1.f+t1.d*t1.c<=t1.f or t1.c>=a and a not between 19 and t1.e then e else b end-t1.c) | t1.b<>19 then t1.f when 19<=t1.d and not -t1.c>=11 and t1.a between t1.f and (19) then b else t1.c end)/abs(b))+11>=t1.f and t1.f not between f and t1.a)} -} {-120000} -do_test randexpr-2.1715 { - db eval {SELECT (~(abs(case when t1.f*17 not in (coalesce((select 13 from t1 where d in (select count(distinct t1.e- -t1.e+t1.e*11) from t1 union select (abs(~~(cast(avg(d) AS integer))* -(min(13))+max(d) & min(13))) from t1)),d),a,t1.e) then c else t1.c end-c)/abs((t1.d)))*t1.c)*t1.d+t1.b-b FROM t1 WHERE NOT ((abs(case when (t1.e+case when t1.f+t1.d*t1.c<=t1.f or t1.c>=a and a not between 19 and t1.e then e else b end-t1.c) | t1.b<>19 then t1.f when 19<=t1.d and not -t1.c>=11 and t1.a between t1.f and (19) then b else t1.c end)/abs(b))+11>=t1.f and t1.f not between f and t1.a)} -} {-120000} -do_test randexpr-2.1716 { - db eval {SELECT (abs(a)/abs(case when (not t1.f in (select count(*) from t1 union select - -min(c) | min(13*t1.d) from t1)) and ( -t1.a*t1.d)>=d or (t1.a in (a,11,f)) or (c>=t1.a) then 17+case when not exists(select 1 from t1 where e=d or (t1.a in (a,11,f)) or (c>=t1.a) then 17+case when not exists(select 1 from t1 where e=d or (t1.a in (a,11,f)) or (c>=t1.a) then 17+case when not exists(select 1 from t1 where ec)) and 13 between t1.c and 17 or a=13),coalesce((select a from t1 where (t1.d) in (c,11,t1.c)),t1.d)) | c | coalesce((select max(d) from t1 where t1.b>b),t1.a)=19 then e else 13 end between t1.a and t1.f and 17>=c then a when d in (e,13,c) or t1.b<> -19 then (17) else 17 end FROM t1 WHERE -b in (t1.b,t1.f,case when a in (select case +(min(t1.c)*+~cast(avg(+t1.f) AS integer)*cast(avg(d) AS integer) | abs(count(*))+count(*)*count(distinct 17)) when count(distinct e) then -cast(avg(t1.a) AS integer) else min(11) end from t1 union select ((min(13))) from t1) then (abs(t1.d)/abs(case when -19c)) and 13 between t1.c and 17 or a=13),coalesce((select a from t1 where (t1.d) in (c,11,t1.c)),t1.d)) | c | coalesce((select max(d) from t1 where t1.b>b),t1.a)=19 then e else 13 end between t1.a and t1.f and 17>=c then a when d in (e,13,c) or t1.b<> -19 then (17) else 17 end FROM t1 WHERE NOT ( -b in (t1.b,t1.f,case when a in (select case +(min(t1.c)*+~cast(avg(+t1.f) AS integer)*cast(avg(d) AS integer) | abs(count(*))+count(*)*count(distinct 17)) when count(distinct e) then -cast(avg(t1.a) AS integer) else min(11) end from t1 union select ((min(13))) from t1) then (abs(t1.d)/abs(case when -19c)) and 13 between t1.c and 17 or a=13),coalesce((select a from t1 where (t1.d) in (c,11,t1.c)),t1.d)) & c & coalesce((select max(d) from t1 where t1.b>b),t1.a)=19 then e else 13 end between t1.a and t1.f and 17>=c then a when d in (e,13,c) or t1.b<> -19 then (17) else 17 end FROM t1 WHERE NOT ( -b in (t1.b,t1.f,case when a in (select case +(min(t1.c)*+~cast(avg(+t1.f) AS integer)*cast(avg(d) AS integer) | abs(count(*))+count(*)*count(distinct 17)) when count(distinct e) then -cast(avg(t1.a) AS integer) else min(11) end from t1 union select ((min(13))) from t1) then (abs(t1.d)/abs(case when -19e)} -} {} -do_test randexpr-2.1723 { - db eval {SELECT coalesce((select t1.b from t1 where not exists(select 1 from t1 where 13 in (select count(*) | ~min((select max((abs(d)/abs(t1.e+t1.e))) from t1)* -case when f*case e*~a when case e when (d) then 19 else (b) end then d else 17 end*t1.b between 11 and 13 then e when d in (a,(19),e) then c else 13 end-e*17) from t1 union select (count(*)) from t1))),f) FROM t1 WHERE NOT (not exists(select 1 from t1 where t1.a<>e))} -} {200} -do_test randexpr-2.1724 { - db eval {SELECT coalesce((select t1.b from t1 where not exists(select 1 from t1 where 13 in (select count(*) & ~min((select max((abs(d)/abs(t1.e+t1.e))) from t1)* -case when f*case e*~a when case e when (d) then 19 else (b) end then d else 17 end*t1.b between 11 and 13 then e when d in (a,(19),e) then c else 13 end-e*17) from t1 union select (count(*)) from t1))),f) FROM t1 WHERE NOT (not exists(select 1 from t1 where t1.a<>e))} -} {200} -do_test randexpr-2.1725 { - db eval {SELECT - -case b when +~coalesce((select max(coalesce((select c from t1 where coalesce((select max(t1.a+f) from t1 where (t1.a not between t1.a and t1.e)),t1.a)-b not between e and -t1.d),d)+19) from t1 where (f in (select ( -count(*) | count(*)+cast(avg(11) AS integer)) from t1 union select count(distinct 13) from t1) or -b<>19 or 17>=t1.a)),t1.e)-c-t1.d then t1.a else 19 end- - -11 FROM t1 WHERE d+a*~coalesce((select max((select count(distinct t1.e)-max(t1.d) from t1)) from t1 where not exists(select 1 from t1 where t1.e in (11-f*19,a,c-b)) and 11=t1.b),t1.a)=(t1.b) and -t1.b19 or 17>=t1.a)),t1.e)-c-t1.d then t1.a else 19 end- - -11 FROM t1 WHERE NOT (d+a*~coalesce((select max((select count(distinct t1.e)-max(t1.d) from t1)) from t1 where not exists(select 1 from t1 where t1.e in (11-f*19,a,c-b)) and 11=t1.b),t1.a)=(t1.b) and -t1.b19 or 17>=t1.a)),t1.e)-c-t1.d then t1.a else 19 end- - -11 FROM t1 WHERE NOT (d+a*~coalesce((select max((select count(distinct t1.e)-max(t1.d) from t1)) from t1 where not exists(select 1 from t1 where t1.e in (11-f*19,a,c-b)) and 11=t1.b),t1.a)=(t1.b) and -t1.bcoalesce((select max(coalesce((select max(t1.d) from t1 where not exists(select 1 from t1 where e | t1.f-19 between t1.e-a and b and e>=t1.d)),+d)) from t1 where (exists(select 1 from t1 where t1.b in (select 19 from t1 union select 17 from t1) or 11 between t1.b and d))),c)),t1.e)*t1.a<=c then b else t1.d end)) FROM t1 WHERE (select abs( -abs(abs(case count(*) when ~ -min(f)+case - -abs(+cast(avg(c*17) AS integer)) when count(*) then max(t1.a) else max(11) end+(cast(avg(e) AS integer)) then min(17) else count(*) end-cast(avg(a) AS integer)-count(*))))+ -cast(avg(t1.a) AS integer) | ((count(*))) from t1)+f in (select max((abs(+11*t1.a)/abs(t1.f))) from t1 union select max(d)-(( -count(distinct 11))) from t1)} -} {} -do_test randexpr-2.1729 { - db eval {SELECT -(abs(t1.a)/abs(case when coalesce((select max( -c) from t1 where t1.a*e>coalesce((select max(coalesce((select max(t1.d) from t1 where not exists(select 1 from t1 where e | t1.f-19 between t1.e-a and b and e>=t1.d)),+d)) from t1 where (exists(select 1 from t1 where t1.b in (select 19 from t1 union select 17 from t1) or 11 between t1.b and d))),c)),t1.e)*t1.a<=c then b else t1.d end)) FROM t1 WHERE NOT ((select abs( -abs(abs(case count(*) when ~ -min(f)+case - -abs(+cast(avg(c*17) AS integer)) when count(*) then max(t1.a) else max(11) end+(cast(avg(e) AS integer)) then min(17) else count(*) end-cast(avg(a) AS integer)-count(*))))+ -cast(avg(t1.a) AS integer) | ((count(*))) from t1)+f in (select max((abs(+11*t1.a)/abs(t1.f))) from t1 union select max(d)-(( -count(distinct 11))) from t1))} -} {0} -do_test randexpr-2.1730 { - db eval {SELECT -(abs(t1.a)/abs(case when coalesce((select max( -c) from t1 where t1.a*e>coalesce((select max(coalesce((select max(t1.d) from t1 where not exists(select 1 from t1 where e & t1.f-19 between t1.e-a and b and e>=t1.d)),+d)) from t1 where (exists(select 1 from t1 where t1.b in (select 19 from t1 union select 17 from t1) or 11 between t1.b and d))),c)),t1.e)*t1.a<=c then b else t1.d end)) FROM t1 WHERE NOT ((select abs( -abs(abs(case count(*) when ~ -min(f)+case - -abs(+cast(avg(c*17) AS integer)) when count(*) then max(t1.a) else max(11) end+(cast(avg(e) AS integer)) then min(17) else count(*) end-cast(avg(a) AS integer)-count(*))))+ -cast(avg(t1.a) AS integer) | ((count(*))) from t1)+f in (select max((abs(+11*t1.a)/abs(t1.f))) from t1 union select max(d)-(( -count(distinct 11))) from t1))} -} {0} -do_test randexpr-2.1731 { - db eval {SELECT case when ((select (+~~max(13)*count(distinct t1.c)) from t1)<>(select (+ -count(*)) from t1)) then +(17) else 19 end+~(abs(13)/abs(d))-t1.d FROM t1 WHERE coalesce((select (select -+ -count(distinct a)*count(*)+max(t1.b) from t1) from t1 where exists(select 1 from t1 where t1.b=c)),t1.c)+f<>t1.f} -} {-384} -do_test randexpr-2.1732 { - db eval {SELECT case when ((select (+~~max(13)*count(distinct t1.c)) from t1)<>(select (+ -count(*)) from t1)) then +(17) else 19 end+~(abs(13)/abs(d))-t1.d FROM t1 WHERE NOT (coalesce((select (select -+ -count(distinct a)*count(*)+max(t1.b) from t1) from t1 where exists(select 1 from t1 where t1.b=c)),t1.c)+f<>t1.f)} -} {} -do_test randexpr-2.1733 { - db eval {SELECT case t1.f when case when 17<=c and coalesce((select case when e in (case when (t1.a=c) then b else -13 end,t1.d,t1.a) then 13 else t1.b end from t1 where (b)=13),t1.d) in ((t1.e),b,t1.b) and d not between 19 and 11 then +(select ~ -~max(e)+count(*)+cast(avg((t1.c)) AS integer) from t1) when t1.f<>e and t1.ee and t1.et1.e then t1.d else (d) end in (select count(*) from t1 union select -abs(~abs(count(distinct d)) | min(t1.e))*count(*) from t1)),t1.f)) from t1 where a>13),d) not between t1.d and c)} -} {60000} -do_test randexpr-2.1738 { - db eval {SELECT +case + -(+t1.a)-~13+t1.b*t1.b+ -c+(select abs(case ~max(t1.c)++min( -13)+ -count(*)+(count(*)) | ((cast(avg(t1.e) AS integer))) when min(t1.c) then min(t1.d) else min(b) end)+min(13) | count(distinct f) | min(t1.a) from t1) when t1.e then 11-17 else t1.b*c end FROM t1 WHERE NOT ((~coalesce((select max(coalesce((select max(19) from t1 where case when case f-(coalesce((select ~11 from t1 where -19= -t1.f or b=t1.b),13)) when 19 then t1.d else t1.b end<=17 then 17 when t1.b>t1.e then t1.d else (d) end in (select count(*) from t1 union select -abs(~abs(count(distinct d)) | min(t1.e))*count(*) from t1)),t1.f)) from t1 where a>13),d) not between t1.d and c))} -} {} -do_test randexpr-2.1739 { - db eval {SELECT +case + -(+t1.a)-~13+t1.b*t1.b+ -c+(select abs(case ~max(t1.c)++min( -13)+ -count(*)+(count(*)) & ((cast(avg(t1.e) AS integer))) when min(t1.c) then min(t1.d) else min(b) end)+min(13) & count(distinct f) & min(t1.a) from t1) when t1.e then 11-17 else t1.b*c end FROM t1 WHERE (~coalesce((select max(coalesce((select max(19) from t1 where case when case f-(coalesce((select ~11 from t1 where -19= -t1.f or b=t1.b),13)) when 19 then t1.d else t1.b end<=17 then 17 when t1.b>t1.e then t1.d else (d) end in (select count(*) from t1 union select -abs(~abs(count(distinct d)) | min(t1.e))*count(*) from t1)),t1.f)) from t1 where a>13),d) not between t1.d and c)} -} {60000} -do_test randexpr-2.1740 { - db eval {SELECT (abs(e)/abs((+b)*coalesce((select c+c+t1.a+t1.e+t1.a+t1.a | 17+e*(t1.c) from t1 where a in (select count(distinct t1.c)-+count(*) from t1 union select - -( -max(t1.f))-count(distinct t1.b)+min(t1.b)*count(*)+count(distinct a) from t1)),t1.a)+e))*19 FROM t1 WHERE coalesce((select 11 from t1 where case t1.e-(t1.a) when (f) then ((19)) else t1.f end+ -t1.b+a+coalesce((select coalesce((select d from t1 where exists(select 1 from t1 where 13+(t1.a)<>19 or 17 not in (c,e,t1.c) or f not in (t1.e,t1.a, -f))),~ -13+e) from t1 where b between (11) and t1.f),t1.a)<=t1.d), -c)<=11} -} {0} -do_test randexpr-2.1741 { - db eval {SELECT (abs(e)/abs((+b)*coalesce((select c+c+t1.a+t1.e+t1.a+t1.a | 17+e*(t1.c) from t1 where a in (select count(distinct t1.c)-+count(*) from t1 union select - -( -max(t1.f))-count(distinct t1.b)+min(t1.b)*count(*)+count(distinct a) from t1)),t1.a)+e))*19 FROM t1 WHERE NOT (coalesce((select 11 from t1 where case t1.e-(t1.a) when (f) then ((19)) else t1.f end+ -t1.b+a+coalesce((select coalesce((select d from t1 where exists(select 1 from t1 where 13+(t1.a)<>19 or 17 not in (c,e,t1.c) or f not in (t1.e,t1.a, -f))),~ -13+e) from t1 where b between (11) and t1.f),t1.a)<=t1.d), -c)<=11)} -} {} -do_test randexpr-2.1742 { - db eval {SELECT (abs(e)/abs((+b)*coalesce((select c+c+t1.a+t1.e+t1.a+t1.a & 17+e*(t1.c) from t1 where a in (select count(distinct t1.c)-+count(*) from t1 union select - -( -max(t1.f))-count(distinct t1.b)+min(t1.b)*count(*)+count(distinct a) from t1)),t1.a)+e))*19 FROM t1 WHERE coalesce((select 11 from t1 where case t1.e-(t1.a) when (f) then ((19)) else t1.f end+ -t1.b+a+coalesce((select coalesce((select d from t1 where exists(select 1 from t1 where 13+(t1.a)<>19 or 17 not in (c,e,t1.c) or f not in (t1.e,t1.a, -f))),~ -13+e) from t1 where b between (11) and t1.f),t1.a)<=t1.d), -c)<=11} -} {0} -do_test randexpr-2.1743 { - db eval {SELECT case coalesce((select t1.f from t1 where not exists(select 1 from t1 where coalesce((select max(d) from t1 where 13 not in (11,coalesce((select max((+f)) from t1 where not d>=f or e in (select 11-t1.b from t1 union select t1.d from t1) or not exists(select 1 from t1 where -b in (select t1.d from t1 union select b from t1) or t1.a<>b or t1.d>e) or t1.a not between (t1.f) and t1.e),+f),t1.e)),t1.f)*t1.b not in (13,t1.b,t1.f))),t1.a)*b when c then b else t1.f end FROM t1 WHERE case when c*coalesce((select max(19+t1.e*~case case t1.e when t1.f then -t1.a else 11 end when 11 then t1.a else (select cast(avg(a) AS integer) from t1) end- -t1.b*coalesce((select 19 from t1 where t1.f in ((a),t1.d,t1.c)),a)) from t1 where exists(select 1 from t1 where not exists(select 1 from t1 where t1.a not in (t1.b,t1.a,17)))),13)>=a then b when t1.c>t1.a then d else 17 end not in (a,17,t1.b)} -} {600} -do_test randexpr-2.1744 { - db eval {SELECT case coalesce((select t1.f from t1 where not exists(select 1 from t1 where coalesce((select max(d) from t1 where 13 not in (11,coalesce((select max((+f)) from t1 where not d>=f or e in (select 11-t1.b from t1 union select t1.d from t1) or not exists(select 1 from t1 where -b in (select t1.d from t1 union select b from t1) or t1.a<>b or t1.d>e) or t1.a not between (t1.f) and t1.e),+f),t1.e)),t1.f)*t1.b not in (13,t1.b,t1.f))),t1.a)*b when c then b else t1.f end FROM t1 WHERE NOT (case when c*coalesce((select max(19+t1.e*~case case t1.e when t1.f then -t1.a else 11 end when 11 then t1.a else (select cast(avg(a) AS integer) from t1) end- -t1.b*coalesce((select 19 from t1 where t1.f in ((a),t1.d,t1.c)),a)) from t1 where exists(select 1 from t1 where not exists(select 1 from t1 where t1.a not in (t1.b,t1.a,17)))),13)>=a then b when t1.c>t1.a then d else 17 end not in (a,17,t1.b))} -} {} -do_test randexpr-2.1745 { - db eval {SELECT (abs(case when (c*+~t1.d++t1.b+a-case when (select +case count(*)+min(d) when -count(distinct 17) then max(t1.b) else -cast(avg(d) AS integer) end from t1) in (select cast(avg(c) AS integer) from t1 union select ((count(*))) from t1) then t1.a* -f else f end*c*19-(f)-t1.c-t1.f+t1.d>=f) then (t1.d) else d end)/abs(t1.b)) FROM t1 WHERE coalesce((select a from t1 where t1.d not in ( -13*d,19,t1.a)),(abs(coalesce((select case when c>=t1.e then b else case ~t1.d+a-+t1.b+17 when case when t1.e+t1.e not between e and (c) then t1.d when d>a then t1.d else t1.c end | t1.a-(d) then t1.f else c end end from t1 where d>=t1.c),13))/abs(t1.c)))=t1.e} -} {} -do_test randexpr-2.1746 { - db eval {SELECT (abs(case when (c*+~t1.d++t1.b+a-case when (select +case count(*)+min(d) when -count(distinct 17) then max(t1.b) else -cast(avg(d) AS integer) end from t1) in (select cast(avg(c) AS integer) from t1 union select ((count(*))) from t1) then t1.a* -f else f end*c*19-(f)-t1.c-t1.f+t1.d>=f) then (t1.d) else d end)/abs(t1.b)) FROM t1 WHERE NOT (coalesce((select a from t1 where t1.d not in ( -13*d,19,t1.a)),(abs(coalesce((select case when c>=t1.e then b else case ~t1.d+a-+t1.b+17 when case when t1.e+t1.e not between e and (c) then t1.d when d>a then t1.d else t1.c end | t1.a-(d) then t1.f else c end end from t1 where d>=t1.c),13))/abs(t1.c)))=t1.e)} -} {2} -do_test randexpr-2.1747 { - db eval {SELECT d+coalesce((select max(coalesce((select f from t1 where coalesce((select 17 | t1.b from t1 where 11 not in ((t1.e),+a-f,t1.c | b+17*t1.e-c)), -c) in (select -count(distinct e)-+max(t1.b) from t1 union select count(distinct c)+cast(avg(t1.b) AS integer) from t1)),17)) from t1 where not t1.c(select ~~+(min(11-11)) | ~ -(count(*)) from t1)*(case when t1.d=19 then a when not t1.a in (11,t1.e,c) or t1.a not between t1.f and e then t1.a else t1.e end+19) then 13 when 19 between -17 and t1.a then t1.a else 19 end end>=t1.f and t1.e>t1.a} -} {} -do_test randexpr-2.1748 { - db eval {SELECT d+coalesce((select max(coalesce((select f from t1 where coalesce((select 17 | t1.b from t1 where 11 not in ((t1.e),+a-f,t1.c | b+17*t1.e-c)), -c) in (select -count(distinct e)-+max(t1.b) from t1 union select count(distinct c)+cast(avg(t1.b) AS integer) from t1)),17)) from t1 where not t1.c(select ~~+(min(11-11)) | ~ -(count(*)) from t1)*(case when t1.d=19 then a when not t1.a in (11,t1.e,c) or t1.a not between t1.f and e then t1.a else t1.e end+19) then 13 when 19 between -17 and t1.a then t1.a else 19 end end>=t1.f and t1.e>t1.a)} -} {1117} -do_test randexpr-2.1749 { - db eval {SELECT d+coalesce((select max(coalesce((select f from t1 where coalesce((select 17 & t1.b from t1 where 11 not in ((t1.e),+a-f,t1.c & b+17*t1.e-c)), -c) in (select -count(distinct e)-+max(t1.b) from t1 union select count(distinct c)+cast(avg(t1.b) AS integer) from t1)),17)) from t1 where not t1.c(select ~~+(min(11-11)) | ~ -(count(*)) from t1)*(case when t1.d=19 then a when not t1.a in (11,t1.e,c) or t1.a not between t1.f and e then t1.a else t1.e end+19) then 13 when 19 between -17 and t1.a then t1.a else 19 end end>=t1.f and t1.e>t1.a)} -} {1117} -do_test randexpr-2.1750 { - db eval {SELECT (select case ~ -(~case case cast(avg(t1.e) AS integer) when min(case when t1.c between coalesce((select t1.b from t1 where d in (select f from t1 union select t1.e from t1)),(e)) and t1.d and (19=(11)) then 17 else b end) | max((13))-min(t1.c) | -count(distinct t1.d)*max(11) then count(*) else max(f) end*count(*)-(( -count(distinct f))) when min(t1.c) then (count(distinct (13))) else max((b)) end)+max(t1.a) when (max(t1.c)) then -cast(avg(a) AS integer) else cast(avg(t1.c) AS integer) end from t1) FROM t1 WHERE (f) not between c and 17 | t1.b | coalesce((select t1.d from t1 where t1.d*~case when a<=f or (case t1.f when d+17+17 then e else +case when (11<>17) then 11 when -t1.b not in (e,19,(f)) then t1.c else a end+13 end>= -t1.f) then ~ -t1.c else c end*t1.f*a*17<=t1.f),17)} -} {300} -do_test randexpr-2.1751 { - db eval {SELECT (select case ~ -(~case case cast(avg(t1.e) AS integer) when min(case when t1.c between coalesce((select t1.b from t1 where d in (select f from t1 union select t1.e from t1)),(e)) and t1.d and (19=(11)) then 17 else b end) | max((13))-min(t1.c) | -count(distinct t1.d)*max(11) then count(*) else max(f) end*count(*)-(( -count(distinct f))) when min(t1.c) then (count(distinct (13))) else max((b)) end)+max(t1.a) when (max(t1.c)) then -cast(avg(a) AS integer) else cast(avg(t1.c) AS integer) end from t1) FROM t1 WHERE NOT ((f) not between c and 17 | t1.b | coalesce((select t1.d from t1 where t1.d*~case when a<=f or (case t1.f when d+17+17 then e else +case when (11<>17) then 11 when -t1.b not in (e,19,(f)) then t1.c else a end+13 end>= -t1.f) then ~ -t1.c else c end*t1.f*a*17<=t1.f),17))} -} {} -do_test randexpr-2.1752 { - db eval {SELECT (select case ~ -(~case case cast(avg(t1.e) AS integer) when min(case when t1.c between coalesce((select t1.b from t1 where d in (select f from t1 union select t1.e from t1)),(e)) and t1.d and (19=(11)) then 17 else b end) & max((13))-min(t1.c) & -count(distinct t1.d)*max(11) then count(*) else max(f) end*count(*)-(( -count(distinct f))) when min(t1.c) then (count(distinct (13))) else max((b)) end)+max(t1.a) when (max(t1.c)) then -cast(avg(a) AS integer) else cast(avg(t1.c) AS integer) end from t1) FROM t1 WHERE (f) not between c and 17 | t1.b | coalesce((select t1.d from t1 where t1.d*~case when a<=f or (case t1.f when d+17+17 then e else +case when (11<>17) then 11 when -t1.b not in (e,19,(f)) then t1.c else a end+13 end>= -t1.f) then ~ -t1.c else c end*t1.f*a*17<=t1.f),17)} -} {300} -do_test randexpr-2.1753 { - db eval {SELECT (select abs(min(t1.b)) from t1)-f | case when +t1.d*d not in (t1.f,t1.a,case when ~t1.f-17*c<>t1.a then 11 when 19 in (select (+count(distinct b)) | cast(avg(19) AS integer)*count(*) from t1 union select count(distinct t1.d) from t1) then d else d end+19+b) then (a) else 17 end*13+d FROM t1 WHERE t1.f<>(abs(t1.a)/abs(coalesce((select max(case when coalesce((select max((select count(*) from t1)) from t1 where f<>t1.a),coalesce((select max(11) from t1 where 17+coalesce((select t1.a from t1 where a in (select +~cast(avg(d+11) AS integer) from t1 union select count(distinct coalesce((select max((13)) from t1 where not (t1.f)<>19),f)*d) from t1)),19)+t1.e between 13 and (t1.b)),e))>=e then d else t1.f end) from t1 where ((not f>= -t1.b))),t1.c)))} -} {-268} -do_test randexpr-2.1754 { - db eval {SELECT (select abs(min(t1.b)) from t1)-f | case when +t1.d*d not in (t1.f,t1.a,case when ~t1.f-17*c<>t1.a then 11 when 19 in (select (+count(distinct b)) | cast(avg(19) AS integer)*count(*) from t1 union select count(distinct t1.d) from t1) then d else d end+19+b) then (a) else 17 end*13+d FROM t1 WHERE NOT (t1.f<>(abs(t1.a)/abs(coalesce((select max(case when coalesce((select max((select count(*) from t1)) from t1 where f<>t1.a),coalesce((select max(11) from t1 where 17+coalesce((select t1.a from t1 where a in (select +~cast(avg(d+11) AS integer) from t1 union select count(distinct coalesce((select max((13)) from t1 where not (t1.f)<>19),f)*d) from t1)),19)+t1.e between 13 and (t1.b)),e))>=e then d else t1.f end) from t1 where ((not f>= -t1.b))),t1.c))))} -} {} -do_test randexpr-2.1755 { - db eval {SELECT (select abs(min(t1.b)) from t1)-f & case when +t1.d*d not in (t1.f,t1.a,case when ~t1.f-17*c<>t1.a then 11 when 19 in (select (+count(distinct b)) & cast(avg(19) AS integer)*count(*) from t1 union select count(distinct t1.d) from t1) then d else d end+19+b) then (a) else 17 end*13+d FROM t1 WHERE t1.f<>(abs(t1.a)/abs(coalesce((select max(case when coalesce((select max((select count(*) from t1)) from t1 where f<>t1.a),coalesce((select max(11) from t1 where 17+coalesce((select t1.a from t1 where a in (select +~cast(avg(d+11) AS integer) from t1 union select count(distinct coalesce((select max((13)) from t1 where not (t1.f)<>19),f)*d) from t1)),19)+t1.e between 13 and (t1.b)),e))>=e then d else t1.f end) from t1 where ((not f>= -t1.b))),t1.c)))} -} {1568} -do_test randexpr-2.1756 { - db eval {SELECT coalesce((select max(a) from t1 where a>a*(((t1.d)) | a)-+case t1.a-t1.d-19+coalesce((select max(t1.c) from t1 where ~(select -cast(avg(a+d) AS integer) from t1) not in (~((17)),t1.a,(t1.e))),b)+a*(c) when t1.f then a else t1.f end-17+c),13)*t1.a FROM t1 WHERE t1.b*t1.d*11*case 13 | t1.a when (case when not exists(select 1 from t1 where t1.a not between coalesce((select f-a from t1 where a not in (11,d,(a)) or e<=d and 11=t1.e),d)+e and t1.c) and (t1.a>=t1.f or (t1.a)>=t1.a) then (c)+t1.d else a end)* -t1.a then e else t1.f end | 13>=b} -} {1300} -do_test randexpr-2.1757 { - db eval {SELECT coalesce((select max(a) from t1 where a>a*(((t1.d)) | a)-+case t1.a-t1.d-19+coalesce((select max(t1.c) from t1 where ~(select -cast(avg(a+d) AS integer) from t1) not in (~((17)),t1.a,(t1.e))),b)+a*(c) when t1.f then a else t1.f end-17+c),13)*t1.a FROM t1 WHERE NOT (t1.b*t1.d*11*case 13 | t1.a when (case when not exists(select 1 from t1 where t1.a not between coalesce((select f-a from t1 where a not in (11,d,(a)) or e<=d and 11=t1.e),d)+e and t1.c) and (t1.a>=t1.f or (t1.a)>=t1.a) then (c)+t1.d else a end)* -t1.a then e else t1.f end | 13>=b)} -} {} -do_test randexpr-2.1758 { - db eval {SELECT coalesce((select max(a) from t1 where a>a*(((t1.d)) & a)-+case t1.a-t1.d-19+coalesce((select max(t1.c) from t1 where ~(select -cast(avg(a+d) AS integer) from t1) not in (~((17)),t1.a,(t1.e))),b)+a*(c) when t1.f then a else t1.f end-17+c),13)*t1.a FROM t1 WHERE t1.b*t1.d*11*case 13 | t1.a when (case when not exists(select 1 from t1 where t1.a not between coalesce((select f-a from t1 where a not in (11,d,(a)) or e<=d and 11=t1.e),d)+e and t1.c) and (t1.a>=t1.f or (t1.a)>=t1.a) then (c)+t1.d else a end)* -t1.a then e else t1.f end | 13>=b} -} {10000} -do_test randexpr-2.1759 { - db eval {SELECT (abs(t1.f)/abs(11*19 | case when (e+t1.b*t1.d+(abs(case -13+t1.d*t1.a-+coalesce((select t1.d from t1 where t1.b not between b and d and d in (select c from t1 union select d from t1)),(19)) when d then 13 else d end*t1.e)/abs(d))+f not between e and t1.a) then ( -f) else d end*a)) FROM t1 WHERE a in (select abs(max(b))-count(distinct case when d not between coalesce((select max(13) from t1 where a+a<+(19)), -f*case (select -cast(avg(t1.c) AS integer)*cast(avg(c) AS integer)-cast(avg(13) AS integer) from t1)*coalesce((select d from t1 where (e=(f))),t1.d) when t1.a then 17 else 19 end) and d then t1.f when (19 between t1.e and -a) then t1.a else (t1.c) end) from t1 union select max(t1.e)+~min(t1.c) from t1)} -} {} -do_test randexpr-2.1760 { - db eval {SELECT (abs(t1.f)/abs(11*19 | case when (e+t1.b*t1.d+(abs(case -13+t1.d*t1.a-+coalesce((select t1.d from t1 where t1.b not between b and d and d in (select c from t1 union select d from t1)),(19)) when d then 13 else d end*t1.e)/abs(d))+f not between e and t1.a) then ( -f) else d end*a)) FROM t1 WHERE NOT (a in (select abs(max(b))-count(distinct case when d not between coalesce((select max(13) from t1 where a+a<+(19)), -f*case (select -cast(avg(t1.c) AS integer)*cast(avg(c) AS integer)-cast(avg(13) AS integer) from t1)*coalesce((select d from t1 where (e=(f))),t1.d) when t1.a then 17 else 19 end) and d then t1.f when (19 between t1.e and -a) then t1.a else (t1.c) end) from t1 union select max(t1.e)+~min(t1.c) from t1))} -} {0} -do_test randexpr-2.1761 { - db eval {SELECT (abs(t1.f)/abs(11*19 & case when (e+t1.b*t1.d+(abs(case -13+t1.d*t1.a-+coalesce((select t1.d from t1 where t1.b not between b and d and d in (select c from t1 union select d from t1)),(19)) when d then 13 else d end*t1.e)/abs(d))+f not between e and t1.a) then ( -f) else d end*a)) FROM t1 WHERE NOT (a in (select abs(max(b))-count(distinct case when d not between coalesce((select max(13) from t1 where a+a<+(19)), -f*case (select -cast(avg(t1.c) AS integer)*cast(avg(c) AS integer)-cast(avg(13) AS integer) from t1)*coalesce((select d from t1 where (e=(f))),t1.d) when t1.a then 17 else 19 end) and d then t1.f when (19 between t1.e and -a) then t1.a else (t1.c) end) from t1 union select max(t1.e)+~min(t1.c) from t1))} -} {4} -do_test randexpr-2.1762 { - db eval {SELECT +t1.d | (d)*t1.e | (select case abs((max(t1.e)-abs(+case min(a) | (~(min(~t1.c)))*(abs(abs(count(*))+count(distinct b)*count(distinct 17)))*max(c) when max(t1.c) then max(t1.d) else cast(avg(d) AS integer) end | max(t1.a))))*cast(avg(11) AS integer) when (cast(avg( -a) AS integer)) then min(19) else -count(distinct 13) end from t1)+t1.b FROM t1 WHERE not exists(select 1 from t1 where e13) or t1.a*t1.f- -a>=t1.d or d in (select -case cast(avg(b) AS integer) when max(19) then count(distinct -t1.f) else count(distinct f) end* -max(t1.d) from t1 union select -cast(avg(13) AS integer) from t1) and 11 between t1.f and d then case when t1.f not between b and 13 then f else t1.e end-t1.c when t1.d in (t1.e,b,d) then t1.f else -t1.d end-t1.d)*d*f>=a} -} {} -do_test randexpr-2.1766 { - db eval {SELECT coalesce((select max(e) from t1 where -(abs(~(t1.f+b))/abs(t1.f)) not in (~case 11+c*case when -t1.d not between coalesce((select max(d) from t1 where f- -t1.f+t1.f-13-e13) or t1.a*t1.f- -a>=t1.d or d in (select -case cast(avg(b) AS integer) when max(19) then count(distinct -t1.f) else count(distinct f) end* -max(t1.d) from t1 union select -cast(avg(13) AS integer) from t1) and 11 between t1.f and d then case when t1.f not between b and 13 then f else t1.e end-t1.c when t1.d in (t1.e,b,d) then t1.f else -t1.d end-t1.d)*d*f>=a)} -} {500} -do_test randexpr-2.1767 { - db eval {SELECT case when ~case when t1.a | case when exists(select 1 from t1 where 19 in (select (count(*))-count(*) from t1 union select -min(b) from t1) or t1.f not in (17,11,t1.c) and t1.d in (a,19,t1.a)) then ~c | 11 else 17 end* -19 in (select count(*) from t1 union select abs( - -case ~cast(avg(t1.b) AS integer) when min(b) then max(a) else (max( -d)) end | count(*)) from t1) then t1.a else t1.c end | b in (select f from t1 union select 13 from t1) then t1.b when t1.a<>(17) then c else t1.a end FROM t1 WHERE exists(select 1 from t1 where d<>13)} -} {300} -do_test randexpr-2.1768 { - db eval {SELECT case when ~case when t1.a | case when exists(select 1 from t1 where 19 in (select (count(*))-count(*) from t1 union select -min(b) from t1) or t1.f not in (17,11,t1.c) and t1.d in (a,19,t1.a)) then ~c | 11 else 17 end* -19 in (select count(*) from t1 union select abs( - -case ~cast(avg(t1.b) AS integer) when min(b) then max(a) else (max( -d)) end | count(*)) from t1) then t1.a else t1.c end | b in (select f from t1 union select 13 from t1) then t1.b when t1.a<>(17) then c else t1.a end FROM t1 WHERE NOT (exists(select 1 from t1 where d<>13))} -} {} -do_test randexpr-2.1769 { - db eval {SELECT case when ~case when t1.a & case when exists(select 1 from t1 where 19 in (select (count(*))-count(*) from t1 union select -min(b) from t1) or t1.f not in (17,11,t1.c) and t1.d in (a,19,t1.a)) then ~c & 11 else 17 end* -19 in (select count(*) from t1 union select abs( - -case ~cast(avg(t1.b) AS integer) when min(b) then max(a) else (max( -d)) end & count(*)) from t1) then t1.a else t1.c end & b in (select f from t1 union select 13 from t1) then t1.b when t1.a<>(17) then c else t1.a end FROM t1 WHERE exists(select 1 from t1 where d<>13)} -} {300} -do_test randexpr-2.1770 { - db eval {SELECT coalesce((select a+t1.d from t1 where t1.d+coalesce((select max(case when e not between 11 and case when (abs(f)/abs(t1.f+19*t1.b))>e then ~d when not not 17 in (13,17,t1.a) then f else t1.f end then 11 when b<17 then t1.b else f end) from t1 where exists(select 1 from t1 where (c<>c))), -f)+t1.c in (select (t1.e) from t1 union select c from t1)),c) FROM t1 WHERE not (t1.a)<=case a when t1.f then +coalesce((select max(c) from t1 where (abs(d-11)/abs(t1.a))+t1.f<=d*d*t1.a+coalesce((select 19 from t1 where (select cast(avg(f) AS integer) from t1)*t1.f+19+ -13 in ((t1.d),c,t1.a)),t1.c) or ((not exists(select 1 from t1 where 19 in (select e from t1 union select -11 from t1))))),c) else e end} -} {} -do_test randexpr-2.1771 { - db eval {SELECT coalesce((select a+t1.d from t1 where t1.d+coalesce((select max(case when e not between 11 and case when (abs(f)/abs(t1.f+19*t1.b))>e then ~d when not not 17 in (13,17,t1.a) then f else t1.f end then 11 when b<17 then t1.b else f end) from t1 where exists(select 1 from t1 where (c<>c))), -f)+t1.c in (select (t1.e) from t1 union select c from t1)),c) FROM t1 WHERE NOT (not (t1.a)<=case a when t1.f then +coalesce((select max(c) from t1 where (abs(d-11)/abs(t1.a))+t1.f<=d*d*t1.a+coalesce((select 19 from t1 where (select cast(avg(f) AS integer) from t1)*t1.f+19+ -13 in ((t1.d),c,t1.a)),t1.c) or ((not exists(select 1 from t1 where 19 in (select e from t1 union select -11 from t1))))),c) else e end)} -} {300} -do_test randexpr-2.1772 { - db eval {SELECT (abs( -c+b)/abs(case when ~11 in (select t1.c from t1 union select coalesce((select t1.f from t1 where coalesce((select max(17) from t1 where coalesce((select case -t1.d when t1.e then a else b end-(t1.d) from t1 where t1.a not between -a and t1.b or t1.f=t1.b) and (f)>= -13),t1.b) from t1) then t1.c when t1.b<=t1.f then 13 else t1.e end)) FROM t1 WHERE (d-coalesce((select max(case 11 when +13-17 | 13 | coalesce((select t1.b from t1 where ((abs(t1.b)/abs((abs(b)/abs(+(19)))*t1.c)) | a in ( -t1.c,t1.a,t1.b))),d)* -d then 13 else 11 end) from t1 where e not in (d,11,11) or t1.e>t1.e),17)+t1.a>b)} -} {7} -do_test randexpr-2.1773 { - db eval {SELECT (abs( -c+b)/abs(case when ~11 in (select t1.c from t1 union select coalesce((select t1.f from t1 where coalesce((select max(17) from t1 where coalesce((select case -t1.d when t1.e then a else b end-(t1.d) from t1 where t1.a not between -a and t1.b or t1.f=t1.b) and (f)>= -13),t1.b) from t1) then t1.c when t1.b<=t1.f then 13 else t1.e end)) FROM t1 WHERE NOT ((d-coalesce((select max(case 11 when +13-17 | 13 | coalesce((select t1.b from t1 where ((abs(t1.b)/abs((abs(b)/abs(+(19)))*t1.c)) | a in ( -t1.c,t1.a,t1.b))),d)* -d then 13 else 11 end) from t1 where e not in (d,11,11) or t1.e>t1.e),17)+t1.a>b))} -} {} -do_test randexpr-2.1774 { - db eval {SELECT coalesce((select max(17) from t1 where (e* -t1.f*e*c-coalesce((select max(t1.f) from t1 where t1.c between case when e+~ -t1.e+11 in (select c from t1 union select t1.a from t1) and t1.d>=c then 19 else ( - -(t1.a)) end*c+f and t1.b),13) not in (t1.b,e,t1.c) and (11) not in (b,( -t1.b),13))),19) FROM t1 WHERE d>e+f} -} {} -do_test randexpr-2.1775 { - db eval {SELECT coalesce((select max(17) from t1 where (e* -t1.f*e*c-coalesce((select max(t1.f) from t1 where t1.c between case when e+~ -t1.e+11 in (select c from t1 union select t1.a from t1) and t1.d>=c then 19 else ( - -(t1.a)) end*c+f and t1.b),13) not in (t1.b,e,t1.c) and (11) not in (b,( -t1.b),13))),19) FROM t1 WHERE NOT (d>e+f)} -} {17} -do_test randexpr-2.1776 { - db eval {SELECT case when t1.b in (select case 13-(select case count(*) when count(distinct (abs(19)/abs(t1.d)))*~count(distinct 13)*(max((abs(t1.e*d*f)/abs(17)))) then -case - -count(distinct e) when min(19) then (cast(avg(17) AS integer)) else count(distinct t1.a) end*max(t1.b)-cast(avg(a) AS integer) else count(distinct t1.d) end from t1)+t1.b*d when t1.c+t1.a then f else t1.f end from t1 union select t1.c from t1) then t1.a when a in (select 11 from t1 union select a from t1) then a else e end FROM t1 WHERE (case when case 11+case f when e then d else (abs(e)/abs(19))*a end when 19 then b else d end= -19 then 13 else t1.e end between 17 and t1.a or b>=17 and ((( -t1.f))>=t1.c and 17 between t1.c and 19 and t1.c between t1.d and a or t1.d=17) or c in (b,13,17))} -} {} -do_test randexpr-2.1777 { - db eval {SELECT case when t1.b in (select case 13-(select case count(*) when count(distinct (abs(19)/abs(t1.d)))*~count(distinct 13)*(max((abs(t1.e*d*f)/abs(17)))) then -case - -count(distinct e) when min(19) then (cast(avg(17) AS integer)) else count(distinct t1.a) end*max(t1.b)-cast(avg(a) AS integer) else count(distinct t1.d) end from t1)+t1.b*d when t1.c+t1.a then f else t1.f end from t1 union select t1.c from t1) then t1.a when a in (select 11 from t1 union select a from t1) then a else e end FROM t1 WHERE NOT ((case when case 11+case f when e then d else (abs(e)/abs(19))*a end when 19 then b else d end= -19 then 13 else t1.e end between 17 and t1.a or b>=17 and ((( -t1.f))>=t1.c and 17 between t1.c and 19 and t1.c between t1.d and a or t1.d=17) or c in (b,13,17)))} -} {100} -do_test randexpr-2.1778 { - db eval {SELECT case when coalesce((select case when (not exists(select 1 from t1 where t1.f<>t1.f)) then case when d-t1.e*t1.d=((select (count(distinct t1.a)) from t1)) then t1.a when 13 not in ( -b,13,19) then t1.b else e end when t1.e=13 then e else 17 end-17*b from t1 where (t1.d in (d,t1.e,t1.f))),( -f)) not in (d,t1.e,c) then t1.d else -t1.f end* -t1.b FROM t1 WHERE not exists(select 1 from t1 where 11 in (select max(coalesce((select max(case when e+coalesce((select max(d) from t1 where not at1.f)) then case when d-t1.e*t1.d=((select (count(distinct t1.a)) from t1)) then t1.a when 13 not in ( -b,13,19) then t1.b else e end when t1.e=13 then e else 17 end-17*b from t1 where (t1.d in (d,t1.e,t1.f))),( -f)) not in (d,t1.e,c) then t1.d else -t1.f end* -t1.b FROM t1 WHERE NOT (not exists(select 1 from t1 where 11 in (select max(coalesce((select max(case when e+coalesce((select max(d) from t1 where not ab or not t1.f in (11,t1.a,t1.e)),t1.a) | e then c else e end from t1 where -t1.a<11),13))/abs(t1.b))-t1.b*17 from t1 where c=t1.c),17) FROM t1 WHERE t1.e+e>=coalesce((select max(t1.d) from t1 where +(t1.f) not between c and f),case when exists(select 1 from t1 where t1.e+t1.c<>(abs(e*(select -count(*) from t1))/abs(t1.e*coalesce((select max((select cast(avg(13) AS integer) from t1)) from t1 where not (a) not between -c and -17), -d)+ -a+t1.f))) then case when e between 17 and d then a else 19 end when not c between e and 11 then 13 else t1.a end)} -} {-3051} -do_test randexpr-2.1781 { - db eval {SELECT coalesce((select (abs(~c*t1.a+t1.b*coalesce((select case c when b+coalesce((select t1.b-case e when 19 then b else b end*11 from t1 where t1.b<>b or not t1.f in (11,t1.a,t1.e)),t1.a) | e then c else e end from t1 where -t1.a<11),13))/abs(t1.b))-t1.b*17 from t1 where c=t1.c),17) FROM t1 WHERE NOT (t1.e+e>=coalesce((select max(t1.d) from t1 where +(t1.f) not between c and f),case when exists(select 1 from t1 where t1.e+t1.c<>(abs(e*(select -count(*) from t1))/abs(t1.e*coalesce((select max((select cast(avg(13) AS integer) from t1)) from t1 where not (a) not between -c and -17), -d)+ -a+t1.f))) then case when e between 17 and d then a else 19 end when not c between e and 11 then 13 else t1.a end))} -} {} -do_test randexpr-2.1782 { - db eval {SELECT coalesce((select (abs(~c*t1.a+t1.b*coalesce((select case c when b+coalesce((select t1.b-case e when 19 then b else b end*11 from t1 where t1.b<>b or not t1.f in (11,t1.a,t1.e)),t1.a) & e then c else e end from t1 where -t1.a<11),13))/abs(t1.b))-t1.b*17 from t1 where c=t1.c),17) FROM t1 WHERE t1.e+e>=coalesce((select max(t1.d) from t1 where +(t1.f) not between c and f),case when exists(select 1 from t1 where t1.e+t1.c<>(abs(e*(select -count(*) from t1))/abs(t1.e*coalesce((select max((select cast(avg(13) AS integer) from t1)) from t1 where not (a) not between -c and -17), -d)+ -a+t1.f))) then case when e between 17 and d then a else 19 end when not c between e and 11 then 13 else t1.a end)} -} {-3051} -do_test randexpr-2.1783 { - db eval {SELECT t1.a-~17-t1.c+t1.c | (c) | (13)*coalesce((select max((case when 11 in (case when (19 in (select abs(max(c)) from t1 union select ( -cast(avg(19) AS integer)) from t1)) then 13 when t1.a= -t1.a then t1.b else c end,a,13) then t1.e when t1.b in (t1.a,13, -19) then d else t1.a end)) from t1 where t1.d between t1.d and t1.b and t1.d<=17),t1.d)*11 | t1.e FROM t1 WHERE e in (select 11 from t1 union select a from t1)} -} {} -do_test randexpr-2.1784 { - db eval {SELECT t1.a-~17-t1.c+t1.c | (c) | (13)*coalesce((select max((case when 11 in (case when (19 in (select abs(max(c)) from t1 union select ( -cast(avg(19) AS integer)) from t1)) then 13 when t1.a= -t1.a then t1.b else c end,a,13) then t1.e when t1.b in (t1.a,13, -19) then d else t1.a end)) from t1 where t1.d between t1.d and t1.b and t1.d<=17),t1.d)*11 | t1.e FROM t1 WHERE NOT (e in (select 11 from t1 union select a from t1))} -} {57342} -do_test randexpr-2.1785 { - db eval {SELECT t1.a-~17-t1.c+t1.c & (c) & (13)*coalesce((select max((case when 11 in (case when (19 in (select abs(max(c)) from t1 union select ( -cast(avg(19) AS integer)) from t1)) then 13 when t1.a= -t1.a then t1.b else c end,a,13) then t1.e when t1.b in (t1.a,13, -19) then d else t1.a end)) from t1 where t1.d between t1.d and t1.b and t1.d<=17),t1.d)*11 & t1.e FROM t1 WHERE NOT (e in (select 11 from t1 union select a from t1))} -} {32} -do_test randexpr-2.1786 { - db eval {SELECT (abs(case when 11 not between t1.d and case coalesce((select case c+case when b in (case when a<=t1.b then (t1.a) when f not in (d,t1.f, -(a)) then (t1.a) else c end,t1.a,b) then 11 when (t1.c not between 17 and -d) then t1.d else e end+e*t1.a when 19 then b else t1.e end from t1 where not exists(select 1 from t1 where not exists(select 1 from t1 where -(19)=d))),t1.d) when c then a else -17 end or a>=19 then 17 else b end+ -13)/abs(b)) FROM t1 WHERE not exists(select 1 from t1 where not e+case 13 when 11 then +t1.d else t1.f+11 end*a-19+t1.c+a in (~e | coalesce((select ~a*+(abs( -case case b*e when f then e else -13 end when t1.d then t1.b else t1.b end)/abs(17))+t1.b from t1 where t1.a=e),d),e,e))} -} {} -do_test randexpr-2.1787 { - db eval {SELECT (abs(case when 11 not between t1.d and case coalesce((select case c+case when b in (case when a<=t1.b then (t1.a) when f not in (d,t1.f, -(a)) then (t1.a) else c end,t1.a,b) then 11 when (t1.c not between 17 and -d) then t1.d else e end+e*t1.a when 19 then b else t1.e end from t1 where not exists(select 1 from t1 where not exists(select 1 from t1 where -(19)=d))),t1.d) when c then a else -17 end or a>=19 then 17 else b end+ -13)/abs(b)) FROM t1 WHERE NOT (not exists(select 1 from t1 where not e+case 13 when 11 then +t1.d else t1.f+11 end*a-19+t1.c+a in (~e | coalesce((select ~a*+(abs( -case case b*e when f then e else -13 end when t1.d then t1.b else t1.b end)/abs(17))+t1.b from t1 where t1.a=e),d),e,e)))} -} {0} -do_test randexpr-2.1788 { - db eval {SELECT t1.c-coalesce((select t1.e from t1 where not 17 | (select abs(min((t1.c) | +case 19 when d then f else t1.c end*(13)+a)- -count(*)) from t1)>t1.c and (exists(select 1 from t1 where c in (select f from t1 union select a from t1))) or t1.e>t1.c),coalesce((select e*(e) from t1 where not exists(select 1 from t1 where b not in (f,a,19))),c)) FROM t1 WHERE t1.f*t1.e*b+coalesce((select case when 17 not in (case e++t1.d+19*11 when case when 11 in (select -min(t1.a)*min(t1.e)+cast(avg(t1.a) AS integer) from t1 union select -count(*) from t1) then 13 else 11 end*17 then a else t1.a end,(t1.b),t1.d) then t1.f else -b end from t1 where t1.b not between 17 and (a)),d)-t1.d-c*bt1.c and (exists(select 1 from t1 where c in (select f from t1 union select a from t1))) or t1.e>t1.c),coalesce((select e*(e) from t1 where not exists(select 1 from t1 where b not in (f,a,19))),c)) FROM t1 WHERE NOT (t1.f*t1.e*b+coalesce((select case when 17 not in (case e++t1.d+19*11 when case when 11 in (select -min(t1.a)*min(t1.e)+cast(avg(t1.a) AS integer) from t1 union select -count(*) from t1) then 13 else 11 end*17 then a else t1.a end,(t1.b),t1.d) then t1.f else -b end from t1 where t1.b not between 17 and (a)),d)-t1.d-c*bt1.c and (exists(select 1 from t1 where c in (select f from t1 union select a from t1))) or t1.e>t1.c),coalesce((select e*(e) from t1 where not exists(select 1 from t1 where b not in (f,a,19))),c)) FROM t1 WHERE NOT (t1.f*t1.e*b+coalesce((select case when 17 not in (case e++t1.d+19*11 when case when 11 in (select -min(t1.a)*min(t1.e)+cast(avg(t1.a) AS integer) from t1 union select -count(*) from t1) then 13 else 11 end*17 then a else t1.a end,(t1.b),t1.d) then t1.f else -b end from t1 where t1.b not between 17 and (a)),d)-t1.d-c*b= -b+t1.f | 19 then t1.d else 11 end else t1.a end-t1.e else d end not between f and t1.f) then c else e end) from t1 where f>=t1.b and t1.c between t1.f and t1.a),e)*d*b FROM t1 WHERE t1.b in (select 11-case when (t1.a+19<=case when c>=(19) then 11 else t1.e+t1.a*c end*e and t1.f in (select case abs(+abs( -count(*) | count(*)*count(distinct c)+max(13))) when min(d) then min(b) else min(t1.b) end | cast(avg(t1.e) AS integer) from t1 union select count(distinct t1.e) from t1)) then t1.a else t1.f end*17 from t1 union select t1.a from t1)} -} {} -do_test randexpr-2.1792 { - db eval {SELECT c-coalesce((select max(case when (case t1.a when a then case f when e*e then ~c | case when +c>= -b+t1.f | 19 then t1.d else 11 end else t1.a end-t1.e else d end not between f and t1.f) then c else e end) from t1 where f>=t1.b and t1.c between t1.f and t1.a),e)*d*b FROM t1 WHERE NOT (t1.b in (select 11-case when (t1.a+19<=case when c>=(19) then 11 else t1.e+t1.a*c end*e and t1.f in (select case abs(+abs( -count(*) | count(*)*count(distinct c)+max(13))) when min(d) then min(b) else min(t1.b) end | cast(avg(t1.e) AS integer) from t1 union select count(distinct t1.e) from t1)) then t1.a else t1.f end*17 from t1 union select t1.a from t1))} -} {-39999700} -do_test randexpr-2.1793 { - db eval {SELECT c-coalesce((select max(case when (case t1.a when a then case f when e*e then ~c & case when +c>= -b+t1.f & 19 then t1.d else 11 end else t1.a end-t1.e else d end not between f and t1.f) then c else e end) from t1 where f>=t1.b and t1.c between t1.f and t1.a),e)*d*b FROM t1 WHERE NOT (t1.b in (select 11-case when (t1.a+19<=case when c>=(19) then 11 else t1.e+t1.a*c end*e and t1.f in (select case abs(+abs( -count(*) | count(*)*count(distinct c)+max(13))) when min(d) then min(b) else min(t1.b) end | cast(avg(t1.e) AS integer) from t1 union select count(distinct t1.e) from t1)) then t1.a else t1.f end*17 from t1 union select t1.a from t1))} -} {-39999700} -do_test randexpr-2.1794 { - db eval {SELECT coalesce((select f from t1 where ~coalesce((select max(b-e) from t1 where 13 in (select d from t1 union select d from t1)),(abs(t1.f)/abs(t1.f)))-t1.d+case a when t1.b then 13 else case when 19>case a when t1.a then 13 else -d end or e<>c then coalesce((select max(a) from t1 where t1.e not between (13) and t1.d),11) when b in (select t1.a from t1 union select t1.f from t1) then 19 else a end end-b>11),17) FROM t1 WHERE b in (select e-17 from t1 union select d from t1)} -} {} -do_test randexpr-2.1795 { - db eval {SELECT coalesce((select f from t1 where ~coalesce((select max(b-e) from t1 where 13 in (select d from t1 union select d from t1)),(abs(t1.f)/abs(t1.f)))-t1.d+case a when t1.b then 13 else case when 19>case a when t1.a then 13 else -d end or e<>c then coalesce((select max(a) from t1 where t1.e not between (13) and t1.d),11) when b in (select t1.a from t1 union select t1.f from t1) then 19 else a end end-b>11),17) FROM t1 WHERE NOT (b in (select e-17 from t1 union select d from t1))} -} {17} -do_test randexpr-2.1796 { - db eval {SELECT coalesce((select case case when 13<>((abs(t1.b)/abs(f+t1.c))) then 11 else coalesce((select max(b) from t1 where (b=(abs((select min((select case -min(11) when count(distinct d) then count(*) else min(t1.c) end from t1)) from t1))/abs(t1.f))-c)), -19)*e end*d* -e+t1.d when 13 then c else c end+b from t1 where d>13 or (b between t1.e and 19)),a) FROM t1 WHERE not exists(select 1 from t1 where ((not not exists(select 1 from t1 where ((case when coalesce((select max(19) from t1 where case when b>=e and f between t1.d and t1.c or ( -t1.b)=t1.f then b+a else 11 end in (d,t1.d,(17))),t1.d)>t1.b then (t1.f) else d end*e*t1.e<=t1.b)) or 13<>13)) or 17((abs(t1.b)/abs(f+t1.c))) then 11 else coalesce((select max(b) from t1 where (b=(abs((select min((select case -min(11) when count(distinct d) then count(*) else min(t1.c) end from t1)) from t1))/abs(t1.f))-c)), -19)*e end*d* -e+t1.d when 13 then c else c end+b from t1 where d>13 or (b between t1.e and 19)),a) FROM t1 WHERE NOT (not exists(select 1 from t1 where ((not not exists(select 1 from t1 where ((case when coalesce((select max(19) from t1 where case when b>=e and f between t1.d and t1.c or ( -t1.b)=t1.f then b+a else 11 end in (d,t1.d,(17))),t1.d)>t1.b then (t1.f) else d end*e*t1.e<=t1.b)) or 13<>13)) or 17t1.d then e+t1.c when 19 between t1.f and t1.f then 11 else e end between t1.e and 17) and c=t1.f),t1.c) not between t1.a and (19) then c else t1.b end*a-19 and b then b when a not in (a,t1.f,11) then a else a end FROM t1 WHERE (select abs((+min(t1.c)*min(t1.d)*count(*)))*count(*)++count(distinct ~13*11+t1.f) | case abs(+count(*)) when min(t1.e) then count(*) else max(13) end from t1)*t1.b between d and a++19 and t1.c in (select ~((abs(17)/abs(c)))-d from t1 union select t1.f from t1)} -} {} -do_test randexpr-2.1799 { - db eval {SELECT ~case when 19 not between ~case when coalesce((select max(t1.c*(select cast(avg(13) AS integer) from t1)) from t1 where exists(select 1 from t1 where case when (t1.b in (d,b,t1.c)) and 13>t1.d then e+t1.c when 19 between t1.f and t1.f then 11 else e end between t1.e and 17) and c=t1.f),t1.c) not between t1.a and (19) then c else t1.b end*a-19 and b then b when a not in (a,t1.f,11) then a else a end FROM t1 WHERE NOT ((select abs((+min(t1.c)*min(t1.d)*count(*)))*count(*)++count(distinct ~13*11+t1.f) | case abs(+count(*)) when min(t1.e) then count(*) else max(13) end from t1)*t1.b between d and a++19 and t1.c in (select ~((abs(17)/abs(c)))-d from t1 union select t1.f from t1))} -} {-101} -do_test randexpr-2.1800 { - db eval {SELECT (t1.d)+(abs(coalesce((select ((abs(case t1.e when a+(abs(11)/abs(b)) then t1.f else case coalesce((select max(d+c) from t1 where +19+11t1.c),d))/abs(t1.d))-11 | (17) | b FROM t1 WHERE (select ~min(b)+count(distinct 17) from t1)>(select max((abs((13))/abs(coalesce((select case when b*13 in (case when e=t1.b then c when 11<>e then f else t1.b end,t1.f,t1.a) then d when not exists(select 1 from t1 where t1.f<>e) then t1.a else c end from t1 where t1.e=13),t1.f) | b)))+(~~cast(avg(f) AS integer)-min((13))) from t1)} -} {} -do_test randexpr-2.1801 { - db eval {SELECT (t1.d)+(abs(coalesce((select ((abs(case t1.e when a+(abs(11)/abs(b)) then t1.f else case coalesce((select max(d+c) from t1 where +19+11t1.c),d))/abs(t1.d))-11 | (17) | b FROM t1 WHERE NOT ((select ~min(b)+count(distinct 17) from t1)>(select max((abs((13))/abs(coalesce((select case when b*13 in (case when e=t1.b then c when 11<>e then f else t1.b end,t1.f,t1.a) then d when not exists(select 1 from t1 where t1.f<>e) then t1.a else c end from t1 where t1.e=13),t1.f) | b)))+(~~cast(avg(f) AS integer)-min((13))) from t1))} -} {477} -do_test randexpr-2.1802 { - db eval {SELECT (t1.d)+(abs(coalesce((select ((abs(case t1.e when a+(abs(11)/abs(b)) then t1.f else case coalesce((select max(d+c) from t1 where +19+11t1.c),d))/abs(t1.d))-11 & (17) & b FROM t1 WHERE NOT ((select ~min(b)+count(distinct 17) from t1)>(select max((abs((13))/abs(coalesce((select case when b*13 in (case when e=t1.b then c when 11<>e then f else t1.b end,t1.f,t1.a) then d when not exists(select 1 from t1 where t1.f<>e) then t1.a else c end from t1 where t1.e=13),t1.f) | b)))+(~~cast(avg(f) AS integer)-min((13))) from t1))} -} {0} -do_test randexpr-2.1803 { - db eval {SELECT d+case coalesce((select t1.f from t1 where coalesce((select max((11)) from t1 where (coalesce((select d from t1 where ((case b when ( -a) then 19 else e end)) not in ( -d,t1.c,13)),b))>t1.b and ((c in (select ~~cast(avg(t1.b) AS integer)+ -(max(t1.e)) from t1 union select max(c) from t1) and (e) in (select -count(distinct 17) from t1 union select count(*) from t1) or 11<>t1.c))),t1.b) not between (f) and 11),t1.d) when (19) then e else 13 end-t1.f FROM t1 WHERE exists(select 1 from t1 where (t1.a between case when e | b*c-19 | at1.b and ((c in (select ~~cast(avg(t1.b) AS integer)+ -(max(t1.e)) from t1 union select max(c) from t1) and (e) in (select -count(distinct 17) from t1 union select count(*) from t1) or 11<>t1.c))),t1.b) not between (f) and 11),t1.d) when (19) then e else 13 end-t1.f FROM t1 WHERE NOT (exists(select 1 from t1 where (t1.a between case when e | b*c-19 | a=f or (select -count(*) from t1) in (select t1.c from t1 union select 17 from t1)),b)*e not between case coalesce((select max(~case when 17>t1.e then d else 13 end) from t1 where not t1.c<=17),t1.c) when 13 then c else t1.e end+t1.c-t1.e and t1.e),t1.e) FROM t1 WHERE case ~case when not exists(select 1 from t1 where f<=~t1.d) then (abs(coalesce((select ~19 from t1 where d+t1.f=b),d))/abs(e)) when d in (select +min(11) from t1 union select ( -abs(count(distinct e)))+count(distinct t1.a) from t1) then e else t1.d end when -d then t1.e else t1.b end=t1.f or t1.d not in (t1.c,t1.e,t1.e) and t1.c not in (17,t1.a,e)} -} {300} -do_test randexpr-2.1806 { - db eval {SELECT coalesce((select c from t1 where - -19-coalesce((select t1.e from t1 where not f<=b-17 or not -13>=f or (select -count(*) from t1) in (select t1.c from t1 union select 17 from t1)),b)*e not between case coalesce((select max(~case when 17>t1.e then d else 13 end) from t1 where not t1.c<=17),t1.c) when 13 then c else t1.e end+t1.c-t1.e and t1.e),t1.e) FROM t1 WHERE NOT (case ~case when not exists(select 1 from t1 where f<=~t1.d) then (abs(coalesce((select ~19 from t1 where d+t1.f=b),d))/abs(e)) when d in (select +min(11) from t1 union select ( -abs(count(distinct e)))+count(distinct t1.a) from t1) then e else t1.d end when -d then t1.e else t1.b end=t1.f or t1.d not in (t1.c,t1.e,t1.e) and t1.c not in (17,t1.a,e))} -} {} -do_test randexpr-2.1807 { - db eval {SELECT case when t1.e<=~d then case when t1.d-e in (~t1.c-case e*case when t1.e not in (t1.d,19,f) then e else b end*e when (19) then t1.a else -e end,19,17) then t1.f when t1.d not in (t1.b,b,17) then t1.b else 19 end when 13= -t1.f and not (19=t1.d) then t1.f else (d) end FROM t1 WHERE 19<>d} -} {400} -do_test randexpr-2.1808 { - db eval {SELECT case when t1.e<=~d then case when t1.d-e in (~t1.c-case e*case when t1.e not in (t1.d,19,f) then e else b end*e when (19) then t1.a else -e end,19,17) then t1.f when t1.d not in (t1.b,b,17) then t1.b else 19 end when 13= -t1.f and not (19=t1.d) then t1.f else (d) end FROM t1 WHERE NOT (19<>d)} -} {} -do_test randexpr-2.1809 { - db eval {SELECT (select max(case when (t1.d<=t1.a*t1.b) then t1.e else case when t1.a> -t1.c*t1.f then b else b*(a) end end)*min(+ -19-(select min(a) from t1)-+17*case when not exists(select 1 from t1 where (select abs(cast(avg(a) AS integer)) from t1)=t1.a) then e when 19>=a then 13 else t1.a end*19-e) from t1) FROM t1 WHERE t1.e in (select max(t1.e)-cast(avg(e) AS integer) from t1 union select (~+count(*) | count(*) | cast(avg((abs(coalesce((select max(case f+c-17 when t1.b then t1.e else t1.d end) from t1 where 17 in (select a from t1 union select t1.b from t1)),a))/abs( -t1.e))) AS integer)+~case count(*) when cast(avg(t1.d) AS integer) then -cast(avg(t1.e) AS integer) else count(distinct d) end-max(13)+ -min(t1.a) | min((17)) | count(distinct d))-min(e) from t1)} -} {} -do_test randexpr-2.1810 { - db eval {SELECT (select max(case when (t1.d<=t1.a*t1.b) then t1.e else case when t1.a> -t1.c*t1.f then b else b*(a) end end)*min(+ -19-(select min(a) from t1)-+17*case when not exists(select 1 from t1 where (select abs(cast(avg(a) AS integer)) from t1)=t1.a) then e when 19>=a then 13 else t1.a end*19-e) from t1) FROM t1 WHERE NOT (t1.e in (select max(t1.e)-cast(avg(e) AS integer) from t1 union select (~+count(*) | count(*) | cast(avg((abs(coalesce((select max(case f+c-17 when t1.b then t1.e else t1.d end) from t1 where 17 in (select a from t1 union select t1.b from t1)),a))/abs( -t1.e))) AS integer)+~case count(*) when cast(avg(t1.d) AS integer) then -cast(avg(t1.e) AS integer) else count(distinct d) end-max(13)+ -min(t1.a) | min((17)) | count(distinct d))-min(e) from t1))} -} {-16459500} -do_test randexpr-2.1811 { - db eval {SELECT case when case (select max(t1.b)*min(case when (abs(t1.e)/abs(d)) in (select 19 from t1 union select +t1.d from t1) then t1.d when t1.d=d or 11 in (t1.c,b,t1.b) and 13 in (select max(b)-count(distinct b) from t1 union select count(distinct -t1.c) from t1) then f else 17 end) from t1) when t1.a then 11 else t1.d end+t1.a>c or t1.c between 13 and a then f when (t1.b)>=t1.a then d else b end FROM t1 WHERE (not exists(select 1 from t1 where coalesce((select max(e) from t1 where -b+a-(abs(c)/abs(b))-( -t1.a)-t1.c>=d),d) in (select count(distinct a) from t1 union select cast(avg(t1.b) AS integer) from t1) and exists(select 1 from t1 where not t1.d<>f) and t1.a in (select min(t1.a)+max(a)*max(19)*count(distinct c) from t1 union select ((count(distinct 11))) from t1) or t1.c>(13) and a between (t1.f) and 13))} -} {600} -do_test randexpr-2.1812 { - db eval {SELECT case when case (select max(t1.b)*min(case when (abs(t1.e)/abs(d)) in (select 19 from t1 union select +t1.d from t1) then t1.d when t1.d=d or 11 in (t1.c,b,t1.b) and 13 in (select max(b)-count(distinct b) from t1 union select count(distinct -t1.c) from t1) then f else 17 end) from t1) when t1.a then 11 else t1.d end+t1.a>c or t1.c between 13 and a then f when (t1.b)>=t1.a then d else b end FROM t1 WHERE NOT ((not exists(select 1 from t1 where coalesce((select max(e) from t1 where -b+a-(abs(c)/abs(b))-( -t1.a)-t1.c>=d),d) in (select count(distinct a) from t1 union select cast(avg(t1.b) AS integer) from t1) and exists(select 1 from t1 where not t1.d<>f) and t1.a in (select min(t1.a)+max(a)*max(19)*count(distinct c) from t1 union select ((count(distinct 11))) from t1) or t1.c>(13) and a between (t1.f) and 13)))} -} {} -do_test randexpr-2.1813 { - db eval {SELECT f*~13*(abs(13*d- -(abs(case when ~coalesce((select max(c) from t1 where b>case when not exists(select 1 from t1 where f not in ( - -(t1.b),t1.b,t1.f)) then e when t1.c<>f then c else 13 end),17) | -19 not in (f,b,f) then -b when not 13 in (select max((19)) from t1 union select count(*) | count(*) from t1) and 11 not between t1.b and e or 13 in (t1.a, -e,(t1.c)) then a else 11 end)/abs(t1.c))*b | t1.b)/abs(f))*f*f FROM t1 WHERE ~case f when coalesce((select max(17) from t1 where b+t1.f*case 11 when coalesce((select max(t1.f) from t1 where 17>t1.f),19)-t1.b-t1.b | d then b else c end+t1.d*11-t1.c<=case when b>=a then 19 else f end | t1.a),13) then f else t1.e end*t1.e*17-d in (select 13 from t1 union select t1.e from t1)} -} {} -do_test randexpr-2.1814 { - db eval {SELECT f*~13*(abs(13*d- -(abs(case when ~coalesce((select max(c) from t1 where b>case when not exists(select 1 from t1 where f not in ( - -(t1.b),t1.b,t1.f)) then e when t1.c<>f then c else 13 end),17) | -19 not in (f,b,f) then -b when not 13 in (select max((19)) from t1 union select count(*) | count(*) from t1) and 11 not between t1.b and e or 13 in (t1.a, -e,(t1.c)) then a else 11 end)/abs(t1.c))*b | t1.b)/abs(f))*f*f FROM t1 WHERE NOT (~case f when coalesce((select max(17) from t1 where b+t1.f*case 11 when coalesce((select max(t1.f) from t1 where 17>t1.f),19)-t1.b-t1.b | d then b else c end+t1.d*11-t1.c<=case when b>=a then 19 else f end | t1.a),13) then f else t1.e end*t1.e*17-d in (select 13 from t1 union select t1.e from t1))} -} {-24192000000} -do_test randexpr-2.1815 { - db eval {SELECT f*~13*(abs(13*d- -(abs(case when ~coalesce((select max(c) from t1 where b>case when not exists(select 1 from t1 where f not in ( - -(t1.b),t1.b,t1.f)) then e when t1.c<>f then c else 13 end),17) & -19 not in (f,b,f) then -b when not 13 in (select max((19)) from t1 union select count(*) & count(*) from t1) and 11 not between t1.b and e or 13 in (t1.a, -e,(t1.c)) then a else 11 end)/abs(t1.c))*b & t1.b)/abs(f))*f*f FROM t1 WHERE NOT (~case f when coalesce((select max(17) from t1 where b+t1.f*case 11 when coalesce((select max(t1.f) from t1 where 17>t1.f),19)-t1.b-t1.b | d then b else c end+t1.d*11-t1.c<=case when b>=a then 19 else f end | t1.a),13) then f else t1.e end*t1.e*17-d in (select 13 from t1 union select t1.e from t1))} -} {0} -do_test randexpr-2.1816 { - db eval {SELECT t1.b | (select case max( -17)-min(17) when cast(avg(a) AS integer)*(+cast(avg(f) AS integer)-cast(avg(case when not exists(select 1 from t1 where not case when t1.c<>t1.b or -d not between b and a then 11 when (11)=11 then b else t1.b end in (t1.d,t1.c,13)) then 13 when t1.e not between 17 and t1.b then t1.c else t1.d end*t1.b) AS integer))-cast(avg(19) AS integer)*~max(t1.c)-((max(13)))*(count(*))+(max(11)) then count(distinct 13) else cast(avg(17) AS integer) end from t1) FROM t1 WHERE (abs(t1.c)/abs(case t1.d when t1.f then 13 else t1.f+13 end)) not between c and 19} -} {217} -do_test randexpr-2.1817 { - db eval {SELECT t1.b | (select case max( -17)-min(17) when cast(avg(a) AS integer)*(+cast(avg(f) AS integer)-cast(avg(case when not exists(select 1 from t1 where not case when t1.c<>t1.b or -d not between b and a then 11 when (11)=11 then b else t1.b end in (t1.d,t1.c,13)) then 13 when t1.e not between 17 and t1.b then t1.c else t1.d end*t1.b) AS integer))-cast(avg(19) AS integer)*~max(t1.c)-((max(13)))*(count(*))+(max(11)) then count(distinct 13) else cast(avg(17) AS integer) end from t1) FROM t1 WHERE NOT ((abs(t1.c)/abs(case t1.d when t1.f then 13 else t1.f+13 end)) not between c and 19)} -} {} -do_test randexpr-2.1818 { - db eval {SELECT t1.b & (select case max( -17)-min(17) when cast(avg(a) AS integer)*(+cast(avg(f) AS integer)-cast(avg(case when not exists(select 1 from t1 where not case when t1.c<>t1.b or -d not between b and a then 11 when (11)=11 then b else t1.b end in (t1.d,t1.c,13)) then 13 when t1.e not between 17 and t1.b then t1.c else t1.d end*t1.b) AS integer))-cast(avg(19) AS integer)*~max(t1.c)-((max(13)))*(count(*))+(max(11)) then count(distinct 13) else cast(avg(17) AS integer) end from t1) FROM t1 WHERE (abs(t1.c)/abs(case t1.d when t1.f then 13 else t1.f+13 end)) not between c and 19} -} {0} -do_test randexpr-2.1819 { - db eval {SELECT case +c-case (select case count(distinct 13) when min(19*e) then ~count(*) else ~min(case when not +13*(case when e*c>=e then e else f end)-a+c not in (b,t1.b,t1.e) then 19 else 17 end*a) end from t1) when 11 then 11 else c end+t1.c when t1.b then d else 19 end FROM t1 WHERE t1.a<>~coalesce((select max(e) from t1 where 13-17*13<>19*17-f or coalesce((select max(~case +t1.d-f*e | c+(17)+a | c*((b)) when a then t1.a else d end-d) from t1 where t1.c>= -t1.a),t1.b) | 19>t1.a),c)} -} {19} -do_test randexpr-2.1820 { - db eval {SELECT case +c-case (select case count(distinct 13) when min(19*e) then ~count(*) else ~min(case when not +13*(case when e*c>=e then e else f end)-a+c not in (b,t1.b,t1.e) then 19 else 17 end*a) end from t1) when 11 then 11 else c end+t1.c when t1.b then d else 19 end FROM t1 WHERE NOT (t1.a<>~coalesce((select max(e) from t1 where 13-17*13<>19*17-f or coalesce((select max(~case +t1.d-f*e | c+(17)+a | c*((b)) when a then t1.a else d end-d) from t1 where t1.c>= -t1.a),t1.b) | 19>t1.a),c))} -} {} -do_test randexpr-2.1821 { - db eval {SELECT coalesce((select max(t1.d) from t1 where f between case when (19 not in (t1.b,(a),t1.a)) or t1.a=t1.b | -(select +cast(avg(17-case when -c<=17 then a when -11 not in (11,19,a) then e else 11 end-t1.a*d) AS integer) from t1) then t1.b when (11)*f in (13,t1.a,a) or t1.a=e),f)*b-f and t1.f),t1.b) else d end+19 when t1.a then 11 else e end-t1.a)} -} {} -do_test randexpr-2.1822 { - db eval {SELECT coalesce((select max(t1.d) from t1 where f between case when (19 not in (t1.b,(a),t1.a)) or t1.a=t1.b | -(select +cast(avg(17-case when -c<=17 then a when -11 not in (11,19,a) then e else 11 end-t1.a*d) AS integer) from t1) then t1.b when (11)*f in (13,t1.a,a) or t1.a=e),f)*b-f and t1.f),t1.b) else d end+19 when t1.a then 11 else e end-t1.a))} -} {-200} -do_test randexpr-2.1823 { - db eval {SELECT coalesce((select max(t1.d) from t1 where f between case when (19 not in (t1.b,(a),t1.a)) or t1.a=t1.b & -(select +cast(avg(17-case when -c<=17 then a when -11 not in (11,19,a) then e else 11 end-t1.a*d) AS integer) from t1) then t1.b when (11)*f in (13,t1.a,a) or t1.a=e),f)*b-f and t1.f),t1.b) else d end+19 when t1.a then 11 else e end-t1.a))} -} {-200} -do_test randexpr-2.1824 { - db eval {SELECT case when not -t1.c in (coalesce((select d from t1 where t1.a not in (t1.c+f, -f,19) and t1.b in (select max(t1.d)+min(19)*min(t1.e) from t1 union select count(distinct d) from t1) and (t1.d) in (select -count(*) from t1 union select -count(*) from t1)),d* -t1.e),b,f) or -c not in (a, -t1.a,t1.e) then case when b between 17 and t1.b and a not in (t1.a,e,t1.e) then t1.d else 19 end*t1.b else t1.d end+t1.d FROM t1 WHERE (abs((17))/abs(11 | e*e+d++t1.d)) in (19+t1.f,e,(abs(13)/abs( -t1.c)))} -} {4200} -do_test randexpr-2.1825 { - db eval {SELECT case when not -t1.c in (coalesce((select d from t1 where t1.a not in (t1.c+f, -f,19) and t1.b in (select max(t1.d)+min(19)*min(t1.e) from t1 union select count(distinct d) from t1) and (t1.d) in (select -count(*) from t1 union select -count(*) from t1)),d* -t1.e),b,f) or -c not in (a, -t1.a,t1.e) then case when b between 17 and t1.b and a not in (t1.a,e,t1.e) then t1.d else 19 end*t1.b else t1.d end+t1.d FROM t1 WHERE NOT ((abs((17))/abs(11 | e*e+d++t1.d)) in (19+t1.f,e,(abs(13)/abs( -t1.c))))} -} {} -do_test randexpr-2.1826 { - db eval {SELECT case when ( -(select ~ -~ -(max(c))-min(t1.e) | count(distinct (11)) | min(t1.a) from t1)-case when case d when a then case when t1.e=t1.a then t1.c else c end else c end<=t1.f then t1.b when t1.c not in (a,19,c) then b else 17 end>=19) or d in (19,f, -11) then 19 else (select case min(t1.a)-(cast(avg(t1.f) AS integer))-(min(11)) when count(*) then count(*) else count(distinct a) end from t1) end FROM t1 WHERE not exists(select 1 from t1 where (abs(11-13)/abs(f))>19*~19+t1.d-t1.f+coalesce((select max(f) from t1 where t1.a-t1.e+case when case when a not between t1.c and 19 and -t1.e>t1.c then case when t1.f in (t1.d,e,t1.f) then d when c not in (11,t1.c,d) then t1.a else a end when t1.b=11 then t1.c else t1.e end>e then e else e end-11t1.f} -} {1} -do_test randexpr-2.1827 { - db eval {SELECT case when ( -(select ~ -~ -(max(c))-min(t1.e) | count(distinct (11)) | min(t1.a) from t1)-case when case d when a then case when t1.e=t1.a then t1.c else c end else c end<=t1.f then t1.b when t1.c not in (a,19,c) then b else 17 end>=19) or d in (19,f, -11) then 19 else (select case min(t1.a)-(cast(avg(t1.f) AS integer))-(min(11)) when count(*) then count(*) else count(distinct a) end from t1) end FROM t1 WHERE NOT (not exists(select 1 from t1 where (abs(11-13)/abs(f))>19*~19+t1.d-t1.f+coalesce((select max(f) from t1 where t1.a-t1.e+case when case when a not between t1.c and 19 and -t1.e>t1.c then case when t1.f in (t1.d,e,t1.f) then d when c not in (11,t1.c,d) then t1.a else a end when t1.b=11 then t1.c else t1.e end>e then e else e end-11t1.f)} -} {} -do_test randexpr-2.1828 { - db eval {SELECT case when ( -(select ~ -~ -(max(c))-min(t1.e) & count(distinct (11)) & min(t1.a) from t1)-case when case d when a then case when t1.e=t1.a then t1.c else c end else c end<=t1.f then t1.b when t1.c not in (a,19,c) then b else 17 end>=19) or d in (19,f, -11) then 19 else (select case min(t1.a)-(cast(avg(t1.f) AS integer))-(min(11)) when count(*) then count(*) else count(distinct a) end from t1) end FROM t1 WHERE not exists(select 1 from t1 where (abs(11-13)/abs(f))>19*~19+t1.d-t1.f+coalesce((select max(f) from t1 where t1.a-t1.e+case when case when a not between t1.c and 19 and -t1.e>t1.c then case when t1.f in (t1.d,e,t1.f) then d when c not in (11,t1.c,d) then t1.a else a end when t1.b=11 then t1.c else t1.e end>e then e else e end-11t1.f} -} {1} -do_test randexpr-2.1829 { - db eval {SELECT t1.e | t1.a*~(17)-t1.c*f*f-coalesce((select max( -t1.a+coalesce((select t1.a from t1 where 19 not between 17 and f),(t1.b))*c+11) from t1 where 19 in (select -cast(avg(f) AS integer)-cast(avg(a) AS integer)*count(distinct d) from t1 union select count(*) from t1) and t1.d in (17,t1.d, -t1.c) or 19<>19),a)*11 FROM t1 WHERE not +19+coalesce((select -19 from t1 where t1.c | e in (select ~ -abs(case ~abs(+(count(distinct 17) | case ~(max(t1.a))+(+~ -min(17)) when abs(min(t1.c)) then count(distinct 17) else -cast(avg(t1.e) AS integer) end)*cast(avg(c) AS integer)*cast(avg(t1.b) AS integer)) when count(distinct t1.d) then min(b) else -cast(avg(d) AS integer) end) from t1 union select count(*) from t1)),13)>13} -} {} -do_test randexpr-2.1830 { - db eval {SELECT t1.e | t1.a*~(17)-t1.c*f*f-coalesce((select max( -t1.a+coalesce((select t1.a from t1 where 19 not between 17 and f),(t1.b))*c+11) from t1 where 19 in (select -cast(avg(f) AS integer)-cast(avg(a) AS integer)*count(distinct d) from t1 union select count(*) from t1) and t1.d in (17,t1.d, -t1.c) or 19<>19),a)*11 FROM t1 WHERE NOT (not +19+coalesce((select -19 from t1 where t1.c | e in (select ~ -abs(case ~abs(+(count(distinct 17) | case ~(max(t1.a))+(+~ -min(17)) when abs(min(t1.c)) then count(distinct 17) else -cast(avg(t1.e) AS integer) end)*cast(avg(c) AS integer)*cast(avg(t1.b) AS integer)) when count(distinct t1.d) then min(b) else -cast(avg(d) AS integer) end) from t1 union select count(*) from t1)),13)>13)} -} {-108002820} -do_test randexpr-2.1831 { - db eval {SELECT t1.e & t1.a*~(17)-t1.c*f*f-coalesce((select max( -t1.a+coalesce((select t1.a from t1 where 19 not between 17 and f),(t1.b))*c+11) from t1 where 19 in (select -cast(avg(f) AS integer)-cast(avg(a) AS integer)*count(distinct d) from t1 union select count(*) from t1) and t1.d in (17,t1.d, -t1.c) or 19<>19),a)*11 FROM t1 WHERE NOT (not +19+coalesce((select -19 from t1 where t1.c | e in (select ~ -abs(case ~abs(+(count(distinct 17) | case ~(max(t1.a))+(+~ -min(17)) when abs(min(t1.c)) then count(distinct 17) else -cast(avg(t1.e) AS integer) end)*cast(avg(c) AS integer)*cast(avg(t1.b) AS integer)) when count(distinct t1.d) then min(b) else -cast(avg(d) AS integer) end) from t1 union select count(*) from t1)),13)>13)} -} {420} -do_test randexpr-2.1832 { - db eval {SELECT case when t1.a<(abs((abs(13)/abs(case t1.e+11*17*case +case case when ~19>=t1.c then f when f not in (a,e,d) then 19 else b end when 19 then 19 else b end | -c when c then t1.c else c end*d-t1.e when e then 13 else c end)))/abs(t1.b)) then 17 when t1.b not in (t1.a,13,e) then e else -t1.c end FROM t1 WHERE 19>=11} -} {500} -do_test randexpr-2.1833 { - db eval {SELECT case when t1.a<(abs((abs(13)/abs(case t1.e+11*17*case +case case when ~19>=t1.c then f when f not in (a,e,d) then 19 else b end when 19 then 19 else b end | -c when c then t1.c else c end*d-t1.e when e then 13 else c end)))/abs(t1.b)) then 17 when t1.b not in (t1.a,13,e) then e else -t1.c end FROM t1 WHERE NOT (19>=11)} -} {} -do_test randexpr-2.1834 { - db eval {SELECT case when t1.a<(abs((abs(13)/abs(case t1.e+11*17*case +case case when ~19>=t1.c then f when f not in (a,e,d) then 19 else b end when 19 then 19 else b end & -c when c then t1.c else c end*d-t1.e when e then 13 else c end)))/abs(t1.b)) then 17 when t1.b not in (t1.a,13,e) then e else -t1.c end FROM t1 WHERE 19>=11} -} {500} -do_test randexpr-2.1835 { - db eval {SELECT coalesce((select (select count(*)-+count(*) from t1) from t1 where +t1.f+t1.f<~case when exists(select 1 from t1 where coalesce((select t1.a from t1 where b-19(11) then d else (c) end+e+t1.d),c) FROM t1 WHERE case when t1.f+(select min(t1.c+(abs(13+(abs(t1.e+d-11-e+d+c)/abs(t1.e))-c*t1.f)/abs(t1.b))) from t1)+f=d or t1.b not between t1.e and t1.a then 11-a when (13 in (13,19,19)) then t1.d else t1.b end(11) then d else (c) end+e+t1.d),c) FROM t1 WHERE NOT (case when t1.f+(select min(t1.c+(abs(13+(abs(t1.e+d-11-e+d+c)/abs(t1.e))-c*t1.f)/abs(t1.b))) from t1)+f=d or t1.b not between t1.e and t1.a then 11-a when (13 in (13,19,19)) then t1.d else t1.b end=t1.b)),((d))) and t1.c then 19 else 13 end FROM t1 WHERE d*a in (case when 19>t1.e then c | (select +~count(distinct t1.b)-++abs(min(11)+ -~min(t1.b)+ -(max(t1.d))-min(t1.b)-count(distinct t1.f)) | max(f) from t1) else a+t1.c end,t1.a+case 19 when (11*a)*t1.c then d else a end*t1.a-d,f)} -} {} -do_test randexpr-2.1838 { - db eval {SELECT case when not exists(select 1 from t1 where not exists(select 1 from t1 where (case when (abs(a)/abs(t1.f))=t1.b)),((d))) and t1.c then 19 else 13 end FROM t1 WHERE NOT (d*a in (case when 19>t1.e then c | (select +~count(distinct t1.b)-++abs(min(11)+ -~min(t1.b)+ -(max(t1.d))-min(t1.b)-count(distinct t1.f)) | max(f) from t1) else a+t1.c end,t1.a+case 19 when (11*a)*t1.c then d else a end*t1.a-d,f))} -} {-14} -do_test randexpr-2.1839 { - db eval {SELECT case when b<= -coalesce((select max(t1.b+t1.c+a*a-t1.c-e) from t1 where not 11>e or c<=17 and b<=b), -t1.d)+13 and 17 not between a and c and not exists(select 1 from t1 where f not between t1.d and t1.e and t1.d between 13 and -t1.a) then t1.b when e not in (a,t1.f, -t1.d) then t1.c else e end FROM t1 WHERE not coalesce((select max((c)) from t1 where d* -coalesce((select max(coalesce((select t1.d from t1 where (d<=d)),d)) from t1 where (abs(case 11 when (select -+count(distinct 13)*min(c) | count(*) from t1) then 11 else case when (19 between (19) and 17 or t1.c in (c,19,d)) then c when -t1.e>=c then c else c end end*11)/abs((13))) not in (17, -t1.e, -t1.e)),t1.e)=17),t1.c) between 13 and t1.f} -} {} -do_test randexpr-2.1840 { - db eval {SELECT case when b<= -coalesce((select max(t1.b+t1.c+a*a-t1.c-e) from t1 where not 11>e or c<=17 and b<=b), -t1.d)+13 and 17 not between a and c and not exists(select 1 from t1 where f not between t1.d and t1.e and t1.d between 13 and -t1.a) then t1.b when e not in (a,t1.f, -t1.d) then t1.c else e end FROM t1 WHERE NOT (not coalesce((select max((c)) from t1 where d* -coalesce((select max(coalesce((select t1.d from t1 where (d<=d)),d)) from t1 where (abs(case 11 when (select -+count(distinct 13)*min(c) | count(*) from t1) then 11 else case when (19 between (19) and 17 or t1.c in (c,19,d)) then c when -t1.e>=c then c else c end end*11)/abs((13))) not in (17, -t1.e, -t1.e)),t1.e)=17),t1.c) between 13 and t1.f)} -} {300} -do_test randexpr-2.1841 { - db eval {SELECT 17 | -(case when (a) not between 11 and case (abs(~(abs(13-case (abs(17)/abs(19+e | t1.e)) when (t1.d) then -(t1.c) else t1.f end+t1.f*t1.c)/abs(a)))/abs(17)) when 19 then d else t1.d end then 17 when not exists(select 1 from t1 where t1.e not in (t1.b,t1.b,b) or a between a and 17) then 11 else b end) | t1.e FROM t1 WHERE 17>=e} -} {} -do_test randexpr-2.1842 { - db eval {SELECT 17 | -(case when (a) not between 11 and case (abs(~(abs(13-case (abs(17)/abs(19+e | t1.e)) when (t1.d) then -(t1.c) else t1.f end+t1.f*t1.c)/abs(a)))/abs(17)) when 19 then d else t1.d end then 17 when not exists(select 1 from t1 where t1.e not in (t1.b,t1.b,b) or a between a and 17) then 11 else b end) | t1.e FROM t1 WHERE NOT (17>=e)} -} {-3} -do_test randexpr-2.1843 { - db eval {SELECT 17 & -(case when (a) not between 11 and case (abs(~(abs(13-case (abs(17)/abs(19+e & t1.e)) when (t1.d) then -(t1.c) else t1.f end+t1.f*t1.c)/abs(a)))/abs(17)) when 19 then d else t1.d end then 17 when not exists(select 1 from t1 where t1.e not in (t1.b,t1.b,b) or a between a and 17) then 11 else b end) & t1.e FROM t1 WHERE NOT (17>=e)} -} {16} -do_test randexpr-2.1844 { - db eval {SELECT (abs(11 | t1.e)/abs(case 13 when 17*+t1.a+d*+d then ~ -17*+ - -case f when b then a-b else t1.d end-f+t1.f+17 else t1.a end)) FROM t1 WHERE t1.f<>17} -} {5} -do_test randexpr-2.1845 { - db eval {SELECT (abs(11 | t1.e)/abs(case 13 when 17*+t1.a+d*+d then ~ -17*+ - -case f when b then a-b else t1.d end-f+t1.f+17 else t1.a end)) FROM t1 WHERE NOT (t1.f<>17)} -} {} -do_test randexpr-2.1846 { - db eval {SELECT (abs(11 & t1.e)/abs(case 13 when 17*+t1.a+d*+d then ~ -17*+ - -case f when b then a-b else t1.d end-f+t1.f+17 else t1.a end)) FROM t1 WHERE t1.f<>17} -} {0} -do_test randexpr-2.1847 { - db eval {SELECT case when not coalesce((select max(case 11 when case d when coalesce((select f from t1 where case when (t1.d) | case 11 when t1.d then 11 else (t1.a) end | t1.b in (e,c,(11)) then 17 when c between e and f then t1.e else t1.a end>t1.e),t1.d) then 13 else c end then c else c end) from t1 where t1.e not between (a) and (t1.d)),c) not in ((11),((19)),a) then (t1.c) else (c) end FROM t1 WHERE t1.d-t1.c>=13} -} {300} -do_test randexpr-2.1848 { - db eval {SELECT case when not coalesce((select max(case 11 when case d when coalesce((select f from t1 where case when (t1.d) | case 11 when t1.d then 11 else (t1.a) end | t1.b in (e,c,(11)) then 17 when c between e and f then t1.e else t1.a end>t1.e),t1.d) then 13 else c end then c else c end) from t1 where t1.e not between (a) and (t1.d)),c) not in ((11),((19)),a) then (t1.c) else (c) end FROM t1 WHERE NOT (t1.d-t1.c>=13)} -} {} -do_test randexpr-2.1849 { - db eval {SELECT case when not coalesce((select max(case 11 when case d when coalesce((select f from t1 where case when (t1.d) & case 11 when t1.d then 11 else (t1.a) end & t1.b in (e,c,(11)) then 17 when c between e and f then t1.e else t1.a end>t1.e),t1.d) then 13 else c end then c else c end) from t1 where t1.e not between (a) and (t1.d)),c) not in ((11),((19)),a) then (t1.c) else (c) end FROM t1 WHERE t1.d-t1.c>=13} -} {300} -do_test randexpr-2.1850 { - db eval {SELECT (select case count(distinct ~case when (abs(coalesce((select t1.e from t1 where (not exists(select 1 from t1 where a | e between c and coalesce((select (t1.d) from t1 where (t1.a=t1.a)), -(c))))),b+19))/abs(d))>11 then b else t1.d end) when count(distinct 17) then ~min((t1.d))-case -(case -cast(avg(t1.b) AS integer) when -max(13) then (min(t1.d)) else count(distinct t1.b) end+(min(t1.e)))*(cast(avg( -17) AS integer)) when -count(distinct 19) then count(*) else max(t1.c) end else count(distinct f) end from t1) FROM t1 WHERE t1.e=t1.d} -} {} -do_test randexpr-2.1851 { - db eval {SELECT (select case count(distinct ~case when (abs(coalesce((select t1.e from t1 where (not exists(select 1 from t1 where a | e between c and coalesce((select (t1.d) from t1 where (t1.a=t1.a)), -(c))))),b+19))/abs(d))>11 then b else t1.d end) when count(distinct 17) then ~min((t1.d))-case -(case -cast(avg(t1.b) AS integer) when -max(13) then (min(t1.d)) else count(distinct t1.b) end+(min(t1.e)))*(cast(avg( -17) AS integer)) when -count(distinct 19) then count(*) else max(t1.c) end else count(distinct f) end from t1) FROM t1 WHERE NOT (t1.e=t1.d)} -} {-701} -do_test randexpr-2.1852 { - db eval {SELECT (select case count(distinct ~case when (abs(coalesce((select t1.e from t1 where (not exists(select 1 from t1 where a & e between c and coalesce((select (t1.d) from t1 where (t1.a=t1.a)), -(c))))),b+19))/abs(d))>11 then b else t1.d end) when count(distinct 17) then ~min((t1.d))-case -(case -cast(avg(t1.b) AS integer) when -max(13) then (min(t1.d)) else count(distinct t1.b) end+(min(t1.e)))*(cast(avg( -17) AS integer)) when -count(distinct 19) then count(*) else max(t1.c) end else count(distinct f) end from t1) FROM t1 WHERE NOT (t1.e=t1.d)} -} {-701} -do_test randexpr-2.1853 { - db eval {SELECT case when t1.d<>t1.a and a-t1.b-c in (13,t1.e-(abs(d)/abs(coalesce((select max(e) from t1 where 19 not between -b and 17),b))),t1.b) or (not exists(select 1 from t1 where t1.f not between -17 and a)) then case when e>t1.e then t1.d when t1.cf-11 and not not bt1.a and a-t1.b-c in (13,t1.e-(abs(d)/abs(coalesce((select max(e) from t1 where 19 not between -b and 17),b))),t1.b) or (not exists(select 1 from t1 where t1.f not between -17 and a)) then case when e>t1.e then t1.d when t1.cf-11 and not not bcoalesce((select d from t1 where not exists(select 1 from t1 where c*b in (t1.b*t1.d,t1.c,b) or c between d and a)),19)-t1.c*e) then coalesce((select f from t1 where 11 in (select c from t1 union select b from t1)),(c)) when 17<>t1.b then d else 19 end)) from t1 where f in (a,t1.f,t1.d)),(19)) else t1.e end FROM t1 WHERE not not exists(select 1 from t1 where (select abs(min(19-19))*count(*) | min(13)*min((a))+cast(avg(t1.e) AS integer)+(cast(avg(19) AS integer)) from t1) in (17,+(select min(b) from t1),(select cast(avg(f) AS integer) from t1)) and 11 in (select ( -(min(c))) from t1 union select (min(13)) from t1)) or t1.d between c and -(f) or not t1.c in (select min(e) from t1 union select -(max(e)) from t1) and t1.e in (t1.f,a,11) and f not between a and 17 and 19<=17 and 13 not in (b,t1.b,13)} -} {} -do_test randexpr-2.1856 { - db eval {SELECT ~case 17 when t1.c then coalesce((select max((case when not exists(select 1 from t1 where 11<>coalesce((select d from t1 where not exists(select 1 from t1 where c*b in (t1.b*t1.d,t1.c,b) or c between d and a)),19)-t1.c*e) then coalesce((select f from t1 where 11 in (select c from t1 union select b from t1)),(c)) when 17<>t1.b then d else 19 end)) from t1 where f in (a,t1.f,t1.d)),(19)) else t1.e end FROM t1 WHERE NOT (not not exists(select 1 from t1 where (select abs(min(19-19))*count(*) | min(13)*min((a))+cast(avg(t1.e) AS integer)+(cast(avg(19) AS integer)) from t1) in (17,+(select min(b) from t1),(select cast(avg(f) AS integer) from t1)) and 11 in (select ( -(min(c))) from t1 union select (min(13)) from t1)) or t1.d between c and -(f) or not t1.c in (select min(e) from t1 union select -(max(e)) from t1) and t1.e in (t1.f,a,11) and f not between a and 17 and 19<=17 and 13 not in (b,t1.b,13))} -} {-501} -do_test randexpr-2.1857 { - db eval {SELECT coalesce((select +f+coalesce((select case when b- -f*t1.d-t1.a>d and t1.e in (select b from t1 union select t1.d from t1) then 11 else -a end from t1 where (not (t1.f) not between 13 and t1.f)),11) from t1 where t1.c<=c and (d) between 11 and t1.b or b in (select d from t1 union select t1.e from t1) and 19<>t1.e or 19 not between a and a),19) FROM t1 WHERE t1.e<>(select cast(avg((b)*(select abs( -max(t1.f)) from t1)) AS integer) from t1)} -} {500} -do_test randexpr-2.1858 { - db eval {SELECT coalesce((select +f+coalesce((select case when b- -f*t1.d-t1.a>d and t1.e in (select b from t1 union select t1.d from t1) then 11 else -a end from t1 where (not (t1.f) not between 13 and t1.f)),11) from t1 where t1.c<=c and (d) between 11 and t1.b or b in (select d from t1 union select t1.e from t1) and 19<>t1.e or 19 not between a and a),19) FROM t1 WHERE NOT (t1.e<>(select cast(avg((b)*(select abs( -max(t1.f)) from t1)) AS integer) from t1))} -} {} -do_test randexpr-2.1859 { - db eval {SELECT coalesce((select max(coalesce((select (t1.f) from t1 where f in (select t1.f+(select case count(distinct 19) when count(*) then max(t1.d) else -count(*) end from t1) from t1 union select 13 from t1)),c)) from t1 where not exists(select 1 from t1 where coalesce((select (select +count(*) | ~(~ -count(distinct -13)) from t1) from t1 where case when d*~f-13<>((d)) then 19 else t1.a end not between d and t1.e),t1.f) | t1.d in (select t1.d from t1 union select t1.d from t1))),13) FROM t1 WHERE b= -~case f-t1.a | ~case coalesce((select max(t1.b) from t1 where b>t1.e or t1.d=17-(abs(coalesce((select 17 from t1 where 17 between c and c),a)-c+a)/abs(t1.f))-c and d not in (17,19,c)),c) when 11 then e else t1.d end | t1.c-d when t1.c then c else e end | a} -} {} -do_test randexpr-2.1860 { - db eval {SELECT coalesce((select max(coalesce((select (t1.f) from t1 where f in (select t1.f+(select case count(distinct 19) when count(*) then max(t1.d) else -count(*) end from t1) from t1 union select 13 from t1)),c)) from t1 where not exists(select 1 from t1 where coalesce((select (select +count(*) | ~(~ -count(distinct -13)) from t1) from t1 where case when d*~f-13<>((d)) then 19 else t1.a end not between d and t1.e),t1.f) | t1.d in (select t1.d from t1 union select t1.d from t1))),13) FROM t1 WHERE NOT (b= -~case f-t1.a | ~case coalesce((select max(t1.b) from t1 where b>t1.e or t1.d=17-(abs(coalesce((select 17 from t1 where 17 between c and c),a)-c+a)/abs(t1.f))-c and d not in (17,19,c)),c) when 11 then e else t1.d end | t1.c-d when t1.c then c else e end | a)} -} {300} -do_test randexpr-2.1861 { - db eval {SELECT coalesce((select max(coalesce((select (t1.f) from t1 where f in (select t1.f+(select case count(distinct 19) when count(*) then max(t1.d) else -count(*) end from t1) from t1 union select 13 from t1)),c)) from t1 where not exists(select 1 from t1 where coalesce((select (select +count(*) & ~(~ -count(distinct -13)) from t1) from t1 where case when d*~f-13<>((d)) then 19 else t1.a end not between d and t1.e),t1.f) & t1.d in (select t1.d from t1 union select t1.d from t1))),13) FROM t1 WHERE NOT (b= -~case f-t1.a | ~case coalesce((select max(t1.b) from t1 where b>t1.e or t1.d=17-(abs(coalesce((select 17 from t1 where 17 between c and c),a)-c+a)/abs(t1.f))-c and d not in (17,19,c)),c) when 11 then e else t1.d end | t1.c-d when t1.c then c else e end | a)} -} {300} -do_test randexpr-2.1862 { - db eval {SELECT coalesce((select max(( -17-case when t1.c-13<+11 | (t1.a)-e then 13*t1.a when coalesce((select 11 from t1 where t1.a>t1.c),17)+f+t1.a not between 13 and e then t1.f else c end)) from t1 where exists(select 1 from t1 where (19>=t1.f)) and f in (select max(13) from t1 union select count(*) from t1) and (19)>=t1.f),d) FROM t1 WHERE t1.f in (select 19 from t1 union select -17*11+t1.d from t1)} -} {} -do_test randexpr-2.1863 { - db eval {SELECT coalesce((select max(( -17-case when t1.c-13<+11 | (t1.a)-e then 13*t1.a when coalesce((select 11 from t1 where t1.a>t1.c),17)+f+t1.a not between 13 and e then t1.f else c end)) from t1 where exists(select 1 from t1 where (19>=t1.f)) and f in (select max(13) from t1 union select count(*) from t1) and (19)>=t1.f),d) FROM t1 WHERE NOT (t1.f in (select 19 from t1 union select -17*11+t1.d from t1))} -} {400} -do_test randexpr-2.1864 { - db eval {SELECT coalesce((select max(( -17-case when t1.c-13<+11 & (t1.a)-e then 13*t1.a when coalesce((select 11 from t1 where t1.a>t1.c),17)+f+t1.a not between 13 and e then t1.f else c end)) from t1 where exists(select 1 from t1 where (19>=t1.f)) and f in (select max(13) from t1 union select count(*) from t1) and (19)>=t1.f),d) FROM t1 WHERE NOT (t1.f in (select 19 from t1 union select -17*11+t1.d from t1))} -} {400} -do_test randexpr-2.1865 { - db eval {SELECT (t1.a)+c*case when not b in (select 11 from t1 union select 13 from t1) and a=case when not exists(select 1 from t1 where exists(select 1 from t1 where ~+( -(17)) | t1.d>=b)) then case t1.d when c then 19 else t1.c end*a else d end-a then e when b not between f and d and t1.b>=11 or not (t1.e>=b) and 11<=17 then 13 else t1.d end FROM t1 WHERE b in (e | 19,t1.c,case 17 when 19 then +(case when 19> -coalesce((select max(a) from t1 where t1.a not in (case e when t1.d then (c)-c else 11 end | (11)-c*t1.f,e,t1.f)),13) then t1.e else t1.e end)*e else 13 end-19+ - -t1.d* -b) or -t1.e>b} -} {} -do_test randexpr-2.1866 { - db eval {SELECT (t1.a)+c*case when not b in (select 11 from t1 union select 13 from t1) and a=case when not exists(select 1 from t1 where exists(select 1 from t1 where ~+( -(17)) | t1.d>=b)) then case t1.d when c then 19 else t1.c end*a else d end-a then e when b not between f and d and t1.b>=11 or not (t1.e>=b) and 11<=17 then 13 else t1.d end FROM t1 WHERE NOT (b in (e | 19,t1.c,case 17 when 19 then +(case when 19> -coalesce((select max(a) from t1 where t1.a not in (case e when t1.d then (c)-c else 11 end | (11)-c*t1.f,e,t1.f)),13) then t1.e else t1.e end)*e else 13 end-19+ - -t1.d* -b) or -t1.e>b)} -} {4000} -do_test randexpr-2.1867 { - db eval {SELECT (t1.a)+c*case when not b in (select 11 from t1 union select 13 from t1) and a=case when not exists(select 1 from t1 where exists(select 1 from t1 where ~+( -(17)) & t1.d>=b)) then case t1.d when c then 19 else t1.c end*a else d end-a then e when b not between f and d and t1.b>=11 or not (t1.e>=b) and 11<=17 then 13 else t1.d end FROM t1 WHERE NOT (b in (e | 19,t1.c,case 17 when 19 then +(case when 19> -coalesce((select max(a) from t1 where t1.a not in (case e when t1.d then (c)-c else 11 end | (11)-c*t1.f,e,t1.f)),13) then t1.e else t1.e end)*e else 13 end-19+ - -t1.d* -b) or -t1.e>b)} -} {4000} -do_test randexpr-2.1868 { - db eval {SELECT case when b | case when 13 between ~coalesce((select 19 from t1 where b in (select max(a*17) from t1 union select cast(avg( -19) AS integer)+abs(cast(avg(a) AS integer)) from t1)),17) and 11 then a when not exists(select 1 from t1 where not exists(select 1 from t1 where 19<=e)) and d in (select 17 from t1 union select 17 from t1) then -b else a end-a in (select max(t1.c) from t1 union select min(e) | count(*)+count(*) from t1) then t1.b when not (not 19<=t1.b) then 13 else a end-b FROM t1 WHERE +~+13>=t1.c} -} {} -do_test randexpr-2.1869 { - db eval {SELECT case when b | case when 13 between ~coalesce((select 19 from t1 where b in (select max(a*17) from t1 union select cast(avg( -19) AS integer)+abs(cast(avg(a) AS integer)) from t1)),17) and 11 then a when not exists(select 1 from t1 where not exists(select 1 from t1 where 19<=e)) and d in (select 17 from t1 union select 17 from t1) then -b else a end-a in (select max(t1.c) from t1 union select min(e) | count(*)+count(*) from t1) then t1.b when not (not 19<=t1.b) then 13 else a end-b FROM t1 WHERE NOT (+~+13>=t1.c)} -} {-187} -do_test randexpr-2.1870 { - db eval {SELECT case when b & case when 13 between ~coalesce((select 19 from t1 where b in (select max(a*17) from t1 union select cast(avg( -19) AS integer)+abs(cast(avg(a) AS integer)) from t1)),17) and 11 then a when not exists(select 1 from t1 where not exists(select 1 from t1 where 19<=e)) and d in (select 17 from t1 union select 17 from t1) then -b else a end-a in (select max(t1.c) from t1 union select min(e) & count(*)+count(*) from t1) then t1.b when not (not 19<=t1.b) then 13 else a end-b FROM t1 WHERE NOT (+~+13>=t1.c)} -} {0} -do_test randexpr-2.1871 { - db eval {SELECT coalesce((select case when t1.d in (select min(f) from t1 union select ~ -count(*) from t1) then d else 13 end from t1 where 19<=case when 13>=+17-c+(select count(*)-min(11) from t1)+t1.f*t1.e*c*t1.d then c else t1.b end),t1.c | +t1.e) FROM t1 WHERE a between (abs(coalesce((select max(case when (t1.d+a*coalesce((select d-13 from t1 where a<=19),t1.f))>= -c then c else 13 end) from t1 where f>=d or t1.a>t1.d),t1.a))/abs(t1.f)) and 19 and 13=t1.e and not exists(select 1 from t1 where 13 in (select -( -count(distinct (a))) | -cast(avg(t1.c) AS integer) from t1 union select (min(t1.c)) from t1) or t1.f not between t1.c and t1.c)} -} {} -do_test randexpr-2.1872 { - db eval {SELECT coalesce((select case when t1.d in (select min(f) from t1 union select ~ -count(*) from t1) then d else 13 end from t1 where 19<=case when 13>=+17-c+(select count(*)-min(11) from t1)+t1.f*t1.e*c*t1.d then c else t1.b end),t1.c | +t1.e) FROM t1 WHERE NOT (a between (abs(coalesce((select max(case when (t1.d+a*coalesce((select d-13 from t1 where a<=19),t1.f))>= -c then c else 13 end) from t1 where f>=d or t1.a>t1.d),t1.a))/abs(t1.f)) and 19 and 13=t1.e and not exists(select 1 from t1 where 13 in (select -( -count(distinct (a))) | -cast(avg(t1.c) AS integer) from t1 union select (min(t1.c)) from t1) or t1.f not between t1.c and t1.c))} -} {13} -do_test randexpr-2.1873 { - db eval {SELECT coalesce((select case when t1.d in (select min(f) from t1 union select ~ -count(*) from t1) then d else 13 end from t1 where 19<=case when 13>=+17-c+(select count(*)-min(11) from t1)+t1.f*t1.e*c*t1.d then c else t1.b end),t1.c & +t1.e) FROM t1 WHERE NOT (a between (abs(coalesce((select max(case when (t1.d+a*coalesce((select d-13 from t1 where a<=19),t1.f))>= -c then c else 13 end) from t1 where f>=d or t1.a>t1.d),t1.a))/abs(t1.f)) and 19 and 13=t1.e and not exists(select 1 from t1 where 13 in (select -( -count(distinct (a))) | -cast(avg(t1.c) AS integer) from t1 union select (min(t1.c)) from t1) or t1.f not between t1.c and t1.c))} -} {13} -do_test randexpr-2.1874 { - db eval {SELECT coalesce((select max(f) from t1 where coalesce((select max(+(select cast(avg(t1.d) AS integer) from t1)*19) from t1 where (abs(t1.d*t1.c)/abs(f))+t1.e> -t1.d*t1.e-a),13-case +coalesce((select max(t1.c) from t1 where d<=d and - -t1.a<=(t1.f) or f<>19 and 17<19),(t1.c)) | c*t1.f*b when t1.a then 19 else (b) end)>=a),t1.f) FROM t1 WHERE (~c-13*case when case when a+19-c in (select case count(distinct c)-case cast(avg(t1.a) AS integer) when max( -b) then cast(avg(t1.f) AS integer) else cast(avg((t1.d)) AS integer) end when min(b) then cast(avg(b) AS integer) else count(*) end from t1 union select max(t1.f) from t1) and 17 between (t1.b) and c and 19>t1.d or 19 in (t1.f,t1.a,(b)) then a else t1.e end in (13,t1.a,b) then 17 else t1.e end*t1.d+a+t1.b+t1.f) -t1.d*t1.e-a),13-case +coalesce((select max(t1.c) from t1 where d<=d and - -t1.a<=(t1.f) or f<>19 and 17<19),(t1.c)) | c*t1.f*b when t1.a then 19 else (b) end)>=a),t1.f) FROM t1 WHERE NOT ((~c-13*case when case when a+19-c in (select case count(distinct c)-case cast(avg(t1.a) AS integer) when max( -b) then cast(avg(t1.f) AS integer) else cast(avg((t1.d)) AS integer) end when min(b) then cast(avg(b) AS integer) else count(*) end from t1 union select max(t1.f) from t1) and 17 between (t1.b) and c and 19>t1.d or 19 in (t1.f,t1.a,(b)) then a else t1.e end in (13,t1.a,b) then 17 else t1.e end*t1.d+a+t1.b+t1.f) -t1.d*t1.e-a),13-case +coalesce((select max(t1.c) from t1 where d<=d and - -t1.a<=(t1.f) or f<>19 and 17<19),(t1.c)) & c*t1.f*b when t1.a then 19 else (b) end)>=a),t1.f) FROM t1 WHERE (~c-13*case when case when a+19-c in (select case count(distinct c)-case cast(avg(t1.a) AS integer) when max( -b) then cast(avg(t1.f) AS integer) else cast(avg((t1.d)) AS integer) end when min(b) then cast(avg(b) AS integer) else count(*) end from t1 union select max(t1.f) from t1) and 17 between (t1.b) and c and 19>t1.d or 19 in (t1.f,t1.a,(b)) then a else t1.e end in (13,t1.a,b) then 17 else t1.e end*t1.d+a+t1.b+t1.f) -b then a else f end then t1.e else f end FROM t1 WHERE t1.f-~coalesce((select 17 from t1 where (e+ -case when (d -b then a else f end then t1.e else f end FROM t1 WHERE NOT (t1.f-~coalesce((select 17 from t1 where (e+ -case when (d -b then a else f end then t1.e else f end FROM t1 WHERE t1.f-~coalesce((select 17 from t1 where (e+ -case when (d19) then case when f in (11,11,d) then t1.e when t1.a<=19 then a else e end else -t1.e end from t1) then e when t1.c=t1.b then 19 else e end when f then 19 else c end) | d-c and a} -} {} -do_test randexpr-2.1881 { - db eval {SELECT -(17-case (select max(a)+min( -(abs(t1.c-t1.a | t1.e- -t1.b+19*t1.c)/abs(c)))+ -case min(a) when count(distinct -a) then count(distinct 19) else count(*) end-count(distinct t1.e)*(max(t1.a))-(count(distinct 19)) from t1) when (select count(*) from t1) then b else t1.d end*11)-11* -c FROM t1 WHERE NOT (f between (case case when +(f) in (select t1.f from t1 union select case when t1.b in ((abs(19)/abs(11)),f,c) and (d) in (select -count(distinct b)*count(*) from t1 union select count(distinct -13) from t1) or (t1.e>19) then case when f in (11,11,d) then t1.e when t1.a<=19 then a else e end else -t1.e end from t1) then e when t1.c=t1.b then 19 else e end when f then 19 else c end) | d-c and a)} -} {7683} -do_test randexpr-2.1882 { - db eval {SELECT -(17-case (select max(a)+min( -(abs(t1.c-t1.a & t1.e- -t1.b+19*t1.c)/abs(c)))+ -case min(a) when count(distinct -a) then count(distinct 19) else count(*) end-count(distinct t1.e)*(max(t1.a))-(count(distinct 19)) from t1) when (select count(*) from t1) then b else t1.d end*11)-11* -c FROM t1 WHERE NOT (f between (case case when +(f) in (select t1.f from t1 union select case when t1.b in ((abs(19)/abs(11)),f,c) and (d) in (select -count(distinct b)*count(*) from t1 union select count(distinct -13) from t1) or (t1.e>19) then case when f in (11,11,d) then t1.e when t1.a<=19 then a else e end else -t1.e end from t1) then e when t1.c=t1.b then 19 else e end when f then 19 else c end) | d-c and a)} -} {7683} -do_test randexpr-2.1883 { - db eval {SELECT (case coalesce((select +a from t1 where exists(select 1 from t1 where t1.e not between t1.f-b and (select count(*) from t1)-t1.f | e)),t1.d+case when t1.b not between t1.d and 17+case when a in (t1.d,a,(abs(~case when (t1.f)<=t1.c then -17 else t1.f end)/abs(19))*d*t1.d) then (b) else a end then 11 else f end+(t1.a)) when f then 17 else t1.e end) FROM t1 WHERE a-e*case t1.d+case c when (abs(~t1.d*(select min(case when not exists(select 1 from t1 where ((d)+(19) between 11 and 19)) then 11+13 when e not in (t1.f,17,e) and t1.c<>a then t1.e else 19 end*t1.a-f) from t1))/abs(b)) then 13 else 17 end when t1.f then (f) else t1.c enda then t1.e else 19 end*t1.a-f) from t1))/abs(b)) then 13 else 17 end when t1.f then (f) else t1.c enda then t1.e else 19 end*t1.a-f) from t1))/abs(b)) then 13 else 17 end when t1.f then (f) else t1.c end(13) | -11 and c>f),19)+t1.c) AS integer)-(~case cast(avg(t1.f) AS integer)*abs(max(b)+(count(*))+count(distinct b)) when min(c) then cast(avg(t1.b) AS integer) else count(*) end) from t1) in (select t1.e from t1 union select t1.c from t1) then f when d=(c)),b)) when max(d) then ( -max(c))+((min(11)))+max(t1.c) else max(t1.a) end from t1)-e+t1.b-(b)-11-t1.d*t1.c<>t1.c)} -} {} -do_test randexpr-2.1890 { - db eval {SELECT (abs(b)/abs((select max(c) from t1)))+case when (select +cast(avg(17 | ~coalesce((select e from t1 where t1.b>(13) | -11 and c>f),19)+t1.c) AS integer)-(~case cast(avg(t1.f) AS integer)*abs(max(b)+(count(*))+count(distinct b)) when min(c) then cast(avg(t1.b) AS integer) else count(*) end) from t1) in (select t1.e from t1 union select t1.c from t1) then f when d=(c)),b)) when max(d) then ( -max(c))+((min(11)))+max(t1.c) else max(t1.a) end from t1)-e+t1.b-(b)-11-t1.d*t1.c<>t1.c))} -} {500} -do_test randexpr-2.1891 { - db eval {SELECT (abs(b)/abs((select max(c) from t1)))+case when (select +cast(avg(17 & ~coalesce((select e from t1 where t1.b>(13) & -11 and c>f),19)+t1.c) AS integer)-(~case cast(avg(t1.f) AS integer)*abs(max(b)+(count(*))+count(distinct b)) when min(c) then cast(avg(t1.b) AS integer) else count(*) end) from t1) in (select t1.e from t1 union select t1.c from t1) then f when d=(c)),b)) when max(d) then ( -max(c))+((min(11)))+max(t1.c) else max(t1.a) end from t1)-e+t1.b-(b)-11-t1.d*t1.c<>t1.c))} -} {500} -do_test randexpr-2.1892 { - db eval {SELECT coalesce((select max(case 13 when +coalesce((select max(c) from t1 where t1.a+f in (t1.b,t1.b,(abs(19)/abs(+17+~(abs(t1.a+f)/abs(~t1.c))+case when not exists(select 1 from t1 where coalesce((select max(e) from t1 where (b)> -t1.a),c)=t1.b) then 19 else b end))-f)),t1.a)+a then f else 17 end*t1.e) from t1 where 13<>t1.f),t1.f) FROM t1 WHERE not exists(select 1 from t1 where coalesce((select max(case when 13 not in (t1.b,b,t1.c) then t1.c | t1.a else 13-19+a+t1.e-t1.e end+t1.a*17+( -d)-17 | t1.c-t1.a | 19+b) from t1 where not a=e),11) in (select 17 from t1 union select c from t1) or t1.c>=t1.e)} -} {8500} -do_test randexpr-2.1893 { - db eval {SELECT coalesce((select max(case 13 when +coalesce((select max(c) from t1 where t1.a+f in (t1.b,t1.b,(abs(19)/abs(+17+~(abs(t1.a+f)/abs(~t1.c))+case when not exists(select 1 from t1 where coalesce((select max(e) from t1 where (b)> -t1.a),c)=t1.b) then 19 else b end))-f)),t1.a)+a then f else 17 end*t1.e) from t1 where 13<>t1.f),t1.f) FROM t1 WHERE NOT (not exists(select 1 from t1 where coalesce((select max(case when 13 not in (t1.b,b,t1.c) then t1.c | t1.a else 13-19+a+t1.e-t1.e end+t1.a*17+( -d)-17 | t1.c-t1.a | 19+b) from t1 where not a=e),11) in (select 17 from t1 union select c from t1) or t1.c>=t1.e))} -} {} -do_test randexpr-2.1894 { - db eval {SELECT t1.f++c*coalesce((select +t1.f from t1 where a<~13),case when exists(select 1 from t1 where not exists(select 1 from t1 where 17 in (select 11 from t1 union select (17) from t1))) then b else + -19 | coalesce((select case when (select cast(avg(a) AS integer) from t1)>e then case when (11=(e) and 17=t1.a then -c else 19 end-f) from t1 where not exists(select 1 from t1 where d in (select -~count(distinct 11)+max(t1.a) from t1 union select count(distinct e)* -count(distinct t1.b) from t1)) or (ce then case when (11=(e) and 17=t1.a then -c else 19 end-f) from t1 where not exists(select 1 from t1 where d in (select -~count(distinct 11)+max(t1.a) from t1 union select count(distinct e)* -count(distinct t1.b) from t1)) or (ce then case when (11=(e) and 17=t1.a then -c else 19 end-f) from t1 where not exists(select 1 from t1 where d in (select -~count(distinct 11)+max(t1.a) from t1 union select count(distinct e)* -count(distinct t1.b) from t1)) or (c=t1.c then f else t1.f end-f) from t1) FROM t1 WHERE (~ -t1.c in (select d from t1 union select t1.c*case when (17 in (+case c when t1.f then t1.c else c+e+t1.c*e+coalesce((select max((c)) from t1 where (t1.e)>a),19)-t1.e end | e-t1.b,t1.d,c)) then d when t1.e in (select (max( -e)-~~count(*)) from t1 union select count(*) from t1) then d else t1.f end from t1))} -} {} -do_test randexpr-2.1898 { - db eval {SELECT (select + -min(case when case when exists(select 1 from t1 where a<=c or coalesce((select max(11) from t1 where d=17),19)*11<=f and t1.e in (select t1.c from t1 union select a from t1)) then (f)-d when a=t1.c then f else t1.f end-f) from t1) FROM t1 WHERE NOT ((~ -t1.c in (select d from t1 union select t1.c*case when (17 in (+case c when t1.f then t1.c else c+e+t1.c*e+coalesce((select max((c)) from t1 where (t1.e)>a),19)-t1.e end | e-t1.b,t1.d,c)) then d when t1.e in (select (max( -e)-~~count(*)) from t1 union select count(*) from t1) then d else t1.f end from t1)))} -} {0} -do_test randexpr-2.1899 { - db eval {SELECT ~+t1.f-coalesce((select t1.f from t1 where case when t1.d>=t1.f then b else case c when 11 then t1.f*case when (select (count(*)) from t1)<>a+t1.b | +11-coalesce((select max(t1.f-a) from t1 where (f<=t1.c and t1.d=c)),d)-11 then b when (t1.c)<=t1.b then 19 else 11 end else c end end*19-13< - -b),e) FROM t1 WHERE (exists(select 1 from t1 where -t1.f not between ~17 and t1.a+(b+d+13)))} -} {-1101} -do_test randexpr-2.1900 { - db eval {SELECT ~+t1.f-coalesce((select t1.f from t1 where case when t1.d>=t1.f then b else case c when 11 then t1.f*case when (select (count(*)) from t1)<>a+t1.b | +11-coalesce((select max(t1.f-a) from t1 where (f<=t1.c and t1.d=c)),d)-11 then b when (t1.c)<=t1.b then 19 else 11 end else c end end*19-13< - -b),e) FROM t1 WHERE NOT ((exists(select 1 from t1 where -t1.f not between ~17 and t1.a+(b+d+13))))} -} {} -do_test randexpr-2.1901 { - db eval {SELECT ~+t1.f-coalesce((select t1.f from t1 where case when t1.d>=t1.f then b else case c when 11 then t1.f*case when (select (count(*)) from t1)<>a+t1.b & +11-coalesce((select max(t1.f-a) from t1 where (f<=t1.c and t1.d=c)),d)-11 then b when (t1.c)<=t1.b then 19 else 11 end else c end end*19-13< - -b),e) FROM t1 WHERE (exists(select 1 from t1 where -t1.f not between ~17 and t1.a+(b+d+13)))} -} {-1101} -do_test randexpr-2.1902 { - db eval {SELECT -t1.e+coalesce((select (d) from t1 where t1.f=t1.f*(select +count(distinct case when (coalesce((select max(case when a in (select b+17 from t1 union select -17 from t1) then 19 when 17a),e)<>f or d not between (e) and b) then 11 else (abs(13)/abs( -(d))) end*t1.c) from t1)),e-f) FROM t1 WHERE ((case when t1.e+d*~coalesce((select coalesce((select max(b) from t1 where ~case when t1.f not between t1.c and coalesce((select t1.b from t1 where -t1.e in (select (( - -min(19))) from t1 union select count(distinct t1.d) from t1)),t1.d) then c when t1.f=e then t1.f else b end=13),13) from t1 where t1.e not between 13 and 11 or not exists(select 1 from t1 where t1.a not between (11) and d and 11>=a)),t1.f) in (select count(*) from t1 union select ~max( -13) from t1) then -13 else 17 end) | d in (a,d,13))} -} {} -do_test randexpr-2.1903 { - db eval {SELECT -t1.e+coalesce((select (d) from t1 where t1.f=t1.f*(select +count(distinct case when (coalesce((select max(case when a in (select b+17 from t1 union select -17 from t1) then 19 when 17a),e)<>f or d not between (e) and b) then 11 else (abs(13)/abs( -(d))) end*t1.c) from t1)),e-f) FROM t1 WHERE NOT (((case when t1.e+d*~coalesce((select coalesce((select max(b) from t1 where ~case when t1.f not between t1.c and coalesce((select t1.b from t1 where -t1.e in (select (( - -min(19))) from t1 union select count(distinct t1.d) from t1)),t1.d) then c when t1.f=e then t1.f else b end=13),13) from t1 where t1.e not between 13 and 11 or not exists(select 1 from t1 where t1.a not between (11) and d and 11>=a)),t1.f) in (select count(*) from t1 union select ~max( -13) from t1) then -13 else 17 end) | d in (a,d,13)))} -} {-100} -do_test randexpr-2.1904 { - db eval {SELECT -t1.e+coalesce((select (d) from t1 where t1.f=t1.f*(select +count(distinct case when (coalesce((select max(case when a in (select b+17 from t1 union select -17 from t1) then 19 when 17a),e)<>f or d not between (e) and b) then 11 else (abs(13)/abs( -(d))) end*t1.c) from t1)),e-f) FROM t1 WHERE NOT (((case when t1.e+d*~coalesce((select coalesce((select max(b) from t1 where ~case when t1.f not between t1.c and coalesce((select t1.b from t1 where -t1.e in (select (( - -min(19))) from t1 union select count(distinct t1.d) from t1)),t1.d) then c when t1.f=e then t1.f else b end=13),13) from t1 where t1.e not between 13 and 11 or not exists(select 1 from t1 where t1.a not between (11) and d and 11>=a)),t1.f) in (select count(*) from t1 union select ~max( -13) from t1) then -13 else 17 end) | d in (a,d,13)))} -} {-100} -do_test randexpr-2.1905 { - db eval {SELECT coalesce((select max((19)) from t1 where d* -a<=(select count(*) from t1)+19*19*a-e-d or b in (t1.c+ -t1.b,t1.a,b+t1.b)),d) FROM t1 WHERE exists(select 1 from t1 where exists(select 1 from t1 where not t1.e>e))} -} {19} -do_test randexpr-2.1906 { - db eval {SELECT coalesce((select max((19)) from t1 where d* -a<=(select count(*) from t1)+19*19*a-e-d or b in (t1.c+ -t1.b,t1.a,b+t1.b)),d) FROM t1 WHERE NOT (exists(select 1 from t1 where exists(select 1 from t1 where not t1.e>e)))} -} {} -do_test randexpr-2.1907 { - db eval {SELECT (select -~count(distinct (abs(11)/abs(f-17-+(select cast(avg(+(select count(*) from t1)) AS integer) from t1)))) from t1) FROM t1 WHERE (abs((a))/abs(t1.b))>(select count(distinct case case when 17 in (select -b-case when 17 in (select +(( - -max(t1.b))) from t1 union select max((t1.b)) from t1) then f when t1.e=(t1.d) then 17 else e end | e-t1.d | t1.c* -13*d*t1.b from t1 union select 11 from t1) then c when c>=a then 13 else 13 end+t1.b when -f then 19 else 13 end)*min(t1.f) from t1)-19-f} -} {2} -do_test randexpr-2.1908 { - db eval {SELECT (select -~count(distinct (abs(11)/abs(f-17-+(select cast(avg(+(select count(*) from t1)) AS integer) from t1)))) from t1) FROM t1 WHERE NOT ((abs((a))/abs(t1.b))>(select count(distinct case case when 17 in (select -b-case when 17 in (select +(( - -max(t1.b))) from t1 union select max((t1.b)) from t1) then f when t1.e=(t1.d) then 17 else e end | e-t1.d | t1.c* -13*d*t1.b from t1 union select 11 from t1) then c when c>=a then 13 else 13 end+t1.b when -f then 19 else 13 end)*min(t1.f) from t1)-19-f)} -} {} -do_test randexpr-2.1909 { - db eval {SELECT -(select cast(avg(coalesce((select max(f) from t1 where -case coalesce((select max(~c-case when exists(select 1 from t1 where -b in (~e,t1.e,t1.e)) then t1.e when (17 in (select ++ -(count(distinct t1.a)) from t1 union select (max( -f)) from t1)) then b else t1.f end) from t1 where (13 in (19,b,11))),t1.e) when c then (b) else 11 end-a*b*13=t1.e),13)) AS integer) from t1) FROM t1 WHERE exists(select 1 from t1 where case when not (case when ~17*d>=b then a when c*(abs((abs(f)/abs(t1.c)))/abs(t1.b))+d*t1.b<19 and not case 13 when a then 11 else -t1.e end<>f then 11 else c end+t1.d) not in (t1.c,t1.f,d) then (abs(c)/abs(t1.f)) else t1.a end*t1.f not between t1.d and c)} -} {-13} -do_test randexpr-2.1910 { - db eval {SELECT -(select cast(avg(coalesce((select max(f) from t1 where -case coalesce((select max(~c-case when exists(select 1 from t1 where -b in (~e,t1.e,t1.e)) then t1.e when (17 in (select ++ -(count(distinct t1.a)) from t1 union select (max( -f)) from t1)) then b else t1.f end) from t1 where (13 in (19,b,11))),t1.e) when c then (b) else 11 end-a*b*13=t1.e),13)) AS integer) from t1) FROM t1 WHERE NOT (exists(select 1 from t1 where case when not (case when ~17*d>=b then a when c*(abs((abs(f)/abs(t1.c)))/abs(t1.b))+d*t1.b<19 and not case 13 when a then 11 else -t1.e end<>f then 11 else c end+t1.d) not in (t1.c,t1.f,d) then (abs(c)/abs(t1.f)) else t1.a end*t1.f not between t1.d and c))} -} {} -do_test randexpr-2.1911 { - db eval {SELECT case t1.c when (select abs( -max(t1.a*t1.f*t1.a*e)) from t1)*case when not exists(select 1 from t1 where (select cast(avg(c) AS integer) from t1) in (select case case when ( -case t1.f when 17 then t1.c else e end=17) then 19 else e end when e then c else -a end*t1.d from t1 union select d from t1)) then e*t1.a else b end+e*t1.d+t1.b then t1.d else c end+t1.e FROM t1 WHERE 13 in (select +abs(case count(distinct t1.e+(abs((abs(coalesce((select t1.b from t1 where coalesce((select max(case when (19<=t1.d) then (13) when a>=13 then 13 else t1.f end) from t1 where a in (t1.c,19,t1.b)),19)>13),d))/abs(f))+t1.a*t1.b)/abs(e))) when +cast(avg(c) AS integer) then ~~+max(f) | cast(avg(t1.c) AS integer) else count(distinct 13)+min(t1.b) | count(*) end)*max(t1.d)-count(*) from t1 union select count(*) from t1)} -} {} -do_test randexpr-2.1912 { - db eval {SELECT case t1.c when (select abs( -max(t1.a*t1.f*t1.a*e)) from t1)*case when not exists(select 1 from t1 where (select cast(avg(c) AS integer) from t1) in (select case case when ( -case t1.f when 17 then t1.c else e end=17) then 19 else e end when e then c else -a end*t1.d from t1 union select d from t1)) then e*t1.a else b end+e*t1.d+t1.b then t1.d else c end+t1.e FROM t1 WHERE NOT (13 in (select +abs(case count(distinct t1.e+(abs((abs(coalesce((select t1.b from t1 where coalesce((select max(case when (19<=t1.d) then (13) when a>=13 then 13 else t1.f end) from t1 where a in (t1.c,19,t1.b)),19)>13),d))/abs(f))+t1.a*t1.b)/abs(e))) when +cast(avg(c) AS integer) then ~~+max(f) | cast(avg(t1.c) AS integer) else count(distinct 13)+min(t1.b) | count(*) end)*max(t1.d)-count(*) from t1 union select count(*) from t1))} -} {800} -do_test randexpr-2.1913 { - db eval {SELECT case when f in (d, -case when (case 11 when (select max(t1.d) from t1) then (abs(a)/abs(+t1.b)) else ~b end<19) then (abs( -(abs(17)/abs(t1.f)))/abs((select count(*) from t1))) when (f) not between coalesce((select 13 from t1 where t1.a<=case t1.a when 13 then -t1.c else 13 end and 13 not between t1.f and 11),11) and 19 then e else b end,t1.d) then b else t1.b end FROM t1 WHERE t1.f between f and a-c-t1.d-t1.d+t1.d*case when exists(select 1 from t1 where d between (select ~cast(avg(17) AS integer) from t1) and a) then case when case b when f then 13 else b end19),t1.b)) or ((t1.a>19)) or e<>19 then -t1.e else -13 end-b+t1.d else a end then 19 when d between b and t1.c then t1.e else e end)/abs(t1.a)) FROM t1 WHERE b | t1.b>b-case when a-f in (select 17 from t1 union select coalesce((select coalesce((select t1.e+t1.a+d+d from t1 where 13 not between t1.e+19 and 13),(select count(distinct t1.e) from t1)*11) from t1 where b not in (b,(t1.f),t1.a)),13) from t1) then b else c end+a-13-13*(13) | 11} -} {0} -do_test randexpr-2.1916 { - db eval {SELECT (abs(case when 11<=case 17 when t1.d then t1.b+~19-~case when not t1.b not in (t1.a,b,coalesce((select a+(a) from t1 where t1.b>19),t1.b)) or ((t1.a>19)) or e<>19 then -t1.e else -13 end-b+t1.d else a end then 19 when d between b and t1.c then t1.e else e end)/abs(t1.a)) FROM t1 WHERE NOT (b | t1.b>b-case when a-f in (select 17 from t1 union select coalesce((select coalesce((select t1.e+t1.a+d+d from t1 where 13 not between t1.e+19 and 13),(select count(distinct t1.e) from t1)*11) from t1 where b not in (b,(t1.f),t1.a)),13) from t1) then b else c end+a-13-13*(13) | 11)} -} {} -do_test randexpr-2.1917 { - db eval {SELECT -t1.a | coalesce((select t1.f*(select min(f)+min(( -(select -case (min(13)) when -abs(min(t1.b)) then count(distinct a) else count(*) end from t1)*(select - -count(*) from t1)))* -count(*) from t1) from t1 where t1.d in (select case case when t1.a<(f) then c else 19 end when f then b else -c end*a*t1.c from t1 union select t1.b from t1)),b) | a FROM t1 WHERE +19*case when exists(select 1 from t1 where e<+13 | f or t1.d=19) then t1.a when case when exists(select 1 from t1 where t1.c in (select 11 from t1 union select c from t1)) then 13*t1.e else 19 end<=c and (t1.e between (b) and 13) or 11 not between t1.f and 13 or 17 between b and 13 then t1.e+a else 17 end not between b and d or t1.e not between 13 and 17} -} {-4} -do_test randexpr-2.1918 { - db eval {SELECT -t1.a | coalesce((select t1.f*(select min(f)+min(( -(select -case (min(13)) when -abs(min(t1.b)) then count(distinct a) else count(*) end from t1)*(select - -count(*) from t1)))* -count(*) from t1) from t1 where t1.d in (select case case when t1.a<(f) then c else 19 end when f then b else -c end*a*t1.c from t1 union select t1.b from t1)),b) | a FROM t1 WHERE NOT (+19*case when exists(select 1 from t1 where e<+13 | f or t1.d=19) then t1.a when case when exists(select 1 from t1 where t1.c in (select 11 from t1 union select c from t1)) then 13*t1.e else 19 end<=c and (t1.e between (b) and 13) or 11 not between t1.f and 13 or 17 between b and 13 then t1.e+a else 17 end not between b and d or t1.e not between 13 and 17)} -} {} -do_test randexpr-2.1919 { - db eval {SELECT -t1.a & coalesce((select t1.f*(select min(f)+min(( -(select -case (min(13)) when -abs(min(t1.b)) then count(distinct a) else count(*) end from t1)*(select - -count(*) from t1)))* -count(*) from t1) from t1 where t1.d in (select case case when t1.a<(f) then c else 19 end when f then b else -c end*a*t1.c from t1 union select t1.b from t1)),b) & a FROM t1 WHERE +19*case when exists(select 1 from t1 where e<+13 | f or t1.d=19) then t1.a when case when exists(select 1 from t1 where t1.c in (select 11 from t1 union select c from t1)) then 13*t1.e else 19 end<=c and (t1.e between (b) and 13) or 11 not between t1.f and 13 or 17 between b and 13 then t1.e+a else 17 end not between b and d or t1.e not between 13 and 17} -} {0} -do_test randexpr-2.1920 { - db eval {SELECT (select -case +count(distinct case when -+ -~case when ((t1.e)) not between e and f then e when t1.b between -11 and t1.b then d else t1.a end*19 in (select t1.f from t1 union select t1.d from t1) then t1.b when a in (select -19 from t1 union select c from t1) then a else f end) when +~ -(count(*)) then -( -count(distinct t1.e))-count(distinct c) else max(t1.c) end-count(distinct t1.c)-count(distinct 19)-(max(11)) from t1) FROM t1 WHERE -~coalesce((select max(19*t1.b) from t1 where t1.d in (select max( -coalesce((select max(t1.c) from t1 where case 13 when f+ -13+t1.b-case 13 when t1.a | (abs(t1.a)/abs(t1.f)) then 11 else f end then f else 17 end in (b,t1.d,(e))),13)) from t1 union select ~~min(b)*abs(cast(avg(b) AS integer)) from t1)),e)*((t1.d))<>t1.d} -} {-313} -do_test randexpr-2.1921 { - db eval {SELECT (select -case +count(distinct case when -+ -~case when ((t1.e)) not between e and f then e when t1.b between -11 and t1.b then d else t1.a end*19 in (select t1.f from t1 union select t1.d from t1) then t1.b when a in (select -19 from t1 union select c from t1) then a else f end) when +~ -(count(*)) then -( -count(distinct t1.e))-count(distinct c) else max(t1.c) end-count(distinct t1.c)-count(distinct 19)-(max(11)) from t1) FROM t1 WHERE NOT ( -~coalesce((select max(19*t1.b) from t1 where t1.d in (select max( -coalesce((select max(t1.c) from t1 where case 13 when f+ -13+t1.b-case 13 when t1.a | (abs(t1.a)/abs(t1.f)) then 11 else f end then f else 17 end in (b,t1.d,(e))),13)) from t1 union select ~~min(b)*abs(cast(avg(b) AS integer)) from t1)),e)*((t1.d))<>t1.d)} -} {} -do_test randexpr-2.1922 { - db eval {SELECT case a when c then (abs((select abs(~(+~~case max(t1.d) when +count(distinct ~d | (select case max(17) when count(*) then count(distinct (t1.c)) else count(distinct 11) end from t1)) then (+cast(avg((17)) AS integer))+count(*) else -(( - -(cast(avg(c) AS integer)))) end)+count(distinct t1.e)+min(13)) from t1)*+11-((abs(t1.a)/abs(coalesce((select c from t1 where ((t1.f<>d))),(t1.c))))) | t1.d)/abs( -(d))) else a end FROM t1 WHERE coalesce((select max(case t1.a when +t1.e then case when t1.c+(select (max(t1.d))-max(13)+cast(avg(c) AS integer)+min((e)) | max(a) from t1)<= -t1.a | case when not exists(select 1 from t1 where -t1.d<=t1.a) then t1.f when 11=c then a else 13 end | t1.c else t1.a end) from t1 where 19<=e and t1.e between t1.d and 11),13) not in (e,a,c)} -} {100} -do_test randexpr-2.1923 { - db eval {SELECT case a when c then (abs((select abs(~(+~~case max(t1.d) when +count(distinct ~d | (select case max(17) when count(*) then count(distinct (t1.c)) else count(distinct 11) end from t1)) then (+cast(avg((17)) AS integer))+count(*) else -(( - -(cast(avg(c) AS integer)))) end)+count(distinct t1.e)+min(13)) from t1)*+11-((abs(t1.a)/abs(coalesce((select c from t1 where ((t1.f<>d))),(t1.c))))) | t1.d)/abs( -(d))) else a end FROM t1 WHERE NOT (coalesce((select max(case t1.a when +t1.e then case when t1.c+(select (max(t1.d))-max(13)+cast(avg(c) AS integer)+min((e)) | max(a) from t1)<= -t1.a | case when not exists(select 1 from t1 where -t1.d<=t1.a) then t1.f when 11=c then a else 13 end | t1.c else t1.a end) from t1 where 19<=e and t1.e between t1.d and 11),13) not in (e,a,c))} -} {} -do_test randexpr-2.1924 { - db eval {SELECT case a when c then (abs((select abs(~(+~~case max(t1.d) when +count(distinct ~d & (select case max(17) when count(*) then count(distinct (t1.c)) else count(distinct 11) end from t1)) then (+cast(avg((17)) AS integer))+count(*) else -(( - -(cast(avg(c) AS integer)))) end)+count(distinct t1.e)+min(13)) from t1)*+11-((abs(t1.a)/abs(coalesce((select c from t1 where ((t1.f<>d))),(t1.c))))) & t1.d)/abs( -(d))) else a end FROM t1 WHERE coalesce((select max(case t1.a when +t1.e then case when t1.c+(select (max(t1.d))-max(13)+cast(avg(c) AS integer)+min((e)) | max(a) from t1)<= -t1.a | case when not exists(select 1 from t1 where -t1.d<=t1.a) then t1.f when 11=c then a else 13 end | t1.c else t1.a end) from t1 where 19<=e and t1.e between t1.d and 11),13) not in (e,a,c)} -} {100} -do_test randexpr-2.1925 { - db eval {SELECT t1.d-+case ~(select ~+~count(distinct case when case when case when 11 not between t1.c and t1.a-e then t1.d else e end*d-(d) between -13 and e then a else c end in (select b from t1 union select 17 from t1) then a else 13 end)*cast(avg(d) AS integer) from t1) when t1.e then (abs(11)/abs(coalesce((select max(19) from t1 where (a)<>t1.e),19))) else t1.c end+t1.c FROM t1 WHERE 19 not in (t1.a*+case when -c+~t1.a-t1.c in (t1.a,b*case t1.a | coalesce((select max(coalesce((select 17 from t1 where t1.e>t1.a),t1.d)) from t1 where not 11=19),17) when 11 then t1.d else (f) end*b-t1.a+c, -b) then d when a<>f then a else b end-c,d,t1.b)} -} {400} -do_test randexpr-2.1926 { - db eval {SELECT t1.d-+case ~(select ~+~count(distinct case when case when case when 11 not between t1.c and t1.a-e then t1.d else e end*d-(d) between -13 and e then a else c end in (select b from t1 union select 17 from t1) then a else 13 end)*cast(avg(d) AS integer) from t1) when t1.e then (abs(11)/abs(coalesce((select max(19) from t1 where (a)<>t1.e),19))) else t1.c end+t1.c FROM t1 WHERE NOT (19 not in (t1.a*+case when -c+~t1.a-t1.c in (t1.a,b*case t1.a | coalesce((select max(coalesce((select 17 from t1 where t1.e>t1.a),t1.d)) from t1 where not 11=19),17) when 11 then t1.d else (f) end*b-t1.a+c, -b) then d when a<>f then a else b end-c,d,t1.b))} -} {} -do_test randexpr-2.1927 { - db eval {SELECT case when case (select +min(~ -11+f*~b) | case abs(cast(avg(t1.f) AS integer))*~min(c) when count(*)+max( -11) then abs(count(*)) else max(13) end from t1) when coalesce((select max(coalesce((select max(19) from t1 where (17>=17)),t1.f)) from t1 where ct1.a then -d else -t1.b end FROM t1 WHERE t1.a+b-t1.c*17>=c} -} {} -do_test randexpr-2.1928 { - db eval {SELECT case when case (select +min(~ -11+f*~b) | case abs(cast(avg(t1.f) AS integer))*~min(c) when count(*)+max( -11) then abs(count(*)) else max(13) end from t1) when coalesce((select max(coalesce((select max(19) from t1 where (17>=17)),t1.f)) from t1 where ct1.a then -d else -t1.b end FROM t1 WHERE NOT (t1.a+b-t1.c*17>=c)} -} {-400} -do_test randexpr-2.1929 { - db eval {SELECT case when case (select +min(~ -11+f*~b) & case abs(cast(avg(t1.f) AS integer))*~min(c) when count(*)+max( -11) then abs(count(*)) else max(13) end from t1) when coalesce((select max(coalesce((select max(19) from t1 where (17>=17)),t1.f)) from t1 where ct1.a then -d else -t1.b end FROM t1 WHERE NOT (t1.a+b-t1.c*17>=c)} -} {-400} -do_test randexpr-2.1930 { - db eval {SELECT case when ~case when t1.f>11*t1.a then f when case when (t1.c*19<(t1.f)) then (e) when at1.e and a in (d,t1.c,13) then t1.b when -17 not between f and d then f else t1.c end FROM t1 WHERE c in (select + -min(case (select count(*) from t1) when t1.a then t1.c else coalesce((select max(b) from t1 where d in (select -abs(cast(avg(t1.b) AS integer)) | (min(t1.f)) | count(distinct a)+abs(cast(avg(b) AS integer))*( -min(b)) | cast(avg(t1.c) AS integer)*((min(t1.e))) from t1 union select cast(avg(f) AS integer) from t1)),t1.e) | +case b when -t1.c then (select (count(*)) from t1) else b end | 13 end) from t1 union select min(t1.d) from t1)} -} {} -do_test randexpr-2.1931 { - db eval {SELECT case when ~case when t1.f>11*t1.a then f when case when (t1.c*19<(t1.f)) then (e) when at1.e and a in (d,t1.c,13) then t1.b when -17 not between f and d then f else t1.c end FROM t1 WHERE NOT (c in (select + -min(case (select count(*) from t1) when t1.a then t1.c else coalesce((select max(b) from t1 where d in (select -abs(cast(avg(t1.b) AS integer)) | (min(t1.f)) | count(distinct a)+abs(cast(avg(b) AS integer))*( -min(b)) | cast(avg(t1.c) AS integer)*((min(t1.e))) from t1 union select cast(avg(f) AS integer) from t1)),t1.e) | +case b when -t1.c then (select (count(*)) from t1) else b end | 13 end) from t1 union select min(t1.d) from t1))} -} {600} -do_test randexpr-2.1932 { - db eval {SELECT case when (b) between 19 and case when t1.a* -t1.d+t1.a-t1.d-b-a<=d then t1.c when not exists(select 1 from t1 where (13>t1.e) and ((a>a))) and -(13)>t1.b then t1.d else 11 end or d=e then 13+t1.f when ( -a) not between t1.e and t1.b then (c) else t1.e end+t1.a+17 FROM t1 WHERE (case when a<=f+t1.a | f then t1.c*a-coalesce((select max( -e) from t1 where t1.a=t1.d),b)*d- -f else t1.b end) in (select min(t1.f)+~max(b) | count(distinct t1.d)*+ - -case (count(*)) when +count(distinct e) then count(*) else -cast(avg(d) AS integer) end from t1 union select count(*) from t1) and d between 11 and t1.a} -} {} -do_test randexpr-2.1933 { - db eval {SELECT case when (b) between 19 and case when t1.a* -t1.d+t1.a-t1.d-b-a<=d then t1.c when not exists(select 1 from t1 where (13>t1.e) and ((a>a))) and -(13)>t1.b then t1.d else 11 end or d=e then 13+t1.f when ( -a) not between t1.e and t1.b then (c) else t1.e end+t1.a+17 FROM t1 WHERE NOT ((case when a<=f+t1.a | f then t1.c*a-coalesce((select max( -e) from t1 where t1.a=t1.d),b)*d- -f else t1.b end) in (select min(t1.f)+~max(b) | count(distinct t1.d)*+ - -case (count(*)) when +count(distinct e) then count(*) else -cast(avg(d) AS integer) end from t1 union select count(*) from t1) and d between 11 and t1.a)} -} {730} -do_test randexpr-2.1934 { - db eval {SELECT +f*19*~~ -t1.c-13-case when t1.b in (select +case when not exists(select 1 from t1 where (((abs((abs((select count(*)*(count(distinct t1.d)) from t1))/abs(b)))/abs(e))*(e))>=d)) then f when t1.a=f then b else t1.e end+19 | (17) from t1 union select t1.b from t1) or -ee and t1.e<=t1.b} -} {} -do_test randexpr-2.1935 { - db eval {SELECT +f*19*~~ -t1.c-13-case when t1.b in (select +case when not exists(select 1 from t1 where (((abs((abs((select count(*)*(count(distinct t1.d)) from t1))/abs(b)))/abs(e))*(e))>=d)) then f when t1.a=f then b else t1.e end+19 | (17) from t1 union select t1.b from t1) or -ee and t1.e<=t1.b)} -} {-3420224} -do_test randexpr-2.1936 { - db eval {SELECT +f*19*~~ -t1.c-13-case when t1.b in (select +case when not exists(select 1 from t1 where (((abs((abs((select count(*)*(count(distinct t1.d)) from t1))/abs(b)))/abs(e))*(e))>=d)) then f when t1.a=f then b else t1.e end+19 & (17) from t1 union select t1.b from t1) or -ee and t1.e<=t1.b)} -} {-3420224} -do_test randexpr-2.1937 { - db eval {SELECT f-coalesce((select max(d+~+ - -(a)*(select min(t1.d) from t1)*t1.f+case when ( -13)*t1.e<>11 | -t1.e or c=11 then (t1.e) when -t1.d<=t1.b and (t1.f<>t1.c) then a else -t1.f end) from t1 where 11 not between t1.e and b),t1.f)-13 FROM t1 WHERE -a not in (17+~coalesce((select t1.a from t1 where (exists(select 1 from t1 where 11>c))),11)+17-11,11,t1.c) or f in (select case (min((t1.a))) when max(b) then min(13) else cast(avg(c) AS integer) end*max(d)*(case cast(avg(19) AS integer) when ( -min(19)) then count(*) else count(*) end) | -cast(avg(19) AS integer) from t1 union select cast(avg(b) AS integer) from t1) or t1.f>= -t1.d} -} {24239687} -do_test randexpr-2.1938 { - db eval {SELECT f-coalesce((select max(d+~+ - -(a)*(select min(t1.d) from t1)*t1.f+case when ( -13)*t1.e<>11 | -t1.e or c=11 then (t1.e) when -t1.d<=t1.b and (t1.f<>t1.c) then a else -t1.f end) from t1 where 11 not between t1.e and b),t1.f)-13 FROM t1 WHERE NOT ( -a not in (17+~coalesce((select t1.a from t1 where (exists(select 1 from t1 where 11>c))),11)+17-11,11,t1.c) or f in (select case (min((t1.a))) when max(b) then min(13) else cast(avg(c) AS integer) end*max(d)*(case cast(avg(19) AS integer) when ( -min(19)) then count(*) else count(*) end) | -cast(avg(19) AS integer) from t1 union select cast(avg(b) AS integer) from t1) or t1.f>= -t1.d)} -} {} -do_test randexpr-2.1939 { - db eval {SELECT f-coalesce((select max(d+~+ - -(a)*(select min(t1.d) from t1)*t1.f+case when ( -13)*t1.e<>11 & -t1.e or c=11 then (t1.e) when -t1.d<=t1.b and (t1.f<>t1.c) then a else -t1.f end) from t1 where 11 not between t1.e and b),t1.f)-13 FROM t1 WHERE -a not in (17+~coalesce((select t1.a from t1 where (exists(select 1 from t1 where 11>c))),11)+17-11,11,t1.c) or f in (select case (min((t1.a))) when max(b) then min(13) else cast(avg(c) AS integer) end*max(d)*(case cast(avg(19) AS integer) when ( -min(19)) then count(*) else count(*) end) | -cast(avg(19) AS integer) from t1 union select cast(avg(b) AS integer) from t1) or t1.f>= -t1.d} -} {24239687} -do_test randexpr-2.1940 { - db eval {SELECT ~case when ~coalesce((select max(f) from t1 where b | (select +max(13) from t1)+t1.b<~13*t1.d*coalesce((select -t1.b from t1 where coalesce((select t1.e+a from t1 where 11=17),a) between 19 and e),17)*d),t1.b) in (select cast(avg(t1.d) AS integer) from t1 union select ~count(distinct 11) from t1) then 11 when t1.d>=t1.b then 13 else f end-t1.e FROM t1 WHERE not exists(select 1 from t1 where coalesce((select case t1.b when -t1.c then c-17 else case f when (abs(case when ((13*case -e when case when b>c and 11>11 then -a when -(t1.c)>t1.e then d else t1.d end then t1.d else t1.e end<=11)) then ~t1.b+f when (d)<=c then t1.a else (t1.a) end+b)/abs(b)) then -b else 11 end end-19 from t1 where t1.e<=t1.b),a)>t1.a)} -} {-514} -do_test randexpr-2.1941 { - db eval {SELECT ~case when ~coalesce((select max(f) from t1 where b | (select +max(13) from t1)+t1.b<~13*t1.d*coalesce((select -t1.b from t1 where coalesce((select t1.e+a from t1 where 11=17),a) between 19 and e),17)*d),t1.b) in (select cast(avg(t1.d) AS integer) from t1 union select ~count(distinct 11) from t1) then 11 when t1.d>=t1.b then 13 else f end-t1.e FROM t1 WHERE NOT (not exists(select 1 from t1 where coalesce((select case t1.b when -t1.c then c-17 else case f when (abs(case when ((13*case -e when case when b>c and 11>11 then -a when -(t1.c)>t1.e then d else t1.d end then t1.d else t1.e end<=11)) then ~t1.b+f when (d)<=c then t1.a else (t1.a) end+b)/abs(b)) then -b else 11 end end-19 from t1 where t1.e<=t1.b),a)>t1.a))} -} {} -do_test randexpr-2.1942 { - db eval {SELECT ~case when ~coalesce((select max(f) from t1 where b & (select +max(13) from t1)+t1.b<~13*t1.d*coalesce((select -t1.b from t1 where coalesce((select t1.e+a from t1 where 11=17),a) between 19 and e),17)*d),t1.b) in (select cast(avg(t1.d) AS integer) from t1 union select ~count(distinct 11) from t1) then 11 when t1.d>=t1.b then 13 else f end-t1.e FROM t1 WHERE not exists(select 1 from t1 where coalesce((select case t1.b when -t1.c then c-17 else case f when (abs(case when ((13*case -e when case when b>c and 11>11 then -a when -(t1.c)>t1.e then d else t1.d end then t1.d else t1.e end<=11)) then ~t1.b+f when (d)<=c then t1.a else (t1.a) end+b)/abs(b)) then -b else 11 end end-19 from t1 where t1.e<=t1.b),a)>t1.a)} -} {-514} -do_test randexpr-2.1943 { - db eval {SELECT +(case when (not exists(select 1 from t1 where t1.c in (select +(abs(a)/abs( -coalesce((select max(17) from t1 where (not (c>=t1.d and t1.c>=f) and t1.e>e)),19-17))) from t1 union select case when (b)>d then d when c not in (f,t1.b,t1.d) then t1.f else t1.d end from t1) or a not in (t1.d,a, -b))) and exists(select 1 from t1 where b<11) then c when t1.c not between e and -19 then t1.b else ~c end) FROM t1 WHERE t1.e*f-a- -13-b= -d} -} {} -do_test randexpr-2.1944 { - db eval {SELECT +(case when (not exists(select 1 from t1 where t1.c in (select +(abs(a)/abs( -coalesce((select max(17) from t1 where (not (c>=t1.d and t1.c>=f) and t1.e>e)),19-17))) from t1 union select case when (b)>d then d when c not in (f,t1.b,t1.d) then t1.f else t1.d end from t1) or a not in (t1.d,a, -b))) and exists(select 1 from t1 where b<11) then c when t1.c not between e and -19 then t1.b else ~c end) FROM t1 WHERE NOT (t1.e*f-a- -13-b= -d)} -} {200} -do_test randexpr-2.1945 { - db eval {SELECT b-case when a not between t1.f and case when t1.d in (select count(*) from t1 union select cast(avg(coalesce((select +11*t1.e from t1 where e+bb and t1.d between c and b then t1.d else t1.d endb and t1.d between c and b then t1.d else t1.d endb and t1.d between c and b then t1.d else t1.d end=t1.d and 17<=13 or f between -t1.c and 11 then case d when t1.c then 13 else t1.e end when (11)>b then a else c end in (t1.e,a,b)} -} {} -do_test randexpr-2.1949 { - db eval {SELECT (select (min(coalesce((select max((case when t1.f=t1.d and 17<=13 or f between -t1.c and 11 then case d when t1.c then 13 else t1.e end when (11)>b then a else c end in (t1.e,a,b))} -} {582} -do_test randexpr-2.1950 { - db eval {SELECT coalesce((select max((abs(e)/abs(t1.a))) from t1 where (select (count(distinct ~ - -11- -t1.a-a*t1.d | 11-19+t1.f+17*c)-cast(avg(17) AS integer)+(cast(avg((19)) AS integer))) from t1)>a),17 | 11+17)+e-(c)-d-b FROM t1 WHERE (d>t1.d-case when case +(abs(t1.d | t1.f)/abs(t1.b)) when +b then coalesce((select max(t1.d | t1.c+(11+t1.d-t1.c)) from t1 where ((t1.e=17))),17) else t1.c end>=b then a else t1.f end) and (not (e<=c)) and not (t1.c<>b)} -} {} -do_test randexpr-2.1951 { - db eval {SELECT coalesce((select max((abs(e)/abs(t1.a))) from t1 where (select (count(distinct ~ - -11- -t1.a-a*t1.d | 11-19+t1.f+17*c)-cast(avg(17) AS integer)+(cast(avg((19)) AS integer))) from t1)>a),17 | 11+17)+e-(c)-d-b FROM t1 WHERE NOT ((d>t1.d-case when case +(abs(t1.d | t1.f)/abs(t1.b)) when +b then coalesce((select max(t1.d | t1.c+(11+t1.d-t1.c)) from t1 where ((t1.e=17))),17) else t1.c end>=b then a else t1.f end) and (not (e<=c)) and not (t1.c<>b))} -} {-371} -do_test randexpr-2.1952 { - db eval {SELECT coalesce((select max((abs(e)/abs(t1.a))) from t1 where (select (count(distinct ~ - -11- -t1.a-a*t1.d & 11-19+t1.f+17*c)-cast(avg(17) AS integer)+(cast(avg((19)) AS integer))) from t1)>a),17 & 11+17)+e-(c)-d-b FROM t1 WHERE NOT ((d>t1.d-case when case +(abs(t1.d | t1.f)/abs(t1.b)) when +b then coalesce((select max(t1.d | t1.c+(11+t1.d-t1.c)) from t1 where ((t1.e=17))),17) else t1.c end>=b then a else t1.f end) and (not (e<=c)) and not (t1.c<>b))} -} {-384} -do_test randexpr-2.1953 { - db eval {SELECT coalesce((select c from t1 where case b when t1.a*(17) | case b++b when e then d else t1.b+f end+a+t1.d then d else t1.b | +e end<+~(select (count(*)) from t1)),17) FROM t1 WHERE (b+t1.c*c in (11, -t1.f,t1.b))} -} {} -do_test randexpr-2.1954 { - db eval {SELECT coalesce((select c from t1 where case b when t1.a*(17) | case b++b when e then d else t1.b+f end+a+t1.d then d else t1.b | +e end<+~(select (count(*)) from t1)),17) FROM t1 WHERE NOT ((b+t1.c*c in (11, -t1.f,t1.b)))} -} {17} -do_test randexpr-2.1955 { - db eval {SELECT coalesce((select c from t1 where case b when t1.a*(17) & case b++b when e then d else t1.b+f end+a+t1.d then d else t1.b & +e end<+~(select (count(*)) from t1)),17) FROM t1 WHERE NOT ((b+t1.c*c in (11, -t1.f,t1.b)))} -} {17} -do_test randexpr-2.1956 { - db eval {SELECT case when coalesce((select max((abs(c)/abs(t1.d))) from t1 where t1.f*case when t1.a in (select (abs(17)/abs(c))*(t1.a) from t1 union select t1.e from t1) then t1.b else b end<19),e)+a-d in (select case max(t1.b)-count(distinct t1.c) when +case abs(cast(avg(t1.f) AS integer)) when +cast(avg(f) AS integer)-min(f) then count(distinct c) else cast(avg(d) AS integer) end then count(distinct t1.a) else cast(avg(b) AS integer) end from t1 union select count(distinct t1.e) from t1) then t1.c else f end FROM t1 WHERE ((19 in (t1.b,case t1.f when 11 then 11 else -+t1.b | 19 end+coalesce((select 11 from t1 where c<=t1.c* -e),f),t1.f)) or (b between t1.b and 17) or not exists(select 1 from t1 where -17 between -f and t1.e or (not b<>11) and 19 in (select 11 from t1 union select t1.b from t1))) or 13>(t1.e)} -} {} -do_test randexpr-2.1957 { - db eval {SELECT case when coalesce((select max((abs(c)/abs(t1.d))) from t1 where t1.f*case when t1.a in (select (abs(17)/abs(c))*(t1.a) from t1 union select t1.e from t1) then t1.b else b end<19),e)+a-d in (select case max(t1.b)-count(distinct t1.c) when +case abs(cast(avg(t1.f) AS integer)) when +cast(avg(f) AS integer)-min(f) then count(distinct c) else cast(avg(d) AS integer) end then count(distinct t1.a) else cast(avg(b) AS integer) end from t1 union select count(distinct t1.e) from t1) then t1.c else f end FROM t1 WHERE NOT (((19 in (t1.b,case t1.f when 11 then 11 else -+t1.b | 19 end+coalesce((select 11 from t1 where c<=t1.c* -e),f),t1.f)) or (b between t1.b and 17) or not exists(select 1 from t1 where -17 between -f and t1.e or (not b<>11) and 19 in (select 11 from t1 union select t1.b from t1))) or 13>(t1.e))} -} {300} -do_test randexpr-2.1958 { - db eval {SELECT f+case when e>+11+t1.e or ~t1.a=f+t1.e+t1.c then t1.a+case when b*coalesce((select max(a) from t1 where not exists(select 1 from t1 where (t1.f=case when exists(select 1 from t1 where t1.ff),11))<(e) then t1.e else 19 end+(c) else t1.a end*c-t1.c FROM t1 WHERE not ~coalesce((select max(t1.f*coalesce((select max(f) from t1 where case 17 when e*19 then case t1.a when 17 then f else t1.c+t1.d end | (e) else ~a end>=e or not t1.b in (select a from t1 union select d from t1)),19)) from t1 where e>coalesce((select 17 from t1 where not exists(select 1 from t1 where t1.c=t1.a)),case t1.b when t1.b then a else 19 end)),13)*t1.b not between t1.e and t1.e} -} {} -do_test randexpr-2.1959 { - db eval {SELECT f+case when e>+11+t1.e or ~t1.a=f+t1.e+t1.c then t1.a+case when b*coalesce((select max(a) from t1 where not exists(select 1 from t1 where (t1.f=case when exists(select 1 from t1 where t1.ff),11))<(e) then t1.e else 19 end+(c) else t1.a end*c-t1.c FROM t1 WHERE NOT (not ~coalesce((select max(t1.f*coalesce((select max(f) from t1 where case 17 when e*19 then case t1.a when 17 then f else t1.c+t1.d end | (e) else ~a end>=e or not t1.b in (select a from t1 union select d from t1)),19)) from t1 where e>coalesce((select 17 from t1 where not exists(select 1 from t1 where t1.c=t1.a)),case t1.b when t1.b then a else 19 end)),13)*t1.b not between t1.e and t1.e)} -} {30300} -do_test randexpr-2.1960 { - db eval {SELECT e*(select -max((case when -case when (+(abs(f)/abs(17))*13)> -a then 17 else f end | -t1.f-e*11<>11 then c when exists(select 1 from t1 where not exists(select 1 from t1 where t1.b not in (t1.d,19,d) and t1.d<>11)) or 13<= -t1.f then 11 else d end-t1.a)*e) from t1) FROM t1 WHERE exists(select 1 from t1 where c<>a)} -} {-50000000} -do_test randexpr-2.1961 { - db eval {SELECT e*(select -max((case when -case when (+(abs(f)/abs(17))*13)> -a then 17 else f end | -t1.f-e*11<>11 then c when exists(select 1 from t1 where not exists(select 1 from t1 where t1.b not in (t1.d,19,d) and t1.d<>11)) or 13<= -t1.f then 11 else d end-t1.a)*e) from t1) FROM t1 WHERE NOT (exists(select 1 from t1 where c<>a))} -} {} -do_test randexpr-2.1962 { - db eval {SELECT e*(select -max((case when -case when (+(abs(f)/abs(17))*13)> -a then 17 else f end & -t1.f-e*11<>11 then c when exists(select 1 from t1 where not exists(select 1 from t1 where t1.b not in (t1.d,19,d) and t1.d<>11)) or 13<= -t1.f then 11 else d end-t1.a)*e) from t1) FROM t1 WHERE exists(select 1 from t1 where c<>a)} -} {-50000000} -do_test randexpr-2.1963 { - db eval {SELECT a-t1.b | (case case when 13 in (t1.c,(t1.c),t1.e) then e+b when b in (select e from t1 union select d from t1) then (select count(distinct (abs(case when t1.e not between c and c then f else case t1.a when t1.c then e+t1.d else c end end)/abs(b))) from t1) else t1.b- -t1.d end when t1.c then 11 else e end- -a)+d-t1.b FROM t1 WHERE (case when f between f+(abs(coalesce((select t1.c*t1.c from t1 where f between 19 and (select count(distinct coalesce((select max(case case when t1.b<>t1.c then t1.d when 19t1.c then t1.d when 19t1.c then t1.d when 19 -case t1.f when +b-case when (17 in (select count(distinct b)+count(distinct t1.a) from t1 union select count(distinct 13) from t1)) then d else 13 end+t1.d | d* -11+t1.d*t1.f | a-17 then 13 else c end*t1.e),d) then t1.b else d end)/abs(t1.a))*19 FROM t1 WHERE t1.f in (select count(*) from t1 union select count(*) from t1)} -} {} -do_test randexpr-2.1967 { - db eval {SELECT (abs(case t1.f | d when coalesce((select max(~b) from t1 where +t1.a<> -case t1.f when +b-case when (17 in (select count(distinct b)+count(distinct t1.a) from t1 union select count(distinct 13) from t1)) then d else 13 end+t1.d | d* -11+t1.d*t1.f | a-17 then 13 else c end*t1.e),d) then t1.b else d end)/abs(t1.a))*19 FROM t1 WHERE NOT (t1.f in (select count(*) from t1 union select count(*) from t1))} -} {76} -do_test randexpr-2.1968 { - db eval {SELECT (abs(case t1.f & d when coalesce((select max(~b) from t1 where +t1.a<> -case t1.f when +b-case when (17 in (select count(distinct b)+count(distinct t1.a) from t1 union select count(distinct 13) from t1)) then d else 13 end+t1.d & d* -11+t1.d*t1.f & a-17 then 13 else c end*t1.e),d) then t1.b else d end)/abs(t1.a))*19 FROM t1 WHERE NOT (t1.f in (select count(*) from t1 union select count(*) from t1))} -} {76} -do_test randexpr-2.1969 { - db eval {SELECT t1.d+coalesce((select max(t1.b*t1.b | ~case a | c | t1.d when t1.c then t1.a else t1.e end | e-13*b) from t1 where -t1.a in (select e from t1 union select t1.b from t1) and not exists(select 1 from t1 where (a) in (select min(13)* -cast(avg(t1.e) AS integer)*~case count(*) when count(*) then ((cast(avg(e) AS integer))) else count(*) end | (min(t1.e)) | -count(*) from t1 union select max(t1.a) from t1))), -t1.b)+a FROM t1 WHERE not exists(select 1 from t1 where 11*d+a>=(t1.a-e+17*(select +cast(avg((select cast(avg((abs(case when (abs(t1.a)/abs(coalesce((select max(c+t1.e) from t1 where not exists(select 1 from t1 where 13 in (select -t1.c from t1 union select t1.f from t1))),17) | e*e)) not between e and t1.f then 19 else t1.b end)/abs(19))) AS integer)* -count(*) from t1)) AS integer)*count(distinct 11)-abs(cast(avg(b) AS integer)) from t1)))} -} {} -do_test randexpr-2.1970 { - db eval {SELECT t1.d+coalesce((select max(t1.b*t1.b | ~case a | c | t1.d when t1.c then t1.a else t1.e end | e-13*b) from t1 where -t1.a in (select e from t1 union select t1.b from t1) and not exists(select 1 from t1 where (a) in (select min(13)* -cast(avg(t1.e) AS integer)*~case count(*) when count(*) then ((cast(avg(e) AS integer))) else count(*) end | (min(t1.e)) | -count(*) from t1 union select max(t1.a) from t1))), -t1.b)+a FROM t1 WHERE NOT (not exists(select 1 from t1 where 11*d+a>=(t1.a-e+17*(select +cast(avg((select cast(avg((abs(case when (abs(t1.a)/abs(coalesce((select max(c+t1.e) from t1 where not exists(select 1 from t1 where 13 in (select -t1.c from t1 union select t1.f from t1))),17) | e*e)) not between e and t1.f then 19 else t1.b end)/abs(19))) AS integer)* -count(*) from t1)) AS integer)*count(distinct 11)-abs(cast(avg(b) AS integer)) from t1))))} -} {300} -do_test randexpr-2.1971 { - db eval {SELECT t1.d+coalesce((select max(t1.b*t1.b & ~case a & c & t1.d when t1.c then t1.a else t1.e end & e-13*b) from t1 where -t1.a in (select e from t1 union select t1.b from t1) and not exists(select 1 from t1 where (a) in (select min(13)* -cast(avg(t1.e) AS integer)*~case count(*) when count(*) then ((cast(avg(e) AS integer))) else count(*) end & (min(t1.e)) & -count(*) from t1 union select max(t1.a) from t1))), -t1.b)+a FROM t1 WHERE NOT (not exists(select 1 from t1 where 11*d+a>=(t1.a-e+17*(select +cast(avg((select cast(avg((abs(case when (abs(t1.a)/abs(coalesce((select max(c+t1.e) from t1 where not exists(select 1 from t1 where 13 in (select -t1.c from t1 union select t1.f from t1))),17) | e*e)) not between e and t1.f then 19 else t1.b end)/abs(19))) AS integer)* -count(*) from t1)) AS integer)*count(distinct 11)-abs(cast(avg(b) AS integer)) from t1))))} -} {300} -do_test randexpr-2.1972 { - db eval {SELECT ~case when case when +d+case b when 11 then coalesce((select max(b) from t1 where (((abs(f)/abs((abs(11)/abs(e))+t1.b))>t1.f))),(select max(t1.e) from t1)) else t1.f end*t1.f*17>=(t1.e) or 17>t1.f then t1.a else t1.a end in (c,13,c) then t1.f when t1.a not in (t1.d, -t1.b,a) then -t1.b else 11 end FROM t1 WHERE t1.a in (+e,17,11*13) and b not between t1.f*(abs(t1.c-((abs(t1.a | coalesce((select max(case when -f-t1.c<=t1.f then 19 when (t1.a)<>t1.f and 13 between a and t1.e then -11 else 17 end) from t1 where c>19),f)-t1.e)/abs(e))))/abs(b))-t1.e | (19) and -t1.a and t1.f in (select 13 from t1 union select a from t1)} -} {} -do_test randexpr-2.1973 { - db eval {SELECT ~case when case when +d+case b when 11 then coalesce((select max(b) from t1 where (((abs(f)/abs((abs(11)/abs(e))+t1.b))>t1.f))),(select max(t1.e) from t1)) else t1.f end*t1.f*17>=(t1.e) or 17>t1.f then t1.a else t1.a end in (c,13,c) then t1.f when t1.a not in (t1.d, -t1.b,a) then -t1.b else 11 end FROM t1 WHERE NOT (t1.a in (+e,17,11*13) and b not between t1.f*(abs(t1.c-((abs(t1.a | coalesce((select max(case when -f-t1.c<=t1.f then 19 when (t1.a)<>t1.f and 13 between a and t1.e then -11 else 17 end) from t1 where c>19),f)-t1.e)/abs(e))))/abs(b))-t1.e | (19) and -t1.a and t1.f in (select 13 from t1 union select a from t1))} -} {-12} -do_test randexpr-2.1974 { - db eval {SELECT case when case 17 when case when (abs(t1.c)/abs(t1.c | coalesce((select max(t1.d) from t1 where not t1.e<17 or 11 not in (t1.a,t1.c,a) or c=d and (t1.b)=t1.e and 17 in ( -t1.c,a,d) and t1.f not in (19,a,b)),11) | (select -max(+t1.b) from t1)+19-19 | f))<>t1.a or e>17 then f else a end then 11 else f end=t1.a then f else -t1.f end FROM t1 WHERE -t1.b+a>= -t1.a} -} {-600} -do_test randexpr-2.1975 { - db eval {SELECT case when case 17 when case when (abs(t1.c)/abs(t1.c | coalesce((select max(t1.d) from t1 where not t1.e<17 or 11 not in (t1.a,t1.c,a) or c=d and (t1.b)=t1.e and 17 in ( -t1.c,a,d) and t1.f not in (19,a,b)),11) | (select -max(+t1.b) from t1)+19-19 | f))<>t1.a or e>17 then f else a end then 11 else f end=t1.a then f else -t1.f end FROM t1 WHERE NOT ( -t1.b+a>= -t1.a)} -} {} -do_test randexpr-2.1976 { - db eval {SELECT (abs(coalesce((select ((t1.c)) from t1 where not exists(select 1 from t1 where t1.e*17<13*coalesce((select max(a) from t1 where 19 in (select max(e*11) from t1 union select cast(avg(t1.b) AS integer) from t1)),a | a))),case when f-13t1.e then t1.b else f end))/abs(17)) FROM t1 WHERE ((d not between -a and b))} -} {17} -do_test randexpr-2.1977 { - db eval {SELECT (abs(coalesce((select ((t1.c)) from t1 where not exists(select 1 from t1 where t1.e*17<13*coalesce((select max(a) from t1 where 19 in (select max(e*11) from t1 union select cast(avg(t1.b) AS integer) from t1)),a | a))),case when f-13t1.e then t1.b else f end))/abs(17)) FROM t1 WHERE NOT (((d not between -a and b)))} -} {} -do_test randexpr-2.1978 { - db eval {SELECT (abs(coalesce((select ((t1.c)) from t1 where not exists(select 1 from t1 where t1.e*17<13*coalesce((select max(a) from t1 where 19 in (select max(e*11) from t1 union select cast(avg(t1.b) AS integer) from t1)),a & a))),case when f-13t1.e then t1.b else f end))/abs(17)) FROM t1 WHERE ((d not between -a and b))} -} {17} -do_test randexpr-2.1979 { - db eval {SELECT case f when (d)-case when coalesce((select max(coalesce((select 11 from t1 where case when (t1.f<=17 or exists(select 1 from t1 where 11 | d in (select (abs(max(t1.f))) from t1 union select ( -min(c)) from t1))) then a when t1.f not in (e,13,13) then t1.c else e end between 19 and c),t1.a)) from t1 where f>=t1.d),17) not between e and t1.c and 11<=17 then t1.e-19 when t1.a not in (c,t1.e,t1.c) then 11 else t1.b end then t1.e else t1.f end FROM t1 WHERE (not (case 17 when d then t1.c else c end=f | (select case count(*) when count(*)++max(11)+ -(abs(+cast(avg(c) AS integer)-(~count(*))+count(*)*(~case max( -c) when - -cast(avg(t1.f) AS integer) then (count(*)) else -max(t1.b) end*cast(avg(a) AS integer))-count(*) | ( -( -max(11)))) | ( -min(17))+count(*)) then (max(19)) else max(t1.c) end from t1)))} -} {600} -do_test randexpr-2.1980 { - db eval {SELECT case f when (d)-case when coalesce((select max(coalesce((select 11 from t1 where case when (t1.f<=17 or exists(select 1 from t1 where 11 | d in (select (abs(max(t1.f))) from t1 union select ( -min(c)) from t1))) then a when t1.f not in (e,13,13) then t1.c else e end between 19 and c),t1.a)) from t1 where f>=t1.d),17) not between e and t1.c and 11<=17 then t1.e-19 when t1.a not in (c,t1.e,t1.c) then 11 else t1.b end then t1.e else t1.f end FROM t1 WHERE NOT ((not (case 17 when d then t1.c else c end=f | (select case count(*) when count(*)++max(11)+ -(abs(+cast(avg(c) AS integer)-(~count(*))+count(*)*(~case max( -c) when - -cast(avg(t1.f) AS integer) then (count(*)) else -max(t1.b) end*cast(avg(a) AS integer))-count(*) | ( -( -max(11)))) | ( -min(17))+count(*)) then (max(19)) else max(t1.c) end from t1))))} -} {} -do_test randexpr-2.1981 { - db eval {SELECT case f when (d)-case when coalesce((select max(coalesce((select 11 from t1 where case when (t1.f<=17 or exists(select 1 from t1 where 11 & d in (select (abs(max(t1.f))) from t1 union select ( -min(c)) from t1))) then a when t1.f not in (e,13,13) then t1.c else e end between 19 and c),t1.a)) from t1 where f>=t1.d),17) not between e and t1.c and 11<=17 then t1.e-19 when t1.a not in (c,t1.e,t1.c) then 11 else t1.b end then t1.e else t1.f end FROM t1 WHERE (not (case 17 when d then t1.c else c end=f | (select case count(*) when count(*)++max(11)+ -(abs(+cast(avg(c) AS integer)-(~count(*))+count(*)*(~case max( -c) when - -cast(avg(t1.f) AS integer) then (count(*)) else -max(t1.b) end*cast(avg(a) AS integer))-count(*) | ( -( -max(11)))) | ( -min(17))+count(*)) then (max(19)) else max(t1.c) end from t1)))} -} {600} -do_test randexpr-2.1982 { - db eval {SELECT case when d+t1.d not between t1.f and + -t1.c then ~+a+(select +count(*) from t1) else (select +abs(count(*)) from t1)-t1.a end FROM t1 WHERE t1.b+f | d+a in (select +cast(avg(b) AS integer)++case min(coalesce((select t1.c from t1 where (e) in ((a)+17,t1.b,d)),t1.f)) when ~~cast(avg(17) AS integer)-max((t1.a)) then case min(13) when count(*) then count(distinct t1.a) else cast(avg(b) AS integer) end*max(d)+max(t1.b) else -count(*) end-count(*) from t1 union select cast(avg(t1.f) AS integer) from t1)} -} {} -do_test randexpr-2.1983 { - db eval {SELECT case when d+t1.d not between t1.f and + -t1.c then ~+a+(select +count(*) from t1) else (select +abs(count(*)) from t1)-t1.a end FROM t1 WHERE NOT (t1.b+f | d+a in (select +cast(avg(b) AS integer)++case min(coalesce((select t1.c from t1 where (e) in ((a)+17,t1.b,d)),t1.f)) when ~~cast(avg(17) AS integer)-max((t1.a)) then case min(13) when count(*) then count(distinct t1.a) else cast(avg(b) AS integer) end*max(d)+max(t1.b) else -count(*) end-count(*) from t1 union select cast(avg(t1.f) AS integer) from t1))} -} {-100} -do_test randexpr-2.1984 { - db eval {SELECT case when case when case case when (case when (( -ft1.c or exists(select 1 from t1 where not exists(select 1 from t1 where (a not between b and -t1.e)) and t1.f>=(t1.a)) and t1.f<(t1.b)) then 19 else e end) when a then t1.e else 11 end,(a),19)} -} {} -do_test randexpr-2.1985 { - db eval {SELECT case when case when case case when (case when (( -ft1.c or exists(select 1 from t1 where not exists(select 1 from t1 where (a not between b and -t1.e)) and t1.f>=(t1.a)) and t1.f<(t1.b)) then 19 else e end) when a then t1.e else 11 end,(a),19))} -} {-11300} -do_test randexpr-2.1986 { - db eval {SELECT coalesce((select 11 from t1 where 19 in (select ((count(*)*min(11)*(abs(max(a)))-max(b)*+count(*))) from t1 union select case abs(abs(min(t1.b))*case count(distinct b) when count(distinct t1.a) then count(distinct t1.f-t1.f) else max(11) end) when cast(avg(e) AS integer) then count(*) else count(*) end from t1)),d)*11+t1.c+b | 13+19 FROM t1 WHERE t1.c in (select 19 from t1 union select ~t1.f-t1.f+17- -17 from t1)} -} {} -do_test randexpr-2.1987 { - db eval {SELECT coalesce((select 11 from t1 where 19 in (select ((count(*)*min(11)*(abs(max(a)))-max(b)*+count(*))) from t1 union select case abs(abs(min(t1.b))*case count(distinct b) when count(distinct t1.a) then count(distinct t1.f-t1.f) else max(11) end) when cast(avg(e) AS integer) then count(*) else count(*) end from t1)),d)*11+t1.c+b | 13+19 FROM t1 WHERE NOT (t1.c in (select 19 from t1 union select ~t1.f-t1.f+17- -17 from t1))} -} {4900} -do_test randexpr-2.1988 { - db eval {SELECT coalesce((select 11 from t1 where 19 in (select ((count(*)*min(11)*(abs(max(a)))-max(b)*+count(*))) from t1 union select case abs(abs(min(t1.b))*case count(distinct b) when count(distinct t1.a) then count(distinct t1.f-t1.f) else max(11) end) when cast(avg(e) AS integer) then count(*) else count(*) end from t1)),d)*11+t1.c+b & 13+19 FROM t1 WHERE NOT (t1.c in (select 19 from t1 union select ~t1.f-t1.f+17- -17 from t1))} -} {32} -do_test randexpr-2.1989 { - db eval {SELECT case f when (select ++abs(max(d))+case case count(*) when min(t1.c) then (count(*)) else min(t1.e) end when -count(distinct t1.e) then count(distinct a) else min(t1.b) end from t1) then coalesce((select case when e in (select d from t1 union select f from t1) and t1.a not between b and 13 and d in (select 17 from t1 union select b from t1) then 17 when 11=f then 19 else d end from t1 where 11 not in (t1.c,t1.c,t1.d)),a) else e end-t1.e-t1.d-17*t1.f FROM t1 WHERE case when coalesce((select max(c) from t1 where 19 not between 11 and t1.e and t1.b in (select count(*) from t1 union select ~min(case c when (abs(case when d=( -t1.e) or t1.b<>t1.f then b else t1.b end)/abs(t1.c))+19 then t1.f else d end) from t1) and -b in (select min(17) from t1 union select min( -c) | count(distinct 17)- -(count(*))+max(t1.c) | -cast(avg(t1.c) AS integer) from t1)),t1.c)*t1.f not between -t1.e and t1.f then 11 else f end>f} -} {} -do_test randexpr-2.1990 { - db eval {SELECT case f when (select ++abs(max(d))+case case count(*) when min(t1.c) then (count(*)) else min(t1.e) end when -count(distinct t1.e) then count(distinct a) else min(t1.b) end from t1) then coalesce((select case when e in (select d from t1 union select f from t1) and t1.a not between b and 13 and d in (select 17 from t1 union select b from t1) then 17 when 11=f then 19 else d end from t1 where 11 not in (t1.c,t1.c,t1.d)),a) else e end-t1.e-t1.d-17*t1.f FROM t1 WHERE NOT (case when coalesce((select max(c) from t1 where 19 not between 11 and t1.e and t1.b in (select count(*) from t1 union select ~min(case c when (abs(case when d=( -t1.e) or t1.b<>t1.f then b else t1.b end)/abs(t1.c))+19 then t1.f else d end) from t1) and -b in (select min(17) from t1 union select min( -c) | count(distinct 17)- -(count(*))+max(t1.c) | -cast(avg(t1.c) AS integer) from t1)),t1.c)*t1.f not between -t1.e and t1.f then 11 else f end>f)} -} {-10700} -do_test randexpr-2.1991 { - db eval {SELECT case when ((coalesce((select t1.a from t1 where exists(select 1 from t1 where t1.a<=t1.b-e*coalesce((select max(a) from t1 where t1.e in (select min(13+13) from t1 union select -(count(distinct t1.f)-count(*)) from t1)),17)-f-t1.f) or t1.d in (select t1.a from t1 union select b from t1)),t1.d*t1.f)<>a)) then t1.d when not exists(select 1 from t1 where ((t1.f in (c,19,f)))) then t1.f else 17 end FROM t1 WHERE t1.c<=a} -} {} -do_test randexpr-2.1992 { - db eval {SELECT case when ((coalesce((select t1.a from t1 where exists(select 1 from t1 where t1.a<=t1.b-e*coalesce((select max(a) from t1 where t1.e in (select min(13+13) from t1 union select -(count(distinct t1.f)-count(*)) from t1)),17)-f-t1.f) or t1.d in (select t1.a from t1 union select b from t1)),t1.d*t1.f)<>a)) then t1.d when not exists(select 1 from t1 where ((t1.f in (c,19,f)))) then t1.f else 17 end FROM t1 WHERE NOT (t1.c<=a)} -} {400} -do_test randexpr-2.1993 { - db eval {SELECT case 17 when t1.f then 11 else (case when (c between case when ~t1.e+13-t1.c+case coalesce((select t1.c from t1 where t1.a not between a and 17),coalesce((select max(case when exists(select 1 from t1 where a>=t1.a) then ((t1.e)) when t1.e>=11 then 17 else t1.b end) from t1 where ( -11d),t1.c) | b- -17-(17)*c) from t1 where (19<13)),t1.c) not between a and t1.a} -} {200} -do_test randexpr-2.1994 { - db eval {SELECT case 17 when t1.f then 11 else (case when (c between case when ~t1.e+13-t1.c+case coalesce((select t1.c from t1 where t1.a not between a and 17),coalesce((select max(case when exists(select 1 from t1 where a>=t1.a) then ((t1.e)) when t1.e>=11 then 17 else t1.b end) from t1 where ( -11d),t1.c) | b- -17-(17)*c) from t1 where (19<13)),t1.c) not between a and t1.a)} -} {} -do_test randexpr-2.1995 { - db eval {SELECT case 17 when t1.f then 11 else (case when (c between case when ~t1.e+13-t1.c+case coalesce((select t1.c from t1 where t1.a not between a and 17),coalesce((select max(case when exists(select 1 from t1 where a>=t1.a) then ((t1.e)) when t1.e>=11 then 17 else t1.b end) from t1 where ( -11d),t1.c) | b- -17-(17)*c) from t1 where (19<13)),t1.c) not between a and t1.a} -} {200} -do_test randexpr-2.1996 { - db eval {SELECT 17+(select case ~max((abs(t1.c+coalesce((select max(t1.f) from t1 where t1.f in (select 13-c-case when not a>=t1.c then f else t1.c end+t1.c from t1 union select 19 from t1) or exists(select 1 from t1 where 1317 | e*d-17*t1.e*case a when case when (not f>=19 and t1.f<=t1.b) then coalesce((select case 11 when -c then t1.f else (t1.f) end from t1 where 13 between t1.e and t1.f),(e)) when -t1.f not between b and d then t1.d else t1.a end then 11 else 19 end then d when ad)} -} {1017} -do_test randexpr-2.1997 { - db eval {SELECT 17+(select case ~max((abs(t1.c+coalesce((select max(t1.f) from t1 where t1.f in (select 13-c-case when not a>=t1.c then f else t1.c end+t1.c from t1 union select 19 from t1) or exists(select 1 from t1 where 1317 | e*d-17*t1.e*case a when case when (not f>=19 and t1.f<=t1.b) then coalesce((select case 11 when -c then t1.f else (t1.f) end from t1 where 13 between t1.e and t1.f),(e)) when -t1.f not between b and d then t1.d else t1.a end then 11 else 19 end then d when ad))} -} {} -do_test randexpr-2.1998 { - db eval {SELECT 17+(select case ~max((abs(t1.c+coalesce((select max(t1.f) from t1 where t1.f in (select 13-c-case when not a>=t1.c then f else t1.c end+t1.c from t1 union select 19 from t1) or exists(select 1 from t1 where 1317 | e*d-17*t1.e*case a when case when (not f>=19 and t1.f<=t1.b) then coalesce((select case 11 when -c then t1.f else (t1.f) end from t1 where 13 between t1.e and t1.f),(e)) when -t1.f not between b and d then t1.d else t1.a end then 11 else 19 end then d when ad)} -} {0} -do_test randexpr-2.1999 { - db eval {SELECT ~c-t1.a*case -case 19 when d then t1.f else t1.a end-d when 11 then coalesce((select max(case when (case when exists(select 1 from t1 where 11*11>13) then t1.c else 11 end)<=(select min(~d+case 19 when e then 13 else e end) from t1) then c when ((f))<=17 then d else t1.c end+t1.f) from t1 where (t1.b between -c and t1.e)),t1.e) else 17 end FROM t1 WHERE +(abs(d-(select cast(avg((select (abs(max(t1.d*+d*( -e*(13)) | 17)+ -min(t1.d)+~ - -max(17) | max(t1.a) | -count(distinct t1.a)-count(distinct 13)*(count(distinct t1.a)) | (count(distinct 17)))) from t1)) AS integer) from t1)-11)/abs(c+d-t1.e))>=t1.d} -} {} -do_test randexpr-2.2000 { - db eval {SELECT ~c-t1.a*case -case 19 when d then t1.f else t1.a end-d when 11 then coalesce((select max(case when (case when exists(select 1 from t1 where 11*11>13) then t1.c else 11 end)<=(select min(~d+case 19 when e then 13 else e end) from t1) then c when ((f))<=17 then d else t1.c end+t1.f) from t1 where (t1.b between -c and t1.e)),t1.e) else 17 end FROM t1 WHERE NOT (+(abs(d-(select cast(avg((select (abs(max(t1.d*+d*( -e*(13)) | 17)+ -min(t1.d)+~ - -max(17) | max(t1.a) | -count(distinct t1.a)-count(distinct 13)*(count(distinct t1.a)) | (count(distinct 17)))) from t1)) AS integer) from t1)-11)/abs(c+d-t1.e))>=t1.d)} -} {-2001} -do_test randexpr-2.2001 { - db eval {SELECT coalesce((select 11 from t1 where a not in (17,e,(select -abs(case ( -count(distinct t1.e)) when count(distinct 13) | max((abs(case 11 when -(abs(19)/abs(17 | t1.c*t1.e))*t1.c | t1.b then a else +d end)/abs(b*t1.a))) then max(c*13) else cast(avg(t1.f) AS integer) end)-max(11) from t1)*d)),t1.d) FROM t1 WHERE 19-c*coalesce((select max(case (select count(distinct t1.f) from t1) | t1.a when case a when (abs(case when not c+t1.d>=e then 17*t1.e+a when not exists(select 1 from t1 where 11>b) then c else a end)/abs(t1.e))+t1.f*13 then 11 else t1.f end then 19 else d end-b) from t1 where (d) not between f and e),t1.d)= -c} -} {} -do_test randexpr-2.2002 { - db eval {SELECT coalesce((select 11 from t1 where a not in (17,e,(select -abs(case ( -count(distinct t1.e)) when count(distinct 13) | max((abs(case 11 when -(abs(19)/abs(17 | t1.c*t1.e))*t1.c | t1.b then a else +d end)/abs(b*t1.a))) then max(c*13) else cast(avg(t1.f) AS integer) end)-max(11) from t1)*d)),t1.d) FROM t1 WHERE NOT (19-c*coalesce((select max(case (select count(distinct t1.f) from t1) | t1.a when case a when (abs(case when not c+t1.d>=e then 17*t1.e+a when not exists(select 1 from t1 where 11>b) then c else a end)/abs(t1.e))+t1.f*13 then 11 else t1.f end then 19 else d end-b) from t1 where (d) not between f and e),t1.d)= -c)} -} {11} -do_test randexpr-2.2003 { - db eval {SELECT coalesce((select 11 from t1 where a not in (17,e,(select -abs(case ( -count(distinct t1.e)) when count(distinct 13) & max((abs(case 11 when -(abs(19)/abs(17 & t1.c*t1.e))*t1.c & t1.b then a else +d end)/abs(b*t1.a))) then max(c*13) else cast(avg(t1.f) AS integer) end)-max(11) from t1)*d)),t1.d) FROM t1 WHERE NOT (19-c*coalesce((select max(case (select count(distinct t1.f) from t1) | t1.a when case a when (abs(case when not c+t1.d>=e then 17*t1.e+a when not exists(select 1 from t1 where 11>b) then c else a end)/abs(t1.e))+t1.f*13 then 11 else t1.f end then 19 else d end-b) from t1 where (d) not between f and e),t1.d)= -c)} -} {11} -do_test randexpr-2.2004 { - db eval {SELECT 11+t1.b*~c*17-13-a+t1.d | t1.f+t1.b*coalesce((select 17 from t1 where t1.e in (select (select cast(avg(case case e when (t1.d) then 17 else (abs((abs(case when d19 then 19 else a end)/abs(f)))/abs((t1.e))) end when b then (11) else f end+17) AS integer) from t1) from t1 union select t1.c from t1)),(17)) FROM t1 WHERE e=11} -} {} -do_test randexpr-2.2005 { - db eval {SELECT 11+t1.b*~c*17-13-a+t1.d | t1.f+t1.b*coalesce((select 17 from t1 where t1.e in (select (select cast(avg(case case e when (t1.d) then 17 else (abs((abs(case when d19 then 19 else a end)/abs(f)))/abs((t1.e))) end when b then (11) else f end+17) AS integer) from t1) from t1 union select t1.c from t1)),(17)) FROM t1 WHERE NOT (e=11)} -} {-1019998} -do_test randexpr-2.2006 { - db eval {SELECT 11+t1.b*~c*17-13-a+t1.d & t1.f+t1.b*coalesce((select 17 from t1 where t1.e in (select (select cast(avg(case case e when (t1.d) then 17 else (abs((abs(case when d19 then 19 else a end)/abs(f)))/abs((t1.e))) end when b then (11) else f end+17) AS integer) from t1) from t1 union select t1.c from t1)),(17)) FROM t1 WHERE NOT (e=11)} -} {896} -do_test randexpr-2.2007 { - db eval {SELECT e*~~(coalesce((select +case when not exists(select 1 from t1 where 13*coalesce((select max(coalesce((select max(11) from t1 where not exists(select 1 from t1 where (select -count(distinct 11) | min(11) from t1)>case b when b then c else d end)),13)) from t1 where -c<>d),13)<>t1.f and 13 between 13 and 19) then b-t1.e+e else (t1.f) end from t1 where ((not not e>t1.c and c not between a and e))),t1.d)) FROM t1 WHERE exists(select 1 from t1 where case when case when e -b)} -} {200000} -do_test randexpr-2.2008 { - db eval {SELECT e*~~(coalesce((select +case when not exists(select 1 from t1 where 13*coalesce((select max(coalesce((select max(11) from t1 where not exists(select 1 from t1 where (select -count(distinct 11) | min(11) from t1)>case b when b then c else d end)),13)) from t1 where -c<>d),13)<>t1.f and 13 between 13 and 19) then b-t1.e+e else (t1.f) end from t1 where ((not not e>t1.c and c not between a and e))),t1.d)) FROM t1 WHERE NOT (exists(select 1 from t1 where case when case when e -b))} -} {} -do_test randexpr-2.2009 { - db eval {SELECT e*~~(coalesce((select +case when not exists(select 1 from t1 where 13*coalesce((select max(coalesce((select max(11) from t1 where not exists(select 1 from t1 where (select -count(distinct 11) & min(11) from t1)>case b when b then c else d end)),13)) from t1 where -c<>d),13)<>t1.f and 13 between 13 and 19) then b-t1.e+e else (t1.f) end from t1 where ((not not e>t1.c and c not between a and e))),t1.d)) FROM t1 WHERE exists(select 1 from t1 where case when case when e -b)} -} {200000} -do_test randexpr-2.2010 { - db eval {SELECT (case t1.b-coalesce((select max(t1.f) from t1 where +t1.c=e or coalesce((select max(t1.a) from t1 where exists(select 1 from t1 where ((13-(select +cast(avg( -t1.b) AS integer) from t1) in (case f when (19) then t1.f else t1.f end,11,t1.e))))),(t1.a)+t1.e) not in (t1.f,t1.a,b) and t1.e not in (11,t1.b,t1.b)),d) when 19 then t1.e else c end-t1.e*t1.f) FROM t1 WHERE t1.ecoalesce((select max(f) from t1 where 19>=b),19) then f else t1.e end-f)/abs(t1.a))-11 else t1.e end when exists(select 1 from t1 where not exists(select 1 from t1 where ((c)) not in (b,a,e))) then t1.c else ((11)) end FROM t1 WHERE (not 13 not in (17,a,e))} -} {} -do_test randexpr-2.2013 { - db eval {SELECT t1.a+e-case when 19<+17 then case when 19 not between t1.e and t1.e then (abs(case when e+17*(select count(distinct (abs(+17)/abs(t1.c))) from t1)<>coalesce((select max(f) from t1 where 19>=b),19) then f else t1.e end-f)/abs(t1.a))-11 else t1.e end when exists(select 1 from t1 where not exists(select 1 from t1 where ((c)) not in (b,a,e))) then t1.c else ((11)) end FROM t1 WHERE NOT ((not 13 not in (17,a,e)))} -} {589} -do_test randexpr-2.2014 { - db eval {SELECT case when not exists(select 1 from t1 where case when -~(19)=t1.c then t1.f*~case when t1.f<=(select max(t1.c) from t1) then e when (c<>13) then t1.a else (b) end when t1.b between 19 and 17 then 17 else e end-e+t1.a>e or -19 in (select max(13) from t1 union select min( -19) from t1)) then t1.b when -11>=a then ~b else 19 end FROM t1 WHERE (c not between coalesce((select max(c) from t1 where (not t1.c<>t1.a)), -(abs(case when t1.e<=t1.c then t1.d when exists(select 1 from t1 where 17 in (select case when coalesce((select c from t1 where 17-t1.a-coalesce((select 17 from t1 where t1.f in (t1.b,19,t1.c)),17) not between e and 13),t1.b) not in (e,13,t1.a) then t1.c else b end | f from t1 union select t1.f from t1)) then t1.f else 11 end)/abs(t1.a))) and t1.e)} -} {} -do_test randexpr-2.2015 { - db eval {SELECT case when not exists(select 1 from t1 where case when -~(19)=t1.c then t1.f*~case when t1.f<=(select max(t1.c) from t1) then e when (c<>13) then t1.a else (b) end when t1.b between 19 and 17 then 17 else e end-e+t1.a>e or -19 in (select max(13) from t1 union select min( -19) from t1)) then t1.b when -11>=a then ~b else 19 end FROM t1 WHERE NOT ((c not between coalesce((select max(c) from t1 where (not t1.c<>t1.a)), -(abs(case when t1.e<=t1.c then t1.d when exists(select 1 from t1 where 17 in (select case when coalesce((select c from t1 where 17-t1.a-coalesce((select 17 from t1 where t1.f in (t1.b,19,t1.c)),17) not between e and 13),t1.b) not in (e,13,t1.a) then t1.c else b end | f from t1 union select t1.f from t1)) then t1.f else 11 end)/abs(t1.a))) and t1.e))} -} {19} -do_test randexpr-2.2016 { - db eval {SELECT case t1.c | t1.b when t1.f-c then case when c=11) or t1.c<=t1.e) then + - -b+11 else 13 end from t1 union select (t1.c) from t1) then 17 else 11 end else t1.a end FROM t1 WHERE t1.f | 13+coalesce((select max(11) from t1 where e>=(select ~case cast(avg(19*f+(c)) AS integer) when (min(c))-min(t1.a) then cast(avg(13) AS integer) else count(distinct e) end from t1)),t1.f)>=coalesce((select c from t1 where (exists(select 1 from t1 where t1.f>=f and (t1.d)<>t1.a))),c) or not exists(select 1 from t1 where not 11>=t1.d) or (b between c and 11 and 11< -t1.b and t1.e>=t1.b) or t1.c>e} -} {100} -do_test randexpr-2.2017 { - db eval {SELECT case t1.c | t1.b when t1.f-c then case when c=11) or t1.c<=t1.e) then + - -b+11 else 13 end from t1 union select (t1.c) from t1) then 17 else 11 end else t1.a end FROM t1 WHERE NOT (t1.f | 13+coalesce((select max(11) from t1 where e>=(select ~case cast(avg(19*f+(c)) AS integer) when (min(c))-min(t1.a) then cast(avg(13) AS integer) else count(distinct e) end from t1)),t1.f)>=coalesce((select c from t1 where (exists(select 1 from t1 where t1.f>=f and (t1.d)<>t1.a))),c) or not exists(select 1 from t1 where not 11>=t1.d) or (b between c and 11 and 11< -t1.b and t1.e>=t1.b) or t1.c>e)} -} {} -do_test randexpr-2.2018 { - db eval {SELECT case t1.c & t1.b when t1.f-c then case when c=11) or t1.c<=t1.e) then + - -b+11 else 13 end from t1 union select (t1.c) from t1) then 17 else 11 end else t1.a end FROM t1 WHERE t1.f | 13+coalesce((select max(11) from t1 where e>=(select ~case cast(avg(19*f+(c)) AS integer) when (min(c))-min(t1.a) then cast(avg(13) AS integer) else count(distinct e) end from t1)),t1.f)>=coalesce((select c from t1 where (exists(select 1 from t1 where t1.f>=f and (t1.d)<>t1.a))),c) or not exists(select 1 from t1 where not 11>=t1.d) or (b between c and 11 and 11< -t1.b and t1.e>=t1.b) or t1.c>e} -} {100} -do_test randexpr-2.2019 { - db eval {SELECT coalesce((select 19 from t1 where a<=case (abs(e)/abs(case b+f when b then t1.e else e end)) when + -t1.b+coalesce((select max(t1.f) from t1 where (19<=+e) and (c*b)>= -t1.e and (c>=c)),11+(e)+a)-t1.b then 17 else 17 end-t1.e),a) FROM t1 WHERE +d*t1.f+c+t1.c*13<>t1.e} -} {100} -do_test randexpr-2.2020 { - db eval {SELECT coalesce((select 19 from t1 where a<=case (abs(e)/abs(case b+f when b then t1.e else e end)) when + -t1.b+coalesce((select max(t1.f) from t1 where (19<=+e) and (c*b)>= -t1.e and (c>=c)),11+(e)+a)-t1.b then 17 else 17 end-t1.e),a) FROM t1 WHERE NOT (+d*t1.f+c+t1.c*13<>t1.e)} -} {} -do_test randexpr-2.2021 { - db eval {SELECT (abs(t1.e)/abs(coalesce((select +t1.a*c from t1 where (abs(e)/abs(d)) in (select +~count(*)-min(t1.d) from t1 union select abs(abs(cast(avg(t1.b) AS integer))+cast(avg(b) AS integer)) from t1)),d))) FROM t1 WHERE not b not between (select max(13) from t1) and 13} -} {} -do_test randexpr-2.2022 { - db eval {SELECT (abs(t1.e)/abs(coalesce((select +t1.a*c from t1 where (abs(e)/abs(d)) in (select +~count(*)-min(t1.d) from t1 union select abs(abs(cast(avg(t1.b) AS integer))+cast(avg(b) AS integer)) from t1)),d))) FROM t1 WHERE NOT (not b not between (select max(13) from t1) and 13)} -} {1} -do_test randexpr-2.2023 { - db eval {SELECT +(select +~(count(distinct (abs((abs(coalesce((select max(t1.c) from t1 where -e in (select t1.e from t1 union select (e) from t1)),c)-11)/abs(19))*t1.c)/abs(19))))*count(distinct t1.a)*+count(distinct a)*count(distinct t1.d) | count(*)-max(11)+cast(avg(t1.b) AS integer)*min(t1.a) from t1)+19+t1.c*19+~coalesce((select e from t1 where 13 in (select count(distinct 17) from t1 union select count(distinct 11) from t1) or t1.f<>c),17) FROM t1 WHERE exists(select 1 from t1 where coalesce((select t1.f from t1 where t1.a in (case when exists(select 1 from t1 where b*t1.e in (select (t1.a) from t1 union select (case -13 when f then t1.b else t1.a end) from t1)) then t1.d else 17 end,d,11)),c) not in (17,19,t1.b)) or (b) in (select abs(~~abs(count(*)) | - -min(c)-min(11)+count(*) | max(a) | count(*)-count(distinct 11)) from t1 union select max(t1.f) from t1) or t1.b>=19} -} {5216} -do_test randexpr-2.2024 { - db eval {SELECT +(select +~(count(distinct (abs((abs(coalesce((select max(t1.c) from t1 where -e in (select t1.e from t1 union select (e) from t1)),c)-11)/abs(19))*t1.c)/abs(19))))*count(distinct t1.a)*+count(distinct a)*count(distinct t1.d) | count(*)-max(11)+cast(avg(t1.b) AS integer)*min(t1.a) from t1)+19+t1.c*19+~coalesce((select e from t1 where 13 in (select count(distinct 17) from t1 union select count(distinct 11) from t1) or t1.f<>c),17) FROM t1 WHERE NOT (exists(select 1 from t1 where coalesce((select t1.f from t1 where t1.a in (case when exists(select 1 from t1 where b*t1.e in (select (t1.a) from t1 union select (case -13 when f then t1.b else t1.a end) from t1)) then t1.d else 17 end,d,11)),c) not in (17,19,t1.b)) or (b) in (select abs(~~abs(count(*)) | - -min(c)-min(11)+count(*) | max(a) | count(*)-count(distinct 11)) from t1 union select max(t1.f) from t1) or t1.b>=19)} -} {} -do_test randexpr-2.2025 { - db eval {SELECT +(select +~(count(distinct (abs((abs(coalesce((select max(t1.c) from t1 where -e in (select t1.e from t1 union select (e) from t1)),c)-11)/abs(19))*t1.c)/abs(19))))*count(distinct t1.a)*+count(distinct a)*count(distinct t1.d) & count(*)-max(11)+cast(avg(t1.b) AS integer)*min(t1.a) from t1)+19+t1.c*19+~coalesce((select e from t1 where 13 in (select count(distinct 17) from t1 union select count(distinct 11) from t1) or t1.f<>c),17) FROM t1 WHERE exists(select 1 from t1 where coalesce((select t1.f from t1 where t1.a in (case when exists(select 1 from t1 where b*t1.e in (select (t1.a) from t1 union select (case -13 when f then t1.b else t1.a end) from t1)) then t1.d else 17 end,d,11)),c) not in (17,19,t1.b)) or (b) in (select abs(~~abs(count(*)) | - -min(c)-min(11)+count(*) | max(a) | count(*)-count(distinct 11)) from t1 union select max(t1.f) from t1) or t1.b>=19} -} {25208} -do_test randexpr-2.2026 { - db eval {SELECT (abs(case t1.c when ~coalesce((select max(case coalesce((select max(b) from t1 where not aa),e) then 17 else a end)/abs(19)) FROM t1 WHERE d not in (d,d+case coalesce((select t1.e from t1 where (case when 17*case case f-+t1.c+coalesce((select t1.c from t1 where t1.df)),d) when t1.e then (t1.c) else -e end,t1.f)} -} {} -do_test randexpr-2.2027 { - db eval {SELECT (abs(case t1.c when ~coalesce((select max(case coalesce((select max(b) from t1 where not aa),e) then 17 else a end)/abs(19)) FROM t1 WHERE NOT (d not in (d,d+case coalesce((select t1.e from t1 where (case when 17*case case f-+t1.c+coalesce((select t1.c from t1 where t1.df)),d) when t1.e then (t1.c) else -e end,t1.f))} -} {5} -do_test randexpr-2.2028 { - db eval {SELECT case 13 when 13 then case when 11 between case case when not 17 not between f-t1.e and (abs(19)/abs(((t1.b))))*19 then t1.a when exists(select 1 from t1 where t1.e not between d and 13) then t1.c else -e end when t1.e then t1.c else e end and 17 then 19 when not exists(select 1 from t1 where 11=f) and exists(select 1 from t1 where d<>t1.a) or t1.f>=17 then a else t1.e end else 19 end*11 FROM t1 WHERE case 17 when t1.f then 11 else c end+d=t1.f} -} {} -do_test randexpr-2.2029 { - db eval {SELECT case 13 when 13 then case when 11 between case case when not 17 not between f-t1.e and (abs(19)/abs(((t1.b))))*19 then t1.a when exists(select 1 from t1 where t1.e not between d and 13) then t1.c else -e end when t1.e then t1.c else e end and 17 then 19 when not exists(select 1 from t1 where 11=f) and exists(select 1 from t1 where d<>t1.a) or t1.f>=17 then a else t1.e end else 19 end*11 FROM t1 WHERE NOT (case 17 when t1.f then 11 else c end+d=t1.f)} -} {1100} -do_test randexpr-2.2030 { - db eval {SELECT coalesce((select max(b-case when exists(select 1 from t1 where case when t1.c>t1.b then t1.c*19 else coalesce((select max((abs(t1.a)/abs(~(select +max(t1.c)*max(a)*cast(avg(t1.d) AS integer) from t1)+case when e=t1.c or t1.c between e and b then +a else 13 end))) from t1 where 17=b),t1.a) end not between f and t1.c) then c else e end+ - -d-17) from t1 where t1.e=(select cast(avg(d) AS integer) from t1)} -} {} -do_test randexpr-2.2031 { - db eval {SELECT coalesce((select max(b-case when exists(select 1 from t1 where case when t1.c>t1.b then t1.c*19 else coalesce((select max((abs(t1.a)/abs(~(select +max(t1.c)*max(a)*cast(avg(t1.d) AS integer) from t1)+case when e=t1.c or t1.c between e and b then +a else 13 end))) from t1 where 17=b),t1.a) end not between f and t1.c) then c else e end+ - -d-17) from t1 where t1.e=(select cast(avg(d) AS integer) from t1))} -} {17} -do_test randexpr-2.2032 { - db eval {SELECT case when -13 in (select +case when case when exists(select 1 from t1 where ~coalesce((select t1.f from t1 where exists(select 1 from t1 where t1.a not between t1.b and -t1.e)),t1.c)+c | b not between f and t1.b) then -11-19 else t1.d end in (select ~abs(max(19))+cast(avg(e) AS integer)-max(13)-count(*) from t1 union select min(f) from t1) then t1.f else b end+t1.e from t1 union select t1.f from t1) then b when e(select count(distinct d) from t1)) then t1.a when +(select cast(avg(e-19*~case 19 when t1.f then (t1.d) else t1.e end*t1.d*c) AS integer) from t1) in (e,t1.c,t1.e) then 13 else a end from t1 where d not between t1.b and f),a)) from t1 union select min((t1.b)) from t1) or (t1.e<=13)} -} {} -do_test randexpr-2.2033 { - db eval {SELECT case when -13 in (select +case when case when exists(select 1 from t1 where ~coalesce((select t1.f from t1 where exists(select 1 from t1 where t1.a not between t1.b and -t1.e)),t1.c)+c | b not between f and t1.b) then -11-19 else t1.d end in (select ~abs(max(19))+cast(avg(e) AS integer)-max(13)-count(*) from t1 union select min(f) from t1) then t1.f else b end+t1.e from t1 union select t1.f from t1) then b when e(select count(distinct d) from t1)) then t1.a when +(select cast(avg(e-19*~case 19 when t1.f then (t1.d) else t1.e end*t1.d*c) AS integer) from t1) in (e,t1.c,t1.e) then 13 else a end from t1 where d not between t1.b and f),a)) from t1 union select min((t1.b)) from t1) or (t1.e<=13))} -} {411} -do_test randexpr-2.2034 { - db eval {SELECT case when -13 in (select +case when case when exists(select 1 from t1 where ~coalesce((select t1.f from t1 where exists(select 1 from t1 where t1.a not between t1.b and -t1.e)),t1.c)+c & b not between f and t1.b) then -11-19 else t1.d end in (select ~abs(max(19))+cast(avg(e) AS integer)-max(13)-count(*) from t1 union select min(f) from t1) then t1.f else b end+t1.e from t1 union select t1.f from t1) then b when e(select count(distinct d) from t1)) then t1.a when +(select cast(avg(e-19*~case 19 when t1.f then (t1.d) else t1.e end*t1.d*c) AS integer) from t1) in (e,t1.c,t1.e) then 13 else a end from t1 where d not between t1.b and f),a)) from t1 union select min((t1.b)) from t1) or (t1.e<=13))} -} {411} -do_test randexpr-2.2035 { - db eval {SELECT (+coalesce((select max(c) from t1 where case when ( -t1.f between t1.a | -a*(abs(11 | e+case when not exists(select 1 from t1 where t1.b<>f or a=t1.a) then 17*(a) else 17 end*c)/abs(c))-d+f* -e-t1.a and b) then -11-a else t1.a end*19+b | t1.a<=t1.e),t1.b)) FROM t1 WHERE t1.e between -case when e not in (t1.e,case when d+t1.c-b-t1.b+case when -ef or a=t1.a) then 17*(a) else 17 end*c)/abs(c))-d+f* -e-t1.a and b) then -11-a else t1.a end*19+b | t1.a<=t1.e),t1.b)) FROM t1 WHERE NOT (t1.e between -case when e not in (t1.e,case when d+t1.c-b-t1.b+case when -ef or a=t1.a) then 17*(a) else 17 end*c)/abs(c))-d+f* -e-t1.a and b) then -11-a else t1.a end*19+b & t1.a<=t1.e),t1.b)) FROM t1 WHERE NOT (t1.e between -case when e not in (t1.e,case when d+t1.c-b-t1.b+case when -ee then t1.d else a end+f)-case (+min(t1.f)*min(e)+cast(avg(c) AS integer))*count(*) when - -((count(distinct f))) then max(a) else count(*) end | -cast(avg(11) AS integer)*count(*))-count(*)*( -max(f)) from t1)} -} {} -do_test randexpr-2.2039 { - db eval {SELECT (select +~~ -(count(*))+max((select ~count(*)+count(distinct d)*~cast(avg(19) AS integer)+case count(*)- -abs(abs(~abs(++abs(cast(avg(t1.c) AS integer)))+count(distinct e)+count(*)))+(min(19) | ( -cast(avg(b) AS integer) | - -(count(distinct t1.f)))) when -count(*) then max( -b) else max((t1.d)) end from t1)) from t1) FROM t1 WHERE NOT ((abs(c)/abs((select (abs(count(*))) from t1))) not between t1.b and (select abs(count(*)* -~min(~e+case when t1.a+(a)>e then t1.d else a end+f)-case (+min(t1.f)*min(e)+cast(avg(c) AS integer))*count(*) when - -((count(distinct f))) then max(a) else count(*) end | -cast(avg(11) AS integer)*count(*))-count(*)*( -max(f)) from t1))} -} {377} -do_test randexpr-2.2040 { - db eval {SELECT (select +~~ -(count(*))+max((select ~count(*)+count(distinct d)*~cast(avg(19) AS integer)+case count(*)- -abs(abs(~abs(++abs(cast(avg(t1.c) AS integer)))+count(distinct e)+count(*)))+(min(19) & ( -cast(avg(b) AS integer) & - -(count(distinct t1.f)))) when -count(*) then max( -b) else max((t1.d)) end from t1)) from t1) FROM t1 WHERE NOT ((abs(c)/abs((select (abs(count(*))) from t1))) not between t1.b and (select abs(count(*)* -~min(~e+case when t1.a+(a)>e then t1.d else a end+f)-case (+min(t1.f)*min(e)+cast(avg(c) AS integer))*count(*) when - -((count(distinct f))) then max(a) else count(*) end | -cast(avg(11) AS integer)*count(*))-count(*)*( -max(f)) from t1))} -} {377} -do_test randexpr-2.2041 { - db eval {SELECT case when ((select abs((count(*)))+min(case 17 when b then 13 | 11+c | f else 19 end) | +count(*)- - -max(t1.d) from t1) not between 19-case when t1.c not between ~e and (e) then t1.d else t1.c end and t1.e) then t1.d when t1.d in (select -~count(distinct t1.f)*(min(t1.b)) from t1 union select (cast(avg(17) AS integer)) from t1) then d else t1.b end FROM t1 WHERE not exists(select 1 from t1 where d in (coalesce((select max((select abs(~min(f))++~count(distinct t1.a)+cast(avg(t1.b) AS integer)*cast(avg(13) AS integer) from t1)) from t1 where exists(select 1 from t1 where not not exists(select 1 from t1 where (exists(select 1 from t1 where 11=13 then ~19*13 | t1.c+t1.e when c between t1.d and a then t1.b else t1.d end)-13,17,11))} -} {400} -do_test randexpr-2.2042 { - db eval {SELECT case when ((select abs((count(*)))+min(case 17 when b then 13 | 11+c | f else 19 end) | +count(*)- - -max(t1.d) from t1) not between 19-case when t1.c not between ~e and (e) then t1.d else t1.c end and t1.e) then t1.d when t1.d in (select -~count(distinct t1.f)*(min(t1.b)) from t1 union select (cast(avg(17) AS integer)) from t1) then d else t1.b end FROM t1 WHERE NOT (not exists(select 1 from t1 where d in (coalesce((select max((select abs(~min(f))++~count(distinct t1.a)+cast(avg(t1.b) AS integer)*cast(avg(13) AS integer) from t1)) from t1 where exists(select 1 from t1 where not not exists(select 1 from t1 where (exists(select 1 from t1 where 11=13 then ~19*13 | t1.c+t1.e when c between t1.d and a then t1.b else t1.d end)-13,17,11)))} -} {} -do_test randexpr-2.2043 { - db eval {SELECT case when ((select abs((count(*)))+min(case 17 when b then 13 & 11+c & f else 19 end) & +count(*)- - -max(t1.d) from t1) not between 19-case when t1.c not between ~e and (e) then t1.d else t1.c end and t1.e) then t1.d when t1.d in (select -~count(distinct t1.f)*(min(t1.b)) from t1 union select (cast(avg(17) AS integer)) from t1) then d else t1.b end FROM t1 WHERE not exists(select 1 from t1 where d in (coalesce((select max((select abs(~min(f))++~count(distinct t1.a)+cast(avg(t1.b) AS integer)*cast(avg(13) AS integer) from t1)) from t1 where exists(select 1 from t1 where not not exists(select 1 from t1 where (exists(select 1 from t1 where 11=13 then ~19*13 | t1.c+t1.e when c between t1.d and a then t1.b else t1.d end)-13,17,11))} -} {400} -do_test randexpr-2.2044 { - db eval {SELECT case when not exists(select 1 from t1 where e in (select +(count(distinct (abs(case when ((abs(coalesce((select coalesce((select case when c>f and a in (19, -e,t1.c) then +t1.a else t1.e end from t1 where ct1.f),(select case abs(count(distinct t1.e)-cast(avg(t1.d) AS integer)*cast(avg(t1.b) AS integer)) when min(19) then count(*) else min(c) end+count(distinct t1.c) from t1))+t1.b,t1.d, -d)} -} {} -do_test randexpr-2.2045 { - db eval {SELECT case when not exists(select 1 from t1 where e in (select +(count(distinct (abs(case when ((abs(coalesce((select coalesce((select case when c>f and a in (19, -e,t1.c) then +t1.a else t1.e end from t1 where ct1.f),(select case abs(count(distinct t1.e)-cast(avg(t1.d) AS integer)*cast(avg(t1.b) AS integer)) when min(19) then count(*) else min(c) end+count(distinct t1.c) from t1))+t1.b,t1.d, -d))} -} {120000} -do_test randexpr-2.2046 { - db eval {SELECT -case when -b=t1.c then t1.a when (select min(t1.b) from t1)<=d+coalesce((select max(11+a) from t1 where (not exists(select 1 from t1 where c | -((case case when (t1.f between a and t1.b) then b else c end-t1.c when 19 then t1.c else f end+t1.c)+t1.b | a)-t1.c-(c)<=19))),t1.c) then e else -t1.d end-(17) FROM t1 WHERE (t1.b | case t1.b when ((t1.e)) then (abs(19)/abs(t1.a))-coalesce((select max(t1.e*case b when a then 11 else t1.a end) from t1 where +~case when 13=17 and t1.e+11 in (select t1.f from t1 union select t1.d from t1) then t1.b when (b<17 and a>= -17) then f else -t1.e end+(17)<=13),d) else b end | b between t1.d and t1.f)} -} {} -do_test randexpr-2.2047 { - db eval {SELECT -case when -b=t1.c then t1.a when (select min(t1.b) from t1)<=d+coalesce((select max(11+a) from t1 where (not exists(select 1 from t1 where c | -((case case when (t1.f between a and t1.b) then b else c end-t1.c when 19 then t1.c else f end+t1.c)+t1.b | a)-t1.c-(c)<=19))),t1.c) then e else -t1.d end-(17) FROM t1 WHERE NOT ((t1.b | case t1.b when ((t1.e)) then (abs(19)/abs(t1.a))-coalesce((select max(t1.e*case b when a then 11 else t1.a end) from t1 where +~case when 13=17 and t1.e+11 in (select t1.f from t1 union select t1.d from t1) then t1.b when (b<17 and a>= -17) then f else -t1.e end+(17)<=13),d) else b end | b between t1.d and t1.f))} -} {-517} -do_test randexpr-2.2048 { - db eval {SELECT -case when -b=t1.c then t1.a when (select min(t1.b) from t1)<=d+coalesce((select max(11+a) from t1 where (not exists(select 1 from t1 where c & -((case case when (t1.f between a and t1.b) then b else c end-t1.c when 19 then t1.c else f end+t1.c)+t1.b & a)-t1.c-(c)<=19))),t1.c) then e else -t1.d end-(17) FROM t1 WHERE NOT ((t1.b | case t1.b when ((t1.e)) then (abs(19)/abs(t1.a))-coalesce((select max(t1.e*case b when a then 11 else t1.a end) from t1 where +~case when 13=17 and t1.e+11 in (select t1.f from t1 union select t1.d from t1) then t1.b when (b<17 and a>= -17) then f else -t1.e end+(17)<=13),d) else b end | b between t1.d and t1.f))} -} {-517} -do_test randexpr-2.2049 { - db eval {SELECT case when not c=t1.f | t1.d),19),t1.a) then (t1.d) when -a<=( -t1.a) then a else f end*a,13,19)) or e=17),a)*17 FROM t1 WHERE (select case min(+19) when abs((max(17)* -min(a*(abs(case e when t1.b then t1.f else -t1.c end*f)/abs(t1.d))*e)-count(*) | max(19))) then - -case count(distinct 11) when min(11) then max(19) else min(13) end-( -count(distinct 13)) else -(count(distinct b)) end*cast(avg(17) AS integer)-max(e) from t1) between t1.d and coalesce((select max(13) from t1 where not 17>a-f-e),13)} -} {} -do_test randexpr-2.2052 { - db eval {SELECT +11+~coalesce((select -19 from t1 where exists(select 1 from t1 where f*t1.e not in ( -f*~t1.a-f*case when t1.f in ((e),coalesce((select b from t1 where b>=t1.f | t1.d),19),t1.a) then (t1.d) when -a<=( -t1.a) then a else f end*a,13,19)) or e=17),a)*17 FROM t1 WHERE NOT ((select case min(+19) when abs((max(17)* -min(a*(abs(case e when t1.b then t1.f else -t1.c end*f)/abs(t1.d))*e)-count(*) | max(19))) then - -case count(distinct 11) when min(11) then max(19) else min(13) end-( -count(distinct 13)) else -(count(distinct b)) end*cast(avg(17) AS integer)-max(e) from t1) between t1.d and coalesce((select max(13) from t1 where not 17>a-f-e),13))} -} {317} -do_test randexpr-2.2053 { - db eval {SELECT +11+~coalesce((select -19 from t1 where exists(select 1 from t1 where f*t1.e not in ( -f*~t1.a-f*case when t1.f in ((e),coalesce((select b from t1 where b>=t1.f & t1.d),19),t1.a) then (t1.d) when -a<=( -t1.a) then a else f end*a,13,19)) or e=17),a)*17 FROM t1 WHERE NOT ((select case min(+19) when abs((max(17)* -min(a*(abs(case e when t1.b then t1.f else -t1.c end*f)/abs(t1.d))*e)-count(*) | max(19))) then - -case count(distinct 11) when min(11) then max(19) else min(13) end-( -count(distinct 13)) else -(count(distinct b)) end*cast(avg(17) AS integer)-max(e) from t1) between t1.d and coalesce((select max(13) from t1 where not 17>a-f-e),13))} -} {317} -do_test randexpr-2.2054 { - db eval {SELECT coalesce((select 11 from t1 where (b-case (select count(distinct t1.f*e) from t1) when t1.f | 11 | 11*coalesce((select 19 from t1 where (~coalesce((select f from t1 where (t1.c>17)),a)+t1.c not between f and t1.e or 19>=c)),(t1.d)) then a else t1.f end>=f and exists(select 1 from t1 where 13<>c) or - -t1.f17)),a)+t1.c not between f and t1.e or 19>=c)),(t1.d)) then a else t1.f end>=f and exists(select 1 from t1 where 13<>c) or - -t1.f17)),a)+t1.c not between f and t1.e or 19>=c)),(t1.d)) then a else t1.f end>=f and exists(select 1 from t1 where 13<>c) or - -t1.fcoalesce((select max(coalesce((select t1.e from t1 where not (abs(a+t1.e*c | case when t1.b in (select -max(t1.b)*cast(avg(19) AS integer) from t1 union select -max(13) from t1) then t1.f else 19 end-f+(19)+19)/abs(t1.e)) in (d,13,e) or t1.e<=t1.e),t1.b-17)) from t1 where -11<>17 or e in (select max(19) from t1 union select (cast(avg(f) AS integer)) from t1)),a)),17))/abs(t1.e)) FROM t1 WHERE t1.e<>13 | (t1.f)+c-((13))-~13 | (abs(e)/abs(coalesce((select max(t1.c) from t1 where (d)<=t1.d),case when (exists(select 1 from t1 where not exists(select 1 from t1 where (abs(17)/abs(t1.d))>coalesce((select max(a) from t1 where t1.c not between t1.f and t1.f and f not in (t1.f, -t1.c,13)),t1.c)))) then c else 19 end))) | t1.a*11* -e*t1.c or not exists(select 1 from t1 where f>c)} -} {0} -do_test randexpr-2.2058 { - db eval {SELECT (abs(coalesce((select max(t1.e) from t1 where c>coalesce((select max(coalesce((select t1.e from t1 where not (abs(a+t1.e*c | case when t1.b in (select -max(t1.b)*cast(avg(19) AS integer) from t1 union select -max(13) from t1) then t1.f else 19 end-f+(19)+19)/abs(t1.e)) in (d,13,e) or t1.e<=t1.e),t1.b-17)) from t1 where -11<>17 or e in (select max(19) from t1 union select (cast(avg(f) AS integer)) from t1)),a)),17))/abs(t1.e)) FROM t1 WHERE NOT (t1.e<>13 | (t1.f)+c-((13))-~13 | (abs(e)/abs(coalesce((select max(t1.c) from t1 where (d)<=t1.d),case when (exists(select 1 from t1 where not exists(select 1 from t1 where (abs(17)/abs(t1.d))>coalesce((select max(a) from t1 where t1.c not between t1.f and t1.f and f not in (t1.f, -t1.c,13)),t1.c)))) then c else 19 end))) | t1.a*11* -e*t1.c or not exists(select 1 from t1 where f>c))} -} {} -do_test randexpr-2.2059 { - db eval {SELECT (abs(coalesce((select max(t1.e) from t1 where c>coalesce((select max(coalesce((select t1.e from t1 where not (abs(a+t1.e*c & case when t1.b in (select -max(t1.b)*cast(avg(19) AS integer) from t1 union select -max(13) from t1) then t1.f else 19 end-f+(19)+19)/abs(t1.e)) in (d,13,e) or t1.e<=t1.e),t1.b-17)) from t1 where -11<>17 or e in (select max(19) from t1 union select (cast(avg(f) AS integer)) from t1)),a)),17))/abs(t1.e)) FROM t1 WHERE t1.e<>13 | (t1.f)+c-((13))-~13 | (abs(e)/abs(coalesce((select max(t1.c) from t1 where (d)<=t1.d),case when (exists(select 1 from t1 where not exists(select 1 from t1 where (abs(17)/abs(t1.d))>coalesce((select max(a) from t1 where t1.c not between t1.f and t1.f and f not in (t1.f, -t1.c,13)),t1.c)))) then c else 19 end))) | t1.a*11* -e*t1.c or not exists(select 1 from t1 where f>c)} -} {0} -do_test randexpr-2.2060 { - db eval {SELECT case t1.e when a then case when not exists(select 1 from t1 where (abs(~coalesce((select c from t1 where (case when not case when a between t1.b and t1.a then t1.c when -17 not in (11,t1.d,11) then a else t1.a end in (select count(distinct t1.a)+count(distinct t1.a) from t1 union select count(*) from t1) then t1.c when t1.b<(11) then f else a end>=11 and (t1.f)=11)),+11))/abs(e)) not between 17 and -t1.a) or c not between 19 and t1.b then t1.c when t1.e=11 and (t1.f)=11)),+11))/abs(e)) not between 17 and -t1.a) or c not between 19 and t1.b then t1.c when t1.e=11 and (t1.f)=11)),+11))/abs(e)) not between 17 and -t1.a) or c not between 19 and t1.b then t1.c when t1.eb),~case when b between 17 and e | coalesce((select max(a) from t1 where (f in (t1.b,f,a))),13) then f when -d<=d then t1.e else e end+13)+13 then d else d end+t1.f=d),b)+b FROM t1 WHERE b=b} -} {400} -do_test randexpr-2.2064 { - db eval {SELECT ~~coalesce((select t1.a from t1 where case f*+e when ~11-coalesce((select max(t1.f) from t1 where t1.f>b),~case when b between 17 and e | coalesce((select max(a) from t1 where (f in (t1.b,f,a))),13) then f when -d<=d then t1.e else e end+13)+13 then d else d end+t1.f=d),b)+b FROM t1 WHERE NOT (b=b)} -} {} -do_test randexpr-2.2065 { - db eval {SELECT ~~coalesce((select t1.a from t1 where case f*+e when ~11-coalesce((select max(t1.f) from t1 where t1.f>b),~case when b between 17 and e & coalesce((select max(a) from t1 where (f in (t1.b,f,a))),13) then f when -d<=d then t1.e else e end+13)+13 then d else d end+t1.f=d),b)+b FROM t1 WHERE b=b} -} {400} -do_test randexpr-2.2066 { - db eval {SELECT e | t1.e*case d when t1.e then a else case when t1.a<= -~+e then b else 17-t1.e end*c*f+case when case when +c in (select +min(11) from t1 union select cast(avg(f) AS integer) from t1) and b between c and t1.f then 11+t1.a when f>=c then d else t1.c end=c then d else t1.c end=c then d else t1.c endt1.e), -t1.d) FROM t1 WHERE t1.b between coalesce((select (coalesce((select max(case when case when not exists(select 1 from t1 where (17) not in (13,case when 19 not in (19,t1.f,t1.e) and b>=t1.a then e when b<=t1.c then 11 else b end,11)) then c | t1.a else 17 end | 19 in (c,t1.b,d) then t1.a else t1.a end | t1.c) from t1 where not exists(select 1 from t1 where t1.a<=t1.e)),t1.c)) from t1 where t1.d<=t1.a),17)*c-11 and d} -} {} -do_test randexpr-2.2070 { - db eval {SELECT coalesce((select -(select min(f)-+min(f)*~case +cast(avg(t1.e) AS integer) when max(13)-abs( -max(a)) then +count(distinct a) | abs(max( -c+13)) else (count(*)) end from t1) from t1 where t1.a<>t1.e), -t1.d) FROM t1 WHERE NOT (t1.b between coalesce((select (coalesce((select max(case when case when not exists(select 1 from t1 where (17) not in (13,case when 19 not in (19,t1.f,t1.e) and b>=t1.a then e when b<=t1.c then 11 else b end,11)) then c | t1.a else 17 end | 19 in (c,t1.b,d) then t1.a else t1.a end | t1.c) from t1 where not exists(select 1 from t1 where t1.a<=t1.e)),t1.c)) from t1 where t1.d<=t1.a),17)*c-11 and d)} -} {-1800} -do_test randexpr-2.2071 { - db eval {SELECT coalesce((select -(select min(f)-+min(f)*~case +cast(avg(t1.e) AS integer) when max(13)-abs( -max(a)) then +count(distinct a) & abs(max( -c+13)) else (count(*)) end from t1) from t1 where t1.a<>t1.e), -t1.d) FROM t1 WHERE NOT (t1.b between coalesce((select (coalesce((select max(case when case when not exists(select 1 from t1 where (17) not in (13,case when 19 not in (19,t1.f,t1.e) and b>=t1.a then e when b<=t1.c then 11 else b end,11)) then c | t1.a else 17 end | 19 in (c,t1.b,d) then t1.a else t1.a end | t1.c) from t1 where not exists(select 1 from t1 where t1.a<=t1.e)),t1.c)) from t1 where t1.d<=t1.a),17)*c-11 and d)} -} {-1800} -do_test randexpr-2.2072 { - db eval {SELECT coalesce((select c from t1 where case when +case when not 11 | c not in (11,case when 13> -d then e when a>t1.c then 17 else t1.e end,t1.b) then t1.d when c<>t1.a then t1.b else 19 end-b>=17 or 11=19 and b<=e),d) FROM t1 WHERE (+a*t1.a+(19-(abs(case -c when d then (abs(f)/abs(case t1.a when 19 then b else +~( -case t1.f*t1.a | 17 when -t1.a then d else (t1.e) end*d)+t1.a-a end)) else 13 end)/abs(11))*t1.c)+17-d not in (11,a,b))} -} {300} -do_test randexpr-2.2073 { - db eval {SELECT coalesce((select c from t1 where case when +case when not 11 | c not in (11,case when 13> -d then e when a>t1.c then 17 else t1.e end,t1.b) then t1.d when c<>t1.a then t1.b else 19 end-b>=17 or 11=19 and b<=e),d) FROM t1 WHERE NOT ((+a*t1.a+(19-(abs(case -c when d then (abs(f)/abs(case t1.a when 19 then b else +~( -case t1.f*t1.a | 17 when -t1.a then d else (t1.e) end*d)+t1.a-a end)) else 13 end)/abs(11))*t1.c)+17-d not in (11,a,b)))} -} {} -do_test randexpr-2.2074 { - db eval {SELECT coalesce((select c from t1 where case when +case when not 11 & c not in (11,case when 13> -d then e when a>t1.c then 17 else t1.e end,t1.b) then t1.d when c<>t1.a then t1.b else 19 end-b>=17 or 11=19 and b<=e),d) FROM t1 WHERE (+a*t1.a+(19-(abs(case -c when d then (abs(f)/abs(case t1.a when 19 then b else +~( -case t1.f*t1.a | 17 when -t1.a then d else (t1.e) end*d)+t1.a-a end)) else 13 end)/abs(11))*t1.c)+17-d not in (11,a,b))} -} {300} -do_test randexpr-2.2075 { - db eval {SELECT case 17 when t1.c then t1.c*f | t1.b+t1.d+b+c-t1.e+t1.c+t1.c-t1.c*t1.f else case when t1.f+case when (abs(t1.a-coalesce((select a from t1 where (t1.c) in (t1.c,d,19)), -t1.a))/abs(f)) between t1.c and a then -(t1.b) else b end not in (11, -t1.d,t1.d) then t1.d else d end end FROM t1 WHERE ~17 between (select -count(distinct b+b)++max(t1.b)*(~(max(t1.d)))-abs(cast(avg(17) AS integer)*count(*))-max(f) | count(distinct t1.a)-count(distinct 13)-cast(avg(c) AS integer) from t1) and c-case when f<>t1.e then (abs(~(a)+e+t1.a | t1.a)/abs(t1.c)) else 13 end- -t1.e} -} {400} -do_test randexpr-2.2076 { - db eval {SELECT case 17 when t1.c then t1.c*f | t1.b+t1.d+b+c-t1.e+t1.c+t1.c-t1.c*t1.f else case when t1.f+case when (abs(t1.a-coalesce((select a from t1 where (t1.c) in (t1.c,d,19)), -t1.a))/abs(f)) between t1.c and a then -(t1.b) else b end not in (11, -t1.d,t1.d) then t1.d else d end end FROM t1 WHERE NOT (~17 between (select -count(distinct b+b)++max(t1.b)*(~(max(t1.d)))-abs(cast(avg(17) AS integer)*count(*))-max(f) | count(distinct t1.a)-count(distinct 13)-cast(avg(c) AS integer) from t1) and c-case when f<>t1.e then (abs(~(a)+e+t1.a | t1.a)/abs(t1.c)) else 13 end- -t1.e)} -} {} -do_test randexpr-2.2077 { - db eval {SELECT case 17 when t1.c then t1.c*f & t1.b+t1.d+b+c-t1.e+t1.c+t1.c-t1.c*t1.f else case when t1.f+case when (abs(t1.a-coalesce((select a from t1 where (t1.c) in (t1.c,d,19)), -t1.a))/abs(f)) between t1.c and a then -(t1.b) else b end not in (11, -t1.d,t1.d) then t1.d else d end end FROM t1 WHERE ~17 between (select -count(distinct b+b)++max(t1.b)*(~(max(t1.d)))-abs(cast(avg(17) AS integer)*count(*))-max(f) | count(distinct t1.a)-count(distinct 13)-cast(avg(c) AS integer) from t1) and c-case when f<>t1.e then (abs(~(a)+e+t1.a | t1.a)/abs(t1.c)) else 13 end- -t1.e} -} {400} -do_test randexpr-2.2078 { - db eval {SELECT (select cast(avg(coalesce((select max(coalesce((select e from t1 where not ((coalesce((select b from t1 where coalesce((select max(11) from t1 where exists(select 1 from t1 where (a in (select count(*)+max(((t1.a))) from t1 union select cast(avg(a) AS integer) from t1)))),b)<=19), -b))*f=t1.e) and 17<>11 and e in (t1.f,f,17)) or a not between -a and (17)),+~b)-17*b) from t1 where t1.b>=b),t1.a)) AS integer) from t1) FROM t1 WHERE f in (select cast(avg(t1.e-f-t1.e) AS integer)+min(t1.d) from t1 union select max(case b when 11 then case case when f in (a,a,f) then t1.b when (t1.f)>d then -19 else t1.a end when 11 then a else t1.e end else (t1.b) end*a)*cast(avg(a) AS integer)+ -+cast(avg(t1.e) AS integer)*case cast(avg(t1.e) AS integer) when (cast(avg( -t1.a) AS integer)) then count(*) else count(*) end*min(t1.d)*min(e) from t1) and (a between d and t1.f)} -} {} -do_test randexpr-2.2079 { - db eval {SELECT (select cast(avg(coalesce((select max(coalesce((select e from t1 where not ((coalesce((select b from t1 where coalesce((select max(11) from t1 where exists(select 1 from t1 where (a in (select count(*)+max(((t1.a))) from t1 union select cast(avg(a) AS integer) from t1)))),b)<=19), -b))*f=t1.e) and 17<>11 and e in (t1.f,f,17)) or a not between -a and (17)),+~b)-17*b) from t1 where t1.b>=b),t1.a)) AS integer) from t1) FROM t1 WHERE NOT (f in (select cast(avg(t1.e-f-t1.e) AS integer)+min(t1.d) from t1 union select max(case b when 11 then case case when f in (a,a,f) then t1.b when (t1.f)>d then -19 else t1.a end when 11 then a else t1.e end else (t1.b) end*a)*cast(avg(a) AS integer)+ -+cast(avg(t1.e) AS integer)*case cast(avg(t1.e) AS integer) when (cast(avg( -t1.a) AS integer)) then count(*) else count(*) end*min(t1.d)*min(e) from t1) and (a between d and t1.f))} -} {-2900} -do_test randexpr-2.2080 { - db eval {SELECT case when coalesce((select max(coalesce((select max((select min(13) from t1)*d*case when not 19<>(t1.c)-d then 11 else 17 end) from t1 where 13=t1.e then t1.d when not exists(select 1 from t1 where t1.c in (select (count(*)) from t1 union select +count(*) from t1)) then t1.c else 19 end FROM t1 WHERE ((11>=11))} -} {300} -do_test randexpr-2.2081 { - db eval {SELECT case when coalesce((select max(coalesce((select max((select min(13) from t1)*d*case when not 19<>(t1.c)-d then 11 else 17 end) from t1 where 13=t1.e then t1.d when not exists(select 1 from t1 where t1.c in (select (count(*)) from t1 union select +count(*) from t1)) then t1.c else 19 end FROM t1 WHERE NOT (((11>=11)))} -} {} -do_test randexpr-2.2082 { - db eval {SELECT -case when 19 in (select abs((count(*))) from t1 union select abs(min(t1.f)*min(e*e)) from t1) and case when not not (17>a) or d>=c and (19)<=t1.b and - -t1.f<>t1.f then f when t1.b between d and t1.f then case when t1.e=e then coalesce((select max(d) from t1 where t1.b>=b),a) when t1.a not between c and e then e else 13 end else (17) end>t1.d then b else b end+t1.b-a FROM t1 WHERE exists(select 1 from t1 where +coalesce((select 19 from t1 where not exists(select 1 from t1 where exists(select 1 from t1 where case when (select max(11-(select +count(distinct +case + -coalesce((select t1.d from t1 where exists(select 1 from t1 where (b)>t1.c)),t1.f)*11 when -a then 19 else 19 end) from t1)) from t1)<=t1.d-c then f when exists(select 1 from t1 where t1.f not between b and a) then -d else t1.d end not in (t1.b,t1.e, -t1.f)))),f) not in (f,e,13))} -} {} -do_test randexpr-2.2083 { - db eval {SELECT -case when 19 in (select abs((count(*))) from t1 union select abs(min(t1.f)*min(e*e)) from t1) and case when not not (17>a) or d>=c and (19)<=t1.b and - -t1.f<>t1.f then f when t1.b between d and t1.f then case when t1.e=e then coalesce((select max(d) from t1 where t1.b>=b),a) when t1.a not between c and e then e else 13 end else (17) end>t1.d then b else b end+t1.b-a FROM t1 WHERE NOT (exists(select 1 from t1 where +coalesce((select 19 from t1 where not exists(select 1 from t1 where exists(select 1 from t1 where case when (select max(11-(select +count(distinct +case + -coalesce((select t1.d from t1 where exists(select 1 from t1 where (b)>t1.c)),t1.f)*11 when -a then 19 else 19 end) from t1)) from t1)<=t1.d-c then f when exists(select 1 from t1 where t1.f not between b and a) then -d else t1.d end not in (t1.b,t1.e, -t1.f)))),f) not in (f,e,13)))} -} {-100} -do_test randexpr-2.2084 { - db eval {SELECT coalesce((select max(b) from t1 where d not between a-t1.e and a),coalesce((select max(t1.c) from t1 where exists(select 1 from t1 where t1.ee or 11 between b and 13} -} {200} -do_test randexpr-2.2085 { - db eval {SELECT coalesce((select max(b) from t1 where d not between a-t1.e and a),coalesce((select max(t1.c) from t1 where exists(select 1 from t1 where t1.ee or 11 between b and 13)} -} {} -do_test randexpr-2.2086 { - db eval {SELECT (select case count(*) when ~(case case -abs(count(*) | (case case ~case -count(distinct case when t1.a< -t1.d then b when 19 in (t1.e, - -19,t1.b) then t1.c else t1.f end)-count(distinct (t1.f)) when count(*) then max(c) else count(distinct 17) end when count(*) then ((cast(avg(b) AS integer))) else -count(*) end when -count(distinct t1.f) then count(distinct t1.a) else count(distinct t1.e) end))+count(*) when cast(avg(19) AS integer) then -min( -t1.c) else count(*) end when (min(t1.e)) then cast(avg(c) AS integer) else min(t1.f) end) then min(e) else count(*) end | max(11) from t1)+19 FROM t1 WHERE case when (((d not between (+t1.a-coalesce((select max(b*t1.b* -t1.f) from t1 where a>a),13)) and a)) and c>=d or fe and t1.c< -11 and f<>b or t1.b<17),c) else t1.a end>=11} -} {30} -do_test randexpr-2.2087 { - db eval {SELECT (select case count(*) when ~(case case -abs(count(*) | (case case ~case -count(distinct case when t1.a< -t1.d then b when 19 in (t1.e, - -19,t1.b) then t1.c else t1.f end)-count(distinct (t1.f)) when count(*) then max(c) else count(distinct 17) end when count(*) then ((cast(avg(b) AS integer))) else -count(*) end when -count(distinct t1.f) then count(distinct t1.a) else count(distinct t1.e) end))+count(*) when cast(avg(19) AS integer) then -min( -t1.c) else count(*) end when (min(t1.e)) then cast(avg(c) AS integer) else min(t1.f) end) then min(e) else count(*) end | max(11) from t1)+19 FROM t1 WHERE NOT (case when (((d not between (+t1.a-coalesce((select max(b*t1.b* -t1.f) from t1 where a>a),13)) and a)) and c>=d or fe and t1.c< -11 and f<>b or t1.b<17),c) else t1.a end>=11)} -} {} -do_test randexpr-2.2088 { - db eval {SELECT (select case count(*) when ~(case case -abs(count(*) & (case case ~case -count(distinct case when t1.a< -t1.d then b when 19 in (t1.e, - -19,t1.b) then t1.c else t1.f end)-count(distinct (t1.f)) when count(*) then max(c) else count(distinct 17) end when count(*) then ((cast(avg(b) AS integer))) else -count(*) end when -count(distinct t1.f) then count(distinct t1.a) else count(distinct t1.e) end))+count(*) when cast(avg(19) AS integer) then -min( -t1.c) else count(*) end when (min(t1.e)) then cast(avg(c) AS integer) else min(t1.f) end) then min(e) else count(*) end & max(11) from t1)+19 FROM t1 WHERE case when (((d not between (+t1.a-coalesce((select max(b*t1.b* -t1.f) from t1 where a>a),13)) and a)) and c>=d or fe and t1.c< -11 and f<>b or t1.b<17),c) else t1.a end>=11} -} {20} -do_test randexpr-2.2089 { - db eval {SELECT case when case when t1.a*~t1.a-19-c | 17+t1.d*f*c=d then f else -13 end+t1.b+a in (t1.f,t1.d,t1.f) and (not c=11) and t1.e<>f then coalesce((select f from t1 where t1.d not in (t1.e,f,11)), -17) else f end-b FROM t1 WHERE not exists(select 1 from t1 where +d between d*13 and ((abs(13+e+e)/abs(+case when not t1.c in (~(select cast(avg(case e when b then 11 else 13 end) AS integer) from t1)*b*17,t1.e,t1.e) then 11* -c when t1.f in (select min(e)*count(distinct c) from t1 union select - - - -max(e) | cast(avg((d)) AS integer) from t1) then (c) else e end)))) or d<17} -} {400} -do_test randexpr-2.2090 { - db eval {SELECT case when case when t1.a*~t1.a-19-c | 17+t1.d*f*c=d then f else -13 end+t1.b+a in (t1.f,t1.d,t1.f) and (not c=11) and t1.e<>f then coalesce((select f from t1 where t1.d not in (t1.e,f,11)), -17) else f end-b FROM t1 WHERE NOT (not exists(select 1 from t1 where +d between d*13 and ((abs(13+e+e)/abs(+case when not t1.c in (~(select cast(avg(case e when b then 11 else 13 end) AS integer) from t1)*b*17,t1.e,t1.e) then 11* -c when t1.f in (select min(e)*count(distinct c) from t1 union select - - - -max(e) | cast(avg((d)) AS integer) from t1) then (c) else e end)))) or d<17)} -} {} -do_test randexpr-2.2091 { - db eval {SELECT case when case when t1.a*~t1.a-19-c & 17+t1.d*f*c=d then f else -13 end+t1.b+a in (t1.f,t1.d,t1.f) and (not c=11) and t1.e<>f then coalesce((select f from t1 where t1.d not in (t1.e,f,11)), -17) else f end-b FROM t1 WHERE not exists(select 1 from t1 where +d between d*13 and ((abs(13+e+e)/abs(+case when not t1.c in (~(select cast(avg(case e when b then 11 else 13 end) AS integer) from t1)*b*17,t1.e,t1.e) then 11* -c when t1.f in (select min(e)*count(distinct c) from t1 union select - - - -max(e) | cast(avg((d)) AS integer) from t1) then (c) else e end)))) or d<17} -} {400} -do_test randexpr-2.2092 { - db eval {SELECT coalesce((select c from t1 where t1.b between t1.b and -17),coalesce((select -t1.e from t1 where (select count(distinct coalesce((select case t1.b-t1.a*(b)*13 when 11 then (a) else 11 end from t1 where a not in ((t1.e),c,11) and e>b),13)) from t1) in (t1.d,b,13) and not t1.b<13 or 11<> -17 or (11)>17 or t1.f not between b and (t1.a)),(b))) FROM t1 WHERE ((+case +d when f then (d) else case t1.f-(b)-11 when d then -t1.c else a end end not in ( -17,(t1.d),13) and (11 not in ((c),t1.f,t1.d)) and (e in (select 13 from t1 union select t1.a from t1) and d in (select t1.e from t1 union select 19 from t1))) or exists(select 1 from t1 where -t1.a= -t1.d)) and exists(select 1 from t1 where t1.b not between f and e or 19>=t1.d)} -} {} -do_test randexpr-2.2093 { - db eval {SELECT coalesce((select c from t1 where t1.b between t1.b and -17),coalesce((select -t1.e from t1 where (select count(distinct coalesce((select case t1.b-t1.a*(b)*13 when 11 then (a) else 11 end from t1 where a not in ((t1.e),c,11) and e>b),13)) from t1) in (t1.d,b,13) and not t1.b<13 or 11<> -17 or (11)>17 or t1.f not between b and (t1.a)),(b))) FROM t1 WHERE NOT (((+case +d when f then (d) else case t1.f-(b)-11 when d then -t1.c else a end end not in ( -17,(t1.d),13) and (11 not in ((c),t1.f,t1.d)) and (e in (select 13 from t1 union select t1.a from t1) and d in (select t1.e from t1 union select 19 from t1))) or exists(select 1 from t1 where -t1.a= -t1.d)) and exists(select 1 from t1 where t1.b not between f and e or 19>=t1.d))} -} {-500} -do_test randexpr-2.2094 { - db eval {SELECT case d when f then case when (abs(coalesce((select ~f*case when t1.f<(select -count(distinct (select count(*)-min(13) from t1)) from t1) then d when t1.d between t1.b and f and not (t1.b between ( -t1.f) and f) then -d else b end-b | t1.f*17 from t1 where ((d>t1.d))),17))/abs(11))-13=t1.c then a else 11 end else b end FROM t1 WHERE t1.b between coalesce((select case when coalesce((select t1.c from t1 where not ((t1.a>=11+17 and (13+(11)<>13))) and b<=c and c in (c, -c,(e)) and d not in (f,b,c) or t1.d>=13 and 13 between 19 and a),d) not between 13-case when t1.f<>t1.b then t1.f else t1.c end | d and d then b when c= -d),19) and c} -} {} -do_test randexpr-2.2095 { - db eval {SELECT case d when f then case when (abs(coalesce((select ~f*case when t1.f<(select -count(distinct (select count(*)-min(13) from t1)) from t1) then d when t1.d between t1.b and f and not (t1.b between ( -t1.f) and f) then -d else b end-b | t1.f*17 from t1 where ((d>t1.d))),17))/abs(11))-13=t1.c then a else 11 end else b end FROM t1 WHERE NOT (t1.b between coalesce((select case when coalesce((select t1.c from t1 where not ((t1.a>=11+17 and (13+(11)<>13))) and b<=c and c in (c, -c,(e)) and d not in (f,b,c) or t1.d>=13 and 13 between 19 and a),d) not between 13-case when t1.f<>t1.b then t1.f else t1.c end | d and d then b when c= -d),19) and c)} -} {200} -do_test randexpr-2.2096 { - db eval {SELECT case d when f then case when (abs(coalesce((select ~f*case when t1.f<(select -count(distinct (select count(*)-min(13) from t1)) from t1) then d when t1.d between t1.b and f and not (t1.b between ( -t1.f) and f) then -d else b end-b & t1.f*17 from t1 where ((d>t1.d))),17))/abs(11))-13=t1.c then a else 11 end else b end FROM t1 WHERE NOT (t1.b between coalesce((select case when coalesce((select t1.c from t1 where not ((t1.a>=11+17 and (13+(11)<>13))) and b<=c and c in (c, -c,(e)) and d not in (f,b,c) or t1.d>=13 and 13 between 19 and a),d) not between 13-case when t1.f<>t1.b then t1.f else t1.c end | d and d then b when c= -d),19) and c)} -} {200} -do_test randexpr-2.2097 { - db eval {SELECT (coalesce((select case when exists(select 1 from t1 where case when (t1.b)>=f+e*coalesce((select max( -+t1.c) from t1 where case a when e then e else 11 end in (select 17 from t1 union select d from t1) or e not between d and a),t1.f) then ( -t1.d) else e end in (11,c,b)) then 17 else t1.f end+t1.f from t1 where not d in ((b),(f),11) and t1.f=t1.b and 19<13 then 19 else 13 end=19) and b not in (c,t1.a,d) or b between e and -t1.f or t1.b between t1.e and c and t1.a<=t1.d} -} {} -do_test randexpr-2.2098 { - db eval {SELECT (coalesce((select case when exists(select 1 from t1 where case when (t1.b)>=f+e*coalesce((select max( -+t1.c) from t1 where case a when e then e else 11 end in (select 17 from t1 union select d from t1) or e not between d and a),t1.f) then ( -t1.d) else e end in (11,c,b)) then 17 else t1.f end+t1.f from t1 where not d in ((b),(f),11) and t1.f=t1.b and 19<13 then 19 else 13 end=19) and b not in (c,t1.a,d) or b between e and -t1.f or t1.b between t1.e and c and t1.a<=t1.d)} -} {19} -do_test randexpr-2.2099 { - db eval {SELECT 11+17+case when case 17 when coalesce((select max(d) from t1 where 13+(t1.c-e)+19+e-t1.e>=b and not 11 not in (19,t1.e,13) and (t1.f)>b),19)*19 then c else -d end not in (c,19,t1.c) then d when d<=t1.d then 13 else 11 end+ -a FROM t1 WHERE coalesce((select max(~t1.f) from t1 where (13*t1.e)<=case when 17 | a<=t1.e then coalesce((select max(19) from t1 where case when not not exists(select 1 from t1 where 19 in (t1.d+19,11,t1.f) or not exists(select 1 from t1 where a=t1.c then - -11 else t1.b end else f end-f<=b),t1.b) else t1.e end),f)-19>=13} -} {328} -do_test randexpr-2.2100 { - db eval {SELECT 11+17+case when case 17 when coalesce((select max(d) from t1 where 13+(t1.c-e)+19+e-t1.e>=b and not 11 not in (19,t1.e,13) and (t1.f)>b),19)*19 then c else -d end not in (c,19,t1.c) then d when d<=t1.d then 13 else 11 end+ -a FROM t1 WHERE NOT (coalesce((select max(~t1.f) from t1 where (13*t1.e)<=case when 17 | a<=t1.e then coalesce((select max(19) from t1 where case when not not exists(select 1 from t1 where 19 in (t1.d+19,11,t1.f) or not exists(select 1 from t1 where a=t1.c then - -11 else t1.b end else f end-f<=b),t1.b) else t1.e end),f)-19>=13)} -} {} -do_test randexpr-2.2101 { - db eval {SELECT coalesce((select max(t1.a+(select count(distinct 11-case when coalesce((select max(11) from t1 where t1.f<(t1.a)-t1.b),b) in (select ~abs(min(c-case when (case 13 when -coalesce((select (t1.e) from t1 where -a not in (f,t1.d,d)),(11)) then b else t1.e end not between b and -t1.e) then e else t1.a end)) | count(*) from t1 union select -min(17) from t1) then t1.a else t1.d end) from t1)-t1.b) from t1 where 1711) then e else a end-t1.c+(d)*(13) in (select ~count(distinct (t1.f))+ -~ -count(distinct t1.e)+(min(13)) from t1 union select cast(avg(11) AS integer) from t1) or t1.e<>t1.f)) then f when not a<19 then coalesce((select max(11) from t1 where (t1.d) between -d and -t1.e or t1.f not between d and a and -b=19),t1.b) else +t1.f end not between a and e} -} {-99} -do_test randexpr-2.2102 { - db eval {SELECT coalesce((select max(t1.a+(select count(distinct 11-case when coalesce((select max(11) from t1 where t1.f<(t1.a)-t1.b),b) in (select ~abs(min(c-case when (case 13 when -coalesce((select (t1.e) from t1 where -a not in (f,t1.d,d)),(11)) then b else t1.e end not between b and -t1.e) then e else t1.a end)) | count(*) from t1 union select -min(17) from t1) then t1.a else t1.d end) from t1)-t1.b) from t1 where 1711) then e else a end-t1.c+(d)*(13) in (select ~count(distinct (t1.f))+ -~ -count(distinct t1.e)+(min(13)) from t1 union select cast(avg(11) AS integer) from t1) or t1.e<>t1.f)) then f when not a<19 then coalesce((select max(11) from t1 where (t1.d) between -d and -t1.e or t1.f not between d and a and -b=19),t1.b) else +t1.f end not between a and e)} -} {} -do_test randexpr-2.2103 { - db eval {SELECT coalesce((select max(t1.a+(select count(distinct 11-case when coalesce((select max(11) from t1 where t1.f<(t1.a)-t1.b),b) in (select ~abs(min(c-case when (case 13 when -coalesce((select (t1.e) from t1 where -a not in (f,t1.d,d)),(11)) then b else t1.e end not between b and -t1.e) then e else t1.a end)) & count(*) from t1 union select -min(17) from t1) then t1.a else t1.d end) from t1)-t1.b) from t1 where 1711) then e else a end-t1.c+(d)*(13) in (select ~count(distinct (t1.f))+ -~ -count(distinct t1.e)+(min(13)) from t1 union select cast(avg(11) AS integer) from t1) or t1.e<>t1.f)) then f when not a<19 then coalesce((select max(11) from t1 where (t1.d) between -d and -t1.e or t1.f not between d and a and -b=19),t1.b) else +t1.f end not between a and e} -} {-99} -do_test randexpr-2.2104 { - db eval {SELECT t1.b-case when 13 not between 13 and (select +count(*) from t1) then t1.e when +11 in (coalesce((select t1.f from t1 where d-((f))*coalesce((select d from t1 where 17 between ~(select max(d) | count(*) | cast(avg(e) AS integer)+count(*) from t1) and case when c<13 or 17>13 then a else e end-t1.b),e)-t1.a<=(t1.e)),19),b,13) then e else b end-t1.b FROM t1 WHERE t1.b>=coalesce((select max(d-c) from t1 where exists(select 1 from t1 where (~a*(select -count(distinct 11-d*13+d+19) from t1)* -b in (f,t1.d-c,a-(abs(c)/abs(case when (abs(13- -(19))/abs(t1.f)) in (select c from t1 union select -a from t1) then t1.c when b<=c then t1.a else -13 end)))))),19)} -} {-500} -do_test randexpr-2.2105 { - db eval {SELECT t1.b-case when 13 not between 13 and (select +count(*) from t1) then t1.e when +11 in (coalesce((select t1.f from t1 where d-((f))*coalesce((select d from t1 where 17 between ~(select max(d) | count(*) | cast(avg(e) AS integer)+count(*) from t1) and case when c<13 or 17>13 then a else e end-t1.b),e)-t1.a<=(t1.e)),19),b,13) then e else b end-t1.b FROM t1 WHERE NOT (t1.b>=coalesce((select max(d-c) from t1 where exists(select 1 from t1 where (~a*(select -count(distinct 11-d*13+d+19) from t1)* -b in (f,t1.d-c,a-(abs(c)/abs(case when (abs(13- -(19))/abs(t1.f)) in (select c from t1 union select -a from t1) then t1.c when b<=c then t1.a else -13 end)))))),19))} -} {} -do_test randexpr-2.2106 { - db eval {SELECT t1.b-case when 13 not between 13 and (select +count(*) from t1) then t1.e when +11 in (coalesce((select t1.f from t1 where d-((f))*coalesce((select d from t1 where 17 between ~(select max(d) & count(*) & cast(avg(e) AS integer)+count(*) from t1) and case when c<13 or 17>13 then a else e end-t1.b),e)-t1.a<=(t1.e)),19),b,13) then e else b end-t1.b FROM t1 WHERE t1.b>=coalesce((select max(d-c) from t1 where exists(select 1 from t1 where (~a*(select -count(distinct 11-d*13+d+19) from t1)* -b in (f,t1.d-c,a-(abs(c)/abs(case when (abs(13- -(19))/abs(t1.f)) in (select c from t1 union select -a from t1) then t1.c when b<=c then t1.a else -13 end)))))),19)} -} {-500} -do_test randexpr-2.2107 { - db eval {SELECT t1.f*case when c*case when t1.d*t1.b-(~19) in (select (cast(avg(d-t1.d) AS integer)) from t1 union select min(11)+cast(avg(e) AS integer) | abs(count(distinct t1.a) | min(19)) from t1) then t1.d when not 11 not in (d,t1.e,13) then t1.a else 11 end in (select (t1.c) from t1 union select 11 from t1) or t1.e not in (f, -t1.f,t1.e) then c else d end FROM t1 WHERE case when t1.e=t1.c and (abs(case when (11* -17 not in (c,t1.f-t1.c-coalesce((select max(c) from t1 where c in (select min(19) from t1 union select ~count(*)*max(t1.f) from t1)),a),t1.a)) then coalesce((select max(17) from t1 where -b>=(t1.c)),19) else f end+19)/abs(t1.f))*t1.d between d and b then t1.b-t1.e else c end=19} -} {} -do_test randexpr-2.2108 { - db eval {SELECT t1.f*case when c*case when t1.d*t1.b-(~19) in (select (cast(avg(d-t1.d) AS integer)) from t1 union select min(11)+cast(avg(e) AS integer) | abs(count(distinct t1.a) | min(19)) from t1) then t1.d when not 11 not in (d,t1.e,13) then t1.a else 11 end in (select (t1.c) from t1 union select 11 from t1) or t1.e not in (f, -t1.f,t1.e) then c else d end FROM t1 WHERE NOT (case when t1.e=t1.c and (abs(case when (11* -17 not in (c,t1.f-t1.c-coalesce((select max(c) from t1 where c in (select min(19) from t1 union select ~count(*)*max(t1.f) from t1)),a),t1.a)) then coalesce((select max(17) from t1 where -b>=(t1.c)),19) else f end+19)/abs(t1.f))*t1.d between d and b then t1.b-t1.e else c end=19)} -} {240000} -do_test randexpr-2.2109 { - db eval {SELECT t1.f*case when c*case when t1.d*t1.b-(~19) in (select (cast(avg(d-t1.d) AS integer)) from t1 union select min(11)+cast(avg(e) AS integer) & abs(count(distinct t1.a) & min(19)) from t1) then t1.d when not 11 not in (d,t1.e,13) then t1.a else 11 end in (select (t1.c) from t1 union select 11 from t1) or t1.e not in (f, -t1.f,t1.e) then c else d end FROM t1 WHERE NOT (case when t1.e=t1.c and (abs(case when (11* -17 not in (c,t1.f-t1.c-coalesce((select max(c) from t1 where c in (select min(19) from t1 union select ~count(*)*max(t1.f) from t1)),a),t1.a)) then coalesce((select max(17) from t1 where -b>=(t1.c)),19) else f end+19)/abs(t1.f))*t1.d between d and b then t1.b-t1.e else c end=19)} -} {240000} -do_test randexpr-2.2110 { - db eval {SELECT coalesce((select max((abs(t1.d)/abs((coalesce((select c from t1 where (abs(+f)/abs(t1.b))-t1.a between 13 and case (13+c+((abs(coalesce((select 11 from t1 where 11+19a then (coalesce((select -e from t1 where case coalesce((select case when 19 in (select t1.e from t1 union select f from t1) then b when t1.c=11 then a else (13) end from t1 where t1.a in (select ( -cast(avg(13) AS integer)+max(t1.e)) from t1 union select cast(avg(19) AS integer) from t1)),19) when f then f else ( -t1.c) end+17<=e and a>=t1.b or t1.c>=b),t1.e)) else e end)>=e),b)+f FROM t1 WHERE exists(select 1 from t1 where 17 in (select -abs(case (min(t1.b)) when count(*)*max(a) then -abs((max(e))) | ~max( -coalesce((select max(coalesce((select e from t1 where f>=11 or exists(select 1 from t1 where 11 not in (11,t1.c,f))),d)) from t1 where 13=t1.d and 17<>f),t1.d))+count(distinct t1.e) else count(*)+~cast(avg(t1.f) AS integer) end | count(distinct t1.a))+count(distinct t1.a) from t1 union select count(*) from t1))} -} {} -do_test randexpr-2.2113 { - db eval {SELECT f+coalesce((select max(t1.f) from t1 where (case when 13<>a then (coalesce((select -e from t1 where case coalesce((select case when 19 in (select t1.e from t1 union select f from t1) then b when t1.c=11 then a else (13) end from t1 where t1.a in (select ( -cast(avg(13) AS integer)+max(t1.e)) from t1 union select cast(avg(19) AS integer) from t1)),19) when f then f else ( -t1.c) end+17<=e and a>=t1.b or t1.c>=b),t1.e)) else e end)>=e),b)+f FROM t1 WHERE NOT (exists(select 1 from t1 where 17 in (select -abs(case (min(t1.b)) when count(*)*max(a) then -abs((max(e))) | ~max( -coalesce((select max(coalesce((select e from t1 where f>=11 or exists(select 1 from t1 where 11 not in (11,t1.c,f))),d)) from t1 where 13=t1.d and 17<>f),t1.d))+count(distinct t1.e) else count(*)+~cast(avg(t1.f) AS integer) end | count(distinct t1.a))+count(distinct t1.a) from t1 union select count(*) from t1)))} -} {1400} -do_test randexpr-2.2114 { - db eval {SELECT case when case when (abs( -t1.b)/abs(case case case (select ~ -(+abs(case min(19) when (( -min(t1.e))) then count(distinct (t1.e)) else cast(avg(11) AS integer) end)) from t1) when t1.e then (select min(19) from t1) else 17 end when (13)-a*17 then t1.d else t1.a end when a then 19 else -( -f) end))>=d then t1.e else 13 end between f and 19 then f when t1.c<=t1.a or (t1.b>(11)) then 11 else t1.b end FROM t1 WHERE t1.c in (select case when 11<17 then case when (t1.b*coalesce((select (abs((coalesce((select a-19 from t1 where t1.c between e and f and d<>17 and t1.d not between 19 and 19),a)))/abs(t1.c))+t1.b-17 from t1 where c=a), -t1.d)+c>t1.f) then -13+(t1.e) when 11<>t1.c then 13 else t1.c end when 11=c then t1.c else (c) end from t1 union select t1.e from t1)} -} {} -do_test randexpr-2.2115 { - db eval {SELECT case when case when (abs( -t1.b)/abs(case case case (select ~ -(+abs(case min(19) when (( -min(t1.e))) then count(distinct (t1.e)) else cast(avg(11) AS integer) end)) from t1) when t1.e then (select min(19) from t1) else 17 end when (13)-a*17 then t1.d else t1.a end when a then 19 else -( -f) end))>=d then t1.e else 13 end between f and 19 then f when t1.c<=t1.a or (t1.b>(11)) then 11 else t1.b end FROM t1 WHERE NOT (t1.c in (select case when 11<17 then case when (t1.b*coalesce((select (abs((coalesce((select a-19 from t1 where t1.c between e and f and d<>17 and t1.d not between 19 and 19),a)))/abs(t1.c))+t1.b-17 from t1 where c=a), -t1.d)+c>t1.f) then -13+(t1.e) when 11<>t1.c then 13 else t1.c end when 11=c then t1.c else (c) end from t1 union select t1.e from t1))} -} {11} -do_test randexpr-2.2116 { - db eval {SELECT t1.e+coalesce((select case t1.a-case when t1.a in (case (abs(coalesce((select t1.e from t1 where t1.a>t1.b),~c))/abs(t1.b))* -(select count(distinct t1.c)-cast(avg(coalesce((select 19 from t1 where c not between (abs(b-11)/abs( -t1.e)) and (17)),17)) AS integer) from t1) when t1.e then f else 17 end,t1.c,t1.c) then d else t1.e end when d then 17 else 13 end from t1 where 11<11),t1.f) FROM t1 WHERE 11* -19 in (select case when ~coalesce((select t1.b from t1 where coalesce((select d from t1 where t1.a=17*~e+t1.d*case when 11< -~t1.b*t1.b*c+a then (c) else 19 end*a),e)>e),11)<=19 then t1.c when (not exists(select 1 from t1 where t1.d<17)) then b else c end from t1 union select t1.a from t1)} -} {} -do_test randexpr-2.2117 { - db eval {SELECT t1.e+coalesce((select case t1.a-case when t1.a in (case (abs(coalesce((select t1.e from t1 where t1.a>t1.b),~c))/abs(t1.b))* -(select count(distinct t1.c)-cast(avg(coalesce((select 19 from t1 where c not between (abs(b-11)/abs( -t1.e)) and (17)),17)) AS integer) from t1) when t1.e then f else 17 end,t1.c,t1.c) then d else t1.e end when d then 17 else 13 end from t1 where 11<11),t1.f) FROM t1 WHERE NOT (11* -19 in (select case when ~coalesce((select t1.b from t1 where coalesce((select d from t1 where t1.a=17*~e+t1.d*case when 11< -~t1.b*t1.b*c+a then (c) else 19 end*a),e)>e),11)<=19 then t1.c when (not exists(select 1 from t1 where t1.d<17)) then b else c end from t1 union select t1.a from t1))} -} {1100} -do_test randexpr-2.2118 { - db eval {SELECT 19* -coalesce((select coalesce((select t1.d*17 from t1 where t1.b<=t1.b+17), -(a | 17)) from t1 where t1.d in (select case abs(count(*))*count(distinct (17)) when max(11) then abs(+max(13)-case -cast(avg(t1.d) AS integer)- -(max(19))-count(distinct d) when min(t1.c) then cast(avg(c) AS integer) else count(distinct t1.f) end | max(c)) else max(t1.d) end from t1 union select count(*) from t1)),t1.f)-t1.e+c FROM t1 WHERE ~(abs(case 17 when d then coalesce((select t1.d from t1 where 13 in (select t1.d-f | case when (17 in (t1.a,19,t1.f)) then case when a*f in (select e from t1 union select t1.a from t1) or 11=t1.c or t1.a>=(19) and ( -b)13 then b when t1.e in (t1.c, -t1.b,a) then 19 else 19 end else a end from t1 union select t1.b from t1)),d) else 13 end)/abs(11))+19*t1.e in (e, -t1.e,a)} -} {} -do_test randexpr-2.2119 { - db eval {SELECT 19* -coalesce((select coalesce((select t1.d*17 from t1 where t1.b<=t1.b+17), -(a | 17)) from t1 where t1.d in (select case abs(count(*))*count(distinct (17)) when max(11) then abs(+max(13)-case -cast(avg(t1.d) AS integer)- -(max(19))-count(distinct d) when min(t1.c) then cast(avg(c) AS integer) else count(distinct t1.f) end | max(c)) else max(t1.d) end from t1 union select count(*) from t1)),t1.f)-t1.e+c FROM t1 WHERE NOT (~(abs(case 17 when d then coalesce((select t1.d from t1 where 13 in (select t1.d-f | case when (17 in (t1.a,19,t1.f)) then case when a*f in (select e from t1 union select t1.a from t1) or 11=t1.c or t1.a>=(19) and ( -b)13 then b when t1.e in (t1.c, -t1.b,a) then 19 else 19 end else a end from t1 union select t1.b from t1)),d) else 13 end)/abs(11))+19*t1.e in (e, -t1.e,a))} -} {-129400} -do_test randexpr-2.2120 { - db eval {SELECT 19* -coalesce((select coalesce((select t1.d*17 from t1 where t1.b<=t1.b+17), -(a & 17)) from t1 where t1.d in (select case abs(count(*))*count(distinct (17)) when max(11) then abs(+max(13)-case -cast(avg(t1.d) AS integer)- -(max(19))-count(distinct d) when min(t1.c) then cast(avg(c) AS integer) else count(distinct t1.f) end & max(c)) else max(t1.d) end from t1 union select count(*) from t1)),t1.f)-t1.e+c FROM t1 WHERE NOT (~(abs(case 17 when d then coalesce((select t1.d from t1 where 13 in (select t1.d-f | case when (17 in (t1.a,19,t1.f)) then case when a*f in (select e from t1 union select t1.a from t1) or 11=t1.c or t1.a>=(19) and ( -b)13 then b when t1.e in (t1.c, -t1.b,a) then 19 else 19 end else a end from t1 union select t1.b from t1)),d) else 13 end)/abs(11))+19*t1.e in (e, -t1.e,a))} -} {-129400} -do_test randexpr-2.2121 { - db eval {SELECT case t1.f when f then t1.a-case d+t1.d+coalesce((select (select cast(avg( -case when t1.d in (select -min(17)-count(*)+max(f) from t1 union select -count(distinct 13) from t1) then t1.e else a end*a) AS integer) from t1)-t1.d from t1 where -t1.b not in (11, -(t1.b),t1.d) and c in (select b from t1 union select 19 from t1) and t1.a in (select -e from t1 union select t1.e from t1)),a)*t1.f when 19 then t1.f else 11 end else c end FROM t1 WHERE t1.c>11} -} {89} -do_test randexpr-2.2122 { - db eval {SELECT case t1.f when f then t1.a-case d+t1.d+coalesce((select (select cast(avg( -case when t1.d in (select -min(17)-count(*)+max(f) from t1 union select -count(distinct 13) from t1) then t1.e else a end*a) AS integer) from t1)-t1.d from t1 where -t1.b not in (11, -(t1.b),t1.d) and c in (select b from t1 union select 19 from t1) and t1.a in (select -e from t1 union select t1.e from t1)),a)*t1.f when 19 then t1.f else 11 end else c end FROM t1 WHERE NOT (t1.c>11)} -} {} -do_test randexpr-2.2123 { - db eval {SELECT case when (case when (e not in (e | e,17,e)) then 13 else t1.b end>+t1.b*f-b+t1.d-e) or 19 between b and t1.a then 11 when exists(select 1 from t1 where (t1.d) | t1.d in (case when (e>=(11)) or (t1.a)>=t1.f then c-b when t1.c<>t1.e then t1.a else (17) end,c,13)) then 17 else t1.b end FROM t1 WHERE (select min(case when a not in (coalesce((select 19 from t1 where t1.f<((abs(e)/abs(t1.a+e)) | d)-e),e),t1.f,t1.a) then c else 13 end)-(count(distinct d)-abs(count(distinct t1.c)-cast(avg(d) AS integer) | min(b)+(cast(avg(19) AS integer) | case count(distinct t1.c) when cast(avg( -t1.b) AS integer) then cast(avg(t1.a) AS integer) else max(13) end))) from t1) not between b | a and 19} -} {200} -do_test randexpr-2.2124 { - db eval {SELECT case when (case when (e not in (e | e,17,e)) then 13 else t1.b end>+t1.b*f-b+t1.d-e) or 19 between b and t1.a then 11 when exists(select 1 from t1 where (t1.d) | t1.d in (case when (e>=(11)) or (t1.a)>=t1.f then c-b when t1.c<>t1.e then t1.a else (17) end,c,13)) then 17 else t1.b end FROM t1 WHERE NOT ((select min(case when a not in (coalesce((select 19 from t1 where t1.f<((abs(e)/abs(t1.a+e)) | d)-e),e),t1.f,t1.a) then c else 13 end)-(count(distinct d)-abs(count(distinct t1.c)-cast(avg(d) AS integer) | min(b)+(cast(avg(19) AS integer) | case count(distinct t1.c) when cast(avg( -t1.b) AS integer) then cast(avg(t1.a) AS integer) else max(13) end))) from t1) not between b | a and 19)} -} {} -do_test randexpr-2.2125 { - db eval {SELECT case when (case when (e not in (e & e,17,e)) then 13 else t1.b end>+t1.b*f-b+t1.d-e) or 19 between b and t1.a then 11 when exists(select 1 from t1 where (t1.d) & t1.d in (case when (e>=(11)) or (t1.a)>=t1.f then c-b when t1.c<>t1.e then t1.a else (17) end,c,13)) then 17 else t1.b end FROM t1 WHERE (select min(case when a not in (coalesce((select 19 from t1 where t1.f<((abs(e)/abs(t1.a+e)) | d)-e),e),t1.f,t1.a) then c else 13 end)-(count(distinct d)-abs(count(distinct t1.c)-cast(avg(d) AS integer) | min(b)+(cast(avg(19) AS integer) | case count(distinct t1.c) when cast(avg( -t1.b) AS integer) then cast(avg(t1.a) AS integer) else max(13) end))) from t1) not between b | a and 19} -} {200} -do_test randexpr-2.2126 { - db eval {SELECT case when case when t1.c+13<13 then 11 when (t1.b) not in (t1.b,e,t1.c) then t1.f else -t1.c end- -a | 13 in (select max(a) from t1 union select count(distinct 17)* -case count(*) when count(*) then -((count(distinct 17))) else max(t1.b) end | ( -count(*)) from t1) and e<=17 and t1.c<=d then coalesce((select max(coalesce((select max(e) from t1 where t1.f not in (e,17,t1.b) and d= -t1.b),t1.d)) from t1 where t1.d(f) then t1.e else 17 end else t1.c end-19} -} {200} -do_test randexpr-2.2127 { - db eval {SELECT case when case when t1.c+13<13 then 11 when (t1.b) not in (t1.b,e,t1.c) then t1.f else -t1.c end- -a | 13 in (select max(a) from t1 union select count(distinct 17)* -case count(*) when count(*) then -((count(distinct 17))) else max(t1.b) end | ( -count(*)) from t1) and e<=17 and t1.c<=d then coalesce((select max(coalesce((select max(e) from t1 where t1.f not in (e,17,t1.b) and d= -t1.b),t1.d)) from t1 where t1.d(f) then t1.e else 17 end else t1.c end-19)} -} {} -do_test randexpr-2.2128 { - db eval {SELECT case when case when t1.c+13<13 then 11 when (t1.b) not in (t1.b,e,t1.c) then t1.f else -t1.c end- -a & 13 in (select max(a) from t1 union select count(distinct 17)* -case count(*) when count(*) then -((count(distinct 17))) else max(t1.b) end & ( -count(*)) from t1) and e<=17 and t1.c<=d then coalesce((select max(coalesce((select max(e) from t1 where t1.f not in (e,17,t1.b) and d= -t1.b),t1.d)) from t1 where t1.d(f) then t1.e else 17 end else t1.c end-19} -} {200} -do_test randexpr-2.2129 { - db eval {SELECT coalesce((select case t1.e when coalesce((select max(e- -coalesce((select 17-d-e from t1 where ( -e*(d)>t1.c and 17=(t1.b) or not 11>(a) and b not between ((f)) and t1.d)),t1.c)-f-(f)*b+t1.a) from t1 where f<>13),t1.b) then t1.c else t1.b end from t1 where c in (select t1.a from t1 union select (t1.e) from t1)),e) FROM t1 WHERE (c in (select ~abs(cast(avg(19) AS integer))- -(case (++abs(max( -(select case case ( -abs(+cast(avg(b) AS integer) | count(distinct t1.b*17)*min( -11)*count(distinct t1.e))) when (max( -t1.b)) then count(distinct e) else max(11) end when -min(d) then count(*) else cast(avg(t1.a) AS integer) end from t1))*max(11))) when min(b) then max(19) else (count(*)) end)* -(max(t1.a))-count(*) from t1 union select count(distinct t1.a) from t1))} -} {} -do_test randexpr-2.2130 { - db eval {SELECT coalesce((select case t1.e when coalesce((select max(e- -coalesce((select 17-d-e from t1 where ( -e*(d)>t1.c and 17=(t1.b) or not 11>(a) and b not between ((f)) and t1.d)),t1.c)-f-(f)*b+t1.a) from t1 where f<>13),t1.b) then t1.c else t1.b end from t1 where c in (select t1.a from t1 union select (t1.e) from t1)),e) FROM t1 WHERE NOT ((c in (select ~abs(cast(avg(19) AS integer))- -(case (++abs(max( -(select case case ( -abs(+cast(avg(b) AS integer) | count(distinct t1.b*17)*min( -11)*count(distinct t1.e))) when (max( -t1.b)) then count(distinct e) else max(11) end when -min(d) then count(*) else cast(avg(t1.a) AS integer) end from t1))*max(11))) when min(b) then max(19) else (count(*)) end)* -(max(t1.a))-count(*) from t1 union select count(distinct t1.a) from t1)))} -} {500} -do_test randexpr-2.2131 { - db eval {SELECT t1.e+13-(abs(f)/abs(e | coalesce((select case when (f>=~t1.c*case t1.a when -d then (11) else 17 end*19) then case a when t1.e then b else e end else t1.c end from t1 where e in (select t1.a from t1 union select a from t1) or t1.d not in (f,f,17) and t1.b not between f and 17 and e=c),t1.c)*17+d+t1.d)) FROM t1 WHERE coalesce((select ~f+t1.c*t1.d | t1.d*t1.d-t1.b from t1 where t1.b | t1.a between case when (abs(coalesce((select f from t1 where t1.e between 11-17 and t1.c),e)-t1.d*b)/abs(((d))))-d between t1.b and d then a when -(f) between e and t1.e then t1.a else a end and t1.b),t1.a)-11=d} -} {} -do_test randexpr-2.2132 { - db eval {SELECT t1.e+13-(abs(f)/abs(e | coalesce((select case when (f>=~t1.c*case t1.a when -d then (11) else 17 end*19) then case a when t1.e then b else e end else t1.c end from t1 where e in (select t1.a from t1 union select a from t1) or t1.d not in (f,f,17) and t1.b not between f and 17 and e=c),t1.c)*17+d+t1.d)) FROM t1 WHERE NOT (coalesce((select ~f+t1.c*t1.d | t1.d*t1.d-t1.b from t1 where t1.b | t1.a between case when (abs(coalesce((select f from t1 where t1.e between 11-17 and t1.c),e)-t1.d*b)/abs(((d))))-d between t1.b and d then a when -(f) between e and t1.e then t1.a else a end and t1.b),t1.a)-11=d)} -} {513} -do_test randexpr-2.2133 { - db eval {SELECT t1.e+13-(abs(f)/abs(e & coalesce((select case when (f>=~t1.c*case t1.a when -d then (11) else 17 end*19) then case a when t1.e then b else e end else t1.c end from t1 where e in (select t1.a from t1 union select a from t1) or t1.d not in (f,f,17) and t1.b not between f and 17 and e=c),t1.c)*17+d+t1.d)) FROM t1 WHERE NOT (coalesce((select ~f+t1.c*t1.d | t1.d*t1.d-t1.b from t1 where t1.b | t1.a between case when (abs(coalesce((select f from t1 where t1.e between 11-17 and t1.c),e)-t1.d*b)/abs(((d))))-d between t1.b and d then a when -(f) between e and t1.e then t1.a else a end and t1.b),t1.a)-11=d)} -} {511} -do_test randexpr-2.2134 { - db eval {SELECT +(abs(~+13+(abs(t1.c)/abs(t1.c | coalesce((select t1.a from t1 where (select min(t1.c) from t1)<>(abs(t1.f | coalesce((select c from t1 where b=17),f)-b)/abs(coalesce((select max(d-t1.e) from t1 where not exists(select 1 from t1 where t1.e in (select f from t1 union select t1.d from t1))),19)*e+19)) or t1.a in (select 13 from t1 union select t1.d from t1) and (b)<= -t1.f),11))))/abs(e)) FROM t1 WHERE t1.e<>coalesce((select case 17 when f then coalesce((select max(t1.c) from t1 where coalesce((select coalesce((select ~e from t1 where not 17<=e | 17),11)+t1.d+t1.e from t1 where (e>=f or (not t1.e>=t1.a or e between f and t1.f))),t1.b) not in (13,17,c) or t1.a> -t1.d),19) else t1.c end from t1 where (not 17 not in (t1.b,11,b) and f>=t1.f) or 19<=t1.f),d)-11} -} {0} -do_test randexpr-2.2135 { - db eval {SELECT +(abs(~+13+(abs(t1.c)/abs(t1.c | coalesce((select t1.a from t1 where (select min(t1.c) from t1)<>(abs(t1.f | coalesce((select c from t1 where b=17),f)-b)/abs(coalesce((select max(d-t1.e) from t1 where not exists(select 1 from t1 where t1.e in (select f from t1 union select t1.d from t1))),19)*e+19)) or t1.a in (select 13 from t1 union select t1.d from t1) and (b)<= -t1.f),11))))/abs(e)) FROM t1 WHERE NOT (t1.e<>coalesce((select case 17 when f then coalesce((select max(t1.c) from t1 where coalesce((select coalesce((select ~e from t1 where not 17<=e | 17),11)+t1.d+t1.e from t1 where (e>=f or (not t1.e>=t1.a or e between f and t1.f))),t1.b) not in (13,17,c) or t1.a> -t1.d),19) else t1.c end from t1 where (not 17 not in (t1.b,11,b) and f>=t1.f) or 19<=t1.f),d)-11)} -} {} -do_test randexpr-2.2136 { - db eval {SELECT +(abs(~+13+(abs(t1.c)/abs(t1.c & coalesce((select t1.a from t1 where (select min(t1.c) from t1)<>(abs(t1.f & coalesce((select c from t1 where b=17),f)-b)/abs(coalesce((select max(d-t1.e) from t1 where not exists(select 1 from t1 where t1.e in (select f from t1 union select t1.d from t1))),19)*e+19)) or t1.a in (select 13 from t1 union select t1.d from t1) and (b)<= -t1.f),11))))/abs(e)) FROM t1 WHERE t1.e<>coalesce((select case 17 when f then coalesce((select max(t1.c) from t1 where coalesce((select coalesce((select ~e from t1 where not 17<=e | 17),11)+t1.d+t1.e from t1 where (e>=f or (not t1.e>=t1.a or e between f and t1.f))),t1.b) not in (13,17,c) or t1.a> -t1.d),19) else t1.c end from t1 where (not 17 not in (t1.b,11,b) and f>=t1.f) or 19<=t1.f),d)-11} -} {0} -do_test randexpr-2.2137 { - db eval {SELECT (case when not case when ((e not between d and case when not exists(select 1 from t1 where 11>=(a)*t1.d*11 or -(d) not in (a,11,t1.f)) then f else ~f end or not d<>t1.e or t1.c in (a,t1.d,t1.c))) then case when -b between 11 and b then (select count(distinct 17) from t1) when t1.e<>11 then f else d end else t1.d end<=a then (abs(t1.d)/abs(e)) when t1.d=t1.b and 17=t1.e)) then f else 19 end-t1.a*t1.a-e<=t1.b and 17 in (t1.d,13,t1.b) then c else t1.b end<>t1.b or not exists(select 1 from t1 where 17 between (d) and ( -(t1.d)))} -} {0} -do_test randexpr-2.2138 { - db eval {SELECT (case when not case when ((e not between d and case when not exists(select 1 from t1 where 11>=(a)*t1.d*11 or -(d) not in (a,11,t1.f)) then f else ~f end or not d<>t1.e or t1.c in (a,t1.d,t1.c))) then case when -b between 11 and b then (select count(distinct 17) from t1) when t1.e<>11 then f else d end else t1.d end<=a then (abs(t1.d)/abs(e)) when t1.d=t1.b and 17=t1.e)) then f else 19 end-t1.a*t1.a-e<=t1.b and 17 in (t1.d,13,t1.b) then c else t1.b end<>t1.b or not exists(select 1 from t1 where 17 between (d) and ( -(t1.d))))} -} {} -do_test randexpr-2.2139 { - db eval {SELECT t1.b+case when f+f not in (c+case when t1.f<>d then 11 when f between 11 and t1.d then 11 else 13 end,e,(t1.f)) and not exists(select 1 from t1 where (exists(select 1 from t1 where 19<11)) or 11 in ((t1.d),t1.c,b) and t1.b>13) and t1.b=t1.b then (abs(t1.d)/abs(13)) when a not between t1.c and 19 then t1.f else 19 end+13*17-t1.e FROM t1 WHERE not exists(select 1 from t1 where (exists(select 1 from t1 where t1.c>=19)))} -} {} -do_test randexpr-2.2140 { - db eval {SELECT t1.b+case when f+f not in (c+case when t1.f<>d then 11 when f between 11 and t1.d then 11 else 13 end,e,(t1.f)) and not exists(select 1 from t1 where (exists(select 1 from t1 where 19<11)) or 11 in ((t1.d),t1.c,b) and t1.b>13) and t1.b=t1.b then (abs(t1.d)/abs(13)) when a not between t1.c and 19 then t1.f else 19 end+13*17-t1.e FROM t1 WHERE NOT (not exists(select 1 from t1 where (exists(select 1 from t1 where t1.c>=19))))} -} {-49} -do_test randexpr-2.2141 { - db eval {SELECT (case when f>(select abs((((count(*)-+cast(avg(d) AS integer)))) | count(distinct a)) from t1) then case when (abs(coalesce((select max(t1.d) from t1 where coalesce((select max(case when t1.b between t1.f and a then -f when f<> -b then t1.e else -19 end) from t1 where not exists(select 1 from t1 where t1.c not in (t1.f,t1.c,t1.a))),t1.c)<=b), -t1.c))/abs(t1.a))11} -} {600} -do_test randexpr-2.2142 { - db eval {SELECT (case when f>(select abs((((count(*)-+cast(avg(d) AS integer)))) | count(distinct a)) from t1) then case when (abs(coalesce((select max(t1.d) from t1 where coalesce((select max(case when t1.b between t1.f and a then -f when f<> -b then t1.e else -19 end) from t1 where not exists(select 1 from t1 where t1.c not in (t1.f,t1.c,t1.a))),t1.c)<=b), -t1.c))/abs(t1.a))11)} -} {} -do_test randexpr-2.2143 { - db eval {SELECT (case when f>(select abs((((count(*)-+cast(avg(d) AS integer)))) & count(distinct a)) from t1) then case when (abs(coalesce((select max(t1.d) from t1 where coalesce((select max(case when t1.b between t1.f and a then -f when f<> -b then t1.e else -19 end) from t1 where not exists(select 1 from t1 where t1.c not in (t1.f,t1.c,t1.a))),t1.c)<=b), -t1.c))/abs(t1.a))11} -} {600} -do_test randexpr-2.2144 { - db eval {SELECT (abs(+coalesce((select t1.f from t1 where not exists(select 1 from t1 where (((c)<=t1.a)))),f+(select count(distinct t1.b) from t1)*t1.b+case when case (select count(*) from t1) when coalesce((select max(t1.f-e+13) from t1 where (t1.e>a and 19 not in (13,b,19))),t1.c)+e then t1.b else t1.b end in (select -c from t1 union select c from t1) then f when t1.a>t1.e then t1.c else d end+ -13))/abs((t1.f))) FROM t1 WHERE coalesce((select t1.f from t1 where a>=e),13) between -c and t1.a} -} {1} -do_test randexpr-2.2145 { - db eval {SELECT (abs(+coalesce((select t1.f from t1 where not exists(select 1 from t1 where (((c)<=t1.a)))),f+(select count(distinct t1.b) from t1)*t1.b+case when case (select count(*) from t1) when coalesce((select max(t1.f-e+13) from t1 where (t1.e>a and 19 not in (13,b,19))),t1.c)+e then t1.b else t1.b end in (select -c from t1 union select c from t1) then f when t1.a>t1.e then t1.c else d end+ -13))/abs((t1.f))) FROM t1 WHERE NOT (coalesce((select t1.f from t1 where a>=e),13) between -c and t1.a)} -} {} -do_test randexpr-2.2146 { - db eval {SELECT coalesce((select max(~19) from t1 where t1.a between case t1.c when t1.b then t1.e else +~f end and case when 19 not in (e+b,t1.e-d,(select max(e) from t1)) then t1.a else case 13 when case e when e then t1.f else f end-a+t1.f then 19 else t1.b end+11 end-t1.d-17 or t1.b<>t1.a),13)-t1.b | 11 FROM t1 WHERE (+(17)-(select cast(avg( -((17)*case t1.b when 13+f then t1.f else t1.b end)) AS integer) | case case cast(avg(e) AS integer) when abs((case (~min(t1.c)) when max(t1.e) then cast(avg(t1.b) AS integer) else (( -count(*))) end-max(b)))+(min(t1.c)) then -cast(avg(c) AS integer) else min(f) end when cast(avg(17) AS integer) then max(f) else (min(d)) end from t1)+e+c*19>=13)} -} {-209} -do_test randexpr-2.2147 { - db eval {SELECT coalesce((select max(~19) from t1 where t1.a between case t1.c when t1.b then t1.e else +~f end and case when 19 not in (e+b,t1.e-d,(select max(e) from t1)) then t1.a else case 13 when case e when e then t1.f else f end-a+t1.f then 19 else t1.b end+11 end-t1.d-17 or t1.b<>t1.a),13)-t1.b | 11 FROM t1 WHERE NOT ((+(17)-(select cast(avg( -((17)*case t1.b when 13+f then t1.f else t1.b end)) AS integer) | case case cast(avg(e) AS integer) when abs((case (~min(t1.c)) when max(t1.e) then cast(avg(t1.b) AS integer) else (( -count(*))) end-max(b)))+(min(t1.c)) then -cast(avg(c) AS integer) else min(f) end when cast(avg(17) AS integer) then max(f) else (min(d)) end from t1)+e+c*19>=13))} -} {} -do_test randexpr-2.2148 { - db eval {SELECT coalesce((select max(~19) from t1 where t1.a between case t1.c when t1.b then t1.e else +~f end and case when 19 not in (e+b,t1.e-d,(select max(e) from t1)) then t1.a else case 13 when case e when e then t1.f else f end-a+t1.f then 19 else t1.b end+11 end-t1.d-17 or t1.b<>t1.a),13)-t1.b & 11 FROM t1 WHERE (+(17)-(select cast(avg( -((17)*case t1.b when 13+f then t1.f else t1.b end)) AS integer) | case case cast(avg(e) AS integer) when abs((case (~min(t1.c)) when max(t1.e) then cast(avg(t1.b) AS integer) else (( -count(*))) end-max(b)))+(min(t1.c)) then -cast(avg(c) AS integer) else min(f) end when cast(avg(17) AS integer) then max(f) else (min(d)) end from t1)+e+c*19>=13)} -} {0} -do_test randexpr-2.2149 { - db eval {SELECT coalesce((select max(e) from t1 where 11>=coalesce((select max(b) from t1 where (abs(13)/abs(coalesce((select max(11) from t1 where f not between t1.a and t1.d),t1.d)))=case when 11 in (select (11 | d)-coalesce((select t1.e | coalesce((select t1.e from t1 where t1.f in (select 13 from t1 union select t1.c from t1) and d in (select t1.b from t1 union select 17 from t1)),(c))-17-19 from t1 where (t1.b)<=t1.b),(d)) from t1 union select t1.d from t1) then t1.a else (b) end),c)),19) FROM t1 WHERE ~t1.b not in (~++(select (case ~ -min( -11) when abs(count(*)*count(*)) then +~max(t1.a-11 | (19)) else case abs((cast(avg(f) AS integer)))-count(distinct t1.a) when (( -(max(a)))) then (min(t1.d)) else (min(a)) end end) from t1)+(abs(+t1.b)/abs(a))-t1.f+~t1.d+b+t1.c,13,e)} -} {19} -do_test randexpr-2.2150 { - db eval {SELECT coalesce((select max(e) from t1 where 11>=coalesce((select max(b) from t1 where (abs(13)/abs(coalesce((select max(11) from t1 where f not between t1.a and t1.d),t1.d)))=case when 11 in (select (11 | d)-coalesce((select t1.e | coalesce((select t1.e from t1 where t1.f in (select 13 from t1 union select t1.c from t1) and d in (select t1.b from t1 union select 17 from t1)),(c))-17-19 from t1 where (t1.b)<=t1.b),(d)) from t1 union select t1.d from t1) then t1.a else (b) end),c)),19) FROM t1 WHERE NOT (~t1.b not in (~++(select (case ~ -min( -11) when abs(count(*)*count(*)) then +~max(t1.a-11 | (19)) else case abs((cast(avg(f) AS integer)))-count(distinct t1.a) when (( -(max(a)))) then (min(t1.d)) else (min(a)) end end) from t1)+(abs(+t1.b)/abs(a))-t1.f+~t1.d+b+t1.c,13,e))} -} {} -do_test randexpr-2.2151 { - db eval {SELECT coalesce((select max(e) from t1 where 11>=coalesce((select max(b) from t1 where (abs(13)/abs(coalesce((select max(11) from t1 where f not between t1.a and t1.d),t1.d)))=case when 11 in (select (11 & d)-coalesce((select t1.e & coalesce((select t1.e from t1 where t1.f in (select 13 from t1 union select t1.c from t1) and d in (select t1.b from t1 union select 17 from t1)),(c))-17-19 from t1 where (t1.b)<=t1.b),(d)) from t1 union select t1.d from t1) then t1.a else (b) end),c)),19) FROM t1 WHERE ~t1.b not in (~++(select (case ~ -min( -11) when abs(count(*)*count(*)) then +~max(t1.a-11 | (19)) else case abs((cast(avg(f) AS integer)))-count(distinct t1.a) when (( -(max(a)))) then (min(t1.d)) else (min(a)) end end) from t1)+(abs(+t1.b)/abs(a))-t1.f+~t1.d+b+t1.c,13,e)} -} {19} -do_test randexpr-2.2152 { - db eval {SELECT (abs(+b)/abs(coalesce((select max(t1.b) from t1 where (not t1.a not between t1.c-(abs(b)/abs(d)) and c)),19)+19*t1.e | t1.e))-t1.f*coalesce((select case d when e*t1.d*f then 17 else t1.c+t1.c end from t1 where t1.b>=(select count(*) from t1)),+f+t1.b-t1.b+19- -b) FROM t1 WHERE not exists(select 1 from t1 where not exists(select 1 from t1 where not exists(select 1 from t1 where not (b>=(abs(case when case (select count(*) from t1) when t1.a then a+case t1.f when a+ -t1.a*t1.d then 19 else e end+t1.a+f else -d end>=e then f when t1.b>=t1.d or not dt1.b then t1.e else d end)/abs(f)) or a>e))))} -} {-360000} -do_test randexpr-2.2153 { - db eval {SELECT (abs(+b)/abs(coalesce((select max(t1.b) from t1 where (not t1.a not between t1.c-(abs(b)/abs(d)) and c)),19)+19*t1.e | t1.e))-t1.f*coalesce((select case d when e*t1.d*f then 17 else t1.c+t1.c end from t1 where t1.b>=(select count(*) from t1)),+f+t1.b-t1.b+19- -b) FROM t1 WHERE NOT (not exists(select 1 from t1 where not exists(select 1 from t1 where not exists(select 1 from t1 where not (b>=(abs(case when case (select count(*) from t1) when t1.a then a+case t1.f when a+ -t1.a*t1.d then 19 else e end+t1.a+f else -d end>=e then f when t1.b>=t1.d or not dt1.b then t1.e else d end)/abs(f)) or a>e)))))} -} {} -do_test randexpr-2.2154 { - db eval {SELECT (abs(+b)/abs(coalesce((select max(t1.b) from t1 where (not t1.a not between t1.c-(abs(b)/abs(d)) and c)),19)+19*t1.e & t1.e))-t1.f*coalesce((select case d when e*t1.d*f then 17 else t1.c+t1.c end from t1 where t1.b>=(select count(*) from t1)),+f+t1.b-t1.b+19- -b) FROM t1 WHERE not exists(select 1 from t1 where not exists(select 1 from t1 where not exists(select 1 from t1 where not (b>=(abs(case when case (select count(*) from t1) when t1.a then a+case t1.f when a+ -t1.a*t1.d then 19 else e end+t1.a+f else -d end>=e then f when t1.b>=t1.d or not dt1.b then t1.e else d end)/abs(f)) or a>e))))} -} {-360000} -do_test randexpr-2.2155 { - db eval {SELECT (abs((select +abs(case count(*) when +max(19) then count(distinct b)*count(distinct (13+(select max(t1.d) from t1)* -a+t1.e*t1.b*a))+cast(avg(13) AS integer) | min(13)*cast(avg(c) AS integer)-count(distinct t1.e)-((min(f))) | cast(avg(17) AS integer)-( -cast(avg(( -t1.d)) AS integer))- -cast(avg(t1.d) AS integer) | count(*) else max(t1.f) end) from t1))/abs(t1.a)) FROM t1 WHERE b<=e or exists(select 1 from t1 where 17 in (select ~e+coalesce((select d from t1 where 11* -~+case when not (b) not between t1.f and b then -~t1.c-11*+19+((b)) when f not between f and 11 then b else a end+11-(b)-t1.f<>17),d) from t1 union select t1.a from t1))} -} {6} -do_test randexpr-2.2156 { - db eval {SELECT (abs((select +abs(case count(*) when +max(19) then count(distinct b)*count(distinct (13+(select max(t1.d) from t1)* -a+t1.e*t1.b*a))+cast(avg(13) AS integer) | min(13)*cast(avg(c) AS integer)-count(distinct t1.e)-((min(f))) | cast(avg(17) AS integer)-( -cast(avg(( -t1.d)) AS integer))- -cast(avg(t1.d) AS integer) | count(*) else max(t1.f) end) from t1))/abs(t1.a)) FROM t1 WHERE NOT (b<=e or exists(select 1 from t1 where 17 in (select ~e+coalesce((select d from t1 where 11* -~+case when not (b) not between t1.f and b then -~t1.c-11*+19+((b)) when f not between f and 11 then b else a end+11-(b)-t1.f<>17),d) from t1 union select t1.a from t1)))} -} {} -do_test randexpr-2.2157 { - db eval {SELECT (abs((select +abs(case count(*) when +max(19) then count(distinct b)*count(distinct (13+(select max(t1.d) from t1)* -a+t1.e*t1.b*a))+cast(avg(13) AS integer) & min(13)*cast(avg(c) AS integer)-count(distinct t1.e)-((min(f))) & cast(avg(17) AS integer)-( -cast(avg(( -t1.d)) AS integer))- -cast(avg(t1.d) AS integer) & count(*) else max(t1.f) end) from t1))/abs(t1.a)) FROM t1 WHERE b<=e or exists(select 1 from t1 where 17 in (select ~e+coalesce((select d from t1 where 11* -~+case when not (b) not between t1.f and b then -~t1.c-11*+19+((b)) when f not between f and 11 then b else a end+11-(b)-t1.f<>17),d) from t1 union select t1.a from t1))} -} {6} -do_test randexpr-2.2158 { - db eval {SELECT coalesce((select max(11) from t1 where c=(abs(coalesce((select case when t1.c-t1.f+coalesce((select max(b) from t1 where case when (11<>17) then t1.c else c end in (select b from t1 union select t1.b from t1) and 13=11),f)+t1.b>=t1.f then 11 when c>t1.f then 19 else 19 end from t1 where exists(select 1 from t1 where not exists(select 1 from t1 where (e>19)))),t1.d))/abs(b)) and -t1.d between t1.b and 13 or 17<>t1.e), -((11))) FROM t1 WHERE case when case when (not exists(select 1 from t1 where 19 not between case when coalesce((select b from t1 where (abs(t1.c)/abs(17))+t1.e between case when not exists(select 1 from t1 where not a<=t1.e) then t1.e when d17) then t1.c else c end in (select b from t1 union select t1.b from t1) and 13=11),f)+t1.b>=t1.f then 11 when c>t1.f then 19 else 19 end from t1 where exists(select 1 from t1 where not exists(select 1 from t1 where (e>19)))),t1.d))/abs(b)) and -t1.d between t1.b and 13 or 17<>t1.e), -((11))) FROM t1 WHERE NOT (case when case when (not exists(select 1 from t1 where 19 not between case when coalesce((select b from t1 where (abs(t1.c)/abs(17))+t1.e between case when not exists(select 1 from t1 where not a<=t1.e) then t1.e when d(t1.c)} -} {-2600247} -do_test randexpr-2.2161 { - db eval {SELECT coalesce((select ( -t1.e*(abs((case when not 13 not in (case coalesce((select max(t1.f) from t1 where not exists(select 1 from t1 where d between -b and f)),11) when 11 then 19 else a end,t1.a,t1.a) then f-t1.f when t1.c in (select -abs(count(*)+(max((t1.a)))) from t1 union select -max((19)) from t1) then d else 13 end-19))/abs(t1.b))-t1.d*e-19) from t1 where t1.e not between 13 and c),19)*13 FROM t1 WHERE NOT (19<>(t1.c))} -} {} -do_test randexpr-2.2162 { - db eval {SELECT coalesce((select max(13) from t1 where f= -case when exists(select 1 from t1 where not t1.b>=e and b in (select b from t1 union select (+(t1.f-d)) from t1) or 19 in (select min(e) from t1 union select -~+++ -abs(min(17*t1.d)) from t1) or not t1.a>a) then 13 else t1.c end+a | ~11),19) FROM t1 WHERE (exists(select 1 from t1 where t1.c>19)) and a>d-a} -} {} -do_test randexpr-2.2163 { - db eval {SELECT coalesce((select max(13) from t1 where f= -case when exists(select 1 from t1 where not t1.b>=e and b in (select b from t1 union select (+(t1.f-d)) from t1) or 19 in (select min(e) from t1 union select -~+++ -abs(min(17*t1.d)) from t1) or not t1.a>a) then 13 else t1.c end+a | ~11),19) FROM t1 WHERE NOT ((exists(select 1 from t1 where t1.c>19)) and a>d-a)} -} {19} -do_test randexpr-2.2164 { - db eval {SELECT coalesce((select max(13) from t1 where f= -case when exists(select 1 from t1 where not t1.b>=e and b in (select b from t1 union select (+(t1.f-d)) from t1) or 19 in (select min(e) from t1 union select -~+++ -abs(min(17*t1.d)) from t1) or not t1.a>a) then 13 else t1.c end+a & ~11),19) FROM t1 WHERE NOT ((exists(select 1 from t1 where t1.c>19)) and a>d-a)} -} {19} -do_test randexpr-2.2165 { - db eval {SELECT coalesce((select case when a between (select count(distinct 19) from t1) and case when de then b*t1.e else a end) from t1 where t1.e=t1.e),t1.f) from t1 where (d not between 13 and (f))),17)-d) from t1 where (11<>19)),t1.e)+t1.c)/abs(t1.e))*11*c-t1.d*t1.d+a end FROM t1 WHERE 13-e*t1.e=19),(abs(e)/abs((abs( -d+e)/abs(a))))+t1.a) from t1 where t1.b in (t1.e,(t1.e),t1.f)),f))=t1.e)) or b<=19),t1.b)<=13) then 13 else t1.f end-f} -} {-159900} -do_test randexpr-2.2168 { - db eval {SELECT case 17 when -b then e*c else (abs(coalesce((select max(coalesce((select coalesce((select max(case when t1.d<=19 and t1.d>e then b*t1.e else a end) from t1 where t1.e=t1.e),t1.f) from t1 where (d not between 13 and (f))),17)-d) from t1 where (11<>19)),t1.e)+t1.c)/abs(t1.e))*11*c-t1.d*t1.d+a end FROM t1 WHERE NOT (13-e*t1.e=19),(abs(e)/abs((abs( -d+e)/abs(a))))+t1.a) from t1 where t1.b in (t1.e,(t1.e),t1.f)),f))=t1.e)) or b<=19),t1.b)<=13) then 13 else t1.f end-f)} -} {} -do_test randexpr-2.2169 { - db eval {SELECT case when case when e*(d-case a when 13 then (19) else d end) between 13 and f then f when exists(select 1 from t1 where 19<>t1.a) then e else b end in (select -max(e)+min(11)-case ~~cast(avg(t1.c) AS integer) when max(19) then max(f) else -cast(avg(f) AS integer) end from t1 union select -max(13) from t1) and f>d and (t1.f=c) then t1.b else t1.c+ -t1.f end FROM t1 WHERE t1.e+11>=~t1.a-11} -} {-300} -do_test randexpr-2.2170 { - db eval {SELECT case when case when e*(d-case a when 13 then (19) else d end) between 13 and f then f when exists(select 1 from t1 where 19<>t1.a) then e else b end in (select -max(e)+min(11)-case ~~cast(avg(t1.c) AS integer) when max(19) then max(f) else -cast(avg(f) AS integer) end from t1 union select -max(13) from t1) and f>d and (t1.f=c) then t1.b else t1.c+ -t1.f end FROM t1 WHERE NOT (t1.e+11>=~t1.a-11)} -} {} -do_test randexpr-2.2171 { - db eval {SELECT coalesce((select t1.f from t1 where not (abs(coalesce((select 17*13+(select cast(avg(t1.a) AS integer)-(count(distinct t1.c)*+cast(avg((select count(*) from t1)) AS integer))+count(*) from t1) from t1 where (select count(distinct t1.d*(((t1.d)))+f) from t1) in ( -b*t1.e-11,t1.d,d) and exists(select 1 from t1 where t1.d>c)),t1.e))/abs(b)) not in (t1.f,11,d)),t1.d) FROM t1 WHERE exists(select 1 from t1 where +t1.c-case when exists(select 1 from t1 where (select +case count(distinct case when 19*d in (select (cast(avg(11) AS integer)*cast(avg( -13) AS integer)) from t1 union select count(*) from t1) then t1.c else 13 end) when count(*) then count(*) else (min(t1.b)) end from t1)<>case when (not t1.ft1.d then case when f>=17 then t1.a else t1.e end else b end) then 11+t1.f when d<>17 then t1.e else a end- -13<>e) and t1.a<=17} -} {} -do_test randexpr-2.2172 { - db eval {SELECT coalesce((select t1.f from t1 where not (abs(coalesce((select 17*13+(select cast(avg(t1.a) AS integer)-(count(distinct t1.c)*+cast(avg((select count(*) from t1)) AS integer))+count(*) from t1) from t1 where (select count(distinct t1.d*(((t1.d)))+f) from t1) in ( -b*t1.e-11,t1.d,d) and exists(select 1 from t1 where t1.d>c)),t1.e))/abs(b)) not in (t1.f,11,d)),t1.d) FROM t1 WHERE NOT (exists(select 1 from t1 where +t1.c-case when exists(select 1 from t1 where (select +case count(distinct case when 19*d in (select (cast(avg(11) AS integer)*cast(avg( -13) AS integer)) from t1 union select count(*) from t1) then t1.c else 13 end) when count(*) then count(*) else (min(t1.b)) end from t1)<>case when (not t1.ft1.d then case when f>=17 then t1.a else t1.e end else b end) then 11+t1.f when d<>17 then t1.e else a end- -13<>e) and t1.a<=17)} -} {400} -do_test randexpr-2.2173 { - db eval {SELECT case when not (select - -count(distinct t1.f)-(max(case when e not between f and t1.b+(13)+ -d-t1.a then t1.d else 11 end))+ -max(t1.b)*cast(avg(13) AS integer)-count(*) | (max(t1.e)) from t1)<>~t1.d then b when -coalesce((select (abs(t1.e)/abs(t1.b)) from t1 where a<>b), - -17)<=t1.a then -f else 11 end FROM t1 WHERE t1.a<>(select max(19) from t1)} -} {-600} -do_test randexpr-2.2174 { - db eval {SELECT case when not (select - -count(distinct t1.f)-(max(case when e not between f and t1.b+(13)+ -d-t1.a then t1.d else 11 end))+ -max(t1.b)*cast(avg(13) AS integer)-count(*) | (max(t1.e)) from t1)<>~t1.d then b when -coalesce((select (abs(t1.e)/abs(t1.b)) from t1 where a<>b), - -17)<=t1.a then -f else 11 end FROM t1 WHERE NOT (t1.a<>(select max(19) from t1))} -} {} -do_test randexpr-2.2175 { - db eval {SELECT case when not (select - -count(distinct t1.f)-(max(case when e not between f and t1.b+(13)+ -d-t1.a then t1.d else 11 end))+ -max(t1.b)*cast(avg(13) AS integer)-count(*) & (max(t1.e)) from t1)<>~t1.d then b when -coalesce((select (abs(t1.e)/abs(t1.b)) from t1 where a<>b), - -17)<=t1.a then -f else 11 end FROM t1 WHERE t1.a<>(select max(19) from t1)} -} {-600} -do_test randexpr-2.2176 { - db eval {SELECT case when case coalesce((select t1.d+a*11 from t1 where e<=t1.d),19) when 19 then -t1.d-t1.a else t1.e end not between 17 and d then t1.f when not (t1.c<=e and ((13<>e or t1.c not between t1.c and 13)) or t1.c=17 and t1.a not in (t1.e, -t1.d,t1.b) and b=b then t1.d else 13 end FROM t1 WHERE (case t1.f when t1.b then case when case when not exists(select 1 from t1 where (t1.d+t1.a in (c,coalesce((select max(t1.c) from t1 where exists(select 1 from t1 where (t1.a>=c))),+b), -t1.b))) then (select abs( -case ((abs( - - -count(*)+count(*)))) when min(d) then -(cast(avg(t1.d) AS integer)) else cast(avg(e) AS integer) end | ((max((t1.f)))))+(min(t1.c)) from t1) else 11 end>f then 19 else t1.b end else b end)<=13 or (t1.f>b)} -} {600} -do_test randexpr-2.2177 { - db eval {SELECT case when case coalesce((select t1.d+a*11 from t1 where e<=t1.d),19) when 19 then -t1.d-t1.a else t1.e end not between 17 and d then t1.f when not (t1.c<=e and ((13<>e or t1.c not between t1.c and 13)) or t1.c=17 and t1.a not in (t1.e, -t1.d,t1.b) and b=b then t1.d else 13 end FROM t1 WHERE NOT ((case t1.f when t1.b then case when case when not exists(select 1 from t1 where (t1.d+t1.a in (c,coalesce((select max(t1.c) from t1 where exists(select 1 from t1 where (t1.a>=c))),+b), -t1.b))) then (select abs( -case ((abs( - - -count(*)+count(*)))) when min(d) then -(cast(avg(t1.d) AS integer)) else cast(avg(e) AS integer) end | ((max((t1.f)))))+(min(t1.c)) from t1) else 11 end>f then 19 else t1.b end else b end)<=13 or (t1.f>b))} -} {} -do_test randexpr-2.2178 { - db eval {SELECT (((d)+t1.f))-case +t1.d when coalesce((select max(13) from t1 where (select -max(17*case when d>=coalesce((select 19 from t1 where a<>t1.e),t1.b) then e when -c<>d then e else t1.a end*t1.f)+ -case count(*) when (+cast(avg(c) AS integer)) then count(*) else -count(distinct t1.f) end+count(*) from t1)<=(abs(t1.c)/abs(t1.f))),17) then 17 else t1.d end-t1.b FROM t1 WHERE ~d-c in (select cast(avg(19) AS integer) from t1 union select - -abs((abs((cast(avg(f) AS integer)) | abs(count(distinct 19))))) from t1)} -} {} -do_test randexpr-2.2179 { - db eval {SELECT (((d)+t1.f))-case +t1.d when coalesce((select max(13) from t1 where (select -max(17*case when d>=coalesce((select 19 from t1 where a<>t1.e),t1.b) then e when -c<>d then e else t1.a end*t1.f)+ -case count(*) when (+cast(avg(c) AS integer)) then count(*) else -count(distinct t1.f) end+count(*) from t1)<=(abs(t1.c)/abs(t1.f))),17) then 17 else t1.d end-t1.b FROM t1 WHERE NOT (~d-c in (select cast(avg(19) AS integer) from t1 union select - -abs((abs((cast(avg(f) AS integer)) | abs(count(distinct 19))))) from t1))} -} {400} -do_test randexpr-2.2180 { - db eval {SELECT coalesce((select max(f+t1.c*b) from t1 where (select abs(cast(avg(f) AS integer)) from t1)-c*~ -b+ -coalesce((select max(t1.a) from t1 where (select cast(avg((c) | ~t1.d) AS integer) from t1) not between t1.d-+(abs(t1.d)/abs(t1.c))+d and 11 and 17>=t1.e),t1.e)-b in (t1.c,d,e)),a)+c FROM t1 WHERE 19*e not in (a,t1.d,coalesce((select coalesce((select max(t1.d) from t1 where (exists(select 1 from t1 where not exists(select 1 from t1 where e*case when ~c | f+11* -a in ( -t1.c,17,(t1.b)) then (f) when e=e or t1.d=f and (e)>(e) then (11) else a end+a*c in (select d from t1 union select -11 from t1))))),t1.f) from t1 where t1.d<=d),13))} -} {400} -do_test randexpr-2.2181 { - db eval {SELECT coalesce((select max(f+t1.c*b) from t1 where (select abs(cast(avg(f) AS integer)) from t1)-c*~ -b+ -coalesce((select max(t1.a) from t1 where (select cast(avg((c) | ~t1.d) AS integer) from t1) not between t1.d-+(abs(t1.d)/abs(t1.c))+d and 11 and 17>=t1.e),t1.e)-b in (t1.c,d,e)),a)+c FROM t1 WHERE NOT (19*e not in (a,t1.d,coalesce((select coalesce((select max(t1.d) from t1 where (exists(select 1 from t1 where not exists(select 1 from t1 where e*case when ~c | f+11* -a in ( -t1.c,17,(t1.b)) then (f) when e=e or t1.d=f and (e)>(e) then (11) else a end+a*c in (select d from t1 union select -11 from t1))))),t1.f) from t1 where t1.d<=d),13)))} -} {} -do_test randexpr-2.2182 { - db eval {SELECT coalesce((select max(f+t1.c*b) from t1 where (select abs(cast(avg(f) AS integer)) from t1)-c*~ -b+ -coalesce((select max(t1.a) from t1 where (select cast(avg((c) & ~t1.d) AS integer) from t1) not between t1.d-+(abs(t1.d)/abs(t1.c))+d and 11 and 17>=t1.e),t1.e)-b in (t1.c,d,e)),a)+c FROM t1 WHERE 19*e not in (a,t1.d,coalesce((select coalesce((select max(t1.d) from t1 where (exists(select 1 from t1 where not exists(select 1 from t1 where e*case when ~c | f+11* -a in ( -t1.c,17,(t1.b)) then (f) when e=e or t1.d=f and (e)>(e) then (11) else a end+a*c in (select d from t1 union select -11 from t1))))),t1.f) from t1 where t1.d<=d),13))} -} {400} -do_test randexpr-2.2183 { - db eval {SELECT c*~case ((abs(t1.b)/abs(t1.b))) when c then e else t1.c end-(case when (c)>=case coalesce((select max((abs(d)/abs(c))) from t1 where 13 not in (a-t1.e-(select count(*) | min(e)+min(c) from t1)*19*t1.b,11,a)),e) when e then b else t1.d end then d when 17<11 then c else t1.d end) | t1.f FROM t1 WHERE case when not (abs(t1.d | (abs( - -coalesce((select max(coalesce((select c+e from t1 where not t1.b in ((c),b,(f))),t1.b)) from t1 where 11=b),t1.f)+13*t1.f*e)/abs(t1.e)))/abs(t1.b))>=c then coalesce((select (t1.c) from t1 where t1.e in (11,e,t1.a)),a) when 13<=t1.b then t1.f else t1.d end in (select e from t1 union select (t1.d) from t1)} -} {} -do_test randexpr-2.2184 { - db eval {SELECT c*~case ((abs(t1.b)/abs(t1.b))) when c then e else t1.c end-(case when (c)>=case coalesce((select max((abs(d)/abs(c))) from t1 where 13 not in (a-t1.e-(select count(*) | min(e)+min(c) from t1)*19*t1.b,11,a)),e) when e then b else t1.d end then d when 17<11 then c else t1.d end) | t1.f FROM t1 WHERE NOT (case when not (abs(t1.d | (abs( - -coalesce((select max(coalesce((select c+e from t1 where not t1.b in ((c),b,(f))),t1.b)) from t1 where 11=b),t1.f)+13*t1.f*e)/abs(t1.e)))/abs(t1.b))>=c then coalesce((select (t1.c) from t1 where t1.e in (11,e,t1.a)),a) when 13<=t1.b then t1.f else t1.d end in (select e from t1 union select (t1.d) from t1))} -} {-90116} -do_test randexpr-2.2185 { - db eval {SELECT c*~case ((abs(t1.b)/abs(t1.b))) when c then e else t1.c end-(case when (c)>=case coalesce((select max((abs(d)/abs(c))) from t1 where 13 not in (a-t1.e-(select count(*) & min(e)+min(c) from t1)*19*t1.b,11,a)),e) when e then b else t1.d end then d when 17<11 then c else t1.d end) & t1.f FROM t1 WHERE NOT (case when not (abs(t1.d | (abs( - -coalesce((select max(coalesce((select c+e from t1 where not t1.b in ((c),b,(f))),t1.b)) from t1 where 11=b),t1.f)+13*t1.f*e)/abs(t1.e)))/abs(t1.b))>=c then coalesce((select (t1.c) from t1 where t1.e in (11,e,t1.a)),a) when 13<=t1.b then t1.f else t1.d end in (select e from t1 union select (t1.d) from t1))} -} {16} -do_test randexpr-2.2186 { - db eval {SELECT case when a+13*+ -~case when 17=t1.c*17 then 19 | (t1.b) when f+t1.e+(d)+b+c not between (d) and e or (a between t1.b and t1.a) then 17 else a end-17-(e)<=17 then b when c in (select 17 from t1 union select t1.a from t1) then c else t1.e end FROM t1 WHERE e-coalesce((select f-case 17+t1.a*(abs(t1.e)/abs((abs(coalesce((select max(+ -case when t1.a>=d then c else t1.e end-d) from t1 where (not exists(select 1 from t1 where (t1.d in ( -f,d,t1.b))) or -t1.f not between -b and t1.b)),11))/abs(13)))) when 13 then d else t1.f end from t1 where t1.e in ((19),t1.e,17) or e>=t1.d),e)<>17 or 19<=19} -} {200} -do_test randexpr-2.2187 { - db eval {SELECT case when a+13*+ -~case when 17=t1.c*17 then 19 | (t1.b) when f+t1.e+(d)+b+c not between (d) and e or (a between t1.b and t1.a) then 17 else a end-17-(e)<=17 then b when c in (select 17 from t1 union select t1.a from t1) then c else t1.e end FROM t1 WHERE NOT (e-coalesce((select f-case 17+t1.a*(abs(t1.e)/abs((abs(coalesce((select max(+ -case when t1.a>=d then c else t1.e end-d) from t1 where (not exists(select 1 from t1 where (t1.d in ( -f,d,t1.b))) or -t1.f not between -b and t1.b)),11))/abs(13)))) when 13 then d else t1.f end from t1 where t1.e in ((19),t1.e,17) or e>=t1.d),e)<>17 or 19<=19)} -} {} -do_test randexpr-2.2188 { - db eval {SELECT case when a+13*+ -~case when 17=t1.c*17 then 19 & (t1.b) when f+t1.e+(d)+b+c not between (d) and e or (a between t1.b and t1.a) then 17 else a end-17-(e)<=17 then b when c in (select 17 from t1 union select t1.a from t1) then c else t1.e end FROM t1 WHERE e-coalesce((select f-case 17+t1.a*(abs(t1.e)/abs((abs(coalesce((select max(+ -case when t1.a>=d then c else t1.e end-d) from t1 where (not exists(select 1 from t1 where (t1.d in ( -f,d,t1.b))) or -t1.f not between -b and t1.b)),11))/abs(13)))) when 13 then d else t1.f end from t1 where t1.e in ((19),t1.e,17) or e>=t1.d),e)<>17 or 19<=19} -} {200} -do_test randexpr-2.2189 { - db eval {SELECT 17-t1.a*(select abs(~count(*)*abs(count(distinct a)) | (~count(distinct case (a* -coalesce((select a from t1 where (13 in (select max((abs(t1.e)/abs(case when not exists(select 1 from t1 where (b<>c)) then (11)-t1.f-e else e end))) from t1 union select (count(distinct 11)) from t1))),t1.b)+11) when (17) then e else f end))) from t1) FROM t1 WHERE 13>case (e) when t1.a then t1.a else 11 end-t1.b} -} {-183} -do_test randexpr-2.2190 { - db eval {SELECT 17-t1.a*(select abs(~count(*)*abs(count(distinct a)) | (~count(distinct case (a* -coalesce((select a from t1 where (13 in (select max((abs(t1.e)/abs(case when not exists(select 1 from t1 where (b<>c)) then (11)-t1.f-e else e end))) from t1 union select (count(distinct 11)) from t1))),t1.b)+11) when (17) then e else f end))) from t1) FROM t1 WHERE NOT (13>case (e) when t1.a then t1.a else 11 end-t1.b)} -} {} -do_test randexpr-2.2191 { - db eval {SELECT 17-t1.a*(select abs(~count(*)*abs(count(distinct a)) & (~count(distinct case (a* -coalesce((select a from t1 where (13 in (select max((abs(t1.e)/abs(case when not exists(select 1 from t1 where (b<>c)) then (11)-t1.f-e else e end))) from t1 union select (count(distinct 11)) from t1))),t1.b)+11) when (17) then e else f end))) from t1) FROM t1 WHERE 13>case (e) when t1.a then t1.a else 11 end-t1.b} -} {-183} -do_test randexpr-2.2192 { - db eval {SELECT case when t1.b= -b then e else (select -(count(distinct t1.a))*max(c)-count(*)+count(distinct t1.b+d)*min(t1.f-case when 19 in (select t1.d from t1 union select e from t1) then 17 when f<=t1.c then t1.b else e end-(d)*c)-count(distinct t1.d)*case +max(f) when max(17) | max(d) | -(cast(avg(d) AS integer)) then -cast(avg(11) AS integer) else -count(distinct 11) end*min(t1.d) from t1) end FROM t1 WHERE t1.f>=f} -} {-119801} -do_test randexpr-2.2193 { - db eval {SELECT case when t1.b= -b then e else (select -(count(distinct t1.a))*max(c)-count(*)+count(distinct t1.b+d)*min(t1.f-case when 19 in (select t1.d from t1 union select e from t1) then 17 when f<=t1.c then t1.b else e end-(d)*c)-count(distinct t1.d)*case +max(f) when max(17) | max(d) | -(cast(avg(d) AS integer)) then -cast(avg(11) AS integer) else -count(distinct 11) end*min(t1.d) from t1) end FROM t1 WHERE NOT (t1.f>=f)} -} {} -do_test randexpr-2.2194 { - db eval {SELECT case when t1.b= -b then e else (select -(count(distinct t1.a))*max(c)-count(*)+count(distinct t1.b+d)*min(t1.f-case when 19 in (select t1.d from t1 union select e from t1) then 17 when f<=t1.c then t1.b else e end-(d)*c)-count(distinct t1.d)*case +max(f) when max(17) & max(d) & -(cast(avg(d) AS integer)) then -cast(avg(11) AS integer) else -count(distinct 11) end*min(t1.d) from t1) end FROM t1 WHERE t1.f>=f} -} {-119801} -do_test randexpr-2.2195 { - db eval {SELECT -~f | (abs(13+t1.b)/abs((select max(t1.b | t1.f+ -17-11) | +case min(e) when count(*) | case (~ -min(c)*cast(avg(19) AS integer)) when -count(*) then min(a) else min(13) end then -((max(t1.c))) else max(e) end-(count(distinct -t1.a)) from t1)))+~(abs((abs(case when a<>19 then t1.a when f>17 then a else b end)/abs(t1.b)))/abs(t1.f)) FROM t1 WHERE (17 between t1.f*(abs(b)/abs((abs((select max(17) from t1) | 17)/abs(13))+c-coalesce((select max(d) from t1 where d between f-a-11-d and a+t1.a+d-t1.b+17+13),case when a not between a and t1.b then t1.d when t1.d not in ((e),a,d) then c else b end*d))) and b and t1.e> -17)} -} {} -do_test randexpr-2.2196 { - db eval {SELECT -~f | (abs(13+t1.b)/abs((select max(t1.b | t1.f+ -17-11) | +case min(e) when count(*) | case (~ -min(c)*cast(avg(19) AS integer)) when -count(*) then min(a) else min(13) end then -((max(t1.c))) else max(e) end-(count(distinct -t1.a)) from t1)))+~(abs((abs(case when a<>19 then t1.a when f>17 then a else b end)/abs(t1.b)))/abs(t1.f)) FROM t1 WHERE NOT ((17 between t1.f*(abs(b)/abs((abs((select max(17) from t1) | 17)/abs(13))+c-coalesce((select max(d) from t1 where d between f-a-11-d and a+t1.a+d-t1.b+17+13),case when a not between a and t1.b then t1.d when t1.d not in ((e),a,d) then c else b end*d))) and b and t1.e> -17))} -} {-1} -do_test randexpr-2.2197 { - db eval {SELECT (select abs(abs( -case case ~count(distinct t1.f+(t1.f)+coalesce((select (abs(t1.e+(b)+a)/abs(11))+b from t1 where exists(select 1 from t1 where t1.f not in (t1.b,(b),e) and not (t1.b)>c)),f)) when ~count(*)-min(t1.f) then +(count(*))*( -count(*)-max(t1.a)) else min(11) end when count(distinct (f)) then -count(distinct a) else count(*) end | count(distinct 13))) from t1) FROM t1 WHERE exists(select 1 from t1 where case when t1.f>(abs(b)/abs(a)) then ~case when t1.e+13-b<=(coalesce((select max(11) from t1 where (select abs(min(11)) from t1) in (select case d when f then 17 else t1.f end from t1 union select t1.f from t1)),b)*13)-19 then 11 when not 19 between t1.c and t1.b then a else e end-t1.a when (t1.a) not between b and t1.f then t1.a else c end=t1.e)} -} {} -do_test randexpr-2.2198 { - db eval {SELECT (select abs(abs( -case case ~count(distinct t1.f+(t1.f)+coalesce((select (abs(t1.e+(b)+a)/abs(11))+b from t1 where exists(select 1 from t1 where t1.f not in (t1.b,(b),e) and not (t1.b)>c)),f)) when ~count(*)-min(t1.f) then +(count(*))*( -count(*)-max(t1.a)) else min(11) end when count(distinct (f)) then -count(distinct a) else count(*) end | count(distinct 13))) from t1) FROM t1 WHERE NOT (exists(select 1 from t1 where case when t1.f>(abs(b)/abs(a)) then ~case when t1.e+13-b<=(coalesce((select max(11) from t1 where (select abs(min(11)) from t1) in (select case d when f then 17 else t1.f end from t1 union select t1.f from t1)),b)*13)-19 then 11 when not 19 between t1.c and t1.b then a else e end-t1.a when (t1.a) not between b and t1.f then t1.a else c end=t1.e))} -} {1} -do_test randexpr-2.2199 { - db eval {SELECT (select abs(abs( -case case ~count(distinct t1.f+(t1.f)+coalesce((select (abs(t1.e+(b)+a)/abs(11))+b from t1 where exists(select 1 from t1 where t1.f not in (t1.b,(b),e) and not (t1.b)>c)),f)) when ~count(*)-min(t1.f) then +(count(*))*( -count(*)-max(t1.a)) else min(11) end when count(distinct (f)) then -count(distinct a) else count(*) end & count(distinct 13))) from t1) FROM t1 WHERE NOT (exists(select 1 from t1 where case when t1.f>(abs(b)/abs(a)) then ~case when t1.e+13-b<=(coalesce((select max(11) from t1 where (select abs(min(11)) from t1) in (select case d when f then 17 else t1.f end from t1 union select t1.f from t1)),b)*13)-19 then 11 when not 19 between t1.c and t1.b then a else e end-t1.a when (t1.a) not between b and t1.f then t1.a else c end=t1.e))} -} {1} -do_test randexpr-2.2200 { - db eval {SELECT 19 | t1.a*(select case max(case when t1.b*17>=t1.b then coalesce((select max(e) from t1 where e in (select count(*) from t1 union select count(distinct t1.f) from t1)),d) when t1.a in (select min(11) from t1 union select (( -( -max(t1.f)))) from t1) and 17 in (select count(distinct 17) from t1 union select -count(distinct d) from t1) and (d)<>t1.c and t1.c not between b and b then a else 11 end)+cast(avg(t1.a) AS integer) when ~count(distinct t1.e) then count(distinct d) else count(distinct e) end from t1) | e*t1.b-t1.d FROM t1 WHERE (((abs(19)/abs(case ~c*d+(abs(e)/abs((coalesce((select case when (f in (select count(*) from t1 union select -min(d) from t1)) then case when -t1.f between t1.c and t1.f then b when 11<>a then t1.a else t1.c end when 13=13 then 13 else t1.a end from t1 where 19 not between 11 and t1.b or t1.b not in ((e),(b),c)),a)- -((t1.c))-c)))+t1.b+17 when 13 then ((13)) else t1.f end*t1.b)) in ( -17,t1.a,11)))} -} {} -do_test randexpr-2.2201 { - db eval {SELECT 19 | t1.a*(select case max(case when t1.b*17>=t1.b then coalesce((select max(e) from t1 where e in (select count(*) from t1 union select count(distinct t1.f) from t1)),d) when t1.a in (select min(11) from t1 union select (( -( -max(t1.f)))) from t1) and 17 in (select count(distinct 17) from t1 union select -count(distinct d) from t1) and (d)<>t1.c and t1.c not between b and b then a else 11 end)+cast(avg(t1.a) AS integer) when ~count(distinct t1.e) then count(distinct d) else count(distinct e) end from t1) | e*t1.b-t1.d FROM t1 WHERE NOT ((((abs(19)/abs(case ~c*d+(abs(e)/abs((coalesce((select case when (f in (select count(*) from t1 union select -min(d) from t1)) then case when -t1.f between t1.c and t1.f then b when 11<>a then t1.a else t1.c end when 13=13 then 13 else t1.a end from t1 where 19 not between 11 and t1.b or t1.b not in ((e),(b),c)),a)- -((t1.c))-c)))+t1.b+17 when 13 then ((13)) else t1.f end*t1.b)) in ( -17,t1.a,11))))} -} {99703} -do_test randexpr-2.2202 { - db eval {SELECT 19 & t1.a*(select case max(case when t1.b*17>=t1.b then coalesce((select max(e) from t1 where e in (select count(*) from t1 union select count(distinct t1.f) from t1)),d) when t1.a in (select min(11) from t1 union select (( -( -max(t1.f)))) from t1) and 17 in (select count(distinct 17) from t1 union select -count(distinct d) from t1) and (d)<>t1.c and t1.c not between b and b then a else 11 end)+cast(avg(t1.a) AS integer) when ~count(distinct t1.e) then count(distinct d) else count(distinct e) end from t1) & e*t1.b-t1.d FROM t1 WHERE NOT ((((abs(19)/abs(case ~c*d+(abs(e)/abs((coalesce((select case when (f in (select count(*) from t1 union select -min(d) from t1)) then case when -t1.f between t1.c and t1.f then b when 11<>a then t1.a else t1.c end when 13=13 then 13 else t1.a end from t1 where 19 not between 11 and t1.b or t1.b not in ((e),(b),c)),a)- -((t1.c))-c)))+t1.b+17 when 13 then ((13)) else t1.f end*t1.b)) in ( -17,t1.a,11))))} -} {0} -do_test randexpr-2.2203 { - db eval {SELECT c-coalesce((select -coalesce((select max(case when (abs(~~case when case when t1.e<=e and t1.f>t1.d then b when t1.a<>t1.a then 17 else 17 end+t1.c>=t1.a then (c) when c not in (f,e,t1.c) then t1.d else 13 end)/abs(t1.a))c),t1.a)*19 FROM t1 WHERE (17) | case when 19 not in ((case when (e*19=f) then case t1.f when a then 13 else t1.d end when bt1.b) then f else a end in (select c from t1 union select -13 from t1) or 17 in (select 19 from t1 union select d from t1) and t1.b in (c,b,19) and t1.b>=( -b)} -} {} -do_test randexpr-2.2204 { - db eval {SELECT c-coalesce((select -coalesce((select max(case when (abs(~~case when case when t1.e<=e and t1.f>t1.d then b when t1.a<>t1.a then 17 else 17 end+t1.c>=t1.a then (c) when c not in (f,e,t1.c) then t1.d else 13 end)/abs(t1.a))c),t1.a)*19 FROM t1 WHERE NOT ((17) | case when 19 not in ((case when (e*19=f) then case t1.f when a then 13 else t1.d end when bt1.b) then f else a end in (select c from t1 union select -13 from t1) or 17 in (select 19 from t1 union select d from t1) and t1.b in (c,b,19) and t1.b>=( -b))} -} {-1600} -do_test randexpr-2.2205 { - db eval {SELECT 13+case when not (t1.d in (11,f,t1.a)) then coalesce((select +t1.e from t1 where case t1.e when t1.b then 19+t1.a+~e+a*t1.a else 11 end not between 19 and 19),(abs(t1.f-case when (19)=17 then t1.c else t1.f end)/abs(19)) from t1 union select c from t1)), -d)) from t1))/abs(t1.d))) from t1)*(c) | 11+t1.c*t1.b) from t1 union select cast(avg(t1.c) AS integer) from t1)} -} {} -do_test randexpr-2.2206 { - db eval {SELECT 13+case when not (t1.d in (11,f,t1.a)) then coalesce((select +t1.e from t1 where case t1.e when t1.b then 19+t1.a+~e+a*t1.a else 11 end not between 19 and 19),(abs(t1.f-case when (19)=17 then t1.c else t1.f end)/abs(19)) from t1 union select c from t1)), -d)) from t1))/abs(t1.d))) from t1)*(c) | 11+t1.c*t1.b) from t1 union select cast(avg(t1.c) AS integer) from t1))} -} {400013} -do_test randexpr-2.2207 { - db eval {SELECT case when -11-t1.b-f-t1.b>~c then t1.e else case when t1.d<>b*~17+t1.d*(select max(+(select count(distinct t1.a)+ -cast(avg(d) AS integer)*max(13) from t1)) from t1) or (abs(c)/abs(c)) not in (11,d,t1.c) then 13 when d in (select f from t1 union select b from t1) then t1.f else -t1.a end+ -f end FROM t1 WHERE ~t1.b*19-d not between ~b and t1.f} -} {-587} -do_test randexpr-2.2208 { - db eval {SELECT case when -11-t1.b-f-t1.b>~c then t1.e else case when t1.d<>b*~17+t1.d*(select max(+(select count(distinct t1.a)+ -cast(avg(d) AS integer)*max(13) from t1)) from t1) or (abs(c)/abs(c)) not in (11,d,t1.c) then 13 when d in (select f from t1 union select b from t1) then t1.f else -t1.a end+ -f end FROM t1 WHERE NOT (~t1.b*19-d not between ~b and t1.f)} -} {} -do_test randexpr-2.2209 { - db eval {SELECT coalesce((select t1.b from t1 where coalesce((select max(coalesce((select max(t1.a) from t1 where t1.c=t1.e),case b-f when f then e else 13 end-t1.d)) from t1 where not exists(select 1 from t1 where -t1.f>=17)),a)*(19) in (select max(d) from t1 union select case -count(*) when +count(distinct (t1.f)) then min(t1.d) else count(*) end from t1) and a<=f and d not between b and 19 and not exists(select 1 from t1 where b between t1.c and e or c<>t1.f)),17) FROM t1 WHERE t1.a-19<>c*d} -} {17} -do_test randexpr-2.2210 { - db eval {SELECT coalesce((select t1.b from t1 where coalesce((select max(coalesce((select max(t1.a) from t1 where t1.c=t1.e),case b-f when f then e else 13 end-t1.d)) from t1 where not exists(select 1 from t1 where -t1.f>=17)),a)*(19) in (select max(d) from t1 union select case -count(*) when +count(distinct (t1.f)) then min(t1.d) else count(*) end from t1) and a<=f and d not between b and 19 and not exists(select 1 from t1 where b between t1.c and e or c<>t1.f)),17) FROM t1 WHERE NOT (t1.a-19<>c*d)} -} {} -do_test randexpr-2.2211 { - db eval {SELECT (coalesce((select case (select ~count(*) | max(b+t1.b)+case max((abs(+coalesce((select max(f) from t1 where not (17=e)),t1.f))/abs(b))*a) when -~~ -(cast(avg(13) AS integer)) | count(*) then min(13) else count(*) end-count(distinct d) from t1) when 17+t1.d then t1.a else 13 end from t1 where e not between 13 and 11),11)+t1.e+b) FROM t1 WHERE not f in (select t1.e from t1 union select t1.f from t1) or 13 not in (t1.b | t1.e,t1.f,d) or (abs(f)/abs(+(abs(f+(select max(case when ((13<>t1.c)) then 13 else t1.c end) | ~min(t1.a)+cast(avg(a) AS integer) from t1)*(d)-b)/abs(d))*e))-t1.b not in (t1.c,f,t1.d) and t1.b<>t1.f} -} {713} -do_test randexpr-2.2212 { - db eval {SELECT (coalesce((select case (select ~count(*) | max(b+t1.b)+case max((abs(+coalesce((select max(f) from t1 where not (17=e)),t1.f))/abs(b))*a) when -~~ -(cast(avg(13) AS integer)) | count(*) then min(13) else count(*) end-count(distinct d) from t1) when 17+t1.d then t1.a else 13 end from t1 where e not between 13 and 11),11)+t1.e+b) FROM t1 WHERE NOT (not f in (select t1.e from t1 union select t1.f from t1) or 13 not in (t1.b | t1.e,t1.f,d) or (abs(f)/abs(+(abs(f+(select max(case when ((13<>t1.c)) then 13 else t1.c end) | ~min(t1.a)+cast(avg(a) AS integer) from t1)*(d)-b)/abs(d))*e))-t1.b not in (t1.c,f,t1.d) and t1.b<>t1.f)} -} {} -do_test randexpr-2.2213 { - db eval {SELECT (coalesce((select case (select ~count(*) & max(b+t1.b)+case max((abs(+coalesce((select max(f) from t1 where not (17=e)),t1.f))/abs(b))*a) when -~~ -(cast(avg(13) AS integer)) & count(*) then min(13) else count(*) end-count(distinct d) from t1) when 17+t1.d then t1.a else 13 end from t1 where e not between 13 and 11),11)+t1.e+b) FROM t1 WHERE not f in (select t1.e from t1 union select t1.f from t1) or 13 not in (t1.b | t1.e,t1.f,d) or (abs(f)/abs(+(abs(f+(select max(case when ((13<>t1.c)) then 13 else t1.c end) | ~min(t1.a)+cast(avg(a) AS integer) from t1)*(d)-b)/abs(d))*e))-t1.b not in (t1.c,f,t1.d) and t1.b<>t1.f} -} {713} -do_test randexpr-2.2214 { - db eval {SELECT t1.b-c*a*t1.b+ -f | (case when 1317)} -} {-6000392} -do_test randexpr-2.2215 { - db eval {SELECT t1.b-c*a*t1.b+ -f | (case when 1317))} -} {} -do_test randexpr-2.2216 { - db eval {SELECT t1.b-c*a*t1.b+ -f & (case when 1317)} -} {192} -do_test randexpr-2.2217 { - db eval {SELECT ~(select (abs(cast(avg(((b)-d*t1.a-c+17+f+e+ -17)) AS integer))) from t1)*t1.c++ -(11-t1.b*~f-e*t1.b)-coalesce((select max(case when not c=13 then 17 else b end) from t1 where (t1.a>17)),c) | -f-f FROM t1 WHERE a+coalesce((select max(coalesce((select max(f) from t1 where ((not b in (select t1.b from t1 union select (select -cast(avg(t1.b) AS integer) from t1) from t1)) or not t1.d= -t1.c and 19<=t1.c)),t1.f)-coalesce((select c from t1 where d<=t1.a), -e)) from t1 where d in (select t1.d from t1 union select t1.d from t1)),t1.d)-a | t1.b>(f) or t1.d between 19 and t1.c and exists(select 1 from t1 where b=13) and not 13 not in (t1.d,(c),d) and e not between 17 and 13} -} {-1040} -do_test randexpr-2.2218 { - db eval {SELECT ~(select (abs(cast(avg(((b)-d*t1.a-c+17+f+e+ -17)) AS integer))) from t1)*t1.c++ -(11-t1.b*~f-e*t1.b)-coalesce((select max(case when not c=13 then 17 else b end) from t1 where (t1.a>17)),c) | -f-f FROM t1 WHERE NOT (a+coalesce((select max(coalesce((select max(f) from t1 where ((not b in (select t1.b from t1 union select (select -cast(avg(t1.b) AS integer) from t1) from t1)) or not t1.d= -t1.c and 19<=t1.c)),t1.f)-coalesce((select c from t1 where d<=t1.a), -e)) from t1 where d in (select t1.d from t1 union select t1.d from t1)),t1.d)-a | t1.b>(f) or t1.d between 19 and t1.c and exists(select 1 from t1 where b=13) and not 13 not in (t1.d,(c),d) and e not between 17 and 13)} -} {} -do_test randexpr-2.2219 { - db eval {SELECT ~(select (abs(cast(avg(((b)-d*t1.a-c+17+f+e+ -17)) AS integer))) from t1)*t1.c++ -(11-t1.b*~f-e*t1.b)-coalesce((select max(case when not c=13 then 17 else b end) from t1 where (t1.a>17)),c) & -f-f FROM t1 WHERE a+coalesce((select max(coalesce((select max(f) from t1 where ((not b in (select t1.b from t1 union select (select -cast(avg(t1.b) AS integer) from t1) from t1)) or not t1.d= -t1.c and 19<=t1.c)),t1.f)-coalesce((select c from t1 where d<=t1.a), -e)) from t1 where d in (select t1.d from t1 union select t1.d from t1)),t1.d)-a | t1.b>(f) or t1.d between 19 and t1.c and exists(select 1 from t1 where b=13) and not 13 not in (t1.d,(c),d) and e not between 17 and 13} -} {-11720688} -do_test randexpr-2.2220 { - db eval {SELECT case when t1.a in (select count(*) from t1 union select cast(avg(t1.a) AS integer)*count(distinct 17) | -count(*) from t1) then ~coalesce((select max(19+t1.a) from t1 where +d=t1.a),case t1.c-(select count(*) from t1) when coalesce((select (abs((select (cast(avg(13) AS integer)) from t1))/abs(13)) from t1 where f<~13-(t1.a)*19),d) then a else 19 end) | b when t1.d>a then f else b end FROM t1 WHERE 19<=case when (t1.a*11*19-e<>(select abs(min(e))+case -abs(abs( - -( -(( -max(c)))))-(min(c))) when min(e) then -(min(f)) else - -min(t1.a) end from t1)*t1.d) then e+f+coalesce((select max(e-a) from t1 where (t1.b) between 11 and -t1.c),c) when t1.c<=17 then 17 else t1.b end and 19<>t1.f} -} {600} -do_test randexpr-2.2221 { - db eval {SELECT case when t1.a in (select count(*) from t1 union select cast(avg(t1.a) AS integer)*count(distinct 17) | -count(*) from t1) then ~coalesce((select max(19+t1.a) from t1 where +d=t1.a),case t1.c-(select count(*) from t1) when coalesce((select (abs((select (cast(avg(13) AS integer)) from t1))/abs(13)) from t1 where f<~13-(t1.a)*19),d) then a else 19 end) | b when t1.d>a then f else b end FROM t1 WHERE NOT (19<=case when (t1.a*11*19-e<>(select abs(min(e))+case -abs(abs( - -( -(( -max(c)))))-(min(c))) when min(e) then -(min(f)) else - -min(t1.a) end from t1)*t1.d) then e+f+coalesce((select max(e-a) from t1 where (t1.b) between 11 and -t1.c),c) when t1.c<=17 then 17 else t1.b end and 19<>t1.f)} -} {} -do_test randexpr-2.2222 { - db eval {SELECT case when t1.a in (select count(*) from t1 union select cast(avg(t1.a) AS integer)*count(distinct 17) & -count(*) from t1) then ~coalesce((select max(19+t1.a) from t1 where +d=t1.a),case t1.c-(select count(*) from t1) when coalesce((select (abs((select (cast(avg(13) AS integer)) from t1))/abs(13)) from t1 where f<~13-(t1.a)*19),d) then a else 19 end) & b when t1.d>a then f else b end FROM t1 WHERE 19<=case when (t1.a*11*19-e<>(select abs(min(e))+case -abs(abs( - -( -(( -max(c)))))-(min(c))) when min(e) then -(min(f)) else - -min(t1.a) end from t1)*t1.d) then e+f+coalesce((select max(e-a) from t1 where (t1.b) between 11 and -t1.c),c) when t1.c<=17 then 17 else t1.b end and 19<>t1.f} -} {200} -do_test randexpr-2.2223 { - db eval {SELECT c-case when t1.e>coalesce((select case -t1.d-case when d in (select -t1.f from t1 union select t1.c+t1.c from t1) and (t1.a<=t1.a) then 11*(17) when d between 11 and e or -c<>t1.f then 19 else 19 end+11 when 19 then b else t1.b end-t1.a from t1 where not e<=f),( -t1.f)) then b when ((dcoalesce((select case -t1.d-case when d in (select -t1.f from t1 union select t1.c+t1.c from t1) and (t1.a<=t1.a) then 11*(17) when d between 11 and e or -c<>t1.f then 19 else 19 end+11 when 19 then b else t1.b end-t1.a from t1 where not e<=f),( -t1.f)) then b when ((dt1.d),d)>=13 then coalesce((select -17+e from t1 where t1.a<=19),b) else (19) end FROM t1 WHERE (abs( -t1.f)/abs(t1.a))<=t1.d} -} {200} -do_test randexpr-2.2229 { - db eval {SELECT case when not (select -case (( -(count(*)) | cast(avg(d) AS integer))) | min((e)) when cast(avg(d) AS integer) then count(*) else count(distinct t1.e) end+max((17)) | max(t1.a)+ -count(*) from t1)-e in (t1.a,11-t1.d,t1.b) and coalesce((select max(t1.c) from t1 where case t1.d when t1.f then d else b end<>t1.d),d)>=13 then coalesce((select -17+e from t1 where t1.a<=19),b) else (19) end FROM t1 WHERE NOT ((abs( -t1.f)/abs(t1.a))<=t1.d)} -} {} -do_test randexpr-2.2230 { - db eval {SELECT case when not (select -case (( -(count(*)) & cast(avg(d) AS integer))) & min((e)) when cast(avg(d) AS integer) then count(*) else count(distinct t1.e) end+max((17)) & max(t1.a)+ -count(*) from t1)-e in (t1.a,11-t1.d,t1.b) and coalesce((select max(t1.c) from t1 where case t1.d when t1.f then d else b end<>t1.d),d)>=13 then coalesce((select -17+e from t1 where t1.a<=19),b) else (19) end FROM t1 WHERE (abs( -t1.f)/abs(t1.a))<=t1.d} -} {200} -do_test randexpr-2.2231 { - db eval {SELECT case when 13 in (select cast(avg(11) AS integer) from t1 union select count(*) from t1) then t1.f-case c-(abs(d+~+t1.d-(abs(13)/abs(t1.e-t1.b-t1.c))*e)/abs(17*19+t1.e)) when 19 then 17 else a end when (t1.a in (select count(distinct 13) from t1 union select max(t1.f) from t1)) and c between ((c)) and (t1.a) then c else 19 end+t1.e FROM t1 WHERE 19<>t1.c} -} {519} -do_test randexpr-2.2232 { - db eval {SELECT case when 13 in (select cast(avg(11) AS integer) from t1 union select count(*) from t1) then t1.f-case c-(abs(d+~+t1.d-(abs(13)/abs(t1.e-t1.b-t1.c))*e)/abs(17*19+t1.e)) when 19 then 17 else a end when (t1.a in (select count(distinct 13) from t1 union select max(t1.f) from t1)) and c between ((c)) and (t1.a) then c else 19 end+t1.e FROM t1 WHERE NOT (19<>t1.c)} -} {} -do_test randexpr-2.2233 { - db eval {SELECT coalesce((select max(case when not exists(select 1 from t1 where coalesce((select a from t1 where (t1.c+t1.d<=t1.b and exists(select 1 from t1 where t1.f not in (~case when t1.d>d then t1.a else a end,( -e),t1.b))) and (c<>17)),e) in (select e from t1 union select d from t1)) then case when b not in (a,17,e) or f=t1.e then t1.d else d end else a end*19) from t1 where ((t1.c not between e and t1.e))),13) FROM t1 WHERE c not in (~t1.e,t1.e,a)} -} {1900} -do_test randexpr-2.2234 { - db eval {SELECT coalesce((select max(case when not exists(select 1 from t1 where coalesce((select a from t1 where (t1.c+t1.d<=t1.b and exists(select 1 from t1 where t1.f not in (~case when t1.d>d then t1.a else a end,( -e),t1.b))) and (c<>17)),e) in (select e from t1 union select d from t1)) then case when b not in (a,17,e) or f=t1.e then t1.d else d end else a end*19) from t1 where ((t1.c not between e and t1.e))),13) FROM t1 WHERE NOT (c not in (~t1.e,t1.e,a))} -} {} -do_test randexpr-2.2235 { - db eval {SELECT coalesce((select t1.f from t1 where d+(select count(distinct e) from t1)+~+ -~e-a+t1.a-b- -a*coalesce((select c-t1.d*case when ( -11<=e or b>= - -c and t1.c19),t1.f) FROM t1 WHERE t1.f<>c} -} {600} -do_test randexpr-2.2236 { - db eval {SELECT coalesce((select t1.f from t1 where d+(select count(distinct e) from t1)+~+ -~e-a+t1.a-b- -a*coalesce((select c-t1.d*case when ( -11<=e or b>= - -c and t1.c19),t1.f) FROM t1 WHERE NOT (t1.f<>c)} -} {} -do_test randexpr-2.2237 { - db eval {SELECT 19+case when d between t1.b and 19+t1.d*(select ~min(t1.e | a) from t1)-case when exists(select 1 from t1 where 19<>t1.a and 19 between case +19 when 19 then t1.e else e end and t1.a) then a when t1.a between 13 and f or (t1.f<19) and d>=t1.c and f not between a and t1.b then a else t1.d end then b else t1.a end+ -d FROM t1 WHERE f>=t1.d+(t1.a)} -} {-281} -do_test randexpr-2.2238 { - db eval {SELECT 19+case when d between t1.b and 19+t1.d*(select ~min(t1.e | a) from t1)-case when exists(select 1 from t1 where 19<>t1.a and 19 between case +19 when 19 then t1.e else e end and t1.a) then a when t1.a between 13 and f or (t1.f<19) and d>=t1.c and f not between a and t1.b then a else t1.d end then b else t1.a end+ -d FROM t1 WHERE NOT (f>=t1.d+(t1.a))} -} {} -do_test randexpr-2.2239 { - db eval {SELECT 19+case when d between t1.b and 19+t1.d*(select ~min(t1.e & a) from t1)-case when exists(select 1 from t1 where 19<>t1.a and 19 between case +19 when 19 then t1.e else e end and t1.a) then a when t1.a between 13 and f or (t1.f<19) and d>=t1.c and f not between a and t1.b then a else t1.d end then b else t1.a end+ -d FROM t1 WHERE f>=t1.d+(t1.a)} -} {-281} -do_test randexpr-2.2240 { - db eval {SELECT t1.d+(select case max(t1.f) when count(distinct ~coalesce((select case when 17 in (select t1.b from t1 union select t1.e from t1) then c when (d<= -(abs(t1.a)/abs(t1.d))) then t1.b+ -case when t1.bt1.a or t1.d>=t1.f),t1.a)-e)<=t1.e} -} {902} -do_test randexpr-2.2241 { - db eval {SELECT t1.d+(select case max(t1.f) when count(distinct ~coalesce((select case when 17 in (select t1.b from t1 union select t1.e from t1) then c when (d<= -(abs(t1.a)/abs(t1.d))) then t1.b+ -case when t1.bt1.a or t1.d>=t1.f),t1.a)-e)<=t1.e)} -} {} -do_test randexpr-2.2242 { - db eval {SELECT t1.d+(select case max(t1.f) when count(distinct ~coalesce((select case when 17 in (select t1.b from t1 union select t1.e from t1) then c when (d<= -(abs(t1.a)/abs(t1.d))) then t1.b+ -case when t1.bt1.a or t1.d>=t1.f),t1.a)-e)<=t1.e} -} {902} -do_test randexpr-2.2243 { - db eval {SELECT (select count(distinct (select case ~abs(~+abs(case (max(17)) when max(coalesce((select ~b from t1 where (not exists(select 1 from t1 where -17<>f or t1.d>=b and 19 between 19 and t1.b))),(abs(case when 19<>a then t1.c else t1.b end)/abs(19)))) then ~+cast(avg(19) AS integer) else min(t1.a) end) | case min(13) when max(11) then count(distinct -d) else count(distinct t1.d) end)*max(t1.d) when count(*) then -min(e) else (count(*)) end+count(*) from t1)) from t1) FROM t1 WHERE (d in (select abs(count(*) | case max((case when b<=13 then t1.b*e when case when t1.c between t1.d and a then t1.a when (f< -19) then t1.c else d end between t1.d and b then t1.e else t1.b end))-max((t1.c)) when max(t1.f) then -abs(+cast(avg(19) AS integer)) else abs(max(t1.c)) end++max(17))- -cast(avg(f) AS integer) from t1 union select min(11) from t1))} -} {} -do_test randexpr-2.2244 { - db eval {SELECT (select count(distinct (select case ~abs(~+abs(case (max(17)) when max(coalesce((select ~b from t1 where (not exists(select 1 from t1 where -17<>f or t1.d>=b and 19 between 19 and t1.b))),(abs(case when 19<>a then t1.c else t1.b end)/abs(19)))) then ~+cast(avg(19) AS integer) else min(t1.a) end) | case min(13) when max(11) then count(distinct -d) else count(distinct t1.d) end)*max(t1.d) when count(*) then -min(e) else (count(*)) end+count(*) from t1)) from t1) FROM t1 WHERE NOT ((d in (select abs(count(*) | case max((case when b<=13 then t1.b*e when case when t1.c between t1.d and a then t1.a when (f< -19) then t1.c else d end between t1.d and b then t1.e else t1.b end))-max((t1.c)) when max(t1.f) then -abs(+cast(avg(19) AS integer)) else abs(max(t1.c)) end++max(17))- -cast(avg(f) AS integer) from t1 union select min(11) from t1)))} -} {1} -do_test randexpr-2.2245 { - db eval {SELECT (select count(distinct (select case ~abs(~+abs(case (max(17)) when max(coalesce((select ~b from t1 where (not exists(select 1 from t1 where -17<>f or t1.d>=b and 19 between 19 and t1.b))),(abs(case when 19<>a then t1.c else t1.b end)/abs(19)))) then ~+cast(avg(19) AS integer) else min(t1.a) end) & case min(13) when max(11) then count(distinct -d) else count(distinct t1.d) end)*max(t1.d) when count(*) then -min(e) else (count(*)) end+count(*) from t1)) from t1) FROM t1 WHERE NOT ((d in (select abs(count(*) | case max((case when b<=13 then t1.b*e when case when t1.c between t1.d and a then t1.a when (f< -19) then t1.c else d end between t1.d and b then t1.e else t1.b end))-max((t1.c)) when max(t1.f) then -abs(+cast(avg(19) AS integer)) else abs(max(t1.c)) end++max(17))- -cast(avg(f) AS integer) from t1 union select min(11) from t1)))} -} {1} -do_test randexpr-2.2246 { - db eval {SELECT case d*coalesce((select e from t1 where t1.f in (case when not exists(select 1 from t1 where 19>=(+f-13)) then case when not not exists(select 1 from t1 where 17>=t1.d-13) then f else d end else t1.c end,c,+(abs(e)/abs(19*d | case 19 when b then 17 else b end-b))) or e between 13 and a),19) when b then c else t1.b end FROM t1 WHERE t1.b<=coalesce((select coalesce((select t1.a from t1 where not t1.b*(select max(t1.d) from t1)=(+f-13)) then case when not not exists(select 1 from t1 where 17>=t1.d-13) then f else d end else t1.c end,c,+(abs(e)/abs(19*d | case 19 when b then 17 else b end-b))) or e between 13 and a),19) when b then c else t1.b end FROM t1 WHERE NOT (t1.b<=coalesce((select coalesce((select t1.a from t1 where not t1.b*(select max(t1.d) from t1) -c then (b)* -19 else t1.d end<=11 or 17 not between t1.f and 13 or a not in (t1.c,t1.b,11) then c else c end<>t1.a and (f) in (select cast(avg(11) AS integer) from t1 union select case max(b) when (min(t1.c)) then count(distinct f) else max(19) end from t1) then 13 else d end | f-t1.d<=t1.f then f else 19 end FROM t1 WHERE ((f not between t1.f and d))} -} {600} -do_test randexpr-2.2251 { - db eval {SELECT case when case when case when case when t1.b<> -c then (b)* -19 else t1.d end<=11 or 17 not between t1.f and 13 or a not in (t1.c,t1.b,11) then c else c end<>t1.a and (f) in (select cast(avg(11) AS integer) from t1 union select case max(b) when (min(t1.c)) then count(distinct f) else max(19) end from t1) then 13 else d end | f-t1.d<=t1.f then f else 19 end FROM t1 WHERE NOT (((f not between t1.f and d)))} -} {} -do_test randexpr-2.2252 { - db eval {SELECT case when case when case when case when t1.b<> -c then (b)* -19 else t1.d end<=11 or 17 not between t1.f and 13 or a not in (t1.c,t1.b,11) then c else c end<>t1.a and (f) in (select cast(avg(11) AS integer) from t1 union select case max(b) when (min(t1.c)) then count(distinct f) else max(19) end from t1) then 13 else d end & f-t1.d<=t1.f then f else 19 end FROM t1 WHERE ((f not between t1.f and d))} -} {600} -do_test randexpr-2.2253 { - db eval {SELECT d-b-(abs(a)/abs(coalesce((select b from t1 where coalesce((select t1.f from t1 where 13>=f-b),t1.c)*case when coalesce((select case (d*t1.e+b) when t1.a-13 then - -t1.d else t1.a end+13 from t1 where e>=t1.f),11) | b=case when coalesce((select max(case when f<>~b | coalesce((select max(11*c) from t1 where 17=t1.f),t1.d)*d then b when a in (c,(t1.d),(f)) then a else 19 end-t1.f) from t1 where not 13 in (select cast(avg(t1.b) AS integer)-cast(avg( -t1.a) AS integer) from t1 union select count(*) from t1)),17) not in ((t1.f),c, -19) and e between 11 and (19) then 19 else t1.d end} -} {199} -do_test randexpr-2.2254 { - db eval {SELECT d-b-(abs(a)/abs(coalesce((select b from t1 where coalesce((select t1.f from t1 where 13>=f-b),t1.c)*case when coalesce((select case (d*t1.e+b) when t1.a-13 then - -t1.d else t1.a end+13 from t1 where e>=t1.f),11) | b=case when coalesce((select max(case when f<>~b | coalesce((select max(11*c) from t1 where 17=t1.f),t1.d)*d then b when a in (c,(t1.d),(f)) then a else 19 end-t1.f) from t1 where not 13 in (select cast(avg(t1.b) AS integer)-cast(avg( -t1.a) AS integer) from t1 union select count(*) from t1)),17) not in ((t1.f),c, -19) and e between 11 and (19) then 19 else t1.d end)} -} {} -do_test randexpr-2.2255 { - db eval {SELECT d-b-(abs(a)/abs(coalesce((select b from t1 where coalesce((select t1.f from t1 where 13>=f-b),t1.c)*case when coalesce((select case (d*t1.e+b) when t1.a-13 then - -t1.d else t1.a end+13 from t1 where e>=t1.f),11) & b=case when coalesce((select max(case when f<>~b | coalesce((select max(11*c) from t1 where 17=t1.f),t1.d)*d then b when a in (c,(t1.d),(f)) then a else 19 end-t1.f) from t1 where not 13 in (select cast(avg(t1.b) AS integer)-cast(avg( -t1.a) AS integer) from t1 union select count(*) from t1)),17) not in ((t1.f),c, -19) and e between 11 and (19) then 19 else t1.d end} -} {199} -do_test randexpr-2.2256 { - db eval {SELECT coalesce((select max(coalesce((select 13 from t1 where not t1.b<>e*b),t1.c*case when d>=case case 13 when coalesce((select ~~t1.f*(abs(t1.f)/abs(t1.e))-e | -t1.b from t1 where a in (11,13,t1.e)),d)*t1.e then -e else t1.b end when t1.e then 11 else t1.e end then -f else c end) | t1.a) from t1 where e>t1.d), -(t1.f)) FROM t1 WHERE not -13 in (select (+(case case min(a+t1.a) when abs(count(*)-count(distinct t1.d-+(f)-case 19 when b then t1.b else a end)) then case count(*)*max(c) when ~ -count(*)*cast(avg(t1.e) AS integer)*count(distinct -a) then count(*) else cast(avg(19) AS integer) end else cast(avg(b) AS integer) end when min(f) then max( -a) else (count(*)) end)*count(distinct t1.f)-count(*)) from t1 union select count(distinct f) from t1)} -} {90100} -do_test randexpr-2.2257 { - db eval {SELECT coalesce((select max(coalesce((select 13 from t1 where not t1.b<>e*b),t1.c*case when d>=case case 13 when coalesce((select ~~t1.f*(abs(t1.f)/abs(t1.e))-e | -t1.b from t1 where a in (11,13,t1.e)),d)*t1.e then -e else t1.b end when t1.e then 11 else t1.e end then -f else c end) | t1.a) from t1 where e>t1.d), -(t1.f)) FROM t1 WHERE NOT (not -13 in (select (+(case case min(a+t1.a) when abs(count(*)-count(distinct t1.d-+(f)-case 19 when b then t1.b else a end)) then case count(*)*max(c) when ~ -count(*)*cast(avg(t1.e) AS integer)*count(distinct -a) then count(*) else cast(avg(19) AS integer) end else cast(avg(b) AS integer) end when min(f) then max( -a) else (count(*)) end)*count(distinct t1.f)-count(*)) from t1 union select count(distinct f) from t1))} -} {} -do_test randexpr-2.2258 { - db eval {SELECT coalesce((select max(coalesce((select 13 from t1 where not t1.b<>e*b),t1.c*case when d>=case case 13 when coalesce((select ~~t1.f*(abs(t1.f)/abs(t1.e))-e & -t1.b from t1 where a in (11,13,t1.e)),d)*t1.e then -e else t1.b end when t1.e then 11 else t1.e end then -f else c end) & t1.a) from t1 where e>t1.d), -(t1.f)) FROM t1 WHERE not -13 in (select (+(case case min(a+t1.a) when abs(count(*)-count(distinct t1.d-+(f)-case 19 when b then t1.b else a end)) then case count(*)*max(c) when ~ -count(*)*cast(avg(t1.e) AS integer)*count(distinct -a) then count(*) else cast(avg(19) AS integer) end else cast(avg(b) AS integer) end when min(f) then max( -a) else (count(*)) end)*count(distinct t1.f)-count(*)) from t1 union select count(distinct f) from t1)} -} {0} -do_test randexpr-2.2259 { - db eval {SELECT coalesce((select max(t1.e*~t1.b- -t1.b-t1.b-coalesce((select t1.a from t1 where exists(select 1 from t1 where ~d+case case when a between b and f then 13 else -17 end-13 when -19 then t1.f else d end+t1.b<>e or not t1.e between 19 and t1.a or 11 in (19,c, -19))),a)*e) from t1 where t1.f<19),t1.e)-13 FROM t1 WHERE t1.b not between e and 13} -} {487} -do_test randexpr-2.2260 { - db eval {SELECT coalesce((select max(t1.e*~t1.b- -t1.b-t1.b-coalesce((select t1.a from t1 where exists(select 1 from t1 where ~d+case case when a between b and f then 13 else -17 end-13 when -19 then t1.f else d end+t1.b<>e or not t1.e between 19 and t1.a or 11 in (19,c, -19))),a)*e) from t1 where t1.f<19),t1.e)-13 FROM t1 WHERE NOT (t1.b not between e and 13)} -} {} -do_test randexpr-2.2261 { - db eval {SELECT (select (count(distinct case t1.d+case when (coalesce((select max((select + -cast(avg(b) AS integer)-min(19) | (cast(avg(19) AS integer)) from t1)) from t1 where ~c+t1.ct1.a and f between t1.e and d and f<=19 then t1.f else t1.b end-c*a when t1.f then e else t1.b end)) from t1) FROM t1 WHERE not b*c+d<>b} -} {} -do_test randexpr-2.2262 { - db eval {SELECT (select (count(distinct case t1.d+case when (coalesce((select max((select + -cast(avg(b) AS integer)-min(19) | (cast(avg(19) AS integer)) from t1)) from t1 where ~c+t1.ct1.a and f between t1.e and d and f<=19 then t1.f else t1.b end-c*a when t1.f then e else t1.b end)) from t1) FROM t1 WHERE NOT (not b*c+d<>b)} -} {1} -do_test randexpr-2.2263 { - db eval {SELECT (select (count(distinct case t1.d+case when (coalesce((select max((select + -cast(avg(b) AS integer)-min(19) & (cast(avg(19) AS integer)) from t1)) from t1 where ~c+t1.ct1.a and f between t1.e and d and f<=19 then t1.f else t1.b end-c*a when t1.f then e else t1.b end)) from t1) FROM t1 WHERE NOT (not b*c+d<>b)} -} {1} -do_test randexpr-2.2264 { - db eval {SELECT t1.b+case case c when f-((abs(t1.f)/abs(coalesce((select max(f+t1.d | t1.c*e+f+~case when c not between b and t1.a or 11<19 then c-d else t1.f end+e-t1.b*11+t1.e) from t1 where 17 not between e and 19),19)))) then d else a end when (t1.c) then t1.f else f end FROM t1 WHERE (b)-t1.c*19-t1.b>17*b-13} -} {} -do_test randexpr-2.2265 { - db eval {SELECT t1.b+case case c when f-((abs(t1.f)/abs(coalesce((select max(f+t1.d | t1.c*e+f+~case when c not between b and t1.a or 11<19 then c-d else t1.f end+e-t1.b*11+t1.e) from t1 where 17 not between e and 19),19)))) then d else a end when (t1.c) then t1.f else f end FROM t1 WHERE NOT ((b)-t1.c*19-t1.b>17*b-13)} -} {800} -do_test randexpr-2.2266 { - db eval {SELECT t1.b+case case c when f-((abs(t1.f)/abs(coalesce((select max(f+t1.d & t1.c*e+f+~case when c not between b and t1.a or 11<19 then c-d else t1.f end+e-t1.b*11+t1.e) from t1 where 17 not between e and 19),19)))) then d else a end when (t1.c) then t1.f else f end FROM t1 WHERE NOT ((b)-t1.c*19-t1.b>17*b-13)} -} {800} -do_test randexpr-2.2267 { - db eval {SELECT coalesce((select coalesce((select ((abs(19)/abs(17))) from t1 where +13 | d>d),13-(select abs(abs(~count(*)))+~count(*) from t1)+(t1.c*t1.e*(abs(19+(13))/abs(a)))-coalesce((select 17 from t1 where c<>e and b not in ((d),t1.b,b)),t1.c)+t1.d)-13 from t1 where t1.f19 then 17 else t1.c end)-count(*))) then max(11) else +max(b) end) from t1))} -} {} -do_test randexpr-2.2268 { - db eval {SELECT coalesce((select coalesce((select ((abs(19)/abs(17))) from t1 where +13 | d>d),13-(select abs(abs(~count(*)))+~count(*) from t1)+(t1.c*t1.e*(abs(19+(13))/abs(a)))-coalesce((select 17 from t1 where c<>e and b not in ((d),t1.b,b)),t1.c)+t1.d)-13 from t1 where t1.f19 then 17 else t1.c end)-count(*))) then max(11) else +max(b) end) from t1)))} -} {-289} -do_test randexpr-2.2269 { - db eval {SELECT coalesce((select coalesce((select ((abs(19)/abs(17))) from t1 where +13 & d>d),13-(select abs(abs(~count(*)))+~count(*) from t1)+(t1.c*t1.e*(abs(19+(13))/abs(a)))-coalesce((select 17 from t1 where c<>e and b not in ((d),t1.b,b)),t1.c)+t1.d)-13 from t1 where t1.f19 then 17 else t1.c end)-count(*))) then max(11) else +max(b) end) from t1)))} -} {-289} -do_test randexpr-2.2270 { - db eval {SELECT coalesce((select case d when e then t1.f else d++(abs((select count(*) from t1)-case when t1.f*case when t1.b-c in (select -cast(avg(e) AS integer) from t1 union select max(t1.a) from t1) or b between t1.a and -17 and -t1.f not between 17 and a then t1.e when 17<>11 then (abs(19)/abs(f)) else 17 end-17 not in (13,11,c) then t1.f else t1.c end)/abs(c))*t1.e end from t1 where f between t1.c and 17),t1.f) FROM t1 WHERE t1.b<>19} -} {600} -do_test randexpr-2.2271 { - db eval {SELECT coalesce((select case d when e then t1.f else d++(abs((select count(*) from t1)-case when t1.f*case when t1.b-c in (select -cast(avg(e) AS integer) from t1 union select max(t1.a) from t1) or b between t1.a and -17 and -t1.f not between 17 and a then t1.e when 17<>11 then (abs(19)/abs(f)) else 17 end-17 not in (13,11,c) then t1.f else t1.c end)/abs(c))*t1.e end from t1 where f between t1.c and 17),t1.f) FROM t1 WHERE NOT (t1.b<>19)} -} {} -do_test randexpr-2.2272 { - db eval {SELECT t1.f-case when ((t1.a in (select case case +min(case when coalesce((select max(a) from t1 where t1.e not between f and t1.b),f)<>(t1.d) then - -t1.f else 19 end)-case count(*)+(count(distinct t1.d)) when -min(e) then max(t1.f) else min(19) end when cast(avg(13) AS integer) then cast(avg( -t1.a) AS integer) else (min(t1.f)) end when (count(distinct t1.e)) then -cast(avg(a) AS integer) else cast(avg(19) AS integer) end | count(distinct 13)+ -count(*) from t1 union select -max(t1.b) from t1))) then a when d between a and 11 or t1.e<>c then +t1.a-(t1.e) else t1.e end FROM t1 WHERE t1.e between d | t1.a*13 and 11+13*17+b*c++13-~b} -} {} -do_test randexpr-2.2273 { - db eval {SELECT t1.f-case when ((t1.a in (select case case +min(case when coalesce((select max(a) from t1 where t1.e not between f and t1.b),f)<>(t1.d) then - -t1.f else 19 end)-case count(*)+(count(distinct t1.d)) when -min(e) then max(t1.f) else min(19) end when cast(avg(13) AS integer) then cast(avg( -t1.a) AS integer) else (min(t1.f)) end when (count(distinct t1.e)) then -cast(avg(a) AS integer) else cast(avg(19) AS integer) end | count(distinct 13)+ -count(*) from t1 union select -max(t1.b) from t1))) then a when d between a and 11 or t1.e<>c then +t1.a-(t1.e) else t1.e end FROM t1 WHERE NOT (t1.e between d | t1.a*13 and 11+13*17+b*c++13-~b)} -} {1000} -do_test randexpr-2.2274 { - db eval {SELECT t1.f-case when ((t1.a in (select case case +min(case when coalesce((select max(a) from t1 where t1.e not between f and t1.b),f)<>(t1.d) then - -t1.f else 19 end)-case count(*)+(count(distinct t1.d)) when -min(e) then max(t1.f) else min(19) end when cast(avg(13) AS integer) then cast(avg( -t1.a) AS integer) else (min(t1.f)) end when (count(distinct t1.e)) then -cast(avg(a) AS integer) else cast(avg(19) AS integer) end & count(distinct 13)+ -count(*) from t1 union select -max(t1.b) from t1))) then a when d between a and 11 or t1.e<>c then +t1.a-(t1.e) else t1.e end FROM t1 WHERE NOT (t1.e between d | t1.a*13 and 11+13*17+b*c++13-~b)} -} {1000} -do_test randexpr-2.2275 { - db eval {SELECT coalesce((select ~(abs(e)/abs(case when exists(select 1 from t1 where 19=+c or exists(select 1 from t1 where not exists(select 1 from t1 where 11>=d or b not between b and 19)) or t1.a not in (t1.a,(11),13)) then e-13+a-c else a end))*t1.f-(19) | 19 from t1 where t1.d in (select -(cast(avg(19) AS integer)) from t1 union select count(distinct (t1.e)) from t1) and (f in (a,c,(t1.a))) and a between 11 and 11 and t1.d>=t1.f and 11 not in ((t1.f),e,(f)) and 13 not in (t1.c,t1.d,t1.c)),t1.d) FROM t1 WHERE not exists(select 1 from t1 where not coalesce((select max(b) from t1 where coalesce((select t1.f from t1 where t1.f not between t1.e and coalesce((select 13*+ -t1.a | e+case when t1.a not in (case t1.f when d then 19 else 11 end,f*e+19,t1.e+(d)) then 13 else t1.d end+t1.c-17 from t1 where t1.c>=t1.d),t1.c)),t1.d)>t1.c),11) not between b and t1.f)} -} {} -do_test randexpr-2.2276 { - db eval {SELECT coalesce((select ~(abs(e)/abs(case when exists(select 1 from t1 where 19=+c or exists(select 1 from t1 where not exists(select 1 from t1 where 11>=d or b not between b and 19)) or t1.a not in (t1.a,(11),13)) then e-13+a-c else a end))*t1.f-(19) | 19 from t1 where t1.d in (select -(cast(avg(19) AS integer)) from t1 union select count(distinct (t1.e)) from t1) and (f in (a,c,(t1.a))) and a between 11 and 11 and t1.d>=t1.f and 11 not in ((t1.f),e,(f)) and 13 not in (t1.c,t1.d,t1.c)),t1.d) FROM t1 WHERE NOT (not exists(select 1 from t1 where not coalesce((select max(b) from t1 where coalesce((select t1.f from t1 where t1.f not between t1.e and coalesce((select 13*+ -t1.a | e+case when t1.a not in (case t1.f when d then 19 else 11 end,f*e+19,t1.e+(d)) then 13 else t1.d end+t1.c-17 from t1 where t1.c>=t1.d),t1.c)),t1.d)>t1.c),11) not between b and t1.f))} -} {400} -do_test randexpr-2.2277 { - db eval {SELECT coalesce((select ~(abs(e)/abs(case when exists(select 1 from t1 where 19=+c or exists(select 1 from t1 where not exists(select 1 from t1 where 11>=d or b not between b and 19)) or t1.a not in (t1.a,(11),13)) then e-13+a-c else a end))*t1.f-(19) & 19 from t1 where t1.d in (select -(cast(avg(19) AS integer)) from t1 union select count(distinct (t1.e)) from t1) and (f in (a,c,(t1.a))) and a between 11 and 11 and t1.d>=t1.f and 11 not in ((t1.f),e,(f)) and 13 not in (t1.c,t1.d,t1.c)),t1.d) FROM t1 WHERE NOT (not exists(select 1 from t1 where not coalesce((select max(b) from t1 where coalesce((select t1.f from t1 where t1.f not between t1.e and coalesce((select 13*+ -t1.a | e+case when t1.a not in (case t1.f when d then 19 else 11 end,f*e+19,t1.e+(d)) then 13 else t1.d end+t1.c-17 from t1 where t1.c>=t1.d),t1.c)),t1.d)>t1.c),11) not between b and t1.f))} -} {400} -do_test randexpr-2.2278 { - db eval {SELECT case when (select +case -+ -case min(t1.f) when cast(avg(t1.a) AS integer) then abs(~case (min(t1.a)) when (count(*)) then (min(e)) else count(*) end) else ( -cast(avg(b) AS integer)) end*count(*) | count(distinct 11) when -cast(avg(13) AS integer) then -min(13) else max(b) end+max(a) from t1) in ((abs(coalesce((select max(11*a) from t1 where t1.b>11-(select -cast(avg(t1.d) AS integer) from t1)),case when exists(select 1 from t1 where t1.f<13) then a else e end))/abs(c)) | t1.f,f,f) then t1.e else a end FROM t1 WHERE (select case min(case when not 17<11 then (abs(+(d)*t1.c+e-f)/abs(13)) when b between a and 11 then e else b end) when abs(min(t1.b) | (+count(*))) | ~case ( -count(*))-cast(avg(a) AS integer) when count(distinct t1.a) then -count(distinct f) else count(distinct 11) end then max( -t1.d) else -max(f) end from t1)-~c*t1.a not in (t1.e,t1.c,t1.a)} -} {100} -do_test randexpr-2.2279 { - db eval {SELECT case when (select +case -+ -case min(t1.f) when cast(avg(t1.a) AS integer) then abs(~case (min(t1.a)) when (count(*)) then (min(e)) else count(*) end) else ( -cast(avg(b) AS integer)) end*count(*) | count(distinct 11) when -cast(avg(13) AS integer) then -min(13) else max(b) end+max(a) from t1) in ((abs(coalesce((select max(11*a) from t1 where t1.b>11-(select -cast(avg(t1.d) AS integer) from t1)),case when exists(select 1 from t1 where t1.f<13) then a else e end))/abs(c)) | t1.f,f,f) then t1.e else a end FROM t1 WHERE NOT ((select case min(case when not 17<11 then (abs(+(d)*t1.c+e-f)/abs(13)) when b between a and 11 then e else b end) when abs(min(t1.b) | (+count(*))) | ~case ( -count(*))-cast(avg(a) AS integer) when count(distinct t1.a) then -count(distinct f) else count(distinct 11) end then max( -t1.d) else -max(f) end from t1)-~c*t1.a not in (t1.e,t1.c,t1.a))} -} {} -do_test randexpr-2.2280 { - db eval {SELECT case when (select +case -+ -case min(t1.f) when cast(avg(t1.a) AS integer) then abs(~case (min(t1.a)) when (count(*)) then (min(e)) else count(*) end) else ( -cast(avg(b) AS integer)) end*count(*) & count(distinct 11) when -cast(avg(13) AS integer) then -min(13) else max(b) end+max(a) from t1) in ((abs(coalesce((select max(11*a) from t1 where t1.b>11-(select -cast(avg(t1.d) AS integer) from t1)),case when exists(select 1 from t1 where t1.f<13) then a else e end))/abs(c)) & t1.f,f,f) then t1.e else a end FROM t1 WHERE (select case min(case when not 17<11 then (abs(+(d)*t1.c+e-f)/abs(13)) when b between a and 11 then e else b end) when abs(min(t1.b) | (+count(*))) | ~case ( -count(*))-cast(avg(a) AS integer) when count(distinct t1.a) then -count(distinct f) else count(distinct 11) end then max( -t1.d) else -max(f) end from t1)-~c*t1.a not in (t1.e,t1.c,t1.a)} -} {100} -do_test randexpr-2.2281 { - db eval {SELECT case when ~t1.b | 13>=~coalesce((select t1.e from t1 where 11 in (select -case +max(case when (t1.f) in (t1.b,t1.a,t1.f) then f else e end) when max(f)*cast(avg(t1.d) AS integer) then cast(avg(c) AS integer) else -( - -max(t1.f)) end from t1 union select count(*) from t1)),b | ( -t1.e))*t1.c*t1.a*t1.d-f then a when 19 not between -t1.e and t1.e or f not between -a and 19 then d else 11 end FROM t1 WHERE not (d in (select t1.c from t1 union select 11 from t1))} -} {400} -do_test randexpr-2.2282 { - db eval {SELECT case when ~t1.b | 13>=~coalesce((select t1.e from t1 where 11 in (select -case +max(case when (t1.f) in (t1.b,t1.a,t1.f) then f else e end) when max(f)*cast(avg(t1.d) AS integer) then cast(avg(c) AS integer) else -( - -max(t1.f)) end from t1 union select count(*) from t1)),b | ( -t1.e))*t1.c*t1.a*t1.d-f then a when 19 not between -t1.e and t1.e or f not between -a and 19 then d else 11 end FROM t1 WHERE NOT (not (d in (select t1.c from t1 union select 11 from t1)))} -} {} -do_test randexpr-2.2283 { - db eval {SELECT case when ~t1.b & 13>=~coalesce((select t1.e from t1 where 11 in (select -case +max(case when (t1.f) in (t1.b,t1.a,t1.f) then f else e end) when max(f)*cast(avg(t1.d) AS integer) then cast(avg(c) AS integer) else -( - -max(t1.f)) end from t1 union select count(*) from t1)),b & ( -t1.e))*t1.c*t1.a*t1.d-f then a when 19 not between -t1.e and t1.e or f not between -a and 19 then d else 11 end FROM t1 WHERE not (d in (select t1.c from t1 union select 11 from t1))} -} {100} -do_test randexpr-2.2284 { - db eval {SELECT coalesce((select c from t1 where 19 in (select case count(*) when count(distinct c)*+cast(avg(13) AS integer) then max(t1.d) else max(case case when exists(select 1 from t1 where 13 not in (d,e,(19)) and 13 between t1.d and t1.f) then t1.a when b in (t1.a,a,17) then case when t1.a not between 13 and c then (t1.b) else t1.b end else 19 end when 13 then a else 19 end) end from t1 union select (abs(abs(~cast(avg(t1.d) AS integer))) | cast(avg(t1.a) AS integer)) from t1)),t1.e-11)*(t1.a) FROM t1 WHERE not exists(select 1 from t1 where t1.e in (coalesce((select max(13) from t1 where 19 in (select f from t1 union select a from t1) or (not exists(select 1 from t1 where t1.a<=(19)*c*c | 13))),+e-(f)*case when t1.c not in (coalesce((select max(t1.a) from t1 where not c<(19)),19),e,(19)) then d else f end)+a,19,17)) or (d13))),t1.a)-f-a+t1.f) | case (cast(avg(t1.c) AS integer)) when cast(avg(t1.a) AS integer)-(count(*))+max(19) then - -max(19) else cast(avg(e) AS integer) end from t1)+(select cast(avg(b) AS integer) from t1) then t1.a else e-t1.d end-17+11 FROM t1 WHERE +c-(c)*d in (coalesce((select max( -t1.d-d-13) from t1 where (t1.c) not between (abs(13)/abs(t1.c)) and t1.b),d),11,c)} -} {} -do_test randexpr-2.2288 { - db eval {SELECT -~a+d-case d when -(select max(d)*~min(coalesce((select max(t1.e) from t1 where (exists(select 1 from t1 where 17<>13))),t1.a)-f-a+t1.f) | case (cast(avg(t1.c) AS integer)) when cast(avg(t1.a) AS integer)-(count(*))+max(19) then - -max(19) else cast(avg(e) AS integer) end from t1)+(select cast(avg(b) AS integer) from t1) then t1.a else e-t1.d end-17+11 FROM t1 WHERE NOT (+c-(c)*d in (coalesce((select max( -t1.d-d-13) from t1 where (t1.c) not between (abs(13)/abs(t1.c)) and t1.b),d),11,c))} -} {395} -do_test randexpr-2.2289 { - db eval {SELECT -~a+d-case d when -(select max(d)*~min(coalesce((select max(t1.e) from t1 where (exists(select 1 from t1 where 17<>13))),t1.a)-f-a+t1.f) & case (cast(avg(t1.c) AS integer)) when cast(avg(t1.a) AS integer)-(count(*))+max(19) then - -max(19) else cast(avg(e) AS integer) end from t1)+(select cast(avg(b) AS integer) from t1) then t1.a else e-t1.d end-17+11 FROM t1 WHERE NOT (+c-(c)*d in (coalesce((select max( -t1.d-d-13) from t1 where (t1.c) not between (abs(13)/abs(t1.c)) and t1.b),d),11,c))} -} {395} -do_test randexpr-2.2290 { - db eval {SELECT case when 17 in (case (abs(coalesce((select max((select cast(avg(case when 17-(t1.b)+t1.a | b+b in (select b from t1 union select 17 from t1) then c when t1.f in (select t1.a from t1 union select 19 from t1) then 11 else t1.c end) AS integer) from t1)) from t1 where t1.e>=t1.e or (b)=b and c not in (f,t1.a,t1.a)),d))/abs(t1.b)) when 17 then t1.b else 13 end-a,13,17) then t1.a else -d end FROM t1 WHERE t1.e=t1.e or (b)=b and c not in (f,t1.a,t1.a)),d))/abs(t1.b)) when 17 then t1.b else 13 end-a,13,17) then t1.a else -d end FROM t1 WHERE NOT (t1.e=t1.e or (b)=b and c not in (f,t1.a,t1.a)),d))/abs(t1.b)) when 17 then t1.b else 13 end-a,13,17) then t1.a else -d end FROM t1 WHERE NOT (t1.e19),b-case when +13>case when (coalesce((select b from t1 where coalesce((select max(t1.f) from t1 where 17<=case c when t1.e+f then d else case when 11<17 and t1.d<=t1.e then 13 when t1.d<>f then (t1.f) else c end end*t1.c),a) in (select 17 from t1 union select b from t1)),t1.c)>= -11) then (a)*t1.a else 19 end then 13 else 17 end*19) then d else (t1.a) end FROM t1 WHERE t1.d+t1.b not in (b,f,coalesce((select max(t1.b) from t1 where exists(select 1 from t1 where c-t1.b not between case when coalesce((select max(~t1.e) from t1 where f not in (t1.b,17,t1.a)),t1.e) not in (e,13,(t1.d)) then 11 when t1.d>=17 then t1.c else 11 end and (11) and (exists(select 1 from t1 where t1.b<>11))) or 13 in (select max(t1.d) from t1 union select max(b) from t1)),t1.b+19+a))} -} {} -do_test randexpr-2.2294 { - db eval {SELECT case t1.a when coalesce((select a from t1 where t1.b>19),b-case when +13>case when (coalesce((select b from t1 where coalesce((select max(t1.f) from t1 where 17<=case c when t1.e+f then d else case when 11<17 and t1.d<=t1.e then 13 when t1.d<>f then (t1.f) else c end end*t1.c),a) in (select 17 from t1 union select b from t1)),t1.c)>= -11) then (a)*t1.a else 19 end then 13 else 17 end*19) then d else (t1.a) end FROM t1 WHERE NOT (t1.d+t1.b not in (b,f,coalesce((select max(t1.b) from t1 where exists(select 1 from t1 where c-t1.b not between case when coalesce((select max(~t1.e) from t1 where f not in (t1.b,17,t1.a)),t1.e) not in (e,13,(t1.d)) then 11 when t1.d>=17 then t1.c else 11 end and (11) and (exists(select 1 from t1 where t1.b<>11))) or 13 in (select max(t1.d) from t1 union select max(b) from t1)),t1.b+19+a)))} -} {400} -do_test randexpr-2.2295 { - db eval {SELECT coalesce((select max((coalesce((select coalesce((select max(case when case when et1.f then t1.b else c end19),t1.f) from t1 where t1.e<>t1.d),t1.b))) from t1 where 11=t1.c), -c) FROM t1 WHERE not exists(select 1 from t1 where -~e not in (c++case when 17+t1.c=d))),f-13) then a else (t1.a) end+f*19-a,b,f)) and t1.a=b} -} {} -do_test randexpr-2.2296 { - db eval {SELECT coalesce((select max((coalesce((select coalesce((select max(case when case when et1.f then t1.b else c end19),t1.f) from t1 where t1.e<>t1.d),t1.b))) from t1 where 11=t1.c), -c) FROM t1 WHERE NOT (not exists(select 1 from t1 where -~e not in (c++case when 17+t1.c=d))),f-13) then a else (t1.a) end+f*19-a,b,f)) and t1.a=b)} -} {-300} -do_test randexpr-2.2297 { - db eval {SELECT coalesce((select max((coalesce((select coalesce((select max(case when case when et1.f then t1.b else c end19),t1.f) from t1 where t1.e<>t1.d),t1.b))) from t1 where 11=t1.c), -c) FROM t1 WHERE NOT (not exists(select 1 from t1 where -~e not in (c++case when 17+t1.c=d))),f-13) then a else (t1.a) end+f*19-a,b,f)) and t1.a=b)} -} {-300} -do_test randexpr-2.2298 { - db eval {SELECT t1.b-11-case when t1.d+13+t1.c | 17+case when (+a*t1.b*t1.c not in (e,t1.f,t1.e)) then coalesce((select max(e) from t1 where t1.f>=f), -d) when f>b and t1.et1.c then 17 else -13 end not in (f,t1.f,a) and exists(select 1 from t1 where a<=11) then t1.e else c end FROM t1 WHERE case f+~d*case when t1.f<=t1.b*t1.a then e*t1.e else f end*a+f when ~case when 11 not between +(abs(b)/abs(case b+d when t1.a then f else t1.e end*13))+a and (b) then t1.e when t1.e<>11 then t1.d else 17 end+11 then t1.d else t1.b end<=13} -} {} -do_test randexpr-2.2299 { - db eval {SELECT t1.b-11-case when t1.d+13+t1.c | 17+case when (+a*t1.b*t1.c not in (e,t1.f,t1.e)) then coalesce((select max(e) from t1 where t1.f>=f), -d) when f>b and t1.et1.c then 17 else -13 end not in (f,t1.f,a) and exists(select 1 from t1 where a<=11) then t1.e else c end FROM t1 WHERE NOT (case f+~d*case when t1.f<=t1.b*t1.a then e*t1.e else f end*a+f when ~case when 11 not between +(abs(b)/abs(case b+d when t1.a then f else t1.e end*13))+a and (b) then t1.e when t1.e<>11 then t1.d else 17 end+11 then t1.d else t1.b end<=13)} -} {-111} -do_test randexpr-2.2300 { - db eval {SELECT t1.b-11-case when t1.d+13+t1.c & 17+case when (+a*t1.b*t1.c not in (e,t1.f,t1.e)) then coalesce((select max(e) from t1 where t1.f>=f), -d) when f>b and t1.et1.c then 17 else -13 end not in (f,t1.f,a) and exists(select 1 from t1 where a<=11) then t1.e else c end FROM t1 WHERE NOT (case f+~d*case when t1.f<=t1.b*t1.a then e*t1.e else f end*a+f when ~case when 11 not between +(abs(b)/abs(case b+d when t1.a then f else t1.e end*13))+a and (b) then t1.e when t1.e<>11 then t1.d else 17 end+11 then t1.d else t1.b end<=13)} -} {-111} -do_test randexpr-2.2301 { - db eval {SELECT coalesce((select t1.a from t1 where d not between 11 and 13 or case 13*17 when -c then case when (coalesce((select 17 from t1 where (~case when t1.e=d then 19 when 11 in (t1.d,b,17) then t1.c else c end-11 in (select max(e) from t1 union select (case cast(avg((t1.b)) AS integer) when max(11) then min(17) else ( -count(*)) end) from t1))),(19))>d) then t1.d else 11 end else t1.c end<=a),c) FROM t1 WHERE 19 | (abs(t1.d)/abs(11))=b} -} {} -do_test randexpr-2.2302 { - db eval {SELECT coalesce((select t1.a from t1 where d not between 11 and 13 or case 13*17 when -c then case when (coalesce((select 17 from t1 where (~case when t1.e=d then 19 when 11 in (t1.d,b,17) then t1.c else c end-11 in (select max(e) from t1 union select (case cast(avg((t1.b)) AS integer) when max(11) then min(17) else ( -count(*)) end) from t1))),(19))>d) then t1.d else 11 end else t1.c end<=a),c) FROM t1 WHERE NOT (19 | (abs(t1.d)/abs(11))=b)} -} {100} -do_test randexpr-2.2303 { - db eval {SELECT coalesce((select max(17-t1.e-17) from t1 where (t1.c>d)),case when coalesce((select +f+~coalesce((select coalesce((select case when (select cast(avg(17) AS integer) | cast(avg(t1.e) AS integer) from t1)<>coalesce((select t1.e from t1 where 19 in (select count(*) from t1 union select -( -count(*)) from t1)), -d) then b when exists(select 1 from t1 where t1.b between (t1.b) and 13) then a else -b end from t1 where 19=e),t1.c) from t1 where t1.c<=b),t1.d) from t1 where 17 between t1.a and b),t1.e) between c and t1.e then -t1.d else 13 end) FROM t1 WHERE exists(select 1 from t1 where t1.e-13-17-f*f*t1.d*coalesce((select 19-case when not not t1.d>e then case when t1.f=t1.c then 19 else f end else -t1.b end when e in (f,t1.e,17) then t1.a else t1.b end*t1.d from t1 where ((f)) in (select (~case count(distinct 11) when count(distinct t1.d) | count(distinct t1.b)-max( -f) then max(e) else (count(distinct (((a))))) end) from t1 union select max(e) from t1)),f)+c>=t1.f)} -} {} -do_test randexpr-2.2304 { - db eval {SELECT coalesce((select max(17-t1.e-17) from t1 where (t1.c>d)),case when coalesce((select +f+~coalesce((select coalesce((select case when (select cast(avg(17) AS integer) | cast(avg(t1.e) AS integer) from t1)<>coalesce((select t1.e from t1 where 19 in (select count(*) from t1 union select -( -count(*)) from t1)), -d) then b when exists(select 1 from t1 where t1.b between (t1.b) and 13) then a else -b end from t1 where 19=e),t1.c) from t1 where t1.c<=b),t1.d) from t1 where 17 between t1.a and b),t1.e) between c and t1.e then -t1.d else 13 end) FROM t1 WHERE NOT (exists(select 1 from t1 where t1.e-13-17-f*f*t1.d*coalesce((select 19-case when not not t1.d>e then case when t1.f=t1.c then 19 else f end else -t1.b end when e in (f,t1.e,17) then t1.a else t1.b end*t1.d from t1 where ((f)) in (select (~case count(distinct 11) when count(distinct t1.d) | count(distinct t1.b)-max( -f) then max(e) else (count(distinct (((a))))) end) from t1 union select max(e) from t1)),f)+c>=t1.f))} -} {-400} -do_test randexpr-2.2305 { - db eval {SELECT coalesce((select max(17-t1.e-17) from t1 where (t1.c>d)),case when coalesce((select +f+~coalesce((select coalesce((select case when (select cast(avg(17) AS integer) & cast(avg(t1.e) AS integer) from t1)<>coalesce((select t1.e from t1 where 19 in (select count(*) from t1 union select -( -count(*)) from t1)), -d) then b when exists(select 1 from t1 where t1.b between (t1.b) and 13) then a else -b end from t1 where 19=e),t1.c) from t1 where t1.c<=b),t1.d) from t1 where 17 between t1.a and b),t1.e) between c and t1.e then -t1.d else 13 end) FROM t1 WHERE NOT (exists(select 1 from t1 where t1.e-13-17-f*f*t1.d*coalesce((select 19-case when not not t1.d>e then case when t1.f=t1.c then 19 else f end else -t1.b end when e in (f,t1.e,17) then t1.a else t1.b end*t1.d from t1 where ((f)) in (select (~case count(distinct 11) when count(distinct t1.d) | count(distinct t1.b)-max( -f) then max(e) else (count(distinct (((a))))) end) from t1 union select max(e) from t1)),f)+c>=t1.f))} -} {-400} -do_test randexpr-2.2306 { - db eval {SELECT coalesce((select t1.b from t1 where exists(select 1 from t1 where (abs(~case (~13*case when c in (select (max(case when b<>11 then d when 13 not in (19,c,e) then t1.f else 19 end*t1.d)) from t1 union select abs(count(*)) | min(19) from t1) then t1.a else t1.c end-a-13-f*e*17) when f then t1.a else 13 end*t1.c)/abs(a))>t1.b)),13) FROM t1 WHERE ++case when a<=t1.a then 17 else 13 end>+f+(coalesce((select max(19) from t1 where 11 not in (case when t1.e<(abs(11)/abs(19*d*t1.c)) and (c in (select t1.c from t1 union select f from t1) or a>a) then t1.a when 11 not between t1.c and t1.a or t1.e not in ( -t1.a,17,f) then t1.d else e end+t1.f,19,(17))),17))* -11} -} {} -do_test randexpr-2.2307 { - db eval {SELECT coalesce((select t1.b from t1 where exists(select 1 from t1 where (abs(~case (~13*case when c in (select (max(case when b<>11 then d when 13 not in (19,c,e) then t1.f else 19 end*t1.d)) from t1 union select abs(count(*)) | min(19) from t1) then t1.a else t1.c end-a-13-f*e*17) when f then t1.a else 13 end*t1.c)/abs(a))>t1.b)),13) FROM t1 WHERE NOT (++case when a<=t1.a then 17 else 13 end>+f+(coalesce((select max(19) from t1 where 11 not in (case when t1.e<(abs(11)/abs(19*d*t1.c)) and (c in (select t1.c from t1 union select f from t1) or a>a) then t1.a when 11 not between t1.c and t1.a or t1.e not in ( -t1.a,17,f) then t1.d else e end+t1.f,19,(17))),17))* -11)} -} {13} -do_test randexpr-2.2308 { - db eval {SELECT coalesce((select t1.b from t1 where exists(select 1 from t1 where (abs(~case (~13*case when c in (select (max(case when b<>11 then d when 13 not in (19,c,e) then t1.f else 19 end*t1.d)) from t1 union select abs(count(*)) & min(19) from t1) then t1.a else t1.c end-a-13-f*e*17) when f then t1.a else 13 end*t1.c)/abs(a))>t1.b)),13) FROM t1 WHERE NOT (++case when a<=t1.a then 17 else 13 end>+f+(coalesce((select max(19) from t1 where 11 not in (case when t1.e<(abs(11)/abs(19*d*t1.c)) and (c in (select t1.c from t1 union select f from t1) or a>a) then t1.a when 11 not between t1.c and t1.a or t1.e not in ( -t1.a,17,f) then t1.d else e end+t1.f,19,(17))),17))* -11)} -} {13} -do_test randexpr-2.2309 { - db eval {SELECT case when c*(abs(t1.f)/abs(c))*b-11-t1.at1.d then -d else t1.f end*e) from t1 where (b)<>t1.a or 11 between ( -a) and a),t1.b) then t1.d when e=t1.e then t1.c else t1.e end FROM t1 WHERE (coalesce((select (t1.b)+f*case case +coalesce((select 13 from t1 where t1.e<=d),f)-a when d then t1.b else t1.c end+t1.e when a then 17 else t1.e end from t1 where not t1.d in (select b from t1 union select 19 from t1) or not (17t1.d then -d else t1.f end*e) from t1 where (b)<>t1.a or 11 between ( -a) and a),t1.b) then t1.d when e=t1.e then t1.c else t1.e end FROM t1 WHERE NOT ((coalesce((select (t1.b)+f*case case +coalesce((select 13 from t1 where t1.e<=d),f)-a when d then t1.b else t1.c end+t1.e when a then 17 else t1.e end from t1 where not t1.d in (select b from t1 union select 19 from t1) or not (17a) or ( -d) between c and c or (19) between t1.f and t1.b) or (b) not in (t1.d,t1.c,e)) then t1.b*t1.b when a>19 then t1.d else 11 end>=11 then t1.e else -e end FROM t1 WHERE not exists(select 1 from t1 where ((11<=+11)))} -} {} -do_test randexpr-2.2314 { - db eval {SELECT case when case when -f-case when t1.a between 13 and (e) then t1.d | a else 13 enda) or ( -d) between c and c or (19) between t1.f and t1.b) or (b) not in (t1.d,t1.c,e)) then t1.b*t1.b when a>19 then t1.d else 11 end>=11 then t1.e else -e end FROM t1 WHERE NOT (not exists(select 1 from t1 where ((11<=+11))))} -} {500} -do_test randexpr-2.2315 { - db eval {SELECT case when case when -f-case when t1.a between 13 and (e) then t1.d & a else 13 enda) or ( -d) between c and c or (19) between t1.f and t1.b) or (b) not in (t1.d,t1.c,e)) then t1.b*t1.b when a>19 then t1.d else 11 end>=11 then t1.e else -e end FROM t1 WHERE NOT (not exists(select 1 from t1 where ((11<=+11))))} -} {500} -do_test randexpr-2.2316 { - db eval {SELECT (abs(+case when 11*t1.d not between 13 and t1.d then coalesce((select 17 from t1 where case ~e when (abs(+(b+(select ~ -cast(avg(t1.c) AS integer) from t1)))/abs(case 17 when 17 then c else a end)) then t1.d else t1.d end<>t1.a),f) when not exists(select 1 from t1 where (19<=(f))) and 17=t1.b or 19 not between a and a then t1.d else d end)/abs(b)) FROM t1 WHERE t1.d-13 in (t1.a,d,(t1.b))} -} {} -do_test randexpr-2.2317 { - db eval {SELECT (abs(+case when 11*t1.d not between 13 and t1.d then coalesce((select 17 from t1 where case ~e when (abs(+(b+(select ~ -cast(avg(t1.c) AS integer) from t1)))/abs(case 17 when 17 then c else a end)) then t1.d else t1.d end<>t1.a),f) when not exists(select 1 from t1 where (19<=(f))) and 17=t1.b or 19 not between a and a then t1.d else d end)/abs(b)) FROM t1 WHERE NOT (t1.d-13 in (t1.a,d,(t1.b)))} -} {0} -do_test randexpr-2.2318 { - db eval {SELECT b+(select case ~min(t1.a+13) when (cast(avg(t1.a) AS integer)) then max(d) else max(case when case t1.b when t1.e then t1.c else t1.f end+19<>+(select count(*) from t1) then case when b in (t1.e,t1.d,t1.e) and t1.c not between t1.f and 13 then (t1.c) when 17>t1.b then 19 else t1.b end-t1.d when d in (e,f,t1.f) and (a)+t1.e then e+case when (exists(select 1 from t1 where d<17) and d<(abs(t1.e)/abs(+ - -t1.f+d))) then coalesce((select max((t1.f)) from t1 where not 19=t1.e),t1.e)+t1.e else t1.d end when not exists(select 1 from t1 where t1.d not in (19,11,t1.c)) then (t1.f) else d end} -} {1800} -do_test randexpr-2.2319 { - db eval {SELECT b+(select case ~min(t1.a+13) when (cast(avg(t1.a) AS integer)) then max(d) else max(case when case t1.b when t1.e then t1.c else t1.f end+19<>+(select count(*) from t1) then case when b in (t1.e,t1.d,t1.e) and t1.c not between t1.f and 13 then (t1.c) when 17>t1.b then 19 else t1.b end-t1.d when d in (e,f,t1.f) and (a)+t1.e then e+case when (exists(select 1 from t1 where d<17) and d<(abs(t1.e)/abs(+ - -t1.f+d))) then coalesce((select max((t1.f)) from t1 where not 19=t1.e),t1.e)+t1.e else t1.d end when not exists(select 1 from t1 where t1.d not in (19,11,t1.c)) then (t1.f) else d end)} -} {} -do_test randexpr-2.2320 { - db eval {SELECT coalesce((select max(t1.d) from t1 where t1.b+b in (select (t1.c)*11*e+f+ -c-t1.b*coalesce((select max(a) from t1 where t1.a*17 between 19 and (((abs(f)/abs(t1.c+d))))),t1.c-(abs(t1.c)/abs(19)) | case when t1.d= -t1.f then b when (t1.c) not in (e, -11,19) then 19 else t1.a end-c)*t1.a-c from t1 union select t1.d from t1)),a) FROM t1 WHERE (select abs(+min(b)) from t1)<=d+t1.a} -} {400} -do_test randexpr-2.2321 { - db eval {SELECT coalesce((select max(t1.d) from t1 where t1.b+b in (select (t1.c)*11*e+f+ -c-t1.b*coalesce((select max(a) from t1 where t1.a*17 between 19 and (((abs(f)/abs(t1.c+d))))),t1.c-(abs(t1.c)/abs(19)) | case when t1.d= -t1.f then b when (t1.c) not in (e, -11,19) then 19 else t1.a end-c)*t1.a-c from t1 union select t1.d from t1)),a) FROM t1 WHERE NOT ((select abs(+min(b)) from t1)<=d+t1.a)} -} {} -do_test randexpr-2.2322 { - db eval {SELECT coalesce((select max(t1.d) from t1 where t1.b+b in (select (t1.c)*11*e+f+ -c-t1.b*coalesce((select max(a) from t1 where t1.a*17 between 19 and (((abs(f)/abs(t1.c+d))))),t1.c-(abs(t1.c)/abs(19)) & case when t1.d= -t1.f then b when (t1.c) not in (e, -11,19) then 19 else t1.a end-c)*t1.a-c from t1 union select t1.d from t1)),a) FROM t1 WHERE (select abs(+min(b)) from t1)<=d+t1.a} -} {400} -do_test randexpr-2.2323 { - db eval {SELECT case when coalesce((select c from t1 where (~13<>d)),t1.d-+d+13*coalesce((select max(17) from t1 where -fd),e))/abs(13))*f not in (t1.e,t1.c,e) then 19 when 17 not between t1.f and 17 then t1.f else t1.e end),f)+t1.c) | d<>11 then a else 19 end FROM t1 WHERE 13=b} -} {} -do_test randexpr-2.2324 { - db eval {SELECT case when coalesce((select c from t1 where (~13<>d)),t1.d-+d+13*coalesce((select max(17) from t1 where -fd),e))/abs(13))*f not in (t1.e,t1.c,e) then 19 when 17 not between t1.f and 17 then t1.f else t1.e end),f)+t1.c) | d<>11 then a else 19 end FROM t1 WHERE NOT (13=b)} -} {100} -do_test randexpr-2.2325 { - db eval {SELECT case when coalesce((select c from t1 where (~13<>d)),t1.d-+d+13*coalesce((select max(17) from t1 where -fd),e))/abs(13))*f not in (t1.e,t1.c,e) then 19 when 17 not between t1.f and 17 then t1.f else t1.e end),f)+t1.c) & d<>11 then a else 19 end FROM t1 WHERE NOT (13=b)} -} {100} -do_test randexpr-2.2326 { - db eval {SELECT case case t1.e+13 when case when not -f>coalesce((select max(t1.b) from t1 where (select min(a) from t1)t1.d and t1.c<19 and d between b and ( -c)) then (select case ~max( -( - -t1.f)) when min(e) then -count(*) else count(*) end-cast(avg(b) AS integer) from t1) when 17<>11 then f else case -17 when t1.d then b else -t1.f end end+t1.e when t1.d>=11 then 17 else 11 end then t1.d else t1.d end when t1.c then t1.a else 11 end FROM t1 WHERE (coalesce((select coalesce((select max(coalesce((select max( -(select + -case ++case (count(*)) when cast(avg(11) AS integer) then count(*) else -min(13) end when max(19) then -cast(avg(11) AS integer) else count(distinct (b)) end | max(t1.a)+max(b) from t1)) from t1 where 11 in (select b from t1 union select 13 from t1)),case (select count(*) from t1) when 19 then case when d not between -d and b then t1.f else t1.b end else t1.c end)+d-t1.e) from t1 where t1.f not between t1.c and 19),t1.b) from t1 where t1.c between d and -t1.b),t1.b))>=c} -} {} -do_test randexpr-2.2327 { - db eval {SELECT case case t1.e+13 when case when not -f>coalesce((select max(t1.b) from t1 where (select min(a) from t1)t1.d and t1.c<19 and d between b and ( -c)) then (select case ~max( -( - -t1.f)) when min(e) then -count(*) else count(*) end-cast(avg(b) AS integer) from t1) when 17<>11 then f else case -17 when t1.d then b else -t1.f end end+t1.e when t1.d>=11 then 17 else 11 end then t1.d else t1.d end when t1.c then t1.a else 11 end FROM t1 WHERE NOT ((coalesce((select coalesce((select max(coalesce((select max( -(select + -case ++case (count(*)) when cast(avg(11) AS integer) then count(*) else -min(13) end when max(19) then -cast(avg(11) AS integer) else count(distinct (b)) end | max(t1.a)+max(b) from t1)) from t1 where 11 in (select b from t1 union select 13 from t1)),case (select count(*) from t1) when 19 then case when d not between -d and b then t1.f else t1.b end else t1.c end)+d-t1.e) from t1 where t1.f not between t1.c and 19),t1.b) from t1 where t1.c between d and -t1.b),t1.b))>=c)} -} {11} -do_test randexpr-2.2328 { - db eval {SELECT case when +case when coalesce((select t1.b from t1 where not exists(select 1 from t1 where f<=coalesce((select c from t1 where t1.a in (select ~f from t1 union select coalesce((select max(case -(13) when 13 then t1.f else a end | 13) from t1 where c<= -c or b not between f and t1.d and t1.b not in (e,t1.a,17)),a)+d from t1)),13) or t1.a>c)),11*19) between e and 17 then c else -(c) end>=t1.c then t1.d else c end FROM t1 WHERE t1.d<17-t1.a | a-+11} -} {} -do_test randexpr-2.2329 { - db eval {SELECT case when +case when coalesce((select t1.b from t1 where not exists(select 1 from t1 where f<=coalesce((select c from t1 where t1.a in (select ~f from t1 union select coalesce((select max(case -(13) when 13 then t1.f else a end | 13) from t1 where c<= -c or b not between f and t1.d and t1.b not in (e,t1.a,17)),a)+d from t1)),13) or t1.a>c)),11*19) between e and 17 then c else -(c) end>=t1.c then t1.d else c end FROM t1 WHERE NOT (t1.d<17-t1.a | a-+11)} -} {300} -do_test randexpr-2.2330 { - db eval {SELECT case when +case when coalesce((select t1.b from t1 where not exists(select 1 from t1 where f<=coalesce((select c from t1 where t1.a in (select ~f from t1 union select coalesce((select max(case -(13) when 13 then t1.f else a end & 13) from t1 where c<= -c or b not between f and t1.d and t1.b not in (e,t1.a,17)),a)+d from t1)),13) or t1.a>c)),11*19) between e and 17 then c else -(c) end>=t1.c then t1.d else c end FROM t1 WHERE NOT (t1.d<17-t1.a | a-+11)} -} {300} -do_test randexpr-2.2331 { - db eval {SELECT t1.c+c- -d*t1.d+t1.e | case when t1.e<=e and (a*t1.c) in (select ((abs(f)/abs(( -+(select abs(~(min( -c))-max( - -b)-count(*)) from t1))))) from t1 union select b from t1) then +a*t1.c-t1.d*t1.c else e end-t1.d+t1.f FROM t1 WHERE (exists(select 1 from t1 where coalesce((select max(++11+coalesce((select max(17) from t1 where case case when exists(select 1 from t1 where c not between t1.e and 17) then 19 else f end when -t1.f then t1.f else t1.a end<=t1.e or 11 in (b,a,e) and e between 11 and 11), -(a)-19)*t1.f) from t1 where t1.b between d and 17 and 17=e),19) not in (a,b,b))) and (e>=d) or b not in (c,13,19)} -} {161788} -do_test randexpr-2.2332 { - db eval {SELECT t1.c+c- -d*t1.d+t1.e | case when t1.e<=e and (a*t1.c) in (select ((abs(f)/abs(( -+(select abs(~(min( -c))-max( - -b)-count(*)) from t1))))) from t1 union select b from t1) then +a*t1.c-t1.d*t1.c else e end-t1.d+t1.f FROM t1 WHERE NOT ((exists(select 1 from t1 where coalesce((select max(++11+coalesce((select max(17) from t1 where case case when exists(select 1 from t1 where c not between t1.e and 17) then 19 else f end when -t1.f then t1.f else t1.a end<=t1.e or 11 in (b,a,e) and e between 11 and 11), -(a)-19)*t1.f) from t1 where t1.b between d and 17 and 17=e),19) not in (a,b,b))) and (e>=d) or b not in (c,13,19))} -} {} -do_test randexpr-2.2333 { - db eval {SELECT t1.c+c- -d*t1.d+t1.e & case when t1.e<=e and (a*t1.c) in (select ((abs(f)/abs(( -+(select abs(~(min( -c))-max( - -b)-count(*)) from t1))))) from t1 union select b from t1) then +a*t1.c-t1.d*t1.c else e end-t1.d+t1.f FROM t1 WHERE (exists(select 1 from t1 where coalesce((select max(++11+coalesce((select max(17) from t1 where case case when exists(select 1 from t1 where c not between t1.e and 17) then 19 else f end when -t1.f then t1.f else t1.a end<=t1.e or 11 in (b,a,e) and e between 11 and 11), -(a)-19)*t1.f) from t1 where t1.b between d and 17 and 17=e),19) not in (a,b,b))) and (e>=d) or b not in (c,13,19)} -} {12} -do_test randexpr-2.2334 { - db eval {SELECT b-case when exists(select 1 from t1 where (exists(select 1 from t1 where t1.a not between 17 and a+t1.f) or not exists(select 1 from t1 where not exists(select 1 from t1 where t1.b+f+a in (select max(19) | -max(t1.e)-cast(avg(t1.c) AS integer)- -count(distinct t1.b) from t1 union select max(t1.b) from t1)) or not exists(select 1 from t1 where not exists(select 1 from t1 where 11>c or (13) in ( -11,c,19)) or 11>f))) and t1.c not in ( -(d),t1.a,t1.a) and 17 in (t1.b,13,19)) then coalesce((select max(+19) from t1 where 17e)),b) from t1))) or ((t1.dc or (13) in ( -11,c,19)) or 11>f))) and t1.c not in ( -(d),t1.a,t1.a) and 17 in (t1.b,13,19)) then coalesce((select max(+19) from t1 where 17e)),b) from t1))) or ((t1.dc or (13) in ( -11,c,19)) or 11>f))) and t1.c not in ( -(d),t1.a,t1.a) and 17 in (t1.b,13,19)) then coalesce((select max(+19) from t1 where 17e)),b) from t1))) or ((t1.d= -t1.f),t1.c))),b) end from t1 where not a=11),t1.c) FROM t1 WHERE not 13<>11+17-case when 17 between (abs(case f when 19 | t1.a then +(select cast(avg(case when not exists(select 1 from t1 where ~ -13*(select -cast(avg(t1.b*d) AS integer) from t1)+17<>(t1.b)) then ~t1.c when b>t1.d then c else (f) end) AS integer) from t1) else a end)/abs(19)) and t1.f then t1.b when a<>t1.c then t1.e else b end} -} {} -do_test randexpr-2.2338 { - db eval {SELECT coalesce((select t1.f*t1.b+case t1.a when 17 then -t1.c else coalesce((select b from t1 where 19 in (f,d+b,coalesce((select t1.e-b from t1 where t1.b*d+case t1.c when case coalesce((select t1.b from t1 where c not in (b,a,13)),(13)) when t1.b then 19 else 19 end then t1.d else 19 end+ -b>= -t1.f),t1.c))),b) end from t1 where not a=11),t1.c) FROM t1 WHERE NOT (not 13<>11+17-case when 17 between (abs(case f when 19 | t1.a then +(select cast(avg(case when not exists(select 1 from t1 where ~ -13*(select -cast(avg(t1.b*d) AS integer) from t1)+17<>(t1.b)) then ~t1.c when b>t1.d then c else (f) end) AS integer) from t1) else a end)/abs(19)) and t1.f then t1.b when a<>t1.c then t1.e else b end)} -} {120200} -do_test randexpr-2.2339 { - db eval {SELECT coalesce((select max(19) from t1 where t1.f*17+case t1.f when 11 then coalesce((select max(t1.a) from t1 where 13<>t1.d),(abs(13+b-case when not c+(abs(case when t1.c not between a and t1.f then -(e) else t1.d end)/abs( -17))=13} -} {119} -do_test randexpr-2.2340 { - db eval {SELECT coalesce((select max(19) from t1 where t1.f*17+case t1.f when 11 then coalesce((select max(t1.a) from t1 where 13<>t1.d),(abs(13+b-case when not c+(abs(case when t1.c not between a and t1.f then -(e) else t1.d end)/abs( -17))=13)} -} {} -do_test randexpr-2.2341 { - db eval {SELECT +coalesce((select max(e) from t1 where -(case 13*(t1.b* -case when e<=19 then b when t1.e=c then (b) else f end*t1.e) when e then 13 else t1.f end)=t1.b and t1.a in (select count(*) | case case min(b)*(count(*)) when abs(cast(avg(13) AS integer))-max(t1.d) then min(19) else -cast(avg(b) AS integer) end when count(*) then (max(c)) else count(distinct 19) end+cast(avg((b)) AS integer) from t1 union select count(*) from t1)),t1.a) FROM t1 WHERE (select (min(13-(abs(c)/abs(case when coalesce((select case when coalesce((select -a from t1 where case a*f when t1.a then -c else (f) end between t1.a and t1.c),b) not between t1.e and b then 19 when 17 not in (19,d,11) then b else a end from t1 where b in (select t1.e from t1 union select t1.b from t1)),t1.a) not in (t1.e,t1.a,t1.f) then (d) else 19 end)))) from t1) in (select +13 from t1 union select 17 from t1)} -} {100} -do_test randexpr-2.2342 { - db eval {SELECT +coalesce((select max(e) from t1 where -(case 13*(t1.b* -case when e<=19 then b when t1.e=c then (b) else f end*t1.e) when e then 13 else t1.f end)=t1.b and t1.a in (select count(*) | case case min(b)*(count(*)) when abs(cast(avg(13) AS integer))-max(t1.d) then min(19) else -cast(avg(b) AS integer) end when count(*) then (max(c)) else count(distinct 19) end+cast(avg((b)) AS integer) from t1 union select count(*) from t1)),t1.a) FROM t1 WHERE NOT ((select (min(13-(abs(c)/abs(case when coalesce((select case when coalesce((select -a from t1 where case a*f when t1.a then -c else (f) end between t1.a and t1.c),b) not between t1.e and b then 19 when 17 not in (19,d,11) then b else a end from t1 where b in (select t1.e from t1 union select t1.b from t1)),t1.a) not in (t1.e,t1.a,t1.f) then (d) else 19 end)))) from t1) in (select +13 from t1 union select 17 from t1))} -} {} -do_test randexpr-2.2343 { - db eval {SELECT +coalesce((select max(e) from t1 where -(case 13*(t1.b* -case when e<=19 then b when t1.e=c then (b) else f end*t1.e) when e then 13 else t1.f end)=t1.b and t1.a in (select count(*) & case case min(b)*(count(*)) when abs(cast(avg(13) AS integer))-max(t1.d) then min(19) else -cast(avg(b) AS integer) end when count(*) then (max(c)) else count(distinct 19) end+cast(avg((b)) AS integer) from t1 union select count(*) from t1)),t1.a) FROM t1 WHERE (select (min(13-(abs(c)/abs(case when coalesce((select case when coalesce((select -a from t1 where case a*f when t1.a then -c else (f) end between t1.a and t1.c),b) not between t1.e and b then 19 when 17 not in (19,d,11) then b else a end from t1 where b in (select t1.e from t1 union select t1.b from t1)),t1.a) not in (t1.e,t1.a,t1.f) then (d) else 19 end)))) from t1) in (select +13 from t1 union select 17 from t1)} -} {100} -do_test randexpr-2.2344 { - db eval {SELECT case when b in (select 19 from t1 union select c from t1) then -d else 19-13+coalesce((select t1.c from t1 where t1.d>=case when e in (select f*t1.b from t1 union select t1.d from t1) then t1.c when not exists(select 1 from t1 where t1.f not in (17,t1.c,11) and b between b and 17 or c in (t1.b,17,a) or t1.d>t1.d and t1.c<>11 and 13=e and t1.f not in ( -t1.c,19,f)) then coalesce((select max(case when t1.c in (t1.e,d,b) then t1.f else t1.a end) from t1 where e<=t1.f),11) else t1.b end*11),t1.e) end FROM t1 WHERE 13 not between +19 and a} -} {506} -do_test randexpr-2.2345 { - db eval {SELECT case when b in (select 19 from t1 union select c from t1) then -d else 19-13+coalesce((select t1.c from t1 where t1.d>=case when e in (select f*t1.b from t1 union select t1.d from t1) then t1.c when not exists(select 1 from t1 where t1.f not in (17,t1.c,11) and b between b and 17 or c in (t1.b,17,a) or t1.d>t1.d and t1.c<>11 and 13=e and t1.f not in ( -t1.c,19,f)) then coalesce((select max(case when t1.c in (t1.e,d,b) then t1.f else t1.a end) from t1 where e<=t1.f),11) else t1.b end*11),t1.e) end FROM t1 WHERE NOT (13 not between +19 and a)} -} {} -do_test randexpr-2.2346 { - db eval {SELECT (abs(13)/abs(case when t1.f not between a and f then 19-t1.d-t1.d*d | c+(select case count(*) | (~ -count(*)) when cast(avg( -19) AS integer) then min(d) else (cast(avg(e) AS integer)) end from t1) | t1.f-t1.b when f<>case when f<>b and 19 in (d,( -t1.a),t1.c) then 11 when e not between b and (t1.d) then t1.e else t1.d end-t1.e or t1.b not in (f,c,(a)) then -d else t1.f end-t1.f)) FROM t1 WHERE (select -count(*) from t1)=d+11} -} {} -do_test randexpr-2.2347 { - db eval {SELECT (abs(13)/abs(case when t1.f not between a and f then 19-t1.d-t1.d*d | c+(select case count(*) | (~ -count(*)) when cast(avg( -19) AS integer) then min(d) else (cast(avg(e) AS integer)) end from t1) | t1.f-t1.b when f<>case when f<>b and 19 in (d,( -t1.a),t1.c) then 11 when e not between b and (t1.d) then t1.e else t1.d end-t1.e or t1.b not in (f,c,(a)) then -d else t1.f end-t1.f)) FROM t1 WHERE NOT ((select -count(*) from t1)=d+11)} -} {0} -do_test randexpr-2.2348 { - db eval {SELECT (abs(13)/abs(case when t1.f not between a and f then 19-t1.d-t1.d*d & c+(select case count(*) & (~ -count(*)) when cast(avg( -19) AS integer) then min(d) else (cast(avg(e) AS integer)) end from t1) & t1.f-t1.b when f<>case when f<>b and 19 in (d,( -t1.a),t1.c) then 11 when e not between b and (t1.d) then t1.e else t1.d end-t1.e or t1.b not in (f,c,(a)) then -d else t1.f end-t1.f)) FROM t1 WHERE NOT ((select -count(*) from t1)=d+11)} -} {0} -do_test randexpr-2.2349 { - db eval {SELECT ((select count(distinct 11+19 | case (d) when t1.b then coalesce((select case coalesce((select max(+c*t1.f) from t1 where (t1.e=f and 13<=t1.d)), -17)+11-t1.a when (t1.c) then 19 else 13 end from t1 where t1.c in (select ~+ -count(distinct t1.f) from t1 union select count(*)+count(distinct b)*min(11) from t1)),e) else 19 end+d) | count(*) from t1)) FROM t1 WHERE case b when 19 then ~b-~e-d+d+t1.c else a end in (select max(t1.b)-~count(*)+abs(abs((case min((abs(~t1.c*t1.f)/abs(t1.e))) when case max(b) when abs(count(distinct t1.b)) then +cast(avg((13)) AS integer) else +case min(b) when count(*) then count(*) else count(distinct t1.f) end end then max(19) else ( -count(*)) end)))*count(distinct f)*cast(avg(t1.c) AS integer) from t1 union select count(distinct a) from t1)} -} {} -do_test randexpr-2.2350 { - db eval {SELECT ((select count(distinct 11+19 | case (d) when t1.b then coalesce((select case coalesce((select max(+c*t1.f) from t1 where (t1.e=f and 13<=t1.d)), -17)+11-t1.a when (t1.c) then 19 else 13 end from t1 where t1.c in (select ~+ -count(distinct t1.f) from t1 union select count(*)+count(distinct b)*min(11) from t1)),e) else 19 end+d) | count(*) from t1)) FROM t1 WHERE NOT (case b when 19 then ~b-~e-d+d+t1.c else a end in (select max(t1.b)-~count(*)+abs(abs((case min((abs(~t1.c*t1.f)/abs(t1.e))) when case max(b) when abs(count(distinct t1.b)) then +cast(avg((13)) AS integer) else +case min(b) when count(*) then count(*) else count(distinct t1.f) end end then max(19) else ( -count(*)) end)))*count(distinct f)*cast(avg(t1.c) AS integer) from t1 union select count(distinct a) from t1))} -} {1} -do_test randexpr-2.2351 { - db eval {SELECT ((select count(distinct 11+19 & case (d) when t1.b then coalesce((select case coalesce((select max(+c*t1.f) from t1 where (t1.e=f and 13<=t1.d)), -17)+11-t1.a when (t1.c) then 19 else 13 end from t1 where t1.c in (select ~+ -count(distinct t1.f) from t1 union select count(*)+count(distinct b)*min(11) from t1)),e) else 19 end+d) & count(*) from t1)) FROM t1 WHERE NOT (case b when 19 then ~b-~e-d+d+t1.c else a end in (select max(t1.b)-~count(*)+abs(abs((case min((abs(~t1.c*t1.f)/abs(t1.e))) when case max(b) when abs(count(distinct t1.b)) then +cast(avg((13)) AS integer) else +case min(b) when count(*) then count(*) else count(distinct t1.f) end end then max(19) else ( -count(*)) end)))*count(distinct f)*cast(avg(t1.c) AS integer) from t1 union select count(distinct a) from t1))} -} {1} -do_test randexpr-2.2352 { - db eval {SELECT 17+ -(abs(case case when a>t1.c then t1.e else a end*11-case when not exists(select 1 from t1 where coalesce((select -t1.e-11+coalesce((select t1.e from t1 where 13=t1.e),d) from t1 where t1.e between t1.d and a),13)-t1.e in (select t1.d from t1 union select d from t1)) then t1.b else t1.d end-t1.e-13+b when 19 then t1.b else c end)/abs(t1.d)) FROM t1 WHERE coalesce((select max(t1.d) from t1 where t1.a+t1.d<19),t1.a) in (select t1.b from t1 union select c from t1) or t1.c in (select -abs(max(case when -f<>t1.b and b<>11 then t1.f when t1.a=e then t1.d else -(f) end) | case cast(avg(f) AS integer) when count(distinct t1.f) then min(e) else -count(*) end+cast(avg((t1.f)) AS integer)) from t1 union select max(17) from t1) or t1.c between ((c)) and -t1.b and -c not between d and 11 or b>=19} -} {17} -do_test randexpr-2.2353 { - db eval {SELECT 17+ -(abs(case case when a>t1.c then t1.e else a end*11-case when not exists(select 1 from t1 where coalesce((select -t1.e-11+coalesce((select t1.e from t1 where 13=t1.e),d) from t1 where t1.e between t1.d and a),13)-t1.e in (select t1.d from t1 union select d from t1)) then t1.b else t1.d end-t1.e-13+b when 19 then t1.b else c end)/abs(t1.d)) FROM t1 WHERE NOT (coalesce((select max(t1.d) from t1 where t1.a+t1.d<19),t1.a) in (select t1.b from t1 union select c from t1) or t1.c in (select -abs(max(case when -f<>t1.b and b<>11 then t1.f when t1.a=e then t1.d else -(f) end) | case cast(avg(f) AS integer) when count(distinct t1.f) then min(e) else -count(*) end+cast(avg((t1.f)) AS integer)) from t1 union select max(17) from t1) or t1.c between ((c)) and -t1.b and -c not between d and 11 or b>=19)} -} {} -do_test randexpr-2.2354 { - db eval {SELECT e*~+(e)-(abs(~case when (t1.f)>13+~t1.d then case when d=t1.b+13 then 17 when 11 in (t1.d,e,e) then ~19*t1.a else coalesce((select t1.c from t1 where 19*(abs(t1.e)/abs(b)) between t1.c and t1.c),t1.d) end when a not between 13 and -17 then 19 else b end)/abs(t1.b)) FROM t1 WHERE (not d>case t1.b+t1.f when +(~(select (case abs(cast(avg(13) AS integer)) when cast(avg(+a) AS integer) then abs(abs(count(distinct case when t1.f*e<=11 then 13 when exists(select 1 from t1 where t1.e<17 or t1.a>=t1.a) then (11) else f end))) else min(t1.b)-min(11) end) from t1))+17*t1.b*f*17 then e else 11 end)} -} {} -do_test randexpr-2.2355 { - db eval {SELECT e*~+(e)-(abs(~case when (t1.f)>13+~t1.d then case when d=t1.b+13 then 17 when 11 in (t1.d,e,e) then ~19*t1.a else coalesce((select t1.c from t1 where 19*(abs(t1.e)/abs(b)) between t1.c and t1.c),t1.d) end when a not between 13 and -17 then 19 else b end)/abs(t1.b)) FROM t1 WHERE NOT ((not d>case t1.b+t1.f when +(~(select (case abs(cast(avg(13) AS integer)) when cast(avg(+a) AS integer) then abs(abs(count(distinct case when t1.f*e<=11 then 13 when exists(select 1 from t1 where t1.e<17 or t1.a>=t1.a) then (11) else f end))) else min(t1.b)-min(11) end) from t1))+17*t1.b*f*17 then e else 11 end))} -} {-250502} -do_test randexpr-2.2356 { - db eval {SELECT -case when t1.c<= -case coalesce((select max((coalesce((select case 11 when t1.b then t1.f else 11 end-d from t1 where c in (select count(*) | ~count(distinct f) from t1 union select count(*) from t1)),a)*t1.a)-t1.f) from t1 where not exists(select 1 from t1 where ((t1.f not in ( -c,t1.d,b)) or t1.a not in (b,11,t1.c)) or t1.d not in (17,a,t1.a))),19)-t1.b when d then t1.e else t1.e end-19 | e then b else -13 end*e-c FROM t1 WHERE b<>coalesce((select max((abs((abs(11)/abs(13)))/abs(case when t1.e between 11 and 19 then t1.d when 11>=b-19 then (select count(distinct ~a | 19*f+case when f not in (t1.e,t1.f, -t1.f) then 17 when c not in ( -t1.a,t1.c,b) then f else 11 end) from t1) else t1.e end))-t1.e*a) from t1 where e in (t1.c,17,17)),t1.a) or a=t1.e or d>t1.b} -} {6200} -do_test randexpr-2.2357 { - db eval {SELECT -case when t1.c<= -case coalesce((select max((coalesce((select case 11 when t1.b then t1.f else 11 end-d from t1 where c in (select count(*) | ~count(distinct f) from t1 union select count(*) from t1)),a)*t1.a)-t1.f) from t1 where not exists(select 1 from t1 where ((t1.f not in ( -c,t1.d,b)) or t1.a not in (b,11,t1.c)) or t1.d not in (17,a,t1.a))),19)-t1.b when d then t1.e else t1.e end-19 | e then b else -13 end*e-c FROM t1 WHERE NOT (b<>coalesce((select max((abs((abs(11)/abs(13)))/abs(case when t1.e between 11 and 19 then t1.d when 11>=b-19 then (select count(distinct ~a | 19*f+case when f not in (t1.e,t1.f, -t1.f) then 17 when c not in ( -t1.a,t1.c,b) then f else 11 end) from t1) else t1.e end))-t1.e*a) from t1 where e in (t1.c,17,17)),t1.a) or a=t1.e or d>t1.b)} -} {} -do_test randexpr-2.2358 { - db eval {SELECT -case when t1.c<= -case coalesce((select max((coalesce((select case 11 when t1.b then t1.f else 11 end-d from t1 where c in (select count(*) & ~count(distinct f) from t1 union select count(*) from t1)),a)*t1.a)-t1.f) from t1 where not exists(select 1 from t1 where ((t1.f not in ( -c,t1.d,b)) or t1.a not in (b,11,t1.c)) or t1.d not in (17,a,t1.a))),19)-t1.b when d then t1.e else t1.e end-19 & e then b else -13 end*e-c FROM t1 WHERE b<>coalesce((select max((abs((abs(11)/abs(13)))/abs(case when t1.e between 11 and 19 then t1.d when 11>=b-19 then (select count(distinct ~a | 19*f+case when f not in (t1.e,t1.f, -t1.f) then 17 when c not in ( -t1.a,t1.c,b) then f else 11 end) from t1) else t1.e end))-t1.e*a) from t1 where e in (t1.c,17,17)),t1.a) or a=t1.e or d>t1.b} -} {-100300} -do_test randexpr-2.2359 { - db eval {SELECT (abs(case when t1.d not in (t1.f,t1.d,(select abs(min(((select +count(*)*case max(t1.e-coalesce((select max(case t1.b when 13 then a else e end) from t1 where t1.b>b),19)+d)- -+count(*) when +cast(avg(d) AS integer) then max(c) else (cast(avg(c) AS integer)) end | count(*) from t1)+t1.f)))-max(t1.c) from t1)) then t1.b*t1.f else f end)/abs(b+19)) FROM t1 WHERE a not in ((11),(t1.d),a) or case when f(abs(d)/abs(t1.d)))) then a when f not between t1.f | t1.b and t1.d then a else 13 end from t1 where 19<=c),f) then t1.a else f end between 13 and 11} -} {} -do_test randexpr-2.2360 { - db eval {SELECT (abs(case when t1.d not in (t1.f,t1.d,(select abs(min(((select +count(*)*case max(t1.e-coalesce((select max(case t1.b when 13 then a else e end) from t1 where t1.b>b),19)+d)- -+count(*) when +cast(avg(d) AS integer) then max(c) else (cast(avg(c) AS integer)) end | count(*) from t1)+t1.f)))-max(t1.c) from t1)) then t1.b*t1.f else f end)/abs(b+19)) FROM t1 WHERE NOT (a not in ((11),(t1.d),a) or case when f(abs(d)/abs(t1.d)))) then a when f not between t1.f | t1.b and t1.d then a else 13 end from t1 where 19<=c),f) then t1.a else f end between 13 and 11)} -} {2} -do_test randexpr-2.2361 { - db eval {SELECT (abs(case when t1.d not in (t1.f,t1.d,(select abs(min(((select +count(*)*case max(t1.e-coalesce((select max(case t1.b when 13 then a else e end) from t1 where t1.b>b),19)+d)- -+count(*) when +cast(avg(d) AS integer) then max(c) else (cast(avg(c) AS integer)) end & count(*) from t1)+t1.f)))-max(t1.c) from t1)) then t1.b*t1.f else f end)/abs(b+19)) FROM t1 WHERE NOT (a not in ((11),(t1.d),a) or case when f(abs(d)/abs(t1.d)))) then a when f not between t1.f | t1.b and t1.d then a else 13 end from t1 where 19<=c),f) then t1.a else f end between 13 and 11)} -} {2} -do_test randexpr-2.2362 { - db eval {SELECT t1.a+d | +case when +t1.a-t1.f++t1.c+(select case ~count(*) when (+cast(avg(f*t1.f) AS integer) | min(t1.b)) then -(cast(avg(t1.f) AS integer)) else min(e) end from t1)-b* - -13-f+c in (select b from t1 union select t1.d from t1) or et1.a),t1.f) between t1.a and 19 then ( -b) else t1.a end) from t1 where t1.c in (a,(f),e)),t1.c))/abs(a)))) from t1)) from t1 where case when exists(select 1 from t1 where e<11) and 17 in (select 11 from t1 union select a from t1) then d else (d) end in (select cast(avg(f) AS integer) from t1 union select count(*) from t1)),t1.d) FROM t1 WHERE exists(select 1 from t1 where b not between case 11 when d then (select + -(abs(abs(case -min(d)+ - -count(*)-max(c) when count(*) then max(t1.b) else count(*) end))) from t1)+t1.f-f*t1.b*((select min(a) from t1))-b+f else t1.e end | t1.c+13 and 19) and bt1.e)} -} {400} -do_test randexpr-2.2366 { - db eval {SELECT coalesce((select max((select (max((abs(coalesce((select max(+case when ~t1.d=t1.a then a when coalesce((select case when t1.c in (select 19 from t1 union select (d) from t1) then e else f end from t1 where t1.a<>t1.a),t1.f) between t1.a and 19 then ( -b) else t1.a end) from t1 where t1.c in (a,(f),e)),t1.c))/abs(a)))) from t1)) from t1 where case when exists(select 1 from t1 where e<11) and 17 in (select 11 from t1 union select a from t1) then d else (d) end in (select cast(avg(f) AS integer) from t1 union select count(*) from t1)),t1.d) FROM t1 WHERE NOT (exists(select 1 from t1 where b not between case 11 when d then (select + -(abs(abs(case -min(d)+ - -count(*)-max(c) when count(*) then max(t1.b) else count(*) end))) from t1)+t1.f-f*t1.b*((select min(a) from t1))-b+f else t1.e end | t1.c+13 and 19) and bt1.e))} -} {} -do_test randexpr-2.2367 { - db eval {SELECT case when t1.d+b+c | case +a-t1.d-f*(select cast(avg(17) AS integer)+count(distinct e)-count(distinct t1.a) | - -cast(avg(t1.b) AS integer) from t1)+~t1.e-a when d then t1.f else d end+t1.e*b<>11 then f when t1.a=b or t1.b>(t1.d) then 19 else t1.f end+19 FROM t1 WHERE coalesce((select case t1.e-case coalesce((select (select min(t1.d) from t1) from t1 where coalesce((select max(coalesce((select max(a) from t1 where t1.d in (select cast(avg(t1.b) AS integer) from t1 union select count(distinct a) from t1)), -19)*t1.e) from t1 where d>11),t1.f)>17),t1.f) when (17) then e else d end when b then (19) else 19 end from t1 where not t1.f in (select ( -max(13)) from t1 union select max(c) from t1)),11)-d not in ( -19,13,d)} -} {619} -do_test randexpr-2.2368 { - db eval {SELECT case when t1.d+b+c | case +a-t1.d-f*(select cast(avg(17) AS integer)+count(distinct e)-count(distinct t1.a) | - -cast(avg(t1.b) AS integer) from t1)+~t1.e-a when d then t1.f else d end+t1.e*b<>11 then f when t1.a=b or t1.b>(t1.d) then 19 else t1.f end+19 FROM t1 WHERE NOT (coalesce((select case t1.e-case coalesce((select (select min(t1.d) from t1) from t1 where coalesce((select max(coalesce((select max(a) from t1 where t1.d in (select cast(avg(t1.b) AS integer) from t1 union select count(distinct a) from t1)), -19)*t1.e) from t1 where d>11),t1.f)>17),t1.f) when (17) then e else d end when b then (19) else 19 end from t1 where not t1.f in (select ( -max(13)) from t1 union select max(c) from t1)),11)-d not in ( -19,13,d))} -} {} -do_test randexpr-2.2369 { - db eval {SELECT case when t1.d+b+c & case +a-t1.d-f*(select cast(avg(17) AS integer)+count(distinct e)-count(distinct t1.a) & - -cast(avg(t1.b) AS integer) from t1)+~t1.e-a when d then t1.f else d end+t1.e*b<>11 then f when t1.a=b or t1.b>(t1.d) then 19 else t1.f end+19 FROM t1 WHERE coalesce((select case t1.e-case coalesce((select (select min(t1.d) from t1) from t1 where coalesce((select max(coalesce((select max(a) from t1 where t1.d in (select cast(avg(t1.b) AS integer) from t1 union select count(distinct a) from t1)), -19)*t1.e) from t1 where d>11),t1.f)>17),t1.f) when (17) then e else d end when b then (19) else 19 end from t1 where not t1.f in (select ( -max(13)) from t1 union select max(c) from t1)),11)-d not in ( -19,13,d)} -} {619} -do_test randexpr-2.2370 { - db eval {SELECT case when (t1.a not in (coalesce((select 17 from t1 where case when t1.b*(abs( -t1.b*f*coalesce((select 17 from t1 where not t1.dt1.d then 13 when c>b then c else 11 end when e then a else t1.e end>c) or 19 in (select ++min(f) from t1 union select -count(distinct t1.a) from t1) then (case when t1.f in (select t1.f from t1 union select -t1.a from t1) then c when b not between t1.a and b then -t1.c else t1.a end) else t1.c end not in (f,a,17) then 11 else 11 end FROM t1 WHERE not c not between (select abs(max(~(19*e-t1.a*c*t1.d))*~abs((abs(min(a)-min(c) | cast(avg(19) AS integer))) | count(distinct 19)) | (cast(avg(d) AS integer))) from t1) and (abs(case coalesce((select max(19) from t1 where b not between a and f or 19 in (t1.c,t1.c,b)),t1.e) when c then f else 11 end)/abs(c))} -} {} -do_test randexpr-2.2373 { - db eval {SELECT case when case when (case (t1.a)*case when ct1.d then 13 when c>b then c else 11 end when e then a else t1.e end>c) or 19 in (select ++min(f) from t1 union select -count(distinct t1.a) from t1) then (case when t1.f in (select t1.f from t1 union select -t1.a from t1) then c when b not between t1.a and b then -t1.c else t1.a end) else t1.c end not in (f,a,17) then 11 else 11 end FROM t1 WHERE NOT (not c not between (select abs(max(~(19*e-t1.a*c*t1.d))*~abs((abs(min(a)-min(c) | cast(avg(19) AS integer))) | count(distinct 19)) | (cast(avg(d) AS integer))) from t1) and (abs(case coalesce((select max(19) from t1 where b not between a and f or 19 in (t1.c,t1.c,b)),t1.e) when c then f else 11 end)/abs(c)))} -} {11} -do_test randexpr-2.2374 { - db eval {SELECT (select count(*)-+ -(max(~coalesce((select ~b from t1 where not t1.c | 19 not between c+t1.c and d),a)*(abs(t1.a)/abs(d*(case t1.a*case when 17>e then 11 else 13 end when 19 then e else t1.d end)))+17))-cast(avg(c) AS integer) | count(distinct f) from t1)+(select abs(min(11)) from t1) FROM t1 WHERE coalesce((select max(11) from t1 where case when b<=13-~case when ~~(select count(*)+count(*)* -count(*) from t1)>17*17 then t1.f+case when not case when 19 in (t1.e,a,19) then 17 when f<=19 then 17 else -d end=19 then f when a>=19 then d else f end else t1.c end | f then 19 else b end*t1.d between e and b),f)e then 11 else 13 end when 19 then e else t1.d end)))+17))-cast(avg(c) AS integer) | count(distinct f) from t1)+(select abs(min(11)) from t1) FROM t1 WHERE NOT (coalesce((select max(11) from t1 where case when b<=13-~case when ~~(select count(*)+count(*)* -count(*) from t1)>17*17 then t1.f+case when not case when 19 in (t1.e,a,19) then 17 when f<=19 then 17 else -d end=19 then f when a>=19 then d else f end else t1.c end | f then 19 else b end*t1.d between e and b),f)e then 11 else 13 end when 19 then e else t1.d end)))+17))-cast(avg(c) AS integer) & count(distinct f) from t1)+(select abs(min(11)) from t1) FROM t1 WHERE NOT (coalesce((select max(11) from t1 where case when b<=13-~case when ~~(select count(*)+count(*)* -count(*) from t1)>17*17 then t1.f+case when not case when 19 in (t1.e,a,19) then 17 when f<=19 then 17 else -d end=19 then f when a>=19 then d else f end else t1.c end | f then 19 else b end*t1.d between e and b),f)19 then 11 else 17 end-t1.d FROM t1 WHERE (select min(a) from t1)19 then 11 else 17 end-t1.d FROM t1 WHERE NOT ((select min(a) from t1)19 then 11 else 17 end-t1.d FROM t1 WHERE (select min(a) from t1)c then t1.a else (d) end),d)<= -t1.c) then t1.e*t1.c else 13 end end FROM t1 WHERE exists(select 1 from t1 where ((b not between f and t1.a)))} -} {15004100} -do_test randexpr-2.2381 { - db eval {SELECT t1.d*11-case 11 when a then 11 else - -t1.b-(t1.b)+c+t1.a* -case when not exists(select 1 from t1 where coalesce((select t1.c from t1 where t1.c=case when 13 in (coalesce((select max(coalesce((select max(t1.c) from t1 where c between t1.d and t1.f and t1.a<=b),e)) from t1 where (11 not in (b,19,c))),b),e, -b) then 17 when t1.a in (b,t1.d,b) and t1.f>c then t1.a else (d) end),d)<= -t1.c) then t1.e*t1.c else 13 end end FROM t1 WHERE NOT (exists(select 1 from t1 where ((b not between f and t1.a))))} -} {} -do_test randexpr-2.2382 { - db eval {SELECT t1.c*case when not b>(+coalesce((select t1.e from t1 where t1.b>(abs(case when t1.d<=c+ -17*t1.f*19*17 then 11+a-13-t1.d else case (select abs(count(distinct 19))+ -count(distinct 17) from t1) when 17*t1.d then a else t1.a end end)/abs(17))),(11)))+17 then (t1.c)*f else 17 end FROM t1 WHERE (t1.b)-b<=t1.a*13} -} {54000000} -do_test randexpr-2.2383 { - db eval {SELECT t1.c*case when not b>(+coalesce((select t1.e from t1 where t1.b>(abs(case when t1.d<=c+ -17*t1.f*19*17 then 11+a-13-t1.d else case (select abs(count(distinct 19))+ -count(distinct 17) from t1) when 17*t1.d then a else t1.a end end)/abs(17))),(11)))+17 then (t1.c)*f else 17 end FROM t1 WHERE NOT ((t1.b)-b<=t1.a*13)} -} {} -do_test randexpr-2.2384 { - db eval {SELECT t1.b+coalesce((select max(~e- -t1.d+case +b+f when a-case when t1.a-d+t1.c between t1.e and a*e then (abs(e)/abs(t1.a)) else f | -f*t1.b-t1.c end*t1.e+f then 19 else t1.b end*19) from t1 where 19 in (select e from t1 union select 17 from t1)),19) FROM t1 WHERE d in (11,t1.c+c*t1.d+case when t1.c-case when ~(19+13)*c=11 and d<>17 or t1.e>=c then case t1.a when c then f else 11 end+t1.c when t1.f in (select max(13) from t1 union select cast(avg(c) AS integer) from t1) or t1.ct1.b then t1.e else 19 end,a)} -} {} -do_test randexpr-2.2385 { - db eval {SELECT t1.b+coalesce((select max(~e- -t1.d+case +b+f when a-case when t1.a-d+t1.c between t1.e and a*e then (abs(e)/abs(t1.a)) else f | -f*t1.b-t1.c end*t1.e+f then 19 else t1.b end*19) from t1 where 19 in (select e from t1 union select 17 from t1)),19) FROM t1 WHERE NOT (d in (11,t1.c+c*t1.d+case when t1.c-case when ~(19+13)*c=11 and d<>17 or t1.e>=c then case t1.a when c then f else 11 end+t1.c when t1.f in (select max(13) from t1 union select cast(avg(c) AS integer) from t1) or t1.ct1.b then t1.e else 19 end,a))} -} {219} -do_test randexpr-2.2386 { - db eval {SELECT t1.b+coalesce((select max(~e- -t1.d+case +b+f when a-case when t1.a-d+t1.c between t1.e and a*e then (abs(e)/abs(t1.a)) else f & -f*t1.b-t1.c end*t1.e+f then 19 else t1.b end*19) from t1 where 19 in (select e from t1 union select 17 from t1)),19) FROM t1 WHERE NOT (d in (11,t1.c+c*t1.d+case when t1.c-case when ~(19+13)*c=11 and d<>17 or t1.e>=c then case t1.a when c then f else 11 end+t1.c when t1.f in (select max(13) from t1 union select cast(avg(c) AS integer) from t1) or t1.ct1.b then t1.e else 19 end,a))} -} {219} -do_test randexpr-2.2387 { - db eval {SELECT (abs((select (case (abs(max( -t1.a))* -case count(*) when case min(c) when max(d) then count(*) else max(17) end-cast(avg(17) AS integer) then max(11) else cast(avg(t1.d) AS integer) end | max(13)+max(f)) when cast(avg(f) AS integer) then cast(avg(19) AS integer) else (max(11)) end) from t1) | coalesce((select (select max( -t1.d) from t1) from t1 where t1.b-~e in (select d from t1 union select e from t1) and t1.e=t1.d), -t1.e)-17)/abs(t1.e)) | -t1.e FROM t1 WHERE exists(select 1 from t1 where coalesce((select +19 from t1 where (coalesce((select max(e) from t1 where ((coalesce((select max(19) from t1 where coalesce((select t1.d*19+(t1.c) from t1 where e in (select -11 from t1 union select t1.f from t1) and (t1.d) in (select ~max(t1.e) from t1 union select (( -count(*))) from t1) or 19>=(a)),f) in ((e),e,t1.a)),t1.a)<=t1.c))),t1.f+t1.c)>13)),11) in (11,17,t1.d) and e>=t1.b)} -} {} -do_test randexpr-2.2388 { - db eval {SELECT (abs((select (case (abs(max( -t1.a))* -case count(*) when case min(c) when max(d) then count(*) else max(17) end-cast(avg(17) AS integer) then max(11) else cast(avg(t1.d) AS integer) end | max(13)+max(f)) when cast(avg(f) AS integer) then cast(avg(19) AS integer) else (max(11)) end) from t1) | coalesce((select (select max( -t1.d) from t1) from t1 where t1.b-~e in (select d from t1 union select e from t1) and t1.e=t1.d), -t1.e)-17)/abs(t1.e)) | -t1.e FROM t1 WHERE NOT (exists(select 1 from t1 where coalesce((select +19 from t1 where (coalesce((select max(e) from t1 where ((coalesce((select max(19) from t1 where coalesce((select t1.d*19+(t1.c) from t1 where e in (select -11 from t1 union select t1.f from t1) and (t1.d) in (select ~max(t1.e) from t1 union select (( -count(*))) from t1) or 19>=(a)),f) in ((e),e,t1.a)),t1.a)<=t1.c))),t1.f+t1.c)>13)),11) in (11,17,t1.d) and e>=t1.b))} -} {-499} -do_test randexpr-2.2389 { - db eval {SELECT (abs((select (case (abs(max( -t1.a))* -case count(*) when case min(c) when max(d) then count(*) else max(17) end-cast(avg(17) AS integer) then max(11) else cast(avg(t1.d) AS integer) end & max(13)+max(f)) when cast(avg(f) AS integer) then cast(avg(19) AS integer) else (max(11)) end) from t1) & coalesce((select (select max( -t1.d) from t1) from t1 where t1.b-~e in (select d from t1 union select e from t1) and t1.e=t1.d), -t1.e)-17)/abs(t1.e)) & -t1.e FROM t1 WHERE NOT (exists(select 1 from t1 where coalesce((select +19 from t1 where (coalesce((select max(e) from t1 where ((coalesce((select max(19) from t1 where coalesce((select t1.d*19+(t1.c) from t1 where e in (select -11 from t1 union select t1.f from t1) and (t1.d) in (select ~max(t1.e) from t1 union select (( -count(*))) from t1) or 19>=(a)),f) in ((e),e,t1.a)),t1.a)<=t1.c))),t1.f+t1.c)>13)),11) in (11,17,t1.d) and e>=t1.b))} -} {0} -do_test randexpr-2.2390 { - db eval {SELECT f-coalesce((select 19+t1.e+t1.f from t1 where +11>coalesce((select +t1.f from t1 where t1.a between ~ -(select case cast(avg((abs(t1.d)/abs(t1.b))) AS integer) when -~max(19) then - -case count(distinct c) when count(*) then min((a)) else -min(t1.d) end else max( -t1.b) end from t1) and (select count(distinct f) from t1)),(coalesce((select max(t1.e) from t1 where not 11>=d),t1.c)))),19)-t1.f+19+f*t1.d FROM t1 WHERE f in (select (min((abs(d-t1.c+coalesce((select t1.f from t1 where fcoalesce((select +t1.f from t1 where t1.a between ~ -(select case cast(avg((abs(t1.d)/abs(t1.b))) AS integer) when -~max(19) then - -case count(distinct c) when count(*) then min((a)) else -min(t1.d) end else max( -t1.b) end from t1) and (select count(distinct f) from t1)),(coalesce((select max(t1.e) from t1 where not 11>=d),t1.c)))),19)-t1.f+19+f*t1.d FROM t1 WHERE NOT (f in (select (min((abs(d-t1.c+coalesce((select t1.f from t1 where f(c)), -a) from t1 where (e)<=t1.a),d) then d when e=a then t1.f else f end FROM t1 WHERE f in (13*13-(abs(d)/abs(e)),19,case t1.b+coalesce((select max((abs((abs(17)/abs(a)))/abs(11+t1.c))) from t1 where -t1.c>=t1.f and e in (select count(*) | min(t1.c) from t1 union select cast(avg(e) AS integer) from t1) or 11 not in (e,b,a) or t1.c< -a and t1.e not in (t1.e,b,t1.d)),t1.b) when f then 19 else b end-11) or d>t1.b} -} {-400} -do_test randexpr-2.2393 { - db eval {SELECT t1.b-case when b not between 17 and t1.d*11*f*t1.a or t1.c+case when -t1.e between t1.d and coalesce((select coalesce((select max((select ~count(*) from t1)) from t1 where -17*13-19-((d))<>(c)), -a) from t1 where (e)<=t1.a),d) then d when e=a then t1.f else f end FROM t1 WHERE NOT (f in (13*13-(abs(d)/abs(e)),19,case t1.b+coalesce((select max((abs((abs(17)/abs(a)))/abs(11+t1.c))) from t1 where -t1.c>=t1.f and e in (select count(*) | min(t1.c) from t1 union select cast(avg(e) AS integer) from t1) or 11 not in (e,b,a) or t1.c< -a and t1.e not in (t1.e,b,t1.d)),t1.b) when f then 19 else b end-11) or d>t1.b)} -} {} -do_test randexpr-2.2394 { - db eval {SELECT case t1.d when (abs(17)/abs(coalesce((select max(e) from t1 where a not in (t1.e,case when 11+t1.d not between t1.e and -t1.c | t1.a*(abs(b)/abs(c)) then -d when a in (select +11 from t1 union select c from t1) then -t1.c else 13 end | t1.c,t1.b)),d)-f)) | t1.c then case when 13t1.d then 13 else f end else b end FROM t1 WHERE 17>d*~t1.e+case when not t1.f<>(select count(distinct 19)+min(e) from t1) then case when (13-a<= -t1.b) and t1.f<=t1.f then 19*d else f end-t1.f*d+t1.d when b not in (t1.b,19,19) or t1.d not between t1.b and a then t1.f else b end} -} {200} -do_test randexpr-2.2395 { - db eval {SELECT case t1.d when (abs(17)/abs(coalesce((select max(e) from t1 where a not in (t1.e,case when 11+t1.d not between t1.e and -t1.c | t1.a*(abs(b)/abs(c)) then -d when a in (select +11 from t1 union select c from t1) then -t1.c else 13 end | t1.c,t1.b)),d)-f)) | t1.c then case when 13t1.d then 13 else f end else b end FROM t1 WHERE NOT (17>d*~t1.e+case when not t1.f<>(select count(distinct 19)+min(e) from t1) then case when (13-a<= -t1.b) and t1.f<=t1.f then 19*d else f end-t1.f*d+t1.d when b not in (t1.b,19,19) or t1.d not between t1.b and a then t1.f else b end)} -} {} -do_test randexpr-2.2396 { - db eval {SELECT case t1.d when (abs(17)/abs(coalesce((select max(e) from t1 where a not in (t1.e,case when 11+t1.d not between t1.e and -t1.c & t1.a*(abs(b)/abs(c)) then -d when a in (select +11 from t1 union select c from t1) then -t1.c else 13 end & t1.c,t1.b)),d)-f)) & t1.c then case when 13t1.d then 13 else f end else b end FROM t1 WHERE 17>d*~t1.e+case when not t1.f<>(select count(distinct 19)+min(e) from t1) then case when (13-a<= -t1.b) and t1.f<=t1.f then 19*d else f end-t1.f*d+t1.d when b not in (t1.b,19,19) or t1.d not between t1.b and a then t1.f else b end} -} {200} -do_test randexpr-2.2397 { - db eval {SELECT coalesce((select max(d) from t1 where coalesce((select t1.c from t1 where 17>b),d*coalesce((select max(11*19) from t1 where coalesce((select c from t1 where 19<(abs((case a when b then ~case t1.a+(select min(t1.f)+min(b) from t1) when (d) then e else t1.b end else t1.c end+f+t1.f))/abs(t1.b))),c)<=19),13))*d | eb),d*coalesce((select max(11*19) from t1 where coalesce((select c from t1 where 19<(abs((case a when b then ~case t1.a+(select min(t1.f)+min(b) from t1) when (d) then e else t1.b end else t1.c end+f+t1.f))/abs(t1.b))),c)<=19),13))*d | eb),d*coalesce((select max(11*19) from t1 where coalesce((select c from t1 where 19<(abs((case a when b then ~case t1.a+(select min(t1.f)+min(b) from t1) when (d) then e else t1.b end else t1.c end+f+t1.f))/abs(t1.b))),c)<=19),13))*d & et1.e and 11 in (t1.e,t1.e,d)),f)+13 then t1.b else c end))- -f)) from t1)) AS integer))-count(distinct 11+11+13)+count(distinct t1.a) from t1) FROM t1 WHERE t1.d=b then t1.c when -f*e<=t1.b then e else 17 end not between 17 and t1.f then t1.c else t1.b end-19+f+19*(t1.c)} -} {-558600} -do_test randexpr-2.2401 { - db eval {SELECT t1.b+ -t1.d*(select max(t1.a) | count(*) | abs(cast(avg(f+a-(select ~(min((abs(a)/abs(13+case when f=coalesce((select t1.b from t1 where d<>t1.e and 11 in (t1.e,t1.e,d)),f)+13 then t1.b else c end))- -f)) from t1)) AS integer))-count(distinct 11+11+13)+count(distinct t1.a) from t1) FROM t1 WHERE NOT (t1.d=b then t1.c when -f*e<=t1.b then e else 17 end not between 17 and t1.f then t1.c else t1.b end-19+f+19*(t1.c))} -} {} -do_test randexpr-2.2402 { - db eval {SELECT t1.b+ -t1.d*(select max(t1.a) & count(*) & abs(cast(avg(f+a-(select ~(min((abs(a)/abs(13+case when f=coalesce((select t1.b from t1 where d<>t1.e and 11 in (t1.e,t1.e,d)),f)+13 then t1.b else c end))- -f)) from t1)) AS integer))-count(distinct 11+11+13)+count(distinct t1.a) from t1) FROM t1 WHERE t1.d=b then t1.c when -f*e<=t1.b then e else 17 end not between 17 and t1.f then t1.c else t1.b end-19+f+19*(t1.c)} -} {200} -do_test randexpr-2.2403 { - db eval {SELECT case when case when t1.e<~17 or (case case case t1.d*17*13 when t1.a then e+c else c end when d*f+coalesce((select 17 from t1 where 13 not between 13 and -13),(17)) then t1.b else b end when t1.a then a else t1.c end*d<>d) then ~t1.c else a end<>t1.f then -t1.d else t1.a end+11-t1.c-e FROM t1 WHERE (case when (~f- -e in (17,case when d in (select t1.f from t1 union select a+(abs(coalesce((select (t1.c) from t1 where a in (select min(13) | (max(t1.e)) from t1 union select count(distinct t1.d) from t1)),b)+13)/abs(e))*19*f from t1) then b when not a between 13 and 13 then t1.f else 17 end,t1.c)) then (select max(t1.e)-count(*) | count(*) from t1) else c end)>(t1.e)} -} {} -do_test randexpr-2.2404 { - db eval {SELECT case when case when t1.e<~17 or (case case case t1.d*17*13 when t1.a then e+c else c end when d*f+coalesce((select 17 from t1 where 13 not between 13 and -13),(17)) then t1.b else b end when t1.a then a else t1.c end*d<>d) then ~t1.c else a end<>t1.f then -t1.d else t1.a end+11-t1.c-e FROM t1 WHERE NOT ((case when (~f- -e in (17,case when d in (select t1.f from t1 union select a+(abs(coalesce((select (t1.c) from t1 where a in (select min(13) | (max(t1.e)) from t1 union select count(distinct t1.d) from t1)),b)+13)/abs(e))*19*f from t1) then b when not a between 13 and 13 then t1.f else 17 end,t1.c)) then (select max(t1.e)-count(*) | count(*) from t1) else c end)>(t1.e))} -} {-1189} -do_test randexpr-2.2405 { - db eval {SELECT coalesce((select max(t1.a-(abs(e*coalesce((select max(d) from t1 where (case when case e when case when (t1.e)=d then t1.a+11 else 17 end then (c) else b end<=a then b when 19 in (t1.b,b,t1.e) then f else -19 end+17 between 19 and c or b in (select t1.c from t1 union select t1.a from t1))),t1.a))/abs( -t1.d))) from t1 where 13=17),t1.b)+(t1.b) FROM t1 WHERE coalesce((select -case when (d)>=(select ~case +(+~~cast(avg(a) AS integer)*abs(( -count(*))) | count(distinct 11)) when (count(*)) then count(distinct 19) else min(t1.a) end+min(t1.a) from t1)*13-t1.f then 13 else (e) | t1.c*(select (min(17)) from t1) end*case when (c) in (select 11 from t1 union select t1.f from t1) then 17 else 19 end from t1 where t1.cc} -} {400} -do_test randexpr-2.2406 { - db eval {SELECT coalesce((select max(t1.a-(abs(e*coalesce((select max(d) from t1 where (case when case e when case when (t1.e)=d then t1.a+11 else 17 end then (c) else b end<=a then b when 19 in (t1.b,b,t1.e) then f else -19 end+17 between 19 and c or b in (select t1.c from t1 union select t1.a from t1))),t1.a))/abs( -t1.d))) from t1 where 13=17),t1.b)+(t1.b) FROM t1 WHERE NOT (coalesce((select -case when (d)>=(select ~case +(+~~cast(avg(a) AS integer)*abs(( -count(*))) | count(distinct 11)) when (count(*)) then count(distinct 19) else min(t1.a) end+min(t1.a) from t1)*13-t1.f then 13 else (e) | t1.c*(select (min(17)) from t1) end*case when (c) in (select 11 from t1 union select t1.f from t1) then 17 else 19 end from t1 where t1.cc)} -} {} -do_test randexpr-2.2407 { - db eval {SELECT t1.b-t1.d-case when exists(select 1 from t1 where -coalesce((select t1.a from t1 where a in (c,coalesce((select max((abs(t1.d)/abs(e))) from t1 where case t1.b when t1.e then t1.d else t1.d end-17 between b and t1.f),17)-t1.f-t1.e,t1.a) or t1.b in (t1.a,19,t1.f)),19)>=d) then 19-b when t1.c between (f) and t1.f then t1.d else t1.f end-11 FROM t1 WHERE coalesce((select 13 from t1 where ( -t1.a13 or a in (select cast(avg(d) AS integer) | count(*)* -max(t1.f) from t1 union select count(*) from t1) then 17 when not exists(select 1 from t1 where b>=c) then e else 17 end | -t1.a))*b)*t1.d>=b} -} {-811} -do_test randexpr-2.2408 { - db eval {SELECT t1.b-t1.d-case when exists(select 1 from t1 where -coalesce((select t1.a from t1 where a in (c,coalesce((select max((abs(t1.d)/abs(e))) from t1 where case t1.b when t1.e then t1.d else t1.d end-17 between b and t1.f),17)-t1.f-t1.e,t1.a) or t1.b in (t1.a,19,t1.f)),19)>=d) then 19-b when t1.c between (f) and t1.f then t1.d else t1.f end-11 FROM t1 WHERE NOT (coalesce((select 13 from t1 where ( -t1.a13 or a in (select cast(avg(d) AS integer) | count(*)* -max(t1.f) from t1 union select count(*) from t1) then 17 when not exists(select 1 from t1 where b>=c) then e else 17 end | -t1.a))*b)*t1.d>=b)} -} {} -do_test randexpr-2.2409 { - db eval {SELECT 17 | t1.c*t1.a | case when ~ -~(abs(t1.b)/abs(coalesce((select max(coalesce((select max(+t1.d) from t1 where (t1.b not between 17 and t1.b) and d not between c and 19),d)*(t1.d)-d) from t1 where t1.a in (t1.c,(t1.c),t1.f)),19)))-b+19+ -17>=t1.a then 19 when 19 in (select t1.f from t1 union select t1.b from t1) then t1.c else f end-19*t1.c FROM t1 WHERE (17-t1.f in (d | b-17,t1.f,coalesce((select e+(abs(11)/abs(case t1.c when case (abs(a)/abs(11)) when e then t1.c else 17+c end then b else 11+t1.e end)) from t1 where (13 not between + -b and 13)),t1.c)) and 17 between t1.d | t1.f and t1.e)} -} {} -do_test randexpr-2.2410 { - db eval {SELECT 17 | t1.c*t1.a | case when ~ -~(abs(t1.b)/abs(coalesce((select max(coalesce((select max(+t1.d) from t1 where (t1.b not between 17 and t1.b) and d not between c and 19),d)*(t1.d)-d) from t1 where t1.a in (t1.c,(t1.c),t1.f)),19)))-b+19+ -17>=t1.a then 19 when 19 in (select t1.f from t1 union select t1.b from t1) then t1.c else f end-19*t1.c FROM t1 WHERE NOT ((17-t1.f in (d | b-17,t1.f,coalesce((select e+(abs(11)/abs(case t1.c when case (abs(a)/abs(11)) when e then t1.c else 17+c end then b else 11+t1.e end)) from t1 where (13 not between + -b and 13)),t1.c)) and 17 between t1.d | t1.f and t1.e))} -} {-715} -do_test randexpr-2.2411 { - db eval {SELECT 17 & t1.c*t1.a & case when ~ -~(abs(t1.b)/abs(coalesce((select max(coalesce((select max(+t1.d) from t1 where (t1.b not between 17 and t1.b) and d not between c and 19),d)*(t1.d)-d) from t1 where t1.a in (t1.c,(t1.c),t1.f)),19)))-b+19+ -17>=t1.a then 19 when 19 in (select t1.f from t1 union select t1.b from t1) then t1.c else f end-19*t1.c FROM t1 WHERE NOT ((17-t1.f in (d | b-17,t1.f,coalesce((select e+(abs(11)/abs(case t1.c when case (abs(a)/abs(11)) when e then t1.c else 17+c end then b else 11+t1.e end)) from t1 where (13 not between + -b and 13)),t1.c)) and 17 between t1.d | t1.f and t1.e))} -} {16} -do_test randexpr-2.2412 { - db eval {SELECT coalesce((select t1.a*a+t1.f | t1.d from t1 where t1.d<+t1.c*d-c*19+t1.e-(abs( -t1.e)/abs(19))), -t1.c+coalesce((select t1.b from t1 where not not (select max(t1.c) from t1)-17+e in (e,t1.c,b) and not (d in (select ( -((max(b)))) from t1 union select min(d) from t1))),t1.b) | t1.a) FROM t1 WHERE not t1.f in (select ((select abs(count(*)) from t1)-11) from t1 union select t1.a-17 from t1) or not exists(select 1 from t1 where case (abs(e)/abs(+c)) when coalesce((select max((select +(count(distinct t1.a)) from t1)) from t1 where not (e<=c*t1.a)),~(case when t1.c<=17 then e when t1.c<=t1.c then e else 17 end)) then 13 else d end*b-a= -d)} -} {10744} -do_test randexpr-2.2413 { - db eval {SELECT coalesce((select t1.a*a+t1.f | t1.d from t1 where t1.d<+t1.c*d-c*19+t1.e-(abs( -t1.e)/abs(19))), -t1.c+coalesce((select t1.b from t1 where not not (select max(t1.c) from t1)-17+e in (e,t1.c,b) and not (d in (select ( -((max(b)))) from t1 union select min(d) from t1))),t1.b) | t1.a) FROM t1 WHERE NOT (not t1.f in (select ((select abs(count(*)) from t1)-11) from t1 union select t1.a-17 from t1) or not exists(select 1 from t1 where case (abs(e)/abs(+c)) when coalesce((select max((select +(count(distinct t1.a)) from t1)) from t1 where not (e<=c*t1.a)),~(case when t1.c<=17 then e when t1.c<=t1.c then e else 17 end)) then 13 else d end*b-a= -d))} -} {} -do_test randexpr-2.2414 { - db eval {SELECT coalesce((select t1.a*a+t1.f & t1.d from t1 where t1.d<+t1.c*d-c*19+t1.e-(abs( -t1.e)/abs(19))), -t1.c+coalesce((select t1.b from t1 where not not (select max(t1.c) from t1)-17+e in (e,t1.c,b) and not (d in (select ( -((max(b)))) from t1 union select min(d) from t1))),t1.b) & t1.a) FROM t1 WHERE not t1.f in (select ((select abs(count(*)) from t1)-11) from t1 union select t1.a-17 from t1) or not exists(select 1 from t1 where case (abs(e)/abs(+c)) when coalesce((select max((select +(count(distinct t1.a)) from t1)) from t1 where not (e<=c*t1.a)),~(case when t1.c<=17 then e when t1.c<=t1.c then e else 17 end)) then 13 else d end*b-a= -d)} -} {256} -do_test randexpr-2.2415 { - db eval {SELECT case a+(abs(+13)/abs(a)) when ~(e)*(abs(b* -t1.d*19-t1.c+a-~t1.b*b-coalesce((select max(case when not exists(select 1 from t1 where d in (f,t1.c,f) or t1.c not in (13,f,t1.a)) then case when t1.a>= -t1.e then (( - -b)) else t1.b end else c end+e) from t1 where (a>11)),13)*17)/abs(e)) then 11 else c end FROM t1 WHERE 17 between a and t1.a} -} {} -do_test randexpr-2.2416 { - db eval {SELECT case a+(abs(+13)/abs(a)) when ~(e)*(abs(b* -t1.d*19-t1.c+a-~t1.b*b-coalesce((select max(case when not exists(select 1 from t1 where d in (f,t1.c,f) or t1.c not in (13,f,t1.a)) then case when t1.a>= -t1.e then (( - -b)) else t1.b end else c end+e) from t1 where (a>11)),13)*17)/abs(e)) then 11 else c end FROM t1 WHERE NOT (17 between a and t1.a)} -} {300} -do_test randexpr-2.2417 { - db eval {SELECT +~t1.f-c*case when t1.f between coalesce((select max(a) from t1 where (t1.c-17*t1.b | c=e)),t1.b) and (abs(coalesce((select max(19) from t1 where t1.b not between c+(select min(t1.d) from t1)-t1.d+d+t1.d+t1.c*t1.e and 11),t1.a))/abs(a))-c*b then 17 else 13 end FROM t1 WHERE t1.c not between (abs(+case when not -19 in (case when t1.b+~d+11+f>e then (select -cast(avg(coalesce((select 17 from t1 where (t1.b>=f)),19)) AS integer)*min(d)*(min(e))* -min(b) from t1) when 17+b not between 17 and t1.a then 11 else a end,19,(t1.e)) then f else 19 end*t1.a)/abs(b)) and 19} -} {-4501} -do_test randexpr-2.2418 { - db eval {SELECT +~t1.f-c*case when t1.f between coalesce((select max(a) from t1 where (t1.c-17*t1.b | c=e)),t1.b) and (abs(coalesce((select max(19) from t1 where t1.b not between c+(select min(t1.d) from t1)-t1.d+d+t1.d+t1.c*t1.e and 11),t1.a))/abs(a))-c*b then 17 else 13 end FROM t1 WHERE NOT (t1.c not between (abs(+case when not -19 in (case when t1.b+~d+11+f>e then (select -cast(avg(coalesce((select 17 from t1 where (t1.b>=f)),19)) AS integer)*min(d)*(min(e))* -min(b) from t1) when 17+b not between 17 and t1.a then 11 else a end,19,(t1.e)) then f else 19 end*t1.a)/abs(b)) and 19)} -} {} -do_test randexpr-2.2419 { - db eval {SELECT +~t1.f-c*case when t1.f between coalesce((select max(a) from t1 where (t1.c-17*t1.b & c=e)),t1.b) and (abs(coalesce((select max(19) from t1 where t1.b not between c+(select min(t1.d) from t1)-t1.d+d+t1.d+t1.c*t1.e and 11),t1.a))/abs(a))-c*b then 17 else 13 end FROM t1 WHERE t1.c not between (abs(+case when not -19 in (case when t1.b+~d+11+f>e then (select -cast(avg(coalesce((select 17 from t1 where (t1.b>=f)),19)) AS integer)*min(d)*(min(e))* -min(b) from t1) when 17+b not between 17 and t1.a then 11 else a end,19,(t1.e)) then f else 19 end*t1.a)/abs(b)) and 19} -} {-4501} -do_test randexpr-2.2420 { - db eval {SELECT +(abs(case t1.a when coalesce((select max(13) from t1 where d<=case when t1.b=(select abs(count(distinct t1.e)) from t1) and (select -count(distinct e) from t1) not in ( -11,e,13) then 13 else t1.e end and (not exists(select 1 from t1 where t1.d in (select count(*) from t1 union select max(f) from t1))) and 19=13 or -e=17),coalesce((select (abs(17)/abs(b))-t1.b from t1 where (19)<=t1.f),t1.d))*t1.b then 17 else 13 end)/abs(19)) FROM t1 WHERE a in (select case max(13)-~cast(avg(case when t1.d>13 or exists(select 1 from t1 where not (( -c<=e)) and (b)*t1.a in (select count(*) from t1 union select cast(avg(t1.c) AS integer)+max(f) from t1)) then t1.a else t1.c end) AS integer) when abs(count(distinct t1.d)) then count(distinct (~t1.a)) else count(distinct c)-cast(avg(e) AS integer) end from t1 union select abs(count(distinct a)*max(t1.d)) from t1)} -} {} -do_test randexpr-2.2421 { - db eval {SELECT +(abs(case t1.a when coalesce((select max(13) from t1 where d<=case when t1.b=(select abs(count(distinct t1.e)) from t1) and (select -count(distinct e) from t1) not in ( -11,e,13) then 13 else t1.e end and (not exists(select 1 from t1 where t1.d in (select count(*) from t1 union select max(f) from t1))) and 19=13 or -e=17),coalesce((select (abs(17)/abs(b))-t1.b from t1 where (19)<=t1.f),t1.d))*t1.b then 17 else 13 end)/abs(19)) FROM t1 WHERE NOT (a in (select case max(13)-~cast(avg(case when t1.d>13 or exists(select 1 from t1 where not (( -c<=e)) and (b)*t1.a in (select count(*) from t1 union select cast(avg(t1.c) AS integer)+max(f) from t1)) then t1.a else t1.c end) AS integer) when abs(count(distinct t1.d)) then count(distinct (~t1.a)) else count(distinct c)-cast(avg(e) AS integer) end from t1 union select abs(count(distinct a)*max(t1.d)) from t1))} -} {0} -do_test randexpr-2.2422 { - db eval {SELECT +coalesce((select max(f+c) from t1 where t1.b in (select +max(b+t1.b) from t1 union select cast(avg(d-b | f-11-t1.b | coalesce((select ~t1.a from t1 where (t1.a=case when not exists(select 1 from t1 where 13 not in (t1.b,t1.e,t1.f)) then (abs(t1.d)/abs(c)) when c<>17 then c else 19 end)),t1.c)) AS integer) from t1) and t1.e not in (b,d,(13))),t1.b) FROM t1 WHERE (select cast(avg(~t1.f) AS integer) from t1) not in ( -c,17,11*c)} -} {200} -do_test randexpr-2.2423 { - db eval {SELECT +coalesce((select max(f+c) from t1 where t1.b in (select +max(b+t1.b) from t1 union select cast(avg(d-b | f-11-t1.b | coalesce((select ~t1.a from t1 where (t1.a=case when not exists(select 1 from t1 where 13 not in (t1.b,t1.e,t1.f)) then (abs(t1.d)/abs(c)) when c<>17 then c else 19 end)),t1.c)) AS integer) from t1) and t1.e not in (b,d,(13))),t1.b) FROM t1 WHERE NOT ((select cast(avg(~t1.f) AS integer) from t1) not in ( -c,17,11*c))} -} {} -do_test randexpr-2.2424 { - db eval {SELECT +coalesce((select max(f+c) from t1 where t1.b in (select +max(b+t1.b) from t1 union select cast(avg(d-b & f-11-t1.b & coalesce((select ~t1.a from t1 where (t1.a=case when not exists(select 1 from t1 where 13 not in (t1.b,t1.e,t1.f)) then (abs(t1.d)/abs(c)) when c<>17 then c else 19 end)),t1.c)) AS integer) from t1) and t1.e not in (b,d,(13))),t1.b) FROM t1 WHERE (select cast(avg(~t1.f) AS integer) from t1) not in ( -c,17,11*c)} -} {200} -do_test randexpr-2.2425 { - db eval {SELECT t1.e*case when ((13)-13-13-t1.d+t1.c*b>11) then b when case when (t1.a*b not in (t1.a,t1.b,t1.f)) then 11+e else t1.f end<= -f or f in (t1.a,11,13) or exists(select 1 from t1 where not exists(select 1 from t1 where f in (f,d,t1.e))) then t1.d else b end FROM t1 WHERE coalesce((select 19 from t1 where 13-t1.b*c-t1.a+case when case when coalesce((select +t1.b from t1 where a<>b),13) in ((b),t1.f,b) and not t1.b in (select -cast(avg(13) AS integer) from t1 union select cast(avg(11) AS integer) from t1) or a>=13 then (abs(t1.b+a)/abs(11)) else t1.e end-17+t1.d<>b then (19) else f end=e),13)>=t1.c} -} {} -do_test randexpr-2.2426 { - db eval {SELECT t1.e*case when ((13)-13-13-t1.d+t1.c*b>11) then b when case when (t1.a*b not in (t1.a,t1.b,t1.f)) then 11+e else t1.f end<= -f or f in (t1.a,11,13) or exists(select 1 from t1 where not exists(select 1 from t1 where f in (f,d,t1.e))) then t1.d else b end FROM t1 WHERE NOT (coalesce((select 19 from t1 where 13-t1.b*c-t1.a+case when case when coalesce((select +t1.b from t1 where a<>b),13) in ((b),t1.f,b) and not t1.b in (select -cast(avg(13) AS integer) from t1 union select cast(avg(11) AS integer) from t1) or a>=13 then (abs(t1.b+a)/abs(11)) else t1.e end-17+t1.d<>b then (19) else f end=e),13)>=t1.c)} -} {100000} -do_test randexpr-2.2427 { - db eval {SELECT coalesce((select max(d) from t1 where 19+case t1.b when t1.a-a then (abs(case when (e>=case t1.a when coalesce((select max(t1.d) from t1 where (select case -max(c)+cast(avg(t1.a) AS integer) when cast(avg(t1.a) AS integer) then cast(avg(19) AS integer) else cast(avg(t1.b) AS integer) end from t1)>t1.c),coalesce((select max(d) from t1 where 19<>17 and d<=b), -(t1.c)))+e then c else t1.d end+b) then b when 19 between c and 17 then 11 else e end)/abs( -t1.b)) else t1.a end+13>=d),d) FROM t1 WHERE a=case when t1.f in (select (max(f)-++(min(t1.a))-max(19)-count(*)) from t1 union select +max(t1.b) from t1) then t1.b*19*19 when t1.f>d then 17-d else t1.f end and exists(select 1 from t1 where not exists(select 1 from t1 where d in (select count(distinct 11)+max(a) from t1 union select cast(avg(13) AS integer) from t1) or 19 not in (t1.b,c,13)))} -} {} -do_test randexpr-2.2428 { - db eval {SELECT coalesce((select max(d) from t1 where 19+case t1.b when t1.a-a then (abs(case when (e>=case t1.a when coalesce((select max(t1.d) from t1 where (select case -max(c)+cast(avg(t1.a) AS integer) when cast(avg(t1.a) AS integer) then cast(avg(19) AS integer) else cast(avg(t1.b) AS integer) end from t1)>t1.c),coalesce((select max(d) from t1 where 19<>17 and d<=b), -(t1.c)))+e then c else t1.d end+b) then b when 19 between c and 17 then 11 else e end)/abs( -t1.b)) else t1.a end+13>=d),d) FROM t1 WHERE NOT (a=case when t1.f in (select (max(f)-++(min(t1.a))-max(19)-count(*)) from t1 union select +max(t1.b) from t1) then t1.b*19*19 when t1.f>d then 17-d else t1.f end and exists(select 1 from t1 where not exists(select 1 from t1 where d in (select count(distinct 11)+max(a) from t1 union select cast(avg(13) AS integer) from t1) or 19 not in (t1.b,c,13))))} -} {400} -do_test randexpr-2.2429 { - db eval {SELECT coalesce((select max(case t1.c | b-t1.d+13 when 17 then c else 13 end) from t1 where case when exists(select 1 from t1 where b<>t1.c) then t1.d when a not between (abs(t1.d)/abs((t1.b))) and (t1.c) or (a in (select ~max(((17))) from t1 union select case -(count(distinct -t1.c)) when count(distinct t1.c) then (count(*)) else max(f) end from t1)) and t1.f>19 or a<>11 then t1.b else t1.b end>(11)),13)+b*(b) FROM t1 WHERE case when not exists(select 1 from t1 where (19<>11+t1.b*c+d)) and 13<>b or t1.d between t1.c and b and f between t1.b and -a or 19 between 19 and 17 or t1.e not between e and t1.d then ~13 else coalesce((select max(t1.b) from t1 where f=a),(a)) end in (select -( -+count(distinct 11)-count(*))*count(distinct ( -t1.c))+(count(distinct t1.c))+max(17)-count(*) from t1 union select count(*) from t1)} -} {} -do_test randexpr-2.2430 { - db eval {SELECT coalesce((select max(case t1.c | b-t1.d+13 when 17 then c else 13 end) from t1 where case when exists(select 1 from t1 where b<>t1.c) then t1.d when a not between (abs(t1.d)/abs((t1.b))) and (t1.c) or (a in (select ~max(((17))) from t1 union select case -(count(distinct -t1.c)) when count(distinct t1.c) then (count(*)) else max(f) end from t1)) and t1.f>19 or a<>11 then t1.b else t1.b end>(11)),13)+b*(b) FROM t1 WHERE NOT (case when not exists(select 1 from t1 where (19<>11+t1.b*c+d)) and 13<>b or t1.d between t1.c and b and f between t1.b and -a or 19 between 19 and 17 or t1.e not between e and t1.d then ~13 else coalesce((select max(t1.b) from t1 where f=a),(a)) end in (select -( -+count(distinct 11)-count(*))*count(distinct ( -t1.c))+(count(distinct t1.c))+max(17)-count(*) from t1 union select count(*) from t1))} -} {40013} -do_test randexpr-2.2431 { - db eval {SELECT coalesce((select max(case t1.c & b-t1.d+13 when 17 then c else 13 end) from t1 where case when exists(select 1 from t1 where b<>t1.c) then t1.d when a not between (abs(t1.d)/abs((t1.b))) and (t1.c) or (a in (select ~max(((17))) from t1 union select case -(count(distinct -t1.c)) when count(distinct t1.c) then (count(*)) else max(f) end from t1)) and t1.f>19 or a<>11 then t1.b else t1.b end>(11)),13)+b*(b) FROM t1 WHERE NOT (case when not exists(select 1 from t1 where (19<>11+t1.b*c+d)) and 13<>b or t1.d between t1.c and b and f between t1.b and -a or 19 between 19 and 17 or t1.e not between e and t1.d then ~13 else coalesce((select max(t1.b) from t1 where f=a),(a)) end in (select -( -+count(distinct 11)-count(*))*count(distinct ( -t1.c))+(count(distinct t1.c))+max(17)-count(*) from t1 union select count(*) from t1))} -} {40013} -do_test randexpr-2.2432 { - db eval {SELECT coalesce((select max(coalesce((select max(11) from t1 where t1.b< -t1.b),e)+coalesce((select t1.b from t1 where not case when ~case when -17+t1.d> - -t1.d then t1.b when t1.b between 13 and c or t1.a>= -f then t1.b else t1.e end+t1.c<= -c then 19 else t1.f end not in (c,d,e) or t1.f not between t1.b and 19 and 13>= -t1.f or 13 in (e,(t1.b),11)),t1.b)) from t1 where -(f) not in (f,(t1.e),b)),t1.f) FROM t1 WHERE f in (select f from t1 union select t1.f*t1.b from t1)} -} {700} -do_test randexpr-2.2433 { - db eval {SELECT coalesce((select max(coalesce((select max(11) from t1 where t1.b< -t1.b),e)+coalesce((select t1.b from t1 where not case when ~case when -17+t1.d> - -t1.d then t1.b when t1.b between 13 and c or t1.a>= -f then t1.b else t1.e end+t1.c<= -c then 19 else t1.f end not in (c,d,e) or t1.f not between t1.b and 19 and 13>= -t1.f or 13 in (e,(t1.b),11)),t1.b)) from t1 where -(f) not in (f,(t1.e),b)),t1.f) FROM t1 WHERE NOT (f in (select f from t1 union select t1.f*t1.b from t1))} -} {} -do_test randexpr-2.2434 { - db eval {SELECT ( -+(a)*(abs(case coalesce((select max(d) from t1 where t1.d<>c*(select count(distinct e*coalesce((select 13-17 from t1 where not exists(select 1 from t1 where t1.a in (select f from t1 union select (a) from t1))),t1.f)+(t1.c)) from t1) | t1.e*19 and not t1.a<13),t1.b)+t1.b when t1.d then (t1.f) else t1.c end)/abs(t1.f))-13*t1.f) FROM t1 WHERE f>=t1.a+ -(select (count(*))-(~case cast(avg(t1.b-13-e) AS integer) when count(*) then (max(t1.f*case 13 when 11 then 13 else c end))- -cast(avg(t1.f) AS integer)*count(*)-min(19) else count(distinct d) end)+min(t1.d) | -max(t1.b) from t1) | t1.b*17+t1.d+t1.b-d} -} {} -do_test randexpr-2.2435 { - db eval {SELECT ( -+(a)*(abs(case coalesce((select max(d) from t1 where t1.d<>c*(select count(distinct e*coalesce((select 13-17 from t1 where not exists(select 1 from t1 where t1.a in (select f from t1 union select (a) from t1))),t1.f)+(t1.c)) from t1) | t1.e*19 and not t1.a<13),t1.b)+t1.b when t1.d then (t1.f) else t1.c end)/abs(t1.f))-13*t1.f) FROM t1 WHERE NOT (f>=t1.a+ -(select (count(*))-(~case cast(avg(t1.b-13-e) AS integer) when count(*) then (max(t1.f*case 13 when 11 then 13 else c end))- -cast(avg(t1.f) AS integer)*count(*)-min(19) else count(distinct d) end)+min(t1.d) | -max(t1.b) from t1) | t1.b*17+t1.d+t1.b-d)} -} {-7800} -do_test randexpr-2.2436 { - db eval {SELECT ( -+(a)*(abs(case coalesce((select max(d) from t1 where t1.d<>c*(select count(distinct e*coalesce((select 13-17 from t1 where not exists(select 1 from t1 where t1.a in (select f from t1 union select (a) from t1))),t1.f)+(t1.c)) from t1) & t1.e*19 and not t1.a<13),t1.b)+t1.b when t1.d then (t1.f) else t1.c end)/abs(t1.f))-13*t1.f) FROM t1 WHERE NOT (f>=t1.a+ -(select (count(*))-(~case cast(avg(t1.b-13-e) AS integer) when count(*) then (max(t1.f*case 13 when 11 then 13 else c end))- -cast(avg(t1.f) AS integer)*count(*)-min(19) else count(distinct d) end)+min(t1.d) | -max(t1.b) from t1) | t1.b*17+t1.d+t1.b-d)} -} {-7800} -do_test randexpr-2.2437 { - db eval {SELECT coalesce((select t1.a from t1 where c in (select a from t1 union select t1.a*f from t1) and t1.b in (select (select count(*) from t1)*11 from t1 union select -13 from t1)),13) FROM t1 WHERE (d=17 then d when f<=t1.c then t1.a else d end,t1.e,e) or not 19>c then t1.c-19 else 13 end<>t1.c} -} {-180500} -do_test randexpr-2.2440 { - db eval {SELECT case when (not exists(select 1 from t1 where a<=case a | e-case t1.f when c then e else 19 end | t1.b when t1.c then t1.e else 19 end+d)) or f between a and b and (t1.f) not in (d,t1.e,11) then case 17+e | t1.c when 19 then 13 else -(19) end | 11 else a end-t1.f-f*t1.c FROM t1 WHERE NOT (case when t1.b in ( - -case when case when t1.f-case when 19<=c then a else 19 end between 13 and t1.d and not a not in ((f),d,f) then t1.c-a when t1.d not in ( -b,c,11) then 13 else f end>=17 then d when f<=t1.c then t1.a else d end,t1.e,e) or not 19>c then t1.c-19 else 13 end<>t1.c)} -} {} -do_test randexpr-2.2441 { - db eval {SELECT case when (not exists(select 1 from t1 where a<=case a & e-case t1.f when c then e else 19 end & t1.b when t1.c then t1.e else 19 end+d)) or f between a and b and (t1.f) not in (d,t1.e,11) then case 17+e & t1.c when 19 then 13 else -(19) end & 11 else a end-t1.f-f*t1.c FROM t1 WHERE case when t1.b in ( - -case when case when t1.f-case when 19<=c then a else 19 end between 13 and t1.d and not a not in ((f),d,f) then t1.c-a when t1.d not in ( -b,c,11) then 13 else f end>=17 then d when f<=t1.c then t1.a else d end,t1.e,e) or not 19>c then t1.c-19 else 13 end<>t1.c} -} {-180500} -do_test randexpr-2.2442 { - db eval {SELECT coalesce((select d-(abs(case when +coalesce((select 19 from t1 where not exists(select 1 from t1 where d | f in (select ~case count(distinct f) when ( -(cast(avg((( -19))) AS integer))) then (count(*)) else count(distinct 17) end*(max(t1.d)) from t1 union select min(b) from t1))),13) | t1.b+t1.e in (13,(t1.b),t1.a) then t1.a when a in (select t1.f from t1 union select t1.b from t1) then t1.e else a end)/abs(f))-t1.e from t1 where not exists(select 1 from t1 where not 19 in (select t1.b from t1 union select t1.f from t1) or 13 in (select e from t1 union select e from t1))),f) FROM t1 WHERE not exists(select 1 from t1 where case when not exists(select 1 from t1 where a<+case c when (abs(t1.b)/abs(e))+t1.b-b-t1.b then (t1.d)*t1.c else t1.d end) then b else 19 end in (select -count(distinct c)*(max(f)) | ~+case min(t1.a) when cast(avg(c) AS integer) then cast(avg(t1.a) AS integer) | count(distinct t1.d)* -count(distinct t1.e) else ( -count(*)) end | -cast(avg(t1.d) AS integer)+min(a)*count(distinct b) from t1 union select max(13) from t1))} -} {600} -do_test randexpr-2.2443 { - db eval {SELECT coalesce((select d-(abs(case when +coalesce((select 19 from t1 where not exists(select 1 from t1 where d | f in (select ~case count(distinct f) when ( -(cast(avg((( -19))) AS integer))) then (count(*)) else count(distinct 17) end*(max(t1.d)) from t1 union select min(b) from t1))),13) | t1.b+t1.e in (13,(t1.b),t1.a) then t1.a when a in (select t1.f from t1 union select t1.b from t1) then t1.e else a end)/abs(f))-t1.e from t1 where not exists(select 1 from t1 where not 19 in (select t1.b from t1 union select t1.f from t1) or 13 in (select e from t1 union select e from t1))),f) FROM t1 WHERE NOT (not exists(select 1 from t1 where case when not exists(select 1 from t1 where a<+case c when (abs(t1.b)/abs(e))+t1.b-b-t1.b then (t1.d)*t1.c else t1.d end) then b else 19 end in (select -count(distinct c)*(max(f)) | ~+case min(t1.a) when cast(avg(c) AS integer) then cast(avg(t1.a) AS integer) | count(distinct t1.d)* -count(distinct t1.e) else ( -count(*)) end | -cast(avg(t1.d) AS integer)+min(a)*count(distinct b) from t1 union select max(13) from t1)))} -} {} -do_test randexpr-2.2444 { - db eval {SELECT coalesce((select d-(abs(case when +coalesce((select 19 from t1 where not exists(select 1 from t1 where d & f in (select ~case count(distinct f) when ( -(cast(avg((( -19))) AS integer))) then (count(*)) else count(distinct 17) end*(max(t1.d)) from t1 union select min(b) from t1))),13) & t1.b+t1.e in (13,(t1.b),t1.a) then t1.a when a in (select t1.f from t1 union select t1.b from t1) then t1.e else a end)/abs(f))-t1.e from t1 where not exists(select 1 from t1 where not 19 in (select t1.b from t1 union select t1.f from t1) or 13 in (select e from t1 union select e from t1))),f) FROM t1 WHERE not exists(select 1 from t1 where case when not exists(select 1 from t1 where a<+case c when (abs(t1.b)/abs(e))+t1.b-b-t1.b then (t1.d)*t1.c else t1.d end) then b else 19 end in (select -count(distinct c)*(max(f)) | ~+case min(t1.a) when cast(avg(c) AS integer) then cast(avg(t1.a) AS integer) | count(distinct t1.d)* -count(distinct t1.e) else ( -count(*)) end | -cast(avg(t1.d) AS integer)+min(a)*count(distinct b) from t1 union select max(13) from t1))} -} {600} -do_test randexpr-2.2445 { - db eval {SELECT (t1.e)+t1.c-coalesce((select max((abs(coalesce((select case when f>=(abs(coalesce((select max(a) from t1 where 11*(t1.f)*a*t1.d=11),t1.b))/abs(t1.d))+t1.b then c when not exists(select 1 from t1 where t1.c<>b) then 13 else 11 end from t1 where (13 not in (f,t1.c,13))),b)+t1.d)/abs(t1.f))) from t1 where b<>t1.a),t1.a) | t1.d FROM t1 WHERE ~a<>a or d<>t1.e} -} {927} -do_test randexpr-2.2446 { - db eval {SELECT (t1.e)+t1.c-coalesce((select max((abs(coalesce((select case when f>=(abs(coalesce((select max(a) from t1 where 11*(t1.f)*a*t1.d=11),t1.b))/abs(t1.d))+t1.b then c when not exists(select 1 from t1 where t1.c<>b) then 13 else 11 end from t1 where (13 not in (f,t1.c,13))),b)+t1.d)/abs(t1.f))) from t1 where b<>t1.a),t1.a) | t1.d FROM t1 WHERE NOT (~a<>a or d<>t1.e)} -} {} -do_test randexpr-2.2447 { - db eval {SELECT (t1.e)+t1.c-coalesce((select max((abs(coalesce((select case when f>=(abs(coalesce((select max(a) from t1 where 11*(t1.f)*a*t1.d=11),t1.b))/abs(t1.d))+t1.b then c when not exists(select 1 from t1 where t1.c<>b) then 13 else 11 end from t1 where (13 not in (f,t1.c,13))),b)+t1.d)/abs(t1.f))) from t1 where b<>t1.a),t1.a) & t1.d FROM t1 WHERE ~a<>a or d<>t1.e} -} {272} -do_test randexpr-2.2448 { - db eval {SELECT case when coalesce((select 11 from t1 where exists(select 1 from t1 where t1.a<= -19)),t1.c-t1.e*e-19-t1.d-t1.e-~a*coalesce((select max(b) from t1 where b>(abs(+c+case c when 11 then t1.f else 11 end)/abs(b))),t1.e)-f+t1.c+19+e-t1.e)<=t1.f then e else c end FROM t1 WHERE (abs(t1.d)/abs(~b)) in (select count(distinct case when t1.c+t1.fe and ((d) between t1.a and d) then t1.b else 13 end else 11 end) from t1 union select count(*) from t1)} -} {500} -do_test randexpr-2.2449 { - db eval {SELECT case when coalesce((select 11 from t1 where exists(select 1 from t1 where t1.a<= -19)),t1.c-t1.e*e-19-t1.d-t1.e-~a*coalesce((select max(b) from t1 where b>(abs(+c+case c when 11 then t1.f else 11 end)/abs(b))),t1.e)-f+t1.c+19+e-t1.e)<=t1.f then e else c end FROM t1 WHERE NOT ((abs(t1.d)/abs(~b)) in (select count(distinct case when t1.c+t1.fe and ((d) between t1.a and d) then t1.b else 13 end else 11 end) from t1 union select count(*) from t1))} -} {} -do_test randexpr-2.2450 { - db eval {SELECT case when 19*case when case when t1.e>((t1.d)) and 11>t1.d then -17 else e end in (select count(distinct a) from t1 union select min(d) from t1) then (d) else e end | t1.c+a in (select count(*) from t1 union select case +(max(19))+count(distinct -t1.d) when min(19) then cast(avg(e) AS integer) else cast(avg(t1.a) AS integer) end from t1) and 17 between 17 and t1.b then -(t1.e) when b between t1.c and 13 then b else 11 end+t1.f*(t1.d)+t1.c FROM t1 WHERE ~+e+11>b} -} {} -do_test randexpr-2.2451 { - db eval {SELECT case when 19*case when case when t1.e>((t1.d)) and 11>t1.d then -17 else e end in (select count(distinct a) from t1 union select min(d) from t1) then (d) else e end | t1.c+a in (select count(*) from t1 union select case +(max(19))+count(distinct -t1.d) when min(19) then cast(avg(e) AS integer) else cast(avg(t1.a) AS integer) end from t1) and 17 between 17 and t1.b then -(t1.e) when b between t1.c and 13 then b else 11 end+t1.f*(t1.d)+t1.c FROM t1 WHERE NOT (~+e+11>b)} -} {240311} -do_test randexpr-2.2452 { - db eval {SELECT case when 19*case when case when t1.e>((t1.d)) and 11>t1.d then -17 else e end in (select count(distinct a) from t1 union select min(d) from t1) then (d) else e end & t1.c+a in (select count(*) from t1 union select case +(max(19))+count(distinct -t1.d) when min(19) then cast(avg(e) AS integer) else cast(avg(t1.a) AS integer) end from t1) and 17 between 17 and t1.b then -(t1.e) when b between t1.c and 13 then b else 11 end+t1.f*(t1.d)+t1.c FROM t1 WHERE NOT (~+e+11>b)} -} {240311} -do_test randexpr-2.2453 { - db eval {SELECT coalesce((select max((e)) from t1 where not (((abs(c)/abs((abs(t1.e)/abs(t1.d)))) between d and a+t1.f+19-a or (not exists(select 1 from t1 where f*11 in (19,t1.d,case when (11 in (19,17,19) and t1.a>t1.d) then t1.e-19 else t1.e end+f))) and a<11) and 19<>a)),c+d) FROM t1 WHERE 17+case b*f when b then a+e else d end*t1.b<=case when not f=11 then c when t1.ed and exists(select 1 from t1 where 19 in (t1.e,t1.a,(e)))),a)*c from t1 union select f from t1)),t1.a)+f+17 then t1.c else b end} -} {} -do_test randexpr-2.2454 { - db eval {SELECT coalesce((select max((e)) from t1 where not (((abs(c)/abs((abs(t1.e)/abs(t1.d)))) between d and a+t1.f+19-a or (not exists(select 1 from t1 where f*11 in (19,t1.d,case when (11 in (19,17,19) and t1.a>t1.d) then t1.e-19 else t1.e end+f))) and a<11) and 19<>a)),c+d) FROM t1 WHERE NOT (17+case b*f when b then a+e else d end*t1.b<=case when not f=11 then c when t1.ed and exists(select 1 from t1 where 19 in (t1.e,t1.a,(e)))),a)*c from t1 union select f from t1)),t1.a)+f+17 then t1.c else b end)} -} {500} -do_test randexpr-2.2455 { - db eval {SELECT ((select cast(avg(case a when t1.d then (abs(coalesce((select coalesce((select coalesce((select e-a from t1 where not exists(select 1 from t1 where t1.f>11 or t1.a= -f)), -t1.a) from t1 where 11<= -t1.f),t1.f)-13 from t1 where not exists(select 1 from t1 where t1.e in (f,t1.b,d))),t1.d))/abs(11)) else (17) end) AS integer)+abs( -count(distinct e)+count(*)) | -count(*)*+min(e)*count(distinct b)*cast(avg(11) AS integer) from t1)) FROM t1 WHERE d= -19} -} {} -do_test randexpr-2.2456 { - db eval {SELECT ((select cast(avg(case a when t1.d then (abs(coalesce((select coalesce((select coalesce((select e-a from t1 where not exists(select 1 from t1 where t1.f>11 or t1.a= -f)), -t1.a) from t1 where 11<= -t1.f),t1.f)-13 from t1 where not exists(select 1 from t1 where t1.e in (f,t1.b,d))),t1.d))/abs(11)) else (17) end) AS integer)+abs( -count(distinct e)+count(*)) | -count(*)*+min(e)*count(distinct b)*cast(avg(11) AS integer) from t1)) FROM t1 WHERE NOT (d= -19)} -} {-5483} -do_test randexpr-2.2457 { - db eval {SELECT ((select cast(avg(case a when t1.d then (abs(coalesce((select coalesce((select coalesce((select e-a from t1 where not exists(select 1 from t1 where t1.f>11 or t1.a= -f)), -t1.a) from t1 where 11<= -t1.f),t1.f)-13 from t1 where not exists(select 1 from t1 where t1.e in (f,t1.b,d))),t1.d))/abs(11)) else (17) end) AS integer)+abs( -count(distinct e)+count(*)) & -count(*)*+min(e)*count(distinct b)*cast(avg(11) AS integer) from t1)) FROM t1 WHERE NOT (d= -19)} -} {0} -do_test randexpr-2.2458 { - db eval {SELECT 11+t1.e*c | t1.a+t1.a*coalesce((select max(b*t1.d*case when c in (select t1.b from t1 union select case when (t1.b>=d) then 19 else case when ((((t1.a<>t1.b)))) then b when f<=11 then case when e not in (19,t1.d,a) then coalesce((select 11 from t1 where e between a and e),e) when 11<=e then t1.a else 13 end else t1.c end end from t1) then 19 else (t1.d) end-a) from t1 where (t1.d)<= -e),t1.f) FROM t1 WHERE ((f not between t1.a and (abs(19)/abs(17 | (a))) and ((exists(select 1 from t1 where coalesce((select case e*(17) when b-(abs((abs(11)/abs(t1.c+e+t1.c)))/abs(17-((t1.f-t1.e | 11)))) then e else a end from t1 where t1.c not in (19,t1.b,t1.d)),c)=b)))))} -} {} -do_test randexpr-2.2459 { - db eval {SELECT 11+t1.e*c | t1.a+t1.a*coalesce((select max(b*t1.d*case when c in (select t1.b from t1 union select case when (t1.b>=d) then 19 else case when ((((t1.a<>t1.b)))) then b when f<=11 then case when e not in (19,t1.d,a) then coalesce((select 11 from t1 where e between a and e),e) when 11<=e then t1.a else 13 end else t1.c end end from t1) then 19 else (t1.d) end-a) from t1 where (t1.d)<= -e),t1.f) FROM t1 WHERE NOT (((f not between t1.a and (abs(19)/abs(17 | (a))) and ((exists(select 1 from t1 where coalesce((select case e*(17) when b-(abs((abs(11)/abs(t1.c+e+t1.c)))/abs(17-((t1.f-t1.e | 11)))) then e else a end from t1 where t1.c not in (19,t1.b,t1.d)),c)=b))))))} -} {191487} -do_test randexpr-2.2460 { - db eval {SELECT 11+t1.e*c & t1.a+t1.a*coalesce((select max(b*t1.d*case when c in (select t1.b from t1 union select case when (t1.b>=d) then 19 else case when ((((t1.a<>t1.b)))) then b when f<=11 then case when e not in (19,t1.d,a) then coalesce((select 11 from t1 where e between a and e),e) when 11<=e then t1.a else 13 end else t1.c end end from t1) then 19 else (t1.d) end-a) from t1 where (t1.d)<= -e),t1.f) FROM t1 WHERE NOT (((f not between t1.a and (abs(19)/abs(17 | (a))) and ((exists(select 1 from t1 where coalesce((select case e*(17) when b-(abs((abs(11)/abs(t1.c+e+t1.c)))/abs(17-((t1.f-t1.e | 11)))) then e else a end from t1 where t1.c not in (19,t1.b,t1.d)),c)=b))))))} -} {18624} -do_test randexpr-2.2461 { - db eval {SELECT (select (case +~ -abs(count(distinct + -(select (case ~((min(t1.b)+max(a))+count(*))*cast(avg(e) AS integer) when count(distinct (17)) then count(distinct t1.d) else max(a) end) from t1)*(17)-t1.f+case (abs( -t1.e)/abs(17)) when t1.f then b else 11 end)) | max(c)-case max(f) when (max(t1.f)) then min(c) else cast(avg((t1.d)) AS integer) end when count(*) then min(t1.a) else cast(avg(t1.c) AS integer) end) from t1) FROM t1 WHERE 13 in ((select ~ -abs((abs( -max(c)+count(distinct c)-~case +max(f) when min(13) then count(distinct t1.e) else count(*) end-((cast(avg(t1.c) AS integer)))))) from t1),~t1.c-t1.e,case when exists(select 1 from t1 where not exists(select 1 from t1 where t1.a in (select case when t1.ca then b else (c) end+t1.d from t1 union select -t1.e from t1)) or 11 not between b and d or e>e) then t1.f else t1.f end*t1.b- -t1.b)} -} {} -do_test randexpr-2.2462 { - db eval {SELECT (select (case +~ -abs(count(distinct + -(select (case ~((min(t1.b)+max(a))+count(*))*cast(avg(e) AS integer) when count(distinct (17)) then count(distinct t1.d) else max(a) end) from t1)*(17)-t1.f+case (abs( -t1.e)/abs(17)) when t1.f then b else 11 end)) | max(c)-case max(f) when (max(t1.f)) then min(c) else cast(avg((t1.d)) AS integer) end when count(*) then min(t1.a) else cast(avg(t1.c) AS integer) end) from t1) FROM t1 WHERE NOT (13 in ((select ~ -abs((abs( -max(c)+count(distinct c)-~case +max(f) when min(13) then count(distinct t1.e) else count(*) end-((cast(avg(t1.c) AS integer)))))) from t1),~t1.c-t1.e,case when exists(select 1 from t1 where not exists(select 1 from t1 where t1.a in (select case when t1.ca then b else (c) end+t1.d from t1 union select -t1.e from t1)) or 11 not between b and d or e>e) then t1.f else t1.f end*t1.b- -t1.b))} -} {300} -do_test randexpr-2.2463 { - db eval {SELECT (select (case +~ -abs(count(distinct + -(select (case ~((min(t1.b)+max(a))+count(*))*cast(avg(e) AS integer) when count(distinct (17)) then count(distinct t1.d) else max(a) end) from t1)*(17)-t1.f+case (abs( -t1.e)/abs(17)) when t1.f then b else 11 end)) & max(c)-case max(f) when (max(t1.f)) then min(c) else cast(avg((t1.d)) AS integer) end when count(*) then min(t1.a) else cast(avg(t1.c) AS integer) end) from t1) FROM t1 WHERE NOT (13 in ((select ~ -abs((abs( -max(c)+count(distinct c)-~case +max(f) when min(13) then count(distinct t1.e) else count(*) end-((cast(avg(t1.c) AS integer)))))) from t1),~t1.c-t1.e,case when exists(select 1 from t1 where not exists(select 1 from t1 where t1.a in (select case when t1.ca then b else (c) end+t1.d from t1 union select -t1.e from t1)) or 11 not between b and d or e>e) then t1.f else t1.f end*t1.b- -t1.b))} -} {300} -do_test randexpr-2.2464 { - db eval {SELECT case when (abs(~(t1.e))/abs(case when (( -13c)),f)+t1.b when 13 then t1.c else t1.b end<>a) or t1.a=a),e+t1.e))/abs((f))) when a then e else f end) from t1 where t1.a>t1.d),19)) from t1) FROM t1 WHERE 19*~case when (case when t1.f<>t1.a*17*(abs(t1.e)/abs(a))*a*(select case +min(11)*cast(avg(b) AS integer)*cast(avg(19) AS integer) when count(distinct t1.f) then max( -t1.e) else cast(avg( -f) AS integer) end from t1)*(select min(t1.b) from t1)*t1.d then coalesce((select max(11) from t1 where t1.a between t1.d and 17 and 19 not between 17 and a),17) else 17 end in (select t1.f from t1 union select 17 from t1)) then ~t1.b else t1.d end<=b} -} {} -do_test randexpr-2.2471 { - db eval {SELECT (select min(coalesce((select max(t1.c-case t1.e | (abs(coalesce((select max(t1.b) from t1 where 19c)),f)+t1.b when 13 then t1.c else t1.b end<>a) or t1.a=a),e+t1.e))/abs((f))) when a then e else f end) from t1 where t1.a>t1.d),19)) from t1) FROM t1 WHERE NOT (19*~case when (case when t1.f<>t1.a*17*(abs(t1.e)/abs(a))*a*(select case +min(11)*cast(avg(b) AS integer)*cast(avg(19) AS integer) when count(distinct t1.f) then max( -t1.e) else cast(avg( -f) AS integer) end from t1)*(select min(t1.b) from t1)*t1.d then coalesce((select max(11) from t1 where t1.a between t1.d and 17 and 19 not between 17 and a),17) else 17 end in (select t1.f from t1 union select 17 from t1)) then ~t1.b else t1.d end<=b)} -} {19} -do_test randexpr-2.2472 { - db eval {SELECT (select min(coalesce((select max(t1.c-case t1.e & (abs(coalesce((select max(t1.b) from t1 where 19c)),f)+t1.b when 13 then t1.c else t1.b end<>a) or t1.a=a),e+t1.e))/abs((f))) when a then e else f end) from t1 where t1.a>t1.d),19)) from t1) FROM t1 WHERE NOT (19*~case when (case when t1.f<>t1.a*17*(abs(t1.e)/abs(a))*a*(select case +min(11)*cast(avg(b) AS integer)*cast(avg(19) AS integer) when count(distinct t1.f) then max( -t1.e) else cast(avg( -f) AS integer) end from t1)*(select min(t1.b) from t1)*t1.d then coalesce((select max(11) from t1 where t1.a between t1.d and 17 and 19 not between 17 and a),17) else 17 end in (select t1.f from t1 union select 17 from t1)) then ~t1.b else t1.d end<=b)} -} {19} -do_test randexpr-2.2473 { - db eval {SELECT -case (select ~count(*)-~abs(~ -(count(*)+count(*)))*count(*) from t1)*13++coalesce((select max( -+17+case when f not between e and t1.c and t1.f between t1.e and t1.a then e when (b)>19 then f else t1.b end) from t1 where 17 not in (a,t1.f,17) or (d>=t1.e) or a<=17),d) when t1.c then 19 else t1.f end FROM t1 WHERE (19<+case when not 17>e then +t1.f when e | 13 in (select ~(abs(a)/abs(t1.b)) from t1 union select t1.f from t1) then case when f between case case b*f+19-case t1.c when f then 13 else c end when t1.d then b else b end*11 when 19 then 13 else t1.c end and t1.f then c when t1.b<=c then t1.d else 13 end else t1.d end)} -} {-600} -do_test randexpr-2.2474 { - db eval {SELECT -case (select ~count(*)-~abs(~ -(count(*)+count(*)))*count(*) from t1)*13++coalesce((select max( -+17+case when f not between e and t1.c and t1.f between t1.e and t1.a then e when (b)>19 then f else t1.b end) from t1 where 17 not in (a,t1.f,17) or (d>=t1.e) or a<=17),d) when t1.c then 19 else t1.f end FROM t1 WHERE NOT ((19<+case when not 17>e then +t1.f when e | 13 in (select ~(abs(a)/abs(t1.b)) from t1 union select t1.f from t1) then case when f between case case b*f+19-case t1.c when f then 13 else c end when t1.d then b else b end*11 when 19 then 13 else t1.c end and t1.f then c when t1.b<=c then t1.d else 13 end else t1.d end))} -} {} -do_test randexpr-2.2475 { - db eval {SELECT case when e not in (t1.a,t1.b,t1.e-t1.a) then f-coalesce((select max(~19-t1.b-f) from t1 where case when (select count(*)*count(*) from t1)-coalesce((select max(13) from t1 where (abs(13)/abs(19-f)) in (select count(distinct f) from t1 union select ~ - -count(distinct -f) from t1)),t1.b) between t1.f and t1.d then d else f end between t1.f and a),t1.f)+ -t1.f else t1.e end FROM t1 WHERE d not in (c,t1.d, -coalesce((select max( -coalesce((select f from t1 where t1.b>t1.c* - -t1.f),case when (t1.e-t1.e | 19*t1.c+e<19 and 19<=e or not exists(select 1 from t1 where t1.a<=t1.d or e in (a,t1.e,b))) then -e when f in ((t1.a),d,11) then 13 else d end)) from t1 where c between 19 and f),b))} -} {} -do_test randexpr-2.2476 { - db eval {SELECT case when e not in (t1.a,t1.b,t1.e-t1.a) then f-coalesce((select max(~19-t1.b-f) from t1 where case when (select count(*)*count(*) from t1)-coalesce((select max(13) from t1 where (abs(13)/abs(19-f)) in (select count(distinct f) from t1 union select ~ - -count(distinct -f) from t1)),t1.b) between t1.f and t1.d then d else f end between t1.f and a),t1.f)+ -t1.f else t1.e end FROM t1 WHERE NOT (d not in (c,t1.d, -coalesce((select max( -coalesce((select f from t1 where t1.b>t1.c* - -t1.f),case when (t1.e-t1.e | 19*t1.c+e<19 and 19<=e or not exists(select 1 from t1 where t1.a<=t1.d or e in (a,t1.e,b))) then -e when f in ((t1.a),d,11) then 13 else d end)) from t1 where c between 19 and f),b)))} -} {-600} -do_test randexpr-2.2477 { - db eval {SELECT -case when (17<>t1.b-d+t1.a | t1.f) then ~c when ((19)-coalesce((select case t1.d-t1.f when (abs(((select abs(cast(avg(13) AS integer) | cast(avg( -(t1.b)) AS integer)) from t1)))/abs(case d when t1.b then -11 else 19 end))*17 then t1.e else t1.a end from t1 where (19 not in (f,t1.d,t1.e))),t1.d)<>a) then t1.d else t1.c end FROM t1 WHERE a in (~b-t1.f*c,13 | coalesce((select max(t1.a) from t1 where -t1.a-~case when b in (case when t1.e in (select 11 from t1 union select d from t1) and 13>19 then 13*c when f not in (t1.d,c,13) then t1.a else a end,t1.f,d) then a else 11 end+b in (select +(min(11)) from t1 union select max(11)+cast(avg(19) AS integer) from t1)),13),t1.f)} -} {} -do_test randexpr-2.2478 { - db eval {SELECT -case when (17<>t1.b-d+t1.a | t1.f) then ~c when ((19)-coalesce((select case t1.d-t1.f when (abs(((select abs(cast(avg(13) AS integer) | cast(avg( -(t1.b)) AS integer)) from t1)))/abs(case d when t1.b then -11 else 19 end))*17 then t1.e else t1.a end from t1 where (19 not in (f,t1.d,t1.e))),t1.d)<>a) then t1.d else t1.c end FROM t1 WHERE NOT (a in (~b-t1.f*c,13 | coalesce((select max(t1.a) from t1 where -t1.a-~case when b in (case when t1.e in (select 11 from t1 union select d from t1) and 13>19 then 13*c when f not in (t1.d,c,13) then t1.a else a end,t1.f,d) then a else 11 end+b in (select +(min(11)) from t1 union select max(11)+cast(avg(19) AS integer) from t1)),13),t1.f))} -} {301} -do_test randexpr-2.2479 { - db eval {SELECT -case when (17<>t1.b-d+t1.a & t1.f) then ~c when ((19)-coalesce((select case t1.d-t1.f when (abs(((select abs(cast(avg(13) AS integer) & cast(avg( -(t1.b)) AS integer)) from t1)))/abs(case d when t1.b then -11 else 19 end))*17 then t1.e else t1.a end from t1 where (19 not in (f,t1.d,t1.e))),t1.d)<>a) then t1.d else t1.c end FROM t1 WHERE NOT (a in (~b-t1.f*c,13 | coalesce((select max(t1.a) from t1 where -t1.a-~case when b in (case when t1.e in (select 11 from t1 union select d from t1) and 13>19 then 13*c when f not in (t1.d,c,13) then t1.a else a end,t1.f,d) then a else 11 end+b in (select +(min(11)) from t1 union select max(11)+cast(avg(19) AS integer) from t1)),13),t1.f))} -} {301} -do_test randexpr-2.2480 { - db eval {SELECT case f when case when +t1.a between a and case e when 17 then t1.e else f-t1.e+a-((select ++count(distinct d) | cast(avg(t1.e) AS integer)+count(distinct e) | -count(*) from t1)) end-t1.b*f and t1.b | t1.b-b<=c then -t1.b+d when 11 in (select t1.e from t1 union select 11 from t1) then 13 else a end then b else c end FROM t1 WHERE case when ++c-13*d>t1.a and f=t1.d-t1.b then (select count(distinct 11)*(+cast(avg(t1.b) AS integer)+case cast(avg(e) AS integer) when max(d) | min(11) then min(f) else ( -min(t1.b)) end*(count(*)))* -min(19) from t1) else t1.e end*11 in (select a from t1 union select t1.e from t1) and e=17 or 11 not in ( -t1.d,f,t1.f)} -} {300} -do_test randexpr-2.2481 { - db eval {SELECT case f when case when +t1.a between a and case e when 17 then t1.e else f-t1.e+a-((select ++count(distinct d) | cast(avg(t1.e) AS integer)+count(distinct e) | -count(*) from t1)) end-t1.b*f and t1.b | t1.b-b<=c then -t1.b+d when 11 in (select t1.e from t1 union select 11 from t1) then 13 else a end then b else c end FROM t1 WHERE NOT (case when ++c-13*d>t1.a and f=t1.d-t1.b then (select count(distinct 11)*(+cast(avg(t1.b) AS integer)+case cast(avg(e) AS integer) when max(d) | min(11) then min(f) else ( -min(t1.b)) end*(count(*)))* -min(19) from t1) else t1.e end*11 in (select a from t1 union select t1.e from t1) and e=17 or 11 not in ( -t1.d,f,t1.f))} -} {} -do_test randexpr-2.2482 { - db eval {SELECT case f when case when +t1.a between a and case e when 17 then t1.e else f-t1.e+a-((select ++count(distinct d) & cast(avg(t1.e) AS integer)+count(distinct e) & -count(*) from t1)) end-t1.b*f and t1.b & t1.b-b<=c then -t1.b+d when 11 in (select t1.e from t1 union select 11 from t1) then 13 else a end then b else c end FROM t1 WHERE case when ++c-13*d>t1.a and f=t1.d-t1.b then (select count(distinct 11)*(+cast(avg(t1.b) AS integer)+case cast(avg(e) AS integer) when max(d) | min(11) then min(f) else ( -min(t1.b)) end*(count(*)))* -min(19) from t1) else t1.e end*11 in (select a from t1 union select t1.e from t1) and e=17 or 11 not in ( -t1.d,f,t1.f)} -} {300} -do_test randexpr-2.2483 { - db eval {SELECT -(19)-coalesce((select max(t1.e) from t1 where c not in (t1.b,17,t1.c)),case coalesce((select b+f+coalesce((select t1.a from t1 where t1.e>=t1.e+t1.a+t1.c or t1.f between c and t1.f),t1.e) from t1 where 11<>13 or t1.a=b),t1.c)*f+a when a then 17 else 17 end+t1.e)+a FROM t1 WHERE e | a not between -case when not c between case when exists(select 1 from t1 where (f not in (coalesce((select max(t1.d) from t1 where t1.e=t1.d),t1.e)+a,19,t1.c)) or not exists(select 1 from t1 where a in (19,a,e) and 11>=t1.f)) or 11<17 then t1.e+19*t1.f-b when t1.c in (e,t1.b,e) then f else t1.f end and t1.b or (11>=(t1.a)) then e when t1.a=t1.a then (select count(*) from t1) else e end and t1.b} -} {-436} -do_test randexpr-2.2484 { - db eval {SELECT -(19)-coalesce((select max(t1.e) from t1 where c not in (t1.b,17,t1.c)),case coalesce((select b+f+coalesce((select t1.a from t1 where t1.e>=t1.e+t1.a+t1.c or t1.f between c and t1.f),t1.e) from t1 where 11<>13 or t1.a=b),t1.c)*f+a when a then 17 else 17 end+t1.e)+a FROM t1 WHERE NOT (e | a not between -case when not c between case when exists(select 1 from t1 where (f not in (coalesce((select max(t1.d) from t1 where t1.e=t1.d),t1.e)+a,19,t1.c)) or not exists(select 1 from t1 where a in (19,a,e) and 11>=t1.f)) or 11<17 then t1.e+19*t1.f-b when t1.c in (e,t1.b,e) then f else t1.f end and t1.b or (11>=(t1.a)) then e when t1.a=t1.a then (select count(*) from t1) else e end and t1.b)} -} {} -do_test randexpr-2.2485 { - db eval {SELECT case (abs(case when 13 not in (t1.f,a,t1.b) then d*(abs((coalesce((select coalesce((select coalesce((select max(t1.d-t1.a) from t1 where (t1.c between 19 and (c) and c=17)),t1.f) from t1 where t1.e between e and 17),17))-b)/abs(d)) | b+t1.b when e between t1.f and d then 19 else 17 end*f)/abs(a)) when t1.c then 11 else t1.d end FROM t1 WHERE d>=e} -} {} -do_test randexpr-2.2486 { - db eval {SELECT case (abs(case when 13 not in (t1.f,a,t1.b) then d*(abs((coalesce((select coalesce((select coalesce((select max(t1.d-t1.a) from t1 where (t1.c between 19 and (c) and c=17)),t1.f) from t1 where t1.e between e and 17),17))-b)/abs(d)) | b+t1.b when e between t1.f and d then 19 else 17 end*f)/abs(a)) when t1.c then 11 else t1.d end FROM t1 WHERE NOT (d>=e)} -} {400} -do_test randexpr-2.2487 { - db eval {SELECT case (abs(case when 13 not in (t1.f,a,t1.b) then d*(abs((coalesce((select coalesce((select coalesce((select max(t1.d-t1.a) from t1 where (t1.c between 19 and (c) and c=17)),t1.f) from t1 where t1.e between e and 17),17))-b)/abs(d)) & b+t1.b when e between t1.f and d then 19 else 17 end*f)/abs(a)) when t1.c then 11 else t1.d end FROM t1 WHERE NOT (d>=e)} -} {400} -do_test randexpr-2.2488 { - db eval {SELECT case ((abs(case when case -(select count(distinct case when t1.d in (select t1.b from t1 union select t1.b from t1) then b when f not in (t1.a,b,a) then c else 17 end) | cast(avg(d) AS integer) | min(b) from t1) | +b-e when t1.e then f else a end not between 11 and 13 then f when 17>e and 17=t1.f) or d in ( -t1.c,f,t1.a) then -a else t1.f end)/abs(t1.b))) when 17 then t1.f else t1.f end FROM t1 WHERE t1.d=t1.b+case c-11+coalesce((select case when +(select +(case max(t1.e) when count(*) then (count(*)) else cast(avg(d) AS integer) end) from t1)-d between b and t1.d then 11 else f end from t1 where t1.f<=t1.c and exists(select 1 from t1 where exists(select 1 from t1 where e between t1.e and t1.e))),t1.b)-19 when t1.d then t1.f else (t1.f) end | e-c or t1.f not in (b, -f, -f)} -} {600} -do_test randexpr-2.2489 { - db eval {SELECT case ((abs(case when case -(select count(distinct case when t1.d in (select t1.b from t1 union select t1.b from t1) then b when f not in (t1.a,b,a) then c else 17 end) | cast(avg(d) AS integer) | min(b) from t1) | +b-e when t1.e then f else a end not between 11 and 13 then f when 17>e and 17=t1.f) or d in ( -t1.c,f,t1.a) then -a else t1.f end)/abs(t1.b))) when 17 then t1.f else t1.f end FROM t1 WHERE NOT (t1.d=t1.b+case c-11+coalesce((select case when +(select +(case max(t1.e) when count(*) then (count(*)) else cast(avg(d) AS integer) end) from t1)-d between b and t1.d then 11 else f end from t1 where t1.f<=t1.c and exists(select 1 from t1 where exists(select 1 from t1 where e between t1.e and t1.e))),t1.b)-19 when t1.d then t1.f else (t1.f) end | e-c or t1.f not in (b, -f, -f))} -} {} -do_test randexpr-2.2490 { - db eval {SELECT case ((abs(case when case -(select count(distinct case when t1.d in (select t1.b from t1 union select t1.b from t1) then b when f not in (t1.a,b,a) then c else 17 end) & cast(avg(d) AS integer) & min(b) from t1) & +b-e when t1.e then f else a end not between 11 and 13 then f when 17>e and 17=t1.f) or d in ( -t1.c,f,t1.a) then -a else t1.f end)/abs(t1.b))) when 17 then t1.f else t1.f end FROM t1 WHERE t1.d=t1.b+case c-11+coalesce((select case when +(select +(case max(t1.e) when count(*) then (count(*)) else cast(avg(d) AS integer) end) from t1)-d between b and t1.d then 11 else f end from t1 where t1.f<=t1.c and exists(select 1 from t1 where exists(select 1 from t1 where e between t1.e and t1.e))),t1.b)-19 when t1.d then t1.f else (t1.f) end | e-c or t1.f not in (b, -f, -f)} -} {600} -do_test randexpr-2.2491 { - db eval {SELECT coalesce((select max(11) from t1 where 17 not in (11,case when (case when t1.f>b then t1.d*t1.d else (abs((abs(19)/abs(coalesce((select 17*t1.e-t1.c from t1 where 17<13 and (t1.a in (select (min(17)) from t1 union select max(c) from t1) and -t1.d not in ((t1.b),d,a))), -17))))/abs(c))*13 end)<>(t1.f) then a when a=t1.a then 17 else -19 end-d,a)),e) FROM t1 WHERE 19<=case when not exists(select 1 from t1 where case when case when case when ((t1.a in (select +min(t1.c) from t1 union select max(t1.a) from t1))) or 19 between t1.d and b then +c | 11*f else d endb then c else t1.d end in (17,( -b),t1.c)) then t1.e when t1.f in (t1.a,13,d) then 17 else t1.f end*11*t1.d and a<=t1.d} -} {11} -do_test randexpr-2.2492 { - db eval {SELECT coalesce((select max(11) from t1 where 17 not in (11,case when (case when t1.f>b then t1.d*t1.d else (abs((abs(19)/abs(coalesce((select 17*t1.e-t1.c from t1 where 17<13 and (t1.a in (select (min(17)) from t1 union select max(c) from t1) and -t1.d not in ((t1.b),d,a))), -17))))/abs(c))*13 end)<>(t1.f) then a when a=t1.a then 17 else -19 end-d,a)),e) FROM t1 WHERE NOT (19<=case when not exists(select 1 from t1 where case when case when case when ((t1.a in (select +min(t1.c) from t1 union select max(t1.a) from t1))) or 19 between t1.d and b then +c | 11*f else d endb then c else t1.d end in (17,( -b),t1.c)) then t1.e when t1.f in (t1.a,13,d) then 17 else t1.f end*11*t1.d and a<=t1.d)} -} {} -do_test randexpr-2.2493 { - db eval {SELECT b*case when t1.f not in (a,f,t1.e-e) and t1.b in (select coalesce((select max(t1.e) from t1 where coalesce((select max(~d) from t1 where case when t1.b not in (t1.c,17, -c) then t1.f when t1.c>17 then 17 else e end>t1.f and t1.f not in (b,f,d)),17)>=t1.c or 19<=t1.e),t1.a) from t1 union select (e) from t1) then d when t1.c17 then 17 else e end>t1.f and t1.f not in (b,f,d)),17)>=t1.c or 19<=t1.e),t1.a) from t1 union select (e) from t1) then d when t1.cc and e in (select +max(17) from t1 union select count(*) from t1) then (abs( -c)/abs(a)) when b>=t1.f then t1.b else 11 end when t1.f then 17 else t1.d end*(c)+17 when e then c else t1.f end else -c end-t1.c-c-19+c+a not in (t1.a,13,e)} -} {-90801} -do_test randexpr-2.2496 { - db eval {SELECT +(select ~(~cast(avg(t1.c) AS integer)* -cast(avg(c) AS integer))-case min(t1.e) when case count(*)*~(count(*)-+count(*)*cast(avg(case t1.d when 19 then d else (t1.a) end*e) AS integer) | cast(avg(13) AS integer)-cast(avg( -11) AS integer)+max(b)+cast(avg(19) AS integer) | (max(t1.e))) | min(f) when -max(19) then (count(distinct -t1.a)) else (count(distinct 17)) end then max(t1.d) else cast(avg(t1.e) AS integer) end from t1) FROM t1 WHERE NOT (t1.c-case f when 17 | b then case +case f | case when +t1.a>c and e in (select +max(17) from t1 union select count(*) from t1) then (abs( -c)/abs(a)) when b>=t1.f then t1.b else 11 end when t1.f then 17 else t1.d end*(c)+17 when e then c else t1.f end else -c end-t1.c-c-19+c+a not in (t1.a,13,e))} -} {} -do_test randexpr-2.2497 { - db eval {SELECT +(select ~(~cast(avg(t1.c) AS integer)* -cast(avg(c) AS integer))-case min(t1.e) when case count(*)*~(count(*)-+count(*)*cast(avg(case t1.d when 19 then d else (t1.a) end*e) AS integer) & cast(avg(13) AS integer)-cast(avg( -11) AS integer)+max(b)+cast(avg(19) AS integer) & (max(t1.e))) & min(f) when -max(19) then (count(distinct -t1.a)) else (count(distinct 17)) end then max(t1.d) else cast(avg(t1.e) AS integer) end from t1) FROM t1 WHERE t1.c-case f when 17 | b then case +case f | case when +t1.a>c and e in (select +max(17) from t1 union select count(*) from t1) then (abs( -c)/abs(a)) when b>=t1.f then t1.b else 11 end when t1.f then 17 else t1.d end*(c)+17 when e then c else t1.f end else -c end-t1.c-c-19+c+a not in (t1.a,13,e)} -} {-90801} -do_test randexpr-2.2498 { - db eval {SELECT case t1.d when e then t1.d else (abs(e-b)/abs(t1.c+a*a | 17+19*coalesce((select 17 from t1 where 11 between +(select abs(+cast(avg(13) AS integer)) from t1)*19 and t1.e),t1.e-11-t1.e+( -t1.e*13)*t1.e | e*t1.b)*f)) end FROM t1 WHERE (abs(t1.d)/abs(t1.c)) not between +13 and t1.c} -} {0} -do_test randexpr-2.2499 { - db eval {SELECT case t1.d when e then t1.d else (abs(e-b)/abs(t1.c+a*a | 17+19*coalesce((select 17 from t1 where 11 between +(select abs(+cast(avg(13) AS integer)) from t1)*19 and t1.e),t1.e-11-t1.e+( -t1.e*13)*t1.e | e*t1.b)*f)) end FROM t1 WHERE NOT ((abs(t1.d)/abs(t1.c)) not between +13 and t1.c)} -} {} -do_test randexpr-2.2500 { - db eval {SELECT case t1.d when e then t1.d else (abs(e-b)/abs(t1.c+a*a & 17+19*coalesce((select 17 from t1 where 11 between +(select abs(+cast(avg(13) AS integer)) from t1)*19 and t1.e),t1.e-11-t1.e+( -t1.e*13)*t1.e & e*t1.b)*f)) end FROM t1 WHERE (abs(t1.d)/abs(t1.c)) not between +13 and t1.c} -} {18} -do_test randexpr-2.2501 { - db eval {SELECT coalesce((select coalesce((select t1.e from t1 where case when c+a in (select t1.f from t1 union select 13 from t1) then c when not not exists(select 1 from t1 where d>= -11) then t1.d else -t1.f end between b and 11 or d not between e and 11), -f)+e+ -11*17 from t1 where not exists(select 1 from t1 where exists(select 1 from t1 where t1.e in (select ~min(e) from t1 union select case case count(distinct f) | min(19)+min(a) when count(*) then max( -t1.c) else max(17) end when (max(t1.c)) then min(11) else min(t1.c) end from t1)) or d=a)),t1.e) FROM t1 WHERE +t1.e<~case when t1.e in (select (abs(c)/abs(~t1.d)) from t1 union select a from t1) then coalesce((select e from t1 where t1.d+ -coalesce((select max(11-t1.e*b) from t1 where 19 in (11,t1.b,e)),11)*t1.e+19 in (select t1.d from t1 union select -t1.d from t1)),17) | t1.e+e when t1.f in (17,f,f) then t1.b else 17 end*13} -} {} -do_test randexpr-2.2502 { - db eval {SELECT coalesce((select coalesce((select t1.e from t1 where case when c+a in (select t1.f from t1 union select 13 from t1) then c when not not exists(select 1 from t1 where d>= -11) then t1.d else -t1.f end between b and 11 or d not between e and 11), -f)+e+ -11*17 from t1 where not exists(select 1 from t1 where exists(select 1 from t1 where t1.e in (select ~min(e) from t1 union select case case count(distinct f) | min(19)+min(a) when count(*) then max( -t1.c) else max(17) end when (max(t1.c)) then min(11) else min(t1.c) end from t1)) or d=a)),t1.e) FROM t1 WHERE NOT (+t1.e<~case when t1.e in (select (abs(c)/abs(~t1.d)) from t1 union select a from t1) then coalesce((select e from t1 where t1.d+ -coalesce((select max(11-t1.e*b) from t1 where 19 in (11,t1.b,e)),11)*t1.e+19 in (select t1.d from t1 union select -t1.d from t1)),17) | t1.e+e when t1.f in (17,f,f) then t1.b else 17 end*13)} -} {813} -do_test randexpr-2.2503 { - db eval {SELECT coalesce((select coalesce((select t1.e from t1 where case when c+a in (select t1.f from t1 union select 13 from t1) then c when not not exists(select 1 from t1 where d>= -11) then t1.d else -t1.f end between b and 11 or d not between e and 11), -f)+e+ -11*17 from t1 where not exists(select 1 from t1 where exists(select 1 from t1 where t1.e in (select ~min(e) from t1 union select case case count(distinct f) & min(19)+min(a) when count(*) then max( -t1.c) else max(17) end when (max(t1.c)) then min(11) else min(t1.c) end from t1)) or d=a)),t1.e) FROM t1 WHERE NOT (+t1.e<~case when t1.e in (select (abs(c)/abs(~t1.d)) from t1 union select a from t1) then coalesce((select e from t1 where t1.d+ -coalesce((select max(11-t1.e*b) from t1 where 19 in (11,t1.b,e)),11)*t1.e+19 in (select t1.d from t1 union select -t1.d from t1)),17) | t1.e+e when t1.f in (17,f,f) then t1.b else 17 end*13)} -} {813} -do_test randexpr-2.2504 { - db eval {SELECT case when ((t1.f)+coalesce((select coalesce((select ++d from t1 where not t1.d not between e and e),19) from t1 where t1.d<>19),a)-c*a not between c and t1.a and not exists(select 1 from t1 where 17<=a) and exists(select 1 from t1 where not e in (select t1.b from t1 union select t1.e from t1)) and t1.f between 11 and t1.d) or e between c and 13 then t1.a+e when t1.a not between a and d then 17 else t1.a end FROM t1 WHERE (a)+t1.f>t1.e+a} -} {100} -do_test randexpr-2.2505 { - db eval {SELECT case when ((t1.f)+coalesce((select coalesce((select ++d from t1 where not t1.d not between e and e),19) from t1 where t1.d<>19),a)-c*a not between c and t1.a and not exists(select 1 from t1 where 17<=a) and exists(select 1 from t1 where not e in (select t1.b from t1 union select t1.e from t1)) and t1.f between 11 and t1.d) or e between c and 13 then t1.a+e when t1.a not between a and d then 17 else t1.a end FROM t1 WHERE NOT ((a)+t1.f>t1.e+a)} -} {} -do_test randexpr-2.2506 { - db eval {SELECT b*b+case d*d when t1.f then c else coalesce((select coalesce((select max(f) from t1 where (d=t1.b or case when e=11 then t1.a else f end<>t1.d and exists(select 1 from t1 where f not between t1.c and a))),(select count(distinct f) from t1)+case when t1.b between a and (19) and t1.e=a then 13 else 17 end) from t1 where d>=11),f)*t1.e end-11-a- -(11) FROM t1 WHERE (c<19)} -} {} -do_test randexpr-2.2507 { - db eval {SELECT b*b+case d*d when t1.f then c else coalesce((select coalesce((select max(f) from t1 where (d=t1.b or case when e=11 then t1.a else f end<>t1.d and exists(select 1 from t1 where f not between t1.c and a))),(select count(distinct f) from t1)+case when t1.b between a and (19) and t1.e=a then 13 else 17 end) from t1 where d>=11),f)*t1.e end-11-a- -(11) FROM t1 WHERE NOT ((c<19))} -} {339900} -do_test randexpr-2.2508 { - db eval {SELECT coalesce((select max(c) from t1 where ((d between t1.c and c)) and b not between t1.a and a or f+c in (d | +f*d*coalesce((select case when not -t1.c=a)),e)*f,b,11) or -19>=t1.c and t1.a in (b,t1.f,c)),13) FROM t1 WHERE t1.c in (select count(distinct t1.a)*max(d) | +case (~ -~+count(distinct 13)*min(19) | (max(e))+ -(count(*))) when count(distinct t1.a) then max(d) else count(*) end+min(t1.c) from t1 union select min(e) from t1) and 17=t1.c-t1.d or t1.c-d not in ( -c,(abs(case a when t1.a then 13 else e end+f)/abs(e)),t1.a)} -} {13} -do_test randexpr-2.2509 { - db eval {SELECT coalesce((select max(c) from t1 where ((d between t1.c and c)) and b not between t1.a and a or f+c in (d | +f*d*coalesce((select case when not -t1.c=a)),e)*f,b,11) or -19>=t1.c and t1.a in (b,t1.f,c)),13) FROM t1 WHERE NOT (t1.c in (select count(distinct t1.a)*max(d) | +case (~ -~+count(distinct 13)*min(19) | (max(e))+ -(count(*))) when count(distinct t1.a) then max(d) else count(*) end+min(t1.c) from t1 union select min(e) from t1) and 17=t1.c-t1.d or t1.c-d not in ( -c,(abs(case a when t1.a then 13 else e end+f)/abs(e)),t1.a))} -} {} -do_test randexpr-2.2510 { - db eval {SELECT coalesce((select max(c) from t1 where ((d between t1.c and c)) and b not between t1.a and a or f+c in (d & +f*d*coalesce((select case when not -t1.c=a)),e)*f,b,11) or -19>=t1.c and t1.a in (b,t1.f,c)),13) FROM t1 WHERE t1.c in (select count(distinct t1.a)*max(d) | +case (~ -~+count(distinct 13)*min(19) | (max(e))+ -(count(*))) when count(distinct t1.a) then max(d) else count(*) end+min(t1.c) from t1 union select min(e) from t1) and 17=t1.c-t1.d or t1.c-d not in ( -c,(abs(case a when t1.a then 13 else e end+f)/abs(e)),t1.a)} -} {13} -do_test randexpr-2.2511 { - db eval {SELECT case case when not (abs(t1.d)/abs(17))>=t1.a+((19))+ -e-b or 11 between t1.a and 11 then 13 when t1.f in (select case count(distinct t1.d) when abs( -+(cast(avg(t1.c) AS integer)))*count(distinct (t1.e)) then max(19) else case count(distinct t1.a) when cast(avg(19) AS integer) then count(*) else cast(avg((t1.a)) AS integer) end end from t1 union select max(13) from t1) then -t1.b else t1.f end when c then -c else b end FROM t1 WHERE not exists(select 1 from t1 where not exists(select 1 from t1 where 13>=f))} -} {} -do_test randexpr-2.2512 { - db eval {SELECT case case when not (abs(t1.d)/abs(17))>=t1.a+((19))+ -e-b or 11 between t1.a and 11 then 13 when t1.f in (select case count(distinct t1.d) when abs( -+(cast(avg(t1.c) AS integer)))*count(distinct (t1.e)) then max(19) else case count(distinct t1.a) when cast(avg(19) AS integer) then count(*) else cast(avg((t1.a)) AS integer) end end from t1 union select max(13) from t1) then -t1.b else t1.f end when c then -c else b end FROM t1 WHERE NOT (not exists(select 1 from t1 where not exists(select 1 from t1 where 13>=f)))} -} {200} -do_test randexpr-2.2513 { - db eval {SELECT 11-(abs( -(select ((count(*)-(abs( -min(~19)))+case min(case when not exists(select 1 from t1 where (exists(select 1 from t1 where 17>f) or t1.c>=a)) then d else 11 end) | abs(cast(avg(19) AS integer)) when (count(distinct t1.f*19))-+ -( -count(*)) then ((cast(avg(t1.d) AS integer))) else cast(avg(t1.a) AS integer) end*count(distinct t1.d))+cast(avg(c) AS integer))-max(17) from t1)-17)/abs(t1.f)) FROM t1 WHERE - - -f+d in (select 19 from t1 union select t1.b from t1) or ((abs(a)/abs( -11+case when t1.e>=( -f) | d then ~t1.a when coalesce((select t1.d from t1 where e not in (e-(d)+a,e,t1.b)),a)<>t1.b then a else -t1.c end)))<=t1.e and t1.e in (13,t1.a,t1.f)} -} {} -do_test randexpr-2.2514 { - db eval {SELECT 11-(abs( -(select ((count(*)-(abs( -min(~19)))+case min(case when not exists(select 1 from t1 where (exists(select 1 from t1 where 17>f) or t1.c>=a)) then d else 11 end) | abs(cast(avg(19) AS integer)) when (count(distinct t1.f*19))-+ -( -count(*)) then ((cast(avg(t1.d) AS integer))) else cast(avg(t1.a) AS integer) end*count(distinct t1.d))+cast(avg(c) AS integer))-max(17) from t1)-17)/abs(t1.f)) FROM t1 WHERE NOT ( - - -f+d in (select 19 from t1 union select t1.b from t1) or ((abs(a)/abs( -11+case when t1.e>=( -f) | d then ~t1.a when coalesce((select t1.d from t1 where e not in (e-(d)+a,e,t1.b)),a)<>t1.b then a else -t1.c end)))<=t1.e and t1.e in (13,t1.a,t1.f))} -} {11} -do_test randexpr-2.2515 { - db eval {SELECT 11-(abs( -(select ((count(*)-(abs( -min(~19)))+case min(case when not exists(select 1 from t1 where (exists(select 1 from t1 where 17>f) or t1.c>=a)) then d else 11 end) & abs(cast(avg(19) AS integer)) when (count(distinct t1.f*19))-+ -( -count(*)) then ((cast(avg(t1.d) AS integer))) else cast(avg(t1.a) AS integer) end*count(distinct t1.d))+cast(avg(c) AS integer))-max(17) from t1)-17)/abs(t1.f)) FROM t1 WHERE NOT ( - - -f+d in (select 19 from t1 union select t1.b from t1) or ((abs(a)/abs( -11+case when t1.e>=( -f) | d then ~t1.a when coalesce((select t1.d from t1 where e not in (e-(d)+a,e,t1.b)),a)<>t1.b then a else -t1.c end)))<=t1.e and t1.e in (13,t1.a,t1.f))} -} {11} -do_test randexpr-2.2516 { - db eval {SELECT coalesce((select ~11*b from t1 where (not exists(select 1 from t1 where case d when t1.b then t1.b else d end not between b and t1.b and f in (select ~count(*) from t1 union select count(distinct coalesce((select max( -c+(abs(coalesce((select max(t1.a) from t1 where not exists(select 1 from t1 where d>a)),t1.b)-17)/abs((b)))*(a)) from t1 where t1.f>b),f)) from t1) or t1.e not in ((d),c,c)))),c)*17+t1.c FROM t1 WHERE coalesce((select 17*case when exists(select 1 from t1 where coalesce((select t1.e from t1 where f<>e and e not between c and 11),d) in (select 11 from t1 union select c from t1)) then t1.b when t1.a between t1.f and 19 then t1.d else t1.c end*f | 19 from t1 where a between t1.c and b or t1.e in ((b),b,t1.f)),17) in (select ( -~case case (((count(*)))) when max(e) then max(e) else cast(avg(c) AS integer) end when min(17) then cast(avg(13) AS integer) else cast(avg(t1.b) AS integer) end+ -count(*)* -count(*))+min(d) from t1 union select count(distinct t1.e) from t1)} -} {} -do_test randexpr-2.2517 { - db eval {SELECT coalesce((select ~11*b from t1 where (not exists(select 1 from t1 where case d when t1.b then t1.b else d end not between b and t1.b and f in (select ~count(*) from t1 union select count(distinct coalesce((select max( -c+(abs(coalesce((select max(t1.a) from t1 where not exists(select 1 from t1 where d>a)),t1.b)-17)/abs((b)))*(a)) from t1 where t1.f>b),f)) from t1) or t1.e not in ((d),c,c)))),c)*17+t1.c FROM t1 WHERE NOT (coalesce((select 17*case when exists(select 1 from t1 where coalesce((select t1.e from t1 where f<>e and e not between c and 11),d) in (select 11 from t1 union select c from t1)) then t1.b when t1.a between t1.f and 19 then t1.d else t1.c end*f | 19 from t1 where a between t1.c and b or t1.e in ((b),b,t1.f)),17) in (select ( -~case case (((count(*)))) when max(e) then max(e) else cast(avg(c) AS integer) end when min(17) then cast(avg(13) AS integer) else cast(avg(t1.b) AS integer) end+ -count(*)* -count(*))+min(d) from t1 union select count(distinct t1.e) from t1))} -} {5400} -do_test randexpr-2.2518 { - db eval {SELECT (abs(case when not +c<>coalesce((select max(19) from t1 where not (abs(c)/abs(a))*a-t1.a>=case when (exists(select 1 from t1 where d=11)) then t1.a*~b else case when b in (select (f) from t1 union select 17 from t1) or not 17 not between f and -b then t1.a when fcoalesce((select max(19) from t1 where not (abs(c)/abs(a))*a-t1.a>=case when (exists(select 1 from t1 where d=11)) then t1.a*~b else case when b in (select (f) from t1 union select 17 from t1) or not 17 not between f and -b then t1.a when f=t1.b and (b not in (c,t1.e,t1.a))} -} {} -do_test randexpr-2.2521 { - db eval {SELECT ~case when case 11*17 when f then t1.a else t1.e end in ( -coalesce((select max(case coalesce((select t1.f from t1 where exists(select 1 from t1 where t1.c in (case t1.e when -d then c else (d) end,t1.e,t1.a))), -t1.c) when 19 then 11 else t1.e end) from t1 where t1.e in (19, -t1.b,a)),17)+f-11,17,19) then a when ((d=t1.b and (b not in (c,t1.e,t1.a)))} -} {499} -do_test randexpr-2.2522 { - db eval {SELECT (abs(case f when case when d+f between e and t1.f then f when coalesce((select max(t1.f) from t1 where c in (select t1.a from t1 union select case when a not between t1.c and 13 then a else t1.c end from t1) or f*f not in (case when (11<=d) then case when 13= -d),b)<=t1.b then t1.e else 13 end then f else t1.b end)/abs(f)) FROM t1 WHERE c between c and coalesce((select max(f) from t1 where b in (select count(*) from t1 union select max(13) from t1)),19)} -} {} -do_test randexpr-2.2523 { - db eval {SELECT (abs(case f when case when d+f between e and t1.f then f when coalesce((select max(t1.f) from t1 where c in (select t1.a from t1 union select case when a not between t1.c and 13 then a else t1.c end from t1) or f*f not in (case when (11<=d) then case when 13= -d),b)<=t1.b then t1.e else 13 end then f else t1.b end)/abs(f)) FROM t1 WHERE NOT (c between c and coalesce((select max(f) from t1 where b in (select count(*) from t1 union select max(13) from t1)),19))} -} {0} -do_test randexpr-2.2524 { - db eval {SELECT d++11*a+coalesce((select max(t1.a) from t1 where 17+case when (19>=a) then t1.b when f>=f then -(select cast(avg(t1.e-t1.f*t1.a) AS integer) from t1)-f else t1.f end*a+f*t1.a not in (t1.e,e,13)),17)- -t1.b-a-c*19 FROM t1 WHERE f*t1.a*t1.b>17 and case when 13 not in (19, -(select count(*) from t1),coalesce((select max(coalesce((select max(t1.a) from t1 where -coalesce((select max(case when not t1.f<=(t1.d) then t1.a else (a) end) from t1 where t1.f>c or 13<(t1.a)),17)>=t1.a or not exists(select 1 from t1 where - -c not in (a,t1.b,t1.e))),t1.e)) from t1 where (f not in (b,f,f))),c)) then (t1.e) when t1.a<>e then e else b end- -t1.f not in (a, -c,(c))} -} {-4000} -do_test randexpr-2.2525 { - db eval {SELECT d++11*a+coalesce((select max(t1.a) from t1 where 17+case when (19>=a) then t1.b when f>=f then -(select cast(avg(t1.e-t1.f*t1.a) AS integer) from t1)-f else t1.f end*a+f*t1.a not in (t1.e,e,13)),17)- -t1.b-a-c*19 FROM t1 WHERE NOT (f*t1.a*t1.b>17 and case when 13 not in (19, -(select count(*) from t1),coalesce((select max(coalesce((select max(t1.a) from t1 where -coalesce((select max(case when not t1.f<=(t1.d) then t1.a else (a) end) from t1 where t1.f>c or 13<(t1.a)),17)>=t1.a or not exists(select 1 from t1 where - -c not in (a,t1.b,t1.e))),t1.e)) from t1 where (f not in (b,f,f))),c)) then (t1.e) when t1.a<>e then e else b end- -t1.f not in (a, -c,(c)))} -} {} -do_test randexpr-2.2526 { - db eval {SELECT coalesce((select (a) from t1 where 11-11+t1.b<=17-b),case when case when not t1.e*f>= -t1.f and a in (11,t1.c,t1.b) or 19>e then (select case min((f)-f) when cast(avg(t1.a) AS integer) then (cast(avg(17) AS integer)) else ((cast(avg((13)) AS integer))) end from t1) when 13 not between f and t1.c then (abs(e)/abs(17)) else t1.e end | -17<=f then b when f<19 or t1.b<=t1.d then f else f end) FROM t1 WHERE -f | t1.f*c-t1.a | t1.c+11*case ~17 when -coalesce((select max(t1.e) from t1 where 13*(17)>=11),t1.a) then case case when (t1.b>= -t1.b) then t1.f when t1.fa and t1.e in (e,(t1.d),19) then t1.f else t1.c end when a then t1.a else t1.e end else a end*t1.a-13= -t1.f and a in (11,t1.c,t1.b) or 19>e then (select case min((f)-f) when cast(avg(t1.a) AS integer) then (cast(avg(17) AS integer)) else ((cast(avg((13)) AS integer))) end from t1) when 13 not between f and t1.c then (abs(e)/abs(17)) else t1.e end | -17<=f then b when f<19 or t1.b<=t1.d then f else f end) FROM t1 WHERE NOT ( -f | t1.f*c-t1.a | t1.c+11*case ~17 when -coalesce((select max(t1.e) from t1 where 13*(17)>=11),t1.a) then case case when (t1.b>= -t1.b) then t1.f when t1.fa and t1.e in (e,(t1.d),19) then t1.f else t1.c end when a then t1.a else t1.e end else a end*t1.a-13= -t1.f and a in (11,t1.c,t1.b) or 19>e then (select case min((f)-f) when cast(avg(t1.a) AS integer) then (cast(avg(17) AS integer)) else ((cast(avg((13)) AS integer))) end from t1) when 13 not between f and t1.c then (abs(e)/abs(17)) else t1.e end & -17<=f then b when f<19 or t1.b<=t1.d then f else f end) FROM t1 WHERE -f | t1.f*c-t1.a | t1.c+11*case ~17 when -coalesce((select max(t1.e) from t1 where 13*(17)>=11),t1.a) then case case when (t1.b>= -t1.b) then t1.f when t1.fa and t1.e in (e,(t1.d),19) then t1.f else t1.c end when a then t1.a else t1.e end else a end*t1.a-13a then 11 else e end*11 and t1.e) then t1.e when -17<11 then 17 else t1.a end)/abs(a)) FROM t1 WHERE c<=19} -} {} -do_test randexpr-2.2530 { - db eval {SELECT (abs(case when exists(select 1 from t1 where b not between ~case when (t1.e-(c-t1.c) | t1.a) in (select abs(~((min(t1.f) | cast(avg(c) AS integer))*(min(b))-count(distinct 19)*min(e)) | -((count(*))))-cast(avg(d) AS integer) from t1 union select -count(distinct t1.a) from t1) or f>a then 11 else e end*11 and t1.e) then t1.e when -17<11 then 17 else t1.a end)/abs(a)) FROM t1 WHERE NOT (c<=19)} -} {0} -do_test randexpr-2.2531 { - db eval {SELECT (abs(case when exists(select 1 from t1 where b not between ~case when (t1.e-(c-t1.c) & t1.a) in (select abs(~((min(t1.f) & cast(avg(c) AS integer))*(min(b))-count(distinct 19)*min(e)) & -((count(*))))-cast(avg(d) AS integer) from t1 union select -count(distinct t1.a) from t1) or f>a then 11 else e end*11 and t1.e) then t1.e when -17<11 then 17 else t1.a end)/abs(a)) FROM t1 WHERE NOT (c<=19)} -} {0} -do_test randexpr-2.2532 { - db eval {SELECT case when t1.e-19 in (case (abs(t1.a*+~c*coalesce((select c from t1 where ~ -(select abs(case cast(avg(13) AS integer) when - -cast(avg(f) AS integer) then count(distinct t1.d) else (count(*)) end+count(*)) from t1) not between (abs(a | t1.a)/abs(t1.c)) and 19),t1.b)-c*17*(t1.f))/abs(d)) when 13 then 19 else t1.b end,(b),17) then 19 when (11)>=t1.b then b else b end*11 FROM t1 WHERE (case 11 when case t1.e when coalesce((select a from t1 where t1.a=t1.a),t1.f),d,13) then c when 11 between t1.b and 17 then d else 19 end) then f else 19 end then t1.d else c end< -c) and a not in (11,c,11) or 11<>e or exists(select 1 from t1 where b<17)} -} {2200} -do_test randexpr-2.2533 { - db eval {SELECT case when t1.e-19 in (case (abs(t1.a*+~c*coalesce((select c from t1 where ~ -(select abs(case cast(avg(13) AS integer) when - -cast(avg(f) AS integer) then count(distinct t1.d) else (count(*)) end+count(*)) from t1) not between (abs(a | t1.a)/abs(t1.c)) and 19),t1.b)-c*17*(t1.f))/abs(d)) when 13 then 19 else t1.b end,(b),17) then 19 when (11)>=t1.b then b else b end*11 FROM t1 WHERE NOT ((case 11 when case t1.e when coalesce((select a from t1 where t1.a=t1.a),t1.f),d,13) then c when 11 between t1.b and 17 then d else 19 end) then f else 19 end then t1.d else c end< -c) and a not in (11,c,11) or 11<>e or exists(select 1 from t1 where b<17))} -} {} -do_test randexpr-2.2534 { - db eval {SELECT case when t1.e-19 in (case (abs(t1.a*+~c*coalesce((select c from t1 where ~ -(select abs(case cast(avg(13) AS integer) when - -cast(avg(f) AS integer) then count(distinct t1.d) else (count(*)) end+count(*)) from t1) not between (abs(a & t1.a)/abs(t1.c)) and 19),t1.b)-c*17*(t1.f))/abs(d)) when 13 then 19 else t1.b end,(b),17) then 19 when (11)>=t1.b then b else b end*11 FROM t1 WHERE (case 11 when case t1.e when coalesce((select a from t1 where t1.a=t1.a),t1.f),d,13) then c when 11 between t1.b and 17 then d else 19 end) then f else 19 end then t1.d else c end< -c) and a not in (11,c,11) or 11<>e or exists(select 1 from t1 where b<17)} -} {2200} -do_test randexpr-2.2535 { - db eval {SELECT t1.b*case when (abs(t1.c+case when d not in (a,case when b=(t1.a) then (e) when b not between f and t1.c then t1.b else t1.e end, -11) then t1.d when not exists(select 1 from t1 where 19 not between (a) and a or t1.c>d) then d else b end+t1.a+13-19+d)/abs(t1.d))> -t1.f then t1.a when t1.d in (select d from t1 union select c from t1) or 13 not between d and t1.f then t1.b else e end+ - -a FROM t1 WHERE t1.f<=11} -} {} -do_test randexpr-2.2536 { - db eval {SELECT t1.b*case when (abs(t1.c+case when d not in (a,case when b=(t1.a) then (e) when b not between f and t1.c then t1.b else t1.e end, -11) then t1.d when not exists(select 1 from t1 where 19 not between (a) and a or t1.c>d) then d else b end+t1.a+13-19+d)/abs(t1.d))> -t1.f then t1.a when t1.d in (select d from t1 union select c from t1) or 13 not between d and t1.f then t1.b else e end+ - -a FROM t1 WHERE NOT (t1.f<=11)} -} {20100} -do_test randexpr-2.2537 { - db eval {SELECT coalesce((select max(coalesce((select e+t1.c from t1 where f*11+coalesce((select max(17) from t1 where not ~case a when t1.f+13*e-(11)*t1.f then d else a end>d and (a not between t1.c and t1.c)),t1.d)- -f-b+11=b),19)-t1.f) from t1 where exists(select 1 from t1 where 19<>11)),c) FROM t1 WHERE case when 11 in (select -abs(abs( - -(cast(avg(+11-c) AS integer)+cast(avg(~a) AS integer))*max(11))+cast(avg(d) AS integer)-cast(avg(e) AS integer)-((max(t1.e))))+count(*) from t1 union select ( -count(*)) from t1) then t1.a when e>d then c- - -t1.a else 19 end in (select count(distinct -f) from t1 union select count(distinct d) from t1) and not e<17} -} {} -do_test randexpr-2.2538 { - db eval {SELECT coalesce((select max(coalesce((select e+t1.c from t1 where f*11+coalesce((select max(17) from t1 where not ~case a when t1.f+13*e-(11)*t1.f then d else a end>d and (a not between t1.c and t1.c)),t1.d)- -f-b+11=b),19)-t1.f) from t1 where exists(select 1 from t1 where 19<>11)),c) FROM t1 WHERE NOT (case when 11 in (select -abs(abs( - -(cast(avg(+11-c) AS integer)+cast(avg(~a) AS integer))*max(11))+cast(avg(d) AS integer)-cast(avg(e) AS integer)-((max(t1.e))))+count(*) from t1 union select ( -count(*)) from t1) then t1.a when e>d then c- - -t1.a else 19 end in (select count(distinct -f) from t1 union select count(distinct d) from t1) and not e<17)} -} {-581} -do_test randexpr-2.2539 { - db eval {SELECT case when (coalesce((select max(a*case when 17+f>f-t1.d*t1.f then t1.d when t1.c not between t1.e and d then 19 else (c) end) from t1 where not t1.d not between - -17 and 19),t1.a) in (select min((13)) from t1 union select ~(abs(count(distinct t1.a))*((( -max( -t1.f)))+max( -t1.c) | count(*)))-cast(avg(11) AS integer) from t1)) then c- - -d when t1.d>=d then d else 13 end FROM t1 WHERE ((abs(t1.a-t1.a*t1.d*coalesce((select coalesce((select max(11) from t1 where exists(select 1 from t1 where 11+t1.d | -t1.c-case when b+d in (select count(*) from t1 union select max(17)+ -count(distinct t1.d) from t1) then t1.c else d end-a | 13<>c)),t1.c) from t1 where 13 not in (d,t1.a,f) and 19=t1.f),(13))+(t1.d))/abs(t1.c)) between t1.f and t1.d)} -} {} -do_test randexpr-2.2540 { - db eval {SELECT case when (coalesce((select max(a*case when 17+f>f-t1.d*t1.f then t1.d when t1.c not between t1.e and d then 19 else (c) end) from t1 where not t1.d not between - -17 and 19),t1.a) in (select min((13)) from t1 union select ~(abs(count(distinct t1.a))*((( -max( -t1.f)))+max( -t1.c) | count(*)))-cast(avg(11) AS integer) from t1)) then c- - -d when t1.d>=d then d else 13 end FROM t1 WHERE NOT (((abs(t1.a-t1.a*t1.d*coalesce((select coalesce((select max(11) from t1 where exists(select 1 from t1 where 11+t1.d | -t1.c-case when b+d in (select count(*) from t1 union select max(17)+ -count(distinct t1.d) from t1) then t1.c else d end-a | 13<>c)),t1.c) from t1 where 13 not in (d,t1.a,f) and 19=t1.f),(13))+(t1.d))/abs(t1.c)) between t1.f and t1.d))} -} {400} -do_test randexpr-2.2541 { - db eval {SELECT case when (coalesce((select max(a*case when 17+f>f-t1.d*t1.f then t1.d when t1.c not between t1.e and d then 19 else (c) end) from t1 where not t1.d not between - -17 and 19),t1.a) in (select min((13)) from t1 union select ~(abs(count(distinct t1.a))*((( -max( -t1.f)))+max( -t1.c) & count(*)))-cast(avg(11) AS integer) from t1)) then c- - -d when t1.d>=d then d else 13 end FROM t1 WHERE NOT (((abs(t1.a-t1.a*t1.d*coalesce((select coalesce((select max(11) from t1 where exists(select 1 from t1 where 11+t1.d | -t1.c-case when b+d in (select count(*) from t1 union select max(17)+ -count(distinct t1.d) from t1) then t1.c else d end-a | 13<>c)),t1.c) from t1 where 13 not in (d,t1.a,f) and 19=t1.f),(13))+(t1.d))/abs(t1.c)) between t1.f and t1.d))} -} {400} -do_test randexpr-2.2542 { - db eval {SELECT case when f | c>t1.d-case when (abs(t1.b-t1.d*f)/abs(c))=t1.e then 17 when not exists(select 1 from t1 where t1.b=(11) or c not in (13,17,b)) or aa then t1.c when not 11<(f) then case when t1.c= -b then c else 11 end else e end | f>=t1.b and b not between -(t1.e) and f) then 17 when f in (select -count(distinct t1.e) from t1 union select case min(f) when case cast(avg( -t1.b) AS integer) when cast(avg(e) AS integer) then -max(e) else min(t1.b) end then count(*) else (cast(avg(t1.e) AS integer)) end from t1) then case c when e then t1.f else 13 end else t1.d end} -} {} -do_test randexpr-2.2543 { - db eval {SELECT case when f | c>t1.d-case when (abs(t1.b-t1.d*f)/abs(c))=t1.e then 17 when not exists(select 1 from t1 where t1.b=(11) or c not in (13,17,b)) or aa then t1.c when not 11<(f) then case when t1.c= -b then c else 11 end else e end | f>=t1.b and b not between -(t1.e) and f) then 17 when f in (select -count(distinct t1.e) from t1 union select case min(f) when case cast(avg( -t1.b) AS integer) when cast(avg(e) AS integer) then -max(e) else min(t1.b) end then count(*) else (cast(avg(t1.e) AS integer)) end from t1) then case c when e then t1.f else 13 end else t1.d end)} -} {11} -do_test randexpr-2.2544 { - db eval {SELECT case when f & c>t1.d-case when (abs(t1.b-t1.d*f)/abs(c))=t1.e then 17 when not exists(select 1 from t1 where t1.b=(11) or c not in (13,17,b)) or aa then t1.c when not 11<(f) then case when t1.c= -b then c else 11 end else e end | f>=t1.b and b not between -(t1.e) and f) then 17 when f in (select -count(distinct t1.e) from t1 union select case min(f) when case cast(avg( -t1.b) AS integer) when cast(avg(e) AS integer) then -max(e) else min(t1.b) end then count(*) else (cast(avg(t1.e) AS integer)) end from t1) then case c when e then t1.f else 13 end else t1.d end)} -} {11} -do_test randexpr-2.2545 { - db eval {SELECT 17+coalesce((select max(19) from t1 where 11 in (select (abs((abs(~(case +b+17 when t1.e*t1.b then 17 else case when t1.b+17+d*a in (select (~count(distinct a)) from t1 union select case cast(avg(t1.e) AS integer) when count(*) then count(distinct t1.d) else count(distinct b) end from t1) then t1.f when (t1.e in ( -t1.a,t1.e,d)) then 17 else t1.e end | e end)- -b)/abs(t1.f)))/abs(13)) from t1 union select t1.d from t1)),17) FROM t1 WHERE e+t1.b not in (d,a,t1.c) and case case e when (case when +case 13 when t1.a then 19 else 19 end+d in (select count(*)-min(b) from t1 union select - -min(t1.d) from t1) or f in (select ( -min(t1.e)) from t1 union select cast(avg( -19) AS integer) from t1) or (t1.f in (select -max( -t1.c) from t1 union select (min(t1.c)) from t1)) then b else +t1.b end)-t1.b then b else 19 end when a then b else e end between ( -(t1.c)) and a} -} {} -do_test randexpr-2.2546 { - db eval {SELECT 17+coalesce((select max(19) from t1 where 11 in (select (abs((abs(~(case +b+17 when t1.e*t1.b then 17 else case when t1.b+17+d*a in (select (~count(distinct a)) from t1 union select case cast(avg(t1.e) AS integer) when count(*) then count(distinct t1.d) else count(distinct b) end from t1) then t1.f when (t1.e in ( -t1.a,t1.e,d)) then 17 else t1.e end | e end)- -b)/abs(t1.f)))/abs(13)) from t1 union select t1.d from t1)),17) FROM t1 WHERE NOT (e+t1.b not in (d,a,t1.c) and case case e when (case when +case 13 when t1.a then 19 else 19 end+d in (select count(*)-min(b) from t1 union select - -min(t1.d) from t1) or f in (select ( -min(t1.e)) from t1 union select cast(avg( -19) AS integer) from t1) or (t1.f in (select -max( -t1.c) from t1 union select (min(t1.c)) from t1)) then b else +t1.b end)-t1.b then b else 19 end when a then b else e end between ( -(t1.c)) and a)} -} {34} -do_test randexpr-2.2547 { - db eval {SELECT 17+coalesce((select max(19) from t1 where 11 in (select (abs((abs(~(case +b+17 when t1.e*t1.b then 17 else case when t1.b+17+d*a in (select (~count(distinct a)) from t1 union select case cast(avg(t1.e) AS integer) when count(*) then count(distinct t1.d) else count(distinct b) end from t1) then t1.f when (t1.e in ( -t1.a,t1.e,d)) then 17 else t1.e end & e end)- -b)/abs(t1.f)))/abs(13)) from t1 union select t1.d from t1)),17) FROM t1 WHERE NOT (e+t1.b not in (d,a,t1.c) and case case e when (case when +case 13 when t1.a then 19 else 19 end+d in (select count(*)-min(b) from t1 union select - -min(t1.d) from t1) or f in (select ( -min(t1.e)) from t1 union select cast(avg( -19) AS integer) from t1) or (t1.f in (select -max( -t1.c) from t1 union select (min(t1.c)) from t1)) then b else +t1.b end)-t1.b then b else 19 end when a then b else e end between ( -(t1.c)) and a)} -} {34} -do_test randexpr-2.2548 { - db eval {SELECT (abs(~(abs((select ~count(*) | +(max( -coalesce((select max(13) from t1 where coalesce((select max(t1.d) from t1 where 11<+coalesce((select max((case when 19=t1.a then (d) else 19 end)) from t1 where (11) in (17,c,b)),c)*t1.e),t1.c)<13),11)*b | t1.c+17)) from t1))/abs(~b-f))-t1.d*a)/abs(e)) FROM t1 WHERE c not in (coalesce((select t1.a from t1 where -(t1.a+17*~case when coalesce((select max(t1.c) from t1 where (coalesce((select max(t1.f) from t1 where not exists(select 1 from t1 where a<=t1.a)),11) in (select (count(distinct t1.d)+count(distinct c)) from t1 union select count(distinct e) from t1))),13)*f=d then d when t1.d in (select t1.d from t1 union select t1.f from t1) then d else t1.f end+c*c | f)+t1.c*t1.a in (select 17 from t1 union select 13 from t1)),t1.f),17,t1.f)} -} {80} -do_test randexpr-2.2549 { - db eval {SELECT (abs(~(abs((select ~count(*) | +(max( -coalesce((select max(13) from t1 where coalesce((select max(t1.d) from t1 where 11<+coalesce((select max((case when 19=t1.a then (d) else 19 end)) from t1 where (11) in (17,c,b)),c)*t1.e),t1.c)<13),11)*b | t1.c+17)) from t1))/abs(~b-f))-t1.d*a)/abs(e)) FROM t1 WHERE NOT (c not in (coalesce((select t1.a from t1 where -(t1.a+17*~case when coalesce((select max(t1.c) from t1 where (coalesce((select max(t1.f) from t1 where not exists(select 1 from t1 where a<=t1.a)),11) in (select (count(distinct t1.d)+count(distinct c)) from t1 union select count(distinct e) from t1))),13)*f=d then d when t1.d in (select t1.d from t1 union select t1.f from t1) then d else t1.f end+c*c | f)+t1.c*t1.a in (select 17 from t1 union select 13 from t1)),t1.f),17,t1.f))} -} {} -do_test randexpr-2.2550 { - db eval {SELECT (abs(~(abs((select ~count(*) & +(max( -coalesce((select max(13) from t1 where coalesce((select max(t1.d) from t1 where 11<+coalesce((select max((case when 19=t1.a then (d) else 19 end)) from t1 where (11) in (17,c,b)),c)*t1.e),t1.c)<13),11)*b & t1.c+17)) from t1))/abs(~b-f))-t1.d*a)/abs(e)) FROM t1 WHERE c not in (coalesce((select t1.a from t1 where -(t1.a+17*~case when coalesce((select max(t1.c) from t1 where (coalesce((select max(t1.f) from t1 where not exists(select 1 from t1 where a<=t1.a)),11) in (select (count(distinct t1.d)+count(distinct c)) from t1 union select count(distinct e) from t1))),13)*f=d then d when t1.d in (select t1.d from t1 union select t1.f from t1) then d else t1.f end+c*c | f)+t1.c*t1.a in (select 17 from t1 union select 13 from t1)),t1.f),17,t1.f)} -} {80} -do_test randexpr-2.2551 { - db eval {SELECT case (19) when t1.a then t1.f+coalesce((select max(t1.f) from t1 where case when t1.c=t1.a or (t1.d | case when t1.f=t1.d then a else coalesce((select max(case when 11>=a then t1.b else d end+t1.a) from t1 where -t1.a not between t1.e and 19),11) end<>t1.d) then t1.e else c end-t1.f*b+f=19),t1.b) | (t1.a)+e else a end FROM t1 WHERE (case e when d then +(select (min(t1.a)) from t1) else case when a in ((select min(case -t1.c when d then d else f end+ -e)-+cast(avg(19) AS integer)+max(d) from t1)*t1.d | -t1.c,b,e) then t1.d when t1.b in (select +min(e) | min(t1.b) from t1 union select -count(distinct e) from t1) then d else 11 end*13-(e) end not in (t1.c,c,17))} -} {100} -do_test randexpr-2.2552 { - db eval {SELECT case (19) when t1.a then t1.f+coalesce((select max(t1.f) from t1 where case when t1.c=t1.a or (t1.d | case when t1.f=t1.d then a else coalesce((select max(case when 11>=a then t1.b else d end+t1.a) from t1 where -t1.a not between t1.e and 19),11) end<>t1.d) then t1.e else c end-t1.f*b+f=19),t1.b) | (t1.a)+e else a end FROM t1 WHERE NOT ((case e when d then +(select (min(t1.a)) from t1) else case when a in ((select min(case -t1.c when d then d else f end+ -e)-+cast(avg(19) AS integer)+max(d) from t1)*t1.d | -t1.c,b,e) then t1.d when t1.b in (select +min(e) | min(t1.b) from t1 union select -count(distinct e) from t1) then d else 11 end*13-(e) end not in (t1.c,c,17)))} -} {} -do_test randexpr-2.2553 { - db eval {SELECT case (19) when t1.a then t1.f+coalesce((select max(t1.f) from t1 where case when t1.c=t1.a or (t1.d & case when t1.f=t1.d then a else coalesce((select max(case when 11>=a then t1.b else d end+t1.a) from t1 where -t1.a not between t1.e and 19),11) end<>t1.d) then t1.e else c end-t1.f*b+f=19),t1.b) & (t1.a)+e else a end FROM t1 WHERE (case e when d then +(select (min(t1.a)) from t1) else case when a in ((select min(case -t1.c when d then d else f end+ -e)-+cast(avg(19) AS integer)+max(d) from t1)*t1.d | -t1.c,b,e) then t1.d when t1.b in (select +min(e) | min(t1.b) from t1 union select -count(distinct e) from t1) then d else 11 end*13-(e) end not in (t1.c,c,17))} -} {100} -do_test randexpr-2.2554 { - db eval {SELECT (abs(( -case when 11*coalesce((select coalesce((select d from t1 where ((+t1.f*(select max(t1.f)*min(t1.a) from t1)*d*t1.f between 11 and 13))), -t1.c) from t1 where ((e)>=t1.b) or not t1.a in (select f from t1 union select c from t1) and 11<=a or c between (t1.c) and t1.d),t1.f)t1.f} -} {} -do_test randexpr-2.2555 { - db eval {SELECT (abs(( -case when 11*coalesce((select coalesce((select d from t1 where ((+t1.f*(select max(t1.f)*min(t1.a) from t1)*d*t1.f between 11 and 13))), -t1.c) from t1 where ((e)>=t1.b) or not t1.a in (select f from t1 union select c from t1) and 11<=a or c between (t1.c) and t1.d),t1.f)t1.f)} -} {53} -do_test randexpr-2.2556 { - db eval {SELECT case (t1.b) | t1.d-+t1.e*(select (~count(*) | min(c)-case max(case when e | b in (select t1.b from t1 union select t1.b from t1) then d when 17 between 13 and t1.d then d else t1.c end) when abs(count(distinct (t1.e)))- -min(t1.e) then cast(avg(17) AS integer) else count(distinct c) end) from t1) | b-a-+f-t1.f when +a then t1.d else d end FROM t1 WHERE (17>t1.d) and coalesce((select max((t1.a)+coalesce((select max(17*b) from t1 where t1.d-coalesce((select t1.e from t1 where t1.b<>13 or 19=t1.a),t1.d)*f<=(19) or (t1.c<11 and not not dt1.d or d=11} -} {} -do_test randexpr-2.2557 { - db eval {SELECT case (t1.b) | t1.d-+t1.e*(select (~count(*) | min(c)-case max(case when e | b in (select t1.b from t1 union select t1.b from t1) then d when 17 between 13 and t1.d then d else t1.c end) when abs(count(distinct (t1.e)))- -min(t1.e) then cast(avg(17) AS integer) else count(distinct c) end) from t1) | b-a-+f-t1.f when +a then t1.d else d end FROM t1 WHERE NOT ((17>t1.d) and coalesce((select max((t1.a)+coalesce((select max(17*b) from t1 where t1.d-coalesce((select t1.e from t1 where t1.b<>13 or 19=t1.a),t1.d)*f<=(19) or (t1.c<11 and not not dt1.d or d=11)} -} {400} -do_test randexpr-2.2558 { - db eval {SELECT case (t1.b) & t1.d-+t1.e*(select (~count(*) & min(c)-case max(case when e & b in (select t1.b from t1 union select t1.b from t1) then d when 17 between 13 and t1.d then d else t1.c end) when abs(count(distinct (t1.e)))- -min(t1.e) then cast(avg(17) AS integer) else count(distinct c) end) from t1) & b-a-+f-t1.f when +a then t1.d else d end FROM t1 WHERE NOT ((17>t1.d) and coalesce((select max((t1.a)+coalesce((select max(17*b) from t1 where t1.d-coalesce((select t1.e from t1 where t1.b<>13 or 19=t1.a),t1.d)*f<=(19) or (t1.c<11 and not not dt1.d or d=11)} -} {400} -do_test randexpr-2.2559 { - db eval {SELECT case when case when coalesce((select max(c*case (select min(case when f in (select t1.e from t1 union select f+case when d<=d then t1.f when b<=11 then t1.c else t1.b end*11 from t1) then f else c end) from t1) when f then 11 else b end) from t1 where d in (t1.b,t1.a,c)),d) between (d) and 19 then -a else a end in ( -c,t1.d,t1.d) then c when e<> -d then a else t1.c end FROM t1 WHERE a=c or case when e=(e)),t1.a) then c | t1.f when exists(select 1 from t1 where a not between 19 and e) then t1.a else 17 end>t1.d} -} {} -do_test randexpr-2.2560 { - db eval {SELECT case when case when coalesce((select max(c*case (select min(case when f in (select t1.e from t1 union select f+case when d<=d then t1.f when b<=11 then t1.c else t1.b end*11 from t1) then f else c end) from t1) when f then 11 else b end) from t1 where d in (t1.b,t1.a,c)),d) between (d) and 19 then -a else a end in ( -c,t1.d,t1.d) then c when e<> -d then a else t1.c end FROM t1 WHERE NOT (a=c or case when e=(e)),t1.a) then c | t1.f when exists(select 1 from t1 where a not between 19 and e) then t1.a else 17 end>t1.d)} -} {100} -do_test randexpr-2.2561 { - db eval {SELECT 13+(select -abs(+cast(avg((select cast(avg(t1.e*(t1.c)- -(abs(b+e)/abs(f))) AS integer) from t1)) AS integer)-~ -+abs(abs(count(*))) | min(t1.e | t1.e-t1.b)*max(e)-max(t1.f) | min(c)*min(t1.b)+min(t1.e)-count(distinct 11) | min(b)*( - -count(distinct 19)))-count(*) from t1) FROM t1 WHERE d in (select count(*) from t1 union select case count(*) when max(17) | -max(coalesce((select case t1.d*t1.e when t1.a then 11 else 13 end*f- -f from t1 where b in (select case ~abs(max(13)) when case ((max(c))) when cast(avg(t1.c) AS integer) then max(13) else count(distinct t1.d) end then cast(avg(t1.a) AS integer) else cast(avg(11) AS integer) end from t1 union select -max(13) from t1)),13))*cast(avg(f) AS integer) then count(*) else count(distinct e) end from t1) and exists(select 1 from t1 where case d when -(abs(17)/abs(t1.f)) then t1.a else t1.d end=19} -} {17017} -do_test randexpr-2.2565 { - db eval {SELECT c+c*(abs(t1.c+coalesce((select case when 17 not in (t1.f,t1.e,t1.d) or (17=19)} -} {} -do_test randexpr-2.2566 { - db eval {SELECT +case when not c in (select count(distinct t1.b) from t1 union select -+(cast(avg(b*t1.b) AS integer))*max(case 17 when b then 13 else t1.a end)-count(distinct a) | cast(avg(t1.f) AS integer)+max(t1.d) from t1) then t1.e when a<=case t1.a when (e) then t1.d else d end then d else t1.b end*11-a | 17 | t1.a-f FROM t1 WHERE (c not in (t1.b,(select case case ++(min(19))*(count(distinct t1.a))+count(distinct e) | cast(avg(t1.e) AS integer) when min( -t1.d) then cast(avg(13) AS integer) else min(17) end*cast(avg(a) AS integer) when count(distinct -b) then cast(avg(11) AS integer) else - -(cast(avg(c) AS integer)) end from t1)-11+t1.e,t1.a) or d*case d when a then t1.c else 17 end*19 not between b and t1.c or -17=b or f in (select a from t1 union select -b from t1))} -} {-227} -do_test randexpr-2.2567 { - db eval {SELECT +case when not c in (select count(distinct t1.b) from t1 union select -+(cast(avg(b*t1.b) AS integer))*max(case 17 when b then 13 else t1.a end)-count(distinct a) | cast(avg(t1.f) AS integer)+max(t1.d) from t1) then t1.e when a<=case t1.a when (e) then t1.d else d end then d else t1.b end*11-a | 17 | t1.a-f FROM t1 WHERE NOT ((c not in (t1.b,(select case case ++(min(19))*(count(distinct t1.a))+count(distinct e) | cast(avg(t1.e) AS integer) when min( -t1.d) then cast(avg(13) AS integer) else min(17) end*cast(avg(a) AS integer) when count(distinct -b) then cast(avg(11) AS integer) else - -(cast(avg(c) AS integer)) end from t1)-11+t1.e,t1.a) or d*case d when a then t1.c else 17 end*19 not between b and t1.c or -17=b or f in (select a from t1 union select -b from t1)))} -} {} -do_test randexpr-2.2568 { - db eval {SELECT +case when not c in (select count(distinct t1.b) from t1 union select -+(cast(avg(b*t1.b) AS integer))*max(case 17 when b then 13 else t1.a end)-count(distinct a) & cast(avg(t1.f) AS integer)+max(t1.d) from t1) then t1.e when a<=case t1.a when (e) then t1.d else d end then d else t1.b end*11-a & 17 & t1.a-f FROM t1 WHERE (c not in (t1.b,(select case case ++(min(19))*(count(distinct t1.a))+count(distinct e) | cast(avg(t1.e) AS integer) when min( -t1.d) then cast(avg(13) AS integer) else min(17) end*cast(avg(a) AS integer) when count(distinct -b) then cast(avg(11) AS integer) else - -(cast(avg(c) AS integer)) end from t1)-11+t1.e,t1.a) or d*case d when a then t1.c else 17 end*19 not between b and t1.c or -17=b or f in (select a from t1 union select -b from t1))} -} {0} -do_test randexpr-2.2569 { - db eval {SELECT coalesce((select (abs(f)/abs(coalesce((select max(19*b+d*coalesce((select max(t1.c) from t1 where case when d>=(abs((11))/abs(t1.a*13+(13)-d*e+11)) then t1.c when t1.c>=a then 19 else -17 end*t1.e> -e),t1.f)) from t1 where 13<=t1.e),t1.d))) from t1 where t1.d in (select d from t1 union select a from t1)),t1.e) FROM t1 WHERE t1.c between (11) and coalesce((select max(b*case t1.c when t1.f then t1.f else 11 end) from t1 where +(select count(distinct case when f not between -13 and 19 then t1.f++(f) | t1.e*(+13)* -(t1.c)-t1.b when 13=t1.d then 19 else t1.b end*t1.a) from t1) in (t1.e,11, -19)),d)+f} -} {0} -do_test randexpr-2.2570 { - db eval {SELECT coalesce((select (abs(f)/abs(coalesce((select max(19*b+d*coalesce((select max(t1.c) from t1 where case when d>=(abs((11))/abs(t1.a*13+(13)-d*e+11)) then t1.c when t1.c>=a then 19 else -17 end*t1.e> -e),t1.f)) from t1 where 13<=t1.e),t1.d))) from t1 where t1.d in (select d from t1 union select a from t1)),t1.e) FROM t1 WHERE NOT (t1.c between (11) and coalesce((select max(b*case t1.c when t1.f then t1.f else 11 end) from t1 where +(select count(distinct case when f not between -13 and 19 then t1.f++(f) | t1.e*(+13)* -(t1.c)-t1.b when 13=t1.d then 19 else t1.b end*t1.a) from t1) in (t1.e,11, -19)),d)+f)} -} {} -do_test randexpr-2.2571 { - db eval {SELECT case when (not 19>=(abs(t1.b)/abs(+f))) then case 13 when case t1.c when t1.b then f else 13 end then t1.e else t1.a end+coalesce((select max(c) from t1 where a not between t1.d*17*coalesce((select max(e*b) from t1 where t1.a=11),t1.c) and t1.d),t1.d) when (case when t1.d not in (e,t1.a,t1.b) then 19 else t1.f end between t1.c and 19) then t1.e else 11 end FROM t1 WHERE t1.b*+c>=17} -} {11} -do_test randexpr-2.2572 { - db eval {SELECT case when (not 19>=(abs(t1.b)/abs(+f))) then case 13 when case t1.c when t1.b then f else 13 end then t1.e else t1.a end+coalesce((select max(c) from t1 where a not between t1.d*17*coalesce((select max(e*b) from t1 where t1.a=11),t1.c) and t1.d),t1.d) when (case when t1.d not in (e,t1.a,t1.b) then 19 else t1.f end between t1.c and 19) then t1.e else 11 end FROM t1 WHERE NOT (t1.b*+c>=17)} -} {} -do_test randexpr-2.2573 { - db eval {SELECT case when d-t1.c<>e then c when (11 not between 13 and 13) then 13 else -case when c*t1.d>=b*b then -t1.f else b-t1.c | d*(case t1.d when -case t1.b when t1.b then t1.b else 19 end*19*(t1.d) then 13 else 19 end) end+19*11 end+b FROM t1 WHERE ~~case when t1.d+(abs(t1.b+coalesce((select coalesce((select max(b-a-a) from t1 where 17 not in (e,case when (t1.d)<=t1.f or -a not between c and t1.b then c when -19 in ( -d,(t1.a),19) then b else f end,t1.e)), -13) from t1 where not b in (t1.b, -t1.b,c)),e))/abs(11)) between 13 and d then (t1.b) when t1.e<13 then 19 else a end-(19)-d*t1.d not in (d,t1.c,13)} -} {500} -do_test randexpr-2.2574 { - db eval {SELECT case when d-t1.c<>e then c when (11 not between 13 and 13) then 13 else -case when c*t1.d>=b*b then -t1.f else b-t1.c | d*(case t1.d when -case t1.b when t1.b then t1.b else 19 end*19*(t1.d) then 13 else 19 end) end+19*11 end+b FROM t1 WHERE NOT (~~case when t1.d+(abs(t1.b+coalesce((select coalesce((select max(b-a-a) from t1 where 17 not in (e,case when (t1.d)<=t1.f or -a not between c and t1.b then c when -19 in ( -d,(t1.a),19) then b else f end,t1.e)), -13) from t1 where not b in (t1.b, -t1.b,c)),e))/abs(11)) between 13 and d then (t1.b) when t1.e<13 then 19 else a end-(19)-d*t1.d not in (d,t1.c,13))} -} {} -do_test randexpr-2.2575 { - db eval {SELECT case when d-t1.c<>e then c when (11 not between 13 and 13) then 13 else -case when c*t1.d>=b*b then -t1.f else b-t1.c & d*(case t1.d when -case t1.b when t1.b then t1.b else 19 end*19*(t1.d) then 13 else 19 end) end+19*11 end+b FROM t1 WHERE ~~case when t1.d+(abs(t1.b+coalesce((select coalesce((select max(b-a-a) from t1 where 17 not in (e,case when (t1.d)<=t1.f or -a not between c and t1.b then c when -19 in ( -d,(t1.a),19) then b else f end,t1.e)), -13) from t1 where not b in (t1.b, -t1.b,c)),e))/abs(11)) between 13 and d then (t1.b) when t1.e<13 then 19 else a end-(19)-d*t1.d not in (d,t1.c,13)} -} {500} -do_test randexpr-2.2576 { - db eval {SELECT 19+t1.d+d-t1.c*case when 11 not between e and ~c+(select min((abs(t1.b*t1.b)/abs(+t1.c-e))) from t1) then 17 when case when 17*13 not in (t1.b,(abs(~c)/abs( -17-e)),(t1.e)) then 17 else (t1.c) end+c+t1.f not in (t1.f,19,t1.f) then -t1.e else t1.f end FROM t1 WHERE (+13) between +b and t1.e+11} -} {} -do_test randexpr-2.2577 { - db eval {SELECT 19+t1.d+d-t1.c*case when 11 not between e and ~c+(select min((abs(t1.b*t1.b)/abs(+t1.c-e))) from t1) then 17 when case when 17*13 not in (t1.b,(abs(~c)/abs( -17-e)),(t1.e)) then 17 else (t1.c) end+c+t1.f not in (t1.f,19,t1.f) then -t1.e else t1.f end FROM t1 WHERE NOT ((+13) between +b and t1.e+11)} -} {-4281} -do_test randexpr-2.2578 { - db eval {SELECT 17+d*~(abs(coalesce((select 19 | f | e*~+((abs(e)/abs(+19))-t1.c-case 17 when t1.f then f else 19 end-17) from t1 where (e in (select ~(11) from t1 union select case when (f)>a then b when e between -e and t1.b then 17 else t1.f end*t1.a from t1))),t1.b)*e)/abs(17))-t1.a-19 FROM t1 WHERE t1.e not in (d,e,case 19 when - -~case when exists(select 1 from t1 where 17 not in (t1.d,t1.a,coalesce((select max(11-a) from t1 where coalesce((select +c from t1 where exists(select 1 from t1 where case when t1.f not in (19+(f),d,t1.c) then t1.c when (exists(select 1 from t1 where t1.c>19)) then 19 else f end not between a and t1.f)),t1.c)<=b),17))) then t1.d-11 else t1.b end then (d) else t1.f end-(c))} -} {} -do_test randexpr-2.2579 { - db eval {SELECT 17+d*~(abs(coalesce((select 19 | f | e*~+((abs(e)/abs(+19))-t1.c-case 17 when t1.f then f else 19 end-17) from t1 where (e in (select ~(11) from t1 union select case when (f)>a then b when e between -e and t1.b then 17 else t1.f end*t1.a from t1))),t1.b)*e)/abs(17))-t1.a-19 FROM t1 WHERE NOT (t1.e not in (d,e,case 19 when - -~case when exists(select 1 from t1 where 17 not in (t1.d,t1.a,coalesce((select max(11-a) from t1 where coalesce((select +c from t1 where exists(select 1 from t1 where case when t1.f not in (19+(f),d,t1.c) then t1.c when (exists(select 1 from t1 where t1.c>19)) then 19 else f end not between a and t1.f)),t1.c)<=b),17))) then t1.d-11 else t1.b end then (d) else t1.f end-(c)))} -} {-2353302} -do_test randexpr-2.2580 { - db eval {SELECT 17+d*~(abs(coalesce((select 19 & f & e*~+((abs(e)/abs(+19))-t1.c-case 17 when t1.f then f else 19 end-17) from t1 where (e in (select ~(11) from t1 union select case when (f)>a then b when e between -e and t1.b then 17 else t1.f end*t1.a from t1))),t1.b)*e)/abs(17))-t1.a-19 FROM t1 WHERE NOT (t1.e not in (d,e,case 19 when - -~case when exists(select 1 from t1 where 17 not in (t1.d,t1.a,coalesce((select max(11-a) from t1 where coalesce((select +c from t1 where exists(select 1 from t1 where case when t1.f not in (19+(f),d,t1.c) then t1.c when (exists(select 1 from t1 where t1.c>19)) then 19 else f end not between a and t1.f)),t1.c)<=b),17))) then t1.d-11 else t1.b end then (d) else t1.f end-(c)))} -} {-2353302} -do_test randexpr-2.2581 { - db eval {SELECT case a when b-coalesce((select coalesce((select max(c-(abs((19))/abs(coalesce((select t1.c+d from t1 where 17 not in (d,t1.c, -t1.e)),t1.b)-(e)))) from t1 where t1.d in (t1.e,e,t1.f)),(e)) from t1 where t1.b=t1.e or t1.b not between b and e or t1.f not between t1.b and e or c not between -b and a),d) then 13 else 17 end FROM t1 WHERE a+17+(17) in ( -t1.a,13,coalesce((select max(e) from t1 where b+a-13<=b),e)) or e in (select abs( -+~abs(+(min(c))))+count(distinct b) from t1 union select abs(+((max(t1.c)) | min(t1.b))) from t1) and 13 not between f and 19 or not e not in ( -17,13,t1.a)} -} {} -do_test randexpr-2.2582 { - db eval {SELECT case a when b-coalesce((select coalesce((select max(c-(abs((19))/abs(coalesce((select t1.c+d from t1 where 17 not in (d,t1.c, -t1.e)),t1.b)-(e)))) from t1 where t1.d in (t1.e,e,t1.f)),(e)) from t1 where t1.b=t1.e or t1.b not between b and e or t1.f not between t1.b and e or c not between -b and a),d) then 13 else 17 end FROM t1 WHERE NOT (a+17+(17) in ( -t1.a,13,coalesce((select max(e) from t1 where b+a-13<=b),e)) or e in (select abs( -+~abs(+(min(c))))+count(distinct b) from t1 union select abs(+((max(t1.c)) | min(t1.b))) from t1) and 13 not between f and 19 or not e not in ( -17,13,t1.a))} -} {17} -do_test randexpr-2.2583 { - db eval {SELECT case when not t1.e between 17 and a then 11+ -(select ~case count(distinct +13+t1.c | c*13)- -+ -cast(avg(c) AS integer)-min(19)+case -max(c) when -cast(avg(b) AS integer) then max(11) else max(13) end+count(distinct t1.f) when max(( -d)) then cast(avg(t1.c) AS integer) else (min((t1.b))) end | cast(avg(t1.f) AS integer)*count(distinct 17) from t1)+b else +t1.e | -t1.a-a end FROM t1 WHERE (t1.f<=~c+f)} -} {} -do_test randexpr-2.2584 { - db eval {SELECT case when not t1.e between 17 and a then 11+ -(select ~case count(distinct +13+t1.c | c*13)- -+ -cast(avg(c) AS integer)-min(19)+case -max(c) when -cast(avg(b) AS integer) then max(11) else max(13) end+count(distinct t1.f) when max(( -d)) then cast(avg(t1.c) AS integer) else (min((t1.b))) end | cast(avg(t1.f) AS integer)*count(distinct 17) from t1)+b else +t1.e | -t1.a-a end FROM t1 WHERE NOT ((t1.f<=~c+f))} -} {340} -do_test randexpr-2.2585 { - db eval {SELECT case when not t1.e between 17 and a then 11+ -(select ~case count(distinct +13+t1.c & c*13)- -+ -cast(avg(c) AS integer)-min(19)+case -max(c) when -cast(avg(b) AS integer) then max(11) else max(13) end+count(distinct t1.f) when max(( -d)) then cast(avg(t1.c) AS integer) else (min((t1.b))) end & cast(avg(t1.f) AS integer)*count(distinct 17) from t1)+b else +t1.e & -t1.a-a end FROM t1 WHERE NOT ((t1.f<=~c+f))} -} {-317} -do_test randexpr-2.2586 { - db eval {SELECT t1.f-coalesce((select max(case when b<>~t1.f then b+f else coalesce((select t1.c from t1 where case a when 19*t1.e+a then 19 else 13 end between 13 and a),t1.d)+b end) from t1 where (t1.c) in (select -~min(c) | max(t1.d) from t1 union select -cast(avg(t1.a) AS integer) from t1) and t1.c in (t1.a,d,11) or 1113 and not exists(select 1 from t1 where (((t1.d<=t1.b))))),e)*b*t1.f>t1.a or not exists(select 1 from t1 where (13) not in (11,t1.b,t1.c)) then c+d else t1.e end>=t1.f) or (not exists(select 1 from t1 where -11 in (c,t1.d, -a)) or a not between - - -(b) and b) or 13 between t1.b and f} -} {-200} -do_test randexpr-2.2587 { - db eval {SELECT t1.f-coalesce((select max(case when b<>~t1.f then b+f else coalesce((select t1.c from t1 where case a when 19*t1.e+a then 19 else 13 end between 13 and a),t1.d)+b end) from t1 where (t1.c) in (select -~min(c) | max(t1.d) from t1 union select -cast(avg(t1.a) AS integer) from t1) and t1.c in (t1.a,d,11) or 1113 and not exists(select 1 from t1 where (((t1.d<=t1.b))))),e)*b*t1.f>t1.a or not exists(select 1 from t1 where (13) not in (11,t1.b,t1.c)) then c+d else t1.e end>=t1.f) or (not exists(select 1 from t1 where -11 in (c,t1.d, -a)) or a not between - - -(b) and b) or 13 between t1.b and f)} -} {} -do_test randexpr-2.2588 { - db eval {SELECT t1.f-coalesce((select max(case when b<>~t1.f then b+f else coalesce((select t1.c from t1 where case a when 19*t1.e+a then 19 else 13 end between 13 and a),t1.d)+b end) from t1 where (t1.c) in (select -~min(c) & max(t1.d) from t1 union select -cast(avg(t1.a) AS integer) from t1) and t1.c in (t1.a,d,11) or 1113 and not exists(select 1 from t1 where (((t1.d<=t1.b))))),e)*b*t1.f>t1.a or not exists(select 1 from t1 where (13) not in (11,t1.b,t1.c)) then c+d else t1.e end>=t1.f) or (not exists(select 1 from t1 where -11 in (c,t1.d, -a)) or a not between - - -(b) and b) or 13 between t1.b and f} -} {-200} -do_test randexpr-2.2589 { - db eval {SELECT case when ( -c=~t1.b and coalesce((select max(coalesce((select b from t1 where t1.f between case when t1.e between t1.f and 19 then (t1.b) else t1.a end and t1.f),a)) from t1 where 11=t1.f),t1.f)+t1.c=d) and a>t1.c and 19> -19 and exists(select 1 from t1 where (b=17)) and 17 between 19 and 13 then 19*case (d) when c then b else a end when t1.d not in ( -t1.a,f,13) then -t1.f else (d) end FROM t1 WHERE 11*case when d | (abs(+t1.e-t1.e*b+(select case abs(count(*)) when count(*) then count(*) else cast(avg(t1.c) AS integer) end from t1)*17+(d)-13-11)/abs(c))-f- -t1.c-d | t1.a not between 19 and f then t1.a when t1.d in (select 11 from t1 union select d from t1) then e else e end-t1.c between 19 and c} -} {} -do_test randexpr-2.2590 { - db eval {SELECT case when ( -c=~t1.b and coalesce((select max(coalesce((select b from t1 where t1.f between case when t1.e between t1.f and 19 then (t1.b) else t1.a end and t1.f),a)) from t1 where 11=t1.f),t1.f)+t1.c=d) and a>t1.c and 19> -19 and exists(select 1 from t1 where (b=17)) and 17 between 19 and 13 then 19*case (d) when c then b else a end when t1.d not in ( -t1.a,f,13) then -t1.f else (d) end FROM t1 WHERE NOT (11*case when d | (abs(+t1.e-t1.e*b+(select case abs(count(*)) when count(*) then count(*) else cast(avg(t1.c) AS integer) end from t1)*17+(d)-13-11)/abs(c))-f- -t1.c-d | t1.a not between 19 and f then t1.a when t1.d in (select 11 from t1 union select d from t1) then e else e end-t1.c between 19 and c)} -} {-600} -do_test randexpr-2.2591 { - db eval {SELECT +case when t1.a-17 in (select cast(avg(t1.a*t1.d+(abs( -t1.e)/abs(case when t1.e>t1.a or a>t1.d then t1.f when 13<11 then t1.b else c end))*t1.d) AS integer) from t1 union select count(distinct t1.a) from t1) then t1.c when d in (select +count(distinct b)-case case - -cast(avg(d) AS integer) when case max(11) when min(17) then count(*) else (cast(avg(a) AS integer)) end then -count(*) else -cast(avg(17) AS integer) end when max(19) then count(distinct t1.f) else count(distinct -t1.d) end | min(e) from t1 union select count(*) from t1) then t1.d else t1.a end FROM t1 WHERE -+b>=19} -} {} -do_test randexpr-2.2592 { - db eval {SELECT +case when t1.a-17 in (select cast(avg(t1.a*t1.d+(abs( -t1.e)/abs(case when t1.e>t1.a or a>t1.d then t1.f when 13<11 then t1.b else c end))*t1.d) AS integer) from t1 union select count(distinct t1.a) from t1) then t1.c when d in (select +count(distinct b)-case case - -cast(avg(d) AS integer) when case max(11) when min(17) then count(*) else (cast(avg(a) AS integer)) end then -count(*) else -cast(avg(17) AS integer) end when max(19) then count(distinct t1.f) else count(distinct -t1.d) end | min(e) from t1 union select count(*) from t1) then t1.d else t1.a end FROM t1 WHERE NOT ( -+b>=19)} -} {100} -do_test randexpr-2.2593 { - db eval {SELECT +case when t1.a-17 in (select cast(avg(t1.a*t1.d+(abs( -t1.e)/abs(case when t1.e>t1.a or a>t1.d then t1.f when 13<11 then t1.b else c end))*t1.d) AS integer) from t1 union select count(distinct t1.a) from t1) then t1.c when d in (select +count(distinct b)-case case - -cast(avg(d) AS integer) when case max(11) when min(17) then count(*) else (cast(avg(a) AS integer)) end then -count(*) else -cast(avg(17) AS integer) end when max(19) then count(distinct t1.f) else count(distinct -t1.d) end & min(e) from t1 union select count(*) from t1) then t1.d else t1.a end FROM t1 WHERE NOT ( -+b>=19)} -} {100} -do_test randexpr-2.2594 { - db eval {SELECT case ~(t1.f)-t1.b-t1.e*c when coalesce((select case when d*13 | d=case when 19 between b+e+a | t1.f and a+11+t1.b*(t1.f) then d else b end then t1.c when e not between 13 and 13 then 19 else a end from t1 where 13=t1.b),c) then t1.c else b end FROM t1 WHERE not t1.d in (select cast(avg(t1.e) AS integer)-~~min(coalesce((select (abs(11)/abs(11+(select count(*)+min(17)+ -cast(avg(t1.d) AS integer) from t1)*13+coalesce((select max(b) from t1 where (t1.c)<>t1.e or e<(a)),13)-d*t1.c))*t1.b from t1 where 19<=e),c))++abs(count(distinct t1.b))+~max(11)*max(11) from t1 union select +max(11) from t1)} -} {200} -do_test randexpr-2.2595 { - db eval {SELECT case ~(t1.f)-t1.b-t1.e*c when coalesce((select case when d*13 | d=case when 19 between b+e+a | t1.f and a+11+t1.b*(t1.f) then d else b end then t1.c when e not between 13 and 13 then 19 else a end from t1 where 13=t1.b),c) then t1.c else b end FROM t1 WHERE NOT (not t1.d in (select cast(avg(t1.e) AS integer)-~~min(coalesce((select (abs(11)/abs(11+(select count(*)+min(17)+ -cast(avg(t1.d) AS integer) from t1)*13+coalesce((select max(b) from t1 where (t1.c)<>t1.e or e<(a)),13)-d*t1.c))*t1.b from t1 where 19<=e),c))++abs(count(distinct t1.b))+~max(11)*max(11) from t1 union select +max(11) from t1))} -} {} -do_test randexpr-2.2596 { - db eval {SELECT case ~(t1.f)-t1.b-t1.e*c when coalesce((select case when d*13 & d=case when 19 between b+e+a & t1.f and a+11+t1.b*(t1.f) then d else b end then t1.c when e not between 13 and 13 then 19 else a end from t1 where 13=t1.b),c) then t1.c else b end FROM t1 WHERE not t1.d in (select cast(avg(t1.e) AS integer)-~~min(coalesce((select (abs(11)/abs(11+(select count(*)+min(17)+ -cast(avg(t1.d) AS integer) from t1)*13+coalesce((select max(b) from t1 where (t1.c)<>t1.e or e<(a)),13)-d*t1.c))*t1.b from t1 where 19<=e),c))++abs(count(distinct t1.b))+~max(11)*max(11) from t1 union select +max(11) from t1)} -} {200} -do_test randexpr-2.2597 { - db eval {SELECT t1.d+(abs(11)/abs(e*~(select -+ -case min(t1.e) when count(distinct case when (exists(select 1 from t1 where (t1.d not in (19+11,t1.e,t1.c)))) then c*b-t1.a else -c end) then count(*)+case (cast(avg(a) AS integer))-count(distinct f) when -(count(*)) then count(distinct e) else max(t1.b) end- -count(distinct 17)* -min(t1.c) else count(distinct -19) end-count(distinct b) | cast(avg(19) AS integer) from t1)))-~t1.c FROM t1 WHERE c*coalesce((select e from t1 where case when exists(select 1 from t1 where not exists(select 1 from t1 where coalesce((select +b | 13 from t1 where ((17<(select (+~min(coalesce((select t1.c from t1 where case e when 13 then a else 11 end not in ( -b,t1.b,e)),(a)))) from t1)+d-19))),17) not between t1.b and t1.a)) then 11*d else t1.a end in (select c from t1 union select t1.e from t1)),t1.f) not between ( -d) and 13} -} {701} -do_test randexpr-2.2598 { - db eval {SELECT t1.d+(abs(11)/abs(e*~(select -+ -case min(t1.e) when count(distinct case when (exists(select 1 from t1 where (t1.d not in (19+11,t1.e,t1.c)))) then c*b-t1.a else -c end) then count(*)+case (cast(avg(a) AS integer))-count(distinct f) when -(count(*)) then count(distinct e) else max(t1.b) end- -count(distinct 17)* -min(t1.c) else count(distinct -19) end-count(distinct b) | cast(avg(19) AS integer) from t1)))-~t1.c FROM t1 WHERE NOT (c*coalesce((select e from t1 where case when exists(select 1 from t1 where not exists(select 1 from t1 where coalesce((select +b | 13 from t1 where ((17<(select (+~min(coalesce((select t1.c from t1 where case e when 13 then a else 11 end not in ( -b,t1.b,e)),(a)))) from t1)+d-19))),17) not between t1.b and t1.a)) then 11*d else t1.a end in (select c from t1 union select t1.e from t1)),t1.f) not between ( -d) and 13)} -} {} -do_test randexpr-2.2599 { - db eval {SELECT t1.d+(abs(11)/abs(e*~(select -+ -case min(t1.e) when count(distinct case when (exists(select 1 from t1 where (t1.d not in (19+11,t1.e,t1.c)))) then c*b-t1.a else -c end) then count(*)+case (cast(avg(a) AS integer))-count(distinct f) when -(count(*)) then count(distinct e) else max(t1.b) end- -count(distinct 17)* -min(t1.c) else count(distinct -19) end-count(distinct b) & cast(avg(19) AS integer) from t1)))-~t1.c FROM t1 WHERE c*coalesce((select e from t1 where case when exists(select 1 from t1 where not exists(select 1 from t1 where coalesce((select +b | 13 from t1 where ((17<(select (+~min(coalesce((select t1.c from t1 where case e when 13 then a else 11 end not in ( -b,t1.b,e)),(a)))) from t1)+d-19))),17) not between t1.b and t1.a)) then 11*d else t1.a end in (select c from t1 union select t1.e from t1)),t1.f) not between ( -d) and 13} -} {701} -finish_test Index: test/rollback.test ================================================================== --- test/rollback.test +++ test/rollback.test @@ -11,11 +11,11 @@ # This file implements regression tests for SQLite library. The # focus of this file is verifying that a rollback in one statement # caused by an ON CONFLICT ROLLBACK clause aborts any other pending # statements. # -# $Id: rollback.test,v 1.10 2008/10/17 18:51:53 danielk1977 Exp $ +# $Id: rollback.test,v 1.9 2008/10/13 14:16:11 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl set DB [sqlite3_connection_pointer db] @@ -79,14 +79,11 @@ sqlite3_finalize $STMT } {SQLITE_OK} set permutation "" catch {set permutation $::permutations_test_prefix} -if {$tcl_platform(platform) == "unix" - && $permutation ne "onefile" - && $permutation ne "inmemory_journal" -} { +if {$tcl_platform(platform) == "unix" && $permutation ne "onefile"} { do_test rollback-2.1 { execsql { BEGIN; INSERT INTO t3 VALUES('hello world'); } DELETED test/savepoint.test Index: test/savepoint.test ================================================================== --- test/savepoint.test +++ /dev/null @@ -1,862 +0,0 @@ -# 2008 December 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. -# -#*********************************************************************** -# -# $Id: savepoint.test,v 1.12 2009/02/04 10:09:04 danielk1977 Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - - -#---------------------------------------------------------------------- -# The following tests - savepoint-1.* - test that the SAVEPOINT, RELEASE -# and ROLLBACK TO comands are correctly parsed, and that the auto-commit -# flag is correctly set and unset as a result. -# -do_test savepoint-1.1 { - execsql { - SAVEPOINT sp1; - RELEASE sp1; - } -} {} -do_test savepoint-1.2 { - execsql { - SAVEPOINT sp1; - ROLLBACK TO sp1; - } -} {} -do_test savepoint-1.3 { - execsql { SAVEPOINT sp1 } - db close -} {} -sqlite3 db test.db -do_test savepoint-1.4.1 { - execsql { - SAVEPOINT sp1; - SAVEPOINT sp2; - RELEASE sp1; - } - sqlite3_get_autocommit db -} {1} -do_test savepoint-1.4.2 { - execsql { - SAVEPOINT sp1; - SAVEPOINT sp2; - RELEASE sp2; - } - sqlite3_get_autocommit db -} {0} -do_test savepoint-1.4.3 { - execsql { RELEASE sp1 } - sqlite3_get_autocommit db -} {1} -do_test savepoint-1.4.4 { - execsql { - SAVEPOINT sp1; - SAVEPOINT sp2; - ROLLBACK TO sp1; - } - sqlite3_get_autocommit db -} {0} -do_test savepoint-1.4.5 { - execsql { RELEASE SAVEPOINT sp1 } - sqlite3_get_autocommit db -} {1} -do_test savepoint-1.4.6 { - execsql { - SAVEPOINT sp1; - SAVEPOINT sp2; - SAVEPOINT sp3; - ROLLBACK TO SAVEPOINT sp3; - ROLLBACK TRANSACTION TO sp2; - ROLLBACK TRANSACTION TO SAVEPOINT sp1; - } - sqlite3_get_autocommit db -} {0} -do_test savepoint-1.4.7 { - execsql { RELEASE SAVEPOINT SP1 } - sqlite3_get_autocommit db -} {1} -do_test savepoint-1.5 { - execsql { - SAVEPOINT sp1; - ROLLBACK TO sp1; - } -} {} -do_test savepoint-1.6 { - execsql COMMIT -} {} - -#------------------------------------------------------------------------ -# These tests - savepoint-2.* - test rollbacks and releases of savepoints -# with a very simple data set. -# - -do_test savepoint-2.1 { - execsql { - CREATE TABLE t1(a, b, c); - BEGIN; - INSERT INTO t1 VALUES(1, 2, 3); - SAVEPOINT one; - UPDATE t1 SET a = 2, b = 3, c = 4; - } - execsql { SELECT * FROM t1 } -} {2 3 4} -do_test savepoint-2.2 { - execsql { - ROLLBACK TO one; - } - execsql { SELECT * FROM t1 } -} {1 2 3} -do_test savepoint-2.3 { - execsql { - INSERT INTO t1 VALUES(4, 5, 6); - } - execsql { SELECT * FROM t1 } -} {1 2 3 4 5 6} -do_test savepoint-2.4 { - execsql { - ROLLBACK TO one; - } - execsql { SELECT * FROM t1 } -} {1 2 3} - - -do_test savepoint-2.5 { - execsql { - INSERT INTO t1 VALUES(7, 8, 9); - SAVEPOINT two; - INSERT INTO t1 VALUES(10, 11, 12); - } - execsql { SELECT * FROM t1 } -} {1 2 3 7 8 9 10 11 12} -do_test savepoint-2.6 { - execsql { - ROLLBACK TO two; - } - execsql { SELECT * FROM t1 } -} {1 2 3 7 8 9} -do_test savepoint-2.7 { - execsql { - INSERT INTO t1 VALUES(10, 11, 12); - } - execsql { SELECT * FROM t1 } -} {1 2 3 7 8 9 10 11 12} -do_test savepoint-2.8 { - execsql { - ROLLBACK TO one; - } - execsql { SELECT * FROM t1 } -} {1 2 3} -do_test savepoint-2.9 { - execsql { - INSERT INTO t1 VALUES('a', 'b', 'c'); - SAVEPOINT two; - INSERT INTO t1 VALUES('d', 'e', 'f'); - } - execsql { SELECT * FROM t1 } -} {1 2 3 a b c d e f} -do_test savepoint-2.10 { - execsql { - RELEASE two; - } - execsql { SELECT * FROM t1 } -} {1 2 3 a b c d e f} -do_test savepoint-2.11 { - execsql { - ROLLBACK; - } - execsql { SELECT * FROM t1 } -} {} - -#------------------------------------------------------------------------ -# This block of tests - savepoint-3.* - test that when a transaction -# savepoint is rolled back, locks are not released from database files. -# And that when a transaction savepoint is released, they are released. -# -do_test savepoint-3.1 { - execsql { SAVEPOINT "transaction" } - execsql { PRAGMA lock_status } -} {main unlocked temp closed} - -do_test savepoint-3.2 { - execsql { INSERT INTO t1 VALUES(1, 2, 3) } - execsql { PRAGMA lock_status } -} {main reserved temp closed} - -do_test savepoint-3.3 { - execsql { ROLLBACK TO "transaction" } - execsql { PRAGMA lock_status } -} {main reserved temp closed} - -do_test savepoint-3.4 { - execsql { INSERT INTO t1 VALUES(1, 2, 3) } - execsql { PRAGMA lock_status } -} {main reserved temp closed} - -do_test savepoint-3.5 { - execsql { RELEASE "transaction" } - execsql { PRAGMA lock_status } -} {main unlocked temp closed} - -#------------------------------------------------------------------------ -# Test that savepoints that include schema modifications are handled -# correctly. Test cases savepoint-4.*. -# -do_test savepoint-4.1 { - execsql { - CREATE TABLE t2(d, e, f); - SELECT sql FROM sqlite_master; - } -} {{CREATE TABLE t1(a, b, c)} {CREATE TABLE t2(d, e, f)}} -do_test savepoint-4.2 { - execsql { - BEGIN; - CREATE TABLE t3(g,h); - INSERT INTO t3 VALUES('I', 'II'); - SAVEPOINT one; - DROP TABLE t3; - } -} {} -do_test savepoint-4.3 { - execsql { - CREATE TABLE t3(g, h, i); - INSERT INTO t3 VALUES('III', 'IV', 'V'); - } - execsql {SELECT * FROM t3} -} {III IV V} -do_test savepoint-4.4 { - execsql { ROLLBACK TO one; } - execsql {SELECT * FROM t3} -} {I II} -do_test savepoint-4.5 { - execsql { - ROLLBACK; - SELECT sql FROM sqlite_master; - } -} {{CREATE TABLE t1(a, b, c)} {CREATE TABLE t2(d, e, f)}} - -do_test savepoint-4.6 { - execsql { - BEGIN; - INSERT INTO t1 VALUES('o', 't', 't'); - SAVEPOINT sp1; - CREATE TABLE t3(a, b, c); - INSERT INTO t3 VALUES('z', 'y', 'x'); - } - execsql {SELECT * FROM t3} -} {z y x} -do_test savepoint-4.7 { - execsql { - ROLLBACK TO sp1; - CREATE TABLE t3(a); - INSERT INTO t3 VALUES('value'); - } - execsql {SELECT * FROM t3} -} {value} -do_test savepoint-4.8 { - execsql COMMIT -} {} - -#------------------------------------------------------------------------ -# Test some logic errors to do with the savepoint feature. -# - -do_test savepoint-5.1.1 { - execsql { - CREATE TABLE blobs(x); - INSERT INTO blobs VALUES('a twentyeight character blob'); - } - set fd [db incrblob blobs x 1] - puts -nonewline $fd "hello" - catchsql {SAVEPOINT abc} -} {1 {cannot open savepoint - SQL statements in progress}} -do_test savepoint-5.1.2 { - close $fd - catchsql {SAVEPOINT abc} -} {0 {}} - -do_test savepoint-5.2 { - execsql {RELEASE abc} - catchsql {RELEASE abc} -} {1 {no such savepoint: abc}} - -do_test savepoint-5.3.1 { - execsql {SAVEPOINT abc} - catchsql {ROLLBACK TO def} -} {1 {no such savepoint: def}} -do_test savepoint-5.3.2 { - execsql {SAVEPOINT def} - set fd [db incrblob -readonly blobs x 1] - catchsql {ROLLBACK TO def} -} {1 {cannot rollback savepoint - SQL statements in progress}} -do_test savepoint-5.3.3 { - catchsql {RELEASE def} -} {0 {}} -do_test savepoint-5.3.4 { - close $fd - execsql {savepoint def} - set fd [db incrblob blobs x 1] - catchsql {release def} -} {1 {cannot release savepoint - SQL statements in progress}} -do_test savepoint-5.3.5 { - close $fd - execsql {release abc} -} {} - -do_test savepoint-5.4.1 { - execsql { - SAVEPOINT main; - INSERT INTO blobs VALUES('another blob'); - } -} {} -do_test savepoint-5.4.2 { - sqlite3 db2 test.db - execsql { BEGIN ; SELECT * FROM blobs } db2 - catchsql { RELEASE main } -} {1 {database is locked}} -do_test savepoint-5.4.3 { - db2 close - catchsql { RELEASE main } -} {0 {}} -do_test savepoint-5.4.4 { - execsql { SELECT x FROM blobs WHERE rowid = 2 } -} {{another blob}} - -#------------------------------------------------------------------------- -# The following tests, savepoint-6.*, test an incr-vacuum inside of a -# couple of nested savepoints. -# -ifcapable {autovacuum && pragma} { - db close - file delete -force test.db - sqlite3 db test.db - - do_test savepoint-6.1 { - execsql { - PRAGMA auto_vacuum = incremental; - CREATE TABLE t1(a, b, c); - CREATE INDEX i1 ON t1(a, b); - BEGIN; - INSERT INTO t1 VALUES(randstr(10,400),randstr(10,400),randstr(10,400)); - } - set r "randstr(10,400)" - for {set ii 0} {$ii < 10} {incr ii} { - execsql "INSERT INTO t1 SELECT $r, $r, $r FROM t1" - } - execsql { COMMIT } - } {} - - integrity_check savepoint-6.2 - - do_test savepoint-6.3 { - execsql { - PRAGMA cache_size = 10; - BEGIN; - UPDATE t1 SET a = randstr(10,10) WHERE (rowid%4)==0; - SAVEPOINT one; - DELETE FROM t1 WHERE rowid%2; - PRAGMA incr_vacuum; - SAVEPOINT two; - INSERT INTO t1 SELECT randstr(10,400), randstr(10,400), c FROM t1; - DELETE FROM t1 WHERE rowid%2; - PRAGMA incr_vacuum; - ROLLBACK TO one; - COMMIT; - } - } {} - - integrity_check savepoint-6.4 -} - -#------------------------------------------------------------------------- -# The following tests, savepoint-7.*, attempt to break the logic -# surrounding savepoints by growing and shrinking the database file. -# -db close -file delete -force test.db -sqlite3 db test.db - -do_test savepoint-7.1 { - execsql { - PRAGMA auto_vacuum = incremental; - PRAGMA cache_size = 10; - BEGIN; - CREATE TABLE t1(a PRIMARY KEY, b); - INSERT INTO t1(a) VALUES('alligator'); - INSERT INTO t1(a) VALUES('angelfish'); - INSERT INTO t1(a) VALUES('ant'); - INSERT INTO t1(a) VALUES('antelope'); - INSERT INTO t1(a) VALUES('ape'); - INSERT INTO t1(a) VALUES('baboon'); - INSERT INTO t1(a) VALUES('badger'); - INSERT INTO t1(a) VALUES('bear'); - INSERT INTO t1(a) VALUES('beetle'); - INSERT INTO t1(a) VALUES('bird'); - INSERT INTO t1(a) VALUES('bison'); - UPDATE t1 SET b = randstr(1000,1000); - UPDATE t1 SET b = b||randstr(1000,1000); - UPDATE t1 SET b = b||randstr(1000,1000); - UPDATE t1 SET b = b||randstr(10,1000); - COMMIT; - } - expr ([execsql { PRAGMA page_count }] > 20) -} {1} -do_test savepoint-7.2.1 { - execsql { - BEGIN; - SAVEPOINT one; - CREATE TABLE t2(a, b); - INSERT INTO t2 SELECT a, b FROM t1; - ROLLBACK TO one; - } - execsql { - PRAGMA integrity_check; - } -} {ok} -do_test savepoint-7.2.2 { - execsql { - COMMIT; - PRAGMA integrity_check; - } -} {ok} - -do_test savepoint-7.3.1 { - execsql { - CREATE TABLE t2(a, b); - INSERT INTO t2 SELECT a, b FROM t1; - } -} {} -do_test savepoint-7.3.2 { - execsql { - BEGIN; - SAVEPOINT one; - DELETE FROM t2; - PRAGMA incremental_vacuum; - SAVEPOINT two; - INSERT INTO t2 SELECT a, b FROM t1; - ROLLBACK TO two; - COMMIT; - } - execsql { PRAGMA integrity_check } -} {ok} - -do_test savepoint-7.4.1 { - db close - file delete -force test.db - sqlite3 db test.db - execsql { - PRAGMA auto_vacuum = incremental; - CREATE TABLE t1(a, b, PRIMARY KEY(a, b)); - INSERT INTO t1 VALUES(randstr(1000,1000), randstr(1000,1000)); - BEGIN; - DELETE FROM t1; - SAVEPOINT one; - PRAGMA incremental_vacuum; - ROLLBACK TO one; - COMMIT; - } - - execsql { PRAGMA integrity_check } -} {ok} - -do_test savepoint-7.5.1 { - execsql { - PRAGMA incremental_vacuum; - CREATE TABLE t5(x, y); - INSERT INTO t5 VALUES(1, randstr(1000,1000)); - INSERT INTO t5 VALUES(2, randstr(1000,1000)); - INSERT INTO t5 VALUES(3, randstr(1000,1000)); - - BEGIN; - INSERT INTO t5 VALUES(4, randstr(1000,1000)); - INSERT INTO t5 VALUES(5, randstr(1000,1000)); - DELETE FROM t5 WHERE x=1 OR x=2; - SAVEPOINT one; - PRAGMA incremental_vacuum; - SAVEPOINT two; - INSERT INTO t5 VALUES(1, randstr(1000,1000)); - INSERT INTO t5 VALUES(2, randstr(1000,1000)); - ROLLBACK TO two; - ROLLBACK TO one; - COMMIT; - PRAGMA integrity_check; - } -} {ok} -do_test savepoint-7.5.2 { - execsql { - DROP TABLE t5; - } -} {} - -# Test oddly named and quoted savepoints. -# -do_test savepoint-8-1 { - execsql { SAVEPOINT "save1" } - execsql { RELEASE save1 } -} {} -do_test savepoint-8-2 { - execsql { SAVEPOINT "Including whitespace " } - execsql { RELEASE "including Whitespace " } -} {} - -# Test that the authorization callback works. -# -ifcapable auth { - proc auth {args} { - eval lappend ::authdata $args - return SQLITE_OK - } - db auth auth - - do_test savepoint-9.1 { - set ::authdata [list] - execsql { SAVEPOINT sp1 } - set ::authdata - } {SQLITE_SAVEPOINT BEGIN sp1 {} {}} - do_test savepoint-9.2 { - set ::authdata [list] - execsql { ROLLBACK TO sp1 } - set ::authdata - } {SQLITE_SAVEPOINT ROLLBACK sp1 {} {}} - do_test savepoint-9.3 { - set ::authdata [list] - execsql { RELEASE sp1 } - set ::authdata - } {SQLITE_SAVEPOINT RELEASE sp1 {} {}} - - proc auth {args} { - eval lappend ::authdata $args - return SQLITE_DENY - } - db auth auth - - do_test savepoint-9.4 { - set ::authdata [list] - set res [catchsql { SAVEPOINT sp1 }] - concat $::authdata $res - } {SQLITE_SAVEPOINT BEGIN sp1 {} {} 1 {not authorized}} - do_test savepoint-9.5 { - set ::authdata [list] - set res [catchsql { ROLLBACK TO sp1 }] - concat $::authdata $res - } {SQLITE_SAVEPOINT ROLLBACK sp1 {} {} 1 {not authorized}} - do_test savepoint-9.6 { - set ::authdata [list] - set res [catchsql { RELEASE sp1 }] - concat $::authdata $res - } {SQLITE_SAVEPOINT RELEASE sp1 {} {} 1 {not authorized}} - - catch { db eval ROLLBACK } - db auth "" -} - -#------------------------------------------------------------------------- -# The following tests - savepoint-10.* - test the interaction of -# savepoints and ATTACH statements. -# - -# First make sure it is not possible to attach or detach a database while -# a savepoint is open (it is not possible if any transaction is open). -# -do_test savepoint-10.1.1 { - catchsql { - SAVEPOINT one; - ATTACH 'test2.db' AS aux; - } -} {1 {cannot ATTACH database within transaction}} -do_test savepoint-10.1.2 { - execsql { - RELEASE one; - ATTACH 'test2.db' AS aux; - } - catchsql { - SAVEPOINT one; - DETACH aux; - } -} {1 {cannot DETACH database within transaction}} -do_test savepoint-10.1.3 { - execsql { - RELEASE one; - DETACH aux; - } -} {} - -# The lock state of the TEMP database can vary if SQLITE_TEMP_STORE=3 -# And the following set of tests is only really interested in the status -# of the aux1 and aux2 locks. So record the current lock status of -# TEMP for use in the answers. -set templockstate [lindex [db eval {PRAGMA lock_status}] 3] - - -do_test savepoint-10.2.1 { - file delete -force test3.db - file delete -force test2.db - execsql { - ATTACH 'test2.db' AS aux1; - ATTACH 'test3.db' AS aux2; - DROP TABLE t1; - CREATE TABLE main.t1(x, y); - CREATE TABLE aux1.t2(x, y); - CREATE TABLE aux2.t3(x, y); - SELECT name FROM sqlite_master - UNION ALL - SELECT name FROM aux1.sqlite_master - UNION ALL - SELECT name FROM aux2.sqlite_master; - } -} {t1 t2 t3} -do_test savepoint-10.2.2 { - execsql { PRAGMA lock_status } -} [list main unlocked temp $templockstate aux1 unlocked aux2 unlocked] - -do_test savepoint-10.2.3 { - execsql { - SAVEPOINT one; - INSERT INTO t1 VALUES(1, 2); - PRAGMA lock_status; - } -} [list main reserved temp $templockstate aux1 unlocked aux2 unlocked] -do_test savepoint-10.2.4 { - execsql { - INSERT INTO t3 VALUES(3, 4); - PRAGMA lock_status; - } -} [list main reserved temp $templockstate aux1 unlocked aux2 reserved] -do_test savepoint-10.2.5 { - execsql { - SAVEPOINT two; - INSERT INTO t2 VALUES(5, 6); - PRAGMA lock_status; - } -} [list main reserved temp $templockstate aux1 reserved aux2 reserved] -do_test savepoint-10.2.6 { - execsql { SELECT * FROM t2 } -} {5 6} -do_test savepoint-10.2.7 { - execsql { ROLLBACK TO two } - execsql { SELECT * FROM t2 } -} {} -do_test savepoint-10.2.8 { - execsql { PRAGMA lock_status } -} [list main reserved temp $templockstate aux1 reserved aux2 reserved] -do_test savepoint-10.2.9 { - execsql { SELECT 'a', * FROM t1 UNION ALL SELECT 'b', * FROM t3 } -} {a 1 2 b 3 4} -do_test savepoint-10.2.9 { - execsql { - INSERT INTO t2 VALUES(5, 6); - RELEASE one; - } - execsql { - SELECT * FROM t1; - SELECT * FROM t2; - SELECT * FROM t3; - } -} {1 2 5 6 3 4} -do_test savepoint-10.2.9 { - execsql { PRAGMA lock_status } -} [list main unlocked temp $templockstate aux1 unlocked aux2 unlocked] - -do_test savepoint-10.2.10 { - execsql { - SAVEPOINT one; - INSERT INTO t1 VALUES('a', 'b'); - SAVEPOINT two; - INSERT INTO t2 VALUES('c', 'd'); - SAVEPOINT three; - INSERT INTO t3 VALUES('e', 'f'); - } - execsql { - SELECT * FROM t1; - SELECT * FROM t2; - SELECT * FROM t3; - } -} {1 2 a b 5 6 c d 3 4 e f} -do_test savepoint-10.2.11 { - execsql { ROLLBACK TO two } - execsql { - SELECT * FROM t1; - SELECT * FROM t2; - SELECT * FROM t3; - } -} {1 2 a b 5 6 3 4} -do_test savepoint-10.2.12 { - execsql { - INSERT INTO t3 VALUES('g', 'h'); - ROLLBACK TO two; - } - execsql { - SELECT * FROM t1; - SELECT * FROM t2; - SELECT * FROM t3; - } -} {1 2 a b 5 6 3 4} -do_test savepoint-10.2.13 { - execsql { ROLLBACK } - execsql { - SELECT * FROM t1; - SELECT * FROM t2; - SELECT * FROM t3; - } -} {1 2 5 6 3 4} -do_test savepoint-10.2.14 { - execsql { PRAGMA lock_status } -} [list main unlocked temp $templockstate aux1 unlocked aux2 unlocked] - -#------------------------------------------------------------------------- -# The following tests - savepoint-11.* - test the interaction of -# savepoints and creating or dropping tables and indexes in -# auto-vacuum mode. -# -do_test savepoint-11.1 { - db close - file delete -force test.db - sqlite3 db test.db - execsql { - PRAGMA auto_vacuum = full; - CREATE TABLE t1(a, b, UNIQUE(a, b)); - INSERT INTO t1 VALUES(1, randstr(1000,1000)); - INSERT INTO t1 VALUES(2, randstr(1000,1000)); - } -} {} -do_test savepoint-11.2 { - execsql { - SAVEPOINT one; - CREATE TABLE t2(a, b, UNIQUE(a, b)); - SAVEPOINT two; - CREATE TABLE t3(a, b, UNIQUE(a, b)); - } -} {} -integrity_check savepoint-11.3 -do_test savepoint-11.4 { - execsql { ROLLBACK TO two } -} {} -integrity_check savepoint-11.5 -do_test savepoint-11.6 { - execsql { - CREATE TABLE t3(a, b, UNIQUE(a, b)); - ROLLBACK TO one; - } -} {} -integrity_check savepoint-11.7 -do_test savepoint-11.8 { - execsql { ROLLBACK } - file size test.db -} {8192} - - -do_test savepoint-11.9 { - execsql { - DROP TABLE IF EXISTS t1; - DROP TABLE IF EXISTS t2; - DROP TABLE IF EXISTS t3; - } -} {} -do_test savepoint-11.10 { - execsql { - BEGIN; - CREATE TABLE t1(a, b); - CREATE TABLE t2(x, y); - INSERT INTO t2 VALUES(1, 2); - SAVEPOINT one; - INSERT INTO t2 VALUES(3, 4); - SAVEPOINT two; - DROP TABLE t1; - ROLLBACK TO two; - } - execsql {SELECT * FROM t2} -} {1 2 3 4} -do_test savepoint-11.11 { - execsql COMMIT -} {} -do_test savepoint-11.12 { - execsql {SELECT * FROM t2} -} {1 2 3 4} - -#------------------------------------------------------------------------- -# The following tests - savepoint-12.* - test the interaction of -# savepoints and "ON CONFLICT ROLLBACK" clauses. -# -do_test savepoint-12.1 { - execsql { - CREATE TABLE t4(a PRIMARY KEY, b); - INSERT INTO t4 VALUES(1, 'one'); - } -} {} -do_test savepoint-12.2 { - # The final statement of the following SQL hits a constraint when the - # conflict handling mode is "OR ROLLBACK" and there are a couple of - # open savepoints. At one point this would fail to clear the internal - # record of the open savepoints, resulting in an assert() failure - # later on. - # - catchsql { - BEGIN; - INSERT INTO t4 VALUES(2, 'two'); - SAVEPOINT sp1; - INSERT INTO t4 VALUES(3, 'three'); - SAVEPOINT sp2; - INSERT OR ROLLBACK INTO t4 VALUES(1, 'one'); - } -} {1 {column a is not unique}} -do_test savepoint-12.3 { - sqlite3_get_autocommit db -} {1} -do_test savepoint-12.4 { - execsql { SAVEPOINT one } -} {} - -#------------------------------------------------------------------------- -# The following tests - savepoint-13.* - test the interaction of -# savepoints and "journal_mode = off". -# -do_test savepoint-13.1 { - db close - catch {file delete -force test.db} - sqlite3 db test.db - execsql { - BEGIN; - CREATE TABLE t1(a PRIMARY KEY, b); - INSERT INTO t1 VALUES(1, 2); - COMMIT; - PRAGMA journal_mode = off; - } -} {off} -do_test savepoint-13.2 { - execsql { - BEGIN; - INSERT INTO t1 VALUES(3, 4); - INSERT INTO t1 SELECT a+4,b+4 FROM t1; - COMMIT; - } -} {} -do_test savepoint-13.3 { - execsql { - BEGIN; - INSERT INTO t1 VALUES(9, 10); - SAVEPOINT s1; - INSERT INTO t1 VALUES(11, 12); - COMMIT; - } -} {} -do_test savepoint-13.4 { - execsql { - BEGIN; - INSERT INTO t1 VALUES(13, 14); - SAVEPOINT s1; - INSERT INTO t1 VALUES(15, 16); - ROLLBACK TO s1; - ROLLBACK; - SELECT * FROM t1; - } -} {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16} - -finish_test DELETED test/savepoint2.test Index: test/savepoint2.test ================================================================== --- test/savepoint2.test +++ /dev/null @@ -1,149 +0,0 @@ -# 2008 December 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. -# -#*********************************************************************** -# -# $Id: savepoint2.test,v 1.4 2008/12/22 10:58:46 danielk1977 Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -# Tests in this file are quite similar to those run by trans.test and -# avtrans.test. -# - -proc signature {} { - return [db eval {SELECT count(*), md5sum(x) FROM t3}] -} - -do_test savepoint2-1 { - execsql { - PRAGMA cache_size=10; - BEGIN; - CREATE TABLE t3(x TEXT); - INSERT INTO t3 VALUES(randstr(10,400)); - INSERT INTO t3 VALUES(randstr(10,400)); - INSERT INTO t3 SELECT randstr(10,400) FROM t3; - INSERT INTO t3 SELECT randstr(10,400) FROM t3; - INSERT INTO t3 SELECT randstr(10,400) FROM t3; - INSERT INTO t3 SELECT randstr(10,400) FROM t3; - INSERT INTO t3 SELECT randstr(10,400) FROM t3; - INSERT INTO t3 SELECT randstr(10,400) FROM t3; - INSERT INTO t3 SELECT randstr(10,400) FROM t3; - INSERT INTO t3 SELECT randstr(10,400) FROM t3; - INSERT INTO t3 SELECT randstr(10,400) FROM t3; - COMMIT; - SELECT count(*) FROM t3; - } -} {1024} - -unset -nocomplain ::sig -unset -nocomplain SQL - -set iterations 20 - -set SQL(1) { - DELETE FROM t3 WHERE random()%10!=0; - INSERT INTO t3 SELECT randstr(10,10)||x FROM t3; - INSERT INTO t3 SELECT randstr(10,10)||x FROM t3; -} -set SQL(2) { - DELETE FROM t3 WHERE random()%10!=0; - INSERT INTO t3 SELECT randstr(10,10)||x FROM t3; - DELETE FROM t3 WHERE random()%10!=0; - INSERT INTO t3 SELECT randstr(10,10)||x FROM t3; -} -set SQL(3) { - UPDATE t3 SET x = randstr(10, 400) WHERE random()%10; - INSERT INTO t3 SELECT x FROM t3 WHERE random()%10; - DELETE FROM t3 WHERE random()%10; -} -set SQL(4) { - INSERT INTO t3 SELECT randstr(10,400) FROM t3 WHERE (random()%10 == 0); -} - - - -for {set ii 2} {$ii < ($iterations+2)} {incr ii} { - - # Record the database signature. Optionally (every second run) open a - # transaction. In all cases open savepoint "one", which may or may - # not be a transaction savepoint, depending on whether or not a real - # transaction has been opened. - # - do_test savepoint2-$ii.1 { - if {$ii % 2} { execsql BEGIN } - set ::sig(one) [signature] - execsql "SAVEPOINT one" - } {} - - # Execute some SQL on the database. Then rollback to savepoint "one". - # Check that the database signature is as it was when "one" was opened. - # - do_test savepoint2-$ii.2 { - execsql $SQL(1) - execsql "ROLLBACK to one" - signature - } $::sig(one) - integrity_check savepoint2-$ii.2.1 - - # Execute some SQL. Then open savepoint "two". Savepoint "two" is therefore - # nested in savepoint "one". - # - do_test savepoint2-$ii.3 { - execsql $SQL(1) - set ::sig(two) [signature] - execsql "SAVEPOINT two" - } {} - - # More SQL changes. The rollback to savepoint "two". Check that the - # signature is as it was when savepoint "two" was opened. - # - do_test savepoint2-$ii.4 { - execsql $SQL(2) - execsql "ROLLBACK to two" - signature - } $::sig(two) - integrity_check savepoint2-$ii.4.1 - - # More SQL changes. The rollback to savepoint "two". Check that the - # signature is as it was when savepoint "two" was opened. - # - do_test savepoint2-$ii.5 { - execsql $SQL(2) - execsql "SAVEPOINT three" - execsql $SQL(3) - execsql "RELEASE three" - execsql "ROLLBACK to one" - signature - } $::sig(one) - - # By this point the database is in the same state as it was at the - # top of the for{} loop (everything having been rolled back by the - # "ROLLBACK TO one" command above). So make a few changes to the - # database and COMMIT the open transaction, so that the next iteration - # of the for{} loop works on a different dataset. - # - # The transaction being committed here may have been opened normally using - # "BEGIN", or may have been opened using a transaction savepoint created - # by the "SAVEPOINT one" statement. - # - do_test savepoint2-$ii.6 { - execsql $SQL(4) - execsql COMMIT - sqlite3_get_autocommit db - } {1} - integrity_check savepoint2-$ii.6.1 -} - -unset -nocomplain ::sig -unset -nocomplain SQL - -finish_test - DELETED test/savepoint3.test Index: test/savepoint3.test ================================================================== --- test/savepoint3.test +++ /dev/null @@ -1,137 +0,0 @@ -# 2008 December 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. -# -#*********************************************************************** -# -# $Id: savepoint3.test,v 1.4 2009/01/09 17:11:05 danielk1977 Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -source $testdir/malloc_common.tcl - -do_malloc_test savepoint3-1 -sqlprep { - CREATE TABLE t1(a, b, c); - INSERT INTO t1 VALUES(1, 2, 3); -} -sqlbody { - SAVEPOINT one; - INSERT INTO t1 VALUES(4, 5, 6); - SAVEPOINT two; - DELETE FROM t1; - ROLLBACK TO two; - RELEASE one; -} - -do_malloc_test savepoint3-2 -sqlprep { - PRAGMA cache_size = 10; - CREATE TABLE t1(a, b, c); - INSERT INTO t1 VALUES(randstr(400,400), randstr(400,400), randstr(400,400)); - INSERT INTO t1 SELECT - randstr(400,400), randstr(400,400), randstr(400,400) FROM t1; - INSERT INTO t1 - SELECT randstr(400,400), randstr(400,400), randstr(400,400) FROM t1; - INSERT INTO t1 - SELECT randstr(400,400), randstr(400,400), randstr(400,400) FROM t1; - INSERT INTO t1 - SELECT randstr(400,400), randstr(400,400), randstr(400,400) FROM t1; - INSERT INTO t1 - SELECT randstr(400,400), randstr(400,400), randstr(400,400) FROM t1; - INSERT INTO t1 - SELECT randstr(400,400), randstr(400,400), randstr(400,400) FROM t1; - INSERT INTO t1 - SELECT randstr(400,400), randstr(400,400), randstr(400,400) FROM t1; - INSERT INTO t1 - SELECT randstr(400,400), randstr(400,400), randstr(400,400) FROM t1; -} -sqlbody { - PRAGMA cache_size = 10; - SAVEPOINT one; - DELETE FROM t1 WHERE rowid < 5; - SAVEPOINT two; - DELETE FROM t1 WHERE rowid > 10; - ROLLBACK TO two; - ROLLBACK TO one; - RELEASE one; -} - -do_ioerr_test savepoint3.3 -sqlprep { - CREATE TABLE t1(a, b, c); - INSERT INTO t1 VALUES(1, randstr(1000,1000), randstr(1000,1000)); - INSERT INTO t1 VALUES(2, randstr(1000,1000), randstr(1000,1000)); -} -sqlbody { - BEGIN; - UPDATE t1 SET a = 3 WHERE a = 1; - SAVEPOINT one; - UPDATE t1 SET a = 4 WHERE a = 2; - COMMIT; -} -cleanup { - db eval { - SAVEPOINT one; - RELEASE one; - } -} - -# The following test does a really big savepoint rollback. One involving -# more than 4000 pages. The idea is to get a specific sqlite3BitvecSet() -# operation in pagerPlaybackSavepoint() to fail. -#do_malloc_test savepoint3-4 -sqlprep { -# BEGIN; -# CREATE TABLE t1(a, b); -# CREATE INDEX i1 ON t1(a); -# CREATE INDEX i2 ON t1(b); -# INSERT INTO t1 VALUES(randstr(500,500), randstr(500,500)); -- 1 -# INSERT INTO t1 VALUES(randstr(500,500), randstr(500,500)); -- 2 -# INSERT INTO t1 SELECT randstr(500,500), randstr(500,500) FROM t1; -- 4 -# INSERT INTO t1 SELECT randstr(500,500), randstr(500,500) FROM t1; -- 8 -# INSERT INTO t1 SELECT randstr(500,500), randstr(500,500) FROM t1; -- 16 -# INSERT INTO t1 SELECT randstr(500,500), randstr(500,500) FROM t1; -- 32 -# INSERT INTO t1 SELECT randstr(500,500), randstr(500,500) FROM t1; -- 64 -# INSERT INTO t1 SELECT randstr(500,500), randstr(500,500) FROM t1; -- 128 -# INSERT INTO t1 SELECT randstr(500,500), randstr(500,500) FROM t1; -- 256 -# INSERT INTO t1 SELECT randstr(500,500), randstr(500,500) FROM t1; -- 512 -# INSERT INTO t1 SELECT randstr(500,500), randstr(500,500) FROM t1; -- 1024 -# INSERT INTO t1 SELECT randstr(500,500), randstr(500,500) FROM t1; -- 2048 -# COMMIT; -# BEGIN; -# SAVEPOINT abc; -# UPDATE t1 SET a = randstr(500,500); -#} -sqlbody { -# ROLLBACK TO abc; -#} - - -# Cause a specific malloc in savepoint rollback code to fail. -# -do_malloc_test savepoint3-4 -start 7 -sqlprep { - PRAGMA auto_vacuum = incremental; - PRAGMA cache_size = 1000; - - CREATE TABLE t1(a, b); - CREATE TABLE t2(a, b); - CREATE TABLE t3(a, b); - INSERT INTO t1 VALUES(1, randstr(500,500)); - INSERT INTO t1 VALUES(2, randstr(500,500)); - INSERT INTO t1 VALUES(3, randstr(500,500)); - DELETE FROM t1; - - BEGIN; - INSERT INTO t1 VALUES(1, randstr(500,500)); - INSERT INTO t1 VALUES(2, randstr(500,500)); - INSERT INTO t1 VALUES(3, randstr(500,500)); - DROP TABLE t3; -- Page 5 of the database file is now free. - DROP TABLE t2; -- Page 4 of the database file is now free. - - SAVEPOINT abc; - PRAGMA incremental_vacuum; -} -sqlbody { - ROLLBACK TO abc; -} - - -finish_test - DELETED test/savepoint4.test Index: test/savepoint4.test ================================================================== --- test/savepoint4.test +++ /dev/null @@ -1,164 +0,0 @@ -# 2008 December 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. -# -#*********************************************************************** -# -# $Id: savepoint4.test,v 1.4 2009/02/10 14:45:13 danielk1977 Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - - -proc signature {} { - return [db eval {SELECT count(*), md5sum(x) FROM t1}] -} - -set ITERATIONS 25 ;# Number of iterations for savepoint4-1 -set ITERATIONS2 13 ;# Number of iterations for savepoint4-2 -expr srand(0) - -do_test savepoint4-1 { - execsql { - PRAGMA cache_size=10; - BEGIN; - CREATE TABLE t1(x TEXT); - INSERT INTO t1 VALUES(randstr(10,400)); - INSERT INTO t1 VALUES(randstr(10,400)); - INSERT INTO t1 SELECT randstr(10,400) FROM t1; - INSERT INTO t1 SELECT randstr(10,400) FROM t1; - INSERT INTO t1 SELECT randstr(10,400) FROM t1; - INSERT INTO t1 SELECT randstr(10,400) FROM t1; - INSERT INTO t1 SELECT randstr(10,400) FROM t1; - INSERT INTO t1 SELECT randstr(10,400) FROM t1; - INSERT INTO t1 SELECT randstr(10,400) FROM t1; - INSERT INTO t1 SELECT randstr(10,400) FROM t1; - INSERT INTO t1 SELECT randstr(10,400) FROM t1; - COMMIT; - SELECT count(*) FROM t1; - } -} {1024} - - -unset -nocomplain ::sig - -for {set ii 1} {$ii<=$ITERATIONS} {incr ii} { - set ::sig [signature] - - for {set iDelay 1 ; set crashed 1} {$crashed} {incr iDelay} { - - do_test savepoint4-1.$ii.1.$iDelay { - set ret [crashsql -delay $iDelay -file test.db-journal { - PRAGMA cache_size = 20; - SAVEPOINT one; - DELETE FROM t1 WHERE random()%2==0; - SAVEPOINT two; - INSERT INTO t1 SELECT randstr(10,10)||x FROM t1; - ROLLBACK TO two; - UPDATE t1 SET x = randstr(10, 400) WHERE random()%10; - RELEASE two; - ROLLBACK TO one; - RELEASE one; - }] - signature - } $::sig - - set crashed [lindex $ret 0] - integrity_check savepoint4-1.$ii.1.$iDelay.integrity - } - - do_test savepoint4-1.$ii.2 { - execsql { - DELETE FROM t1 WHERE random()%10==0; - INSERT INTO t1 SELECT randstr(10,10)||x FROM t1 WHERE random()%9==0; - } - } {} -} - -do_test savepoint4-2 { - execsql { - PRAGMA cache_size=10; - DROP TABLE IF EXISTS t1; - BEGIN; - CREATE TABLE t1(x TEXT); - CREATE INDEX i1 ON t1(x); - INSERT INTO t1 VALUES(randstr(10,400)); - INSERT INTO t1 VALUES(randstr(10,400)); - INSERT INTO t1 SELECT randstr(10,400) FROM t1; - INSERT INTO t1 SELECT randstr(10,400) FROM t1; - INSERT INTO t1 SELECT randstr(10,400) FROM t1; - INSERT INTO t1 SELECT randstr(10,400) FROM t1; - INSERT INTO t1 SELECT randstr(10,400) FROM t1; - INSERT INTO t1 SELECT randstr(10,400) FROM t1; - INSERT INTO t1 SELECT randstr(10,400) FROM t1; - COMMIT; - SELECT count(*) FROM t1; - } -} {256} - -for {set ii 1} {$ii<=$ITERATIONS2} {incr ii} { - set ::sig [signature] - set file test.db-journal - - for {set iDelay 1 ; set crashed 1} {$crashed} {incr iDelay} { - - do_test savepoint4-2.$ii.1.$iDelay { - - set ret [crashsql -delay $iDelay -file $file { - SAVEPOINT one; - INSERT INTO t1 SELECT * FROM t1 WHERE rowid<50; - ROLLBACK TO one; - INSERT INTO t1 SELECT * FROM t1 WHERE rowid<50; - SAVEPOINT two; - DELETE FROM t1 WHERE (random()%10)==0; - SAVEPOINT three; - DELETE FROM t1 WHERE (random()%10)==0; - SAVEPOINT four; - DELETE FROM t1 WHERE (random()%10)==0; - RELEASE two; - - SAVEPOINT three; - UPDATE t1 SET x = x||x WHERE (rowid%12)==0; - SAVEPOINT four; - UPDATE t1 SET x = x||x WHERE (rowid%14)==0; - ROLLBACK TO three; - UPDATE t1 SET x = x||x WHERE (rowid%13)==0; - RELEASE three; - - DELETE FROM t1 WHERE rowid > (SELECT rowid FROM t1 LIMIT 1 OFFSET 256); - RELEASE one; - }] - - set crashed [lindex $ret 0] - if {$crashed} { - signature - } else { - set ::sig - } - } $::sig - - integrity_check savepoint4-2.$ii.1.$iDelay.integrity - - if {$crashed == 0 && $file == "test.db-journal"} { - set crashed 1 - set iDelay 0 - set file test.db - set ::sig [signature] - } - } - - do_test savepoint4-2.$ii.2 { - execsql { - DELETE FROM t1 WHERE random()%10==0; - INSERT INTO t1 SELECT randstr(10,10)||x FROM t1 WHERE random()%9==0; - } - } {} -} - -finish_test - DELETED test/savepoint5.test Index: test/savepoint5.test ================================================================== --- test/savepoint5.test +++ /dev/null @@ -1,46 +0,0 @@ -# 2009 January 2 -# -# 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. -# -#*********************************************************************** -# -# Verify that a SAVEPOINT on a new, empty database followed by a -# ROLLBACK TO that savepoint starts over again with another new -# empty database. -# -# $Id: savepoint5.test,v 1.1 2009/01/02 21:08:09 drh Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -do_test savepoint5-1.1 { - db eval { - SAVEPOINT sp1; - CREATE TABLE t1(x); - INSERT INTO t1 VALUES(1); - SELECT count(*) FROM sqlite_master; - SELECT * FROM t1; - } -} {1 1} -do_test savepoint5-1.2 { - db eval { - ROLLBACK TO sp1; - SELECT count(*) FROM sqlite_master; - } -} {0} -do_test savepoint5-1.3 { - db eval { - CREATE TABLE t1(x); - INSERT INTO t1 VALUES(1); - SELECT count(*) FROM sqlite_master; - SELECT * FROM t1; - } -} {1 1} - - -finish_test DELETED test/savepoint6.test Index: test/savepoint6.test ================================================================== --- test/savepoint6.test +++ /dev/null @@ -1,273 +0,0 @@ -# 2009 January 3 -# -# 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. -# -#*********************************************************************** -# -# $Id: savepoint6.test,v 1.3 2009/01/07 17:06:53 danielk1977 Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -proc sql {zSql} { - uplevel db eval [list $zSql] - #puts stderr "$zSql ;" -} - -set DATABASE_SCHEMA { - PRAGMA auto_vacuum = incremental; - CREATE TABLE t1(x, y); - CREATE UNIQUE INDEX i1 ON t1(x); - CREATE INDEX i2 ON t1(y); -} - -#-------------------------------------------------------------------------- -# In memory database state. -# -# ::lSavepoint is a list containing one entry for each active savepoint. The -# first entry in the list corresponds to the most recently opened savepoint. -# Each entry consists of two elements: -# -# 1. The savepoint name. -# -# 2. A serialized Tcl array representing the contents of table t1 at the -# start of the savepoint. The keys of the array are the x values. The -# values are the y values. -# -# Array ::aEntry contains the contents of database table t1. Array keys are -# x values, the array data values are y values. -# -set lSavepoint [list] -array set aEntry [list] - -proc x_to_y {x} { - set nChar [expr int(rand()*250) + 250] - set str " $nChar [string repeat $x. $nChar]" - string range $str 1 $nChar -} -#-------------------------------------------------------------------------- - -#------------------------------------------------------------------------- -# Procs to operate on database: -# -# savepoint NAME -# rollback NAME -# release NAME -# -# insert_rows XVALUES -# delete_rows XVALUES -# -proc savepoint {zName} { - catch { sql "SAVEPOINT $zName" } - lappend ::lSavepoint [list $zName [array get ::aEntry]] -} - -proc rollback {zName} { - catch { sql "ROLLBACK TO $zName" } - for {set i [expr {[llength $::lSavepoint]-1}]} {$i>=0} {incr i -1} { - set zSavepoint [lindex $::lSavepoint $i 0] - if {$zSavepoint eq $zName} { - unset -nocomplain ::aEntry - array set ::aEntry [lindex $::lSavepoint $i 1] - - - if {$i+1 < [llength $::lSavepoint]} { - set ::lSavepoint [lreplace $::lSavepoint [expr $i+1] end] - } - break - } - } -} - -proc release {zName} { - catch { sql "RELEASE $zName" } - for {set i [expr {[llength $::lSavepoint]-1}]} {$i>=0} {incr i -1} { - set zSavepoint [lindex $::lSavepoint $i 0] - if {$zSavepoint eq $zName} { - set ::lSavepoint [lreplace $::lSavepoint $i end] - break - } - } - - if {[llength $::lSavepoint] == 0} { - #puts stderr "-- End of transaction!!!!!!!!!!!!!" - } -} - -proc insert_rows {lX} { - foreach x $lX { - set y [x_to_y $x] - - # Update database [db] - sql "INSERT OR REPLACE INTO t1 VALUES($x, '$y')" - - # Update the Tcl database. - set ::aEntry($x) $y - } -} - -proc delete_rows {lX} { - foreach x $lX { - # Update database [db] - sql "DELETE FROM t1 WHERE x = $x" - - # Update the Tcl database. - unset -nocomplain ::aEntry($x) - } -} -#------------------------------------------------------------------------- - -#------------------------------------------------------------------------- -# Proc to compare database content with the in-memory representation. -# -# checkdb -# -proc checkdb {} { - set nEntry [db one {SELECT count(*) FROM t1}] - set nEntry2 [array size ::aEntry] - if {$nEntry != $nEntry2} { - error "$nEntry entries in database, $nEntry2 entries in array" - } - db eval {SELECT x, y FROM t1} { - if {![info exists ::aEntry($x)]} { - error "Entry $x exists in database, but not in array" - } - if {$::aEntry($x) ne $y} { - error "Entry $x is set to {$y} in database, {$::aEntry($x)} in array" - } - } - - db eval { PRAGMA integrity_check } -} -#------------------------------------------------------------------------- - -#------------------------------------------------------------------------- -# Proc to return random set of x values. -# -# random_integers -# -proc random_integers {nRes nRange} { - set ret [list] - for {set i 0} {$i<$nRes} {incr i} { - lappend ret [expr int(rand()*$nRange)] - } - return $ret -} -#------------------------------------------------------------------------- - -proc database_op {} { - set i [expr int(rand()*2)] - if {$i==0} { - insert_rows [random_integers 100 1000] - } - if {$i==1} { - delete_rows [random_integers 100 1000] - set i [expr int(rand()*3)] - if {$i==0} { - sql {PRAGMA incremental_vacuum} - } - } -} - -proc savepoint_op {} { - set names {one two three four five} - set cmds {savepoint savepoint savepoint savepoint release rollback} - - set C [lindex $cmds [expr int(rand()*6)]] - set N [lindex $names [expr int(rand()*5)]] - - #puts stderr " $C $N ; " - #flush stderr - - $C $N - return ok -} - -expr srand(0) - -############################################################################ -############################################################################ -# Start of test cases. - -do_test savepoint6-1.1 { - sql $DATABASE_SCHEMA -} {} -do_test savepoint6-1.2 { - insert_rows { - 497 166 230 355 779 588 394 317 290 475 362 193 805 851 564 - 763 44 930 389 819 765 760 966 280 538 414 500 18 25 287 320 - 30 382 751 87 283 981 429 630 974 421 270 810 405 - } - - savepoint one - insert_rows 858 - delete_rows 930 - savepoint two - execsql {PRAGMA incremental_vacuum} - savepoint three - insert_rows 144 - rollback three - rollback two - release one - - execsql {SELECT count(*) FROM t1} -} {44} - -foreach zSetup [list { - set testname normal - sqlite3 db test.db -} { - set testname tempdb - sqlite3 db "" -} { - if {[catch {set ::permutations_test_prefix} z] == 0 && $z eq "journaltest"} { - continue - } - set testname nosync - sqlite3 db test.db - sql { PRAGMA synchronous = off } -} { - set testname smallcache - sqlite3 db test.db - sql { PRAGMA cache_size = 10 } -}] { - - unset -nocomplain ::lSavepoint - unset -nocomplain ::aEntry - - catch { db close } - file delete -force test.db - eval $zSetup - sql $DATABASE_SCHEMA - - do_test savepoint6-$testname.setup { - savepoint one - insert_rows [random_integers 100 1000] - release one - checkdb - } {ok} - - for {set i 0} {$i < 1000} {incr i} { - do_test savepoint6-$testname.$i.1 { - savepoint_op - checkdb - } {ok} - - do_test savepoint6-$testname.$i.2 { - database_op - database_op - checkdb - } {ok} - } -} - -unset -nocomplain ::lSavepoint -unset -nocomplain ::aEntry - -finish_test - Index: test/schema.test ================================================================== --- test/schema.test +++ test/schema.test @@ -11,11 +11,11 @@ # This file implements regression tests for SQLite library. # # This file tests the various conditions under which an SQLITE_SCHEMA # error should be returned. # -# $Id: schema.test,v 1.9 2009/02/04 17:40:58 drh Exp $ +# $Id: schema.test,v 1.8 2007/10/09 08:29:33 danielk1977 Exp $ #--------------------------------------------------------------------- # When any of the following types of SQL statements or actions are # executed, all pre-compiled statements are invalidated. An attempt # to execute an invalidated statement always returns SQLITE_SCHEMA. @@ -311,11 +311,11 @@ do_test schema-11.3 { set rc [catch { db function tstfunc {} } msg] list $rc $msg -} {1 {unable to delete/modify user-function due to active statements}} +} {1 {Unable to delete/modify user-function due to active statements}} do_test schema-11.4 { sqlite3_finalize $::STMT } {SQLITE_OK} do_test schema-11.5 { db collate tstcollate {} @@ -329,11 +329,11 @@ do_test schema-11.7 { set rc [catch { db collate tstcollate {} } msg] list $rc $msg -} {1 {unable to delete/modify collation sequence due to active statements}} +} {1 {Unable to delete/modify collation sequence due to active statements}} do_test schema-11.8 { sqlite3_finalize $::STMT } {SQLITE_OK} # The following demonstrates why statements need to be expired whenever Index: test/schema2.test ================================================================== --- test/schema2.test +++ test/schema2.test @@ -12,11 +12,11 @@ # # This file tests the various conditions under which an SQLITE_SCHEMA # error should be returned. This is a copy of schema.test that # has been altered to use sqlite3_prepare_v2 instead of sqlite3_prepare # -# $Id: schema2.test,v 1.4 2009/02/04 17:40:58 drh Exp $ +# $Id: schema2.test,v 1.3 2007/10/09 08:29:33 danielk1977 Exp $ #--------------------------------------------------------------------- # When any of the following types of SQL statements or actions are # executed, all pre-compiled statements are invalidated. An attempt # to execute an invalidated statement always returns SQLITE_SCHEMA. @@ -312,11 +312,11 @@ do_test schema2-11.3 { set rc [catch { db function tstfunc {} } msg] list $rc $msg -} {1 {unable to delete/modify user-function due to active statements}} +} {1 {Unable to delete/modify user-function due to active statements}} do_test schema2-11.4 { sqlite3_finalize $::STMT } {SQLITE_OK} do_test schema2-11.5 { db collate tstcollate {} @@ -330,11 +330,11 @@ do_test schema2-11.7 { set rc [catch { db collate tstcollate {} } msg] list $rc $msg -} {1 {unable to delete/modify collation sequence due to active statements}} +} {1 {Unable to delete/modify collation sequence due to active statements}} do_test schema2-11.8 { sqlite3_finalize $::STMT } {SQLITE_OK} finish_test Index: test/select2.test ================================================================== --- test/select2.test +++ test/select2.test @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the SELECT statement. # -# $Id: select2.test,v 1.28 2009/01/15 15:23:59 drh Exp $ +# $Id: select2.test,v 1.27 2008/07/12 14:52:20 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Create a table with some data @@ -88,15 +88,15 @@ execsql {COMMIT} }] list } {} puts "time without cache: $t2" -#ifcapable tclvar { -# do_test select2-2.0.3 { -# expr {[lindex $t1 0]<[lindex $t2 0]} -# } 1 -#} +ifcapable tclvar { + do_test select2-2.0.3 { + expr {[lindex $t1 0]<[lindex $t2 0]} + } 1 +} do_test select2-2.1 { execsql {SELECT count(*) FROM tbl2} } {30000} do_test select2-2.2 { Index: test/select6.test ================================================================== --- test/select6.test +++ test/select6.test @@ -10,11 +10,11 @@ #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing SELECT statements that contain # subqueries in their FROM clause. # -# $Id: select6.test,v 1.29 2009/01/09 01:12:28 drh Exp $ +# $Id: select6.test,v 1.28 2008/08/20 16:35:10 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Omit this whole file if the library is build without subquery support. @@ -498,19 +498,9 @@ do_test select6-9.9 { execsql { SELECT x FROM (SELECT x FROM t1 LIMIT -1 OFFSET 1); } } {2 3 4} -do_test select6-9.10 { - execsql { - SELECT x, y FROM (SELECT x, (SELECT 10+x) y FROM t1 LIMIT -1 OFFSET 1); - } -} {2 12 3 13 4 14} -do_test select6-9.11 { - execsql { - SELECT x, y FROM (SELECT x, (SELECT 10)+x y FROM t1 LIMIT -1 OFFSET 1); - } -} {2 12 3 13 4 14} finish_test Index: test/shared.test ================================================================== --- test/shared.test +++ test/shared.test @@ -7,11 +7,11 @@ # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # -# $Id: shared.test,v 1.35 2008/11/21 00:10:35 aswift Exp $ +# $Id: shared.test,v 1.34 2008/07/12 14:52:20 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl db close @@ -40,24 +40,10 @@ db close break } } -# if we're using proxy locks, we use 2 filedescriptors for a db -# that is open but NOT yet locked, after a lock is taken we'll have 3, -# normally sqlite uses 1 (proxy locking adds the conch and the local lock) -set using_proxy 0 -foreach {name value} [array get env SQLITE_FORCE_PROXY_LOCKING] { - set using_proxy $value -} -set extrafds_prelock 0 -set extrafds_postlock 0 -if {$using_proxy>0} { - set extrafds_prelock 1 - set extrafds_postlock 2 -} - # $av is currently 0 if this loop iteration is to test with auto-vacuum turned # off, and 1 if it is turned on. Increment it so that (1 -> no auto-vacuum) # and (2 -> auto-vacuum). The sole reason for this is so that it looks nicer # when we use this variable as part of test-case names. # @@ -86,11 +72,10 @@ # Open a second database on the file test.db. It should use the same pager # cache and schema as the original connection. Verify that only 1 file is # opened. sqlite3 db2 test.db set ::sqlite_open_file_count - expr $sqlite_open_file_count-$extrafds_postlock } {1} do_test shared-$av.1.2 { # Add a table and a single row of data via the first connection. # Ensure that the second connection can see them. execsql { @@ -167,11 +152,10 @@ sqlite3 db3 ./test.db } else { sqlite3 db3 TEST.DB } set ::sqlite_open_file_count - expr $sqlite_open_file_count-($extrafds_prelock+$extrafds_postlock) } {2} do_test shared-$av.2.2 { # Start read transactions on db and db2 (the shared pager cache). Ensure # db3 cannot write to the database. execsql { @@ -298,21 +282,18 @@ file delete -force test2.db-journal sqlite3 db test.db sqlite3 db2 test2.db do_test shared-$av.4.1.1 { set sqlite_open_file_count - expr $sqlite_open_file_count-($extrafds_prelock*2) } {2} do_test shared-$av.4.1.2 { execsql {ATTACH 'test2.db' AS test2} set sqlite_open_file_count - expr $sqlite_open_file_count-($extrafds_postlock*2) } {2} do_test shared-$av.4.1.3 { execsql {ATTACH 'test.db' AS test} db2 set sqlite_open_file_count - expr $sqlite_open_file_count-($extrafds_postlock*2) } {2} # Sanity check: Create a table in ./test.db via handle db, and test that handle # db2 can "see" the new table immediately. A handle using a seperate pager # cache would have to reload the database schema before this were possible. Index: test/soak.test ================================================================== --- test/soak.test +++ test/soak.test @@ -9,11 +9,11 @@ # #*********************************************************************** # This file is the driver for the "soak" tests. It is a peer of the # quick.test and all.test scripts. # -# $Id: soak.test,v 1.4 2008/11/13 18:29:51 shane Exp $ +# $Id: soak.test,v 1.3 2008/07/12 14:52:20 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl rename finish_test really_finish_test proc finish_test {} {} @@ -45,14 +45,14 @@ # pseudo-random data in some way over and over again for a very # long time. The number of tests run depends on the value of # global variable $TIMEOUT - tests are run for at least $TIMEOUT # seconds. # -# fuzz.test (pseudo-random SQL statements) -# trans.test (pseudo-random changes to a database followed by rollbacks) -# fuzz_malloc.test -# corruptC.test (pseudo-random corruption to a database) +# fuzz.test (pseudo-random SQL statements) +# trans.test (pseudo-random changes to a database followed by rollbacks) +# +# fuzzy malloc? # # Many database changes maintaining some kind of invariant. # Storing checksums etc. # @@ -60,11 +60,10 @@ # set SOAKTESTS { fuzz.test fuzz_malloc.test trans.test - corruptC.test } set ISQUICK 1 set soak_starttime [clock seconds] Index: test/subquery.test ================================================================== --- test/subquery.test +++ test/subquery.test @@ -9,11 +9,11 @@ # #************************************************************************* # This file implements regression tests for SQLite library. The # focus of this script is testing correlated subqueries # -# $Id: subquery.test,v 1.17 2009/01/09 01:12:28 drh Exp $ +# $Id: subquery.test,v 1.16 2008/07/10 00:32:42 drh Exp $ # set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -266,15 +266,10 @@ CREATE VIEW v1 AS SELECT b FROM t1 WHERE a>0; CREATE TABLE t2(p,q); INSERT INTO t2 VALUES(2,9); SELECT * FROM v1 WHERE EXISTS(SELECT * FROM t2 WHERE p=v1.b); } - } {2} - do_test subquery-3.1.1 { - execsql { - SELECT * FROM v1 WHERE EXISTS(SELECT 1); - } } {2} } else { catchsql { DROP TABLE t1; } catchsql { DROP TABLE t2; } execsql { Index: test/substr.test ================================================================== --- test/substr.test +++ test/substr.test @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the built-in SUBSTR() functions. # -# $Id: substr.test,v 1.7 2009/02/03 13:10:54 drh Exp $ +# $Id: substr.test,v 1.3 2007/10/12 19:11:55 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl ifcapable !tclvar { @@ -64,66 +64,37 @@ # substr-test 1.1 abcdefg 1 1 a substr-test 1.2 abcdefg 2 1 b substr-test 1.3 abcdefg 1 2 ab substr-test 1.4 abcdefg 1 100 abcdefg -substr-test 1.5 abcdefg 0 2 a +substr-test 1.5 abcdefg 0 1 a substr-test 1.6 abcdefg -1 1 g substr-test 1.7 abcdefg -1 10 g substr-test 1.8 abcdefg -5 3 cde substr-test 1.9 abcdefg -7 3 abc substr-test 1.10 abcdefg -100 98 abcde -substr-test 1.11 abcdefg 5 -1 d -substr-test 1.12 abcdefg 5 -4 abcd -substr-test 1.13 abcdefg 5 -5 abcd -substr-test 1.14 abcdefg -5 -1 b -substr-test 1.15 abcdefg -5 -2 ab -substr-test 1.16 abcdefg -5 -3 ab -substr-test 1.17 abcdefg 100 200 {} -substr-test 1.18 abcdefg 200 100 {} - -# Make sure NULL is returned if any parameter is NULL -# -do_test substr-1.90 { - db eval {SELECT ifnull(substr(NULL,1,1),'nil')} -} nil -do_test substr-1.91 { - db eval {SELECT ifnull(substr(NULL,1),'nil')} -} nil -do_test substr-1.92 { - db eval {SELECT ifnull(substr('abcdefg',NULL,1),'nil')} -} nil -do_test substr-1.93 { - db eval {SELECT ifnull(substr('abcdefg',NULL),'nil')} -} nil -do_test substr-1.94 { - db eval {SELECT ifnull(substr('abcdefg',1,NULL),'nil')} -} nil # Make sure everything works with long unicode characters # substr-test 2.1 \u1234\u2345\u3456 1 1 \u1234 substr-test 2.2 \u1234\u2345\u3456 2 1 \u2345 substr-test 2.3 \u1234\u2345\u3456 1 2 \u1234\u2345 substr-test 2.4 \u1234\u2345\u3456 -1 1 \u3456 substr-test 2.5 a\u1234b\u2345c\u3456c -5 3 b\u2345c -substr-test 2.6 a\u1234b\u2345c\u3456c -2 -3 b\u2345c # Basic functionality for BLOBs # subblob-test 3.1 61626364656667 1 1 61 subblob-test 3.2 61626364656667 2 1 62 subblob-test 3.3 61626364656667 1 2 6162 subblob-test 3.4 61626364656667 1 100 61626364656667 -subblob-test 3.5 61626364656667 0 2 61 +subblob-test 3.5 61626364656667 0 1 61 subblob-test 3.6 61626364656667 -1 1 67 subblob-test 3.7 61626364656667 -1 10 67 subblob-test 3.8 61626364656667 -5 3 636465 subblob-test 3.9 61626364656667 -7 3 616263 subblob-test 3.10 61626364656667 -100 98 6162636465 -subblob-test 3.11 61626364656667 100 200 {} -subblob-test 3.12 61626364656667 200 100 {} # If these blobs were strings, then they would contain multi-byte # characters. But since they are blobs, the substr indices refer # to bytes. # Index: test/table.test ================================================================== --- test/table.test +++ test/table.test @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the CREATE TABLE statement. # -# $Id: table.test,v 1.49 2009/01/16 11:04:58 danielk1977 Exp $ +# $Id: table.test,v 1.48 2007/10/09 08:29:33 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Create a basic table and verify it is added to sqlite_master @@ -312,18 +312,10 @@ do_test table-7.3 { execsql2 { SELECT * FROM weird; } } {desc a asc b key 9 14_vac 0 fuzzy_dog_12 xyz begin hi end y'all} -do_test table-7.3 { - execsql { - CREATE TABLE savepoint(release); - INSERT INTO savepoint(release) VALUES(10); - UPDATE savepoint SET release = 5; - SELECT release FROM savepoint; - } -} {5} # Try out the CREATE TABLE AS syntax # do_test table-8.1 { execsql2 { Index: test/tclsqlite.test ================================================================== --- test/tclsqlite.test +++ test/tclsqlite.test @@ -13,11 +13,11 @@ # # Actually, all tests are based on the TCL interface, so the main # interface is pretty well tested. This file contains some addition # tests for fringe issues that the main test suite does not cover. # -# $Id: tclsqlite.test,v 1.72 2009/02/04 22:46:47 drh Exp $ +# $Id: tclsqlite.test,v 1.70 2008/10/09 14:45:26 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Check the error messages generated by tclsqlite @@ -33,11 +33,11 @@ lappend v $msg } [list 1 "wrong # args: should be \"$r\""] do_test tcl-1.2 { set v [catch {db bogus} msg] lappend v $msg -} {1 {bad option "bogus": must be authorizer, backup, busy, cache, changes, close, collate, collation_needed, commit_hook, complete, copy, enable_load_extension, errorcode, eval, exists, function, incrblob, interrupt, last_insert_rowid, nullvalue, onecolumn, profile, progress, rekey, restore, rollback_hook, status, timeout, total_changes, trace, transaction, update_hook, or version}} +} {1 {bad option "bogus": must be authorizer, busy, cache, changes, close, collate, collation_needed, commit_hook, complete, copy, enable_load_extension, errorcode, eval, exists, function, incrblob, interrupt, last_insert_rowid, nullvalue, onecolumn, profile, progress, rekey, rollback_hook, status, timeout, total_changes, trace, transaction, update_hook, or version}} do_test tcl-1.2.1 { set v [catch {db cache bogus} msg] lappend v $msg } {1 {bad option "bogus": must be flush or size}} do_test tcl-1.2.2 { @@ -412,30 +412,29 @@ error test-error } } } db eval {SELECT * FROM t4} -} {1 2} +} {1 2 3 4} do_test tcl-10.10 { for {set i 0} {$i<1} {incr i} { db transaction { db eval {INSERT INTO t4 VALUES(5)} continue } - error "This line should not be run" } db eval {SELECT * FROM t4} -} {1 2 5} +} {1 2 3 4 5} do_test tcl-10.11 { for {set i 0} {$i<10} {incr i} { db transaction { db eval {INSERT INTO t4 VALUES(6)} break } } db eval {SELECT * FROM t4} -} {1 2 5 6} +} {1 2 3 4 5 6} do_test tcl-10.12 { set rc [catch { for {set i 0} {$i<10} {incr i} { db transaction { db eval {INSERT INTO t4 VALUES(7)} @@ -444,129 +443,17 @@ } }] } {2} do_test tcl-10.13 { db eval {SELECT * FROM t4} -} {1 2 5 6 7} - -# Now test that [db transaction] commands may be nested with -# the expected results. -# -do_test tcl-10.14 { - db transaction { - db eval { - DELETE FROM t4; - INSERT INTO t4 VALUES('one'); - } - - catch { - db transaction { - db eval { INSERT INTO t4 VALUES('two') } - db transaction { - db eval { INSERT INTO t4 VALUES('three') } - error "throw an error!" - } - } - } - } - - db eval {SELECT * FROM t4} -} {one} -do_test tcl-10.15 { - # Make sure a transaction has not been left open. - db eval {BEGIN ; COMMIT} -} {} -do_test tcl-10.16 { - db transaction { - db eval { INSERT INTO t4 VALUES('two'); } - db transaction { - db eval { INSERT INTO t4 VALUES('three') } - db transaction { - db eval { INSERT INTO t4 VALUES('four') } - } - } - } - db eval {SELECT * FROM t4} -} {one two three four} -do_test tcl-10.17 { - catch { - db transaction { - db eval { INSERT INTO t4 VALUES('A'); } - db transaction { - db eval { INSERT INTO t4 VALUES('B') } - db transaction { - db eval { INSERT INTO t4 VALUES('C') } - error "throw an error!" - } - } - } - } - db eval {SELECT * FROM t4} -} {one two three four} -do_test tcl-10.18 { - # Make sure a transaction has not been left open. - db eval {BEGIN ; COMMIT} -} {} - -# Mess up a [db transaction] command by locking the database using a -# second connection when it tries to commit. Make sure the transaction -# is not still open after the "database is locked" exception is thrown. -# -do_test tcl-10.18 { - sqlite3 db2 test.db - db2 eval { - BEGIN; - SELECT * FROM sqlite_master; - } - - set rc [catch { - db transaction { - db eval {INSERT INTO t4 VALUES('five')} - } - } msg] - list $rc $msg -} {1 {database is locked}} -do_test tcl-10.19 { - db eval {BEGIN ; COMMIT} -} {} - -# Thwart a [db transaction] command by locking the database using a -# second connection with "BEGIN EXCLUSIVE". Make sure no transaction is -# open after the "database is locked" exception is thrown. -# -do_test tcl-10.20 { - db2 eval { - COMMIT; - BEGIN EXCLUSIVE; - } - set rc [catch { - db transaction { - db eval {INSERT INTO t4 VALUES('five')} - } - } msg] - list $rc $msg -} {1 {database is locked}} -do_test tcl-10.21 { - db2 close - db eval {BEGIN ; COMMIT} -} {} -do_test tcl-10.22 { - sqlite3 db2 test.db - db transaction exclusive { - catch { db2 eval {SELECT * FROM sqlite_master} } msg - set msg "db2: $msg" - } - set msg -} {db2: database is locked} -db2 close +} {1 2 3 4 5 6 7} do_test tcl-11.1 { - db eval {INSERT INTO t4 VALUES(6)} - db exists {SELECT x,x*2,x+x FROM t4 WHERE x==6} + db exists {SELECT x,x*2,x+x FROM t4 WHERE x==4} } {1} do_test tcl-11.2 { - db exists {SELECT 0 FROM t4 WHERE x==6} + db exists {SELECT 0 FROM t4 WHERE x==4} } {1} do_test tcl-11.3 { db exists {SELECT 1 FROM t4 WHERE x==8} } {0} Index: test/temptable.test ================================================================== --- test/temptable.test +++ test/temptable.test @@ -10,11 +10,11 @@ #*********************************************************************** # This file implements regression tests for SQLite library. # # This file implements tests for temporary tables and indices. # -# $Id: temptable.test,v 1.20 2009/02/10 11:17:43 danielk1977 Exp $ +# $Id: temptable.test,v 1.19 2007/10/09 08:29:33 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl ifcapable !tempdb { @@ -417,24 +417,6 @@ # -readonly flag is taken so seriously that a subsequent [file delete -force] # (required before the next test file can be executed) will fail. # catch {file attributes test.db -readonly 0} -do_test temptable-8.0 { - db close - catch {file delete -force test.db} - sqlite3 db test.db -} {} -do_test temptable-8.1 { - execsql { CREATE TEMP TABLE tbl2(a, b); } - execsql { - CREATE TABLE tbl(a, b); - INSERT INTO tbl VALUES(1, 2); - } - execsql {SELECT * FROM tbl} -} {1 2} -do_test temptable-8.2 { - execsql { CREATE TEMP TABLE tbl(a, b); } - execsql {SELECT * FROM tbl} -} {} - finish_test Index: test/tester.tcl ================================================================== --- test/tester.tcl +++ test/tester.tcl @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements some common TCL routines used for regression # testing the SQLite library # -# $Id: tester.tcl,v 1.139 2009/02/05 16:31:46 drh Exp $ +# $Id: tester.tcl,v 1.134 2008/08/05 17:53:24 drh Exp $ # # What for user input before continuing. This gives an opportunity # to connect profiling tools to the process. # @@ -25,11 +25,11 @@ set argv [lreplace $argv $i $i] } } set tcl_precision 15 -sqlite3_test_control_pending_byte 0x0010000 +set sqlite_pending_byte 0x0010000 # # Check the command-line arguments for a default soft-heap-limit. # Store this default value in the global variable ::soft_limit and # update the soft-heap-limit each time this script is run. In that @@ -135,22 +135,18 @@ if {[info exists tester_do_binarylog]} { sqlite3_instvfs binarylog -default binarylog ostrace.bin sqlite3_instvfs marker binarylog "$argv0 $argv" } } - -proc reset_db {} { - catch {db close} - file delete -force test.db - file delete -force test.db-journal - sqlite3 db ./test.db - set ::DB [sqlite3_connection_pointer db] - if {[info exists ::SETUP_SQL]} { - db eval $::SETUP_SQL - } -} -reset_db +catch {db close} +file delete -force test.db +file delete -force test.db-journal +sqlite3 db ./test.db +set ::DB [sqlite3_connection_pointer db] +if {[info exists ::SETUP_SQL]} { + db eval $::SETUP_SQL +} # Abort early if this script has been run before. # if {[info exists nTest]} return @@ -483,13 +479,15 @@ } } # Do an integrity check of the entire database # -proc integrity_check {name {db db}} { +proc integrity_check {name} { ifcapable integrityck { - do_test $name [list execsql {PRAGMA integrity_check} $db] {ok} + do_test $name { + execsql {PRAGMA integrity_check} + } {ok} } } proc fix_ifcapable_expr {expr} { set ret "" @@ -574,11 +572,11 @@ set cfile [file join [pwd] $crashfile] set f [open crash.tcl w] puts $f "sqlite3_crash_enable 1" puts $f "sqlite3_crashparams $blocksize $dc $crashdelay $cfile" - puts $f "sqlite3_test_control_pending_byte $::sqlite_pending_byte" + puts $f "set sqlite_pending_byte $::sqlite_pending_byte" puts $f "sqlite3 db test.db -vfs crash" # This block sets the cache size of the main database to 10 # pages. This is done in case the build is configured to omit # "PRAGMA cache_size". @@ -659,11 +657,10 @@ # Delete the files test.db and test2.db, then execute the TCL and # SQL (in that order) to prepare for the test case. do_test $testname.$n.1 { set ::sqlite_io_error_pending 0 catch {db close} - catch {db2 close} catch {file delete -force test.db} catch {file delete -force test.db-journal} catch {file delete -force test2.db} catch {file delete -force test2.db-journal} set ::DB [sqlite3 db test.db; sqlite3_connection_pointer db] @@ -864,28 +861,10 @@ } foreach prag {default_cache_size} { append txt $prag-[$db eval "PRAGMA $prag"]\n } # puts txt=$txt - return [md5 $txt] -} - -# Generate a checksum based on the contents of a single database with -# a database connection. The name of the database is $dbname. -# Examples of $dbname are "temp" or "main". -# -proc dbcksum {db dbname} { - if {$dbname=="temp"} { - set master sqlite_temp_master - } else { - set master $dbname.sqlite_master - } - set alltab [$db eval "SELECT name FROM $master WHERE type='table'"] - set txt [$db eval "SELECT * FROM $master"]\n - foreach tab $alltab { - append txt [$db eval "SELECT * FROM $dbname.$tab"]\n - } return [md5 $txt] } proc memdebug_log_sql {{filename mallocs.sql}} { Index: test/thread001.test ================================================================== --- test/thread001.test +++ test/thread001.test @@ -7,11 +7,11 @@ # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # -# $Id: thread001.test,v 1.8 2009/02/04 11:57:46 danielk1977 Exp $ +# $Id: thread001.test,v 1.6 2008/10/07 15:25:49 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl ifcapable !mutex { @@ -20,21 +20,17 @@ source $testdir/thread_common.tcl if {[info commands sqlthread] eq ""} { return } -set ::enable_shared_cache [sqlite3_enable_shared_cache] - set ::NTHREAD 10 # Run this test three times: # # 1) All threads use the same database handle. # 2) All threads use their own database handles. # 3) All threads use their own database handles, shared-cache is enabled. -# -# # foreach {tn same_db shared_cache} [list \ 1 1 0 \ 2 0 0 \ 3 0 1 \ @@ -46,11 +42,11 @@ do_test thread001.$tn.0 { db close sqlite3_enable_shared_cache $shared_cache sqlite3_enable_shared_cache $shared_cache } $shared_cache - sqlite3 db test.db -fullmutex 1 + sqlite3 db test.db set dbconfig "" if {$same_db} { set dbconfig [list set ::DB [sqlite3_connection_pointer db]] } @@ -76,17 +72,15 @@ } } {1} do_test thread001.$tn.3 { execsql { PRAGMA integrity_check } } {ok} - + set thread_program { - #sqlthread parent {puts STARTING..} set needToClose 0 if {![info exists ::DB]} { set ::DB [sqlthread open test.db] - #sqlthread parent "puts \"OPEN $::DB\"" set needToClose 1 } for {set i 0} {$i < 100} {incr i} { # Test that the invariant is true. @@ -101,14 +95,12 @@ # Add another row to the database. execsql { INSERT INTO ab SELECT NULL, md5sum(a, b) FROM ab } } if {$needToClose} { - #sqlthread parent "puts \"CLOSE $::DB\"" sqlite3_close $::DB } - #sqlthread parent "puts \"DONE\"" list OK } # Kick off $::NTHREAD threads: @@ -144,7 +136,6 @@ do_test thread001.$tn.7 { execsql { PRAGMA integrity_check } } {ok} } -sqlite3_enable_shared_cache $::enable_shared_cache finish_test Index: test/thread002.test ================================================================== --- test/thread002.test +++ test/thread002.test @@ -10,11 +10,11 @@ #*********************************************************************** # # This test attempts to deadlock SQLite in shared-cache mode. # # -# $Id: thread002.test,v 1.5 2009/02/04 11:57:46 danielk1977 Exp $ +# $Id: thread002.test,v 1.4 2008/10/07 15:25:49 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl source $testdir/thread_common.tcl @@ -26,11 +26,11 @@ finish_test return } db close -set ::enable_shared_cache [sqlite3_enable_shared_cache 1] +sqlite3_enable_shared_cache 1 set ::NTHREAD 10 do_test thread002.1 { # Create 3 databases with identical schemas: @@ -104,7 +104,6 @@ db close set res } [list [expr 1 + $::NTHREAD*100] ok] } -sqlite3_enable_shared_cache $::enable_shared_cache finish_test Index: test/thread_common.tcl ================================================================== --- test/thread_common.tcl +++ test/thread_common.tcl @@ -7,11 +7,11 @@ # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # -# $Id: thread_common.tcl,v 1.3 2009/01/19 17:40:12 drh Exp $ +# $Id: thread_common.tcl,v 1.2 2007/09/10 10:53:02 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl if {[info commands sqlthread] eq ""} { @@ -35,11 +35,10 @@ while {$rc eq "SQLITE_LOCKED" || $rc eq "SQLITE_BUSY" || $rc eq "SQLITE_SCHEMA"} { set res [list] - enter_db_mutex $::DB set err [catch { set ::STMT [sqlite3_prepare_v2 $::DB $sql -1 dummy_tail] } msg] if {$err == 0} { @@ -58,25 +57,20 @@ } if {[string first locked [sqlite3_errmsg $::DB]]>=0} { set rc SQLITE_LOCKED } - if {$rc ne "SQLITE_OK"} { - set errtxt "$rc - [sqlite3_errmsg $::DB] (debug1)" - } - leave_db_mutex $::DB if {$rc eq "SQLITE_LOCKED" || $rc eq "SQLITE_BUSY"} { - #sqlthread parent "puts \"thread [sqlthread id] is busy. rc=$rc\"" - after 200 - } else { - #sqlthread parent "puts \"thread [sqlthread id] ran $sql\"" + #puts -nonewline "([sqlthread id] $rc)" + #flush stdout + after 20 } } if {$rc ne "SQLITE_OK"} { - error $errtxt + error "$rc - [sqlite3_errmsg $::DB]" } set res } proc do_test {name script result} { Index: test/tkt1667.test ================================================================== --- test/tkt1667.test +++ test/tkt1667.test @@ -12,11 +12,11 @@ # # This file implements tests to verify that ticket #1667 has been # fixed. # # -# $Id: tkt1667.test,v 1.4 2009/02/05 17:00:54 drh Exp $ +# $Id: tkt1667.test,v 1.3 2008/07/12 14:52:20 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl ifcapable !autovacuum||!tclvar { @@ -30,11 +30,11 @@ # Set the pending byte offset such that the page it is on is # the first autovacuum pointer map page in the file (assume a page # size of 1024). set first_ptrmap_page [expr 1024/5 + 3] -sqlite3_test_control_pending_byte [expr 1024 * ($first_ptrmap_page-1)] +set sqlite_pending_byte [expr 1024 * ($first_ptrmap_page-1)] sqlite db test.db do_test tkt1667-1 { execsql { DELETED test/tkt2565.test Index: test/tkt2565.test ================================================================== --- test/tkt2565.test +++ /dev/null @@ -1,90 +0,0 @@ -# 2009 January 8 -# -# 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 script attempts to reproduce the circumstances of ticket #2565. -# -# More specifically, this script attempts to generate rollback journals -# that contain headers with nRec==0 that are followed by additional -# valid headers. -# -# $Id: tkt2565.test,v 1.1 2009/01/08 15:24:02 drh Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -# Use the alternative pcache and rig it to call pagerStress() -# very frequently. -# -db close -sqlite3_shutdown -sqlite3_config_alt_pcache 1 100 0 1 - -# Open two database connections to database "test.db". -# -proc reopen_database {} { - catch {db close} - sqlite3 db test.db - db cache size 0 - execsql { - pragma page_size=512; - pragma auto_vacuum=2; - pragma cache_size=16; - } -} - -# Open two database connections and create a single table in the db. -# -do_test tkt2565-1.0 { - reopen_database - execsql { CREATE TABLE A(Id INTEGER, Name TEXT) } -} {} - -for {set iFail 1} {$iFail<200} {incr iFail} { - reopen_database - execsql { pragma locking_mode=exclusive } - set nRow [db one {SELECT count(*) FROM a}] - - # Dirty (at least) one of the pages in the cache. - do_test tkt2565-1.$iFail.1 { - execsql { - BEGIN EXCLUSIVE; - INSERT INTO a VALUES(1, 'ABCDEFGHIJKLMNOP'); - } - } {} - - # Now try to commit the transaction. Cause an IO error to occur - # within this operation, which moves the pager into the error state. - # - set ::sqlite_io_error_persist 1 - set ::sqlite_io_error_pending $iFail - do_test tkt2565-1.$iFail.2 { - set rc [catchsql {COMMIT}] - list - } {} - set ::sqlite_io_error_persist 0 - set ::sqlite_io_error_pending 0 - if {!$::sqlite_io_error_hit} break - set ::sqlite_io_error_hit 0 -} - -# Make sure this test script doesn't leave any files open. -# -do_test tkt2565-1.X { - catch { db close } - set sqlite_open_file_count -} 0 - -# Restore the pcache configuration for subsequent tests. -# -sqlite3_shutdown -sqlite3_config_alt_pcache 0 - -finish_test Index: test/tkt3080.test ================================================================== --- test/tkt3080.test +++ test/tkt3080.test @@ -12,11 +12,11 @@ # Ticket #3080 # # Make sure that application-defined functions are able to recursively # invoke SQL statements that create and drop virtual tables. # -# $Id: tkt3080.test,v 1.2 2008/11/05 16:37:35 drh Exp $ +# $Id: tkt3080.test,v 1.1 2008/04/28 17:12:11 drh Exp $ # set testdir [file dirname $argv0] source $testdir/tester.tcl @@ -46,11 +46,11 @@ } {1 {database table is locked}} do_test tkt3080.4 { db eval { SELECT name FROM sqlite_master; } -} {t1 t2 t3} +} {t1 t2} ifcapable vtab { register_echo_module [sqlite3_connection_pointer db] do_test tkt3080.10 { set sql { @@ -64,14 +64,14 @@ } db eval { SELECT execsql(x) FROM t1 } execsql {SELECT name FROM sqlite_master} - } {t1 t2 t3} + } {t1 t2} do_test tkt3080.11 { execsql {SELECT * FROM t2} } {123} } finish_test Index: test/tkt3346.test ================================================================== --- test/tkt3346.test +++ test/tkt3346.test @@ -10,11 +10,11 @@ #*********************************************************************** # # This file implements regression tests for SQLite library. The # focus of this file is testing the fix for ticket #3346 # -# $Id: tkt3346.test,v 1.3 2008/12/09 13:12:57 drh Exp $ +# $Id: tkt3346.test,v 1.1 2008/09/01 15:52:11 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl do_test tkt3346-1.1 { @@ -25,43 +25,7 @@ INSERT INTO t1 VALUES(3,'claire'); SELECT *, ( SELECT y FROM (SELECT x.b='alice' AS y) ) FROM ( SELECT * FROM t1 ) AS x; } } {2 bob 0 1 alice 1 3 claire 0} -do_test tkt3346-1.2 { - db eval { - SELECT b FROM (SELECT * FROM t1) AS x - WHERE (SELECT y FROM (SELECT x.b='alice' AS y))=0 - } -} {bob claire} -do_test tkt3346-1.3 { - db eval { - SELECT b FROM (SELECT * FROM t1 ORDER BY a) AS x - WHERE (SELECT y FROM (SELECT a||b y FROM t1 WHERE t1.b=x.b))=(x.a||x.b) - } -} {alice bob claire} -do_test tkt3346-1.4 { - db eval { - SELECT b FROM (SELECT * FROM t1 ORDER BY a) AS x - WHERE (SELECT y FROM (SELECT a||b y FROM t1 WHERE t1.b=x.b))=('2'||x.b) - } -} {bob} - -# Ticket #3530 -# -# As shown by ticket #3346 above (see also ticket #3298) it is important -# that a subquery in the result-set be able to look up through multiple -# FROM levels in order to view tables in the FROM clause at the top level. -# -# But ticket #3530 shows us that a subquery in the FROM clause should not -# be able to look up to higher levels: -# -do_test tkt3346-2.1 { - catchsql { - CREATE TABLE t2(a); - INSERT INTO t2 VALUES(1); - - SELECT * FROM (SELECT * FROM t1 WHERE 1=x.a) AS x; - } -} {1 {no such column: x.a}} finish_test DELETED test/tkt3442.test Index: test/tkt3442.test ================================================================== --- test/tkt3442.test +++ /dev/null @@ -1,73 +0,0 @@ -# 2008 October 20 -# -# 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. -# -# This file implements tests to verify that ticket #3442 has been -# fixed. -# -# -# $Id: tkt3442.test,v 1.1 2008/10/22 16:04:43 shane Exp $ - - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - - -# Create a schema with some indexes. -# -do_test tkt3442-1.1 { - execsql { - CREATE TABLE listhash( - key INTEGER PRIMARY KEY, - id TEXT, - node INTEGER - ); - CREATE UNIQUE INDEX ididx ON listhash(id); - } -} {} - - -# Explain Query Plan -# -proc EQP {sql} { - uplevel "execsql {EXPLAIN QUERY PLAN $sql}" -} - - -# These tests perform an EXPLAIN QUERY PLAN on both versions of the -# SELECT referenced in ticket #3442 (both '5000' and "5000") -# and verify that the query plan is the same. -# -ifcapable explain { - do_test tkt3442-1.2 { - EQP { SELECT node FROM listhash WHERE id='5000' LIMIT 1; } - } {0 0 {TABLE listhash WITH INDEX ididx}} - do_test tkt3442-1.3 { - EQP { SELECT node FROM listhash WHERE id="5000" LIMIT 1; } - } {0 0 {TABLE listhash WITH INDEX ididx}} -} - - -# Some extra tests testing other permutations of 5000. -# -ifcapable explain { - do_test tkt3442-1.4 { - EQP { SELECT node FROM listhash WHERE id=5000 LIMIT 1; } - } {0 0 {TABLE listhash WITH INDEX ididx}} -} -do_test tkt3442-1.5 { - catchsql { - SELECT node FROM listhash WHERE id=[5000] LIMIT 1; - } -} {1 {no such column: 5000}} - -finish_test - DELETED test/tkt3457.test Index: test/tkt3457.test ================================================================== --- test/tkt3457.test +++ /dev/null @@ -1,78 +0,0 @@ -# 2008 October 29 -# -# 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. -# -# $Id: tkt3457.test,v 1.1 2008/10/29 07:01:57 danielk1977 Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -if {$tcl_platform(platform) != "unix"} { - finish_test - return -} - -#----------------------------------------------------------------------- -# To roll back a hot-journal file, the application needs read and write -# permission on the journal file in question. The following tests test -# the outcome of trying to rollback a hot-journal file when this is not -# the case. -# -# tkt3457-1.2: Application has neither read, nor write permission on -# the hot-journal file. Result: SQLITE_CANTOPEN. -# -# tkt3457-1.3: Application has write but not read permission on -# the hot-journal file. Result: SQLITE_CANTOPEN. -# -# tkt3457-1.4: Application has read but not write permission on -# the hot-journal file. Result: SQLITE_CANTOPEN. -# -# tkt3457-1.5: Application has read/write permission on the hot-journal -# file. Result: SQLITE_OK. -# -do_test tkt3457-1.1 { - execsql { - CREATE TABLE t1(a, b, c); - INSERT INTO t1 VALUES(1, 2, 3); - BEGIN; - INSERT INTO t1 VALUES(4, 5, 6); - } - - file copy -force test.db bak.db - file copy -force test.db-journal bak.db-journal - - execsql COMMIT -} {} - -do_test tkt3457-1.2 { - file copy -force bak.db-journal test.db-journal - file attributes test.db-journal -permissions --------- - catchsql { SELECT * FROM t1 } -} {1 {unable to open database file}} -do_test tkt3457-1.3 { - file copy -force bak.db-journal test.db-journal - file attributes test.db-journal -permissions -w--w--w- - catchsql { SELECT * FROM t1 } -} {1 {unable to open database file}} -do_test tkt3457-1.4 { - file copy -force bak.db-journal test.db-journal - file attributes test.db-journal -permissions r--r--r-- - catchsql { SELECT * FROM t1 } -} {1 {unable to open database file}} - -do_test tkt3457-1.5 { - file copy -force bak.db-journal test.db-journal - file attributes test.db-journal -permissions rw-rw-rw- - catchsql { SELECT * FROM t1 } -} {0 {1 2 3 4 5 6}} - -finish_test - DELETED test/tkt3461.test Index: test/tkt3461.test ================================================================== --- test/tkt3461.test +++ /dev/null @@ -1,67 +0,0 @@ -# 2008 October 25 -# -# 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. -# -# This file implements tests to verify that ticket #3461 has been -# fixed. -# -# $Id: tkt3461.test,v 1.2 2008/10/25 15:03:21 drh Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -#################################### -#################################### -# REMOVE THESE TWO LINES: -#################################### -#################################### -#finish_test -#return - -do_test tkt3461-1.1 { - execsql { - CREATE TABLE t1(a, b); - INSERT INTO t1 VALUES(1, 2); - } -} {} - -do_test tkt3461-1.2 { - execsql { SELECT a, b+1 AS b_plus_one FROM t1 WHERE a=1 } -} {1 3} - -do_test tkt3461-1.3 { - # explain { SELECT a, b+1 AS b_plus_one FROM t1 WHERE a=1 OR b_plus_one } - # execsql { PRAGMA vdbe_trace = 1; PRAGMA vdbe_listing=1 } - execsql { SELECT a, b+1 AS b_plus_one FROM t1 WHERE a=1 OR b_plus_one } -} {1 3} - -do_test tkt3461-2.1 { - execsql { - SELECT a, b+1 AS b_plus_one - FROM t1 - WHERE CASE WHEN a=1 THEN 1 ELSE b_plus_one END - } -} {1 3} - -do_test tkt3461-3.1 { - execsql { - CREATE TABLE t2(c, d); - INSERT INTO t2 VALUES(3, 4); - } - # execsql { PRAGMA vdbe_trace = 1; PRAGMA vdbe_listing=1 } - execsql { - SELECT a, b+1 AS b_plus_one, c, d - FROM t1 LEFT JOIN t2 - ON (a=c AND d=b_plus_one) - } -} {1 3 {} {}} - -finish_test DELETED test/tkt3472.test Index: test/tkt3472.test ================================================================== --- test/tkt3472.test +++ /dev/null @@ -1,39 +0,0 @@ -# 2008 November 11 -# -# The author disclaims copyright to this source code. In place of -# a legal notice, here is a blessing: -# -# May you do good and not evil. -# May you find forgiveness for yourself and forgive others. -# May you share freely, never taking more than you give. -# -#*********************************************************************** -# -# $Id: tkt3472.test,v 1.4 2008/12/03 22:32:45 drh Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -if {![info exists threadsOverrideEachOthersLocks]} { - finish_test - return -} - -set ::correctvalue $threadsOverrideEachOthersLocks -puts "threadsOverrideEachOthersLocks = $::correctvalue" - -do_test tkt3472-1.1 { - db close - set threadsOverrideEachOthersLocks -1 - sqlite3 db test.db - set threadsOverrideEachOthersLocks -} $::correctvalue - -do_test tkt3472-1.2 { - db close - set threadsOverrideEachOthersLocks -1 - sqlite3 db test.db -readonly 1 - set threadsOverrideEachOthersLocks -} $::correctvalue - -finish_test DELETED test/tkt3493.test Index: test/tkt3493.test ================================================================== --- test/tkt3493.test +++ /dev/null @@ -1,154 +0,0 @@ -# 2008 October 13 -# -# The author disclaims copyright to this source code. In place of -# a legal notice, here is a blessing: -# -# May you do good and not evil. -# May you find forgiveness for yourself and forgive others. -# May you share freely, never taking more than you give. -# -#*********************************************************************** -# This file implements regression tests for SQLite library. Specifically, -# it tests that affinities and collation sequences are correctly applied -# in aggregate queries. -# -# $Id: tkt3493.test,v 1.1 2008/11/12 08:07:12 danielk1977 Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -do_test tkt3493-1.1 { - execsql { - BEGIN; - CREATE TABLE A (id INTEGER PRIMARY KEY AUTOINCREMENT, val TEXT); - INSERT INTO A VALUES(1,'123'); - INSERT INTO A VALUES(2,'456'); - CREATE TABLE B (id INTEGER PRIMARY KEY AUTOINCREMENT, val TEXT); - INSERT INTO B VALUES(1,1); - INSERT INTO B VALUES(2,2); - CREATE TABLE A_B (B_id INTEGER NOT NULL, A_id INTEGER); - INSERT INTO A_B VALUES(1,1); - INSERT INTO A_B VALUES(2,2); - COMMIT; - } -} {} -do_test tkt3493-1.2 { - execsql { - SELECT - CASE - WHEN B.val = 1 THEN 'XYZ' - ELSE A.val - END AS Col1 - FROM B - LEFT OUTER JOIN A_B ON B.id = A_B.B_id - LEFT OUTER JOIN A ON A.id = A_B.A_id - ORDER BY Col1 ASC; - } -} {456 XYZ} -do_test tkt3493-1.3 { - execsql { - SELECT DISTINCT - CASE - WHEN B.val = 1 THEN 'XYZ' - ELSE A.val - END AS Col1 - FROM B - LEFT OUTER JOIN A_B ON B.id = A_B.B_id - LEFT OUTER JOIN A ON A.id = A_B.A_id - ORDER BY Col1 ASC; - } -} {456 XYZ} -do_test tkt3493-1.4 { - execsql { - SELECT b.val, CASE WHEN b.val = 1 THEN 'xyz' ELSE b.val END AS col1 FROM b; - } -} {1 xyz 2 2} -do_test tkt3493-1.5 { - execsql { - SELECT DISTINCT - b.val, - CASE WHEN b.val = 1 THEN 'xyz' ELSE b.val END AS col1 - FROM b; - } -} {1 xyz 2 2} -do_test tkt3493-1.6 { - execsql { - SELECT DISTINCT - b.val, - CASE WHEN b.val = '1' THEN 'xyz' ELSE b.val END AS col1 - FROM b; - } -} {1 xyz 2 2} - - -do_test tkt3493-2.1 { - execsql { - CREATE TABLE t1(a TEXT, b INT); - INSERT INTO t1 VALUES(123, 456); - } -} {} -do_test tkt3493-2.2.1 { - execsql { SELECT a=123 FROM t1 GROUP BY a } -} {1} -do_test tkt3493-2.2.2 { - execsql { SELECT a=123 FROM t1 } -} {1} -do_test tkt3493-2.2.3 { - execsql { SELECT a='123' FROM t1 } -} {1} -do_test tkt3493-2.2.4 { - execsql { SELECT count(*), a=123 FROM t1 } -} {1 1} -do_test tkt3493-2.2.5 { - execsql { SELECT count(*), +a=123 FROM t1 } -} {1 0} -do_test tkt3493-2.3.3 { - execsql { SELECT b='456' FROM t1 GROUP BY a } -} {1} -do_test tkt3493-2.3.1 { - execsql { SELECT b='456' FROM t1 GROUP BY b } -} {1} -do_test tkt3493-2.3.2 { - execsql { SELECT b='456' FROM t1 } -} {1} -do_test tkt3493-2.4.1 { - execsql { SELECT typeof(a), a FROM t1 GROUP BY a HAVING a=123 } -} {text 123} -do_test tkt3493-2.4.2 { - execsql { SELECT typeof(a), a FROM t1 GROUP BY b HAVING a=123 } -} {text 123} -do_test tkt3493-2.5.1 { - execsql { SELECT typeof(b), b FROM t1 GROUP BY a HAVING b='456' } -} {integer 456} -do_test tkt3493-2.5.2 { - execsql { SELECT typeof(b), b FROM t1 GROUP BY b HAVING b='456' } -} {integer 456} - -do_test tkt3493-3.1 { - execsql { - CREATE TABLE t2(a COLLATE NOCASE, b COLLATE BINARY); - INSERT INTO t2 VALUES('aBc', 'DeF'); - } -} {} -do_test tkt3493-3.2.1 { - execsql { SELECT a='abc' FROM t2 GROUP BY a } -} {1} -do_test tkt3493-3.2.2 { - execsql { SELECT a='abc' FROM t2 } -} {1} - -do_test tkt3493-3.3.1 { - execsql { SELECT a>b FROM t2 GROUP BY a, b} -} {0} -do_test tkt3493-3.3.2 { - execsql { SELECT a>b COLLATE BINARY FROM t2 GROUP BY a, b} -} {1} -do_test tkt3493-3.3.3 { - execsql { SELECT b>a FROM t2 GROUP BY a, b} -} {0} -do_test tkt3493-3.3.4 { - execsql { SELECT b>a COLLATE NOCASE FROM t2 GROUP BY a, b} -} {1} - -finish_test - DELETED test/tkt3508.test Index: test/tkt3508.test ================================================================== --- test/tkt3508.test +++ /dev/null @@ -1,38 +0,0 @@ -# 2008 November 22 -# -# 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. -# -# $Id: tkt3508.test,v 1.3 2008/11/26 20:09:15 pweilbacher Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -do_test tkt3508-1.1 { - catchsql { - CREATE TABLE modificationsTmp ( - SUBSTRATE_HPRD_ID VARCHAR(80), - SUBSTRATE_GENE_SYMBOL VARCHAR(80), - SUBSTRATE_ISOFORM_ID VARCHAR(80), - SUBSTRATE_REFSEQ_ID VARCHAR(80), - SITE INTEGER, - RESIDUE VARCHAR(80), - ENZYME_NAME VARCHAR(80), - ENZYME_HPRD_ID VARCHAR(80), - MODIFICATION_TYPE VARCHAR(80), - EXPERIMENT_TYPE VARCHAR(80), - REFERENCE_ID VARCHAR(80) - ); - select SUBSTRATE_HPRD_ID, count(substrate_refseq_id) as c - from modificationsTmp where c > 1 group by SUBSTRATE_HPRD_ID; - } -} {1 {misuse of aggregate: }} - -finish_test DELETED test/tkt3522.test Index: test/tkt3522.test ================================================================== --- test/tkt3522.test +++ /dev/null @@ -1,43 +0,0 @@ -# 2008 December 4 -# -# 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. -# -# This file is a verification that the bugs identified in ticket -# #3522 have been fixed. -# -# $Id: tkt3522.test,v 1.1 2008/12/05 00:00:07 drh Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -do_test tkt3522-1.1 { - db eval { - CREATE TABLE tab4( - col0 INTEGER, - col1 INTEGER, - col2 INTEGER, - col3 INTEGER, - col4 INTEGER - ); - SELECT cor1.* - FROM tab4 AS cor0 - JOIN tab4 AS cor1 USING ( col4, col3, col2, col1, col0 ); - } -} {} -do_test tkt3522-1.2 { - db eval { - CREATE TABLE tab1(col0 INTEGER); - CREATE TABLE tab2(col0 INTEGER); - SELECT cor0.* FROM tab1 NATURAL JOIN tab2 AS cor0; - } -} {} - -finish_test DELETED test/tkt3527.test Index: test/tkt3527.test ================================================================== --- test/tkt3527.test +++ /dev/null @@ -1,118 +0,0 @@ -# 2008 December 8 -# -# 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. -# -# This file is a verification that the bugs identified in ticket -# #3527 have been fixed. -# -# $Id: tkt3527.test,v 1.1 2008/12/08 13:42:36 drh Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -do_test tkt3527-1.1 { - db eval { - CREATE TABLE Element ( - Code INTEGER PRIMARY KEY, - Name VARCHAR(60) - ); - - CREATE TABLE ElemOr ( - CodeOr INTEGER NOT NULL, - Code INTEGER NOT NULL, - PRIMARY KEY(CodeOr,Code) - ); - - CREATE TABLE ElemAnd ( - CodeAnd INTEGER, - Code INTEGER, - Attr1 INTEGER, - Attr2 INTEGER, - Attr3 INTEGER, - PRIMARY KEY(CodeAnd,Code) - ); - - INSERT INTO Element VALUES(1,'Elem1'); - INSERT INTO Element VALUES(2,'Elem2'); - INSERT INTO Element VALUES(3,'Elem3'); - INSERT INTO Element VALUES(4,'Elem4'); - INSERT INTO Element VALUES(5,'Elem5'); - INSERT INTO ElemOr Values(3,4); - INSERT INTO ElemOr Values(3,5); - INSERT INTO ElemAnd VALUES(1,3,1,1,1); - INSERT INTO ElemAnd VALUES(1,2,1,1,1); - - CREATE VIEW ElemView1 AS - SELECT - CAST(Element.Code AS VARCHAR(50)) AS ElemId, - Element.Code AS ElemCode, - Element.Name AS ElemName, - ElemAnd.Code AS InnerCode, - ElemAnd.Attr1 AS Attr1, - ElemAnd.Attr2 AS Attr2, - ElemAnd.Attr3 AS Attr3, - 0 AS Level, - 0 AS IsOrElem - FROM Element JOIN ElemAnd ON ElemAnd.CodeAnd=Element.Code - WHERE ElemAnd.CodeAnd NOT IN (SELECT CodeOr FROM ElemOr) - UNION ALL - SELECT - CAST(ElemOr.CodeOr AS VARCHAR(50)) AS ElemId, - Element.Code AS ElemCode, - Element.Name AS ElemName, - ElemOr.Code AS InnerCode, - NULL AS Attr1, - NULL AS Attr2, - NULL AS Attr3, - 0 AS Level, - 1 AS IsOrElem - FROM ElemOr JOIN Element ON Element.Code=ElemOr.CodeOr - ORDER BY ElemId, InnerCode; - - CREATE VIEW ElemView2 AS - SELECT - ElemId, - ElemCode, - ElemName, - InnerCode, - Attr1, - Attr2, - Attr3, - Level, - IsOrElem - FROM ElemView1 - UNION ALL - SELECT - Element.ElemId || '.' || InnerElem.ElemId AS ElemId, - InnerElem.ElemCode, - InnerElem.ElemName, - InnerElem.InnerCode, - InnerElem.Attr1, - InnerElem.Attr2, - InnerElem.Attr3, - InnerElem.Level+1, - InnerElem.IsOrElem - FROM ElemView1 AS Element - JOIN ElemView1 AS InnerElem - ON Element.Level=0 AND Element.InnerCode=InnerElem.ElemCode - ORDER BY ElemId, InnerCode; - - SELECT * FROM ElemView1; - } -} {1 1 Elem1 2 1 1 1 0 0 1 1 Elem1 3 1 1 1 0 0 3 3 Elem3 4 {} {} {} 0 1 3 3 Elem3 5 {} {} {} 0 1} - -do_test tkt3527-1.2 { - db eval { - SELECT * FROM ElemView2; - } -} {1 1 Elem1 2 1 1 1 0 0 1 1 Elem1 3 1 1 1 0 0 1.3 3 Elem3 4 {} {} {} 1 1 1.3 3 Elem3 5 {} {} {} 1 1 3 3 Elem3 4 {} {} {} 0 1 3 3 Elem3 5 {} {} {} 0 1} - -finish_test DELETED test/tkt3541.test Index: test/tkt3541.test ================================================================== --- test/tkt3541.test +++ /dev/null @@ -1,35 +0,0 @@ -# 2008 December 16 -# -# 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. -# -# This file is a verification that the bugs identified in ticket -# #3541 have been fixed. -# -# $Id: tkt3541.test,v 1.1 2008/12/15 15:27:52 drh Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -do_test tkt3541-1.1 { - db eval { - CREATE TABLE t1(x); - INSERT INTO t1 VALUES(123); - SELECT CASE ~max(x) WHEN min(x) THEN 1 ELSE max(x) END FROM t1; - } -} {123} -do_test tkt3541-1.2 { - db eval { - SELECT CASE NOT max(x) WHEN min(x) THEN 1 ELSE max(x) END FROM t1; - } -} {123} - - -finish_test DELETED test/tkt3554.test Index: test/tkt3554.test ================================================================== --- test/tkt3554.test +++ /dev/null @@ -1,68 +0,0 @@ -# 2008 December 24 -# -# The author disclaims copyright to this source code. In place of -# a legal notice, here is a blessing: -# -# May you do good and not evil. -# May you find forgiveness for yourself and forgive others. -# May you share freely, never taking more than you give. -# -#*********************************************************************** -# This file implements regression tests for SQLite library. -# -# This file implements tests to verify that ticket #3554 has been -# fixed. -# -# $Id: tkt3554.test,v 1.1 2008/12/26 07:56:39 danielk1977 Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -ifcapable !trigger { - finish_test - return -} - -do_test tkt3544-1.1 { - execsql { - CREATE TABLE test ( obj, t1, t2, PRIMARY KEY(obj, t1, t2) ); - - CREATE TRIGGER test_insert BEFORE INSERT ON test BEGIN - UPDATE test SET t1 = new.t1 - WHERE obj = new.obj AND new.t1 < t1 AND new.t2 >= t1; - - UPDATE test SET t2 = new.t2 - WHERE obj = new.obj AND new.t2 > t2 AND new.t1 <= t2; - - SELECT RAISE(IGNORE) WHERE EXISTS ( - SELECT obj FROM test - WHERE obj = new.obj AND new.t1 >= t1 AND new.t2 <= t2 - ); - END; - } -} {} - -do_test tkt3544-1.2 { - execsql { - INSERT INTO test VALUES('a', 10000, 11000); - SELECT * FROM test; - } -} {a 10000 11000} - - -do_test tkt3544-1.3 { - execsql { - INSERT INTO test VALUES('a', 9000, 10500); - } - execsql { SELECT * FROM test } -} {a 9000 11000} - -do_test tkt3544-1.4 { - execsql { - INSERT INTO test VALUES('a', 10000, 12000); - } - execsql { SELECT * FROM test } -} {a 9000 12000} - -finish_test - DELETED test/tkt3581.test Index: test/tkt3581.test ================================================================== --- test/tkt3581.test +++ /dev/null @@ -1,54 +0,0 @@ -# 2008 January 13 -# -# The author disclaims copyright to this source code. In place of -# a legal notice, here is a blessing: -# -# May you do good and not evil. -# May you find forgiveness for yourself and forgive others. -# May you share freely, never taking more than you give. -# -#*********************************************************************** -# This file implements regression tests for SQLite library. -# -# This file implements tests to verify that ticket #3581 has been -# fixed. -# -# $Id: tkt3581.test,v 1.1 2009/01/14 01:10:40 drh Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -do_test tkt3581-1.1 { - db eval { - CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c); - INSERT INTO t1 VALUES(0,544,846); - INSERT INTO t1 VALUES(1,345,51); - CREATE TABLE t2(a INTEGER PRIMARY KEY, b, c); - INSERT INTO t2 SELECT * FROM t1; - CREATE INDEX i2 on t2(c); - } -} {} - -do_test tkt3581-1.2 { - db eval { - SELECT a FROM t1 - WHERE (b > 45 AND c < 356) - OR b <= 733 - OR b >= 557 - OR (b >= 614 AND c < 251) - ORDER BY b; - } -} {1 0} - -do_test tkt3581-1.3 { - db eval { - SELECT a FROM t2 - WHERE (b > 45 AND c < 356) - OR b <= 733 - OR b >= 557 - OR (b >= 614 AND c < 251) - ORDER BY b; - } -} {1 0} - -finish_test Index: test/trans.test ================================================================== --- test/trans.test +++ test/trans.test @@ -9,15 +9,16 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this script is database locks. # -# $Id: trans.test,v 1.39 2008/12/22 10:58:46 danielk1977 Exp $ +# $Id: trans.test,v 1.38 2008/04/19 20:34:19 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl + # Create several tables to work with. # do_test trans-1.0 { execsql { DELETED test/trans3.test Index: test/trans3.test ================================================================== --- test/trans3.test +++ /dev/null @@ -1,77 +0,0 @@ -# 2008 November 3 -# -# The author disclaims copyright to this source code. In place of -# a legal notice, here is a blessing: -# -# May you do good and not evil. -# May you find forgiveness for yourself and forgive others. -# May you share freely, never taking more than you give. -# -#*********************************************************************** -# -# This file implements regression tests for SQLite library. The -# focus of this script is the response of COMMIT and ROLLBACK when -# statements are still pending. -# -# $Id: trans3.test,v 1.2 2008/11/05 16:37:35 drh Exp $ -# -set testdir [file dirname $argv0] -source $testdir/tester.tcl -unset -nocomplain ecode - -do_test trans3-1.1 { - db eval { - CREATE TABLE t1(x); - INSERT INTO t1 VALUES(1); - INSERT INTO t1 VALUES(2); - INSERT INTO t1 VALUES(3); - SELECT * FROM t1; - } -} {1 2 3} -do_test trans3-1.2 { - db eval BEGIN - db eval {INSERT INTO t1 VALUES(4);} - set ::ecode {} - set x [catch { - db eval {SELECT * FROM t1 LIMIT 1} { - if {[catch {db eval COMMIT} errmsg]} { - set ::ecode [sqlite3_extended_errcode db] - error $errmsg - } - } - } errmsg] - lappend x $errmsg -} {0 {}} -do_test trans3-1.3 { - set ::ecode -} {} -do_test trans3-1.3.1 { - sqlite3_get_autocommit db -} 1 -do_test trans3-1.4 { - db eval {SELECT * FROM t1} -} {1 2 3 4} -do_test trans3-1.5 { - db eval BEGIN - db eval {INSERT INTO t1 VALUES(5);} - set ::ecode {} - set x [catch { - db eval {SELECT * FROM t1} { - if {[catch {db eval ROLLBACK} errmsg]} { - set ::ecode [sqlite3_extended_errcode db] - error $errmsg - } - } - } errmsg] - lappend x $errmsg -} {1 {cannot rollback transaction - SQL statements in progress}} -do_test trans3-1.6 { - set ::ecode -} {SQLITE_BUSY} -do_test trans3-1.7 { - db eval COMMIT - db eval {SELECT * FROM t1} -} {1 2 3 4 5} -unset -nocomplain ecode - -finish_test Index: test/trigger2.test ================================================================== --- test/trigger2.test +++ test/trigger2.test @@ -733,22 +733,10 @@ UPDATE v1 SET x=x+100, y=y+200, z=z+300; SELECT * FROM v1log; } } {3 103 5 205 4 304 9 109 11 211 10 310} -# At one point the following was causing a segfault. -do_test trigger2-9.1 { - execsql { - CREATE TABLE t3(a TEXT, b TEXT); - CREATE VIEW v3 AS SELECT t3.a FROM t3; - CREATE TRIGGER trig1 INSTEAD OF DELETE ON v3 BEGIN - SELECT 1; - END; - DELETE FROM v3 WHERE a = 1; - } -} {} - } ;# ifcapable view integrity_check trigger2-9.9 finish_test Index: test/utf16align.test ================================================================== --- test/utf16align.test +++ test/utf16align.test @@ -12,11 +12,11 @@ # This file contains code to verify that the SQLITE_UTF16_ALIGNED # flag passed into the sqlite3_create_collation() function insures # that all strings passed to that function are aligned on an even # byte boundary. # -# $Id: utf16align.test,v 1.2 2008/11/07 03:29:34 drh Exp $ +# $Id: utf16align.test,v 1.1 2006/02/16 18:16:38 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Skip this entire test if we do not support UTF16 @@ -79,17 +79,6 @@ } expr {$unaligned_string_counter>0} } 0 integrity_check utf16align-1.4 -# ticket #3482 -# -db close -sqlite3 db :memory: -do_test utf16align-2.1 { - db eval { - PRAGMA encoding=UTF16be; - SELECT hex(ltrim(x'6efcda')); - } -} {6EFC} - finish_test Index: test/vacuum.test ================================================================== --- test/vacuum.test +++ test/vacuum.test @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the VACUUM statement. # -# $Id: vacuum.test,v 1.43 2009/01/31 14:54:07 danielk1977 Exp $ +# $Id: vacuum.test,v 1.41 2008/04/15 02:36:34 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # If the VACUUM statement is disabled in the current build, skip all @@ -100,22 +100,18 @@ do_test vacuum-1.6 { expr {[file size test.db]<$::size1} } {1} } ifcapable vacuum { - do_test vacuum-2.1.1 { + do_test vacuum-2.1 { catchsql { BEGIN; VACUUM; + COMMIT; } } {1 {cannot VACUUM from within a transaction}} - do_test vacuum-2.1.2 { - sqlite3_get_autocommit db - } {0} - do_test vacuum-2.1.3 { - db eval {COMMIT} - } {} + catch {db eval COMMIT} } do_test vacuum-2.2 { sqlite3 db2 test.db execsql { BEGIN; @@ -285,18 +281,11 @@ sqlite3 db2 :memory: execsql { CREATE TABLE t1(t); VACUUM; } db2 - execsql { - CREATE TABLE t2(t); - CREATE TABLE t3(t); - DROP TABLE t2; - VACUUM; - pragma integrity_check; - } db2 -} {ok} +} {} db2 close # Ticket #873. VACUUM a database that has ' in its name. # do_test vacuum-8.1 { Index: test/vacuum2.test ================================================================== --- test/vacuum2.test +++ test/vacuum2.test @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the VACUUM statement. # -# $Id: vacuum2.test,v 1.9 2008/11/10 18:20:16 shane Exp $ +# $Id: vacuum2.test,v 1.8 2008/08/23 16:17:56 danielk1977 Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # If the VACUUM statement is disabled in the current build, skip all @@ -80,19 +80,17 @@ do_test vacuum2-3.2 { cksum db2 } $cksum # Convert the database to an autovacuumed database. -ifcapable autovacuum { - do_test vacuum2-3.3 { - execsql { - PRAGMA auto_vacuum=FULL; - VACUUM; - } - expr {[file size test.db]/$pageSize} - } {4} -} +do_test vacuum2-3.3 { + execsql { + PRAGMA auto_vacuum=FULL; + VACUUM; + } + expr {[file size test.db]/$pageSize} +} {4} do_test vacuum2-3.4 { cksum db2 } $cksum do_test vacuum2-3.5 { cksum Index: test/view.test ================================================================== --- test/view.test +++ test/view.test @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing VIEW statements. # -# $Id: view.test,v 1.39 2008/12/14 14:45:21 danielk1977 Exp $ +# $Id: view.test,v 1.38 2008/08/21 14:54:29 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Omit this entire file if the library is not configured with views enabled. ifcapable !view { @@ -564,16 +564,6 @@ execsql2 { SELECT * FROM v3308c } } {rowid 1 a 1 x 5 rowid 2 a 4 x 11} -# Ticket #3539 had this crashing (see commit [5940]). -do_test view-20.1 { - execsql { - DROP TABLE IF EXISTS t1; - DROP VIEW IF EXISTS v1; - CREATE TABLE t1(c1); - CREATE VIEW v1 AS SELECT c1 FROM (SELECT t1.c1 FROM t1); - } -} {} - finish_test Index: test/where.test ================================================================== --- test/where.test +++ test/where.test @@ -9,11 +9,11 @@ # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the use of indices in WHERE clases. # -# $Id: where.test,v 1.50 2008/11/03 09:06:06 danielk1977 Exp $ +# $Id: where.test,v 1.49 2008/10/07 23:46:38 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Build some test data @@ -1213,48 +1213,6 @@ } } {2 2} integrity_check {where-99.0} -#--------------------------------------------------------------------- -# These tests test that a bug surrounding the use of ForceInt has been -# fixed in where.c. -# -do_test where-17.1 { - execsql { - CREATE TABLE tbooking ( - id INTEGER PRIMARY KEY, - eventtype INTEGER NOT NULL - ); - INSERT INTO tbooking VALUES(42, 3); - INSERT INTO tbooking VALUES(43, 4); - } -} {} -do_test where-17.2 { - execsql { - SELECT a.id - FROM tbooking AS a - WHERE a.eventtype=3; - } -} {42} -do_test where-17.3 { - execsql { - SELECT a.id, (SELECT b.id FROM tbooking AS b WHERE b.id>a.id) - FROM tbooking AS a - WHERE a.eventtype=3; - } -} {42 43} -do_test where-17.4 { - execsql { - SELECT a.id, (SELECT b.id FROM tbooking AS b WHERE b.id>a.id) - FROM (SELECT 1.5 AS id) AS a - } -} {1.5 42} -do_test where-17.5 { - execsql { - CREATE TABLE tother(a, b); - INSERT INTO tother VALUES(1, 3.7); - SELECT id, a FROM tbooking, tother WHERE id>a; - } -} {42 1 43 1} - finish_test Index: test/where2.test ================================================================== --- test/where2.test +++ test/where2.test @@ -10,11 +10,11 @@ #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the use of indices in WHERE clauses # based on recent changes to the optimizer. # -# $Id: where2.test,v 1.15 2009/02/02 01:50:40 drh Exp $ +# $Id: where2.test,v 1.14 2008/10/07 23:46:39 drh Exp $ set testdir [file dirname $argv0] source $testdir/tester.tcl # Build some test data @@ -95,21 +95,21 @@ # When constrained by a UNIQUE index, the ORDER BY clause is always ignored. # do_test where2-2.1 { queryplan { - SELECT * FROM t1 WHERE w=85 ORDER BY random(); + SELECT * FROM t1 WHERE w=85 ORDER BY random(5); } } {85 6 7396 7402 nosort t1 i1w} do_test where2-2.2 { queryplan { - SELECT * FROM t1 WHERE x=6 AND y=7396 ORDER BY random(); + SELECT * FROM t1 WHERE x=6 AND y=7396 ORDER BY random(5); } } {85 6 7396 7402 sort t1 i1xy} do_test where2-2.3 { queryplan { - SELECT * FROM t1 WHERE rowid=85 AND x=6 AND y=7396 ORDER BY random(); + SELECT * FROM t1 WHERE rowid=85 AND x=6 AND y=7396 ORDER BY random(5); } } {85 6 7396 7402 nosort t1 *} # Efficient handling of forward and reverse table scans. DELETED test/where7.test Index: test/where7.test ================================================================== --- test/where7.test +++ /dev/null @@ -1,24997 +0,0 @@ -# 2008 December 23 -# -# The author disclaims copyright to this source code. In place of -# a legal notice, here is a blessing: -# -# May you do good and not evil. -# May you find forgiveness for yourself and forgive others. -# May you share freely, never taking more than you give. -# -#*********************************************************************** -# This file implements regression tests for SQLite library. The -# focus of this file is testing the multi-index OR clause optimizer. -# -# $Id: where7.test,v 1.7 2009/01/14 00:55:10 drh Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -ifcapable !or_opt { - finish_test - return -} - -# Evaluate SQL. Return the result set followed by the -# and the number of full-scan steps. -# -proc count_steps {sql} { - set r [db eval $sql] - lappend r scan [db status step] sort [db status sort] -} - -# Build some test data -# -do_test where7-1.1 { - execsql { - CREATE TABLE t1(a INTEGER PRIMARY KEY,b,c,d); - INSERT INTO t1 VALUES(1,2,3,4); - INSERT INTO t1 VALUES(2,3,4,5); - INSERT INTO t1 VALUES(3,4,6,8); - INSERT INTO t1 VALUES(4,5,10,15); - INSERT INTO t1 VALUES(5,10,100,1000); - CREATE INDEX t1b ON t1(b); - CREATE INDEX t1c ON t1(c); - SELECT * FROM t1; - } -} {1 2 3 4 2 3 4 5 3 4 6 8 4 5 10 15 5 10 100 1000} -do_test where7-1.2 { - count_steps { - SELECT a FROM t1 WHERE b=3 OR c=6 ORDER BY a - } -} {2 3 scan 0 sort 0} -do_test where7-1.3 { - count_steps { - SELECT a FROM t1 WHERE b=3 OR +c=6 ORDER BY a - } -} {2 3 scan 4 sort 0} -do_test where7-1.4 { - count_steps { - SELECT a FROM t1 WHERE +b=3 OR c=6 ORDER BY 1 - } -} {2 3 scan 4 sort 0} -do_test where7-1.5 { - count_steps { - SELECT a FROM t1 WHERE 3=b OR c=6 ORDER BY rowid - } -} {2 3 scan 0 sort 0} -do_test where7-1.6 { - count_steps { - SELECT a FROM t1 WHERE (3=b OR c=6) AND +a>0 ORDER BY a - } -} {2 3 scan 0 sort 0} -do_test where7-1.7 { - count_steps { - SELECT a FROM t1 WHERE (b=3 OR c>10) ORDER BY a - } -} {2 5 scan 0 sort 0} -do_test where7-1.8 { - count_steps { - SELECT a FROM t1 WHERE (b=3 OR c>=10) ORDER BY a - } -} {2 4 5 scan 0 sort 0} -do_test where7-1.9 { - count_steps { - SELECT a FROM t1 WHERE (b=3 OR c>=10 OR c=4) ORDER BY a - } -} {2 4 5 scan 0 sort 0} -do_test where7-1.10 { - count_steps { - SELECT a FROM t1 WHERE (b=3 OR c>=10 OR c=4 OR b>10) ORDER BY a - } -} {2 4 5 scan 0 sort 0} -do_test where7-1.11 { - count_steps { - SELECT a FROM t1 WHERE (d=5 AND b=3) OR c==100 ORDER BY a; - } -} {2 5 scan 0 sort 0} -do_test where7-1.12 { - count_steps { - SELECT a FROM t1 WHERE (b BETWEEN 2 AND 4) OR c=100 ORDER BY a - } -} {1 2 3 5 scan 0 sort 0} -do_test where7-1.13.1 { - count_steps { - SELECT a FROM t1 WHERE (b BETWEEN 0 AND 2) OR (c BETWEEN 9 AND 999) - ORDER BY a DESC - } -} {5 4 1 scan 4 sort 0} -do_test where7-1.13.2 { - count_steps { - SELECT a FROM t1 WHERE (b BETWEEN 0 AND 2) OR (c BETWEEN 9 AND 999) - ORDER BY +a DESC - } -} {5 4 1 scan 0 sort 1} - -do_test where7-1.14 { - count_steps { - SELECT a FROM t1 WHERE (d=8 OR c=6 OR b=4) AND +a>0 - } -} {3 scan 4 sort 0} -do_test where7-1.15 { - count_steps { - SELECT a FROM t1 WHERE +a>=0 AND (d=8 OR c=6 OR b=4) - } -} {3 scan 4 sort 0} - -do_test where7-1.20 { - set sql "SELECT a FROM t1 WHERE a=11 OR b=11" - for {set i 12} {$i<400} {incr i} { - append sql " OR a=$i OR b=$i" - } - append sql " ORDER BY a" - count_steps $sql -} {scan 0 sort 0} -do_test where7-1.21 { - set sql "SELECT a FROM t1 WHERE b=11 OR c=11" - for {set i 12} {$i<400} {incr i} { - append sql " OR b=$i OR c=$i" - } - append sql " ORDER BY a" - count_steps $sql -} {5 scan 0 sort 0} -do_test where7-1.22 { - set sql "SELECT a FROM t1 WHERE (b=11 OR c=11" - for {set i 12} {$i<400} {incr i} { - append sql " OR b=$i OR c=$i" - } - append sql ") AND d>=0 AND d<9999 ORDER BY a" - count_steps $sql -} {5 scan 0 sort 0} -do_test where7-1.23 { - set sql "SELECT a FROM t1 WHERE (b=11 OR c=11" - for {set i 12} {$i<400} {incr i} { - append sql " OR (b=$i AND d!=0) OR (c=$i AND d IS NOT NULL)" - } - append sql ") AND d>=0 AND d<9999 ORDER BY a" - count_steps $sql -} {5 scan 0 sort 0} - -do_test where7-1.31 { - set sql "SELECT a FROM t1 WHERE (a=11 AND b=11)" - for {set i 12} {$i<400} {incr i} { - append sql " OR (a=$i AND b=$i)" - } - append sql " ORDER BY a" - count_steps $sql -} {scan 0 sort 0} -do_test where7-1.32 { - set sql "SELECT a FROM t1 WHERE (b=11 AND c=11)" - for {set i 12} {$i<400} {incr i} { - append sql " OR (b=$i AND c=$i)" - } - append sql " ORDER BY a" - count_steps $sql -} {scan 0 sort 0} - -# Lots of randomly generated OR-clause processing tests. -# -do_test where7-2.1 { - db eval { - CREATE TABLE t2(a INTEGER PRIMARY KEY,b,c,d,e,f,g); - INSERT INTO t2 VALUES(1,11,1001,1.001,100.1,'bcdefghij','yxwvuts'); - INSERT INTO t2 VALUES(2,22,1001,2.002,100.1,'cdefghijk','yxwvuts'); - INSERT INTO t2 VALUES(3,33,1001,3.003,100.1,'defghijkl','xwvutsr'); - INSERT INTO t2 VALUES(4,44,2002,4.004,200.2,'efghijklm','xwvutsr'); - INSERT INTO t2 VALUES(5,55,2002,5.005,200.2,'fghijklmn','xwvutsr'); - INSERT INTO t2 VALUES(6,66,2002,6.006,200.2,'ghijklmno','xwvutsr'); - INSERT INTO t2 VALUES(7,77,3003,7.007,300.3,'hijklmnop','xwvutsr'); - INSERT INTO t2 VALUES(8,88,3003,8.008,300.3,'ijklmnopq','wvutsrq'); - INSERT INTO t2 VALUES(9,99,3003,9.009,300.3,'jklmnopqr','wvutsrq'); - INSERT INTO t2 VALUES(10,110,4004,10.01,400.4,'klmnopqrs','wvutsrq'); - INSERT INTO t2 VALUES(11,121,4004,11.011,400.4,'lmnopqrst','wvutsrq'); - INSERT INTO t2 VALUES(12,132,4004,12.012,400.4,'mnopqrstu','wvutsrq'); - INSERT INTO t2 VALUES(13,143,5005,13.013,500.5,'nopqrstuv','vutsrqp'); - INSERT INTO t2 VALUES(14,154,5005,14.014,500.5,'opqrstuvw','vutsrqp'); - INSERT INTO t2 VALUES(15,165,5005,15.015,500.5,'pqrstuvwx','vutsrqp'); - INSERT INTO t2 VALUES(16,176,6006,16.016,600.6,'qrstuvwxy','vutsrqp'); - INSERT INTO t2 VALUES(17,187,6006,17.017,600.6,'rstuvwxyz','vutsrqp'); - INSERT INTO t2 VALUES(18,198,6006,18.018,600.6,'stuvwxyza','utsrqpo'); - INSERT INTO t2 VALUES(19,209,7007,19.019,700.7,'tuvwxyzab','utsrqpo'); - INSERT INTO t2 VALUES(20,220,7007,20.02,700.7,'uvwxyzabc','utsrqpo'); - INSERT INTO t2 VALUES(21,231,7007,21.021,700.7,'vwxyzabcd','utsrqpo'); - INSERT INTO t2 VALUES(22,242,8008,22.022,800.8,'wxyzabcde','utsrqpo'); - INSERT INTO t2 VALUES(23,253,8008,23.023,800.8,'xyzabcdef','tsrqpon'); - INSERT INTO t2 VALUES(24,264,8008,24.024,800.8,'yzabcdefg','tsrqpon'); - INSERT INTO t2 VALUES(25,275,9009,25.025,900.9,'zabcdefgh','tsrqpon'); - INSERT INTO t2 VALUES(26,286,9009,26.026,900.9,'abcdefghi','tsrqpon'); - INSERT INTO t2 VALUES(27,297,9009,27.027,900.9,'bcdefghij','tsrqpon'); - INSERT INTO t2 VALUES(28,308,10010,28.028,1001.0,'cdefghijk','srqponm'); - INSERT INTO t2 VALUES(29,319,10010,29.029,1001.0,'defghijkl','srqponm'); - INSERT INTO t2 VALUES(30,330,10010,30.03,1001.0,'efghijklm','srqponm'); - INSERT INTO t2 VALUES(31,341,11011,31.031,1101.1,'fghijklmn','srqponm'); - INSERT INTO t2 VALUES(32,352,11011,32.032,1101.1,'ghijklmno','srqponm'); - INSERT INTO t2 VALUES(33,363,11011,33.033,1101.1,'hijklmnop','rqponml'); - INSERT INTO t2 VALUES(34,374,12012,34.034,1201.2,'ijklmnopq','rqponml'); - INSERT INTO t2 VALUES(35,385,12012,35.035,1201.2,'jklmnopqr','rqponml'); - INSERT INTO t2 VALUES(36,396,12012,36.036,1201.2,'klmnopqrs','rqponml'); - INSERT INTO t2 VALUES(37,407,13013,37.037,1301.3,'lmnopqrst','rqponml'); - INSERT INTO t2 VALUES(38,418,13013,38.038,1301.3,'mnopqrstu','qponmlk'); - INSERT INTO t2 VALUES(39,429,13013,39.039,1301.3,'nopqrstuv','qponmlk'); - INSERT INTO t2 VALUES(40,440,14014,40.04,1401.4,'opqrstuvw','qponmlk'); - INSERT INTO t2 VALUES(41,451,14014,41.041,1401.4,'pqrstuvwx','qponmlk'); - INSERT INTO t2 VALUES(42,462,14014,42.042,1401.4,'qrstuvwxy','qponmlk'); - INSERT INTO t2 VALUES(43,473,15015,43.043,1501.5,'rstuvwxyz','ponmlkj'); - INSERT INTO t2 VALUES(44,484,15015,44.044,1501.5,'stuvwxyza','ponmlkj'); - INSERT INTO t2 VALUES(45,495,15015,45.045,1501.5,'tuvwxyzab','ponmlkj'); - INSERT INTO t2 VALUES(46,506,16016,46.046,1601.6,'uvwxyzabc','ponmlkj'); - INSERT INTO t2 VALUES(47,517,16016,47.047,1601.6,'vwxyzabcd','ponmlkj'); - INSERT INTO t2 VALUES(48,528,16016,48.048,1601.6,'wxyzabcde','onmlkji'); - INSERT INTO t2 VALUES(49,539,17017,49.049,1701.7,'xyzabcdef','onmlkji'); - INSERT INTO t2 VALUES(50,550,17017,50.05,1701.7,'yzabcdefg','onmlkji'); - INSERT INTO t2 VALUES(51,561,17017,51.051,1701.7,'zabcdefgh','onmlkji'); - INSERT INTO t2 VALUES(52,572,18018,52.052,1801.8,'abcdefghi','onmlkji'); - INSERT INTO t2 VALUES(53,583,18018,53.053,1801.8,'bcdefghij','nmlkjih'); - INSERT INTO t2 VALUES(54,594,18018,54.054,1801.8,'cdefghijk','nmlkjih'); - INSERT INTO t2 VALUES(55,605,19019,55.055,1901.9,'defghijkl','nmlkjih'); - INSERT INTO t2 VALUES(56,616,19019,56.056,1901.9,'efghijklm','nmlkjih'); - INSERT INTO t2 VALUES(57,627,19019,57.057,1901.9,'fghijklmn','nmlkjih'); - INSERT INTO t2 VALUES(58,638,20020,58.058,2002.0,'ghijklmno','mlkjihg'); - INSERT INTO t2 VALUES(59,649,20020,59.059,2002.0,'hijklmnop','mlkjihg'); - INSERT INTO t2 VALUES(60,660,20020,60.06,2002.0,'ijklmnopq','mlkjihg'); - INSERT INTO t2 VALUES(61,671,21021,61.061,2102.1,'jklmnopqr','mlkjihg'); - INSERT INTO t2 VALUES(62,682,21021,62.062,2102.1,'klmnopqrs','mlkjihg'); - INSERT INTO t2 VALUES(63,693,21021,63.063,2102.1,'lmnopqrst','lkjihgf'); - INSERT INTO t2 VALUES(64,704,22022,64.064,2202.2,'mnopqrstu','lkjihgf'); - INSERT INTO t2 VALUES(65,715,22022,65.065,2202.2,'nopqrstuv','lkjihgf'); - INSERT INTO t2 VALUES(66,726,22022,66.066,2202.2,'opqrstuvw','lkjihgf'); - INSERT INTO t2 VALUES(67,737,23023,67.067,2302.3,'pqrstuvwx','lkjihgf'); - INSERT INTO t2 VALUES(68,748,23023,68.068,2302.3,'qrstuvwxy','kjihgfe'); - INSERT INTO t2 VALUES(69,759,23023,69.069,2302.3,'rstuvwxyz','kjihgfe'); - INSERT INTO t2 VALUES(70,770,24024,70.07,2402.4,'stuvwxyza','kjihgfe'); - INSERT INTO t2 VALUES(71,781,24024,71.071,2402.4,'tuvwxyzab','kjihgfe'); - INSERT INTO t2 VALUES(72,792,24024,72.072,2402.4,'uvwxyzabc','kjihgfe'); - INSERT INTO t2 VALUES(73,803,25025,73.073,2502.5,'vwxyzabcd','jihgfed'); - INSERT INTO t2 VALUES(74,814,25025,74.074,2502.5,'wxyzabcde','jihgfed'); - INSERT INTO t2 VALUES(75,825,25025,75.075,2502.5,'xyzabcdef','jihgfed'); - INSERT INTO t2 VALUES(76,836,26026,76.076,2602.6,'yzabcdefg','jihgfed'); - INSERT INTO t2 VALUES(77,847,26026,77.077,2602.6,'zabcdefgh','jihgfed'); - INSERT INTO t2 VALUES(78,858,26026,78.078,2602.6,'abcdefghi','ihgfedc'); - INSERT INTO t2 VALUES(79,869,27027,79.079,2702.7,'bcdefghij','ihgfedc'); - INSERT INTO t2 VALUES(80,880,27027,80.08,2702.7,'cdefghijk','ihgfedc'); - INSERT INTO t2 VALUES(81,891,27027,81.081,2702.7,'defghijkl','ihgfedc'); - INSERT INTO t2 VALUES(82,902,28028,82.082,2802.8,'efghijklm','ihgfedc'); - INSERT INTO t2 VALUES(83,913,28028,83.083,2802.8,'fghijklmn','hgfedcb'); - INSERT INTO t2 VALUES(84,924,28028,84.084,2802.8,'ghijklmno','hgfedcb'); - INSERT INTO t2 VALUES(85,935,29029,85.085,2902.9,'hijklmnop','hgfedcb'); - INSERT INTO t2 VALUES(86,946,29029,86.086,2902.9,'ijklmnopq','hgfedcb'); - INSERT INTO t2 VALUES(87,957,29029,87.087,2902.9,'jklmnopqr','hgfedcb'); - INSERT INTO t2 VALUES(88,968,30030,88.088,3003.0,'klmnopqrs','gfedcba'); - INSERT INTO t2 VALUES(89,979,30030,89.089,3003.0,'lmnopqrst','gfedcba'); - INSERT INTO t2 VALUES(90,990,30030,90.09,3003.0,'mnopqrstu','gfedcba'); - INSERT INTO t2 VALUES(91,1001,31031,91.091,3103.1,'nopqrstuv','gfedcba'); - INSERT INTO t2 VALUES(92,1012,31031,92.092,3103.1,'opqrstuvw','gfedcba'); - INSERT INTO t2 VALUES(93,1023,31031,93.093,3103.1,'pqrstuvwx','fedcbaz'); - INSERT INTO t2 VALUES(94,1034,32032,94.094,3203.2,'qrstuvwxy','fedcbaz'); - INSERT INTO t2 VALUES(95,1045,32032,95.095,3203.2,'rstuvwxyz','fedcbaz'); - INSERT INTO t2 VALUES(96,1056,32032,96.096,3203.2,'stuvwxyza','fedcbaz'); - INSERT INTO t2 VALUES(97,1067,33033,97.097,3303.3,'tuvwxyzab','fedcbaz'); - INSERT INTO t2 VALUES(98,1078,33033,98.098,3303.3,'uvwxyzabc','edcbazy'); - INSERT INTO t2 VALUES(99,1089,33033,99.099,3303.3,'vwxyzabcd','edcbazy'); - INSERT INTO t2 VALUES(100,1100,34034,100.1,3403.4,'wxyzabcde','edcbazy'); - CREATE INDEX t2b ON t2(b); - CREATE INDEX t2c ON t2(c); - CREATE INDEX t2d ON t2(d); - CREATE INDEX t2e ON t2(e); - CREATE INDEX t2f ON t2(f); - CREATE INDEX t2g ON t2(g); - CREATE TABLE t3(a INTEGER PRIMARY KEY,b,c,d,e,f,g); - INSERT INTO t3 SELECT * FROM t2; - CREATE INDEX t3b ON t3(b,c); - CREATE INDEX t3c ON t3(c,e); - CREATE INDEX t3d ON t3(d,g); - CREATE INDEX t3e ON t3(e,f,g); - CREATE INDEX t3f ON t3(f,b,d,c); - CREATE INDEX t3g ON t3(g,f); - } -} {} -do_test where7-2.2.1 { - count_steps { - SELECT a FROM t2 - WHERE b=979 - OR ((a BETWEEN 91 AND 93) AND a!=92) - OR ((a BETWEEN 5 AND 7) AND a!=6) - OR (g='mlkjihg' AND f GLOB 'klmno*') - ORDER BY a - } -} {5 7 62 89 91 93 scan 0 sort 0} -do_test where7-2.2.2 { - count_steps { - SELECT a FROM t3 - WHERE b=979 - OR ((a BETWEEN 91 AND 93) AND a!=92) - OR ((a BETWEEN 5 AND 7) AND a!=6) - OR (g='mlkjihg' AND f GLOB 'klmno*') - ORDER BY a - } -} {5 7 62 89 91 93 scan 0 sort 0} -do_test where7-2.3.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='yxwvuts' AND f GLOB 'cdefg*') - OR (d>=47.0 AND d<48.0 AND d NOT NULL) - OR (d>=27.0 AND d<28.0 AND d NOT NULL) - ORDER BY a - } -} {2 27 47 scan 0 sort 0} -do_test where7-2.3.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='yxwvuts' AND f GLOB 'cdefg*') - OR (d>=47.0 AND d<48.0 AND d NOT NULL) - OR (d>=27.0 AND d<28.0 AND d NOT NULL) - ORDER BY a - } -} {2 27 47 scan 0 sort 0} -do_test where7-2.4.1 { - count_steps { - SELECT a FROM t2 - WHERE c=20020 - OR ((a BETWEEN 10 AND 12) AND a!=11) - OR (d>=75.0 AND d<76.0 AND d NOT NULL) - ORDER BY a - } -} {10 12 58 59 60 75 scan 0 sort 0} -do_test where7-2.4.2 { - count_steps { - SELECT a FROM t3 - WHERE c=20020 - OR ((a BETWEEN 10 AND 12) AND a!=11) - OR (d>=75.0 AND d<76.0 AND d NOT NULL) - ORDER BY a - } -} {10 12 58 59 60 75 scan 0 sort 0} -do_test where7-2.5.1 { - count_steps { - SELECT a FROM t2 - WHERE f='xyzabcdef' - OR (g='fedcbaz' AND f GLOB 'stuvw*') - OR b=245 - OR a=27 - ORDER BY a - } -} {23 27 49 75 96 scan 0 sort 0} -do_test where7-2.5.2 { - count_steps { - SELECT a FROM t3 - WHERE f='xyzabcdef' - OR (g='fedcbaz' AND f GLOB 'stuvw*') - OR b=245 - OR a=27 - ORDER BY a - } -} {23 27 49 75 96 scan 0 sort 0} -do_test where7-2.6.1 { - count_steps { - SELECT a FROM t2 - WHERE d>1e10 - OR c=28028 - OR a=40 - ORDER BY a - } -} {40 82 83 84 scan 0 sort 0} -do_test where7-2.6.2 { - count_steps { - SELECT a FROM t3 - WHERE d>1e10 - OR c=28028 - OR a=40 - ORDER BY a - } -} {40 82 83 84 scan 0 sort 0} -do_test where7-2.7.1 { - count_steps { - SELECT a FROM t2 - WHERE c=27027 - OR ((a BETWEEN 8 AND 10) AND a!=9) - OR (g='hgfedcb' AND f GLOB 'jklmn*') - OR a=18 - OR ((a BETWEEN 99 AND 101) AND a!=100) - OR c=29029 - OR a=14 - OR b=520 - OR (g='srqponm' AND f GLOB 'fghij*') - OR (g='ponmlkj' AND f GLOB 'rstuv*') - ORDER BY a - } -} {8 10 14 18 31 43 79 80 81 85 86 87 99 scan 0 sort 0} -do_test where7-2.7.2 { - count_steps { - SELECT a FROM t3 - WHERE c=27027 - OR ((a BETWEEN 8 AND 10) AND a!=9) - OR (g='hgfedcb' AND f GLOB 'jklmn*') - OR a=18 - OR ((a BETWEEN 99 AND 101) AND a!=100) - OR c=29029 - OR a=14 - OR b=520 - OR (g='srqponm' AND f GLOB 'fghij*') - OR (g='ponmlkj' AND f GLOB 'rstuv*') - ORDER BY a - } -} {8 10 14 18 31 43 79 80 81 85 86 87 99 scan 0 sort 0} -do_test where7-2.8.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 35 AND 37) AND a!=36) - OR ((a BETWEEN 65 AND 67) AND a!=66) - OR (d>=26.0 AND d<27.0 AND d NOT NULL) - OR b=311 - ORDER BY a - } -} {26 35 37 65 67 scan 0 sort 0} -do_test where7-2.8.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 35 AND 37) AND a!=36) - OR ((a BETWEEN 65 AND 67) AND a!=66) - OR (d>=26.0 AND d<27.0 AND d NOT NULL) - OR b=311 - ORDER BY a - } -} {26 35 37 65 67 scan 0 sort 0} -do_test where7-2.9.1 { - count_steps { - SELECT a FROM t2 - WHERE c=24024 - OR a=29 - OR b=99 - OR (d>=48.0 AND d<49.0 AND d NOT NULL) - ORDER BY a - } -} {9 29 48 70 71 72 scan 0 sort 0} -do_test where7-2.9.2 { - count_steps { - SELECT a FROM t3 - WHERE c=24024 - OR a=29 - OR b=99 - OR (d>=48.0 AND d<49.0 AND d NOT NULL) - ORDER BY a - } -} {9 29 48 70 71 72 scan 0 sort 0} -do_test where7-2.10.1 { - count_steps { - SELECT a FROM t2 - WHERE c<=10 - OR a=4 - OR (d>=49.0 AND d<50.0 AND d NOT NULL) - ORDER BY a - } -} {4 49 scan 0 sort 0} -do_test where7-2.10.2 { - count_steps { - SELECT a FROM t3 - WHERE c<=10 - OR a=4 - OR (d>=49.0 AND d<50.0 AND d NOT NULL) - ORDER BY a - } -} {4 49 scan 0 sort 0} -do_test where7-2.11.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='srqponm' AND f GLOB 'fghij*') - OR b=143 - OR b=209 - ORDER BY a - } -} {13 19 31 scan 0 sort 0} -do_test where7-2.11.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='srqponm' AND f GLOB 'fghij*') - OR b=143 - OR b=209 - ORDER BY a - } -} {13 19 31 scan 0 sort 0} -do_test where7-2.12.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='kjihgfe' AND f GLOB 'rstuv*') - OR (d>=86.0 AND d<87.0 AND d NOT NULL) - OR b=542 - OR (g='qponmlk' AND f GLOB 'mnopq*') - ORDER BY a - } -} {38 69 86 scan 0 sort 0} -do_test where7-2.12.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='kjihgfe' AND f GLOB 'rstuv*') - OR (d>=86.0 AND d<87.0 AND d NOT NULL) - OR b=542 - OR (g='qponmlk' AND f GLOB 'mnopq*') - ORDER BY a - } -} {38 69 86 scan 0 sort 0} -do_test where7-2.13.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='gfedcba' AND f GLOB 'nopqr*') - OR b=960 - OR a=82 - OR a=89 - OR (d>=32.0 AND d<33.0 AND d NOT NULL) - OR g IS NULL - OR (g='nmlkjih' AND f GLOB 'efghi*') - ORDER BY a - } -} {32 56 82 89 91 scan 0 sort 0} -do_test where7-2.13.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='gfedcba' AND f GLOB 'nopqr*') - OR b=960 - OR a=82 - OR a=89 - OR (d>=32.0 AND d<33.0 AND d NOT NULL) - OR g IS NULL - OR (g='nmlkjih' AND f GLOB 'efghi*') - ORDER BY a - } -} {32 56 82 89 91 scan 0 sort 0} -do_test where7-2.14.1 { - count_steps { - SELECT a FROM t2 - WHERE b=407 - OR c=11011 - OR a=3 - OR b=583 - OR (g='ponmlkj' AND f GLOB 'vwxyz*') - OR ((a BETWEEN 94 AND 96) AND a!=95) - OR b=308 - OR (d>=56.0 AND d<57.0 AND d NOT NULL) - OR b=341 - ORDER BY a - } -} {3 28 31 32 33 37 47 53 56 94 96 scan 0 sort 0} -do_test where7-2.14.2 { - count_steps { - SELECT a FROM t3 - WHERE b=407 - OR c=11011 - OR a=3 - OR b=583 - OR (g='ponmlkj' AND f GLOB 'vwxyz*') - OR ((a BETWEEN 94 AND 96) AND a!=95) - OR b=308 - OR (d>=56.0 AND d<57.0 AND d NOT NULL) - OR b=341 - ORDER BY a - } -} {3 28 31 32 33 37 47 53 56 94 96 scan 0 sort 0} -do_test where7-2.15.1 { - count_steps { - SELECT a FROM t2 - WHERE b=509 - OR b=839 - OR b=1089 - OR (d>=19.0 AND d<20.0 AND d NOT NULL) - OR ((a BETWEEN 45 AND 47) AND a!=46) - OR ((a BETWEEN 93 AND 95) AND a!=94) - OR (f GLOB '?lmno*' AND f GLOB 'klmn*') - OR (g='rqponml' AND f GLOB 'jklmn*') - OR b=363 - OR c=8008 - OR (g='wvutsrq' AND f GLOB 'lmnop*') - ORDER BY a - } -} {10 11 19 22 23 24 33 35 36 45 47 62 88 93 95 99 scan 0 sort 0} -do_test where7-2.15.2 { - count_steps { - SELECT a FROM t3 - WHERE b=509 - OR b=839 - OR b=1089 - OR (d>=19.0 AND d<20.0 AND d NOT NULL) - OR ((a BETWEEN 45 AND 47) AND a!=46) - OR ((a BETWEEN 93 AND 95) AND a!=94) - OR (f GLOB '?lmno*' AND f GLOB 'klmn*') - OR (g='rqponml' AND f GLOB 'jklmn*') - OR b=363 - OR c=8008 - OR (g='wvutsrq' AND f GLOB 'lmnop*') - ORDER BY a - } -} {10 11 19 22 23 24 33 35 36 45 47 62 88 93 95 99 scan 0 sort 0} -do_test where7-2.16.1 { - count_steps { - SELECT a FROM t2 - WHERE b=825 - OR a=41 - OR b=454 - OR b=817 - OR (d>=30.0 AND d<31.0 AND d NOT NULL) - OR ((a BETWEEN 47 AND 49) AND a!=48) - ORDER BY a - } -} {30 41 47 49 75 scan 0 sort 0} -do_test where7-2.16.2 { - count_steps { - SELECT a FROM t3 - WHERE b=825 - OR a=41 - OR b=454 - OR b=817 - OR (d>=30.0 AND d<31.0 AND d NOT NULL) - OR ((a BETWEEN 47 AND 49) AND a!=48) - ORDER BY a - } -} {30 41 47 49 75 scan 0 sort 0} -do_test where7-2.17.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=93.0 AND d<94.0 AND d NOT NULL) - OR c=15015 - OR (g='rqponml' AND f GLOB 'klmno*') - OR b=1015 - OR a=92 - OR c=15015 - OR b=407 - OR c>=34035 - OR ((a BETWEEN 36 AND 38) AND a!=37) - OR b=539 - OR a=61 - ORDER BY a - } -} {36 37 38 43 44 45 49 61 92 93 scan 0 sort 0} -do_test where7-2.17.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=93.0 AND d<94.0 AND d NOT NULL) - OR c=15015 - OR (g='rqponml' AND f GLOB 'klmno*') - OR b=1015 - OR a=92 - OR c=15015 - OR b=407 - OR c>=34035 - OR ((a BETWEEN 36 AND 38) AND a!=37) - OR b=539 - OR a=61 - ORDER BY a - } -} {36 37 38 43 44 45 49 61 92 93 scan 0 sort 0} -do_test where7-2.18.1 { - count_steps { - SELECT a FROM t2 - WHERE b=674 - OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') - OR b=572 - OR c=8008 - OR f='yzabcdefg' - OR (g='nmlkjih' AND f GLOB 'defgh*') - OR a=49 - OR b=641 - OR (g='onmlkji' AND f GLOB 'wxyza*') - ORDER BY a - } -} {15 22 23 24 41 48 49 50 52 55 67 76 93 scan 0 sort 0} -do_test where7-2.18.2 { - count_steps { - SELECT a FROM t3 - WHERE b=674 - OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') - OR b=572 - OR c=8008 - OR f='yzabcdefg' - OR (g='nmlkjih' AND f GLOB 'defgh*') - OR a=49 - OR b=641 - OR (g='onmlkji' AND f GLOB 'wxyza*') - ORDER BY a - } -} {15 22 23 24 41 48 49 50 52 55 67 76 93 scan 0 sort 0} -do_test where7-2.19.1 { - count_steps { - SELECT a FROM t2 - WHERE b=894 - OR b=165 - ORDER BY a - } -} {15 scan 0 sort 1} -do_test where7-2.19.2 { - count_steps { - SELECT a FROM t3 - WHERE b=894 - OR b=165 - ORDER BY a - } -} {15 scan 0 sort 1} -do_test where7-2.20.1 { - count_steps { - SELECT a FROM t2 - WHERE a=49 - OR b=847 - OR (g='wvutsrq' AND f GLOB 'mnopq*') - OR (d>=26.0 AND d<27.0 AND d NOT NULL) - OR (d>=10.0 AND d<11.0 AND d NOT NULL) - OR a=41 - OR (g='wvutsrq' AND f GLOB 'ijklm*') - OR b=454 - OR b=363 - OR (d>=87.0 AND d<88.0 AND d NOT NULL) - OR (d>=85.0 AND d<86.0 AND d NOT NULL) - ORDER BY a - } -} {8 10 12 26 33 41 49 77 85 87 scan 0 sort 0} -do_test where7-2.20.2 { - count_steps { - SELECT a FROM t3 - WHERE a=49 - OR b=847 - OR (g='wvutsrq' AND f GLOB 'mnopq*') - OR (d>=26.0 AND d<27.0 AND d NOT NULL) - OR (d>=10.0 AND d<11.0 AND d NOT NULL) - OR a=41 - OR (g='wvutsrq' AND f GLOB 'ijklm*') - OR b=454 - OR b=363 - OR (d>=87.0 AND d<88.0 AND d NOT NULL) - OR (d>=85.0 AND d<86.0 AND d NOT NULL) - ORDER BY a - } -} {8 10 12 26 33 41 49 77 85 87 scan 0 sort 0} -do_test where7-2.21.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=26.0 AND d<27.0 AND d NOT NULL) - OR (f GLOB '?vwxy*' AND f GLOB 'uvwx*') - ORDER BY a - } -} {20 26 46 72 98 scan 0 sort 0} -do_test where7-2.21.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=26.0 AND d<27.0 AND d NOT NULL) - OR (f GLOB '?vwxy*' AND f GLOB 'uvwx*') - ORDER BY a - } -} {20 26 46 72 98 scan 0 sort 0} -do_test where7-2.22.1 { - count_steps { - SELECT a FROM t2 - WHERE b=396 - OR b=894 - ORDER BY a - } -} {36 scan 0 sort 1} -do_test where7-2.22.2 { - count_steps { - SELECT a FROM t3 - WHERE b=396 - OR b=894 - ORDER BY a - } -} {36 scan 0 sort 1} -do_test where7-2.23.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=32.0 AND d<33.0 AND d NOT NULL) - OR b=671 - OR b=330 - OR (g='rqponml' AND f GLOB 'ijklm*') - ORDER BY a - } -} {30 32 34 61 scan 0 sort 0} -do_test where7-2.23.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=32.0 AND d<33.0 AND d NOT NULL) - OR b=671 - OR b=330 - OR (g='rqponml' AND f GLOB 'ijklm*') - ORDER BY a - } -} {30 32 34 61 scan 0 sort 0} -do_test where7-2.24.1 { - count_steps { - SELECT a FROM t2 - WHERE b=916 - OR (d>=45.0 AND d<46.0 AND d NOT NULL) - OR (g='fedcbaz' AND f GLOB 'stuvw*') - OR b=121 - OR (d>=24.0 AND d<25.0 AND d NOT NULL) - OR (d>=86.0 AND d<87.0 AND d NOT NULL) - OR c=15015 - OR c=1001 - OR b=132 - ORDER BY a - } -} {1 2 3 11 12 24 43 44 45 86 96 scan 0 sort 0} -do_test where7-2.24.2 { - count_steps { - SELECT a FROM t3 - WHERE b=916 - OR (d>=45.0 AND d<46.0 AND d NOT NULL) - OR (g='fedcbaz' AND f GLOB 'stuvw*') - OR b=121 - OR (d>=24.0 AND d<25.0 AND d NOT NULL) - OR (d>=86.0 AND d<87.0 AND d NOT NULL) - OR c=15015 - OR c=1001 - OR b=132 - ORDER BY a - } -} {1 2 3 11 12 24 43 44 45 86 96 scan 0 sort 0} -do_test where7-2.25.1 { - count_steps { - SELECT a FROM t2 - WHERE a=68 - OR ((a BETWEEN 77 AND 79) AND a!=78) - OR b=1100 - OR (d>=91.0 AND d<92.0 AND d NOT NULL) - OR b=58 - OR a=65 - OR (d>=49.0 AND d<50.0 AND d NOT NULL) - OR b=124 - ORDER BY a - } -} {49 65 68 77 79 91 100 scan 0 sort 0} -do_test where7-2.25.2 { - count_steps { - SELECT a FROM t3 - WHERE a=68 - OR ((a BETWEEN 77 AND 79) AND a!=78) - OR b=1100 - OR (d>=91.0 AND d<92.0 AND d NOT NULL) - OR b=58 - OR a=65 - OR (d>=49.0 AND d<50.0 AND d NOT NULL) - OR b=124 - ORDER BY a - } -} {49 65 68 77 79 91 100 scan 0 sort 0} -do_test where7-2.26.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=2.0 AND d<3.0 AND d NOT NULL) - OR ((a BETWEEN 72 AND 74) AND a!=73) - OR ((a BETWEEN 64 AND 66) AND a!=65) - OR f='nopqrstuv' - OR c=8008 - OR b=1089 - OR b=396 - OR a=26 - ORDER BY a - } -} {2 13 22 23 24 26 36 39 64 65 66 72 74 91 99 scan 0 sort 0} -do_test where7-2.26.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=2.0 AND d<3.0 AND d NOT NULL) - OR ((a BETWEEN 72 AND 74) AND a!=73) - OR ((a BETWEEN 64 AND 66) AND a!=65) - OR f='nopqrstuv' - OR c=8008 - OR b=1089 - OR b=396 - OR a=26 - ORDER BY a - } -} {2 13 22 23 24 26 36 39 64 65 66 72 74 91 99 scan 0 sort 0} -do_test where7-2.27.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=24.0 AND d<25.0 AND d NOT NULL) - OR b=429 - OR a=26 - OR b=267 - OR (g='ihgfedc' AND f GLOB 'efghi*') - OR a=24 - OR ((a BETWEEN 90 AND 92) AND a!=91) - OR (g='utsrqpo' AND f GLOB 'vwxyz*') - OR ((a BETWEEN 54 AND 56) AND a!=55) - OR a=9 - ORDER BY a - } -} {9 21 24 26 39 54 56 82 90 92 scan 0 sort 0} -do_test where7-2.27.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=24.0 AND d<25.0 AND d NOT NULL) - OR b=429 - OR a=26 - OR b=267 - OR (g='ihgfedc' AND f GLOB 'efghi*') - OR a=24 - OR ((a BETWEEN 90 AND 92) AND a!=91) - OR (g='utsrqpo' AND f GLOB 'vwxyz*') - OR ((a BETWEEN 54 AND 56) AND a!=55) - OR a=9 - ORDER BY a - } -} {9 21 24 26 39 54 56 82 90 92 scan 0 sort 0} -do_test where7-2.28.1 { - count_steps { - SELECT a FROM t2 - WHERE a=23 - OR b=803 - OR ((a BETWEEN 30 AND 32) AND a!=31) - OR b=157 - OR ((a BETWEEN 52 AND 54) AND a!=53) - OR b=234 - OR b=212 - OR ((a BETWEEN 67 AND 69) AND a!=68) - OR b=685 - OR a=71 - OR c=22022 - ORDER BY a - } -} {23 30 32 52 54 64 65 66 67 69 71 73 scan 0 sort 0} -do_test where7-2.28.2 { - count_steps { - SELECT a FROM t3 - WHERE a=23 - OR b=803 - OR ((a BETWEEN 30 AND 32) AND a!=31) - OR b=157 - OR ((a BETWEEN 52 AND 54) AND a!=53) - OR b=234 - OR b=212 - OR ((a BETWEEN 67 AND 69) AND a!=68) - OR b=685 - OR a=71 - OR c=22022 - ORDER BY a - } -} {23 30 32 52 54 64 65 66 67 69 71 73 scan 0 sort 0} -do_test where7-2.29.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 98 AND 100) AND a!=99) - OR c=3003 - ORDER BY a - } -} {7 8 9 98 100 scan 0 sort 0} -do_test where7-2.29.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 98 AND 100) AND a!=99) - OR c=3003 - ORDER BY a - } -} {7 8 9 98 100 scan 0 sort 0} -do_test where7-2.30.1 { - count_steps { - SELECT a FROM t2 - WHERE f='efghijklm' - OR a=17 - ORDER BY a - } -} {4 17 30 56 82 scan 0 sort 0} -do_test where7-2.30.2 { - count_steps { - SELECT a FROM t3 - WHERE f='efghijklm' - OR a=17 - ORDER BY a - } -} {4 17 30 56 82 scan 0 sort 0} -do_test where7-2.31.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 0 AND 2) AND a!=1) - OR b=33 - OR b=729 - OR (g='lkjihgf' AND f GLOB 'nopqr*') - ORDER BY a - } -} {2 3 65 scan 0 sort 0} -do_test where7-2.31.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 0 AND 2) AND a!=1) - OR b=33 - OR b=729 - OR (g='lkjihgf' AND f GLOB 'nopqr*') - ORDER BY a - } -} {2 3 65 scan 0 sort 0} -do_test where7-2.32.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=32.0 AND d<33.0 AND d NOT NULL) - OR b=586 - OR b=267 - OR b=795 - OR b=704 - OR b=242 - OR a=80 - OR f='lmnopqrst' - OR 1000000=32.0 AND d<33.0 AND d NOT NULL) - OR b=586 - OR b=267 - OR b=795 - OR b=704 - OR b=242 - OR a=80 - OR f='lmnopqrst' - OR 1000000=31.0 AND d<32.0 AND d NOT NULL) - ORDER BY a - } -} {31 73 scan 0 sort 0} -do_test where7-2.33.2 { - count_steps { - SELECT a FROM t3 - WHERE b=1059 - OR a=73 - OR (d>=31.0 AND d<32.0 AND d NOT NULL) - ORDER BY a - } -} {31 73 scan 0 sort 0} -do_test where7-2.34.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='tsrqpon' AND f GLOB 'abcde*') - OR b=572 - OR (g='rqponml' AND f GLOB 'lmnop*') - OR a=54 - OR a=90 - OR (d>=88.0 AND d<89.0 AND d NOT NULL) - ORDER BY a - } -} {26 37 52 54 88 90 scan 0 sort 0} -do_test where7-2.34.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='tsrqpon' AND f GLOB 'abcde*') - OR b=572 - OR (g='rqponml' AND f GLOB 'lmnop*') - OR a=54 - OR a=90 - OR (d>=88.0 AND d<89.0 AND d NOT NULL) - ORDER BY a - } -} {26 37 52 54 88 90 scan 0 sort 0} -do_test where7-2.35.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='jihgfed' AND f GLOB 'zabcd*') - OR c=16016 - OR (d>=54.0 AND d<55.0 AND d NOT NULL) - OR (g='ihgfedc' AND f GLOB 'efghi*') - OR b=1100 - OR a=14 - OR b=473 - ORDER BY a - } -} {14 43 46 47 48 54 77 82 100 scan 0 sort 0} -do_test where7-2.35.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='jihgfed' AND f GLOB 'zabcd*') - OR c=16016 - OR (d>=54.0 AND d<55.0 AND d NOT NULL) - OR (g='ihgfedc' AND f GLOB 'efghi*') - OR b=1100 - OR a=14 - OR b=473 - ORDER BY a - } -} {14 43 46 47 48 54 77 82 100 scan 0 sort 0} -do_test where7-2.36.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 49 AND 51) AND a!=50) - OR b=1078 - OR b=80 - OR b=223 - ORDER BY a - } -} {49 51 98 scan 0 sort 0} -do_test where7-2.36.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 49 AND 51) AND a!=50) - OR b=1078 - OR b=80 - OR b=223 - ORDER BY a - } -} {49 51 98 scan 0 sort 0} -do_test where7-2.37.1 { - count_steps { - SELECT a FROM t2 - WHERE b=297 - OR b=825 - OR ((a BETWEEN 16 AND 18) AND a!=17) - OR b=297 - OR b=847 - OR b=69 - ORDER BY a - } -} {16 18 27 75 77 scan 0 sort 0} -do_test where7-2.37.2 { - count_steps { - SELECT a FROM t3 - WHERE b=297 - OR b=825 - OR ((a BETWEEN 16 AND 18) AND a!=17) - OR b=297 - OR b=847 - OR b=69 - ORDER BY a - } -} {16 18 27 75 77 scan 0 sort 0} -do_test where7-2.38.1 { - count_steps { - SELECT a FROM t2 - WHERE f='efghijklm' - OR a=74 - OR ((a BETWEEN 35 AND 37) AND a!=36) - OR (f GLOB '?cdef*' AND f GLOB 'bcde*') - OR (g='jihgfed' AND f GLOB 'vwxyz*') - OR (d>=84.0 AND d<85.0 AND d NOT NULL) - OR ((a BETWEEN 99 AND 101) AND a!=100) - ORDER BY a - } -} {1 4 27 30 35 37 53 56 73 74 79 82 84 99 scan 0 sort 0} -do_test where7-2.38.2 { - count_steps { - SELECT a FROM t3 - WHERE f='efghijklm' - OR a=74 - OR ((a BETWEEN 35 AND 37) AND a!=36) - OR (f GLOB '?cdef*' AND f GLOB 'bcde*') - OR (g='jihgfed' AND f GLOB 'vwxyz*') - OR (d>=84.0 AND d<85.0 AND d NOT NULL) - OR ((a BETWEEN 99 AND 101) AND a!=100) - ORDER BY a - } -} {1 4 27 30 35 37 53 56 73 74 79 82 84 99 scan 0 sort 0} -do_test where7-2.39.1 { - count_steps { - SELECT a FROM t2 - WHERE b=286 - OR (g='mlkjihg' AND f GLOB 'klmno*') - OR (d>=81.0 AND d<82.0 AND d NOT NULL) - OR b=627 - OR (f GLOB '?defg*' AND f GLOB 'cdef*') - OR (d>=38.0 AND d<39.0 AND d NOT NULL) - OR c=31031 - ORDER BY a - } -} {2 26 28 38 54 57 62 80 81 91 92 93 scan 0 sort 0} -do_test where7-2.39.2 { - count_steps { - SELECT a FROM t3 - WHERE b=286 - OR (g='mlkjihg' AND f GLOB 'klmno*') - OR (d>=81.0 AND d<82.0 AND d NOT NULL) - OR b=627 - OR (f GLOB '?defg*' AND f GLOB 'cdef*') - OR (d>=38.0 AND d<39.0 AND d NOT NULL) - OR c=31031 - ORDER BY a - } -} {2 26 28 38 54 57 62 80 81 91 92 93 scan 0 sort 0} -do_test where7-2.40.1 { - count_steps { - SELECT a FROM t2 - WHERE b=333 - OR (g='lkjihgf' AND f GLOB 'pqrst*') - OR (d>=8.0 AND d<9.0 AND d NOT NULL) - OR c=22022 - ORDER BY a - } -} {8 64 65 66 67 scan 0 sort 0} -do_test where7-2.40.2 { - count_steps { - SELECT a FROM t3 - WHERE b=333 - OR (g='lkjihgf' AND f GLOB 'pqrst*') - OR (d>=8.0 AND d<9.0 AND d NOT NULL) - OR c=22022 - ORDER BY a - } -} {8 64 65 66 67 scan 0 sort 0} -do_test where7-2.41.1 { - count_steps { - SELECT a FROM t2 - WHERE a=18 - OR c=31031 - OR c=7007 - OR b=1100 - OR b=715 - OR (d>=81.0 AND d<82.0 AND d NOT NULL) - OR b=773 - OR b=487 - OR b=421 - OR b=1015 - OR b=124 - ORDER BY a - } -} {18 19 20 21 65 81 91 92 93 100 scan 0 sort 0} -do_test where7-2.41.2 { - count_steps { - SELECT a FROM t3 - WHERE a=18 - OR c=31031 - OR c=7007 - OR b=1100 - OR b=715 - OR (d>=81.0 AND d<82.0 AND d NOT NULL) - OR b=773 - OR b=487 - OR b=421 - OR b=1015 - OR b=124 - ORDER BY a - } -} {18 19 20 21 65 81 91 92 93 100 scan 0 sort 0} -do_test where7-2.42.1 { - count_steps { - SELECT a FROM t2 - WHERE b=704 - OR b=289 - OR (d>=82.0 AND d<83.0 AND d NOT NULL) - OR b=47 - ORDER BY a - } -} {64 82 scan 0 sort 0} -do_test where7-2.42.2 { - count_steps { - SELECT a FROM t3 - WHERE b=704 - OR b=289 - OR (d>=82.0 AND d<83.0 AND d NOT NULL) - OR b=47 - ORDER BY a - } -} {64 82 scan 0 sort 0} -do_test where7-2.43.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=51.0 AND d<52.0 AND d NOT NULL) - OR ((a BETWEEN 46 AND 48) AND a!=47) - OR b=770 - OR (d>=35.0 AND d<36.0 AND d NOT NULL) - OR b=14 - OR ((a BETWEEN 49 AND 51) AND a!=50) - OR a=37 - OR ((a BETWEEN 39 AND 41) AND a!=40) - ORDER BY a - } -} {35 37 39 41 46 48 49 51 70 scan 0 sort 0} -do_test where7-2.43.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=51.0 AND d<52.0 AND d NOT NULL) - OR ((a BETWEEN 46 AND 48) AND a!=47) - OR b=770 - OR (d>=35.0 AND d<36.0 AND d NOT NULL) - OR b=14 - OR ((a BETWEEN 49 AND 51) AND a!=50) - OR a=37 - OR ((a BETWEEN 39 AND 41) AND a!=40) - ORDER BY a - } -} {35 37 39 41 46 48 49 51 70 scan 0 sort 0} -do_test where7-2.44.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=51.0 AND d<52.0 AND d NOT NULL) - OR b=135 - OR ((a BETWEEN 38 AND 40) AND a!=39) - OR (d>=16.0 AND d<17.0 AND d NOT NULL) - ORDER BY a - } -} {16 38 40 51 scan 0 sort 0} -do_test where7-2.44.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=51.0 AND d<52.0 AND d NOT NULL) - OR b=135 - OR ((a BETWEEN 38 AND 40) AND a!=39) - OR (d>=16.0 AND d<17.0 AND d NOT NULL) - ORDER BY a - } -} {16 38 40 51 scan 0 sort 0} -do_test where7-2.45.1 { - count_steps { - SELECT a FROM t2 - WHERE a=29 - OR (g='gfedcba' AND f GLOB 'nopqr*') - OR (g='onmlkji' AND f GLOB 'zabcd*') - OR a=47 - OR c>=34035 - OR (d>=13.0 AND d<14.0 AND d NOT NULL) - OR (d>=72.0 AND d<73.0 AND d NOT NULL) - ORDER BY a - } -} {13 29 47 51 72 91 scan 0 sort 0} -do_test where7-2.45.2 { - count_steps { - SELECT a FROM t3 - WHERE a=29 - OR (g='gfedcba' AND f GLOB 'nopqr*') - OR (g='onmlkji' AND f GLOB 'zabcd*') - OR a=47 - OR c>=34035 - OR (d>=13.0 AND d<14.0 AND d NOT NULL) - OR (d>=72.0 AND d<73.0 AND d NOT NULL) - ORDER BY a - } -} {13 29 47 51 72 91 scan 0 sort 0} -do_test where7-2.46.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=34.0 AND d<35.0 AND d NOT NULL) - OR (d>=91.0 AND d<92.0 AND d NOT NULL) - OR ((a BETWEEN 93 AND 95) AND a!=94) - OR b=454 - OR ((a BETWEEN 65 AND 67) AND a!=66) - OR b=638 - OR (g='gfedcba' AND f GLOB 'klmno*') - OR c=25025 - OR f='yzabcdefg' - OR c=16016 - ORDER BY a - } -} {24 34 46 47 48 50 58 65 67 73 74 75 76 88 91 93 95 scan 0 sort 0} -do_test where7-2.46.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=34.0 AND d<35.0 AND d NOT NULL) - OR (d>=91.0 AND d<92.0 AND d NOT NULL) - OR ((a BETWEEN 93 AND 95) AND a!=94) - OR b=454 - OR ((a BETWEEN 65 AND 67) AND a!=66) - OR b=638 - OR (g='gfedcba' AND f GLOB 'klmno*') - OR c=25025 - OR f='yzabcdefg' - OR c=16016 - ORDER BY a - } -} {24 34 46 47 48 50 58 65 67 73 74 75 76 88 91 93 95 scan 0 sort 0} -do_test where7-2.47.1 { - count_steps { - SELECT a FROM t2 - WHERE b=352 - OR (d>=23.0 AND d<24.0 AND d NOT NULL) - OR (d>=68.0 AND d<69.0 AND d NOT NULL) - OR (d>=91.0 AND d<92.0 AND d NOT NULL) - ORDER BY a - } -} {23 32 68 91 scan 0 sort 0} -do_test where7-2.47.2 { - count_steps { - SELECT a FROM t3 - WHERE b=352 - OR (d>=23.0 AND d<24.0 AND d NOT NULL) - OR (d>=68.0 AND d<69.0 AND d NOT NULL) - OR (d>=91.0 AND d<92.0 AND d NOT NULL) - ORDER BY a - } -} {23 32 68 91 scan 0 sort 0} -do_test where7-2.48.1 { - count_steps { - SELECT a FROM t2 - WHERE b=418 - OR c=23023 - OR b=869 - OR b=781 - ORDER BY a - } -} {38 67 68 69 71 79 scan 0 sort 0} -do_test where7-2.48.2 { - count_steps { - SELECT a FROM t3 - WHERE b=418 - OR c=23023 - OR b=869 - OR b=781 - ORDER BY a - } -} {38 67 68 69 71 79 scan 0 sort 0} -do_test where7-2.49.1 { - count_steps { - SELECT a FROM t2 - WHERE b=69 - OR ((a BETWEEN 45 AND 47) AND a!=46) - OR (f GLOB '?fghi*' AND f GLOB 'efgh*') - OR (g='tsrqpon' AND f GLOB 'yzabc*') - OR (d>=92.0 AND d<93.0 AND d NOT NULL) - OR (d>=7.0 AND d<8.0 AND d NOT NULL) - ORDER BY a - } -} {4 7 24 30 45 47 56 82 92 scan 0 sort 0} -do_test where7-2.49.2 { - count_steps { - SELECT a FROM t3 - WHERE b=69 - OR ((a BETWEEN 45 AND 47) AND a!=46) - OR (f GLOB '?fghi*' AND f GLOB 'efgh*') - OR (g='tsrqpon' AND f GLOB 'yzabc*') - OR (d>=92.0 AND d<93.0 AND d NOT NULL) - OR (d>=7.0 AND d<8.0 AND d NOT NULL) - ORDER BY a - } -} {4 7 24 30 45 47 56 82 92 scan 0 sort 0} -do_test where7-2.50.1 { - count_steps { - SELECT a FROM t2 - WHERE c=22022 - OR b=264 - OR f='lmnopqrst' - OR (g='rqponml' AND f GLOB 'klmno*') - OR a=45 - OR (g='xwvutsr' AND f GLOB 'defgh*') - OR (d>=13.0 AND d<14.0 AND d NOT NULL) - OR (d>=58.0 AND d<59.0 AND d NOT NULL) - OR (g='gfedcba' AND f GLOB 'lmnop*') - ORDER BY a - } -} {3 11 13 24 36 37 45 58 63 64 65 66 89 scan 0 sort 0} -do_test where7-2.50.2 { - count_steps { - SELECT a FROM t3 - WHERE c=22022 - OR b=264 - OR f='lmnopqrst' - OR (g='rqponml' AND f GLOB 'klmno*') - OR a=45 - OR (g='xwvutsr' AND f GLOB 'defgh*') - OR (d>=13.0 AND d<14.0 AND d NOT NULL) - OR (d>=58.0 AND d<59.0 AND d NOT NULL) - OR (g='gfedcba' AND f GLOB 'lmnop*') - ORDER BY a - } -} {3 11 13 24 36 37 45 58 63 64 65 66 89 scan 0 sort 0} -do_test where7-2.51.1 { - count_steps { - SELECT a FROM t2 - WHERE b=1012 - OR ((a BETWEEN 73 AND 75) AND a!=74) - OR a=51 - OR (d>=97.0 AND d<98.0 AND d NOT NULL) - OR a=77 - ORDER BY a - } -} {51 73 75 77 92 97 scan 0 sort 0} -do_test where7-2.51.2 { - count_steps { - SELECT a FROM t3 - WHERE b=1012 - OR ((a BETWEEN 73 AND 75) AND a!=74) - OR a=51 - OR (d>=97.0 AND d<98.0 AND d NOT NULL) - OR a=77 - ORDER BY a - } -} {51 73 75 77 92 97 scan 0 sort 0} -do_test where7-2.52.1 { - count_steps { - SELECT a FROM t2 - WHERE a=22 - OR c<=10 - OR ((a BETWEEN 6 AND 8) AND a!=7) - OR (g='tsrqpon' AND f GLOB 'zabcd*') - OR b=531 - OR c=22022 - OR ((a BETWEEN 24 AND 26) AND a!=25) - OR b=847 - OR (g='tsrqpon' AND f GLOB 'zabcd*') - OR (d>=40.0 AND d<41.0 AND d NOT NULL) - OR a=78 - ORDER BY a - } -} {6 8 22 24 25 26 40 64 65 66 77 78 scan 0 sort 0} -do_test where7-2.52.2 { - count_steps { - SELECT a FROM t3 - WHERE a=22 - OR c<=10 - OR ((a BETWEEN 6 AND 8) AND a!=7) - OR (g='tsrqpon' AND f GLOB 'zabcd*') - OR b=531 - OR c=22022 - OR ((a BETWEEN 24 AND 26) AND a!=25) - OR b=847 - OR (g='tsrqpon' AND f GLOB 'zabcd*') - OR (d>=40.0 AND d<41.0 AND d NOT NULL) - OR a=78 - ORDER BY a - } -} {6 8 22 24 25 26 40 64 65 66 77 78 scan 0 sort 0} -do_test where7-2.53.1 { - count_steps { - SELECT a FROM t2 - WHERE 1000000=15.0 AND d<16.0 AND d NOT NULL) - OR a=73 - OR ((a BETWEEN 27 AND 29) AND a!=28) - ORDER BY a - } -} {15 27 29 52 53 54 73 79 80 81 scan 0 sort 0} -do_test where7-2.53.2 { - count_steps { - SELECT a FROM t3 - WHERE 1000000=15.0 AND d<16.0 AND d NOT NULL) - OR a=73 - OR ((a BETWEEN 27 AND 29) AND a!=28) - ORDER BY a - } -} {15 27 29 52 53 54 73 79 80 81 scan 0 sort 0} -do_test where7-2.54.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=18.0 AND d<19.0 AND d NOT NULL) - OR (f GLOB '?hijk*' AND f GLOB 'ghij*') - OR (g='vutsrqp' AND f GLOB 'pqrst*') - OR (g='edcbazy' AND f GLOB 'vwxyz*') - OR (g='yxwvuts' AND f GLOB 'cdefg*') - OR ((a BETWEEN 70 AND 72) AND a!=71) - OR ((a BETWEEN 92 AND 94) AND a!=93) - OR (g='qponmlk' AND f GLOB 'nopqr*') - OR b=1081 - OR ((a BETWEEN 12 AND 14) AND a!=13) - OR b=399 - ORDER BY a - } -} {2 6 12 14 15 18 32 39 58 70 72 84 92 94 99 scan 0 sort 0} -do_test where7-2.54.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=18.0 AND d<19.0 AND d NOT NULL) - OR (f GLOB '?hijk*' AND f GLOB 'ghij*') - OR (g='vutsrqp' AND f GLOB 'pqrst*') - OR (g='edcbazy' AND f GLOB 'vwxyz*') - OR (g='yxwvuts' AND f GLOB 'cdefg*') - OR ((a BETWEEN 70 AND 72) AND a!=71) - OR ((a BETWEEN 92 AND 94) AND a!=93) - OR (g='qponmlk' AND f GLOB 'nopqr*') - OR b=1081 - OR ((a BETWEEN 12 AND 14) AND a!=13) - OR b=399 - ORDER BY a - } -} {2 6 12 14 15 18 32 39 58 70 72 84 92 94 99 scan 0 sort 0} -do_test where7-2.55.1 { - count_steps { - SELECT a FROM t2 - WHERE b=352 - OR e IS NULL - OR b=1034 - OR b=1048 - OR (d>=59.0 AND d<60.0 AND d NOT NULL) - OR ((a BETWEEN 35 AND 37) AND a!=36) - OR (d>=40.0 AND d<41.0 AND d NOT NULL) - OR b=47 - OR (d>=76.0 AND d<77.0 AND d NOT NULL) - ORDER BY a - } -} {32 35 37 40 59 76 94 scan 0 sort 0} -do_test where7-2.55.2 { - count_steps { - SELECT a FROM t3 - WHERE b=352 - OR e IS NULL - OR b=1034 - OR b=1048 - OR (d>=59.0 AND d<60.0 AND d NOT NULL) - OR ((a BETWEEN 35 AND 37) AND a!=36) - OR (d>=40.0 AND d<41.0 AND d NOT NULL) - OR b=47 - OR (d>=76.0 AND d<77.0 AND d NOT NULL) - ORDER BY a - } -} {32 35 37 40 59 76 94 scan 0 sort 0} -do_test where7-2.56.1 { - count_steps { - SELECT a FROM t2 - WHERE a=14 - OR ((a BETWEEN 92 AND 94) AND a!=93) - OR (g='yxwvuts' AND f GLOB 'bcdef*') - OR (d>=75.0 AND d<76.0 AND d NOT NULL) - ORDER BY a - } -} {1 14 75 92 94 scan 0 sort 0} -do_test where7-2.56.2 { - count_steps { - SELECT a FROM t3 - WHERE a=14 - OR ((a BETWEEN 92 AND 94) AND a!=93) - OR (g='yxwvuts' AND f GLOB 'bcdef*') - OR (d>=75.0 AND d<76.0 AND d NOT NULL) - ORDER BY a - } -} {1 14 75 92 94 scan 0 sort 0} -do_test where7-2.57.1 { - count_steps { - SELECT a FROM t2 - WHERE b=707 - OR (d>=98.0 AND d<99.0 AND d NOT NULL) - OR (g='gfedcba' AND f GLOB 'nopqr*') - OR (g='gfedcba' AND f GLOB 'mnopq*') - OR b=473 - OR ((a BETWEEN 26 AND 28) AND a!=27) - OR (g='lkjihgf' AND f GLOB 'opqrs*') - OR b=352 - OR b=693 - ORDER BY a - } -} {26 28 32 43 63 66 90 91 98 scan 0 sort 0} -do_test where7-2.57.2 { - count_steps { - SELECT a FROM t3 - WHERE b=707 - OR (d>=98.0 AND d<99.0 AND d NOT NULL) - OR (g='gfedcba' AND f GLOB 'nopqr*') - OR (g='gfedcba' AND f GLOB 'mnopq*') - OR b=473 - OR ((a BETWEEN 26 AND 28) AND a!=27) - OR (g='lkjihgf' AND f GLOB 'opqrs*') - OR b=352 - OR b=693 - ORDER BY a - } -} {26 28 32 43 63 66 90 91 98 scan 0 sort 0} -do_test where7-2.58.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 81 AND 83) AND a!=82) - OR f='hijklmnop' - OR b=748 - OR ((a BETWEEN 78 AND 80) AND a!=79) - OR f='defghijkl' - OR c=27027 - OR g IS NULL - OR a=40 - OR (f GLOB '?defg*' AND f GLOB 'cdef*') - ORDER BY a - } -} {2 3 7 28 29 33 40 54 55 59 68 78 79 80 81 83 85 scan 0 sort 0} -do_test where7-2.58.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 81 AND 83) AND a!=82) - OR f='hijklmnop' - OR b=748 - OR ((a BETWEEN 78 AND 80) AND a!=79) - OR f='defghijkl' - OR c=27027 - OR g IS NULL - OR a=40 - OR (f GLOB '?defg*' AND f GLOB 'cdef*') - ORDER BY a - } -} {2 3 7 28 29 33 40 54 55 59 68 78 79 80 81 83 85 scan 0 sort 0} -do_test where7-2.59.1 { - count_steps { - SELECT a FROM t2 - WHERE a=62 - OR b=839 - OR a=36 - OR b=638 - OR (g='tsrqpon' AND f GLOB 'abcde*') - OR a=73 - OR a=48 - OR a=86 - OR (g='ihgfedc' AND f GLOB 'bcdef*') - ORDER BY a - } -} {26 36 48 58 62 73 79 86 scan 0 sort 0} -do_test where7-2.59.2 { - count_steps { - SELECT a FROM t3 - WHERE a=62 - OR b=839 - OR a=36 - OR b=638 - OR (g='tsrqpon' AND f GLOB 'abcde*') - OR a=73 - OR a=48 - OR a=86 - OR (g='ihgfedc' AND f GLOB 'bcdef*') - ORDER BY a - } -} {26 36 48 58 62 73 79 86 scan 0 sort 0} -do_test where7-2.60.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 4 AND 6) AND a!=5) - OR b=641 - OR ((a BETWEEN 9 AND 11) AND a!=10) - OR (d>=14.0 AND d<15.0 AND d NOT NULL) - OR b=880 - OR a=94 - ORDER BY a - } -} {4 6 9 11 14 80 94 scan 0 sort 0} -do_test where7-2.60.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 4 AND 6) AND a!=5) - OR b=641 - OR ((a BETWEEN 9 AND 11) AND a!=10) - OR (d>=14.0 AND d<15.0 AND d NOT NULL) - OR b=880 - OR a=94 - ORDER BY a - } -} {4 6 9 11 14 80 94 scan 0 sort 0} -do_test where7-2.61.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 29 AND 31) AND a!=30) - OR (d>=71.0 AND d<72.0 AND d NOT NULL) - ORDER BY a - } -} {29 31 71 scan 0 sort 0} -do_test where7-2.61.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 29 AND 31) AND a!=30) - OR (d>=71.0 AND d<72.0 AND d NOT NULL) - ORDER BY a - } -} {29 31 71 scan 0 sort 0} -do_test where7-2.62.1 { - count_steps { - SELECT a FROM t2 - WHERE (f GLOB '?zabc*' AND f GLOB 'yzab*') - OR (g='wvutsrq' AND f GLOB 'jklmn*') - OR ((a BETWEEN 11 AND 13) AND a!=12) - OR b=971 - OR (g='tsrqpon' AND f GLOB 'abcde*') - OR b=726 - OR b=858 - OR ((a BETWEEN 68 AND 70) AND a!=69) - OR a=56 - ORDER BY a - } -} {9 11 13 24 26 50 56 66 68 70 76 78 scan 0 sort 0} -do_test where7-2.62.2 { - count_steps { - SELECT a FROM t3 - WHERE (f GLOB '?zabc*' AND f GLOB 'yzab*') - OR (g='wvutsrq' AND f GLOB 'jklmn*') - OR ((a BETWEEN 11 AND 13) AND a!=12) - OR b=971 - OR (g='tsrqpon' AND f GLOB 'abcde*') - OR b=726 - OR b=858 - OR ((a BETWEEN 68 AND 70) AND a!=69) - OR a=56 - ORDER BY a - } -} {9 11 13 24 26 50 56 66 68 70 76 78 scan 0 sort 0} -do_test where7-2.63.1 { - count_steps { - SELECT a FROM t2 - WHERE c=21021 - OR b=795 - OR (g='yxwvuts' AND f GLOB 'bcdef*') - OR f='rstuvwxyz' - OR a=46 - OR b=773 - OR (g='jihgfed' AND f GLOB 'zabcd*') - OR a=1 - OR ((a BETWEEN 12 AND 14) AND a!=13) - ORDER BY a - } -} {1 12 14 17 43 46 61 62 63 69 77 95 scan 0 sort 0} -do_test where7-2.63.2 { - count_steps { - SELECT a FROM t3 - WHERE c=21021 - OR b=795 - OR (g='yxwvuts' AND f GLOB 'bcdef*') - OR f='rstuvwxyz' - OR a=46 - OR b=773 - OR (g='jihgfed' AND f GLOB 'zabcd*') - OR a=1 - OR ((a BETWEEN 12 AND 14) AND a!=13) - ORDER BY a - } -} {1 12 14 17 43 46 61 62 63 69 77 95 scan 0 sort 0} -do_test where7-2.64.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 35 AND 37) AND a!=36) - OR (d>=70.0 AND d<71.0 AND d NOT NULL) - OR (g='qponmlk' AND f GLOB 'mnopq*') - OR a=77 - ORDER BY a - } -} {35 37 38 70 77 scan 0 sort 0} -do_test where7-2.64.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 35 AND 37) AND a!=36) - OR (d>=70.0 AND d<71.0 AND d NOT NULL) - OR (g='qponmlk' AND f GLOB 'mnopq*') - OR a=77 - ORDER BY a - } -} {35 37 38 70 77 scan 0 sort 0} -do_test where7-2.65.1 { - count_steps { - SELECT a FROM t2 - WHERE f='jklmnopqr' - OR b=517 - ORDER BY a - } -} {9 35 47 61 87 scan 0 sort 0} -do_test where7-2.65.2 { - count_steps { - SELECT a FROM t3 - WHERE f='jklmnopqr' - OR b=517 - ORDER BY a - } -} {9 35 47 61 87 scan 0 sort 0} -do_test where7-2.66.1 { - count_steps { - SELECT a FROM t2 - WHERE b=330 - OR b=410 - OR (g='jihgfed' AND f GLOB 'vwxyz*') - OR b=102 - OR (d>=78.0 AND d<79.0 AND d NOT NULL) - OR f='bcdefghij' - OR b=168 - OR (d>=5.0 AND d<6.0 AND d NOT NULL) - ORDER BY a - } -} {1 5 27 30 53 73 78 79 scan 0 sort 0} -do_test where7-2.66.2 { - count_steps { - SELECT a FROM t3 - WHERE b=330 - OR b=410 - OR (g='jihgfed' AND f GLOB 'vwxyz*') - OR b=102 - OR (d>=78.0 AND d<79.0 AND d NOT NULL) - OR f='bcdefghij' - OR b=168 - OR (d>=5.0 AND d<6.0 AND d NOT NULL) - ORDER BY a - } -} {1 5 27 30 53 73 78 79 scan 0 sort 0} -do_test where7-2.67.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=8.0 AND d<9.0 AND d NOT NULL) - OR (g='mlkjihg' AND f GLOB 'ijklm*') - OR a=37 - OR ((a BETWEEN 43 AND 45) AND a!=44) - ORDER BY a - } -} {8 37 43 45 60 scan 0 sort 0} -do_test where7-2.67.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=8.0 AND d<9.0 AND d NOT NULL) - OR (g='mlkjihg' AND f GLOB 'ijklm*') - OR a=37 - OR ((a BETWEEN 43 AND 45) AND a!=44) - ORDER BY a - } -} {8 37 43 45 60 scan 0 sort 0} -do_test where7-2.68.1 { - count_steps { - SELECT a FROM t2 - WHERE a=91 - OR (g='lkjihgf' AND f GLOB 'opqrs*') - OR ((a BETWEEN 70 AND 72) AND a!=71) - OR (g='kjihgfe' AND f GLOB 'rstuv*') - OR ((a BETWEEN 81 AND 83) AND a!=82) - OR b=564 - OR (g='lkjihgf' AND f GLOB 'opqrs*') - OR (g='vutsrqp' AND f GLOB 'nopqr*') - OR a=43 - OR b=773 - ORDER BY a - } -} {13 43 66 69 70 72 81 83 91 scan 0 sort 0} -do_test where7-2.68.2 { - count_steps { - SELECT a FROM t3 - WHERE a=91 - OR (g='lkjihgf' AND f GLOB 'opqrs*') - OR ((a BETWEEN 70 AND 72) AND a!=71) - OR (g='kjihgfe' AND f GLOB 'rstuv*') - OR ((a BETWEEN 81 AND 83) AND a!=82) - OR b=564 - OR (g='lkjihgf' AND f GLOB 'opqrs*') - OR (g='vutsrqp' AND f GLOB 'nopqr*') - OR a=43 - OR b=773 - ORDER BY a - } -} {13 43 66 69 70 72 81 83 91 scan 0 sort 0} -do_test where7-2.69.1 { - count_steps { - SELECT a FROM t2 - WHERE f='defghijkl' - OR c>=34035 - ORDER BY a - } -} {3 29 55 81 scan 0 sort 0} -do_test where7-2.69.2 { - count_steps { - SELECT a FROM t3 - WHERE f='defghijkl' - OR c>=34035 - ORDER BY a - } -} {3 29 55 81 scan 0 sort 0} -do_test where7-2.70.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 79 AND 81) AND a!=80) - OR ((a BETWEEN 89 AND 91) AND a!=90) - OR (f GLOB '?stuv*' AND f GLOB 'rstu*') - ORDER BY a - } -} {17 43 69 79 81 89 91 95 scan 0 sort 0} -do_test where7-2.70.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 79 AND 81) AND a!=80) - OR ((a BETWEEN 89 AND 91) AND a!=90) - OR (f GLOB '?stuv*' AND f GLOB 'rstu*') - ORDER BY a - } -} {17 43 69 79 81 89 91 95 scan 0 sort 0} -do_test where7-2.71.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=56.0 AND d<57.0 AND d NOT NULL) - OR (g='tsrqpon' AND f GLOB 'zabcd*') - OR ((a BETWEEN 26 AND 28) AND a!=27) - OR (g='ponmlkj' AND f GLOB 'rstuv*') - ORDER BY a - } -} {25 26 28 43 56 scan 0 sort 0} -do_test where7-2.71.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=56.0 AND d<57.0 AND d NOT NULL) - OR (g='tsrqpon' AND f GLOB 'zabcd*') - OR ((a BETWEEN 26 AND 28) AND a!=27) - OR (g='ponmlkj' AND f GLOB 'rstuv*') - ORDER BY a - } -} {25 26 28 43 56 scan 0 sort 0} -do_test where7-2.72.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 14 AND 16) AND a!=15) - OR b=451 - OR (g='srqponm' AND f GLOB 'cdefg*') - OR a=91 - ORDER BY a - } -} {14 16 28 41 91 scan 0 sort 0} -do_test where7-2.72.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 14 AND 16) AND a!=15) - OR b=451 - OR (g='srqponm' AND f GLOB 'cdefg*') - OR a=91 - ORDER BY a - } -} {14 16 28 41 91 scan 0 sort 0} -do_test where7-2.73.1 { - count_steps { - SELECT a FROM t2 - WHERE a=7 - OR (d>=77.0 AND d<78.0 AND d NOT NULL) - OR b=1001 - ORDER BY a - } -} {7 77 91 scan 0 sort 0} -do_test where7-2.73.2 { - count_steps { - SELECT a FROM t3 - WHERE a=7 - OR (d>=77.0 AND d<78.0 AND d NOT NULL) - OR b=1001 - ORDER BY a - } -} {7 77 91 scan 0 sort 0} -do_test where7-2.74.1 { - count_steps { - SELECT a FROM t2 - WHERE b=704 - OR (d>=45.0 AND d<46.0 AND d NOT NULL) - OR b=542 - OR b=968 - OR (g='xwvutsr' AND f GLOB 'ghijk*') - ORDER BY a - } -} {6 45 64 88 scan 0 sort 0} -do_test where7-2.74.2 { - count_steps { - SELECT a FROM t3 - WHERE b=704 - OR (d>=45.0 AND d<46.0 AND d NOT NULL) - OR b=542 - OR b=968 - OR (g='xwvutsr' AND f GLOB 'ghijk*') - ORDER BY a - } -} {6 45 64 88 scan 0 sort 0} -do_test where7-2.75.1 { - count_steps { - SELECT a FROM t2 - WHERE a=92 - OR (d>=9.0 AND d<10.0 AND d NOT NULL) - OR ((a BETWEEN 19 AND 21) AND a!=20) - OR (g='edcbazy' AND f GLOB 'uvwxy*') - OR b=902 - OR ((a BETWEEN 80 AND 82) AND a!=81) - OR b=487 - OR ((a BETWEEN 48 AND 50) AND a!=49) - OR (d>=23.0 AND d<24.0 AND d NOT NULL) - OR b=495 - ORDER BY a - } -} {9 19 21 23 45 48 50 80 82 92 98 scan 0 sort 0} -do_test where7-2.75.2 { - count_steps { - SELECT a FROM t3 - WHERE a=92 - OR (d>=9.0 AND d<10.0 AND d NOT NULL) - OR ((a BETWEEN 19 AND 21) AND a!=20) - OR (g='edcbazy' AND f GLOB 'uvwxy*') - OR b=902 - OR ((a BETWEEN 80 AND 82) AND a!=81) - OR b=487 - OR ((a BETWEEN 48 AND 50) AND a!=49) - OR (d>=23.0 AND d<24.0 AND d NOT NULL) - OR b=495 - ORDER BY a - } -} {9 19 21 23 45 48 50 80 82 92 98 scan 0 sort 0} -do_test where7-2.76.1 { - count_steps { - SELECT a FROM t2 - WHERE a=74 - OR (d>=29.0 AND d<30.0 AND d NOT NULL) - OR a=25 - OR a=5 - OR f='hijklmnop' - OR f='zabcdefgh' - OR (d>=87.0 AND d<88.0 AND d NOT NULL) - ORDER BY a - } -} {5 7 25 29 33 51 59 74 77 85 87 scan 0 sort 0} -do_test where7-2.76.2 { - count_steps { - SELECT a FROM t3 - WHERE a=74 - OR (d>=29.0 AND d<30.0 AND d NOT NULL) - OR a=25 - OR a=5 - OR f='hijklmnop' - OR f='zabcdefgh' - OR (d>=87.0 AND d<88.0 AND d NOT NULL) - ORDER BY a - } -} {5 7 25 29 33 51 59 74 77 85 87 scan 0 sort 0} -do_test where7-2.77.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 5 AND 7) AND a!=6) - OR (d>=40.0 AND d<41.0 AND d NOT NULL) - OR b=770 - OR b=143 - OR (g='rqponml' AND f GLOB 'lmnop*') - OR b=740 - OR ((a BETWEEN 49 AND 51) AND a!=50) - OR c=34034 - ORDER BY a - } -} {5 7 13 37 40 49 51 70 100 scan 0 sort 0} -do_test where7-2.77.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 5 AND 7) AND a!=6) - OR (d>=40.0 AND d<41.0 AND d NOT NULL) - OR b=770 - OR b=143 - OR (g='rqponml' AND f GLOB 'lmnop*') - OR b=740 - OR ((a BETWEEN 49 AND 51) AND a!=50) - OR c=34034 - ORDER BY a - } -} {5 7 13 37 40 49 51 70 100 scan 0 sort 0} -do_test where7-2.78.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 73 AND 75) AND a!=74) - OR a=18 - OR (d>=43.0 AND d<44.0 AND d NOT NULL) - OR (g='tsrqpon' AND f GLOB 'bcdef*') - OR a=6 - OR c=25025 - OR b=641 - OR (d>=81.0 AND d<82.0 AND d NOT NULL) - OR (d>=61.0 AND d<62.0 AND d NOT NULL) - OR b=506 - ORDER BY a - } -} {6 18 27 43 46 61 73 74 75 81 scan 0 sort 0} -do_test where7-2.78.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 73 AND 75) AND a!=74) - OR a=18 - OR (d>=43.0 AND d<44.0 AND d NOT NULL) - OR (g='tsrqpon' AND f GLOB 'bcdef*') - OR a=6 - OR c=25025 - OR b=641 - OR (d>=81.0 AND d<82.0 AND d NOT NULL) - OR (d>=61.0 AND d<62.0 AND d NOT NULL) - OR b=506 - ORDER BY a - } -} {6 18 27 43 46 61 73 74 75 81 scan 0 sort 0} -do_test where7-2.79.1 { - count_steps { - SELECT a FROM t2 - WHERE a=79 - OR b=363 - ORDER BY a - } -} {33 79 scan 0 sort 0} -do_test where7-2.79.2 { - count_steps { - SELECT a FROM t3 - WHERE a=79 - OR b=363 - ORDER BY a - } -} {33 79 scan 0 sort 0} -do_test where7-2.80.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=6.0 AND d<7.0 AND d NOT NULL) - OR ((a BETWEEN 22 AND 24) AND a!=23) - ORDER BY a - } -} {6 22 24 scan 0 sort 0} -do_test where7-2.80.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=6.0 AND d<7.0 AND d NOT NULL) - OR ((a BETWEEN 22 AND 24) AND a!=23) - ORDER BY a - } -} {6 22 24 scan 0 sort 0} -do_test where7-2.81.1 { - count_steps { - SELECT a FROM t2 - WHERE c=31031 - OR (d>=31.0 AND d<32.0 AND d NOT NULL) - OR (d>=8.0 AND d<9.0 AND d NOT NULL) - OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') - ORDER BY a - } -} {8 15 31 41 67 91 92 93 scan 0 sort 0} -do_test where7-2.81.2 { - count_steps { - SELECT a FROM t3 - WHERE c=31031 - OR (d>=31.0 AND d<32.0 AND d NOT NULL) - OR (d>=8.0 AND d<9.0 AND d NOT NULL) - OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') - ORDER BY a - } -} {8 15 31 41 67 91 92 93 scan 0 sort 0} -do_test where7-2.82.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='xwvutsr' AND f GLOB 'hijkl*') - OR ((a BETWEEN 84 AND 86) AND a!=85) - OR (g='edcbazy' AND f GLOB 'uvwxy*') - OR ((a BETWEEN 95 AND 97) AND a!=96) - OR (g='hgfedcb' AND f GLOB 'fghij*') - OR a=6 - OR a=88 - OR (g='srqponm' AND f GLOB 'ghijk*') - OR (g='jihgfed' AND f GLOB 'yzabc*') - OR ((a BETWEEN 18 AND 20) AND a!=19) - ORDER BY a - } -} {6 7 18 20 32 76 83 84 86 88 95 97 98 scan 0 sort 0} -do_test where7-2.82.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='xwvutsr' AND f GLOB 'hijkl*') - OR ((a BETWEEN 84 AND 86) AND a!=85) - OR (g='edcbazy' AND f GLOB 'uvwxy*') - OR ((a BETWEEN 95 AND 97) AND a!=96) - OR (g='hgfedcb' AND f GLOB 'fghij*') - OR a=6 - OR a=88 - OR (g='srqponm' AND f GLOB 'ghijk*') - OR (g='jihgfed' AND f GLOB 'yzabc*') - OR ((a BETWEEN 18 AND 20) AND a!=19) - ORDER BY a - } -} {6 7 18 20 32 76 83 84 86 88 95 97 98 scan 0 sort 0} -do_test where7-2.83.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 36 AND 38) AND a!=37) - OR b=278 - OR b=561 - OR b=286 - OR f='efghijklm' - OR ((a BETWEEN 32 AND 34) AND a!=33) - OR b=201 - ORDER BY a - } -} {4 26 30 32 34 36 38 51 56 82 scan 0 sort 0} -do_test where7-2.83.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 36 AND 38) AND a!=37) - OR b=278 - OR b=561 - OR b=286 - OR f='efghijklm' - OR ((a BETWEEN 32 AND 34) AND a!=33) - OR b=201 - ORDER BY a - } -} {4 26 30 32 34 36 38 51 56 82 scan 0 sort 0} -do_test where7-2.84.1 { - count_steps { - SELECT a FROM t2 - WHERE (f GLOB '?bcde*' AND f GLOB 'abcd*') - OR ((a BETWEEN 73 AND 75) AND a!=74) - OR b=209 - OR b=861 - OR (d>=58.0 AND d<59.0 AND d NOT NULL) - OR (d>=69.0 AND d<70.0 AND d NOT NULL) - OR b=682 - OR ((a BETWEEN 72 AND 74) AND a!=73) - OR b=616 - OR (g='mlkjihg' AND f GLOB 'ijklm*') - OR ((a BETWEEN 67 AND 69) AND a!=68) - ORDER BY a - } -} {19 26 52 56 58 60 62 67 69 72 73 74 75 78 scan 0 sort 0} -do_test where7-2.84.2 { - count_steps { - SELECT a FROM t3 - WHERE (f GLOB '?bcde*' AND f GLOB 'abcd*') - OR ((a BETWEEN 73 AND 75) AND a!=74) - OR b=209 - OR b=861 - OR (d>=58.0 AND d<59.0 AND d NOT NULL) - OR (d>=69.0 AND d<70.0 AND d NOT NULL) - OR b=682 - OR ((a BETWEEN 72 AND 74) AND a!=73) - OR b=616 - OR (g='mlkjihg' AND f GLOB 'ijklm*') - OR ((a BETWEEN 67 AND 69) AND a!=68) - ORDER BY a - } -} {19 26 52 56 58 60 62 67 69 72 73 74 75 78 scan 0 sort 0} -do_test where7-2.85.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=15.0 AND d<16.0 AND d NOT NULL) - OR b=231 - OR (d>=53.0 AND d<54.0 AND d NOT NULL) - OR (d>=46.0 AND d<47.0 AND d NOT NULL) - OR (d>=56.0 AND d<57.0 AND d NOT NULL) - OR b=861 - OR a=53 - OR ((a BETWEEN 24 AND 26) AND a!=25) - ORDER BY a - } -} {15 21 24 26 46 53 56 scan 0 sort 0} -do_test where7-2.85.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=15.0 AND d<16.0 AND d NOT NULL) - OR b=231 - OR (d>=53.0 AND d<54.0 AND d NOT NULL) - OR (d>=46.0 AND d<47.0 AND d NOT NULL) - OR (d>=56.0 AND d<57.0 AND d NOT NULL) - OR b=861 - OR a=53 - OR ((a BETWEEN 24 AND 26) AND a!=25) - ORDER BY a - } -} {15 21 24 26 46 53 56 scan 0 sort 0} -do_test where7-2.86.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 91 AND 93) AND a!=92) - OR c=13013 - ORDER BY a - } -} {37 38 39 91 93 scan 0 sort 0} -do_test where7-2.86.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 91 AND 93) AND a!=92) - OR c=13013 - ORDER BY a - } -} {37 38 39 91 93 scan 0 sort 0} -do_test where7-2.87.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 1 AND 3) AND a!=2) - OR (f GLOB '?vwxy*' AND f GLOB 'uvwx*') - OR b=385 - OR ((a BETWEEN 16 AND 18) AND a!=17) - OR ((a BETWEEN 14 AND 16) AND a!=15) - OR c=33033 - OR (f GLOB '?rstu*' AND f GLOB 'qrst*') - OR b=1004 - OR b=927 - OR (f GLOB '?defg*' AND f GLOB 'cdef*') - ORDER BY a - } -} {1 2 3 14 16 18 20 28 35 42 46 54 68 72 80 94 97 98 99 scan 0 sort 0} -do_test where7-2.87.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 1 AND 3) AND a!=2) - OR (f GLOB '?vwxy*' AND f GLOB 'uvwx*') - OR b=385 - OR ((a BETWEEN 16 AND 18) AND a!=17) - OR ((a BETWEEN 14 AND 16) AND a!=15) - OR c=33033 - OR (f GLOB '?rstu*' AND f GLOB 'qrst*') - OR b=1004 - OR b=927 - OR (f GLOB '?defg*' AND f GLOB 'cdef*') - ORDER BY a - } -} {1 2 3 14 16 18 20 28 35 42 46 54 68 72 80 94 97 98 99 scan 0 sort 0} -do_test where7-2.88.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 48 AND 50) AND a!=49) - OR (g='gfedcba' AND f GLOB 'mnopq*') - OR f IS NULL - OR (g='jihgfed' AND f GLOB 'zabcd*') - OR a=81 - OR a=99 - ORDER BY a - } -} {48 50 77 81 90 99 scan 0 sort 0} -do_test where7-2.88.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 48 AND 50) AND a!=49) - OR (g='gfedcba' AND f GLOB 'mnopq*') - OR f IS NULL - OR (g='jihgfed' AND f GLOB 'zabcd*') - OR a=81 - OR a=99 - ORDER BY a - } -} {48 50 77 81 90 99 scan 0 sort 0} -do_test where7-2.89.1 { - count_steps { - SELECT a FROM t2 - WHERE a=19 - OR b=454 - OR (d>=1.0 AND d<2.0 AND d NOT NULL) - OR (g='onmlkji' AND f GLOB 'xyzab*') - OR (g='lkjihgf' AND f GLOB 'mnopq*') - ORDER BY a - } -} {1 19 49 64 scan 0 sort 0} -do_test where7-2.89.2 { - count_steps { - SELECT a FROM t3 - WHERE a=19 - OR b=454 - OR (d>=1.0 AND d<2.0 AND d NOT NULL) - OR (g='onmlkji' AND f GLOB 'xyzab*') - OR (g='lkjihgf' AND f GLOB 'mnopq*') - ORDER BY a - } -} {1 19 49 64 scan 0 sort 0} -do_test where7-2.90.1 { - count_steps { - SELECT a FROM t2 - WHERE c=24024 - OR ((a BETWEEN 46 AND 48) AND a!=47) - OR a=93 - OR b=33 - OR (g='rqponml' AND f GLOB 'ijklm*') - OR ((a BETWEEN 15 AND 17) AND a!=16) - OR ((a BETWEEN 27 AND 29) AND a!=28) - ORDER BY a - } -} {3 15 17 27 29 34 46 48 70 71 72 93 scan 0 sort 0} -do_test where7-2.90.2 { - count_steps { - SELECT a FROM t3 - WHERE c=24024 - OR ((a BETWEEN 46 AND 48) AND a!=47) - OR a=93 - OR b=33 - OR (g='rqponml' AND f GLOB 'ijklm*') - OR ((a BETWEEN 15 AND 17) AND a!=16) - OR ((a BETWEEN 27 AND 29) AND a!=28) - ORDER BY a - } -} {3 15 17 27 29 34 46 48 70 71 72 93 scan 0 sort 0} -do_test where7-2.91.1 { - count_steps { - SELECT a FROM t2 - WHERE b=924 - OR (d>=48.0 AND d<49.0 AND d NOT NULL) - ORDER BY a - } -} {48 84 scan 0 sort 0} -do_test where7-2.91.2 { - count_steps { - SELECT a FROM t3 - WHERE b=924 - OR (d>=48.0 AND d<49.0 AND d NOT NULL) - ORDER BY a - } -} {48 84 scan 0 sort 0} -do_test where7-2.92.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=81.0 AND d<82.0 AND d NOT NULL) - OR ((a BETWEEN 35 AND 37) AND a!=36) - OR (g='kjihgfe' AND f GLOB 'uvwxy*') - OR ((a BETWEEN 35 AND 37) AND a!=36) - OR c=26026 - OR a=8 - OR ((a BETWEEN 25 AND 27) AND a!=26) - OR b=1048 - ORDER BY a - } -} {8 25 27 35 37 72 76 77 78 81 scan 0 sort 0} -do_test where7-2.92.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=81.0 AND d<82.0 AND d NOT NULL) - OR ((a BETWEEN 35 AND 37) AND a!=36) - OR (g='kjihgfe' AND f GLOB 'uvwxy*') - OR ((a BETWEEN 35 AND 37) AND a!=36) - OR c=26026 - OR a=8 - OR ((a BETWEEN 25 AND 27) AND a!=26) - OR b=1048 - ORDER BY a - } -} {8 25 27 35 37 72 76 77 78 81 scan 0 sort 0} -do_test where7-2.93.1 { - count_steps { - SELECT a FROM t2 - WHERE b=905 - OR (d>=18.0 AND d<19.0 AND d NOT NULL) - ORDER BY a - } -} {18 scan 0 sort 0} -do_test where7-2.93.2 { - count_steps { - SELECT a FROM t3 - WHERE b=905 - OR (d>=18.0 AND d<19.0 AND d NOT NULL) - ORDER BY a - } -} {18 scan 0 sort 0} -do_test where7-2.94.1 { - count_steps { - SELECT a FROM t2 - WHERE a=21 - OR f='jklmnopqr' - OR ((a BETWEEN 11 AND 13) AND a!=12) - OR a=86 - OR b=1070 - OR ((a BETWEEN 26 AND 28) AND a!=27) - OR b=803 - OR (d>=73.0 AND d<74.0 AND d NOT NULL) - OR a=27 - OR (g='tsrqpon' AND f GLOB 'abcde*') - OR b=1001 - ORDER BY a - } -} {9 11 13 21 26 27 28 35 61 73 86 87 91 scan 0 sort 0} -do_test where7-2.94.2 { - count_steps { - SELECT a FROM t3 - WHERE a=21 - OR f='jklmnopqr' - OR ((a BETWEEN 11 AND 13) AND a!=12) - OR a=86 - OR b=1070 - OR ((a BETWEEN 26 AND 28) AND a!=27) - OR b=803 - OR (d>=73.0 AND d<74.0 AND d NOT NULL) - OR a=27 - OR (g='tsrqpon' AND f GLOB 'abcde*') - OR b=1001 - ORDER BY a - } -} {9 11 13 21 26 27 28 35 61 73 86 87 91 scan 0 sort 0} -do_test where7-2.95.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='utsrqpo' AND f GLOB 'stuvw*') - OR b=825 - OR c=31031 - OR c=14014 - OR a=84 - OR c=31031 - OR (g='mlkjihg' AND f GLOB 'ghijk*') - OR ((a BETWEEN 92 AND 94) AND a!=93) - OR f='vwxyzabcd' - OR ((a BETWEEN 54 AND 56) AND a!=55) - ORDER BY a - } -} {18 21 40 41 42 47 54 56 58 73 75 84 91 92 93 94 99 scan 0 sort 0} -do_test where7-2.95.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='utsrqpo' AND f GLOB 'stuvw*') - OR b=825 - OR c=31031 - OR c=14014 - OR a=84 - OR c=31031 - OR (g='mlkjihg' AND f GLOB 'ghijk*') - OR ((a BETWEEN 92 AND 94) AND a!=93) - OR f='vwxyzabcd' - OR ((a BETWEEN 54 AND 56) AND a!=55) - ORDER BY a - } -} {18 21 40 41 42 47 54 56 58 73 75 84 91 92 93 94 99 scan 0 sort 0} -do_test where7-2.96.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 36 AND 38) AND a!=37) - OR ((a BETWEEN 48 AND 50) AND a!=49) - OR g IS NULL - OR a=46 - ORDER BY a - } -} {36 38 46 48 50 scan 0 sort 0} -do_test where7-2.96.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 36 AND 38) AND a!=37) - OR ((a BETWEEN 48 AND 50) AND a!=49) - OR g IS NULL - OR a=46 - ORDER BY a - } -} {36 38 46 48 50 scan 0 sort 0} -do_test where7-2.97.1 { - count_steps { - SELECT a FROM t2 - WHERE (f GLOB '?hijk*' AND f GLOB 'ghij*') - OR a=11 - OR a=98 - ORDER BY a - } -} {6 11 32 58 84 98 scan 0 sort 0} -do_test where7-2.97.2 { - count_steps { - SELECT a FROM t3 - WHERE (f GLOB '?hijk*' AND f GLOB 'ghij*') - OR a=11 - OR a=98 - ORDER BY a - } -} {6 11 32 58 84 98 scan 0 sort 0} -do_test where7-2.98.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 76 AND 78) AND a!=77) - OR (f GLOB '?rstu*' AND f GLOB 'qrst*') - OR (d>=23.0 AND d<24.0 AND d NOT NULL) - OR b=924 - OR a=30 - OR b=1048 - OR f='vwxyzabcd' - OR a=61 - OR (d>=11.0 AND d<12.0 AND d NOT NULL) - ORDER BY a - } -} {11 16 21 23 30 42 47 61 68 73 76 78 84 94 99 scan 0 sort 0} -do_test where7-2.98.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 76 AND 78) AND a!=77) - OR (f GLOB '?rstu*' AND f GLOB 'qrst*') - OR (d>=23.0 AND d<24.0 AND d NOT NULL) - OR b=924 - OR a=30 - OR b=1048 - OR f='vwxyzabcd' - OR a=61 - OR (d>=11.0 AND d<12.0 AND d NOT NULL) - ORDER BY a - } -} {11 16 21 23 30 42 47 61 68 73 76 78 84 94 99 scan 0 sort 0} -do_test where7-2.99.1 { - count_steps { - SELECT a FROM t2 - WHERE b=176 - OR (f GLOB '?klmn*' AND f GLOB 'jklm*') - OR b=817 - OR f='qrstuvwxy' - OR a=94 - OR b=880 - ORDER BY a - } -} {9 16 35 42 61 68 80 87 94 scan 0 sort 0} -do_test where7-2.99.2 { - count_steps { - SELECT a FROM t3 - WHERE b=176 - OR (f GLOB '?klmn*' AND f GLOB 'jklm*') - OR b=817 - OR f='qrstuvwxy' - OR a=94 - OR b=880 - ORDER BY a - } -} {9 16 35 42 61 68 80 87 94 scan 0 sort 0} -do_test where7-2.100.1 { - count_steps { - SELECT a FROM t2 - WHERE a=96 - OR (g='lkjihgf' AND f GLOB 'opqrs*') - OR b=770 - OR b=828 - OR f='cdefghijk' - OR f='qrstuvwxy' - OR b=660 - OR (g='qponmlk' AND f GLOB 'nopqr*') - OR b=869 - OR (g='ihgfedc' AND f GLOB 'cdefg*') - ORDER BY a - } -} {2 16 28 39 42 54 60 66 68 70 79 80 94 96 scan 0 sort 0} -do_test where7-2.100.2 { - count_steps { - SELECT a FROM t3 - WHERE a=96 - OR (g='lkjihgf' AND f GLOB 'opqrs*') - OR b=770 - OR b=828 - OR f='cdefghijk' - OR f='qrstuvwxy' - OR b=660 - OR (g='qponmlk' AND f GLOB 'nopqr*') - OR b=869 - OR (g='ihgfedc' AND f GLOB 'cdefg*') - ORDER BY a - } -} {2 16 28 39 42 54 60 66 68 70 79 80 94 96 scan 0 sort 0} -do_test where7-2.101.1 { - count_steps { - SELECT a FROM t2 - WHERE c=23023 - OR a=29 - OR b=484 - OR 1000000=77.0 AND d<78.0 AND d NOT NULL) - OR (d>=21.0 AND d<22.0 AND d NOT NULL) - OR a=59 - ORDER BY a - } -} {20 21 59 71 77 97 scan 0 sort 0} -do_test where7-2.103.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='kjihgfe' AND f GLOB 'tuvwx*') - OR b=220 - OR b=421 - OR (g='fedcbaz' AND f GLOB 'tuvwx*') - OR b=487 - OR (d>=77.0 AND d<78.0 AND d NOT NULL) - OR (d>=21.0 AND d<22.0 AND d NOT NULL) - OR a=59 - ORDER BY a - } -} {20 21 59 71 77 97 scan 0 sort 0} -do_test where7-2.104.1 { - count_steps { - SELECT a FROM t2 - WHERE 1000000=72.0 AND d<73.0 AND d NOT NULL) - OR b=278 - ORDER BY a - } -} {1 3 20 72 75 80 scan 0 sort 0} -do_test where7-2.104.2 { - count_steps { - SELECT a FROM t3 - WHERE 1000000=72.0 AND d<73.0 AND d NOT NULL) - OR b=278 - ORDER BY a - } -} {1 3 20 72 75 80 scan 0 sort 0} -do_test where7-2.105.1 { - count_steps { - SELECT a FROM t2 - WHERE g IS NULL - OR a=89 - OR b=377 - OR a=93 - OR (d>=36.0 AND d<37.0 AND d NOT NULL) - OR a=93 - OR b=154 - OR ((a BETWEEN 23 AND 25) AND a!=24) - OR ((a BETWEEN 44 AND 46) AND a!=45) - ORDER BY a - } -} {14 23 25 36 44 46 89 93 scan 0 sort 0} -do_test where7-2.105.2 { - count_steps { - SELECT a FROM t3 - WHERE g IS NULL - OR a=89 - OR b=377 - OR a=93 - OR (d>=36.0 AND d<37.0 AND d NOT NULL) - OR a=93 - OR b=154 - OR ((a BETWEEN 23 AND 25) AND a!=24) - OR ((a BETWEEN 44 AND 46) AND a!=45) - ORDER BY a - } -} {14 23 25 36 44 46 89 93 scan 0 sort 0} -do_test where7-2.106.1 { - count_steps { - SELECT a FROM t2 - WHERE c=25025 - OR b=990 - OR (d>=69.0 AND d<70.0 AND d NOT NULL) - OR (d>=81.0 AND d<82.0 AND d NOT NULL) - OR c=15015 - OR c=19019 - OR (g='srqponm' AND f GLOB 'ghijk*') - OR (d>=44.0 AND d<45.0 AND d NOT NULL) - ORDER BY a - } -} {32 43 44 45 55 56 57 69 73 74 75 81 90 scan 0 sort 0} -do_test where7-2.106.2 { - count_steps { - SELECT a FROM t3 - WHERE c=25025 - OR b=990 - OR (d>=69.0 AND d<70.0 AND d NOT NULL) - OR (d>=81.0 AND d<82.0 AND d NOT NULL) - OR c=15015 - OR c=19019 - OR (g='srqponm' AND f GLOB 'ghijk*') - OR (d>=44.0 AND d<45.0 AND d NOT NULL) - ORDER BY a - } -} {32 43 44 45 55 56 57 69 73 74 75 81 90 scan 0 sort 0} -do_test where7-2.107.1 { - count_steps { - SELECT a FROM t2 - WHERE a=43 - OR (d>=86.0 AND d<87.0 AND d NOT NULL) - OR a=98 - ORDER BY a - } -} {43 86 98 scan 0 sort 0} -do_test where7-2.107.2 { - count_steps { - SELECT a FROM t3 - WHERE a=43 - OR (d>=86.0 AND d<87.0 AND d NOT NULL) - OR a=98 - ORDER BY a - } -} {43 86 98 scan 0 sort 0} -do_test where7-2.108.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='lkjihgf' AND f GLOB 'lmnop*') - OR ((a BETWEEN 73 AND 75) AND a!=74) - OR a=46 - OR b=388 - OR b=913 - OR b=451 - OR ((a BETWEEN 83 AND 85) AND a!=84) - ORDER BY a - } -} {41 46 63 73 75 83 85 scan 0 sort 0} -do_test where7-2.108.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='lkjihgf' AND f GLOB 'lmnop*') - OR ((a BETWEEN 73 AND 75) AND a!=74) - OR a=46 - OR b=388 - OR b=913 - OR b=451 - OR ((a BETWEEN 83 AND 85) AND a!=84) - ORDER BY a - } -} {41 46 63 73 75 83 85 scan 0 sort 0} -do_test where7-2.109.1 { - count_steps { - SELECT a FROM t2 - WHERE b=388 - OR c=14014 - OR (d>=48.0 AND d<49.0 AND d NOT NULL) - OR b=311 - OR c=34034 - OR c=3003 - OR c=34034 - OR b=421 - OR a=47 - OR (g='vutsrqp' AND f GLOB 'nopqr*') - OR a=39 - ORDER BY a - } -} {7 8 9 13 39 40 41 42 47 48 100 scan 0 sort 0} -do_test where7-2.109.2 { - count_steps { - SELECT a FROM t3 - WHERE b=388 - OR c=14014 - OR (d>=48.0 AND d<49.0 AND d NOT NULL) - OR b=311 - OR c=34034 - OR c=3003 - OR c=34034 - OR b=421 - OR a=47 - OR (g='vutsrqp' AND f GLOB 'nopqr*') - OR a=39 - ORDER BY a - } -} {7 8 9 13 39 40 41 42 47 48 100 scan 0 sort 0} -do_test where7-2.110.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=48.0 AND d<49.0 AND d NOT NULL) - OR (d>=25.0 AND d<26.0 AND d NOT NULL) - OR f='uvwxyzabc' - OR (f GLOB '?hijk*' AND f GLOB 'ghij*') - OR (g='xwvutsr' AND f GLOB 'efghi*') - OR (f GLOB '?stuv*' AND f GLOB 'rstu*') - OR ((a BETWEEN 65 AND 67) AND a!=66) - OR g IS NULL - OR b=583 - ORDER BY a - } -} {4 6 17 20 25 32 43 46 48 53 58 65 67 69 72 84 95 98 scan 0 sort 0} -do_test where7-2.110.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=48.0 AND d<49.0 AND d NOT NULL) - OR (d>=25.0 AND d<26.0 AND d NOT NULL) - OR f='uvwxyzabc' - OR (f GLOB '?hijk*' AND f GLOB 'ghij*') - OR (g='xwvutsr' AND f GLOB 'efghi*') - OR (f GLOB '?stuv*' AND f GLOB 'rstu*') - OR ((a BETWEEN 65 AND 67) AND a!=66) - OR g IS NULL - OR b=583 - ORDER BY a - } -} {4 6 17 20 25 32 43 46 48 53 58 65 67 69 72 84 95 98 scan 0 sort 0} -do_test where7-2.111.1 { - count_steps { - SELECT a FROM t2 - WHERE f='fghijklmn' - OR c=22022 - OR (g='srqponm' AND f GLOB 'fghij*') - OR (f GLOB '?lmno*' AND f GLOB 'klmn*') - ORDER BY a - } -} {5 10 31 36 57 62 64 65 66 83 88 scan 0 sort 0} -do_test where7-2.111.2 { - count_steps { - SELECT a FROM t3 - WHERE f='fghijklmn' - OR c=22022 - OR (g='srqponm' AND f GLOB 'fghij*') - OR (f GLOB '?lmno*' AND f GLOB 'klmn*') - ORDER BY a - } -} {5 10 31 36 57 62 64 65 66 83 88 scan 0 sort 0} -do_test where7-2.112.1 { - count_steps { - SELECT a FROM t2 - WHERE a=90 - OR a=68 - OR (d>=64.0 AND d<65.0 AND d NOT NULL) - OR a=65 - OR ((a BETWEEN 25 AND 27) AND a!=26) - OR a=74 - OR b=429 - OR (d>=62.0 AND d<63.0 AND d NOT NULL) - ORDER BY a - } -} {25 27 39 62 64 65 68 74 90 scan 0 sort 0} -do_test where7-2.112.2 { - count_steps { - SELECT a FROM t3 - WHERE a=90 - OR a=68 - OR (d>=64.0 AND d<65.0 AND d NOT NULL) - OR a=65 - OR ((a BETWEEN 25 AND 27) AND a!=26) - OR a=74 - OR b=429 - OR (d>=62.0 AND d<63.0 AND d NOT NULL) - ORDER BY a - } -} {25 27 39 62 64 65 68 74 90 scan 0 sort 0} -do_test where7-2.113.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 48 AND 50) AND a!=49) - OR (d>=19.0 AND d<20.0 AND d NOT NULL) - OR (d>=46.0 AND d<47.0 AND d NOT NULL) - OR a=51 - OR b=817 - OR (d>=95.0 AND d<96.0 AND d NOT NULL) - OR ((a BETWEEN 26 AND 28) AND a!=27) - ORDER BY a - } -} {19 26 28 46 48 50 51 95 scan 0 sort 0} -do_test where7-2.113.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 48 AND 50) AND a!=49) - OR (d>=19.0 AND d<20.0 AND d NOT NULL) - OR (d>=46.0 AND d<47.0 AND d NOT NULL) - OR a=51 - OR b=817 - OR (d>=95.0 AND d<96.0 AND d NOT NULL) - OR ((a BETWEEN 26 AND 28) AND a!=27) - ORDER BY a - } -} {19 26 28 46 48 50 51 95 scan 0 sort 0} -do_test where7-2.114.1 { - count_steps { - SELECT a FROM t2 - WHERE f='zabcdefgh' - OR ((a BETWEEN 85 AND 87) AND a!=86) - OR b=1037 - OR b=938 - ORDER BY a - } -} {25 51 77 85 87 scan 0 sort 0} -do_test where7-2.114.2 { - count_steps { - SELECT a FROM t3 - WHERE f='zabcdefgh' - OR ((a BETWEEN 85 AND 87) AND a!=86) - OR b=1037 - OR b=938 - ORDER BY a - } -} {25 51 77 85 87 scan 0 sort 0} -do_test where7-2.115.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='vutsrqp' AND f GLOB 'rstuv*') - OR (g='ihgfedc' AND f GLOB 'bcdef*') - OR b=245 - OR ((a BETWEEN 51 AND 53) AND a!=52) - OR c=21021 - OR (g='utsrqpo' AND f GLOB 'wxyza*') - OR (g='ihgfedc' AND f GLOB 'bcdef*') - OR (g='srqponm' AND f GLOB 'fghij*') - OR f='wxyzabcde' - OR b=784 - OR (d>=4.0 AND d<5.0 AND d NOT NULL) - ORDER BY a - } -} {4 17 22 31 48 51 53 61 62 63 74 79 100 scan 0 sort 0} -do_test where7-2.115.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='vutsrqp' AND f GLOB 'rstuv*') - OR (g='ihgfedc' AND f GLOB 'bcdef*') - OR b=245 - OR ((a BETWEEN 51 AND 53) AND a!=52) - OR c=21021 - OR (g='utsrqpo' AND f GLOB 'wxyza*') - OR (g='ihgfedc' AND f GLOB 'bcdef*') - OR (g='srqponm' AND f GLOB 'fghij*') - OR f='wxyzabcde' - OR b=784 - OR (d>=4.0 AND d<5.0 AND d NOT NULL) - ORDER BY a - } -} {4 17 22 31 48 51 53 61 62 63 74 79 100 scan 0 sort 0} -do_test where7-2.116.1 { - count_steps { - SELECT a FROM t2 - WHERE c=8008 - OR (g='lkjihgf' AND f GLOB 'pqrst*') - OR b=660 - OR b=363 - OR f='lmnopqrst' - OR (g='yxwvuts' AND f GLOB 'bcdef*') - OR ((a BETWEEN 87 AND 89) AND a!=88) - OR a=14 - ORDER BY a - } -} {1 11 14 22 23 24 33 37 60 63 67 87 89 scan 0 sort 0} -do_test where7-2.116.2 { - count_steps { - SELECT a FROM t3 - WHERE c=8008 - OR (g='lkjihgf' AND f GLOB 'pqrst*') - OR b=660 - OR b=363 - OR f='lmnopqrst' - OR (g='yxwvuts' AND f GLOB 'bcdef*') - OR ((a BETWEEN 87 AND 89) AND a!=88) - OR a=14 - ORDER BY a - } -} {1 11 14 22 23 24 33 37 60 63 67 87 89 scan 0 sort 0} -do_test where7-2.117.1 { - count_steps { - SELECT a FROM t2 - WHERE b=594 - OR (g='yxwvuts' AND f GLOB 'cdefg*') - OR b=784 - OR b=333 - OR a=19 - OR b=146 - OR a=26 - OR c=4004 - OR (d>=9.0 AND d<10.0 AND d NOT NULL) - OR a=50 - ORDER BY a - } -} {2 9 10 11 12 19 26 50 54 scan 0 sort 0} -do_test where7-2.117.2 { - count_steps { - SELECT a FROM t3 - WHERE b=594 - OR (g='yxwvuts' AND f GLOB 'cdefg*') - OR b=784 - OR b=333 - OR a=19 - OR b=146 - OR a=26 - OR c=4004 - OR (d>=9.0 AND d<10.0 AND d NOT NULL) - OR a=50 - ORDER BY a - } -} {2 9 10 11 12 19 26 50 54 scan 0 sort 0} -do_test where7-2.118.1 { - count_steps { - SELECT a FROM t2 - WHERE a=58 - OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') - OR a=77 - OR a=18 - OR ((a BETWEEN 42 AND 44) AND a!=43) - OR f='mnopqrstu' - OR a=73 - OR a=70 - OR ((a BETWEEN 85 AND 87) AND a!=86) - ORDER BY a - } -} {7 12 18 33 38 42 44 58 59 64 70 73 77 85 87 90 scan 0 sort 0} -do_test where7-2.118.2 { - count_steps { - SELECT a FROM t3 - WHERE a=58 - OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') - OR a=77 - OR a=18 - OR ((a BETWEEN 42 AND 44) AND a!=43) - OR f='mnopqrstu' - OR a=73 - OR a=70 - OR ((a BETWEEN 85 AND 87) AND a!=86) - ORDER BY a - } -} {7 12 18 33 38 42 44 58 59 64 70 73 77 85 87 90 scan 0 sort 0} -do_test where7-2.119.1 { - count_steps { - SELECT a FROM t2 - WHERE a=96 - OR b=25 - OR b=429 - OR b=638 - OR (d>=87.0 AND d<88.0 AND d NOT NULL) - OR ((a BETWEEN 36 AND 38) AND a!=37) - OR a=43 - OR a=61 - OR b=836 - OR b=627 - ORDER BY a - } -} {36 38 39 43 57 58 61 76 87 96 scan 0 sort 0} -do_test where7-2.119.2 { - count_steps { - SELECT a FROM t3 - WHERE a=96 - OR b=25 - OR b=429 - OR b=638 - OR (d>=87.0 AND d<88.0 AND d NOT NULL) - OR ((a BETWEEN 36 AND 38) AND a!=37) - OR a=43 - OR a=61 - OR b=836 - OR b=627 - ORDER BY a - } -} {36 38 39 43 57 58 61 76 87 96 scan 0 sort 0} -do_test where7-2.120.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='lkjihgf' AND f GLOB 'lmnop*') - OR b=528 - OR c=5005 - OR (d>=24.0 AND d<25.0 AND d NOT NULL) - OR (d>=66.0 AND d<67.0 AND d NOT NULL) - OR (g='ponmlkj' AND f GLOB 'rstuv*') - ORDER BY a - } -} {13 14 15 24 43 48 63 66 scan 0 sort 0} -do_test where7-2.120.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='lkjihgf' AND f GLOB 'lmnop*') - OR b=528 - OR c=5005 - OR (d>=24.0 AND d<25.0 AND d NOT NULL) - OR (d>=66.0 AND d<67.0 AND d NOT NULL) - OR (g='ponmlkj' AND f GLOB 'rstuv*') - ORDER BY a - } -} {13 14 15 24 43 48 63 66 scan 0 sort 0} -do_test where7-2.121.1 { - count_steps { - SELECT a FROM t2 - WHERE b=828 - OR c<=10 - OR b=891 - OR ((a BETWEEN 31 AND 33) AND a!=32) - OR (d>=75.0 AND d<76.0 AND d NOT NULL) - OR (g='yxwvuts' AND f GLOB 'bcdef*') - OR b=344 - OR a=25 - OR b=201 - OR (g='kjihgfe' AND f GLOB 'qrstu*') - ORDER BY a - } -} {1 25 31 33 68 75 81 scan 0 sort 0} -do_test where7-2.121.2 { - count_steps { - SELECT a FROM t3 - WHERE b=828 - OR c<=10 - OR b=891 - OR ((a BETWEEN 31 AND 33) AND a!=32) - OR (d>=75.0 AND d<76.0 AND d NOT NULL) - OR (g='yxwvuts' AND f GLOB 'bcdef*') - OR b=344 - OR a=25 - OR b=201 - OR (g='kjihgfe' AND f GLOB 'qrstu*') - ORDER BY a - } -} {1 25 31 33 68 75 81 scan 0 sort 0} -do_test where7-2.122.1 { - count_steps { - SELECT a FROM t2 - WHERE a=87 - OR (f GLOB '?ghij*' AND f GLOB 'fghi*') - OR (d>=49.0 AND d<50.0 AND d NOT NULL) - OR ((a BETWEEN 5 AND 7) AND a!=6) - OR b=528 - OR f='ghijklmno' - OR ((a BETWEEN 28 AND 30) AND a!=29) - OR a=86 - OR b=454 - ORDER BY a - } -} {5 6 7 28 30 31 32 48 49 57 58 83 84 86 87 scan 0 sort 0} -do_test where7-2.122.2 { - count_steps { - SELECT a FROM t3 - WHERE a=87 - OR (f GLOB '?ghij*' AND f GLOB 'fghi*') - OR (d>=49.0 AND d<50.0 AND d NOT NULL) - OR ((a BETWEEN 5 AND 7) AND a!=6) - OR b=528 - OR f='ghijklmno' - OR ((a BETWEEN 28 AND 30) AND a!=29) - OR a=86 - OR b=454 - ORDER BY a - } -} {5 6 7 28 30 31 32 48 49 57 58 83 84 86 87 scan 0 sort 0} -do_test where7-2.123.1 { - count_steps { - SELECT a FROM t2 - WHERE b=22 - OR (g='kjihgfe' AND f GLOB 'rstuv*') - OR b=586 - ORDER BY a - } -} {2 69 scan 0 sort 0} -do_test where7-2.123.2 { - count_steps { - SELECT a FROM t3 - WHERE b=22 - OR (g='kjihgfe' AND f GLOB 'rstuv*') - OR b=586 - ORDER BY a - } -} {2 69 scan 0 sort 0} -do_test where7-2.124.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=99.0 AND d<100.0 AND d NOT NULL) - OR b=374 - OR ((a BETWEEN 38 AND 40) AND a!=39) - OR b=11 - OR (d>=96.0 AND d<97.0 AND d NOT NULL) - ORDER BY a - } -} {1 34 38 40 96 99 scan 0 sort 0} -do_test where7-2.124.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=99.0 AND d<100.0 AND d NOT NULL) - OR b=374 - OR ((a BETWEEN 38 AND 40) AND a!=39) - OR b=11 - OR (d>=96.0 AND d<97.0 AND d NOT NULL) - ORDER BY a - } -} {1 34 38 40 96 99 scan 0 sort 0} -do_test where7-2.125.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=94.0 AND d<95.0 AND d NOT NULL) - OR a=86 - OR b=231 - OR (d>=62.0 AND d<63.0 AND d NOT NULL) - OR b=22 - OR b=597 - OR (d>=21.0 AND d<22.0 AND d NOT NULL) - OR a=34 - ORDER BY a - } -} {2 21 34 62 86 94 scan 0 sort 0} -do_test where7-2.125.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=94.0 AND d<95.0 AND d NOT NULL) - OR a=86 - OR b=231 - OR (d>=62.0 AND d<63.0 AND d NOT NULL) - OR b=22 - OR b=597 - OR (d>=21.0 AND d<22.0 AND d NOT NULL) - OR a=34 - ORDER BY a - } -} {2 21 34 62 86 94 scan 0 sort 0} -do_test where7-2.126.1 { - count_steps { - SELECT a FROM t2 - WHERE a=67 - OR (d>=31.0 AND d<32.0 AND d NOT NULL) - OR (g='vutsrqp' AND f GLOB 'qrstu*') - OR c=16016 - ORDER BY a - } -} {16 31 46 47 48 67 scan 0 sort 0} -do_test where7-2.126.2 { - count_steps { - SELECT a FROM t3 - WHERE a=67 - OR (d>=31.0 AND d<32.0 AND d NOT NULL) - OR (g='vutsrqp' AND f GLOB 'qrstu*') - OR c=16016 - ORDER BY a - } -} {16 31 46 47 48 67 scan 0 sort 0} -do_test where7-2.127.1 { - count_steps { - SELECT a FROM t2 - WHERE b=286 - OR b=14 - OR (f GLOB '?cdef*' AND f GLOB 'bcde*') - OR a=51 - OR b=542 - OR (g='kjihgfe' AND f GLOB 'uvwxy*') - OR (g='kjihgfe' AND f GLOB 'qrstu*') - ORDER BY a - } -} {1 26 27 51 53 68 72 79 scan 0 sort 0} -do_test where7-2.127.2 { - count_steps { - SELECT a FROM t3 - WHERE b=286 - OR b=14 - OR (f GLOB '?cdef*' AND f GLOB 'bcde*') - OR a=51 - OR b=542 - OR (g='kjihgfe' AND f GLOB 'uvwxy*') - OR (g='kjihgfe' AND f GLOB 'qrstu*') - ORDER BY a - } -} {1 26 27 51 53 68 72 79 scan 0 sort 0} -do_test where7-2.128.1 { - count_steps { - SELECT a FROM t2 - WHERE b=858 - OR b=759 - OR b=308 - OR c>=34035 - ORDER BY a - } -} {28 69 78 scan 0 sort 0} -do_test where7-2.128.2 { - count_steps { - SELECT a FROM t3 - WHERE b=858 - OR b=759 - OR b=308 - OR c>=34035 - ORDER BY a - } -} {28 69 78 scan 0 sort 0} -do_test where7-2.129.1 { - count_steps { - SELECT a FROM t2 - WHERE b=674 - OR (d>=37.0 AND d<38.0 AND d NOT NULL) - OR b=891 - OR b=1067 - OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') - OR a=63 - OR (f GLOB '?stuv*' AND f GLOB 'rstu*') - ORDER BY a - } -} {7 17 33 37 43 59 63 69 81 85 95 97 scan 0 sort 0} -do_test where7-2.129.2 { - count_steps { - SELECT a FROM t3 - WHERE b=674 - OR (d>=37.0 AND d<38.0 AND d NOT NULL) - OR b=891 - OR b=1067 - OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') - OR a=63 - OR (f GLOB '?stuv*' AND f GLOB 'rstu*') - ORDER BY a - } -} {7 17 33 37 43 59 63 69 81 85 95 97 scan 0 sort 0} -do_test where7-2.130.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=29.0 AND d<30.0 AND d NOT NULL) - OR (d>=88.0 AND d<89.0 AND d NOT NULL) - OR a=11 - OR a=85 - OR b=572 - OR a=65 - OR ((a BETWEEN 53 AND 55) AND a!=54) - OR b=726 - OR b=198 - ORDER BY a - } -} {11 18 29 52 53 55 65 66 85 88 scan 0 sort 0} -do_test where7-2.130.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=29.0 AND d<30.0 AND d NOT NULL) - OR (d>=88.0 AND d<89.0 AND d NOT NULL) - OR a=11 - OR a=85 - OR b=572 - OR a=65 - OR ((a BETWEEN 53 AND 55) AND a!=54) - OR b=726 - OR b=198 - ORDER BY a - } -} {11 18 29 52 53 55 65 66 85 88 scan 0 sort 0} -do_test where7-2.131.1 { - count_steps { - SELECT a FROM t2 - WHERE a=34 - OR b=440 - OR b=770 - OR b=916 - OR a=46 - OR b=388 - OR b=660 - OR b=256 - ORDER BY a - } -} {34 40 46 60 70 scan 0 sort 0} -do_test where7-2.131.2 { - count_steps { - SELECT a FROM t3 - WHERE a=34 - OR b=440 - OR b=770 - OR b=916 - OR a=46 - OR b=388 - OR b=660 - OR b=256 - ORDER BY a - } -} {34 40 46 60 70 scan 0 sort 0} -do_test where7-2.132.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='qponmlk' AND f GLOB 'opqrs*') - OR (g='jihgfed' AND f GLOB 'zabcd*') - OR (d>=7.0 AND d<8.0 AND d NOT NULL) - OR b=872 - OR (g='ihgfedc' AND f GLOB 'abcde*') - OR a=87 - OR ((a BETWEEN 29 AND 31) AND a!=30) - OR a=51 - ORDER BY a - } -} {7 29 31 40 51 77 78 87 scan 0 sort 0} -do_test where7-2.132.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='qponmlk' AND f GLOB 'opqrs*') - OR (g='jihgfed' AND f GLOB 'zabcd*') - OR (d>=7.0 AND d<8.0 AND d NOT NULL) - OR b=872 - OR (g='ihgfedc' AND f GLOB 'abcde*') - OR a=87 - OR ((a BETWEEN 29 AND 31) AND a!=30) - OR a=51 - ORDER BY a - } -} {7 29 31 40 51 77 78 87 scan 0 sort 0} -do_test where7-2.133.1 { - count_steps { - SELECT a FROM t2 - WHERE a=50 - OR c=25025 - OR c=34034 - OR b=36 - ORDER BY a - } -} {50 73 74 75 100 scan 0 sort 0} -do_test where7-2.133.2 { - count_steps { - SELECT a FROM t3 - WHERE a=50 - OR c=25025 - OR c=34034 - OR b=36 - ORDER BY a - } -} {50 73 74 75 100 scan 0 sort 0} -do_test where7-2.134.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=35.0 AND d<36.0 AND d NOT NULL) - OR (d>=54.0 AND d<55.0 AND d NOT NULL) - ORDER BY a - } -} {35 54 scan 0 sort 0} -do_test where7-2.134.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=35.0 AND d<36.0 AND d NOT NULL) - OR (d>=54.0 AND d<55.0 AND d NOT NULL) - ORDER BY a - } -} {35 54 scan 0 sort 0} -do_test where7-2.135.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 29 AND 31) AND a!=30) - OR a=2 - OR (g='jihgfed' AND f GLOB 'yzabc*') - OR ((a BETWEEN 20 AND 22) AND a!=21) - OR ((a BETWEEN 22 AND 24) AND a!=23) - OR b=616 - ORDER BY a - } -} {2 20 22 24 29 31 56 76 scan 0 sort 0} -do_test where7-2.135.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 29 AND 31) AND a!=30) - OR a=2 - OR (g='jihgfed' AND f GLOB 'yzabc*') - OR ((a BETWEEN 20 AND 22) AND a!=21) - OR ((a BETWEEN 22 AND 24) AND a!=23) - OR b=616 - ORDER BY a - } -} {2 20 22 24 29 31 56 76 scan 0 sort 0} -do_test where7-2.136.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 48 AND 50) AND a!=49) - OR (g='fedcbaz' AND f GLOB 'pqrst*') - OR ((a BETWEEN 52 AND 54) AND a!=53) - OR ((a BETWEEN 20 AND 22) AND a!=21) - OR (d>=11.0 AND d<12.0 AND d NOT NULL) - OR a=56 - OR (g='mlkjihg' AND f GLOB 'klmno*') - OR b=1023 - OR ((a BETWEEN 5 AND 7) AND a!=6) - OR b=1012 - OR b=1048 - ORDER BY a - } -} {5 7 11 20 22 48 50 52 54 56 62 92 93 scan 0 sort 0} -do_test where7-2.136.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 48 AND 50) AND a!=49) - OR (g='fedcbaz' AND f GLOB 'pqrst*') - OR ((a BETWEEN 52 AND 54) AND a!=53) - OR ((a BETWEEN 20 AND 22) AND a!=21) - OR (d>=11.0 AND d<12.0 AND d NOT NULL) - OR a=56 - OR (g='mlkjihg' AND f GLOB 'klmno*') - OR b=1023 - OR ((a BETWEEN 5 AND 7) AND a!=6) - OR b=1012 - OR b=1048 - ORDER BY a - } -} {5 7 11 20 22 48 50 52 54 56 62 92 93 scan 0 sort 0} -do_test where7-2.137.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=85.0 AND d<86.0 AND d NOT NULL) - OR (f GLOB '?tuvw*' AND f GLOB 'stuv*') - OR b=1089 - OR (g='rqponml' AND f GLOB 'klmno*') - OR b=223 - OR (g='jihgfed' AND f GLOB 'wxyza*') - OR b=572 - OR (g='srqponm' AND f GLOB 'defgh*') - OR (d>=28.0 AND d<29.0 AND d NOT NULL) - OR (d>=88.0 AND d<89.0 AND d NOT NULL) - ORDER BY a - } -} {18 28 29 36 44 52 70 74 85 88 96 99 scan 0 sort 0} -do_test where7-2.137.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=85.0 AND d<86.0 AND d NOT NULL) - OR (f GLOB '?tuvw*' AND f GLOB 'stuv*') - OR b=1089 - OR (g='rqponml' AND f GLOB 'klmno*') - OR b=223 - OR (g='jihgfed' AND f GLOB 'wxyza*') - OR b=572 - OR (g='srqponm' AND f GLOB 'defgh*') - OR (d>=28.0 AND d<29.0 AND d NOT NULL) - OR (d>=88.0 AND d<89.0 AND d NOT NULL) - ORDER BY a - } -} {18 28 29 36 44 52 70 74 85 88 96 99 scan 0 sort 0} -do_test where7-2.138.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='lkjihgf' AND f GLOB 'nopqr*') - OR a=57 - OR ((a BETWEEN 2 AND 4) AND a!=3) - OR (g='vutsrqp' AND f GLOB 'rstuv*') - OR b=341 - OR ((a BETWEEN 15 AND 17) AND a!=16) - ORDER BY a - } -} {2 4 15 17 31 57 65 scan 0 sort 0} -do_test where7-2.138.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='lkjihgf' AND f GLOB 'nopqr*') - OR a=57 - OR ((a BETWEEN 2 AND 4) AND a!=3) - OR (g='vutsrqp' AND f GLOB 'rstuv*') - OR b=341 - OR ((a BETWEEN 15 AND 17) AND a!=16) - ORDER BY a - } -} {2 4 15 17 31 57 65 scan 0 sort 0} -do_test where7-2.139.1 { - count_steps { - SELECT a FROM t2 - WHERE c<=10 - OR b=498 - OR (d>=45.0 AND d<46.0 AND d NOT NULL) - OR (d>=76.0 AND d<77.0 AND d NOT NULL) - OR b=872 - OR a=36 - OR ((a BETWEEN 51 AND 53) AND a!=52) - ORDER BY a - } -} {36 45 51 53 76 scan 0 sort 0} -do_test where7-2.139.2 { - count_steps { - SELECT a FROM t3 - WHERE c<=10 - OR b=498 - OR (d>=45.0 AND d<46.0 AND d NOT NULL) - OR (d>=76.0 AND d<77.0 AND d NOT NULL) - OR b=872 - OR a=36 - OR ((a BETWEEN 51 AND 53) AND a!=52) - ORDER BY a - } -} {36 45 51 53 76 scan 0 sort 0} -do_test where7-2.140.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='tsrqpon' AND f GLOB 'abcde*') - OR (g='wvutsrq' AND f GLOB 'mnopq*') - OR b=850 - OR ((a BETWEEN 51 AND 53) AND a!=52) - OR (d>=83.0 AND d<84.0 AND d NOT NULL) - ORDER BY a - } -} {12 26 51 53 83 scan 0 sort 0} -do_test where7-2.140.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='tsrqpon' AND f GLOB 'abcde*') - OR (g='wvutsrq' AND f GLOB 'mnopq*') - OR b=850 - OR ((a BETWEEN 51 AND 53) AND a!=52) - OR (d>=83.0 AND d<84.0 AND d NOT NULL) - ORDER BY a - } -} {12 26 51 53 83 scan 0 sort 0} -do_test where7-2.141.1 { - count_steps { - SELECT a FROM t2 - WHERE a=31 - OR (d>=99.0 AND d<100.0 AND d NOT NULL) - OR c=20020 - OR (g='vutsrqp' AND f GLOB 'rstuv*') - OR (g='vutsrqp' AND f GLOB 'qrstu*') - OR (g='nmlkjih' AND f GLOB 'defgh*') - ORDER BY a - } -} {16 17 31 55 58 59 60 99 scan 0 sort 0} -do_test where7-2.141.2 { - count_steps { - SELECT a FROM t3 - WHERE a=31 - OR (d>=99.0 AND d<100.0 AND d NOT NULL) - OR c=20020 - OR (g='vutsrqp' AND f GLOB 'rstuv*') - OR (g='vutsrqp' AND f GLOB 'qrstu*') - OR (g='nmlkjih' AND f GLOB 'defgh*') - ORDER BY a - } -} {16 17 31 55 58 59 60 99 scan 0 sort 0} -do_test where7-2.142.1 { - count_steps { - SELECT a FROM t2 - WHERE (f GLOB '?defg*' AND f GLOB 'cdef*') - OR b=495 - OR b=344 - OR (f GLOB '?nopq*' AND f GLOB 'mnop*') - OR (d>=83.0 AND d<84.0 AND d NOT NULL) - OR (g='kjihgfe' AND f GLOB 'uvwxy*') - OR b=784 - ORDER BY a - } -} {2 12 28 38 45 54 64 72 80 83 90 scan 0 sort 0} -do_test where7-2.142.2 { - count_steps { - SELECT a FROM t3 - WHERE (f GLOB '?defg*' AND f GLOB 'cdef*') - OR b=495 - OR b=344 - OR (f GLOB '?nopq*' AND f GLOB 'mnop*') - OR (d>=83.0 AND d<84.0 AND d NOT NULL) - OR (g='kjihgfe' AND f GLOB 'uvwxy*') - OR b=784 - ORDER BY a - } -} {2 12 28 38 45 54 64 72 80 83 90 scan 0 sort 0} -do_test where7-2.143.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 59 AND 61) AND a!=60) - OR (f GLOB '?lmno*' AND f GLOB 'klmn*') - OR ((a BETWEEN 6 AND 8) AND a!=7) - OR a=91 - OR (f GLOB '?defg*' AND f GLOB 'cdef*') - OR (g='vutsrqp' AND f GLOB 'nopqr*') - OR (g='ihgfedc' AND f GLOB 'efghi*') - OR (d>=24.0 AND d<25.0 AND d NOT NULL) - ORDER BY a - } -} {2 6 8 10 13 24 28 36 54 59 61 62 80 82 88 91 scan 0 sort 0} -do_test where7-2.143.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 59 AND 61) AND a!=60) - OR (f GLOB '?lmno*' AND f GLOB 'klmn*') - OR ((a BETWEEN 6 AND 8) AND a!=7) - OR a=91 - OR (f GLOB '?defg*' AND f GLOB 'cdef*') - OR (g='vutsrqp' AND f GLOB 'nopqr*') - OR (g='ihgfedc' AND f GLOB 'efghi*') - OR (d>=24.0 AND d<25.0 AND d NOT NULL) - ORDER BY a - } -} {2 6 8 10 13 24 28 36 54 59 61 62 80 82 88 91 scan 0 sort 0} -do_test where7-2.144.1 { - count_steps { - SELECT a FROM t2 - WHERE a=94 - OR b=839 - OR b=322 - OR a=13 - OR f='abcdefghi' - OR a=82 - OR b=839 - OR b=583 - OR b=113 - OR (d>=34.0 AND d<35.0 AND d NOT NULL) - ORDER BY a - } -} {13 26 34 52 53 78 82 94 scan 0 sort 0} -do_test where7-2.144.2 { - count_steps { - SELECT a FROM t3 - WHERE a=94 - OR b=839 - OR b=322 - OR a=13 - OR f='abcdefghi' - OR a=82 - OR b=839 - OR b=583 - OR b=113 - OR (d>=34.0 AND d<35.0 AND d NOT NULL) - ORDER BY a - } -} {13 26 34 52 53 78 82 94 scan 0 sort 0} -do_test where7-2.145.1 { - count_steps { - SELECT a FROM t2 - WHERE a=26 - OR ((a BETWEEN 52 AND 54) AND a!=53) - OR (d>=42.0 AND d<43.0 AND d NOT NULL) - OR (g='onmlkji' AND f GLOB 'abcde*') - OR (g='utsrqpo' AND f GLOB 'wxyza*') - OR b=751 - OR ((a BETWEEN 90 AND 92) AND a!=91) - OR b=399 - OR a=33 - ORDER BY a - } -} {22 26 33 42 52 54 90 92 scan 0 sort 0} -do_test where7-2.145.2 { - count_steps { - SELECT a FROM t3 - WHERE a=26 - OR ((a BETWEEN 52 AND 54) AND a!=53) - OR (d>=42.0 AND d<43.0 AND d NOT NULL) - OR (g='onmlkji' AND f GLOB 'abcde*') - OR (g='utsrqpo' AND f GLOB 'wxyza*') - OR b=751 - OR ((a BETWEEN 90 AND 92) AND a!=91) - OR b=399 - OR a=33 - ORDER BY a - } -} {22 26 33 42 52 54 90 92 scan 0 sort 0} -do_test where7-2.146.1 { - count_steps { - SELECT a FROM t2 - WHERE b=696 - OR a=1 - OR b=1023 - OR ((a BETWEEN 80 AND 82) AND a!=81) - OR a=66 - OR c=25025 - OR (d>=32.0 AND d<33.0 AND d NOT NULL) - ORDER BY a - } -} {1 32 66 73 74 75 80 82 93 scan 0 sort 0} -do_test where7-2.146.2 { - count_steps { - SELECT a FROM t3 - WHERE b=696 - OR a=1 - OR b=1023 - OR ((a BETWEEN 80 AND 82) AND a!=81) - OR a=66 - OR c=25025 - OR (d>=32.0 AND d<33.0 AND d NOT NULL) - ORDER BY a - } -} {1 32 66 73 74 75 80 82 93 scan 0 sort 0} -do_test where7-2.147.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=7.0 AND d<8.0 AND d NOT NULL) - OR (d>=1.0 AND d<2.0 AND d NOT NULL) - OR (g='vutsrqp' AND f GLOB 'qrstu*') - OR ((a BETWEEN 70 AND 72) AND a!=71) - OR b=212 - OR b=660 - OR ((a BETWEEN 68 AND 70) AND a!=69) - OR (g='rqponml' AND f GLOB 'jklmn*') - OR (d>=81.0 AND d<82.0 AND d NOT NULL) - ORDER BY a - } -} {1 7 16 35 60 68 70 72 81 scan 0 sort 0} -do_test where7-2.147.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=7.0 AND d<8.0 AND d NOT NULL) - OR (d>=1.0 AND d<2.0 AND d NOT NULL) - OR (g='vutsrqp' AND f GLOB 'qrstu*') - OR ((a BETWEEN 70 AND 72) AND a!=71) - OR b=212 - OR b=660 - OR ((a BETWEEN 68 AND 70) AND a!=69) - OR (g='rqponml' AND f GLOB 'jklmn*') - OR (d>=81.0 AND d<82.0 AND d NOT NULL) - ORDER BY a - } -} {1 7 16 35 60 68 70 72 81 scan 0 sort 0} -do_test where7-2.148.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=65.0 AND d<66.0 AND d NOT NULL) - OR (g='ponmlkj' AND f GLOB 'uvwxy*') - OR (g='mlkjihg' AND f GLOB 'ijklm*') - OR f='yzabcdefg' - OR a=62 - OR b=916 - OR (d>=5.0 AND d<6.0 AND d NOT NULL) - ORDER BY a - } -} {5 24 46 50 60 62 65 76 scan 0 sort 0} -do_test where7-2.148.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=65.0 AND d<66.0 AND d NOT NULL) - OR (g='ponmlkj' AND f GLOB 'uvwxy*') - OR (g='mlkjihg' AND f GLOB 'ijklm*') - OR f='yzabcdefg' - OR a=62 - OR b=916 - OR (d>=5.0 AND d<6.0 AND d NOT NULL) - ORDER BY a - } -} {5 24 46 50 60 62 65 76 scan 0 sort 0} -do_test where7-2.149.1 { - count_steps { - SELECT a FROM t2 - WHERE b=198 - OR (d>=39.0 AND d<40.0 AND d NOT NULL) - OR a=54 - OR 1000000=39.0 AND d<40.0 AND d NOT NULL) - OR a=54 - OR 1000000=76.0 AND d<77.0 AND d NOT NULL) - OR (g='mlkjihg' AND f GLOB 'ghijk*') - OR a=88 - OR b=693 - OR f='stuvwxyza' - ORDER BY a - } -} {18 44 58 63 70 76 88 96 scan 0 sort 0} -do_test where7-2.151.2 { - count_steps { - SELECT a FROM t3 - WHERE b=311 - OR (d>=76.0 AND d<77.0 AND d NOT NULL) - OR (g='mlkjihg' AND f GLOB 'ghijk*') - OR a=88 - OR b=693 - OR f='stuvwxyza' - ORDER BY a - } -} {18 44 58 63 70 76 88 96 scan 0 sort 0} -do_test where7-2.152.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 64 AND 66) AND a!=65) - OR (d>=86.0 AND d<87.0 AND d NOT NULL) - OR b=300 - OR (d>=16.0 AND d<17.0 AND d NOT NULL) - OR c=32032 - ORDER BY a - } -} {16 64 66 86 94 95 96 scan 0 sort 0} -do_test where7-2.152.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 64 AND 66) AND a!=65) - OR (d>=86.0 AND d<87.0 AND d NOT NULL) - OR b=300 - OR (d>=16.0 AND d<17.0 AND d NOT NULL) - OR c=32032 - ORDER BY a - } -} {16 64 66 86 94 95 96 scan 0 sort 0} -do_test where7-2.153.1 { - count_steps { - SELECT a FROM t2 - WHERE (f GLOB '?fghi*' AND f GLOB 'efgh*') - OR (g='rqponml' AND f GLOB 'hijkl*') - OR (d>=59.0 AND d<60.0 AND d NOT NULL) - OR a=28 - OR (g='srqponm' AND f GLOB 'efghi*') - OR c=12012 - OR b=14 - OR a=58 - OR ((a BETWEEN 95 AND 97) AND a!=96) - ORDER BY a - } -} {4 28 30 33 34 35 36 56 58 59 82 95 97 scan 0 sort 0} -do_test where7-2.153.2 { - count_steps { - SELECT a FROM t3 - WHERE (f GLOB '?fghi*' AND f GLOB 'efgh*') - OR (g='rqponml' AND f GLOB 'hijkl*') - OR (d>=59.0 AND d<60.0 AND d NOT NULL) - OR a=28 - OR (g='srqponm' AND f GLOB 'efghi*') - OR c=12012 - OR b=14 - OR a=58 - OR ((a BETWEEN 95 AND 97) AND a!=96) - ORDER BY a - } -} {4 28 30 33 34 35 36 56 58 59 82 95 97 scan 0 sort 0} -do_test where7-2.154.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='vutsrqp' AND f GLOB 'qrstu*') - OR (d>=93.0 AND d<94.0 AND d NOT NULL) - OR f='zabcdefgh' - OR b=80 - OR (g='wvutsrq' AND f GLOB 'lmnop*') - OR (g='tsrqpon' AND f GLOB 'xyzab*') - OR ((a BETWEEN 84 AND 86) AND a!=85) - ORDER BY a - } -} {11 16 23 25 51 77 84 86 93 scan 0 sort 0} -do_test where7-2.154.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='vutsrqp' AND f GLOB 'qrstu*') - OR (d>=93.0 AND d<94.0 AND d NOT NULL) - OR f='zabcdefgh' - OR b=80 - OR (g='wvutsrq' AND f GLOB 'lmnop*') - OR (g='tsrqpon' AND f GLOB 'xyzab*') - OR ((a BETWEEN 84 AND 86) AND a!=85) - ORDER BY a - } -} {11 16 23 25 51 77 84 86 93 scan 0 sort 0} -do_test where7-2.155.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='ponmlkj' AND f GLOB 'uvwxy*') - OR (d>=50.0 AND d<51.0 AND d NOT NULL) - OR ((a BETWEEN 27 AND 29) AND a!=28) - OR ((a BETWEEN 58 AND 60) AND a!=59) - ORDER BY a - } -} {27 29 46 50 58 60 scan 0 sort 0} -do_test where7-2.155.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='ponmlkj' AND f GLOB 'uvwxy*') - OR (d>=50.0 AND d<51.0 AND d NOT NULL) - OR ((a BETWEEN 27 AND 29) AND a!=28) - OR ((a BETWEEN 58 AND 60) AND a!=59) - ORDER BY a - } -} {27 29 46 50 58 60 scan 0 sort 0} -do_test where7-2.156.1 { - count_steps { - SELECT a FROM t2 - WHERE a=76 - OR (d>=81.0 AND d<82.0 AND d NOT NULL) - OR b=935 - OR b=1023 - ORDER BY a - } -} {76 81 85 93 scan 0 sort 0} -do_test where7-2.156.2 { - count_steps { - SELECT a FROM t3 - WHERE a=76 - OR (d>=81.0 AND d<82.0 AND d NOT NULL) - OR b=935 - OR b=1023 - ORDER BY a - } -} {76 81 85 93 scan 0 sort 0} -do_test where7-2.157.1 { - count_steps { - SELECT a FROM t2 - WHERE a=15 - OR ((a BETWEEN 42 AND 44) AND a!=43) - OR b<0 - OR b=209 - ORDER BY a - } -} {15 19 42 44 scan 0 sort 0} -do_test where7-2.157.2 { - count_steps { - SELECT a FROM t3 - WHERE a=15 - OR ((a BETWEEN 42 AND 44) AND a!=43) - OR b<0 - OR b=209 - ORDER BY a - } -} {15 19 42 44 scan 0 sort 0} -do_test where7-2.158.1 { - count_steps { - SELECT a FROM t2 - WHERE b=421 - OR a=27 - OR (g='srqponm' AND f GLOB 'defgh*') - OR a=67 - OR (g='wvutsrq' AND f GLOB 'klmno*') - OR b<0 - OR (g='mlkjihg' AND f GLOB 'ijklm*') - OR (g='yxwvuts' AND f GLOB 'cdefg*') - ORDER BY a - } -} {2 10 27 29 60 67 scan 0 sort 0} -do_test where7-2.158.2 { - count_steps { - SELECT a FROM t3 - WHERE b=421 - OR a=27 - OR (g='srqponm' AND f GLOB 'defgh*') - OR a=67 - OR (g='wvutsrq' AND f GLOB 'klmno*') - OR b<0 - OR (g='mlkjihg' AND f GLOB 'ijklm*') - OR (g='yxwvuts' AND f GLOB 'cdefg*') - ORDER BY a - } -} {2 10 27 29 60 67 scan 0 sort 0} -do_test where7-2.159.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=42.0 AND d<43.0 AND d NOT NULL) - OR (g='mlkjihg' AND f GLOB 'jklmn*') - OR c=32032 - OR ((a BETWEEN 68 AND 70) AND a!=69) - OR (g='ihgfedc' AND f GLOB 'abcde*') - OR a=12 - OR f='stuvwxyza' - OR ((a BETWEEN 24 AND 26) AND a!=25) - ORDER BY a - } -} {12 18 24 26 42 44 61 68 70 78 94 95 96 scan 0 sort 0} -do_test where7-2.159.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=42.0 AND d<43.0 AND d NOT NULL) - OR (g='mlkjihg' AND f GLOB 'jklmn*') - OR c=32032 - OR ((a BETWEEN 68 AND 70) AND a!=69) - OR (g='ihgfedc' AND f GLOB 'abcde*') - OR a=12 - OR f='stuvwxyza' - OR ((a BETWEEN 24 AND 26) AND a!=25) - ORDER BY a - } -} {12 18 24 26 42 44 61 68 70 78 94 95 96 scan 0 sort 0} -do_test where7-2.160.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='srqponm' AND f GLOB 'defgh*') - OR a=53 - OR a=42 - OR c=21021 - OR c=14014 - OR (f GLOB '?mnop*' AND f GLOB 'lmno*') - OR b=583 - OR (f GLOB '?fghi*' AND f GLOB 'efgh*') - OR ((a BETWEEN 93 AND 95) AND a!=94) - OR (g='onmlkji' AND f GLOB 'zabcd*') - OR b=245 - ORDER BY a - } -} {4 11 29 30 37 40 41 42 51 53 56 61 62 63 82 89 93 95 scan 0 sort 0} -do_test where7-2.160.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='srqponm' AND f GLOB 'defgh*') - OR a=53 - OR a=42 - OR c=21021 - OR c=14014 - OR (f GLOB '?mnop*' AND f GLOB 'lmno*') - OR b=583 - OR (f GLOB '?fghi*' AND f GLOB 'efgh*') - OR ((a BETWEEN 93 AND 95) AND a!=94) - OR (g='onmlkji' AND f GLOB 'zabcd*') - OR b=245 - ORDER BY a - } -} {4 11 29 30 37 40 41 42 51 53 56 61 62 63 82 89 93 95 scan 0 sort 0} -do_test where7-2.161.1 { - count_steps { - SELECT a FROM t2 - WHERE b=608 - OR (g='srqponm' AND f GLOB 'defgh*') - OR b=330 - OR a=32 - OR a=70 - OR b=517 - OR (g='tsrqpon' AND f GLOB 'xyzab*') - ORDER BY a - } -} {23 29 30 32 47 70 scan 0 sort 0} -do_test where7-2.161.2 { - count_steps { - SELECT a FROM t3 - WHERE b=608 - OR (g='srqponm' AND f GLOB 'defgh*') - OR b=330 - OR a=32 - OR a=70 - OR b=517 - OR (g='tsrqpon' AND f GLOB 'xyzab*') - ORDER BY a - } -} {23 29 30 32 47 70 scan 0 sort 0} -do_test where7-2.162.1 { - count_steps { - SELECT a FROM t2 - WHERE a=2 - OR b=594 - OR (d>=6.0 AND d<7.0 AND d NOT NULL) - OR b=773 - ORDER BY a - } -} {2 6 54 scan 0 sort 0} -do_test where7-2.162.2 { - count_steps { - SELECT a FROM t3 - WHERE a=2 - OR b=594 - OR (d>=6.0 AND d<7.0 AND d NOT NULL) - OR b=773 - ORDER BY a - } -} {2 6 54 scan 0 sort 0} -do_test where7-2.163.1 { - count_steps { - SELECT a FROM t2 - WHERE a=73 - OR (g='mlkjihg' AND f GLOB 'jklmn*') - OR (g='gfedcba' AND f GLOB 'mnopq*') - ORDER BY a - } -} {61 73 90 scan 0 sort 0} -do_test where7-2.163.2 { - count_steps { - SELECT a FROM t3 - WHERE a=73 - OR (g='mlkjihg' AND f GLOB 'jklmn*') - OR (g='gfedcba' AND f GLOB 'mnopq*') - ORDER BY a - } -} {61 73 90 scan 0 sort 0} -do_test where7-2.164.1 { - count_steps { - SELECT a FROM t2 - WHERE f='mnopqrstu' - OR b=1103 - ORDER BY a - } -} {12 38 64 90 scan 0 sort 0} -do_test where7-2.164.2 { - count_steps { - SELECT a FROM t3 - WHERE f='mnopqrstu' - OR b=1103 - ORDER BY a - } -} {12 38 64 90 scan 0 sort 0} -do_test where7-2.165.1 { - count_steps { - SELECT a FROM t2 - WHERE c=26026 - OR (g='wvutsrq' AND f GLOB 'lmnop*') - OR (g='mlkjihg' AND f GLOB 'hijkl*') - OR b=828 - OR c=22022 - ORDER BY a - } -} {11 59 64 65 66 76 77 78 scan 0 sort 0} -do_test where7-2.165.2 { - count_steps { - SELECT a FROM t3 - WHERE c=26026 - OR (g='wvutsrq' AND f GLOB 'lmnop*') - OR (g='mlkjihg' AND f GLOB 'hijkl*') - OR b=828 - OR c=22022 - ORDER BY a - } -} {11 59 64 65 66 76 77 78 scan 0 sort 0} -do_test where7-2.166.1 { - count_steps { - SELECT a FROM t2 - WHERE b=616 - OR a=43 - OR c=27027 - OR (f GLOB '?efgh*' AND f GLOB 'defg*') - OR ((a BETWEEN 83 AND 85) AND a!=84) - OR (g='hgfedcb' AND f GLOB 'fghij*') - OR ((a BETWEEN 17 AND 19) AND a!=18) - ORDER BY a - } -} {3 17 19 29 43 55 56 79 80 81 83 85 scan 0 sort 0} -do_test where7-2.166.2 { - count_steps { - SELECT a FROM t3 - WHERE b=616 - OR a=43 - OR c=27027 - OR (f GLOB '?efgh*' AND f GLOB 'defg*') - OR ((a BETWEEN 83 AND 85) AND a!=84) - OR (g='hgfedcb' AND f GLOB 'fghij*') - OR ((a BETWEEN 17 AND 19) AND a!=18) - ORDER BY a - } -} {3 17 19 29 43 55 56 79 80 81 83 85 scan 0 sort 0} -do_test where7-2.167.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='vutsrqp' AND f GLOB 'qrstu*') - OR (g='qponmlk' AND f GLOB 'mnopq*') - OR ((a BETWEEN 57 AND 59) AND a!=58) - ORDER BY a - } -} {16 38 57 59 scan 0 sort 0} -do_test where7-2.167.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='vutsrqp' AND f GLOB 'qrstu*') - OR (g='qponmlk' AND f GLOB 'mnopq*') - OR ((a BETWEEN 57 AND 59) AND a!=58) - ORDER BY a - } -} {16 38 57 59 scan 0 sort 0} -do_test where7-2.168.1 { - count_steps { - SELECT a FROM t2 - WHERE a=30 - OR b=1081 - OR b=113 - OR b=869 - OR (d>=46.0 AND d<47.0 AND d NOT NULL) - OR b=946 - ORDER BY a - } -} {30 46 79 86 scan 0 sort 0} -do_test where7-2.168.2 { - count_steps { - SELECT a FROM t3 - WHERE a=30 - OR b=1081 - OR b=113 - OR b=869 - OR (d>=46.0 AND d<47.0 AND d NOT NULL) - OR b=946 - ORDER BY a - } -} {30 46 79 86 scan 0 sort 0} -do_test where7-2.169.1 { - count_steps { - SELECT a FROM t2 - WHERE d>1e10 - OR a=22 - OR b=638 - OR (g='lkjihgf' AND f GLOB 'pqrst*') - OR a=29 - OR a=49 - ORDER BY a - } -} {22 29 49 58 67 scan 0 sort 0} -do_test where7-2.169.2 { - count_steps { - SELECT a FROM t3 - WHERE d>1e10 - OR a=22 - OR b=638 - OR (g='lkjihgf' AND f GLOB 'pqrst*') - OR a=29 - OR a=49 - ORDER BY a - } -} {22 29 49 58 67 scan 0 sort 0} -do_test where7-2.170.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='lkjihgf' AND f GLOB 'pqrst*') - OR (d>=78.0 AND d<79.0 AND d NOT NULL) - OR b=77 - ORDER BY a - } -} {7 67 78 scan 0 sort 0} -do_test where7-2.170.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='lkjihgf' AND f GLOB 'pqrst*') - OR (d>=78.0 AND d<79.0 AND d NOT NULL) - OR b=77 - ORDER BY a - } -} {7 67 78 scan 0 sort 0} -do_test where7-2.171.1 { - count_steps { - SELECT a FROM t2 - WHERE (f GLOB '?rstu*' AND f GLOB 'qrst*') - OR b=363 - OR f='pqrstuvwx' - OR b=308 - OR b=187 - ORDER BY a - } -} {15 16 17 28 33 41 42 67 68 93 94 scan 0 sort 0} -do_test where7-2.171.2 { - count_steps { - SELECT a FROM t3 - WHERE (f GLOB '?rstu*' AND f GLOB 'qrst*') - OR b=363 - OR f='pqrstuvwx' - OR b=308 - OR b=187 - ORDER BY a - } -} {15 16 17 28 33 41 42 67 68 93 94 scan 0 sort 0} -do_test where7-2.172.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='qponmlk' AND f GLOB 'nopqr*') - OR b=264 - OR a=65 - OR b=135 - OR b=594 - OR (d>=21.0 AND d<22.0 AND d NOT NULL) - ORDER BY a - } -} {21 24 39 54 65 scan 0 sort 0} -do_test where7-2.172.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='qponmlk' AND f GLOB 'nopqr*') - OR b=264 - OR a=65 - OR b=135 - OR b=594 - OR (d>=21.0 AND d<22.0 AND d NOT NULL) - ORDER BY a - } -} {21 24 39 54 65 scan 0 sort 0} -do_test where7-2.173.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 41 AND 43) AND a!=42) - OR ((a BETWEEN 64 AND 66) AND a!=65) - OR ((a BETWEEN 72 AND 74) AND a!=73) - OR b=517 - OR (d>=34.0 AND d<35.0 AND d NOT NULL) - OR (g='jihgfed' AND f GLOB 'vwxyz*') - OR (d>=48.0 AND d<49.0 AND d NOT NULL) - OR b=1023 - OR a=40 - ORDER BY a - } -} {34 40 41 43 47 48 64 66 72 73 74 93 scan 0 sort 0} -do_test where7-2.173.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 41 AND 43) AND a!=42) - OR ((a BETWEEN 64 AND 66) AND a!=65) - OR ((a BETWEEN 72 AND 74) AND a!=73) - OR b=517 - OR (d>=34.0 AND d<35.0 AND d NOT NULL) - OR (g='jihgfed' AND f GLOB 'vwxyz*') - OR (d>=48.0 AND d<49.0 AND d NOT NULL) - OR b=1023 - OR a=40 - ORDER BY a - } -} {34 40 41 43 47 48 64 66 72 73 74 93 scan 0 sort 0} -do_test where7-2.174.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 12 AND 14) AND a!=13) - OR a=46 - OR a=6 - OR (f GLOB '?klmn*' AND f GLOB 'jklm*') - OR a=49 - ORDER BY a - } -} {6 9 12 14 35 46 49 61 87 scan 0 sort 0} -do_test where7-2.174.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 12 AND 14) AND a!=13) - OR a=46 - OR a=6 - OR (f GLOB '?klmn*' AND f GLOB 'jklm*') - OR a=49 - ORDER BY a - } -} {6 9 12 14 35 46 49 61 87 scan 0 sort 0} -do_test where7-2.175.1 { - count_steps { - SELECT a FROM t2 - WHERE a=87 - OR (g='fedcbaz' AND f GLOB 'pqrst*') - OR ((a BETWEEN 50 AND 52) AND a!=51) - OR a=83 - OR ((a BETWEEN 96 AND 98) AND a!=97) - OR (d>=34.0 AND d<35.0 AND d NOT NULL) - OR (d>=24.0 AND d<25.0 AND d NOT NULL) - ORDER BY a - } -} {24 34 50 52 83 87 93 96 98 scan 0 sort 0} -do_test where7-2.175.2 { - count_steps { - SELECT a FROM t3 - WHERE a=87 - OR (g='fedcbaz' AND f GLOB 'pqrst*') - OR ((a BETWEEN 50 AND 52) AND a!=51) - OR a=83 - OR ((a BETWEEN 96 AND 98) AND a!=97) - OR (d>=34.0 AND d<35.0 AND d NOT NULL) - OR (d>=24.0 AND d<25.0 AND d NOT NULL) - ORDER BY a - } -} {24 34 50 52 83 87 93 96 98 scan 0 sort 0} -do_test where7-2.176.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='edcbazy' AND f GLOB 'vwxyz*') - OR ((a BETWEEN 93 AND 95) AND a!=94) - OR ((a BETWEEN 71 AND 73) AND a!=72) - OR (g='mlkjihg' AND f GLOB 'ghijk*') - OR (d>=10.0 AND d<11.0 AND d NOT NULL) - OR c=15015 - ORDER BY a - } -} {10 43 44 45 58 71 73 93 95 99 scan 0 sort 0} -do_test where7-2.176.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='edcbazy' AND f GLOB 'vwxyz*') - OR ((a BETWEEN 93 AND 95) AND a!=94) - OR ((a BETWEEN 71 AND 73) AND a!=72) - OR (g='mlkjihg' AND f GLOB 'ghijk*') - OR (d>=10.0 AND d<11.0 AND d NOT NULL) - OR c=15015 - ORDER BY a - } -} {10 43 44 45 58 71 73 93 95 99 scan 0 sort 0} -do_test where7-2.177.1 { - count_steps { - SELECT a FROM t2 - WHERE b=968 - OR f='hijklmnop' - OR b=99 - OR a=87 - ORDER BY a - } -} {7 9 33 59 85 87 88 scan 0 sort 0} -do_test where7-2.177.2 { - count_steps { - SELECT a FROM t3 - WHERE b=968 - OR f='hijklmnop' - OR b=99 - OR a=87 - ORDER BY a - } -} {7 9 33 59 85 87 88 scan 0 sort 0} -do_test where7-2.178.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 69 AND 71) AND a!=70) - OR b=913 - OR a=58 - OR b=960 - OR (d>=98.0 AND d<99.0 AND d NOT NULL) - OR b=176 - OR a=6 - ORDER BY a - } -} {6 16 58 69 71 83 98 scan 0 sort 0} -do_test where7-2.178.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 69 AND 71) AND a!=70) - OR b=913 - OR a=58 - OR b=960 - OR (d>=98.0 AND d<99.0 AND d NOT NULL) - OR b=176 - OR a=6 - ORDER BY a - } -} {6 16 58 69 71 83 98 scan 0 sort 0} -do_test where7-2.179.1 { - count_steps { - SELECT a FROM t2 - WHERE a=84 - OR (g='onmlkji' AND f GLOB 'xyzab*') - OR (g='ihgfedc' AND f GLOB 'efghi*') - OR ((a BETWEEN 14 AND 16) AND a!=15) - OR b=594 - OR ((a BETWEEN 81 AND 83) AND a!=82) - OR ((a BETWEEN 50 AND 52) AND a!=51) - OR f='pqrstuvwx' - ORDER BY a - } -} {14 15 16 41 49 50 52 54 67 81 82 83 84 93 scan 0 sort 0} -do_test where7-2.179.2 { - count_steps { - SELECT a FROM t3 - WHERE a=84 - OR (g='onmlkji' AND f GLOB 'xyzab*') - OR (g='ihgfedc' AND f GLOB 'efghi*') - OR ((a BETWEEN 14 AND 16) AND a!=15) - OR b=594 - OR ((a BETWEEN 81 AND 83) AND a!=82) - OR ((a BETWEEN 50 AND 52) AND a!=51) - OR f='pqrstuvwx' - ORDER BY a - } -} {14 15 16 41 49 50 52 54 67 81 82 83 84 93 scan 0 sort 0} -do_test where7-2.180.1 { - count_steps { - SELECT a FROM t2 - WHERE b=58 - OR b=663 - ORDER BY a - } -} {scan 0 sort 1} -do_test where7-2.180.2 { - count_steps { - SELECT a FROM t3 - WHERE b=58 - OR b=663 - ORDER BY a - } -} {scan 0 sort 1} -do_test where7-2.181.1 { - count_steps { - SELECT a FROM t2 - WHERE a=56 - OR (d>=10.0 AND d<11.0 AND d NOT NULL) - OR b=946 - ORDER BY a - } -} {10 56 86 scan 0 sort 0} -do_test where7-2.181.2 { - count_steps { - SELECT a FROM t3 - WHERE a=56 - OR (d>=10.0 AND d<11.0 AND d NOT NULL) - OR b=946 - ORDER BY a - } -} {10 56 86 scan 0 sort 0} -do_test where7-2.182.1 { - count_steps { - SELECT a FROM t2 - WHERE b=627 - OR b=905 - OR (d>=75.0 AND d<76.0 AND d NOT NULL) - OR ((a BETWEEN 4 AND 6) AND a!=5) - OR f='xyzabcdef' - OR a=29 - ORDER BY a - } -} {4 6 23 29 49 57 75 scan 0 sort 0} -do_test where7-2.182.2 { - count_steps { - SELECT a FROM t3 - WHERE b=627 - OR b=905 - OR (d>=75.0 AND d<76.0 AND d NOT NULL) - OR ((a BETWEEN 4 AND 6) AND a!=5) - OR f='xyzabcdef' - OR a=29 - ORDER BY a - } -} {4 6 23 29 49 57 75 scan 0 sort 0} -do_test where7-2.183.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='jihgfed' AND f GLOB 'wxyza*') - OR b=850 - OR (f GLOB '?uvwx*' AND f GLOB 'tuvw*') - ORDER BY a - } -} {19 45 71 74 97 scan 0 sort 0} -do_test where7-2.183.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='jihgfed' AND f GLOB 'wxyza*') - OR b=850 - OR (f GLOB '?uvwx*' AND f GLOB 'tuvw*') - ORDER BY a - } -} {19 45 71 74 97 scan 0 sort 0} -do_test where7-2.184.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 54 AND 56) AND a!=55) - OR ((a BETWEEN 42 AND 44) AND a!=43) - OR (d>=39.0 AND d<40.0 AND d NOT NULL) - OR b=462 - OR b=1089 - OR (d>=65.0 AND d<66.0 AND d NOT NULL) - OR a=53 - OR d>1e10 - OR (d>=57.0 AND d<58.0 AND d NOT NULL) - OR c=23023 - OR b=561 - ORDER BY a - } -} {39 42 44 51 53 54 56 57 65 67 68 69 99 scan 0 sort 0} -do_test where7-2.184.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 54 AND 56) AND a!=55) - OR ((a BETWEEN 42 AND 44) AND a!=43) - OR (d>=39.0 AND d<40.0 AND d NOT NULL) - OR b=462 - OR b=1089 - OR (d>=65.0 AND d<66.0 AND d NOT NULL) - OR a=53 - OR d>1e10 - OR (d>=57.0 AND d<58.0 AND d NOT NULL) - OR c=23023 - OR b=561 - ORDER BY a - } -} {39 42 44 51 53 54 56 57 65 67 68 69 99 scan 0 sort 0} -do_test where7-2.185.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=56.0 AND d<57.0 AND d NOT NULL) - OR b=561 - OR ((a BETWEEN 9 AND 11) AND a!=10) - OR (f GLOB '?uvwx*' AND f GLOB 'tuvw*') - OR b=55 - OR a=94 - ORDER BY a - } -} {5 9 11 19 45 51 56 71 94 97 scan 0 sort 0} -do_test where7-2.185.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=56.0 AND d<57.0 AND d NOT NULL) - OR b=561 - OR ((a BETWEEN 9 AND 11) AND a!=10) - OR (f GLOB '?uvwx*' AND f GLOB 'tuvw*') - OR b=55 - OR a=94 - ORDER BY a - } -} {5 9 11 19 45 51 56 71 94 97 scan 0 sort 0} -do_test where7-2.186.1 { - count_steps { - SELECT a FROM t2 - WHERE (f GLOB '?qrst*' AND f GLOB 'pqrs*') - OR a=1 - OR (f GLOB '?opqr*' AND f GLOB 'nopq*') - OR f='fghijklmn' - OR ((a BETWEEN 37 AND 39) AND a!=38) - OR (g='mlkjihg' AND f GLOB 'hijkl*') - OR (d>=59.0 AND d<60.0 AND d NOT NULL) - OR (g='hgfedcb' AND f GLOB 'fghij*') - OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') - OR a=96 - ORDER BY a - } -} {1 5 13 14 15 31 37 39 40 41 57 59 65 66 67 83 91 92 93 96 scan 0 sort 0} -do_test where7-2.186.2 { - count_steps { - SELECT a FROM t3 - WHERE (f GLOB '?qrst*' AND f GLOB 'pqrs*') - OR a=1 - OR (f GLOB '?opqr*' AND f GLOB 'nopq*') - OR f='fghijklmn' - OR ((a BETWEEN 37 AND 39) AND a!=38) - OR (g='mlkjihg' AND f GLOB 'hijkl*') - OR (d>=59.0 AND d<60.0 AND d NOT NULL) - OR (g='hgfedcb' AND f GLOB 'fghij*') - OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') - OR a=96 - ORDER BY a - } -} {1 5 13 14 15 31 37 39 40 41 57 59 65 66 67 83 91 92 93 96 scan 0 sort 0} -do_test where7-2.187.1 { - count_steps { - SELECT a FROM t2 - WHERE b=495 - OR b=231 - OR b=795 - OR a=1 - OR ((a BETWEEN 13 AND 15) AND a!=14) - OR b=861 - OR b=388 - OR ((a BETWEEN 17 AND 19) AND a!=18) - OR a=4 - ORDER BY a - } -} {1 4 13 15 17 19 21 45 scan 0 sort 0} -do_test where7-2.187.2 { - count_steps { - SELECT a FROM t3 - WHERE b=495 - OR b=231 - OR b=795 - OR a=1 - OR ((a BETWEEN 13 AND 15) AND a!=14) - OR b=861 - OR b=388 - OR ((a BETWEEN 17 AND 19) AND a!=18) - OR a=4 - ORDER BY a - } -} {1 4 13 15 17 19 21 45 scan 0 sort 0} -do_test where7-2.188.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='jihgfed' AND f GLOB 'zabcd*') - OR b=286 - OR b=553 - OR ((a BETWEEN 51 AND 53) AND a!=52) - OR b=839 - ORDER BY a - } -} {26 51 53 77 scan 0 sort 0} -do_test where7-2.188.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='jihgfed' AND f GLOB 'zabcd*') - OR b=286 - OR b=553 - OR ((a BETWEEN 51 AND 53) AND a!=52) - OR b=839 - ORDER BY a - } -} {26 51 53 77 scan 0 sort 0} -do_test where7-2.189.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=3.0 AND d<4.0 AND d NOT NULL) - OR b=487 - OR (d>=17.0 AND d<18.0 AND d NOT NULL) - OR ((a BETWEEN 60 AND 62) AND a!=61) - OR a=90 - OR (g='tsrqpon' AND f GLOB 'yzabc*') - ORDER BY a - } -} {3 17 24 60 62 90 scan 0 sort 0} -do_test where7-2.189.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=3.0 AND d<4.0 AND d NOT NULL) - OR b=487 - OR (d>=17.0 AND d<18.0 AND d NOT NULL) - OR ((a BETWEEN 60 AND 62) AND a!=61) - OR a=90 - OR (g='tsrqpon' AND f GLOB 'yzabc*') - ORDER BY a - } -} {3 17 24 60 62 90 scan 0 sort 0} -do_test where7-2.190.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 17 AND 19) AND a!=18) - OR b=671 - OR (g='xwvutsr' AND f GLOB 'ghijk*') - OR ((a BETWEEN 15 AND 17) AND a!=16) - OR (d>=36.0 AND d<37.0 AND d NOT NULL) - OR a=57 - ORDER BY a - } -} {6 15 17 19 36 57 61 scan 0 sort 0} -do_test where7-2.190.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 17 AND 19) AND a!=18) - OR b=671 - OR (g='xwvutsr' AND f GLOB 'ghijk*') - OR ((a BETWEEN 15 AND 17) AND a!=16) - OR (d>=36.0 AND d<37.0 AND d NOT NULL) - OR a=57 - ORDER BY a - } -} {6 15 17 19 36 57 61 scan 0 sort 0} -do_test where7-2.191.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='lkjihgf' AND f GLOB 'opqrs*') - OR b=891 - OR a=64 - ORDER BY a - } -} {64 66 81 scan 0 sort 0} -do_test where7-2.191.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='lkjihgf' AND f GLOB 'opqrs*') - OR b=891 - OR a=64 - ORDER BY a - } -} {64 66 81 scan 0 sort 0} -do_test where7-2.192.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 58 AND 60) AND a!=59) - OR b=201 - OR (g='jihgfed' AND f GLOB 'wxyza*') - OR (d>=28.0 AND d<29.0 AND d NOT NULL) - OR (g='tsrqpon' AND f GLOB 'abcde*') - OR b=718 - OR ((a BETWEEN 44 AND 46) AND a!=45) - OR (g='xwvutsr' AND f GLOB 'ghijk*') - ORDER BY a - } -} {6 26 28 44 46 58 60 74 scan 0 sort 0} -do_test where7-2.192.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 58 AND 60) AND a!=59) - OR b=201 - OR (g='jihgfed' AND f GLOB 'wxyza*') - OR (d>=28.0 AND d<29.0 AND d NOT NULL) - OR (g='tsrqpon' AND f GLOB 'abcde*') - OR b=718 - OR ((a BETWEEN 44 AND 46) AND a!=45) - OR (g='xwvutsr' AND f GLOB 'ghijk*') - ORDER BY a - } -} {6 26 28 44 46 58 60 74 scan 0 sort 0} -do_test where7-2.193.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='wvutsrq' AND f GLOB 'ijklm*') - OR f='opqrstuvw' - OR (g='rqponml' AND f GLOB 'ijklm*') - ORDER BY a - } -} {8 14 34 40 66 92 scan 0 sort 0} -do_test where7-2.193.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='wvutsrq' AND f GLOB 'ijklm*') - OR f='opqrstuvw' - OR (g='rqponml' AND f GLOB 'ijklm*') - ORDER BY a - } -} {8 14 34 40 66 92 scan 0 sort 0} -do_test where7-2.194.1 { - count_steps { - SELECT a FROM t2 - WHERE b=454 - OR b=33 - OR b=157 - ORDER BY a - } -} {3 scan 0 sort 1} -do_test where7-2.194.2 { - count_steps { - SELECT a FROM t3 - WHERE b=454 - OR b=33 - OR b=157 - ORDER BY a - } -} {3 scan 0 sort 1} -do_test where7-2.195.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 82 AND 84) AND a!=83) - OR b=993 - OR ((a BETWEEN 79 AND 81) AND a!=80) - OR (d>=55.0 AND d<56.0 AND d NOT NULL) - OR a=30 - ORDER BY a - } -} {30 55 79 81 82 84 scan 0 sort 0} -do_test where7-2.195.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 82 AND 84) AND a!=83) - OR b=993 - OR ((a BETWEEN 79 AND 81) AND a!=80) - OR (d>=55.0 AND d<56.0 AND d NOT NULL) - OR a=30 - ORDER BY a - } -} {30 55 79 81 82 84 scan 0 sort 0} -do_test where7-2.196.1 { - count_steps { - SELECT a FROM t2 - WHERE (f GLOB '?klmn*' AND f GLOB 'jklm*') - OR b=850 - ORDER BY a - } -} {9 35 61 87 scan 0 sort 0} -do_test where7-2.196.2 { - count_steps { - SELECT a FROM t3 - WHERE (f GLOB '?klmn*' AND f GLOB 'jklm*') - OR b=850 - ORDER BY a - } -} {9 35 61 87 scan 0 sort 0} -do_test where7-2.197.1 { - count_steps { - SELECT a FROM t2 - WHERE b=872 - OR (d>=47.0 AND d<48.0 AND d NOT NULL) - OR b=322 - OR a=6 - OR (g='jihgfed' AND f GLOB 'xyzab*') - OR c<=10 - OR b=784 - OR b=11 - OR b=759 - OR b=993 - ORDER BY a - } -} {1 6 47 69 75 scan 0 sort 0} -do_test where7-2.197.2 { - count_steps { - SELECT a FROM t3 - WHERE b=872 - OR (d>=47.0 AND d<48.0 AND d NOT NULL) - OR b=322 - OR a=6 - OR (g='jihgfed' AND f GLOB 'xyzab*') - OR c<=10 - OR b=784 - OR b=11 - OR b=759 - OR b=993 - ORDER BY a - } -} {1 6 47 69 75 scan 0 sort 0} -do_test where7-2.198.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 53 AND 55) AND a!=54) - OR ((a BETWEEN 63 AND 65) AND a!=64) - OR a=29 - OR ((a BETWEEN 65 AND 67) AND a!=66) - OR a=66 - OR a=55 - OR ((a BETWEEN 81 AND 83) AND a!=82) - OR b=14 - OR (d>=88.0 AND d<89.0 AND d NOT NULL) - ORDER BY a - } -} {29 53 55 63 65 66 67 81 83 88 scan 0 sort 0} -do_test where7-2.198.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 53 AND 55) AND a!=54) - OR ((a BETWEEN 63 AND 65) AND a!=64) - OR a=29 - OR ((a BETWEEN 65 AND 67) AND a!=66) - OR a=66 - OR a=55 - OR ((a BETWEEN 81 AND 83) AND a!=82) - OR b=14 - OR (d>=88.0 AND d<89.0 AND d NOT NULL) - ORDER BY a - } -} {29 53 55 63 65 66 67 81 83 88 scan 0 sort 0} -do_test where7-2.199.1 { - count_steps { - SELECT a FROM t2 - WHERE c=29029 - OR b=960 - OR ((a BETWEEN 49 AND 51) AND a!=50) - OR (f GLOB '?hijk*' AND f GLOB 'ghij*') - OR b=410 - OR c=27027 - OR (g='mlkjihg' AND f GLOB 'ghijk*') - OR (g='jihgfed' AND f GLOB 'vwxyz*') - OR ((a BETWEEN 79 AND 81) AND a!=80) - OR (f GLOB '?yzab*' AND f GLOB 'xyza*') - OR c=1001 - ORDER BY a - } -} {1 2 3 6 23 32 49 51 58 73 75 79 80 81 84 85 86 87 scan 0 sort 0} -do_test where7-2.199.2 { - count_steps { - SELECT a FROM t3 - WHERE c=29029 - OR b=960 - OR ((a BETWEEN 49 AND 51) AND a!=50) - OR (f GLOB '?hijk*' AND f GLOB 'ghij*') - OR b=410 - OR c=27027 - OR (g='mlkjihg' AND f GLOB 'ghijk*') - OR (g='jihgfed' AND f GLOB 'vwxyz*') - OR ((a BETWEEN 79 AND 81) AND a!=80) - OR (f GLOB '?yzab*' AND f GLOB 'xyza*') - OR c=1001 - ORDER BY a - } -} {1 2 3 6 23 32 49 51 58 73 75 79 80 81 84 85 86 87 scan 0 sort 0} -do_test where7-2.200.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 84 AND 86) AND a!=85) - OR ((a BETWEEN 87 AND 89) AND a!=88) - OR (d>=4.0 AND d<5.0 AND d NOT NULL) - OR ((a BETWEEN 15 AND 17) AND a!=16) - OR b=374 - OR a=69 - OR (d>=53.0 AND d<54.0 AND d NOT NULL) - OR (d>=78.0 AND d<79.0 AND d NOT NULL) - OR b=33 - OR (g='srqponm' AND f GLOB 'defgh*') - OR (g='nmlkjih' AND f GLOB 'bcdef*') - ORDER BY a - } -} {3 4 15 17 29 34 53 69 78 84 86 87 89 scan 0 sort 0} -do_test where7-2.200.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 84 AND 86) AND a!=85) - OR ((a BETWEEN 87 AND 89) AND a!=88) - OR (d>=4.0 AND d<5.0 AND d NOT NULL) - OR ((a BETWEEN 15 AND 17) AND a!=16) - OR b=374 - OR a=69 - OR (d>=53.0 AND d<54.0 AND d NOT NULL) - OR (d>=78.0 AND d<79.0 AND d NOT NULL) - OR b=33 - OR (g='srqponm' AND f GLOB 'defgh*') - OR (g='nmlkjih' AND f GLOB 'bcdef*') - ORDER BY a - } -} {3 4 15 17 29 34 53 69 78 84 86 87 89 scan 0 sort 0} -do_test where7-2.201.1 { - count_steps { - SELECT a FROM t2 - WHERE c=11011 - OR (d>=25.0 AND d<26.0 AND d NOT NULL) - OR ((a BETWEEN 93 AND 95) AND a!=94) - OR ((a BETWEEN 35 AND 37) AND a!=36) - OR f='lmnopqrst' - OR a=52 - OR (g='xwvutsr' AND f GLOB 'hijkl*') - OR (d>=63.0 AND d<64.0 AND d NOT NULL) - OR b=242 - OR ((a BETWEEN 91 AND 93) AND a!=92) - ORDER BY a - } -} {7 11 22 25 31 32 33 35 37 52 63 89 91 93 95 scan 0 sort 0} -do_test where7-2.201.2 { - count_steps { - SELECT a FROM t3 - WHERE c=11011 - OR (d>=25.0 AND d<26.0 AND d NOT NULL) - OR ((a BETWEEN 93 AND 95) AND a!=94) - OR ((a BETWEEN 35 AND 37) AND a!=36) - OR f='lmnopqrst' - OR a=52 - OR (g='xwvutsr' AND f GLOB 'hijkl*') - OR (d>=63.0 AND d<64.0 AND d NOT NULL) - OR b=242 - OR ((a BETWEEN 91 AND 93) AND a!=92) - ORDER BY a - } -} {7 11 22 25 31 32 33 35 37 52 63 89 91 93 95 scan 0 sort 0} -do_test where7-2.202.1 { - count_steps { - SELECT a FROM t2 - WHERE b=135 - OR a=49 - OR b=44 - OR b=377 - ORDER BY a - } -} {4 49 scan 0 sort 0} -do_test where7-2.202.2 { - count_steps { - SELECT a FROM t3 - WHERE b=135 - OR a=49 - OR b=44 - OR b=377 - ORDER BY a - } -} {4 49 scan 0 sort 0} -do_test where7-2.203.1 { - count_steps { - SELECT a FROM t2 - WHERE b=1070 - OR (g='jihgfed' AND f GLOB 'vwxyz*') - OR (g='xwvutsr' AND f GLOB 'defgh*') - OR b=737 - OR ((a BETWEEN 99 AND 101) AND a!=100) - OR b=36 - OR b=707 - OR (g='nmlkjih' AND f GLOB 'bcdef*') - ORDER BY a - } -} {3 53 67 73 99 scan 0 sort 0} -do_test where7-2.203.2 { - count_steps { - SELECT a FROM t3 - WHERE b=1070 - OR (g='jihgfed' AND f GLOB 'vwxyz*') - OR (g='xwvutsr' AND f GLOB 'defgh*') - OR b=737 - OR ((a BETWEEN 99 AND 101) AND a!=100) - OR b=36 - OR b=707 - OR (g='nmlkjih' AND f GLOB 'bcdef*') - ORDER BY a - } -} {3 53 67 73 99 scan 0 sort 0} -do_test where7-2.204.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 61 AND 63) AND a!=62) - OR (g='srqponm' AND f GLOB 'defgh*') - OR (d>=56.0 AND d<57.0 AND d NOT NULL) - OR (f GLOB '?stuv*' AND f GLOB 'rstu*') - ORDER BY a - } -} {17 29 43 56 61 63 69 95 scan 0 sort 0} -do_test where7-2.204.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 61 AND 63) AND a!=62) - OR (g='srqponm' AND f GLOB 'defgh*') - OR (d>=56.0 AND d<57.0 AND d NOT NULL) - OR (f GLOB '?stuv*' AND f GLOB 'rstu*') - ORDER BY a - } -} {17 29 43 56 61 63 69 95 scan 0 sort 0} -do_test where7-2.205.1 { - count_steps { - SELECT a FROM t2 - WHERE a=30 - OR ((a BETWEEN 15 AND 17) AND a!=16) - OR f='vwxyzabcd' - OR b=506 - ORDER BY a - } -} {15 17 21 30 46 47 73 99 scan 0 sort 0} -do_test where7-2.205.2 { - count_steps { - SELECT a FROM t3 - WHERE a=30 - OR ((a BETWEEN 15 AND 17) AND a!=16) - OR f='vwxyzabcd' - OR b=506 - ORDER BY a - } -} {15 17 21 30 46 47 73 99 scan 0 sort 0} -do_test where7-2.206.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='ponmlkj' AND f GLOB 'rstuv*') - OR ((a BETWEEN 35 AND 37) AND a!=36) - ORDER BY a - } -} {35 37 43 scan 0 sort 0} -do_test where7-2.206.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='ponmlkj' AND f GLOB 'rstuv*') - OR ((a BETWEEN 35 AND 37) AND a!=36) - ORDER BY a - } -} {35 37 43 scan 0 sort 0} -do_test where7-2.207.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='ihgfedc' AND f GLOB 'abcde*') - OR b=795 - OR c=16016 - OR a=44 - OR f='defghijkl' - ORDER BY a - } -} {3 29 44 46 47 48 55 78 81 scan 0 sort 0} -do_test where7-2.207.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='ihgfedc' AND f GLOB 'abcde*') - OR b=795 - OR c=16016 - OR a=44 - OR f='defghijkl' - ORDER BY a - } -} {3 29 44 46 47 48 55 78 81 scan 0 sort 0} -do_test where7-2.208.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='xwvutsr' AND f GLOB 'ghijk*') - OR (f GLOB '?lmno*' AND f GLOB 'klmn*') - ORDER BY a - } -} {6 10 36 62 88 scan 0 sort 0} -do_test where7-2.208.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='xwvutsr' AND f GLOB 'ghijk*') - OR (f GLOB '?lmno*' AND f GLOB 'klmn*') - ORDER BY a - } -} {6 10 36 62 88 scan 0 sort 0} -do_test where7-2.209.1 { - count_steps { - SELECT a FROM t2 - WHERE b=627 - OR c=11011 - ORDER BY a - } -} {31 32 33 57 scan 0 sort 0} -do_test where7-2.209.2 { - count_steps { - SELECT a FROM t3 - WHERE b=627 - OR c=11011 - ORDER BY a - } -} {31 32 33 57 scan 0 sort 0} -do_test where7-2.210.1 { - count_steps { - SELECT a FROM t2 - WHERE b=418 - OR (g='hgfedcb' AND f GLOB 'fghij*') - OR (g='hgfedcb' AND f GLOB 'ghijk*') - OR b=968 - OR (g='qponmlk' AND f GLOB 'nopqr*') - OR b=14 - OR (f GLOB '?defg*' AND f GLOB 'cdef*') - ORDER BY a - } -} {2 28 38 39 54 80 83 84 88 scan 0 sort 0} -do_test where7-2.210.2 { - count_steps { - SELECT a FROM t3 - WHERE b=418 - OR (g='hgfedcb' AND f GLOB 'fghij*') - OR (g='hgfedcb' AND f GLOB 'ghijk*') - OR b=968 - OR (g='qponmlk' AND f GLOB 'nopqr*') - OR b=14 - OR (f GLOB '?defg*' AND f GLOB 'cdef*') - ORDER BY a - } -} {2 28 38 39 54 80 83 84 88 scan 0 sort 0} -do_test where7-2.211.1 { - count_steps { - SELECT a FROM t2 - WHERE b=275 - OR b=630 - OR b=520 - OR (d>=90.0 AND d<91.0 AND d NOT NULL) - OR b=583 - OR a=94 - OR b=660 - OR (d>=68.0 AND d<69.0 AND d NOT NULL) - OR (d>=76.0 AND d<77.0 AND d NOT NULL) - OR (d>=11.0 AND d<12.0 AND d NOT NULL) - ORDER BY a - } -} {11 25 53 60 68 76 90 94 scan 0 sort 0} -do_test where7-2.211.2 { - count_steps { - SELECT a FROM t3 - WHERE b=275 - OR b=630 - OR b=520 - OR (d>=90.0 AND d<91.0 AND d NOT NULL) - OR b=583 - OR a=94 - OR b=660 - OR (d>=68.0 AND d<69.0 AND d NOT NULL) - OR (d>=76.0 AND d<77.0 AND d NOT NULL) - OR (d>=11.0 AND d<12.0 AND d NOT NULL) - ORDER BY a - } -} {11 25 53 60 68 76 90 94 scan 0 sort 0} -do_test where7-2.212.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='ihgfedc' AND f GLOB 'abcde*') - OR a=43 - OR c=7007 - OR a=42 - OR a=2 - OR ((a BETWEEN 3 AND 5) AND a!=4) - OR (g='yxwvuts' AND f GLOB 'bcdef*') - OR d<0.0 - ORDER BY a - } -} {1 2 3 5 19 20 21 42 43 78 scan 0 sort 0} -do_test where7-2.212.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='ihgfedc' AND f GLOB 'abcde*') - OR a=43 - OR c=7007 - OR a=42 - OR a=2 - OR ((a BETWEEN 3 AND 5) AND a!=4) - OR (g='yxwvuts' AND f GLOB 'bcdef*') - OR d<0.0 - ORDER BY a - } -} {1 2 3 5 19 20 21 42 43 78 scan 0 sort 0} -do_test where7-2.213.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=94.0 AND d<95.0 AND d NOT NULL) - OR a=65 - OR b=913 - OR a=38 - OR (d>=52.0 AND d<53.0 AND d NOT NULL) - OR (d>=31.0 AND d<32.0 AND d NOT NULL) - OR (g='mlkjihg' AND f GLOB 'hijkl*') - ORDER BY a - } -} {31 38 52 59 65 83 94 scan 0 sort 0} -do_test where7-2.213.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=94.0 AND d<95.0 AND d NOT NULL) - OR a=65 - OR b=913 - OR a=38 - OR (d>=52.0 AND d<53.0 AND d NOT NULL) - OR (d>=31.0 AND d<32.0 AND d NOT NULL) - OR (g='mlkjihg' AND f GLOB 'hijkl*') - ORDER BY a - } -} {31 38 52 59 65 83 94 scan 0 sort 0} -do_test where7-2.214.1 { - count_steps { - SELECT a FROM t2 - WHERE c=1001 - OR c=24024 - OR ((a BETWEEN 91 AND 93) AND a!=92) - OR (d>=3.0 AND d<4.0 AND d NOT NULL) - OR (g='fedcbaz' AND f GLOB 'rstuv*') - OR b=726 - ORDER BY a - } -} {1 2 3 66 70 71 72 91 93 95 scan 0 sort 0} -do_test where7-2.214.2 { - count_steps { - SELECT a FROM t3 - WHERE c=1001 - OR c=24024 - OR ((a BETWEEN 91 AND 93) AND a!=92) - OR (d>=3.0 AND d<4.0 AND d NOT NULL) - OR (g='fedcbaz' AND f GLOB 'rstuv*') - OR b=726 - ORDER BY a - } -} {1 2 3 66 70 71 72 91 93 95 scan 0 sort 0} -do_test where7-2.215.1 { - count_steps { - SELECT a FROM t2 - WHERE b=1067 - OR ((a BETWEEN 64 AND 66) AND a!=65) - OR (f GLOB '?cdef*' AND f GLOB 'bcde*') - ORDER BY a - } -} {1 27 53 64 66 79 97 scan 0 sort 0} -do_test where7-2.215.2 { - count_steps { - SELECT a FROM t3 - WHERE b=1067 - OR ((a BETWEEN 64 AND 66) AND a!=65) - OR (f GLOB '?cdef*' AND f GLOB 'bcde*') - ORDER BY a - } -} {1 27 53 64 66 79 97 scan 0 sort 0} -do_test where7-2.216.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 33 AND 35) AND a!=34) - OR a=25 - OR ((a BETWEEN 83 AND 85) AND a!=84) - ORDER BY a - } -} {25 33 35 83 85 scan 0 sort 0} -do_test where7-2.216.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 33 AND 35) AND a!=34) - OR a=25 - OR ((a BETWEEN 83 AND 85) AND a!=84) - ORDER BY a - } -} {25 33 35 83 85 scan 0 sort 0} -do_test where7-2.217.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='onmlkji' AND f GLOB 'zabcd*') - OR b=253 - ORDER BY a - } -} {23 51 scan 0 sort 0} -do_test where7-2.217.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='onmlkji' AND f GLOB 'zabcd*') - OR b=253 - ORDER BY a - } -} {23 51 scan 0 sort 0} -do_test where7-2.218.1 { - count_steps { - SELECT a FROM t2 - WHERE (f GLOB '?zabc*' AND f GLOB 'yzab*') - OR (d>=30.0 AND d<31.0 AND d NOT NULL) - OR (g='fedcbaz' AND f GLOB 'tuvwx*') - ORDER BY a - } -} {24 30 50 76 97 scan 0 sort 0} -do_test where7-2.218.2 { - count_steps { - SELECT a FROM t3 - WHERE (f GLOB '?zabc*' AND f GLOB 'yzab*') - OR (d>=30.0 AND d<31.0 AND d NOT NULL) - OR (g='fedcbaz' AND f GLOB 'tuvwx*') - ORDER BY a - } -} {24 30 50 76 97 scan 0 sort 0} -do_test where7-2.219.1 { - count_steps { - SELECT a FROM t2 - WHERE b=575 - OR f='wxyzabcde' - OR (g='qponmlk' AND f GLOB 'opqrs*') - OR (g='lkjihgf' AND f GLOB 'mnopq*') - OR b=11 - OR ((a BETWEEN 62 AND 64) AND a!=63) - OR b=333 - OR b=432 - OR b=1081 - OR (g='nmlkjih' AND f GLOB 'cdefg*') - ORDER BY a - } -} {1 22 40 48 54 62 64 74 100 scan 0 sort 0} -do_test where7-2.219.2 { - count_steps { - SELECT a FROM t3 - WHERE b=575 - OR f='wxyzabcde' - OR (g='qponmlk' AND f GLOB 'opqrs*') - OR (g='lkjihgf' AND f GLOB 'mnopq*') - OR b=11 - OR ((a BETWEEN 62 AND 64) AND a!=63) - OR b=333 - OR b=432 - OR b=1081 - OR (g='nmlkjih' AND f GLOB 'cdefg*') - ORDER BY a - } -} {1 22 40 48 54 62 64 74 100 scan 0 sort 0} -do_test where7-2.220.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='fedcbaz' AND f GLOB 'stuvw*') - OR (g='kjihgfe' AND f GLOB 'uvwxy*') - OR (d>=37.0 AND d<38.0 AND d NOT NULL) - OR c=30030 - OR b=124 - OR a=88 - OR b=1100 - OR (f GLOB '?nopq*' AND f GLOB 'mnop*') - OR (g='ihgfedc' AND f GLOB 'defgh*') - ORDER BY a - } -} {12 37 38 64 72 81 88 89 90 96 100 scan 0 sort 0} -do_test where7-2.220.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='fedcbaz' AND f GLOB 'stuvw*') - OR (g='kjihgfe' AND f GLOB 'uvwxy*') - OR (d>=37.0 AND d<38.0 AND d NOT NULL) - OR c=30030 - OR b=124 - OR a=88 - OR b=1100 - OR (f GLOB '?nopq*' AND f GLOB 'mnop*') - OR (g='ihgfedc' AND f GLOB 'defgh*') - ORDER BY a - } -} {12 37 38 64 72 81 88 89 90 96 100 scan 0 sort 0} -do_test where7-2.221.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 46 AND 48) AND a!=47) - OR ((a BETWEEN 51 AND 53) AND a!=52) - OR ((a BETWEEN 30 AND 32) AND a!=31) - OR a=23 - OR ((a BETWEEN 45 AND 47) AND a!=46) - OR (g='hgfedcb' AND f GLOB 'jklmn*') - OR b=418 - OR a=38 - OR ((a BETWEEN 38 AND 40) AND a!=39) - OR b=344 - OR a=1 - ORDER BY a - } -} {1 23 30 32 38 40 45 46 47 48 51 53 87 scan 0 sort 0} -do_test where7-2.221.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 46 AND 48) AND a!=47) - OR ((a BETWEEN 51 AND 53) AND a!=52) - OR ((a BETWEEN 30 AND 32) AND a!=31) - OR a=23 - OR ((a BETWEEN 45 AND 47) AND a!=46) - OR (g='hgfedcb' AND f GLOB 'jklmn*') - OR b=418 - OR a=38 - OR ((a BETWEEN 38 AND 40) AND a!=39) - OR b=344 - OR a=1 - ORDER BY a - } -} {1 23 30 32 38 40 45 46 47 48 51 53 87 scan 0 sort 0} -do_test where7-2.222.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=68.0 AND d<69.0 AND d NOT NULL) - OR b=605 - OR b=528 - ORDER BY a - } -} {48 55 68 scan 0 sort 0} -do_test where7-2.222.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=68.0 AND d<69.0 AND d NOT NULL) - OR b=605 - OR b=528 - ORDER BY a - } -} {48 55 68 scan 0 sort 0} -do_test where7-2.223.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 59 AND 61) AND a!=60) - OR (g='wvutsrq' AND f GLOB 'ijklm*') - OR a=15 - OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') - OR ((a BETWEEN 57 AND 59) AND a!=58) - OR (d>=87.0 AND d<88.0 AND d NOT NULL) - ORDER BY a - } -} {7 8 15 33 57 59 61 85 87 scan 0 sort 0} -do_test where7-2.223.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 59 AND 61) AND a!=60) - OR (g='wvutsrq' AND f GLOB 'ijklm*') - OR a=15 - OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') - OR ((a BETWEEN 57 AND 59) AND a!=58) - OR (d>=87.0 AND d<88.0 AND d NOT NULL) - ORDER BY a - } -} {7 8 15 33 57 59 61 85 87 scan 0 sort 0} -do_test where7-2.224.1 { - count_steps { - SELECT a FROM t2 - WHERE b=157 - OR c>=34035 - OR b=1103 - OR (g='utsrqpo' AND f GLOB 'uvwxy*') - ORDER BY a - } -} {20 scan 0 sort 0} -do_test where7-2.224.2 { - count_steps { - SELECT a FROM t3 - WHERE b=157 - OR c>=34035 - OR b=1103 - OR (g='utsrqpo' AND f GLOB 'uvwxy*') - ORDER BY a - } -} {20 scan 0 sort 0} -do_test where7-2.225.1 { - count_steps { - SELECT a FROM t2 - WHERE b=553 - OR ((a BETWEEN 48 AND 50) AND a!=49) - OR c=34034 - OR ((a BETWEEN 4 AND 6) AND a!=5) - OR a=58 - OR ((a BETWEEN 98 AND 100) AND a!=99) - OR (f GLOB '?ghij*' AND f GLOB 'fghi*') - OR b=550 - ORDER BY a - } -} {4 5 6 31 48 50 57 58 83 98 100 scan 0 sort 0} -do_test where7-2.225.2 { - count_steps { - SELECT a FROM t3 - WHERE b=553 - OR ((a BETWEEN 48 AND 50) AND a!=49) - OR c=34034 - OR ((a BETWEEN 4 AND 6) AND a!=5) - OR a=58 - OR ((a BETWEEN 98 AND 100) AND a!=99) - OR (f GLOB '?ghij*' AND f GLOB 'fghi*') - OR b=550 - ORDER BY a - } -} {4 5 6 31 48 50 57 58 83 98 100 scan 0 sort 0} -do_test where7-2.226.1 { - count_steps { - SELECT a FROM t2 - WHERE b=572 - OR a=72 - OR c=9009 - OR ((a BETWEEN 2 AND 4) AND a!=3) - OR b=704 - OR a=88 - OR (g='srqponm' AND f GLOB 'efghi*') - OR b=594 - OR a=35 - OR b=663 - OR b=751 - ORDER BY a - } -} {2 4 25 26 27 30 35 52 54 64 72 88 scan 0 sort 0} -do_test where7-2.226.2 { - count_steps { - SELECT a FROM t3 - WHERE b=572 - OR a=72 - OR c=9009 - OR ((a BETWEEN 2 AND 4) AND a!=3) - OR b=704 - OR a=88 - OR (g='srqponm' AND f GLOB 'efghi*') - OR b=594 - OR a=35 - OR b=663 - OR b=751 - ORDER BY a - } -} {2 4 25 26 27 30 35 52 54 64 72 88 scan 0 sort 0} -do_test where7-2.227.1 { - count_steps { - SELECT a FROM t2 - WHERE a=42 - OR a=21 - OR (g='fedcbaz' AND f GLOB 'pqrst*') - OR (d>=48.0 AND d<49.0 AND d NOT NULL) - OR ((a BETWEEN 31 AND 33) AND a!=32) - OR ((a BETWEEN 97 AND 99) AND a!=98) - OR g IS NULL - OR b=1078 - OR ((a BETWEEN 42 AND 44) AND a!=43) - OR (d>=54.0 AND d<55.0 AND d NOT NULL) - OR b=652 - ORDER BY a - } -} {21 31 33 42 44 48 54 93 97 98 99 scan 0 sort 0} -do_test where7-2.227.2 { - count_steps { - SELECT a FROM t3 - WHERE a=42 - OR a=21 - OR (g='fedcbaz' AND f GLOB 'pqrst*') - OR (d>=48.0 AND d<49.0 AND d NOT NULL) - OR ((a BETWEEN 31 AND 33) AND a!=32) - OR ((a BETWEEN 97 AND 99) AND a!=98) - OR g IS NULL - OR b=1078 - OR ((a BETWEEN 42 AND 44) AND a!=43) - OR (d>=54.0 AND d<55.0 AND d NOT NULL) - OR b=652 - ORDER BY a - } -} {21 31 33 42 44 48 54 93 97 98 99 scan 0 sort 0} -do_test where7-2.228.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='srqponm' AND f GLOB 'ghijk*') - OR (g='ihgfedc' AND f GLOB 'defgh*') - ORDER BY a - } -} {32 81 scan 0 sort 0} -do_test where7-2.228.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='srqponm' AND f GLOB 'ghijk*') - OR (g='ihgfedc' AND f GLOB 'defgh*') - ORDER BY a - } -} {32 81 scan 0 sort 0} -do_test where7-2.229.1 { - count_steps { - SELECT a FROM t2 - WHERE a=79 - OR ((a BETWEEN 2 AND 4) AND a!=3) - ORDER BY a - } -} {2 4 79 scan 0 sort 0} -do_test where7-2.229.2 { - count_steps { - SELECT a FROM t3 - WHERE a=79 - OR ((a BETWEEN 2 AND 4) AND a!=3) - ORDER BY a - } -} {2 4 79 scan 0 sort 0} -do_test where7-2.230.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=55.0 AND d<56.0 AND d NOT NULL) - OR (f GLOB '?yzab*' AND f GLOB 'xyza*') - OR b=165 - OR b=322 - OR (d>=30.0 AND d<31.0 AND d NOT NULL) - OR b=979 - OR a=42 - OR ((a BETWEEN 89 AND 91) AND a!=90) - ORDER BY a - } -} {15 23 30 42 49 55 75 89 91 scan 0 sort 0} -do_test where7-2.230.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=55.0 AND d<56.0 AND d NOT NULL) - OR (f GLOB '?yzab*' AND f GLOB 'xyza*') - OR b=165 - OR b=322 - OR (d>=30.0 AND d<31.0 AND d NOT NULL) - OR b=979 - OR a=42 - OR ((a BETWEEN 89 AND 91) AND a!=90) - ORDER BY a - } -} {15 23 30 42 49 55 75 89 91 scan 0 sort 0} -do_test where7-2.231.1 { - count_steps { - SELECT a FROM t2 - WHERE b=993 - OR ((a BETWEEN 17 AND 19) AND a!=18) - OR b=300 - OR (d>=84.0 AND d<85.0 AND d NOT NULL) - OR ((a BETWEEN 87 AND 89) AND a!=88) - OR f='uvwxyzabc' - OR b=473 - OR (g='xwvutsr' AND f GLOB 'fghij*') - OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') - ORDER BY a - } -} {5 7 17 19 20 33 43 46 59 72 84 85 87 89 98 scan 0 sort 0} -do_test where7-2.231.2 { - count_steps { - SELECT a FROM t3 - WHERE b=993 - OR ((a BETWEEN 17 AND 19) AND a!=18) - OR b=300 - OR (d>=84.0 AND d<85.0 AND d NOT NULL) - OR ((a BETWEEN 87 AND 89) AND a!=88) - OR f='uvwxyzabc' - OR b=473 - OR (g='xwvutsr' AND f GLOB 'fghij*') - OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') - ORDER BY a - } -} {5 7 17 19 20 33 43 46 59 72 84 85 87 89 98 scan 0 sort 0} -do_test where7-2.232.1 { - count_steps { - SELECT a FROM t2 - WHERE b=619 - OR b=451 - OR b=135 - OR (d>=41.0 AND d<42.0 AND d NOT NULL) - OR (g='vutsrqp' AND f GLOB 'opqrs*') - ORDER BY a - } -} {14 41 scan 0 sort 0} -do_test where7-2.232.2 { - count_steps { - SELECT a FROM t3 - WHERE b=619 - OR b=451 - OR b=135 - OR (d>=41.0 AND d<42.0 AND d NOT NULL) - OR (g='vutsrqp' AND f GLOB 'opqrs*') - ORDER BY a - } -} {14 41 scan 0 sort 0} -do_test where7-2.233.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='xwvutsr' AND f GLOB 'ghijk*') - OR (d>=74.0 AND d<75.0 AND d NOT NULL) - OR a=55 - OR b=319 - OR ((a BETWEEN 77 AND 79) AND a!=78) - OR b=902 - OR (g='jihgfed' AND f GLOB 'zabcd*') - ORDER BY a - } -} {6 29 55 74 77 79 82 scan 0 sort 0} -do_test where7-2.233.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='xwvutsr' AND f GLOB 'ghijk*') - OR (d>=74.0 AND d<75.0 AND d NOT NULL) - OR a=55 - OR b=319 - OR ((a BETWEEN 77 AND 79) AND a!=78) - OR b=902 - OR (g='jihgfed' AND f GLOB 'zabcd*') - ORDER BY a - } -} {6 29 55 74 77 79 82 scan 0 sort 0} -do_test where7-2.234.1 { - count_steps { - SELECT a FROM t2 - WHERE a=99 - OR b=641 - OR ((a BETWEEN 98 AND 100) AND a!=99) - OR (d>=16.0 AND d<17.0 AND d NOT NULL) - OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') - ORDER BY a - } -} {8 16 34 60 86 98 99 100 scan 0 sort 0} -do_test where7-2.234.2 { - count_steps { - SELECT a FROM t3 - WHERE a=99 - OR b=641 - OR ((a BETWEEN 98 AND 100) AND a!=99) - OR (d>=16.0 AND d<17.0 AND d NOT NULL) - OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') - ORDER BY a - } -} {8 16 34 60 86 98 99 100 scan 0 sort 0} -do_test where7-2.235.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=100.0 AND d<101.0 AND d NOT NULL) - OR b=751 - ORDER BY a - } -} {100 scan 0 sort 0} -do_test where7-2.235.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=100.0 AND d<101.0 AND d NOT NULL) - OR b=751 - ORDER BY a - } -} {100 scan 0 sort 0} -do_test where7-2.236.1 { - count_steps { - SELECT a FROM t2 - WHERE b=1034 - OR ((a BETWEEN 92 AND 94) AND a!=93) - OR (g='qponmlk' AND f GLOB 'pqrst*') - OR ((a BETWEEN 97 AND 99) AND a!=98) - ORDER BY a - } -} {41 92 94 97 99 scan 0 sort 0} -do_test where7-2.236.2 { - count_steps { - SELECT a FROM t3 - WHERE b=1034 - OR ((a BETWEEN 92 AND 94) AND a!=93) - OR (g='qponmlk' AND f GLOB 'pqrst*') - OR ((a BETWEEN 97 AND 99) AND a!=98) - ORDER BY a - } -} {41 92 94 97 99 scan 0 sort 0} -do_test where7-2.237.1 { - count_steps { - SELECT a FROM t2 - WHERE b=608 - OR a=87 - OR c=14014 - ORDER BY a - } -} {40 41 42 87 scan 0 sort 0} -do_test where7-2.237.2 { - count_steps { - SELECT a FROM t3 - WHERE b=608 - OR a=87 - OR c=14014 - ORDER BY a - } -} {40 41 42 87 scan 0 sort 0} -do_test where7-2.238.1 { - count_steps { - SELECT a FROM t2 - WHERE b=828 - OR (g='rqponml' AND f GLOB 'hijkl*') - OR a=28 - OR (f GLOB '?cdef*' AND f GLOB 'bcde*') - OR (f GLOB '?ghij*' AND f GLOB 'fghi*') - OR (d>=90.0 AND d<91.0 AND d NOT NULL) - OR b=176 - ORDER BY a - } -} {1 5 16 27 28 31 33 53 57 79 83 90 scan 0 sort 0} -do_test where7-2.238.2 { - count_steps { - SELECT a FROM t3 - WHERE b=828 - OR (g='rqponml' AND f GLOB 'hijkl*') - OR a=28 - OR (f GLOB '?cdef*' AND f GLOB 'bcde*') - OR (f GLOB '?ghij*' AND f GLOB 'fghi*') - OR (d>=90.0 AND d<91.0 AND d NOT NULL) - OR b=176 - ORDER BY a - } -} {1 5 16 27 28 31 33 53 57 79 83 90 scan 0 sort 0} -do_test where7-2.239.1 { - count_steps { - SELECT a FROM t2 - WHERE b=267 - OR ((a BETWEEN 32 AND 34) AND a!=33) - OR (g='fedcbaz' AND f GLOB 'tuvwx*') - OR (d>=95.0 AND d<96.0 AND d NOT NULL) - OR ((a BETWEEN 67 AND 69) AND a!=68) - OR b=968 - OR ((a BETWEEN 42 AND 44) AND a!=43) - OR b=894 - OR ((a BETWEEN 93 AND 95) AND a!=94) - ORDER BY a - } -} {32 34 42 44 67 69 88 93 95 97 scan 0 sort 0} -do_test where7-2.239.2 { - count_steps { - SELECT a FROM t3 - WHERE b=267 - OR ((a BETWEEN 32 AND 34) AND a!=33) - OR (g='fedcbaz' AND f GLOB 'tuvwx*') - OR (d>=95.0 AND d<96.0 AND d NOT NULL) - OR ((a BETWEEN 67 AND 69) AND a!=68) - OR b=968 - OR ((a BETWEEN 42 AND 44) AND a!=43) - OR b=894 - OR ((a BETWEEN 93 AND 95) AND a!=94) - ORDER BY a - } -} {32 34 42 44 67 69 88 93 95 97 scan 0 sort 0} -do_test where7-2.240.1 { - count_steps { - SELECT a FROM t2 - WHERE b=597 - OR b=553 - OR b=740 - ORDER BY a - } -} {scan 0 sort 1} -do_test where7-2.240.2 { - count_steps { - SELECT a FROM t3 - WHERE b=597 - OR b=553 - OR b=740 - ORDER BY a - } -} {scan 0 sort 1} -do_test where7-2.241.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 55 AND 57) AND a!=56) - OR (g='kjihgfe' AND f GLOB 'rstuv*') - OR b=1059 - ORDER BY a - } -} {55 57 69 scan 0 sort 0} -do_test where7-2.241.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 55 AND 57) AND a!=56) - OR (g='kjihgfe' AND f GLOB 'rstuv*') - OR b=1059 - ORDER BY a - } -} {55 57 69 scan 0 sort 0} -do_test where7-2.242.1 { - count_steps { - SELECT a FROM t2 - WHERE b=762 - OR a=66 - OR b=190 - OR ((a BETWEEN 87 AND 89) AND a!=88) - ORDER BY a - } -} {66 87 89 scan 0 sort 0} -do_test where7-2.242.2 { - count_steps { - SELECT a FROM t3 - WHERE b=762 - OR a=66 - OR b=190 - OR ((a BETWEEN 87 AND 89) AND a!=88) - ORDER BY a - } -} {66 87 89 scan 0 sort 0} -do_test where7-2.243.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='jihgfed' AND f GLOB 'wxyza*') - OR (d>=87.0 AND d<88.0 AND d NOT NULL) - OR (d>=82.0 AND d<83.0 AND d NOT NULL) - ORDER BY a - } -} {74 82 87 scan 0 sort 0} -do_test where7-2.243.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='jihgfed' AND f GLOB 'wxyza*') - OR (d>=87.0 AND d<88.0 AND d NOT NULL) - OR (d>=82.0 AND d<83.0 AND d NOT NULL) - ORDER BY a - } -} {74 82 87 scan 0 sort 0} -do_test where7-2.244.1 { - count_steps { - SELECT a FROM t2 - WHERE b=729 - OR b=825 - OR ((a BETWEEN 37 AND 39) AND a!=38) - OR (d>=100.0 AND d<101.0 AND d NOT NULL) - OR b=399 - ORDER BY a - } -} {37 39 75 100 scan 0 sort 0} -do_test where7-2.244.2 { - count_steps { - SELECT a FROM t3 - WHERE b=729 - OR b=825 - OR ((a BETWEEN 37 AND 39) AND a!=38) - OR (d>=100.0 AND d<101.0 AND d NOT NULL) - OR b=399 - ORDER BY a - } -} {37 39 75 100 scan 0 sort 0} -do_test where7-2.245.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 63 AND 65) AND a!=64) - OR (d>=92.0 AND d<93.0 AND d NOT NULL) - OR c<=10 - OR b=891 - OR b<0 - OR a=69 - OR b=476 - OR a=1 - OR a=86 - ORDER BY a - } -} {1 63 65 69 81 86 92 scan 0 sort 0} -do_test where7-2.245.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 63 AND 65) AND a!=64) - OR (d>=92.0 AND d<93.0 AND d NOT NULL) - OR c<=10 - OR b=891 - OR b<0 - OR a=69 - OR b=476 - OR a=1 - OR a=86 - ORDER BY a - } -} {1 63 65 69 81 86 92 scan 0 sort 0} -do_test where7-2.246.1 { - count_steps { - SELECT a FROM t2 - WHERE a=97 - OR a=44 - OR (f GLOB '?zabc*' AND f GLOB 'yzab*') - ORDER BY a - } -} {24 44 50 76 97 scan 0 sort 0} -do_test where7-2.246.2 { - count_steps { - SELECT a FROM t3 - WHERE a=97 - OR a=44 - OR (f GLOB '?zabc*' AND f GLOB 'yzab*') - ORDER BY a - } -} {24 44 50 76 97 scan 0 sort 0} -do_test where7-2.247.1 { - count_steps { - SELECT a FROM t2 - WHERE b=839 - OR (d>=22.0 AND d<23.0 AND d NOT NULL) - OR (g='tsrqpon' AND f GLOB 'abcde*') - OR (g='kjihgfe' AND f GLOB 'tuvwx*') - OR a=19 - OR b=938 - OR ((a BETWEEN 56 AND 58) AND a!=57) - OR b=1056 - OR ((a BETWEEN 22 AND 24) AND a!=23) - OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') - OR a=54 - ORDER BY a - } -} {7 19 22 24 26 33 54 56 58 59 71 85 96 scan 0 sort 0} -do_test where7-2.247.2 { - count_steps { - SELECT a FROM t3 - WHERE b=839 - OR (d>=22.0 AND d<23.0 AND d NOT NULL) - OR (g='tsrqpon' AND f GLOB 'abcde*') - OR (g='kjihgfe' AND f GLOB 'tuvwx*') - OR a=19 - OR b=938 - OR ((a BETWEEN 56 AND 58) AND a!=57) - OR b=1056 - OR ((a BETWEEN 22 AND 24) AND a!=23) - OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') - OR a=54 - ORDER BY a - } -} {7 19 22 24 26 33 54 56 58 59 71 85 96 scan 0 sort 0} -do_test where7-2.248.1 { - count_steps { - SELECT a FROM t2 - WHERE b=132 - OR a=11 - OR b=198 - OR (g='jihgfed' AND f GLOB 'wxyza*') - OR (g='ponmlkj' AND f GLOB 'stuvw*') - ORDER BY a - } -} {11 12 18 44 74 scan 0 sort 0} -do_test where7-2.248.2 { - count_steps { - SELECT a FROM t3 - WHERE b=132 - OR a=11 - OR b=198 - OR (g='jihgfed' AND f GLOB 'wxyza*') - OR (g='ponmlkj' AND f GLOB 'stuvw*') - ORDER BY a - } -} {11 12 18 44 74 scan 0 sort 0} -do_test where7-2.249.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='xwvutsr' AND f GLOB 'ghijk*') - OR (g='ponmlkj' AND f GLOB 'vwxyz*') - OR a=17 - ORDER BY a - } -} {6 17 47 scan 0 sort 0} -do_test where7-2.249.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='xwvutsr' AND f GLOB 'ghijk*') - OR (g='ponmlkj' AND f GLOB 'vwxyz*') - OR a=17 - ORDER BY a - } -} {6 17 47 scan 0 sort 0} -do_test where7-2.250.1 { - count_steps { - SELECT a FROM t2 - WHERE c=26026 - OR a=93 - OR (d>=18.0 AND d<19.0 AND d NOT NULL) - OR (g='fedcbaz' AND f GLOB 'tuvwx*') - OR b=22 - OR b=1081 - OR (d>=87.0 AND d<88.0 AND d NOT NULL) - OR b=770 - OR a=46 - ORDER BY a - } -} {2 18 46 70 76 77 78 87 93 97 scan 0 sort 0} -do_test where7-2.250.2 { - count_steps { - SELECT a FROM t3 - WHERE c=26026 - OR a=93 - OR (d>=18.0 AND d<19.0 AND d NOT NULL) - OR (g='fedcbaz' AND f GLOB 'tuvwx*') - OR b=22 - OR b=1081 - OR (d>=87.0 AND d<88.0 AND d NOT NULL) - OR b=770 - OR a=46 - ORDER BY a - } -} {2 18 46 70 76 77 78 87 93 97 scan 0 sort 0} -do_test where7-2.251.1 { - count_steps { - SELECT a FROM t2 - WHERE b=399 - OR (g='utsrqpo' AND f GLOB 'wxyza*') - OR ((a BETWEEN 38 AND 40) AND a!=39) - OR b=1092 - OR (g='utsrqpo' AND f GLOB 'stuvw*') - OR b=795 - OR b=1056 - ORDER BY a - } -} {18 22 38 40 96 scan 0 sort 0} -do_test where7-2.251.2 { - count_steps { - SELECT a FROM t3 - WHERE b=399 - OR (g='utsrqpo' AND f GLOB 'wxyza*') - OR ((a BETWEEN 38 AND 40) AND a!=39) - OR b=1092 - OR (g='utsrqpo' AND f GLOB 'stuvw*') - OR b=795 - OR b=1056 - ORDER BY a - } -} {18 22 38 40 96 scan 0 sort 0} -do_test where7-2.252.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 24 AND 26) AND a!=25) - OR b=1045 - OR (g='srqponm' AND f GLOB 'defgh*') - OR b=883 - OR b=594 - OR (d>=54.0 AND d<55.0 AND d NOT NULL) - OR (f GLOB '?mnop*' AND f GLOB 'lmno*') - OR (d>=1.0 AND d<2.0 AND d NOT NULL) - OR b=990 - ORDER BY a - } -} {1 11 24 26 29 37 54 63 89 90 95 scan 0 sort 0} -do_test where7-2.252.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 24 AND 26) AND a!=25) - OR b=1045 - OR (g='srqponm' AND f GLOB 'defgh*') - OR b=883 - OR b=594 - OR (d>=54.0 AND d<55.0 AND d NOT NULL) - OR (f GLOB '?mnop*' AND f GLOB 'lmno*') - OR (d>=1.0 AND d<2.0 AND d NOT NULL) - OR b=990 - ORDER BY a - } -} {1 11 24 26 29 37 54 63 89 90 95 scan 0 sort 0} -do_test where7-2.253.1 { - count_steps { - SELECT a FROM t2 - WHERE a=21 - OR ((a BETWEEN 69 AND 71) AND a!=70) - OR (g='yxwvuts' AND f GLOB 'cdefg*') - OR b=124 - ORDER BY a - } -} {2 21 69 71 scan 0 sort 0} -do_test where7-2.253.2 { - count_steps { - SELECT a FROM t3 - WHERE a=21 - OR ((a BETWEEN 69 AND 71) AND a!=70) - OR (g='yxwvuts' AND f GLOB 'cdefg*') - OR b=124 - ORDER BY a - } -} {2 21 69 71 scan 0 sort 0} -do_test where7-2.254.1 { - count_steps { - SELECT a FROM t2 - WHERE a=5 - OR c=33033 - OR (g='ihgfedc' AND f GLOB 'abcde*') - OR ((a BETWEEN 56 AND 58) AND a!=57) - OR b=11 - OR ((a BETWEEN 24 AND 26) AND a!=25) - OR (g='jihgfed' AND f GLOB 'vwxyz*') - OR b=212 - OR (d>=4.0 AND d<5.0 AND d NOT NULL) - OR b=14 - OR c=18018 - ORDER BY a - } -} {1 4 5 24 26 52 53 54 56 58 73 78 97 98 99 scan 0 sort 0} -do_test where7-2.254.2 { - count_steps { - SELECT a FROM t3 - WHERE a=5 - OR c=33033 - OR (g='ihgfedc' AND f GLOB 'abcde*') - OR ((a BETWEEN 56 AND 58) AND a!=57) - OR b=11 - OR ((a BETWEEN 24 AND 26) AND a!=25) - OR (g='jihgfed' AND f GLOB 'vwxyz*') - OR b=212 - OR (d>=4.0 AND d<5.0 AND d NOT NULL) - OR b=14 - OR c=18018 - ORDER BY a - } -} {1 4 5 24 26 52 53 54 56 58 73 78 97 98 99 scan 0 sort 0} -do_test where7-2.255.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 91 AND 93) AND a!=92) - OR b=66 - OR ((a BETWEEN 29 AND 31) AND a!=30) - OR (g='wvutsrq' AND f GLOB 'jklmn*') - ORDER BY a - } -} {6 9 29 31 91 93 scan 0 sort 0} -do_test where7-2.255.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 91 AND 93) AND a!=92) - OR b=66 - OR ((a BETWEEN 29 AND 31) AND a!=30) - OR (g='wvutsrq' AND f GLOB 'jklmn*') - ORDER BY a - } -} {6 9 29 31 91 93 scan 0 sort 0} -do_test where7-2.256.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 34 AND 36) AND a!=35) - OR a=18 - OR b=157 - OR b=509 - OR b=451 - OR ((a BETWEEN 4 AND 6) AND a!=5) - OR a=35 - OR a=53 - OR (d>=31.0 AND d<32.0 AND d NOT NULL) - ORDER BY a - } -} {4 6 18 31 34 35 36 41 53 scan 0 sort 0} -do_test where7-2.256.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 34 AND 36) AND a!=35) - OR a=18 - OR b=157 - OR b=509 - OR b=451 - OR ((a BETWEEN 4 AND 6) AND a!=5) - OR a=35 - OR a=53 - OR (d>=31.0 AND d<32.0 AND d NOT NULL) - ORDER BY a - } -} {4 6 18 31 34 35 36 41 53 scan 0 sort 0} -do_test where7-2.257.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=56.0 AND d<57.0 AND d NOT NULL) - OR (d>=37.0 AND d<38.0 AND d NOT NULL) - OR b=517 - OR (d>=15.0 AND d<16.0 AND d NOT NULL) - OR f='efghijklm' - OR b=165 - OR (g='edcbazy' AND f GLOB 'uvwxy*') - OR f='rstuvwxyz' - OR ((a BETWEEN 86 AND 88) AND a!=87) - ORDER BY a - } -} {4 15 17 30 37 43 47 56 69 82 86 88 95 98 scan 0 sort 0} -do_test where7-2.257.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=56.0 AND d<57.0 AND d NOT NULL) - OR (d>=37.0 AND d<38.0 AND d NOT NULL) - OR b=517 - OR (d>=15.0 AND d<16.0 AND d NOT NULL) - OR f='efghijklm' - OR b=165 - OR (g='edcbazy' AND f GLOB 'uvwxy*') - OR f='rstuvwxyz' - OR ((a BETWEEN 86 AND 88) AND a!=87) - ORDER BY a - } -} {4 15 17 30 37 43 47 56 69 82 86 88 95 98 scan 0 sort 0} -do_test where7-2.258.1 { - count_steps { - SELECT a FROM t2 - WHERE a=22 - OR b=850 - ORDER BY a - } -} {22 scan 0 sort 0} -do_test where7-2.258.2 { - count_steps { - SELECT a FROM t3 - WHERE a=22 - OR b=850 - ORDER BY a - } -} {22 scan 0 sort 0} -do_test where7-2.259.1 { - count_steps { - SELECT a FROM t2 - WHERE b=366 - OR a=89 - OR f='pqrstuvwx' - OR b=220 - ORDER BY a - } -} {15 20 41 67 89 93 scan 0 sort 0} -do_test where7-2.259.2 { - count_steps { - SELECT a FROM t3 - WHERE b=366 - OR a=89 - OR f='pqrstuvwx' - OR b=220 - ORDER BY a - } -} {15 20 41 67 89 93 scan 0 sort 0} -do_test where7-2.260.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='rqponml' AND f GLOB 'jklmn*') - OR (g='fedcbaz' AND f GLOB 'tuvwx*') - OR (g='wvutsrq' AND f GLOB 'mnopq*') - ORDER BY a - } -} {12 35 97 scan 0 sort 0} -do_test where7-2.260.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='rqponml' AND f GLOB 'jklmn*') - OR (g='fedcbaz' AND f GLOB 'tuvwx*') - OR (g='wvutsrq' AND f GLOB 'mnopq*') - ORDER BY a - } -} {12 35 97 scan 0 sort 0} -do_test where7-2.261.1 { - count_steps { - SELECT a FROM t2 - WHERE b=781 - OR b=762 - OR f='efghijklm' - ORDER BY a - } -} {4 30 56 71 82 scan 0 sort 0} -do_test where7-2.261.2 { - count_steps { - SELECT a FROM t3 - WHERE b=781 - OR b=762 - OR f='efghijklm' - ORDER BY a - } -} {4 30 56 71 82 scan 0 sort 0} -do_test where7-2.262.1 { - count_steps { - SELECT a FROM t2 - WHERE a=33 - OR (g='jihgfed' AND f GLOB 'yzabc*') - OR (d>=5.0 AND d<6.0 AND d NOT NULL) - OR b=916 - OR a=97 - OR (f GLOB '?vwxy*' AND f GLOB 'uvwx*') - OR a=56 - OR ((a BETWEEN 82 AND 84) AND a!=83) - OR (d>=34.0 AND d<35.0 AND d NOT NULL) - ORDER BY a - } -} {5 20 33 34 46 56 72 76 82 84 97 98 scan 0 sort 0} -do_test where7-2.262.2 { - count_steps { - SELECT a FROM t3 - WHERE a=33 - OR (g='jihgfed' AND f GLOB 'yzabc*') - OR (d>=5.0 AND d<6.0 AND d NOT NULL) - OR b=916 - OR a=97 - OR (f GLOB '?vwxy*' AND f GLOB 'uvwx*') - OR a=56 - OR ((a BETWEEN 82 AND 84) AND a!=83) - OR (d>=34.0 AND d<35.0 AND d NOT NULL) - ORDER BY a - } -} {5 20 33 34 46 56 72 76 82 84 97 98 scan 0 sort 0} -do_test where7-2.263.1 { - count_steps { - SELECT a FROM t2 - WHERE f IS NULL - OR b=14 - OR b=1001 - OR b=1048 - OR b=443 - OR (d>=29.0 AND d<30.0 AND d NOT NULL) - OR (d>=71.0 AND d<72.0 AND d NOT NULL) - OR c=3003 - OR b=267 - ORDER BY a - } -} {7 8 9 29 71 91 scan 0 sort 0} -do_test where7-2.263.2 { - count_steps { - SELECT a FROM t3 - WHERE f IS NULL - OR b=14 - OR b=1001 - OR b=1048 - OR b=443 - OR (d>=29.0 AND d<30.0 AND d NOT NULL) - OR (d>=71.0 AND d<72.0 AND d NOT NULL) - OR c=3003 - OR b=267 - ORDER BY a - } -} {7 8 9 29 71 91 scan 0 sort 0} -do_test where7-2.264.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=9.0 AND d<10.0 AND d NOT NULL) - OR (d>=70.0 AND d<71.0 AND d NOT NULL) - OR b=176 - OR f='tuvwxyzab' - OR (g='jihgfed' AND f GLOB 'wxyza*') - OR a=33 - OR (d>=16.0 AND d<17.0 AND d NOT NULL) - OR ((a BETWEEN 27 AND 29) AND a!=28) - ORDER BY a - } -} {9 16 19 27 29 33 45 70 71 74 97 scan 0 sort 0} -do_test where7-2.264.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=9.0 AND d<10.0 AND d NOT NULL) - OR (d>=70.0 AND d<71.0 AND d NOT NULL) - OR b=176 - OR f='tuvwxyzab' - OR (g='jihgfed' AND f GLOB 'wxyza*') - OR a=33 - OR (d>=16.0 AND d<17.0 AND d NOT NULL) - OR ((a BETWEEN 27 AND 29) AND a!=28) - ORDER BY a - } -} {9 16 19 27 29 33 45 70 71 74 97 scan 0 sort 0} -do_test where7-2.265.1 { - count_steps { - SELECT a FROM t2 - WHERE d>1e10 - OR c<=10 - ORDER BY a - } -} {scan 0 sort 0} -do_test where7-2.265.2 { - count_steps { - SELECT a FROM t3 - WHERE d>1e10 - OR c<=10 - ORDER BY a - } -} {scan 0 sort 0} -do_test where7-2.266.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=79.0 AND d<80.0 AND d NOT NULL) - OR b=883 - OR b=487 - OR b=693 - OR ((a BETWEEN 75 AND 77) AND a!=76) - OR (d>=18.0 AND d<19.0 AND d NOT NULL) - OR (g='edcbazy' AND f GLOB 'wxyza*') - OR b=1078 - OR ((a BETWEEN 88 AND 90) AND a!=89) - OR a=50 - OR b=476 - ORDER BY a - } -} {18 50 63 75 77 79 88 90 98 100 scan 0 sort 0} -do_test where7-2.266.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=79.0 AND d<80.0 AND d NOT NULL) - OR b=883 - OR b=487 - OR b=693 - OR ((a BETWEEN 75 AND 77) AND a!=76) - OR (d>=18.0 AND d<19.0 AND d NOT NULL) - OR (g='edcbazy' AND f GLOB 'wxyza*') - OR b=1078 - OR ((a BETWEEN 88 AND 90) AND a!=89) - OR a=50 - OR b=476 - ORDER BY a - } -} {18 50 63 75 77 79 88 90 98 100 scan 0 sort 0} -do_test where7-2.267.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=48.0 AND d<49.0 AND d NOT NULL) - OR (g='wvutsrq' AND f GLOB 'mnopq*') - ORDER BY a - } -} {12 48 scan 0 sort 0} -do_test where7-2.267.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=48.0 AND d<49.0 AND d NOT NULL) - OR (g='wvutsrq' AND f GLOB 'mnopq*') - ORDER BY a - } -} {12 48 scan 0 sort 0} -do_test where7-2.268.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='onmlkji' AND f GLOB 'abcde*') - OR ((a BETWEEN 6 AND 8) AND a!=7) - OR (d>=93.0 AND d<94.0 AND d NOT NULL) - OR ((a BETWEEN 66 AND 68) AND a!=67) - OR a=33 - OR a=48 - OR b=55 - OR (f GLOB '?cdef*' AND f GLOB 'bcde*') - OR b=344 - ORDER BY a - } -} {1 5 6 8 27 33 48 52 53 66 68 79 93 scan 0 sort 0} -do_test where7-2.268.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='onmlkji' AND f GLOB 'abcde*') - OR ((a BETWEEN 6 AND 8) AND a!=7) - OR (d>=93.0 AND d<94.0 AND d NOT NULL) - OR ((a BETWEEN 66 AND 68) AND a!=67) - OR a=33 - OR a=48 - OR b=55 - OR (f GLOB '?cdef*' AND f GLOB 'bcde*') - OR b=344 - ORDER BY a - } -} {1 5 6 8 27 33 48 52 53 66 68 79 93 scan 0 sort 0} -do_test where7-2.269.1 { - count_steps { - SELECT a FROM t2 - WHERE b=410 - OR b=737 - OR (d>=51.0 AND d<52.0 AND d NOT NULL) - OR a=27 - OR ((a BETWEEN 85 AND 87) AND a!=86) - OR ((a BETWEEN 47 AND 49) AND a!=48) - OR (g='ponmlkj' AND f GLOB 'tuvwx*') - OR (d>=70.0 AND d<71.0 AND d NOT NULL) - ORDER BY a - } -} {27 45 47 49 51 67 70 85 87 scan 0 sort 0} -do_test where7-2.269.2 { - count_steps { - SELECT a FROM t3 - WHERE b=410 - OR b=737 - OR (d>=51.0 AND d<52.0 AND d NOT NULL) - OR a=27 - OR ((a BETWEEN 85 AND 87) AND a!=86) - OR ((a BETWEEN 47 AND 49) AND a!=48) - OR (g='ponmlkj' AND f GLOB 'tuvwx*') - OR (d>=70.0 AND d<71.0 AND d NOT NULL) - ORDER BY a - } -} {27 45 47 49 51 67 70 85 87 scan 0 sort 0} -do_test where7-2.270.1 { - count_steps { - SELECT a FROM t2 - WHERE b=135 - OR ((a BETWEEN 49 AND 51) AND a!=50) - OR (g='onmlkji' AND f GLOB 'zabcd*') - OR f='defghijkl' - OR ((a BETWEEN 12 AND 14) AND a!=13) - OR a=37 - OR ((a BETWEEN 95 AND 97) AND a!=96) - OR (d>=38.0 AND d<39.0 AND d NOT NULL) - OR b=509 - ORDER BY a - } -} {3 12 14 29 37 38 49 51 55 81 95 97 scan 0 sort 0} -do_test where7-2.270.2 { - count_steps { - SELECT a FROM t3 - WHERE b=135 - OR ((a BETWEEN 49 AND 51) AND a!=50) - OR (g='onmlkji' AND f GLOB 'zabcd*') - OR f='defghijkl' - OR ((a BETWEEN 12 AND 14) AND a!=13) - OR a=37 - OR ((a BETWEEN 95 AND 97) AND a!=96) - OR (d>=38.0 AND d<39.0 AND d NOT NULL) - OR b=509 - ORDER BY a - } -} {3 12 14 29 37 38 49 51 55 81 95 97 scan 0 sort 0} -do_test where7-2.271.1 { - count_steps { - SELECT a FROM t2 - WHERE a=73 - OR (d>=98.0 AND d<99.0 AND d NOT NULL) - OR c=15015 - OR (g='fedcbaz' AND f GLOB 'tuvwx*') - OR ((a BETWEEN 69 AND 71) AND a!=70) - OR ((a BETWEEN 63 AND 65) AND a!=64) - OR b=267 - OR b=1081 - OR a=71 - ORDER BY a - } -} {43 44 45 63 65 69 71 73 97 98 scan 0 sort 0} -do_test where7-2.271.2 { - count_steps { - SELECT a FROM t3 - WHERE a=73 - OR (d>=98.0 AND d<99.0 AND d NOT NULL) - OR c=15015 - OR (g='fedcbaz' AND f GLOB 'tuvwx*') - OR ((a BETWEEN 69 AND 71) AND a!=70) - OR ((a BETWEEN 63 AND 65) AND a!=64) - OR b=267 - OR b=1081 - OR a=71 - ORDER BY a - } -} {43 44 45 63 65 69 71 73 97 98 scan 0 sort 0} -do_test where7-2.272.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 24 AND 26) AND a!=25) - OR (d>=51.0 AND d<52.0 AND d NOT NULL) - OR b=121 - OR ((a BETWEEN 68 AND 70) AND a!=69) - OR a=32 - OR b=91 - OR (d>=68.0 AND d<69.0 AND d NOT NULL) - OR a=8 - OR a=24 - OR a=2 - ORDER BY a - } -} {2 8 11 24 26 32 51 68 70 scan 0 sort 0} -do_test where7-2.272.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 24 AND 26) AND a!=25) - OR (d>=51.0 AND d<52.0 AND d NOT NULL) - OR b=121 - OR ((a BETWEEN 68 AND 70) AND a!=69) - OR a=32 - OR b=91 - OR (d>=68.0 AND d<69.0 AND d NOT NULL) - OR a=8 - OR a=24 - OR a=2 - ORDER BY a - } -} {2 8 11 24 26 32 51 68 70 scan 0 sort 0} -do_test where7-2.273.1 { - count_steps { - SELECT a FROM t2 - WHERE b=330 - OR a=2 - OR (d>=4.0 AND d<5.0 AND d NOT NULL) - ORDER BY a - } -} {2 4 30 scan 0 sort 0} -do_test where7-2.273.2 { - count_steps { - SELECT a FROM t3 - WHERE b=330 - OR a=2 - OR (d>=4.0 AND d<5.0 AND d NOT NULL) - ORDER BY a - } -} {2 4 30 scan 0 sort 0} -do_test where7-2.274.1 { - count_steps { - SELECT a FROM t2 - WHERE (f GLOB '?yzab*' AND f GLOB 'xyza*') - OR ((a BETWEEN 32 AND 34) AND a!=33) - OR ((a BETWEEN 77 AND 79) AND a!=78) - OR c=5005 - OR (g='ponmlkj' AND f GLOB 'vwxyz*') - ORDER BY a - } -} {13 14 15 23 32 34 47 49 75 77 79 scan 0 sort 0} -do_test where7-2.274.2 { - count_steps { - SELECT a FROM t3 - WHERE (f GLOB '?yzab*' AND f GLOB 'xyza*') - OR ((a BETWEEN 32 AND 34) AND a!=33) - OR ((a BETWEEN 77 AND 79) AND a!=78) - OR c=5005 - OR (g='ponmlkj' AND f GLOB 'vwxyz*') - ORDER BY a - } -} {13 14 15 23 32 34 47 49 75 77 79 scan 0 sort 0} -do_test where7-2.275.1 { - count_steps { - SELECT a FROM t2 - WHERE b=773 - OR 1000000=48.0 AND d<49.0 AND d NOT NULL) - OR b=509 - ORDER BY a - } -} {13 39 48 65 67 91 98 scan 0 sort 0} -do_test where7-2.275.2 { - count_steps { - SELECT a FROM t3 - WHERE b=773 - OR 1000000=48.0 AND d<49.0 AND d NOT NULL) - OR b=509 - ORDER BY a - } -} {13 39 48 65 67 91 98 scan 0 sort 0} -do_test where7-2.276.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 48 AND 50) AND a!=49) - OR f='stuvwxyza' - OR c=34034 - OR b=806 - OR b=264 - OR ((a BETWEEN 62 AND 64) AND a!=63) - ORDER BY a - } -} {18 24 44 48 50 62 64 70 96 100 scan 0 sort 0} -do_test where7-2.276.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 48 AND 50) AND a!=49) - OR f='stuvwxyza' - OR c=34034 - OR b=806 - OR b=264 - OR ((a BETWEEN 62 AND 64) AND a!=63) - ORDER BY a - } -} {18 24 44 48 50 62 64 70 96 100 scan 0 sort 0} -do_test where7-2.277.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=75.0 AND d<76.0 AND d NOT NULL) - OR a=94 - OR (d>=41.0 AND d<42.0 AND d NOT NULL) - OR c=16016 - OR b=352 - OR b=410 - OR b=1100 - OR (d>=62.0 AND d<63.0 AND d NOT NULL) - OR (g='gfedcba' AND f GLOB 'nopqr*') - ORDER BY a - } -} {32 41 46 47 48 62 75 91 94 100 scan 0 sort 0} -do_test where7-2.277.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=75.0 AND d<76.0 AND d NOT NULL) - OR a=94 - OR (d>=41.0 AND d<42.0 AND d NOT NULL) - OR c=16016 - OR b=352 - OR b=410 - OR b=1100 - OR (d>=62.0 AND d<63.0 AND d NOT NULL) - OR (g='gfedcba' AND f GLOB 'nopqr*') - ORDER BY a - } -} {32 41 46 47 48 62 75 91 94 100 scan 0 sort 0} -do_test where7-2.278.1 { - count_steps { - SELECT a FROM t2 - WHERE a=98 - OR ((a BETWEEN 41 AND 43) AND a!=42) - OR (d>=20.0 AND d<21.0 AND d NOT NULL) - OR ((a BETWEEN 22 AND 24) AND a!=23) - ORDER BY a - } -} {20 22 24 41 43 98 scan 0 sort 0} -do_test where7-2.278.2 { - count_steps { - SELECT a FROM t3 - WHERE a=98 - OR ((a BETWEEN 41 AND 43) AND a!=42) - OR (d>=20.0 AND d<21.0 AND d NOT NULL) - OR ((a BETWEEN 22 AND 24) AND a!=23) - ORDER BY a - } -} {20 22 24 41 43 98 scan 0 sort 0} -do_test where7-2.279.1 { - count_steps { - SELECT a FROM t2 - WHERE a=55 - OR (d>=6.0 AND d<7.0 AND d NOT NULL) - OR ((a BETWEEN 97 AND 99) AND a!=98) - OR a=80 - OR b=462 - OR f='defghijkl' - OR b=990 - OR b=938 - OR b=726 - ORDER BY a - } -} {3 6 29 42 55 66 80 81 90 97 99 scan 0 sort 0} -do_test where7-2.279.2 { - count_steps { - SELECT a FROM t3 - WHERE a=55 - OR (d>=6.0 AND d<7.0 AND d NOT NULL) - OR ((a BETWEEN 97 AND 99) AND a!=98) - OR a=80 - OR b=462 - OR f='defghijkl' - OR b=990 - OR b=938 - OR b=726 - ORDER BY a - } -} {3 6 29 42 55 66 80 81 90 97 99 scan 0 sort 0} -do_test where7-2.280.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='mlkjihg' AND f GLOB 'jklmn*') - OR (d>=94.0 AND d<95.0 AND d NOT NULL) - OR b=605 - OR (d>=31.0 AND d<32.0 AND d NOT NULL) - OR c=25025 - OR c=7007 - OR a=41 - ORDER BY a - } -} {19 20 21 31 41 55 61 73 74 75 94 scan 0 sort 0} -do_test where7-2.280.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='mlkjihg' AND f GLOB 'jklmn*') - OR (d>=94.0 AND d<95.0 AND d NOT NULL) - OR b=605 - OR (d>=31.0 AND d<32.0 AND d NOT NULL) - OR c=25025 - OR c=7007 - OR a=41 - ORDER BY a - } -} {19 20 21 31 41 55 61 73 74 75 94 scan 0 sort 0} -do_test where7-2.281.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 49 AND 51) AND a!=50) - OR (g='utsrqpo' AND f GLOB 'uvwxy*') - OR b=1089 - OR ((a BETWEEN 11 AND 13) AND a!=12) - OR ((a BETWEEN 24 AND 26) AND a!=25) - OR (d>=75.0 AND d<76.0 AND d NOT NULL) - OR (d>=37.0 AND d<38.0 AND d NOT NULL) - OR (g='mlkjihg' AND f GLOB 'ijklm*') - OR c=8008 - ORDER BY a - } -} {11 13 20 22 23 24 26 37 49 51 60 75 99 scan 0 sort 0} -do_test where7-2.281.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 49 AND 51) AND a!=50) - OR (g='utsrqpo' AND f GLOB 'uvwxy*') - OR b=1089 - OR ((a BETWEEN 11 AND 13) AND a!=12) - OR ((a BETWEEN 24 AND 26) AND a!=25) - OR (d>=75.0 AND d<76.0 AND d NOT NULL) - OR (d>=37.0 AND d<38.0 AND d NOT NULL) - OR (g='mlkjihg' AND f GLOB 'ijklm*') - OR c=8008 - ORDER BY a - } -} {11 13 20 22 23 24 26 37 49 51 60 75 99 scan 0 sort 0} -do_test where7-2.282.1 { - count_steps { - SELECT a FROM t2 - WHERE a=38 - OR (g='srqponm' AND f GLOB 'defgh*') - OR a=32 - OR b=979 - OR ((a BETWEEN 84 AND 86) AND a!=85) - OR a=96 - OR b=253 - ORDER BY a - } -} {23 29 32 38 84 86 89 96 scan 0 sort 0} -do_test where7-2.282.2 { - count_steps { - SELECT a FROM t3 - WHERE a=38 - OR (g='srqponm' AND f GLOB 'defgh*') - OR a=32 - OR b=979 - OR ((a BETWEEN 84 AND 86) AND a!=85) - OR a=96 - OR b=253 - ORDER BY a - } -} {23 29 32 38 84 86 89 96 scan 0 sort 0} -do_test where7-2.283.1 { - count_steps { - SELECT a FROM t2 - WHERE b=421 - OR ((a BETWEEN 47 AND 49) AND a!=48) - OR (d>=43.0 AND d<44.0 AND d NOT NULL) - ORDER BY a - } -} {43 47 49 scan 0 sort 0} -do_test where7-2.283.2 { - count_steps { - SELECT a FROM t3 - WHERE b=421 - OR ((a BETWEEN 47 AND 49) AND a!=48) - OR (d>=43.0 AND d<44.0 AND d NOT NULL) - ORDER BY a - } -} {43 47 49 scan 0 sort 0} -do_test where7-2.284.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=14.0 AND d<15.0 AND d NOT NULL) - OR c=8008 - OR ((a BETWEEN 88 AND 90) AND a!=89) - OR ((a BETWEEN 17 AND 19) AND a!=18) - OR (d>=91.0 AND d<92.0 AND d NOT NULL) - OR a=71 - OR (d>=82.0 AND d<83.0 AND d NOT NULL) - OR a=75 - OR (d>=88.0 AND d<89.0 AND d NOT NULL) - OR (g='ihgfedc' AND f GLOB 'bcdef*') - ORDER BY a - } -} {14 17 19 22 23 24 71 75 79 82 88 90 91 scan 0 sort 0} -do_test where7-2.284.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=14.0 AND d<15.0 AND d NOT NULL) - OR c=8008 - OR ((a BETWEEN 88 AND 90) AND a!=89) - OR ((a BETWEEN 17 AND 19) AND a!=18) - OR (d>=91.0 AND d<92.0 AND d NOT NULL) - OR a=71 - OR (d>=82.0 AND d<83.0 AND d NOT NULL) - OR a=75 - OR (d>=88.0 AND d<89.0 AND d NOT NULL) - OR (g='ihgfedc' AND f GLOB 'bcdef*') - ORDER BY a - } -} {14 17 19 22 23 24 71 75 79 82 88 90 91 scan 0 sort 0} -do_test where7-2.285.1 { - count_steps { - SELECT a FROM t2 - WHERE a=23 - OR (d>=89.0 AND d<90.0 AND d NOT NULL) - OR (d>=93.0 AND d<94.0 AND d NOT NULL) - OR (g='jihgfed' AND f GLOB 'wxyza*') - ORDER BY a - } -} {23 74 89 93 scan 0 sort 0} -do_test where7-2.285.2 { - count_steps { - SELECT a FROM t3 - WHERE a=23 - OR (d>=89.0 AND d<90.0 AND d NOT NULL) - OR (d>=93.0 AND d<94.0 AND d NOT NULL) - OR (g='jihgfed' AND f GLOB 'wxyza*') - ORDER BY a - } -} {23 74 89 93 scan 0 sort 0} -do_test where7-2.286.1 { - count_steps { - SELECT a FROM t2 - WHERE b=828 - OR (d>=73.0 AND d<74.0 AND d NOT NULL) - OR ((a BETWEEN 9 AND 11) AND a!=10) - OR b=190 - OR ((a BETWEEN 52 AND 54) AND a!=53) - OR b=421 - OR b=1012 - ORDER BY a - } -} {9 11 52 54 73 92 scan 0 sort 0} -do_test where7-2.286.2 { - count_steps { - SELECT a FROM t3 - WHERE b=828 - OR (d>=73.0 AND d<74.0 AND d NOT NULL) - OR ((a BETWEEN 9 AND 11) AND a!=10) - OR b=190 - OR ((a BETWEEN 52 AND 54) AND a!=53) - OR b=421 - OR b=1012 - ORDER BY a - } -} {9 11 52 54 73 92 scan 0 sort 0} -do_test where7-2.287.1 { - count_steps { - SELECT a FROM t2 - WHERE b=473 - OR (g='yxwvuts' AND f GLOB 'bcdef*') - OR (g='onmlkji' AND f GLOB 'zabcd*') - OR b=836 - ORDER BY a - } -} {1 43 51 76 scan 0 sort 0} -do_test where7-2.287.2 { - count_steps { - SELECT a FROM t3 - WHERE b=473 - OR (g='yxwvuts' AND f GLOB 'bcdef*') - OR (g='onmlkji' AND f GLOB 'zabcd*') - OR b=836 - ORDER BY a - } -} {1 43 51 76 scan 0 sort 0} -do_test where7-2.288.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=60.0 AND d<61.0 AND d NOT NULL) - OR a=25 - OR b=440 - OR b=539 - OR a=70 - ORDER BY a - } -} {25 40 49 60 70 scan 0 sort 0} -do_test where7-2.288.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=60.0 AND d<61.0 AND d NOT NULL) - OR a=25 - OR b=440 - OR b=539 - OR a=70 - ORDER BY a - } -} {25 40 49 60 70 scan 0 sort 0} -do_test where7-2.289.1 { - count_steps { - SELECT a FROM t2 - WHERE f='wxyzabcde' - OR (g='nmlkjih' AND f GLOB 'fghij*') - OR (g='qponmlk' AND f GLOB 'qrstu*') - OR ((a BETWEEN 89 AND 91) AND a!=90) - OR b=990 - ORDER BY a - } -} {22 42 48 57 74 89 90 91 100 scan 0 sort 0} -do_test where7-2.289.2 { - count_steps { - SELECT a FROM t3 - WHERE f='wxyzabcde' - OR (g='nmlkjih' AND f GLOB 'fghij*') - OR (g='qponmlk' AND f GLOB 'qrstu*') - OR ((a BETWEEN 89 AND 91) AND a!=90) - OR b=990 - ORDER BY a - } -} {22 42 48 57 74 89 90 91 100 scan 0 sort 0} -do_test where7-2.290.1 { - count_steps { - SELECT a FROM t2 - WHERE b=451 - OR b=586 - OR (g='onmlkji' AND f GLOB 'xyzab*') - OR c=16016 - OR b=993 - OR a=17 - ORDER BY a - } -} {17 41 46 47 48 49 scan 0 sort 0} -do_test where7-2.290.2 { - count_steps { - SELECT a FROM t3 - WHERE b=451 - OR b=586 - OR (g='onmlkji' AND f GLOB 'xyzab*') - OR c=16016 - OR b=993 - OR a=17 - ORDER BY a - } -} {17 41 46 47 48 49 scan 0 sort 0} -do_test where7-2.291.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='wvutsrq' AND f GLOB 'jklmn*') - OR a=52 - OR b=132 - ORDER BY a - } -} {9 12 52 scan 0 sort 0} -do_test where7-2.291.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='wvutsrq' AND f GLOB 'jklmn*') - OR a=52 - OR b=132 - ORDER BY a - } -} {9 12 52 scan 0 sort 0} -do_test where7-2.292.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='kjihgfe' AND f GLOB 'qrstu*') - OR ((a BETWEEN 29 AND 31) AND a!=30) - OR b=784 - OR ((a BETWEEN 74 AND 76) AND a!=75) - ORDER BY a - } -} {29 31 68 74 76 scan 0 sort 0} -do_test where7-2.292.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='kjihgfe' AND f GLOB 'qrstu*') - OR ((a BETWEEN 29 AND 31) AND a!=30) - OR b=784 - OR ((a BETWEEN 74 AND 76) AND a!=75) - ORDER BY a - } -} {29 31 68 74 76 scan 0 sort 0} -do_test where7-2.293.1 { - count_steps { - SELECT a FROM t2 - WHERE f='vwxyzabcd' - OR a=16 - OR (d>=38.0 AND d<39.0 AND d NOT NULL) - OR (d>=28.0 AND d<29.0 AND d NOT NULL) - OR b=333 - OR (g='kjihgfe' AND f GLOB 'rstuv*') - OR b=55 - OR b=311 - ORDER BY a - } -} {5 16 21 28 38 47 69 73 99 scan 0 sort 0} -do_test where7-2.293.2 { - count_steps { - SELECT a FROM t3 - WHERE f='vwxyzabcd' - OR a=16 - OR (d>=38.0 AND d<39.0 AND d NOT NULL) - OR (d>=28.0 AND d<29.0 AND d NOT NULL) - OR b=333 - OR (g='kjihgfe' AND f GLOB 'rstuv*') - OR b=55 - OR b=311 - ORDER BY a - } -} {5 16 21 28 38 47 69 73 99 scan 0 sort 0} -do_test where7-2.294.1 { - count_steps { - SELECT a FROM t2 - WHERE (f GLOB '?fghi*' AND f GLOB 'efgh*') - OR a=17 - OR a=100 - OR a=68 - OR b=1092 - OR a=75 - OR ((a BETWEEN 54 AND 56) AND a!=55) - ORDER BY a - } -} {4 17 30 54 56 68 75 82 100 scan 0 sort 0} -do_test where7-2.294.2 { - count_steps { - SELECT a FROM t3 - WHERE (f GLOB '?fghi*' AND f GLOB 'efgh*') - OR a=17 - OR a=100 - OR a=68 - OR b=1092 - OR a=75 - OR ((a BETWEEN 54 AND 56) AND a!=55) - ORDER BY a - } -} {4 17 30 54 56 68 75 82 100 scan 0 sort 0} -do_test where7-2.295.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=57.0 AND d<58.0 AND d NOT NULL) - OR (d>=32.0 AND d<33.0 AND d NOT NULL) - OR a=97 - OR b=696 - OR b=718 - OR b=1070 - OR a=17 - OR ((a BETWEEN 43 AND 45) AND a!=44) - OR a=37 - ORDER BY a - } -} {17 32 37 43 45 57 97 scan 0 sort 0} -do_test where7-2.295.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=57.0 AND d<58.0 AND d NOT NULL) - OR (d>=32.0 AND d<33.0 AND d NOT NULL) - OR a=97 - OR b=696 - OR b=718 - OR b=1070 - OR a=17 - OR ((a BETWEEN 43 AND 45) AND a!=44) - OR a=37 - ORDER BY a - } -} {17 32 37 43 45 57 97 scan 0 sort 0} -do_test where7-2.296.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 84 AND 86) AND a!=85) - OR b=872 - ORDER BY a - } -} {84 86 scan 0 sort 0} -do_test where7-2.296.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 84 AND 86) AND a!=85) - OR b=872 - ORDER BY a - } -} {84 86 scan 0 sort 0} -do_test where7-2.297.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='mlkjihg' AND f GLOB 'klmno*') - OR a=95 - OR (g='gfedcba' AND f GLOB 'klmno*') - OR (g='srqponm' AND f GLOB 'efghi*') - OR ((a BETWEEN 39 AND 41) AND a!=40) - OR a=73 - OR c=31031 - OR ((a BETWEEN 63 AND 65) AND a!=64) - OR (d>=6.0 AND d<7.0 AND d NOT NULL) - ORDER BY a - } -} {6 30 39 41 62 63 65 73 88 91 92 93 95 scan 0 sort 0} -do_test where7-2.297.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='mlkjihg' AND f GLOB 'klmno*') - OR a=95 - OR (g='gfedcba' AND f GLOB 'klmno*') - OR (g='srqponm' AND f GLOB 'efghi*') - OR ((a BETWEEN 39 AND 41) AND a!=40) - OR a=73 - OR c=31031 - OR ((a BETWEEN 63 AND 65) AND a!=64) - OR (d>=6.0 AND d<7.0 AND d NOT NULL) - ORDER BY a - } -} {6 30 39 41 62 63 65 73 88 91 92 93 95 scan 0 sort 0} -do_test where7-2.298.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=99.0 AND d<100.0 AND d NOT NULL) - OR b=784 - OR a=18 - OR b=814 - OR b=817 - OR (d>=32.0 AND d<33.0 AND d NOT NULL) - OR f='wxyzabcde' - OR b=696 - ORDER BY a - } -} {18 22 32 48 74 99 100 scan 0 sort 0} -do_test where7-2.298.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=99.0 AND d<100.0 AND d NOT NULL) - OR b=784 - OR a=18 - OR b=814 - OR b=817 - OR (d>=32.0 AND d<33.0 AND d NOT NULL) - OR f='wxyzabcde' - OR b=696 - ORDER BY a - } -} {18 22 32 48 74 99 100 scan 0 sort 0} -do_test where7-2.299.1 { - count_steps { - SELECT a FROM t2 - WHERE b=828 - OR ((a BETWEEN 16 AND 18) AND a!=17) - OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') - OR (g='ponmlkj' AND f GLOB 'tuvwx*') - OR b=803 - OR c=18018 - OR a=78 - OR a=69 - OR a=62 - ORDER BY a - } -} {8 16 18 34 45 52 53 54 60 62 69 73 78 86 scan 0 sort 0} -do_test where7-2.299.2 { - count_steps { - SELECT a FROM t3 - WHERE b=828 - OR ((a BETWEEN 16 AND 18) AND a!=17) - OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') - OR (g='ponmlkj' AND f GLOB 'tuvwx*') - OR b=803 - OR c=18018 - OR a=78 - OR a=69 - OR a=62 - ORDER BY a - } -} {8 16 18 34 45 52 53 54 60 62 69 73 78 86 scan 0 sort 0} -do_test where7-2.300.1 { - count_steps { - SELECT a FROM t2 - WHERE c=4004 - OR a=82 - OR b=792 - OR (g='qponmlk' AND f GLOB 'opqrs*') - OR d<0.0 - OR ((a BETWEEN 64 AND 66) AND a!=65) - OR (d>=72.0 AND d<73.0 AND d NOT NULL) - OR (g='tsrqpon' AND f GLOB 'abcde*') - OR (d>=38.0 AND d<39.0 AND d NOT NULL) - OR b=586 - ORDER BY a - } -} {10 11 12 26 38 40 64 66 72 82 scan 0 sort 0} -do_test where7-2.300.2 { - count_steps { - SELECT a FROM t3 - WHERE c=4004 - OR a=82 - OR b=792 - OR (g='qponmlk' AND f GLOB 'opqrs*') - OR d<0.0 - OR ((a BETWEEN 64 AND 66) AND a!=65) - OR (d>=72.0 AND d<73.0 AND d NOT NULL) - OR (g='tsrqpon' AND f GLOB 'abcde*') - OR (d>=38.0 AND d<39.0 AND d NOT NULL) - OR b=586 - ORDER BY a - } -} {10 11 12 26 38 40 64 66 72 82 scan 0 sort 0} -do_test where7-2.301.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='nmlkjih' AND f GLOB 'defgh*') - OR (d>=69.0 AND d<70.0 AND d NOT NULL) - ORDER BY a - } -} {55 69 scan 0 sort 0} -do_test where7-2.301.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='nmlkjih' AND f GLOB 'defgh*') - OR (d>=69.0 AND d<70.0 AND d NOT NULL) - ORDER BY a - } -} {55 69 scan 0 sort 0} -do_test where7-2.302.1 { - count_steps { - SELECT a FROM t2 - WHERE f='xyzabcdef' - OR b=1070 - OR (f GLOB '?lmno*' AND f GLOB 'klmn*') - OR b=102 - ORDER BY a - } -} {10 23 36 49 62 75 88 scan 0 sort 0} -do_test where7-2.302.2 { - count_steps { - SELECT a FROM t3 - WHERE f='xyzabcdef' - OR b=1070 - OR (f GLOB '?lmno*' AND f GLOB 'klmn*') - OR b=102 - ORDER BY a - } -} {10 23 36 49 62 75 88 scan 0 sort 0} -do_test where7-2.303.1 { - count_steps { - SELECT a FROM t2 - WHERE a=28 - OR c=5005 - OR f='opqrstuvw' - OR c>=34035 - OR a=23 - ORDER BY a - } -} {13 14 15 23 28 40 66 92 scan 0 sort 0} -do_test where7-2.303.2 { - count_steps { - SELECT a FROM t3 - WHERE a=28 - OR c=5005 - OR f='opqrstuvw' - OR c>=34035 - OR a=23 - ORDER BY a - } -} {13 14 15 23 28 40 66 92 scan 0 sort 0} -do_test where7-2.304.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='rqponml' AND f GLOB 'jklmn*') - OR a=40 - OR b=168 - OR a=22 - OR a=5 - ORDER BY a - } -} {5 22 35 40 scan 0 sort 0} -do_test where7-2.304.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='rqponml' AND f GLOB 'jklmn*') - OR a=40 - OR b=168 - OR a=22 - OR a=5 - ORDER BY a - } -} {5 22 35 40 scan 0 sort 0} -do_test where7-2.305.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='wvutsrq' AND f GLOB 'klmno*') - OR c=23023 - OR (d>=9.0 AND d<10.0 AND d NOT NULL) - ORDER BY a - } -} {9 10 67 68 69 scan 0 sort 0} -do_test where7-2.305.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='wvutsrq' AND f GLOB 'klmno*') - OR c=23023 - OR (d>=9.0 AND d<10.0 AND d NOT NULL) - ORDER BY a - } -} {9 10 67 68 69 scan 0 sort 0} -do_test where7-2.306.1 { - count_steps { - SELECT a FROM t2 - WHERE b<0 - OR f='yzabcdefg' - OR (g='hgfedcb' AND f GLOB 'jklmn*') - ORDER BY a - } -} {24 50 76 87 scan 0 sort 0} -do_test where7-2.306.2 { - count_steps { - SELECT a FROM t3 - WHERE b<0 - OR f='yzabcdefg' - OR (g='hgfedcb' AND f GLOB 'jklmn*') - ORDER BY a - } -} {24 50 76 87 scan 0 sort 0} -do_test where7-2.307.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 33 AND 35) AND a!=34) - OR ((a BETWEEN 93 AND 95) AND a!=94) - OR ((a BETWEEN 23 AND 25) AND a!=24) - OR b=1026 - ORDER BY a - } -} {23 25 33 35 93 95 scan 0 sort 0} -do_test where7-2.307.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 33 AND 35) AND a!=34) - OR ((a BETWEEN 93 AND 95) AND a!=94) - OR ((a BETWEEN 23 AND 25) AND a!=24) - OR b=1026 - ORDER BY a - } -} {23 25 33 35 93 95 scan 0 sort 0} -do_test where7-2.308.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='gfedcba' AND f GLOB 'klmno*') - OR b=696 - OR (d>=70.0 AND d<71.0 AND d NOT NULL) - OR (g='lkjihgf' AND f GLOB 'lmnop*') - OR ((a BETWEEN 5 AND 7) AND a!=6) - OR (g='mlkjihg' AND f GLOB 'hijkl*') - OR (d>=63.0 AND d<64.0 AND d NOT NULL) - OR b=58 - ORDER BY a - } -} {5 7 59 63 70 88 scan 0 sort 0} -do_test where7-2.308.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='gfedcba' AND f GLOB 'klmno*') - OR b=696 - OR (d>=70.0 AND d<71.0 AND d NOT NULL) - OR (g='lkjihgf' AND f GLOB 'lmnop*') - OR ((a BETWEEN 5 AND 7) AND a!=6) - OR (g='mlkjihg' AND f GLOB 'hijkl*') - OR (d>=63.0 AND d<64.0 AND d NOT NULL) - OR b=58 - ORDER BY a - } -} {5 7 59 63 70 88 scan 0 sort 0} -do_test where7-2.309.1 { - count_steps { - SELECT a FROM t2 - WHERE b=1037 - OR b=220 - OR a=9 - ORDER BY a - } -} {9 20 scan 0 sort 0} -do_test where7-2.309.2 { - count_steps { - SELECT a FROM t3 - WHERE b=1037 - OR b=220 - OR a=9 - ORDER BY a - } -} {9 20 scan 0 sort 0} -do_test where7-2.310.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=13.0 AND d<14.0 AND d NOT NULL) - OR a=45 - OR a=27 - OR (g='hgfedcb' AND f GLOB 'hijkl*') - ORDER BY a - } -} {13 27 45 85 scan 0 sort 0} -do_test where7-2.310.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=13.0 AND d<14.0 AND d NOT NULL) - OR a=45 - OR a=27 - OR (g='hgfedcb' AND f GLOB 'hijkl*') - ORDER BY a - } -} {13 27 45 85 scan 0 sort 0} -do_test where7-2.311.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=90.0 AND d<91.0 AND d NOT NULL) - OR a=22 - OR b=968 - OR b=960 - ORDER BY a - } -} {22 88 90 scan 0 sort 0} -do_test where7-2.311.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=90.0 AND d<91.0 AND d NOT NULL) - OR a=22 - OR b=968 - OR b=960 - ORDER BY a - } -} {22 88 90 scan 0 sort 0} -do_test where7-2.312.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 72 AND 74) AND a!=73) - OR a=25 - OR b=363 - ORDER BY a - } -} {25 33 72 74 scan 0 sort 0} -do_test where7-2.312.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 72 AND 74) AND a!=73) - OR a=25 - OR b=363 - ORDER BY a - } -} {25 33 72 74 scan 0 sort 0} -do_test where7-2.313.1 { - count_steps { - SELECT a FROM t2 - WHERE b=121 - OR (g='wvutsrq' AND f GLOB 'klmno*') - OR a=13 - OR b=627 - OR (g='mlkjihg' AND f GLOB 'klmno*') - OR a=84 - OR a=23 - OR b=495 - ORDER BY a - } -} {10 11 13 23 45 57 62 84 scan 0 sort 0} -do_test where7-2.313.2 { - count_steps { - SELECT a FROM t3 - WHERE b=121 - OR (g='wvutsrq' AND f GLOB 'klmno*') - OR a=13 - OR b=627 - OR (g='mlkjihg' AND f GLOB 'klmno*') - OR a=84 - OR a=23 - OR b=495 - ORDER BY a - } -} {10 11 13 23 45 57 62 84 scan 0 sort 0} -do_test where7-2.314.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='wvutsrq' AND f GLOB 'ijklm*') - OR ((a BETWEEN 69 AND 71) AND a!=70) - OR b=1100 - ORDER BY a - } -} {8 69 71 100 scan 0 sort 0} -do_test where7-2.314.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='wvutsrq' AND f GLOB 'ijklm*') - OR ((a BETWEEN 69 AND 71) AND a!=70) - OR b=1100 - ORDER BY a - } -} {8 69 71 100 scan 0 sort 0} -do_test where7-2.315.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=38.0 AND d<39.0 AND d NOT NULL) - OR a=98 - OR b=91 - OR c=33033 - OR b=795 - OR (d>=6.0 AND d<7.0 AND d NOT NULL) - OR a=95 - OR (d>=30.0 AND d<31.0 AND d NOT NULL) - OR ((a BETWEEN 17 AND 19) AND a!=18) - ORDER BY a - } -} {6 17 19 30 38 95 97 98 99 scan 0 sort 0} -do_test where7-2.315.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=38.0 AND d<39.0 AND d NOT NULL) - OR a=98 - OR b=91 - OR c=33033 - OR b=795 - OR (d>=6.0 AND d<7.0 AND d NOT NULL) - OR a=95 - OR (d>=30.0 AND d<31.0 AND d NOT NULL) - OR ((a BETWEEN 17 AND 19) AND a!=18) - ORDER BY a - } -} {6 17 19 30 38 95 97 98 99 scan 0 sort 0} -do_test where7-2.316.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='utsrqpo' AND f GLOB 'tuvwx*') - OR a=99 - ORDER BY a - } -} {19 99 scan 0 sort 0} -do_test where7-2.316.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='utsrqpo' AND f GLOB 'tuvwx*') - OR a=99 - ORDER BY a - } -} {19 99 scan 0 sort 0} -do_test where7-2.317.1 { - count_steps { - SELECT a FROM t2 - WHERE c=4004 - OR g IS NULL - OR ((a BETWEEN 36 AND 38) AND a!=37) - ORDER BY a - } -} {10 11 12 36 38 scan 0 sort 0} -do_test where7-2.317.2 { - count_steps { - SELECT a FROM t3 - WHERE c=4004 - OR g IS NULL - OR ((a BETWEEN 36 AND 38) AND a!=37) - ORDER BY a - } -} {10 11 12 36 38 scan 0 sort 0} -do_test where7-2.318.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=84.0 AND d<85.0 AND d NOT NULL) - OR (g='edcbazy' AND f GLOB 'wxyza*') - ORDER BY a - } -} {84 100 scan 0 sort 0} -do_test where7-2.318.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=84.0 AND d<85.0 AND d NOT NULL) - OR (g='edcbazy' AND f GLOB 'wxyza*') - ORDER BY a - } -} {84 100 scan 0 sort 0} -do_test where7-2.319.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 1 AND 3) AND a!=2) - OR b=308 - OR (d>=46.0 AND d<47.0 AND d NOT NULL) - ORDER BY a - } -} {1 3 28 46 scan 0 sort 0} -do_test where7-2.319.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 1 AND 3) AND a!=2) - OR b=308 - OR (d>=46.0 AND d<47.0 AND d NOT NULL) - ORDER BY a - } -} {1 3 28 46 scan 0 sort 0} -do_test where7-2.320.1 { - count_steps { - SELECT a FROM t2 - WHERE b=608 - OR a=10 - OR a=62 - OR (g='ponmlkj' AND f GLOB 'vwxyz*') - OR a=33 - OR ((a BETWEEN 85 AND 87) AND a!=86) - ORDER BY a - } -} {10 33 47 62 85 87 scan 0 sort 0} -do_test where7-2.320.2 { - count_steps { - SELECT a FROM t3 - WHERE b=608 - OR a=10 - OR a=62 - OR (g='ponmlkj' AND f GLOB 'vwxyz*') - OR a=33 - OR ((a BETWEEN 85 AND 87) AND a!=86) - ORDER BY a - } -} {10 33 47 62 85 87 scan 0 sort 0} -do_test where7-2.321.1 { - count_steps { - SELECT a FROM t2 - WHERE c=16016 - OR (g='ponmlkj' AND f GLOB 'tuvwx*') - OR b=825 - OR f='bcdefghij' - OR c=30030 - OR (d>=100.0 AND d<101.0 AND d NOT NULL) - OR b=1070 - OR b=1059 - OR b=990 - ORDER BY a - } -} {1 27 45 46 47 48 53 75 79 88 89 90 100 scan 0 sort 0} -do_test where7-2.321.2 { - count_steps { - SELECT a FROM t3 - WHERE c=16016 - OR (g='ponmlkj' AND f GLOB 'tuvwx*') - OR b=825 - OR f='bcdefghij' - OR c=30030 - OR (d>=100.0 AND d<101.0 AND d NOT NULL) - OR b=1070 - OR b=1059 - OR b=990 - ORDER BY a - } -} {1 27 45 46 47 48 53 75 79 88 89 90 100 scan 0 sort 0} -do_test where7-2.322.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 37 AND 39) AND a!=38) - OR (d>=28.0 AND d<29.0 AND d NOT NULL) - OR b=22 - OR (g='nmlkjih' AND f GLOB 'defgh*') - OR b=473 - OR (d>=58.0 AND d<59.0 AND d NOT NULL) - ORDER BY a - } -} {2 28 37 39 43 55 58 scan 0 sort 0} -do_test where7-2.322.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 37 AND 39) AND a!=38) - OR (d>=28.0 AND d<29.0 AND d NOT NULL) - OR b=22 - OR (g='nmlkjih' AND f GLOB 'defgh*') - OR b=473 - OR (d>=58.0 AND d<59.0 AND d NOT NULL) - ORDER BY a - } -} {2 28 37 39 43 55 58 scan 0 sort 0} -do_test where7-2.323.1 { - count_steps { - SELECT a FROM t2 - WHERE c=10010 - OR (d>=89.0 AND d<90.0 AND d NOT NULL) - OR b=1078 - OR (f GLOB '?bcde*' AND f GLOB 'abcd*') - OR ((a BETWEEN 39 AND 41) AND a!=40) - OR f='qrstuvwxy' - OR b=462 - OR (g='xwvutsr' AND f GLOB 'defgh*') - OR (d>=78.0 AND d<79.0 AND d NOT NULL) - OR ((a BETWEEN 86 AND 88) AND a!=87) - OR a=53 - ORDER BY a - } -} {3 16 26 28 29 30 39 41 42 52 53 68 78 86 88 89 94 98 scan 0 sort 0} -do_test where7-2.323.2 { - count_steps { - SELECT a FROM t3 - WHERE c=10010 - OR (d>=89.0 AND d<90.0 AND d NOT NULL) - OR b=1078 - OR (f GLOB '?bcde*' AND f GLOB 'abcd*') - OR ((a BETWEEN 39 AND 41) AND a!=40) - OR f='qrstuvwxy' - OR b=462 - OR (g='xwvutsr' AND f GLOB 'defgh*') - OR (d>=78.0 AND d<79.0 AND d NOT NULL) - OR ((a BETWEEN 86 AND 88) AND a!=87) - OR a=53 - ORDER BY a - } -} {3 16 26 28 29 30 39 41 42 52 53 68 78 86 88 89 94 98 scan 0 sort 0} -do_test where7-2.324.1 { - count_steps { - SELECT a FROM t2 - WHERE (f GLOB '?fghi*' AND f GLOB 'efgh*') - OR (d>=64.0 AND d<65.0 AND d NOT NULL) - OR b=1015 - OR (d>=2.0 AND d<3.0 AND d NOT NULL) - OR b=718 - OR (g='kjihgfe' AND f GLOB 'rstuv*') - OR b=561 - ORDER BY a - } -} {2 4 30 51 56 64 69 82 scan 0 sort 0} -do_test where7-2.324.2 { - count_steps { - SELECT a FROM t3 - WHERE (f GLOB '?fghi*' AND f GLOB 'efgh*') - OR (d>=64.0 AND d<65.0 AND d NOT NULL) - OR b=1015 - OR (d>=2.0 AND d<3.0 AND d NOT NULL) - OR b=718 - OR (g='kjihgfe' AND f GLOB 'rstuv*') - OR b=561 - ORDER BY a - } -} {2 4 30 51 56 64 69 82 scan 0 sort 0} -do_test where7-2.325.1 { - count_steps { - SELECT a FROM t2 - WHERE b=421 - OR (d>=70.0 AND d<71.0 AND d NOT NULL) - ORDER BY a - } -} {70 scan 0 sort 0} -do_test where7-2.325.2 { - count_steps { - SELECT a FROM t3 - WHERE b=421 - OR (d>=70.0 AND d<71.0 AND d NOT NULL) - ORDER BY a - } -} {70 scan 0 sort 0} -do_test where7-2.326.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 8 AND 10) AND a!=9) - OR ((a BETWEEN 51 AND 53) AND a!=52) - OR a=69 - OR b=1048 - OR b=762 - OR ((a BETWEEN 55 AND 57) AND a!=56) - ORDER BY a - } -} {8 10 51 53 55 57 69 scan 0 sort 0} -do_test where7-2.326.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 8 AND 10) AND a!=9) - OR ((a BETWEEN 51 AND 53) AND a!=52) - OR a=69 - OR b=1048 - OR b=762 - OR ((a BETWEEN 55 AND 57) AND a!=56) - ORDER BY a - } -} {8 10 51 53 55 57 69 scan 0 sort 0} -do_test where7-2.327.1 { - count_steps { - SELECT a FROM t2 - WHERE b=1037 - OR e IS NULL - OR (g='xwvutsr' AND f GLOB 'hijkl*') - OR (d>=30.0 AND d<31.0 AND d NOT NULL) - OR (d>=31.0 AND d<32.0 AND d NOT NULL) - OR b=132 - OR (d>=79.0 AND d<80.0 AND d NOT NULL) - OR f='zabcdefgh' - OR b=322 - ORDER BY a - } -} {7 12 25 30 31 51 77 79 scan 0 sort 0} -do_test where7-2.327.2 { - count_steps { - SELECT a FROM t3 - WHERE b=1037 - OR e IS NULL - OR (g='xwvutsr' AND f GLOB 'hijkl*') - OR (d>=30.0 AND d<31.0 AND d NOT NULL) - OR (d>=31.0 AND d<32.0 AND d NOT NULL) - OR b=132 - OR (d>=79.0 AND d<80.0 AND d NOT NULL) - OR f='zabcdefgh' - OR b=322 - ORDER BY a - } -} {7 12 25 30 31 51 77 79 scan 0 sort 0} -do_test where7-2.328.1 { - count_steps { - SELECT a FROM t2 - WHERE b=264 - OR b=751 - OR ((a BETWEEN 59 AND 61) AND a!=60) - OR d>1e10 - OR b=674 - OR b=979 - OR b=828 - OR b=91 - OR b=935 - OR (d>=26.0 AND d<27.0 AND d NOT NULL) - ORDER BY a - } -} {24 26 59 61 85 89 scan 0 sort 0} -do_test where7-2.328.2 { - count_steps { - SELECT a FROM t3 - WHERE b=264 - OR b=751 - OR ((a BETWEEN 59 AND 61) AND a!=60) - OR d>1e10 - OR b=674 - OR b=979 - OR b=828 - OR b=91 - OR b=935 - OR (d>=26.0 AND d<27.0 AND d NOT NULL) - ORDER BY a - } -} {24 26 59 61 85 89 scan 0 sort 0} -do_test where7-2.329.1 { - count_steps { - SELECT a FROM t2 - WHERE b=385 - OR a=100 - OR ((a BETWEEN 49 AND 51) AND a!=50) - OR ((a BETWEEN 64 AND 66) AND a!=65) - OR (g='ihgfedc' AND f GLOB 'efghi*') - ORDER BY a - } -} {35 49 51 64 66 82 100 scan 0 sort 0} -do_test where7-2.329.2 { - count_steps { - SELECT a FROM t3 - WHERE b=385 - OR a=100 - OR ((a BETWEEN 49 AND 51) AND a!=50) - OR ((a BETWEEN 64 AND 66) AND a!=65) - OR (g='ihgfedc' AND f GLOB 'efghi*') - ORDER BY a - } -} {35 49 51 64 66 82 100 scan 0 sort 0} -do_test where7-2.330.1 { - count_steps { - SELECT a FROM t2 - WHERE b=638 - OR (g='gfedcba' AND f GLOB 'lmnop*') - OR ((a BETWEEN 16 AND 18) AND a!=17) - OR b=256 - OR b=1103 - OR b=891 - OR a=12 - ORDER BY a - } -} {12 16 18 58 81 89 scan 0 sort 0} -do_test where7-2.330.2 { - count_steps { - SELECT a FROM t3 - WHERE b=638 - OR (g='gfedcba' AND f GLOB 'lmnop*') - OR ((a BETWEEN 16 AND 18) AND a!=17) - OR b=256 - OR b=1103 - OR b=891 - OR a=12 - ORDER BY a - } -} {12 16 18 58 81 89 scan 0 sort 0} -do_test where7-2.331.1 { - count_steps { - SELECT a FROM t2 - WHERE (f GLOB '?rstu*' AND f GLOB 'qrst*') - OR (g='wvutsrq' AND f GLOB 'ijklm*') - OR (d>=60.0 AND d<61.0 AND d NOT NULL) - OR (f GLOB '?uvwx*' AND f GLOB 'tuvw*') - OR b=916 - OR f='nopqrstuv' - OR ((a BETWEEN 73 AND 75) AND a!=74) - ORDER BY a - } -} {8 13 16 19 39 42 45 60 65 68 71 73 75 91 94 97 scan 0 sort 0} -do_test where7-2.331.2 { - count_steps { - SELECT a FROM t3 - WHERE (f GLOB '?rstu*' AND f GLOB 'qrst*') - OR (g='wvutsrq' AND f GLOB 'ijklm*') - OR (d>=60.0 AND d<61.0 AND d NOT NULL) - OR (f GLOB '?uvwx*' AND f GLOB 'tuvw*') - OR b=916 - OR f='nopqrstuv' - OR ((a BETWEEN 73 AND 75) AND a!=74) - ORDER BY a - } -} {8 13 16 19 39 42 45 60 65 68 71 73 75 91 94 97 scan 0 sort 0} -do_test where7-2.332.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=48.0 AND d<49.0 AND d NOT NULL) - OR c=24024 - OR ((a BETWEEN 22 AND 24) AND a!=23) - OR (g='wvutsrq' AND f GLOB 'ijklm*') - OR ((a BETWEEN 26 AND 28) AND a!=27) - OR b=476 - OR (g='jihgfed' AND f GLOB 'vwxyz*') - OR b=1089 - ORDER BY a - } -} {8 22 24 26 28 48 70 71 72 73 99 scan 0 sort 0} -do_test where7-2.332.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=48.0 AND d<49.0 AND d NOT NULL) - OR c=24024 - OR ((a BETWEEN 22 AND 24) AND a!=23) - OR (g='wvutsrq' AND f GLOB 'ijklm*') - OR ((a BETWEEN 26 AND 28) AND a!=27) - OR b=476 - OR (g='jihgfed' AND f GLOB 'vwxyz*') - OR b=1089 - ORDER BY a - } -} {8 22 24 26 28 48 70 71 72 73 99 scan 0 sort 0} -do_test where7-2.333.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='kjihgfe' AND f GLOB 'tuvwx*') - OR (g='nmlkjih' AND f GLOB 'bcdef*') - OR (g='lkjihgf' AND f GLOB 'pqrst*') - OR a=54 - OR b=1048 - OR b=938 - ORDER BY a - } -} {53 54 67 71 scan 0 sort 0} -do_test where7-2.333.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='kjihgfe' AND f GLOB 'tuvwx*') - OR (g='nmlkjih' AND f GLOB 'bcdef*') - OR (g='lkjihgf' AND f GLOB 'pqrst*') - OR a=54 - OR b=1048 - OR b=938 - ORDER BY a - } -} {53 54 67 71 scan 0 sort 0} -do_test where7-2.334.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=7.0 AND d<8.0 AND d NOT NULL) - OR b=817 - OR f='qrstuvwxy' - OR b=341 - OR (d>=89.0 AND d<90.0 AND d NOT NULL) - OR a=73 - OR (d>=62.0 AND d<63.0 AND d NOT NULL) - ORDER BY a - } -} {7 16 31 42 62 68 73 89 94 scan 0 sort 0} -do_test where7-2.334.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=7.0 AND d<8.0 AND d NOT NULL) - OR b=817 - OR f='qrstuvwxy' - OR b=341 - OR (d>=89.0 AND d<90.0 AND d NOT NULL) - OR a=73 - OR (d>=62.0 AND d<63.0 AND d NOT NULL) - ORDER BY a - } -} {7 16 31 42 62 68 73 89 94 scan 0 sort 0} -do_test where7-2.335.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=18.0 AND d<19.0 AND d NOT NULL) - OR b=352 - ORDER BY a - } -} {18 32 scan 0 sort 0} -do_test where7-2.335.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=18.0 AND d<19.0 AND d NOT NULL) - OR b=352 - ORDER BY a - } -} {18 32 scan 0 sort 0} -do_test where7-2.336.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=27.0 AND d<28.0 AND d NOT NULL) - OR a=40 - OR ((a BETWEEN 84 AND 86) AND a!=85) - OR (g='kjihgfe' AND f GLOB 'stuvw*') - OR ((a BETWEEN 39 AND 41) AND a!=40) - OR b=22 - OR (g='lkjihgf' AND f GLOB 'opqrs*') - OR a=40 - OR b=289 - OR (g='wvutsrq' AND f GLOB 'klmno*') - ORDER BY a - } -} {2 10 27 39 40 41 66 70 84 86 scan 0 sort 0} -do_test where7-2.336.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=27.0 AND d<28.0 AND d NOT NULL) - OR a=40 - OR ((a BETWEEN 84 AND 86) AND a!=85) - OR (g='kjihgfe' AND f GLOB 'stuvw*') - OR ((a BETWEEN 39 AND 41) AND a!=40) - OR b=22 - OR (g='lkjihgf' AND f GLOB 'opqrs*') - OR a=40 - OR b=289 - OR (g='wvutsrq' AND f GLOB 'klmno*') - ORDER BY a - } -} {2 10 27 39 40 41 66 70 84 86 scan 0 sort 0} -do_test where7-2.337.1 { - count_steps { - SELECT a FROM t2 - WHERE b=704 - OR c=12012 - OR b=803 - OR a=32 - OR a=4 - OR b=619 - ORDER BY a - } -} {4 32 34 35 36 64 73 scan 0 sort 0} -do_test where7-2.337.2 { - count_steps { - SELECT a FROM t3 - WHERE b=704 - OR c=12012 - OR b=803 - OR a=32 - OR a=4 - OR b=619 - ORDER BY a - } -} {4 32 34 35 36 64 73 scan 0 sort 0} -do_test where7-2.338.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 14 AND 16) AND a!=15) - OR f='stuvwxyza' - OR ((a BETWEEN 14 AND 16) AND a!=15) - ORDER BY a - } -} {14 16 18 44 70 96 scan 0 sort 0} -do_test where7-2.338.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 14 AND 16) AND a!=15) - OR f='stuvwxyza' - OR ((a BETWEEN 14 AND 16) AND a!=15) - ORDER BY a - } -} {14 16 18 44 70 96 scan 0 sort 0} -do_test where7-2.339.1 { - count_steps { - SELECT a FROM t2 - WHERE b=187 - OR f='bcdefghij' - OR a=18 - OR f='zabcdefgh' - OR (g='jihgfed' AND f GLOB 'xyzab*') - OR b<0 - OR (g='xwvutsr' AND f GLOB 'defgh*') - OR (f GLOB '?defg*' AND f GLOB 'cdef*') - OR (d>=20.0 AND d<21.0 AND d NOT NULL) - OR (d>=54.0 AND d<55.0 AND d NOT NULL) - OR (d>=30.0 AND d<31.0 AND d NOT NULL) - ORDER BY a - } -} {1 2 3 17 18 20 25 27 28 30 51 53 54 75 77 79 80 scan 0 sort 0} -do_test where7-2.339.2 { - count_steps { - SELECT a FROM t3 - WHERE b=187 - OR f='bcdefghij' - OR a=18 - OR f='zabcdefgh' - OR (g='jihgfed' AND f GLOB 'xyzab*') - OR b<0 - OR (g='xwvutsr' AND f GLOB 'defgh*') - OR (f GLOB '?defg*' AND f GLOB 'cdef*') - OR (d>=20.0 AND d<21.0 AND d NOT NULL) - OR (d>=54.0 AND d<55.0 AND d NOT NULL) - OR (d>=30.0 AND d<31.0 AND d NOT NULL) - ORDER BY a - } -} {1 2 3 17 18 20 25 27 28 30 51 53 54 75 77 79 80 scan 0 sort 0} -do_test where7-2.340.1 { - count_steps { - SELECT a FROM t2 - WHERE b=311 - OR ((a BETWEEN 9 AND 11) AND a!=10) - OR (d>=84.0 AND d<85.0 AND d NOT NULL) - OR b=839 - OR b=693 - OR (d>=12.0 AND d<13.0 AND d NOT NULL) - OR ((a BETWEEN 40 AND 42) AND a!=41) - OR b=715 - OR f='jklmnopqr' - OR b=385 - OR (d>=22.0 AND d<23.0 AND d NOT NULL) - ORDER BY a - } -} {9 11 12 22 35 40 42 61 63 65 84 87 scan 0 sort 0} -do_test where7-2.340.2 { - count_steps { - SELECT a FROM t3 - WHERE b=311 - OR ((a BETWEEN 9 AND 11) AND a!=10) - OR (d>=84.0 AND d<85.0 AND d NOT NULL) - OR b=839 - OR b=693 - OR (d>=12.0 AND d<13.0 AND d NOT NULL) - OR ((a BETWEEN 40 AND 42) AND a!=41) - OR b=715 - OR f='jklmnopqr' - OR b=385 - OR (d>=22.0 AND d<23.0 AND d NOT NULL) - ORDER BY a - } -} {9 11 12 22 35 40 42 61 63 65 84 87 scan 0 sort 0} -do_test where7-2.341.1 { - count_steps { - SELECT a FROM t2 - WHERE b=223 - OR b=498 - OR b=66 - OR b=14 - OR (g='jihgfed' AND f GLOB 'vwxyz*') - OR c=6006 - OR a=34 - OR (g='utsrqpo' AND f GLOB 'wxyza*') - OR b=407 - ORDER BY a - } -} {6 16 17 18 22 34 37 73 scan 0 sort 0} -do_test where7-2.341.2 { - count_steps { - SELECT a FROM t3 - WHERE b=223 - OR b=498 - OR b=66 - OR b=14 - OR (g='jihgfed' AND f GLOB 'vwxyz*') - OR c=6006 - OR a=34 - OR (g='utsrqpo' AND f GLOB 'wxyza*') - OR b=407 - ORDER BY a - } -} {6 16 17 18 22 34 37 73 scan 0 sort 0} -do_test where7-2.342.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='ihgfedc' AND f GLOB 'bcdef*') - OR b=88 - OR (g='fedcbaz' AND f GLOB 'rstuv*') - OR ((a BETWEEN 69 AND 71) AND a!=70) - OR (d>=53.0 AND d<54.0 AND d NOT NULL) - OR a=56 - OR b=429 - OR a=3 - ORDER BY a - } -} {3 8 39 53 56 69 71 79 95 scan 0 sort 0} -do_test where7-2.342.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='ihgfedc' AND f GLOB 'bcdef*') - OR b=88 - OR (g='fedcbaz' AND f GLOB 'rstuv*') - OR ((a BETWEEN 69 AND 71) AND a!=70) - OR (d>=53.0 AND d<54.0 AND d NOT NULL) - OR a=56 - OR b=429 - OR a=3 - ORDER BY a - } -} {3 8 39 53 56 69 71 79 95 scan 0 sort 0} -do_test where7-2.343.1 { - count_steps { - SELECT a FROM t2 - WHERE b=1078 - OR a=2 - OR b=190 - OR b=289 - OR (d>=76.0 AND d<77.0 AND d NOT NULL) - OR (f GLOB '?lmno*' AND f GLOB 'klmn*') - OR ((a BETWEEN 14 AND 16) AND a!=15) - OR (g='ponmlkj' AND f GLOB 'vwxyz*') - ORDER BY a - } -} {2 10 14 16 36 47 62 76 88 98 scan 0 sort 0} -do_test where7-2.343.2 { - count_steps { - SELECT a FROM t3 - WHERE b=1078 - OR a=2 - OR b=190 - OR b=289 - OR (d>=76.0 AND d<77.0 AND d NOT NULL) - OR (f GLOB '?lmno*' AND f GLOB 'klmn*') - OR ((a BETWEEN 14 AND 16) AND a!=15) - OR (g='ponmlkj' AND f GLOB 'vwxyz*') - ORDER BY a - } -} {2 10 14 16 36 47 62 76 88 98 scan 0 sort 0} -do_test where7-2.344.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 61 AND 63) AND a!=62) - OR ((a BETWEEN 53 AND 55) AND a!=54) - OR b=946 - OR a=21 - ORDER BY a - } -} {21 53 55 61 63 86 scan 0 sort 0} -do_test where7-2.344.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 61 AND 63) AND a!=62) - OR ((a BETWEEN 53 AND 55) AND a!=54) - OR b=946 - OR a=21 - ORDER BY a - } -} {21 53 55 61 63 86 scan 0 sort 0} -do_test where7-2.345.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=19.0 AND d<20.0 AND d NOT NULL) - OR (d>=27.0 AND d<28.0 AND d NOT NULL) - OR b=682 - OR (d>=64.0 AND d<65.0 AND d NOT NULL) - OR (g='ponmlkj' AND f GLOB 'tuvwx*') - OR ((a BETWEEN 29 AND 31) AND a!=30) - OR a=28 - OR (g='rqponml' AND f GLOB 'klmno*') - ORDER BY a - } -} {19 27 28 29 31 36 45 62 64 scan 0 sort 0} -do_test where7-2.345.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=19.0 AND d<20.0 AND d NOT NULL) - OR (d>=27.0 AND d<28.0 AND d NOT NULL) - OR b=682 - OR (d>=64.0 AND d<65.0 AND d NOT NULL) - OR (g='ponmlkj' AND f GLOB 'tuvwx*') - OR ((a BETWEEN 29 AND 31) AND a!=30) - OR a=28 - OR (g='rqponml' AND f GLOB 'klmno*') - ORDER BY a - } -} {19 27 28 29 31 36 45 62 64 scan 0 sort 0} -do_test where7-2.346.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='ponmlkj' AND f GLOB 'uvwxy*') - OR (d>=88.0 AND d<89.0 AND d NOT NULL) - OR a=18 - OR (f GLOB '?abcd*' AND f GLOB 'zabc*') - OR b=388 - ORDER BY a - } -} {18 25 46 51 77 88 scan 0 sort 0} -do_test where7-2.346.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='ponmlkj' AND f GLOB 'uvwxy*') - OR (d>=88.0 AND d<89.0 AND d NOT NULL) - OR a=18 - OR (f GLOB '?abcd*' AND f GLOB 'zabc*') - OR b=388 - ORDER BY a - } -} {18 25 46 51 77 88 scan 0 sort 0} -do_test where7-2.347.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=45.0 AND d<46.0 AND d NOT NULL) - OR (g='tsrqpon' AND f GLOB 'zabcd*') - ORDER BY a - } -} {25 45 scan 0 sort 0} -do_test where7-2.347.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=45.0 AND d<46.0 AND d NOT NULL) - OR (g='tsrqpon' AND f GLOB 'zabcd*') - ORDER BY a - } -} {25 45 scan 0 sort 0} -do_test where7-2.348.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='rqponml' AND f GLOB 'klmno*') - OR (d>=79.0 AND d<80.0 AND d NOT NULL) - OR b=363 - OR (f GLOB '?ghij*' AND f GLOB 'fghi*') - OR b=220 - OR f='yzabcdefg' - OR b=715 - OR b=421 - ORDER BY a - } -} {5 20 24 31 33 36 50 57 65 76 79 83 scan 0 sort 0} -do_test where7-2.348.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='rqponml' AND f GLOB 'klmno*') - OR (d>=79.0 AND d<80.0 AND d NOT NULL) - OR b=363 - OR (f GLOB '?ghij*' AND f GLOB 'fghi*') - OR b=220 - OR f='yzabcdefg' - OR b=715 - OR b=421 - ORDER BY a - } -} {5 20 24 31 33 36 50 57 65 76 79 83 scan 0 sort 0} -do_test where7-2.349.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='hgfedcb' AND f GLOB 'ijklm*') - OR b=696 - OR a=23 - OR (f GLOB '?efgh*' AND f GLOB 'defg*') - OR ((a BETWEEN 12 AND 14) AND a!=13) - OR (g='hgfedcb' AND f GLOB 'hijkl*') - OR (f GLOB '?lmno*' AND f GLOB 'klmn*') - OR (f GLOB '?opqr*' AND f GLOB 'nopq*') - ORDER BY a - } -} {3 10 12 13 14 23 29 36 39 55 62 65 81 85 86 88 91 scan 0 sort 0} -do_test where7-2.349.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='hgfedcb' AND f GLOB 'ijklm*') - OR b=696 - OR a=23 - OR (f GLOB '?efgh*' AND f GLOB 'defg*') - OR ((a BETWEEN 12 AND 14) AND a!=13) - OR (g='hgfedcb' AND f GLOB 'hijkl*') - OR (f GLOB '?lmno*' AND f GLOB 'klmn*') - OR (f GLOB '?opqr*' AND f GLOB 'nopq*') - ORDER BY a - } -} {3 10 12 13 14 23 29 36 39 55 62 65 81 85 86 88 91 scan 0 sort 0} -do_test where7-2.350.1 { - count_steps { - SELECT a FROM t2 - WHERE a=66 - OR ((a BETWEEN 4 AND 6) AND a!=5) - OR (g='mlkjihg' AND f GLOB 'ijklm*') - OR (f GLOB '?xyza*' AND f GLOB 'wxyz*') - OR b=388 - OR (d>=21.0 AND d<22.0 AND d NOT NULL) - OR b=264 - OR (d>=95.0 AND d<96.0 AND d NOT NULL) - OR a=13 - OR (d>=47.0 AND d<48.0 AND d NOT NULL) - OR (d>=94.0 AND d<95.0 AND d NOT NULL) - ORDER BY a - } -} {4 6 13 21 22 24 47 48 60 66 74 94 95 100 scan 0 sort 0} -do_test where7-2.350.2 { - count_steps { - SELECT a FROM t3 - WHERE a=66 - OR ((a BETWEEN 4 AND 6) AND a!=5) - OR (g='mlkjihg' AND f GLOB 'ijklm*') - OR (f GLOB '?xyza*' AND f GLOB 'wxyz*') - OR b=388 - OR (d>=21.0 AND d<22.0 AND d NOT NULL) - OR b=264 - OR (d>=95.0 AND d<96.0 AND d NOT NULL) - OR a=13 - OR (d>=47.0 AND d<48.0 AND d NOT NULL) - OR (d>=94.0 AND d<95.0 AND d NOT NULL) - ORDER BY a - } -} {4 6 13 21 22 24 47 48 60 66 74 94 95 100 scan 0 sort 0} -do_test where7-2.351.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=31.0 AND d<32.0 AND d NOT NULL) - OR a=16 - OR (g='onmlkji' AND f GLOB 'zabcd*') - OR b=385 - OR ((a BETWEEN 56 AND 58) AND a!=57) - OR b=979 - OR (g='jihgfed' AND f GLOB 'zabcd*') - OR b=1026 - ORDER BY a - } -} {16 31 35 51 56 58 77 89 scan 0 sort 0} -do_test where7-2.351.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=31.0 AND d<32.0 AND d NOT NULL) - OR a=16 - OR (g='onmlkji' AND f GLOB 'zabcd*') - OR b=385 - OR ((a BETWEEN 56 AND 58) AND a!=57) - OR b=979 - OR (g='jihgfed' AND f GLOB 'zabcd*') - OR b=1026 - ORDER BY a - } -} {16 31 35 51 56 58 77 89 scan 0 sort 0} -do_test where7-2.352.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=45.0 AND d<46.0 AND d NOT NULL) - OR b=168 - OR a=72 - OR f='klmnopqrs' - OR ((a BETWEEN 66 AND 68) AND a!=67) - OR a=92 - OR a=47 - ORDER BY a - } -} {10 36 45 47 62 66 68 72 88 92 scan 0 sort 0} -do_test where7-2.352.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=45.0 AND d<46.0 AND d NOT NULL) - OR b=168 - OR a=72 - OR f='klmnopqrs' - OR ((a BETWEEN 66 AND 68) AND a!=67) - OR a=92 - OR a=47 - ORDER BY a - } -} {10 36 45 47 62 66 68 72 88 92 scan 0 sort 0} -do_test where7-2.353.1 { - count_steps { - SELECT a FROM t2 - WHERE a=92 - OR b=319 - OR b=792 - OR b=396 - OR b=498 - OR (d>=67.0 AND d<68.0 AND d NOT NULL) - OR d>1e10 - OR (g='kjihgfe' AND f GLOB 'tuvwx*') - OR (d>=39.0 AND d<40.0 AND d NOT NULL) - OR b=1048 - OR (d>=17.0 AND d<18.0 AND d NOT NULL) - ORDER BY a - } -} {17 29 36 39 67 71 72 92 scan 0 sort 0} -do_test where7-2.353.2 { - count_steps { - SELECT a FROM t3 - WHERE a=92 - OR b=319 - OR b=792 - OR b=396 - OR b=498 - OR (d>=67.0 AND d<68.0 AND d NOT NULL) - OR d>1e10 - OR (g='kjihgfe' AND f GLOB 'tuvwx*') - OR (d>=39.0 AND d<40.0 AND d NOT NULL) - OR b=1048 - OR (d>=17.0 AND d<18.0 AND d NOT NULL) - ORDER BY a - } -} {17 29 36 39 67 71 72 92 scan 0 sort 0} -do_test where7-2.354.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=24.0 AND d<25.0 AND d NOT NULL) - OR b=1034 - OR ((a BETWEEN 70 AND 72) AND a!=71) - OR (g='tsrqpon' AND f GLOB 'abcde*') - OR (d>=78.0 AND d<79.0 AND d NOT NULL) - OR b=25 - OR (g='qponmlk' AND f GLOB 'pqrst*') - OR b=231 - OR a=85 - OR (d>=53.0 AND d<54.0 AND d NOT NULL) - ORDER BY a - } -} {21 24 26 41 53 70 72 78 85 94 scan 0 sort 0} -do_test where7-2.354.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=24.0 AND d<25.0 AND d NOT NULL) - OR b=1034 - OR ((a BETWEEN 70 AND 72) AND a!=71) - OR (g='tsrqpon' AND f GLOB 'abcde*') - OR (d>=78.0 AND d<79.0 AND d NOT NULL) - OR b=25 - OR (g='qponmlk' AND f GLOB 'pqrst*') - OR b=231 - OR a=85 - OR (d>=53.0 AND d<54.0 AND d NOT NULL) - ORDER BY a - } -} {21 24 26 41 53 70 72 78 85 94 scan 0 sort 0} -do_test where7-2.355.1 { - count_steps { - SELECT a FROM t2 - WHERE f='opqrstuvw' - OR c=10010 - ORDER BY a - } -} {14 28 29 30 40 66 92 scan 0 sort 0} -do_test where7-2.355.2 { - count_steps { - SELECT a FROM t3 - WHERE f='opqrstuvw' - OR c=10010 - ORDER BY a - } -} {14 28 29 30 40 66 92 scan 0 sort 0} -do_test where7-2.356.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=37.0 AND d<38.0 AND d NOT NULL) - OR (d>=84.0 AND d<85.0 AND d NOT NULL) - OR ((a BETWEEN 40 AND 42) AND a!=41) - OR b=454 - OR a=46 - OR b=102 - ORDER BY a - } -} {37 40 42 46 84 scan 0 sort 0} -do_test where7-2.356.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=37.0 AND d<38.0 AND d NOT NULL) - OR (d>=84.0 AND d<85.0 AND d NOT NULL) - OR ((a BETWEEN 40 AND 42) AND a!=41) - OR b=454 - OR a=46 - OR b=102 - ORDER BY a - } -} {37 40 42 46 84 scan 0 sort 0} -do_test where7-2.357.1 { - count_steps { - SELECT a FROM t2 - WHERE a=56 - OR (d>=99.0 AND d<100.0 AND d NOT NULL) - OR ((a BETWEEN 66 AND 68) AND a!=67) - OR a=86 - OR c=34034 - ORDER BY a - } -} {56 66 68 86 99 100 scan 0 sort 0} -do_test where7-2.357.2 { - count_steps { - SELECT a FROM t3 - WHERE a=56 - OR (d>=99.0 AND d<100.0 AND d NOT NULL) - OR ((a BETWEEN 66 AND 68) AND a!=67) - OR a=86 - OR c=34034 - ORDER BY a - } -} {56 66 68 86 99 100 scan 0 sort 0} -do_test where7-2.358.1 { - count_steps { - SELECT a FROM t2 - WHERE a=92 - OR f='abcdefghi' - OR a=15 - OR ((a BETWEEN 55 AND 57) AND a!=56) - OR (d>=16.0 AND d<17.0 AND d NOT NULL) - OR a=15 - OR b=550 - ORDER BY a - } -} {15 16 26 50 52 55 57 78 92 scan 0 sort 0} -do_test where7-2.358.2 { - count_steps { - SELECT a FROM t3 - WHERE a=92 - OR f='abcdefghi' - OR a=15 - OR ((a BETWEEN 55 AND 57) AND a!=56) - OR (d>=16.0 AND d<17.0 AND d NOT NULL) - OR a=15 - OR b=550 - ORDER BY a - } -} {15 16 26 50 52 55 57 78 92 scan 0 sort 0} -do_test where7-2.359.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='fedcbaz' AND f GLOB 'tuvwx*') - OR ((a BETWEEN 28 AND 30) AND a!=29) - OR ((a BETWEEN 6 AND 8) AND a!=7) - OR b=1023 - OR (d>=38.0 AND d<39.0 AND d NOT NULL) - ORDER BY a - } -} {6 8 28 30 38 93 97 scan 0 sort 0} -do_test where7-2.359.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='fedcbaz' AND f GLOB 'tuvwx*') - OR ((a BETWEEN 28 AND 30) AND a!=29) - OR ((a BETWEEN 6 AND 8) AND a!=7) - OR b=1023 - OR (d>=38.0 AND d<39.0 AND d NOT NULL) - ORDER BY a - } -} {6 8 28 30 38 93 97 scan 0 sort 0} -do_test where7-2.360.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 63 AND 65) AND a!=64) - OR f='opqrstuvw' - OR (d>=72.0 AND d<73.0 AND d NOT NULL) - OR b=407 - ORDER BY a - } -} {14 37 40 63 65 66 72 92 scan 0 sort 0} -do_test where7-2.360.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 63 AND 65) AND a!=64) - OR f='opqrstuvw' - OR (d>=72.0 AND d<73.0 AND d NOT NULL) - OR b=407 - ORDER BY a - } -} {14 37 40 63 65 66 72 92 scan 0 sort 0} -do_test where7-2.361.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=20.0 AND d<21.0 AND d NOT NULL) - OR b=740 - OR a=38 - OR (g='srqponm' AND f GLOB 'efghi*') - ORDER BY a - } -} {20 30 38 scan 0 sort 0} -do_test where7-2.361.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=20.0 AND d<21.0 AND d NOT NULL) - OR b=740 - OR a=38 - OR (g='srqponm' AND f GLOB 'efghi*') - ORDER BY a - } -} {20 30 38 scan 0 sort 0} -do_test where7-2.362.1 { - count_steps { - SELECT a FROM t2 - WHERE b=410 - OR (g='tsrqpon' AND f GLOB 'xyzab*') - OR b=25 - OR a=80 - OR ((a BETWEEN 1 AND 3) AND a!=2) - OR a=65 - OR ((a BETWEEN 64 AND 66) AND a!=65) - OR b=641 - OR b=352 - ORDER BY a - } -} {1 3 23 32 64 65 66 80 scan 0 sort 0} -do_test where7-2.362.2 { - count_steps { - SELECT a FROM t3 - WHERE b=410 - OR (g='tsrqpon' AND f GLOB 'xyzab*') - OR b=25 - OR a=80 - OR ((a BETWEEN 1 AND 3) AND a!=2) - OR a=65 - OR ((a BETWEEN 64 AND 66) AND a!=65) - OR b=641 - OR b=352 - ORDER BY a - } -} {1 3 23 32 64 65 66 80 scan 0 sort 0} -do_test where7-2.363.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='kjihgfe' AND f GLOB 'uvwxy*') - OR (d>=64.0 AND d<65.0 AND d NOT NULL) - OR b=135 - OR a=15 - ORDER BY a - } -} {15 64 72 scan 0 sort 0} -do_test where7-2.363.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='kjihgfe' AND f GLOB 'uvwxy*') - OR (d>=64.0 AND d<65.0 AND d NOT NULL) - OR b=135 - OR a=15 - ORDER BY a - } -} {15 64 72 scan 0 sort 0} -do_test where7-2.364.1 { - count_steps { - SELECT a FROM t2 - WHERE b=572 - OR (g='lkjihgf' AND f GLOB 'opqrs*') - OR a=84 - OR (g='lkjihgf' AND f GLOB 'nopqr*') - OR f='xyzabcdef' - OR (g='gfedcba' AND f GLOB 'mnopq*') - OR a=65 - ORDER BY a - } -} {23 49 52 65 66 75 84 90 scan 0 sort 0} -do_test where7-2.364.2 { - count_steps { - SELECT a FROM t3 - WHERE b=572 - OR (g='lkjihgf' AND f GLOB 'opqrs*') - OR a=84 - OR (g='lkjihgf' AND f GLOB 'nopqr*') - OR f='xyzabcdef' - OR (g='gfedcba' AND f GLOB 'mnopq*') - OR a=65 - ORDER BY a - } -} {23 49 52 65 66 75 84 90 scan 0 sort 0} -do_test where7-2.365.1 { - count_steps { - SELECT a FROM t2 - WHERE a=6 - OR a=65 - OR (d>=19.0 AND d<20.0 AND d NOT NULL) - OR (g='qponmlk' AND f GLOB 'qrstu*') - OR b=825 - OR c=29029 - OR (d>=75.0 AND d<76.0 AND d NOT NULL) - ORDER BY a - } -} {6 19 42 65 75 85 86 87 scan 0 sort 0} -do_test where7-2.365.2 { - count_steps { - SELECT a FROM t3 - WHERE a=6 - OR a=65 - OR (d>=19.0 AND d<20.0 AND d NOT NULL) - OR (g='qponmlk' AND f GLOB 'qrstu*') - OR b=825 - OR c=29029 - OR (d>=75.0 AND d<76.0 AND d NOT NULL) - ORDER BY a - } -} {6 19 42 65 75 85 86 87 scan 0 sort 0} -do_test where7-2.366.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 55 AND 57) AND a!=56) - OR ((a BETWEEN 80 AND 82) AND a!=81) - OR (g='tsrqpon' AND f GLOB 'abcde*') - OR (d>=21.0 AND d<22.0 AND d NOT NULL) - OR c=32032 - OR (g='utsrqpo' AND f GLOB 'wxyza*') - ORDER BY a - } -} {21 22 26 55 57 80 82 94 95 96 scan 0 sort 0} -do_test where7-2.366.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 55 AND 57) AND a!=56) - OR ((a BETWEEN 80 AND 82) AND a!=81) - OR (g='tsrqpon' AND f GLOB 'abcde*') - OR (d>=21.0 AND d<22.0 AND d NOT NULL) - OR c=32032 - OR (g='utsrqpo' AND f GLOB 'wxyza*') - ORDER BY a - } -} {21 22 26 55 57 80 82 94 95 96 scan 0 sort 0} -do_test where7-2.367.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=98.0 AND d<99.0 AND d NOT NULL) - OR a=27 - ORDER BY a - } -} {27 98 scan 0 sort 0} -do_test where7-2.367.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=98.0 AND d<99.0 AND d NOT NULL) - OR a=27 - ORDER BY a - } -} {27 98 scan 0 sort 0} -do_test where7-2.368.1 { - count_steps { - SELECT a FROM t2 - WHERE b=806 - OR a=74 - OR a=28 - OR (d>=50.0 AND d<51.0 AND d NOT NULL) - OR b=751 - OR (g='mlkjihg' AND f GLOB 'hijkl*') - ORDER BY a - } -} {28 50 59 74 scan 0 sort 0} -do_test where7-2.368.2 { - count_steps { - SELECT a FROM t3 - WHERE b=806 - OR a=74 - OR a=28 - OR (d>=50.0 AND d<51.0 AND d NOT NULL) - OR b=751 - OR (g='mlkjihg' AND f GLOB 'hijkl*') - ORDER BY a - } -} {28 50 59 74 scan 0 sort 0} -do_test where7-2.369.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=5.0 AND d<6.0 AND d NOT NULL) - OR (f GLOB '?opqr*' AND f GLOB 'nopq*') - OR b=729 - OR (g='xwvutsr' AND f GLOB 'fghij*') - ORDER BY a - } -} {5 13 39 65 91 scan 0 sort 0} -do_test where7-2.369.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=5.0 AND d<6.0 AND d NOT NULL) - OR (f GLOB '?opqr*' AND f GLOB 'nopq*') - OR b=729 - OR (g='xwvutsr' AND f GLOB 'fghij*') - ORDER BY a - } -} {5 13 39 65 91 scan 0 sort 0} -do_test where7-2.370.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='qponmlk' AND f GLOB 'opqrs*') - OR (f GLOB '?hijk*' AND f GLOB 'ghij*') - OR ((a BETWEEN 53 AND 55) AND a!=54) - OR b=630 - ORDER BY a - } -} {6 32 40 53 55 58 84 scan 0 sort 0} -do_test where7-2.370.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='qponmlk' AND f GLOB 'opqrs*') - OR (f GLOB '?hijk*' AND f GLOB 'ghij*') - OR ((a BETWEEN 53 AND 55) AND a!=54) - OR b=630 - ORDER BY a - } -} {6 32 40 53 55 58 84 scan 0 sort 0} -do_test where7-2.371.1 { - count_steps { - SELECT a FROM t2 - WHERE b=605 - OR c=18018 - OR (d>=46.0 AND d<47.0 AND d NOT NULL) - ORDER BY a - } -} {46 52 53 54 55 scan 0 sort 0} -do_test where7-2.371.2 { - count_steps { - SELECT a FROM t3 - WHERE b=605 - OR c=18018 - OR (d>=46.0 AND d<47.0 AND d NOT NULL) - ORDER BY a - } -} {46 52 53 54 55 scan 0 sort 0} -do_test where7-2.372.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='xwvutsr' AND f GLOB 'ghijk*') - OR a=22 - OR b=553 - OR b=443 - OR (d>=100.0 AND d<101.0 AND d NOT NULL) - OR b=1070 - OR b=179 - OR a=75 - OR ((a BETWEEN 95 AND 97) AND a!=96) - OR b=278 - OR a=38 - ORDER BY a - } -} {6 22 38 75 95 97 100 scan 0 sort 0} -do_test where7-2.372.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='xwvutsr' AND f GLOB 'ghijk*') - OR a=22 - OR b=553 - OR b=443 - OR (d>=100.0 AND d<101.0 AND d NOT NULL) - OR b=1070 - OR b=179 - OR a=75 - OR ((a BETWEEN 95 AND 97) AND a!=96) - OR b=278 - OR a=38 - ORDER BY a - } -} {6 22 38 75 95 97 100 scan 0 sort 0} -do_test where7-2.373.1 { - count_steps { - SELECT a FROM t2 - WHERE f='hijklmnop' - OR b=938 - ORDER BY a - } -} {7 33 59 85 scan 0 sort 0} -do_test where7-2.373.2 { - count_steps { - SELECT a FROM t3 - WHERE f='hijklmnop' - OR b=938 - ORDER BY a - } -} {7 33 59 85 scan 0 sort 0} -do_test where7-2.374.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='xwvutsr' AND f GLOB 'ghijk*') - OR b=927 - ORDER BY a - } -} {6 scan 0 sort 0} -do_test where7-2.374.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='xwvutsr' AND f GLOB 'ghijk*') - OR b=927 - ORDER BY a - } -} {6 scan 0 sort 0} -do_test where7-2.375.1 { - count_steps { - SELECT a FROM t2 - WHERE c=11011 - OR a=54 - ORDER BY a - } -} {31 32 33 54 scan 0 sort 0} -do_test where7-2.375.2 { - count_steps { - SELECT a FROM t3 - WHERE c=11011 - OR a=54 - ORDER BY a - } -} {31 32 33 54 scan 0 sort 0} -do_test where7-2.376.1 { - count_steps { - SELECT a FROM t2 - WHERE a=44 - OR b=264 - OR (d>=30.0 AND d<31.0 AND d NOT NULL) - OR c=1001 - OR b=14 - OR a=67 - OR (g='nmlkjih' AND f GLOB 'fghij*') - ORDER BY a - } -} {1 2 3 24 30 44 57 67 scan 0 sort 0} -do_test where7-2.376.2 { - count_steps { - SELECT a FROM t3 - WHERE a=44 - OR b=264 - OR (d>=30.0 AND d<31.0 AND d NOT NULL) - OR c=1001 - OR b=14 - OR a=67 - OR (g='nmlkjih' AND f GLOB 'fghij*') - ORDER BY a - } -} {1 2 3 24 30 44 57 67 scan 0 sort 0} -do_test where7-2.377.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 26 AND 28) AND a!=27) - OR f='wxyzabcde' - OR (g='kjihgfe' AND f GLOB 'rstuv*') - OR (g='wvutsrq' AND f GLOB 'klmno*') - OR a=46 - ORDER BY a - } -} {10 22 26 28 46 48 69 74 100 scan 0 sort 0} -do_test where7-2.377.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 26 AND 28) AND a!=27) - OR f='wxyzabcde' - OR (g='kjihgfe' AND f GLOB 'rstuv*') - OR (g='wvutsrq' AND f GLOB 'klmno*') - OR a=46 - ORDER BY a - } -} {10 22 26 28 46 48 69 74 100 scan 0 sort 0} -do_test where7-2.378.1 { - count_steps { - SELECT a FROM t2 - WHERE f='abcdefghi' - OR ((a BETWEEN 61 AND 63) AND a!=62) - OR a=18 - OR a=42 - OR a=77 - OR b=605 - ORDER BY a - } -} {18 26 42 52 55 61 63 77 78 scan 0 sort 0} -do_test where7-2.378.2 { - count_steps { - SELECT a FROM t3 - WHERE f='abcdefghi' - OR ((a BETWEEN 61 AND 63) AND a!=62) - OR a=18 - OR a=42 - OR a=77 - OR b=605 - ORDER BY a - } -} {18 26 42 52 55 61 63 77 78 scan 0 sort 0} -do_test where7-2.379.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='srqponm' AND f GLOB 'fghij*') - OR ((a BETWEEN 79 AND 81) AND a!=80) - OR a=65 - OR c=22022 - OR ((a BETWEEN 42 AND 44) AND a!=43) - OR (d>=61.0 AND d<62.0 AND d NOT NULL) - OR c=31031 - ORDER BY a - } -} {31 42 44 61 64 65 66 79 81 91 92 93 scan 0 sort 0} -do_test where7-2.379.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='srqponm' AND f GLOB 'fghij*') - OR ((a BETWEEN 79 AND 81) AND a!=80) - OR a=65 - OR c=22022 - OR ((a BETWEEN 42 AND 44) AND a!=43) - OR (d>=61.0 AND d<62.0 AND d NOT NULL) - OR c=31031 - ORDER BY a - } -} {31 42 44 61 64 65 66 79 81 91 92 93 scan 0 sort 0} -do_test where7-2.380.1 { - count_steps { - SELECT a FROM t2 - WHERE c=12012 - OR b=792 - ORDER BY a - } -} {34 35 36 72 scan 0 sort 0} -do_test where7-2.380.2 { - count_steps { - SELECT a FROM t3 - WHERE c=12012 - OR b=792 - ORDER BY a - } -} {34 35 36 72 scan 0 sort 0} -do_test where7-2.381.1 { - count_steps { - SELECT a FROM t2 - WHERE b=880 - OR (d>=32.0 AND d<33.0 AND d NOT NULL) - OR b=443 - OR ((a BETWEEN 29 AND 31) AND a!=30) - ORDER BY a - } -} {29 31 32 80 scan 0 sort 0} -do_test where7-2.381.2 { - count_steps { - SELECT a FROM t3 - WHERE b=880 - OR (d>=32.0 AND d<33.0 AND d NOT NULL) - OR b=443 - OR ((a BETWEEN 29 AND 31) AND a!=30) - ORDER BY a - } -} {29 31 32 80 scan 0 sort 0} -do_test where7-2.382.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 92 AND 94) AND a!=93) - OR b=707 - OR a=26 - OR (d>=67.0 AND d<68.0 AND d NOT NULL) - OR ((a BETWEEN 81 AND 83) AND a!=82) - OR (d>=62.0 AND d<63.0 AND d NOT NULL) - ORDER BY a - } -} {26 62 67 81 83 92 94 scan 0 sort 0} -do_test where7-2.382.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 92 AND 94) AND a!=93) - OR b=707 - OR a=26 - OR (d>=67.0 AND d<68.0 AND d NOT NULL) - OR ((a BETWEEN 81 AND 83) AND a!=82) - OR (d>=62.0 AND d<63.0 AND d NOT NULL) - ORDER BY a - } -} {26 62 67 81 83 92 94 scan 0 sort 0} -do_test where7-2.383.1 { - count_steps { - SELECT a FROM t2 - WHERE a=55 - OR a=45 - OR b=25 - OR b=982 - OR b=696 - OR a=83 - OR f='pqrstuvwx' - ORDER BY a - } -} {15 41 45 55 67 83 93 scan 0 sort 0} -do_test where7-2.383.2 { - count_steps { - SELECT a FROM t3 - WHERE a=55 - OR a=45 - OR b=25 - OR b=982 - OR b=696 - OR a=83 - OR f='pqrstuvwx' - ORDER BY a - } -} {15 41 45 55 67 83 93 scan 0 sort 0} -do_test where7-2.384.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 17 AND 19) AND a!=18) - OR a=84 - OR (g='fedcbaz' AND f GLOB 'rstuv*') - OR (d>=65.0 AND d<66.0 AND d NOT NULL) - OR b=891 - OR ((a BETWEEN 78 AND 80) AND a!=79) - OR (g='ihgfedc' AND f GLOB 'efghi*') - ORDER BY a - } -} {17 19 65 78 80 81 82 84 95 scan 0 sort 0} -do_test where7-2.384.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 17 AND 19) AND a!=18) - OR a=84 - OR (g='fedcbaz' AND f GLOB 'rstuv*') - OR (d>=65.0 AND d<66.0 AND d NOT NULL) - OR b=891 - OR ((a BETWEEN 78 AND 80) AND a!=79) - OR (g='ihgfedc' AND f GLOB 'efghi*') - ORDER BY a - } -} {17 19 65 78 80 81 82 84 95 scan 0 sort 0} -do_test where7-2.385.1 { - count_steps { - SELECT a FROM t2 - WHERE b=484 - OR ((a BETWEEN 63 AND 65) AND a!=64) - OR (g='xwvutsr' AND f GLOB 'defgh*') - OR (d>=5.0 AND d<6.0 AND d NOT NULL) - OR a=89 - OR a=34 - OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') - ORDER BY a - } -} {3 5 14 34 40 44 63 65 66 89 92 scan 0 sort 0} -do_test where7-2.385.2 { - count_steps { - SELECT a FROM t3 - WHERE b=484 - OR ((a BETWEEN 63 AND 65) AND a!=64) - OR (g='xwvutsr' AND f GLOB 'defgh*') - OR (d>=5.0 AND d<6.0 AND d NOT NULL) - OR a=89 - OR a=34 - OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') - ORDER BY a - } -} {3 5 14 34 40 44 63 65 66 89 92 scan 0 sort 0} -do_test where7-2.386.1 { - count_steps { - SELECT a FROM t2 - WHERE b=275 - OR f IS NULL - OR (d>=38.0 AND d<39.0 AND d NOT NULL) - OR ((a BETWEEN 89 AND 91) AND a!=90) - OR a=99 - ORDER BY a - } -} {25 38 89 91 99 scan 0 sort 0} -do_test where7-2.386.2 { - count_steps { - SELECT a FROM t3 - WHERE b=275 - OR f IS NULL - OR (d>=38.0 AND d<39.0 AND d NOT NULL) - OR ((a BETWEEN 89 AND 91) AND a!=90) - OR a=99 - ORDER BY a - } -} {25 38 89 91 99 scan 0 sort 0} -do_test where7-2.387.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=72.0 AND d<73.0 AND d NOT NULL) - OR ((a BETWEEN 27 AND 29) AND a!=28) - OR (g='wvutsrq' AND f GLOB 'klmno*') - OR b=330 - OR (d>=86.0 AND d<87.0 AND d NOT NULL) - ORDER BY a - } -} {10 27 29 30 72 86 scan 0 sort 0} -do_test where7-2.387.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=72.0 AND d<73.0 AND d NOT NULL) - OR ((a BETWEEN 27 AND 29) AND a!=28) - OR (g='wvutsrq' AND f GLOB 'klmno*') - OR b=330 - OR (d>=86.0 AND d<87.0 AND d NOT NULL) - ORDER BY a - } -} {10 27 29 30 72 86 scan 0 sort 0} -do_test where7-2.388.1 { - count_steps { - SELECT a FROM t2 - WHERE (f GLOB '?qrst*' AND f GLOB 'pqrs*') - OR ((a BETWEEN 86 AND 88) AND a!=87) - OR b=1026 - OR ((a BETWEEN 63 AND 65) AND a!=64) - OR a=30 - OR b=619 - ORDER BY a - } -} {15 30 41 63 65 67 86 88 93 scan 0 sort 0} -do_test where7-2.388.2 { - count_steps { - SELECT a FROM t3 - WHERE (f GLOB '?qrst*' AND f GLOB 'pqrs*') - OR ((a BETWEEN 86 AND 88) AND a!=87) - OR b=1026 - OR ((a BETWEEN 63 AND 65) AND a!=64) - OR a=30 - OR b=619 - ORDER BY a - } -} {15 30 41 63 65 67 86 88 93 scan 0 sort 0} -do_test where7-2.389.1 { - count_steps { - SELECT a FROM t2 - WHERE b=638 - OR ((a BETWEEN 62 AND 64) AND a!=63) - ORDER BY a - } -} {58 62 64 scan 0 sort 0} -do_test where7-2.389.2 { - count_steps { - SELECT a FROM t3 - WHERE b=638 - OR ((a BETWEEN 62 AND 64) AND a!=63) - ORDER BY a - } -} {58 62 64 scan 0 sort 0} -do_test where7-2.390.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 96 AND 98) AND a!=97) - OR b=814 - OR ((a BETWEEN 52 AND 54) AND a!=53) - OR f='pqrstuvwx' - OR a=29 - ORDER BY a - } -} {15 29 41 52 54 67 74 93 96 98 scan 0 sort 0} -do_test where7-2.390.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 96 AND 98) AND a!=97) - OR b=814 - OR ((a BETWEEN 52 AND 54) AND a!=53) - OR f='pqrstuvwx' - OR a=29 - ORDER BY a - } -} {15 29 41 52 54 67 74 93 96 98 scan 0 sort 0} -do_test where7-2.391.1 { - count_steps { - SELECT a FROM t2 - WHERE (f GLOB '?tuvw*' AND f GLOB 'stuv*') - OR b=847 - OR (f GLOB '?ghij*' AND f GLOB 'fghi*') - ORDER BY a - } -} {5 18 31 44 57 70 77 83 96 scan 0 sort 0} -do_test where7-2.391.2 { - count_steps { - SELECT a FROM t3 - WHERE (f GLOB '?tuvw*' AND f GLOB 'stuv*') - OR b=847 - OR (f GLOB '?ghij*' AND f GLOB 'fghi*') - ORDER BY a - } -} {5 18 31 44 57 70 77 83 96 scan 0 sort 0} -do_test where7-2.392.1 { - count_steps { - SELECT a FROM t2 - WHERE b=256 - OR b=597 - OR b=264 - OR ((a BETWEEN 5 AND 7) AND a!=6) - OR a=72 - OR (g='xwvutsr' AND f GLOB 'defgh*') - OR b=641 - OR (g='nmlkjih' AND f GLOB 'cdefg*') - OR b=586 - ORDER BY a - } -} {3 5 7 24 54 72 scan 0 sort 0} -do_test where7-2.392.2 { - count_steps { - SELECT a FROM t3 - WHERE b=256 - OR b=597 - OR b=264 - OR ((a BETWEEN 5 AND 7) AND a!=6) - OR a=72 - OR (g='xwvutsr' AND f GLOB 'defgh*') - OR b=641 - OR (g='nmlkjih' AND f GLOB 'cdefg*') - OR b=586 - ORDER BY a - } -} {3 5 7 24 54 72 scan 0 sort 0} -do_test where7-2.393.1 { - count_steps { - SELECT a FROM t2 - WHERE b=982 - OR ((a BETWEEN 12 AND 14) AND a!=13) - OR c=8008 - OR b=927 - OR (f GLOB '?zabc*' AND f GLOB 'yzab*') - OR ((a BETWEEN 18 AND 20) AND a!=19) - OR c=6006 - ORDER BY a - } -} {12 14 16 17 18 20 22 23 24 50 76 scan 0 sort 0} -do_test where7-2.393.2 { - count_steps { - SELECT a FROM t3 - WHERE b=982 - OR ((a BETWEEN 12 AND 14) AND a!=13) - OR c=8008 - OR b=927 - OR (f GLOB '?zabc*' AND f GLOB 'yzab*') - OR ((a BETWEEN 18 AND 20) AND a!=19) - OR c=6006 - ORDER BY a - } -} {12 14 16 17 18 20 22 23 24 50 76 scan 0 sort 0} -do_test where7-2.394.1 { - count_steps { - SELECT a FROM t2 - WHERE b=847 - OR ((a BETWEEN 2 AND 4) AND a!=3) - OR a=50 - OR ((a BETWEEN 57 AND 59) AND a!=58) - OR ((a BETWEEN 58 AND 60) AND a!=59) - ORDER BY a - } -} {2 4 50 57 58 59 60 77 scan 0 sort 0} -do_test where7-2.394.2 { - count_steps { - SELECT a FROM t3 - WHERE b=847 - OR ((a BETWEEN 2 AND 4) AND a!=3) - OR a=50 - OR ((a BETWEEN 57 AND 59) AND a!=58) - OR ((a BETWEEN 58 AND 60) AND a!=59) - ORDER BY a - } -} {2 4 50 57 58 59 60 77 scan 0 sort 0} -do_test where7-2.395.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='hgfedcb' AND f GLOB 'jklmn*') - OR (d>=43.0 AND d<44.0 AND d NOT NULL) - OR a=20 - OR (d>=100.0 AND d<101.0 AND d NOT NULL) - OR b=869 - OR ((a BETWEEN 37 AND 39) AND a!=38) - OR (g='qponmlk' AND f GLOB 'opqrs*') - OR (d>=42.0 AND d<43.0 AND d NOT NULL) - OR a=52 - ORDER BY a - } -} {20 37 39 40 42 43 52 79 87 100 scan 0 sort 0} -do_test where7-2.395.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='hgfedcb' AND f GLOB 'jklmn*') - OR (d>=43.0 AND d<44.0 AND d NOT NULL) - OR a=20 - OR (d>=100.0 AND d<101.0 AND d NOT NULL) - OR b=869 - OR ((a BETWEEN 37 AND 39) AND a!=38) - OR (g='qponmlk' AND f GLOB 'opqrs*') - OR (d>=42.0 AND d<43.0 AND d NOT NULL) - OR a=52 - ORDER BY a - } -} {20 37 39 40 42 43 52 79 87 100 scan 0 sort 0} -do_test where7-2.396.1 { - count_steps { - SELECT a FROM t2 - WHERE a=8 - OR a=60 - OR ((a BETWEEN 70 AND 72) AND a!=71) - OR b=352 - OR ((a BETWEEN 46 AND 48) AND a!=47) - OR b=847 - OR (d>=25.0 AND d<26.0 AND d NOT NULL) - OR a=54 - OR ((a BETWEEN 85 AND 87) AND a!=86) - OR b=671 - OR a=98 - ORDER BY a - } -} {8 25 32 46 48 54 60 61 70 72 77 85 87 98 scan 0 sort 0} -do_test where7-2.396.2 { - count_steps { - SELECT a FROM t3 - WHERE a=8 - OR a=60 - OR ((a BETWEEN 70 AND 72) AND a!=71) - OR b=352 - OR ((a BETWEEN 46 AND 48) AND a!=47) - OR b=847 - OR (d>=25.0 AND d<26.0 AND d NOT NULL) - OR a=54 - OR ((a BETWEEN 85 AND 87) AND a!=86) - OR b=671 - OR a=98 - ORDER BY a - } -} {8 25 32 46 48 54 60 61 70 72 77 85 87 98 scan 0 sort 0} -do_test where7-2.397.1 { - count_steps { - SELECT a FROM t2 - WHERE b=212 - OR (g='tsrqpon' AND f GLOB 'bcdef*') - OR b=583 - OR ((a BETWEEN 97 AND 99) AND a!=98) - ORDER BY a - } -} {27 53 97 99 scan 0 sort 0} -do_test where7-2.397.2 { - count_steps { - SELECT a FROM t3 - WHERE b=212 - OR (g='tsrqpon' AND f GLOB 'bcdef*') - OR b=583 - OR ((a BETWEEN 97 AND 99) AND a!=98) - ORDER BY a - } -} {27 53 97 99 scan 0 sort 0} -do_test where7-2.398.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 8 AND 10) AND a!=9) - OR ((a BETWEEN 68 AND 70) AND a!=69) - OR (d>=73.0 AND d<74.0 AND d NOT NULL) - OR b=25 - OR (d>=95.0 AND d<96.0 AND d NOT NULL) - OR (g='kjihgfe' AND f GLOB 'stuvw*') - OR c=8008 - OR (g='tsrqpon' AND f GLOB 'zabcd*') - OR b=759 - OR ((a BETWEEN 58 AND 60) AND a!=59) - OR a=89 - ORDER BY a - } -} {8 10 22 23 24 25 58 60 68 69 70 73 89 95 scan 0 sort 0} -do_test where7-2.398.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 8 AND 10) AND a!=9) - OR ((a BETWEEN 68 AND 70) AND a!=69) - OR (d>=73.0 AND d<74.0 AND d NOT NULL) - OR b=25 - OR (d>=95.0 AND d<96.0 AND d NOT NULL) - OR (g='kjihgfe' AND f GLOB 'stuvw*') - OR c=8008 - OR (g='tsrqpon' AND f GLOB 'zabcd*') - OR b=759 - OR ((a BETWEEN 58 AND 60) AND a!=59) - OR a=89 - ORDER BY a - } -} {8 10 22 23 24 25 58 60 68 69 70 73 89 95 scan 0 sort 0} -do_test where7-2.399.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=98.0 AND d<99.0 AND d NOT NULL) - OR b=113 - OR ((a BETWEEN 87 AND 89) AND a!=88) - ORDER BY a - } -} {87 89 98 scan 0 sort 0} -do_test where7-2.399.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=98.0 AND d<99.0 AND d NOT NULL) - OR b=113 - OR ((a BETWEEN 87 AND 89) AND a!=88) - ORDER BY a - } -} {87 89 98 scan 0 sort 0} -do_test where7-2.400.1 { - count_steps { - SELECT a FROM t2 - WHERE b=267 - OR (d>=81.0 AND d<82.0 AND d NOT NULL) - OR b=652 - OR b=605 - OR (d>=100.0 AND d<101.0 AND d NOT NULL) - OR a=91 - OR c=28028 - OR (g='xwvutsr' AND f GLOB 'defgh*') - OR b=792 - ORDER BY a - } -} {3 55 72 81 82 83 84 91 100 scan 0 sort 0} -do_test where7-2.400.2 { - count_steps { - SELECT a FROM t3 - WHERE b=267 - OR (d>=81.0 AND d<82.0 AND d NOT NULL) - OR b=652 - OR b=605 - OR (d>=100.0 AND d<101.0 AND d NOT NULL) - OR a=91 - OR c=28028 - OR (g='xwvutsr' AND f GLOB 'defgh*') - OR b=792 - ORDER BY a - } -} {3 55 72 81 82 83 84 91 100 scan 0 sort 0} -do_test where7-2.401.1 { - count_steps { - SELECT a FROM t2 - WHERE b=762 - OR (d>=62.0 AND d<63.0 AND d NOT NULL) - OR (d>=14.0 AND d<15.0 AND d NOT NULL) - OR ((a BETWEEN 92 AND 94) AND a!=93) - OR (g='fedcbaz' AND f GLOB 'rstuv*') - ORDER BY a - } -} {14 62 92 94 95 scan 0 sort 0} -do_test where7-2.401.2 { - count_steps { - SELECT a FROM t3 - WHERE b=762 - OR (d>=62.0 AND d<63.0 AND d NOT NULL) - OR (d>=14.0 AND d<15.0 AND d NOT NULL) - OR ((a BETWEEN 92 AND 94) AND a!=93) - OR (g='fedcbaz' AND f GLOB 'rstuv*') - ORDER BY a - } -} {14 62 92 94 95 scan 0 sort 0} -do_test where7-2.402.1 { - count_steps { - SELECT a FROM t2 - WHERE b=190 - OR ((a BETWEEN 51 AND 53) AND a!=52) - OR a=93 - OR a=68 - OR b=91 - OR b=586 - OR (d>=24.0 AND d<25.0 AND d NOT NULL) - ORDER BY a - } -} {24 51 53 68 93 scan 0 sort 0} -do_test where7-2.402.2 { - count_steps { - SELECT a FROM t3 - WHERE b=190 - OR ((a BETWEEN 51 AND 53) AND a!=52) - OR a=93 - OR a=68 - OR b=91 - OR b=586 - OR (d>=24.0 AND d<25.0 AND d NOT NULL) - ORDER BY a - } -} {24 51 53 68 93 scan 0 sort 0} -do_test where7-2.403.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='mlkjihg' AND f GLOB 'jklmn*') - OR b=880 - OR (g='mlkjihg' AND f GLOB 'klmno*') - ORDER BY a - } -} {61 62 80 scan 0 sort 0} -do_test where7-2.403.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='mlkjihg' AND f GLOB 'jklmn*') - OR b=880 - OR (g='mlkjihg' AND f GLOB 'klmno*') - ORDER BY a - } -} {61 62 80 scan 0 sort 0} -do_test where7-2.404.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='mlkjihg' AND f GLOB 'jklmn*') - OR (d>=75.0 AND d<76.0 AND d NOT NULL) - OR b=627 - OR (g='onmlkji' AND f GLOB 'wxyza*') - OR b=616 - OR a=35 - OR a=24 - OR b=839 - OR a=42 - OR b=297 - ORDER BY a - } -} {24 27 35 42 48 56 57 61 75 scan 0 sort 0} -do_test where7-2.404.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='mlkjihg' AND f GLOB 'jklmn*') - OR (d>=75.0 AND d<76.0 AND d NOT NULL) - OR b=627 - OR (g='onmlkji' AND f GLOB 'wxyza*') - OR b=616 - OR a=35 - OR a=24 - OR b=839 - OR a=42 - OR b=297 - ORDER BY a - } -} {24 27 35 42 48 56 57 61 75 scan 0 sort 0} -do_test where7-2.405.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='fedcbaz' AND f GLOB 'rstuv*') - OR ((a BETWEEN 5 AND 7) AND a!=6) - OR b=36 - OR ((a BETWEEN 99 AND 101) AND a!=100) - OR (f GLOB '?mnop*' AND f GLOB 'lmno*') - OR b=25 - ORDER BY a - } -} {5 7 11 37 63 89 95 99 scan 0 sort 0} -do_test where7-2.405.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='fedcbaz' AND f GLOB 'rstuv*') - OR ((a BETWEEN 5 AND 7) AND a!=6) - OR b=36 - OR ((a BETWEEN 99 AND 101) AND a!=100) - OR (f GLOB '?mnop*' AND f GLOB 'lmno*') - OR b=25 - ORDER BY a - } -} {5 7 11 37 63 89 95 99 scan 0 sort 0} -do_test where7-2.406.1 { - count_steps { - SELECT a FROM t2 - WHERE b=740 - OR ((a BETWEEN 90 AND 92) AND a!=91) - OR (g='jihgfed' AND f GLOB 'wxyza*') - OR (d>=77.0 AND d<78.0 AND d NOT NULL) - OR (d>=96.0 AND d<97.0 AND d NOT NULL) - ORDER BY a - } -} {74 77 90 92 96 scan 0 sort 0} -do_test where7-2.406.2 { - count_steps { - SELECT a FROM t3 - WHERE b=740 - OR ((a BETWEEN 90 AND 92) AND a!=91) - OR (g='jihgfed' AND f GLOB 'wxyza*') - OR (d>=77.0 AND d<78.0 AND d NOT NULL) - OR (d>=96.0 AND d<97.0 AND d NOT NULL) - ORDER BY a - } -} {74 77 90 92 96 scan 0 sort 0} -do_test where7-2.407.1 { - count_steps { - SELECT a FROM t2 - WHERE f='hijklmnop' - OR (d>=20.0 AND d<21.0 AND d NOT NULL) - OR (g='wvutsrq' AND f GLOB 'ijklm*') - OR b=528 - OR (g='xwvutsr' AND f GLOB 'defgh*') - ORDER BY a - } -} {3 7 8 20 33 48 59 85 scan 0 sort 0} -do_test where7-2.407.2 { - count_steps { - SELECT a FROM t3 - WHERE f='hijklmnop' - OR (d>=20.0 AND d<21.0 AND d NOT NULL) - OR (g='wvutsrq' AND f GLOB 'ijklm*') - OR b=528 - OR (g='xwvutsr' AND f GLOB 'defgh*') - ORDER BY a - } -} {3 7 8 20 33 48 59 85 scan 0 sort 0} -do_test where7-2.408.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=33.0 AND d<34.0 AND d NOT NULL) - OR (g='vutsrqp' AND f GLOB 'opqrs*') - OR b=253 - OR (f GLOB '?zabc*' AND f GLOB 'yzab*') - OR b=869 - OR (d>=22.0 AND d<23.0 AND d NOT NULL) - ORDER BY a - } -} {14 22 23 24 33 50 76 79 scan 0 sort 0} -do_test where7-2.408.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=33.0 AND d<34.0 AND d NOT NULL) - OR (g='vutsrqp' AND f GLOB 'opqrs*') - OR b=253 - OR (f GLOB '?zabc*' AND f GLOB 'yzab*') - OR b=869 - OR (d>=22.0 AND d<23.0 AND d NOT NULL) - ORDER BY a - } -} {14 22 23 24 33 50 76 79 scan 0 sort 0} -do_test where7-2.409.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=26.0 AND d<27.0 AND d NOT NULL) - OR ((a BETWEEN 57 AND 59) AND a!=58) - ORDER BY a - } -} {26 57 59 scan 0 sort 0} -do_test where7-2.409.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=26.0 AND d<27.0 AND d NOT NULL) - OR ((a BETWEEN 57 AND 59) AND a!=58) - ORDER BY a - } -} {26 57 59 scan 0 sort 0} -do_test where7-2.410.1 { - count_steps { - SELECT a FROM t2 - WHERE b=781 - OR ((a BETWEEN 33 AND 35) AND a!=34) - ORDER BY a - } -} {33 35 71 scan 0 sort 0} -do_test where7-2.410.2 { - count_steps { - SELECT a FROM t3 - WHERE b=781 - OR ((a BETWEEN 33 AND 35) AND a!=34) - ORDER BY a - } -} {33 35 71 scan 0 sort 0} -do_test where7-2.411.1 { - count_steps { - SELECT a FROM t2 - WHERE b=803 - OR (g='mlkjihg' AND f GLOB 'jklmn*') - OR ((a BETWEEN 61 AND 63) AND a!=62) - OR (g='jihgfed' AND f GLOB 'xyzab*') - OR (g='nmlkjih' AND f GLOB 'cdefg*') - OR ((a BETWEEN 98 AND 100) AND a!=99) - OR b=1059 - OR (g='ponmlkj' AND f GLOB 'stuvw*') - OR ((a BETWEEN 30 AND 32) AND a!=31) - ORDER BY a - } -} {30 32 44 54 61 63 73 75 98 100 scan 0 sort 0} -do_test where7-2.411.2 { - count_steps { - SELECT a FROM t3 - WHERE b=803 - OR (g='mlkjihg' AND f GLOB 'jklmn*') - OR ((a BETWEEN 61 AND 63) AND a!=62) - OR (g='jihgfed' AND f GLOB 'xyzab*') - OR (g='nmlkjih' AND f GLOB 'cdefg*') - OR ((a BETWEEN 98 AND 100) AND a!=99) - OR b=1059 - OR (g='ponmlkj' AND f GLOB 'stuvw*') - OR ((a BETWEEN 30 AND 32) AND a!=31) - ORDER BY a - } -} {30 32 44 54 61 63 73 75 98 100 scan 0 sort 0} -do_test where7-2.412.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 82 AND 84) AND a!=83) - OR (g='rqponml' AND f GLOB 'klmno*') - OR b=1056 - OR a=49 - OR b=451 - OR ((a BETWEEN 88 AND 90) AND a!=89) - OR b=509 - OR c=32032 - OR (g='utsrqpo' AND f GLOB 'vwxyz*') - OR a=4 - ORDER BY a - } -} {4 21 36 41 49 82 84 88 90 94 95 96 scan 0 sort 0} -do_test where7-2.412.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 82 AND 84) AND a!=83) - OR (g='rqponml' AND f GLOB 'klmno*') - OR b=1056 - OR a=49 - OR b=451 - OR ((a BETWEEN 88 AND 90) AND a!=89) - OR b=509 - OR c=32032 - OR (g='utsrqpo' AND f GLOB 'vwxyz*') - OR a=4 - ORDER BY a - } -} {4 21 36 41 49 82 84 88 90 94 95 96 scan 0 sort 0} -do_test where7-2.413.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 16 AND 18) AND a!=17) - OR (d>=22.0 AND d<23.0 AND d NOT NULL) - OR b=726 - OR ((a BETWEEN 57 AND 59) AND a!=58) - OR (d>=59.0 AND d<60.0 AND d NOT NULL) - OR (g='vutsrqp' AND f GLOB 'opqrs*') - OR b=11 - OR (g='vutsrqp' AND f GLOB 'qrstu*') - OR ((a BETWEEN 37 AND 39) AND a!=38) - OR b=121 - OR (d>=87.0 AND d<88.0 AND d NOT NULL) - ORDER BY a - } -} {1 11 14 16 18 22 37 39 57 59 66 87 scan 0 sort 0} -do_test where7-2.413.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 16 AND 18) AND a!=17) - OR (d>=22.0 AND d<23.0 AND d NOT NULL) - OR b=726 - OR ((a BETWEEN 57 AND 59) AND a!=58) - OR (d>=59.0 AND d<60.0 AND d NOT NULL) - OR (g='vutsrqp' AND f GLOB 'opqrs*') - OR b=11 - OR (g='vutsrqp' AND f GLOB 'qrstu*') - OR ((a BETWEEN 37 AND 39) AND a!=38) - OR b=121 - OR (d>=87.0 AND d<88.0 AND d NOT NULL) - ORDER BY a - } -} {1 11 14 16 18 22 37 39 57 59 66 87 scan 0 sort 0} -do_test where7-2.414.1 { - count_steps { - SELECT a FROM t2 - WHERE c<=10 - OR (d>=48.0 AND d<49.0 AND d NOT NULL) - OR ((a BETWEEN 83 AND 85) AND a!=84) - OR (g='onmlkji' AND f GLOB 'yzabc*') - OR a=43 - OR b=553 - OR b=377 - OR b=462 - OR (f GLOB '?opqr*' AND f GLOB 'nopq*') - OR b=198 - ORDER BY a - } -} {13 18 39 42 43 48 50 65 83 85 91 scan 0 sort 0} -do_test where7-2.414.2 { - count_steps { - SELECT a FROM t3 - WHERE c<=10 - OR (d>=48.0 AND d<49.0 AND d NOT NULL) - OR ((a BETWEEN 83 AND 85) AND a!=84) - OR (g='onmlkji' AND f GLOB 'yzabc*') - OR a=43 - OR b=553 - OR b=377 - OR b=462 - OR (f GLOB '?opqr*' AND f GLOB 'nopq*') - OR b=198 - ORDER BY a - } -} {13 18 39 42 43 48 50 65 83 85 91 scan 0 sort 0} -do_test where7-2.415.1 { - count_steps { - SELECT a FROM t2 - WHERE 1000000=30.0 AND d<31.0 AND d NOT NULL) - OR c>=34035 - OR (f GLOB '?yzab*' AND f GLOB 'xyza*') - OR b=718 - OR c=29029 - ORDER BY a - } -} {17 23 30 43 49 54 56 69 75 85 86 87 90 95 scan 0 sort 0} -do_test where7-2.415.2 { - count_steps { - SELECT a FROM t3 - WHERE 1000000=30.0 AND d<31.0 AND d NOT NULL) - OR c>=34035 - OR (f GLOB '?yzab*' AND f GLOB 'xyza*') - OR b=718 - OR c=29029 - ORDER BY a - } -} {17 23 30 43 49 54 56 69 75 85 86 87 90 95 scan 0 sort 0} -do_test where7-2.416.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=16.0 AND d<17.0 AND d NOT NULL) - OR c=34034 - OR b=704 - OR b=938 - OR (d>=36.0 AND d<37.0 AND d NOT NULL) - ORDER BY a - } -} {16 36 64 100 scan 0 sort 0} -do_test where7-2.416.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=16.0 AND d<17.0 AND d NOT NULL) - OR c=34034 - OR b=704 - OR b=938 - OR (d>=36.0 AND d<37.0 AND d NOT NULL) - ORDER BY a - } -} {16 36 64 100 scan 0 sort 0} -do_test where7-2.417.1 { - count_steps { - SELECT a FROM t2 - WHERE b=1092 - OR f='tuvwxyzab' - OR c=12012 - ORDER BY a - } -} {19 34 35 36 45 71 97 scan 0 sort 0} -do_test where7-2.417.2 { - count_steps { - SELECT a FROM t3 - WHERE b=1092 - OR f='tuvwxyzab' - OR c=12012 - ORDER BY a - } -} {19 34 35 36 45 71 97 scan 0 sort 0} -do_test where7-2.418.1 { - count_steps { - SELECT a FROM t2 - WHERE c=19019 - OR a=53 - OR b=396 - ORDER BY a - } -} {36 53 55 56 57 scan 0 sort 0} -do_test where7-2.418.2 { - count_steps { - SELECT a FROM t3 - WHERE c=19019 - OR a=53 - OR b=396 - ORDER BY a - } -} {36 53 55 56 57 scan 0 sort 0} -do_test where7-2.419.1 { - count_steps { - SELECT a FROM t2 - WHERE f IS NULL - OR b=531 - OR a=55 - OR b=990 - ORDER BY a - } -} {55 90 scan 0 sort 0} -do_test where7-2.419.2 { - count_steps { - SELECT a FROM t3 - WHERE f IS NULL - OR b=531 - OR a=55 - OR b=990 - ORDER BY a - } -} {55 90 scan 0 sort 0} -do_test where7-2.420.1 { - count_steps { - SELECT a FROM t2 - WHERE f='opqrstuvw' - OR (d>=23.0 AND d<24.0 AND d NOT NULL) - OR (g='onmlkji' AND f GLOB 'abcde*') - OR f='tuvwxyzab' - OR a=89 - OR b=135 - ORDER BY a - } -} {14 19 23 40 45 52 66 71 89 92 97 scan 0 sort 0} -do_test where7-2.420.2 { - count_steps { - SELECT a FROM t3 - WHERE f='opqrstuvw' - OR (d>=23.0 AND d<24.0 AND d NOT NULL) - OR (g='onmlkji' AND f GLOB 'abcde*') - OR f='tuvwxyzab' - OR a=89 - OR b=135 - ORDER BY a - } -} {14 19 23 40 45 52 66 71 89 92 97 scan 0 sort 0} -do_test where7-2.421.1 { - count_steps { - SELECT a FROM t2 - WHERE b=399 - OR f='yzabcdefg' - OR ((a BETWEEN 62 AND 64) AND a!=63) - OR ((a BETWEEN 42 AND 44) AND a!=43) - OR (g='vutsrqp' AND f GLOB 'qrstu*') - OR ((a BETWEEN 51 AND 53) AND a!=52) - OR ((a BETWEEN 2 AND 4) AND a!=3) - OR (d>=9.0 AND d<10.0 AND d NOT NULL) - ORDER BY a - } -} {2 4 9 16 24 42 44 50 51 53 62 64 76 scan 0 sort 0} -do_test where7-2.421.2 { - count_steps { - SELECT a FROM t3 - WHERE b=399 - OR f='yzabcdefg' - OR ((a BETWEEN 62 AND 64) AND a!=63) - OR ((a BETWEEN 42 AND 44) AND a!=43) - OR (g='vutsrqp' AND f GLOB 'qrstu*') - OR ((a BETWEEN 51 AND 53) AND a!=52) - OR ((a BETWEEN 2 AND 4) AND a!=3) - OR (d>=9.0 AND d<10.0 AND d NOT NULL) - ORDER BY a - } -} {2 4 9 16 24 42 44 50 51 53 62 64 76 scan 0 sort 0} -do_test where7-2.422.1 { - count_steps { - SELECT a FROM t2 - WHERE b=858 - OR a=23 - OR b=506 - OR (g='onmlkji' AND f GLOB 'wxyza*') - OR c=19019 - OR b=363 - ORDER BY a - } -} {23 33 46 48 55 56 57 78 scan 0 sort 0} -do_test where7-2.422.2 { - count_steps { - SELECT a FROM t3 - WHERE b=858 - OR a=23 - OR b=506 - OR (g='onmlkji' AND f GLOB 'wxyza*') - OR c=19019 - OR b=363 - ORDER BY a - } -} {23 33 46 48 55 56 57 78 scan 0 sort 0} -do_test where7-2.423.1 { - count_steps { - SELECT a FROM t2 - WHERE a=38 - OR (d>=54.0 AND d<55.0 AND d NOT NULL) - OR ((a BETWEEN 20 AND 22) AND a!=21) - OR a=5 - OR b=286 - OR (g='utsrqpo' AND f GLOB 'wxyza*') - OR (d>=47.0 AND d<48.0 AND d NOT NULL) - OR (g='qponmlk' AND f GLOB 'mnopq*') - ORDER BY a - } -} {5 20 22 26 38 47 54 scan 0 sort 0} -do_test where7-2.423.2 { - count_steps { - SELECT a FROM t3 - WHERE a=38 - OR (d>=54.0 AND d<55.0 AND d NOT NULL) - OR ((a BETWEEN 20 AND 22) AND a!=21) - OR a=5 - OR b=286 - OR (g='utsrqpo' AND f GLOB 'wxyza*') - OR (d>=47.0 AND d<48.0 AND d NOT NULL) - OR (g='qponmlk' AND f GLOB 'mnopq*') - ORDER BY a - } -} {5 20 22 26 38 47 54 scan 0 sort 0} -do_test where7-2.424.1 { - count_steps { - SELECT a FROM t2 - WHERE b=506 - OR b=550 - OR b=1089 - OR b=267 - OR (d>=68.0 AND d<69.0 AND d NOT NULL) - OR f='wxyzabcde' - OR (g='srqponm' AND f GLOB 'ghijk*') - OR b=814 - ORDER BY a - } -} {22 32 46 48 50 68 74 99 100 scan 0 sort 0} -do_test where7-2.424.2 { - count_steps { - SELECT a FROM t3 - WHERE b=506 - OR b=550 - OR b=1089 - OR b=267 - OR (d>=68.0 AND d<69.0 AND d NOT NULL) - OR f='wxyzabcde' - OR (g='srqponm' AND f GLOB 'ghijk*') - OR b=814 - ORDER BY a - } -} {22 32 46 48 50 68 74 99 100 scan 0 sort 0} -do_test where7-2.425.1 { - count_steps { - SELECT a FROM t2 - WHERE f='bcdefghij' - OR b=506 - OR f='opqrstuvw' - OR (d>=69.0 AND d<70.0 AND d NOT NULL) - OR ((a BETWEEN 18 AND 20) AND a!=19) - OR ((a BETWEEN 10 AND 12) AND a!=11) - ORDER BY a - } -} {1 10 12 14 18 20 27 40 46 53 66 69 79 92 scan 0 sort 0} -do_test where7-2.425.2 { - count_steps { - SELECT a FROM t3 - WHERE f='bcdefghij' - OR b=506 - OR f='opqrstuvw' - OR (d>=69.0 AND d<70.0 AND d NOT NULL) - OR ((a BETWEEN 18 AND 20) AND a!=19) - OR ((a BETWEEN 10 AND 12) AND a!=11) - ORDER BY a - } -} {1 10 12 14 18 20 27 40 46 53 66 69 79 92 scan 0 sort 0} -do_test where7-2.426.1 { - count_steps { - SELECT a FROM t2 - WHERE b=22 - OR (f GLOB '?efgh*' AND f GLOB 'defg*') - OR b=399 - OR (g='mlkjihg' AND f GLOB 'jklmn*') - ORDER BY a - } -} {2 3 29 55 61 81 scan 0 sort 0} -do_test where7-2.426.2 { - count_steps { - SELECT a FROM t3 - WHERE b=22 - OR (f GLOB '?efgh*' AND f GLOB 'defg*') - OR b=399 - OR (g='mlkjihg' AND f GLOB 'jklmn*') - ORDER BY a - } -} {2 3 29 55 61 81 scan 0 sort 0} -do_test where7-2.427.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 39 AND 41) AND a!=40) - OR a=66 - OR b=484 - OR a=42 - ORDER BY a - } -} {39 41 42 44 66 scan 0 sort 0} -do_test where7-2.427.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 39 AND 41) AND a!=40) - OR a=66 - OR b=484 - OR a=42 - ORDER BY a - } -} {39 41 42 44 66 scan 0 sort 0} -do_test where7-2.428.1 { - count_steps { - SELECT a FROM t2 - WHERE b=905 - OR a=1 - OR b=22 - OR b=696 - ORDER BY a - } -} {1 2 scan 0 sort 0} -do_test where7-2.428.2 { - count_steps { - SELECT a FROM t3 - WHERE b=905 - OR a=1 - OR b=22 - OR b=696 - ORDER BY a - } -} {1 2 scan 0 sort 0} -do_test where7-2.429.1 { - count_steps { - SELECT a FROM t2 - WHERE f='klmnopqrs' - OR a=62 - ORDER BY a - } -} {10 36 62 88 scan 0 sort 0} -do_test where7-2.429.2 { - count_steps { - SELECT a FROM t3 - WHERE f='klmnopqrs' - OR a=62 - ORDER BY a - } -} {10 36 62 88 scan 0 sort 0} -do_test where7-2.430.1 { - count_steps { - SELECT a FROM t2 - WHERE a=42 - OR b=1001 - OR (g='onmlkji' AND f GLOB 'xyzab*') - OR (f GLOB '?stuv*' AND f GLOB 'rstu*') - OR a=62 - ORDER BY a - } -} {17 42 43 49 62 69 91 95 scan 0 sort 0} -do_test where7-2.430.2 { - count_steps { - SELECT a FROM t3 - WHERE a=42 - OR b=1001 - OR (g='onmlkji' AND f GLOB 'xyzab*') - OR (f GLOB '?stuv*' AND f GLOB 'rstu*') - OR a=62 - ORDER BY a - } -} {17 42 43 49 62 69 91 95 scan 0 sort 0} -do_test where7-2.431.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='edcbazy' AND f GLOB 'vwxyz*') - OR b=209 - OR (g='hgfedcb' AND f GLOB 'hijkl*') - OR f='mnopqrstu' - OR b=374 - OR (g='utsrqpo' AND f GLOB 'stuvw*') - OR ((a BETWEEN 88 AND 90) AND a!=89) - OR ((a BETWEEN 98 AND 100) AND a!=99) - OR f='pqrstuvwx' - OR a=65 - OR a=23 - ORDER BY a - } -} {12 15 18 19 23 34 38 41 64 65 67 85 88 90 93 98 99 100 scan 0 sort 0} -do_test where7-2.431.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='edcbazy' AND f GLOB 'vwxyz*') - OR b=209 - OR (g='hgfedcb' AND f GLOB 'hijkl*') - OR f='mnopqrstu' - OR b=374 - OR (g='utsrqpo' AND f GLOB 'stuvw*') - OR ((a BETWEEN 88 AND 90) AND a!=89) - OR ((a BETWEEN 98 AND 100) AND a!=99) - OR f='pqrstuvwx' - OR a=65 - OR a=23 - ORDER BY a - } -} {12 15 18 19 23 34 38 41 64 65 67 85 88 90 93 98 99 100 scan 0 sort 0} -do_test where7-2.432.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=3.0 AND d<4.0 AND d NOT NULL) - OR a=64 - OR ((a BETWEEN 9 AND 11) AND a!=10) - OR ((a BETWEEN 18 AND 20) AND a!=19) - OR (d>=7.0 AND d<8.0 AND d NOT NULL) - OR (d>=10.0 AND d<11.0 AND d NOT NULL) - OR (d>=69.0 AND d<70.0 AND d NOT NULL) - ORDER BY a - } -} {3 7 9 10 11 18 20 64 69 scan 0 sort 0} -do_test where7-2.432.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=3.0 AND d<4.0 AND d NOT NULL) - OR a=64 - OR ((a BETWEEN 9 AND 11) AND a!=10) - OR ((a BETWEEN 18 AND 20) AND a!=19) - OR (d>=7.0 AND d<8.0 AND d NOT NULL) - OR (d>=10.0 AND d<11.0 AND d NOT NULL) - OR (d>=69.0 AND d<70.0 AND d NOT NULL) - ORDER BY a - } -} {3 7 9 10 11 18 20 64 69 scan 0 sort 0} -do_test where7-2.433.1 { - count_steps { - SELECT a FROM t2 - WHERE a=91 - OR b=935 - OR a=82 - OR (g='vutsrqp' AND f GLOB 'opqrs*') - OR (d>=43.0 AND d<44.0 AND d NOT NULL) - OR b=300 - ORDER BY a - } -} {14 43 82 85 91 scan 0 sort 0} -do_test where7-2.433.2 { - count_steps { - SELECT a FROM t3 - WHERE a=91 - OR b=935 - OR a=82 - OR (g='vutsrqp' AND f GLOB 'opqrs*') - OR (d>=43.0 AND d<44.0 AND d NOT NULL) - OR b=300 - ORDER BY a - } -} {14 43 82 85 91 scan 0 sort 0} -do_test where7-2.434.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='utsrqpo' AND f GLOB 'wxyza*') - OR f='hijklmnop' - OR (d>=45.0 AND d<46.0 AND d NOT NULL) - OR (g='xwvutsr' AND f GLOB 'defgh*') - OR (d>=94.0 AND d<95.0 AND d NOT NULL) - OR (g='xwvutsr' AND f GLOB 'efghi*') - OR ((a BETWEEN 10 AND 12) AND a!=11) - OR b=110 - OR ((a BETWEEN 83 AND 85) AND a!=84) - ORDER BY a - } -} {3 4 7 10 12 22 33 45 59 83 85 94 scan 0 sort 0} -do_test where7-2.434.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='utsrqpo' AND f GLOB 'wxyza*') - OR f='hijklmnop' - OR (d>=45.0 AND d<46.0 AND d NOT NULL) - OR (g='xwvutsr' AND f GLOB 'defgh*') - OR (d>=94.0 AND d<95.0 AND d NOT NULL) - OR (g='xwvutsr' AND f GLOB 'efghi*') - OR ((a BETWEEN 10 AND 12) AND a!=11) - OR b=110 - OR ((a BETWEEN 83 AND 85) AND a!=84) - ORDER BY a - } -} {3 4 7 10 12 22 33 45 59 83 85 94 scan 0 sort 0} -do_test where7-2.435.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 99 AND 101) AND a!=100) - OR b=66 - OR a=32 - OR b=487 - OR b=69 - OR (d>=33.0 AND d<34.0 AND d NOT NULL) - OR (g='edcbazy' AND f GLOB 'uvwxy*') - OR (g='onmlkji' AND f GLOB 'yzabc*') - ORDER BY a - } -} {6 32 33 50 98 99 scan 0 sort 0} -do_test where7-2.435.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 99 AND 101) AND a!=100) - OR b=66 - OR a=32 - OR b=487 - OR b=69 - OR (d>=33.0 AND d<34.0 AND d NOT NULL) - OR (g='edcbazy' AND f GLOB 'uvwxy*') - OR (g='onmlkji' AND f GLOB 'yzabc*') - ORDER BY a - } -} {6 32 33 50 98 99 scan 0 sort 0} -do_test where7-2.436.1 { - count_steps { - SELECT a FROM t2 - WHERE b=814 - OR (g='qponmlk' AND f GLOB 'opqrs*') - OR c=25025 - ORDER BY a - } -} {40 73 74 75 scan 0 sort 0} -do_test where7-2.436.2 { - count_steps { - SELECT a FROM t3 - WHERE b=814 - OR (g='qponmlk' AND f GLOB 'opqrs*') - OR c=25025 - ORDER BY a - } -} {40 73 74 75 scan 0 sort 0} -do_test where7-2.437.1 { - count_steps { - SELECT a FROM t2 - WHERE b=960 - OR (d>=62.0 AND d<63.0 AND d NOT NULL) - OR (g='gfedcba' AND f GLOB 'opqrs*') - OR (d>=31.0 AND d<32.0 AND d NOT NULL) - ORDER BY a - } -} {31 62 92 scan 0 sort 0} -do_test where7-2.437.2 { - count_steps { - SELECT a FROM t3 - WHERE b=960 - OR (d>=62.0 AND d<63.0 AND d NOT NULL) - OR (g='gfedcba' AND f GLOB 'opqrs*') - OR (d>=31.0 AND d<32.0 AND d NOT NULL) - ORDER BY a - } -} {31 62 92 scan 0 sort 0} -do_test where7-2.438.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=56.0 AND d<57.0 AND d NOT NULL) - OR a=7 - OR b=36 - OR b=528 - OR c=17017 - OR b=66 - OR b=674 - OR (d>=96.0 AND d<97.0 AND d NOT NULL) - OR (d>=69.0 AND d<70.0 AND d NOT NULL) - ORDER BY a - } -} {6 7 48 49 50 51 56 69 96 scan 0 sort 0} -do_test where7-2.438.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=56.0 AND d<57.0 AND d NOT NULL) - OR a=7 - OR b=36 - OR b=528 - OR c=17017 - OR b=66 - OR b=674 - OR (d>=96.0 AND d<97.0 AND d NOT NULL) - OR (d>=69.0 AND d<70.0 AND d NOT NULL) - ORDER BY a - } -} {6 7 48 49 50 51 56 69 96 scan 0 sort 0} -do_test where7-2.439.1 { - count_steps { - SELECT a FROM t2 - WHERE c>=34035 - OR ((a BETWEEN 71 AND 73) AND a!=72) - OR (g='mlkjihg' AND f GLOB 'jklmn*') - OR a=52 - OR ((a BETWEEN 11 AND 13) AND a!=12) - OR b=836 - OR a=46 - OR c=23023 - OR (f GLOB '?vwxy*' AND f GLOB 'uvwx*') - ORDER BY a - } -} {11 13 20 46 52 61 67 68 69 71 72 73 76 98 scan 0 sort 0} -do_test where7-2.439.2 { - count_steps { - SELECT a FROM t3 - WHERE c>=34035 - OR ((a BETWEEN 71 AND 73) AND a!=72) - OR (g='mlkjihg' AND f GLOB 'jklmn*') - OR a=52 - OR ((a BETWEEN 11 AND 13) AND a!=12) - OR b=836 - OR a=46 - OR c=23023 - OR (f GLOB '?vwxy*' AND f GLOB 'uvwx*') - ORDER BY a - } -} {11 13 20 46 52 61 67 68 69 71 72 73 76 98 scan 0 sort 0} -do_test where7-2.440.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='ponmlkj' AND f GLOB 'rstuv*') - OR (g='tsrqpon' AND f GLOB 'bcdef*') - OR b=770 - OR (g='mlkjihg' AND f GLOB 'klmno*') - OR b=726 - OR (d>=31.0 AND d<32.0 AND d NOT NULL) - OR a=49 - OR f='bcdefghij' - OR (g='rqponml' AND f GLOB 'lmnop*') - OR f='jklmnopqr' - ORDER BY a - } -} {1 9 27 31 35 37 43 49 53 61 62 66 70 79 87 scan 0 sort 0} -do_test where7-2.440.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='ponmlkj' AND f GLOB 'rstuv*') - OR (g='tsrqpon' AND f GLOB 'bcdef*') - OR b=770 - OR (g='mlkjihg' AND f GLOB 'klmno*') - OR b=726 - OR (d>=31.0 AND d<32.0 AND d NOT NULL) - OR a=49 - OR f='bcdefghij' - OR (g='rqponml' AND f GLOB 'lmnop*') - OR f='jklmnopqr' - ORDER BY a - } -} {1 9 27 31 35 37 43 49 53 61 62 66 70 79 87 scan 0 sort 0} -do_test where7-2.441.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=13.0 AND d<14.0 AND d NOT NULL) - OR (d>=48.0 AND d<49.0 AND d NOT NULL) - OR (f GLOB '?yzab*' AND f GLOB 'xyza*') - OR (g='nmlkjih' AND f GLOB 'fghij*') - OR (f GLOB '?abcd*' AND f GLOB 'zabc*') - ORDER BY a - } -} {13 23 25 48 49 51 57 75 77 scan 0 sort 0} -do_test where7-2.441.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=13.0 AND d<14.0 AND d NOT NULL) - OR (d>=48.0 AND d<49.0 AND d NOT NULL) - OR (f GLOB '?yzab*' AND f GLOB 'xyza*') - OR (g='nmlkjih' AND f GLOB 'fghij*') - OR (f GLOB '?abcd*' AND f GLOB 'zabc*') - ORDER BY a - } -} {13 23 25 48 49 51 57 75 77 scan 0 sort 0} -do_test where7-2.442.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 46 AND 48) AND a!=47) - OR (d>=15.0 AND d<16.0 AND d NOT NULL) - OR b=366 - ORDER BY a - } -} {15 46 48 scan 0 sort 0} -do_test where7-2.442.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 46 AND 48) AND a!=47) - OR (d>=15.0 AND d<16.0 AND d NOT NULL) - OR b=366 - ORDER BY a - } -} {15 46 48 scan 0 sort 0} -do_test where7-2.443.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 88 AND 90) AND a!=89) - OR b=421 - OR (d>=55.0 AND d<56.0 AND d NOT NULL) - OR b=531 - OR b=957 - OR (d>=91.0 AND d<92.0 AND d NOT NULL) - OR (d>=9.0 AND d<10.0 AND d NOT NULL) - OR c=28028 - ORDER BY a - } -} {9 55 82 83 84 87 88 90 91 scan 0 sort 0} -do_test where7-2.443.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 88 AND 90) AND a!=89) - OR b=421 - OR (d>=55.0 AND d<56.0 AND d NOT NULL) - OR b=531 - OR b=957 - OR (d>=91.0 AND d<92.0 AND d NOT NULL) - OR (d>=9.0 AND d<10.0 AND d NOT NULL) - OR c=28028 - ORDER BY a - } -} {9 55 82 83 84 87 88 90 91 scan 0 sort 0} -do_test where7-2.444.1 { - count_steps { - SELECT a FROM t2 - WHERE a=100 - OR a=85 - OR b=847 - ORDER BY a - } -} {77 85 100 scan 0 sort 0} -do_test where7-2.444.2 { - count_steps { - SELECT a FROM t3 - WHERE a=100 - OR a=85 - OR b=847 - ORDER BY a - } -} {77 85 100 scan 0 sort 0} -do_test where7-2.445.1 { - count_steps { - SELECT a FROM t2 - WHERE b=25 - OR a=5 - OR 1000000=98.0 AND d<99.0 AND d NOT NULL) - ORDER BY a - } -} {5 9 11 12 14 30 46 78 98 scan 0 sort 0} -do_test where7-2.445.2 { - count_steps { - SELECT a FROM t3 - WHERE b=25 - OR a=5 - OR 1000000=98.0 AND d<99.0 AND d NOT NULL) - ORDER BY a - } -} {5 9 11 12 14 30 46 78 98 scan 0 sort 0} -do_test where7-2.446.1 { - count_steps { - SELECT a FROM t2 - WHERE b=792 - OR b=484 - OR a=34 - OR b=454 - OR b=1056 - OR (d>=99.0 AND d<100.0 AND d NOT NULL) - OR b=693 - ORDER BY a - } -} {34 44 63 72 96 99 scan 0 sort 0} -do_test where7-2.446.2 { - count_steps { - SELECT a FROM t3 - WHERE b=792 - OR b=484 - OR a=34 - OR b=454 - OR b=1056 - OR (d>=99.0 AND d<100.0 AND d NOT NULL) - OR b=693 - ORDER BY a - } -} {34 44 63 72 96 99 scan 0 sort 0} -do_test where7-2.447.1 { - count_steps { - SELECT a FROM t2 - WHERE f='fghijklmn' - OR a=23 - OR (d>=89.0 AND d<90.0 AND d NOT NULL) - OR a=69 - ORDER BY a - } -} {5 23 31 57 69 83 89 scan 0 sort 0} -do_test where7-2.447.2 { - count_steps { - SELECT a FROM t3 - WHERE f='fghijklmn' - OR a=23 - OR (d>=89.0 AND d<90.0 AND d NOT NULL) - OR a=69 - ORDER BY a - } -} {5 23 31 57 69 83 89 scan 0 sort 0} -do_test where7-2.448.1 { - count_steps { - SELECT a FROM t2 - WHERE c=17017 - OR (d>=66.0 AND d<67.0 AND d NOT NULL) - OR (g='ponmlkj' AND f GLOB 'stuvw*') - OR (d>=69.0 AND d<70.0 AND d NOT NULL) - OR ((a BETWEEN 35 AND 37) AND a!=36) - OR a=31 - OR (g='hgfedcb' AND f GLOB 'ijklm*') - OR b=531 - OR b=322 - OR a=98 - ORDER BY a - } -} {31 35 37 44 49 50 51 66 69 86 98 scan 0 sort 0} -do_test where7-2.448.2 { - count_steps { - SELECT a FROM t3 - WHERE c=17017 - OR (d>=66.0 AND d<67.0 AND d NOT NULL) - OR (g='ponmlkj' AND f GLOB 'stuvw*') - OR (d>=69.0 AND d<70.0 AND d NOT NULL) - OR ((a BETWEEN 35 AND 37) AND a!=36) - OR a=31 - OR (g='hgfedcb' AND f GLOB 'ijklm*') - OR b=531 - OR b=322 - OR a=98 - ORDER BY a - } -} {31 35 37 44 49 50 51 66 69 86 98 scan 0 sort 0} -do_test where7-2.449.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=100.0 AND d<101.0 AND d NOT NULL) - OR a=60 - OR (d>=92.0 AND d<93.0 AND d NOT NULL) - OR (d>=88.0 AND d<89.0 AND d NOT NULL) - OR ((a BETWEEN 90 AND 92) AND a!=91) - OR f='ijklmnopq' - OR b=572 - OR b=165 - OR c=24024 - OR b=355 - ORDER BY a - } -} {8 15 34 52 60 70 71 72 86 88 90 92 100 scan 0 sort 0} -do_test where7-2.449.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=100.0 AND d<101.0 AND d NOT NULL) - OR a=60 - OR (d>=92.0 AND d<93.0 AND d NOT NULL) - OR (d>=88.0 AND d<89.0 AND d NOT NULL) - OR ((a BETWEEN 90 AND 92) AND a!=91) - OR f='ijklmnopq' - OR b=572 - OR b=165 - OR c=24024 - OR b=355 - ORDER BY a - } -} {8 15 34 52 60 70 71 72 86 88 90 92 100 scan 0 sort 0} -do_test where7-2.450.1 { - count_steps { - SELECT a FROM t2 - WHERE b=264 - OR (g='wvutsrq' AND f GLOB 'klmno*') - OR b=465 - OR (d>=24.0 AND d<25.0 AND d NOT NULL) - OR ((a BETWEEN 95 AND 97) AND a!=96) - OR (g='lkjihgf' AND f GLOB 'mnopq*') - OR f='fghijklmn' - OR b=363 - OR b=102 - ORDER BY a - } -} {5 10 24 31 33 57 64 83 95 97 scan 0 sort 0} -do_test where7-2.450.2 { - count_steps { - SELECT a FROM t3 - WHERE b=264 - OR (g='wvutsrq' AND f GLOB 'klmno*') - OR b=465 - OR (d>=24.0 AND d<25.0 AND d NOT NULL) - OR ((a BETWEEN 95 AND 97) AND a!=96) - OR (g='lkjihgf' AND f GLOB 'mnopq*') - OR f='fghijklmn' - OR b=363 - OR b=102 - ORDER BY a - } -} {5 10 24 31 33 57 64 83 95 97 scan 0 sort 0} -do_test where7-2.451.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 0 AND 2) AND a!=1) - OR (d>=81.0 AND d<82.0 AND d NOT NULL) - OR b=1045 - OR (g='utsrqpo' AND f GLOB 'vwxyz*') - OR (f GLOB '?klmn*' AND f GLOB 'jklm*') - OR (d>=93.0 AND d<94.0 AND d NOT NULL) - OR (d>=11.0 AND d<12.0 AND d NOT NULL) - OR b=366 - ORDER BY a - } -} {2 9 11 21 35 61 81 87 93 95 scan 0 sort 0} -do_test where7-2.451.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 0 AND 2) AND a!=1) - OR (d>=81.0 AND d<82.0 AND d NOT NULL) - OR b=1045 - OR (g='utsrqpo' AND f GLOB 'vwxyz*') - OR (f GLOB '?klmn*' AND f GLOB 'jklm*') - OR (d>=93.0 AND d<94.0 AND d NOT NULL) - OR (d>=11.0 AND d<12.0 AND d NOT NULL) - OR b=366 - ORDER BY a - } -} {2 9 11 21 35 61 81 87 93 95 scan 0 sort 0} -do_test where7-2.452.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='vutsrqp' AND f GLOB 'opqrs*') - OR b=770 - OR b=726 - OR b=209 - ORDER BY a - } -} {14 19 66 70 scan 0 sort 0} -do_test where7-2.452.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='vutsrqp' AND f GLOB 'opqrs*') - OR b=770 - OR b=726 - OR b=209 - ORDER BY a - } -} {14 19 66 70 scan 0 sort 0} -do_test where7-2.453.1 { - count_steps { - SELECT a FROM t2 - WHERE a=55 - OR (d>=30.0 AND d<31.0 AND d NOT NULL) - OR a=77 - OR b=308 - OR c=16016 - OR b=396 - OR (f GLOB '?nopq*' AND f GLOB 'mnop*') - OR (d>=33.0 AND d<34.0 AND d NOT NULL) - OR (f GLOB '?ghij*' AND f GLOB 'fghi*') - ORDER BY a - } -} {5 12 28 30 31 33 36 38 46 47 48 55 57 64 77 83 90 scan 0 sort 0} -do_test where7-2.453.2 { - count_steps { - SELECT a FROM t3 - WHERE a=55 - OR (d>=30.0 AND d<31.0 AND d NOT NULL) - OR a=77 - OR b=308 - OR c=16016 - OR b=396 - OR (f GLOB '?nopq*' AND f GLOB 'mnop*') - OR (d>=33.0 AND d<34.0 AND d NOT NULL) - OR (f GLOB '?ghij*' AND f GLOB 'fghi*') - ORDER BY a - } -} {5 12 28 30 31 33 36 38 46 47 48 55 57 64 77 83 90 scan 0 sort 0} -do_test where7-2.454.1 { - count_steps { - SELECT a FROM t2 - WHERE a=92 - OR (d>=20.0 AND d<21.0 AND d NOT NULL) - OR b=429 - OR a=65 - OR (d>=66.0 AND d<67.0 AND d NOT NULL) - OR (g='mlkjihg' AND f GLOB 'klmno*') - OR ((a BETWEEN 89 AND 91) AND a!=90) - OR (g='srqponm' AND f GLOB 'cdefg*') - OR a=13 - ORDER BY a - } -} {13 20 28 39 62 65 66 89 91 92 scan 0 sort 0} -do_test where7-2.454.2 { - count_steps { - SELECT a FROM t3 - WHERE a=92 - OR (d>=20.0 AND d<21.0 AND d NOT NULL) - OR b=429 - OR a=65 - OR (d>=66.0 AND d<67.0 AND d NOT NULL) - OR (g='mlkjihg' AND f GLOB 'klmno*') - OR ((a BETWEEN 89 AND 91) AND a!=90) - OR (g='srqponm' AND f GLOB 'cdefg*') - OR a=13 - ORDER BY a - } -} {13 20 28 39 62 65 66 89 91 92 scan 0 sort 0} -do_test where7-2.455.1 { - count_steps { - SELECT a FROM t2 - WHERE b=660 - OR (f GLOB '?fghi*' AND f GLOB 'efgh*') - ORDER BY a - } -} {4 30 56 60 82 scan 0 sort 0} -do_test where7-2.455.2 { - count_steps { - SELECT a FROM t3 - WHERE b=660 - OR (f GLOB '?fghi*' AND f GLOB 'efgh*') - ORDER BY a - } -} {4 30 56 60 82 scan 0 sort 0} -do_test where7-2.456.1 { - count_steps { - SELECT a FROM t2 - WHERE b=817 - OR (g='fedcbaz' AND f GLOB 'pqrst*') - OR (g='hgfedcb' AND f GLOB 'jklmn*') - OR b=1092 - OR (g='qponmlk' AND f GLOB 'pqrst*') - OR ((a BETWEEN 48 AND 50) AND a!=49) - OR b=685 - OR b=1081 - OR f='xyzabcdef' - OR b=660 - ORDER BY a - } -} {23 41 48 49 50 60 75 87 93 scan 0 sort 0} -do_test where7-2.456.2 { - count_steps { - SELECT a FROM t3 - WHERE b=817 - OR (g='fedcbaz' AND f GLOB 'pqrst*') - OR (g='hgfedcb' AND f GLOB 'jklmn*') - OR b=1092 - OR (g='qponmlk' AND f GLOB 'pqrst*') - OR ((a BETWEEN 48 AND 50) AND a!=49) - OR b=685 - OR b=1081 - OR f='xyzabcdef' - OR b=660 - ORDER BY a - } -} {23 41 48 49 50 60 75 87 93 scan 0 sort 0} -do_test where7-2.457.1 { - count_steps { - SELECT a FROM t2 - WHERE b=1015 - OR a=78 - OR b=322 - OR (g='xwvutsr' AND f GLOB 'efghi*') - OR ((a BETWEEN 62 AND 64) AND a!=63) - OR b=542 - OR ((a BETWEEN 95 AND 97) AND a!=96) - OR f='vwxyzabcd' - ORDER BY a - } -} {4 21 47 62 64 73 78 95 97 99 scan 0 sort 0} -do_test where7-2.457.2 { - count_steps { - SELECT a FROM t3 - WHERE b=1015 - OR a=78 - OR b=322 - OR (g='xwvutsr' AND f GLOB 'efghi*') - OR ((a BETWEEN 62 AND 64) AND a!=63) - OR b=542 - OR ((a BETWEEN 95 AND 97) AND a!=96) - OR f='vwxyzabcd' - ORDER BY a - } -} {4 21 47 62 64 73 78 95 97 99 scan 0 sort 0} -do_test where7-2.458.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=19.0 AND d<20.0 AND d NOT NULL) - OR b=561 - OR b=509 - OR (d>=38.0 AND d<39.0 AND d NOT NULL) - OR b=1078 - OR (g='utsrqpo' AND f GLOB 'vwxyz*') - OR (g='rqponml' AND f GLOB 'jklmn*') - OR a=47 - OR b=410 - OR (d>=5.0 AND d<6.0 AND d NOT NULL) - ORDER BY a - } -} {5 19 21 35 38 47 51 98 scan 0 sort 0} -do_test where7-2.458.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=19.0 AND d<20.0 AND d NOT NULL) - OR b=561 - OR b=509 - OR (d>=38.0 AND d<39.0 AND d NOT NULL) - OR b=1078 - OR (g='utsrqpo' AND f GLOB 'vwxyz*') - OR (g='rqponml' AND f GLOB 'jklmn*') - OR a=47 - OR b=410 - OR (d>=5.0 AND d<6.0 AND d NOT NULL) - ORDER BY a - } -} {5 19 21 35 38 47 51 98 scan 0 sort 0} -do_test where7-2.459.1 { - count_steps { - SELECT a FROM t2 - WHERE b=586 - OR b<0 - OR a=58 - OR b=289 - OR ((a BETWEEN 87 AND 89) AND a!=88) - OR ((a BETWEEN 33 AND 35) AND a!=34) - OR ((a BETWEEN 12 AND 14) AND a!=13) - OR ((a BETWEEN 30 AND 32) AND a!=31) - OR (d>=22.0 AND d<23.0 AND d NOT NULL) - ORDER BY a - } -} {12 14 22 30 32 33 35 58 87 89 scan 0 sort 0} -do_test where7-2.459.2 { - count_steps { - SELECT a FROM t3 - WHERE b=586 - OR b<0 - OR a=58 - OR b=289 - OR ((a BETWEEN 87 AND 89) AND a!=88) - OR ((a BETWEEN 33 AND 35) AND a!=34) - OR ((a BETWEEN 12 AND 14) AND a!=13) - OR ((a BETWEEN 30 AND 32) AND a!=31) - OR (d>=22.0 AND d<23.0 AND d NOT NULL) - ORDER BY a - } -} {12 14 22 30 32 33 35 58 87 89 scan 0 sort 0} -do_test where7-2.460.1 { - count_steps { - SELECT a FROM t2 - WHERE b=1001 - OR c=19019 - OR (d>=5.0 AND d<6.0 AND d NOT NULL) - OR a=28 - OR (d>=82.0 AND d<83.0 AND d NOT NULL) - ORDER BY a - } -} {5 28 55 56 57 82 91 scan 0 sort 0} -do_test where7-2.460.2 { - count_steps { - SELECT a FROM t3 - WHERE b=1001 - OR c=19019 - OR (d>=5.0 AND d<6.0 AND d NOT NULL) - OR a=28 - OR (d>=82.0 AND d<83.0 AND d NOT NULL) - ORDER BY a - } -} {5 28 55 56 57 82 91 scan 0 sort 0} -do_test where7-2.461.1 { - count_steps { - SELECT a FROM t2 - WHERE b=286 - OR ((a BETWEEN 91 AND 93) AND a!=92) - OR b=924 - ORDER BY a - } -} {26 84 91 93 scan 0 sort 0} -do_test where7-2.461.2 { - count_steps { - SELECT a FROM t3 - WHERE b=286 - OR ((a BETWEEN 91 AND 93) AND a!=92) - OR b=924 - ORDER BY a - } -} {26 84 91 93 scan 0 sort 0} -do_test where7-2.462.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=64.0 AND d<65.0 AND d NOT NULL) - OR f='ghijklmno' - ORDER BY a - } -} {6 32 58 64 84 scan 0 sort 0} -do_test where7-2.462.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=64.0 AND d<65.0 AND d NOT NULL) - OR f='ghijklmno' - ORDER BY a - } -} {6 32 58 64 84 scan 0 sort 0} -do_test where7-2.463.1 { - count_steps { - SELECT a FROM t2 - WHERE b=1056 - OR b=539 - OR (d>=86.0 AND d<87.0 AND d NOT NULL) - OR (d>=67.0 AND d<68.0 AND d NOT NULL) - OR (d>=38.0 AND d<39.0 AND d NOT NULL) - OR b=990 - OR b=979 - OR ((a BETWEEN 24 AND 26) AND a!=25) - ORDER BY a - } -} {24 26 38 49 67 86 89 90 96 scan 0 sort 0} -do_test where7-2.463.2 { - count_steps { - SELECT a FROM t3 - WHERE b=1056 - OR b=539 - OR (d>=86.0 AND d<87.0 AND d NOT NULL) - OR (d>=67.0 AND d<68.0 AND d NOT NULL) - OR (d>=38.0 AND d<39.0 AND d NOT NULL) - OR b=990 - OR b=979 - OR ((a BETWEEN 24 AND 26) AND a!=25) - ORDER BY a - } -} {24 26 38 49 67 86 89 90 96 scan 0 sort 0} -do_test where7-2.464.1 { - count_steps { - SELECT a FROM t2 - WHERE b=660 - OR b=696 - OR b=1059 - OR (f GLOB '?klmn*' AND f GLOB 'jklm*') - OR f='cdefghijk' - OR e IS NULL - OR (d>=30.0 AND d<31.0 AND d NOT NULL) - OR b=1045 - OR b=960 - OR (g='jihgfed' AND f GLOB 'vwxyz*') - ORDER BY a - } -} {2 9 28 30 35 54 60 61 73 80 87 95 scan 0 sort 0} -do_test where7-2.464.2 { - count_steps { - SELECT a FROM t3 - WHERE b=660 - OR b=696 - OR b=1059 - OR (f GLOB '?klmn*' AND f GLOB 'jklm*') - OR f='cdefghijk' - OR e IS NULL - OR (d>=30.0 AND d<31.0 AND d NOT NULL) - OR b=1045 - OR b=960 - OR (g='jihgfed' AND f GLOB 'vwxyz*') - ORDER BY a - } -} {2 9 28 30 35 54 60 61 73 80 87 95 scan 0 sort 0} -do_test where7-2.465.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='qponmlk' AND f GLOB 'mnopq*') - OR b=256 - OR b=759 - OR ((a BETWEEN 43 AND 45) AND a!=44) - OR (d>=96.0 AND d<97.0 AND d NOT NULL) - OR f='vwxyzabcd' - OR (f GLOB '?abcd*' AND f GLOB 'zabc*') - OR a=14 - OR b=113 - OR ((a BETWEEN 66 AND 68) AND a!=67) - ORDER BY a - } -} {14 21 25 38 43 45 47 51 66 68 69 73 77 96 99 scan 0 sort 0} -do_test where7-2.465.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='qponmlk' AND f GLOB 'mnopq*') - OR b=256 - OR b=759 - OR ((a BETWEEN 43 AND 45) AND a!=44) - OR (d>=96.0 AND d<97.0 AND d NOT NULL) - OR f='vwxyzabcd' - OR (f GLOB '?abcd*' AND f GLOB 'zabc*') - OR a=14 - OR b=113 - OR ((a BETWEEN 66 AND 68) AND a!=67) - ORDER BY a - } -} {14 21 25 38 43 45 47 51 66 68 69 73 77 96 99 scan 0 sort 0} -do_test where7-2.466.1 { - count_steps { - SELECT a FROM t2 - WHERE b=77 - OR (g='xwvutsr' AND f GLOB 'fghij*') - OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') - OR b=828 - OR ((a BETWEEN 3 AND 5) AND a!=4) - OR (g='wvutsrq' AND f GLOB 'klmno*') - OR a=65 - OR ((a BETWEEN 74 AND 76) AND a!=75) - OR d>1e10 - OR b=759 - OR (d>=57.0 AND d<58.0 AND d NOT NULL) - ORDER BY a - } -} {3 5 7 10 15 41 57 65 67 69 74 76 93 scan 0 sort 0} -do_test where7-2.466.2 { - count_steps { - SELECT a FROM t3 - WHERE b=77 - OR (g='xwvutsr' AND f GLOB 'fghij*') - OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') - OR b=828 - OR ((a BETWEEN 3 AND 5) AND a!=4) - OR (g='wvutsrq' AND f GLOB 'klmno*') - OR a=65 - OR ((a BETWEEN 74 AND 76) AND a!=75) - OR d>1e10 - OR b=759 - OR (d>=57.0 AND d<58.0 AND d NOT NULL) - ORDER BY a - } -} {3 5 7 10 15 41 57 65 67 69 74 76 93 scan 0 sort 0} -do_test where7-2.467.1 { - count_steps { - SELECT a FROM t2 - WHERE b=311 - OR a=19 - OR b<0 - OR b=77 - OR b=751 - OR a=96 - OR (g='hgfedcb' AND f GLOB 'ijklm*') - OR ((a BETWEEN 76 AND 78) AND a!=77) - OR c=1001 - OR (d>=78.0 AND d<79.0 AND d NOT NULL) - OR b=135 - ORDER BY a - } -} {1 2 3 7 19 76 78 86 96 scan 0 sort 0} -do_test where7-2.467.2 { - count_steps { - SELECT a FROM t3 - WHERE b=311 - OR a=19 - OR b<0 - OR b=77 - OR b=751 - OR a=96 - OR (g='hgfedcb' AND f GLOB 'ijklm*') - OR ((a BETWEEN 76 AND 78) AND a!=77) - OR c=1001 - OR (d>=78.0 AND d<79.0 AND d NOT NULL) - OR b=135 - ORDER BY a - } -} {1 2 3 7 19 76 78 86 96 scan 0 sort 0} -do_test where7-2.468.1 { - count_steps { - SELECT a FROM t2 - WHERE c=34034 - OR a=21 - OR b=1015 - OR a=30 - OR (d>=1.0 AND d<2.0 AND d NOT NULL) - OR f='bcdefghij' - OR (g='tsrqpon' AND f GLOB 'abcde*') - OR (g='nmlkjih' AND f GLOB 'fghij*') - OR b=1078 - ORDER BY a - } -} {1 21 26 27 30 53 57 79 98 100 scan 0 sort 0} -do_test where7-2.468.2 { - count_steps { - SELECT a FROM t3 - WHERE c=34034 - OR a=21 - OR b=1015 - OR a=30 - OR (d>=1.0 AND d<2.0 AND d NOT NULL) - OR f='bcdefghij' - OR (g='tsrqpon' AND f GLOB 'abcde*') - OR (g='nmlkjih' AND f GLOB 'fghij*') - OR b=1078 - ORDER BY a - } -} {1 21 26 27 30 53 57 79 98 100 scan 0 sort 0} -do_test where7-2.469.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 47 AND 49) AND a!=48) - OR a=81 - OR a=60 - OR ((a BETWEEN 32 AND 34) AND a!=33) - OR a=82 - OR ((a BETWEEN 56 AND 58) AND a!=57) - OR a=72 - OR a=80 - OR b=440 - OR (d>=59.0 AND d<60.0 AND d NOT NULL) - ORDER BY a - } -} {32 34 40 47 49 56 58 59 60 72 80 81 82 scan 0 sort 0} -do_test where7-2.469.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 47 AND 49) AND a!=48) - OR a=81 - OR a=60 - OR ((a BETWEEN 32 AND 34) AND a!=33) - OR a=82 - OR ((a BETWEEN 56 AND 58) AND a!=57) - OR a=72 - OR a=80 - OR b=440 - OR (d>=59.0 AND d<60.0 AND d NOT NULL) - ORDER BY a - } -} {32 34 40 47 49 56 58 59 60 72 80 81 82 scan 0 sort 0} -do_test where7-2.470.1 { - count_steps { - SELECT a FROM t2 - WHERE a=10 - OR a=79 - OR (g='ihgfedc' AND f GLOB 'defgh*') - OR (g='hgfedcb' AND f GLOB 'ghijk*') - OR ((a BETWEEN 58 AND 60) AND a!=59) - OR (d>=87.0 AND d<88.0 AND d NOT NULL) - OR (d>=67.0 AND d<68.0 AND d NOT NULL) - OR (g='vutsrqp' AND f GLOB 'opqrs*') - ORDER BY a - } -} {10 14 58 60 67 79 81 84 87 scan 0 sort 0} -do_test where7-2.470.2 { - count_steps { - SELECT a FROM t3 - WHERE a=10 - OR a=79 - OR (g='ihgfedc' AND f GLOB 'defgh*') - OR (g='hgfedcb' AND f GLOB 'ghijk*') - OR ((a BETWEEN 58 AND 60) AND a!=59) - OR (d>=87.0 AND d<88.0 AND d NOT NULL) - OR (d>=67.0 AND d<68.0 AND d NOT NULL) - OR (g='vutsrqp' AND f GLOB 'opqrs*') - ORDER BY a - } -} {10 14 58 60 67 79 81 84 87 scan 0 sort 0} -do_test where7-2.471.1 { - count_steps { - SELECT a FROM t2 - WHERE f='tuvwxyzab' - OR a=38 - OR b=374 - OR (g='jihgfed' AND f GLOB 'xyzab*') - OR b=539 - OR ((a BETWEEN 64 AND 66) AND a!=65) - OR (d>=37.0 AND d<38.0 AND d NOT NULL) - ORDER BY a - } -} {19 34 37 38 45 49 64 66 71 75 97 scan 0 sort 0} -do_test where7-2.471.2 { - count_steps { - SELECT a FROM t3 - WHERE f='tuvwxyzab' - OR a=38 - OR b=374 - OR (g='jihgfed' AND f GLOB 'xyzab*') - OR b=539 - OR ((a BETWEEN 64 AND 66) AND a!=65) - OR (d>=37.0 AND d<38.0 AND d NOT NULL) - ORDER BY a - } -} {19 34 37 38 45 49 64 66 71 75 97 scan 0 sort 0} -do_test where7-2.472.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='kjihgfe' AND f GLOB 'uvwxy*') - OR (f GLOB '?rstu*' AND f GLOB 'qrst*') - OR (d>=76.0 AND d<77.0 AND d NOT NULL) - OR (d>=38.0 AND d<39.0 AND d NOT NULL) - OR c=18018 - OR b=979 - OR (g='lkjihgf' AND f GLOB 'mnopq*') - OR ((a BETWEEN 38 AND 40) AND a!=39) - OR (d>=29.0 AND d<30.0 AND d NOT NULL) - OR c=7007 - ORDER BY a - } -} {16 19 20 21 29 38 40 42 52 53 54 64 68 72 76 89 94 scan 0 sort 0} -do_test where7-2.472.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='kjihgfe' AND f GLOB 'uvwxy*') - OR (f GLOB '?rstu*' AND f GLOB 'qrst*') - OR (d>=76.0 AND d<77.0 AND d NOT NULL) - OR (d>=38.0 AND d<39.0 AND d NOT NULL) - OR c=18018 - OR b=979 - OR (g='lkjihgf' AND f GLOB 'mnopq*') - OR ((a BETWEEN 38 AND 40) AND a!=39) - OR (d>=29.0 AND d<30.0 AND d NOT NULL) - OR c=7007 - ORDER BY a - } -} {16 19 20 21 29 38 40 42 52 53 54 64 68 72 76 89 94 scan 0 sort 0} -do_test where7-2.473.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='nmlkjih' AND f GLOB 'fghij*') - OR (g='lkjihgf' AND f GLOB 'pqrst*') - OR a=59 - OR (d>=7.0 AND d<8.0 AND d NOT NULL) - ORDER BY a - } -} {7 57 59 67 scan 0 sort 0} -do_test where7-2.473.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='nmlkjih' AND f GLOB 'fghij*') - OR (g='lkjihgf' AND f GLOB 'pqrst*') - OR a=59 - OR (d>=7.0 AND d<8.0 AND d NOT NULL) - ORDER BY a - } -} {7 57 59 67 scan 0 sort 0} -do_test where7-2.474.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=84.0 AND d<85.0 AND d NOT NULL) - OR ((a BETWEEN 30 AND 32) AND a!=31) - OR ((a BETWEEN 16 AND 18) AND a!=17) - OR b=220 - OR a=52 - OR ((a BETWEEN 88 AND 90) AND a!=89) - OR ((a BETWEEN 93 AND 95) AND a!=94) - OR ((a BETWEEN 82 AND 84) AND a!=83) - OR f='defghijkl' - OR a=10 - OR (d>=10.0 AND d<11.0 AND d NOT NULL) - ORDER BY a - } -} {3 10 16 18 20 29 30 32 52 55 81 82 84 88 90 93 95 scan 0 sort 0} -do_test where7-2.474.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=84.0 AND d<85.0 AND d NOT NULL) - OR ((a BETWEEN 30 AND 32) AND a!=31) - OR ((a BETWEEN 16 AND 18) AND a!=17) - OR b=220 - OR a=52 - OR ((a BETWEEN 88 AND 90) AND a!=89) - OR ((a BETWEEN 93 AND 95) AND a!=94) - OR ((a BETWEEN 82 AND 84) AND a!=83) - OR f='defghijkl' - OR a=10 - OR (d>=10.0 AND d<11.0 AND d NOT NULL) - ORDER BY a - } -} {3 10 16 18 20 29 30 32 52 55 81 82 84 88 90 93 95 scan 0 sort 0} -do_test where7-2.475.1 { - count_steps { - SELECT a FROM t2 - WHERE c=13013 - OR b=1059 - OR c>=34035 - OR b=465 - OR b=487 - OR a=85 - OR b=619 - ORDER BY a - } -} {37 38 39 85 scan 0 sort 0} -do_test where7-2.475.2 { - count_steps { - SELECT a FROM t3 - WHERE c=13013 - OR b=1059 - OR c>=34035 - OR b=465 - OR b=487 - OR a=85 - OR b=619 - ORDER BY a - } -} {37 38 39 85 scan 0 sort 0} -do_test where7-2.476.1 { - count_steps { - SELECT a FROM t2 - WHERE a=98 - OR c=21021 - OR (d>=97.0 AND d<98.0 AND d NOT NULL) - OR (d>=17.0 AND d<18.0 AND d NOT NULL) - OR (g='utsrqpo' AND f GLOB 'stuvw*') - OR d<0.0 - OR (d>=32.0 AND d<33.0 AND d NOT NULL) - ORDER BY a - } -} {17 18 32 61 62 63 97 98 scan 0 sort 0} -do_test where7-2.476.2 { - count_steps { - SELECT a FROM t3 - WHERE a=98 - OR c=21021 - OR (d>=97.0 AND d<98.0 AND d NOT NULL) - OR (d>=17.0 AND d<18.0 AND d NOT NULL) - OR (g='utsrqpo' AND f GLOB 'stuvw*') - OR d<0.0 - OR (d>=32.0 AND d<33.0 AND d NOT NULL) - ORDER BY a - } -} {17 18 32 61 62 63 97 98 scan 0 sort 0} -do_test where7-2.477.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=75.0 AND d<76.0 AND d NOT NULL) - OR ((a BETWEEN 10 AND 12) AND a!=11) - OR (d>=20.0 AND d<21.0 AND d NOT NULL) - ORDER BY a - } -} {10 12 20 75 scan 0 sort 0} -do_test where7-2.477.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=75.0 AND d<76.0 AND d NOT NULL) - OR ((a BETWEEN 10 AND 12) AND a!=11) - OR (d>=20.0 AND d<21.0 AND d NOT NULL) - ORDER BY a - } -} {10 12 20 75 scan 0 sort 0} -do_test where7-2.478.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='qponmlk' AND f GLOB 'opqrs*') - OR (g='ponmlkj' AND f GLOB 'uvwxy*') - OR b=982 - OR ((a BETWEEN 87 AND 89) AND a!=88) - OR a=26 - OR (d>=75.0 AND d<76.0 AND d NOT NULL) - OR (d>=92.0 AND d<93.0 AND d NOT NULL) - OR ((a BETWEEN 23 AND 25) AND a!=24) - OR c=1001 - ORDER BY a - } -} {1 2 3 23 25 26 40 46 75 87 89 92 scan 0 sort 0} -do_test where7-2.478.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='qponmlk' AND f GLOB 'opqrs*') - OR (g='ponmlkj' AND f GLOB 'uvwxy*') - OR b=982 - OR ((a BETWEEN 87 AND 89) AND a!=88) - OR a=26 - OR (d>=75.0 AND d<76.0 AND d NOT NULL) - OR (d>=92.0 AND d<93.0 AND d NOT NULL) - OR ((a BETWEEN 23 AND 25) AND a!=24) - OR c=1001 - ORDER BY a - } -} {1 2 3 23 25 26 40 46 75 87 89 92 scan 0 sort 0} -do_test where7-2.479.1 { - count_steps { - SELECT a FROM t2 - WHERE (f GLOB '?vwxy*' AND f GLOB 'uvwx*') - OR (d>=10.0 AND d<11.0 AND d NOT NULL) - OR b=561 - OR (g='onmlkji' AND f GLOB 'abcde*') - OR (g='gfedcba' AND f GLOB 'opqrs*') - OR b=440 - OR c=7007 - OR b=399 - OR b=44 - OR a=67 - ORDER BY a - } -} {4 10 19 20 21 40 46 51 52 67 72 92 98 scan 0 sort 0} -do_test where7-2.479.2 { - count_steps { - SELECT a FROM t3 - WHERE (f GLOB '?vwxy*' AND f GLOB 'uvwx*') - OR (d>=10.0 AND d<11.0 AND d NOT NULL) - OR b=561 - OR (g='onmlkji' AND f GLOB 'abcde*') - OR (g='gfedcba' AND f GLOB 'opqrs*') - OR b=440 - OR c=7007 - OR b=399 - OR b=44 - OR a=67 - ORDER BY a - } -} {4 10 19 20 21 40 46 51 52 67 72 92 98 scan 0 sort 0} -do_test where7-2.480.1 { - count_steps { - SELECT a FROM t2 - WHERE b=528 - OR b=891 - OR (d>=81.0 AND d<82.0 AND d NOT NULL) - OR a=62 - OR (d>=48.0 AND d<49.0 AND d NOT NULL) - OR a=91 - OR f='bcdefghij' - OR ((a BETWEEN 28 AND 30) AND a!=29) - OR (d>=69.0 AND d<70.0 AND d NOT NULL) - OR (d>=90.0 AND d<91.0 AND d NOT NULL) - ORDER BY a - } -} {1 27 28 30 48 53 62 69 79 81 90 91 scan 0 sort 0} -do_test where7-2.480.2 { - count_steps { - SELECT a FROM t3 - WHERE b=528 - OR b=891 - OR (d>=81.0 AND d<82.0 AND d NOT NULL) - OR a=62 - OR (d>=48.0 AND d<49.0 AND d NOT NULL) - OR a=91 - OR f='bcdefghij' - OR ((a BETWEEN 28 AND 30) AND a!=29) - OR (d>=69.0 AND d<70.0 AND d NOT NULL) - OR (d>=90.0 AND d<91.0 AND d NOT NULL) - ORDER BY a - } -} {1 27 28 30 48 53 62 69 79 81 90 91 scan 0 sort 0} -do_test where7-2.481.1 { - count_steps { - SELECT a FROM t2 - WHERE a=47 - OR b=663 - OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') - OR b=1015 - OR a=7 - OR ((a BETWEEN 88 AND 90) AND a!=89) - OR (d>=87.0 AND d<88.0 AND d NOT NULL) - ORDER BY a - } -} {7 8 34 47 60 86 87 88 90 scan 0 sort 0} -do_test where7-2.481.2 { - count_steps { - SELECT a FROM t3 - WHERE a=47 - OR b=663 - OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') - OR b=1015 - OR a=7 - OR ((a BETWEEN 88 AND 90) AND a!=89) - OR (d>=87.0 AND d<88.0 AND d NOT NULL) - ORDER BY a - } -} {7 8 34 47 60 86 87 88 90 scan 0 sort 0} -do_test where7-2.482.1 { - count_steps { - SELECT a FROM t2 - WHERE b=88 - OR a=90 - OR a=10 - OR (g='xwvutsr' AND f GLOB 'ghijk*') - OR b=850 - OR b=132 - OR b=198 - ORDER BY a - } -} {6 8 10 12 18 90 scan 0 sort 0} -do_test where7-2.482.2 { - count_steps { - SELECT a FROM t3 - WHERE b=88 - OR a=90 - OR a=10 - OR (g='xwvutsr' AND f GLOB 'ghijk*') - OR b=850 - OR b=132 - OR b=198 - ORDER BY a - } -} {6 8 10 12 18 90 scan 0 sort 0} -do_test where7-2.483.1 { - count_steps { - SELECT a FROM t2 - WHERE c=11011 - OR e IS NULL - ORDER BY a - } -} {31 32 33 scan 0 sort 0} -do_test where7-2.483.2 { - count_steps { - SELECT a FROM t3 - WHERE c=11011 - OR e IS NULL - ORDER BY a - } -} {31 32 33 scan 0 sort 0} -do_test where7-2.484.1 { - count_steps { - SELECT a FROM t2 - WHERE a=33 - OR ((a BETWEEN 71 AND 73) AND a!=72) - OR (f GLOB '?fghi*' AND f GLOB 'efgh*') - OR (g='kjihgfe' AND f GLOB 'tuvwx*') - OR b=1067 - OR a=11 - OR a=83 - OR (d>=30.0 AND d<31.0 AND d NOT NULL) - OR c=2002 - OR (g='utsrqpo' AND f GLOB 'tuvwx*') - ORDER BY a - } -} {4 5 6 11 19 30 33 56 71 73 82 83 97 scan 0 sort 0} -do_test where7-2.484.2 { - count_steps { - SELECT a FROM t3 - WHERE a=33 - OR ((a BETWEEN 71 AND 73) AND a!=72) - OR (f GLOB '?fghi*' AND f GLOB 'efgh*') - OR (g='kjihgfe' AND f GLOB 'tuvwx*') - OR b=1067 - OR a=11 - OR a=83 - OR (d>=30.0 AND d<31.0 AND d NOT NULL) - OR c=2002 - OR (g='utsrqpo' AND f GLOB 'tuvwx*') - ORDER BY a - } -} {4 5 6 11 19 30 33 56 71 73 82 83 97 scan 0 sort 0} -do_test where7-2.485.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='lkjihgf' AND f GLOB 'pqrst*') - OR (d>=19.0 AND d<20.0 AND d NOT NULL) - OR (d>=82.0 AND d<83.0 AND d NOT NULL) - OR (d>=27.0 AND d<28.0 AND d NOT NULL) - OR (d>=54.0 AND d<55.0 AND d NOT NULL) - OR c=16016 - OR b=495 - OR ((a BETWEEN 1 AND 3) AND a!=2) - ORDER BY a - } -} {1 3 19 27 45 46 47 48 54 67 82 scan 0 sort 0} -do_test where7-2.485.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='lkjihgf' AND f GLOB 'pqrst*') - OR (d>=19.0 AND d<20.0 AND d NOT NULL) - OR (d>=82.0 AND d<83.0 AND d NOT NULL) - OR (d>=27.0 AND d<28.0 AND d NOT NULL) - OR (d>=54.0 AND d<55.0 AND d NOT NULL) - OR c=16016 - OR b=495 - OR ((a BETWEEN 1 AND 3) AND a!=2) - ORDER BY a - } -} {1 3 19 27 45 46 47 48 54 67 82 scan 0 sort 0} -do_test where7-2.486.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 49 AND 51) AND a!=50) - OR (d>=5.0 AND d<6.0 AND d NOT NULL) - OR b=198 - OR (g='onmlkji' AND f GLOB 'xyzab*') - OR ((a BETWEEN 93 AND 95) AND a!=94) - OR ((a BETWEEN 2 AND 4) AND a!=3) - OR b=297 - OR (f GLOB '?vwxy*' AND f GLOB 'uvwx*') - OR b=781 - ORDER BY a - } -} {2 4 5 18 20 27 46 49 51 71 72 93 95 98 scan 0 sort 0} -do_test where7-2.486.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 49 AND 51) AND a!=50) - OR (d>=5.0 AND d<6.0 AND d NOT NULL) - OR b=198 - OR (g='onmlkji' AND f GLOB 'xyzab*') - OR ((a BETWEEN 93 AND 95) AND a!=94) - OR ((a BETWEEN 2 AND 4) AND a!=3) - OR b=297 - OR (f GLOB '?vwxy*' AND f GLOB 'uvwx*') - OR b=781 - ORDER BY a - } -} {2 4 5 18 20 27 46 49 51 71 72 93 95 98 scan 0 sort 0} -do_test where7-2.487.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 48 AND 50) AND a!=49) - OR b=509 - OR a=36 - ORDER BY a - } -} {36 48 50 scan 0 sort 0} -do_test where7-2.487.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 48 AND 50) AND a!=49) - OR b=509 - OR a=36 - ORDER BY a - } -} {36 48 50 scan 0 sort 0} -do_test where7-2.488.1 { - count_steps { - SELECT a FROM t2 - WHERE b=498 - OR (d>=27.0 AND d<28.0 AND d NOT NULL) - OR d>1e10 - OR b=1023 - OR (g='qponmlk' AND f GLOB 'qrstu*') - ORDER BY a - } -} {27 42 93 scan 0 sort 0} -do_test where7-2.488.2 { - count_steps { - SELECT a FROM t3 - WHERE b=498 - OR (d>=27.0 AND d<28.0 AND d NOT NULL) - OR d>1e10 - OR b=1023 - OR (g='qponmlk' AND f GLOB 'qrstu*') - ORDER BY a - } -} {27 42 93 scan 0 sort 0} -do_test where7-2.489.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=72.0 AND d<73.0 AND d NOT NULL) - OR (d>=86.0 AND d<87.0 AND d NOT NULL) - OR b=517 - OR b=550 - ORDER BY a - } -} {47 50 72 86 scan 0 sort 0} -do_test where7-2.489.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=72.0 AND d<73.0 AND d NOT NULL) - OR (d>=86.0 AND d<87.0 AND d NOT NULL) - OR b=517 - OR b=550 - ORDER BY a - } -} {47 50 72 86 scan 0 sort 0} -do_test where7-2.490.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='vutsrqp' AND f GLOB 'qrstu*') - OR b=718 - OR a=27 - OR (d>=39.0 AND d<40.0 AND d NOT NULL) - OR b=795 - OR ((a BETWEEN 3 AND 5) AND a!=4) - OR b=319 - OR a=53 - OR (d>=8.0 AND d<9.0 AND d NOT NULL) - OR (d>=27.0 AND d<28.0 AND d NOT NULL) - OR (d>=72.0 AND d<73.0 AND d NOT NULL) - ORDER BY a - } -} {3 5 8 16 27 29 39 53 72 scan 0 sort 0} -do_test where7-2.490.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='vutsrqp' AND f GLOB 'qrstu*') - OR b=718 - OR a=27 - OR (d>=39.0 AND d<40.0 AND d NOT NULL) - OR b=795 - OR ((a BETWEEN 3 AND 5) AND a!=4) - OR b=319 - OR a=53 - OR (d>=8.0 AND d<9.0 AND d NOT NULL) - OR (d>=27.0 AND d<28.0 AND d NOT NULL) - OR (d>=72.0 AND d<73.0 AND d NOT NULL) - ORDER BY a - } -} {3 5 8 16 27 29 39 53 72 scan 0 sort 0} -do_test where7-2.491.1 { - count_steps { - SELECT a FROM t2 - WHERE b=641 - OR (g='hgfedcb' AND f GLOB 'jklmn*') - OR b=1067 - OR b=443 - OR ((a BETWEEN 45 AND 47) AND a!=46) - ORDER BY a - } -} {45 47 87 97 scan 0 sort 0} -do_test where7-2.491.2 { - count_steps { - SELECT a FROM t3 - WHERE b=641 - OR (g='hgfedcb' AND f GLOB 'jklmn*') - OR b=1067 - OR b=443 - OR ((a BETWEEN 45 AND 47) AND a!=46) - ORDER BY a - } -} {45 47 87 97 scan 0 sort 0} -do_test where7-2.492.1 { - count_steps { - SELECT a FROM t2 - WHERE c=6006 - OR (g='wvutsrq' AND f GLOB 'mnopq*') - ORDER BY a - } -} {12 16 17 18 scan 0 sort 0} -do_test where7-2.492.2 { - count_steps { - SELECT a FROM t3 - WHERE c=6006 - OR (g='wvutsrq' AND f GLOB 'mnopq*') - ORDER BY a - } -} {12 16 17 18 scan 0 sort 0} -do_test where7-2.493.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 97 AND 99) AND a!=98) - OR ((a BETWEEN 5 AND 7) AND a!=6) - OR a=13 - OR a=87 - OR f='jklmnopqr' - OR a=18 - OR (f GLOB '?tuvw*' AND f GLOB 'stuv*') - OR (d>=91.0 AND d<92.0 AND d NOT NULL) - ORDER BY a - } -} {5 7 9 13 18 35 44 61 70 87 91 96 97 99 scan 0 sort 0} -do_test where7-2.493.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 97 AND 99) AND a!=98) - OR ((a BETWEEN 5 AND 7) AND a!=6) - OR a=13 - OR a=87 - OR f='jklmnopqr' - OR a=18 - OR (f GLOB '?tuvw*' AND f GLOB 'stuv*') - OR (d>=91.0 AND d<92.0 AND d NOT NULL) - ORDER BY a - } -} {5 7 9 13 18 35 44 61 70 87 91 96 97 99 scan 0 sort 0} -do_test where7-2.494.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 42 AND 44) AND a!=43) - OR b=289 - ORDER BY a - } -} {42 44 scan 0 sort 0} -do_test where7-2.494.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 42 AND 44) AND a!=43) - OR b=289 - ORDER BY a - } -} {42 44 scan 0 sort 0} -do_test where7-2.495.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='edcbazy' AND f GLOB 'wxyza*') - OR b=993 - OR b=58 - OR (g='qponmlk' AND f GLOB 'opqrs*') - ORDER BY a - } -} {40 100 scan 0 sort 0} -do_test where7-2.495.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='edcbazy' AND f GLOB 'wxyza*') - OR b=993 - OR b=58 - OR (g='qponmlk' AND f GLOB 'opqrs*') - ORDER BY a - } -} {40 100 scan 0 sort 0} -do_test where7-2.496.1 { - count_steps { - SELECT a FROM t2 - WHERE c=2002 - OR (d>=90.0 AND d<91.0 AND d NOT NULL) - OR ((a BETWEEN 85 AND 87) AND a!=86) - OR b<0 - OR (g='xwvutsr' AND f GLOB 'efghi*') - OR (g='wvutsrq' AND f GLOB 'ijklm*') - OR b=649 - OR b=891 - OR (g='lkjihgf' AND f GLOB 'nopqr*') - OR (d>=23.0 AND d<24.0 AND d NOT NULL) - ORDER BY a - } -} {4 5 6 8 23 59 65 81 85 87 90 scan 0 sort 0} -do_test where7-2.496.2 { - count_steps { - SELECT a FROM t3 - WHERE c=2002 - OR (d>=90.0 AND d<91.0 AND d NOT NULL) - OR ((a BETWEEN 85 AND 87) AND a!=86) - OR b<0 - OR (g='xwvutsr' AND f GLOB 'efghi*') - OR (g='wvutsrq' AND f GLOB 'ijklm*') - OR b=649 - OR b=891 - OR (g='lkjihgf' AND f GLOB 'nopqr*') - OR (d>=23.0 AND d<24.0 AND d NOT NULL) - ORDER BY a - } -} {4 5 6 8 23 59 65 81 85 87 90 scan 0 sort 0} -do_test where7-2.497.1 { - count_steps { - SELECT a FROM t2 - WHERE f='hijklmnop' - OR b=388 - OR ((a BETWEEN 82 AND 84) AND a!=83) - OR c=2002 - OR c=22022 - OR (d>=22.0 AND d<23.0 AND d NOT NULL) - OR a=52 - OR a=35 - ORDER BY a - } -} {4 5 6 7 22 33 35 52 59 64 65 66 82 84 85 scan 0 sort 0} -do_test where7-2.497.2 { - count_steps { - SELECT a FROM t3 - WHERE f='hijklmnop' - OR b=388 - OR ((a BETWEEN 82 AND 84) AND a!=83) - OR c=2002 - OR c=22022 - OR (d>=22.0 AND d<23.0 AND d NOT NULL) - OR a=52 - OR a=35 - ORDER BY a - } -} {4 5 6 7 22 33 35 52 59 64 65 66 82 84 85 scan 0 sort 0} -do_test where7-2.498.1 { - count_steps { - SELECT a FROM t2 - WHERE a=66 - OR a=40 - OR b=253 - OR f='yzabcdefg' - ORDER BY a - } -} {23 24 40 50 66 76 scan 0 sort 0} -do_test where7-2.498.2 { - count_steps { - SELECT a FROM t3 - WHERE a=66 - OR a=40 - OR b=253 - OR f='yzabcdefg' - ORDER BY a - } -} {23 24 40 50 66 76 scan 0 sort 0} -do_test where7-2.499.1 { - count_steps { - SELECT a FROM t2 - WHERE a=87 - OR (d>=57.0 AND d<58.0 AND d NOT NULL) - OR c=2002 - ORDER BY a - } -} {4 5 6 57 87 scan 0 sort 0} -do_test where7-2.499.2 { - count_steps { - SELECT a FROM t3 - WHERE a=87 - OR (d>=57.0 AND d<58.0 AND d NOT NULL) - OR c=2002 - ORDER BY a - } -} {4 5 6 57 87 scan 0 sort 0} -do_test where7-2.500.1 { - count_steps { - SELECT a FROM t2 - WHERE b=429 - OR a=42 - OR (g='ponmlkj' AND f GLOB 'tuvwx*') - OR b=418 - OR f='abcdefghi' - OR c=18018 - ORDER BY a - } -} {26 38 39 42 45 52 53 54 78 scan 0 sort 0} -do_test where7-2.500.2 { - count_steps { - SELECT a FROM t3 - WHERE b=429 - OR a=42 - OR (g='ponmlkj' AND f GLOB 'tuvwx*') - OR b=418 - OR f='abcdefghi' - OR c=18018 - ORDER BY a - } -} {26 38 39 42 45 52 53 54 78 scan 0 sort 0} -do_test where7-2.501.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=5.0 AND d<6.0 AND d NOT NULL) - OR (g='jihgfed' AND f GLOB 'wxyza*') - OR a=62 - OR a=37 - OR (d>=43.0 AND d<44.0 AND d NOT NULL) - OR b=429 - OR a=7 - OR (d>=22.0 AND d<23.0 AND d NOT NULL) - OR a=71 - OR (d>=52.0 AND d<53.0 AND d NOT NULL) - OR ((a BETWEEN 11 AND 13) AND a!=12) - ORDER BY a - } -} {5 7 11 13 22 37 39 43 52 62 71 74 scan 0 sort 0} -do_test where7-2.501.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=5.0 AND d<6.0 AND d NOT NULL) - OR (g='jihgfed' AND f GLOB 'wxyza*') - OR a=62 - OR a=37 - OR (d>=43.0 AND d<44.0 AND d NOT NULL) - OR b=429 - OR a=7 - OR (d>=22.0 AND d<23.0 AND d NOT NULL) - OR a=71 - OR (d>=52.0 AND d<53.0 AND d NOT NULL) - OR ((a BETWEEN 11 AND 13) AND a!=12) - ORDER BY a - } -} {5 7 11 13 22 37 39 43 52 62 71 74 scan 0 sort 0} -do_test where7-2.502.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='wvutsrq' AND f GLOB 'klmno*') - OR ((a BETWEEN 27 AND 29) AND a!=28) - OR a=11 - ORDER BY a - } -} {10 11 27 29 scan 0 sort 0} -do_test where7-2.502.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='wvutsrq' AND f GLOB 'klmno*') - OR ((a BETWEEN 27 AND 29) AND a!=28) - OR a=11 - ORDER BY a - } -} {10 11 27 29 scan 0 sort 0} -do_test where7-2.503.1 { - count_steps { - SELECT a FROM t2 - WHERE (f GLOB '?klmn*' AND f GLOB 'jklm*') - OR b=814 - OR b=1070 - OR b=407 - OR (g='jihgfed' AND f GLOB 'vwxyz*') - OR (g='vutsrqp' AND f GLOB 'nopqr*') - OR ((a BETWEEN 82 AND 84) AND a!=83) - OR b=234 - ORDER BY a - } -} {9 13 35 37 61 73 74 82 84 87 scan 0 sort 0} -do_test where7-2.503.2 { - count_steps { - SELECT a FROM t3 - WHERE (f GLOB '?klmn*' AND f GLOB 'jklm*') - OR b=814 - OR b=1070 - OR b=407 - OR (g='jihgfed' AND f GLOB 'vwxyz*') - OR (g='vutsrqp' AND f GLOB 'nopqr*') - OR ((a BETWEEN 82 AND 84) AND a!=83) - OR b=234 - ORDER BY a - } -} {9 13 35 37 61 73 74 82 84 87 scan 0 sort 0} -do_test where7-2.504.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=2.0 AND d<3.0 AND d NOT NULL) - OR b=1100 - OR b=333 - OR ((a BETWEEN 7 AND 9) AND a!=8) - ORDER BY a - } -} {2 7 9 100 scan 0 sort 0} -do_test where7-2.504.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=2.0 AND d<3.0 AND d NOT NULL) - OR b=1100 - OR b=333 - OR ((a BETWEEN 7 AND 9) AND a!=8) - ORDER BY a - } -} {2 7 9 100 scan 0 sort 0} -do_test where7-2.505.1 { - count_steps { - SELECT a FROM t2 - WHERE a=91 - OR a=41 - ORDER BY a - } -} {41 91 scan 0 sort 1} -do_test where7-2.505.2 { - count_steps { - SELECT a FROM t3 - WHERE a=91 - OR a=41 - ORDER BY a - } -} {41 91 scan 0 sort 1} -do_test where7-2.506.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=80.0 AND d<81.0 AND d NOT NULL) - OR b=1037 - OR (d>=59.0 AND d<60.0 AND d NOT NULL) - OR (g='rqponml' AND f GLOB 'lmnop*') - OR b=586 - OR (g='vutsrqp' AND f GLOB 'opqrs*') - OR b=605 - ORDER BY a - } -} {14 37 55 59 80 scan 0 sort 0} -do_test where7-2.506.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=80.0 AND d<81.0 AND d NOT NULL) - OR b=1037 - OR (d>=59.0 AND d<60.0 AND d NOT NULL) - OR (g='rqponml' AND f GLOB 'lmnop*') - OR b=586 - OR (g='vutsrqp' AND f GLOB 'opqrs*') - OR b=605 - ORDER BY a - } -} {14 37 55 59 80 scan 0 sort 0} -do_test where7-2.507.1 { - count_steps { - SELECT a FROM t2 - WHERE b=44 - OR (d>=45.0 AND d<46.0 AND d NOT NULL) - ORDER BY a - } -} {4 45 scan 0 sort 0} -do_test where7-2.507.2 { - count_steps { - SELECT a FROM t3 - WHERE b=44 - OR (d>=45.0 AND d<46.0 AND d NOT NULL) - ORDER BY a - } -} {4 45 scan 0 sort 0} -do_test where7-2.508.1 { - count_steps { - SELECT a FROM t2 - WHERE a=10 - OR a=20 - OR (f GLOB '?hijk*' AND f GLOB 'ghij*') - OR a=69 - OR b=113 - OR c=9009 - OR (f GLOB '?efgh*' AND f GLOB 'defg*') - ORDER BY a - } -} {3 6 10 20 25 26 27 29 32 55 58 69 81 84 scan 0 sort 0} -do_test where7-2.508.2 { - count_steps { - SELECT a FROM t3 - WHERE a=10 - OR a=20 - OR (f GLOB '?hijk*' AND f GLOB 'ghij*') - OR a=69 - OR b=113 - OR c=9009 - OR (f GLOB '?efgh*' AND f GLOB 'defg*') - ORDER BY a - } -} {3 6 10 20 25 26 27 29 32 55 58 69 81 84 scan 0 sort 0} -do_test where7-2.509.1 { - count_steps { - SELECT a FROM t2 - WHERE a=62 - OR (d>=86.0 AND d<87.0 AND d NOT NULL) - OR a=47 - OR c=18018 - OR b=715 - OR (d>=57.0 AND d<58.0 AND d NOT NULL) - ORDER BY a - } -} {47 52 53 54 57 62 65 86 scan 0 sort 0} -do_test where7-2.509.2 { - count_steps { - SELECT a FROM t3 - WHERE a=62 - OR (d>=86.0 AND d<87.0 AND d NOT NULL) - OR a=47 - OR c=18018 - OR b=715 - OR (d>=57.0 AND d<58.0 AND d NOT NULL) - ORDER BY a - } -} {47 52 53 54 57 62 65 86 scan 0 sort 0} -do_test where7-2.510.1 { - count_steps { - SELECT a FROM t2 - WHERE b=649 - OR ((a BETWEEN 9 AND 11) AND a!=10) - OR ((a BETWEEN 72 AND 74) AND a!=73) - ORDER BY a - } -} {9 11 59 72 74 scan 0 sort 0} -do_test where7-2.510.2 { - count_steps { - SELECT a FROM t3 - WHERE b=649 - OR ((a BETWEEN 9 AND 11) AND a!=10) - OR ((a BETWEEN 72 AND 74) AND a!=73) - ORDER BY a - } -} {9 11 59 72 74 scan 0 sort 0} -do_test where7-2.511.1 { - count_steps { - SELECT a FROM t2 - WHERE c=33033 - OR b=979 - OR b=47 - OR (g='utsrqpo' AND f GLOB 'wxyza*') - OR (d>=87.0 AND d<88.0 AND d NOT NULL) - OR (d>=62.0 AND d<63.0 AND d NOT NULL) - ORDER BY a - } -} {22 62 87 89 97 98 99 scan 0 sort 0} -do_test where7-2.511.2 { - count_steps { - SELECT a FROM t3 - WHERE c=33033 - OR b=979 - OR b=47 - OR (g='utsrqpo' AND f GLOB 'wxyza*') - OR (d>=87.0 AND d<88.0 AND d NOT NULL) - OR (d>=62.0 AND d<63.0 AND d NOT NULL) - ORDER BY a - } -} {22 62 87 89 97 98 99 scan 0 sort 0} -do_test where7-2.512.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=36.0 AND d<37.0 AND d NOT NULL) - OR a=77 - OR ((a BETWEEN 10 AND 12) AND a!=11) - OR ((a BETWEEN 5 AND 7) AND a!=6) - OR ((a BETWEEN 50 AND 52) AND a!=51) - OR f='jklmnopqr' - OR b=344 - OR ((a BETWEEN 33 AND 35) AND a!=34) - OR b=762 - OR (g='xwvutsr' AND f GLOB 'ghijk*') - ORDER BY a - } -} {5 6 7 9 10 12 33 35 36 50 52 61 77 87 scan 0 sort 0} -do_test where7-2.512.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=36.0 AND d<37.0 AND d NOT NULL) - OR a=77 - OR ((a BETWEEN 10 AND 12) AND a!=11) - OR ((a BETWEEN 5 AND 7) AND a!=6) - OR ((a BETWEEN 50 AND 52) AND a!=51) - OR f='jklmnopqr' - OR b=344 - OR ((a BETWEEN 33 AND 35) AND a!=34) - OR b=762 - OR (g='xwvutsr' AND f GLOB 'ghijk*') - ORDER BY a - } -} {5 6 7 9 10 12 33 35 36 50 52 61 77 87 scan 0 sort 0} -do_test where7-2.513.1 { - count_steps { - SELECT a FROM t2 - WHERE a=65 - OR (d>=17.0 AND d<18.0 AND d NOT NULL) - ORDER BY a - } -} {17 65 scan 0 sort 0} -do_test where7-2.513.2 { - count_steps { - SELECT a FROM t3 - WHERE a=65 - OR (d>=17.0 AND d<18.0 AND d NOT NULL) - ORDER BY a - } -} {17 65 scan 0 sort 0} -do_test where7-2.514.1 { - count_steps { - SELECT a FROM t2 - WHERE a=52 - OR (g='vutsrqp' AND f GLOB 'qrstu*') - OR (d>=64.0 AND d<65.0 AND d NOT NULL) - OR (d>=1.0 AND d<2.0 AND d NOT NULL) - OR c=9009 - OR (d>=42.0 AND d<43.0 AND d NOT NULL) - OR b=1034 - OR (f GLOB '?tuvw*' AND f GLOB 'stuv*') - OR b=784 - OR ((a BETWEEN 36 AND 38) AND a!=37) - ORDER BY a - } -} {1 16 18 25 26 27 36 38 42 44 52 64 70 94 96 scan 0 sort 0} -do_test where7-2.514.2 { - count_steps { - SELECT a FROM t3 - WHERE a=52 - OR (g='vutsrqp' AND f GLOB 'qrstu*') - OR (d>=64.0 AND d<65.0 AND d NOT NULL) - OR (d>=1.0 AND d<2.0 AND d NOT NULL) - OR c=9009 - OR (d>=42.0 AND d<43.0 AND d NOT NULL) - OR b=1034 - OR (f GLOB '?tuvw*' AND f GLOB 'stuv*') - OR b=784 - OR ((a BETWEEN 36 AND 38) AND a!=37) - ORDER BY a - } -} {1 16 18 25 26 27 36 38 42 44 52 64 70 94 96 scan 0 sort 0} -do_test where7-2.515.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='utsrqpo' AND f GLOB 'uvwxy*') - OR c=15015 - ORDER BY a - } -} {20 43 44 45 scan 0 sort 0} -do_test where7-2.515.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='utsrqpo' AND f GLOB 'uvwxy*') - OR c=15015 - ORDER BY a - } -} {20 43 44 45 scan 0 sort 0} -do_test where7-2.516.1 { - count_steps { - SELECT a FROM t2 - WHERE b=979 - OR a=15 - OR (d>=30.0 AND d<31.0 AND d NOT NULL) - OR ((a BETWEEN 29 AND 31) AND a!=30) - OR ((a BETWEEN 24 AND 26) AND a!=25) - OR b=209 - OR (g='kjihgfe' AND f GLOB 'stuvw*') - OR b=44 - OR b=971 - ORDER BY a - } -} {4 15 19 24 26 29 30 31 70 89 scan 0 sort 0} -do_test where7-2.516.2 { - count_steps { - SELECT a FROM t3 - WHERE b=979 - OR a=15 - OR (d>=30.0 AND d<31.0 AND d NOT NULL) - OR ((a BETWEEN 29 AND 31) AND a!=30) - OR ((a BETWEEN 24 AND 26) AND a!=25) - OR b=209 - OR (g='kjihgfe' AND f GLOB 'stuvw*') - OR b=44 - OR b=971 - ORDER BY a - } -} {4 15 19 24 26 29 30 31 70 89 scan 0 sort 0} -do_test where7-2.517.1 { - count_steps { - SELECT a FROM t2 - WHERE b=894 - OR ((a BETWEEN 58 AND 60) AND a!=59) - OR a=6 - OR a=40 - OR b=245 - OR a=84 - OR c=4004 - OR a=66 - OR a=35 - OR a=14 - ORDER BY a - } -} {6 10 11 12 14 35 40 58 60 66 84 scan 0 sort 0} -do_test where7-2.517.2 { - count_steps { - SELECT a FROM t3 - WHERE b=894 - OR ((a BETWEEN 58 AND 60) AND a!=59) - OR a=6 - OR a=40 - OR b=245 - OR a=84 - OR c=4004 - OR a=66 - OR a=35 - OR a=14 - ORDER BY a - } -} {6 10 11 12 14 35 40 58 60 66 84 scan 0 sort 0} -do_test where7-2.518.1 { - count_steps { - SELECT a FROM t2 - WHERE b=1001 - OR (g='nmlkjih' AND f GLOB 'fghij*') - OR a=1 - OR b=374 - OR (f GLOB '?fghi*' AND f GLOB 'efgh*') - OR c=9009 - OR b=770 - ORDER BY a - } -} {1 4 25 26 27 30 34 56 57 70 82 91 scan 0 sort 0} -do_test where7-2.518.2 { - count_steps { - SELECT a FROM t3 - WHERE b=1001 - OR (g='nmlkjih' AND f GLOB 'fghij*') - OR a=1 - OR b=374 - OR (f GLOB '?fghi*' AND f GLOB 'efgh*') - OR c=9009 - OR b=770 - ORDER BY a - } -} {1 4 25 26 27 30 34 56 57 70 82 91 scan 0 sort 0} -do_test where7-2.519.1 { - count_steps { - SELECT a FROM t2 - WHERE a=13 - OR b=1037 - OR b=267 - OR b=165 - OR (g='lkjihgf' AND f GLOB 'nopqr*') - OR ((a BETWEEN 30 AND 32) AND a!=31) - OR a=49 - ORDER BY a - } -} {13 15 30 32 49 65 scan 0 sort 0} -do_test where7-2.519.2 { - count_steps { - SELECT a FROM t3 - WHERE a=13 - OR b=1037 - OR b=267 - OR b=165 - OR (g='lkjihgf' AND f GLOB 'nopqr*') - OR ((a BETWEEN 30 AND 32) AND a!=31) - OR a=49 - ORDER BY a - } -} {13 15 30 32 49 65 scan 0 sort 0} -do_test where7-2.520.1 { - count_steps { - SELECT a FROM t2 - WHERE g IS NULL - OR (g='tsrqpon' AND f GLOB 'yzabc*') - OR (d>=50.0 AND d<51.0 AND d NOT NULL) - OR b=1026 - OR b=344 - ORDER BY a - } -} {24 50 scan 0 sort 0} -do_test where7-2.520.2 { - count_steps { - SELECT a FROM t3 - WHERE g IS NULL - OR (g='tsrqpon' AND f GLOB 'yzabc*') - OR (d>=50.0 AND d<51.0 AND d NOT NULL) - OR b=1026 - OR b=344 - ORDER BY a - } -} {24 50 scan 0 sort 0} -do_test where7-2.521.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 10 AND 12) AND a!=11) - OR (f GLOB '?stuv*' AND f GLOB 'rstu*') - OR (g='rqponml' AND f GLOB 'hijkl*') - OR a=57 - OR f='pqrstuvwx' - OR (d>=21.0 AND d<22.0 AND d NOT NULL) - OR b=223 - OR (d>=75.0 AND d<76.0 AND d NOT NULL) - ORDER BY a - } -} {10 12 15 17 21 33 41 43 57 67 69 75 93 95 scan 0 sort 0} -do_test where7-2.521.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 10 AND 12) AND a!=11) - OR (f GLOB '?stuv*' AND f GLOB 'rstu*') - OR (g='rqponml' AND f GLOB 'hijkl*') - OR a=57 - OR f='pqrstuvwx' - OR (d>=21.0 AND d<22.0 AND d NOT NULL) - OR b=223 - OR (d>=75.0 AND d<76.0 AND d NOT NULL) - ORDER BY a - } -} {10 12 15 17 21 33 41 43 57 67 69 75 93 95 scan 0 sort 0} -do_test where7-2.522.1 { - count_steps { - SELECT a FROM t2 - WHERE b=124 - OR (d>=89.0 AND d<90.0 AND d NOT NULL) - OR b=14 - OR ((a BETWEEN 6 AND 8) AND a!=7) - OR (d>=1.0 AND d<2.0 AND d NOT NULL) - OR (g='ihgfedc' AND f GLOB 'cdefg*') - OR b=704 - OR f='wxyzabcde' - OR b=1048 - ORDER BY a - } -} {1 6 8 22 48 64 74 80 89 100 scan 0 sort 0} -do_test where7-2.522.2 { - count_steps { - SELECT a FROM t3 - WHERE b=124 - OR (d>=89.0 AND d<90.0 AND d NOT NULL) - OR b=14 - OR ((a BETWEEN 6 AND 8) AND a!=7) - OR (d>=1.0 AND d<2.0 AND d NOT NULL) - OR (g='ihgfedc' AND f GLOB 'cdefg*') - OR b=704 - OR f='wxyzabcde' - OR b=1048 - ORDER BY a - } -} {1 6 8 22 48 64 74 80 89 100 scan 0 sort 0} -do_test where7-2.523.1 { - count_steps { - SELECT a FROM t2 - WHERE a=32 - OR ((a BETWEEN 39 AND 41) AND a!=40) - OR (g='jihgfed' AND f GLOB 'wxyza*') - OR ((a BETWEEN 27 AND 29) AND a!=28) - OR b=781 - OR (d>=4.0 AND d<5.0 AND d NOT NULL) - OR b=1012 - OR ((a BETWEEN 5 AND 7) AND a!=6) - OR b=740 - OR b=861 - OR 1000000=4.0 AND d<5.0 AND d NOT NULL) - OR b=1012 - OR ((a BETWEEN 5 AND 7) AND a!=6) - OR b=740 - OR b=861 - OR 1000000=18.0 AND d<19.0 AND d NOT NULL) - OR c=12012 - OR ((a BETWEEN 66 AND 68) AND a!=67) - OR b=300 - OR (d>=6.0 AND d<7.0 AND d NOT NULL) - OR ((a BETWEEN 31 AND 33) AND a!=32) - OR (g='xwvutsr' AND f GLOB 'defgh*') - OR b=704 - OR f='vwxyzabcd' - ORDER BY a - } -} {3 6 10 12 18 21 31 33 34 35 36 47 64 66 68 73 77 99 scan 0 sort 0} -do_test where7-2.524.2 { - count_steps { - SELECT a FROM t3 - WHERE b=847 - OR ((a BETWEEN 10 AND 12) AND a!=11) - OR (d>=18.0 AND d<19.0 AND d NOT NULL) - OR c=12012 - OR ((a BETWEEN 66 AND 68) AND a!=67) - OR b=300 - OR (d>=6.0 AND d<7.0 AND d NOT NULL) - OR ((a BETWEEN 31 AND 33) AND a!=32) - OR (g='xwvutsr' AND f GLOB 'defgh*') - OR b=704 - OR f='vwxyzabcd' - ORDER BY a - } -} {3 6 10 12 18 21 31 33 34 35 36 47 64 66 68 73 77 99 scan 0 sort 0} -do_test where7-2.525.1 { - count_steps { - SELECT a FROM t2 - WHERE f='tuvwxyzab' - OR a=22 - OR (g='kjihgfe' AND f GLOB 'stuvw*') - OR b=817 - OR b=1078 - OR c=17017 - OR (g='vutsrqp' AND f GLOB 'nopqr*') - OR ((a BETWEEN 26 AND 28) AND a!=27) - OR b=542 - OR b=396 - OR b=784 - ORDER BY a - } -} {13 19 22 26 28 36 45 49 50 51 70 71 97 98 scan 0 sort 0} -do_test where7-2.525.2 { - count_steps { - SELECT a FROM t3 - WHERE f='tuvwxyzab' - OR a=22 - OR (g='kjihgfe' AND f GLOB 'stuvw*') - OR b=817 - OR b=1078 - OR c=17017 - OR (g='vutsrqp' AND f GLOB 'nopqr*') - OR ((a BETWEEN 26 AND 28) AND a!=27) - OR b=542 - OR b=396 - OR b=784 - ORDER BY a - } -} {13 19 22 26 28 36 45 49 50 51 70 71 97 98 scan 0 sort 0} -do_test where7-2.526.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 29 AND 31) AND a!=30) - OR (g='rqponml' AND f GLOB 'jklmn*') - OR a=39 - OR (d>=10.0 AND d<11.0 AND d NOT NULL) - OR ((a BETWEEN 43 AND 45) AND a!=44) - OR a=40 - ORDER BY a - } -} {10 29 31 35 39 40 43 45 scan 0 sort 0} -do_test where7-2.526.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 29 AND 31) AND a!=30) - OR (g='rqponml' AND f GLOB 'jklmn*') - OR a=39 - OR (d>=10.0 AND d<11.0 AND d NOT NULL) - OR ((a BETWEEN 43 AND 45) AND a!=44) - OR a=40 - ORDER BY a - } -} {10 29 31 35 39 40 43 45 scan 0 sort 0} -do_test where7-2.527.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 72 AND 74) AND a!=73) - OR (g='fedcbaz' AND f GLOB 'pqrst*') - OR b=454 - OR (d>=68.0 AND d<69.0 AND d NOT NULL) - ORDER BY a - } -} {68 72 74 93 scan 0 sort 0} -do_test where7-2.527.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 72 AND 74) AND a!=73) - OR (g='fedcbaz' AND f GLOB 'pqrst*') - OR b=454 - OR (d>=68.0 AND d<69.0 AND d NOT NULL) - ORDER BY a - } -} {68 72 74 93 scan 0 sort 0} -do_test where7-2.528.1 { - count_steps { - SELECT a FROM t2 - WHERE b=891 - OR b=594 - OR b=253 - OR b=550 - OR (f GLOB '?efgh*' AND f GLOB 'defg*') - ORDER BY a - } -} {3 23 29 50 54 55 81 scan 0 sort 0} -do_test where7-2.528.2 { - count_steps { - SELECT a FROM t3 - WHERE b=891 - OR b=594 - OR b=253 - OR b=550 - OR (f GLOB '?efgh*' AND f GLOB 'defg*') - ORDER BY a - } -} {3 23 29 50 54 55 81 scan 0 sort 0} -do_test where7-2.529.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='lkjihgf' AND f GLOB 'lmnop*') - OR (f GLOB '?fghi*' AND f GLOB 'efgh*') - OR ((a BETWEEN 74 AND 76) AND a!=75) - ORDER BY a - } -} {4 30 56 63 74 76 82 scan 0 sort 0} -do_test where7-2.529.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='lkjihgf' AND f GLOB 'lmnop*') - OR (f GLOB '?fghi*' AND f GLOB 'efgh*') - OR ((a BETWEEN 74 AND 76) AND a!=75) - ORDER BY a - } -} {4 30 56 63 74 76 82 scan 0 sort 0} -do_test where7-2.530.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 76 AND 78) AND a!=77) - OR (f GLOB '?ghij*' AND f GLOB 'fghi*') - OR b=36 - OR a=40 - OR b=1059 - OR (g='qponmlk' AND f GLOB 'nopqr*') - OR (d>=96.0 AND d<97.0 AND d NOT NULL) - ORDER BY a - } -} {5 31 39 40 57 76 78 83 96 scan 0 sort 0} -do_test where7-2.530.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 76 AND 78) AND a!=77) - OR (f GLOB '?ghij*' AND f GLOB 'fghi*') - OR b=36 - OR a=40 - OR b=1059 - OR (g='qponmlk' AND f GLOB 'nopqr*') - OR (d>=96.0 AND d<97.0 AND d NOT NULL) - ORDER BY a - } -} {5 31 39 40 57 76 78 83 96 scan 0 sort 0} -do_test where7-2.531.1 { - count_steps { - SELECT a FROM t2 - WHERE f='tuvwxyzab' - OR (g='wvutsrq' AND f GLOB 'lmnop*') - OR (d>=80.0 AND d<81.0 AND d NOT NULL) - OR (d>=27.0 AND d<28.0 AND d NOT NULL) - ORDER BY a - } -} {11 19 27 45 71 80 97 scan 0 sort 0} -do_test where7-2.531.2 { - count_steps { - SELECT a FROM t3 - WHERE f='tuvwxyzab' - OR (g='wvutsrq' AND f GLOB 'lmnop*') - OR (d>=80.0 AND d<81.0 AND d NOT NULL) - OR (d>=27.0 AND d<28.0 AND d NOT NULL) - ORDER BY a - } -} {11 19 27 45 71 80 97 scan 0 sort 0} -do_test where7-2.532.1 { - count_steps { - SELECT a FROM t2 - WHERE b=751 - OR ((a BETWEEN 40 AND 42) AND a!=41) - OR f='rstuvwxyz' - OR (g='xwvutsr' AND f GLOB 'hijkl*') - OR b=209 - OR c=23023 - OR (g='jihgfed' AND f GLOB 'xyzab*') - OR (g='gfedcba' AND f GLOB 'nopqr*') - OR b=110 - OR b=55 - OR b=267 - ORDER BY a - } -} {5 7 10 17 19 40 42 43 67 68 69 75 91 95 scan 0 sort 0} -do_test where7-2.532.2 { - count_steps { - SELECT a FROM t3 - WHERE b=751 - OR ((a BETWEEN 40 AND 42) AND a!=41) - OR f='rstuvwxyz' - OR (g='xwvutsr' AND f GLOB 'hijkl*') - OR b=209 - OR c=23023 - OR (g='jihgfed' AND f GLOB 'xyzab*') - OR (g='gfedcba' AND f GLOB 'nopqr*') - OR b=110 - OR b=55 - OR b=267 - ORDER BY a - } -} {5 7 10 17 19 40 42 43 67 68 69 75 91 95 scan 0 sort 0} -do_test where7-2.533.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=53.0 AND d<54.0 AND d NOT NULL) - OR (g='ponmlkj' AND f GLOB 'uvwxy*') - OR b=495 - ORDER BY a - } -} {45 46 53 scan 0 sort 0} -do_test where7-2.533.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=53.0 AND d<54.0 AND d NOT NULL) - OR (g='ponmlkj' AND f GLOB 'uvwxy*') - OR b=495 - ORDER BY a - } -} {45 46 53 scan 0 sort 0} -do_test where7-2.534.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 82 AND 84) AND a!=83) - OR (g='vutsrqp' AND f GLOB 'qrstu*') - ORDER BY a - } -} {16 82 84 scan 0 sort 0} -do_test where7-2.534.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 82 AND 84) AND a!=83) - OR (g='vutsrqp' AND f GLOB 'qrstu*') - ORDER BY a - } -} {16 82 84 scan 0 sort 0} -do_test where7-2.535.1 { - count_steps { - SELECT a FROM t2 - WHERE a=30 - OR c=13013 - OR (f GLOB '?abcd*' AND f GLOB 'zabc*') - OR ((a BETWEEN 70 AND 72) AND a!=71) - OR c=11011 - ORDER BY a - } -} {25 30 31 32 33 37 38 39 51 70 72 77 scan 0 sort 0} -do_test where7-2.535.2 { - count_steps { - SELECT a FROM t3 - WHERE a=30 - OR c=13013 - OR (f GLOB '?abcd*' AND f GLOB 'zabc*') - OR ((a BETWEEN 70 AND 72) AND a!=71) - OR c=11011 - ORDER BY a - } -} {25 30 31 32 33 37 38 39 51 70 72 77 scan 0 sort 0} -do_test where7-2.536.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='kjihgfe' AND f GLOB 'rstuv*') - OR (d>=93.0 AND d<94.0 AND d NOT NULL) - ORDER BY a - } -} {69 93 scan 0 sort 0} -do_test where7-2.536.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='kjihgfe' AND f GLOB 'rstuv*') - OR (d>=93.0 AND d<94.0 AND d NOT NULL) - ORDER BY a - } -} {69 93 scan 0 sort 0} -do_test where7-2.537.1 { - count_steps { - SELECT a FROM t2 - WHERE c=13013 - OR (g='ihgfedc' AND f GLOB 'defgh*') - OR ((a BETWEEN 19 AND 21) AND a!=20) - OR (g='edcbazy' AND f GLOB 'vwxyz*') - OR a=72 - OR ((a BETWEEN 40 AND 42) AND a!=41) - OR (d>=90.0 AND d<91.0 AND d NOT NULL) - OR a=96 - OR (f GLOB '?rstu*' AND f GLOB 'qrst*') - OR b=352 - ORDER BY a - } -} {16 19 21 32 37 38 39 40 42 68 72 81 90 94 96 99 scan 0 sort 0} -do_test where7-2.537.2 { - count_steps { - SELECT a FROM t3 - WHERE c=13013 - OR (g='ihgfedc' AND f GLOB 'defgh*') - OR ((a BETWEEN 19 AND 21) AND a!=20) - OR (g='edcbazy' AND f GLOB 'vwxyz*') - OR a=72 - OR ((a BETWEEN 40 AND 42) AND a!=41) - OR (d>=90.0 AND d<91.0 AND d NOT NULL) - OR a=96 - OR (f GLOB '?rstu*' AND f GLOB 'qrst*') - OR b=352 - ORDER BY a - } -} {16 19 21 32 37 38 39 40 42 68 72 81 90 94 96 99 scan 0 sort 0} -do_test where7-2.538.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 84 AND 86) AND a!=85) - OR ((a BETWEEN 30 AND 32) AND a!=31) - OR (d>=95.0 AND d<96.0 AND d NOT NULL) - OR (d>=25.0 AND d<26.0 AND d NOT NULL) - OR (d>=63.0 AND d<64.0 AND d NOT NULL) - OR ((a BETWEEN 6 AND 8) AND a!=7) - OR f='stuvwxyza' - OR a=40 - OR (g='mlkjihg' AND f GLOB 'ghijk*') - OR (d>=39.0 AND d<40.0 AND d NOT NULL) - OR (g='rqponml' AND f GLOB 'ijklm*') - ORDER BY a - } -} {6 8 18 25 30 32 34 39 40 44 58 63 70 84 86 95 96 scan 0 sort 0} -do_test where7-2.538.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 84 AND 86) AND a!=85) - OR ((a BETWEEN 30 AND 32) AND a!=31) - OR (d>=95.0 AND d<96.0 AND d NOT NULL) - OR (d>=25.0 AND d<26.0 AND d NOT NULL) - OR (d>=63.0 AND d<64.0 AND d NOT NULL) - OR ((a BETWEEN 6 AND 8) AND a!=7) - OR f='stuvwxyza' - OR a=40 - OR (g='mlkjihg' AND f GLOB 'ghijk*') - OR (d>=39.0 AND d<40.0 AND d NOT NULL) - OR (g='rqponml' AND f GLOB 'ijklm*') - ORDER BY a - } -} {6 8 18 25 30 32 34 39 40 44 58 63 70 84 86 95 96 scan 0 sort 0} -do_test where7-2.539.1 { - count_steps { - SELECT a FROM t2 - WHERE f='stuvwxyza' - OR b=916 - OR (g='mlkjihg' AND f GLOB 'klmno*') - OR a=92 - OR b=927 - OR (d>=32.0 AND d<33.0 AND d NOT NULL) - OR (f GLOB '?lmno*' AND f GLOB 'klmn*') - OR b=190 - OR ((a BETWEEN 20 AND 22) AND a!=21) - OR b=465 - OR a=9 - ORDER BY a - } -} {9 10 18 20 22 32 36 44 62 70 88 92 96 scan 0 sort 0} -do_test where7-2.539.2 { - count_steps { - SELECT a FROM t3 - WHERE f='stuvwxyza' - OR b=916 - OR (g='mlkjihg' AND f GLOB 'klmno*') - OR a=92 - OR b=927 - OR (d>=32.0 AND d<33.0 AND d NOT NULL) - OR (f GLOB '?lmno*' AND f GLOB 'klmn*') - OR b=190 - OR ((a BETWEEN 20 AND 22) AND a!=21) - OR b=465 - OR a=9 - ORDER BY a - } -} {9 10 18 20 22 32 36 44 62 70 88 92 96 scan 0 sort 0} -do_test where7-2.540.1 { - count_steps { - SELECT a FROM t2 - WHERE f='jklmnopqr' - OR ((a BETWEEN 71 AND 73) AND a!=72) - OR ((a BETWEEN 71 AND 73) AND a!=72) - OR ((a BETWEEN 32 AND 34) AND a!=33) - OR ((a BETWEEN 99 AND 101) AND a!=100) - OR b=704 - ORDER BY a - } -} {9 32 34 35 61 64 71 73 87 99 scan 0 sort 0} -do_test where7-2.540.2 { - count_steps { - SELECT a FROM t3 - WHERE f='jklmnopqr' - OR ((a BETWEEN 71 AND 73) AND a!=72) - OR ((a BETWEEN 71 AND 73) AND a!=72) - OR ((a BETWEEN 32 AND 34) AND a!=33) - OR ((a BETWEEN 99 AND 101) AND a!=100) - OR b=704 - ORDER BY a - } -} {9 32 34 35 61 64 71 73 87 99 scan 0 sort 0} -do_test where7-2.541.1 { - count_steps { - SELECT a FROM t2 - WHERE b=22 - OR b=1023 - ORDER BY a - } -} {2 93 scan 0 sort 1} -do_test where7-2.541.2 { - count_steps { - SELECT a FROM t3 - WHERE b=22 - OR b=1023 - ORDER BY a - } -} {2 93 scan 0 sort 1} -do_test where7-2.542.1 { - count_steps { - SELECT a FROM t2 - WHERE c=2002 - OR ((a BETWEEN 63 AND 65) AND a!=64) - OR ((a BETWEEN 28 AND 30) AND a!=29) - OR ((a BETWEEN 92 AND 94) AND a!=93) - OR (g='edcbazy' AND f GLOB 'vwxyz*') - OR e IS NULL - OR b=839 - OR b=883 - ORDER BY a - } -} {4 5 6 28 30 63 65 92 94 99 scan 0 sort 0} -do_test where7-2.542.2 { - count_steps { - SELECT a FROM t3 - WHERE c=2002 - OR ((a BETWEEN 63 AND 65) AND a!=64) - OR ((a BETWEEN 28 AND 30) AND a!=29) - OR ((a BETWEEN 92 AND 94) AND a!=93) - OR (g='edcbazy' AND f GLOB 'vwxyz*') - OR e IS NULL - OR b=839 - OR b=883 - ORDER BY a - } -} {4 5 6 28 30 63 65 92 94 99 scan 0 sort 0} -do_test where7-2.543.1 { - count_steps { - SELECT a FROM t2 - WHERE b=47 - OR b=113 - OR (d>=78.0 AND d<79.0 AND d NOT NULL) - OR a=19 - OR (g='utsrqpo' AND f GLOB 'wxyza*') - OR b=88 - OR b=1004 - OR b=341 - ORDER BY a - } -} {8 19 22 31 78 scan 0 sort 0} -do_test where7-2.543.2 { - count_steps { - SELECT a FROM t3 - WHERE b=47 - OR b=113 - OR (d>=78.0 AND d<79.0 AND d NOT NULL) - OR a=19 - OR (g='utsrqpo' AND f GLOB 'wxyza*') - OR b=88 - OR b=1004 - OR b=341 - ORDER BY a - } -} {8 19 22 31 78 scan 0 sort 0} -do_test where7-2.544.1 { - count_steps { - SELECT a FROM t2 - WHERE b=330 - OR (d>=91.0 AND d<92.0 AND d NOT NULL) - OR (g='rqponml' AND f GLOB 'jklmn*') - OR (d>=53.0 AND d<54.0 AND d NOT NULL) - OR b=157 - OR b=982 - OR (d>=40.0 AND d<41.0 AND d NOT NULL) - OR (d>=31.0 AND d<32.0 AND d NOT NULL) - OR a=57 - OR c=21021 - ORDER BY a - } -} {30 31 35 40 53 57 61 62 63 91 scan 0 sort 0} -do_test where7-2.544.2 { - count_steps { - SELECT a FROM t3 - WHERE b=330 - OR (d>=91.0 AND d<92.0 AND d NOT NULL) - OR (g='rqponml' AND f GLOB 'jklmn*') - OR (d>=53.0 AND d<54.0 AND d NOT NULL) - OR b=157 - OR b=982 - OR (d>=40.0 AND d<41.0 AND d NOT NULL) - OR (d>=31.0 AND d<32.0 AND d NOT NULL) - OR a=57 - OR c=21021 - ORDER BY a - } -} {30 31 35 40 53 57 61 62 63 91 scan 0 sort 0} -do_test where7-2.545.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 29 AND 31) AND a!=30) - OR b=440 - OR a=48 - OR a=5 - ORDER BY a - } -} {5 29 31 40 48 scan 0 sort 0} -do_test where7-2.545.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 29 AND 31) AND a!=30) - OR b=440 - OR a=48 - OR a=5 - ORDER BY a - } -} {5 29 31 40 48 scan 0 sort 0} -do_test where7-2.546.1 { - count_steps { - SELECT a FROM t2 - WHERE b=575 - OR (d>=66.0 AND d<67.0 AND d NOT NULL) - OR ((a BETWEEN 83 AND 85) AND a!=84) - OR ((a BETWEEN 85 AND 87) AND a!=86) - ORDER BY a - } -} {66 83 85 87 scan 0 sort 0} -do_test where7-2.546.2 { - count_steps { - SELECT a FROM t3 - WHERE b=575 - OR (d>=66.0 AND d<67.0 AND d NOT NULL) - OR ((a BETWEEN 83 AND 85) AND a!=84) - OR ((a BETWEEN 85 AND 87) AND a!=86) - ORDER BY a - } -} {66 83 85 87 scan 0 sort 0} -do_test where7-2.547.1 { - count_steps { - SELECT a FROM t2 - WHERE b=913 - OR a=63 - OR (d>=80.0 AND d<81.0 AND d NOT NULL) - ORDER BY a - } -} {63 80 83 scan 0 sort 0} -do_test where7-2.547.2 { - count_steps { - SELECT a FROM t3 - WHERE b=913 - OR a=63 - OR (d>=80.0 AND d<81.0 AND d NOT NULL) - ORDER BY a - } -} {63 80 83 scan 0 sort 0} -do_test where7-2.548.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='ponmlkj' AND f GLOB 'uvwxy*') - OR (f GLOB '?opqr*' AND f GLOB 'nopq*') - OR ((a BETWEEN 39 AND 41) AND a!=40) - ORDER BY a - } -} {13 39 41 46 65 91 scan 0 sort 0} -do_test where7-2.548.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='ponmlkj' AND f GLOB 'uvwxy*') - OR (f GLOB '?opqr*' AND f GLOB 'nopq*') - OR ((a BETWEEN 39 AND 41) AND a!=40) - ORDER BY a - } -} {13 39 41 46 65 91 scan 0 sort 0} -do_test where7-2.549.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 94 AND 96) AND a!=95) - OR (d>=59.0 AND d<60.0 AND d NOT NULL) - OR (d>=90.0 AND d<91.0 AND d NOT NULL) - ORDER BY a - } -} {59 90 94 96 scan 0 sort 0} -do_test where7-2.549.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 94 AND 96) AND a!=95) - OR (d>=59.0 AND d<60.0 AND d NOT NULL) - OR (d>=90.0 AND d<91.0 AND d NOT NULL) - ORDER BY a - } -} {59 90 94 96 scan 0 sort 0} -do_test where7-2.550.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='hgfedcb' AND f GLOB 'ijklm*') - OR c=10010 - OR a=77 - OR ((a BETWEEN 50 AND 52) AND a!=51) - OR (d>=14.0 AND d<15.0 AND d NOT NULL) - OR a=64 - OR a=58 - OR a=80 - OR (g='ponmlkj' AND f GLOB 'uvwxy*') - OR b=102 - ORDER BY a - } -} {14 28 29 30 46 50 52 58 64 77 80 86 scan 0 sort 0} -do_test where7-2.550.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='hgfedcb' AND f GLOB 'ijklm*') - OR c=10010 - OR a=77 - OR ((a BETWEEN 50 AND 52) AND a!=51) - OR (d>=14.0 AND d<15.0 AND d NOT NULL) - OR a=64 - OR a=58 - OR a=80 - OR (g='ponmlkj' AND f GLOB 'uvwxy*') - OR b=102 - ORDER BY a - } -} {14 28 29 30 46 50 52 58 64 77 80 86 scan 0 sort 0} -do_test where7-2.551.1 { - count_steps { - SELECT a FROM t2 - WHERE b=718 - OR b=806 - OR (d>=12.0 AND d<13.0 AND d NOT NULL) - OR b=597 - OR (f GLOB '?efgh*' AND f GLOB 'defg*') - OR b=454 - OR (g='lkjihgf' AND f GLOB 'nopqr*') - OR ((a BETWEEN 18 AND 20) AND a!=19) - OR b=586 - OR ((a BETWEEN 98 AND 100) AND a!=99) - OR (f GLOB '?lmno*' AND f GLOB 'klmn*') - ORDER BY a - } -} {3 10 12 18 20 29 36 55 62 65 81 88 98 100 scan 0 sort 0} -do_test where7-2.551.2 { - count_steps { - SELECT a FROM t3 - WHERE b=718 - OR b=806 - OR (d>=12.0 AND d<13.0 AND d NOT NULL) - OR b=597 - OR (f GLOB '?efgh*' AND f GLOB 'defg*') - OR b=454 - OR (g='lkjihgf' AND f GLOB 'nopqr*') - OR ((a BETWEEN 18 AND 20) AND a!=19) - OR b=586 - OR ((a BETWEEN 98 AND 100) AND a!=99) - OR (f GLOB '?lmno*' AND f GLOB 'klmn*') - ORDER BY a - } -} {3 10 12 18 20 29 36 55 62 65 81 88 98 100 scan 0 sort 0} -do_test where7-2.552.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='ponmlkj' AND f GLOB 'rstuv*') - OR (g='edcbazy' AND f GLOB 'wxyza*') - OR b=55 - OR b=1048 - OR ((a BETWEEN 18 AND 20) AND a!=19) - ORDER BY a - } -} {5 18 20 43 100 scan 0 sort 0} -do_test where7-2.552.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='ponmlkj' AND f GLOB 'rstuv*') - OR (g='edcbazy' AND f GLOB 'wxyza*') - OR b=55 - OR b=1048 - OR ((a BETWEEN 18 AND 20) AND a!=19) - ORDER BY a - } -} {5 18 20 43 100 scan 0 sort 0} -do_test where7-2.553.1 { - count_steps { - SELECT a FROM t2 - WHERE b=1100 - OR a=37 - OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') - OR b=506 - ORDER BY a - } -} {8 34 37 46 60 86 100 scan 0 sort 0} -do_test where7-2.553.2 { - count_steps { - SELECT a FROM t3 - WHERE b=1100 - OR a=37 - OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') - OR b=506 - ORDER BY a - } -} {8 34 37 46 60 86 100 scan 0 sort 0} -do_test where7-2.554.1 { - count_steps { - SELECT a FROM t2 - WHERE b=484 - OR a=7 - OR c=9009 - OR (d>=67.0 AND d<68.0 AND d NOT NULL) - OR b=333 - OR c=23023 - OR b=847 - OR ((a BETWEEN 88 AND 90) AND a!=89) - ORDER BY a - } -} {7 25 26 27 44 67 68 69 77 88 90 scan 0 sort 0} -do_test where7-2.554.2 { - count_steps { - SELECT a FROM t3 - WHERE b=484 - OR a=7 - OR c=9009 - OR (d>=67.0 AND d<68.0 AND d NOT NULL) - OR b=333 - OR c=23023 - OR b=847 - OR ((a BETWEEN 88 AND 90) AND a!=89) - ORDER BY a - } -} {7 25 26 27 44 67 68 69 77 88 90 scan 0 sort 0} -do_test where7-2.555.1 { - count_steps { - SELECT a FROM t2 - WHERE a=6 - OR (d>=79.0 AND d<80.0 AND d NOT NULL) - OR b=451 - OR a=33 - ORDER BY a - } -} {6 33 41 79 scan 0 sort 0} -do_test where7-2.555.2 { - count_steps { - SELECT a FROM t3 - WHERE a=6 - OR (d>=79.0 AND d<80.0 AND d NOT NULL) - OR b=451 - OR a=33 - ORDER BY a - } -} {6 33 41 79 scan 0 sort 0} -do_test where7-2.556.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=68.0 AND d<69.0 AND d NOT NULL) - OR (g='jihgfed' AND f GLOB 'wxyza*') - OR ((a BETWEEN 18 AND 20) AND a!=19) - OR b=704 - ORDER BY a - } -} {18 20 64 68 74 scan 0 sort 0} -do_test where7-2.556.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=68.0 AND d<69.0 AND d NOT NULL) - OR (g='jihgfed' AND f GLOB 'wxyza*') - OR ((a BETWEEN 18 AND 20) AND a!=19) - OR b=704 - ORDER BY a - } -} {18 20 64 68 74 scan 0 sort 0} -do_test where7-2.557.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=98.0 AND d<99.0 AND d NOT NULL) - OR b=960 - OR (g='nmlkjih' AND f GLOB 'efghi*') - OR b=289 - ORDER BY a - } -} {56 98 scan 0 sort 0} -do_test where7-2.557.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=98.0 AND d<99.0 AND d NOT NULL) - OR b=960 - OR (g='nmlkjih' AND f GLOB 'efghi*') - OR b=289 - ORDER BY a - } -} {56 98 scan 0 sort 0} -do_test where7-2.558.1 { - count_steps { - SELECT a FROM t2 - WHERE b=619 - OR b=993 - OR a=52 - OR ((a BETWEEN 55 AND 57) AND a!=56) - OR (g='jihgfed' AND f GLOB 'yzabc*') - OR (g='jihgfed' AND f GLOB 'vwxyz*') - ORDER BY a - } -} {52 55 57 73 76 scan 0 sort 0} -do_test where7-2.558.2 { - count_steps { - SELECT a FROM t3 - WHERE b=619 - OR b=993 - OR a=52 - OR ((a BETWEEN 55 AND 57) AND a!=56) - OR (g='jihgfed' AND f GLOB 'yzabc*') - OR (g='jihgfed' AND f GLOB 'vwxyz*') - ORDER BY a - } -} {52 55 57 73 76 scan 0 sort 0} -do_test where7-2.559.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 89 AND 91) AND a!=90) - OR ((a BETWEEN 61 AND 63) AND a!=62) - OR (g='fedcbaz' AND f GLOB 'tuvwx*') - OR (d>=64.0 AND d<65.0 AND d NOT NULL) - OR a=8 - OR (d>=18.0 AND d<19.0 AND d NOT NULL) - OR (f GLOB '?yzab*' AND f GLOB 'xyza*') - OR (d>=1.0 AND d<2.0 AND d NOT NULL) - OR (d>=100.0 AND d<101.0 AND d NOT NULL) - ORDER BY a - } -} {1 8 18 23 49 61 63 64 75 89 91 97 100 scan 0 sort 0} -do_test where7-2.559.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 89 AND 91) AND a!=90) - OR ((a BETWEEN 61 AND 63) AND a!=62) - OR (g='fedcbaz' AND f GLOB 'tuvwx*') - OR (d>=64.0 AND d<65.0 AND d NOT NULL) - OR a=8 - OR (d>=18.0 AND d<19.0 AND d NOT NULL) - OR (f GLOB '?yzab*' AND f GLOB 'xyza*') - OR (d>=1.0 AND d<2.0 AND d NOT NULL) - OR (d>=100.0 AND d<101.0 AND d NOT NULL) - ORDER BY a - } -} {1 8 18 23 49 61 63 64 75 89 91 97 100 scan 0 sort 0} -do_test where7-2.560.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=7.0 AND d<8.0 AND d NOT NULL) - OR a=12 - OR f='qrstuvwxy' - OR (d>=75.0 AND d<76.0 AND d NOT NULL) - OR ((a BETWEEN 6 AND 8) AND a!=7) - OR c=25025 - OR a=60 - OR b=506 - OR (d>=4.0 AND d<5.0 AND d NOT NULL) - ORDER BY a - } -} {4 6 7 8 12 16 42 46 60 68 73 74 75 94 scan 0 sort 0} -do_test where7-2.560.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=7.0 AND d<8.0 AND d NOT NULL) - OR a=12 - OR f='qrstuvwxy' - OR (d>=75.0 AND d<76.0 AND d NOT NULL) - OR ((a BETWEEN 6 AND 8) AND a!=7) - OR c=25025 - OR a=60 - OR b=506 - OR (d>=4.0 AND d<5.0 AND d NOT NULL) - ORDER BY a - } -} {4 6 7 8 12 16 42 46 60 68 73 74 75 94 scan 0 sort 0} -do_test where7-2.561.1 { - count_steps { - SELECT a FROM t2 - WHERE b=553 - OR ((a BETWEEN 63 AND 65) AND a!=64) - OR (d>=76.0 AND d<77.0 AND d NOT NULL) - OR b=58 - ORDER BY a - } -} {63 65 76 scan 0 sort 0} -do_test where7-2.561.2 { - count_steps { - SELECT a FROM t3 - WHERE b=553 - OR ((a BETWEEN 63 AND 65) AND a!=64) - OR (d>=76.0 AND d<77.0 AND d NOT NULL) - OR b=58 - ORDER BY a - } -} {63 65 76 scan 0 sort 0} -do_test where7-2.562.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='srqponm' AND f GLOB 'cdefg*') - OR (f GLOB '?hijk*' AND f GLOB 'ghij*') - OR (g='edcbazy' AND f GLOB 'uvwxy*') - OR a=97 - OR a=20 - ORDER BY a - } -} {6 20 28 32 58 84 97 98 scan 0 sort 0} -do_test where7-2.562.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='srqponm' AND f GLOB 'cdefg*') - OR (f GLOB '?hijk*' AND f GLOB 'ghij*') - OR (g='edcbazy' AND f GLOB 'uvwxy*') - OR a=97 - OR a=20 - ORDER BY a - } -} {6 20 28 32 58 84 97 98 scan 0 sort 0} -do_test where7-2.563.1 { - count_steps { - SELECT a FROM t2 - WHERE b=836 - OR (g='kjihgfe' AND f GLOB 'stuvw*') - OR b=927 - OR a=21 - OR b=872 - OR (g='nmlkjih' AND f GLOB 'bcdef*') - OR c=32032 - ORDER BY a - } -} {21 53 70 76 94 95 96 scan 0 sort 0} -do_test where7-2.563.2 { - count_steps { - SELECT a FROM t3 - WHERE b=836 - OR (g='kjihgfe' AND f GLOB 'stuvw*') - OR b=927 - OR a=21 - OR b=872 - OR (g='nmlkjih' AND f GLOB 'bcdef*') - OR c=32032 - ORDER BY a - } -} {21 53 70 76 94 95 96 scan 0 sort 0} -do_test where7-2.564.1 { - count_steps { - SELECT a FROM t2 - WHERE b=850 - OR (g='lkjihgf' AND f GLOB 'pqrst*') - OR b=110 - OR ((a BETWEEN 39 AND 41) AND a!=40) - OR b=913 - OR ((a BETWEEN 14 AND 16) AND a!=15) - OR (g='rqponml' AND f GLOB 'hijkl*') - OR (d>=81.0 AND d<82.0 AND d NOT NULL) - OR (d>=5.0 AND d<6.0 AND d NOT NULL) - ORDER BY a - } -} {5 10 14 16 33 39 41 67 81 83 scan 0 sort 0} -do_test where7-2.564.2 { - count_steps { - SELECT a FROM t3 - WHERE b=850 - OR (g='lkjihgf' AND f GLOB 'pqrst*') - OR b=110 - OR ((a BETWEEN 39 AND 41) AND a!=40) - OR b=913 - OR ((a BETWEEN 14 AND 16) AND a!=15) - OR (g='rqponml' AND f GLOB 'hijkl*') - OR (d>=81.0 AND d<82.0 AND d NOT NULL) - OR (d>=5.0 AND d<6.0 AND d NOT NULL) - ORDER BY a - } -} {5 10 14 16 33 39 41 67 81 83 scan 0 sort 0} -do_test where7-2.565.1 { - count_steps { - SELECT a FROM t2 - WHERE b=696 - OR c=20020 - OR c=31031 - ORDER BY a - } -} {58 59 60 91 92 93 scan 0 sort 0} -do_test where7-2.565.2 { - count_steps { - SELECT a FROM t3 - WHERE b=696 - OR c=20020 - OR c=31031 - ORDER BY a - } -} {58 59 60 91 92 93 scan 0 sort 0} -do_test where7-2.566.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='srqponm' AND f GLOB 'defgh*') - OR b=462 - OR b=916 - OR ((a BETWEEN 59 AND 61) AND a!=60) - OR (d>=83.0 AND d<84.0 AND d NOT NULL) - OR (d>=88.0 AND d<89.0 AND d NOT NULL) - OR (f GLOB '?mnop*' AND f GLOB 'lmno*') - OR (g='edcbazy' AND f GLOB 'vwxyz*') - OR (g='rqponml' AND f GLOB 'ijklm*') - OR ((a BETWEEN 98 AND 100) AND a!=99) - OR f='fghijklmn' - ORDER BY a - } -} {5 11 29 31 34 37 42 57 59 61 63 83 88 89 98 99 100 scan 0 sort 0} -do_test where7-2.566.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='srqponm' AND f GLOB 'defgh*') - OR b=462 - OR b=916 - OR ((a BETWEEN 59 AND 61) AND a!=60) - OR (d>=83.0 AND d<84.0 AND d NOT NULL) - OR (d>=88.0 AND d<89.0 AND d NOT NULL) - OR (f GLOB '?mnop*' AND f GLOB 'lmno*') - OR (g='edcbazy' AND f GLOB 'vwxyz*') - OR (g='rqponml' AND f GLOB 'ijklm*') - OR ((a BETWEEN 98 AND 100) AND a!=99) - OR f='fghijklmn' - ORDER BY a - } -} {5 11 29 31 34 37 42 57 59 61 63 83 88 89 98 99 100 scan 0 sort 0} -do_test where7-2.567.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 5 AND 7) AND a!=6) - OR (g='qponmlk' AND f GLOB 'opqrs*') - OR (g='fedcbaz' AND f GLOB 'tuvwx*') - OR b<0 - OR (g='wvutsrq' AND f GLOB 'jklmn*') - OR (d>=76.0 AND d<77.0 AND d NOT NULL) - OR (d>=8.0 AND d<9.0 AND d NOT NULL) - OR (d>=83.0 AND d<84.0 AND d NOT NULL) - OR a=42 - OR (g='srqponm' AND f GLOB 'fghij*') - ORDER BY a - } -} {5 7 8 9 31 40 42 76 83 97 scan 0 sort 0} -do_test where7-2.567.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 5 AND 7) AND a!=6) - OR (g='qponmlk' AND f GLOB 'opqrs*') - OR (g='fedcbaz' AND f GLOB 'tuvwx*') - OR b<0 - OR (g='wvutsrq' AND f GLOB 'jklmn*') - OR (d>=76.0 AND d<77.0 AND d NOT NULL) - OR (d>=8.0 AND d<9.0 AND d NOT NULL) - OR (d>=83.0 AND d<84.0 AND d NOT NULL) - OR a=42 - OR (g='srqponm' AND f GLOB 'fghij*') - ORDER BY a - } -} {5 7 8 9 31 40 42 76 83 97 scan 0 sort 0} -do_test where7-2.568.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=83.0 AND d<84.0 AND d NOT NULL) - OR a=73 - OR ((a BETWEEN 92 AND 94) AND a!=93) - OR a=18 - OR ((a BETWEEN 31 AND 33) AND a!=32) - OR b=410 - OR a=79 - OR a=53 - ORDER BY a - } -} {18 31 33 53 73 79 83 92 94 scan 0 sort 0} -do_test where7-2.568.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=83.0 AND d<84.0 AND d NOT NULL) - OR a=73 - OR ((a BETWEEN 92 AND 94) AND a!=93) - OR a=18 - OR ((a BETWEEN 31 AND 33) AND a!=32) - OR b=410 - OR a=79 - OR a=53 - ORDER BY a - } -} {18 31 33 53 73 79 83 92 94 scan 0 sort 0} -do_test where7-2.569.1 { - count_steps { - SELECT a FROM t2 - WHERE b=715 - OR ((a BETWEEN 20 AND 22) AND a!=21) - OR f='yzabcdefg' - OR (d>=67.0 AND d<68.0 AND d NOT NULL) - OR b=11 - ORDER BY a - } -} {1 20 22 24 50 65 67 76 scan 0 sort 0} -do_test where7-2.569.2 { - count_steps { - SELECT a FROM t3 - WHERE b=715 - OR ((a BETWEEN 20 AND 22) AND a!=21) - OR f='yzabcdefg' - OR (d>=67.0 AND d<68.0 AND d NOT NULL) - OR b=11 - ORDER BY a - } -} {1 20 22 24 50 65 67 76 scan 0 sort 0} -do_test where7-2.570.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=34.0 AND d<35.0 AND d NOT NULL) - OR b=1070 - OR (d>=67.0 AND d<68.0 AND d NOT NULL) - OR c=27027 - OR a=59 - OR c=31031 - ORDER BY a - } -} {34 59 67 79 80 81 91 92 93 scan 0 sort 0} -do_test where7-2.570.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=34.0 AND d<35.0 AND d NOT NULL) - OR b=1070 - OR (d>=67.0 AND d<68.0 AND d NOT NULL) - OR c=27027 - OR a=59 - OR c=31031 - ORDER BY a - } -} {34 59 67 79 80 81 91 92 93 scan 0 sort 0} -do_test where7-2.571.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='vutsrqp' AND f GLOB 'nopqr*') - OR ((a BETWEEN 65 AND 67) AND a!=66) - OR a=9 - OR (f GLOB '?mnop*' AND f GLOB 'lmno*') - OR c=19019 - OR (d>=33.0 AND d<34.0 AND d NOT NULL) - OR (g='lkjihgf' AND f GLOB 'pqrst*') - OR b=121 - OR (d>=32.0 AND d<33.0 AND d NOT NULL) - OR c=18018 - ORDER BY a - } -} {9 11 13 32 33 37 52 53 54 55 56 57 63 65 67 89 scan 0 sort 0} -do_test where7-2.571.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='vutsrqp' AND f GLOB 'nopqr*') - OR ((a BETWEEN 65 AND 67) AND a!=66) - OR a=9 - OR (f GLOB '?mnop*' AND f GLOB 'lmno*') - OR c=19019 - OR (d>=33.0 AND d<34.0 AND d NOT NULL) - OR (g='lkjihgf' AND f GLOB 'pqrst*') - OR b=121 - OR (d>=32.0 AND d<33.0 AND d NOT NULL) - OR c=18018 - ORDER BY a - } -} {9 11 13 32 33 37 52 53 54 55 56 57 63 65 67 89 scan 0 sort 0} -do_test where7-2.572.1 { - count_steps { - SELECT a FROM t2 - WHERE b=462 - OR (g='gfedcba' AND f GLOB 'opqrs*') - OR ((a BETWEEN 59 AND 61) AND a!=60) - ORDER BY a - } -} {42 59 61 92 scan 0 sort 0} -do_test where7-2.572.2 { - count_steps { - SELECT a FROM t3 - WHERE b=462 - OR (g='gfedcba' AND f GLOB 'opqrs*') - OR ((a BETWEEN 59 AND 61) AND a!=60) - ORDER BY a - } -} {42 59 61 92 scan 0 sort 0} -do_test where7-2.573.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='nmlkjih' AND f GLOB 'cdefg*') - OR ((a BETWEEN 36 AND 38) AND a!=37) - OR b=110 - OR a=88 - OR (d>=51.0 AND d<52.0 AND d NOT NULL) - ORDER BY a - } -} {10 36 38 51 54 88 scan 0 sort 0} -do_test where7-2.573.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='nmlkjih' AND f GLOB 'cdefg*') - OR ((a BETWEEN 36 AND 38) AND a!=37) - OR b=110 - OR a=88 - OR (d>=51.0 AND d<52.0 AND d NOT NULL) - ORDER BY a - } -} {10 36 38 51 54 88 scan 0 sort 0} -do_test where7-2.574.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=26.0 AND d<27.0 AND d NOT NULL) - OR ((a BETWEEN 8 AND 10) AND a!=9) - OR b=399 - OR b=264 - ORDER BY a - } -} {8 10 24 26 scan 0 sort 0} -do_test where7-2.574.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=26.0 AND d<27.0 AND d NOT NULL) - OR ((a BETWEEN 8 AND 10) AND a!=9) - OR b=399 - OR b=264 - ORDER BY a - } -} {8 10 24 26 scan 0 sort 0} -do_test where7-2.575.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='lkjihgf' AND f GLOB 'nopqr*') - OR b=300 - OR ((a BETWEEN 36 AND 38) AND a!=37) - OR a=14 - OR c=1001 - OR b=751 - OR (d>=91.0 AND d<92.0 AND d NOT NULL) - OR b=858 - OR (f GLOB '?klmn*' AND f GLOB 'jklm*') - OR (g='jihgfed' AND f GLOB 'yzabc*') - ORDER BY a - } -} {1 2 3 9 14 35 36 38 61 65 76 78 87 91 scan 0 sort 0} -do_test where7-2.575.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='lkjihgf' AND f GLOB 'nopqr*') - OR b=300 - OR ((a BETWEEN 36 AND 38) AND a!=37) - OR a=14 - OR c=1001 - OR b=751 - OR (d>=91.0 AND d<92.0 AND d NOT NULL) - OR b=858 - OR (f GLOB '?klmn*' AND f GLOB 'jklm*') - OR (g='jihgfed' AND f GLOB 'yzabc*') - ORDER BY a - } -} {1 2 3 9 14 35 36 38 61 65 76 78 87 91 scan 0 sort 0} -do_test where7-2.576.1 { - count_steps { - SELECT a FROM t2 - WHERE b=575 - OR b=209 - OR b=726 - OR c=15015 - OR (d>=36.0 AND d<37.0 AND d NOT NULL) - OR c=17017 - OR ((a BETWEEN 76 AND 78) AND a!=77) - OR c=16016 - ORDER BY a - } -} {19 36 43 44 45 46 47 48 49 50 51 66 76 78 scan 0 sort 0} -do_test where7-2.576.2 { - count_steps { - SELECT a FROM t3 - WHERE b=575 - OR b=209 - OR b=726 - OR c=15015 - OR (d>=36.0 AND d<37.0 AND d NOT NULL) - OR c=17017 - OR ((a BETWEEN 76 AND 78) AND a!=77) - OR c=16016 - ORDER BY a - } -} {19 36 43 44 45 46 47 48 49 50 51 66 76 78 scan 0 sort 0} -do_test where7-2.577.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=38.0 AND d<39.0 AND d NOT NULL) - OR c=30030 - OR c=3003 - OR (g='vutsrqp' AND f GLOB 'nopqr*') - OR b=69 - ORDER BY a - } -} {7 8 9 13 38 88 89 90 scan 0 sort 0} -do_test where7-2.577.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=38.0 AND d<39.0 AND d NOT NULL) - OR c=30030 - OR c=3003 - OR (g='vutsrqp' AND f GLOB 'nopqr*') - OR b=69 - ORDER BY a - } -} {7 8 9 13 38 88 89 90 scan 0 sort 0} -do_test where7-2.578.1 { - count_steps { - SELECT a FROM t2 - WHERE f='nopqrstuv' - OR ((a BETWEEN 18 AND 20) AND a!=19) - OR b=322 - ORDER BY a - } -} {13 18 20 39 65 91 scan 0 sort 0} -do_test where7-2.578.2 { - count_steps { - SELECT a FROM t3 - WHERE f='nopqrstuv' - OR ((a BETWEEN 18 AND 20) AND a!=19) - OR b=322 - ORDER BY a - } -} {13 18 20 39 65 91 scan 0 sort 0} -do_test where7-2.579.1 { - count_steps { - SELECT a FROM t2 - WHERE a=41 - OR b=1103 - OR (f GLOB '?tuvw*' AND f GLOB 'stuv*') - OR b=773 - ORDER BY a - } -} {18 41 44 70 96 scan 0 sort 0} -do_test where7-2.579.2 { - count_steps { - SELECT a FROM t3 - WHERE a=41 - OR b=1103 - OR (f GLOB '?tuvw*' AND f GLOB 'stuv*') - OR b=773 - ORDER BY a - } -} {18 41 44 70 96 scan 0 sort 0} -do_test where7-2.580.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='fedcbaz' AND f GLOB 'rstuv*') - OR ((a BETWEEN 6 AND 8) AND a!=7) - ORDER BY a - } -} {6 8 95 scan 0 sort 0} -do_test where7-2.580.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='fedcbaz' AND f GLOB 'rstuv*') - OR ((a BETWEEN 6 AND 8) AND a!=7) - ORDER BY a - } -} {6 8 95 scan 0 sort 0} -do_test where7-2.581.1 { - count_steps { - SELECT a FROM t2 - WHERE b=1004 - OR d>1e10 - OR (d>=72.0 AND d<73.0 AND d NOT NULL) - ORDER BY a - } -} {72 scan 0 sort 0} -do_test where7-2.581.2 { - count_steps { - SELECT a FROM t3 - WHERE b=1004 - OR d>1e10 - OR (d>=72.0 AND d<73.0 AND d NOT NULL) - ORDER BY a - } -} {72 scan 0 sort 0} -do_test where7-2.582.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 96 AND 98) AND a!=97) - OR b=858 - OR a=47 - OR a=59 - OR b=902 - OR b=740 - OR b=1059 - OR ((a BETWEEN 43 AND 45) AND a!=44) - ORDER BY a - } -} {43 45 47 59 78 82 96 98 scan 0 sort 0} -do_test where7-2.582.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 96 AND 98) AND a!=97) - OR b=858 - OR a=47 - OR a=59 - OR b=902 - OR b=740 - OR b=1059 - OR ((a BETWEEN 43 AND 45) AND a!=44) - ORDER BY a - } -} {43 45 47 59 78 82 96 98 scan 0 sort 0} -do_test where7-2.583.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=83.0 AND d<84.0 AND d NOT NULL) - OR (g='edcbazy' AND f GLOB 'vwxyz*') - ORDER BY a - } -} {83 99 scan 0 sort 0} -do_test where7-2.583.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=83.0 AND d<84.0 AND d NOT NULL) - OR (g='edcbazy' AND f GLOB 'vwxyz*') - ORDER BY a - } -} {83 99 scan 0 sort 0} -do_test where7-2.584.1 { - count_steps { - SELECT a FROM t2 - WHERE b=388 - OR b=11 - OR (d>=56.0 AND d<57.0 AND d NOT NULL) - OR b=960 - OR b=718 - OR (d>=95.0 AND d<96.0 AND d NOT NULL) - OR b=935 - ORDER BY a - } -} {1 56 85 95 scan 0 sort 0} -do_test where7-2.584.2 { - count_steps { - SELECT a FROM t3 - WHERE b=388 - OR b=11 - OR (d>=56.0 AND d<57.0 AND d NOT NULL) - OR b=960 - OR b=718 - OR (d>=95.0 AND d<96.0 AND d NOT NULL) - OR b=935 - ORDER BY a - } -} {1 56 85 95 scan 0 sort 0} -do_test where7-2.585.1 { - count_steps { - SELECT a FROM t2 - WHERE b=366 - OR (f GLOB '?nopq*' AND f GLOB 'mnop*') - OR (g='vutsrqp' AND f GLOB 'nopqr*') - OR (d>=5.0 AND d<6.0 AND d NOT NULL) - OR b=179 - OR b=110 - OR (g='mlkjihg' AND f GLOB 'klmno*') - OR (d>=68.0 AND d<69.0 AND d NOT NULL) - ORDER BY a - } -} {5 10 12 13 38 62 64 68 90 scan 0 sort 0} -do_test where7-2.585.2 { - count_steps { - SELECT a FROM t3 - WHERE b=366 - OR (f GLOB '?nopq*' AND f GLOB 'mnop*') - OR (g='vutsrqp' AND f GLOB 'nopqr*') - OR (d>=5.0 AND d<6.0 AND d NOT NULL) - OR b=179 - OR b=110 - OR (g='mlkjihg' AND f GLOB 'klmno*') - OR (d>=68.0 AND d<69.0 AND d NOT NULL) - ORDER BY a - } -} {5 10 12 13 38 62 64 68 90 scan 0 sort 0} -do_test where7-2.586.1 { - count_steps { - SELECT a FROM t2 - WHERE b=146 - OR b=374 - OR (g='kjihgfe' AND f GLOB 'rstuv*') - ORDER BY a - } -} {34 69 scan 0 sort 0} -do_test where7-2.586.2 { - count_steps { - SELECT a FROM t3 - WHERE b=146 - OR b=374 - OR (g='kjihgfe' AND f GLOB 'rstuv*') - ORDER BY a - } -} {34 69 scan 0 sort 0} -do_test where7-2.587.1 { - count_steps { - SELECT a FROM t2 - WHERE a=89 - OR a=97 - ORDER BY a - } -} {89 97 scan 0 sort 1} -do_test where7-2.587.2 { - count_steps { - SELECT a FROM t3 - WHERE a=89 - OR a=97 - ORDER BY a - } -} {89 97 scan 0 sort 1} -do_test where7-2.588.1 { - count_steps { - SELECT a FROM t2 - WHERE b=146 - OR f='ijklmnopq' - OR (d>=13.0 AND d<14.0 AND d NOT NULL) - OR b=99 - OR (d>=98.0 AND d<99.0 AND d NOT NULL) - OR ((a BETWEEN 34 AND 36) AND a!=35) - OR (d>=80.0 AND d<81.0 AND d NOT NULL) - OR (g='tsrqpon' AND f GLOB 'yzabc*') - OR ((a BETWEEN 51 AND 53) AND a!=52) - OR c=8008 - OR f='vwxyzabcd' - ORDER BY a - } -} {8 9 13 21 22 23 24 34 36 47 51 53 60 73 80 86 98 99 scan 0 sort 0} -do_test where7-2.588.2 { - count_steps { - SELECT a FROM t3 - WHERE b=146 - OR f='ijklmnopq' - OR (d>=13.0 AND d<14.0 AND d NOT NULL) - OR b=99 - OR (d>=98.0 AND d<99.0 AND d NOT NULL) - OR ((a BETWEEN 34 AND 36) AND a!=35) - OR (d>=80.0 AND d<81.0 AND d NOT NULL) - OR (g='tsrqpon' AND f GLOB 'yzabc*') - OR ((a BETWEEN 51 AND 53) AND a!=52) - OR c=8008 - OR f='vwxyzabcd' - ORDER BY a - } -} {8 9 13 21 22 23 24 34 36 47 51 53 60 73 80 86 98 99 scan 0 sort 0} -do_test where7-2.589.1 { - count_steps { - SELECT a FROM t2 - WHERE b=88 - OR b=847 - OR ((a BETWEEN 4 AND 6) AND a!=5) - OR f='hijklmnop' - OR ((a BETWEEN 23 AND 25) AND a!=24) - OR b=223 - OR (d>=30.0 AND d<31.0 AND d NOT NULL) - OR b=440 - ORDER BY a - } -} {4 6 7 8 23 25 30 33 40 59 77 85 scan 0 sort 0} -do_test where7-2.589.2 { - count_steps { - SELECT a FROM t3 - WHERE b=88 - OR b=847 - OR ((a BETWEEN 4 AND 6) AND a!=5) - OR f='hijklmnop' - OR ((a BETWEEN 23 AND 25) AND a!=24) - OR b=223 - OR (d>=30.0 AND d<31.0 AND d NOT NULL) - OR b=440 - ORDER BY a - } -} {4 6 7 8 23 25 30 33 40 59 77 85 scan 0 sort 0} -do_test where7-2.590.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=69.0 AND d<70.0 AND d NOT NULL) - OR (d>=95.0 AND d<96.0 AND d NOT NULL) - OR a=54 - OR a=68 - OR b=91 - ORDER BY a - } -} {54 68 69 95 scan 0 sort 0} -do_test where7-2.590.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=69.0 AND d<70.0 AND d NOT NULL) - OR (d>=95.0 AND d<96.0 AND d NOT NULL) - OR a=54 - OR a=68 - OR b=91 - ORDER BY a - } -} {54 68 69 95 scan 0 sort 0} -do_test where7-2.591.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='lkjihgf' AND f GLOB 'lmnop*') - OR b=968 - OR c=2002 - OR b=1081 - OR (g='xwvutsr' AND f GLOB 'ghijk*') - OR (g='wvutsrq' AND f GLOB 'jklmn*') - OR b=847 - ORDER BY a - } -} {4 5 6 9 63 77 88 scan 0 sort 0} -do_test where7-2.591.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='lkjihgf' AND f GLOB 'lmnop*') - OR b=968 - OR c=2002 - OR b=1081 - OR (g='xwvutsr' AND f GLOB 'ghijk*') - OR (g='wvutsrq' AND f GLOB 'jklmn*') - OR b=847 - ORDER BY a - } -} {4 5 6 9 63 77 88 scan 0 sort 0} -do_test where7-2.592.1 { - count_steps { - SELECT a FROM t2 - WHERE a=71 - OR b=1056 - OR ((a BETWEEN 81 AND 83) AND a!=82) - OR ((a BETWEEN 34 AND 36) AND a!=35) - OR a=47 - OR (d>=30.0 AND d<31.0 AND d NOT NULL) - OR ((a BETWEEN 75 AND 77) AND a!=76) - OR a=22 - OR (d>=24.0 AND d<25.0 AND d NOT NULL) - ORDER BY a - } -} {22 24 30 34 36 47 71 75 77 81 83 96 scan 0 sort 0} -do_test where7-2.592.2 { - count_steps { - SELECT a FROM t3 - WHERE a=71 - OR b=1056 - OR ((a BETWEEN 81 AND 83) AND a!=82) - OR ((a BETWEEN 34 AND 36) AND a!=35) - OR a=47 - OR (d>=30.0 AND d<31.0 AND d NOT NULL) - OR ((a BETWEEN 75 AND 77) AND a!=76) - OR a=22 - OR (d>=24.0 AND d<25.0 AND d NOT NULL) - ORDER BY a - } -} {22 24 30 34 36 47 71 75 77 81 83 96 scan 0 sort 0} -do_test where7-2.593.1 { - count_steps { - SELECT a FROM t2 - WHERE b=817 - OR ((a BETWEEN 54 AND 56) AND a!=55) - OR (d>=35.0 AND d<36.0 AND d NOT NULL) - ORDER BY a - } -} {35 54 56 scan 0 sort 0} -do_test where7-2.593.2 { - count_steps { - SELECT a FROM t3 - WHERE b=817 - OR ((a BETWEEN 54 AND 56) AND a!=55) - OR (d>=35.0 AND d<36.0 AND d NOT NULL) - ORDER BY a - } -} {35 54 56 scan 0 sort 0} -do_test where7-2.594.1 { - count_steps { - SELECT a FROM t2 - WHERE b=179 - OR ((a BETWEEN 75 AND 77) AND a!=76) - OR b=814 - OR a=4 - OR c=6006 - OR (g='nmlkjih' AND f GLOB 'bcdef*') - OR ((a BETWEEN 54 AND 56) AND a!=55) - OR 1000000=34035 - OR b=935 - OR b=102 - ORDER BY a - } -} {4 20 26 40 42 76 78 85 89 91 97 98 99 scan 0 sort 0} -do_test where7-2.595.2 { - count_steps { - SELECT a FROM t3 - WHERE c=33033 - OR ((a BETWEEN 76 AND 78) AND a!=77) - OR b=190 - OR a=26 - OR ((a BETWEEN 40 AND 42) AND a!=41) - OR b=220 - OR ((a BETWEEN 89 AND 91) AND a!=90) - OR b=44 - OR c>=34035 - OR b=935 - OR b=102 - ORDER BY a - } -} {4 20 26 40 42 76 78 85 89 91 97 98 99 scan 0 sort 0} -do_test where7-2.596.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 99 AND 101) AND a!=100) - OR b=146 - OR a=37 - OR (g='gfedcba' AND f GLOB 'klmno*') - OR f='jklmnopqr' - OR b=770 - OR b=850 - OR b=36 - OR c=27027 - OR a=97 - ORDER BY a - } -} {9 35 37 61 70 79 80 81 87 88 97 99 scan 0 sort 0} -do_test where7-2.596.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 99 AND 101) AND a!=100) - OR b=146 - OR a=37 - OR (g='gfedcba' AND f GLOB 'klmno*') - OR f='jklmnopqr' - OR b=770 - OR b=850 - OR b=36 - OR c=27027 - OR a=97 - ORDER BY a - } -} {9 35 37 61 70 79 80 81 87 88 97 99 scan 0 sort 0} -do_test where7-2.597.1 { - count_steps { - SELECT a FROM t2 - WHERE a=56 - OR b=407 - OR (g='rqponml' AND f GLOB 'ijklm*') - OR (f GLOB '?nopq*' AND f GLOB 'mnop*') - ORDER BY a - } -} {12 34 37 38 56 64 90 scan 0 sort 0} -do_test where7-2.597.2 { - count_steps { - SELECT a FROM t3 - WHERE a=56 - OR b=407 - OR (g='rqponml' AND f GLOB 'ijklm*') - OR (f GLOB '?nopq*' AND f GLOB 'mnop*') - ORDER BY a - } -} {12 34 37 38 56 64 90 scan 0 sort 0} -do_test where7-2.598.1 { - count_steps { - SELECT a FROM t2 - WHERE b=264 - OR a=67 - OR f='wxyzabcde' - OR a=41 - OR b=396 - OR a=3 - OR ((a BETWEEN 56 AND 58) AND a!=57) - ORDER BY a - } -} {3 22 24 36 41 48 56 58 67 74 100 scan 0 sort 0} -do_test where7-2.598.2 { - count_steps { - SELECT a FROM t3 - WHERE b=264 - OR a=67 - OR f='wxyzabcde' - OR a=41 - OR b=396 - OR a=3 - OR ((a BETWEEN 56 AND 58) AND a!=57) - ORDER BY a - } -} {3 22 24 36 41 48 56 58 67 74 100 scan 0 sort 0} -do_test where7-2.599.1 { - count_steps { - SELECT a FROM t2 - WHERE a=63 - OR (g='rqponml' AND f GLOB 'ijklm*') - OR a=33 - ORDER BY a - } -} {33 34 63 scan 0 sort 0} -do_test where7-2.599.2 { - count_steps { - SELECT a FROM t3 - WHERE a=63 - OR (g='rqponml' AND f GLOB 'ijklm*') - OR a=33 - ORDER BY a - } -} {33 34 63 scan 0 sort 0} -do_test where7-2.600.1 { - count_steps { - SELECT a FROM t2 - WHERE c=8008 - OR a=54 - OR (f GLOB '?ghij*' AND f GLOB 'fghi*') - OR a=83 - OR b=121 - OR ((a BETWEEN 56 AND 58) AND a!=57) - OR (d>=29.0 AND d<30.0 AND d NOT NULL) - OR b=1037 - OR b=253 - ORDER BY a - } -} {5 11 22 23 24 29 31 54 56 57 58 83 scan 0 sort 0} -do_test where7-2.600.2 { - count_steps { - SELECT a FROM t3 - WHERE c=8008 - OR a=54 - OR (f GLOB '?ghij*' AND f GLOB 'fghi*') - OR a=83 - OR b=121 - OR ((a BETWEEN 56 AND 58) AND a!=57) - OR (d>=29.0 AND d<30.0 AND d NOT NULL) - OR b=1037 - OR b=253 - ORDER BY a - } -} {5 11 22 23 24 29 31 54 56 57 58 83 scan 0 sort 0} -do_test where7-2.601.1 { - count_steps { - SELECT a FROM t2 - WHERE a=71 - OR b=806 - OR c=31031 - OR (g='nmlkjih' AND f GLOB 'bcdef*') - OR (g='qponmlk' AND f GLOB 'pqrst*') - OR c=16016 - OR ((a BETWEEN 76 AND 78) AND a!=77) - OR (g='kjihgfe' AND f GLOB 'stuvw*') - OR ((a BETWEEN 49 AND 51) AND a!=50) - ORDER BY a - } -} {41 46 47 48 49 51 53 70 71 76 78 91 92 93 scan 0 sort 0} -do_test where7-2.601.2 { - count_steps { - SELECT a FROM t3 - WHERE a=71 - OR b=806 - OR c=31031 - OR (g='nmlkjih' AND f GLOB 'bcdef*') - OR (g='qponmlk' AND f GLOB 'pqrst*') - OR c=16016 - OR ((a BETWEEN 76 AND 78) AND a!=77) - OR (g='kjihgfe' AND f GLOB 'stuvw*') - OR ((a BETWEEN 49 AND 51) AND a!=50) - ORDER BY a - } -} {41 46 47 48 49 51 53 70 71 76 78 91 92 93 scan 0 sort 0} -do_test where7-2.602.1 { - count_steps { - SELECT a FROM t2 - WHERE a=69 - OR ((a BETWEEN 61 AND 63) AND a!=62) - OR ((a BETWEEN 46 AND 48) AND a!=47) - OR (g='qponmlk' AND f GLOB 'nopqr*') - OR (g='nmlkjih' AND f GLOB 'efghi*') - OR b=396 - OR (d>=40.0 AND d<41.0 AND d NOT NULL) - OR a=100 - OR a=56 - OR b=674 - ORDER BY a - } -} {36 39 40 46 48 56 61 63 69 100 scan 0 sort 0} -do_test where7-2.602.2 { - count_steps { - SELECT a FROM t3 - WHERE a=69 - OR ((a BETWEEN 61 AND 63) AND a!=62) - OR ((a BETWEEN 46 AND 48) AND a!=47) - OR (g='qponmlk' AND f GLOB 'nopqr*') - OR (g='nmlkjih' AND f GLOB 'efghi*') - OR b=396 - OR (d>=40.0 AND d<41.0 AND d NOT NULL) - OR a=100 - OR a=56 - OR b=674 - ORDER BY a - } -} {36 39 40 46 48 56 61 63 69 100 scan 0 sort 0} -do_test where7-2.603.1 { - count_steps { - SELECT a FROM t2 - WHERE a=91 - OR ((a BETWEEN 13 AND 15) AND a!=14) - OR (d>=97.0 AND d<98.0 AND d NOT NULL) - OR ((a BETWEEN 76 AND 78) AND a!=77) - OR (d>=46.0 AND d<47.0 AND d NOT NULL) - OR (g='mlkjihg' AND f GLOB 'ghijk*') - OR b=69 - OR a=14 - OR (d>=53.0 AND d<54.0 AND d NOT NULL) - OR f='yzabcdefg' - OR (d>=39.0 AND d<40.0 AND d NOT NULL) - ORDER BY a - } -} {13 14 15 24 39 46 50 53 58 76 78 91 97 scan 0 sort 0} -do_test where7-2.603.2 { - count_steps { - SELECT a FROM t3 - WHERE a=91 - OR ((a BETWEEN 13 AND 15) AND a!=14) - OR (d>=97.0 AND d<98.0 AND d NOT NULL) - OR ((a BETWEEN 76 AND 78) AND a!=77) - OR (d>=46.0 AND d<47.0 AND d NOT NULL) - OR (g='mlkjihg' AND f GLOB 'ghijk*') - OR b=69 - OR a=14 - OR (d>=53.0 AND d<54.0 AND d NOT NULL) - OR f='yzabcdefg' - OR (d>=39.0 AND d<40.0 AND d NOT NULL) - ORDER BY a - } -} {13 14 15 24 39 46 50 53 58 76 78 91 97 scan 0 sort 0} -do_test where7-2.604.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='nmlkjih' AND f GLOB 'efghi*') - OR a=78 - OR a=4 - OR b=619 - OR a=45 - OR b=1067 - OR (g='ponmlkj' AND f GLOB 'stuvw*') - OR b=982 - OR a=52 - ORDER BY a - } -} {4 44 45 52 56 78 97 scan 0 sort 0} -do_test where7-2.604.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='nmlkjih' AND f GLOB 'efghi*') - OR a=78 - OR a=4 - OR b=619 - OR a=45 - OR b=1067 - OR (g='ponmlkj' AND f GLOB 'stuvw*') - OR b=982 - OR a=52 - ORDER BY a - } -} {4 44 45 52 56 78 97 scan 0 sort 0} -do_test where7-2.605.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=43.0 AND d<44.0 AND d NOT NULL) - OR (g='nmlkjih' AND f GLOB 'efghi*') - OR (g='mlkjihg' AND f GLOB 'ghijk*') - ORDER BY a - } -} {43 56 58 scan 0 sort 0} -do_test where7-2.605.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=43.0 AND d<44.0 AND d NOT NULL) - OR (g='nmlkjih' AND f GLOB 'efghi*') - OR (g='mlkjihg' AND f GLOB 'ghijk*') - ORDER BY a - } -} {43 56 58 scan 0 sort 0} -do_test where7-2.606.1 { - count_steps { - SELECT a FROM t2 - WHERE b=341 - OR f='rstuvwxyz' - OR ((a BETWEEN 40 AND 42) AND a!=41) - OR b=440 - OR a=27 - OR (g='fedcbaz' AND f GLOB 'tuvwx*') - ORDER BY a - } -} {17 27 31 40 42 43 69 95 97 scan 0 sort 0} -do_test where7-2.606.2 { - count_steps { - SELECT a FROM t3 - WHERE b=341 - OR f='rstuvwxyz' - OR ((a BETWEEN 40 AND 42) AND a!=41) - OR b=440 - OR a=27 - OR (g='fedcbaz' AND f GLOB 'tuvwx*') - ORDER BY a - } -} {17 27 31 40 42 43 69 95 97 scan 0 sort 0} -do_test where7-2.607.1 { - count_steps { - SELECT a FROM t2 - WHERE b=696 - OR b=1056 - OR ((a BETWEEN 82 AND 84) AND a!=83) - OR (d>=4.0 AND d<5.0 AND d NOT NULL) - OR a=83 - OR c=24024 - OR a=52 - OR b=300 - OR f='rstuvwxyz' - OR (g='qponmlk' AND f GLOB 'opqrs*') - ORDER BY a - } -} {4 17 40 43 52 69 70 71 72 82 83 84 95 96 scan 0 sort 0} -do_test where7-2.607.2 { - count_steps { - SELECT a FROM t3 - WHERE b=696 - OR b=1056 - OR ((a BETWEEN 82 AND 84) AND a!=83) - OR (d>=4.0 AND d<5.0 AND d NOT NULL) - OR a=83 - OR c=24024 - OR a=52 - OR b=300 - OR f='rstuvwxyz' - OR (g='qponmlk' AND f GLOB 'opqrs*') - ORDER BY a - } -} {4 17 40 43 52 69 70 71 72 82 83 84 95 96 scan 0 sort 0} -do_test where7-2.608.1 { - count_steps { - SELECT a FROM t2 - WHERE b=960 - OR b=806 - OR b=69 - OR ((a BETWEEN 95 AND 97) AND a!=96) - OR ((a BETWEEN 8 AND 10) AND a!=9) - ORDER BY a - } -} {8 10 95 97 scan 0 sort 0} -do_test where7-2.608.2 { - count_steps { - SELECT a FROM t3 - WHERE b=960 - OR b=806 - OR b=69 - OR ((a BETWEEN 95 AND 97) AND a!=96) - OR ((a BETWEEN 8 AND 10) AND a!=9) - ORDER BY a - } -} {8 10 95 97 scan 0 sort 0} -do_test where7-2.609.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='jihgfed' AND f GLOB 'wxyza*') - OR b=605 - OR ((a BETWEEN 48 AND 50) AND a!=49) - OR a=24 - OR (g='mlkjihg' AND f GLOB 'klmno*') - OR (d>=84.0 AND d<85.0 AND d NOT NULL) - ORDER BY a - } -} {24 48 50 55 62 74 84 scan 0 sort 0} -do_test where7-2.609.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='jihgfed' AND f GLOB 'wxyza*') - OR b=605 - OR ((a BETWEEN 48 AND 50) AND a!=49) - OR a=24 - OR (g='mlkjihg' AND f GLOB 'klmno*') - OR (d>=84.0 AND d<85.0 AND d NOT NULL) - ORDER BY a - } -} {24 48 50 55 62 74 84 scan 0 sort 0} -do_test where7-2.610.1 { - count_steps { - SELECT a FROM t2 - WHERE a=3 - OR a=24 - OR ((a BETWEEN 54 AND 56) AND a!=55) - OR a=91 - OR (d>=8.0 AND d<9.0 AND d NOT NULL) - OR (d>=97.0 AND d<98.0 AND d NOT NULL) - OR a=65 - OR ((a BETWEEN 14 AND 16) AND a!=15) - ORDER BY a - } -} {3 8 14 16 24 54 56 65 91 97 scan 0 sort 0} -do_test where7-2.610.2 { - count_steps { - SELECT a FROM t3 - WHERE a=3 - OR a=24 - OR ((a BETWEEN 54 AND 56) AND a!=55) - OR a=91 - OR (d>=8.0 AND d<9.0 AND d NOT NULL) - OR (d>=97.0 AND d<98.0 AND d NOT NULL) - OR a=65 - OR ((a BETWEEN 14 AND 16) AND a!=15) - ORDER BY a - } -} {3 8 14 16 24 54 56 65 91 97 scan 0 sort 0} -do_test where7-2.611.1 { - count_steps { - SELECT a FROM t2 - WHERE b=333 - OR (d>=13.0 AND d<14.0 AND d NOT NULL) - OR b=465 - OR c=32032 - OR b=396 - OR (f GLOB '?klmn*' AND f GLOB 'jklm*') - OR c=19019 - OR b=671 - ORDER BY a - } -} {9 13 35 36 55 56 57 61 87 94 95 96 scan 0 sort 0} -do_test where7-2.611.2 { - count_steps { - SELECT a FROM t3 - WHERE b=333 - OR (d>=13.0 AND d<14.0 AND d NOT NULL) - OR b=465 - OR c=32032 - OR b=396 - OR (f GLOB '?klmn*' AND f GLOB 'jklm*') - OR c=19019 - OR b=671 - ORDER BY a - } -} {9 13 35 36 55 56 57 61 87 94 95 96 scan 0 sort 0} -do_test where7-2.612.1 { - count_steps { - SELECT a FROM t2 - WHERE b=495 - OR a=23 - ORDER BY a - } -} {23 45 scan 0 sort 0} -do_test where7-2.612.2 { - count_steps { - SELECT a FROM t3 - WHERE b=495 - OR a=23 - ORDER BY a - } -} {23 45 scan 0 sort 0} -do_test where7-2.613.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=44.0 AND d<45.0 AND d NOT NULL) - OR ((a BETWEEN 35 AND 37) AND a!=36) - OR f='tuvwxyzab' - OR a=81 - OR (d>=58.0 AND d<59.0 AND d NOT NULL) - OR a=55 - OR b=1015 - ORDER BY a - } -} {19 35 37 44 45 55 58 71 81 97 scan 0 sort 0} -do_test where7-2.613.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=44.0 AND d<45.0 AND d NOT NULL) - OR ((a BETWEEN 35 AND 37) AND a!=36) - OR f='tuvwxyzab' - OR a=81 - OR (d>=58.0 AND d<59.0 AND d NOT NULL) - OR a=55 - OR b=1015 - ORDER BY a - } -} {19 35 37 44 45 55 58 71 81 97 scan 0 sort 0} -do_test where7-2.614.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=17.0 AND d<18.0 AND d NOT NULL) - OR ((a BETWEEN 63 AND 65) AND a!=64) - OR a=75 - OR (g='utsrqpo' AND f GLOB 'tuvwx*') - OR (d>=92.0 AND d<93.0 AND d NOT NULL) - OR (g='ponmlkj' AND f GLOB 'uvwxy*') - OR c=8008 - OR (g='hgfedcb' AND f GLOB 'jklmn*') - ORDER BY a - } -} {17 19 22 23 24 46 63 65 75 87 92 scan 0 sort 0} -do_test where7-2.614.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=17.0 AND d<18.0 AND d NOT NULL) - OR ((a BETWEEN 63 AND 65) AND a!=64) - OR a=75 - OR (g='utsrqpo' AND f GLOB 'tuvwx*') - OR (d>=92.0 AND d<93.0 AND d NOT NULL) - OR (g='ponmlkj' AND f GLOB 'uvwxy*') - OR c=8008 - OR (g='hgfedcb' AND f GLOB 'jklmn*') - ORDER BY a - } -} {17 19 22 23 24 46 63 65 75 87 92 scan 0 sort 0} -do_test where7-2.615.1 { - count_steps { - SELECT a FROM t2 - WHERE a=51 - OR b=278 - OR a=49 - OR f IS NULL - OR ((a BETWEEN 52 AND 54) AND a!=53) - OR ((a BETWEEN 11 AND 13) AND a!=12) - OR ((a BETWEEN 44 AND 46) AND a!=45) - OR b=1056 - OR (g='xwvutsr' AND f GLOB 'defgh*') - OR ((a BETWEEN 9 AND 11) AND a!=10) - OR b=66 - ORDER BY a - } -} {3 6 9 11 13 44 46 49 51 52 54 96 scan 0 sort 0} -do_test where7-2.615.2 { - count_steps { - SELECT a FROM t3 - WHERE a=51 - OR b=278 - OR a=49 - OR f IS NULL - OR ((a BETWEEN 52 AND 54) AND a!=53) - OR ((a BETWEEN 11 AND 13) AND a!=12) - OR ((a BETWEEN 44 AND 46) AND a!=45) - OR b=1056 - OR (g='xwvutsr' AND f GLOB 'defgh*') - OR ((a BETWEEN 9 AND 11) AND a!=10) - OR b=66 - ORDER BY a - } -} {3 6 9 11 13 44 46 49 51 52 54 96 scan 0 sort 0} -do_test where7-2.616.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=13.0 AND d<14.0 AND d NOT NULL) - OR b=418 - OR c=6006 - OR b=209 - OR a=83 - OR b=880 - ORDER BY a - } -} {13 16 17 18 19 38 80 83 scan 0 sort 0} -do_test where7-2.616.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=13.0 AND d<14.0 AND d NOT NULL) - OR b=418 - OR c=6006 - OR b=209 - OR a=83 - OR b=880 - ORDER BY a - } -} {13 16 17 18 19 38 80 83 scan 0 sort 0} -do_test where7-2.617.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 65 AND 67) AND a!=66) - OR (g='mlkjihg' AND f GLOB 'ijklm*') - OR ((a BETWEEN 20 AND 22) AND a!=21) - OR (d>=5.0 AND d<6.0 AND d NOT NULL) - OR b=762 - OR b=740 - OR (d>=59.0 AND d<60.0 AND d NOT NULL) - OR b=333 - OR ((a BETWEEN 21 AND 23) AND a!=22) - OR (d>=71.0 AND d<72.0 AND d NOT NULL) - OR (g='tsrqpon' AND f GLOB 'abcde*') - ORDER BY a - } -} {5 20 21 22 23 26 59 60 65 67 71 scan 0 sort 0} -do_test where7-2.617.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 65 AND 67) AND a!=66) - OR (g='mlkjihg' AND f GLOB 'ijklm*') - OR ((a BETWEEN 20 AND 22) AND a!=21) - OR (d>=5.0 AND d<6.0 AND d NOT NULL) - OR b=762 - OR b=740 - OR (d>=59.0 AND d<60.0 AND d NOT NULL) - OR b=333 - OR ((a BETWEEN 21 AND 23) AND a!=22) - OR (d>=71.0 AND d<72.0 AND d NOT NULL) - OR (g='tsrqpon' AND f GLOB 'abcde*') - ORDER BY a - } -} {5 20 21 22 23 26 59 60 65 67 71 scan 0 sort 0} -do_test where7-2.618.1 { - count_steps { - SELECT a FROM t2 - WHERE b=539 - OR f='zabcdefgh' - OR d>1e10 - OR c=5005 - OR b=22 - OR (f GLOB '?wxyz*' AND f GLOB 'vwxy*') - OR a=84 - OR (g='tsrqpon' AND f GLOB 'yzabc*') - OR (d>=56.0 AND d<57.0 AND d NOT NULL) - ORDER BY a - } -} {2 13 14 15 21 24 25 47 49 51 56 73 77 84 99 scan 0 sort 0} -do_test where7-2.618.2 { - count_steps { - SELECT a FROM t3 - WHERE b=539 - OR f='zabcdefgh' - OR d>1e10 - OR c=5005 - OR b=22 - OR (f GLOB '?wxyz*' AND f GLOB 'vwxy*') - OR a=84 - OR (g='tsrqpon' AND f GLOB 'yzabc*') - OR (d>=56.0 AND d<57.0 AND d NOT NULL) - ORDER BY a - } -} {2 13 14 15 21 24 25 47 49 51 56 73 77 84 99 scan 0 sort 0} -do_test where7-2.619.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 39 AND 41) AND a!=40) - OR (g='edcbazy' AND f GLOB 'uvwxy*') - OR (d>=45.0 AND d<46.0 AND d NOT NULL) - OR b=1100 - OR g IS NULL - OR a=100 - OR (g='qponmlk' AND f GLOB 'opqrs*') - OR b=762 - ORDER BY a - } -} {39 40 41 45 98 100 scan 0 sort 0} -do_test where7-2.619.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 39 AND 41) AND a!=40) - OR (g='edcbazy' AND f GLOB 'uvwxy*') - OR (d>=45.0 AND d<46.0 AND d NOT NULL) - OR b=1100 - OR g IS NULL - OR a=100 - OR (g='qponmlk' AND f GLOB 'opqrs*') - OR b=762 - ORDER BY a - } -} {39 40 41 45 98 100 scan 0 sort 0} -do_test where7-2.620.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 17 AND 19) AND a!=18) - OR a=8 - OR a=17 - OR b=718 - ORDER BY a - } -} {8 17 19 scan 0 sort 0} -do_test where7-2.620.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 17 AND 19) AND a!=18) - OR a=8 - OR a=17 - OR b=718 - ORDER BY a - } -} {8 17 19 scan 0 sort 0} -do_test where7-2.621.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=5.0 AND d<6.0 AND d NOT NULL) - OR ((a BETWEEN 42 AND 44) AND a!=43) - OR a=8 - OR b=47 - OR ((a BETWEEN 88 AND 90) AND a!=89) - OR (g='hgfedcb' AND f GLOB 'ghijk*') - OR a=73 - OR b=253 - OR b=1081 - OR (g='xwvutsr' AND f GLOB 'ghijk*') - OR (g='xwvutsr' AND f GLOB 'defgh*') - ORDER BY a - } -} {3 5 6 8 23 42 44 73 84 88 90 scan 0 sort 0} -do_test where7-2.621.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=5.0 AND d<6.0 AND d NOT NULL) - OR ((a BETWEEN 42 AND 44) AND a!=43) - OR a=8 - OR b=47 - OR ((a BETWEEN 88 AND 90) AND a!=89) - OR (g='hgfedcb' AND f GLOB 'ghijk*') - OR a=73 - OR b=253 - OR b=1081 - OR (g='xwvutsr' AND f GLOB 'ghijk*') - OR (g='xwvutsr' AND f GLOB 'defgh*') - ORDER BY a - } -} {3 5 6 8 23 42 44 73 84 88 90 scan 0 sort 0} -do_test where7-2.622.1 { - count_steps { - SELECT a FROM t2 - WHERE a=74 - OR (d>=50.0 AND d<51.0 AND d NOT NULL) - OR ((a BETWEEN 48 AND 50) AND a!=49) - OR (g='xwvutsr' AND f GLOB 'hijkl*') - OR a=40 - OR ((a BETWEEN 60 AND 62) AND a!=61) - OR b=715 - OR a=89 - OR b=432 - OR b=993 - OR b=850 - ORDER BY a - } -} {7 40 48 50 60 62 65 74 89 scan 0 sort 0} -do_test where7-2.622.2 { - count_steps { - SELECT a FROM t3 - WHERE a=74 - OR (d>=50.0 AND d<51.0 AND d NOT NULL) - OR ((a BETWEEN 48 AND 50) AND a!=49) - OR (g='xwvutsr' AND f GLOB 'hijkl*') - OR a=40 - OR ((a BETWEEN 60 AND 62) AND a!=61) - OR b=715 - OR a=89 - OR b=432 - OR b=993 - OR b=850 - ORDER BY a - } -} {7 40 48 50 60 62 65 74 89 scan 0 sort 0} -do_test where7-2.623.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=29.0 AND d<30.0 AND d NOT NULL) - OR f='cdefghijk' - OR (d>=16.0 AND d<17.0 AND d NOT NULL) - OR b=146 - OR (d>=5.0 AND d<6.0 AND d NOT NULL) - OR b=102 - OR (g='jihgfed' AND f GLOB 'vwxyz*') - OR ((a BETWEEN 35 AND 37) AND a!=36) - ORDER BY a - } -} {2 5 16 28 29 35 37 54 73 80 scan 0 sort 0} -do_test where7-2.623.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=29.0 AND d<30.0 AND d NOT NULL) - OR f='cdefghijk' - OR (d>=16.0 AND d<17.0 AND d NOT NULL) - OR b=146 - OR (d>=5.0 AND d<6.0 AND d NOT NULL) - OR b=102 - OR (g='jihgfed' AND f GLOB 'vwxyz*') - OR ((a BETWEEN 35 AND 37) AND a!=36) - ORDER BY a - } -} {2 5 16 28 29 35 37 54 73 80 scan 0 sort 0} -do_test where7-2.624.1 { - count_steps { - SELECT a FROM t2 - WHERE b=330 - OR ((a BETWEEN 2 AND 4) AND a!=3) - OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') - ORDER BY a - } -} {2 4 8 30 34 60 86 scan 0 sort 0} -do_test where7-2.624.2 { - count_steps { - SELECT a FROM t3 - WHERE b=330 - OR ((a BETWEEN 2 AND 4) AND a!=3) - OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') - ORDER BY a - } -} {2 4 8 30 34 60 86 scan 0 sort 0} -do_test where7-2.625.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=100.0 AND d<101.0 AND d NOT NULL) - OR (f GLOB '?bcde*' AND f GLOB 'abcd*') - OR a=85 - OR ((a BETWEEN 37 AND 39) AND a!=38) - OR a=24 - OR b=792 - OR a=63 - OR (d>=99.0 AND d<100.0 AND d NOT NULL) - OR b=627 - OR (f GLOB '?uvwx*' AND f GLOB 'tuvw*') - OR b=905 - ORDER BY a - } -} {19 24 26 37 39 45 52 57 63 71 72 78 85 97 99 100 scan 0 sort 0} -do_test where7-2.625.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=100.0 AND d<101.0 AND d NOT NULL) - OR (f GLOB '?bcde*' AND f GLOB 'abcd*') - OR a=85 - OR ((a BETWEEN 37 AND 39) AND a!=38) - OR a=24 - OR b=792 - OR a=63 - OR (d>=99.0 AND d<100.0 AND d NOT NULL) - OR b=627 - OR (f GLOB '?uvwx*' AND f GLOB 'tuvw*') - OR b=905 - ORDER BY a - } -} {19 24 26 37 39 45 52 57 63 71 72 78 85 97 99 100 scan 0 sort 0} -do_test where7-2.626.1 { - count_steps { - SELECT a FROM t2 - WHERE f='ghijklmno' - OR (d>=87.0 AND d<88.0 AND d NOT NULL) - OR ((a BETWEEN 72 AND 74) AND a!=73) - OR (g='ponmlkj' AND f GLOB 'vwxyz*') - OR f='abcdefghi' - OR b=1092 - ORDER BY a - } -} {6 26 32 47 52 58 72 74 78 84 87 scan 0 sort 0} -do_test where7-2.626.2 { - count_steps { - SELECT a FROM t3 - WHERE f='ghijklmno' - OR (d>=87.0 AND d<88.0 AND d NOT NULL) - OR ((a BETWEEN 72 AND 74) AND a!=73) - OR (g='ponmlkj' AND f GLOB 'vwxyz*') - OR f='abcdefghi' - OR b=1092 - ORDER BY a - } -} {6 26 32 47 52 58 72 74 78 84 87 scan 0 sort 0} -do_test where7-2.627.1 { - count_steps { - SELECT a FROM t2 - WHERE b=33 - OR (g='hgfedcb' AND f GLOB 'ghijk*') - OR (d>=81.0 AND d<82.0 AND d NOT NULL) - OR a=15 - OR (d>=61.0 AND d<62.0 AND d NOT NULL) - ORDER BY a - } -} {3 15 61 81 84 scan 0 sort 0} -do_test where7-2.627.2 { - count_steps { - SELECT a FROM t3 - WHERE b=33 - OR (g='hgfedcb' AND f GLOB 'ghijk*') - OR (d>=81.0 AND d<82.0 AND d NOT NULL) - OR a=15 - OR (d>=61.0 AND d<62.0 AND d NOT NULL) - ORDER BY a - } -} {3 15 61 81 84 scan 0 sort 0} -do_test where7-2.628.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 20 AND 22) AND a!=21) - OR (g='tsrqpon' AND f GLOB 'bcdef*') - OR (g='ponmlkj' AND f GLOB 'uvwxy*') - ORDER BY a - } -} {20 22 27 46 scan 0 sort 0} -do_test where7-2.628.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 20 AND 22) AND a!=21) - OR (g='tsrqpon' AND f GLOB 'bcdef*') - OR (g='ponmlkj' AND f GLOB 'uvwxy*') - ORDER BY a - } -} {20 22 27 46 scan 0 sort 0} -do_test where7-2.629.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 12 AND 14) AND a!=13) - OR (g='xwvutsr' AND f GLOB 'defgh*') - OR ((a BETWEEN 56 AND 58) AND a!=57) - OR b<0 - OR b=1045 - ORDER BY a - } -} {3 12 14 56 58 95 scan 0 sort 0} -do_test where7-2.629.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 12 AND 14) AND a!=13) - OR (g='xwvutsr' AND f GLOB 'defgh*') - OR ((a BETWEEN 56 AND 58) AND a!=57) - OR b<0 - OR b=1045 - ORDER BY a - } -} {3 12 14 56 58 95 scan 0 sort 0} -do_test where7-2.630.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 54 AND 56) AND a!=55) - OR a=7 - OR a=50 - OR (f GLOB '?efgh*' AND f GLOB 'defg*') - OR a=11 - OR b=938 - ORDER BY a - } -} {3 7 11 29 50 54 55 56 81 scan 0 sort 0} -do_test where7-2.630.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 54 AND 56) AND a!=55) - OR a=7 - OR a=50 - OR (f GLOB '?efgh*' AND f GLOB 'defg*') - OR a=11 - OR b=938 - ORDER BY a - } -} {3 7 11 29 50 54 55 56 81 scan 0 sort 0} -do_test where7-2.631.1 { - count_steps { - SELECT a FROM t2 - WHERE b=245 - OR (g='xwvutsr' AND f GLOB 'ghijk*') - OR ((a BETWEEN 92 AND 94) AND a!=93) - OR b=715 - OR a=83 - OR f='pqrstuvwx' - OR b=935 - OR (g='lkjihgf' AND f GLOB 'nopqr*') - OR a=3 - ORDER BY a - } -} {3 6 15 41 65 67 83 85 92 93 94 scan 0 sort 0} -do_test where7-2.631.2 { - count_steps { - SELECT a FROM t3 - WHERE b=245 - OR (g='xwvutsr' AND f GLOB 'ghijk*') - OR ((a BETWEEN 92 AND 94) AND a!=93) - OR b=715 - OR a=83 - OR f='pqrstuvwx' - OR b=935 - OR (g='lkjihgf' AND f GLOB 'nopqr*') - OR a=3 - ORDER BY a - } -} {3 6 15 41 65 67 83 85 92 93 94 scan 0 sort 0} -do_test where7-2.632.1 { - count_steps { - SELECT a FROM t2 - WHERE b=1015 - OR (g='utsrqpo' AND f GLOB 'tuvwx*') - OR (f GLOB '?ghij*' AND f GLOB 'fghi*') - OR (g='xwvutsr' AND f GLOB 'hijkl*') - OR ((a BETWEEN 96 AND 98) AND a!=97) - OR b=795 - OR ((a BETWEEN 13 AND 15) AND a!=14) - ORDER BY a - } -} {5 7 13 15 19 31 57 83 96 98 scan 0 sort 0} -do_test where7-2.632.2 { - count_steps { - SELECT a FROM t3 - WHERE b=1015 - OR (g='utsrqpo' AND f GLOB 'tuvwx*') - OR (f GLOB '?ghij*' AND f GLOB 'fghi*') - OR (g='xwvutsr' AND f GLOB 'hijkl*') - OR ((a BETWEEN 96 AND 98) AND a!=97) - OR b=795 - OR ((a BETWEEN 13 AND 15) AND a!=14) - ORDER BY a - } -} {5 7 13 15 19 31 57 83 96 98 scan 0 sort 0} -do_test where7-2.633.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='xwvutsr' AND f GLOB 'efghi*') - OR a=31 - OR b=660 - OR ((a BETWEEN 23 AND 25) AND a!=24) - OR b=157 - OR (g='rqponml' AND f GLOB 'hijkl*') - OR b=1012 - ORDER BY a - } -} {4 23 25 31 33 60 92 scan 0 sort 0} -do_test where7-2.633.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='xwvutsr' AND f GLOB 'efghi*') - OR a=31 - OR b=660 - OR ((a BETWEEN 23 AND 25) AND a!=24) - OR b=157 - OR (g='rqponml' AND f GLOB 'hijkl*') - OR b=1012 - ORDER BY a - } -} {4 23 25 31 33 60 92 scan 0 sort 0} -do_test where7-2.634.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=95.0 AND d<96.0 AND d NOT NULL) - OR a=15 - OR b=729 - OR ((a BETWEEN 41 AND 43) AND a!=42) - OR (d>=25.0 AND d<26.0 AND d NOT NULL) - OR ((a BETWEEN 34 AND 36) AND a!=35) - OR a=84 - OR b=289 - ORDER BY a - } -} {15 25 34 36 41 43 84 95 scan 0 sort 0} -do_test where7-2.634.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=95.0 AND d<96.0 AND d NOT NULL) - OR a=15 - OR b=729 - OR ((a BETWEEN 41 AND 43) AND a!=42) - OR (d>=25.0 AND d<26.0 AND d NOT NULL) - OR ((a BETWEEN 34 AND 36) AND a!=35) - OR a=84 - OR b=289 - ORDER BY a - } -} {15 25 34 36 41 43 84 95 scan 0 sort 0} -do_test where7-2.635.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 94 AND 96) AND a!=95) - OR f='stuvwxyza' - OR a=10 - OR a=81 - OR c=15015 - OR (g='onmlkji' AND f GLOB 'yzabc*') - ORDER BY a - } -} {10 18 43 44 45 50 70 81 94 96 scan 0 sort 0} -do_test where7-2.635.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 94 AND 96) AND a!=95) - OR f='stuvwxyza' - OR a=10 - OR a=81 - OR c=15015 - OR (g='onmlkji' AND f GLOB 'yzabc*') - ORDER BY a - } -} {10 18 43 44 45 50 70 81 94 96 scan 0 sort 0} -do_test where7-2.636.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='qponmlk' AND f GLOB 'pqrst*') - OR (g='rqponml' AND f GLOB 'lmnop*') - OR c=29029 - OR ((a BETWEEN 19 AND 21) AND a!=20) - OR a=62 - OR b=693 - OR ((a BETWEEN 61 AND 63) AND a!=62) - OR b=264 - OR a=90 - OR (f GLOB '?zabc*' AND f GLOB 'yzab*') - OR (d>=1.0 AND d<2.0 AND d NOT NULL) - ORDER BY a - } -} {1 19 21 24 37 41 50 61 62 63 76 85 86 87 90 scan 0 sort 0} -do_test where7-2.636.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='qponmlk' AND f GLOB 'pqrst*') - OR (g='rqponml' AND f GLOB 'lmnop*') - OR c=29029 - OR ((a BETWEEN 19 AND 21) AND a!=20) - OR a=62 - OR b=693 - OR ((a BETWEEN 61 AND 63) AND a!=62) - OR b=264 - OR a=90 - OR (f GLOB '?zabc*' AND f GLOB 'yzab*') - OR (d>=1.0 AND d<2.0 AND d NOT NULL) - ORDER BY a - } -} {1 19 21 24 37 41 50 61 62 63 76 85 86 87 90 scan 0 sort 0} -do_test where7-2.637.1 { - count_steps { - SELECT a FROM t2 - WHERE a=72 - OR b=630 - OR ((a BETWEEN 27 AND 29) AND a!=28) - ORDER BY a - } -} {27 29 72 scan 0 sort 0} -do_test where7-2.637.2 { - count_steps { - SELECT a FROM t3 - WHERE a=72 - OR b=630 - OR ((a BETWEEN 27 AND 29) AND a!=28) - ORDER BY a - } -} {27 29 72 scan 0 sort 0} -do_test where7-2.638.1 { - count_steps { - SELECT a FROM t2 - WHERE a=49 - OR b=806 - OR a=91 - OR b=1004 - OR b=102 - OR b=190 - OR b=201 - OR b=330 - OR ((a BETWEEN 14 AND 16) AND a!=15) - OR b=179 - OR a=93 - ORDER BY a - } -} {14 16 30 49 91 93 scan 0 sort 0} -do_test where7-2.638.2 { - count_steps { - SELECT a FROM t3 - WHERE a=49 - OR b=806 - OR a=91 - OR b=1004 - OR b=102 - OR b=190 - OR b=201 - OR b=330 - OR ((a BETWEEN 14 AND 16) AND a!=15) - OR b=179 - OR a=93 - ORDER BY a - } -} {14 16 30 49 91 93 scan 0 sort 0} -do_test where7-2.639.1 { - count_steps { - SELECT a FROM t2 - WHERE f='nopqrstuv' - OR c=19019 - OR f='pqrstuvwx' - OR a=6 - OR a=71 - OR ((a BETWEEN 97 AND 99) AND a!=98) - OR b=946 - OR (g='srqponm' AND f GLOB 'fghij*') - ORDER BY a - } -} {6 13 15 31 39 41 55 56 57 65 67 71 86 91 93 97 99 scan 0 sort 0} -do_test where7-2.639.2 { - count_steps { - SELECT a FROM t3 - WHERE f='nopqrstuv' - OR c=19019 - OR f='pqrstuvwx' - OR a=6 - OR a=71 - OR ((a BETWEEN 97 AND 99) AND a!=98) - OR b=946 - OR (g='srqponm' AND f GLOB 'fghij*') - ORDER BY a - } -} {6 13 15 31 39 41 55 56 57 65 67 71 86 91 93 97 99 scan 0 sort 0} -do_test where7-2.640.1 { - count_steps { - SELECT a FROM t2 - WHERE b=333 - OR (g='utsrqpo' AND f GLOB 'tuvwx*') - OR c=23023 - OR (g='hgfedcb' AND f GLOB 'ijklm*') - OR b=883 - OR ((a BETWEEN 42 AND 44) AND a!=43) - OR b=223 - ORDER BY a - } -} {19 42 44 67 68 69 86 scan 0 sort 0} -do_test where7-2.640.2 { - count_steps { - SELECT a FROM t3 - WHERE b=333 - OR (g='utsrqpo' AND f GLOB 'tuvwx*') - OR c=23023 - OR (g='hgfedcb' AND f GLOB 'ijklm*') - OR b=883 - OR ((a BETWEEN 42 AND 44) AND a!=43) - OR b=223 - ORDER BY a - } -} {19 42 44 67 68 69 86 scan 0 sort 0} -do_test where7-2.641.1 { - count_steps { - SELECT a FROM t2 - WHERE c=23023 - OR b=1015 - OR (d>=45.0 AND d<46.0 AND d NOT NULL) - OR a=49 - OR f='fghijklmn' - OR (g='srqponm' AND f GLOB 'fghij*') - OR b=770 - OR (d>=57.0 AND d<58.0 AND d NOT NULL) - OR ((a BETWEEN 25 AND 27) AND a!=26) - OR (g='lkjihgf' AND f GLOB 'lmnop*') - ORDER BY a - } -} {5 25 27 31 45 49 57 63 67 68 69 70 83 scan 0 sort 0} -do_test where7-2.641.2 { - count_steps { - SELECT a FROM t3 - WHERE c=23023 - OR b=1015 - OR (d>=45.0 AND d<46.0 AND d NOT NULL) - OR a=49 - OR f='fghijklmn' - OR (g='srqponm' AND f GLOB 'fghij*') - OR b=770 - OR (d>=57.0 AND d<58.0 AND d NOT NULL) - OR ((a BETWEEN 25 AND 27) AND a!=26) - OR (g='lkjihgf' AND f GLOB 'lmnop*') - ORDER BY a - } -} {5 25 27 31 45 49 57 63 67 68 69 70 83 scan 0 sort 0} -do_test where7-2.642.1 { - count_steps { - SELECT a FROM t2 - WHERE a=73 - OR (g='fedcbaz' AND f GLOB 'pqrst*') - OR b=146 - ORDER BY a - } -} {73 93 scan 0 sort 0} -do_test where7-2.642.2 { - count_steps { - SELECT a FROM t3 - WHERE a=73 - OR (g='fedcbaz' AND f GLOB 'pqrst*') - OR b=146 - ORDER BY a - } -} {73 93 scan 0 sort 0} -do_test where7-2.643.1 { - count_steps { - SELECT a FROM t2 - WHERE b=627 - OR b=990 - OR b=671 - ORDER BY a - } -} {57 61 90 scan 0 sort 1} -do_test where7-2.643.2 { - count_steps { - SELECT a FROM t3 - WHERE b=627 - OR b=990 - OR b=671 - ORDER BY a - } -} {57 61 90 scan 0 sort 1} -do_test where7-2.644.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=40.0 AND d<41.0 AND d NOT NULL) - OR b=363 - OR a=50 - OR b=476 - OR (g='tsrqpon' AND f GLOB 'bcdef*') - OR (d>=7.0 AND d<8.0 AND d NOT NULL) - OR a=74 - OR b=308 - ORDER BY a - } -} {7 27 28 33 40 50 74 scan 0 sort 0} -do_test where7-2.644.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=40.0 AND d<41.0 AND d NOT NULL) - OR b=363 - OR a=50 - OR b=476 - OR (g='tsrqpon' AND f GLOB 'bcdef*') - OR (d>=7.0 AND d<8.0 AND d NOT NULL) - OR a=74 - OR b=308 - ORDER BY a - } -} {7 27 28 33 40 50 74 scan 0 sort 0} -do_test where7-2.645.1 { - count_steps { - SELECT a FROM t2 - WHERE b=121 - OR (d>=2.0 AND d<3.0 AND d NOT NULL) - OR b=693 - OR a=31 - OR b=960 - OR (d>=88.0 AND d<89.0 AND d NOT NULL) - OR (d>=72.0 AND d<73.0 AND d NOT NULL) - OR (f GLOB '?mnop*' AND f GLOB 'lmno*') - OR ((a BETWEEN 3 AND 5) AND a!=4) - ORDER BY a - } -} {2 3 5 11 31 37 63 72 88 89 scan 0 sort 0} -do_test where7-2.645.2 { - count_steps { - SELECT a FROM t3 - WHERE b=121 - OR (d>=2.0 AND d<3.0 AND d NOT NULL) - OR b=693 - OR a=31 - OR b=960 - OR (d>=88.0 AND d<89.0 AND d NOT NULL) - OR (d>=72.0 AND d<73.0 AND d NOT NULL) - OR (f GLOB '?mnop*' AND f GLOB 'lmno*') - OR ((a BETWEEN 3 AND 5) AND a!=4) - ORDER BY a - } -} {2 3 5 11 31 37 63 72 88 89 scan 0 sort 0} -do_test where7-2.646.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=23.0 AND d<24.0 AND d NOT NULL) - OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') - ORDER BY a - } -} {15 23 41 67 93 scan 0 sort 0} -do_test where7-2.646.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=23.0 AND d<24.0 AND d NOT NULL) - OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') - ORDER BY a - } -} {15 23 41 67 93 scan 0 sort 0} -do_test where7-2.647.1 { - count_steps { - SELECT a FROM t2 - WHERE b=880 - OR (g='rqponml' AND f GLOB 'hijkl*') - OR b=704 - ORDER BY a - } -} {33 64 80 scan 0 sort 0} -do_test where7-2.647.2 { - count_steps { - SELECT a FROM t3 - WHERE b=880 - OR (g='rqponml' AND f GLOB 'hijkl*') - OR b=704 - ORDER BY a - } -} {33 64 80 scan 0 sort 0} -do_test where7-2.648.1 { - count_steps { - SELECT a FROM t2 - WHERE a=59 - OR b=1100 - ORDER BY a - } -} {59 100 scan 0 sort 0} -do_test where7-2.648.2 { - count_steps { - SELECT a FROM t3 - WHERE a=59 - OR b=1100 - ORDER BY a - } -} {59 100 scan 0 sort 0} -do_test where7-2.649.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 48 AND 50) AND a!=49) - OR (g='utsrqpo' AND f GLOB 'vwxyz*') - ORDER BY a - } -} {21 48 50 scan 0 sort 0} -do_test where7-2.649.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 48 AND 50) AND a!=49) - OR (g='utsrqpo' AND f GLOB 'vwxyz*') - ORDER BY a - } -} {21 48 50 scan 0 sort 0} -do_test where7-2.650.1 { - count_steps { - SELECT a FROM t2 - WHERE b=396 - OR (g='qponmlk' AND f GLOB 'qrstu*') - OR b=322 - OR b=33 - ORDER BY a - } -} {3 36 42 scan 0 sort 0} -do_test where7-2.650.2 { - count_steps { - SELECT a FROM t3 - WHERE b=396 - OR (g='qponmlk' AND f GLOB 'qrstu*') - OR b=322 - OR b=33 - ORDER BY a - } -} {3 36 42 scan 0 sort 0} -do_test where7-2.651.1 { - count_steps { - SELECT a FROM t2 - WHERE b=319 - OR (d>=16.0 AND d<17.0 AND d NOT NULL) - OR (g='onmlkji' AND f GLOB 'abcde*') - OR a=83 - OR ((a BETWEEN 51 AND 53) AND a!=52) - OR f='nopqrstuv' - ORDER BY a - } -} {13 16 29 39 51 52 53 65 83 91 scan 0 sort 0} -do_test where7-2.651.2 { - count_steps { - SELECT a FROM t3 - WHERE b=319 - OR (d>=16.0 AND d<17.0 AND d NOT NULL) - OR (g='onmlkji' AND f GLOB 'abcde*') - OR a=83 - OR ((a BETWEEN 51 AND 53) AND a!=52) - OR f='nopqrstuv' - ORDER BY a - } -} {13 16 29 39 51 52 53 65 83 91 scan 0 sort 0} -do_test where7-2.652.1 { - count_steps { - SELECT a FROM t2 - WHERE a=51 - OR (d>=41.0 AND d<42.0 AND d NOT NULL) - OR (d>=17.0 AND d<18.0 AND d NOT NULL) - OR b=330 - OR f='yzabcdefg' - OR b=418 - OR b=641 - OR b=586 - ORDER BY a - } -} {17 24 30 38 41 50 51 76 scan 0 sort 0} -do_test where7-2.652.2 { - count_steps { - SELECT a FROM t3 - WHERE a=51 - OR (d>=41.0 AND d<42.0 AND d NOT NULL) - OR (d>=17.0 AND d<18.0 AND d NOT NULL) - OR b=330 - OR f='yzabcdefg' - OR b=418 - OR b=641 - OR b=586 - ORDER BY a - } -} {17 24 30 38 41 50 51 76 scan 0 sort 0} -do_test where7-2.653.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='edcbazy' AND f GLOB 'wxyza*') - OR (d>=79.0 AND d<80.0 AND d NOT NULL) - OR a=15 - OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') - OR b=1012 - ORDER BY a - } -} {15 41 67 79 92 93 100 scan 0 sort 0} -do_test where7-2.653.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='edcbazy' AND f GLOB 'wxyza*') - OR (d>=79.0 AND d<80.0 AND d NOT NULL) - OR a=15 - OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') - OR b=1012 - ORDER BY a - } -} {15 41 67 79 92 93 100 scan 0 sort 0} -do_test where7-2.654.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='mlkjihg' AND f GLOB 'ijklm*') - OR ((a BETWEEN 19 AND 21) AND a!=20) - OR ((a BETWEEN 32 AND 34) AND a!=33) - OR (g='vutsrqp' AND f GLOB 'rstuv*') - OR b=1004 - OR b=517 - OR (d>=46.0 AND d<47.0 AND d NOT NULL) - OR (g='fedcbaz' AND f GLOB 'pqrst*') - OR ((a BETWEEN 19 AND 21) AND a!=20) - OR b=187 - ORDER BY a - } -} {17 19 21 32 34 46 47 60 93 scan 0 sort 0} -do_test where7-2.654.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='mlkjihg' AND f GLOB 'ijklm*') - OR ((a BETWEEN 19 AND 21) AND a!=20) - OR ((a BETWEEN 32 AND 34) AND a!=33) - OR (g='vutsrqp' AND f GLOB 'rstuv*') - OR b=1004 - OR b=517 - OR (d>=46.0 AND d<47.0 AND d NOT NULL) - OR (g='fedcbaz' AND f GLOB 'pqrst*') - OR ((a BETWEEN 19 AND 21) AND a!=20) - OR b=187 - ORDER BY a - } -} {17 19 21 32 34 46 47 60 93 scan 0 sort 0} -do_test where7-2.655.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 95 AND 97) AND a!=96) - OR (g='nmlkjih' AND f GLOB 'defgh*') - OR b=1070 - ORDER BY a - } -} {55 95 97 scan 0 sort 0} -do_test where7-2.655.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 95 AND 97) AND a!=96) - OR (g='nmlkjih' AND f GLOB 'defgh*') - OR b=1070 - ORDER BY a - } -} {55 95 97 scan 0 sort 0} -do_test where7-2.656.1 { - count_steps { - SELECT a FROM t2 - WHERE b=421 - OR ((a BETWEEN 20 AND 22) AND a!=21) - OR c=16016 - OR a=46 - OR (g='qponmlk' AND f GLOB 'pqrst*') - OR b=597 - OR (f GLOB '?stuv*' AND f GLOB 'rstu*') - OR ((a BETWEEN 73 AND 75) AND a!=74) - ORDER BY a - } -} {17 20 22 41 43 46 47 48 69 73 75 95 scan 0 sort 0} -do_test where7-2.656.2 { - count_steps { - SELECT a FROM t3 - WHERE b=421 - OR ((a BETWEEN 20 AND 22) AND a!=21) - OR c=16016 - OR a=46 - OR (g='qponmlk' AND f GLOB 'pqrst*') - OR b=597 - OR (f GLOB '?stuv*' AND f GLOB 'rstu*') - OR ((a BETWEEN 73 AND 75) AND a!=74) - ORDER BY a - } -} {17 20 22 41 43 46 47 48 69 73 75 95 scan 0 sort 0} -do_test where7-2.657.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='srqponm' AND f GLOB 'fghij*') - OR (g='nmlkjih' AND f GLOB 'cdefg*') - ORDER BY a - } -} {31 54 scan 0 sort 0} -do_test where7-2.657.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='srqponm' AND f GLOB 'fghij*') - OR (g='nmlkjih' AND f GLOB 'cdefg*') - ORDER BY a - } -} {31 54 scan 0 sort 0} -do_test where7-2.658.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='vutsrqp' AND f GLOB 'nopqr*') - OR ((a BETWEEN 1 AND 3) AND a!=2) - ORDER BY a - } -} {1 3 13 scan 0 sort 0} -do_test where7-2.658.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='vutsrqp' AND f GLOB 'nopqr*') - OR ((a BETWEEN 1 AND 3) AND a!=2) - ORDER BY a - } -} {1 3 13 scan 0 sort 0} -do_test where7-2.659.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 9 AND 11) AND a!=10) - OR b=572 - OR ((a BETWEEN 81 AND 83) AND a!=82) - OR ((a BETWEEN 62 AND 64) AND a!=63) - OR b=880 - OR b=509 - OR (g='rqponml' AND f GLOB 'jklmn*') - OR (g='qponmlk' AND f GLOB 'opqrs*') - ORDER BY a - } -} {9 11 35 40 52 62 64 80 81 83 scan 0 sort 0} -do_test where7-2.659.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 9 AND 11) AND a!=10) - OR b=572 - OR ((a BETWEEN 81 AND 83) AND a!=82) - OR ((a BETWEEN 62 AND 64) AND a!=63) - OR b=880 - OR b=509 - OR (g='rqponml' AND f GLOB 'jklmn*') - OR (g='qponmlk' AND f GLOB 'opqrs*') - ORDER BY a - } -} {9 11 35 40 52 62 64 80 81 83 scan 0 sort 0} -do_test where7-2.660.1 { - count_steps { - SELECT a FROM t2 - WHERE b=924 - OR (g='edcbazy' AND f GLOB 'uvwxy*') - OR f='lmnopqrst' - OR c=32032 - OR ((a BETWEEN 94 AND 96) AND a!=95) - OR b=242 - OR f='tuvwxyzab' - OR b=707 - ORDER BY a - } -} {11 19 22 37 45 63 71 84 89 94 95 96 97 98 scan 0 sort 0} -do_test where7-2.660.2 { - count_steps { - SELECT a FROM t3 - WHERE b=924 - OR (g='edcbazy' AND f GLOB 'uvwxy*') - OR f='lmnopqrst' - OR c=32032 - OR ((a BETWEEN 94 AND 96) AND a!=95) - OR b=242 - OR f='tuvwxyzab' - OR b=707 - ORDER BY a - } -} {11 19 22 37 45 63 71 84 89 94 95 96 97 98 scan 0 sort 0} -do_test where7-2.661.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='vutsrqp' AND f GLOB 'opqrs*') - OR f='ijklmnopq' - OR a=29 - OR b=795 - OR b=1048 - OR b=517 - ORDER BY a - } -} {8 14 29 34 47 60 86 scan 0 sort 0} -do_test where7-2.661.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='vutsrqp' AND f GLOB 'opqrs*') - OR f='ijklmnopq' - OR a=29 - OR b=795 - OR b=1048 - OR b=517 - ORDER BY a - } -} {8 14 29 34 47 60 86 scan 0 sort 0} -do_test where7-2.662.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 65 AND 67) AND a!=66) - OR (f GLOB '?wxyz*' AND f GLOB 'vwxy*') - OR (g='onmlkji' AND f GLOB 'zabcd*') - OR b=729 - OR b=649 - OR (d>=38.0 AND d<39.0 AND d NOT NULL) - OR b=729 - OR ((a BETWEEN 24 AND 26) AND a!=25) - ORDER BY a - } -} {21 24 26 38 47 51 59 65 67 73 99 scan 0 sort 0} -do_test where7-2.662.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 65 AND 67) AND a!=66) - OR (f GLOB '?wxyz*' AND f GLOB 'vwxy*') - OR (g='onmlkji' AND f GLOB 'zabcd*') - OR b=729 - OR b=649 - OR (d>=38.0 AND d<39.0 AND d NOT NULL) - OR b=729 - OR ((a BETWEEN 24 AND 26) AND a!=25) - ORDER BY a - } -} {21 24 26 38 47 51 59 65 67 73 99 scan 0 sort 0} -do_test where7-2.663.1 { - count_steps { - SELECT a FROM t2 - WHERE b=542 - OR b=759 - OR a=94 - OR b=707 - OR a=31 - ORDER BY a - } -} {31 69 94 scan 0 sort 0} -do_test where7-2.663.2 { - count_steps { - SELECT a FROM t3 - WHERE b=542 - OR b=759 - OR a=94 - OR b=707 - OR a=31 - ORDER BY a - } -} {31 69 94 scan 0 sort 0} -do_test where7-2.664.1 { - count_steps { - SELECT a FROM t2 - WHERE a=50 - OR (d>=73.0 AND d<74.0 AND d NOT NULL) - OR b=858 - ORDER BY a - } -} {50 73 78 scan 0 sort 0} -do_test where7-2.664.2 { - count_steps { - SELECT a FROM t3 - WHERE a=50 - OR (d>=73.0 AND d<74.0 AND d NOT NULL) - OR b=858 - ORDER BY a - } -} {50 73 78 scan 0 sort 0} -do_test where7-2.665.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=32.0 AND d<33.0 AND d NOT NULL) - OR b=223 - OR ((a BETWEEN 70 AND 72) AND a!=71) - OR b=465 - OR (d>=44.0 AND d<45.0 AND d NOT NULL) - ORDER BY a - } -} {32 44 70 72 scan 0 sort 0} -do_test where7-2.665.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=32.0 AND d<33.0 AND d NOT NULL) - OR b=223 - OR ((a BETWEEN 70 AND 72) AND a!=71) - OR b=465 - OR (d>=44.0 AND d<45.0 AND d NOT NULL) - ORDER BY a - } -} {32 44 70 72 scan 0 sort 0} -do_test where7-2.666.1 { - count_steps { - SELECT a FROM t2 - WHERE b=748 - OR (d>=6.0 AND d<7.0 AND d NOT NULL) - OR c=12012 - OR ((a BETWEEN 36 AND 38) AND a!=37) - OR a=48 - OR a=86 - OR c=7007 - OR ((a BETWEEN 29 AND 31) AND a!=30) - OR (d>=38.0 AND d<39.0 AND d NOT NULL) - ORDER BY a - } -} {6 19 20 21 29 31 34 35 36 38 48 68 86 scan 0 sort 0} -do_test where7-2.666.2 { - count_steps { - SELECT a FROM t3 - WHERE b=748 - OR (d>=6.0 AND d<7.0 AND d NOT NULL) - OR c=12012 - OR ((a BETWEEN 36 AND 38) AND a!=37) - OR a=48 - OR a=86 - OR c=7007 - OR ((a BETWEEN 29 AND 31) AND a!=30) - OR (d>=38.0 AND d<39.0 AND d NOT NULL) - ORDER BY a - } -} {6 19 20 21 29 31 34 35 36 38 48 68 86 scan 0 sort 0} -do_test where7-2.667.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=53.0 AND d<54.0 AND d NOT NULL) - OR a=64 - OR c=14014 - OR (d>=26.0 AND d<27.0 AND d NOT NULL) - OR ((a BETWEEN 37 AND 39) AND a!=38) - OR a=37 - OR b=1089 - OR (d>=80.0 AND d<81.0 AND d NOT NULL) - OR b=385 - OR b=960 - ORDER BY a - } -} {26 35 37 39 40 41 42 53 64 80 99 scan 0 sort 0} -do_test where7-2.667.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=53.0 AND d<54.0 AND d NOT NULL) - OR a=64 - OR c=14014 - OR (d>=26.0 AND d<27.0 AND d NOT NULL) - OR ((a BETWEEN 37 AND 39) AND a!=38) - OR a=37 - OR b=1089 - OR (d>=80.0 AND d<81.0 AND d NOT NULL) - OR b=385 - OR b=960 - ORDER BY a - } -} {26 35 37 39 40 41 42 53 64 80 99 scan 0 sort 0} -do_test where7-2.668.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='xwvutsr' AND f GLOB 'ghijk*') - OR b=968 - ORDER BY a - } -} {6 88 scan 0 sort 0} -do_test where7-2.668.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='xwvutsr' AND f GLOB 'ghijk*') - OR b=968 - ORDER BY a - } -} {6 88 scan 0 sort 0} -do_test where7-2.669.1 { - count_steps { - SELECT a FROM t2 - WHERE (f GLOB '?tuvw*' AND f GLOB 'stuv*') - OR ((a BETWEEN 37 AND 39) AND a!=38) - OR b=762 - OR ((a BETWEEN 51 AND 53) AND a!=52) - OR b=209 - OR b=729 - ORDER BY a - } -} {18 19 37 39 44 51 53 70 96 scan 0 sort 0} -do_test where7-2.669.2 { - count_steps { - SELECT a FROM t3 - WHERE (f GLOB '?tuvw*' AND f GLOB 'stuv*') - OR ((a BETWEEN 37 AND 39) AND a!=38) - OR b=762 - OR ((a BETWEEN 51 AND 53) AND a!=52) - OR b=209 - OR b=729 - ORDER BY a - } -} {18 19 37 39 44 51 53 70 96 scan 0 sort 0} -do_test where7-2.670.1 { - count_steps { - SELECT a FROM t2 - WHERE c=24024 - OR (d>=37.0 AND d<38.0 AND d NOT NULL) - OR b=429 - OR (g='utsrqpo' AND f GLOB 'tuvwx*') - OR (g='onmlkji' AND f GLOB 'zabcd*') - ORDER BY a - } -} {19 37 39 51 70 71 72 scan 0 sort 0} -do_test where7-2.670.2 { - count_steps { - SELECT a FROM t3 - WHERE c=24024 - OR (d>=37.0 AND d<38.0 AND d NOT NULL) - OR b=429 - OR (g='utsrqpo' AND f GLOB 'tuvwx*') - OR (g='onmlkji' AND f GLOB 'zabcd*') - ORDER BY a - } -} {19 37 39 51 70 71 72 scan 0 sort 0} -do_test where7-2.671.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='gfedcba' AND f GLOB 'lmnop*') - OR ((a BETWEEN 32 AND 34) AND a!=33) - OR b=275 - OR ((a BETWEEN 36 AND 38) AND a!=37) - OR b=1070 - OR b=825 - ORDER BY a - } -} {25 32 34 36 38 75 89 scan 0 sort 0} -do_test where7-2.671.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='gfedcba' AND f GLOB 'lmnop*') - OR ((a BETWEEN 32 AND 34) AND a!=33) - OR b=275 - OR ((a BETWEEN 36 AND 38) AND a!=37) - OR b=1070 - OR b=825 - ORDER BY a - } -} {25 32 34 36 38 75 89 scan 0 sort 0} -do_test where7-2.672.1 { - count_steps { - SELECT a FROM t2 - WHERE b=319 - OR (g='kjihgfe' AND f GLOB 'stuvw*') - OR (d>=6.0 AND d<7.0 AND d NOT NULL) - OR (d>=88.0 AND d<89.0 AND d NOT NULL) - ORDER BY a - } -} {6 29 70 88 scan 0 sort 0} -do_test where7-2.672.2 { - count_steps { - SELECT a FROM t3 - WHERE b=319 - OR (g='kjihgfe' AND f GLOB 'stuvw*') - OR (d>=6.0 AND d<7.0 AND d NOT NULL) - OR (d>=88.0 AND d<89.0 AND d NOT NULL) - ORDER BY a - } -} {6 29 70 88 scan 0 sort 0} -do_test where7-2.673.1 { - count_steps { - SELECT a FROM t2 - WHERE f='rstuvwxyz' - OR b=451 - OR (g='gfedcba' AND f GLOB 'klmno*') - OR a=90 - OR b=605 - ORDER BY a - } -} {17 41 43 55 69 88 90 95 scan 0 sort 0} -do_test where7-2.673.2 { - count_steps { - SELECT a FROM t3 - WHERE f='rstuvwxyz' - OR b=451 - OR (g='gfedcba' AND f GLOB 'klmno*') - OR a=90 - OR b=605 - ORDER BY a - } -} {17 41 43 55 69 88 90 95 scan 0 sort 0} -do_test where7-2.674.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='wvutsrq' AND f GLOB 'jklmn*') - OR (g='xwvutsr' AND f GLOB 'defgh*') - OR a=55 - OR (g='mlkjihg' AND f GLOB 'ijklm*') - OR b=803 - OR b=685 - ORDER BY a - } -} {3 9 55 60 73 scan 0 sort 0} -do_test where7-2.674.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='wvutsrq' AND f GLOB 'jklmn*') - OR (g='xwvutsr' AND f GLOB 'defgh*') - OR a=55 - OR (g='mlkjihg' AND f GLOB 'ijklm*') - OR b=803 - OR b=685 - ORDER BY a - } -} {3 9 55 60 73 scan 0 sort 0} -do_test where7-2.675.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='wvutsrq' AND f GLOB 'ijklm*') - OR (g='qponmlk' AND f GLOB 'mnopq*') - OR (g='fedcbaz' AND f GLOB 'qrstu*') - ORDER BY a - } -} {8 38 94 scan 0 sort 0} -do_test where7-2.675.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='wvutsrq' AND f GLOB 'ijklm*') - OR (g='qponmlk' AND f GLOB 'mnopq*') - OR (g='fedcbaz' AND f GLOB 'qrstu*') - ORDER BY a - } -} {8 38 94 scan 0 sort 0} -do_test where7-2.676.1 { - count_steps { - SELECT a FROM t2 - WHERE b=374 - OR f='abcdefghi' - OR a=44 - ORDER BY a - } -} {26 34 44 52 78 scan 0 sort 0} -do_test where7-2.676.2 { - count_steps { - SELECT a FROM t3 - WHERE b=374 - OR f='abcdefghi' - OR a=44 - ORDER BY a - } -} {26 34 44 52 78 scan 0 sort 0} -do_test where7-2.677.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='fedcbaz' AND f GLOB 'pqrst*') - OR a=19 - OR b=256 - OR (d>=82.0 AND d<83.0 AND d NOT NULL) - ORDER BY a - } -} {19 82 93 scan 0 sort 0} -do_test where7-2.677.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='fedcbaz' AND f GLOB 'pqrst*') - OR a=19 - OR b=256 - OR (d>=82.0 AND d<83.0 AND d NOT NULL) - ORDER BY a - } -} {19 82 93 scan 0 sort 0} -do_test where7-2.678.1 { - count_steps { - SELECT a FROM t2 - WHERE a=32 - OR a=72 - OR b=165 - OR (g='wvutsrq' AND f GLOB 'ijklm*') - OR (f GLOB '?zabc*' AND f GLOB 'yzab*') - ORDER BY a - } -} {8 15 24 32 50 72 76 scan 0 sort 0} -do_test where7-2.678.2 { - count_steps { - SELECT a FROM t3 - WHERE a=32 - OR a=72 - OR b=165 - OR (g='wvutsrq' AND f GLOB 'ijklm*') - OR (f GLOB '?zabc*' AND f GLOB 'yzab*') - ORDER BY a - } -} {8 15 24 32 50 72 76 scan 0 sort 0} -do_test where7-2.679.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=98.0 AND d<99.0 AND d NOT NULL) - OR (g='edcbazy' AND f GLOB 'vwxyz*') - OR (g='utsrqpo' AND f GLOB 'tuvwx*') - ORDER BY a - } -} {19 98 99 scan 0 sort 0} -do_test where7-2.679.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=98.0 AND d<99.0 AND d NOT NULL) - OR (g='edcbazy' AND f GLOB 'vwxyz*') - OR (g='utsrqpo' AND f GLOB 'tuvwx*') - ORDER BY a - } -} {19 98 99 scan 0 sort 0} -do_test where7-2.680.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='utsrqpo' AND f GLOB 'stuvw*') - OR a=56 - OR b=330 - OR b=905 - OR (g='kjihgfe' AND f GLOB 'qrstu*') - OR b=1100 - OR a=92 - OR (g='fedcbaz' AND f GLOB 'rstuv*') - ORDER BY a - } -} {18 30 56 68 92 95 100 scan 0 sort 0} -do_test where7-2.680.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='utsrqpo' AND f GLOB 'stuvw*') - OR a=56 - OR b=330 - OR b=905 - OR (g='kjihgfe' AND f GLOB 'qrstu*') - OR b=1100 - OR a=92 - OR (g='fedcbaz' AND f GLOB 'rstuv*') - ORDER BY a - } -} {18 30 56 68 92 95 100 scan 0 sort 0} -do_test where7-2.681.1 { - count_steps { - SELECT a FROM t2 - WHERE f='pqrstuvwx' - OR b=663 - OR (g='mlkjihg' AND f GLOB 'ghijk*') - OR c=21021 - OR (f GLOB '?xyza*' AND f GLOB 'wxyz*') - OR (d>=61.0 AND d<62.0 AND d NOT NULL) - OR (g='srqponm' AND f GLOB 'ghijk*') - OR (g='xwvutsr' AND f GLOB 'ghijk*') - ORDER BY a - } -} {6 15 22 32 41 48 58 61 62 63 67 74 93 100 scan 0 sort 0} -do_test where7-2.681.2 { - count_steps { - SELECT a FROM t3 - WHERE f='pqrstuvwx' - OR b=663 - OR (g='mlkjihg' AND f GLOB 'ghijk*') - OR c=21021 - OR (f GLOB '?xyza*' AND f GLOB 'wxyz*') - OR (d>=61.0 AND d<62.0 AND d NOT NULL) - OR (g='srqponm' AND f GLOB 'ghijk*') - OR (g='xwvutsr' AND f GLOB 'ghijk*') - ORDER BY a - } -} {6 15 22 32 41 48 58 61 62 63 67 74 93 100 scan 0 sort 0} -do_test where7-2.682.1 { - count_steps { - SELECT a FROM t2 - WHERE b=352 - OR (f GLOB '?stuv*' AND f GLOB 'rstu*') - OR (d>=34.0 AND d<35.0 AND d NOT NULL) - OR a=69 - OR b=993 - OR (g='ihgfedc' AND f GLOB 'defgh*') - OR b=245 - OR (d>=91.0 AND d<92.0 AND d NOT NULL) - OR a=39 - ORDER BY a - } -} {17 32 34 39 43 69 81 91 95 scan 0 sort 0} -do_test where7-2.682.2 { - count_steps { - SELECT a FROM t3 - WHERE b=352 - OR (f GLOB '?stuv*' AND f GLOB 'rstu*') - OR (d>=34.0 AND d<35.0 AND d NOT NULL) - OR a=69 - OR b=993 - OR (g='ihgfedc' AND f GLOB 'defgh*') - OR b=245 - OR (d>=91.0 AND d<92.0 AND d NOT NULL) - OR a=39 - ORDER BY a - } -} {17 32 34 39 43 69 81 91 95 scan 0 sort 0} -do_test where7-2.683.1 { - count_steps { - SELECT a FROM t2 - WHERE a=31 - OR ((a BETWEEN 69 AND 71) AND a!=70) - OR (g='ponmlkj' AND f GLOB 'stuvw*') - OR a=62 - ORDER BY a - } -} {31 44 62 69 71 scan 0 sort 0} -do_test where7-2.683.2 { - count_steps { - SELECT a FROM t3 - WHERE a=31 - OR ((a BETWEEN 69 AND 71) AND a!=70) - OR (g='ponmlkj' AND f GLOB 'stuvw*') - OR a=62 - ORDER BY a - } -} {31 44 62 69 71 scan 0 sort 0} -do_test where7-2.684.1 { - count_steps { - SELECT a FROM t2 - WHERE (f GLOB '?zabc*' AND f GLOB 'yzab*') - OR b=946 - OR ((a BETWEEN 32 AND 34) AND a!=33) - OR (d>=57.0 AND d<58.0 AND d NOT NULL) - OR a=44 - OR ((a BETWEEN 76 AND 78) AND a!=77) - OR (g='rqponml' AND f GLOB 'lmnop*') - OR c=4004 - OR b=685 - OR b=407 - OR ((a BETWEEN 74 AND 76) AND a!=75) - ORDER BY a - } -} {10 11 12 24 32 34 37 44 50 57 74 76 78 86 scan 0 sort 0} -do_test where7-2.684.2 { - count_steps { - SELECT a FROM t3 - WHERE (f GLOB '?zabc*' AND f GLOB 'yzab*') - OR b=946 - OR ((a BETWEEN 32 AND 34) AND a!=33) - OR (d>=57.0 AND d<58.0 AND d NOT NULL) - OR a=44 - OR ((a BETWEEN 76 AND 78) AND a!=77) - OR (g='rqponml' AND f GLOB 'lmnop*') - OR c=4004 - OR b=685 - OR b=407 - OR ((a BETWEEN 74 AND 76) AND a!=75) - ORDER BY a - } -} {10 11 12 24 32 34 37 44 50 57 74 76 78 86 scan 0 sort 0} -do_test where7-2.685.1 { - count_steps { - SELECT a FROM t2 - WHERE b=385 - OR ((a BETWEEN 35 AND 37) AND a!=36) - OR a=69 - ORDER BY a - } -} {35 37 69 scan 0 sort 0} -do_test where7-2.685.2 { - count_steps { - SELECT a FROM t3 - WHERE b=385 - OR ((a BETWEEN 35 AND 37) AND a!=36) - OR a=69 - ORDER BY a - } -} {35 37 69 scan 0 sort 0} -do_test where7-2.686.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='lkjihgf' AND f GLOB 'nopqr*') - OR (f GLOB '?klmn*' AND f GLOB 'jklm*') - OR (g='rqponml' AND f GLOB 'lmnop*') - OR c=27027 - OR ((a BETWEEN 88 AND 90) AND a!=89) - OR (f GLOB '?efgh*' AND f GLOB 'defg*') - OR ((a BETWEEN 4 AND 6) AND a!=5) - ORDER BY a - } -} {3 4 6 9 29 35 37 55 61 65 79 80 81 87 88 90 scan 0 sort 0} -do_test where7-2.686.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='lkjihgf' AND f GLOB 'nopqr*') - OR (f GLOB '?klmn*' AND f GLOB 'jklm*') - OR (g='rqponml' AND f GLOB 'lmnop*') - OR c=27027 - OR ((a BETWEEN 88 AND 90) AND a!=89) - OR (f GLOB '?efgh*' AND f GLOB 'defg*') - OR ((a BETWEEN 4 AND 6) AND a!=5) - ORDER BY a - } -} {3 4 6 9 29 35 37 55 61 65 79 80 81 87 88 90 scan 0 sort 0} -do_test where7-2.687.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 24 AND 26) AND a!=25) - OR (d>=89.0 AND d<90.0 AND d NOT NULL) - OR b=462 - OR c=8008 - OR c=14014 - OR b=748 - OR b=355 - ORDER BY a - } -} {22 23 24 26 40 41 42 68 89 scan 0 sort 0} -do_test where7-2.687.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 24 AND 26) AND a!=25) - OR (d>=89.0 AND d<90.0 AND d NOT NULL) - OR b=462 - OR c=8008 - OR c=14014 - OR b=748 - OR b=355 - ORDER BY a - } -} {22 23 24 26 40 41 42 68 89 scan 0 sort 0} -do_test where7-2.688.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='hgfedcb' AND f GLOB 'jklmn*') - OR b=80 - OR (d>=6.0 AND d<7.0 AND d NOT NULL) - ORDER BY a - } -} {6 87 scan 0 sort 0} -do_test where7-2.688.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='hgfedcb' AND f GLOB 'jklmn*') - OR b=80 - OR (d>=6.0 AND d<7.0 AND d NOT NULL) - ORDER BY a - } -} {6 87 scan 0 sort 0} -do_test where7-2.689.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='fedcbaz' AND f GLOB 'rstuv*') - OR c=22022 - OR (d>=86.0 AND d<87.0 AND d NOT NULL) - OR b=927 - OR ((a BETWEEN 0 AND 2) AND a!=1) - ORDER BY a - } -} {2 64 65 66 86 95 scan 0 sort 0} -do_test where7-2.689.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='fedcbaz' AND f GLOB 'rstuv*') - OR c=22022 - OR (d>=86.0 AND d<87.0 AND d NOT NULL) - OR b=927 - OR ((a BETWEEN 0 AND 2) AND a!=1) - ORDER BY a - } -} {2 64 65 66 86 95 scan 0 sort 0} -do_test where7-2.690.1 { - count_steps { - SELECT a FROM t2 - WHERE (f GLOB '?tuvw*' AND f GLOB 'stuv*') - OR a=39 - OR (g='kjihgfe' AND f GLOB 'uvwxy*') - OR b=179 - OR a=98 - OR f='defghijkl' - OR (g='mlkjihg' AND f GLOB 'ijklm*') - OR b=157 - OR f='pqrstuvwx' - OR a=68 - ORDER BY a - } -} {3 15 18 29 39 41 44 55 60 67 68 70 72 81 93 96 98 scan 0 sort 0} -do_test where7-2.690.2 { - count_steps { - SELECT a FROM t3 - WHERE (f GLOB '?tuvw*' AND f GLOB 'stuv*') - OR a=39 - OR (g='kjihgfe' AND f GLOB 'uvwxy*') - OR b=179 - OR a=98 - OR f='defghijkl' - OR (g='mlkjihg' AND f GLOB 'ijklm*') - OR b=157 - OR f='pqrstuvwx' - OR a=68 - ORDER BY a - } -} {3 15 18 29 39 41 44 55 60 67 68 70 72 81 93 96 98 scan 0 sort 0} -do_test where7-2.691.1 { - count_steps { - SELECT a FROM t2 - WHERE b=77 - OR b=682 - OR f='rstuvwxyz' - OR b=506 - OR a=74 - OR b=308 - OR b=850 - OR b=363 - OR ((a BETWEEN 2 AND 4) AND a!=3) - OR c=5005 - OR ((a BETWEEN 65 AND 67) AND a!=66) - ORDER BY a - } -} {2 4 7 13 14 15 17 28 33 43 46 62 65 67 69 74 95 scan 0 sort 0} -do_test where7-2.691.2 { - count_steps { - SELECT a FROM t3 - WHERE b=77 - OR b=682 - OR f='rstuvwxyz' - OR b=506 - OR a=74 - OR b=308 - OR b=850 - OR b=363 - OR ((a BETWEEN 2 AND 4) AND a!=3) - OR c=5005 - OR ((a BETWEEN 65 AND 67) AND a!=66) - ORDER BY a - } -} {2 4 7 13 14 15 17 28 33 43 46 62 65 67 69 74 95 scan 0 sort 0} -do_test where7-2.692.1 { - count_steps { - SELECT a FROM t2 - WHERE a=88 - OR a=29 - OR (d>=63.0 AND d<64.0 AND d NOT NULL) - OR (g='ponmlkj' AND f GLOB 'uvwxy*') - OR b=308 - OR b=58 - OR b=429 - OR ((a BETWEEN 82 AND 84) AND a!=83) - ORDER BY a - } -} {28 29 39 46 63 82 84 88 scan 0 sort 0} -do_test where7-2.692.2 { - count_steps { - SELECT a FROM t3 - WHERE a=88 - OR a=29 - OR (d>=63.0 AND d<64.0 AND d NOT NULL) - OR (g='ponmlkj' AND f GLOB 'uvwxy*') - OR b=308 - OR b=58 - OR b=429 - OR ((a BETWEEN 82 AND 84) AND a!=83) - ORDER BY a - } -} {28 29 39 46 63 82 84 88 scan 0 sort 0} -do_test where7-2.693.1 { - count_steps { - SELECT a FROM t2 - WHERE c=20020 - OR (g='gfedcba' AND f GLOB 'lmnop*') - OR c=24024 - OR (d>=2.0 AND d<3.0 AND d NOT NULL) - OR b=366 - OR a=19 - OR (g='utsrqpo' AND f GLOB 'wxyza*') - OR (g='edcbazy' AND f GLOB 'wxyza*') - ORDER BY a - } -} {2 19 22 58 59 60 70 71 72 89 100 scan 0 sort 0} -do_test where7-2.693.2 { - count_steps { - SELECT a FROM t3 - WHERE c=20020 - OR (g='gfedcba' AND f GLOB 'lmnop*') - OR c=24024 - OR (d>=2.0 AND d<3.0 AND d NOT NULL) - OR b=366 - OR a=19 - OR (g='utsrqpo' AND f GLOB 'wxyza*') - OR (g='edcbazy' AND f GLOB 'wxyza*') - ORDER BY a - } -} {2 19 22 58 59 60 70 71 72 89 100 scan 0 sort 0} -do_test where7-2.694.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='hgfedcb' AND f GLOB 'fghij*') - OR ((a BETWEEN 85 AND 87) AND a!=86) - OR (g='lkjihgf' AND f GLOB 'lmnop*') - OR (f GLOB '?mnop*' AND f GLOB 'lmno*') - OR (f GLOB '?cdef*' AND f GLOB 'bcde*') - OR c=10010 - OR b=1089 - OR (g='ihgfedc' AND f GLOB 'cdefg*') - OR (d>=81.0 AND d<82.0 AND d NOT NULL) - OR b=858 - OR (f GLOB '?yzab*' AND f GLOB 'xyza*') - ORDER BY a - } -} {1 11 23 27 28 29 30 37 49 53 63 75 78 79 80 81 83 85 87 89 99 scan 0 sort 0} -do_test where7-2.694.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='hgfedcb' AND f GLOB 'fghij*') - OR ((a BETWEEN 85 AND 87) AND a!=86) - OR (g='lkjihgf' AND f GLOB 'lmnop*') - OR (f GLOB '?mnop*' AND f GLOB 'lmno*') - OR (f GLOB '?cdef*' AND f GLOB 'bcde*') - OR c=10010 - OR b=1089 - OR (g='ihgfedc' AND f GLOB 'cdefg*') - OR (d>=81.0 AND d<82.0 AND d NOT NULL) - OR b=858 - OR (f GLOB '?yzab*' AND f GLOB 'xyza*') - ORDER BY a - } -} {1 11 23 27 28 29 30 37 49 53 63 75 78 79 80 81 83 85 87 89 99 scan 0 sort 0} -do_test where7-2.695.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=64.0 AND d<65.0 AND d NOT NULL) - OR b=1070 - OR b=69 - OR (d>=39.0 AND d<40.0 AND d NOT NULL) - OR ((a BETWEEN 83 AND 85) AND a!=84) - OR a=85 - ORDER BY a - } -} {39 64 83 85 scan 0 sort 0} -do_test where7-2.695.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=64.0 AND d<65.0 AND d NOT NULL) - OR b=1070 - OR b=69 - OR (d>=39.0 AND d<40.0 AND d NOT NULL) - OR ((a BETWEEN 83 AND 85) AND a!=84) - OR a=85 - ORDER BY a - } -} {39 64 83 85 scan 0 sort 0} -do_test where7-2.696.1 { - count_steps { - SELECT a FROM t2 - WHERE b=1089 - OR (f GLOB '?zabc*' AND f GLOB 'yzab*') - OR b=528 - OR (g='hgfedcb' AND f GLOB 'jklmn*') - OR ((a BETWEEN 21 AND 23) AND a!=22) - OR (d>=36.0 AND d<37.0 AND d NOT NULL) - OR (f GLOB '?hijk*' AND f GLOB 'ghij*') - OR a=13 - OR b=759 - OR b=990 - OR c=31031 - ORDER BY a - } -} {6 13 21 23 24 32 36 48 50 58 69 76 84 87 90 91 92 93 99 scan 0 sort 0} -do_test where7-2.696.2 { - count_steps { - SELECT a FROM t3 - WHERE b=1089 - OR (f GLOB '?zabc*' AND f GLOB 'yzab*') - OR b=528 - OR (g='hgfedcb' AND f GLOB 'jklmn*') - OR ((a BETWEEN 21 AND 23) AND a!=22) - OR (d>=36.0 AND d<37.0 AND d NOT NULL) - OR (f GLOB '?hijk*' AND f GLOB 'ghij*') - OR a=13 - OR b=759 - OR b=990 - OR c=31031 - ORDER BY a - } -} {6 13 21 23 24 32 36 48 50 58 69 76 84 87 90 91 92 93 99 scan 0 sort 0} -do_test where7-2.697.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='yxwvuts' AND f GLOB 'bcdef*') - OR b=363 - OR ((a BETWEEN 71 AND 73) AND a!=72) - OR b=135 - OR (g='ihgfedc' AND f GLOB 'bcdef*') - OR a=48 - OR (g='rqponml' AND f GLOB 'jklmn*') - ORDER BY a - } -} {1 33 35 48 71 73 79 scan 0 sort 0} -do_test where7-2.697.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='yxwvuts' AND f GLOB 'bcdef*') - OR b=363 - OR ((a BETWEEN 71 AND 73) AND a!=72) - OR b=135 - OR (g='ihgfedc' AND f GLOB 'bcdef*') - OR a=48 - OR (g='rqponml' AND f GLOB 'jklmn*') - ORDER BY a - } -} {1 33 35 48 71 73 79 scan 0 sort 0} -do_test where7-2.698.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 13 AND 15) AND a!=14) - OR b=1026 - OR ((a BETWEEN 12 AND 14) AND a!=13) - OR (g='gfedcba' AND f GLOB 'lmnop*') - OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') - OR (d>=90.0 AND d<91.0 AND d NOT NULL) - OR ((a BETWEEN 91 AND 93) AND a!=92) - OR ((a BETWEEN 31 AND 33) AND a!=32) - OR (d>=85.0 AND d<86.0 AND d NOT NULL) - OR a=23 - ORDER BY a - } -} {7 12 13 14 15 23 31 33 59 85 89 90 91 93 scan 0 sort 0} -do_test where7-2.698.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 13 AND 15) AND a!=14) - OR b=1026 - OR ((a BETWEEN 12 AND 14) AND a!=13) - OR (g='gfedcba' AND f GLOB 'lmnop*') - OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') - OR (d>=90.0 AND d<91.0 AND d NOT NULL) - OR ((a BETWEEN 91 AND 93) AND a!=92) - OR ((a BETWEEN 31 AND 33) AND a!=32) - OR (d>=85.0 AND d<86.0 AND d NOT NULL) - OR a=23 - ORDER BY a - } -} {7 12 13 14 15 23 31 33 59 85 89 90 91 93 scan 0 sort 0} -do_test where7-2.699.1 { - count_steps { - SELECT a FROM t2 - WHERE c=17017 - OR c=26026 - OR (f GLOB '?xyza*' AND f GLOB 'wxyz*') - ORDER BY a - } -} {22 48 49 50 51 74 76 77 78 100 scan 0 sort 0} -do_test where7-2.699.2 { - count_steps { - SELECT a FROM t3 - WHERE c=17017 - OR c=26026 - OR (f GLOB '?xyza*' AND f GLOB 'wxyz*') - ORDER BY a - } -} {22 48 49 50 51 74 76 77 78 100 scan 0 sort 0} -do_test where7-2.700.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='jihgfed' AND f GLOB 'wxyza*') - OR b=729 - OR (f GLOB '?cdef*' AND f GLOB 'bcde*') - OR b=1103 - OR (g='kjihgfe' AND f GLOB 'stuvw*') - ORDER BY a - } -} {1 27 53 70 74 79 scan 0 sort 0} -do_test where7-2.700.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='jihgfed' AND f GLOB 'wxyza*') - OR b=729 - OR (f GLOB '?cdef*' AND f GLOB 'bcde*') - OR b=1103 - OR (g='kjihgfe' AND f GLOB 'stuvw*') - ORDER BY a - } -} {1 27 53 70 74 79 scan 0 sort 0} -do_test where7-2.701.1 { - count_steps { - SELECT a FROM t2 - WHERE a=73 - OR b=872 - OR b=289 - OR b=267 - OR b=737 - OR b=110 - OR (g='xwvutsr' AND f GLOB 'defgh*') - OR (d>=15.0 AND d<16.0 AND d NOT NULL) - ORDER BY a - } -} {3 10 15 67 73 scan 0 sort 0} -do_test where7-2.701.2 { - count_steps { - SELECT a FROM t3 - WHERE a=73 - OR b=872 - OR b=289 - OR b=267 - OR b=737 - OR b=110 - OR (g='xwvutsr' AND f GLOB 'defgh*') - OR (d>=15.0 AND d<16.0 AND d NOT NULL) - ORDER BY a - } -} {3 10 15 67 73 scan 0 sort 0} -do_test where7-2.702.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 59 AND 61) AND a!=60) - OR f='pqrstuvwx' - OR f='ijklmnopq' - OR b=649 - OR (d>=39.0 AND d<40.0 AND d NOT NULL) - OR c=17017 - OR a=63 - OR (g='vutsrqp' AND f GLOB 'rstuv*') - OR (g='vutsrqp' AND f GLOB 'opqrs*') - OR b=1092 - ORDER BY a - } -} {8 14 15 17 34 39 41 49 50 51 59 60 61 63 67 86 93 scan 0 sort 0} -do_test where7-2.702.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 59 AND 61) AND a!=60) - OR f='pqrstuvwx' - OR f='ijklmnopq' - OR b=649 - OR (d>=39.0 AND d<40.0 AND d NOT NULL) - OR c=17017 - OR a=63 - OR (g='vutsrqp' AND f GLOB 'rstuv*') - OR (g='vutsrqp' AND f GLOB 'opqrs*') - OR b=1092 - ORDER BY a - } -} {8 14 15 17 34 39 41 49 50 51 59 60 61 63 67 86 93 scan 0 sort 0} -do_test where7-2.703.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='ihgfedc' AND f GLOB 'efghi*') - OR ((a BETWEEN 30 AND 32) AND a!=31) - OR ((a BETWEEN 64 AND 66) AND a!=65) - OR d>1e10 - OR b=872 - OR a=74 - OR a=18 - OR (d>=43.0 AND d<44.0 AND d NOT NULL) - ORDER BY a - } -} {18 30 32 43 64 66 74 82 scan 0 sort 0} -do_test where7-2.703.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='ihgfedc' AND f GLOB 'efghi*') - OR ((a BETWEEN 30 AND 32) AND a!=31) - OR ((a BETWEEN 64 AND 66) AND a!=65) - OR d>1e10 - OR b=872 - OR a=74 - OR a=18 - OR (d>=43.0 AND d<44.0 AND d NOT NULL) - ORDER BY a - } -} {18 30 32 43 64 66 74 82 scan 0 sort 0} -do_test where7-2.704.1 { - count_steps { - SELECT a FROM t2 - WHERE b=946 - OR a=5 - OR (g='srqponm' AND f GLOB 'defgh*') - OR b=979 - OR a=32 - OR ((a BETWEEN 54 AND 56) AND a!=55) - OR b=264 - OR (g='xwvutsr' AND f GLOB 'ghijk*') - OR a=55 - OR b=146 - ORDER BY a - } -} {5 6 24 29 32 54 55 56 86 89 scan 0 sort 0} -do_test where7-2.704.2 { - count_steps { - SELECT a FROM t3 - WHERE b=946 - OR a=5 - OR (g='srqponm' AND f GLOB 'defgh*') - OR b=979 - OR a=32 - OR ((a BETWEEN 54 AND 56) AND a!=55) - OR b=264 - OR (g='xwvutsr' AND f GLOB 'ghijk*') - OR a=55 - OR b=146 - ORDER BY a - } -} {5 6 24 29 32 54 55 56 86 89 scan 0 sort 0} -do_test where7-2.705.1 { - count_steps { - SELECT a FROM t2 - WHERE c=13013 - OR b=91 - ORDER BY a - } -} {37 38 39 scan 0 sort 0} -do_test where7-2.705.2 { - count_steps { - SELECT a FROM t3 - WHERE c=13013 - OR b=91 - ORDER BY a - } -} {37 38 39 scan 0 sort 0} -do_test where7-2.706.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 65 AND 67) AND a!=66) - OR c=16016 - OR a=80 - OR (d>=69.0 AND d<70.0 AND d NOT NULL) - OR (d>=51.0 AND d<52.0 AND d NOT NULL) - OR f='abcdefghi' - OR (g='srqponm' AND f GLOB 'fghij*') - OR a=14 - OR a=32 - OR ((a BETWEEN 29 AND 31) AND a!=30) - ORDER BY a - } -} {14 26 29 31 32 46 47 48 51 52 65 67 69 78 80 scan 0 sort 0} -do_test where7-2.706.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 65 AND 67) AND a!=66) - OR c=16016 - OR a=80 - OR (d>=69.0 AND d<70.0 AND d NOT NULL) - OR (d>=51.0 AND d<52.0 AND d NOT NULL) - OR f='abcdefghi' - OR (g='srqponm' AND f GLOB 'fghij*') - OR a=14 - OR a=32 - OR ((a BETWEEN 29 AND 31) AND a!=30) - ORDER BY a - } -} {14 26 29 31 32 46 47 48 51 52 65 67 69 78 80 scan 0 sort 0} -do_test where7-2.707.1 { - count_steps { - SELECT a FROM t2 - WHERE a=93 - OR (d>=20.0 AND d<21.0 AND d NOT NULL) - OR ((a BETWEEN 18 AND 20) AND a!=19) - OR b=286 - OR c=7007 - OR (g='jihgfed' AND f GLOB 'wxyza*') - ORDER BY a - } -} {18 19 20 21 26 74 93 scan 0 sort 0} -do_test where7-2.707.2 { - count_steps { - SELECT a FROM t3 - WHERE a=93 - OR (d>=20.0 AND d<21.0 AND d NOT NULL) - OR ((a BETWEEN 18 AND 20) AND a!=19) - OR b=286 - OR c=7007 - OR (g='jihgfed' AND f GLOB 'wxyza*') - ORDER BY a - } -} {18 19 20 21 26 74 93 scan 0 sort 0} -do_test where7-2.708.1 { - count_steps { - SELECT a FROM t2 - WHERE a=27 - OR (g='ihgfedc' AND f GLOB 'abcde*') - OR (d>=71.0 AND d<72.0 AND d NOT NULL) - OR (d>=86.0 AND d<87.0 AND d NOT NULL) - OR (d>=76.0 AND d<77.0 AND d NOT NULL) - OR a=54 - OR b=872 - OR b=894 - ORDER BY a - } -} {27 54 71 76 78 86 scan 0 sort 0} -do_test where7-2.708.2 { - count_steps { - SELECT a FROM t3 - WHERE a=27 - OR (g='ihgfedc' AND f GLOB 'abcde*') - OR (d>=71.0 AND d<72.0 AND d NOT NULL) - OR (d>=86.0 AND d<87.0 AND d NOT NULL) - OR (d>=76.0 AND d<77.0 AND d NOT NULL) - OR a=54 - OR b=872 - OR b=894 - ORDER BY a - } -} {27 54 71 76 78 86 scan 0 sort 0} -do_test where7-2.709.1 { - count_steps { - SELECT a FROM t2 - WHERE b=212 - OR f='klmnopqrs' - OR f='qrstuvwxy' - ORDER BY a - } -} {10 16 36 42 62 68 88 94 scan 0 sort 0} -do_test where7-2.709.2 { - count_steps { - SELECT a FROM t3 - WHERE b=212 - OR f='klmnopqrs' - OR f='qrstuvwxy' - ORDER BY a - } -} {10 16 36 42 62 68 88 94 scan 0 sort 0} -do_test where7-2.710.1 { - count_steps { - SELECT a FROM t2 - WHERE c=30030 - OR (d>=12.0 AND d<13.0 AND d NOT NULL) - OR f='tuvwxyzab' - OR (g='onmlkji' AND f GLOB 'wxyza*') - OR c=6006 - OR a=1 - OR c=1001 - ORDER BY a - } -} {1 2 3 12 16 17 18 19 45 48 71 88 89 90 97 scan 0 sort 0} -do_test where7-2.710.2 { - count_steps { - SELECT a FROM t3 - WHERE c=30030 - OR (d>=12.0 AND d<13.0 AND d NOT NULL) - OR f='tuvwxyzab' - OR (g='onmlkji' AND f GLOB 'wxyza*') - OR c=6006 - OR a=1 - OR c=1001 - ORDER BY a - } -} {1 2 3 12 16 17 18 19 45 48 71 88 89 90 97 scan 0 sort 0} -do_test where7-2.711.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=25.0 AND d<26.0 AND d NOT NULL) - OR (g='vutsrqp' AND f GLOB 'rstuv*') - OR (g='edcbazy' AND f GLOB 'uvwxy*') - OR a=76 - ORDER BY a - } -} {17 25 76 98 scan 0 sort 0} -do_test where7-2.711.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=25.0 AND d<26.0 AND d NOT NULL) - OR (g='vutsrqp' AND f GLOB 'rstuv*') - OR (g='edcbazy' AND f GLOB 'uvwxy*') - OR a=76 - ORDER BY a - } -} {17 25 76 98 scan 0 sort 0} -do_test where7-2.712.1 { - count_steps { - SELECT a FROM t2 - WHERE b=440 - OR c=29029 - OR b=913 - OR f='wxyzabcde' - OR ((a BETWEEN 2 AND 4) AND a!=3) - OR b=124 - ORDER BY a - } -} {2 4 22 40 48 74 83 85 86 87 100 scan 0 sort 0} -do_test where7-2.712.2 { - count_steps { - SELECT a FROM t3 - WHERE b=440 - OR c=29029 - OR b=913 - OR f='wxyzabcde' - OR ((a BETWEEN 2 AND 4) AND a!=3) - OR b=124 - ORDER BY a - } -} {2 4 22 40 48 74 83 85 86 87 100 scan 0 sort 0} -do_test where7-2.713.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='xwvutsr' AND f GLOB 'fghij*') - OR b=1023 - OR b=385 - OR (d>=1.0 AND d<2.0 AND d NOT NULL) - OR ((a BETWEEN 34 AND 36) AND a!=35) - OR f='uvwxyzabc' - OR ((a BETWEEN 61 AND 63) AND a!=62) - OR (g='utsrqpo' AND f GLOB 'tuvwx*') - OR (d>=71.0 AND d<72.0 AND d NOT NULL) - OR b=564 - OR (g='hgfedcb' AND f GLOB 'jklmn*') - ORDER BY a - } -} {1 5 19 20 34 35 36 46 61 63 71 72 87 93 98 scan 0 sort 0} -do_test where7-2.713.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='xwvutsr' AND f GLOB 'fghij*') - OR b=1023 - OR b=385 - OR (d>=1.0 AND d<2.0 AND d NOT NULL) - OR ((a BETWEEN 34 AND 36) AND a!=35) - OR f='uvwxyzabc' - OR ((a BETWEEN 61 AND 63) AND a!=62) - OR (g='utsrqpo' AND f GLOB 'tuvwx*') - OR (d>=71.0 AND d<72.0 AND d NOT NULL) - OR b=564 - OR (g='hgfedcb' AND f GLOB 'jklmn*') - ORDER BY a - } -} {1 5 19 20 34 35 36 46 61 63 71 72 87 93 98 scan 0 sort 0} -do_test where7-2.714.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=36.0 AND d<37.0 AND d NOT NULL) - OR (g='tsrqpon' AND f GLOB 'bcdef*') - OR b=561 - OR (f GLOB '?lmno*' AND f GLOB 'klmn*') - OR b=539 - ORDER BY a - } -} {10 27 36 49 51 62 88 scan 0 sort 0} -do_test where7-2.714.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=36.0 AND d<37.0 AND d NOT NULL) - OR (g='tsrqpon' AND f GLOB 'bcdef*') - OR b=561 - OR (f GLOB '?lmno*' AND f GLOB 'klmn*') - OR b=539 - ORDER BY a - } -} {10 27 36 49 51 62 88 scan 0 sort 0} -do_test where7-2.715.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=9.0 AND d<10.0 AND d NOT NULL) - OR a=53 - OR b=927 - OR (d>=53.0 AND d<54.0 AND d NOT NULL) - OR (d>=69.0 AND d<70.0 AND d NOT NULL) - OR ((a BETWEEN 70 AND 72) AND a!=71) - OR (d>=91.0 AND d<92.0 AND d NOT NULL) - OR a=42 - OR (d>=15.0 AND d<16.0 AND d NOT NULL) - OR (d>=21.0 AND d<22.0 AND d NOT NULL) - ORDER BY a - } -} {9 15 21 42 53 69 70 72 91 scan 0 sort 0} -do_test where7-2.715.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=9.0 AND d<10.0 AND d NOT NULL) - OR a=53 - OR b=927 - OR (d>=53.0 AND d<54.0 AND d NOT NULL) - OR (d>=69.0 AND d<70.0 AND d NOT NULL) - OR ((a BETWEEN 70 AND 72) AND a!=71) - OR (d>=91.0 AND d<92.0 AND d NOT NULL) - OR a=42 - OR (d>=15.0 AND d<16.0 AND d NOT NULL) - OR (d>=21.0 AND d<22.0 AND d NOT NULL) - ORDER BY a - } -} {9 15 21 42 53 69 70 72 91 scan 0 sort 0} -do_test where7-2.716.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 25 AND 27) AND a!=26) - OR b=209 - OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') - OR b=902 - OR a=45 - OR (g='nmlkjih' AND f GLOB 'bcdef*') - OR b=792 - OR b=740 - ORDER BY a - } -} {8 19 25 27 34 45 53 60 72 82 86 scan 0 sort 0} -do_test where7-2.716.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 25 AND 27) AND a!=26) - OR b=209 - OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') - OR b=902 - OR a=45 - OR (g='nmlkjih' AND f GLOB 'bcdef*') - OR b=792 - OR b=740 - ORDER BY a - } -} {8 19 25 27 34 45 53 60 72 82 86 scan 0 sort 0} -do_test where7-2.717.1 { - count_steps { - SELECT a FROM t2 - WHERE b=33 - OR ((a BETWEEN 61 AND 63) AND a!=62) - OR (d>=16.0 AND d<17.0 AND d NOT NULL) - OR ((a BETWEEN 58 AND 60) AND a!=59) - ORDER BY a - } -} {3 16 58 60 61 63 scan 0 sort 0} -do_test where7-2.717.2 { - count_steps { - SELECT a FROM t3 - WHERE b=33 - OR ((a BETWEEN 61 AND 63) AND a!=62) - OR (d>=16.0 AND d<17.0 AND d NOT NULL) - OR ((a BETWEEN 58 AND 60) AND a!=59) - ORDER BY a - } -} {3 16 58 60 61 63 scan 0 sort 0} -do_test where7-2.718.1 { - count_steps { - SELECT a FROM t2 - WHERE a=49 - OR b=971 - ORDER BY a - } -} {49 scan 0 sort 0} -do_test where7-2.718.2 { - count_steps { - SELECT a FROM t3 - WHERE a=49 - OR b=971 - ORDER BY a - } -} {49 scan 0 sort 0} -do_test where7-2.719.1 { - count_steps { - SELECT a FROM t2 - WHERE a=99 - OR (f GLOB '?hijk*' AND f GLOB 'ghij*') - OR f='uvwxyzabc' - OR a=13 - OR c=7007 - OR b<0 - OR b=1012 - OR ((a BETWEEN 31 AND 33) AND a!=32) - OR c=11011 - ORDER BY a - } -} {6 13 19 20 21 31 32 33 46 58 72 84 92 98 99 scan 0 sort 0} -do_test where7-2.719.2 { - count_steps { - SELECT a FROM t3 - WHERE a=99 - OR (f GLOB '?hijk*' AND f GLOB 'ghij*') - OR f='uvwxyzabc' - OR a=13 - OR c=7007 - OR b<0 - OR b=1012 - OR ((a BETWEEN 31 AND 33) AND a!=32) - OR c=11011 - ORDER BY a - } -} {6 13 19 20 21 31 32 33 46 58 72 84 92 98 99 scan 0 sort 0} -do_test where7-2.720.1 { - count_steps { - SELECT a FROM t2 - WHERE (f GLOB '?abcd*' AND f GLOB 'zabc*') - OR c=25025 - OR b=707 - OR (d>=40.0 AND d<41.0 AND d NOT NULL) - OR (d>=95.0 AND d<96.0 AND d NOT NULL) - OR c=31031 - OR (g='lkjihgf' AND f GLOB 'lmnop*') - ORDER BY a - } -} {25 40 51 63 73 74 75 77 91 92 93 95 scan 0 sort 0} -do_test where7-2.720.2 { - count_steps { - SELECT a FROM t3 - WHERE (f GLOB '?abcd*' AND f GLOB 'zabc*') - OR c=25025 - OR b=707 - OR (d>=40.0 AND d<41.0 AND d NOT NULL) - OR (d>=95.0 AND d<96.0 AND d NOT NULL) - OR c=31031 - OR (g='lkjihgf' AND f GLOB 'lmnop*') - ORDER BY a - } -} {25 40 51 63 73 74 75 77 91 92 93 95 scan 0 sort 0} -do_test where7-2.721.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 8 AND 10) AND a!=9) - OR ((a BETWEEN 11 AND 13) AND a!=12) - OR a=97 - OR (g='qponmlk' AND f GLOB 'mnopq*') - OR (d>=12.0 AND d<13.0 AND d NOT NULL) - OR ((a BETWEEN 53 AND 55) AND a!=54) - OR (f GLOB '?fghi*' AND f GLOB 'efgh*') - OR b=737 - ORDER BY a - } -} {4 8 10 11 12 13 30 38 53 55 56 67 82 97 scan 0 sort 0} -do_test where7-2.721.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 8 AND 10) AND a!=9) - OR ((a BETWEEN 11 AND 13) AND a!=12) - OR a=97 - OR (g='qponmlk' AND f GLOB 'mnopq*') - OR (d>=12.0 AND d<13.0 AND d NOT NULL) - OR ((a BETWEEN 53 AND 55) AND a!=54) - OR (f GLOB '?fghi*' AND f GLOB 'efgh*') - OR b=737 - ORDER BY a - } -} {4 8 10 11 12 13 30 38 53 55 56 67 82 97 scan 0 sort 0} -do_test where7-2.722.1 { - count_steps { - SELECT a FROM t2 - WHERE b=121 - OR b=388 - OR (g='hgfedcb' AND f GLOB 'ijklm*') - OR (d>=41.0 AND d<42.0 AND d NOT NULL) - OR b=696 - OR ((a BETWEEN 12 AND 14) AND a!=13) - OR b=465 - OR b=1045 - ORDER BY a - } -} {11 12 14 41 86 95 scan 0 sort 0} -do_test where7-2.722.2 { - count_steps { - SELECT a FROM t3 - WHERE b=121 - OR b=388 - OR (g='hgfedcb' AND f GLOB 'ijklm*') - OR (d>=41.0 AND d<42.0 AND d NOT NULL) - OR b=696 - OR ((a BETWEEN 12 AND 14) AND a!=13) - OR b=465 - OR b=1045 - ORDER BY a - } -} {11 12 14 41 86 95 scan 0 sort 0} -do_test where7-2.723.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='onmlkji' AND f GLOB 'abcde*') - OR ((a BETWEEN 14 AND 16) AND a!=15) - OR b=498 - OR b=484 - OR b=113 - ORDER BY a - } -} {14 16 44 52 scan 0 sort 0} -do_test where7-2.723.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='onmlkji' AND f GLOB 'abcde*') - OR ((a BETWEEN 14 AND 16) AND a!=15) - OR b=498 - OR b=484 - OR b=113 - ORDER BY a - } -} {14 16 44 52 scan 0 sort 0} -do_test where7-2.724.1 { - count_steps { - SELECT a FROM t2 - WHERE b=278 - OR a=11 - OR ((a BETWEEN 46 AND 48) AND a!=47) - OR ((a BETWEEN 90 AND 92) AND a!=91) - OR ((a BETWEEN 40 AND 42) AND a!=41) - OR (d>=21.0 AND d<22.0 AND d NOT NULL) - OR (d>=88.0 AND d<89.0 AND d NOT NULL) - OR a=47 - OR a=42 - OR a=21 - OR ((a BETWEEN 43 AND 45) AND a!=44) - ORDER BY a - } -} {11 21 40 42 43 45 46 47 48 88 90 92 scan 0 sort 0} -do_test where7-2.724.2 { - count_steps { - SELECT a FROM t3 - WHERE b=278 - OR a=11 - OR ((a BETWEEN 46 AND 48) AND a!=47) - OR ((a BETWEEN 90 AND 92) AND a!=91) - OR ((a BETWEEN 40 AND 42) AND a!=41) - OR (d>=21.0 AND d<22.0 AND d NOT NULL) - OR (d>=88.0 AND d<89.0 AND d NOT NULL) - OR a=47 - OR a=42 - OR a=21 - OR ((a BETWEEN 43 AND 45) AND a!=44) - ORDER BY a - } -} {11 21 40 42 43 45 46 47 48 88 90 92 scan 0 sort 0} -do_test where7-2.725.1 { - count_steps { - SELECT a FROM t2 - WHERE b=135 - OR a=65 - OR c=2002 - ORDER BY a - } -} {4 5 6 65 scan 0 sort 0} -do_test where7-2.725.2 { - count_steps { - SELECT a FROM t3 - WHERE b=135 - OR a=65 - OR c=2002 - ORDER BY a - } -} {4 5 6 65 scan 0 sort 0} -do_test where7-2.726.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='jihgfed' AND f GLOB 'xyzab*') - OR (g='mlkjihg' AND f GLOB 'hijkl*') - OR c=12012 - OR c=21021 - OR b=242 - OR b=770 - OR (g='utsrqpo' AND f GLOB 'uvwxy*') - OR a=71 - OR (d>=53.0 AND d<54.0 AND d NOT NULL) - OR (f GLOB '?hijk*' AND f GLOB 'ghij*') - ORDER BY a - } -} {6 20 22 32 34 35 36 53 58 59 61 62 63 70 71 75 84 scan 0 sort 0} -do_test where7-2.726.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='jihgfed' AND f GLOB 'xyzab*') - OR (g='mlkjihg' AND f GLOB 'hijkl*') - OR c=12012 - OR c=21021 - OR b=242 - OR b=770 - OR (g='utsrqpo' AND f GLOB 'uvwxy*') - OR a=71 - OR (d>=53.0 AND d<54.0 AND d NOT NULL) - OR (f GLOB '?hijk*' AND f GLOB 'ghij*') - ORDER BY a - } -} {6 20 22 32 34 35 36 53 58 59 61 62 63 70 71 75 84 scan 0 sort 0} -do_test where7-2.727.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=39.0 AND d<40.0 AND d NOT NULL) - OR ((a BETWEEN 42 AND 44) AND a!=43) - OR (g='gfedcba' AND f GLOB 'nopqr*') - OR (d>=27.0 AND d<28.0 AND d NOT NULL) - OR (g='utsrqpo' AND f GLOB 'uvwxy*') - OR a=75 - OR (d>=31.0 AND d<32.0 AND d NOT NULL) - OR (d>=54.0 AND d<55.0 AND d NOT NULL) - OR ((a BETWEEN 76 AND 78) AND a!=77) - OR ((a BETWEEN 81 AND 83) AND a!=82) - OR ((a BETWEEN 94 AND 96) AND a!=95) - ORDER BY a - } -} {20 27 31 39 42 44 54 75 76 78 81 83 91 94 96 scan 0 sort 0} -do_test where7-2.727.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=39.0 AND d<40.0 AND d NOT NULL) - OR ((a BETWEEN 42 AND 44) AND a!=43) - OR (g='gfedcba' AND f GLOB 'nopqr*') - OR (d>=27.0 AND d<28.0 AND d NOT NULL) - OR (g='utsrqpo' AND f GLOB 'uvwxy*') - OR a=75 - OR (d>=31.0 AND d<32.0 AND d NOT NULL) - OR (d>=54.0 AND d<55.0 AND d NOT NULL) - OR ((a BETWEEN 76 AND 78) AND a!=77) - OR ((a BETWEEN 81 AND 83) AND a!=82) - OR ((a BETWEEN 94 AND 96) AND a!=95) - ORDER BY a - } -} {20 27 31 39 42 44 54 75 76 78 81 83 91 94 96 scan 0 sort 0} -do_test where7-2.728.1 { - count_steps { - SELECT a FROM t2 - WHERE f='wxyzabcde' - OR f='abcdefghi' - ORDER BY a - } -} {22 26 48 52 74 78 100 scan 0 sort 1} -do_test where7-2.728.2 { - count_steps { - SELECT a FROM t3 - WHERE f='wxyzabcde' - OR f='abcdefghi' - ORDER BY a - } -} {22 26 48 52 74 78 100 scan 0 sort 1} -do_test where7-2.729.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 70 AND 72) AND a!=71) - OR (g='srqponm' AND f GLOB 'efghi*') - OR b=352 - OR (d>=23.0 AND d<24.0 AND d NOT NULL) - OR (d>=55.0 AND d<56.0 AND d NOT NULL) - OR a=12 - OR b=759 - OR c=31031 - ORDER BY a - } -} {12 23 30 32 55 69 70 72 91 92 93 scan 0 sort 0} -do_test where7-2.729.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 70 AND 72) AND a!=71) - OR (g='srqponm' AND f GLOB 'efghi*') - OR b=352 - OR (d>=23.0 AND d<24.0 AND d NOT NULL) - OR (d>=55.0 AND d<56.0 AND d NOT NULL) - OR a=12 - OR b=759 - OR c=31031 - ORDER BY a - } -} {12 23 30 32 55 69 70 72 91 92 93 scan 0 sort 0} -do_test where7-2.730.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='vutsrqp' AND f GLOB 'nopqr*') - OR (d>=21.0 AND d<22.0 AND d NOT NULL) - OR b=165 - ORDER BY a - } -} {13 15 21 scan 0 sort 0} -do_test where7-2.730.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='vutsrqp' AND f GLOB 'nopqr*') - OR (d>=21.0 AND d<22.0 AND d NOT NULL) - OR b=165 - ORDER BY a - } -} {13 15 21 scan 0 sort 0} -do_test where7-2.731.1 { - count_steps { - SELECT a FROM t2 - WHERE a=84 - OR b=916 - OR (g='utsrqpo' AND f GLOB 'wxyza*') - OR a=1 - ORDER BY a - } -} {1 22 84 scan 0 sort 0} -do_test where7-2.731.2 { - count_steps { - SELECT a FROM t3 - WHERE a=84 - OR b=916 - OR (g='utsrqpo' AND f GLOB 'wxyza*') - OR a=1 - ORDER BY a - } -} {1 22 84 scan 0 sort 0} -do_test where7-2.732.1 { - count_steps { - SELECT a FROM t2 - WHERE f='cdefghijk' - OR (d>=62.0 AND d<63.0 AND d NOT NULL) - ORDER BY a - } -} {2 28 54 62 80 scan 0 sort 0} -do_test where7-2.732.2 { - count_steps { - SELECT a FROM t3 - WHERE f='cdefghijk' - OR (d>=62.0 AND d<63.0 AND d NOT NULL) - ORDER BY a - } -} {2 28 54 62 80 scan 0 sort 0} -do_test where7-2.733.1 { - count_steps { - SELECT a FROM t2 - WHERE a=94 - OR b=289 - OR (f GLOB '?abcd*' AND f GLOB 'zabc*') - OR ((a BETWEEN 85 AND 87) AND a!=86) - ORDER BY a - } -} {25 51 77 85 87 94 scan 0 sort 0} -do_test where7-2.733.2 { - count_steps { - SELECT a FROM t3 - WHERE a=94 - OR b=289 - OR (f GLOB '?abcd*' AND f GLOB 'zabc*') - OR ((a BETWEEN 85 AND 87) AND a!=86) - ORDER BY a - } -} {25 51 77 85 87 94 scan 0 sort 0} -do_test where7-2.734.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='ihgfedc' AND f GLOB 'abcde*') - OR (g='yxwvuts' AND f GLOB 'cdefg*') - OR b=957 - OR (d>=15.0 AND d<16.0 AND d NOT NULL) - OR ((a BETWEEN 40 AND 42) AND a!=41) - OR (g='qponmlk' AND f GLOB 'mnopq*') - OR c=21021 - OR b=718 - ORDER BY a - } -} {2 15 38 40 42 61 62 63 78 87 scan 0 sort 0} -do_test where7-2.734.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='ihgfedc' AND f GLOB 'abcde*') - OR (g='yxwvuts' AND f GLOB 'cdefg*') - OR b=957 - OR (d>=15.0 AND d<16.0 AND d NOT NULL) - OR ((a BETWEEN 40 AND 42) AND a!=41) - OR (g='qponmlk' AND f GLOB 'mnopq*') - OR c=21021 - OR b=718 - ORDER BY a - } -} {2 15 38 40 42 61 62 63 78 87 scan 0 sort 0} -do_test where7-2.735.1 { - count_steps { - SELECT a FROM t2 - WHERE b=1023 - OR (g='utsrqpo' AND f GLOB 'uvwxy*') - OR (g='nmlkjih' AND f GLOB 'fghij*') - ORDER BY a - } -} {20 57 93 scan 0 sort 0} -do_test where7-2.735.2 { - count_steps { - SELECT a FROM t3 - WHERE b=1023 - OR (g='utsrqpo' AND f GLOB 'uvwxy*') - OR (g='nmlkjih' AND f GLOB 'fghij*') - ORDER BY a - } -} {20 57 93 scan 0 sort 0} -do_test where7-2.736.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 57 AND 59) AND a!=58) - OR b=102 - OR (d>=34.0 AND d<35.0 AND d NOT NULL) - OR a=90 - OR b=748 - OR (g='qponmlk' AND f GLOB 'mnopq*') - OR b=366 - OR (d>=66.0 AND d<67.0 AND d NOT NULL) - OR (d>=46.0 AND d<47.0 AND d NOT NULL) - ORDER BY a - } -} {34 38 46 57 59 66 68 90 scan 0 sort 0} -do_test where7-2.736.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 57 AND 59) AND a!=58) - OR b=102 - OR (d>=34.0 AND d<35.0 AND d NOT NULL) - OR a=90 - OR b=748 - OR (g='qponmlk' AND f GLOB 'mnopq*') - OR b=366 - OR (d>=66.0 AND d<67.0 AND d NOT NULL) - OR (d>=46.0 AND d<47.0 AND d NOT NULL) - ORDER BY a - } -} {34 38 46 57 59 66 68 90 scan 0 sort 0} -do_test where7-2.737.1 { - count_steps { - SELECT a FROM t2 - WHERE c=3003 - OR b=737 - OR b=179 - OR (d>=42.0 AND d<43.0 AND d NOT NULL) - ORDER BY a - } -} {7 8 9 42 67 scan 0 sort 0} -do_test where7-2.737.2 { - count_steps { - SELECT a FROM t3 - WHERE c=3003 - OR b=737 - OR b=179 - OR (d>=42.0 AND d<43.0 AND d NOT NULL) - ORDER BY a - } -} {7 8 9 42 67 scan 0 sort 0} -do_test where7-2.738.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 14 AND 16) AND a!=15) - OR b=33 - OR b=319 - OR (g='fedcbaz' AND f GLOB 'tuvwx*') - OR b=872 - OR (g='fedcbaz' AND f GLOB 'stuvw*') - OR b=968 - OR a=90 - ORDER BY a - } -} {3 14 16 29 88 90 96 97 scan 0 sort 0} -do_test where7-2.738.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 14 AND 16) AND a!=15) - OR b=33 - OR b=319 - OR (g='fedcbaz' AND f GLOB 'tuvwx*') - OR b=872 - OR (g='fedcbaz' AND f GLOB 'stuvw*') - OR b=968 - OR a=90 - ORDER BY a - } -} {3 14 16 29 88 90 96 97 scan 0 sort 0} -do_test where7-2.739.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 5 AND 7) AND a!=6) - OR f='pqrstuvwx' - OR a=47 - OR b=344 - OR a=94 - OR (g='wvutsrq' AND f GLOB 'lmnop*') - OR c=29029 - OR ((a BETWEEN 78 AND 80) AND a!=79) - ORDER BY a - } -} {5 7 11 15 41 47 67 78 80 85 86 87 93 94 scan 0 sort 0} -do_test where7-2.739.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 5 AND 7) AND a!=6) - OR f='pqrstuvwx' - OR a=47 - OR b=344 - OR a=94 - OR (g='wvutsrq' AND f GLOB 'lmnop*') - OR c=29029 - OR ((a BETWEEN 78 AND 80) AND a!=79) - ORDER BY a - } -} {5 7 11 15 41 47 67 78 80 85 86 87 93 94 scan 0 sort 0} -do_test where7-2.740.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 24 AND 26) AND a!=25) - OR (g='ihgfedc' AND f GLOB 'abcde*') - OR (g='nmlkjih' AND f GLOB 'fghij*') - OR b=201 - ORDER BY a - } -} {24 26 57 78 scan 0 sort 0} -do_test where7-2.740.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 24 AND 26) AND a!=25) - OR (g='ihgfedc' AND f GLOB 'abcde*') - OR (g='nmlkjih' AND f GLOB 'fghij*') - OR b=201 - ORDER BY a - } -} {24 26 57 78 scan 0 sort 0} -do_test where7-2.741.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=40.0 AND d<41.0 AND d NOT NULL) - OR ((a BETWEEN 30 AND 32) AND a!=31) - OR c=4004 - ORDER BY a - } -} {10 11 12 30 32 40 scan 0 sort 0} -do_test where7-2.741.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=40.0 AND d<41.0 AND d NOT NULL) - OR ((a BETWEEN 30 AND 32) AND a!=31) - OR c=4004 - ORDER BY a - } -} {10 11 12 30 32 40 scan 0 sort 0} -do_test where7-2.742.1 { - count_steps { - SELECT a FROM t2 - WHERE (f GLOB '?zabc*' AND f GLOB 'yzab*') - OR (d>=51.0 AND d<52.0 AND d NOT NULL) - OR (d>=62.0 AND d<63.0 AND d NOT NULL) - ORDER BY a - } -} {24 50 51 62 76 scan 0 sort 0} -do_test where7-2.742.2 { - count_steps { - SELECT a FROM t3 - WHERE (f GLOB '?zabc*' AND f GLOB 'yzab*') - OR (d>=51.0 AND d<52.0 AND d NOT NULL) - OR (d>=62.0 AND d<63.0 AND d NOT NULL) - ORDER BY a - } -} {24 50 51 62 76 scan 0 sort 0} -do_test where7-2.743.1 { - count_steps { - SELECT a FROM t2 - WHERE b=121 - OR b=451 - OR a=14 - OR (g='jihgfed' AND f GLOB 'vwxyz*') - OR ((a BETWEEN 51 AND 53) AND a!=52) - OR ((a BETWEEN 0 AND 2) AND a!=1) - ORDER BY a - } -} {2 11 14 41 51 53 73 scan 0 sort 0} -do_test where7-2.743.2 { - count_steps { - SELECT a FROM t3 - WHERE b=121 - OR b=451 - OR a=14 - OR (g='jihgfed' AND f GLOB 'vwxyz*') - OR ((a BETWEEN 51 AND 53) AND a!=52) - OR ((a BETWEEN 0 AND 2) AND a!=1) - ORDER BY a - } -} {2 11 14 41 51 53 73 scan 0 sort 0} -do_test where7-2.744.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=93.0 AND d<94.0 AND d NOT NULL) - OR (d>=26.0 AND d<27.0 AND d NOT NULL) - OR b=553 - OR (d>=31.0 AND d<32.0 AND d NOT NULL) - OR ((a BETWEEN 4 AND 6) AND a!=5) - OR b=616 - OR b=784 - OR b=927 - OR b=176 - OR (g='vutsrqp' AND f GLOB 'pqrst*') - ORDER BY a - } -} {4 6 15 16 26 31 56 93 scan 0 sort 0} -do_test where7-2.744.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=93.0 AND d<94.0 AND d NOT NULL) - OR (d>=26.0 AND d<27.0 AND d NOT NULL) - OR b=553 - OR (d>=31.0 AND d<32.0 AND d NOT NULL) - OR ((a BETWEEN 4 AND 6) AND a!=5) - OR b=616 - OR b=784 - OR b=927 - OR b=176 - OR (g='vutsrqp' AND f GLOB 'pqrst*') - ORDER BY a - } -} {4 6 15 16 26 31 56 93 scan 0 sort 0} -do_test where7-2.745.1 { - count_steps { - SELECT a FROM t2 - WHERE (f GLOB '?lmno*' AND f GLOB 'klmn*') - OR b=77 - ORDER BY a - } -} {7 10 36 62 88 scan 0 sort 0} -do_test where7-2.745.2 { - count_steps { - SELECT a FROM t3 - WHERE (f GLOB '?lmno*' AND f GLOB 'klmn*') - OR b=77 - ORDER BY a - } -} {7 10 36 62 88 scan 0 sort 0} -do_test where7-2.746.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=50.0 AND d<51.0 AND d NOT NULL) - OR ((a BETWEEN 95 AND 97) AND a!=96) - OR ((a BETWEEN 70 AND 72) AND a!=71) - ORDER BY a - } -} {50 70 72 95 97 scan 0 sort 0} -do_test where7-2.746.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=50.0 AND d<51.0 AND d NOT NULL) - OR ((a BETWEEN 95 AND 97) AND a!=96) - OR ((a BETWEEN 70 AND 72) AND a!=71) - ORDER BY a - } -} {50 70 72 95 97 scan 0 sort 0} -do_test where7-2.747.1 { - count_steps { - SELECT a FROM t2 - WHERE b=110 - OR a=12 - OR a=53 - OR (d>=80.0 AND d<81.0 AND d NOT NULL) - OR a=13 - OR ((a BETWEEN 93 AND 95) AND a!=94) - OR b=531 - ORDER BY a - } -} {10 12 13 53 80 93 95 scan 0 sort 0} -do_test where7-2.747.2 { - count_steps { - SELECT a FROM t3 - WHERE b=110 - OR a=12 - OR a=53 - OR (d>=80.0 AND d<81.0 AND d NOT NULL) - OR a=13 - OR ((a BETWEEN 93 AND 95) AND a!=94) - OR b=531 - ORDER BY a - } -} {10 12 13 53 80 93 95 scan 0 sort 0} -do_test where7-2.748.1 { - count_steps { - SELECT a FROM t2 - WHERE a=85 - OR (d>=56.0 AND d<57.0 AND d NOT NULL) - ORDER BY a - } -} {56 85 scan 0 sort 0} -do_test where7-2.748.2 { - count_steps { - SELECT a FROM t3 - WHERE a=85 - OR (d>=56.0 AND d<57.0 AND d NOT NULL) - ORDER BY a - } -} {56 85 scan 0 sort 0} -do_test where7-2.749.1 { - count_steps { - SELECT a FROM t2 - WHERE b=759 - OR b=605 - OR (g='lkjihgf' AND f GLOB 'mnopq*') - OR (d>=86.0 AND d<87.0 AND d NOT NULL) - ORDER BY a - } -} {55 64 69 86 scan 0 sort 0} -do_test where7-2.749.2 { - count_steps { - SELECT a FROM t3 - WHERE b=759 - OR b=605 - OR (g='lkjihgf' AND f GLOB 'mnopq*') - OR (d>=86.0 AND d<87.0 AND d NOT NULL) - ORDER BY a - } -} {55 64 69 86 scan 0 sort 0} -do_test where7-2.750.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=61.0 AND d<62.0 AND d NOT NULL) - OR b=1026 - OR ((a BETWEEN 47 AND 49) AND a!=48) - OR b=132 - OR b=201 - OR b=839 - OR ((a BETWEEN 54 AND 56) AND a!=55) - OR b=355 - OR ((a BETWEEN 3 AND 5) AND a!=4) - OR c=19019 - ORDER BY a - } -} {3 5 12 47 49 54 55 56 57 61 scan 0 sort 0} -do_test where7-2.750.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=61.0 AND d<62.0 AND d NOT NULL) - OR b=1026 - OR ((a BETWEEN 47 AND 49) AND a!=48) - OR b=132 - OR b=201 - OR b=839 - OR ((a BETWEEN 54 AND 56) AND a!=55) - OR b=355 - OR ((a BETWEEN 3 AND 5) AND a!=4) - OR c=19019 - ORDER BY a - } -} {3 5 12 47 49 54 55 56 57 61 scan 0 sort 0} -do_test where7-2.751.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=98.0 AND d<99.0 AND d NOT NULL) - OR ((a BETWEEN 99 AND 101) AND a!=100) - OR (g='vutsrqp' AND f GLOB 'nopqr*') - OR (d>=9.0 AND d<10.0 AND d NOT NULL) - OR a=18 - OR b=509 - OR b=399 - OR (d>=99.0 AND d<100.0 AND d NOT NULL) - ORDER BY a - } -} {9 13 18 98 99 scan 0 sort 0} -do_test where7-2.751.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=98.0 AND d<99.0 AND d NOT NULL) - OR ((a BETWEEN 99 AND 101) AND a!=100) - OR (g='vutsrqp' AND f GLOB 'nopqr*') - OR (d>=9.0 AND d<10.0 AND d NOT NULL) - OR a=18 - OR b=509 - OR b=399 - OR (d>=99.0 AND d<100.0 AND d NOT NULL) - ORDER BY a - } -} {9 13 18 98 99 scan 0 sort 0} -do_test where7-2.752.1 { - count_steps { - SELECT a FROM t2 - WHERE a=18 - OR f='uvwxyzabc' - OR a=90 - OR (d>=62.0 AND d<63.0 AND d NOT NULL) - OR (g='hgfedcb' AND f GLOB 'ghijk*') - OR b=462 - OR a=82 - OR ((a BETWEEN 9 AND 11) AND a!=10) - OR c=34034 - OR b=517 - OR b=465 - ORDER BY a - } -} {9 11 18 20 42 46 47 62 72 82 84 90 98 100 scan 0 sort 0} -do_test where7-2.752.2 { - count_steps { - SELECT a FROM t3 - WHERE a=18 - OR f='uvwxyzabc' - OR a=90 - OR (d>=62.0 AND d<63.0 AND d NOT NULL) - OR (g='hgfedcb' AND f GLOB 'ghijk*') - OR b=462 - OR a=82 - OR ((a BETWEEN 9 AND 11) AND a!=10) - OR c=34034 - OR b=517 - OR b=465 - ORDER BY a - } -} {9 11 18 20 42 46 47 62 72 82 84 90 98 100 scan 0 sort 0} -do_test where7-2.753.1 { - count_steps { - SELECT a FROM t2 - WHERE b=124 - OR ((a BETWEEN 52 AND 54) AND a!=53) - OR (f GLOB '?yzab*' AND f GLOB 'xyza*') - OR ((a BETWEEN 1 AND 3) AND a!=2) - OR b=773 - OR (d>=55.0 AND d<56.0 AND d NOT NULL) - OR (f GLOB '?zabc*' AND f GLOB 'yzab*') - OR a=76 - OR a=16 - ORDER BY a - } -} {1 3 16 23 24 49 50 52 54 55 75 76 scan 0 sort 0} -do_test where7-2.753.2 { - count_steps { - SELECT a FROM t3 - WHERE b=124 - OR ((a BETWEEN 52 AND 54) AND a!=53) - OR (f GLOB '?yzab*' AND f GLOB 'xyza*') - OR ((a BETWEEN 1 AND 3) AND a!=2) - OR b=773 - OR (d>=55.0 AND d<56.0 AND d NOT NULL) - OR (f GLOB '?zabc*' AND f GLOB 'yzab*') - OR a=76 - OR a=16 - ORDER BY a - } -} {1 3 16 23 24 49 50 52 54 55 75 76 scan 0 sort 0} -do_test where7-2.754.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 89 AND 91) AND a!=90) - OR a=97 - OR b=630 - OR (g='kjihgfe' AND f GLOB 'qrstu*') - OR b=143 - ORDER BY a - } -} {13 68 89 91 97 scan 0 sort 0} -do_test where7-2.754.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 89 AND 91) AND a!=90) - OR a=97 - OR b=630 - OR (g='kjihgfe' AND f GLOB 'qrstu*') - OR b=143 - ORDER BY a - } -} {13 68 89 91 97 scan 0 sort 0} -do_test where7-2.755.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='utsrqpo' AND f GLOB 'uvwxy*') - OR b=1056 - OR ((a BETWEEN 65 AND 67) AND a!=66) - OR f='opqrstuvw' - OR a=8 - OR ((a BETWEEN 33 AND 35) AND a!=34) - ORDER BY a - } -} {8 14 20 33 35 40 65 66 67 92 96 scan 0 sort 0} -do_test where7-2.755.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='utsrqpo' AND f GLOB 'uvwxy*') - OR b=1056 - OR ((a BETWEEN 65 AND 67) AND a!=66) - OR f='opqrstuvw' - OR a=8 - OR ((a BETWEEN 33 AND 35) AND a!=34) - ORDER BY a - } -} {8 14 20 33 35 40 65 66 67 92 96 scan 0 sort 0} -do_test where7-2.756.1 { - count_steps { - SELECT a FROM t2 - WHERE f='lmnopqrst' - OR b=773 - OR a=14 - OR a=7 - OR a=28 - ORDER BY a - } -} {7 11 14 28 37 63 89 scan 0 sort 0} -do_test where7-2.756.2 { - count_steps { - SELECT a FROM t3 - WHERE f='lmnopqrst' - OR b=773 - OR a=14 - OR a=7 - OR a=28 - ORDER BY a - } -} {7 11 14 28 37 63 89 scan 0 sort 0} -do_test where7-2.757.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=16.0 AND d<17.0 AND d NOT NULL) - OR a=69 - OR (g='gfedcba' AND f GLOB 'mnopq*') - OR (d>=68.0 AND d<69.0 AND d NOT NULL) - OR c=15015 - ORDER BY a - } -} {16 43 44 45 68 69 90 scan 0 sort 0} -do_test where7-2.757.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=16.0 AND d<17.0 AND d NOT NULL) - OR a=69 - OR (g='gfedcba' AND f GLOB 'mnopq*') - OR (d>=68.0 AND d<69.0 AND d NOT NULL) - OR c=15015 - ORDER BY a - } -} {16 43 44 45 68 69 90 scan 0 sort 0} -do_test where7-2.758.1 { - count_steps { - SELECT a FROM t2 - WHERE b=638 - OR ((a BETWEEN 89 AND 91) AND a!=90) - OR (g='srqponm' AND f GLOB 'fghij*') - OR b=69 - OR (d>=96.0 AND d<97.0 AND d NOT NULL) - ORDER BY a - } -} {31 58 89 91 96 scan 0 sort 0} -do_test where7-2.758.2 { - count_steps { - SELECT a FROM t3 - WHERE b=638 - OR ((a BETWEEN 89 AND 91) AND a!=90) - OR (g='srqponm' AND f GLOB 'fghij*') - OR b=69 - OR (d>=96.0 AND d<97.0 AND d NOT NULL) - ORDER BY a - } -} {31 58 89 91 96 scan 0 sort 0} -do_test where7-2.759.1 { - count_steps { - SELECT a FROM t2 - WHERE b=1100 - OR b=1012 - ORDER BY a - } -} {92 100 scan 0 sort 1} -do_test where7-2.759.2 { - count_steps { - SELECT a FROM t3 - WHERE b=1100 - OR b=1012 - ORDER BY a - } -} {92 100 scan 0 sort 1} -do_test where7-2.760.1 { - count_steps { - SELECT a FROM t2 - WHERE b=627 - OR a=35 - OR b=726 - OR b=1100 - OR a=8 - ORDER BY a - } -} {8 35 57 66 100 scan 0 sort 0} -do_test where7-2.760.2 { - count_steps { - SELECT a FROM t3 - WHERE b=627 - OR a=35 - OR b=726 - OR b=1100 - OR a=8 - ORDER BY a - } -} {8 35 57 66 100 scan 0 sort 0} -do_test where7-2.761.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 21 AND 23) AND a!=22) - OR a=50 - OR (g='wvutsrq' AND f GLOB 'lmnop*') - OR a=33 - OR c=6006 - ORDER BY a - } -} {11 16 17 18 21 23 33 50 scan 0 sort 0} -do_test where7-2.761.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 21 AND 23) AND a!=22) - OR a=50 - OR (g='wvutsrq' AND f GLOB 'lmnop*') - OR a=33 - OR c=6006 - ORDER BY a - } -} {11 16 17 18 21 23 33 50 scan 0 sort 0} -do_test where7-2.762.1 { - count_steps { - SELECT a FROM t2 - WHERE c=23023 - OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') - ORDER BY a - } -} {8 34 60 67 68 69 86 scan 0 sort 0} -do_test where7-2.762.2 { - count_steps { - SELECT a FROM t3 - WHERE c=23023 - OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') - ORDER BY a - } -} {8 34 60 67 68 69 86 scan 0 sort 0} -do_test where7-2.763.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='lkjihgf' AND f GLOB 'lmnop*') - OR f='opqrstuvw' - OR (d>=83.0 AND d<84.0 AND d NOT NULL) - OR c=16016 - OR b=825 - OR (g='onmlkji' AND f GLOB 'zabcd*') - ORDER BY a - } -} {14 40 46 47 48 51 63 66 75 83 92 scan 0 sort 0} -do_test where7-2.763.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='lkjihgf' AND f GLOB 'lmnop*') - OR f='opqrstuvw' - OR (d>=83.0 AND d<84.0 AND d NOT NULL) - OR c=16016 - OR b=825 - OR (g='onmlkji' AND f GLOB 'zabcd*') - ORDER BY a - } -} {14 40 46 47 48 51 63 66 75 83 92 scan 0 sort 0} -do_test where7-2.764.1 { - count_steps { - SELECT a FROM t2 - WHERE b=880 - OR c=5005 - OR (g='srqponm' AND f GLOB 'efghi*') - OR ((a BETWEEN 26 AND 28) AND a!=27) - OR b=146 - OR b=638 - OR a=7 - ORDER BY a - } -} {7 13 14 15 26 28 30 58 80 scan 0 sort 0} -do_test where7-2.764.2 { - count_steps { - SELECT a FROM t3 - WHERE b=880 - OR c=5005 - OR (g='srqponm' AND f GLOB 'efghi*') - OR ((a BETWEEN 26 AND 28) AND a!=27) - OR b=146 - OR b=638 - OR a=7 - ORDER BY a - } -} {7 13 14 15 26 28 30 58 80 scan 0 sort 0} -do_test where7-2.765.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='onmlkji' AND f GLOB 'yzabc*') - OR b=209 - OR b=693 - OR a=12 - OR b=179 - OR b=36 - OR (d>=88.0 AND d<89.0 AND d NOT NULL) - OR (g='jihgfed' AND f GLOB 'xyzab*') - OR c=28028 - ORDER BY a - } -} {12 19 50 63 75 82 83 84 88 scan 0 sort 0} -do_test where7-2.765.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='onmlkji' AND f GLOB 'yzabc*') - OR b=209 - OR b=693 - OR a=12 - OR b=179 - OR b=36 - OR (d>=88.0 AND d<89.0 AND d NOT NULL) - OR (g='jihgfed' AND f GLOB 'xyzab*') - OR c=28028 - ORDER BY a - } -} {12 19 50 63 75 82 83 84 88 scan 0 sort 0} -do_test where7-2.766.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=24.0 AND d<25.0 AND d NOT NULL) - OR (g='srqponm' AND f GLOB 'ghijk*') - OR ((a BETWEEN 73 AND 75) AND a!=74) - OR ((a BETWEEN 10 AND 12) AND a!=11) - OR a=73 - OR (d>=41.0 AND d<42.0 AND d NOT NULL) - OR b=825 - ORDER BY a - } -} {10 12 24 32 41 73 75 scan 0 sort 0} -do_test where7-2.766.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=24.0 AND d<25.0 AND d NOT NULL) - OR (g='srqponm' AND f GLOB 'ghijk*') - OR ((a BETWEEN 73 AND 75) AND a!=74) - OR ((a BETWEEN 10 AND 12) AND a!=11) - OR a=73 - OR (d>=41.0 AND d<42.0 AND d NOT NULL) - OR b=825 - ORDER BY a - } -} {10 12 24 32 41 73 75 scan 0 sort 0} -do_test where7-2.767.1 { - count_steps { - SELECT a FROM t2 - WHERE b=1081 - OR b=253 - OR (d>=53.0 AND d<54.0 AND d NOT NULL) - OR b=220 - OR b=575 - OR b=44 - OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') - OR (g='jihgfed' AND f GLOB 'zabcd*') - ORDER BY a - } -} {4 7 20 23 33 53 59 77 85 scan 0 sort 0} -do_test where7-2.767.2 { - count_steps { - SELECT a FROM t3 - WHERE b=1081 - OR b=253 - OR (d>=53.0 AND d<54.0 AND d NOT NULL) - OR b=220 - OR b=575 - OR b=44 - OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') - OR (g='jihgfed' AND f GLOB 'zabcd*') - ORDER BY a - } -} {4 7 20 23 33 53 59 77 85 scan 0 sort 0} -do_test where7-2.768.1 { - count_steps { - SELECT a FROM t2 - WHERE a=10 - OR c=12012 - OR a=95 - OR (d>=20.0 AND d<21.0 AND d NOT NULL) - OR (g='yxwvuts' AND f GLOB 'cdefg*') - OR (d>=34.0 AND d<35.0 AND d NOT NULL) - OR (f GLOB '?yzab*' AND f GLOB 'xyza*') - ORDER BY a - } -} {2 10 20 23 34 35 36 49 75 95 scan 0 sort 0} -do_test where7-2.768.2 { - count_steps { - SELECT a FROM t3 - WHERE a=10 - OR c=12012 - OR a=95 - OR (d>=20.0 AND d<21.0 AND d NOT NULL) - OR (g='yxwvuts' AND f GLOB 'cdefg*') - OR (d>=34.0 AND d<35.0 AND d NOT NULL) - OR (f GLOB '?yzab*' AND f GLOB 'xyza*') - ORDER BY a - } -} {2 10 20 23 34 35 36 49 75 95 scan 0 sort 0} -do_test where7-2.769.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 89 AND 91) AND a!=90) - OR b=344 - OR b=858 - OR (d>=78.0 AND d<79.0 AND d NOT NULL) - OR b=993 - ORDER BY a - } -} {78 89 91 scan 0 sort 0} -do_test where7-2.769.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 89 AND 91) AND a!=90) - OR b=344 - OR b=858 - OR (d>=78.0 AND d<79.0 AND d NOT NULL) - OR b=993 - ORDER BY a - } -} {78 89 91 scan 0 sort 0} -do_test where7-2.770.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='mlkjihg' AND f GLOB 'klmno*') - OR (d>=56.0 AND d<57.0 AND d NOT NULL) - OR a=49 - OR (d>=80.0 AND d<81.0 AND d NOT NULL) - OR b=682 - OR (d>=50.0 AND d<51.0 AND d NOT NULL) - OR ((a BETWEEN 2 AND 4) AND a!=3) - ORDER BY a - } -} {2 4 49 50 56 62 80 scan 0 sort 0} -do_test where7-2.770.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='mlkjihg' AND f GLOB 'klmno*') - OR (d>=56.0 AND d<57.0 AND d NOT NULL) - OR a=49 - OR (d>=80.0 AND d<81.0 AND d NOT NULL) - OR b=682 - OR (d>=50.0 AND d<51.0 AND d NOT NULL) - OR ((a BETWEEN 2 AND 4) AND a!=3) - ORDER BY a - } -} {2 4 49 50 56 62 80 scan 0 sort 0} -do_test where7-2.771.1 { - count_steps { - SELECT a FROM t2 - WHERE a=100 - OR (d>=72.0 AND d<73.0 AND d NOT NULL) - OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') - OR b=839 - OR (g='vutsrqp' AND f GLOB 'qrstu*') - OR a=37 - OR b=759 - OR (g='jihgfed' AND f GLOB 'wxyza*') - ORDER BY a - } -} {14 16 37 40 66 69 72 74 92 100 scan 0 sort 0} -do_test where7-2.771.2 { - count_steps { - SELECT a FROM t3 - WHERE a=100 - OR (d>=72.0 AND d<73.0 AND d NOT NULL) - OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') - OR b=839 - OR (g='vutsrqp' AND f GLOB 'qrstu*') - OR a=37 - OR b=759 - OR (g='jihgfed' AND f GLOB 'wxyza*') - ORDER BY a - } -} {14 16 37 40 66 69 72 74 92 100 scan 0 sort 0} -do_test where7-2.772.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 98 AND 100) AND a!=99) - OR ((a BETWEEN 94 AND 96) AND a!=95) - OR (g='fedcbaz' AND f GLOB 'stuvw*') - OR b=960 - OR b=297 - OR (d>=5.0 AND d<6.0 AND d NOT NULL) - ORDER BY a - } -} {5 27 94 96 98 100 scan 0 sort 0} -do_test where7-2.772.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 98 AND 100) AND a!=99) - OR ((a BETWEEN 94 AND 96) AND a!=95) - OR (g='fedcbaz' AND f GLOB 'stuvw*') - OR b=960 - OR b=297 - OR (d>=5.0 AND d<6.0 AND d NOT NULL) - ORDER BY a - } -} {5 27 94 96 98 100 scan 0 sort 0} -do_test where7-2.773.1 { - count_steps { - SELECT a FROM t2 - WHERE b=979 - OR (d>=96.0 AND d<97.0 AND d NOT NULL) - OR (d>=16.0 AND d<17.0 AND d NOT NULL) - OR b=1023 - OR ((a BETWEEN 46 AND 48) AND a!=47) - OR (g='hgfedcb' AND f GLOB 'ghijk*') - OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') - ORDER BY a - } -} {8 16 34 46 48 60 84 86 89 93 96 scan 0 sort 0} -do_test where7-2.773.2 { - count_steps { - SELECT a FROM t3 - WHERE b=979 - OR (d>=96.0 AND d<97.0 AND d NOT NULL) - OR (d>=16.0 AND d<17.0 AND d NOT NULL) - OR b=1023 - OR ((a BETWEEN 46 AND 48) AND a!=47) - OR (g='hgfedcb' AND f GLOB 'ghijk*') - OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') - ORDER BY a - } -} {8 16 34 46 48 60 84 86 89 93 96 scan 0 sort 0} -do_test where7-2.774.1 { - count_steps { - SELECT a FROM t2 - WHERE a=3 - OR ((a BETWEEN 0 AND 2) AND a!=1) - ORDER BY a - } -} {2 3 scan 0 sort 0} -do_test where7-2.774.2 { - count_steps { - SELECT a FROM t3 - WHERE a=3 - OR ((a BETWEEN 0 AND 2) AND a!=1) - ORDER BY a - } -} {2 3 scan 0 sort 0} -do_test where7-2.775.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=83.0 AND d<84.0 AND d NOT NULL) - OR (d>=13.0 AND d<14.0 AND d NOT NULL) - OR f='uvwxyzabc' - OR a=43 - OR (g='qponmlk' AND f GLOB 'pqrst*') - ORDER BY a - } -} {13 20 41 43 46 72 83 98 scan 0 sort 0} -do_test where7-2.775.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=83.0 AND d<84.0 AND d NOT NULL) - OR (d>=13.0 AND d<14.0 AND d NOT NULL) - OR f='uvwxyzabc' - OR a=43 - OR (g='qponmlk' AND f GLOB 'pqrst*') - ORDER BY a - } -} {13 20 41 43 46 72 83 98 scan 0 sort 0} -do_test where7-2.776.1 { - count_steps { - SELECT a FROM t2 - WHERE a=14 - OR a=76 - OR (g='tsrqpon' AND f GLOB 'yzabc*') - OR b=795 - OR b=44 - OR b=88 - OR b=762 - OR b=891 - OR (d>=17.0 AND d<18.0 AND d NOT NULL) - OR (g='jihgfed' AND f GLOB 'vwxyz*') - OR ((a BETWEEN 45 AND 47) AND a!=46) - ORDER BY a - } -} {4 8 14 17 24 45 47 73 76 81 scan 0 sort 0} -do_test where7-2.776.2 { - count_steps { - SELECT a FROM t3 - WHERE a=14 - OR a=76 - OR (g='tsrqpon' AND f GLOB 'yzabc*') - OR b=795 - OR b=44 - OR b=88 - OR b=762 - OR b=891 - OR (d>=17.0 AND d<18.0 AND d NOT NULL) - OR (g='jihgfed' AND f GLOB 'vwxyz*') - OR ((a BETWEEN 45 AND 47) AND a!=46) - ORDER BY a - } -} {4 8 14 17 24 45 47 73 76 81 scan 0 sort 0} -do_test where7-2.777.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='wvutsrq' AND f GLOB 'lmnop*') - OR a=73 - OR ((a BETWEEN 39 AND 41) AND a!=40) - OR b=267 - OR f='ijklmnopq' - OR b=674 - ORDER BY a - } -} {8 11 34 39 41 60 73 86 scan 0 sort 0} -do_test where7-2.777.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='wvutsrq' AND f GLOB 'lmnop*') - OR a=73 - OR ((a BETWEEN 39 AND 41) AND a!=40) - OR b=267 - OR f='ijklmnopq' - OR b=674 - ORDER BY a - } -} {8 11 34 39 41 60 73 86 scan 0 sort 0} -do_test where7-2.778.1 { - count_steps { - SELECT a FROM t2 - WHERE b=190 - OR a=59 - OR a=93 - OR b=36 - OR ((a BETWEEN 40 AND 42) AND a!=41) - OR a=62 - OR a=96 - ORDER BY a - } -} {40 42 59 62 93 96 scan 0 sort 0} -do_test where7-2.778.2 { - count_steps { - SELECT a FROM t3 - WHERE b=190 - OR a=59 - OR a=93 - OR b=36 - OR ((a BETWEEN 40 AND 42) AND a!=41) - OR a=62 - OR a=96 - ORDER BY a - } -} {40 42 59 62 93 96 scan 0 sort 0} -do_test where7-2.779.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='wvutsrq' AND f GLOB 'jklmn*') - OR b=275 - OR a=78 - OR b=883 - OR (g='mlkjihg' AND f GLOB 'ghijk*') - OR b=792 - ORDER BY a - } -} {9 25 58 72 78 scan 0 sort 0} -do_test where7-2.779.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='wvutsrq' AND f GLOB 'jklmn*') - OR b=275 - OR a=78 - OR b=883 - OR (g='mlkjihg' AND f GLOB 'ghijk*') - OR b=792 - ORDER BY a - } -} {9 25 58 72 78 scan 0 sort 0} -do_test where7-2.780.1 { - count_steps { - SELECT a FROM t2 - WHERE a=79 - OR (g='wvutsrq' AND f GLOB 'klmno*') - OR (d>=14.0 AND d<15.0 AND d NOT NULL) - ORDER BY a - } -} {10 14 79 scan 0 sort 0} -do_test where7-2.780.2 { - count_steps { - SELECT a FROM t3 - WHERE a=79 - OR (g='wvutsrq' AND f GLOB 'klmno*') - OR (d>=14.0 AND d<15.0 AND d NOT NULL) - ORDER BY a - } -} {10 14 79 scan 0 sort 0} -do_test where7-2.781.1 { - count_steps { - SELECT a FROM t2 - WHERE f='rstuvwxyz' - OR (g='kjihgfe' AND f GLOB 'rstuv*') - OR a=10 - OR b=440 - OR (d>=3.0 AND d<4.0 AND d NOT NULL) - OR (g='jihgfed' AND f GLOB 'yzabc*') - OR b=440 - OR (g='lkjihgf' AND f GLOB 'nopqr*') - OR b=264 - OR b=1081 - ORDER BY a - } -} {3 10 17 24 40 43 65 69 76 95 scan 0 sort 0} -do_test where7-2.781.2 { - count_steps { - SELECT a FROM t3 - WHERE f='rstuvwxyz' - OR (g='kjihgfe' AND f GLOB 'rstuv*') - OR a=10 - OR b=440 - OR (d>=3.0 AND d<4.0 AND d NOT NULL) - OR (g='jihgfed' AND f GLOB 'yzabc*') - OR b=440 - OR (g='lkjihgf' AND f GLOB 'nopqr*') - OR b=264 - OR b=1081 - ORDER BY a - } -} {3 10 17 24 40 43 65 69 76 95 scan 0 sort 0} -do_test where7-2.782.1 { - count_steps { - SELECT a FROM t2 - WHERE c=11011 - OR (f GLOB '?fghi*' AND f GLOB 'efgh*') - OR ((a BETWEEN 62 AND 64) AND a!=63) - OR (d>=81.0 AND d<82.0 AND d NOT NULL) - OR (g='fedcbaz' AND f GLOB 'pqrst*') - OR b=715 - OR b=154 - ORDER BY a - } -} {4 14 30 31 32 33 56 62 64 65 81 82 93 scan 0 sort 0} -do_test where7-2.782.2 { - count_steps { - SELECT a FROM t3 - WHERE c=11011 - OR (f GLOB '?fghi*' AND f GLOB 'efgh*') - OR ((a BETWEEN 62 AND 64) AND a!=63) - OR (d>=81.0 AND d<82.0 AND d NOT NULL) - OR (g='fedcbaz' AND f GLOB 'pqrst*') - OR b=715 - OR b=154 - ORDER BY a - } -} {4 14 30 31 32 33 56 62 64 65 81 82 93 scan 0 sort 0} -do_test where7-2.783.1 { - count_steps { - SELECT a FROM t2 - WHERE f='uvwxyzabc' - OR f='jklmnopqr' - OR a=41 - OR (g='ponmlkj' AND f GLOB 'tuvwx*') - OR a=1 - ORDER BY a - } -} {1 9 20 35 41 45 46 61 72 87 98 scan 0 sort 0} -do_test where7-2.783.2 { - count_steps { - SELECT a FROM t3 - WHERE f='uvwxyzabc' - OR f='jklmnopqr' - OR a=41 - OR (g='ponmlkj' AND f GLOB 'tuvwx*') - OR a=1 - ORDER BY a - } -} {1 9 20 35 41 45 46 61 72 87 98 scan 0 sort 0} -do_test where7-2.784.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='rqponml' AND f GLOB 'jklmn*') - OR ((a BETWEEN 88 AND 90) AND a!=89) - OR (g='edcbazy' AND f GLOB 'wxyza*') - OR (g='gfedcba' AND f GLOB 'opqrs*') - OR (g='fedcbaz' AND f GLOB 'stuvw*') - ORDER BY a - } -} {35 88 90 92 96 100 scan 0 sort 0} -do_test where7-2.784.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='rqponml' AND f GLOB 'jklmn*') - OR ((a BETWEEN 88 AND 90) AND a!=89) - OR (g='edcbazy' AND f GLOB 'wxyza*') - OR (g='gfedcba' AND f GLOB 'opqrs*') - OR (g='fedcbaz' AND f GLOB 'stuvw*') - ORDER BY a - } -} {35 88 90 92 96 100 scan 0 sort 0} -do_test where7-2.785.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 33 AND 35) AND a!=34) - OR (d>=59.0 AND d<60.0 AND d NOT NULL) - OR c=24024 - OR c=22022 - ORDER BY a - } -} {33 35 59 64 65 66 70 71 72 scan 0 sort 0} -do_test where7-2.785.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 33 AND 35) AND a!=34) - OR (d>=59.0 AND d<60.0 AND d NOT NULL) - OR c=24024 - OR c=22022 - ORDER BY a - } -} {33 35 59 64 65 66 70 71 72 scan 0 sort 0} -do_test where7-2.786.1 { - count_steps { - SELECT a FROM t2 - WHERE c=17017 - OR b=550 - OR a=65 - ORDER BY a - } -} {49 50 51 65 scan 0 sort 0} -do_test where7-2.786.2 { - count_steps { - SELECT a FROM t3 - WHERE c=17017 - OR b=550 - OR a=65 - ORDER BY a - } -} {49 50 51 65 scan 0 sort 0} -do_test where7-2.787.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=80.0 AND d<81.0 AND d NOT NULL) - OR c=29029 - ORDER BY a - } -} {80 85 86 87 scan 0 sort 0} -do_test where7-2.787.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=80.0 AND d<81.0 AND d NOT NULL) - OR c=29029 - ORDER BY a - } -} {80 85 86 87 scan 0 sort 0} -do_test where7-2.788.1 { - count_steps { - SELECT a FROM t2 - WHERE b=1012 - OR (d>=80.0 AND d<81.0 AND d NOT NULL) - OR ((a BETWEEN 90 AND 92) AND a!=91) - OR (g='srqponm' AND f GLOB 'ghijk*') - OR b=234 - ORDER BY a - } -} {32 80 90 92 scan 0 sort 0} -do_test where7-2.788.2 { - count_steps { - SELECT a FROM t3 - WHERE b=1012 - OR (d>=80.0 AND d<81.0 AND d NOT NULL) - OR ((a BETWEEN 90 AND 92) AND a!=91) - OR (g='srqponm' AND f GLOB 'ghijk*') - OR b=234 - ORDER BY a - } -} {32 80 90 92 scan 0 sort 0} -do_test where7-2.789.1 { - count_steps { - SELECT a FROM t2 - WHERE b=652 - OR ((a BETWEEN 13 AND 15) AND a!=14) - OR b=110 - OR (g='wvutsrq' AND f GLOB 'ijklm*') - OR a=4 - ORDER BY a - } -} {4 8 10 13 15 scan 0 sort 0} -do_test where7-2.789.2 { - count_steps { - SELECT a FROM t3 - WHERE b=652 - OR ((a BETWEEN 13 AND 15) AND a!=14) - OR b=110 - OR (g='wvutsrq' AND f GLOB 'ijklm*') - OR a=4 - ORDER BY a - } -} {4 8 10 13 15 scan 0 sort 0} -do_test where7-2.790.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=90.0 AND d<91.0 AND d NOT NULL) - OR (d>=50.0 AND d<51.0 AND d NOT NULL) - ORDER BY a - } -} {50 90 scan 0 sort 0} -do_test where7-2.790.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=90.0 AND d<91.0 AND d NOT NULL) - OR (d>=50.0 AND d<51.0 AND d NOT NULL) - ORDER BY a - } -} {50 90 scan 0 sort 0} -do_test where7-2.791.1 { - count_steps { - SELECT a FROM t2 - WHERE (f GLOB '?xyza*' AND f GLOB 'wxyz*') - OR (g='tsrqpon' AND f GLOB 'zabcd*') - OR a=55 - OR (d>=44.0 AND d<45.0 AND d NOT NULL) - OR f='bcdefghij' - OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') - ORDER BY a - } -} {1 7 22 25 27 33 44 48 53 55 59 74 79 85 100 scan 0 sort 0} -do_test where7-2.791.2 { - count_steps { - SELECT a FROM t3 - WHERE (f GLOB '?xyza*' AND f GLOB 'wxyz*') - OR (g='tsrqpon' AND f GLOB 'zabcd*') - OR a=55 - OR (d>=44.0 AND d<45.0 AND d NOT NULL) - OR f='bcdefghij' - OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') - ORDER BY a - } -} {1 7 22 25 27 33 44 48 53 55 59 74 79 85 100 scan 0 sort 0} -do_test where7-2.792.1 { - count_steps { - SELECT a FROM t2 - WHERE b=121 - OR a=50 - OR b=443 - OR d>1e10 - OR (g='onmlkji' AND f GLOB 'yzabc*') - OR f='zabcdefgh' - OR (d>=86.0 AND d<87.0 AND d NOT NULL) - OR (g='nmlkjih' AND f GLOB 'bcdef*') - ORDER BY a - } -} {11 25 50 51 53 77 86 scan 0 sort 0} -do_test where7-2.792.2 { - count_steps { - SELECT a FROM t3 - WHERE b=121 - OR a=50 - OR b=443 - OR d>1e10 - OR (g='onmlkji' AND f GLOB 'yzabc*') - OR f='zabcdefgh' - OR (d>=86.0 AND d<87.0 AND d NOT NULL) - OR (g='nmlkjih' AND f GLOB 'bcdef*') - ORDER BY a - } -} {11 25 50 51 53 77 86 scan 0 sort 0} -do_test where7-2.793.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 83 AND 85) AND a!=84) - OR (d>=20.0 AND d<21.0 AND d NOT NULL) - OR (g='gfedcba' AND f GLOB 'opqrs*') - OR (d>=13.0 AND d<14.0 AND d NOT NULL) - OR b=891 - OR b=605 - OR b=990 - OR (g='ihgfedc' AND f GLOB 'efghi*') - OR b=902 - ORDER BY a - } -} {13 20 55 81 82 83 85 90 92 scan 0 sort 0} -do_test where7-2.793.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 83 AND 85) AND a!=84) - OR (d>=20.0 AND d<21.0 AND d NOT NULL) - OR (g='gfedcba' AND f GLOB 'opqrs*') - OR (d>=13.0 AND d<14.0 AND d NOT NULL) - OR b=891 - OR b=605 - OR b=990 - OR (g='ihgfedc' AND f GLOB 'efghi*') - OR b=902 - ORDER BY a - } -} {13 20 55 81 82 83 85 90 92 scan 0 sort 0} -do_test where7-2.794.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='tsrqpon' AND f GLOB 'zabcd*') - OR ((a BETWEEN 54 AND 56) AND a!=55) - OR (d>=86.0 AND d<87.0 AND d NOT NULL) - OR a=74 - ORDER BY a - } -} {25 54 56 74 86 scan 0 sort 0} -do_test where7-2.794.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='tsrqpon' AND f GLOB 'zabcd*') - OR ((a BETWEEN 54 AND 56) AND a!=55) - OR (d>=86.0 AND d<87.0 AND d NOT NULL) - OR a=74 - ORDER BY a - } -} {25 54 56 74 86 scan 0 sort 0} -do_test where7-2.795.1 { - count_steps { - SELECT a FROM t2 - WHERE c=14014 - OR ((a BETWEEN 53 AND 55) AND a!=54) - OR b=861 - OR (d>=50.0 AND d<51.0 AND d NOT NULL) - OR ((a BETWEEN 7 AND 9) AND a!=8) - ORDER BY a - } -} {7 9 40 41 42 50 53 55 scan 0 sort 0} -do_test where7-2.795.2 { - count_steps { - SELECT a FROM t3 - WHERE c=14014 - OR ((a BETWEEN 53 AND 55) AND a!=54) - OR b=861 - OR (d>=50.0 AND d<51.0 AND d NOT NULL) - OR ((a BETWEEN 7 AND 9) AND a!=8) - ORDER BY a - } -} {7 9 40 41 42 50 53 55 scan 0 sort 0} -do_test where7-2.796.1 { - count_steps { - SELECT a FROM t2 - WHERE b=671 - OR b=88 - OR ((a BETWEEN 98 AND 100) AND a!=99) - OR (f GLOB '?xyza*' AND f GLOB 'wxyz*') - OR (g='lkjihgf' AND f GLOB 'mnopq*') - OR f='efghijklm' - OR b=33 - OR ((a BETWEEN 60 AND 62) AND a!=61) - OR c=19019 - OR b=322 - ORDER BY a - } -} {3 4 8 22 30 48 55 56 57 60 61 62 64 74 82 98 100 scan 0 sort 0} -do_test where7-2.796.2 { - count_steps { - SELECT a FROM t3 - WHERE b=671 - OR b=88 - OR ((a BETWEEN 98 AND 100) AND a!=99) - OR (f GLOB '?xyza*' AND f GLOB 'wxyz*') - OR (g='lkjihgf' AND f GLOB 'mnopq*') - OR f='efghijklm' - OR b=33 - OR ((a BETWEEN 60 AND 62) AND a!=61) - OR c=19019 - OR b=322 - ORDER BY a - } -} {3 4 8 22 30 48 55 56 57 60 61 62 64 74 82 98 100 scan 0 sort 0} -do_test where7-2.797.1 { - count_steps { - SELECT a FROM t2 - WHERE b=517 - OR (d>=43.0 AND d<44.0 AND d NOT NULL) - OR c=18018 - OR b=14 - OR a=83 - OR ((a BETWEEN 33 AND 35) AND a!=34) - ORDER BY a - } -} {33 35 43 47 52 53 54 83 scan 0 sort 0} -do_test where7-2.797.2 { - count_steps { - SELECT a FROM t3 - WHERE b=517 - OR (d>=43.0 AND d<44.0 AND d NOT NULL) - OR c=18018 - OR b=14 - OR a=83 - OR ((a BETWEEN 33 AND 35) AND a!=34) - ORDER BY a - } -} {33 35 43 47 52 53 54 83 scan 0 sort 0} -do_test where7-2.798.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=94.0 AND d<95.0 AND d NOT NULL) - OR b=586 - OR ((a BETWEEN 0 AND 2) AND a!=1) - OR (d>=33.0 AND d<34.0 AND d NOT NULL) - ORDER BY a - } -} {2 33 94 scan 0 sort 0} -do_test where7-2.798.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=94.0 AND d<95.0 AND d NOT NULL) - OR b=586 - OR ((a BETWEEN 0 AND 2) AND a!=1) - OR (d>=33.0 AND d<34.0 AND d NOT NULL) - ORDER BY a - } -} {2 33 94 scan 0 sort 0} -do_test where7-2.799.1 { - count_steps { - SELECT a FROM t2 - WHERE c=20020 - OR b=333 - OR b=762 - OR ((a BETWEEN 81 AND 83) AND a!=82) - OR a=66 - OR (g='jihgfed' AND f GLOB 'vwxyz*') - ORDER BY a - } -} {58 59 60 66 73 81 83 scan 0 sort 0} -do_test where7-2.799.2 { - count_steps { - SELECT a FROM t3 - WHERE c=20020 - OR b=333 - OR b=762 - OR ((a BETWEEN 81 AND 83) AND a!=82) - OR a=66 - OR (g='jihgfed' AND f GLOB 'vwxyz*') - ORDER BY a - } -} {58 59 60 66 73 81 83 scan 0 sort 0} -do_test where7-2.800.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 2 AND 4) AND a!=3) - OR b=440 - OR (d>=78.0 AND d<79.0 AND d NOT NULL) - OR ((a BETWEEN 36 AND 38) AND a!=37) - OR b=638 - ORDER BY a - } -} {2 4 36 38 40 58 78 scan 0 sort 0} -do_test where7-2.800.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 2 AND 4) AND a!=3) - OR b=440 - OR (d>=78.0 AND d<79.0 AND d NOT NULL) - OR ((a BETWEEN 36 AND 38) AND a!=37) - OR b=638 - ORDER BY a - } -} {2 4 36 38 40 58 78 scan 0 sort 0} -do_test where7-2.801.1 { - count_steps { - SELECT a FROM t2 - WHERE b=935 - OR a=17 - OR b=1092 - OR (d>=75.0 AND d<76.0 AND d NOT NULL) - ORDER BY a - } -} {17 75 85 scan 0 sort 0} -do_test where7-2.801.2 { - count_steps { - SELECT a FROM t3 - WHERE b=935 - OR a=17 - OR b=1092 - OR (d>=75.0 AND d<76.0 AND d NOT NULL) - ORDER BY a - } -} {17 75 85 scan 0 sort 0} -do_test where7-2.802.1 { - count_steps { - SELECT a FROM t2 - WHERE a=79 - OR (d>=15.0 AND d<16.0 AND d NOT NULL) - OR b=1067 - OR b=22 - OR a=78 - OR (g='vutsrqp' AND f GLOB 'nopqr*') - OR (g='kjihgfe' AND f GLOB 'qrstu*') - OR ((a BETWEEN 40 AND 42) AND a!=41) - OR f='fghijklmn' - OR b=608 - OR (d>=66.0 AND d<67.0 AND d NOT NULL) - ORDER BY a - } -} {2 5 13 15 31 40 42 57 66 68 78 79 83 97 scan 0 sort 0} -do_test where7-2.802.2 { - count_steps { - SELECT a FROM t3 - WHERE a=79 - OR (d>=15.0 AND d<16.0 AND d NOT NULL) - OR b=1067 - OR b=22 - OR a=78 - OR (g='vutsrqp' AND f GLOB 'nopqr*') - OR (g='kjihgfe' AND f GLOB 'qrstu*') - OR ((a BETWEEN 40 AND 42) AND a!=41) - OR f='fghijklmn' - OR b=608 - OR (d>=66.0 AND d<67.0 AND d NOT NULL) - ORDER BY a - } -} {2 5 13 15 31 40 42 57 66 68 78 79 83 97 scan 0 sort 0} -do_test where7-2.803.1 { - count_steps { - SELECT a FROM t2 - WHERE b=66 - OR (g='ponmlkj' AND f GLOB 'rstuv*') - OR (d>=36.0 AND d<37.0 AND d NOT NULL) - ORDER BY a - } -} {6 36 43 scan 0 sort 0} -do_test where7-2.803.2 { - count_steps { - SELECT a FROM t3 - WHERE b=66 - OR (g='ponmlkj' AND f GLOB 'rstuv*') - OR (d>=36.0 AND d<37.0 AND d NOT NULL) - ORDER BY a - } -} {6 36 43 scan 0 sort 0} -do_test where7-2.804.1 { - count_steps { - SELECT a FROM t2 - WHERE f='rstuvwxyz' - OR a=22 - ORDER BY a - } -} {17 22 43 69 95 scan 0 sort 0} -do_test where7-2.804.2 { - count_steps { - SELECT a FROM t3 - WHERE f='rstuvwxyz' - OR a=22 - ORDER BY a - } -} {17 22 43 69 95 scan 0 sort 0} -do_test where7-2.805.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 12 AND 14) AND a!=13) - OR b=1092 - OR b=14 - OR c=2002 - OR b=33 - OR a=67 - OR (g='onmlkji' AND f GLOB 'xyzab*') - OR a=52 - OR b=80 - OR ((a BETWEEN 70 AND 72) AND a!=71) - OR a=88 - ORDER BY a - } -} {3 4 5 6 12 14 49 52 67 70 72 88 scan 0 sort 0} -do_test where7-2.805.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 12 AND 14) AND a!=13) - OR b=1092 - OR b=14 - OR c=2002 - OR b=33 - OR a=67 - OR (g='onmlkji' AND f GLOB 'xyzab*') - OR a=52 - OR b=80 - OR ((a BETWEEN 70 AND 72) AND a!=71) - OR a=88 - ORDER BY a - } -} {3 4 5 6 12 14 49 52 67 70 72 88 scan 0 sort 0} -do_test where7-2.806.1 { - count_steps { - SELECT a FROM t2 - WHERE a=33 - OR (g='lkjihgf' AND f GLOB 'mnopq*') - OR (g='nmlkjih' AND f GLOB 'bcdef*') - OR (g='edcbazy' AND f GLOB 'wxyza*') - OR b=385 - OR ((a BETWEEN 51 AND 53) AND a!=52) - ORDER BY a - } -} {33 35 51 53 64 100 scan 0 sort 0} -do_test where7-2.806.2 { - count_steps { - SELECT a FROM t3 - WHERE a=33 - OR (g='lkjihgf' AND f GLOB 'mnopq*') - OR (g='nmlkjih' AND f GLOB 'bcdef*') - OR (g='edcbazy' AND f GLOB 'wxyza*') - OR b=385 - OR ((a BETWEEN 51 AND 53) AND a!=52) - ORDER BY a - } -} {33 35 51 53 64 100 scan 0 sort 0} -do_test where7-2.807.1 { - count_steps { - SELECT a FROM t2 - WHERE a=63 - OR b=572 - OR b=784 - OR f='bcdefghij' - OR (g='kjihgfe' AND f GLOB 'stuvw*') - OR a=72 - OR (d>=62.0 AND d<63.0 AND d NOT NULL) - OR b<0 - OR ((a BETWEEN 89 AND 91) AND a!=90) - OR ((a BETWEEN 52 AND 54) AND a!=53) - OR (d>=68.0 AND d<69.0 AND d NOT NULL) - ORDER BY a - } -} {1 27 52 53 54 62 63 68 70 72 79 89 91 scan 0 sort 0} -do_test where7-2.807.2 { - count_steps { - SELECT a FROM t3 - WHERE a=63 - OR b=572 - OR b=784 - OR f='bcdefghij' - OR (g='kjihgfe' AND f GLOB 'stuvw*') - OR a=72 - OR (d>=62.0 AND d<63.0 AND d NOT NULL) - OR b<0 - OR ((a BETWEEN 89 AND 91) AND a!=90) - OR ((a BETWEEN 52 AND 54) AND a!=53) - OR (d>=68.0 AND d<69.0 AND d NOT NULL) - ORDER BY a - } -} {1 27 52 53 54 62 63 68 70 72 79 89 91 scan 0 sort 0} -do_test where7-2.808.1 { - count_steps { - SELECT a FROM t2 - WHERE b=902 - OR (f GLOB '?rstu*' AND f GLOB 'qrst*') - OR c=34034 - OR b=682 - OR f='fghijklmn' - OR a=6 - OR (f GLOB '?ghij*' AND f GLOB 'fghi*') - OR b=828 - OR c=18018 - ORDER BY a - } -} {5 6 16 31 42 52 53 54 57 62 68 82 83 94 100 scan 0 sort 0} -do_test where7-2.808.2 { - count_steps { - SELECT a FROM t3 - WHERE b=902 - OR (f GLOB '?rstu*' AND f GLOB 'qrst*') - OR c=34034 - OR b=682 - OR f='fghijklmn' - OR a=6 - OR (f GLOB '?ghij*' AND f GLOB 'fghi*') - OR b=828 - OR c=18018 - ORDER BY a - } -} {5 6 16 31 42 52 53 54 57 62 68 82 83 94 100 scan 0 sort 0} -do_test where7-2.809.1 { - count_steps { - SELECT a FROM t2 - WHERE b=902 - OR a=89 - OR (d>=94.0 AND d<95.0 AND d NOT NULL) - OR c=34034 - OR b=605 - OR b=143 - OR b=1004 - OR (g='xwvutsr' AND f GLOB 'ghijk*') - OR ((a BETWEEN 85 AND 87) AND a!=86) - OR a=100 - OR b=476 - ORDER BY a - } -} {6 13 55 82 85 87 89 94 100 scan 0 sort 0} -do_test where7-2.809.2 { - count_steps { - SELECT a FROM t3 - WHERE b=902 - OR a=89 - OR (d>=94.0 AND d<95.0 AND d NOT NULL) - OR c=34034 - OR b=605 - OR b=143 - OR b=1004 - OR (g='xwvutsr' AND f GLOB 'ghijk*') - OR ((a BETWEEN 85 AND 87) AND a!=86) - OR a=100 - OR b=476 - ORDER BY a - } -} {6 13 55 82 85 87 89 94 100 scan 0 sort 0} -do_test where7-2.810.1 { - count_steps { - SELECT a FROM t2 - WHERE c=5005 - OR b=839 - OR a=19 - OR b=539 - OR (d>=77.0 AND d<78.0 AND d NOT NULL) - ORDER BY a - } -} {13 14 15 19 49 77 scan 0 sort 0} -do_test where7-2.810.2 { - count_steps { - SELECT a FROM t3 - WHERE c=5005 - OR b=839 - OR a=19 - OR b=539 - OR (d>=77.0 AND d<78.0 AND d NOT NULL) - ORDER BY a - } -} {13 14 15 19 49 77 scan 0 sort 0} -do_test where7-2.811.1 { - count_steps { - SELECT a FROM t2 - WHERE c=31031 - OR (d>=54.0 AND d<55.0 AND d NOT NULL) - ORDER BY a - } -} {54 91 92 93 scan 0 sort 0} -do_test where7-2.811.2 { - count_steps { - SELECT a FROM t3 - WHERE c=31031 - OR (d>=54.0 AND d<55.0 AND d NOT NULL) - ORDER BY a - } -} {54 91 92 93 scan 0 sort 0} -do_test where7-2.812.1 { - count_steps { - SELECT a FROM t2 - WHERE f='ghijklmno' - OR c=13013 - OR (d>=26.0 AND d<27.0 AND d NOT NULL) - OR b=242 - OR b=1081 - OR f='tuvwxyzab' - OR a=12 - OR ((a BETWEEN 80 AND 82) AND a!=81) - OR (g='srqponm' AND f GLOB 'cdefg*') - ORDER BY a - } -} {6 12 19 22 26 28 32 37 38 39 45 58 71 80 82 84 97 scan 0 sort 0} -do_test where7-2.812.2 { - count_steps { - SELECT a FROM t3 - WHERE f='ghijklmno' - OR c=13013 - OR (d>=26.0 AND d<27.0 AND d NOT NULL) - OR b=242 - OR b=1081 - OR f='tuvwxyzab' - OR a=12 - OR ((a BETWEEN 80 AND 82) AND a!=81) - OR (g='srqponm' AND f GLOB 'cdefg*') - ORDER BY a - } -} {6 12 19 22 26 28 32 37 38 39 45 58 71 80 82 84 97 scan 0 sort 0} -do_test where7-2.813.1 { - count_steps { - SELECT a FROM t2 - WHERE a=60 - OR (d>=17.0 AND d<18.0 AND d NOT NULL) - OR a=62 - OR (g='qponmlk' AND f GLOB 'opqrs*') - OR (g='ponmlkj' AND f GLOB 'stuvw*') - OR (d>=4.0 AND d<5.0 AND d NOT NULL) - OR (g='tsrqpon' AND f GLOB 'yzabc*') - OR a=22 - OR (g='utsrqpo' AND f GLOB 'vwxyz*') - ORDER BY a - } -} {4 17 21 22 24 40 44 60 62 scan 0 sort 0} -do_test where7-2.813.2 { - count_steps { - SELECT a FROM t3 - WHERE a=60 - OR (d>=17.0 AND d<18.0 AND d NOT NULL) - OR a=62 - OR (g='qponmlk' AND f GLOB 'opqrs*') - OR (g='ponmlkj' AND f GLOB 'stuvw*') - OR (d>=4.0 AND d<5.0 AND d NOT NULL) - OR (g='tsrqpon' AND f GLOB 'yzabc*') - OR a=22 - OR (g='utsrqpo' AND f GLOB 'vwxyz*') - ORDER BY a - } -} {4 17 21 22 24 40 44 60 62 scan 0 sort 0} -do_test where7-2.814.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=36.0 AND d<37.0 AND d NOT NULL) - OR b=682 - ORDER BY a - } -} {36 62 scan 0 sort 0} -do_test where7-2.814.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=36.0 AND d<37.0 AND d NOT NULL) - OR b=682 - ORDER BY a - } -} {36 62 scan 0 sort 0} -do_test where7-2.815.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=16.0 AND d<17.0 AND d NOT NULL) - OR ((a BETWEEN 15 AND 17) AND a!=16) - OR a=96 - OR ((a BETWEEN 21 AND 23) AND a!=22) - ORDER BY a - } -} {15 16 17 21 23 96 scan 0 sort 0} -do_test where7-2.815.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=16.0 AND d<17.0 AND d NOT NULL) - OR ((a BETWEEN 15 AND 17) AND a!=16) - OR a=96 - OR ((a BETWEEN 21 AND 23) AND a!=22) - ORDER BY a - } -} {15 16 17 21 23 96 scan 0 sort 0} -do_test where7-2.816.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=58.0 AND d<59.0 AND d NOT NULL) - OR ((a BETWEEN 17 AND 19) AND a!=18) - OR a=21 - OR b=322 - OR b=179 - OR (g='ponmlkj' AND f GLOB 'rstuv*') - OR c=33033 - OR (g='mlkjihg' AND f GLOB 'jklmn*') - OR (g='xwvutsr' AND f GLOB 'efghi*') - OR (d>=95.0 AND d<96.0 AND d NOT NULL) - ORDER BY a - } -} {4 17 19 21 43 58 61 95 97 98 99 scan 0 sort 0} -do_test where7-2.816.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=58.0 AND d<59.0 AND d NOT NULL) - OR ((a BETWEEN 17 AND 19) AND a!=18) - OR a=21 - OR b=322 - OR b=179 - OR (g='ponmlkj' AND f GLOB 'rstuv*') - OR c=33033 - OR (g='mlkjihg' AND f GLOB 'jklmn*') - OR (g='xwvutsr' AND f GLOB 'efghi*') - OR (d>=95.0 AND d<96.0 AND d NOT NULL) - ORDER BY a - } -} {4 17 19 21 43 58 61 95 97 98 99 scan 0 sort 0} -do_test where7-2.817.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='fedcbaz' AND f GLOB 'stuvw*') - OR f='jklmnopqr' - OR b=1012 - OR b=597 - OR f='efghijklm' - OR b=660 - OR (d>=54.0 AND d<55.0 AND d NOT NULL) - OR c=17017 - OR a=21 - ORDER BY a - } -} {4 9 21 30 35 49 50 51 54 56 60 61 82 87 92 96 scan 0 sort 0} -do_test where7-2.817.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='fedcbaz' AND f GLOB 'stuvw*') - OR f='jklmnopqr' - OR b=1012 - OR b=597 - OR f='efghijklm' - OR b=660 - OR (d>=54.0 AND d<55.0 AND d NOT NULL) - OR c=17017 - OR a=21 - ORDER BY a - } -} {4 9 21 30 35 49 50 51 54 56 60 61 82 87 92 96 scan 0 sort 0} -do_test where7-2.818.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='srqponm' AND f GLOB 'cdefg*') - OR c=34034 - OR a=80 - ORDER BY a - } -} {28 80 100 scan 0 sort 0} -do_test where7-2.818.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='srqponm' AND f GLOB 'cdefg*') - OR c=34034 - OR a=80 - ORDER BY a - } -} {28 80 100 scan 0 sort 0} -do_test where7-2.819.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='wvutsrq' AND f GLOB 'ijklm*') - OR a=92 - OR (g='ponmlkj' AND f GLOB 'uvwxy*') - OR b=891 - OR 1000000=85.0 AND d<86.0 AND d NOT NULL) - OR (g='qponmlk' AND f GLOB 'mnopq*') - OR b=924 - OR b=564 - OR a=31 - OR (g='gfedcba' AND f GLOB 'nopqr*') - OR b=165 - ORDER BY a - } -} {15 21 31 38 55 84 85 91 scan 0 sort 0} -do_test where7-2.820.2 { - count_steps { - SELECT a FROM t3 - WHERE b=605 - OR (g='utsrqpo' AND f GLOB 'vwxyz*') - OR (d>=85.0 AND d<86.0 AND d NOT NULL) - OR (g='qponmlk' AND f GLOB 'mnopq*') - OR b=924 - OR b=564 - OR a=31 - OR (g='gfedcba' AND f GLOB 'nopqr*') - OR b=165 - ORDER BY a - } -} {15 21 31 38 55 84 85 91 scan 0 sort 0} -do_test where7-2.821.1 { - count_steps { - SELECT a FROM t2 - WHERE b=88 - OR a=35 - OR ((a BETWEEN 38 AND 40) AND a!=39) - OR b=927 - OR f='bcdefghij' - OR a=87 - OR a=48 - OR a=61 - ORDER BY a - } -} {1 8 27 35 38 40 48 53 61 79 87 scan 0 sort 0} -do_test where7-2.821.2 { - count_steps { - SELECT a FROM t3 - WHERE b=88 - OR a=35 - OR ((a BETWEEN 38 AND 40) AND a!=39) - OR b=927 - OR f='bcdefghij' - OR a=87 - OR a=48 - OR a=61 - ORDER BY a - } -} {1 8 27 35 38 40 48 53 61 79 87 scan 0 sort 0} -do_test where7-2.822.1 { - count_steps { - SELECT a FROM t2 - WHERE a=9 - OR (f GLOB '?stuv*' AND f GLOB 'rstu*') - OR ((a BETWEEN 75 AND 77) AND a!=76) - OR ((a BETWEEN 30 AND 32) AND a!=31) - OR (d>=42.0 AND d<43.0 AND d NOT NULL) - OR ((a BETWEEN 47 AND 49) AND a!=48) - OR f='vwxyzabcd' - OR ((a BETWEEN 77 AND 79) AND a!=78) - OR ((a BETWEEN 88 AND 90) AND a!=89) - ORDER BY a - } -} {9 17 21 30 32 42 43 47 49 69 73 75 77 79 88 90 95 99 scan 0 sort 0} -do_test where7-2.822.2 { - count_steps { - SELECT a FROM t3 - WHERE a=9 - OR (f GLOB '?stuv*' AND f GLOB 'rstu*') - OR ((a BETWEEN 75 AND 77) AND a!=76) - OR ((a BETWEEN 30 AND 32) AND a!=31) - OR (d>=42.0 AND d<43.0 AND d NOT NULL) - OR ((a BETWEEN 47 AND 49) AND a!=48) - OR f='vwxyzabcd' - OR ((a BETWEEN 77 AND 79) AND a!=78) - OR ((a BETWEEN 88 AND 90) AND a!=89) - ORDER BY a - } -} {9 17 21 30 32 42 43 47 49 69 73 75 77 79 88 90 95 99 scan 0 sort 0} -do_test where7-2.823.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 13 AND 15) AND a!=14) - OR b=330 - OR a=50 - OR b=748 - OR b=190 - OR f='xyzabcdef' - OR (d>=79.0 AND d<80.0 AND d NOT NULL) - ORDER BY a - } -} {13 15 23 30 49 50 68 75 79 scan 0 sort 0} -do_test where7-2.823.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 13 AND 15) AND a!=14) - OR b=330 - OR a=50 - OR b=748 - OR b=190 - OR f='xyzabcdef' - OR (d>=79.0 AND d<80.0 AND d NOT NULL) - ORDER BY a - } -} {13 15 23 30 49 50 68 75 79 scan 0 sort 0} -do_test where7-2.824.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='rqponml' AND f GLOB 'lmnop*') - OR (g='xwvutsr' AND f GLOB 'hijkl*') - OR (d>=28.0 AND d<29.0 AND d NOT NULL) - ORDER BY a - } -} {7 28 37 scan 0 sort 0} -do_test where7-2.824.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='rqponml' AND f GLOB 'lmnop*') - OR (g='xwvutsr' AND f GLOB 'hijkl*') - OR (d>=28.0 AND d<29.0 AND d NOT NULL) - ORDER BY a - } -} {7 28 37 scan 0 sort 0} -do_test where7-2.825.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 58 AND 60) AND a!=59) - OR b=608 - OR f='nopqrstuv' - OR (g='srqponm' AND f GLOB 'cdefg*') - OR (d>=2.0 AND d<3.0 AND d NOT NULL) - OR (d>=83.0 AND d<84.0 AND d NOT NULL) - OR (g='utsrqpo' AND f GLOB 'wxyza*') - OR (g='ponmlkj' AND f GLOB 'tuvwx*') - OR (d>=49.0 AND d<50.0 AND d NOT NULL) - OR f='defghijkl' - OR a=23 - ORDER BY a - } -} {2 3 13 22 23 28 29 39 45 49 55 58 60 65 81 83 91 scan 0 sort 0} -do_test where7-2.825.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 58 AND 60) AND a!=59) - OR b=608 - OR f='nopqrstuv' - OR (g='srqponm' AND f GLOB 'cdefg*') - OR (d>=2.0 AND d<3.0 AND d NOT NULL) - OR (d>=83.0 AND d<84.0 AND d NOT NULL) - OR (g='utsrqpo' AND f GLOB 'wxyza*') - OR (g='ponmlkj' AND f GLOB 'tuvwx*') - OR (d>=49.0 AND d<50.0 AND d NOT NULL) - OR f='defghijkl' - OR a=23 - ORDER BY a - } -} {2 3 13 22 23 28 29 39 45 49 55 58 60 65 81 83 91 scan 0 sort 0} -do_test where7-2.826.1 { - count_steps { - SELECT a FROM t2 - WHERE f='ijklmnopq' - OR ((a BETWEEN 26 AND 28) AND a!=27) - OR b=399 - ORDER BY a - } -} {8 26 28 34 60 86 scan 0 sort 0} -do_test where7-2.826.2 { - count_steps { - SELECT a FROM t3 - WHERE f='ijklmnopq' - OR ((a BETWEEN 26 AND 28) AND a!=27) - OR b=399 - ORDER BY a - } -} {8 26 28 34 60 86 scan 0 sort 0} -do_test where7-2.827.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='nmlkjih' AND f GLOB 'efghi*') - OR (g='nmlkjih' AND f GLOB 'bcdef*') - OR a=50 - ORDER BY a - } -} {50 53 56 scan 0 sort 0} -do_test where7-2.827.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='nmlkjih' AND f GLOB 'efghi*') - OR (g='nmlkjih' AND f GLOB 'bcdef*') - OR a=50 - ORDER BY a - } -} {50 53 56 scan 0 sort 0} -do_test where7-2.828.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='srqponm' AND f GLOB 'defgh*') - OR a=62 - OR (g='hgfedcb' AND f GLOB 'ijklm*') - ORDER BY a - } -} {29 62 86 scan 0 sort 0} -do_test where7-2.828.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='srqponm' AND f GLOB 'defgh*') - OR a=62 - OR (g='hgfedcb' AND f GLOB 'ijklm*') - ORDER BY a - } -} {29 62 86 scan 0 sort 0} -do_test where7-2.829.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 76 AND 78) AND a!=77) - OR b=682 - OR ((a BETWEEN 35 AND 37) AND a!=36) - OR f='defghijkl' - OR (g='hgfedcb' AND f GLOB 'hijkl*') - OR (d>=87.0 AND d<88.0 AND d NOT NULL) - OR ((a BETWEEN 85 AND 87) AND a!=86) - OR b=883 - OR (g='jihgfed' AND f GLOB 'zabcd*') - OR b=355 - OR (g='vutsrqp' AND f GLOB 'rstuv*') - ORDER BY a - } -} {3 17 29 35 37 55 62 76 77 78 81 85 87 scan 0 sort 0} -do_test where7-2.829.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 76 AND 78) AND a!=77) - OR b=682 - OR ((a BETWEEN 35 AND 37) AND a!=36) - OR f='defghijkl' - OR (g='hgfedcb' AND f GLOB 'hijkl*') - OR (d>=87.0 AND d<88.0 AND d NOT NULL) - OR ((a BETWEEN 85 AND 87) AND a!=86) - OR b=883 - OR (g='jihgfed' AND f GLOB 'zabcd*') - OR b=355 - OR (g='vutsrqp' AND f GLOB 'rstuv*') - ORDER BY a - } -} {3 17 29 35 37 55 62 76 77 78 81 85 87 scan 0 sort 0} -do_test where7-2.830.1 { - count_steps { - SELECT a FROM t2 - WHERE a=23 - OR b=256 - OR b=982 - OR c=16016 - ORDER BY a - } -} {23 46 47 48 scan 0 sort 0} -do_test where7-2.830.2 { - count_steps { - SELECT a FROM t3 - WHERE a=23 - OR b=256 - OR b=982 - OR c=16016 - ORDER BY a - } -} {23 46 47 48 scan 0 sort 0} -do_test where7-2.831.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='mlkjihg' AND f GLOB 'klmno*') - OR ((a BETWEEN 49 AND 51) AND a!=50) - OR ((a BETWEEN 42 AND 44) AND a!=43) - OR b=154 - OR (g='mlkjihg' AND f GLOB 'ijklm*') - OR d>1e10 - ORDER BY a - } -} {14 42 44 49 51 60 62 scan 0 sort 0} -do_test where7-2.831.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='mlkjihg' AND f GLOB 'klmno*') - OR ((a BETWEEN 49 AND 51) AND a!=50) - OR ((a BETWEEN 42 AND 44) AND a!=43) - OR b=154 - OR (g='mlkjihg' AND f GLOB 'ijklm*') - OR d>1e10 - ORDER BY a - } -} {14 42 44 49 51 60 62 scan 0 sort 0} -do_test where7-2.832.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='jihgfed' AND f GLOB 'wxyza*') - OR c=21021 - OR b=1070 - OR (g='xwvutsr' AND f GLOB 'fghij*') - OR (g='onmlkji' AND f GLOB 'wxyza*') - OR ((a BETWEEN 91 AND 93) AND a!=92) - OR b=1081 - OR c=24024 - OR ((a BETWEEN 40 AND 42) AND a!=41) - OR b=267 - ORDER BY a - } -} {5 40 42 48 61 62 63 70 71 72 74 91 93 scan 0 sort 0} -do_test where7-2.832.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='jihgfed' AND f GLOB 'wxyza*') - OR c=21021 - OR b=1070 - OR (g='xwvutsr' AND f GLOB 'fghij*') - OR (g='onmlkji' AND f GLOB 'wxyza*') - OR ((a BETWEEN 91 AND 93) AND a!=92) - OR b=1081 - OR c=24024 - OR ((a BETWEEN 40 AND 42) AND a!=41) - OR b=267 - ORDER BY a - } -} {5 40 42 48 61 62 63 70 71 72 74 91 93 scan 0 sort 0} -do_test where7-2.833.1 { - count_steps { - SELECT a FROM t2 - WHERE a=31 - OR a=65 - OR a=76 - ORDER BY a - } -} {31 65 76 scan 0 sort 1} -do_test where7-2.833.2 { - count_steps { - SELECT a FROM t3 - WHERE a=31 - OR a=65 - OR a=76 - ORDER BY a - } -} {31 65 76 scan 0 sort 1} -do_test where7-2.834.1 { - count_steps { - SELECT a FROM t2 - WHERE b=154 - OR b=187 - OR (g='hgfedcb' AND f GLOB 'hijkl*') - OR a=10 - OR b=267 - OR ((a BETWEEN 60 AND 62) AND a!=61) - OR b=135 - OR b=157 - ORDER BY a - } -} {10 14 17 60 62 85 scan 0 sort 0} -do_test where7-2.834.2 { - count_steps { - SELECT a FROM t3 - WHERE b=154 - OR b=187 - OR (g='hgfedcb' AND f GLOB 'hijkl*') - OR a=10 - OR b=267 - OR ((a BETWEEN 60 AND 62) AND a!=61) - OR b=135 - OR b=157 - ORDER BY a - } -} {10 14 17 60 62 85 scan 0 sort 0} -do_test where7-2.835.1 { - count_steps { - SELECT a FROM t2 - WHERE a=87 - OR b=828 - OR b=333 - ORDER BY a - } -} {87 scan 0 sort 0} -do_test where7-2.835.2 { - count_steps { - SELECT a FROM t3 - WHERE a=87 - OR b=828 - OR b=333 - ORDER BY a - } -} {87 scan 0 sort 0} -do_test where7-2.836.1 { - count_steps { - SELECT a FROM t2 - WHERE f='pqrstuvwx' - OR ((a BETWEEN 61 AND 63) AND a!=62) - OR a=44 - OR b=770 - OR (g='rqponml' AND f GLOB 'ijklm*') - OR f='defghijkl' - ORDER BY a - } -} {3 15 29 34 41 44 55 61 63 67 70 81 93 scan 0 sort 0} -do_test where7-2.836.2 { - count_steps { - SELECT a FROM t3 - WHERE f='pqrstuvwx' - OR ((a BETWEEN 61 AND 63) AND a!=62) - OR a=44 - OR b=770 - OR (g='rqponml' AND f GLOB 'ijklm*') - OR f='defghijkl' - ORDER BY a - } -} {3 15 29 34 41 44 55 61 63 67 70 81 93 scan 0 sort 0} -do_test where7-2.837.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=40.0 AND d<41.0 AND d NOT NULL) - OR ((a BETWEEN 17 AND 19) AND a!=18) - OR f='jklmnopqr' - OR b=630 - OR f='fghijklmn' - OR a=55 - OR (d>=2.0 AND d<3.0 AND d NOT NULL) - ORDER BY a - } -} {2 5 9 17 19 31 35 40 55 57 61 83 87 scan 0 sort 0} -do_test where7-2.837.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=40.0 AND d<41.0 AND d NOT NULL) - OR ((a BETWEEN 17 AND 19) AND a!=18) - OR f='jklmnopqr' - OR b=630 - OR f='fghijklmn' - OR a=55 - OR (d>=2.0 AND d<3.0 AND d NOT NULL) - ORDER BY a - } -} {2 5 9 17 19 31 35 40 55 57 61 83 87 scan 0 sort 0} -do_test where7-2.838.1 { - count_steps { - SELECT a FROM t2 - WHERE b=308 - OR ((a BETWEEN 9 AND 11) AND a!=10) - OR c=20020 - OR b=146 - OR ((a BETWEEN 61 AND 63) AND a!=62) - OR (g='kjihgfe' AND f GLOB 'rstuv*') - OR ((a BETWEEN 15 AND 17) AND a!=16) - OR b=924 - OR (g='rqponml' AND f GLOB 'jklmn*') - OR b=1012 - OR (g='srqponm' AND f GLOB 'cdefg*') - ORDER BY a - } -} {9 11 15 17 28 35 58 59 60 61 63 69 84 92 scan 0 sort 0} -do_test where7-2.838.2 { - count_steps { - SELECT a FROM t3 - WHERE b=308 - OR ((a BETWEEN 9 AND 11) AND a!=10) - OR c=20020 - OR b=146 - OR ((a BETWEEN 61 AND 63) AND a!=62) - OR (g='kjihgfe' AND f GLOB 'rstuv*') - OR ((a BETWEEN 15 AND 17) AND a!=16) - OR b=924 - OR (g='rqponml' AND f GLOB 'jklmn*') - OR b=1012 - OR (g='srqponm' AND f GLOB 'cdefg*') - ORDER BY a - } -} {9 11 15 17 28 35 58 59 60 61 63 69 84 92 scan 0 sort 0} -do_test where7-2.839.1 { - count_steps { - SELECT a FROM t2 - WHERE c=28028 - OR a=25 - OR (g='lkjihgf' AND f GLOB 'pqrst*') - OR (g='vutsrqp' AND f GLOB 'rstuv*') - OR b=627 - OR ((a BETWEEN 49 AND 51) AND a!=50) - OR ((a BETWEEN 92 AND 94) AND a!=93) - OR a=49 - OR b=55 - OR (d>=46.0 AND d<47.0 AND d NOT NULL) - OR b=517 - ORDER BY a - } -} {5 17 25 46 47 49 51 57 67 82 83 84 92 94 scan 0 sort 0} -do_test where7-2.839.2 { - count_steps { - SELECT a FROM t3 - WHERE c=28028 - OR a=25 - OR (g='lkjihgf' AND f GLOB 'pqrst*') - OR (g='vutsrqp' AND f GLOB 'rstuv*') - OR b=627 - OR ((a BETWEEN 49 AND 51) AND a!=50) - OR ((a BETWEEN 92 AND 94) AND a!=93) - OR a=49 - OR b=55 - OR (d>=46.0 AND d<47.0 AND d NOT NULL) - OR b=517 - ORDER BY a - } -} {5 17 25 46 47 49 51 57 67 82 83 84 92 94 scan 0 sort 0} -do_test where7-2.840.1 { - count_steps { - SELECT a FROM t2 - WHERE c=17017 - OR (g='lkjihgf' AND f GLOB 'opqrs*') - OR (g='hgfedcb' AND f GLOB 'jklmn*') - ORDER BY a - } -} {49 50 51 66 87 scan 0 sort 0} -do_test where7-2.840.2 { - count_steps { - SELECT a FROM t3 - WHERE c=17017 - OR (g='lkjihgf' AND f GLOB 'opqrs*') - OR (g='hgfedcb' AND f GLOB 'jklmn*') - ORDER BY a - } -} {49 50 51 66 87 scan 0 sort 0} -do_test where7-2.841.1 { - count_steps { - SELECT a FROM t2 - WHERE a=53 - OR b=11 - OR ((a BETWEEN 50 AND 52) AND a!=51) - OR a=48 - OR (g='xwvutsr' AND f GLOB 'defgh*') - OR (d>=65.0 AND d<66.0 AND d NOT NULL) - OR (d>=38.0 AND d<39.0 AND d NOT NULL) - ORDER BY a - } -} {1 3 38 48 50 52 53 65 scan 0 sort 0} -do_test where7-2.841.2 { - count_steps { - SELECT a FROM t3 - WHERE a=53 - OR b=11 - OR ((a BETWEEN 50 AND 52) AND a!=51) - OR a=48 - OR (g='xwvutsr' AND f GLOB 'defgh*') - OR (d>=65.0 AND d<66.0 AND d NOT NULL) - OR (d>=38.0 AND d<39.0 AND d NOT NULL) - ORDER BY a - } -} {1 3 38 48 50 52 53 65 scan 0 sort 0} -do_test where7-2.842.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 91 AND 93) AND a!=92) - OR b=663 - OR b=608 - OR ((a BETWEEN 76 AND 78) AND a!=77) - OR b=363 - OR (d>=83.0 AND d<84.0 AND d NOT NULL) - OR (g='jihgfed' AND f GLOB 'yzabc*') - OR (g='nmlkjih' AND f GLOB 'efghi*') - OR ((a BETWEEN 39 AND 41) AND a!=40) - OR d>1e10 - ORDER BY a - } -} {33 39 41 56 76 78 83 91 93 scan 0 sort 0} -do_test where7-2.842.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 91 AND 93) AND a!=92) - OR b=663 - OR b=608 - OR ((a BETWEEN 76 AND 78) AND a!=77) - OR b=363 - OR (d>=83.0 AND d<84.0 AND d NOT NULL) - OR (g='jihgfed' AND f GLOB 'yzabc*') - OR (g='nmlkjih' AND f GLOB 'efghi*') - OR ((a BETWEEN 39 AND 41) AND a!=40) - OR d>1e10 - ORDER BY a - } -} {33 39 41 56 76 78 83 91 93 scan 0 sort 0} -do_test where7-2.843.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=40.0 AND d<41.0 AND d NOT NULL) - OR b=443 - OR (f GLOB '?rstu*' AND f GLOB 'qrst*') - OR (g='nmlkjih' AND f GLOB 'fghij*') - OR b=14 - OR b=1001 - OR b=209 - OR (d>=97.0 AND d<98.0 AND d NOT NULL) - OR b=407 - ORDER BY a - } -} {16 19 37 40 42 57 68 91 94 97 scan 0 sort 0} -do_test where7-2.843.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=40.0 AND d<41.0 AND d NOT NULL) - OR b=443 - OR (f GLOB '?rstu*' AND f GLOB 'qrst*') - OR (g='nmlkjih' AND f GLOB 'fghij*') - OR b=14 - OR b=1001 - OR b=209 - OR (d>=97.0 AND d<98.0 AND d NOT NULL) - OR b=407 - ORDER BY a - } -} {16 19 37 40 42 57 68 91 94 97 scan 0 sort 0} -do_test where7-2.844.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=57.0 AND d<58.0 AND d NOT NULL) - OR (g='onmlkji' AND f GLOB 'wxyza*') - OR b=99 - ORDER BY a - } -} {9 48 57 scan 0 sort 0} -do_test where7-2.844.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=57.0 AND d<58.0 AND d NOT NULL) - OR (g='onmlkji' AND f GLOB 'wxyza*') - OR b=99 - ORDER BY a - } -} {9 48 57 scan 0 sort 0} -do_test where7-2.845.1 { - count_steps { - SELECT a FROM t2 - WHERE b=561 - OR (d>=94.0 AND d<95.0 AND d NOT NULL) - OR (g='gfedcba' AND f GLOB 'nopqr*') - OR b=275 - OR (g='vutsrqp' AND f GLOB 'nopqr*') - OR a=95 - ORDER BY a - } -} {13 25 51 91 94 95 scan 0 sort 0} -do_test where7-2.845.2 { - count_steps { - SELECT a FROM t3 - WHERE b=561 - OR (d>=94.0 AND d<95.0 AND d NOT NULL) - OR (g='gfedcba' AND f GLOB 'nopqr*') - OR b=275 - OR (g='vutsrqp' AND f GLOB 'nopqr*') - OR a=95 - ORDER BY a - } -} {13 25 51 91 94 95 scan 0 sort 0} -do_test where7-2.846.1 { - count_steps { - SELECT a FROM t2 - WHERE b=44 - OR b=902 - OR b=946 - OR ((a BETWEEN 31 AND 33) AND a!=32) - OR (g='jihgfed' AND f GLOB 'zabcd*') - OR (g='vutsrqp' AND f GLOB 'opqrs*') - OR (d>=71.0 AND d<72.0 AND d NOT NULL) - OR b=792 - OR (g='vutsrqp' AND f GLOB 'rstuv*') - OR (g='gfedcba' AND f GLOB 'opqrs*') - ORDER BY a - } -} {4 14 17 31 33 71 72 77 82 86 92 scan 0 sort 0} -do_test where7-2.846.2 { - count_steps { - SELECT a FROM t3 - WHERE b=44 - OR b=902 - OR b=946 - OR ((a BETWEEN 31 AND 33) AND a!=32) - OR (g='jihgfed' AND f GLOB 'zabcd*') - OR (g='vutsrqp' AND f GLOB 'opqrs*') - OR (d>=71.0 AND d<72.0 AND d NOT NULL) - OR b=792 - OR (g='vutsrqp' AND f GLOB 'rstuv*') - OR (g='gfedcba' AND f GLOB 'opqrs*') - ORDER BY a - } -} {4 14 17 31 33 71 72 77 82 86 92 scan 0 sort 0} -do_test where7-2.847.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 66 AND 68) AND a!=67) - OR b=22 - OR c=9009 - OR b=616 - OR (f GLOB '?hijk*' AND f GLOB 'ghij*') - ORDER BY a - } -} {2 6 25 26 27 32 56 58 66 68 84 scan 0 sort 0} -do_test where7-2.847.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 66 AND 68) AND a!=67) - OR b=22 - OR c=9009 - OR b=616 - OR (f GLOB '?hijk*' AND f GLOB 'ghij*') - ORDER BY a - } -} {2 6 25 26 27 32 56 58 66 68 84 scan 0 sort 0} -do_test where7-2.848.1 { - count_steps { - SELECT a FROM t2 - WHERE b=858 - OR a=59 - OR b=242 - OR ((a BETWEEN 42 AND 44) AND a!=43) - ORDER BY a - } -} {22 42 44 59 78 scan 0 sort 0} -do_test where7-2.848.2 { - count_steps { - SELECT a FROM t3 - WHERE b=858 - OR a=59 - OR b=242 - OR ((a BETWEEN 42 AND 44) AND a!=43) - ORDER BY a - } -} {22 42 44 59 78 scan 0 sort 0} -do_test where7-2.849.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='edcbazy' AND f GLOB 'vwxyz*') - OR a=84 - OR a=1 - OR c=16016 - OR ((a BETWEEN 60 AND 62) AND a!=61) - OR ((a BETWEEN 14 AND 16) AND a!=15) - OR (d>=7.0 AND d<8.0 AND d NOT NULL) - OR (g='fedcbaz' AND f GLOB 'rstuv*') - OR 1000000=7.0 AND d<8.0 AND d NOT NULL) - OR (g='fedcbaz' AND f GLOB 'rstuv*') - OR 1000000=61.0 AND d<62.0 AND d NOT NULL) - OR (g='qponmlk' AND f GLOB 'pqrst*') - OR b=418 - OR b=748 - OR ((a BETWEEN 42 AND 44) AND a!=43) - OR a=60 - OR ((a BETWEEN 43 AND 45) AND a!=44) - OR a=81 - ORDER BY a - } -} {38 41 42 43 44 45 60 61 68 81 scan 0 sort 0} -do_test where7-2.850.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=61.0 AND d<62.0 AND d NOT NULL) - OR (g='qponmlk' AND f GLOB 'pqrst*') - OR b=418 - OR b=748 - OR ((a BETWEEN 42 AND 44) AND a!=43) - OR a=60 - OR ((a BETWEEN 43 AND 45) AND a!=44) - OR a=81 - ORDER BY a - } -} {38 41 42 43 44 45 60 61 68 81 scan 0 sort 0} -do_test where7-2.851.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=75.0 AND d<76.0 AND d NOT NULL) - OR (g='lkjihgf' AND f GLOB 'pqrst*') - OR b=44 - OR ((a BETWEEN 79 AND 81) AND a!=80) - OR b=737 - OR (d>=12.0 AND d<13.0 AND d NOT NULL) - OR (d>=11.0 AND d<12.0 AND d NOT NULL) - OR f='lmnopqrst' - OR (g='utsrqpo' AND f GLOB 'stuvw*') - ORDER BY a - } -} {4 11 12 18 37 63 67 75 79 81 89 scan 0 sort 0} -do_test where7-2.851.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=75.0 AND d<76.0 AND d NOT NULL) - OR (g='lkjihgf' AND f GLOB 'pqrst*') - OR b=44 - OR ((a BETWEEN 79 AND 81) AND a!=80) - OR b=737 - OR (d>=12.0 AND d<13.0 AND d NOT NULL) - OR (d>=11.0 AND d<12.0 AND d NOT NULL) - OR f='lmnopqrst' - OR (g='utsrqpo' AND f GLOB 'stuvw*') - ORDER BY a - } -} {4 11 12 18 37 63 67 75 79 81 89 scan 0 sort 0} -do_test where7-2.852.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=62.0 AND d<63.0 AND d NOT NULL) - OR (g='lkjihgf' AND f GLOB 'mnopq*') - OR b=938 - OR a=72 - OR (d>=41.0 AND d<42.0 AND d NOT NULL) - OR (g='gfedcba' AND f GLOB 'opqrs*') - ORDER BY a - } -} {41 62 64 72 92 scan 0 sort 0} -do_test where7-2.852.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=62.0 AND d<63.0 AND d NOT NULL) - OR (g='lkjihgf' AND f GLOB 'mnopq*') - OR b=938 - OR a=72 - OR (d>=41.0 AND d<42.0 AND d NOT NULL) - OR (g='gfedcba' AND f GLOB 'opqrs*') - ORDER BY a - } -} {41 62 64 72 92 scan 0 sort 0} -do_test where7-2.853.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='jihgfed' AND f GLOB 'yzabc*') - OR b=905 - OR (f GLOB '?tuvw*' AND f GLOB 'stuv*') - OR b=707 - OR b=146 - OR f='lmnopqrst' - ORDER BY a - } -} {11 18 37 44 63 70 76 89 96 scan 0 sort 0} -do_test where7-2.853.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='jihgfed' AND f GLOB 'yzabc*') - OR b=905 - OR (f GLOB '?tuvw*' AND f GLOB 'stuv*') - OR b=707 - OR b=146 - OR f='lmnopqrst' - ORDER BY a - } -} {11 18 37 44 63 70 76 89 96 scan 0 sort 0} -do_test where7-2.854.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=39.0 AND d<40.0 AND d NOT NULL) - OR b=839 - OR c=10010 - OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') - OR c=8008 - OR ((a BETWEEN 65 AND 67) AND a!=66) - OR b=275 - OR ((a BETWEEN 16 AND 18) AND a!=17) - ORDER BY a - } -} {8 16 18 22 23 24 25 28 29 30 34 39 60 65 67 86 scan 0 sort 0} -do_test where7-2.854.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=39.0 AND d<40.0 AND d NOT NULL) - OR b=839 - OR c=10010 - OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') - OR c=8008 - OR ((a BETWEEN 65 AND 67) AND a!=66) - OR b=275 - OR ((a BETWEEN 16 AND 18) AND a!=17) - ORDER BY a - } -} {8 16 18 22 23 24 25 28 29 30 34 39 60 65 67 86 scan 0 sort 0} -do_test where7-2.855.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=4.0 AND d<5.0 AND d NOT NULL) - OR b=190 - OR b=715 - OR ((a BETWEEN 65 AND 67) AND a!=66) - OR b=36 - OR b=465 - OR (d>=46.0 AND d<47.0 AND d NOT NULL) - ORDER BY a - } -} {4 46 65 67 scan 0 sort 0} -do_test where7-2.855.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=4.0 AND d<5.0 AND d NOT NULL) - OR b=190 - OR b=715 - OR ((a BETWEEN 65 AND 67) AND a!=66) - OR b=36 - OR b=465 - OR (d>=46.0 AND d<47.0 AND d NOT NULL) - ORDER BY a - } -} {4 46 65 67 scan 0 sort 0} -do_test where7-2.856.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=52.0 AND d<53.0 AND d NOT NULL) - OR (g='lkjihgf' AND f GLOB 'nopqr*') - OR (g='onmlkji' AND f GLOB 'abcde*') - OR ((a BETWEEN 67 AND 69) AND a!=68) - OR b=883 - OR (d>=26.0 AND d<27.0 AND d NOT NULL) - OR a=37 - OR b=968 - OR b=374 - OR (d>=31.0 AND d<32.0 AND d NOT NULL) - OR a=83 - ORDER BY a - } -} {26 31 34 37 52 65 67 69 83 88 scan 0 sort 0} -do_test where7-2.856.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=52.0 AND d<53.0 AND d NOT NULL) - OR (g='lkjihgf' AND f GLOB 'nopqr*') - OR (g='onmlkji' AND f GLOB 'abcde*') - OR ((a BETWEEN 67 AND 69) AND a!=68) - OR b=883 - OR (d>=26.0 AND d<27.0 AND d NOT NULL) - OR a=37 - OR b=968 - OR b=374 - OR (d>=31.0 AND d<32.0 AND d NOT NULL) - OR a=83 - ORDER BY a - } -} {26 31 34 37 52 65 67 69 83 88 scan 0 sort 0} -do_test where7-2.857.1 { - count_steps { - SELECT a FROM t2 - WHERE b=971 - OR f='abcdefghi' - OR b=308 - OR f='ghijklmno' - OR (f GLOB '?xyza*' AND f GLOB 'wxyz*') - OR b=443 - OR b=355 - OR a=40 - OR (g='yxwvuts' AND f GLOB 'cdefg*') - OR b=113 - OR b=363 - ORDER BY a - } -} {2 6 22 26 28 32 33 40 48 52 58 74 78 84 100 scan 0 sort 0} -do_test where7-2.857.2 { - count_steps { - SELECT a FROM t3 - WHERE b=971 - OR f='abcdefghi' - OR b=308 - OR f='ghijklmno' - OR (f GLOB '?xyza*' AND f GLOB 'wxyz*') - OR b=443 - OR b=355 - OR a=40 - OR (g='yxwvuts' AND f GLOB 'cdefg*') - OR b=113 - OR b=363 - ORDER BY a - } -} {2 6 22 26 28 32 33 40 48 52 58 74 78 84 100 scan 0 sort 0} -do_test where7-2.858.1 { - count_steps { - SELECT a FROM t2 - WHERE b=286 - OR (d>=99.0 AND d<100.0 AND d NOT NULL) - ORDER BY a - } -} {26 99 scan 0 sort 0} -do_test where7-2.858.2 { - count_steps { - SELECT a FROM t3 - WHERE b=286 - OR (d>=99.0 AND d<100.0 AND d NOT NULL) - ORDER BY a - } -} {26 99 scan 0 sort 0} -do_test where7-2.859.1 { - count_steps { - SELECT a FROM t2 - WHERE b=740 - OR b=957 - OR ((a BETWEEN 51 AND 53) AND a!=52) - OR (g='tsrqpon' AND f GLOB 'xyzab*') - OR a=8 - ORDER BY a - } -} {8 23 51 53 87 scan 0 sort 0} -do_test where7-2.859.2 { - count_steps { - SELECT a FROM t3 - WHERE b=740 - OR b=957 - OR ((a BETWEEN 51 AND 53) AND a!=52) - OR (g='tsrqpon' AND f GLOB 'xyzab*') - OR a=8 - ORDER BY a - } -} {8 23 51 53 87 scan 0 sort 0} -do_test where7-2.860.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=2.0 AND d<3.0 AND d NOT NULL) - OR a=59 - OR (d>=34.0 AND d<35.0 AND d NOT NULL) - OR b=781 - OR ((a BETWEEN 55 AND 57) AND a!=56) - OR ((a BETWEEN 70 AND 72) AND a!=71) - OR ((a BETWEEN 21 AND 23) AND a!=22) - OR b=146 - OR (d>=22.0 AND d<23.0 AND d NOT NULL) - ORDER BY a - } -} {2 21 22 23 34 55 57 59 70 71 72 scan 0 sort 0} -do_test where7-2.860.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=2.0 AND d<3.0 AND d NOT NULL) - OR a=59 - OR (d>=34.0 AND d<35.0 AND d NOT NULL) - OR b=781 - OR ((a BETWEEN 55 AND 57) AND a!=56) - OR ((a BETWEEN 70 AND 72) AND a!=71) - OR ((a BETWEEN 21 AND 23) AND a!=22) - OR b=146 - OR (d>=22.0 AND d<23.0 AND d NOT NULL) - ORDER BY a - } -} {2 21 22 23 34 55 57 59 70 71 72 scan 0 sort 0} -do_test where7-2.861.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=25.0 AND d<26.0 AND d NOT NULL) - OR c=8008 - OR ((a BETWEEN 30 AND 32) AND a!=31) - OR f='stuvwxyza' - OR (d>=8.0 AND d<9.0 AND d NOT NULL) - OR (g='lkjihgf' AND f GLOB 'nopqr*') - OR a=17 - ORDER BY a - } -} {8 17 18 22 23 24 25 30 32 44 65 70 96 scan 0 sort 0} -do_test where7-2.861.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=25.0 AND d<26.0 AND d NOT NULL) - OR c=8008 - OR ((a BETWEEN 30 AND 32) AND a!=31) - OR f='stuvwxyza' - OR (d>=8.0 AND d<9.0 AND d NOT NULL) - OR (g='lkjihgf' AND f GLOB 'nopqr*') - OR a=17 - ORDER BY a - } -} {8 17 18 22 23 24 25 30 32 44 65 70 96 scan 0 sort 0} -do_test where7-2.862.1 { - count_steps { - SELECT a FROM t2 - WHERE a=9 - OR b=352 - OR (g='ponmlkj' AND f GLOB 'stuvw*') - OR b=781 - ORDER BY a - } -} {9 32 44 71 scan 0 sort 0} -do_test where7-2.862.2 { - count_steps { - SELECT a FROM t3 - WHERE a=9 - OR b=352 - OR (g='ponmlkj' AND f GLOB 'stuvw*') - OR b=781 - ORDER BY a - } -} {9 32 44 71 scan 0 sort 0} -do_test where7-2.863.1 { - count_steps { - SELECT a FROM t2 - WHERE a=19 - OR c=9009 - OR (f GLOB '?opqr*' AND f GLOB 'nopq*') - OR a=8 - OR (g='nmlkjih' AND f GLOB 'efghi*') - OR b=473 - ORDER BY a - } -} {8 13 19 25 26 27 39 43 56 65 91 scan 0 sort 0} -do_test where7-2.863.2 { - count_steps { - SELECT a FROM t3 - WHERE a=19 - OR c=9009 - OR (f GLOB '?opqr*' AND f GLOB 'nopq*') - OR a=8 - OR (g='nmlkjih' AND f GLOB 'efghi*') - OR b=473 - ORDER BY a - } -} {8 13 19 25 26 27 39 43 56 65 91 scan 0 sort 0} -do_test where7-2.864.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='wvutsrq' AND f GLOB 'mnopq*') - OR a=73 - OR (d>=19.0 AND d<20.0 AND d NOT NULL) - OR (d>=89.0 AND d<90.0 AND d NOT NULL) - OR b=938 - OR (g='qponmlk' AND f GLOB 'mnopq*') - OR (g='wvutsrq' AND f GLOB 'klmno*') - OR ((a BETWEEN 69 AND 71) AND a!=70) - OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') - OR b=44 - OR (d>=54.0 AND d<55.0 AND d NOT NULL) - ORDER BY a - } -} {4 7 10 12 19 33 38 54 59 69 71 73 85 89 scan 0 sort 0} -do_test where7-2.864.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='wvutsrq' AND f GLOB 'mnopq*') - OR a=73 - OR (d>=19.0 AND d<20.0 AND d NOT NULL) - OR (d>=89.0 AND d<90.0 AND d NOT NULL) - OR b=938 - OR (g='qponmlk' AND f GLOB 'mnopq*') - OR (g='wvutsrq' AND f GLOB 'klmno*') - OR ((a BETWEEN 69 AND 71) AND a!=70) - OR (f GLOB '?ijkl*' AND f GLOB 'hijk*') - OR b=44 - OR (d>=54.0 AND d<55.0 AND d NOT NULL) - ORDER BY a - } -} {4 7 10 12 19 33 38 54 59 69 71 73 85 89 scan 0 sort 0} -do_test where7-2.865.1 { - count_steps { - SELECT a FROM t2 - WHERE c<=10 - OR 1000000=25.0 AND d<26.0 AND d NOT NULL) - OR b=619 - ORDER BY a - } -} {25 70 scan 0 sort 0} -do_test where7-2.865.2 { - count_steps { - SELECT a FROM t3 - WHERE c<=10 - OR 1000000=25.0 AND d<26.0 AND d NOT NULL) - OR b=619 - ORDER BY a - } -} {25 70 scan 0 sort 0} -do_test where7-2.866.1 { - count_steps { - SELECT a FROM t2 - WHERE b=55 - OR c<=10 - OR a=91 - OR b=146 - OR ((a BETWEEN 44 AND 46) AND a!=45) - OR (d>=51.0 AND d<52.0 AND d NOT NULL) - OR a=90 - OR a=59 - OR (d>=93.0 AND d<94.0 AND d NOT NULL) - OR a=19 - OR c=34034 - ORDER BY a - } -} {5 19 44 46 51 59 90 91 93 100 scan 0 sort 0} -do_test where7-2.866.2 { - count_steps { - SELECT a FROM t3 - WHERE b=55 - OR c<=10 - OR a=91 - OR b=146 - OR ((a BETWEEN 44 AND 46) AND a!=45) - OR (d>=51.0 AND d<52.0 AND d NOT NULL) - OR a=90 - OR a=59 - OR (d>=93.0 AND d<94.0 AND d NOT NULL) - OR a=19 - OR c=34034 - ORDER BY a - } -} {5 19 44 46 51 59 90 91 93 100 scan 0 sort 0} -do_test where7-2.867.1 { - count_steps { - SELECT a FROM t2 - WHERE c=28028 - OR f='mnopqrstu' - ORDER BY a - } -} {12 38 64 82 83 84 90 scan 0 sort 0} -do_test where7-2.867.2 { - count_steps { - SELECT a FROM t3 - WHERE c=28028 - OR f='mnopqrstu' - ORDER BY a - } -} {12 38 64 82 83 84 90 scan 0 sort 0} -do_test where7-2.868.1 { - count_steps { - SELECT a FROM t2 - WHERE b=839 - OR b=627 - OR b=113 - OR (d>=4.0 AND d<5.0 AND d NOT NULL) - OR ((a BETWEEN 32 AND 34) AND a!=33) - OR c=16016 - OR (g='nmlkjih' AND f GLOB 'efghi*') - OR f='yzabcdefg' - OR b=451 - ORDER BY a - } -} {4 24 32 34 41 46 47 48 50 56 57 76 scan 0 sort 0} -do_test where7-2.868.2 { - count_steps { - SELECT a FROM t3 - WHERE b=839 - OR b=627 - OR b=113 - OR (d>=4.0 AND d<5.0 AND d NOT NULL) - OR ((a BETWEEN 32 AND 34) AND a!=33) - OR c=16016 - OR (g='nmlkjih' AND f GLOB 'efghi*') - OR f='yzabcdefg' - OR b=451 - ORDER BY a - } -} {4 24 32 34 41 46 47 48 50 56 57 76 scan 0 sort 0} -do_test where7-2.869.1 { - count_steps { - SELECT a FROM t2 - WHERE a=42 - OR b=674 - OR ((a BETWEEN 89 AND 91) AND a!=90) - OR ((a BETWEEN 30 AND 32) AND a!=31) - ORDER BY a - } -} {30 32 42 89 91 scan 0 sort 0} -do_test where7-2.869.2 { - count_steps { - SELECT a FROM t3 - WHERE a=42 - OR b=674 - OR ((a BETWEEN 89 AND 91) AND a!=90) - OR ((a BETWEEN 30 AND 32) AND a!=31) - ORDER BY a - } -} {30 32 42 89 91 scan 0 sort 0} -do_test where7-2.870.1 { - count_steps { - SELECT a FROM t2 - WHERE b=715 - OR a=37 - ORDER BY a - } -} {37 65 scan 0 sort 0} -do_test where7-2.870.2 { - count_steps { - SELECT a FROM t3 - WHERE b=715 - OR a=37 - ORDER BY a - } -} {37 65 scan 0 sort 0} -do_test where7-2.871.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='fedcbaz' AND f GLOB 'tuvwx*') - OR b=1001 - OR ((a BETWEEN 41 AND 43) AND a!=42) - OR (f GLOB '?stuv*' AND f GLOB 'rstu*') - ORDER BY a - } -} {17 41 43 69 91 95 97 scan 0 sort 0} -do_test where7-2.871.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='fedcbaz' AND f GLOB 'tuvwx*') - OR b=1001 - OR ((a BETWEEN 41 AND 43) AND a!=42) - OR (f GLOB '?stuv*' AND f GLOB 'rstu*') - ORDER BY a - } -} {17 41 43 69 91 95 97 scan 0 sort 0} -do_test where7-2.872.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=18.0 AND d<19.0 AND d NOT NULL) - OR (g='srqponm' AND f GLOB 'defgh*') - OR (d>=7.0 AND d<8.0 AND d NOT NULL) - OR b=1048 - OR f='uvwxyzabc' - OR b=685 - ORDER BY a - } -} {7 18 20 29 46 72 98 scan 0 sort 0} -do_test where7-2.872.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=18.0 AND d<19.0 AND d NOT NULL) - OR (g='srqponm' AND f GLOB 'defgh*') - OR (d>=7.0 AND d<8.0 AND d NOT NULL) - OR b=1048 - OR f='uvwxyzabc' - OR b=685 - ORDER BY a - } -} {7 18 20 29 46 72 98 scan 0 sort 0} -do_test where7-2.873.1 { - count_steps { - SELECT a FROM t2 - WHERE c=13013 - OR (g='qponmlk' AND f GLOB 'qrstu*') - OR (d>=87.0 AND d<88.0 AND d NOT NULL) - OR (g='hgfedcb' AND f GLOB 'jklmn*') - OR (g='qponmlk' AND f GLOB 'pqrst*') - OR (d>=66.0 AND d<67.0 AND d NOT NULL) - OR b=1048 - OR ((a BETWEEN 99 AND 101) AND a!=100) - ORDER BY a - } -} {37 38 39 41 42 66 87 99 scan 0 sort 0} -do_test where7-2.873.2 { - count_steps { - SELECT a FROM t3 - WHERE c=13013 - OR (g='qponmlk' AND f GLOB 'qrstu*') - OR (d>=87.0 AND d<88.0 AND d NOT NULL) - OR (g='hgfedcb' AND f GLOB 'jklmn*') - OR (g='qponmlk' AND f GLOB 'pqrst*') - OR (d>=66.0 AND d<67.0 AND d NOT NULL) - OR b=1048 - OR ((a BETWEEN 99 AND 101) AND a!=100) - ORDER BY a - } -} {37 38 39 41 42 66 87 99 scan 0 sort 0} -do_test where7-2.874.1 { - count_steps { - SELECT a FROM t2 - WHERE b=902 - OR (g='lkjihgf' AND f GLOB 'opqrs*') - OR f='uvwxyzabc' - ORDER BY a - } -} {20 46 66 72 82 98 scan 0 sort 0} -do_test where7-2.874.2 { - count_steps { - SELECT a FROM t3 - WHERE b=902 - OR (g='lkjihgf' AND f GLOB 'opqrs*') - OR f='uvwxyzabc' - ORDER BY a - } -} {20 46 66 72 82 98 scan 0 sort 0} -do_test where7-2.875.1 { - count_steps { - SELECT a FROM t2 - WHERE f='ijklmnopq' - OR ((a BETWEEN 80 AND 82) AND a!=81) - OR (d>=9.0 AND d<10.0 AND d NOT NULL) - OR a=56 - OR (d>=20.0 AND d<21.0 AND d NOT NULL) - OR (g='onmlkji' AND f GLOB 'xyzab*') - OR (g='lkjihgf' AND f GLOB 'nopqr*') - OR (d>=23.0 AND d<24.0 AND d NOT NULL) - ORDER BY a - } -} {8 9 20 23 34 49 56 60 65 80 82 86 scan 0 sort 0} -do_test where7-2.875.2 { - count_steps { - SELECT a FROM t3 - WHERE f='ijklmnopq' - OR ((a BETWEEN 80 AND 82) AND a!=81) - OR (d>=9.0 AND d<10.0 AND d NOT NULL) - OR a=56 - OR (d>=20.0 AND d<21.0 AND d NOT NULL) - OR (g='onmlkji' AND f GLOB 'xyzab*') - OR (g='lkjihgf' AND f GLOB 'nopqr*') - OR (d>=23.0 AND d<24.0 AND d NOT NULL) - ORDER BY a - } -} {8 9 20 23 34 49 56 60 65 80 82 86 scan 0 sort 0} -do_test where7-2.876.1 { - count_steps { - SELECT a FROM t2 - WHERE b=520 - OR (d>=28.0 AND d<29.0 AND d NOT NULL) - OR b=432 - OR a=44 - ORDER BY a - } -} {28 44 scan 0 sort 0} -do_test where7-2.876.2 { - count_steps { - SELECT a FROM t3 - WHERE b=520 - OR (d>=28.0 AND d<29.0 AND d NOT NULL) - OR b=432 - OR a=44 - ORDER BY a - } -} {28 44 scan 0 sort 0} -do_test where7-2.877.1 { - count_steps { - SELECT a FROM t2 - WHERE a=4 - OR ((a BETWEEN 12 AND 14) AND a!=13) - OR a=96 - OR b=979 - OR b=520 - ORDER BY a - } -} {4 12 14 89 96 scan 0 sort 0} -do_test where7-2.877.2 { - count_steps { - SELECT a FROM t3 - WHERE a=4 - OR ((a BETWEEN 12 AND 14) AND a!=13) - OR a=96 - OR b=979 - OR b=520 - ORDER BY a - } -} {4 12 14 89 96 scan 0 sort 0} -do_test where7-2.878.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 24 AND 26) AND a!=25) - OR b=1026 - OR b=465 - OR b<0 - OR ((a BETWEEN 81 AND 83) AND a!=82) - OR ((a BETWEEN 50 AND 52) AND a!=51) - OR (d>=29.0 AND d<30.0 AND d NOT NULL) - OR b=770 - OR (g='edcbazy' AND f GLOB 'uvwxy*') - OR (d>=59.0 AND d<60.0 AND d NOT NULL) - OR c=18018 - ORDER BY a - } -} {24 26 29 50 52 53 54 59 70 81 83 98 scan 0 sort 0} -do_test where7-2.878.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 24 AND 26) AND a!=25) - OR b=1026 - OR b=465 - OR b<0 - OR ((a BETWEEN 81 AND 83) AND a!=82) - OR ((a BETWEEN 50 AND 52) AND a!=51) - OR (d>=29.0 AND d<30.0 AND d NOT NULL) - OR b=770 - OR (g='edcbazy' AND f GLOB 'uvwxy*') - OR (d>=59.0 AND d<60.0 AND d NOT NULL) - OR c=18018 - ORDER BY a - } -} {24 26 29 50 52 53 54 59 70 81 83 98 scan 0 sort 0} -do_test where7-2.879.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='gfedcba' AND f GLOB 'nopqr*') - OR ((a BETWEEN 89 AND 91) AND a!=90) - OR (d>=60.0 AND d<61.0 AND d NOT NULL) - OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') - OR (g='kjihgfe' AND f GLOB 'stuvw*') - OR (g='gfedcba' AND f GLOB 'opqrs*') - ORDER BY a - } -} {8 34 60 70 86 89 91 92 scan 0 sort 0} -do_test where7-2.879.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='gfedcba' AND f GLOB 'nopqr*') - OR ((a BETWEEN 89 AND 91) AND a!=90) - OR (d>=60.0 AND d<61.0 AND d NOT NULL) - OR (f GLOB '?jklm*' AND f GLOB 'ijkl*') - OR (g='kjihgfe' AND f GLOB 'stuvw*') - OR (g='gfedcba' AND f GLOB 'opqrs*') - ORDER BY a - } -} {8 34 60 70 86 89 91 92 scan 0 sort 0} -do_test where7-2.880.1 { - count_steps { - SELECT a FROM t2 - WHERE a=100 - OR ((a BETWEEN 17 AND 19) AND a!=18) - OR b=1023 - OR (g='nmlkjih' AND f GLOB 'efghi*') - OR ((a BETWEEN 72 AND 74) AND a!=73) - OR ((a BETWEEN 78 AND 80) AND a!=79) - OR c=28028 - OR (g='utsrqpo' AND f GLOB 'vwxyz*') - ORDER BY a - } -} {17 19 21 56 72 74 78 80 82 83 84 93 100 scan 0 sort 0} -do_test where7-2.880.2 { - count_steps { - SELECT a FROM t3 - WHERE a=100 - OR ((a BETWEEN 17 AND 19) AND a!=18) - OR b=1023 - OR (g='nmlkjih' AND f GLOB 'efghi*') - OR ((a BETWEEN 72 AND 74) AND a!=73) - OR ((a BETWEEN 78 AND 80) AND a!=79) - OR c=28028 - OR (g='utsrqpo' AND f GLOB 'vwxyz*') - ORDER BY a - } -} {17 19 21 56 72 74 78 80 82 83 84 93 100 scan 0 sort 0} -do_test where7-2.881.1 { - count_steps { - SELECT a FROM t2 - WHERE a=48 - OR c=32032 - OR b=1078 - ORDER BY a - } -} {48 94 95 96 98 scan 0 sort 0} -do_test where7-2.881.2 { - count_steps { - SELECT a FROM t3 - WHERE a=48 - OR c=32032 - OR b=1078 - ORDER BY a - } -} {48 94 95 96 98 scan 0 sort 0} -do_test where7-2.882.1 { - count_steps { - SELECT a FROM t2 - WHERE b=993 - OR (g='mlkjihg' AND f GLOB 'jklmn*') - OR a=96 - OR c=15015 - OR a=63 - OR ((a BETWEEN 4 AND 6) AND a!=5) - OR b=1100 - OR (g='rqponml' AND f GLOB 'jklmn*') - OR a=48 - OR (g='wvutsrq' AND f GLOB 'ijklm*') - ORDER BY a - } -} {4 6 8 35 43 44 45 48 61 63 96 100 scan 0 sort 0} -do_test where7-2.882.2 { - count_steps { - SELECT a FROM t3 - WHERE b=993 - OR (g='mlkjihg' AND f GLOB 'jklmn*') - OR a=96 - OR c=15015 - OR a=63 - OR ((a BETWEEN 4 AND 6) AND a!=5) - OR b=1100 - OR (g='rqponml' AND f GLOB 'jklmn*') - OR a=48 - OR (g='wvutsrq' AND f GLOB 'ijklm*') - ORDER BY a - } -} {4 6 8 35 43 44 45 48 61 63 96 100 scan 0 sort 0} -do_test where7-2.883.1 { - count_steps { - SELECT a FROM t2 - WHERE a=2 - OR b=1012 - OR ((a BETWEEN 83 AND 85) AND a!=84) - OR (g='lkjihgf' AND f GLOB 'mnopq*') - OR b=355 - OR ((a BETWEEN 86 AND 88) AND a!=87) - OR b=880 - OR f IS NULL - OR b=619 - OR (d>=15.0 AND d<16.0 AND d NOT NULL) - OR a=20 - ORDER BY a - } -} {2 15 20 64 80 83 85 86 88 92 scan 0 sort 0} -do_test where7-2.883.2 { - count_steps { - SELECT a FROM t3 - WHERE a=2 - OR b=1012 - OR ((a BETWEEN 83 AND 85) AND a!=84) - OR (g='lkjihgf' AND f GLOB 'mnopq*') - OR b=355 - OR ((a BETWEEN 86 AND 88) AND a!=87) - OR b=880 - OR f IS NULL - OR b=619 - OR (d>=15.0 AND d<16.0 AND d NOT NULL) - OR a=20 - ORDER BY a - } -} {2 15 20 64 80 83 85 86 88 92 scan 0 sort 0} -do_test where7-2.884.1 { - count_steps { - SELECT a FROM t2 - WHERE c=23023 - OR (d>=28.0 AND d<29.0 AND d NOT NULL) - OR (g='onmlkji' AND f GLOB 'abcde*') - OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') - OR a=16 - OR f='fghijklmn' - OR a=62 - OR (g='fedcbaz' AND f GLOB 'stuvw*') - OR ((a BETWEEN 65 AND 67) AND a!=66) - ORDER BY a - } -} {5 14 16 28 31 40 52 57 62 65 66 67 68 69 83 92 96 scan 0 sort 0} -do_test where7-2.884.2 { - count_steps { - SELECT a FROM t3 - WHERE c=23023 - OR (d>=28.0 AND d<29.0 AND d NOT NULL) - OR (g='onmlkji' AND f GLOB 'abcde*') - OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') - OR a=16 - OR f='fghijklmn' - OR a=62 - OR (g='fedcbaz' AND f GLOB 'stuvw*') - OR ((a BETWEEN 65 AND 67) AND a!=66) - ORDER BY a - } -} {5 14 16 28 31 40 52 57 62 65 66 67 68 69 83 92 96 scan 0 sort 0} -do_test where7-2.885.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='utsrqpo' AND f GLOB 'wxyza*') - OR (d>=72.0 AND d<73.0 AND d NOT NULL) - OR ((a BETWEEN 30 AND 32) AND a!=31) - OR ((a BETWEEN 63 AND 65) AND a!=64) - OR a=85 - ORDER BY a - } -} {22 30 32 63 65 72 85 scan 0 sort 0} -do_test where7-2.885.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='utsrqpo' AND f GLOB 'wxyza*') - OR (d>=72.0 AND d<73.0 AND d NOT NULL) - OR ((a BETWEEN 30 AND 32) AND a!=31) - OR ((a BETWEEN 63 AND 65) AND a!=64) - OR a=85 - ORDER BY a - } -} {22 30 32 63 65 72 85 scan 0 sort 0} -do_test where7-2.886.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='jihgfed' AND f GLOB 'xyzab*') - OR (g='edcbazy' AND f GLOB 'uvwxy*') - OR c=23023 - OR (g='edcbazy' AND f GLOB 'wxyza*') - OR a=19 - OR b=902 - ORDER BY a - } -} {19 67 68 69 75 82 98 100 scan 0 sort 0} -do_test where7-2.886.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='jihgfed' AND f GLOB 'xyzab*') - OR (g='edcbazy' AND f GLOB 'uvwxy*') - OR c=23023 - OR (g='edcbazy' AND f GLOB 'wxyza*') - OR a=19 - OR b=902 - ORDER BY a - } -} {19 67 68 69 75 82 98 100 scan 0 sort 0} -do_test where7-2.887.1 { - count_steps { - SELECT a FROM t2 - WHERE c=2002 - OR ((a BETWEEN 27 AND 29) AND a!=28) - OR b=1015 - OR a=78 - OR ((a BETWEEN 76 AND 78) AND a!=77) - OR (d>=35.0 AND d<36.0 AND d NOT NULL) - ORDER BY a - } -} {4 5 6 27 29 35 76 78 scan 0 sort 0} -do_test where7-2.887.2 { - count_steps { - SELECT a FROM t3 - WHERE c=2002 - OR ((a BETWEEN 27 AND 29) AND a!=28) - OR b=1015 - OR a=78 - OR ((a BETWEEN 76 AND 78) AND a!=77) - OR (d>=35.0 AND d<36.0 AND d NOT NULL) - ORDER BY a - } -} {4 5 6 27 29 35 76 78 scan 0 sort 0} -do_test where7-2.888.1 { - count_steps { - SELECT a FROM t2 - WHERE c=27027 - OR f='opqrstuvw' - OR b=410 - ORDER BY a - } -} {14 40 66 79 80 81 92 scan 0 sort 0} -do_test where7-2.888.2 { - count_steps { - SELECT a FROM t3 - WHERE c=27027 - OR f='opqrstuvw' - OR b=410 - ORDER BY a - } -} {14 40 66 79 80 81 92 scan 0 sort 0} -do_test where7-2.889.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='jihgfed' AND f GLOB 'zabcd*') - OR (d>=15.0 AND d<16.0 AND d NOT NULL) - OR a=48 - OR b=113 - OR (g='xwvutsr' AND f GLOB 'fghij*') - OR b=143 - ORDER BY a - } -} {5 13 15 48 77 scan 0 sort 0} -do_test where7-2.889.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='jihgfed' AND f GLOB 'zabcd*') - OR (d>=15.0 AND d<16.0 AND d NOT NULL) - OR a=48 - OR b=113 - OR (g='xwvutsr' AND f GLOB 'fghij*') - OR b=143 - ORDER BY a - } -} {5 13 15 48 77 scan 0 sort 0} -do_test where7-2.890.1 { - count_steps { - SELECT a FROM t2 - WHERE a=80 - OR ((a BETWEEN 0 AND 2) AND a!=1) - OR b=718 - OR c=2002 - OR a=60 - OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') - OR b=476 - OR f='opqrstuvw' - ORDER BY a - } -} {2 4 5 6 14 40 60 66 80 92 scan 0 sort 0} -do_test where7-2.890.2 { - count_steps { - SELECT a FROM t3 - WHERE a=80 - OR ((a BETWEEN 0 AND 2) AND a!=1) - OR b=718 - OR c=2002 - OR a=60 - OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') - OR b=476 - OR f='opqrstuvw' - ORDER BY a - } -} {2 4 5 6 14 40 60 66 80 92 scan 0 sort 0} -do_test where7-2.891.1 { - count_steps { - SELECT a FROM t2 - WHERE a=33 - OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') - OR a=2 - OR a=64 - OR b=663 - OR b=385 - OR b=542 - OR (g='utsrqpo' AND f GLOB 'uvwxy*') - OR (d>=9.0 AND d<10.0 AND d NOT NULL) - ORDER BY a - } -} {2 9 14 20 33 35 40 64 66 92 scan 0 sort 0} -do_test where7-2.891.2 { - count_steps { - SELECT a FROM t3 - WHERE a=33 - OR (f GLOB '?pqrs*' AND f GLOB 'opqr*') - OR a=2 - OR a=64 - OR b=663 - OR b=385 - OR b=542 - OR (g='utsrqpo' AND f GLOB 'uvwxy*') - OR (d>=9.0 AND d<10.0 AND d NOT NULL) - ORDER BY a - } -} {2 9 14 20 33 35 40 64 66 92 scan 0 sort 0} -do_test where7-2.892.1 { - count_steps { - SELECT a FROM t2 - WHERE b=608 - OR (f GLOB '?wxyz*' AND f GLOB 'vwxy*') - OR b=572 - OR (d>=75.0 AND d<76.0 AND d NOT NULL) - OR b=220 - OR a=46 - OR a=62 - OR (d>=83.0 AND d<84.0 AND d NOT NULL) - ORDER BY a - } -} {20 21 46 47 52 62 73 75 83 99 scan 0 sort 0} -do_test where7-2.892.2 { - count_steps { - SELECT a FROM t3 - WHERE b=608 - OR (f GLOB '?wxyz*' AND f GLOB 'vwxy*') - OR b=572 - OR (d>=75.0 AND d<76.0 AND d NOT NULL) - OR b=220 - OR a=46 - OR a=62 - OR (d>=83.0 AND d<84.0 AND d NOT NULL) - ORDER BY a - } -} {20 21 46 47 52 62 73 75 83 99 scan 0 sort 0} -do_test where7-2.893.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='fedcbaz' AND f GLOB 'tuvwx*') - OR b=1045 - OR ((a BETWEEN 14 AND 16) AND a!=15) - ORDER BY a - } -} {14 16 95 97 scan 0 sort 0} -do_test where7-2.893.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='fedcbaz' AND f GLOB 'tuvwx*') - OR b=1045 - OR ((a BETWEEN 14 AND 16) AND a!=15) - ORDER BY a - } -} {14 16 95 97 scan 0 sort 0} -do_test where7-2.894.1 { - count_steps { - SELECT a FROM t2 - WHERE b=649 - OR ((a BETWEEN 39 AND 41) AND a!=40) - OR (g='tsrqpon' AND f GLOB 'zabcd*') - OR (d>=62.0 AND d<63.0 AND d NOT NULL) - OR a=74 - OR b=476 - OR b=253 - ORDER BY a - } -} {23 25 39 41 59 62 74 scan 0 sort 0} -do_test where7-2.894.2 { - count_steps { - SELECT a FROM t3 - WHERE b=649 - OR ((a BETWEEN 39 AND 41) AND a!=40) - OR (g='tsrqpon' AND f GLOB 'zabcd*') - OR (d>=62.0 AND d<63.0 AND d NOT NULL) - OR a=74 - OR b=476 - OR b=253 - ORDER BY a - } -} {23 25 39 41 59 62 74 scan 0 sort 0} -do_test where7-2.895.1 { - count_steps { - SELECT a FROM t2 - WHERE b=817 - OR (d>=42.0 AND d<43.0 AND d NOT NULL) - OR (d>=23.0 AND d<24.0 AND d NOT NULL) - OR ((a BETWEEN 82 AND 84) AND a!=83) - OR d<0.0 - OR (g='edcbazy' AND f GLOB 'uvwxy*') - OR a=87 - OR b=88 - OR b=465 - ORDER BY a - } -} {8 23 42 82 84 87 98 scan 0 sort 0} -do_test where7-2.895.2 { - count_steps { - SELECT a FROM t3 - WHERE b=817 - OR (d>=42.0 AND d<43.0 AND d NOT NULL) - OR (d>=23.0 AND d<24.0 AND d NOT NULL) - OR ((a BETWEEN 82 AND 84) AND a!=83) - OR d<0.0 - OR (g='edcbazy' AND f GLOB 'uvwxy*') - OR a=87 - OR b=88 - OR b=465 - ORDER BY a - } -} {8 23 42 82 84 87 98 scan 0 sort 0} -do_test where7-2.896.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='onmlkji' AND f GLOB 'wxyza*') - OR b=773 - OR (d>=80.0 AND d<81.0 AND d NOT NULL) - OR c>=34035 - OR c=34034 - OR (g='fedcbaz' AND f GLOB 'pqrst*') - ORDER BY a - } -} {48 80 93 100 scan 0 sort 0} -do_test where7-2.896.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='onmlkji' AND f GLOB 'wxyza*') - OR b=773 - OR (d>=80.0 AND d<81.0 AND d NOT NULL) - OR c>=34035 - OR c=34034 - OR (g='fedcbaz' AND f GLOB 'pqrst*') - ORDER BY a - } -} {48 80 93 100 scan 0 sort 0} -do_test where7-2.897.1 { - count_steps { - SELECT a FROM t2 - WHERE b=751 - OR ((a BETWEEN 32 AND 34) AND a!=33) - OR a=21 - OR ((a BETWEEN 17 AND 19) AND a!=18) - OR b=671 - OR (d>=88.0 AND d<89.0 AND d NOT NULL) - OR (d>=54.0 AND d<55.0 AND d NOT NULL) - OR ((a BETWEEN 67 AND 69) AND a!=68) - OR b=1012 - OR (g='nmlkjih' AND f GLOB 'efghi*') - OR b=869 - ORDER BY a - } -} {17 19 21 32 34 54 56 61 67 69 79 88 92 scan 0 sort 0} -do_test where7-2.897.2 { - count_steps { - SELECT a FROM t3 - WHERE b=751 - OR ((a BETWEEN 32 AND 34) AND a!=33) - OR a=21 - OR ((a BETWEEN 17 AND 19) AND a!=18) - OR b=671 - OR (d>=88.0 AND d<89.0 AND d NOT NULL) - OR (d>=54.0 AND d<55.0 AND d NOT NULL) - OR ((a BETWEEN 67 AND 69) AND a!=68) - OR b=1012 - OR (g='nmlkjih' AND f GLOB 'efghi*') - OR b=869 - ORDER BY a - } -} {17 19 21 32 34 54 56 61 67 69 79 88 92 scan 0 sort 0} -do_test where7-2.898.1 { - count_steps { - SELECT a FROM t2 - WHERE c=28028 - OR ((a BETWEEN 29 AND 31) AND a!=30) - ORDER BY a - } -} {29 31 82 83 84 scan 0 sort 0} -do_test where7-2.898.2 { - count_steps { - SELECT a FROM t3 - WHERE c=28028 - OR ((a BETWEEN 29 AND 31) AND a!=30) - ORDER BY a - } -} {29 31 82 83 84 scan 0 sort 0} -do_test where7-2.899.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 75 AND 77) AND a!=76) - OR (g='lkjihgf' AND f GLOB 'nopqr*') - OR b=509 - OR ((a BETWEEN 18 AND 20) AND a!=19) - ORDER BY a - } -} {18 20 65 75 77 scan 0 sort 0} -do_test where7-2.899.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 75 AND 77) AND a!=76) - OR (g='lkjihgf' AND f GLOB 'nopqr*') - OR b=509 - OR ((a BETWEEN 18 AND 20) AND a!=19) - ORDER BY a - } -} {18 20 65 75 77 scan 0 sort 0} -do_test where7-2.900.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='edcbazy' AND f GLOB 'uvwxy*') - OR b=165 - OR b=487 - ORDER BY a - } -} {15 98 scan 0 sort 0} -do_test where7-2.900.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='edcbazy' AND f GLOB 'uvwxy*') - OR b=165 - OR b=487 - ORDER BY a - } -} {15 98 scan 0 sort 0} -do_test where7-2.901.1 { - count_steps { - SELECT a FROM t2 - WHERE f='stuvwxyza' - OR a=62 - OR a=47 - ORDER BY a - } -} {18 44 47 62 70 96 scan 0 sort 0} -do_test where7-2.901.2 { - count_steps { - SELECT a FROM t3 - WHERE f='stuvwxyza' - OR a=62 - OR a=47 - ORDER BY a - } -} {18 44 47 62 70 96 scan 0 sort 0} -do_test where7-2.902.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 35 AND 37) AND a!=36) - OR a=14 - OR b=1070 - ORDER BY a - } -} {14 35 37 scan 0 sort 0} -do_test where7-2.902.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 35 AND 37) AND a!=36) - OR a=14 - OR b=1070 - ORDER BY a - } -} {14 35 37 scan 0 sort 0} -do_test where7-2.903.1 { - count_steps { - SELECT a FROM t2 - WHERE a=57 - OR b=256 - OR (d>=76.0 AND d<77.0 AND d NOT NULL) - OR a=35 - OR b=542 - OR a=61 - OR b=784 - OR a=57 - OR (g='ponmlkj' AND f GLOB 'uvwxy*') - ORDER BY a - } -} {35 46 57 61 76 scan 0 sort 0} -do_test where7-2.903.2 { - count_steps { - SELECT a FROM t3 - WHERE a=57 - OR b=256 - OR (d>=76.0 AND d<77.0 AND d NOT NULL) - OR a=35 - OR b=542 - OR a=61 - OR b=784 - OR a=57 - OR (g='ponmlkj' AND f GLOB 'uvwxy*') - ORDER BY a - } -} {35 46 57 61 76 scan 0 sort 0} -do_test where7-2.904.1 { - count_steps { - SELECT a FROM t2 - WHERE (f GLOB '?bcde*' AND f GLOB 'abcd*') - OR (d>=49.0 AND d<50.0 AND d NOT NULL) - OR b=66 - OR (d>=9.0 AND d<10.0 AND d NOT NULL) - OR a=85 - OR ((a BETWEEN 66 AND 68) AND a!=67) - OR (g='xwvutsr' AND f GLOB 'hijkl*') - OR b=198 - OR (g='kjihgfe' AND f GLOB 'rstuv*') - ORDER BY a - } -} {6 7 9 18 26 49 52 66 68 69 78 85 scan 0 sort 0} -do_test where7-2.904.2 { - count_steps { - SELECT a FROM t3 - WHERE (f GLOB '?bcde*' AND f GLOB 'abcd*') - OR (d>=49.0 AND d<50.0 AND d NOT NULL) - OR b=66 - OR (d>=9.0 AND d<10.0 AND d NOT NULL) - OR a=85 - OR ((a BETWEEN 66 AND 68) AND a!=67) - OR (g='xwvutsr' AND f GLOB 'hijkl*') - OR b=198 - OR (g='kjihgfe' AND f GLOB 'rstuv*') - ORDER BY a - } -} {6 7 9 18 26 49 52 66 68 69 78 85 scan 0 sort 0} -do_test where7-2.905.1 { - count_steps { - SELECT a FROM t2 - WHERE c=31031 - OR f='tuvwxyzab' - OR a=51 - OR (g='edcbazy' AND f GLOB 'uvwxy*') - ORDER BY a - } -} {19 45 51 71 91 92 93 97 98 scan 0 sort 0} -do_test where7-2.905.2 { - count_steps { - SELECT a FROM t3 - WHERE c=31031 - OR f='tuvwxyzab' - OR a=51 - OR (g='edcbazy' AND f GLOB 'uvwxy*') - ORDER BY a - } -} {19 45 51 71 91 92 93 97 98 scan 0 sort 0} -do_test where7-2.906.1 { - count_steps { - SELECT a FROM t2 - WHERE (f GLOB '?hijk*' AND f GLOB 'ghij*') - OR (g='edcbazy' AND f GLOB 'vwxyz*') - ORDER BY a - } -} {6 32 58 84 99 scan 0 sort 0} -do_test where7-2.906.2 { - count_steps { - SELECT a FROM t3 - WHERE (f GLOB '?hijk*' AND f GLOB 'ghij*') - OR (g='edcbazy' AND f GLOB 'vwxyz*') - ORDER BY a - } -} {6 32 58 84 99 scan 0 sort 0} -do_test where7-2.907.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=91.0 AND d<92.0 AND d NOT NULL) - OR (d>=49.0 AND d<50.0 AND d NOT NULL) - OR a=74 - OR a=79 - ORDER BY a - } -} {49 74 79 91 scan 0 sort 0} -do_test where7-2.907.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=91.0 AND d<92.0 AND d NOT NULL) - OR (d>=49.0 AND d<50.0 AND d NOT NULL) - OR a=74 - OR a=79 - ORDER BY a - } -} {49 74 79 91 scan 0 sort 0} -do_test where7-2.908.1 { - count_steps { - SELECT a FROM t2 - WHERE b=751 - OR (d>=82.0 AND d<83.0 AND d NOT NULL) - OR ((a BETWEEN 94 AND 96) AND a!=95) - OR (g='xwvutsr' AND f GLOB 'fghij*') - OR a=43 - OR ((a BETWEEN 84 AND 86) AND a!=85) - OR b=80 - ORDER BY a - } -} {5 43 82 84 86 94 96 scan 0 sort 0} -do_test where7-2.908.2 { - count_steps { - SELECT a FROM t3 - WHERE b=751 - OR (d>=82.0 AND d<83.0 AND d NOT NULL) - OR ((a BETWEEN 94 AND 96) AND a!=95) - OR (g='xwvutsr' AND f GLOB 'fghij*') - OR a=43 - OR ((a BETWEEN 84 AND 86) AND a!=85) - OR b=80 - ORDER BY a - } -} {5 43 82 84 86 94 96 scan 0 sort 0} -do_test where7-2.909.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=71.0 AND d<72.0 AND d NOT NULL) - OR (d>=92.0 AND d<93.0 AND d NOT NULL) - ORDER BY a - } -} {71 92 scan 0 sort 0} -do_test where7-2.909.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=71.0 AND d<72.0 AND d NOT NULL) - OR (d>=92.0 AND d<93.0 AND d NOT NULL) - ORDER BY a - } -} {71 92 scan 0 sort 0} -do_test where7-2.910.1 { - count_steps { - SELECT a FROM t2 - WHERE b=286 - OR (g='fedcbaz' AND f GLOB 'tuvwx*') - OR c=32032 - OR (g='fedcbaz' AND f GLOB 'qrstu*') - OR c=34034 - OR b=638 - OR b=451 - OR a=59 - OR b=792 - OR (d>=73.0 AND d<74.0 AND d NOT NULL) - ORDER BY a - } -} {26 41 58 59 72 73 94 95 96 97 100 scan 0 sort 0} -do_test where7-2.910.2 { - count_steps { - SELECT a FROM t3 - WHERE b=286 - OR (g='fedcbaz' AND f GLOB 'tuvwx*') - OR c=32032 - OR (g='fedcbaz' AND f GLOB 'qrstu*') - OR c=34034 - OR b=638 - OR b=451 - OR a=59 - OR b=792 - OR (d>=73.0 AND d<74.0 AND d NOT NULL) - ORDER BY a - } -} {26 41 58 59 72 73 94 95 96 97 100 scan 0 sort 0} -do_test where7-2.911.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 23 AND 25) AND a!=24) - OR (d>=3.0 AND d<4.0 AND d NOT NULL) - OR (g='kjihgfe' AND f GLOB 'tuvwx*') - OR a=57 - OR b=982 - OR ((a BETWEEN 77 AND 79) AND a!=78) - OR (g='mlkjihg' AND f GLOB 'klmno*') - OR a=25 - ORDER BY a - } -} {3 23 25 57 62 71 77 79 scan 0 sort 0} -do_test where7-2.911.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 23 AND 25) AND a!=24) - OR (d>=3.0 AND d<4.0 AND d NOT NULL) - OR (g='kjihgfe' AND f GLOB 'tuvwx*') - OR a=57 - OR b=982 - OR ((a BETWEEN 77 AND 79) AND a!=78) - OR (g='mlkjihg' AND f GLOB 'klmno*') - OR a=25 - ORDER BY a - } -} {3 23 25 57 62 71 77 79 scan 0 sort 0} -do_test where7-2.912.1 { - count_steps { - SELECT a FROM t2 - WHERE b=1089 - OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') - OR (g='qponmlk' AND f GLOB 'nopqr*') - OR c=7007 - OR b=575 - OR a=84 - OR c=34034 - OR b=795 - ORDER BY a - } -} {15 19 20 21 39 41 67 84 93 99 100 scan 0 sort 0} -do_test where7-2.912.2 { - count_steps { - SELECT a FROM t3 - WHERE b=1089 - OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') - OR (g='qponmlk' AND f GLOB 'nopqr*') - OR c=7007 - OR b=575 - OR a=84 - OR c=34034 - OR b=795 - ORDER BY a - } -} {15 19 20 21 39 41 67 84 93 99 100 scan 0 sort 0} -do_test where7-2.913.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 76 AND 78) AND a!=77) - OR b=630 - OR (g='rqponml' AND f GLOB 'hijkl*') - OR b=575 - ORDER BY a - } -} {33 76 78 scan 0 sort 0} -do_test where7-2.913.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 76 AND 78) AND a!=77) - OR b=630 - OR (g='rqponml' AND f GLOB 'hijkl*') - OR b=575 - ORDER BY a - } -} {33 76 78 scan 0 sort 0} -do_test where7-2.914.1 { - count_steps { - SELECT a FROM t2 - WHERE a=59 - OR (d>=5.0 AND d<6.0 AND d NOT NULL) - OR a=44 - OR a=77 - OR (d>=71.0 AND d<72.0 AND d NOT NULL) - OR a=80 - OR b=14 - ORDER BY a - } -} {5 44 59 71 77 80 scan 0 sort 0} -do_test where7-2.914.2 { - count_steps { - SELECT a FROM t3 - WHERE a=59 - OR (d>=5.0 AND d<6.0 AND d NOT NULL) - OR a=44 - OR a=77 - OR (d>=71.0 AND d<72.0 AND d NOT NULL) - OR a=80 - OR b=14 - ORDER BY a - } -} {5 44 59 71 77 80 scan 0 sort 0} -do_test where7-2.915.1 { - count_steps { - SELECT a FROM t2 - WHERE b=693 - OR b=319 - OR b=935 - OR (g='onmlkji' AND f GLOB 'wxyza*') - ORDER BY a - } -} {29 48 63 85 scan 0 sort 0} -do_test where7-2.915.2 { - count_steps { - SELECT a FROM t3 - WHERE b=693 - OR b=319 - OR b=935 - OR (g='onmlkji' AND f GLOB 'wxyza*') - ORDER BY a - } -} {29 48 63 85 scan 0 sort 0} -do_test where7-2.916.1 { - count_steps { - SELECT a FROM t2 - WHERE a=3 - OR f='abcdefghi' - OR b=817 - OR a=61 - OR a=32 - OR (d>=65.0 AND d<66.0 AND d NOT NULL) - OR ((a BETWEEN 35 AND 37) AND a!=36) - OR b=861 - OR (d>=90.0 AND d<91.0 AND d NOT NULL) - OR (g='rqponml' AND f GLOB 'klmno*') - ORDER BY a - } -} {3 26 32 35 36 37 52 61 65 78 90 scan 0 sort 0} -do_test where7-2.916.2 { - count_steps { - SELECT a FROM t3 - WHERE a=3 - OR f='abcdefghi' - OR b=817 - OR a=61 - OR a=32 - OR (d>=65.0 AND d<66.0 AND d NOT NULL) - OR ((a BETWEEN 35 AND 37) AND a!=36) - OR b=861 - OR (d>=90.0 AND d<91.0 AND d NOT NULL) - OR (g='rqponml' AND f GLOB 'klmno*') - ORDER BY a - } -} {3 26 32 35 36 37 52 61 65 78 90 scan 0 sort 0} -do_test where7-2.917.1 { - count_steps { - SELECT a FROM t2 - WHERE a=31 - OR ((a BETWEEN 84 AND 86) AND a!=85) - OR b=542 - OR (g='kjihgfe' AND f GLOB 'uvwxy*') - OR a=84 - OR (d>=97.0 AND d<98.0 AND d NOT NULL) - OR (d>=86.0 AND d<87.0 AND d NOT NULL) - OR b=762 - OR b=726 - OR (g='jihgfed' AND f GLOB 'yzabc*') - OR b=630 - ORDER BY a - } -} {31 66 72 76 84 86 97 scan 0 sort 0} -do_test where7-2.917.2 { - count_steps { - SELECT a FROM t3 - WHERE a=31 - OR ((a BETWEEN 84 AND 86) AND a!=85) - OR b=542 - OR (g='kjihgfe' AND f GLOB 'uvwxy*') - OR a=84 - OR (d>=97.0 AND d<98.0 AND d NOT NULL) - OR (d>=86.0 AND d<87.0 AND d NOT NULL) - OR b=762 - OR b=726 - OR (g='jihgfed' AND f GLOB 'yzabc*') - OR b=630 - ORDER BY a - } -} {31 66 72 76 84 86 97 scan 0 sort 0} -do_test where7-2.918.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='gfedcba' AND f GLOB 'klmno*') - OR b=894 - OR a=81 - OR c=26026 - OR b=333 - OR (f GLOB '?opqr*' AND f GLOB 'nopq*') - ORDER BY a - } -} {13 39 65 76 77 78 81 88 91 scan 0 sort 0} -do_test where7-2.918.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='gfedcba' AND f GLOB 'klmno*') - OR b=894 - OR a=81 - OR c=26026 - OR b=333 - OR (f GLOB '?opqr*' AND f GLOB 'nopq*') - ORDER BY a - } -} {13 39 65 76 77 78 81 88 91 scan 0 sort 0} -do_test where7-2.919.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 97 AND 99) AND a!=98) - OR b=663 - OR b=223 - OR b=641 - OR (d>=63.0 AND d<64.0 AND d NOT NULL) - OR a=21 - OR ((a BETWEEN 60 AND 62) AND a!=61) - ORDER BY a - } -} {21 60 62 63 97 99 scan 0 sort 0} -do_test where7-2.919.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 97 AND 99) AND a!=98) - OR b=663 - OR b=223 - OR b=641 - OR (d>=63.0 AND d<64.0 AND d NOT NULL) - OR a=21 - OR ((a BETWEEN 60 AND 62) AND a!=61) - ORDER BY a - } -} {21 60 62 63 97 99 scan 0 sort 0} -do_test where7-2.920.1 { - count_steps { - SELECT a FROM t2 - WHERE a=16 - OR b=685 - ORDER BY a - } -} {16 scan 0 sort 0} -do_test where7-2.920.2 { - count_steps { - SELECT a FROM t3 - WHERE a=16 - OR b=685 - ORDER BY a - } -} {16 scan 0 sort 0} -do_test where7-2.921.1 { - count_steps { - SELECT a FROM t2 - WHERE c=20020 - OR f='cdefghijk' - OR (g='nmlkjih' AND f GLOB 'cdefg*') - OR (d>=98.0 AND d<99.0 AND d NOT NULL) - ORDER BY a - } -} {2 28 54 58 59 60 80 98 scan 0 sort 0} -do_test where7-2.921.2 { - count_steps { - SELECT a FROM t3 - WHERE c=20020 - OR f='cdefghijk' - OR (g='nmlkjih' AND f GLOB 'cdefg*') - OR (d>=98.0 AND d<99.0 AND d NOT NULL) - ORDER BY a - } -} {2 28 54 58 59 60 80 98 scan 0 sort 0} -do_test where7-2.922.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='hgfedcb' AND f GLOB 'hijkl*') - OR b=561 - ORDER BY a - } -} {51 85 scan 0 sort 0} -do_test where7-2.922.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='hgfedcb' AND f GLOB 'hijkl*') - OR b=561 - ORDER BY a - } -} {51 85 scan 0 sort 0} -do_test where7-2.923.1 { - count_steps { - SELECT a FROM t2 - WHERE b=440 - OR (d>=86.0 AND d<87.0 AND d NOT NULL) - OR b=718 - OR b=770 - OR b=803 - ORDER BY a - } -} {40 70 73 86 scan 0 sort 0} -do_test where7-2.923.2 { - count_steps { - SELECT a FROM t3 - WHERE b=440 - OR (d>=86.0 AND d<87.0 AND d NOT NULL) - OR b=718 - OR b=770 - OR b=803 - ORDER BY a - } -} {40 70 73 86 scan 0 sort 0} -do_test where7-2.924.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='qponmlk' AND f GLOB 'opqrs*') - OR (g='fedcbaz' AND f GLOB 'qrstu*') - ORDER BY a - } -} {40 94 scan 0 sort 0} -do_test where7-2.924.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='qponmlk' AND f GLOB 'opqrs*') - OR (g='fedcbaz' AND f GLOB 'qrstu*') - ORDER BY a - } -} {40 94 scan 0 sort 0} -do_test where7-2.925.1 { - count_steps { - SELECT a FROM t2 - WHERE b=990 - OR (g='kjihgfe' AND f GLOB 'qrstu*') - ORDER BY a - } -} {68 90 scan 0 sort 0} -do_test where7-2.925.2 { - count_steps { - SELECT a FROM t3 - WHERE b=990 - OR (g='kjihgfe' AND f GLOB 'qrstu*') - ORDER BY a - } -} {68 90 scan 0 sort 0} -do_test where7-2.926.1 { - count_steps { - SELECT a FROM t2 - WHERE b=1001 - OR ((a BETWEEN 74 AND 76) AND a!=75) - OR b=858 - OR a=43 - OR b=1059 - ORDER BY a - } -} {43 74 76 78 91 scan 0 sort 0} -do_test where7-2.926.2 { - count_steps { - SELECT a FROM t3 - WHERE b=1001 - OR ((a BETWEEN 74 AND 76) AND a!=75) - OR b=858 - OR a=43 - OR b=1059 - ORDER BY a - } -} {43 74 76 78 91 scan 0 sort 0} -do_test where7-2.927.1 { - count_steps { - SELECT a FROM t2 - WHERE b=440 - OR (d>=50.0 AND d<51.0 AND d NOT NULL) - OR (d>=1.0 AND d<2.0 AND d NOT NULL) - OR b=517 - OR b=993 - OR f='mnopqrstu' - OR a=66 - ORDER BY a - } -} {1 12 38 40 47 50 64 66 90 scan 0 sort 0} -do_test where7-2.927.2 { - count_steps { - SELECT a FROM t3 - WHERE b=440 - OR (d>=50.0 AND d<51.0 AND d NOT NULL) - OR (d>=1.0 AND d<2.0 AND d NOT NULL) - OR b=517 - OR b=993 - OR f='mnopqrstu' - OR a=66 - ORDER BY a - } -} {1 12 38 40 47 50 64 66 90 scan 0 sort 0} -do_test where7-2.928.1 { - count_steps { - SELECT a FROM t2 - WHERE a=38 - OR ((a BETWEEN 97 AND 99) AND a!=98) - OR (f GLOB '?lmno*' AND f GLOB 'klmn*') - OR ((a BETWEEN 4 AND 6) AND a!=5) - OR b=575 - OR (f GLOB '?wxyz*' AND f GLOB 'vwxy*') - OR f IS NULL - ORDER BY a - } -} {4 6 10 21 36 38 47 62 73 88 97 99 scan 0 sort 0} -do_test where7-2.928.2 { - count_steps { - SELECT a FROM t3 - WHERE a=38 - OR ((a BETWEEN 97 AND 99) AND a!=98) - OR (f GLOB '?lmno*' AND f GLOB 'klmn*') - OR ((a BETWEEN 4 AND 6) AND a!=5) - OR b=575 - OR (f GLOB '?wxyz*' AND f GLOB 'vwxy*') - OR f IS NULL - ORDER BY a - } -} {4 6 10 21 36 38 47 62 73 88 97 99 scan 0 sort 0} -do_test where7-2.929.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=30.0 AND d<31.0 AND d NOT NULL) - OR c=34034 - OR b=157 - OR b=960 - ORDER BY a - } -} {30 100 scan 0 sort 0} -do_test where7-2.929.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=30.0 AND d<31.0 AND d NOT NULL) - OR c=34034 - OR b=157 - OR b=960 - ORDER BY a - } -} {30 100 scan 0 sort 0} -do_test where7-2.930.1 { - count_steps { - SELECT a FROM t2 - WHERE b=520 - OR b=960 - ORDER BY a - } -} {scan 0 sort 1} -do_test where7-2.930.2 { - count_steps { - SELECT a FROM t3 - WHERE b=520 - OR b=960 - ORDER BY a - } -} {scan 0 sort 1} -do_test where7-2.931.1 { - count_steps { - SELECT a FROM t2 - WHERE b=839 - OR (d>=38.0 AND d<39.0 AND d NOT NULL) - OR a=11 - OR b=297 - ORDER BY a - } -} {11 27 38 scan 0 sort 0} -do_test where7-2.931.2 { - count_steps { - SELECT a FROM t3 - WHERE b=839 - OR (d>=38.0 AND d<39.0 AND d NOT NULL) - OR a=11 - OR b=297 - ORDER BY a - } -} {11 27 38 scan 0 sort 0} -do_test where7-2.932.1 { - count_steps { - SELECT a FROM t2 - WHERE b=517 - OR e IS NULL - OR a=5 - ORDER BY a - } -} {5 47 scan 0 sort 0} -do_test where7-2.932.2 { - count_steps { - SELECT a FROM t3 - WHERE b=517 - OR e IS NULL - OR a=5 - ORDER BY a - } -} {5 47 scan 0 sort 0} -do_test where7-2.933.1 { - count_steps { - SELECT a FROM t2 - WHERE a=87 - OR c=7007 - OR (d>=52.0 AND d<53.0 AND d NOT NULL) - OR b=374 - OR (d>=3.0 AND d<4.0 AND d NOT NULL) - OR b=850 - OR ((a BETWEEN 32 AND 34) AND a!=33) - OR b=1056 - OR (f GLOB '?vwxy*' AND f GLOB 'uvwx*') - OR (f GLOB '?hijk*' AND f GLOB 'ghij*') - OR (g='ihgfedc' AND f GLOB 'abcde*') - ORDER BY a - } -} {3 6 19 20 21 32 34 46 52 58 72 78 84 87 96 98 scan 0 sort 0} -do_test where7-2.933.2 { - count_steps { - SELECT a FROM t3 - WHERE a=87 - OR c=7007 - OR (d>=52.0 AND d<53.0 AND d NOT NULL) - OR b=374 - OR (d>=3.0 AND d<4.0 AND d NOT NULL) - OR b=850 - OR ((a BETWEEN 32 AND 34) AND a!=33) - OR b=1056 - OR (f GLOB '?vwxy*' AND f GLOB 'uvwx*') - OR (f GLOB '?hijk*' AND f GLOB 'ghij*') - OR (g='ihgfedc' AND f GLOB 'abcde*') - ORDER BY a - } -} {3 6 19 20 21 32 34 46 52 58 72 78 84 87 96 98 scan 0 sort 0} -do_test where7-2.934.1 { - count_steps { - SELECT a FROM t2 - WHERE a=41 - OR (d>=21.0 AND d<22.0 AND d NOT NULL) - OR (g='nmlkjih' AND f GLOB 'bcdef*') - OR (f GLOB '?tuvw*' AND f GLOB 'stuv*') - ORDER BY a - } -} {18 21 41 44 53 70 96 scan 0 sort 0} -do_test where7-2.934.2 { - count_steps { - SELECT a FROM t3 - WHERE a=41 - OR (d>=21.0 AND d<22.0 AND d NOT NULL) - OR (g='nmlkjih' AND f GLOB 'bcdef*') - OR (f GLOB '?tuvw*' AND f GLOB 'stuv*') - ORDER BY a - } -} {18 21 41 44 53 70 96 scan 0 sort 0} -do_test where7-2.935.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='rqponml' AND f GLOB 'jklmn*') - OR (d>=87.0 AND d<88.0 AND d NOT NULL) - OR ((a BETWEEN 3 AND 5) AND a!=4) - OR ((a BETWEEN 94 AND 96) AND a!=95) - OR c=10010 - OR c=24024 - OR f='pqrstuvwx' - ORDER BY a - } -} {3 5 15 28 29 30 35 41 67 70 71 72 87 93 94 96 scan 0 sort 0} -do_test where7-2.935.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='rqponml' AND f GLOB 'jklmn*') - OR (d>=87.0 AND d<88.0 AND d NOT NULL) - OR ((a BETWEEN 3 AND 5) AND a!=4) - OR ((a BETWEEN 94 AND 96) AND a!=95) - OR c=10010 - OR c=24024 - OR f='pqrstuvwx' - ORDER BY a - } -} {3 5 15 28 29 30 35 41 67 70 71 72 87 93 94 96 scan 0 sort 0} -do_test where7-2.936.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 54 AND 56) AND a!=55) - OR ((a BETWEEN 22 AND 24) AND a!=23) - OR b=850 - OR c=6006 - OR a=16 - OR b=949 - OR b=737 - OR c=18018 - OR ((a BETWEEN 33 AND 35) AND a!=34) - OR b=982 - ORDER BY a - } -} {16 17 18 22 24 33 35 52 53 54 56 67 scan 0 sort 0} -do_test where7-2.936.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 54 AND 56) AND a!=55) - OR ((a BETWEEN 22 AND 24) AND a!=23) - OR b=850 - OR c=6006 - OR a=16 - OR b=949 - OR b=737 - OR c=18018 - OR ((a BETWEEN 33 AND 35) AND a!=34) - OR b=982 - ORDER BY a - } -} {16 17 18 22 24 33 35 52 53 54 56 67 scan 0 sort 0} -do_test where7-2.937.1 { - count_steps { - SELECT a FROM t2 - WHERE c=5005 - OR (d>=23.0 AND d<24.0 AND d NOT NULL) - OR (g='rqponml' AND f GLOB 'hijkl*') - OR (g='fedcbaz' AND f GLOB 'pqrst*') - OR b=256 - OR b=363 - OR a=100 - ORDER BY a - } -} {13 14 15 23 33 93 100 scan 0 sort 0} -do_test where7-2.937.2 { - count_steps { - SELECT a FROM t3 - WHERE c=5005 - OR (d>=23.0 AND d<24.0 AND d NOT NULL) - OR (g='rqponml' AND f GLOB 'hijkl*') - OR (g='fedcbaz' AND f GLOB 'pqrst*') - OR b=256 - OR b=363 - OR a=100 - ORDER BY a - } -} {13 14 15 23 33 93 100 scan 0 sort 0} -do_test where7-2.938.1 { - count_steps { - SELECT a FROM t2 - WHERE (f GLOB '?opqr*' AND f GLOB 'nopq*') - OR b=539 - OR b=377 - OR (g='rqponml' AND f GLOB 'hijkl*') - OR a=83 - OR (f GLOB '?nopq*' AND f GLOB 'mnop*') - OR b=781 - ORDER BY a - } -} {12 13 33 38 39 49 64 65 71 83 90 91 scan 0 sort 0} -do_test where7-2.938.2 { - count_steps { - SELECT a FROM t3 - WHERE (f GLOB '?opqr*' AND f GLOB 'nopq*') - OR b=539 - OR b=377 - OR (g='rqponml' AND f GLOB 'hijkl*') - OR a=83 - OR (f GLOB '?nopq*' AND f GLOB 'mnop*') - OR b=781 - ORDER BY a - } -} {12 13 33 38 39 49 64 65 71 83 90 91 scan 0 sort 0} -do_test where7-2.939.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=24.0 AND d<25.0 AND d NOT NULL) - OR (g='tsrqpon' AND f GLOB 'zabcd*') - OR (d>=1.0 AND d<2.0 AND d NOT NULL) - OR b=80 - OR a=6 - OR b=1034 - OR ((a BETWEEN 88 AND 90) AND a!=89) - ORDER BY a - } -} {1 6 24 25 88 90 94 scan 0 sort 0} -do_test where7-2.939.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=24.0 AND d<25.0 AND d NOT NULL) - OR (g='tsrqpon' AND f GLOB 'zabcd*') - OR (d>=1.0 AND d<2.0 AND d NOT NULL) - OR b=80 - OR a=6 - OR b=1034 - OR ((a BETWEEN 88 AND 90) AND a!=89) - ORDER BY a - } -} {1 6 24 25 88 90 94 scan 0 sort 0} -do_test where7-2.940.1 { - count_steps { - SELECT a FROM t2 - WHERE b=264 - OR (d>=51.0 AND d<52.0 AND d NOT NULL) - OR b=605 - OR b=418 - OR b=377 - OR b=531 - OR a=30 - OR (g='tsrqpon' AND f GLOB 'xyzab*') - OR ((a BETWEEN 42 AND 44) AND a!=43) - ORDER BY a - } -} {23 24 30 38 42 44 51 55 scan 0 sort 0} -do_test where7-2.940.2 { - count_steps { - SELECT a FROM t3 - WHERE b=264 - OR (d>=51.0 AND d<52.0 AND d NOT NULL) - OR b=605 - OR b=418 - OR b=377 - OR b=531 - OR a=30 - OR (g='tsrqpon' AND f GLOB 'xyzab*') - OR ((a BETWEEN 42 AND 44) AND a!=43) - ORDER BY a - } -} {23 24 30 38 42 44 51 55 scan 0 sort 0} -do_test where7-2.941.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 78 AND 80) AND a!=79) - OR a=89 - OR ((a BETWEEN 45 AND 47) AND a!=46) - OR ((a BETWEEN 6 AND 8) AND a!=7) - OR b=69 - OR (f GLOB '?rstu*' AND f GLOB 'qrst*') - OR (d>=98.0 AND d<99.0 AND d NOT NULL) - ORDER BY a - } -} {6 8 16 42 45 47 68 78 80 89 94 98 scan 0 sort 0} -do_test where7-2.941.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 78 AND 80) AND a!=79) - OR a=89 - OR ((a BETWEEN 45 AND 47) AND a!=46) - OR ((a BETWEEN 6 AND 8) AND a!=7) - OR b=69 - OR (f GLOB '?rstu*' AND f GLOB 'qrst*') - OR (d>=98.0 AND d<99.0 AND d NOT NULL) - ORDER BY a - } -} {6 8 16 42 45 47 68 78 80 89 94 98 scan 0 sort 0} -do_test where7-2.942.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 68 AND 70) AND a!=69) - OR ((a BETWEEN 70 AND 72) AND a!=71) - OR b=187 - OR b=594 - OR b=297 - OR b=286 - OR ((a BETWEEN 94 AND 96) AND a!=95) - OR (g='rqponml' AND f GLOB 'jklmn*') - ORDER BY a - } -} {17 26 27 35 54 68 70 72 94 96 scan 0 sort 0} -do_test where7-2.942.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 68 AND 70) AND a!=69) - OR ((a BETWEEN 70 AND 72) AND a!=71) - OR b=187 - OR b=594 - OR b=297 - OR b=286 - OR ((a BETWEEN 94 AND 96) AND a!=95) - OR (g='rqponml' AND f GLOB 'jklmn*') - ORDER BY a - } -} {17 26 27 35 54 68 70 72 94 96 scan 0 sort 0} -do_test where7-2.943.1 { - count_steps { - SELECT a FROM t2 - WHERE b=872 - OR ((a BETWEEN 0 AND 2) AND a!=1) - OR ((a BETWEEN 15 AND 17) AND a!=16) - OR c=18018 - OR ((a BETWEEN 30 AND 32) AND a!=31) - OR (g='rqponml' AND f GLOB 'klmno*') - OR (g='mlkjihg' AND f GLOB 'hijkl*') - OR b=388 - OR b=726 - OR a=89 - ORDER BY a - } -} {2 15 17 30 32 36 52 53 54 59 66 89 scan 0 sort 0} -do_test where7-2.943.2 { - count_steps { - SELECT a FROM t3 - WHERE b=872 - OR ((a BETWEEN 0 AND 2) AND a!=1) - OR ((a BETWEEN 15 AND 17) AND a!=16) - OR c=18018 - OR ((a BETWEEN 30 AND 32) AND a!=31) - OR (g='rqponml' AND f GLOB 'klmno*') - OR (g='mlkjihg' AND f GLOB 'hijkl*') - OR b=388 - OR b=726 - OR a=89 - ORDER BY a - } -} {2 15 17 30 32 36 52 53 54 59 66 89 scan 0 sort 0} -do_test where7-2.944.1 { - count_steps { - SELECT a FROM t2 - WHERE b=341 - OR a=68 - OR (g='jihgfed' AND f GLOB 'wxyza*') - OR ((a BETWEEN 40 AND 42) AND a!=41) - OR (d>=76.0 AND d<77.0 AND d NOT NULL) - OR c=7007 - OR c=14014 - OR (g='tsrqpon' AND f GLOB 'yzabc*') - OR f='xyzabcdef' - OR b=1103 - ORDER BY a - } -} {19 20 21 23 24 31 40 41 42 49 68 74 75 76 scan 0 sort 0} -do_test where7-2.944.2 { - count_steps { - SELECT a FROM t3 - WHERE b=341 - OR a=68 - OR (g='jihgfed' AND f GLOB 'wxyza*') - OR ((a BETWEEN 40 AND 42) AND a!=41) - OR (d>=76.0 AND d<77.0 AND d NOT NULL) - OR c=7007 - OR c=14014 - OR (g='tsrqpon' AND f GLOB 'yzabc*') - OR f='xyzabcdef' - OR b=1103 - ORDER BY a - } -} {19 20 21 23 24 31 40 41 42 49 68 74 75 76 scan 0 sort 0} -do_test where7-2.945.1 { - count_steps { - SELECT a FROM t2 - WHERE b=1078 - OR b=377 - OR (d>=46.0 AND d<47.0 AND d NOT NULL) - OR f='mnopqrstu' - OR (d>=34.0 AND d<35.0 AND d NOT NULL) - OR b=905 - ORDER BY a - } -} {12 34 38 46 64 90 98 scan 0 sort 0} -do_test where7-2.945.2 { - count_steps { - SELECT a FROM t3 - WHERE b=1078 - OR b=377 - OR (d>=46.0 AND d<47.0 AND d NOT NULL) - OR f='mnopqrstu' - OR (d>=34.0 AND d<35.0 AND d NOT NULL) - OR b=905 - ORDER BY a - } -} {12 34 38 46 64 90 98 scan 0 sort 0} -do_test where7-2.946.1 { - count_steps { - SELECT a FROM t2 - WHERE b=352 - OR f='lmnopqrst' - OR a=85 - OR (d>=64.0 AND d<65.0 AND d NOT NULL) - ORDER BY a - } -} {11 32 37 63 64 85 89 scan 0 sort 0} -do_test where7-2.946.2 { - count_steps { - SELECT a FROM t3 - WHERE b=352 - OR f='lmnopqrst' - OR a=85 - OR (d>=64.0 AND d<65.0 AND d NOT NULL) - ORDER BY a - } -} {11 32 37 63 64 85 89 scan 0 sort 0} -do_test where7-2.947.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=2.0 AND d<3.0 AND d NOT NULL) - OR b=707 - OR f='rstuvwxyz' - ORDER BY a - } -} {2 17 43 69 95 scan 0 sort 0} -do_test where7-2.947.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=2.0 AND d<3.0 AND d NOT NULL) - OR b=707 - OR f='rstuvwxyz' - ORDER BY a - } -} {2 17 43 69 95 scan 0 sort 0} -do_test where7-2.948.1 { - count_steps { - SELECT a FROM t2 - WHERE a=11 - OR b=718 - OR a=49 - OR (g='kjihgfe' AND f GLOB 'uvwxy*') - OR b=586 - OR ((a BETWEEN 2 AND 4) AND a!=3) - OR b=660 - OR f IS NULL - ORDER BY a - } -} {2 4 11 49 60 72 scan 0 sort 0} -do_test where7-2.948.2 { - count_steps { - SELECT a FROM t3 - WHERE a=11 - OR b=718 - OR a=49 - OR (g='kjihgfe' AND f GLOB 'uvwxy*') - OR b=586 - OR ((a BETWEEN 2 AND 4) AND a!=3) - OR b=660 - OR f IS NULL - ORDER BY a - } -} {2 4 11 49 60 72 scan 0 sort 0} -do_test where7-2.949.1 { - count_steps { - SELECT a FROM t2 - WHERE b=410 - OR (g='lkjihgf' AND f GLOB 'mnopq*') - OR b=817 - OR (g='hgfedcb' AND f GLOB 'fghij*') - OR (d>=97.0 AND d<98.0 AND d NOT NULL) - OR ((a BETWEEN 25 AND 27) AND a!=26) - OR b=759 - OR a=34 - OR ((a BETWEEN 45 AND 47) AND a!=46) - ORDER BY a - } -} {25 27 34 45 47 64 69 83 97 scan 0 sort 0} -do_test where7-2.949.2 { - count_steps { - SELECT a FROM t3 - WHERE b=410 - OR (g='lkjihgf' AND f GLOB 'mnopq*') - OR b=817 - OR (g='hgfedcb' AND f GLOB 'fghij*') - OR (d>=97.0 AND d<98.0 AND d NOT NULL) - OR ((a BETWEEN 25 AND 27) AND a!=26) - OR b=759 - OR a=34 - OR ((a BETWEEN 45 AND 47) AND a!=46) - ORDER BY a - } -} {25 27 34 45 47 64 69 83 97 scan 0 sort 0} -do_test where7-2.950.1 { - count_steps { - SELECT a FROM t2 - WHERE f IS NULL - OR a=29 - OR ((a BETWEEN 86 AND 88) AND a!=87) - OR (g='mlkjihg' AND f GLOB 'hijkl*') - OR c=6006 - OR (g='kjihgfe' AND f GLOB 'qrstu*') - OR b=432 - OR a=38 - OR (g='hgfedcb' AND f GLOB 'ijklm*') - OR b=110 - ORDER BY a - } -} {10 16 17 18 29 38 59 68 86 88 scan 0 sort 0} -do_test where7-2.950.2 { - count_steps { - SELECT a FROM t3 - WHERE f IS NULL - OR a=29 - OR ((a BETWEEN 86 AND 88) AND a!=87) - OR (g='mlkjihg' AND f GLOB 'hijkl*') - OR c=6006 - OR (g='kjihgfe' AND f GLOB 'qrstu*') - OR b=432 - OR a=38 - OR (g='hgfedcb' AND f GLOB 'ijklm*') - OR b=110 - ORDER BY a - } -} {10 16 17 18 29 38 59 68 86 88 scan 0 sort 0} -do_test where7-2.951.1 { - count_steps { - SELECT a FROM t2 - WHERE a=13 - OR ((a BETWEEN 30 AND 32) AND a!=31) - OR b=322 - OR a=34 - OR (d>=49.0 AND d<50.0 AND d NOT NULL) - OR b=55 - OR b=11 - ORDER BY a - } -} {1 5 13 30 32 34 49 scan 0 sort 0} -do_test where7-2.951.2 { - count_steps { - SELECT a FROM t3 - WHERE a=13 - OR ((a BETWEEN 30 AND 32) AND a!=31) - OR b=322 - OR a=34 - OR (d>=49.0 AND d<50.0 AND d NOT NULL) - OR b=55 - OR b=11 - ORDER BY a - } -} {1 5 13 30 32 34 49 scan 0 sort 0} -do_test where7-2.952.1 { - count_steps { - SELECT a FROM t2 - WHERE a=50 - OR a=64 - OR (f GLOB '?stuv*' AND f GLOB 'rstu*') - OR a=96 - OR (d>=94.0 AND d<95.0 AND d NOT NULL) - OR b=949 - OR b=792 - OR a=59 - OR a=16 - OR a=95 - ORDER BY a - } -} {16 17 43 50 59 64 69 72 94 95 96 scan 0 sort 0} -do_test where7-2.952.2 { - count_steps { - SELECT a FROM t3 - WHERE a=50 - OR a=64 - OR (f GLOB '?stuv*' AND f GLOB 'rstu*') - OR a=96 - OR (d>=94.0 AND d<95.0 AND d NOT NULL) - OR b=949 - OR b=792 - OR a=59 - OR a=16 - OR a=95 - ORDER BY a - } -} {16 17 43 50 59 64 69 72 94 95 96 scan 0 sort 0} -do_test where7-2.953.1 { - count_steps { - SELECT a FROM t2 - WHERE b=69 - OR a=89 - OR (g='nmlkjih' AND f GLOB 'defgh*') - OR a=54 - OR a=52 - OR f='wxyzabcde' - OR b=462 - OR (g='onmlkji' AND f GLOB 'wxyza*') - ORDER BY a - } -} {22 42 48 52 54 55 74 89 100 scan 0 sort 0} -do_test where7-2.953.2 { - count_steps { - SELECT a FROM t3 - WHERE b=69 - OR a=89 - OR (g='nmlkjih' AND f GLOB 'defgh*') - OR a=54 - OR a=52 - OR f='wxyzabcde' - OR b=462 - OR (g='onmlkji' AND f GLOB 'wxyza*') - ORDER BY a - } -} {22 42 48 52 54 55 74 89 100 scan 0 sort 0} -do_test where7-2.954.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=33.0 AND d<34.0 AND d NOT NULL) - OR a=43 - OR b=91 - OR f='ghijklmno' - OR ((a BETWEEN 48 AND 50) AND a!=49) - OR b=308 - ORDER BY a - } -} {6 28 32 33 43 48 50 58 84 scan 0 sort 0} -do_test where7-2.954.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=33.0 AND d<34.0 AND d NOT NULL) - OR a=43 - OR b=91 - OR f='ghijklmno' - OR ((a BETWEEN 48 AND 50) AND a!=49) - OR b=308 - ORDER BY a - } -} {6 28 32 33 43 48 50 58 84 scan 0 sort 0} -do_test where7-2.955.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 87 AND 89) AND a!=88) - OR (d>=27.0 AND d<28.0 AND d NOT NULL) - OR b=674 - OR (g='wvutsrq' AND f GLOB 'mnopq*') - OR b=1070 - OR (g='kjihgfe' AND f GLOB 'uvwxy*') - ORDER BY a - } -} {12 27 72 87 89 scan 0 sort 0} -do_test where7-2.955.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 87 AND 89) AND a!=88) - OR (d>=27.0 AND d<28.0 AND d NOT NULL) - OR b=674 - OR (g='wvutsrq' AND f GLOB 'mnopq*') - OR b=1070 - OR (g='kjihgfe' AND f GLOB 'uvwxy*') - ORDER BY a - } -} {12 27 72 87 89 scan 0 sort 0} -do_test where7-2.956.1 { - count_steps { - SELECT a FROM t2 - WHERE (f GLOB '?opqr*' AND f GLOB 'nopq*') - OR c=20020 - OR b=1001 - OR (d>=84.0 AND d<85.0 AND d NOT NULL) - ORDER BY a - } -} {13 39 58 59 60 65 84 91 scan 0 sort 0} -do_test where7-2.956.2 { - count_steps { - SELECT a FROM t3 - WHERE (f GLOB '?opqr*' AND f GLOB 'nopq*') - OR c=20020 - OR b=1001 - OR (d>=84.0 AND d<85.0 AND d NOT NULL) - ORDER BY a - } -} {13 39 58 59 60 65 84 91 scan 0 sort 0} -do_test where7-2.957.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='tsrqpon' AND f GLOB 'xyzab*') - OR ((a BETWEEN 13 AND 15) AND a!=14) - OR c=1001 - OR a=77 - ORDER BY a - } -} {1 2 3 13 15 23 77 scan 0 sort 0} -do_test where7-2.957.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='tsrqpon' AND f GLOB 'xyzab*') - OR ((a BETWEEN 13 AND 15) AND a!=14) - OR c=1001 - OR a=77 - ORDER BY a - } -} {1 2 3 13 15 23 77 scan 0 sort 0} -do_test where7-2.958.1 { - count_steps { - SELECT a FROM t2 - WHERE a=5 - OR (d>=90.0 AND d<91.0 AND d NOT NULL) - ORDER BY a - } -} {5 90 scan 0 sort 0} -do_test where7-2.958.2 { - count_steps { - SELECT a FROM t3 - WHERE a=5 - OR (d>=90.0 AND d<91.0 AND d NOT NULL) - ORDER BY a - } -} {5 90 scan 0 sort 0} -do_test where7-2.959.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=98.0 AND d<99.0 AND d NOT NULL) - OR (g='utsrqpo' AND f GLOB 'vwxyz*') - OR b=154 - OR b=575 - OR b=927 - OR (f GLOB '?uvwx*' AND f GLOB 'tuvw*') - OR f='tuvwxyzab' - OR a=62 - OR b=132 - OR ((a BETWEEN 23 AND 25) AND a!=24) - ORDER BY a - } -} {12 14 19 21 23 25 45 62 71 97 98 scan 0 sort 0} -do_test where7-2.959.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=98.0 AND d<99.0 AND d NOT NULL) - OR (g='utsrqpo' AND f GLOB 'vwxyz*') - OR b=154 - OR b=575 - OR b=927 - OR (f GLOB '?uvwx*' AND f GLOB 'tuvw*') - OR f='tuvwxyzab' - OR a=62 - OR b=132 - OR ((a BETWEEN 23 AND 25) AND a!=24) - ORDER BY a - } -} {12 14 19 21 23 25 45 62 71 97 98 scan 0 sort 0} -do_test where7-2.960.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='fedcbaz' AND f GLOB 'qrstu*') - OR (f GLOB '?ghij*' AND f GLOB 'fghi*') - OR (g='xwvutsr' AND f GLOB 'efghi*') - OR f='hijklmnop' - OR c=11011 - OR ((a BETWEEN 66 AND 68) AND a!=67) - OR (d>=46.0 AND d<47.0 AND d NOT NULL) - OR (g='utsrqpo' AND f GLOB 'stuvw*') - OR (g='gfedcba' AND f GLOB 'nopqr*') - OR c=7007 - OR (g='gfedcba' AND f GLOB 'klmno*') - ORDER BY a - } -} {4 5 7 18 19 20 21 31 32 33 46 57 59 66 68 83 85 88 91 94 scan 0 sort 0} -do_test where7-2.960.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='fedcbaz' AND f GLOB 'qrstu*') - OR (f GLOB '?ghij*' AND f GLOB 'fghi*') - OR (g='xwvutsr' AND f GLOB 'efghi*') - OR f='hijklmnop' - OR c=11011 - OR ((a BETWEEN 66 AND 68) AND a!=67) - OR (d>=46.0 AND d<47.0 AND d NOT NULL) - OR (g='utsrqpo' AND f GLOB 'stuvw*') - OR (g='gfedcba' AND f GLOB 'nopqr*') - OR c=7007 - OR (g='gfedcba' AND f GLOB 'klmno*') - ORDER BY a - } -} {4 5 7 18 19 20 21 31 32 33 46 57 59 66 68 83 85 88 91 94 scan 0 sort 0} -do_test where7-2.961.1 { - count_steps { - SELECT a FROM t2 - WHERE b=451 - OR a=46 - OR a=52 - OR b=462 - OR b=916 - OR (d>=9.0 AND d<10.0 AND d NOT NULL) - OR f='efghijklm' - OR (g='onmlkji' AND f GLOB 'abcde*') - OR ((a BETWEEN 15 AND 17) AND a!=16) - OR (g='wvutsrq' AND f GLOB 'jklmn*') - OR (d>=14.0 AND d<15.0 AND d NOT NULL) - ORDER BY a - } -} {4 9 14 15 17 30 41 42 46 52 56 82 scan 0 sort 0} -do_test where7-2.961.2 { - count_steps { - SELECT a FROM t3 - WHERE b=451 - OR a=46 - OR a=52 - OR b=462 - OR b=916 - OR (d>=9.0 AND d<10.0 AND d NOT NULL) - OR f='efghijklm' - OR (g='onmlkji' AND f GLOB 'abcde*') - OR ((a BETWEEN 15 AND 17) AND a!=16) - OR (g='wvutsrq' AND f GLOB 'jklmn*') - OR (d>=14.0 AND d<15.0 AND d NOT NULL) - ORDER BY a - } -} {4 9 14 15 17 30 41 42 46 52 56 82 scan 0 sort 0} -do_test where7-2.962.1 { - count_steps { - SELECT a FROM t2 - WHERE c=12012 - OR (g='jihgfed' AND f GLOB 'vwxyz*') - OR (g='hgfedcb' AND f GLOB 'ghijk*') - OR a=32 - OR ((a BETWEEN 7 AND 9) AND a!=8) - OR a=14 - ORDER BY a - } -} {7 9 14 32 34 35 36 73 84 scan 0 sort 0} -do_test where7-2.962.2 { - count_steps { - SELECT a FROM t3 - WHERE c=12012 - OR (g='jihgfed' AND f GLOB 'vwxyz*') - OR (g='hgfedcb' AND f GLOB 'ghijk*') - OR a=32 - OR ((a BETWEEN 7 AND 9) AND a!=8) - OR a=14 - ORDER BY a - } -} {7 9 14 32 34 35 36 73 84 scan 0 sort 0} -do_test where7-2.963.1 { - count_steps { - SELECT a FROM t2 - WHERE f='efghijklm' - OR b=473 - OR (d>=97.0 AND d<98.0 AND d NOT NULL) - ORDER BY a - } -} {4 30 43 56 82 97 scan 0 sort 0} -do_test where7-2.963.2 { - count_steps { - SELECT a FROM t3 - WHERE f='efghijklm' - OR b=473 - OR (d>=97.0 AND d<98.0 AND d NOT NULL) - ORDER BY a - } -} {4 30 43 56 82 97 scan 0 sort 0} -do_test where7-2.964.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='srqponm' AND f GLOB 'defgh*') - OR a=99 - OR f='efghijklm' - OR (d>=55.0 AND d<56.0 AND d NOT NULL) - OR (g='gfedcba' AND f GLOB 'mnopq*') - OR b=517 - ORDER BY a - } -} {4 29 30 47 55 56 82 90 99 scan 0 sort 0} -do_test where7-2.964.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='srqponm' AND f GLOB 'defgh*') - OR a=99 - OR f='efghijklm' - OR (d>=55.0 AND d<56.0 AND d NOT NULL) - OR (g='gfedcba' AND f GLOB 'mnopq*') - OR b=517 - ORDER BY a - } -} {4 29 30 47 55 56 82 90 99 scan 0 sort 0} -do_test where7-2.965.1 { - count_steps { - SELECT a FROM t2 - WHERE b=1034 - OR (d>=54.0 AND d<55.0 AND d NOT NULL) - OR (d>=83.0 AND d<84.0 AND d NOT NULL) - OR (g='nmlkjih' AND f GLOB 'cdefg*') - ORDER BY a - } -} {54 83 94 scan 0 sort 0} -do_test where7-2.965.2 { - count_steps { - SELECT a FROM t3 - WHERE b=1034 - OR (d>=54.0 AND d<55.0 AND d NOT NULL) - OR (d>=83.0 AND d<84.0 AND d NOT NULL) - OR (g='nmlkjih' AND f GLOB 'cdefg*') - ORDER BY a - } -} {54 83 94 scan 0 sort 0} -do_test where7-2.966.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=79.0 AND d<80.0 AND d NOT NULL) - OR b=1004 - OR (d>=20.0 AND d<21.0 AND d NOT NULL) - OR b=363 - OR (g='tsrqpon' AND f GLOB 'yzabc*') - ORDER BY a - } -} {20 24 33 79 scan 0 sort 0} -do_test where7-2.966.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=79.0 AND d<80.0 AND d NOT NULL) - OR b=1004 - OR (d>=20.0 AND d<21.0 AND d NOT NULL) - OR b=363 - OR (g='tsrqpon' AND f GLOB 'yzabc*') - ORDER BY a - } -} {20 24 33 79 scan 0 sort 0} -do_test where7-2.967.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=67.0 AND d<68.0 AND d NOT NULL) - OR (g='jihgfed' AND f GLOB 'vwxyz*') - OR (d>=15.0 AND d<16.0 AND d NOT NULL) - OR ((a BETWEEN 98 AND 100) AND a!=99) - OR (f GLOB '?klmn*' AND f GLOB 'jklm*') - OR (g='hgfedcb' AND f GLOB 'ijklm*') - OR a=14 - OR ((a BETWEEN 12 AND 14) AND a!=13) - OR a=15 - OR b=795 - OR c=27027 - ORDER BY a - } -} {9 12 14 15 35 61 67 73 79 80 81 86 87 98 100 scan 0 sort 0} -do_test where7-2.967.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=67.0 AND d<68.0 AND d NOT NULL) - OR (g='jihgfed' AND f GLOB 'vwxyz*') - OR (d>=15.0 AND d<16.0 AND d NOT NULL) - OR ((a BETWEEN 98 AND 100) AND a!=99) - OR (f GLOB '?klmn*' AND f GLOB 'jklm*') - OR (g='hgfedcb' AND f GLOB 'ijklm*') - OR a=14 - OR ((a BETWEEN 12 AND 14) AND a!=13) - OR a=15 - OR b=795 - OR c=27027 - ORDER BY a - } -} {9 12 14 15 35 61 67 73 79 80 81 86 87 98 100 scan 0 sort 0} -do_test where7-2.968.1 { - count_steps { - SELECT a FROM t2 - WHERE b=795 - OR (g='utsrqpo' AND f GLOB 'wxyza*') - ORDER BY a - } -} {22 scan 0 sort 0} -do_test where7-2.968.2 { - count_steps { - SELECT a FROM t3 - WHERE b=795 - OR (g='utsrqpo' AND f GLOB 'wxyza*') - ORDER BY a - } -} {22 scan 0 sort 0} -do_test where7-2.969.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 9 AND 11) AND a!=10) - OR (g='kjihgfe' AND f GLOB 'stuvw*') - OR c=17017 - OR c=26026 - OR (g='mlkjihg' AND f GLOB 'jklmn*') - OR (f GLOB '?defg*' AND f GLOB 'cdef*') - OR (g='nmlkjih' AND f GLOB 'cdefg*') - OR (d>=21.0 AND d<22.0 AND d NOT NULL) - ORDER BY a - } -} {2 9 11 21 28 49 50 51 54 61 70 76 77 78 80 scan 0 sort 0} -do_test where7-2.969.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 9 AND 11) AND a!=10) - OR (g='kjihgfe' AND f GLOB 'stuvw*') - OR c=17017 - OR c=26026 - OR (g='mlkjihg' AND f GLOB 'jklmn*') - OR (f GLOB '?defg*' AND f GLOB 'cdef*') - OR (g='nmlkjih' AND f GLOB 'cdefg*') - OR (d>=21.0 AND d<22.0 AND d NOT NULL) - ORDER BY a - } -} {2 9 11 21 28 49 50 51 54 61 70 76 77 78 80 scan 0 sort 0} -do_test where7-2.970.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=69.0 AND d<70.0 AND d NOT NULL) - OR (d>=28.0 AND d<29.0 AND d NOT NULL) - OR b=891 - OR (d>=97.0 AND d<98.0 AND d NOT NULL) - OR ((a BETWEEN 43 AND 45) AND a!=44) - OR b=693 - ORDER BY a - } -} {28 43 45 63 69 81 97 scan 0 sort 0} -do_test where7-2.970.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=69.0 AND d<70.0 AND d NOT NULL) - OR (d>=28.0 AND d<29.0 AND d NOT NULL) - OR b=891 - OR (d>=97.0 AND d<98.0 AND d NOT NULL) - OR ((a BETWEEN 43 AND 45) AND a!=44) - OR b=693 - ORDER BY a - } -} {28 43 45 63 69 81 97 scan 0 sort 0} -do_test where7-2.971.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=42.0 AND d<43.0 AND d NOT NULL) - OR b=1015 - OR a=28 - OR f='lmnopqrst' - OR b=583 - OR a=75 - OR a=22 - OR a=87 - OR b=795 - OR b=649 - OR (g='qponmlk' AND f GLOB 'qrstu*') - ORDER BY a - } -} {11 22 28 37 42 53 59 63 75 87 89 scan 0 sort 0} -do_test where7-2.971.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=42.0 AND d<43.0 AND d NOT NULL) - OR b=1015 - OR a=28 - OR f='lmnopqrst' - OR b=583 - OR a=75 - OR a=22 - OR a=87 - OR b=795 - OR b=649 - OR (g='qponmlk' AND f GLOB 'qrstu*') - ORDER BY a - } -} {11 22 28 37 42 53 59 63 75 87 89 scan 0 sort 0} -do_test where7-2.972.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='ponmlkj' AND f GLOB 'stuvw*') - OR b=209 - OR b=674 - OR f='hijklmnop' - OR (g='fedcbaz' AND f GLOB 'qrstu*') - OR (d>=28.0 AND d<29.0 AND d NOT NULL) - OR f IS NULL - OR a=41 - OR ((a BETWEEN 33 AND 35) AND a!=34) - OR ((a BETWEEN 92 AND 94) AND a!=93) - ORDER BY a - } -} {7 19 28 33 35 41 44 59 85 92 94 scan 0 sort 0} -do_test where7-2.972.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='ponmlkj' AND f GLOB 'stuvw*') - OR b=209 - OR b=674 - OR f='hijklmnop' - OR (g='fedcbaz' AND f GLOB 'qrstu*') - OR (d>=28.0 AND d<29.0 AND d NOT NULL) - OR f IS NULL - OR a=41 - OR ((a BETWEEN 33 AND 35) AND a!=34) - OR ((a BETWEEN 92 AND 94) AND a!=93) - ORDER BY a - } -} {7 19 28 33 35 41 44 59 85 92 94 scan 0 sort 0} -do_test where7-2.973.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='kjihgfe' AND f GLOB 'rstuv*') - OR (d>=69.0 AND d<70.0 AND d NOT NULL) - OR ((a BETWEEN 66 AND 68) AND a!=67) - OR b=429 - OR b=718 - ORDER BY a - } -} {39 66 68 69 scan 0 sort 0} -do_test where7-2.973.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='kjihgfe' AND f GLOB 'rstuv*') - OR (d>=69.0 AND d<70.0 AND d NOT NULL) - OR ((a BETWEEN 66 AND 68) AND a!=67) - OR b=429 - OR b=718 - ORDER BY a - } -} {39 66 68 69 scan 0 sort 0} -do_test where7-2.974.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='utsrqpo' AND f GLOB 'uvwxy*') - OR (d>=27.0 AND d<28.0 AND d NOT NULL) - OR b=451 - OR (g='gfedcba' AND f GLOB 'opqrs*') - ORDER BY a - } -} {20 27 41 92 scan 0 sort 0} -do_test where7-2.974.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='utsrqpo' AND f GLOB 'uvwxy*') - OR (d>=27.0 AND d<28.0 AND d NOT NULL) - OR b=451 - OR (g='gfedcba' AND f GLOB 'opqrs*') - ORDER BY a - } -} {20 27 41 92 scan 0 sort 0} -do_test where7-2.975.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 7 AND 9) AND a!=8) - OR b=245 - OR b=1092 - OR (g='gfedcba' AND f GLOB 'nopqr*') - OR a=92 - OR b=528 - OR b=267 - OR f='xyzabcdef' - OR b=231 - ORDER BY a - } -} {7 9 21 23 48 49 75 91 92 scan 0 sort 0} -do_test where7-2.975.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 7 AND 9) AND a!=8) - OR b=245 - OR b=1092 - OR (g='gfedcba' AND f GLOB 'nopqr*') - OR a=92 - OR b=528 - OR b=267 - OR f='xyzabcdef' - OR b=231 - ORDER BY a - } -} {7 9 21 23 48 49 75 91 92 scan 0 sort 0} -do_test where7-2.976.1 { - count_steps { - SELECT a FROM t2 - WHERE b=883 - OR b=982 - OR (g='wvutsrq' AND f GLOB 'mnopq*') - OR b=718 - OR b=1048 - ORDER BY a - } -} {12 scan 0 sort 0} -do_test where7-2.976.2 { - count_steps { - SELECT a FROM t3 - WHERE b=883 - OR b=982 - OR (g='wvutsrq' AND f GLOB 'mnopq*') - OR b=718 - OR b=1048 - ORDER BY a - } -} {12 scan 0 sort 0} -do_test where7-2.977.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=87.0 AND d<88.0 AND d NOT NULL) - OR a=53 - OR b=366 - OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') - ORDER BY a - } -} {15 41 53 67 87 93 scan 0 sort 0} -do_test where7-2.977.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=87.0 AND d<88.0 AND d NOT NULL) - OR a=53 - OR b=366 - OR (f GLOB '?qrst*' AND f GLOB 'pqrs*') - ORDER BY a - } -} {15 41 53 67 87 93 scan 0 sort 0} -do_test where7-2.978.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=40.0 AND d<41.0 AND d NOT NULL) - OR b=498 - OR (f GLOB '?fghi*' AND f GLOB 'efgh*') - OR a=19 - OR (g='hgfedcb' AND f GLOB 'ghijk*') - ORDER BY a - } -} {4 19 30 40 56 82 84 scan 0 sort 0} -do_test where7-2.978.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=40.0 AND d<41.0 AND d NOT NULL) - OR b=498 - OR (f GLOB '?fghi*' AND f GLOB 'efgh*') - OR a=19 - OR (g='hgfedcb' AND f GLOB 'ghijk*') - ORDER BY a - } -} {4 19 30 40 56 82 84 scan 0 sort 0} -do_test where7-2.979.1 { - count_steps { - SELECT a FROM t2 - WHERE (f GLOB '?abcd*' AND f GLOB 'zabc*') - OR (f GLOB '?vwxy*' AND f GLOB 'uvwx*') - OR a=82 - OR b=550 - OR (g='gfedcba' AND f GLOB 'lmnop*') - OR e IS NULL - OR b=971 - OR (d>=87.0 AND d<88.0 AND d NOT NULL) - ORDER BY a - } -} {20 25 46 50 51 72 77 82 87 89 98 scan 0 sort 0} -do_test where7-2.979.2 { - count_steps { - SELECT a FROM t3 - WHERE (f GLOB '?abcd*' AND f GLOB 'zabc*') - OR (f GLOB '?vwxy*' AND f GLOB 'uvwx*') - OR a=82 - OR b=550 - OR (g='gfedcba' AND f GLOB 'lmnop*') - OR e IS NULL - OR b=971 - OR (d>=87.0 AND d<88.0 AND d NOT NULL) - ORDER BY a - } -} {20 25 46 50 51 72 77 82 87 89 98 scan 0 sort 0} -do_test where7-2.980.1 { - count_steps { - SELECT a FROM t2 - WHERE c=12012 - OR ((a BETWEEN 94 AND 96) AND a!=95) - OR b=1103 - OR ((a BETWEEN 94 AND 96) AND a!=95) - OR (g='ihgfedc' AND f GLOB 'cdefg*') - OR (g='qponmlk' AND f GLOB 'mnopq*') - OR a=32 - OR b=352 - OR b=297 - OR 1000000=63.0 AND d<64.0 AND d NOT NULL) - OR a=25 - OR b=792 - OR f='cdefghijk' - OR a=73 - OR a=8 - ORDER BY a - } -} {2 8 25 28 49 54 63 72 73 80 scan 0 sort 0} -do_test where7-2.981.2 { - count_steps { - SELECT a FROM t3 - WHERE b=539 - OR (d>=63.0 AND d<64.0 AND d NOT NULL) - OR a=25 - OR b=792 - OR f='cdefghijk' - OR a=73 - OR a=8 - ORDER BY a - } -} {2 8 25 28 49 54 63 72 73 80 scan 0 sort 0} -do_test where7-2.982.1 { - count_steps { - SELECT a FROM t2 - WHERE (g='edcbazy' AND f GLOB 'uvwxy*') - OR ((a BETWEEN 76 AND 78) AND a!=77) - OR b=630 - OR ((a BETWEEN 23 AND 25) AND a!=24) - OR f='hijklmnop' - OR ((a BETWEEN 28 AND 30) AND a!=29) - OR b=572 - OR (g='fedcbaz' AND f GLOB 'rstuv*') - ORDER BY a - } -} {7 23 25 28 30 33 52 59 76 78 85 95 98 scan 0 sort 0} -do_test where7-2.982.2 { - count_steps { - SELECT a FROM t3 - WHERE (g='edcbazy' AND f GLOB 'uvwxy*') - OR ((a BETWEEN 76 AND 78) AND a!=77) - OR b=630 - OR ((a BETWEEN 23 AND 25) AND a!=24) - OR f='hijklmnop' - OR ((a BETWEEN 28 AND 30) AND a!=29) - OR b=572 - OR (g='fedcbaz' AND f GLOB 'rstuv*') - ORDER BY a - } -} {7 23 25 28 30 33 52 59 76 78 85 95 98 scan 0 sort 0} -do_test where7-2.983.1 { - count_steps { - SELECT a FROM t2 - WHERE a=12 - OR b=132 - OR ((a BETWEEN 51 AND 53) AND a!=52) - OR (d>=91.0 AND d<92.0 AND d NOT NULL) - OR (g='srqponm' AND f GLOB 'defgh*') - OR (g='qponmlk' AND f GLOB 'nopqr*') - OR a=43 - OR b=539 - OR (d>=49.0 AND d<50.0 AND d NOT NULL) - OR b=847 - OR ((a BETWEEN 39 AND 41) AND a!=40) - ORDER BY a - } -} {12 29 39 41 43 49 51 53 77 91 scan 0 sort 0} -do_test where7-2.983.2 { - count_steps { - SELECT a FROM t3 - WHERE a=12 - OR b=132 - OR ((a BETWEEN 51 AND 53) AND a!=52) - OR (d>=91.0 AND d<92.0 AND d NOT NULL) - OR (g='srqponm' AND f GLOB 'defgh*') - OR (g='qponmlk' AND f GLOB 'nopqr*') - OR a=43 - OR b=539 - OR (d>=49.0 AND d<50.0 AND d NOT NULL) - OR b=847 - OR ((a BETWEEN 39 AND 41) AND a!=40) - ORDER BY a - } -} {12 29 39 41 43 49 51 53 77 91 scan 0 sort 0} -do_test where7-2.984.1 { - count_steps { - SELECT a FROM t2 - WHERE b=1045 - OR a=30 - OR (d>=69.0 AND d<70.0 AND d NOT NULL) - OR c=31031 - OR a=70 - OR ((a BETWEEN 56 AND 58) AND a!=57) - ORDER BY a - } -} {30 56 58 69 70 91 92 93 95 scan 0 sort 0} -do_test where7-2.984.2 { - count_steps { - SELECT a FROM t3 - WHERE b=1045 - OR a=30 - OR (d>=69.0 AND d<70.0 AND d NOT NULL) - OR c=31031 - OR a=70 - OR ((a BETWEEN 56 AND 58) AND a!=57) - ORDER BY a - } -} {30 56 58 69 70 91 92 93 95 scan 0 sort 0} -do_test where7-2.985.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=63.0 AND d<64.0 AND d NOT NULL) - OR a=11 - OR a=17 - OR a=2 - OR (d>=43.0 AND d<44.0 AND d NOT NULL) - OR ((a BETWEEN 57 AND 59) AND a!=58) - OR (g='kjihgfe' AND f GLOB 'rstuv*') - OR b=814 - ORDER BY a - } -} {2 11 17 43 57 59 63 69 74 scan 0 sort 0} -do_test where7-2.985.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=63.0 AND d<64.0 AND d NOT NULL) - OR a=11 - OR a=17 - OR a=2 - OR (d>=43.0 AND d<44.0 AND d NOT NULL) - OR ((a BETWEEN 57 AND 59) AND a!=58) - OR (g='kjihgfe' AND f GLOB 'rstuv*') - OR b=814 - ORDER BY a - } -} {2 11 17 43 57 59 63 69 74 scan 0 sort 0} -do_test where7-2.986.1 { - count_steps { - SELECT a FROM t2 - WHERE b=561 - OR f='vwxyzabcd' - ORDER BY a - } -} {21 47 51 73 99 scan 0 sort 0} -do_test where7-2.986.2 { - count_steps { - SELECT a FROM t3 - WHERE b=561 - OR f='vwxyzabcd' - ORDER BY a - } -} {21 47 51 73 99 scan 0 sort 0} -do_test where7-2.987.1 { - count_steps { - SELECT a FROM t2 - WHERE b=113 - OR a=34 - OR b=858 - OR ((a BETWEEN 85 AND 87) AND a!=86) - ORDER BY a - } -} {34 78 85 87 scan 0 sort 0} -do_test where7-2.987.2 { - count_steps { - SELECT a FROM t3 - WHERE b=113 - OR a=34 - OR b=858 - OR ((a BETWEEN 85 AND 87) AND a!=86) - ORDER BY a - } -} {34 78 85 87 scan 0 sort 0} -do_test where7-2.988.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=53.0 AND d<54.0 AND d NOT NULL) - OR (g='rqponml' AND f GLOB 'lmnop*') - OR (d>=3.0 AND d<4.0 AND d NOT NULL) - OR (d>=80.0 AND d<81.0 AND d NOT NULL) - OR (g='rqponml' AND f GLOB 'lmnop*') - OR b=319 - ORDER BY a - } -} {3 29 37 53 80 scan 0 sort 0} -do_test where7-2.988.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=53.0 AND d<54.0 AND d NOT NULL) - OR (g='rqponml' AND f GLOB 'lmnop*') - OR (d>=3.0 AND d<4.0 AND d NOT NULL) - OR (d>=80.0 AND d<81.0 AND d NOT NULL) - OR (g='rqponml' AND f GLOB 'lmnop*') - OR b=319 - ORDER BY a - } -} {3 29 37 53 80 scan 0 sort 0} -do_test where7-2.989.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=80.0 AND d<81.0 AND d NOT NULL) - OR (d>=54.0 AND d<55.0 AND d NOT NULL) - OR ((a BETWEEN 92 AND 94) AND a!=93) - OR a=80 - OR (g='fedcbaz' AND f GLOB 'stuvw*') - OR (d>=89.0 AND d<90.0 AND d NOT NULL) - ORDER BY a - } -} {54 80 89 92 94 96 scan 0 sort 0} -do_test where7-2.989.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=80.0 AND d<81.0 AND d NOT NULL) - OR (d>=54.0 AND d<55.0 AND d NOT NULL) - OR ((a BETWEEN 92 AND 94) AND a!=93) - OR a=80 - OR (g='fedcbaz' AND f GLOB 'stuvw*') - OR (d>=89.0 AND d<90.0 AND d NOT NULL) - ORDER BY a - } -} {54 80 89 92 94 96 scan 0 sort 0} -do_test where7-2.990.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 39 AND 41) AND a!=40) - OR b=1103 - OR b=751 - OR a=18 - OR f='nopqrstuv' - OR ((a BETWEEN 35 AND 37) AND a!=36) - OR b=550 - OR ((a BETWEEN 93 AND 95) AND a!=94) - ORDER BY a - } -} {13 18 35 37 39 41 50 65 91 93 95 scan 0 sort 0} -do_test where7-2.990.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 39 AND 41) AND a!=40) - OR b=1103 - OR b=751 - OR a=18 - OR f='nopqrstuv' - OR ((a BETWEEN 35 AND 37) AND a!=36) - OR b=550 - OR ((a BETWEEN 93 AND 95) AND a!=94) - ORDER BY a - } -} {13 18 35 37 39 41 50 65 91 93 95 scan 0 sort 0} -do_test where7-2.991.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 16 AND 18) AND a!=17) - OR (g='ihgfedc' AND f GLOB 'abcde*') - OR a=33 - OR c=4004 - OR (f GLOB '?opqr*' AND f GLOB 'nopq*') - ORDER BY a - } -} {10 11 12 13 16 18 33 39 65 78 91 scan 0 sort 0} -do_test where7-2.991.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 16 AND 18) AND a!=17) - OR (g='ihgfedc' AND f GLOB 'abcde*') - OR a=33 - OR c=4004 - OR (f GLOB '?opqr*' AND f GLOB 'nopq*') - ORDER BY a - } -} {10 11 12 13 16 18 33 39 65 78 91 scan 0 sort 0} -do_test where7-2.992.1 { - count_steps { - SELECT a FROM t2 - WHERE d>1e10 - OR ((a BETWEEN 38 AND 40) AND a!=39) - OR a=81 - OR a=28 - OR (g='srqponm' AND f GLOB 'cdefg*') - OR f='uvwxyzabc' - OR (f GLOB '?efgh*' AND f GLOB 'defg*') - OR (g='edcbazy' AND f GLOB 'uvwxy*') - ORDER BY a - } -} {3 20 28 29 38 40 46 55 72 81 98 scan 0 sort 0} -do_test where7-2.992.2 { - count_steps { - SELECT a FROM t3 - WHERE d>1e10 - OR ((a BETWEEN 38 AND 40) AND a!=39) - OR a=81 - OR a=28 - OR (g='srqponm' AND f GLOB 'cdefg*') - OR f='uvwxyzabc' - OR (f GLOB '?efgh*' AND f GLOB 'defg*') - OR (g='edcbazy' AND f GLOB 'uvwxy*') - ORDER BY a - } -} {3 20 28 29 38 40 46 55 72 81 98 scan 0 sort 0} -do_test where7-2.993.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 96 AND 98) AND a!=97) - OR (d>=44.0 AND d<45.0 AND d NOT NULL) - ORDER BY a - } -} {44 96 98 scan 0 sort 0} -do_test where7-2.993.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 96 AND 98) AND a!=97) - OR (d>=44.0 AND d<45.0 AND d NOT NULL) - ORDER BY a - } -} {44 96 98 scan 0 sort 0} -do_test where7-2.994.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 67 AND 69) AND a!=68) - OR b=99 - OR b=80 - OR ((a BETWEEN 93 AND 95) AND a!=94) - ORDER BY a - } -} {9 67 69 93 95 scan 0 sort 0} -do_test where7-2.994.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 67 AND 69) AND a!=68) - OR b=99 - OR b=80 - OR ((a BETWEEN 93 AND 95) AND a!=94) - ORDER BY a - } -} {9 67 69 93 95 scan 0 sort 0} -do_test where7-2.995.1 { - count_steps { - SELECT a FROM t2 - WHERE b=322 - OR ((a BETWEEN 4 AND 6) AND a!=5) - OR (g='ihgfedc' AND f GLOB 'bcdef*') - ORDER BY a - } -} {4 6 79 scan 0 sort 0} -do_test where7-2.995.2 { - count_steps { - SELECT a FROM t3 - WHERE b=322 - OR ((a BETWEEN 4 AND 6) AND a!=5) - OR (g='ihgfedc' AND f GLOB 'bcdef*') - ORDER BY a - } -} {4 6 79 scan 0 sort 0} -do_test where7-2.996.1 { - count_steps { - SELECT a FROM t2 - WHERE a=94 - OR c=13013 - OR c=10010 - OR (g='ponmlkj' AND f GLOB 'tuvwx*') - OR b=330 - OR (g='edcbazy' AND f GLOB 'vwxyz*') - OR (g='qponmlk' AND f GLOB 'pqrst*') - ORDER BY a - } -} {28 29 30 37 38 39 41 45 94 99 scan 0 sort 0} -do_test where7-2.996.2 { - count_steps { - SELECT a FROM t3 - WHERE a=94 - OR c=13013 - OR c=10010 - OR (g='ponmlkj' AND f GLOB 'tuvwx*') - OR b=330 - OR (g='edcbazy' AND f GLOB 'vwxyz*') - OR (g='qponmlk' AND f GLOB 'pqrst*') - ORDER BY a - } -} {28 29 30 37 38 39 41 45 94 99 scan 0 sort 0} -do_test where7-2.997.1 { - count_steps { - SELECT a FROM t2 - WHERE b=253 - OR (d>=68.0 AND d<69.0 AND d NOT NULL) - OR a=23 - OR (d>=90.0 AND d<91.0 AND d NOT NULL) - OR a=33 - OR ((a BETWEEN 54 AND 56) AND a!=55) - OR b=993 - OR (d>=71.0 AND d<72.0 AND d NOT NULL) - OR b=982 - OR (g='yxwvuts' AND f GLOB 'bcdef*') - ORDER BY a - } -} {1 23 33 54 56 68 71 90 scan 0 sort 0} -do_test where7-2.997.2 { - count_steps { - SELECT a FROM t3 - WHERE b=253 - OR (d>=68.0 AND d<69.0 AND d NOT NULL) - OR a=23 - OR (d>=90.0 AND d<91.0 AND d NOT NULL) - OR a=33 - OR ((a BETWEEN 54 AND 56) AND a!=55) - OR b=993 - OR (d>=71.0 AND d<72.0 AND d NOT NULL) - OR b=982 - OR (g='yxwvuts' AND f GLOB 'bcdef*') - ORDER BY a - } -} {1 23 33 54 56 68 71 90 scan 0 sort 0} -do_test where7-2.998.1 { - count_steps { - SELECT a FROM t2 - WHERE b=190 - OR (d>=81.0 AND d<82.0 AND d NOT NULL) - OR ((a BETWEEN 39 AND 41) AND a!=40) - OR b=124 - OR (g='srqponm' AND f GLOB 'defgh*') - OR f='vwxyzabcd' - OR ((a BETWEEN 5 AND 7) AND a!=6) - OR (g='ihgfedc' AND f GLOB 'bcdef*') - OR a=72 - OR a=82 - ORDER BY a - } -} {5 7 21 29 39 41 47 72 73 79 81 82 99 scan 0 sort 0} -do_test where7-2.998.2 { - count_steps { - SELECT a FROM t3 - WHERE b=190 - OR (d>=81.0 AND d<82.0 AND d NOT NULL) - OR ((a BETWEEN 39 AND 41) AND a!=40) - OR b=124 - OR (g='srqponm' AND f GLOB 'defgh*') - OR f='vwxyzabcd' - OR ((a BETWEEN 5 AND 7) AND a!=6) - OR (g='ihgfedc' AND f GLOB 'bcdef*') - OR a=72 - OR a=82 - ORDER BY a - } -} {5 7 21 29 39 41 47 72 73 79 81 82 99 scan 0 sort 0} -do_test where7-2.999.1 { - count_steps { - SELECT a FROM t2 - WHERE ((a BETWEEN 20 AND 22) AND a!=21) - OR a=50 - OR (d>=10.0 AND d<11.0 AND d NOT NULL) - OR b=949 - ORDER BY a - } -} {10 20 22 50 scan 0 sort 0} -do_test where7-2.999.2 { - count_steps { - SELECT a FROM t3 - WHERE ((a BETWEEN 20 AND 22) AND a!=21) - OR a=50 - OR (d>=10.0 AND d<11.0 AND d NOT NULL) - OR b=949 - ORDER BY a - } -} {10 20 22 50 scan 0 sort 0} -do_test where7-2.1000.1 { - count_steps { - SELECT a FROM t2 - WHERE b=388 - OR ((a BETWEEN 4 AND 6) AND a!=5) - ORDER BY a - } -} {4 6 scan 0 sort 0} -do_test where7-2.1000.2 { - count_steps { - SELECT a FROM t3 - WHERE b=388 - OR ((a BETWEEN 4 AND 6) AND a!=5) - ORDER BY a - } -} {4 6 scan 0 sort 0} -do_test where7-2.1001.1 { - count_steps { - SELECT a FROM t2 - WHERE (d>=15.0 AND d<16.0 AND d NOT NULL) - OR a=6 - OR b=429 - OR (d>=89.0 AND d<90.0 AND d NOT NULL) - OR b=77 - OR (d>=66.0 AND d<67.0 AND d NOT NULL) - OR a=90 - OR a=54 - OR (g='fedcbaz' AND f GLOB 'qrstu*') - ORDER BY a - } -} {6 7 15 39 54 66 89 90 94 scan 0 sort 0} -do_test where7-2.1001.2 { - count_steps { - SELECT a FROM t3 - WHERE (d>=15.0 AND d<16.0 AND d NOT NULL) - OR a=6 - OR b=429 - OR (d>=89.0 AND d<90.0 AND d NOT NULL) - OR b=77 - OR (d>=66.0 AND d<67.0 AND d NOT NULL) - OR a=90 - OR a=54 - OR (g='fedcbaz' AND f GLOB 'qrstu*') - ORDER BY a - } -} {6 7 15 39 54 66 89 90 94 scan 0 sort 0} -finish_test DELETED test/where8.test Index: test/where8.test ================================================================== --- test/where8.test +++ /dev/null @@ -1,663 +0,0 @@ -# 2008 December 23 -# -# The author disclaims copyright to this source code. In place of -# a legal notice, here is a blessing: -# -# May you do good and not evil. -# May you find forgiveness for yourself and forgive others. -# May you share freely, never taking more than you give. -# -#*********************************************************************** -# This file implements regression tests for SQLite library. The focus -# is testing of where.c. More specifically, the focus is the optimization -# of WHERE clauses that feature the OR operator. -# -# $Id: where8.test,v 1.5 2008/12/30 16:13:05 danielk1977 Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -# Test organization: -# -# where8-1.*: Tests to demonstrate simple cases work with a single table -# in the FROM clause. -# -# where8-2.*: Tests surrounding virtual tables and the OR optimization. -# -# where8-3.*: Tests with more than one table in the FROM clause. -# - -proc execsql_status {sql {db db}} { - set result [uplevel $db eval [list $sql]] - concat $result [db status step] [db status sort] -} - -proc execsql_status2 {sql {db db}} { - set ::sqlite_search_count 0 - set result [uplevel [list execsql_status $sql $db]] - concat $result $::sqlite_search_count -} - -do_test where8-1.1 { - execsql { - CREATE TABLE t1(a, b, c); - CREATE INDEX i1 ON t1(a); - CREATE INDEX i2 ON t1(b); - - INSERT INTO t1 VALUES(1, 'one', 'I'); - INSERT INTO t1 VALUES(2, 'two', 'II'); - INSERT INTO t1 VALUES(3, 'three', 'III'); - INSERT INTO t1 VALUES(4, 'four', 'IV'); - INSERT INTO t1 VALUES(5, 'five', 'V'); - INSERT INTO t1 VALUES(6, 'six', 'VI'); - INSERT INTO t1 VALUES(7, 'seven', 'VII'); - INSERT INTO t1 VALUES(8, 'eight', 'VIII'); - INSERT INTO t1 VALUES(9, 'nine', 'IX'); - INSERT INTO t1 VALUES(10, 'ten', 'X'); - } -} {} - -do_test where8-1.2 { - execsql_status2 { SELECT c FROM t1 WHERE a = 1 OR b = 'nine' } -} {I IX 0 0 6} - -do_test where8-1.3 { - execsql_status2 { SELECT c FROM t1 WHERE a > 8 OR b = 'two' } -} {II IX X 0 0 6} - -do_test where8-1.4 { - execsql_status2 { SELECT c FROM t1 WHERE a > 8 OR b GLOB 't*' } -} {II III IX X 0 0 9} - -do_test where8-1.5 { - execsql_status2 { SELECT c FROM t1 WHERE a > 8 OR b GLOB 'f*' } -} {IV V IX X 0 0 9} - -do_test where8-1.6 { - execsql_status { SELECT c FROM t1 WHERE a = 1 OR b = 'three' ORDER BY rowid } -} {I III 0 0} - -do_test where8-1.7 { - execsql_status { SELECT c FROM t1 WHERE a = 1 OR b = 'three' ORDER BY a } -} {I III 0 1} - -do_test where8-1.8 { - # 18 searches. 9 on the index cursor and 9 on the table cursor. - execsql_status2 { SELECT c FROM t1 WHERE a > 1 AND c LIKE 'I%' } -} {II III IV IX 0 0 18} - -do_test where8-1.9 { - execsql_status2 { SELECT c FROM t1 WHERE a >= 9 OR b <= 'eight' } -} {VIII IX X 0 0 6} - -do_test where8-1.10 { - execsql_status2 { - SELECT c FROM t1 WHERE (a >= 9 AND c != 'X') OR b <= 'eight' - } -} {VIII IX 0 0 7} - -do_test where8-1.11 { - execsql_status2 { - SELECT c FROM t1 WHERE (a >= 4 AND a <= 6) OR b = 'nine' - } -} {IV V VI IX 0 0 10} - -do_test where8-1.12.1 { - execsql_status2 { - SELECT c FROM t1 WHERE a IN(1, 2, 3) OR a = 5 - } -} {I II III V 0 0 14} - -do_test where8-1.12.2 { - execsql_status2 { - SELECT c FROM t1 WHERE +a IN(1, 2, 3) OR +a = 5 - } -} {I II III V 9 0 9} - -do_test where8-1.13 { - execsql_status2 { - SELECT c FROM t1 - WHERE a = 2 OR b = 'three' OR a = 4 OR b = 'five' OR a = 6 - ORDER BY rowid - } -} {II III IV V VI 0 0 15} -do_test where8-1.14 { - execsql_status2 { - SELECT c FROM t1 - WHERE - a = 2 OR b = 'three' OR a = 4 OR b = 'five' OR a = 6 OR - b = 'seven' OR a = 8 OR b = 'nine' OR a = 10 - ORDER BY rowid - } -} {II III IV V VI VII VIII IX X 0 0 26} - -do_test where8-1.15 { - execsql_status2 { - SELECT c FROM t1 WHERE - a BETWEEN 2 AND 4 OR b = 'nine' - ORDER BY rowid - } -} {II III IV IX 0 0 10} - - - -#-------------------------------------------------------------------------- -# Tests where8-2.*: Virtual tables -# - -if 0 { -ifcapable vtab { - # Register the 'echo' module used for testing virtual tables. - # - register_echo_module [sqlite3_connection_pointer db] - - do_test where8-2.1 { - execsql { - CREATE VIRTUAL TABLE e1 USING echo(t1); - SELECT b FROM e1; - } - } {one two three four five six seven eight nine ten} - - do_test where8-2.2.1 { - set echo_module "" - execsql { - SELECT c FROM e1 WHERE a=1 OR b='three'; - } - } {I III} - do_test where8-2.2.2 { - set echo_module - } {TODO: What should this be?} -} -} - -#-------------------------------------------------------------------------- -# Tests where8-3.*: Cases with multiple tables in the FROM clause. -# -do_test where8-3.1 { - execsql { - CREATE TABLE t2(d, e, f); - CREATE INDEX i3 ON t2(d); - CREATE INDEX i4 ON t2(e); - - INSERT INTO t2 VALUES(1, NULL, 'I'); - INSERT INTO t2 VALUES(2, 'four', 'IV'); - INSERT INTO t2 VALUES(3, NULL, 'IX'); - INSERT INTO t2 VALUES(4, 'sixteen', 'XVI'); - INSERT INTO t2 VALUES(5, NULL, 'XXV'); - INSERT INTO t2 VALUES(6, 'thirtysix', 'XXXVI'); - INSERT INTO t2 VALUES(7, 'fortynine', 'XLIX'); - INSERT INTO t2 VALUES(8, 'sixtyeight', 'LXIV'); - INSERT INTO t2 VALUES(9, 'eightyone', 'LXXXIX'); - INSERT INTO t2 VALUES(10, NULL, 'C'); - } -} {} - -do_test where8-3.2 { - execsql_status { - SELECT a, d FROM t1, t2 WHERE b=e - } -} {4 2 9 0} - -do_test where8-3.3 { - execsql_status { - SELECT a, d FROM t1, t2 WHERE (a = 2 OR a = 3) AND d = 6 - } -} {2 6 3 6 0 0} - -do_test where8-3.4 { - execsql_status { - SELECT a, d FROM t1, t2 WHERE (a = 2 OR a = 3) AND d = a - } -} {2 2 3 3 0 0} - -do_test where8-3.5 { - execsql_status { - SELECT a, d FROM t1, t2 WHERE (a = 2 OR a = 3) AND (d = a OR e = 'sixteen') - } -} {2 2 2 4 3 3 3 4 0 0} - -do_test where8-3.6 { - # The first part of the WHERE clause in this query, (a=2 OR a=3) is - # transformed into "a IN (2, 3)". This is why the sort is required. - # - execsql_status { - SELECT a, d - FROM t1, t2 - WHERE (a = 2 OR a = 3) AND (d = a OR e = 'sixteen') - ORDER BY t1.rowid - } -} {2 2 2 4 3 3 3 4 0 1} -do_test where8-3.7 { - execsql_status { - SELECT a, d - FROM t1, t2 - WHERE a = 2 AND (d = a OR e = 'sixteen') - ORDER BY t1.rowid - } -} {2 2 2 4 0 0} -do_test where8-3.8 { - execsql_status { - SELECT a, d - FROM t1, t2 - WHERE (a = 2 OR b = 'three') AND (d = a OR e = 'sixteen') - ORDER BY t1.rowid - } -} {2 2 2 4 3 3 3 4 0 0} - -do_test where8-3.9 { - # The "OR c = 'IX'" term forces a linear scan. - execsql_status { - SELECT a, d - FROM t1, t2 - WHERE (a = 2 OR b = 'three' OR c = 'IX') AND (d = a OR e = 'sixteen') - ORDER BY t1.rowid - } -} {2 2 2 4 3 3 3 4 9 4 9 9 9 0} - -do_test where8-3.10 { - execsql_status { - SELECT d FROM t2 WHERE e IS NULL OR e = 'four' - } -} {1 2 3 5 10 0 0} - -do_test where8-3.11 { - execsql_status { - SELECT a, d FROM t1, t2 WHERE (a=d OR b=e) AND a<5 ORDER BY a - } -} {1 1 2 2 3 3 4 2 4 4 0 0} -do_test where8-3.12 { - execsql_status { - SELECT a, d FROM t1, t2 WHERE (a=d OR b=e) AND +a<5 ORDER BY a - } -} {1 1 2 2 3 3 4 2 4 4 0 0} -do_test where8-3.13 { - execsql_status { - SELECT a, d FROM t1, t2 WHERE (a=d OR b=e) AND +a<5 - } -} {1 1 2 2 3 3 4 2 4 4 9 0} - -do_test where8-3.14 { - execsql_status { - SELECT c FROM t1 WHERE a > (SELECT d FROM t2 WHERE e = b) OR a = 5 - } -} {IV V 9 0} - -do_test where8-3.15 { - execsql_status { - SELECT c FROM t1, t2 WHERE a BETWEEN 1 AND 2 OR a = ( - SELECT sum(e IS NULL) FROM t2 AS inner WHERE t2.d>inner.d - ) - } -} {I I I I I I I I I I II II II II II II II II II II III III III III III 99 0} - -#----------------------------------------------------------------------- -# The following tests - where8-4.* - verify that adding or removing -# indexes does not change the results returned by various queries. -# -do_test where8-4.1 { - execsql { - BEGIN; - CREATE TABLE t3(a INTEGER, b REAL, c TEXT); - CREATE TABLE t4(f INTEGER, g REAL, h TEXT); - INSERT INTO t3 VALUES('hills', NULL, 1415926535); - INSERT INTO t3 VALUES('and', 'of', NULL); - INSERT INTO t3 VALUES('have', 'towering', 53594.08128); - INSERT INTO t3 VALUES(NULL, 45.64856692, 'Not'); - INSERT INTO t3 VALUES('same', 5028841971, NULL); - INSERT INTO t3 VALUES('onlookers', 'in', 8214808651); - INSERT INTO t3 VALUES(346.0348610, 2643383279, NULL); - INSERT INTO t3 VALUES(1415926535, 'of', 'are'); - INSERT INTO t3 VALUES(NULL, 0.4811174502, 'snapshots'); - INSERT INTO t3 VALUES('over', 'the', 8628034825); - INSERT INTO t3 VALUES(8628034825, 66.59334461, 2847564.823); - INSERT INTO t3 VALUES('onlookers', 'same', 'and'); - INSERT INTO t3 VALUES(NULL, 'light', 6939937510); - INSERT INTO t3 VALUES('from', 'their', 'viewed'); - INSERT INTO t3 VALUES('from', 'Alpine', 'snapshots'); - INSERT INTO t3 VALUES('from', 'sometimes', 'unalike'); - INSERT INTO t3 VALUES(1339.360726, 'light', 'have'); - INSERT INTO t3 VALUES(6939937510, 3282306647, 'other'); - INSERT INTO t3 VALUES('paintings', 8628034825, 'all'); - INSERT INTO t3 VALUES('paintings', NULL, 'same'); - INSERT INTO t3 VALUES('Alpine', 378678316.5, 'unalike'); - INSERT INTO t3 VALUES('Alpine', NULL, 'same'); - INSERT INTO t3 VALUES(1339.360726, 2847564.823, 'over'); - INSERT INTO t3 VALUES('villages', 'their', 'have'); - INSERT INTO t3 VALUES('unalike', 'remarkably', 'in'); - INSERT INTO t3 VALUES('and', 8979323846, 'and'); - INSERT INTO t3 VALUES(NULL, 1415926535, 'an'); - INSERT INTO t3 VALUES(271.2019091, 8628034825, 0.4811174502); - INSERT INTO t3 VALUES('all', 3421170679, 'the'); - INSERT INTO t3 VALUES('Not', 'and', 1415926535); - INSERT INTO t3 VALUES('of', 'other', 'light'); - INSERT INTO t3 VALUES(NULL, 'towering', 'Not'); - INSERT INTO t3 VALUES(346.0348610, NULL, 'other'); - INSERT INTO t3 VALUES('Not', 378678316.5, NULL); - INSERT INTO t3 VALUES('snapshots', 8628034825, 'of'); - INSERT INTO t3 VALUES(3282306647, 271.2019091, 'and'); - INSERT INTO t3 VALUES(50.58223172, 378678316.5, 5028841971); - INSERT INTO t3 VALUES(50.58223172, 2643383279, 'snapshots'); - INSERT INTO t3 VALUES('writings', 8979323846, 8979323846); - INSERT INTO t3 VALUES('onlookers', 'his', 'in'); - INSERT INTO t3 VALUES('unalike', 8628034825, 1339.360726); - INSERT INTO t3 VALUES('of', 'Alpine', 'and'); - INSERT INTO t3 VALUES('onlookers', NULL, 'from'); - INSERT INTO t3 VALUES('writings', 'it', 1339.360726); - INSERT INTO t3 VALUES('it', 'and', 'villages'); - INSERT INTO t3 VALUES('an', 'the', 'villages'); - INSERT INTO t3 VALUES(8214808651, 8214808651, 'same'); - INSERT INTO t3 VALUES(346.0348610, 'light', 1415926535); - INSERT INTO t3 VALUES(NULL, 8979323846, 'and'); - INSERT INTO t3 VALUES(NULL, 'same', 1339.360726); - INSERT INTO t4 VALUES('his', 'from', 'an'); - INSERT INTO t4 VALUES('snapshots', 'or', NULL); - INSERT INTO t4 VALUES('Alpine', 'have', 'it'); - INSERT INTO t4 VALUES('have', 'peak', 'remarkably'); - INSERT INTO t4 VALUES('hills', NULL, 'Not'); - INSERT INTO t4 VALUES('same', 'from', 2643383279); - INSERT INTO t4 VALUES('have', 'angle', 8628034825); - INSERT INTO t4 VALUES('sometimes', 'it', 2847564.823); - INSERT INTO t4 VALUES(0938446095, 'peak', 'of'); - INSERT INTO t4 VALUES(8628034825, 'and', 'same'); - INSERT INTO t4 VALUES('and', 271.2019091, 'their'); - INSERT INTO t4 VALUES('the', 'of', 'remarkably'); - INSERT INTO t4 VALUES('and', 3421170679, 1415926535); - INSERT INTO t4 VALUES('and', 'in', 'all'); - INSERT INTO t4 VALUES(378678316.5, 0.4811174502, 'snapshots'); - INSERT INTO t4 VALUES('it', 'are', 'have'); - INSERT INTO t4 VALUES('angle', 'snapshots', 378678316.5); - INSERT INTO t4 VALUES('from', 1415926535, 8628034825); - INSERT INTO t4 VALUES('snapshots', 'angle', 'have'); - INSERT INTO t4 VALUES(3421170679, 0938446095, 'Not'); - INSERT INTO t4 VALUES('peak', NULL, 0.4811174502); - INSERT INTO t4 VALUES('same', 'have', 'Alpine'); - INSERT INTO t4 VALUES(271.2019091, 66.59334461, 0938446095); - INSERT INTO t4 VALUES(8979323846, 'his', 'an'); - INSERT INTO t4 VALUES(NULL, 'and', 3282306647); - INSERT INTO t4 VALUES('remarkably', NULL, 'Not'); - INSERT INTO t4 VALUES('villages', 4543.266482, 'his'); - INSERT INTO t4 VALUES(2643383279, 'paintings', 'onlookers'); - INSERT INTO t4 VALUES(1339.360726, 'of', 'the'); - INSERT INTO t4 VALUES('peak', 'other', 'peak'); - INSERT INTO t4 VALUES('it', 'or', 8979323846); - INSERT INTO t4 VALUES('onlookers', 'Not', 'towering'); - INSERT INTO t4 VALUES(NULL, 'peak', 'Not'); - INSERT INTO t4 VALUES('of', 'have', 6939937510); - INSERT INTO t4 VALUES('light', 'hills', 0.4811174502); - INSERT INTO t4 VALUES(5028841971, 'Not', 'it'); - INSERT INTO t4 VALUES('and', 'Not', NULL); - INSERT INTO t4 VALUES(346.0348610, 'villages', NULL); - INSERT INTO t4 VALUES(8979323846, NULL, 6939937510); - INSERT INTO t4 VALUES('an', 'light', 'peak'); - INSERT INTO t4 VALUES(5028841971, 6939937510, 'light'); - INSERT INTO t4 VALUES('sometimes', 'peak', 'peak'); - INSERT INTO t4 VALUES(378678316.5, 5028841971, 'an'); - INSERT INTO t4 VALUES(378678316.5, 'his', 'Alpine'); - INSERT INTO t4 VALUES('from', 'of', 'all'); - INSERT INTO t4 VALUES(0938446095, 'same', NULL); - INSERT INTO t4 VALUES(0938446095, 'Alpine', NULL); - INSERT INTO t4 VALUES('his', 'of', 378678316.5); - INSERT INTO t4 VALUES(271.2019091, 'viewed', 3282306647); - INSERT INTO t4 VALUES('hills', 'all', 'peak'); - COMMIT; - } -} {} - -catch {unset results} -catch {unset A} -catch {unset B} - -set A 2 -foreach idxsql { - { - /* No indexes */ - } { - CREATE INDEX i5 ON t3(a); - } { - CREATE INDEX i5 ON t3(a, b); - CREATE INDEX i6 ON t4(f); - } { - CREATE UNIQUE INDEX i5 ON t3(a, b); - CREATE INDEX i7 ON t3(c); - CREATE INDEX i6 ON t4(f); - CREATE INDEX i8 ON t4(h); - } { - CREATE INDEX i5 ON t3(a, b, c); - CREATE INDEX i6 ON t4(f, g, h); - CREATE INDEX i7 ON t3(c, b, a); - CREATE INDEX i8 ON t4(h, g, f); - } -} { - - execsql { - DROP INDEX IF EXISTS i5; - DROP INDEX IF EXISTS i6; - DROP INDEX IF EXISTS i7; - DROP INDEX IF EXISTS i8; - } - execsql $idxsql - - foreach {B sql} { - 1 { SELECT * FROM t3 WHERE c LIKE b } - 2 { SELECT * FROM t3 WHERE c||'' LIKE 'the%' } - 3 { SELECT * FROM t3 WHERE rowid LIKE '12%' } - 4 { SELECT * FROM t3 WHERE +c LIKE 'the%' } - 5 { SELECT * FROM t3 WHERE c LIKE 'the%' } - 6 { SELECT * FROM t3 WHERE c GLOB '*llo' } - - 7 { SELECT * FROM t3 WHERE a = 'angle' } - 8 { SELECT * FROM t3 WHERE a = 'it' OR b = 6939937510 } - 9 { SELECT * FROM t3, t4 WHERE a = 'painting' OR a = 'are' OR a = f } -10 { SELECT * FROM t3, t4 WHERE a = 'all' OR a = 'and' OR a = h } -11 { SELECT * FROM t3, t4 WHERE a < 'of' OR b > 346 AND c IS NULL } -12 { SELECT * FROM t3, t4 WHERE 'the' > a OR b > 'have' AND c = 1415926535 } - -13 { SELECT * FROM t3 WHERE a BETWEEN 'one' AND 'two' OR a = 3421170679 } -14 { SELECT * FROM t3 WHERE a BETWEEN 'one' AND 'two' OR a IS NULL } -15 { SELECT * FROM t3 WHERE c > 'one' OR c >= 'one' OR c LIKE 'one%' } -16 { SELECT * FROM t3 WHERE c > 'one' OR c = c OR c = a } -17 { SELECT * FROM t3 WHERE c IS NULL OR a >= 'peak' } -18 { SELECT * FROM t3 WHERE c IN ('other', 'all', 'snapshots') OR a>1 } -19 { SELECT * FROM t3 WHERE c IN ('other', 'all', 'snapshots') AND a>1 } -20 { SELECT * FROM t3 WHERE c IS NULL AND a>'one' } -21 { SELECT * FROM t3 WHERE c IS NULL OR a>'one' } -22 { SELECT * FROM t3 WHERE b = b AND a > 'are' } -23 { SELECT * FROM t3 WHERE c <= b OR b < 'snapshots' } -24 { SELECT * FROM t3 WHERE 'onlookers' >= c AND a <= b OR b = 'angle' } -25 { SELECT * FROM t3 WHERE b = 'from' } -26 { SELECT * FROM t3 WHERE b = 4543.266482 } -27 { SELECT * FROM t3 WHERE c < 3282306647 } -28 { SELECT * FROM t3 WHERE c IS NULL AND b >= c } -29 { SELECT * FROM t3 WHERE b > 0.4811174502 AND c = 'other' AND 'viewed' > a } -30 { SELECT * FROM t3 WHERE c = 'peak' } -31 { SELECT * FROM t3 WHERE c < 53594.08128 OR c <= b } -32 { SELECT * FROM t3 WHERE 'writings' <= b } -33 { SELECT * FROM t3 WHERE 2643383279 = b OR c < b AND b <= 3282306647 } -34 { SELECT * FROM t3 WHERE a IS NULL } -35 { SELECT * FROM t3 WHERE 'writings' = a OR b = 378678316.5 } -36 { SELECT * FROM t3 WHERE 'and' >= c } -37 { SELECT * FROM t3 WHERE c < 'from' } -38 { SELECT * FROM t3 WHERE 'his' < c OR b < b } -39 { SELECT * FROM t3 WHERE 53594.08128 = b AND c >= b } -40 { SELECT * FROM t3 WHERE 'unalike' < c AND 'are' >= c AND a <= b } -41 { SELECT * FROM t3 WHERE b >= 4543.266482 OR 'Alpine' > a OR 271.2019091 <= a } -42 { SELECT * FROM t3 WHERE b = c } -43 { SELECT * FROM t3 WHERE c > a AND b < 'all' } -44 { SELECT * FROM t3 WHERE c BETWEEN 'hills' AND 'snapshots' AND c <= 'the' OR c = a } -45 { SELECT * FROM t3 WHERE b > c AND c >= 'hills' } -46 { SELECT * FROM t3 WHERE b > 'or' OR a <= 'hills' OR c IS NULL } -47 { SELECT * FROM t3 WHERE c > b OR b BETWEEN 1339.360726 AND 'onlookers' OR 1415926535 >= b } -48 { SELECT * FROM t3 WHERE a IS NULL } -49 { SELECT * FROM t3 WHERE a > 'other' } -50 { SELECT * FROM t3 WHERE 'the' <= c AND a <= c } -51 { SELECT * FROM t3 WHERE 346.0348610 = a AND c = b } -52 { SELECT * FROM t3 WHERE c BETWEEN 50.58223172 AND 'same' AND a < b } -53 { SELECT * FROM t3 WHERE 'Alpine' <= b AND c >= 'angle' OR b <= 271.2019091 } -54 { SELECT * FROM t3 WHERE a < a AND 1415926535 > b } -55 { SELECT * FROM t3 WHERE c > a AND 'have' >= c } -56 { SELECT * FROM t3 WHERE b <= b AND c > b } -57 { SELECT * FROM t3 WHERE a IS NULL AND c <= c } -58 { SELECT * FROM t3 WHERE b < c OR b = c } -59 { SELECT * FROM t3 WHERE c < b AND b >= 'it' } -60 { SELECT * FROM t3 WHERE a = b AND a <= b OR b >= a } -61 { SELECT * FROM t3 WHERE b = c } -62 { SELECT * FROM t3 WHERE c BETWEEN 'the' AND 271.2019091 OR c <= 3282306647 AND c >= b } -63 { SELECT * FROM t3 WHERE c >= c AND c < 'writings' } -64 { SELECT * FROM t3 WHERE c <= 3282306647 AND b > a OR 'unalike' <= a } -65 { SELECT * FROM t3 WHERE a > c } -66 { SELECT * FROM t3 WHERE c = 'it' OR b >= b } -67 { SELECT * FROM t3 WHERE c = a OR b < c } -68 { SELECT * FROM t3 WHERE b > a } -69 { SELECT * FROM t3 WHERE a < b OR a > 4543.266482 OR 'same' = b } -70 { SELECT * FROM t3 WHERE c < c OR b <= c OR a <= b } -71 { SELECT * FROM t3 WHERE c > a } -72 { SELECT * FROM t3 WHERE c > b } -73 { SELECT * FROM t3 WHERE b <= a } -74 { SELECT * FROM t3 WHERE 3282306647 < b AND a >= 'or' OR a >= 378678316.5 } -75 { SELECT * FROM t3 WHERE 50.58223172 <= c OR c = c AND b < b } -76 { SELECT * FROM t3 WHERE 'and' < b OR b < c OR c > 1339.360726 } -77 { SELECT * FROM t3 WHERE b <= c } -78 { SELECT * FROM t3 WHERE 'in' <= c } -79 { SELECT * FROM t3 WHERE c <= b AND a > a AND c < b } -80 { SELECT * FROM t3 WHERE 'over' < b } -81 { SELECT * FROM t3 WHERE b >= b OR b < c OR a < b } -82 { SELECT * FROM t3 WHERE 'towering' <= b OR 'towering' = a AND c > b } -83 { SELECT * FROM t3 WHERE 'peak' = a OR b BETWEEN 2643383279 AND 'the' } -84 { SELECT * FROM t3 WHERE 'an' < c AND c > 'the' AND c IS NULL } -85 { SELECT * FROM t3 WHERE a <= 'sometimes' AND a BETWEEN 'unalike' AND 1339.360726 } -86 { SELECT * FROM t3 WHERE 1339.360726 < c AND c IS NULL } -87 { SELECT * FROM t3 WHERE b > 'the' } -88 { SELECT * FROM t3 WHERE 'and' = a } -89 { SELECT * FROM t3 WHERE b >= b } -90 { SELECT * FROM t3 WHERE b >= 8979323846 } -91 { SELECT * FROM t3 WHERE c <= a } -92 { SELECT * FROM t3 WHERE a BETWEEN 'have' AND 'light' OR a > b OR a >= 378678316.5 } -93 { SELECT * FROM t3 WHERE c > 3282306647 } -94 { SELECT * FROM t3 WHERE b > c } -95 { SELECT * FROM t3 WHERE b >= a AND 'villages' > a AND b >= c } -96 { SELECT * FROM t3 WHERE 'angle' > a } -97 { SELECT * FROM t3 WHERE 'paintings' >= a } -98 { SELECT * FROM t3 WHERE 'or' >= c } -99 { SELECT * FROM t3 WHERE c < b } - - -101 { SELECT * FROM t3, t4 WHERE f < 'sometimes' OR 'over' <= g AND h < 1415926535 } -102 { SELECT * FROM t3, t4 WHERE h >= 'from' AND h < 6939937510 OR g > h } -103 { SELECT * FROM t3, t4 WHERE c <= h AND g = h AND c >= 'all' } -104 { SELECT * FROM t3, t4 WHERE c = a } -105 { SELECT * FROM t3, t4 WHERE 'of' >= h } -106 { SELECT * FROM t3, t4 WHERE f >= b AND a < g AND h < 'and' } -107 { SELECT * FROM t3, t4 WHERE f <= 8628034825 AND 0938446095 >= b } -108 { SELECT * FROM t3, t4 WHERE a < 'the' } -109 { SELECT * FROM t3, t4 WHERE f = 'sometimes' OR b < 'of' } -110 { SELECT * FROM t3, t4 WHERE c IS NULL } -111 { SELECT * FROM t3, t4 WHERE 'have' = b OR g <= 346.0348610 } -112 { SELECT * FROM t3, t4 WHERE f > b AND b <= h } -113 { SELECT * FROM t3, t4 WHERE f > c OR 'the' = a OR 50.58223172 = a } -114 { SELECT * FROM t3, t4 WHERE 2643383279 <= a AND c = a } -115 { SELECT * FROM t3, t4 WHERE h >= b AND 'it' <= b } -116 { SELECT * FROM t3, t4 WHERE g BETWEEN 'from' AND 'peak' } -117 { SELECT * FROM t3, t4 WHERE 'their' > a AND g > b AND f <= c } -118 { SELECT * FROM t3, t4 WHERE h = 5028841971 AND 'unalike' <= f } -119 { SELECT * FROM t3, t4 WHERE c IS NULL AND a = 3282306647 OR a <= 'Alpine' } -120 { SELECT * FROM t3, t4 WHERE 'sometimes' <= f OR 8214808651 >= a AND b <= 53594.08128 } -121 { SELECT * FROM t3, t4 WHERE 6939937510 <= f OR c < f OR 'sometimes' = c } -122 { SELECT * FROM t3, t4 WHERE b < 'onlookers' AND 'paintings' = g AND c <= h } -123 { SELECT * FROM t3, t4 WHERE a BETWEEN 'all' AND 'from' OR c > 346.0348610 } -124 { SELECT * FROM t3, t4 WHERE 'from' <= b OR a BETWEEN 53594.08128 AND 'their' AND c > a } -125 { SELECT * FROM t3, t4 WHERE h = 2643383279 } -126 { SELECT * FROM t3, t4 WHERE a <= 'the' } -127 { SELECT * FROM t3, t4 WHERE h <= c } -128 { SELECT * FROM t3, t4 WHERE g <= 346.0348610 AND 66.59334461 >= f AND f <= f } -129 { SELECT * FROM t3, t4 WHERE g >= c OR 'in' < b OR b > g } -130 { SELECT * FROM t3, t4 WHERE 'over' > g AND b BETWEEN 'unalike' AND 'remarkably' } -131 { SELECT * FROM t3, t4 WHERE h <= 2847564.823 } -132 { SELECT * FROM t3, t4 WHERE h <= 'remarkably' AND 4543.266482 > h } -133 { SELECT * FROM t3, t4 WHERE a >= c AND 'it' > g AND c < c } -134 { SELECT * FROM t3, t4 WHERE h <= 66.59334461 AND b > 3421170679 } -135 { SELECT * FROM t3, t4 WHERE h < 'are' OR f BETWEEN 0938446095 AND 'are' OR b = b } -136 { SELECT * FROM t3, t4 WHERE h = a OR 66.59334461 <= f } -137 { SELECT * FROM t3, t4 WHERE f > 'of' OR h <= h OR a = f } -138 { SELECT * FROM t3, t4 WHERE 'other' >= g } -139 { SELECT * FROM t3, t4 WHERE b <= 3421170679 } -140 { SELECT * FROM t3, t4 WHERE 'all' = f AND 4543.266482 = b OR f BETWEEN 'and' AND 'angle' } -141 { SELECT * FROM t3, t4 WHERE 'light' = f OR h BETWEEN 'remarkably' AND 1415926535 } -142 { SELECT * FROM t3, t4 WHERE 'hills' = f OR 'the' >= f } -143 { SELECT * FROM t3, t4 WHERE a > 346.0348610 } -144 { SELECT * FROM t3, t4 WHERE 5028841971 = h } -145 { SELECT * FROM t3, t4 WHERE b >= c AND 'the' >= g OR 45.64856692 <= g } -146 { SELECT * FROM t3, t4 WHERE c < 5028841971 } -147 { SELECT * FROM t3, t4 WHERE a > a } -148 { SELECT * FROM t3, t4 WHERE c = 'snapshots' } -149 { SELECT * FROM t3, t4 WHERE h > 1339.360726 AND 'and' > c } -150 { SELECT * FROM t3, t4 WHERE 'and' > g OR 'sometimes' = c } -151 { SELECT * FROM t3, t4 WHERE g >= 'the' AND b >= 'onlookers' } -152 { SELECT * FROM t3, t4 WHERE h BETWEEN 'other' AND 2643383279 } -153 { SELECT * FROM t3, t4 WHERE 'it' = b } -154 { SELECT * FROM t3, t4 WHERE f = c OR c BETWEEN 'and' AND 0.4811174502 } -155 { SELECT * FROM t3, t4 WHERE b <= 'sometimes' OR c <= 0938446095 } -156 { SELECT * FROM t3, t4 WHERE 'and' <= b } -157 { SELECT * FROM t3, t4 WHERE g > a AND f = 'the' AND b < a } -158 { SELECT * FROM t3, t4 WHERE a < 'an' } -159 { SELECT * FROM t3, t4 WHERE a BETWEEN 'his' AND 'same' OR 8628034825 > f } -160 { SELECT * FROM t3, t4 WHERE b = 'peak' } -161 { SELECT * FROM t3, t4 WHERE f IS NULL AND a >= h } -162 { SELECT * FROM t3, t4 WHERE a IS NULL OR 2643383279 = c } -163 { SELECT * FROM t3, t4 WHERE b >= 5028841971 AND f < c AND a IS NULL } -164 { SELECT * FROM t3, t4 WHERE a >= g } -165 { SELECT * FROM t3, t4 WHERE c IS NULL } -166 { SELECT * FROM t3, t4 WHERE h >= h } -167 { SELECT * FROM t3, t4 WHERE 'over' <= h } -168 { SELECT * FROM t3, t4 WHERE b < 4543.266482 OR b = 2643383279 OR 8628034825 < b } -169 { SELECT * FROM t3, t4 WHERE g >= 6939937510 } -170 { SELECT * FROM t3, t4 WHERE 'or' < a OR b < g } -171 { SELECT * FROM t3, t4 WHERE h < 'hills' OR 'and' > g } -172 { SELECT * FROM t3, t4 WHERE 'from' > f OR f <= f } -173 { SELECT * FROM t3, t4 WHERE 'viewed' > b AND f < c } -174 { SELECT * FROM t3, t4 WHERE 'of' <= a } -175 { SELECT * FROM t3, t4 WHERE f > 0938446095 } -176 { SELECT * FROM t3, t4 WHERE a = g } -177 { SELECT * FROM t3, t4 WHERE g >= b AND f BETWEEN 'peak' AND 'and' } -178 { SELECT * FROM t3, t4 WHERE g = a AND 'it' > f } -179 { SELECT * FROM t3, t4 WHERE a <= b OR 'from' > f } -180 { SELECT * FROM t3, t4 WHERE f < 'and' } -181 { SELECT * FROM t3, t4 WHERE 6939937510 < b OR 'sometimes' < h } -182 { SELECT * FROM t3, t4 WHERE f > g AND f < 'peak' } -183 { SELECT * FROM t3, t4 WHERE a <= 53594.08128 AND c <= f AND f >= c } -184 { SELECT * FROM t3, t4 WHERE f = c OR 'it' > b OR g BETWEEN 'the' AND 'all' } -185 { SELECT * FROM t3, t4 WHERE c <= g OR a = h } -186 { SELECT * FROM t3, t4 WHERE 'same' = b OR c >= 2643383279 } -187 { SELECT * FROM t3, t4 WHERE h <= g OR c > 66.59334461 OR a <= f } -188 { SELECT * FROM t3, t4 WHERE b < c AND f = 'writings' } -189 { SELECT * FROM t3, t4 WHERE b < a } -190 { SELECT * FROM t3, t4 WHERE c >= f OR c = 'and' } -191 { SELECT * FROM t3, t4 WHERE f >= 'peak' AND g > f AND h > g } -192 { SELECT * FROM t3, t4 WHERE a >= 8979323846 AND 'same' > b OR c = 'and' } -193 { SELECT * FROM t3, t4 WHERE c >= g OR 'writings' >= c AND b = 'all' } -194 { SELECT * FROM t3, t4 WHERE 'remarkably' < g } -195 { SELECT * FROM t3, t4 WHERE a BETWEEN 'or' AND 'paintings' AND g <= f } -196 { SELECT * FROM t3, t4 WHERE 0938446095 > b OR g <= a OR h > b } -197 { SELECT * FROM t3, t4 WHERE g = 2643383279 AND f = g } -198 { SELECT * FROM t3, t4 WHERE g < 8979323846 } -199 { SELECT * FROM t3, t4 WHERE 'are' <= b } - - } { - do_test where8-4.$A.$B.1 { - set R [execsql $sql] - if {![info exists results($B)]} { - set results($B) $R - } - list - } {} - - do_test where8-4.$A.$B.2 { lsort $R } [lsort $results($B)] - } - incr A -} - -catch {unset results} -catch {unset A} -catch {unset B} - -finish_test - DELETED test/where8m.test Index: test/where8m.test ================================================================== --- test/where8m.test +++ /dev/null @@ -1,41 +0,0 @@ -# 2008 December 23 -# -# The author disclaims copyright to this source code. In place of -# a legal notice, here is a blessing: -# -# May you do good and not evil. -# May you find forgiveness for yourself and forgive others. -# May you share freely, never taking more than you give. -# -#*********************************************************************** -# This file implements regression tests for SQLite library. The focus -# is testing of where.c. More specifically, the focus is the optimization -# of WHERE clauses that feature the OR operator. -# -# $Id: where8m.test,v 1.1 2008/12/30 12:00:12 danielk1977 Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -source $testdir/malloc_common.tcl - -do_malloc_test where8m-1 -sqlprep { - CREATE TABLE t1(a, b, c); - CREATE INDEX i1 ON t1(a); - CREATE INDEX i2 ON t1(b); -} -sqlbody { - SELECT c FROM t1 - WHERE - a = 2 OR b = 'three' OR a = 4 OR b = 'five' OR a = 6 OR - b = 'seven' OR a = 8 OR b = 'nine' OR a = 10 - ORDER BY rowid; - - SELECT c FROM t1 WHERE - a = 1 OR a = 2 OR a = 3 OR a = 4 OR a = 5 OR a = 6; - - SELECT c FROM t1 WHERE - a BETWEEN 1 AND 3 AND b < 5 AND b > 2 AND c = 4; -} - -finish_test - DELETED test/where9.test Index: test/where9.test ================================================================== --- test/where9.test +++ /dev/null @@ -1,805 +0,0 @@ -# 2008 December 30 -# -# 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 the multi-index OR clause optimizer. -# -# $Id: where9.test,v 1.5 2009/01/08 21:00:03 drh Exp $ - -set testdir [file dirname $argv0] -source $testdir/tester.tcl - -ifcapable !or_opt { - finish_test - return -} - -# Evaluate SQL. Return the result set followed by the -# and the number of full-scan steps. -# -proc count_steps {sql} { - set r [db eval $sql] - lappend r scan [db status step] sort [db status sort] -} - - -# Construct test data. -# -do_test where9-1.1 { - db eval { - CREATE TABLE t1(a INTEGER PRIMARY KEY,b,c,d,e,f,g); - INSERT INTO t1 VALUES(1,11,1001,1.001,100.1,'bcdefghij','yxwvuts'); - INSERT INTO t1 VALUES(2,22,1001,2.002,100.1,'cdefghijk','yxwvuts'); - INSERT INTO t1 VALUES(3,33,1001,3.003,100.1,'defghijkl','xwvutsr'); - INSERT INTO t1 VALUES(4,44,2002,4.004,200.2,'efghijklm','xwvutsr'); - INSERT INTO t1 VALUES(5,55,2002,5.005,200.2,'fghijklmn','xwvutsr'); - INSERT INTO t1 VALUES(6,66,2002,6.006,200.2,'ghijklmno','xwvutsr'); - INSERT INTO t1 VALUES(7,77,3003,7.007,300.3,'hijklmnop','xwvutsr'); - INSERT INTO t1 VALUES(8,88,3003,8.008,300.3,'ijklmnopq','wvutsrq'); - INSERT INTO t1 VALUES(9,99,3003,9.009,300.3,'jklmnopqr','wvutsrq'); - INSERT INTO t1 VALUES(10,110,4004,10.01,400.4,'klmnopqrs','wvutsrq'); - INSERT INTO t1 VALUES(11,121,4004,11.011,400.4,'lmnopqrst','wvutsrq'); - INSERT INTO t1 VALUES(12,132,4004,12.012,400.4,'mnopqrstu','wvutsrq'); - INSERT INTO t1 VALUES(13,143,5005,13.013,500.5,'nopqrstuv','vutsrqp'); - INSERT INTO t1 VALUES(14,154,5005,14.014,500.5,'opqrstuvw','vutsrqp'); - INSERT INTO t1 VALUES(15,165,5005,15.015,500.5,'pqrstuvwx','vutsrqp'); - INSERT INTO t1 VALUES(16,176,6006,16.016,600.6,'qrstuvwxy','vutsrqp'); - INSERT INTO t1 VALUES(17,187,6006,17.017,600.6,'rstuvwxyz','vutsrqp'); - INSERT INTO t1 VALUES(18,198,6006,18.018,600.6,'stuvwxyza','utsrqpo'); - INSERT INTO t1 VALUES(19,209,7007,19.019,700.7,'tuvwxyzab','utsrqpo'); - INSERT INTO t1 VALUES(20,220,7007,20.02,700.7,'uvwxyzabc','utsrqpo'); - INSERT INTO t1 VALUES(21,231,7007,21.021,700.7,'vwxyzabcd','utsrqpo'); - INSERT INTO t1 VALUES(22,242,8008,22.022,800.8,'wxyzabcde','utsrqpo'); - INSERT INTO t1 VALUES(23,253,8008,23.023,800.8,'xyzabcdef','tsrqpon'); - INSERT INTO t1 VALUES(24,264,8008,24.024,800.8,'yzabcdefg','tsrqpon'); - INSERT INTO t1 VALUES(25,275,9009,25.025,900.9,'zabcdefgh','tsrqpon'); - INSERT INTO t1 VALUES(26,286,9009,26.026,900.9,'abcdefghi','tsrqpon'); - INSERT INTO t1 VALUES(27,297,9009,27.027,900.9,'bcdefghij','tsrqpon'); - INSERT INTO t1 VALUES(28,308,10010,28.028,1001.0,'cdefghijk','srqponm'); - INSERT INTO t1 VALUES(29,319,10010,29.029,1001.0,'defghijkl','srqponm'); - INSERT INTO t1 VALUES(30,330,10010,30.03,1001.0,'efghijklm','srqponm'); - INSERT INTO t1 VALUES(31,341,11011,31.031,1101.1,'fghijklmn','srqponm'); - INSERT INTO t1 VALUES(32,352,11011,32.032,1101.1,'ghijklmno','srqponm'); - INSERT INTO t1 VALUES(33,363,11011,33.033,1101.1,'hijklmnop','rqponml'); - INSERT INTO t1 VALUES(34,374,12012,34.034,1201.2,'ijklmnopq','rqponml'); - INSERT INTO t1 VALUES(35,385,12012,35.035,1201.2,'jklmnopqr','rqponml'); - INSERT INTO t1 VALUES(36,396,12012,36.036,1201.2,'klmnopqrs','rqponml'); - INSERT INTO t1 VALUES(37,407,13013,37.037,1301.3,'lmnopqrst','rqponml'); - INSERT INTO t1 VALUES(38,418,13013,38.038,1301.3,'mnopqrstu','qponmlk'); - INSERT INTO t1 VALUES(39,429,13013,39.039,1301.3,'nopqrstuv','qponmlk'); - INSERT INTO t1 VALUES(40,440,14014,40.04,1401.4,'opqrstuvw','qponmlk'); - INSERT INTO t1 VALUES(41,451,14014,41.041,1401.4,'pqrstuvwx','qponmlk'); - INSERT INTO t1 VALUES(42,462,14014,42.042,1401.4,'qrstuvwxy','qponmlk'); - INSERT INTO t1 VALUES(43,473,15015,43.043,1501.5,'rstuvwxyz','ponmlkj'); - INSERT INTO t1 VALUES(44,484,15015,44.044,1501.5,'stuvwxyza','ponmlkj'); - INSERT INTO t1 VALUES(45,495,15015,45.045,1501.5,'tuvwxyzab','ponmlkj'); - INSERT INTO t1 VALUES(46,506,16016,46.046,1601.6,'uvwxyzabc','ponmlkj'); - INSERT INTO t1 VALUES(47,517,16016,47.047,1601.6,'vwxyzabcd','ponmlkj'); - INSERT INTO t1 VALUES(48,528,16016,48.048,1601.6,'wxyzabcde','onmlkji'); - INSERT INTO t1 VALUES(49,539,17017,49.049,1701.7,'xyzabcdef','onmlkji'); - INSERT INTO t1 VALUES(50,550,17017,50.05,1701.7,'yzabcdefg','onmlkji'); - INSERT INTO t1 VALUES(51,561,17017,51.051,1701.7,'zabcdefgh','onmlkji'); - INSERT INTO t1 VALUES(52,572,18018,52.052,1801.8,'abcdefghi','onmlkji'); - INSERT INTO t1 VALUES(53,583,18018,53.053,1801.8,'bcdefghij','nmlkjih'); - INSERT INTO t1 VALUES(54,594,18018,54.054,1801.8,'cdefghijk','nmlkjih'); - INSERT INTO t1 VALUES(55,605,19019,55.055,1901.9,'defghijkl','nmlkjih'); - INSERT INTO t1 VALUES(56,616,19019,56.056,1901.9,'efghijklm','nmlkjih'); - INSERT INTO t1 VALUES(57,627,19019,57.057,1901.9,'fghijklmn','nmlkjih'); - INSERT INTO t1 VALUES(58,638,20020,58.058,2002.0,'ghijklmno','mlkjihg'); - INSERT INTO t1 VALUES(59,649,20020,59.059,2002.0,'hijklmnop','mlkjihg'); - INSERT INTO t1 VALUES(60,660,20020,60.06,2002.0,'ijklmnopq','mlkjihg'); - INSERT INTO t1 VALUES(61,671,21021,61.061,2102.1,'jklmnopqr','mlkjihg'); - INSERT INTO t1 VALUES(62,682,21021,62.062,2102.1,'klmnopqrs','mlkjihg'); - INSERT INTO t1 VALUES(63,693,21021,63.063,2102.1,'lmnopqrst','lkjihgf'); - INSERT INTO t1 VALUES(64,704,22022,64.064,2202.2,'mnopqrstu','lkjihgf'); - INSERT INTO t1 VALUES(65,715,22022,65.065,2202.2,'nopqrstuv','lkjihgf'); - INSERT INTO t1 VALUES(66,726,22022,66.066,2202.2,'opqrstuvw','lkjihgf'); - INSERT INTO t1 VALUES(67,737,23023,67.067,2302.3,'pqrstuvwx','lkjihgf'); - INSERT INTO t1 VALUES(68,748,23023,68.068,2302.3,'qrstuvwxy','kjihgfe'); - INSERT INTO t1 VALUES(69,759,23023,69.069,2302.3,'rstuvwxyz','kjihgfe'); - INSERT INTO t1 VALUES(70,770,24024,70.07,2402.4,'stuvwxyza','kjihgfe'); - INSERT INTO t1 VALUES(71,781,24024,71.071,2402.4,'tuvwxyzab','kjihgfe'); - INSERT INTO t1 VALUES(72,792,24024,72.072,2402.4,'uvwxyzabc','kjihgfe'); - INSERT INTO t1 VALUES(73,803,25025,73.073,2502.5,'vwxyzabcd','jihgfed'); - INSERT INTO t1 VALUES(74,814,25025,74.074,2502.5,'wxyzabcde','jihgfed'); - INSERT INTO t1 VALUES(75,825,25025,75.075,2502.5,'xyzabcdef','jihgfed'); - INSERT INTO t1 VALUES(76,836,26026,76.076,2602.6,'yzabcdefg','jihgfed'); - INSERT INTO t1 VALUES(77,847,26026,77.077,2602.6,'zabcdefgh','jihgfed'); - INSERT INTO t1 VALUES(78,858,26026,78.078,2602.6,'abcdefghi','ihgfedc'); - INSERT INTO t1 VALUES(79,869,27027,79.079,2702.7,'bcdefghij','ihgfedc'); - INSERT INTO t1 VALUES(80,880,27027,80.08,2702.7,'cdefghijk','ihgfedc'); - INSERT INTO t1 VALUES(81,891,27027,81.081,2702.7,'defghijkl','ihgfedc'); - INSERT INTO t1 VALUES(82,902,28028,82.082,2802.8,'efghijklm','ihgfedc'); - INSERT INTO t1 VALUES(83,913,28028,83.083,2802.8,'fghijklmn','hgfedcb'); - INSERT INTO t1 VALUES(84,924,28028,84.084,2802.8,'ghijklmno','hgfedcb'); - INSERT INTO t1 VALUES(85,935,29029,85.085,2902.9,'hijklmnop','hgfedcb'); - INSERT INTO t1 VALUES(86,946,29029,86.086,2902.9,'ijklmnopq','hgfedcb'); - INSERT INTO t1 VALUES(87,957,29029,87.087,2902.9,'jklmnopqr','hgfedcb'); - INSERT INTO t1 VALUES(88,968,30030,88.088,3003.0,'klmnopqrs','gfedcba'); - INSERT INTO t1 VALUES(89,979,30030,89.089,3003.0,'lmnopqrst','gfedcba'); - INSERT INTO t1 VALUES(90,NULL,30030,90.09,3003.0,'mnopqrstu','gfedcba'); - INSERT INTO t1 VALUES(91,1001,NULL,91.091,3103.1,'nopqrstuv','gfedcba'); - INSERT INTO t1 VALUES(92,1012,31031,NULL,3103.1,'opqrstuvw','gfedcba'); - INSERT INTO t1 VALUES(93,1023,31031,93.093,NULL,'pqrstuvwx','fedcbaz'); - INSERT INTO t1 VALUES(94,1034,32032,94.094,3203.2,NULL,'fedcbaz'); - INSERT INTO t1 VALUES(95,1045,32032,95.095,3203.2,'rstuvwxyz',NULL); - INSERT INTO t1 VALUES(96,NULL,NULL,96.096,3203.2,'stuvwxyza','fedcbaz'); - INSERT INTO t1 VALUES(97,1067,33033,NULL,NULL,'tuvwxyzab','fedcbaz'); - INSERT INTO t1 VALUES(98,1078,33033,98.098,3303.3,NULL,NULL); - INSERT INTO t1 VALUES(99,NULL,NULL,NULL,NULL,NULL,NULL); - CREATE INDEX t1b ON t1(b); - CREATE INDEX t1c ON t1(c); - CREATE INDEX t1d ON t1(d); - CREATE INDEX t1e ON t1(e); - CREATE INDEX t1f ON t1(f); - CREATE INDEX t1g ON t1(g); - CREATE TABLE t2(a INTEGER PRIMARY KEY,b,c,d,e,f,g); - INSERT INTO t2 SELECT * FROM t1; - CREATE INDEX t2b ON t2(b,c); - CREATE INDEX t2c ON t2(c,e); - CREATE INDEX t2d ON t2(d,g); - CREATE INDEX t2e ON t2(e,f,g); - CREATE INDEX t2f ON t2(f,b,d,c); - CREATE INDEX t2g ON t2(g,f); - CREATE TABLE t3(x,y); - INSERT INTO t3 VALUES(1,80); - INSERT INTO t3 VALUES(2,80); - CREATE TABLE t4(a INTEGER PRIMARY KEY,b,c,d,e,f,g); - INSERT INTO t4 SELECT * FROM t1; - CREATE INDEX t4b ON t4(b); - CREATE INDEX t4c ON t4(c); - } -} {} - -do_test where9-1.2.1 { - count_steps { - SELECT a FROM t1 - WHERE b IS NULL - OR c IS NULL - OR d IS NULL - ORDER BY a - } -} {90 91 92 96 97 99 scan 0 sort 0} -do_test where9-1.2.2 { - count_steps { - SELECT a FROM t1 - WHERE +b IS NULL - OR c IS NULL - OR d IS NULL - ORDER BY a - } -} {90 91 92 96 97 99 scan 98 sort 0} -do_test where9-1.2.3 { - count_steps { - SELECT a FROM t1 - WHERE b IS NULL - OR +c IS NULL - OR d IS NULL - ORDER BY a - } -} {90 91 92 96 97 99 scan 98 sort 0} -do_test where9-1.2.4 { - count_steps { - SELECT a FROM t1 - WHERE b IS NULL - OR c IS NULL - OR +d IS NULL - ORDER BY a - } -} {90 91 92 96 97 99 scan 98 sort 0} -do_test where9-1.2.5 { -breakpoint - count_steps { - SELECT a FROM t4 - WHERE b IS NULL - OR c IS NULL - OR d IS NULL - ORDER BY a - } -} {90 91 92 96 97 99 scan 98 sort 0} - -do_test where9-1.3.1 { - count_steps { - SELECT a FROM t1 - WHERE (b IS NULL AND c NOT NULL AND d NOT NULL) - OR (b NOT NULL AND c IS NULL AND d NOT NULL) - OR (b NOT NULL AND c NOT NULL AND d IS NULL) - ORDER BY a - } -} {90 91 92 97 scan 0 sort 0} -do_test where9-1.3.2 { - count_steps { - SELECT a FROM t4 - WHERE (b IS NULL AND c NOT NULL AND d NOT NULL) - OR (b NOT NULL AND c IS NULL AND d NOT NULL) - OR (b NOT NULL AND c NOT NULL AND d IS NULL) - ORDER BY a - } -} {90 91 92 97 scan 98 sort 0} -do_test where9-1.3.3 { - count_steps { - SELECT a FROM t4 - WHERE (b NOT NULL AND c NOT NULL AND d IS NULL) - OR (b IS NULL AND c NOT NULL AND d NOT NULL) - OR (b NOT NULL AND c IS NULL AND d NOT NULL) - ORDER BY a - } -} {90 91 92 97 scan 98 sort 0} -do_test where9-1.3.4 { - count_steps { - SELECT a FROM t4 - WHERE (b IS NULL AND c NOT NULL AND d NOT NULL) - OR (b NOT NULL AND c NOT NULL AND d IS NULL) - OR (b NOT NULL AND c IS NULL AND d NOT NULL) - ORDER BY a - } -} {90 91 92 97 scan 98 sort 0} - -do_test where9-1.4 { - count_steps { - SELECT a FROM t1 - WHERE (b>=950 AND b<=1010) OR (b IS NULL AND c NOT NULL) - ORDER BY a - } -} {87 88 89 90 91 scan 0 sort 0} -do_test where9-1.5 { - count_steps { - SELECT a FROM t1 - WHERE a=83 - OR b=913 - OR c=28028 - OR (d>=82 AND d<83) - OR (e>2802 AND e<2803) - OR f='fghijklmn' - OR g='hgfedcb' - ORDER BY a - } -} {5 31 57 82 83 84 85 86 87 scan 0 sort 0} -do_test where9-1.6 { - count_steps { - SELECT a FROM t1 - WHERE b=1012 - OR (d IS NULL AND e IS NOT NULL) - } -} {92 scan 0 sort 0} -do_test where9-1.7 { - count_steps { - SELECT a FROM t1 - WHERE (b=1012 OR (d IS NULL AND e IS NOT NULL)) - AND f!=g - } -} {92 scan 0 sort 0} -do_test where9-1.8 { - count_steps { - SELECT a FROM t1 - WHERE (b=1012 OR (d IS NULL AND e IS NOT NULL)) - AND f==g - } -} {scan 0 sort 0} - -do_test where9-2.1 { - count_steps { - SELECT t2.a FROM t1, t2 - WHERE t1.a=80 - AND (t1.c=t2.c OR t1.d=t2.d) - ORDER BY 1 - } -} {79 80 81 scan 0 sort 1} -do_test where9-2.2 { - count_steps { - SELECT t2.a FROM t1, t2 - WHERE t1.a=80 - AND ((t1.c=t2.c AND t1.d=t2.d) OR t1.f=t2.f) - ORDER BY 1 - } -} {2 28 54 80 scan 0 sort 1} -do_test where9-2.3 { - count_steps { - SELECT coalesce(t2.a,9999) - FROM t1 LEFT JOIN t2 ON (t1.c=t2.c AND t1.d=t2.d) OR t1.f=t2.f - WHERE t1.a=80 - ORDER BY 1 - } -} {2 28 54 80 scan 0 sort 1} -do_test where9-2.4 { - count_steps { - SELECT coalesce(t2.a,9999) - FROM t1 LEFT JOIN t2 ON (t1.c+1=t2.c AND t1.d=t2.d) OR (t1.f||'x')=t2.f - WHERE t1.a=80 - ORDER BY 1 - } -} {9999 scan 0 sort 1} -do_test where9-2.5 { - count_steps { - SELECT t1.a, coalesce(t2.a,9999) - FROM t1 LEFT JOIN t2 ON (t1.c=t2.c AND t1.d=t2.d) OR (t1.f)=t2.f - WHERE t1.a=80 OR t1.b=880 OR (t1.c=27027 AND round(t1.d)==80) - ORDER BY 1 - } -} {80 2 80 28 80 54 80 80 scan 0 sort 0} -do_test where9-2.6 { - count_steps { - SELECT t1.a, coalesce(t2.a,9999) - FROM t1 LEFT JOIN t2 ON (t1.c+1=t2.c AND t1.d=t2.d) OR (t1.f||'x')=t2.f - WHERE t1.a=80 OR t1.b=880 OR (t1.c=27027 AND round(t1.d)==80) - ORDER BY 1 - } -} {80 9999 scan 0 sort 0} -do_test where9-2.7 { - count_steps { - SELECT t3.x, t1.a, coalesce(t2.a,9999) - FROM t3 JOIN - t1 LEFT JOIN t2 ON (t1.c+1=t2.c AND t1.d=t2.d) OR (t1.f||'x')=t2.f - WHERE t1.a=t3.y OR t1.b=t3.y*11 OR (t1.c=27027 AND round(t1.d)==80) - ORDER BY 1, 2 - } -} {1 80 9999 2 80 9999 scan 1 sort 1} -do_test where9-2.8 { - count_steps { - SELECT t3.x, t1.a, coalesce(t2.a,9999) - FROM t3 JOIN - t1 LEFT JOIN t2 ON (t1.c=t2.c AND t1.d=t2.d) OR (t1.f)=t2.f - WHERE t1.a=t3.y OR t1.b=t3.y*11 OR (t1.c=27027 AND round(t1.d)==80) - ORDER BY 1, 2 - } -} {1 80 2 1 80 28 1 80 54 1 80 80 2 80 2 2 80 28 2 80 54 2 80 80 scan 1 sort 1} - - -ifcapable explain { - do_test where9-3.1 { - set r [db eval { - EXPLAIN QUERY PLAN - SELECT t2.a FROM t1, t2 - WHERE t1.a=80 - AND ((t1.c=t2.c AND t1.d=t2.d) OR t1.f=t2.f) - }] - set a [expr {[lsearch $r {TABLE t2 VIA MULTI-INDEX UNION}]>=0}] - set b [expr {[lsearch $r {TABLE t2 WITH INDEX t2f}]>=0}] - set c [expr {([lsearch $r {TABLE t2 WITH INDEX t2c}]>=0)+ - [lsearch $r {TABLE t2 WITH INDEX t2d}]>=0}] - concat $a $b $c - } {1 1 1} - do_test where9-3.2 { - set r [db eval { - EXPLAIN QUERY PLAN - SELECT coalesce(t2.a,9999) - FROM t1 LEFT JOIN t2 ON (t1.c+1=t2.c AND t1.d=t2.d) OR (t1.f||'x')=t2.f - WHERE t1.a=80 - }] - set a [expr {[lsearch $r {TABLE t2 VIA MULTI-INDEX UNION}]>=0}] - set b [expr {[lsearch $r {TABLE t2 WITH INDEX t2f}]>=0}] - set c [expr {([lsearch $r {TABLE t2 WITH INDEX t2c}]>=0)+ - [lsearch $r {TABLE t2 WITH INDEX t2d}]>=0}] - concat $a $b $c - } {1 1 1} -} - -# Make sure that INDEXED BY and multi-index OR clauses play well with -# one another. -# -do_test where9-4.1 { - count_steps { - SELECT a FROM t1 - WHERE b>1000 - AND (c=31031 OR d IS NULL) - ORDER BY +a - } -} {92 93 97 scan 0 sort 1} -do_test where9-4.2 { - count_steps { - SELECT a FROM t1 - WHERE b>1000 - AND (c=31031 OR +d IS NULL) - ORDER BY +a - } -} {92 93 97 scan 0 sort 1} -do_test where9-4.3 { - count_steps { - SELECT a FROM t1 - WHERE +b>1000 - AND (c=31031 OR d IS NULL) - ORDER BY +a - } -} {92 93 97 scan 0 sort 1} -do_test where9-4.4 { - count_steps { - SELECT a FROM t1 INDEXED BY t1b - WHERE b>1000 - AND (c=31031 OR d IS NULL) - ORDER BY +a - } -} {92 93 97 scan 0 sort 1} -do_test where9-4.5 { - catchsql { - SELECT a FROM t1 INDEXED BY t1b - WHERE +b>1000 - AND (c=31031 OR d IS NULL) - ORDER BY +a - } -} {1 {cannot use index: t1b}} -do_test where9-4.6 { - count_steps { - SELECT a FROM t1 NOT INDEXED - WHERE b>1000 - AND (c=31031 OR d IS NULL) - ORDER BY +a - } -} {92 93 97 scan 98 sort 1} -do_test where9-4.7 { - catchsql { - SELECT a FROM t1 INDEXED BY t1c - WHERE b>1000 - AND (c=31031 OR d IS NULL) - ORDER BY +a - } -} {1 {cannot use index: t1c}} -do_test where9-4.8 { - catchsql { - SELECT a FROM t1 INDEXED BY t1d - WHERE b>1000 - AND (c=31031 OR d IS NULL) - ORDER BY +a - } -} {1 {cannot use index: t1d}} - -ifcapable explain { - # The (c=31031 OR d IS NULL) clause is preferred over b>1000 because - # the former is an equality test which is expected to return fewer rows. - # - do_test where9-5.1 { - set r [db eval { - EXPLAIN QUERY PLAN - SELECT a FROM t1 - WHERE b>1000 - AND (c=31031 OR d IS NULL) - }] - set a [expr {[lsearch $r {TABLE t1 VIA MULTI-INDEX UNION}]>=0}] - set b [expr {[lsearch $r {TABLE t1 WITH INDEX t1b}]>=0}] - concat $a $b - } {1 0} - - # In contrast, b=1000 is preferred over any OR-clause. - # - do_test where9-5.2 { - set r [db eval { - EXPLAIN QUERY PLAN - SELECT a FROM t1 - WHERE b=1000 - AND (c=31031 OR d IS NULL) - }] - set a [expr {[lsearch $r {TABLE t1 VIA MULTI-INDEX UNION}]>=0}] - set b [expr {[lsearch $r {TABLE t1 WITH INDEX t1b}]>=0}] - concat $a $b - } {0 1} - - # Likewise, inequalities in an AND are preferred over inequalities in - # an OR. - # - do_test where9-5.3 { - set r [db eval { - EXPLAIN QUERY PLAN - SELECT a FROM t1 - WHERE b>1000 - AND (c>=31031 OR d IS NULL) - }] - set a [expr {[lsearch $r {TABLE t1 VIA MULTI-INDEX UNION}]>=0}] - set b [expr {[lsearch $r {TABLE t1 WITH INDEX t1b}]>=0}] - concat $a $b - } {0 1} -} - -############################################################################ -# Make sure OR-clauses work correctly on UPDATE and DELETE statements. - -do_test where9-6.2.1 { - db eval {SELECT count(*) FROM t1 UNION ALL SELECT a FROM t1 WHERE a>=85} -} {99 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99} - -do_test where9-6.2.2 { ;# Deletes entries 90 91 92 96 97 99 - count_steps { - BEGIN; - DELETE FROM t1 - WHERE b IS NULL - OR c IS NULL - OR d IS NULL - } -} {scan 0 sort 0} - -do_test where9-6.2.3 { - db eval { - SELECT count(*) FROM t1 UNION ALL - SELECT a FROM t1 WHERE a>=85; - ROLLBACK; - } -} {93 85 86 87 88 89 93 94 95 98} - -do_test where9-6.2.4 { ;# Deletes entries 90 91 92 96 97 99 - count_steps { - BEGIN; - DELETE FROM t1 - WHERE +b IS NULL - OR c IS NULL - OR d IS NULL - } -} {scan 98 sort 0} - -do_test where9-6.2.5 { - db eval { - SELECT count(*) FROM t1 UNION ALL - SELECT a FROM t1 WHERE a>=85; - ROLLBACK; - } -} {93 85 86 87 88 89 93 94 95 98} - -do_test where9-6.2.6 { - count_steps { - BEGIN; - UPDATE t1 SET a=a+100 - WHERE (b IS NULL - OR c IS NULL - OR d IS NULL) - AND a!=92 - AND a!=97 - } -} {scan 0 sort 0} ;# Add 100 to entries 90 91 96 99 - -do_test where9-6.2.7 { - db eval { - SELECT count(*) FROM t1 UNION ALL - SELECT a FROM t1 WHERE a>=85; - ROLLBACK - } -} {99 85 86 87 88 89 92 93 94 95 97 98 190 191 196 199} - -do_test where9-6.2.8 { ;# Deletes entries 90 91 92 97 99 - count_steps { - BEGIN; - DELETE FROM t1 - WHERE (b IS NULL - OR c IS NULL - OR d IS NULL) - AND a!=96 - } -} {scan 0 sort 0} - -do_test where9-6.2.9 { - db eval { - SELECT count(*) FROM t1 UNION ALL SELECT a FROM t1 WHERE a>=85; - ROLLBACK; - } -} {94 85 86 87 88 89 93 94 95 96 98} - -do_test where9-6.3.1 { - count_steps { - BEGIN; - DELETE FROM t1 - WHERE (b IS NULL AND c NOT NULL AND d NOT NULL) - OR (b NOT NULL AND c IS NULL AND d NOT NULL) - OR (b NOT NULL AND c NOT NULL AND d IS NULL) - } -} {scan 0 sort 0} ;# DELETEs rows 90 91 92 97 -do_test where9-6.3.2 { - db eval { - SELECT count(*) FROM t1 UNION ALL - SELECT a FROM t1 WHERE a BETWEEN 85 AND 100; - ROLLBACK; - } -} {95 85 86 87 88 89 93 94 95 96 98 99} - -do_test where9-6.3.3 { - count_steps { - BEGIN; - UPDATE t1 SET a=a+100 - WHERE (b IS NULL AND c NOT NULL AND d NOT NULL) - OR (b NOT NULL AND c IS NULL AND d NOT NULL) - OR (b NOT NULL AND c NOT NULL AND d IS NULL) - } -} {scan 0 sort 0} ;# Add 100 to rowids 90 91 92 97 -do_test where9-6.3.4 { - db eval { - SELECT count(*) FROM t1 UNION ALL - SELECT a FROM t1 WHERE a BETWEEN 85 AND 200; - ROLLBACK; - } -} {99 85 86 87 88 89 93 94 95 96 98 99 190 191 192 197} - -do_test where9-6.3.5 { - count_steps { - BEGIN; - DELETE FROM t1 - WHERE (+b IS NULL AND c NOT NULL AND d NOT NULL) - OR (b NOT NULL AND c IS NULL AND d NOT NULL) - OR (b NOT NULL AND c NOT NULL AND d IS NULL) - } -} {scan 98 sort 0} ;# DELETEs rows 90 91 92 97 -do_test where9-6.3.6 { - db eval { - SELECT count(*) FROM t1 UNION ALL - SELECT a FROM t1 WHERE a BETWEEN 85 AND 100; - ROLLBACK; - } -} {95 85 86 87 88 89 93 94 95 96 98 99} - -do_test where9-6.3.7 { - count_steps { - BEGIN; - UPDATE t1 SET a=a+100 - WHERE (b IS NULL AND c NOT NULL AND d NOT NULL) - OR (b NOT NULL AND +c IS NULL AND d NOT NULL) - OR (b NOT NULL AND c NOT NULL AND d IS NULL) - } -} {scan 98 sort 0} ;# Add 100 to rowids 90 91 92 97 -do_test where9-6.3.8 { - db eval { - SELECT count(*) FROM t1 UNION ALL - SELECT a FROM t1 WHERE a BETWEEN 85 AND 100; - ROLLBACK; - } -} {99 85 86 87 88 89 93 94 95 96 98 99} - - -do_test where9-6.4.1 { - count_steps { - BEGIN; - DELETE FROM t1 - WHERE (b>=950 AND b<=1010) OR (b IS NULL AND c NOT NULL) - } -} {scan 0 sort 0} ;# DELETE rows 87 88 89 90 91 -do_test where9-6.4.2 { - db eval { - SELECT count(*) FROM t1 UNION ALL - SELECT a FROM t1 WHERE a BETWEEN 85 AND 100; - ROLLBACK; - } -} {94 85 86 92 93 94 95 96 97 98 99} -do_test where9-6.4.3 { - count_steps { - BEGIN; - UPDATE t1 SET a=a+100 - WHERE (b>=950 AND b<=1010) OR (b IS NULL AND c NOT NULL) - } -} {scan 0 sort 0} ;# Add 100 to rowids 87 88 89 90 91 -do_test where9-6.4.4 { - db eval { - SELECT count(*) FROM t1 UNION ALL - SELECT a FROM t1 WHERE a BETWEEN 85 AND 100; - ROLLBACK; - } -} {99 85 86 92 93 94 95 96 97 98 99} - - -do_test where9-6.5.1 { - count_steps { - BEGIN; - DELETE FROM t1 - WHERE a=83 - OR b=913 - OR c=28028 - OR (d>=82 AND d<83) - OR (e>2802 AND e<2803) - OR f='fghijklmn' - OR g='hgfedcb' - } -} {scan 0 sort 0} ;# DELETE rows 5 31 57 82 83 84 85 86 87 -do_test where9-6.5.2 { - db eval { - SELECT count(*) FROM t1 UNION ALL - SELECT a FROM t1 WHERE a IN (5,31,57,82,83,84,85,86,87); - ROLLBACK; - } -} {90} - -do_test where9-6.5.3 { - count_steps { - BEGIN; - UPDATE t1 SET a=a+100 - WHERE a=83 - OR b=913 - OR c=28028 - OR (d>=82 AND d<83) - OR (e>2802 AND e<2803) - OR f='fghijklmn' - OR g='hgfedcb' - } -} {scan 0 sort 0} ;# Add 100 to rowids 5 31 57 82 83 84 85 86 87 -do_test where9-6.5.4 { - db eval { - SELECT count(*) FROM t1 UNION ALL - SELECT a FROM t1 WHERE a%100 IN (5,31,57,82,83,84,85,86,87); - ROLLBACK; - } -} {99 105 131 157 182 183 184 185 186 187} - -do_test where9-6.6.1 { - count_steps { - BEGIN; - DELETE FROM t1 - WHERE (b IS NULL AND c NOT NULL AND d NOT NULL) - OR (b NOT NULL AND +c IS NULL AND d NOT NULL) - OR (b NOT NULL AND c NOT NULL AND d IS NULL) - } -} {scan 98 sort 0} ;# DELETEs rows 90 91 92 97 -do_test where9-6.6.2 { - db eval { - SELECT count(*) FROM t1 UNION ALL - SELECT a FROM t1 WHERE a BETWEEN 85 AND 100; - ROLLBACK; - } -} {95 85 86 87 88 89 93 94 95 96 98 99} - -do_test where9-6.6.3 { - count_steps { - BEGIN; - UPDATE t1 SET a=a+100 - WHERE (b IS NULL AND c NOT NULL AND d NOT NULL) - OR (b NOT NULL AND +c IS NULL AND d NOT NULL) - OR (b NOT NULL AND c NOT NULL AND d IS NULL) - } -} {scan 98 sort 0} ;# Add 100 to rowids 90 91 92 97 -do_test where9-6.6.4 { - db eval { - SELECT count(*) FROM t1 UNION ALL - SELECT a FROM t1 WHERE a BETWEEN 85 AND 200; - ROLLBACK; - } -} {99 85 86 87 88 89 93 94 95 96 98 99 190 191 192 197} - -do_test where9-6.7.1 { - count_steps { - BEGIN; - DELETE FROM t1 NOT INDEXED - WHERE (b IS NULL AND c NOT NULL AND d NOT NULL) - OR (b NOT NULL AND c IS NULL AND d NOT NULL) - OR (b NOT NULL AND c NOT NULL AND d IS NULL) - } -} {scan 98 sort 0} ;# DELETEs rows 90 91 92 97 -do_test where9-6.7.2 { - db eval { - SELECT count(*) FROM t1 UNION ALL - SELECT a FROM t1 WHERE a BETWEEN 85 AND 100; - ROLLBACK; - } -} {95 85 86 87 88 89 93 94 95 96 98 99} - -do_test where9-6.7.3 { - count_steps { - BEGIN; - UPDATE t1 NOT INDEXED SET a=a+100 - WHERE (b IS NULL AND c NOT NULL AND d NOT NULL) - OR (b NOT NULL AND c IS NULL AND d NOT NULL) - OR (b NOT NULL AND c NOT NULL AND d IS NULL) - } -} {scan 98 sort 0} ;# Add 100 to rowids 90 91 92 97 -do_test where9-6.7.4 { - db eval { - SELECT count(*) FROM t1 UNION ALL - SELECT a FROM t1 WHERE a BETWEEN 85 AND 200; - ROLLBACK; - } -} {99 85 86 87 88 89 93 94 95 96 98 99 190 191 192 197} - -do_test where9-6.8.1 { - catchsql { - DELETE FROM t1 INDEXED BY t1b - WHERE (b IS NULL AND c NOT NULL AND d NOT NULL) - OR (b NOT NULL AND c IS NULL AND d NOT NULL) - OR (b NOT NULL AND c NOT NULL AND d IS NULL) - } -} {1 {cannot use index: t1b}} -do_test where9-6.8.2 { - catchsql { - UPDATE t1 INDEXED BY t1b SET a=a+100 - WHERE (b IS NULL AND c NOT NULL AND d NOT NULL) - OR (b NOT NULL AND c IS NULL AND d NOT NULL) - OR (b NOT NULL AND c NOT NULL AND d IS NULL) - } -} {1 {cannot use index: t1b}} - -finish_test Index: tool/genfkey.README ================================================================== --- tool/genfkey.README +++ tool/genfkey.README @@ -97,15 +97,10 @@ The only dependency is sqlite itself. Using gcc and the sqlite amalgamation source code, it may be compiled using the following command: gcc genfkey.c sqlite3.c -o genfkey - Or, to use an installed version of sqlite (the kind linux distributions - install as part of the sqlite3-dev package): - - gcc genfkey.c -lsqlite3 -o genfkey - If compiled/linked against an SQLite version earlier than 3.6.4, then all foreign key constraints are assumed to be "ON UPDATE RESTRICT" and "ON DELETE RESTRICT". If linked against 3.6.4 or newer, "CASCADE" and "SET NULL" are supported as well as "RESTRICT". All 3.x versions of SQLite may use the created triggers definitions. Index: tool/lemon.c ================================================================== --- tool/lemon.c +++ tool/lemon.c @@ -269,11 +269,10 @@ char *tokenprefix; /* A prefix added to token names in the .h file */ int nconflict; /* Number of parsing conflicts */ int tablesize; /* Size of the parse tables */ int basisflag; /* Print only basis configurations */ int has_fallback; /* True if any %fallback is seen in the grammar */ - int nolinenosflag; /* True if #line statements should not be printed */ char *argv0; /* Name of the program */ }; #define MemoryCheck(X) if((X)==0){ \ extern void memory_error(); \ @@ -1400,18 +1399,16 @@ static int basisflag = 0; static int compress = 0; static int quiet = 0; static int statistics = 0; static int mhflag = 0; - static int nolinenosflag = 0; static struct s_options options[] = { {OPT_FLAG, "b", (char*)&basisflag, "Print only the basis in report."}, {OPT_FLAG, "c", (char*)&compress, "Don't compress the action table."}, {OPT_FSTR, "D", (char*)handle_D_option, "Define an %ifdef macro."}, {OPT_FLAG, "g", (char*)&rpflag, "Print grammar without actions."}, - {OPT_FLAG, "m", (char*)&mhflag, "Output a makeheaders compatible file."}, - {OPT_FLAG, "l", (char*)&nolinenosflag, "Do not print #line statements."}, + {OPT_FLAG, "m", (char*)&mhflag, "Output a makeheaders compatible file"}, {OPT_FLAG, "q", (char*)&quiet, "(Quiet) Don't print the report file."}, {OPT_FLAG, "s", (char*)&statistics, "Print parser stats to standard output."}, {OPT_FLAG, "x", (char*)&version, "Print the version number."}, {OPT_FLAG,0,0,0} @@ -1436,11 +1433,10 @@ Symbol_init(); State_init(); lem.argv0 = argv[0]; lem.filename = OptArg(0); lem.basisflag = basisflag; - lem.nolinenosflag = nolinenosflag; Symbol_new("$"); lem.errsym = Symbol_new("error"); lem.errsym->useCnt = 0; /* Parse the input file */ @@ -2342,11 +2338,11 @@ }else{ zOld = ""; } nOld = lemonStrlen(zOld); n = nOld + nNew + 20; - addLineMacro = !psp->gp->nolinenosflag && psp->insertLineMacro && + addLineMacro = psp->insertLineMacro && (psp->decllinenoslot==0 || psp->decllinenoslot[0]!=0); if( addLineMacro ){ for(z=psp->filename, nBack=0; *z; z++){ if( *z=='\\' ) nBack++; } @@ -3121,22 +3117,22 @@ struct lemon *lemp; char *str; int *lineno; { if( str==0 ) return; + (*lineno)++; while( *str ){ - putc(*str,out); if( *str=='\n' ) (*lineno)++; + putc(*str,out); str++; } if( str[-1]!='\n' ){ putc('\n',out); (*lineno)++; } - if (!lemp->nolinenosflag) { - (*lineno)++; tplt_linedir(out,*lineno,lemp->outname); - } + tplt_linedir(out,*lineno+2,lemp->outname); + (*lineno)+=2; return; } /* ** The following routine emits code for the destructor for the @@ -3148,18 +3144,19 @@ struct lemon *lemp; int *lineno; { char *cp = 0; + int linecnt = 0; if( sp->type==TERMINAL ){ cp = lemp->tokendest; if( cp==0 ) return; fprintf(out,"{\n"); (*lineno)++; }else if( sp->destructor ){ cp = sp->destructor; fprintf(out,"{\n"); (*lineno)++; - if (!lemp->nolinenosflag) { (*lineno)++; tplt_linedir(out,sp->destLineno,lemp->filename); } + tplt_linedir(out,sp->destLineno,lemp->filename); (*lineno)++; }else if( lemp->vardest ){ cp = lemp->vardest; if( cp==0 ) return; fprintf(out,"{\n"); (*lineno)++; }else{ @@ -3169,18 +3166,17 @@ if( *cp=='$' && cp[1]=='$' ){ fprintf(out,"(yypminor->yy%d)",sp->dtnum); cp++; continue; } - if( *cp=='\n' ) (*lineno)++; + if( *cp=='\n' ) linecnt++; fputc(*cp,out); } - fprintf(out,"\n"); (*lineno)++; - if (!lemp->nolinenosflag) { - (*lineno)++; tplt_linedir(out,*lineno,lemp->outname); - } - fprintf(out,"}\n"); (*lineno)++; + (*lineno) += 3 + linecnt; + fprintf(out,"\n"); + tplt_linedir(out,*lineno,lemp->outname); + fprintf(out,"}\n"); return; } /* ** Return TRUE (non-zero) if the given symbol has a destructor. @@ -3348,20 +3344,22 @@ struct rule *rp; struct lemon *lemp; int *lineno; { char *cp; + int linecnt = 0; /* Generate code to do the reduce action */ if( rp->code ){ - if (!lemp->nolinenosflag) { (*lineno)++; tplt_linedir(out,rp->line,lemp->filename); } + tplt_linedir(out,rp->line,lemp->filename); fprintf(out,"{%s",rp->code); for(cp=rp->code; *cp; cp++){ - if( *cp=='\n' ) (*lineno)++; + if( *cp=='\n' ) linecnt++; } /* End loop */ - fprintf(out,"}\n"); (*lineno)++; - if (!lemp->nolinenosflag) { (*lineno)++; tplt_linedir(out,*lineno,lemp->outname); } + (*lineno) += 3 + linecnt; + fprintf(out,"}\n"); + tplt_linedir(out,*lineno,lemp->outname); } /* End if( rp->code ) */ return; } @@ -3466,11 +3464,10 @@ if( mhflag ){ fprintf(out,"#if INTERFACE\n"); lineno++; } fprintf(out,"#define %sTOKENTYPE %s\n",name, lemp->tokentype?lemp->tokentype:"void*"); lineno++; if( mhflag ){ fprintf(out,"#endif\n"); lineno++; } fprintf(out,"typedef union {\n"); lineno++; - fprintf(out," int yyinit;\n"); lineno++; fprintf(out," %sTOKENTYPE yy0;\n",name); lineno++; for(i=0; iyyidx = -1; #ifdef YYTRACKMAXSTACKDEPTH pParser->yyidxMax = 0; #endif #if YYSTACKDEPTH<=0 - pParser->yystack = NULL; - pParser->yystksz = 0; yyGrowStack(pParser); #endif } return pParser; } @@ -380,11 +381,11 @@ assert( iLookAhead!=YYNOCODE ); i += iLookAhead; if( i<0 || i>=YY_SZ_ACTTAB || yy_lookahead[i]!=iLookAhead ){ if( iLookAhead>0 ){ #ifdef YYFALLBACK - YYCODETYPE iFallback; /* Fallback token */ + int iFallback; /* Fallback token */ if( iLookAhead %s\n", @@ -497,12 +498,12 @@ return; } } #endif yytos = &yypParser->yystack[yypParser->yyidx]; - yytos->stateno = (YYACTIONTYPE)yyNewState; - yytos->major = (YYCODETYPE)yyMajor; + yytos->stateno = yyNewState; + yytos->major = yyMajor; yytos->minor = *yypMinor; #ifndef NDEBUG if( yyTraceFILE && yypParser->yyidx>0 ){ int i; fprintf(yyTraceFILE,"%sShift %d\n",yyTracePrompt,yyNewState); @@ -579,22 +580,22 @@ %% }; yygoto = yyRuleInfo[yyruleno].lhs; yysize = yyRuleInfo[yyruleno].nrhs; yypParser->yyidx -= yysize; - yyact = yy_find_reduce_action(yymsp[-yysize].stateno,(YYCODETYPE)yygoto); + yyact = yy_find_reduce_action(yymsp[-yysize].stateno,yygoto); if( yyact < YYNSTATE ){ #ifdef NDEBUG /* If we are not debugging and the reduce action popped at least ** one element off the stack, then we can push the new element back ** onto the stack here, and skip the stack overflow test in yy_shift(). ** That gives a significant speed improvement. */ if( yysize ){ yypParser->yyidx++; yymsp -= yysize-1; - yymsp->stateno = (YYACTIONTYPE)yyact; - yymsp->major = (YYCODETYPE)yygoto; + yymsp->stateno = yyact; + yymsp->major = yygoto; yymsp->minor = yygotominor; }else #endif { yy_shift(yypParser,yyact,yygoto,&yygotominor); @@ -715,11 +716,11 @@ fprintf(yyTraceFILE,"%sInput %s\n",yyTracePrompt,yyTokenName[yymajor]); } #endif do{ - yyact = yy_find_shift_action(yypParser,(YYCODETYPE)yymajor); + yyact = yy_find_shift_action(yypParser,yymajor); if( yyactyyerrcnt--; yymajor = YYNOCODE; @@ -764,11 +765,11 @@ if( yyTraceFILE ){ fprintf(yyTraceFILE,"%sDiscard input token %s\n", yyTracePrompt,yyTokenName[yymajor]); } #endif - yy_destructor(yypParser, (YYCODETYPE)yymajor,&yyminorunion); + yy_destructor(yypParser, yymajor,&yyminorunion); yymajor = YYNOCODE; }else{ while( yypParser->yyidx >= 0 && yymx != YYERRORSYMBOL && @@ -777,11 +778,11 @@ YYERRORSYMBOL)) >= YYNSTATE ){ yy_pop_parser_stack(yypParser); } if( yypParser->yyidx < 0 || yymajor==0 ){ - yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); + yy_destructor(yypParser,yymajor,&yyminorunion); yy_parse_failed(yypParser); yymajor = YYNOCODE; }else if( yymx!=YYERRORSYMBOL ){ YYMINORTYPE u2; u2.YYERRSYMDT = 0; @@ -802,15 +803,15 @@ */ if( yypParser->yyerrcnt<=0 ){ yy_syntax_error(yypParser,yymajor,yyminorunion); } yypParser->yyerrcnt = 3; - yy_destructor(yypParser,(YYCODETYPE)yymajor,&yyminorunion); + yy_destructor(yypParser,yymajor,&yyminorunion); if( yyendofinput ){ yy_parse_failed(yypParser); } yymajor = YYNOCODE; #endif } }while( yymajor!=YYNOCODE && yypParser->yyidx>=0 ); return; } ADDED tool/memleak.awk Index: tool/memleak.awk ================================================================== --- /dev/null +++ tool/memleak.awk @@ -0,0 +1,29 @@ +# +# This script looks for memory leaks by analyzing the output of "sqlite" +# when compiled with the SQLITE_DEBUG=2 option. +# +/[0-9]+ malloc / { + mem[$6] = $0 +} +/[0-9]+ realloc / { + mem[$8] = ""; + mem[$10] = $0 +} +/[0-9]+ free / { + if (mem[$6]=="") { + print "*** free without a malloc at",$6 + } + mem[$6] = ""; + str[$6] = "" +} +/^string at / { + addr = $4 + sub("string at " addr " is ","") + str[addr] = $0 +} +END { + for(addr in mem){ + if( mem[addr]=="" ) continue + print mem[addr], str[addr] + } +} ADDED tool/memleak2.awk Index: tool/memleak2.awk ================================================================== --- /dev/null +++ tool/memleak2.awk @@ -0,0 +1,29 @@ +# This AWK script reads the output of testfixture when compiled for memory +# debugging. It generates SQL commands that can be fed into an sqlite +# instance to determine what memory is never freed. A typical usage would +# be as follows: +# +# make -f memleak.mk fulltest 2>mem.out +# awk -f ../sqlite/tool/memleak2.awk mem.out | ./sqlite :memory: +# +# The job performed by this script is the same as that done by memleak.awk. +# The difference is that this script uses much less memory when the size +# of the mem.out file is huge. +# +BEGIN { + print "CREATE TABLE mem(loc INTEGER PRIMARY KEY, src);" +} +/[0-9]+ malloc / { + print "INSERT INTO mem VALUES(" strtonum($6) ",'" $0 "');" +} +/[0-9]+ realloc / { + print "INSERT INTO mem VALUES(" strtonum($10) \ + ",(SELECT src FROM mem WHERE loc=" strtonum($8) "));" + print "DELETE FROM mem WHERE loc=" strtonum($8) ";" +} +/[0-9]+ free / { + print "DELETE FROM mem WHERE loc=" strtonum($6) ";" +} +END { + print "SELECT src FROM mem;" +} ADDED tool/memleak3.tcl Index: tool/memleak3.tcl ================================================================== --- /dev/null +++ tool/memleak3.tcl @@ -0,0 +1,233 @@ +#/bin/sh +# \ +exec `which tclsh` $0 "$@" +# +# The author disclaims copyright to this source code. In place of +# a legal notice, here is a blessing: +# +# May you do good and not evil. +# May you find forgiveness for yourself and forgive others. +# May you share freely, never taking more than you give. +###################################################################### + +set doco " +This script is a tool to help track down memory leaks in the sqlite +library. The library must be compiled with the preprocessor symbol +SQLITE_MEMDEBUG set to at least 2. It must be set to 3 to enable stack +traces. + +To use, run the leaky application and save the standard error output. +Then, execute this program with the first argument the name of the +application binary (or interpreter) and the second argument the name of the +text file that contains the collected stderr output. + +If all goes well a summary of unfreed allocations is printed out. If the +GNU C library is in use and SQLITE_DEBUG is 3 or greater a stack trace is +printed out for each unmatched allocation. + +If the \"-r \" option is passed, then the program stops and prints out +the state of the heap immediately after the th call to malloc() or +realloc(). + +Example: + +$ ./testfixture ../sqlite/test/select1.test 2> memtrace.out +$ tclsh $argv0 ?-r ? ./testfixture memtrace.out +" + + +proc usage {} { + set prg [file tail $::argv0] + puts "Usage: $prg ?-r ? " + puts "" + puts [string trim $::doco] + exit -1 +} + +proc shift {listvar} { + upvar $listvar l + set ret [lindex $l 0] + set l [lrange $l 1 end] + return $ret +} + +# Argument handling. The following vars are set: +# +# $exe - the name of the executable (i.e. "testfixture" or "./sqlite3") +# $memfile - the name of the file containing the trace output. +# $report_at - The malloc number to stop and report at. Or -1 to read +# all of $memfile. +# +set report_at -1 +while {[llength $argv]>2} { + set arg [shift argv] + switch -- $arg { + "-r" { + set report_at [shift argv] + } + default { + usage + } + } +} +if {[llength $argv]!=2} usage +set exe [lindex $argv 0] +set memfile [lindex $argv 1] + +# If stack traces are enabled, the 'addr2line' program is called to +# translate a binary stack address into a human-readable form. +set addr2line addr2line + +# When the SQLITE_MEMDEBUG is set as described above, SQLite prints +# out a line for each malloc(), realloc() or free() call that the +# library makes. If SQLITE_MEMDEBUG is 3, then a stack trace is printed +# out before each malloc() and realloc() line. +# +# This program parses each line the SQLite library outputs and updates +# the following global Tcl variables to reflect the "current" state of +# the heap used by SQLite. +# +set nBytes 0 ;# Total number of bytes currently allocated. +set nMalloc 0 ;# Total number of malloc()/realloc() calls. +set nPeak 0 ;# Peak of nBytes. +set iPeak 0 ;# nMalloc when nPeak was set. +# +# More detailed state information is stored in the $memmap array. +# Each key in the memmap array is the address of a chunk of memory +# currently allocated from the heap. The value is a list of the +# following form +# +# { } +# +array unset memmap + +proc process_input {input_file array_name} { + upvar $array_name mem + set input [open $input_file] + + set MALLOC {([[:digit:]]+) malloc ([[:digit:]]+) bytes at 0x([[:xdigit:]]+)} + # set STACK {^[[:digit:]]+: STACK: (.*)$} + set STACK {^STACK: (.*)$} + set FREE {[[:digit:]]+ free ([[:digit:]]+) bytes at 0x([[:xdigit:]]+)} + set REALLOC {([[:digit:]]+) realloc ([[:digit:]]+) to ([[:digit:]]+)} + append REALLOC { bytes at 0x([[:xdigit:]]+) to 0x([[:xdigit:]]+)} + + set stack "" + while { ![eof $input] } { + set line [gets $input] + if {[regexp $STACK $line dummy stack]} { + # Do nothing. The variable $stack now stores the hexadecimal stack dump + # for the next malloc() or realloc(). + + } elseif { [regexp $MALLOC $line dummy mallocid bytes addr] } { + # If this is a 'malloc' line, set an entry in the mem array. Each entry + # is a list of length three, the number of bytes allocated , the malloc + # number and the stack dump when it was allocated. + set mem($addr) [list $bytes "malloc $mallocid" $stack] + set stack "" + + # Increase the current heap usage + incr ::nBytes $bytes + + # Increase the number of malloc() calls + incr ::nMalloc + + if {$::nBytes > $::nPeak} { + set ::nPeak $::nBytes + set ::iPeak $::nMalloc + } + + } elseif { [regexp $FREE $line dummy bytes addr] } { + # If this is a 'free' line, remove the entry from the mem array. If the + # entry does not exist, or is the wrong number of bytes, announce a + # problem. This is more likely a bug in the regular expressions for + # this script than an SQLite defect. + if { [lindex $mem($addr) 0] != $bytes } { + error "byte count mismatch" + } + unset mem($addr) + + # Decrease the current heap usage + incr ::nBytes [expr -1 * $bytes] + + } elseif { [regexp $REALLOC $line dummy mallocid ob b oa a] } { + # "free" the old allocation in the internal model: + incr ::nBytes [expr -1 * $ob] + unset mem($oa); + + # "malloc" the new allocation + set mem($a) [list $b "realloc $mallocid" $stack] + incr ::nBytes $b + set stack "" + + # Increase the number of malloc() calls + incr ::nMalloc + + if {$::nBytes > $::nPeak} { + set ::nPeak $::nBytes + set ::iPeak $::nMalloc + } + + } else { + # puts "REJECT: $line" + } + + if {$::nMalloc==$::report_at} report + } + + close $input +} + +proc printstack {stack} { + set fcount 10 + if {[llength $stack]<10} { + set fcount [llength $stack] + } + foreach frame [lrange $stack 1 $fcount] { + foreach {f l} [split [exec $::addr2line -f --exe=$::exe $frame] \n] {} + puts [format "%-30s %s" $f $l] + } + if {[llength $stack]>0 } {puts ""} +} + +proc report {} { + + foreach key [array names ::memmap] { + set stack [lindex $::memmap($key) 2] + set bytes [lindex $::memmap($key) 0] + lappend summarymap($stack) $bytes + } + + set sorted [list] + foreach stack [array names summarymap] { + set allocs $summarymap($stack) + set sum 0 + foreach a $allocs { + incr sum $a + } + lappend sorted [list $sum $stack] + } + + set sorted [lsort -integer -index 0 $sorted] + foreach s $sorted { + set sum [lindex $s 0] + set stack [lindex $s 1] + set allocs $summarymap($stack) + puts "$sum bytes in [llength $allocs] chunks ($allocs)" + printstack $stack + } + + # Print out summary statistics + puts "Total allocations : $::nMalloc" + puts "Total outstanding allocations: [array size ::memmap]" + puts "Current heap usage : $::nBytes bytes" + puts "Peak heap usage : $::nPeak bytes (malloc #$::iPeak)" + + exit +} + +process_input $memfile memmap +report + + + Index: tool/mkkeywordhash.c ================================================================== --- tool/mkkeywordhash.c +++ tool/mkkeywordhash.c @@ -13,11 +13,11 @@ static const char zHdr[] = "/***** This file contains automatically generated code ******\n" "**\n" "** The code in this file has been automatically generated by\n" "**\n" - "** $Header: /sqlite/sqlite/tool/mkkeywordhash.c,v 1.37 2009/02/01 00:00:46 drh Exp $\n" + "** $Header: /sqlite/sqlite/tool/mkkeywordhash.c,v 1.32 2008/10/06 05:32:19 danielk1977 Exp $\n" "**\n" "** The code in this file implements a function that determines whether\n" "** or not a given identifier is really an SQL keyword. The same thing\n" "** might be implemented more directly using a hand-written hash table.\n" "** But by using this automatically generated code, the size of the code\n" @@ -25,11 +25,11 @@ "** on platforms with limited memory.\n" "*/\n" ; /* -** All the keywords of the SQL language are stored in a hash +** All the keywords of the SQL language are stored as in a hash ** table composed of instances of the following structure. */ typedef struct Keyword Keyword; struct Keyword { char *zName; /* The keyword name */ @@ -231,25 +231,23 @@ { "QUERY", "TK_QUERY", EXPLAIN }, { "RAISE", "TK_RAISE", TRIGGER }, { "REFERENCES", "TK_REFERENCES", FKEY }, { "REGEXP", "TK_LIKE_KW", ALWAYS }, { "REINDEX", "TK_REINDEX", REINDEX }, - { "RELEASE", "TK_RELEASE", ALWAYS }, { "RENAME", "TK_RENAME", ALTER }, { "REPLACE", "TK_REPLACE", CONFLICT }, { "RESTRICT", "TK_RESTRICT", FKEY }, { "RIGHT", "TK_JOIN_KW", ALWAYS }, { "ROLLBACK", "TK_ROLLBACK", ALWAYS }, { "ROW", "TK_ROW", TRIGGER }, - { "SAVEPOINT", "TK_SAVEPOINT", ALWAYS }, { "SELECT", "TK_SELECT", ALWAYS }, { "SET", "TK_SET", ALWAYS }, { "TABLE", "TK_TABLE", ALWAYS }, { "TEMP", "TK_TEMP", ALWAYS }, { "TEMPORARY", "TK_TEMP", ALWAYS }, { "THEN", "TK_THEN", ALWAYS }, - { "TO", "TK_TO", ALWAYS }, + { "TO", "TK_TO", ALTER }, { "TRANSACTION", "TK_TRANSACTION", ALWAYS }, { "TRIGGER", "TK_TRIGGER", TRIGGER }, { "UNION", "TK_UNION", COMPOUND }, { "UNIQUE", "TK_UNIQUE", ALWAYS }, { "UPDATE", "TK_UPDATE", ALWAYS }, @@ -335,11 +333,10 @@ int bestSize, bestCount; int count; int nChar; int totalLen = 0; int aHash[1000]; /* 1000 is much bigger than nKeyword */ - char zText[2000]; /* Remove entries from the list of keywords that have mask==0 */ for(i=j=0; isubstrId ) continue; - memcpy(&zText[k], p->zName, p->len); - k += p->len; - if( j+p->len>70 ){ - printf("%*s */\n", 74-j, ""); - j = 0; - } - if( j==0 ){ - printf(" /* "); - j = 8; - } - printf("%s", p->zName); - j += p->len; - } - if( j>0 ){ - printf("%*s */\n", 74-j, ""); - } - printf(" static const char zText[%d] = {\n", nChar); - zText[nChar] = 0; - for(i=j=0; i68 ){ - printf("\n"); - j = 0; - } - } - if( j>0 ) printf("\n"); - printf(" };\n"); + + printf(" static const char zText[%d] =\n", nChar+1); + for(i=j=0; isubstrId ) continue; + if( j==0 ) printf(" \""); + printf("%s", p->zName); + j += p->len; + if( j>60 ){ + printf("\"\n"); + j = 0; + } + } + printf("%s;\n", j>0 ? "\"" : " "); printf(" static const unsigned char aHash[%d] = {\n", bestSize); for(i=j=0; i=0; i=((int)aNext[i])-1){\n"); printf(" if( aLen[i]==n &&" " sqlite3StrNICmp(&zText[aOffset[i]],z,n)==0 ){\n"); - for(i=0; i "one hundred twenty three" -# -set ones {zero one two three four five six seven eight nine - ten eleven twelve thirteen fourteen fifteen sixteen seventeen - eighteen nineteen} -set tens {{} ten twenty thirty forty fifty sixty seventy eighty ninety} -proc number_name {n} { - if {$n>=1000} { - set txt "[number_name [expr {$n/1000}]] thousand" - set n [expr {$n%1000}] - } else { - set txt {} - } - if {$n>=100} { - append txt " [lindex $::ones [expr {$n/100}]] hundred" - set n [expr {$n%100}] - } - if {$n>=20} { - append txt " [lindex $::tens [expr {$n/10}]]" - set n [expr {$n%10}] - } - if {$n>0} { - append txt " [lindex $::ones $n]" - } - set txt [string trim $txt] - if {$txt==""} {set txt zero} - return $txt -} - -# Create a database schema. -# -puts { - PRAGMA page_size=1024; - PRAGMA cache_size=8192; - PRAGMA locking_mode=EXCLUSIVE; - CREATE TABLE t1(a INTEGER, b INTEGER, c TEXT); - CREATE TABLE t2(a INTEGER, b INTEGER, c TEXT); - CREATE INDEX i2a ON t2(a); - CREATE INDEX i2b ON t2(b); - SELECT name FROM sqlite_master ORDER BY 1; -} - - -# 50000 INSERTs on an unindexed table -# -set t1c_list {} -puts {BEGIN;} -for {set i 1} {$i<=50000} {incr i} { - set r [expr {int(rand()*500000)}] - set x [number_name $r] - lappend t1c_list $x - puts "INSERT INTO t1 VALUES($i,$r,'$x');" -} -puts {COMMIT;} - -# 50000 INSERTs on an indexed table -# -puts {BEGIN;} -for {set i 1} {$i<=50000} {incr i} { - set r [expr {int(rand()*500000)}] - puts "INSERT INTO t2 VALUES($i,$r,'[number_name $r]');" -} -puts {COMMIT;} - - -# 50 SELECTs on an integer comparison. There is no index so -# a full table scan is required. -# -for {set i 0} {$i<50} {incr i} { - set lwr [expr {$i*100}] - set upr [expr {($i+10)*100}] - puts "SELECT count(*), avg(b) FROM t1 WHERE b>=$lwr AND b<$upr;" -} - -# 50 SELECTs on an LIKE comparison. There is no index so a full -# table scan is required. -# -for {set i 0} {$i<50} {incr i} { - puts "SELECT count(*), avg(b) FROM t1 WHERE c LIKE '%[number_name $i]%';" -} - -# Create indices -# -puts {BEGIN;} -puts { - CREATE INDEX i1a ON t1(a); - CREATE INDEX i1b ON t1(b); - CREATE INDEX i1c ON t1(c); -} -puts {COMMIT;} - -# 5000 SELECTs on an integer comparison where the integer is -# indexed. -# -set sql {} -for {set i 0} {$i<5000} {incr i} { - set lwr [expr {$i*100}] - set upr [expr {($i+10)*100}] - puts "SELECT count(*), avg(b) FROM t1 WHERE b>=$lwr AND b<$upr;" -} - -# 100000 random SELECTs against rowid. -# -for {set i 1} {$i<=100000} {incr i} { - set id [expr {int(rand()*50000)+1}] - puts "SELECT c FROM t1 WHERE rowid=$id;" -} - -# 100000 random SELECTs against a unique indexed column. -# -for {set i 1} {$i<=100000} {incr i} { - set id [expr {int(rand()*50000)+1}] - puts "SELECT c FROM t1 WHERE a=$id;" -} - -# 50000 random SELECTs against an indexed column text column -# -set nt1c [llength $t1c_list] -for {set i 0} {$i<50000} {incr i} { - set r [expr {int(rand()*$nt1c)}] - set c [lindex $t1c_list $i] - puts "SELECT c FROM t1 WHERE c='$c';" -} - - -# Vacuum -puts {VACUUM;} - -# 5000 updates of ranges where the field being compared is indexed. -# -puts {BEGIN;} -for {set i 0} {$i<5000} {incr i} { - set lwr [expr {$i*2}] - set upr [expr {($i+1)*2}] - puts "UPDATE t1 SET b=b*2 WHERE a>=$lwr AND a<$upr;" -} -puts {COMMIT;} - -# 50000 single-row updates. An index is used to find the row quickly. -# -puts {BEGIN;} -for {set i 0} {$i<50000} {incr i} { - set r [expr {int(rand()*500000)}] - puts "UPDATE t1 SET b=$r WHERE a=$i;" -} -puts {COMMIT;} - -# 1 big text update that touches every row in the table. -# -puts { - UPDATE t1 SET c=a; -} - -# Many individual text updates. Each row in the table is -# touched through an index. -# -puts {BEGIN;} -for {set i 1} {$i<=50000} {incr i} { - set r [expr {int(rand()*500000)}] - puts "UPDATE t1 SET c='[number_name $r]' WHERE a=$i;" -} -puts {COMMIT;} - -# Delete all content in a table. -# -puts {DELETE FROM t1;} - -# Copy one table into another -# -puts {INSERT INTO t1 SELECT * FROM t2;} - -# Delete all content in a table, one row at a time. -# -puts {DELETE FROM t1 WHERE 1;} - -# Refill the table yet again -# -puts {INSERT INTO t1 SELECT * FROM t2;} - -# Drop the table and recreate it without its indices. -# -puts {BEGIN;} -puts { - DROP TABLE t1; - CREATE TABLE t1(a INTEGER, b INTEGER, c TEXT); -} -puts {COMMIT;} - -# Refill the table yet again. This copy should be faster because -# there are no indices to deal with. -# -puts {INSERT INTO t1 SELECT * FROM t2;} - -# Select 20000 rows from the table at random. -# -puts { - SELECT rowid FROM t1 ORDER BY random() LIMIT 20000; -} - -# Delete 20000 random rows from the table. -# -puts { - DELETE FROM t1 WHERE rowid IN - (SELECT rowid FROM t1 ORDER BY random() LIMIT 20000); -} -puts {SELECT count(*) FROM t1;} - -# Delete 20000 more rows at random from the table. -# -puts { - DELETE FROM t1 WHERE rowid IN - (SELECT rowid FROM t1 ORDER BY random() LIMIT 20000); -} -puts {SELECT count(*) FROM t1;} Index: tool/mksqlite3c.tcl ================================================================== --- tool/mksqlite3c.tcl +++ tool/mksqlite3c.tcl @@ -87,11 +87,10 @@ # foreach hdr { btree.h btreeInt.h fts3.h - fts3_expr.h fts3_hash.h fts3_tokenizer.h hash.h hwtime.h keywordhash.h @@ -179,21 +178,16 @@ # definitions for internal use if {![regexp {^sqlite3_} $varname]} { regsub {^extern } $line {} line puts $out "SQLITE_PRIVATE $line" } else { - if {[regexp {const char sqlite3_version\[\];} $line]} { - set line {const char sqlite3_version[] = SQLITE_VERSION;} - } regsub {^SQLITE_EXTERN } $line {} line puts $out "SQLITE_API $line" } } elseif {[regexp {^(SQLITE_EXTERN )?void \(\*sqlite3IoTrace\)} $line]} { regsub {^SQLITE_EXTERN } $line {} line puts $out "SQLITE_PRIVATE $line" - } elseif {[regexp {^void \(\*sqlite3Os} $line]} { - puts $out "SQLITE_PRIVATE $line" } else { puts $out $line } } else { puts $out $line @@ -215,15 +209,15 @@ status.c date.c os.c fault.c - mem0.c mem1.c mem2.c mem3.c mem5.c + mem6.c mutex.c mutex_noop.c mutex_os2.c mutex_unix.c mutex_w32.c @@ -239,25 +233,22 @@ os_unix.c os_win.c bitvec.c pcache.c - pcache1.c - rowset.c pager.c btmutex.c btree.c - backup.c + vdbefifo.c vdbemem.c vdbeaux.c vdbeapi.c vdbe.c vdbeblob.c journal.c - memjournal.c walker.c resolve.c expr.c alter.c @@ -287,11 +278,10 @@ complete.c main.c fts3.c - fts3_expr.c fts3_hash.c fts3_porter.c fts3_tokenizer.c fts3_tokenizer1.c ADDED tool/report1.txt Index: tool/report1.txt ================================================================== --- /dev/null +++ tool/report1.txt @@ -0,0 +1,66 @@ +The SQL database used for ACD contains 113 tables and indices implemented +in GDBM. The following are statistics on the sizes of keys and data +within these tables and indices. + +Entries: 962080 +Size: 45573853 +Avg Size: 48 +Key Size: 11045299 +Avg Key Size: 12 +Max Key Size: 99 + + + Size of key Cummulative + and data Instances Percentage +------------ ---------- ----------- + 0..8 266 0% + 9..12 5485 0% + 13..16 73633 8% + 17..24 180918 27% + 25..32 209823 48% + 33..40 148995 64% + 41..48 76304 72% + 49..56 14346 73% + 57..64 15725 75% + 65..80 44916 80% + 81..96 127815 93% + 97..112 34769 96% + 113..128 13314 98% + 129..144 8098 99% + 145..160 3355 99% + 161..176 1159 99% + 177..192 629 99% + 193..208 221 99% + 209..224 210 99% + 225..240 129 99% + 241..256 57 99% + 257..288 496 99% + 289..320 60 99% + 321..352 37 99% + 353..384 46 99% + 385..416 22 99% + 417..448 24 99% + 449..480 26 99% + 481..512 27 99% + 513..1024 471 99% + 1025..2048 389 99% + 2049..4096 182 99% + 4097..8192 74 99% + 8193..16384 34 99% +16385..32768 17 99% +32769..65536 5 99% +65537..131073 3 100% + + +This information is gathered to help design the new built-in +backend for sqlite 2.0. Note in particular that 99% of all +database entries have a combined key and data size of less than +144 bytes. So if a leaf node in the new database is able to +store 144 bytes of combined key and data, only 1% of the leaves +will require overflow pages. Furthermore, note that no key +is larger than 99 bytes, so if the key will never be on an +overflow page. + +The average combined size of key+data is 48. Add in 16 bytes of +overhead for a total of 64. That means that a 1K page will +store (on average) about 16 entries.